[FFmpeg-devel] [BUG] Theora decoder displays green line

Michael Niedermayer michaelni
Sun May 6 17:45:10 CEST 2007


On Sun, May 06, 2007 at 05:23:25PM +0200, Aurelien Jacobs wrote:
> On Sun, 6 May 2007 17:12:21 +0200
> Michael Niedermayer <michaelni at gmx.at> wrote:
> 
> > Hi
> > 
> > On Sun, May 06, 2007 at 02:26:36PM +0200, Diego Biurrun wrote:
> > > Try the following sample:
> > > 
> > > http://mirrors.creativecommons.org/getcreative/Creative_Commons_-_Get_Creative.ogg
> > > 
> > > ffplay displays a green line at the bottom (as does MPlayer with lavc
> > > decoder and lavf demuxer), while MPlayer with native demuxer and
> > > libtheora decoder works fine.
> > 
> > ffmpeg -i output could be usefull
> 
> coded size is 400x304, display size should be 400x300.
> Attached patch fixes this issue.
> 
> Aurel

> Index: libavcodec/vp3.c
> ===================================================================
> --- libavcodec/vp3.c	(revision 8918)
> +++ libavcodec/vp3.c	(working copy)
> @@ -1950,8 +1950,8 @@
>          s->version = 1;
>  
>      s->avctx = avctx;
> -    s->width = (avctx->width + 15) & 0xFFFFFFF0;
> -    s->height = (avctx->height + 15) & 0xFFFFFFF0;
> +    s->width = (avctx->coded_width + 15) & 0xFFFFFFF0;
> +    s->height = (avctx->coded_height + 15) & 0xFFFFFFF0;
>      avctx->pix_fmt = PIX_FMT_YUV420P;
>      if(avctx->idct_algo==FF_IDCT_AUTO)
>          avctx->idct_algo=FF_IDCT_VP3;
> @@ -2385,6 +2385,8 @@
>  
>      s->width = get_bits(gb, 16) << 4;
>      s->height = get_bits(gb, 16) << 4;
> +    avctx->width = get_bits_long(gb, 24);
> +    avctx->height = get_bits_long(gb, 24);

is there anything which ensures that the allocated buffer will
be large enough for the picture which gets decoded?

also, avcodec_set_dimensions() should be used


[...]
> Index: libavformat/oggparsetheora.c
> ===================================================================
> --- libavformat/oggparsetheora.c	(revision 8918)
> +++ libavformat/oggparsetheora.c	(working copy)
> @@ -70,13 +70,15 @@
>              return -1;
>          }
>  
> -        st->codec->width = get_bits(&gb, 16) << 4;
> -        st->codec->height = get_bits(&gb, 16) << 4;
> +        st->codec->coded_width = get_bits(&gb, 16) << 4;
> +        st->codec->coded_height = get_bits(&gb, 16) << 4;
> +        st->codec->width = get_bits_long(&gb, 24);
> +        st->codec->height = get_bits_long(&gb, 24);

coded_width=width unless lowres or other decoder side tricks
are used

the allocated buffer always has its w/h rounded up to the next multiple
of 16 with yv12
that is coded_width is not the allocated width (see avcodec_align_dimensions)




[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070506/a0212676/attachment.pgp>



More information about the ffmpeg-devel mailing list