[vlc-devel] [vlc-commits] avcodec: fix direct rendering with some codecs

Rafaël Carré funman at videolan.org
Sun Dec 11 00:07:21 CET 2011

Le Sat, 10 Dec 2011 23:43:22 +0100,
Laurent Aimar <fenrir at elivagar.org> a écrit :

> On Sat, Dec 10, 2011 at 11:00:07PM +0100, Rafaël Carré wrote:
> > vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Dec 10 16:58:35 2011 -0500| [fcc84608b67f3c3567b96604577bfdcc0de45b53] | committer: Rafaël Carré
> > 
> > avcodec: fix direct rendering with some codecs
> > 
> > Provide edge buffers when CODEC_FLAG_EMU_EDGE is set
> > Fix ProRes playback with direct rendering
>  From what I understand of avcodec, this is wrong. We need edge only when
> CODEC_FLAG_EMU_EDGE isn't set while we always set it.

Hm right, EMU_EDGE shouldn't draw in this border.

I'm not sure why this fixes ProRes decoding when EMU_EDGE is set,
perhaps libav doesn't respect the flag, or perhaps video buffers
provide the edges already?

When breaking in avcodec functions I could see that it was assuming a
buffer 16 or 32 pixels larger than the width, and not setting EMU_EDGE
effectively fixed playback of ProRes.

> Besides, I think (but unsure) that you need to allocated edge on the right
> *and* left side of the buffers, which won't work as is.

Right, I think it also includes top and bottom sides.

> Also, increasing the resolution won't correctly work, mostly due to filter
> and vout modules (you will end up in some case with green pixels on the rigt).

What would go wrong? We don't change i_visible_width

> So I think this commit should be reverted.


Meanwhile I can look for a better fix but I don't understand what is
wrong with just increasing resolution.

For left/top edges we can use 
    unsigned int i_x_offset;               /**< start offset of visible area */
    unsigned int i_y_offset;               /**< start offset of visible area */

The only sample I have is AppleProRes422.mov (yuv422p10le) but IIUC any
vp8 stream would work.

Rafaël Carré

More information about the vlc-devel mailing list