[FFmpeg-soc] [soc]: r4919 - amr/amrnbdec.c

cmcq subversion at mplayerhq.hu
Mon Aug 3 19:37:42 CEST 2009


Author: cmcq
Date: Mon Aug  3 19:37:42 2009
New Revision: 4919

Log:
Use "if { y } else z" style

Modified:
   amr/amrnbdec.c

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Mon Aug  3 19:17:40 2009	(r4918)
+++ amr/amrnbdec.c	Mon Aug  3 19:37:42 2009	(r4919)
@@ -165,9 +165,8 @@ static enum Mode decode_bitstream(AMRCon
             p->cur_frame_type = RX_SPEECH_GOOD;
     } else if (mode == NO_DATA) {
         p->cur_frame_type = RX_NO_DATA;
-    } else {
+    } else
         p->cur_frame_type = RX_SPEECH_BAD;
-    }
 
     return mode;
 }
@@ -424,10 +423,10 @@ static void decode_pitch_lag(int *lag_in
             // decoding with 5 or 6 bit resolution, 1/3 fractional precision
             *lag_int  = ((pitch_index + 2) * 10923 >> 15) - 1;
             *lag_frac = pitch_index - *lag_int * 3 - 2;
-            if (mode == MODE_795)
+            if (mode == MODE_795) {
                 *lag_int += av_clip(prev_lag_int - 10, PITCH_LAG_MIN,
                                     PITCH_LAG_MAX - 19);
-            else
+            } else
                 *lag_int += av_clip(prev_lag_int - 5, PITCH_LAG_MIN,
                                     PITCH_LAG_MAX - 9);
         }
@@ -826,17 +825,17 @@ static float *anti_sparseness(AMRContext
 {
     int ir_filter_strength;
 
-    if (p->pitch_gain[4] < 0.6)
+    if (p->pitch_gain[4] < 0.6) {
         ir_filter_strength = 0;      // strong filtering
-    else if (p->pitch_gain[4] < 0.9)
+    } else if (p->pitch_gain[4] < 0.9) {
         ir_filter_strength = 1;      // medium filtering
-    else
+    } else
         ir_filter_strength = 2;      // no filtering
 
     // detect 'onset'
-    if (fixed_gain > 2.0 * p->prev_sparse_fixed_gain)
+    if (fixed_gain > 2.0 * p->prev_sparse_fixed_gain) {
         p->ir_filter_onset = 2;
-    else if (p->ir_filter_onset)
+    } else if (p->ir_filter_onset)
         p->ir_filter_onset--;
 
     if (!p->ir_filter_onset) {
@@ -1098,9 +1097,9 @@ static int amrnb_decode_frame(AVCodecCon
         return -1;
     }
 
-    if (p->cur_frame_mode == MODE_122)
+    if (p->cur_frame_mode == MODE_122) {
         lsf2lsp_5(p);
-    else
+    } else
         lsf2lsp_3(p);
 
     for (i = 0; i < 4; i++)


More information about the FFmpeg-soc mailing list