[FFmpeg-soc] [soc]: r4117 - amr/amrnbfloatdec.c

kmalaussene subversion at mplayerhq.hu
Sun Feb 22 03:16:54 CET 2009


Author: kmalaussene
Date: Sun Feb 22 03:16:54 2009
New Revision: 4117

Log:
Replace FFMIN(FFMAX()) with av_clip, suggested by Bobby Bingham.

Modified:
   amr/amrnbfloatdec.c

Modified: amr/amrnbfloatdec.c
==============================================================================
--- amr/amrnbfloatdec.c	Sun Feb 22 03:13:12 2009	(r4116)
+++ amr/amrnbfloatdec.c	Sun Feb 22 03:16:54 2009	(r4117)
@@ -401,10 +401,10 @@ static void decode_pitch_lag(int *lag_in
             // calculate the pitch lag
             *lag_int  = (pitch_index + 5) / 6 - 1;
             *lag_frac = pitch_index - *lag_int * 6 - 3;
-            *lag_int += FFMIN(FFMAX(prev_lag_int - 5, PITCH_LAG_MIN_MODE_122), PITCH_LAG_MAX - 9);
+            *lag_int += av_clip(prev_lag_int - 5, PITCH_LAG_MIN_MODE_122, PITCH_LAG_MAX - 9);
         }else if(mode <= MODE_67) {
             // find the search range
-            int search_range_min = FFMIN(FFMAX(prev_lag_int - 5, PITCH_LAG_MIN), PITCH_LAG_MAX - 9);
+            int search_range_min = av_clip(prev_lag_int - 5, PITCH_LAG_MIN, PITCH_LAG_MAX - 9);
 
             // decoding with 4-bit resolution
             if(pitch_index < 4) {
@@ -426,7 +426,7 @@ static void decode_pitch_lag(int *lag_in
             // 10923>>15 is approximately 1/3
             *lag_int  = ( ((pitch_index + 2)*10923)>>15 ) - 1;
             *lag_frac = pitch_index - *lag_int * 3 - 2;
-            *lag_int += FFMIN(FFMAX(prev_lag_int - 5, PITCH_LAG_MIN), PITCH_LAG_MAX - 9);
+            *lag_int += av_clip(prev_lag_int - 5, PITCH_LAG_MIN, PITCH_LAG_MAX - 9);
         }
     }
 }



More information about the FFmpeg-soc mailing list