Author: cmcq
Date: Thu Jul 23 12:19:24 2009
New Revision: 4786

Log:
Copy a typo in the ref source

Modified:
   amr/amrnbfloatdata.h
   amr/amrnbfloatdec.c

Modified: amr/amrnbfloatdata.h
==============================================================================
--- amr/amrnbfloatdata.h        Thu Jul 23 12:18:54 2009        (r4785)
+++ amr/amrnbfloatdata.h        Thu Jul 23 12:19:24 2009        (r4786)
@@ -2302,6 +2302,10 @@ static const float gains_low[64][2] = {
 
 // pre-processing tables
 
+// The specification says 0.8, which should be 13107, but the reference C code
+// uses 13017 instead. (Amusingly the same applies to SHARP_MAX in g729dec.c.)
+#define SHARP_MAX 0.79449462890625
+
 // impulse response filter tables converted to float from Q15 int32_t used for
 // anti-sparseness processing
 static const float ir_filter_strong_MODE_795[AMR_SUBFRAME_SIZE] = {

Modified: amr/amrnbfloatdec.c
==============================================================================
--- amr/amrnbfloatdec.c Thu Jul 23 12:18:54 2009        (r4785)
+++ amr/amrnbfloatdec.c Thu Jul 23 12:19:24 2009        (r4786)
@@ -71,7 +71,7 @@ typedef struct AMRContext {
     float                     pitch_gain[5]; ///< quantified pitch gains for 
the current and previous four subframes
     float                     fixed_gain[5]; ///< quantified fixed gains for 
the current and previous four subframes
 
-    float                              beta; ///< beta = previous pitch_gain, 
bounded by [0.0,0.8]
+    float                              beta; ///< beta = previous pitch_gain, 
bounded by [0.0,SHARP_MAX]
     int                          diff_count; ///< the number of subframes for 
which diff has been above 0.65
     int                          hang_count; ///< the number of subframes 
since a hangover period started
 
@@ -807,7 +807,7 @@ static void decode_gains(AMRContext *p, 
     // MODE_475 only updates on the 2nd and 4th subframes - this follows from
     // the fact that the gains for two subframes are jointly quantised.
     if (mode != MODE_475 || subframe & 1)
-        p->beta = av_clipf(p->pitch_gain[4], 0.0, 0.8);
+        p->beta = av_clipf(p->pitch_gain[4], 0.0, SHARP_MAX);
 
     // ^g_c = g_c' * ^gamma_gc
     p->fixed_gain[4] = fixed_gain_factor
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to