[FFmpeg-devel] [PATCH] H.264: fix decoding of plain still images (broken since revision 14289)

Reimar Döffinger Reimar.Doeffinger
Wed Jan 7 10:54:28 CET 2009


On Wed, Jan 07, 2009 at 12:09:13AM +0100, Michael Niedermayer wrote:
> On Mon, Jan 05, 2009 at 11:35:03PM +0100, Reimar D?ffinger wrote:
> > If this change is considered correct/acceptable, at least MPEG-2 should
> > be changed in the same way.
> 
> mpeg2 currently does:
>     if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
>         /* special case for last picture */
>         if (s2->low_delay==0 && s2->next_picture_ptr) {
>             *picture= *(AVFrame*)s2->next_picture_ptr;
>             s2->next_picture_ptr= NULL;
> 
>             *data_size = sizeof(AVFrame);
>         }
>         return buf_size;

I know, but SEQ_END_CODE at the end of a frame is not treated specially,
and if I understand right it is not even split into a separate frame by
AVParser.
While I'd consider that behaviour correct, it means a calling
application must have "extra" decode calls or single-I-frame videos will
not result in any decoded frames at all. If this is changed for H.264 it
should be changed to MPEG-2, too.

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list