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

kmalaussene subversion at mplayerhq.hu
Sun Feb 22 02:24:44 CET 2009


Author: kmalaussene
Date: Sun Feb 22 02:24:43 2009
New Revision: 4113

Log:
Clean up evaluation of search_range_min and search_range_max ,
by using FFMIN.

Modified:
   amr/amrnbfloatdec.c

Modified: amr/amrnbfloatdec.c
==============================================================================
--- amr/amrnbfloatdec.c	Sun Feb 22 02:11:28 2009	(r4112)
+++ amr/amrnbfloatdec.c	Sun Feb 22 02:24:43 2009	(r4113)
@@ -378,12 +378,9 @@ static void decode_pitch_lag(int *lag_in
                             const int subframe, const enum Mode mode)
 {
     // find the search range
-    int search_range_min = FFMAX(prev_lag_int - 5, mode == MODE_122 ? PITCH_LAG_MIN_MODE_122 : PITCH_LAG_MIN);
+    int search_range_min = FFMIN(FFMAX(prev_lag_int - 5, mode == MODE_122 ? PITCH_LAG_MIN_MODE_122 : PITCH_LAG_MIN),
+                                 PITCH_LAG_MAX - 9);
     int search_range_max = search_range_min + 9;
-    if(search_range_max > PITCH_LAG_MAX) {
-        search_range_max = PITCH_LAG_MAX;
-        search_range_min = search_range_max - 9;
-    }
 
     // subframe 1 or 3
     if(!(subframe & 1)) {



More information about the FFmpeg-soc mailing list