cros-codecs icon indicating copy to clipboard operation
cros-codecs copied to clipboard

h264: we should check first_mb_in_slice when decoding

Open dwlsalmeida opened this issue 2 years ago • 2 comments

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.

dwlsalmeida avatar Jul 11 '23 12:07 dwlsalmeida

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.

dwlsalmeida avatar Jul 11 '23 12:07 dwlsalmeida

Reopening to address the comments right above.

Gnurou avatar Jul 22 '23 07:07 Gnurou