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

Aurelien Jacobs aurel
Sun Sep 7 16:41:11 CEST 2008


Vitor Sessak wrote:

> 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.

Oops, still this stupid broken rounding... Sorry, I didn't noticed
the -32768 vs. -32767 difference...

Aurel




More information about the ffmpeg-cvslog mailing list