feat: add opt-in h264 image storage#2504
Draft
TomCC7 wants to merge 3 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## cc/mem2-image-encode #2504 +/- ##
========================================================
+ Coverage 69.77% 69.89% +0.12%
========================================================
Files 844 844
Lines 74758 75027 +269
Branches 6730 6739 +9
========================================================
+ Hits 52164 52442 +278
+ Misses 20875 20858 -17
- Partials 1719 1727 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This patch updates the existing H.264 image PR so
Imageis not overloaded with encoded-video semantics.Imagenow remains a decoded, pixel-addressable raster type:Image.datais always a NumPy array. H.264 bytes are used only as a transport/storage representation, matching the way the repo already treats JPEG: modules keep usingIn[Image]/Out[Image], while codecs encode/decode behind the transport or storage boundary.What changed
Restored raw-only
Imagesemantics.encoding,codec_metadata,require_raw(), andImage.encoded(...)..dataaccess.Kept H.264 transport as an end-to-end wire codec.
Image -> Image.H264LcmTransportencodesImageto H.264 packet bytes on publish and decodes back toImagebefore subscribers receive it.Image.Added opt-in H.264 storage for logical
Imagestreams.store.stream(name, Image, codec="h264")RecorderConfig(stream_codecs={"color_image": "h264"})Imagestorage remains JPEG.Reused one shared H.264 implementation.
H264Encoder,H264Packet, andH264Decoderlogic.Updated demos/docs/tests for the split semantics.
Imagevalues.Why
The earlier version made
Image.datasometimes mean decoded pixels and sometimes mean encoded H.264 bytes. That made the type harder to reason about and forced unrelated image consumers to handle encoded-video cases.This patch follows the repo’s existing JPEG pattern instead: