[FFmpeg-devel] [PATCH] MOV YUV2 fourcc -> PIX_FMT_YUYV422 mapping

Reimar Döffinger Reimar.Doeffinger
Thu Mar 26 10:16:34 CET 2009


On Thu, Mar 26, 2009 at 02:22:03PM +0530, Jai Menon wrote:
> On 3/26/09, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Wed, Mar 25, 2009 at 08:47:33AM -0700, Baptiste Coudurier wrote:
> >  > On 3/25/2009 8:35 AM, Reimar D?ffinger wrote:
> >  > > On Wed, Mar 25, 2009 at 03:01:50PM +0100, Michael Niedermayer wrote:
> >  > >> On Wed, Mar 25, 2009 at 09:48:51AM +0530, Jai Menon wrote:
> >  > >>> Index: libavcodec/rawdec.c
> >  > >>> ===================================================================
> >  > >>> --- libavcodec/rawdec.c   (revision 17944)
> >  > >>> +++ libavcodec/rawdec.c   (working copy)
> >  > >>> @@ -144,6 +144,13 @@
> >  > >>>          picture->data[2] = tmp;
> >  > >>>      }
> >  > >>>
> >  > >>> +    if(avctx->codec_tag == MKTAG('y', 'u', 'v', '2')) {
> >  > >>> +        int i;
> >  > >>> +        for(i=1; i<picture->linesize[0]*avctx->height; i+=2) {
> >  > >>> +            picture->data[0][i] ^= 128;
> >  > >>> +        }
> >  > >>> +    }

I think you should avoid writing to the padding pixels, particularly
since this would not work for negative linesize i.e. something
like
uint8_t *line = picture->data[0];
for (y = 0; y < avctx->height; y++) {
    for (x = 0; x < avctx->width; x++)
        line[2*x + 1] ^= 0x80; // convert signed to unsigned
    line += picture->linesize[0];
}

> Are you suggesting adding a similar if case in raw_encode which sets
> the sign bit? such a patch will be quite intrusive, especially for a
> pixel fmt which most people won't use :)

Huh? Wouldn't you just need to add exactly the same code between
avpicture_layout and the return?



More information about the ffmpeg-devel mailing list