Emby Emby Emby Learn
  • Emby Home
  • Video
  • Audio
  • Media Files
    • Subtitles and captions
    • Photos and images
    • Metadata and discovery
    • Libraries and media collections
    • Playback and streaming
    • Media hardware acceleration
    • Displays and AV connections
    • Live TV and recording
  1. Emby Learn
  2. Video
  3. Video compression
  4. Lossless video compression
Search Results for

    Show / Hide Table of Contents

    Lossless Video Compression

    Lossless video compression reproduces the picture samples supplied to the encoder exactly.

    The samples 40, 42, 43, 43 can be stored in four 8-bit words, requiring 32 payload bits. They can also be stored as a starting sample plus differences:

    40; +2, +1, 0.

    Nothing has been rounded. Knowing the starting value, the decoder can reverse every addition and recover all four samples exactly.

    A complete small coding rule

    Give common differences short prefix codes:

    Difference Code
    0 0
    +1 10
    +2 110
    Anything else 111, followed by a signed 9-bit difference

    No complete prefix is the start of another. The decoder can distinguish the short codes and knows to read nine more bits after the escape prefix. Nine signed bits cover differences between arbitrary 8-bit sample values.

    For the four-sample example, store:

    starting sample 40     +2    +1   0
    00101000              110   10   0
    

    The payload is 8 + 3 + 2 + 1 = 14 bits, instead of 32. Real byte storage can add padding, and a real format must communicate length and coding rules. This is an original toy codec, not FFV1's entropy coding.

    Decode it:

    1. Read the first eight bits: 40.
    2. Read 110: add 2, giving 42.
    3. Read 10: add 1, giving 43.
    4. Read 0: add zero, giving 43.

    The values and their order are identical. That is lossless sample compression.

    A good predictor saves space without taking a risk

    A predictor tries to make differences small and statistically common. In the toy rule, zero needs only one bit. An unpredictable sequence uses the escape code more often and can become larger.

    The decoder still recovers the exact values because every difference is retained. A poor prediction hurts compression efficiency, not correctness. Real lossless codecs use more capable predictors and coding methods to exploit picture structure.

    FFV1 is a specified video format built for this kind of exact reconstruction. Some delivery codecs also have lossless modes, with their own format and decoder requirements.

    Place the guarantee around the encoder

    Imagine decoding an existing lossy film, resizing it, then losslessly encoding the result. The lossless decoder recovers the resized samples exactly. It does not recover the earlier camera samples, because the losses and resize happened before that codec received its input.

    This identifies a practical verification boundary: compare the samples immediately supplied to the lossless encoder with the samples restored by its decoder, in the same sample format and order.

    A file checksum answers a different question. Repackaging or changing tags can change file bytes while leaving decoded video identical. Conversely, an intact file can faithfully preserve an input that already contained damage.

    For an Emby preservation master, the exact sample representation can be retained separately from a smaller delivery version. The master supplies the stable input for future derivatives; the playback copy supplies the representation appropriate for its viewing route.

    See Also

    • Lossy Video Compression
    • How Video Compression Works
    • Intra-Frame Video Compression

    References

    • RFC 9043: FFV1 lossless video format
    • ITU-T H.264: Advanced video coding
    • ITU-T H.265: High efficiency video coding
    On this Page
    2026 © EMBY LLC. Please see our terms of use and privacy policy.
    Back to Top