[Ffmpeg-devel] [PATCH] mpegvideo remove fourcc upper case conversion

Rich Felker dalias
Tue Aug 22 23:26:28 CEST 2006


On Tue, Aug 22, 2006 at 06:52:19PM +0200, Baptiste Coudurier wrote:
> Hi
> 
> Here is a patch to remove uppercase conversion of fourcc. That cause
> conversion if mpeg essence is stored in container which already have a
> fourcc (mov), and IMHO a codec should not alter fourcc.
> 
> -- 
> Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
> SMARTJOG S.A.                                    http://www.smartjog.com
> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> Phone: +33 1 49966312
> 

> Index: libavcodec/mpegvideo.c
> ===================================================================
> --- libavcodec/mpegvideo.c	(revision 6045)
> +++ libavcodec/mpegvideo.c	(working copy)
> @@ -691,12 +691,6 @@
>      c_size = s->mb_stride * (s->mb_height + 1);
>      yc_size = y_size + 2 * c_size;
>  
> -    /* convert fourcc to upper case */
> -    s->avctx->codec_tag=   toupper( s->avctx->codec_tag     &0xFF)
> -                        + (toupper((s->avctx->codec_tag>>8 )&0xFF)<<8 )
> -                        + (toupper((s->avctx->codec_tag>>16)&0xFF)<<16)
> -                        + (toupper((s->avctx->codec_tag>>24)&0xFF)<<24);
> -

In any case this code is stupid, simple bit arithmetic can do the same
thing..

Rich





More information about the ffmpeg-devel mailing list