[FFmpeg-devel] [PATCH] Add small optimization to libavformat/avidec.c

Jean-Daniel Dupas devlists
Tue Apr 20 17:09:25 CEST 2010


That's already what the compiler does IMHO.

Le 20 avr. 2010 ? 16:49, Sebastian Vater a ?crit :

> Changed an if ( size%2 ) to if ( size&1 ) in libavformat/avidec.c
> 
> Just a small optimization I just stumbled around...
> 
> -- 
> 
> Best regards,
>                   :-) Basty/CDGS (-:
> 
> Index: libavformat/avidec.c
> ===================================================================
> --- libavformat/avidec.c	(r?vision 22920)
> +++ libavformat/avidec.c	(copie de travail)
> @@ -560,7 +560,7 @@
>                         av_log(s, AV_LOG_WARNING, "sample size (%d) != block align (%d)\n", ast->sample_size, st->codec->block_align);
>                         ast->sample_size= st->codec->block_align;
>                     }
> -                    if (size%2) /* 2-aligned (fix for Stargate SG-1 - 3x18 - Shades of Grey.avi) */
> +                    if (size&1) /* 2-aligned (fix for Stargate SG-1 - 3x18 - Shades of Grey.avi) */
>                         url_fskip(pb, 1);
>                     /* Force parsing as several audio frames can be in
>                      * one packet and timestamps refer to packet start. */
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel

-- Jean-Daniel







More information about the ffmpeg-devel mailing list