[FFmpeg-cvslog] r15248 - trunk/libavcodec/mace.c

Vitor Sessak vitor1001
Sun Sep 7 16:35:28 CEST 2008


Aurelien Jacobs wrote:
> vitor wrote:
> 
>> Author: vitor
>> Date: Sun Sep  7 15:46:09 2008
>> New Revision: 15248
>>
>> Log:
>> Use FFMIN() instead of rewriting it.
>>
>>
>>
>> Modified:
>>    trunk/libavcodec/mace.c
>>
>> Modified: trunk/libavcodec/mace.c
>> ==============================================================================
>> --- trunk/libavcodec/mace.c	(original)
>> +++ trunk/libavcodec/mace.c	Sun Sep  7 15:46:09 2008
>> @@ -284,10 +284,7 @@ static void chomp6(ChannelData *ctx, int
>>      current = (short)tab2[(ctx->index & 0x7f0) >> 4][val];
>>  
>>      if ((ctx->previous ^ current) >= 0) {
>> -        if (ctx->factor + 506 > 32767)
>> -            ctx->factor = 32767;
>> -        else
>> -            ctx->factor += 506;
>> +        ctx->factor = FFMIN(ctx->factor + 506, 32767);
>>      } else {
>>          if (ctx->factor - 314 < -32768)
>>              ctx->factor = -32767;
> 
> The exact same change could be applied just below in the else part
> (with FFMAX).

Not when ctx->factor-314  == -32768.

-Vitor




More information about the ffmpeg-cvslog mailing list