[FFmpeg-devel] [PATCH]Swap U&V for Metasoft MJPEG codec

Michael Niedermayer michaelni
Tue Jan 26 08:02:17 CET 2010


On Mon, Jan 25, 2010 at 11:13:29PM +0000, Carl Eugen Hoyos wrote:
> Michael Niedermayer <michaelni <at> gmx.at> writes:
> 
> > > +    if (s->avctx->codec_tag == MKTAG('M', 'T', 'S', 'J'))
> > > +        FFSWAP(int, s->comp_index[1], s->comp_index[2]);
> > 
> > this could cause mismatches as the other variables arent swaped
> > also nb_components would have to be checked to be at least 3.
> > 
> > Iam not sure where the best place is to do the swap but i think
> > a little farther up might be easier.
> > 
> > +if (s->avctx->codec_tag == MKTAG('M', 'T', 'S', 'J') && nb_components==3 &&
> s->nb_components==3 && i)
> > +    index=i;
> >  s->comp_index[i] = index;
> 
> Do you mean
> +        if (s->avctx->codec_tag == MKTAG('M', 'T', 'S', 'J')
> +            && nb_components == 3 && s->nb_components == 3 && i)
> +            index = 2 - (i >> 1);

index = 3-i;


> 
>          s->comp_index[i] = index;
> ?

ok

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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100126/61b044df/attachment.pgp>



More information about the ffmpeg-devel mailing list