# HG changeset patch # User cehoyos # Date 1274210200 0 # Node ID a37818ac38170141ea3883922315daba49383779 # Parent 8729714451218a55cad66abd0b690d3014691678 Factorize some code into the new function ff_toupper4(). Patch by Francesco Lavra, francescolavra interfree it diff -r 872971445121 -r a37818ac3817 internal.h --- a/internal.h Mon May 17 22:49:34 2010 +0000 +++ b/internal.h Tue May 18 19:16:40 2010 +0000 @@ -48,4 +48,6 @@ */ int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b); +unsigned int ff_toupper4(unsigned int x); + #endif /* AVCODEC_INTERNAL_H */ diff -r 872971445121 -r a37818ac3817 mpegvideo.c --- a/mpegvideo.c Mon May 17 22:49:34 2010 +0000 +++ b/mpegvideo.c Tue May 18 19:16:40 2010 +0000 @@ -30,6 +30,7 @@ #include "libavutil/intmath.h" #include "avcodec.h" #include "dsputil.h" +#include "internal.h" #include "mpegvideo.h" #include "mpegvideo_common.h" #include "mjpegenc.h" @@ -530,15 +531,9 @@ yc_size = y_size + 2 * c_size; /* convert fourcc to upper case */ - s->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); + s->codec_tag = ff_toupper4(s->avctx->codec_tag); - s->stream_codec_tag= toupper( s->avctx->stream_codec_tag &0xFF) - + (toupper((s->avctx->stream_codec_tag>>8 )&0xFF)<<8 ) - + (toupper((s->avctx->stream_codec_tag>>16)&0xFF)<<16) - + (toupper((s->avctx->stream_codec_tag>>24)&0xFF)<<24); + s->stream_codec_tag = ff_toupper4(s->avctx->stream_codec_tag); s->avctx->coded_frame= (AVFrame*)&s->current_picture; diff -r 872971445121 -r a37818ac3817 utils.c --- a/utils.c Mon May 17 22:49:34 2010 +0000 +++ b/utils.c Tue May 18 19:16:40 2010 +0000 @@ -1294,3 +1294,11 @@ } return 0; } + +unsigned int ff_toupper4(unsigned int x) +{ + return toupper( x &0xFF) + + (toupper((x>>8 )&0xFF)<<8 ) + + (toupper((x>>16)&0xFF)<<16) + + (toupper((x>>24)&0xFF)<<24); +}