mpeg5 / xeve

eXtra-fast Essential Video Encoder, MPEG-5 EVC (Essential Video Coding)
Other
166 stars 39 forks source link

rbsp_trailing_bits is missing stop bit #153

Closed bradh closed 1 week ago

bradh commented 1 week ago

ISO/IEC 23094-1:2020 Section 7.3.2.8 describes the rbsp_trailing_bits() structure.

It appears that this is not being implemented correctly in xeve (or handled in xevd).

There should always be between 1 and 8 bits written by this structure, where the first bit (the rbsp_stop_one_bit) is `, and the following bits are zero. The open-coded implementation in xeve writes between 0 and 7 bits, all zero. An example is shown for SPS writing at https://github.com/mpeg5/xeve/blob/7d69e5095855fd09f43257e1060c6335c383809c/src_base/xeve_eco.c#L210-L214

I am working on a PR for this. Note that this is a breaking change to the bitstream format, even if the consumer ignores the bits, because any time the body is byte aligned (e.g. an SEI message that is ASCII or UTF-8 text), the length is one byte greater.

mss-park commented 1 week ago

Thanks for checking issue. 'rbsp_stop_one_bit' has been removed in updated version of ISO/IEC 23094-1:2020/Amd 1:2023(https://www.iso.org/standard/85138.html). Please check it and let us know if there is any problems regarding this issue.

bradh commented 1 week ago

Indeed I has missed that - I thought the AMD 1 was just about Green Metadata, and didn't understand it was more general.