cros-codecs
cros-codecs copied to clipboard
h264: we should check first_mb_in_slice when decoding
From the specification:
first_mb_in_slice specifies the address of the first macroblock in the slice
If first_mb_in_slice == 0 this means that we have identified that the slice belongs to a new picture.
This should be one of the conditions checked here
This is not a problem when testing with fluster because we check for this when using H264FrameIterator, but clients are free to submit data as they see fit.
It would be great if we could assert! or debug_assert! these two conditions:
–If separate_colour_plane_flag is equal to 0, the value of first_mb_in_slice shall not be less than the value of
first_mb_in_slice for any other slice of the current picture that precedes the current slice in decoding order.
–Otherwise (separate_colour_plane_flag is equal to 1), the value of first_mb_in_slice shall not be less than the value
of first_mb_in_slice for any other slice of the current picture that precedes the current slice in decoding order and has
the same value of colour_plane_id.
Reopening to address the comments right above.