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

Carl Eugen Hoyos cehoyos
Tue Jan 26 00:13:29 CET 2010


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);

         s->comp_index[i] = index;
?

Carl Eugen




More information about the ffmpeg-devel mailing list