The current code will check for enough surfaces during decode_access_unit
But again, aside from our own FrameIterator (which is used for ccdec), we are not in control of the order of NALUs passed in by users of the library. This can create a problem if we receive the following sequence:
I have just realized that we do not plan for the above scenario, so the first order of business is checking first_mb_in_slice==0 in order to detect that a slice refers to a new picture. Or better yet, we can reuse the logic from Chromium.
While not ideal, we can cope with identifying a new picture in decode_access_unit, but we must:
a) finish the current picture,
b) make sure that we have a surface to decode it to
Note that we already do a) if we notice a new field picture, but not a new frame. This also means moving the check of the current number of surfaces to begin_picture() so that we can have b)
Somewhat related to #33
The current code will check for enough surfaces during decode_access_unit
But again, aside from our own FrameIterator (which is used for ccdec), we are not in control of the order of NALUs passed in by users of the library. This can create a problem if we receive the following sequence:
Where
A..N
are different pictures.I have just realized that we do not plan for the above scenario, so the first order of business is checking
first_mb_in_slice==0
in order to detect that a slice refers to a new picture. Or better yet, we can reuse the logic from Chromium.While not ideal, we can cope with identifying a new picture in
decode_access_unit
, but we must:a) finish the current picture, b) make sure that we have a surface to decode it to
Note that we already do a) if we notice a new field picture, but not a new frame. This also means moving the check of the current number of surfaces to
begin_picture()
so that we can have b)