[FFmpeg-soc] [soc]: r5511 - in aac-sbr: aacsbr.c aacsbr.h

alexc subversion at mplayerhq.hu
Tue Dec 8 07:14:47 CET 2009


Author: alexc
Date: Tue Dec  8 07:14:47 2009
New Revision: 5511

Log:
Fix f_indexnoise.

By "index_Noise is the last f_IndexNoise of the previous SBR frame" the
spec means for l = L_E - 1, i = RATE*t_E[L_E] - 1, and m = M -1. All the
other terms compensate for the initial value of i and count inner loop
iterations. f_index noise can also clearly take on values from 0 to 511
and thus can't be a uint8_t.

Modified:
   aac-sbr/aacsbr.c
   aac-sbr/aacsbr.h

Modified: aac-sbr/aacsbr.c
==============================================================================
--- aac-sbr/aacsbr.c	Tue Dec  8 07:14:45 2009	(r5510)
+++ aac-sbr/aacsbr.c	Tue Dec  8 07:14:47 2009	(r5511)
@@ -501,6 +501,9 @@ static int sbr_make_f_derived(AACContext
         sbr->n_lim = 1;
     }
 
+    sbr->f_indexnoise[0] = 0;
+    sbr->f_indexnoise[1] = 0;
+
     return 0;
 }
 
@@ -1584,14 +1587,12 @@ static void sbr_hf_assemble(float y[2][6
         }
     }
 
-    // FIXME - reset f_indexnoise[][][1] as appropriate
     for (l = 0; l < ch_data->bs_num_env[1]; l++) {
         for (i = sbr->t_env[ch][l] << 1; i < sbr->t_env[ch][l + 1] << 1; i++) {
             for (m = 0; m < sbr->m; m++) {
-                sbr->f_indexnoise[i][m][0] = (sbr->f_indexnoise[i][m][1] +
-                                              (i - (sbr->t_env[ch][0] << 1)) * sbr->m + m + 1) & 0x1ff;
-                w_temp[i][m][0] += q_filt[i][m] * sbr_noise_table[sbr->f_indexnoise[i][m][0]][0];
-                w_temp[i][m][1] += q_filt[i][m] * sbr_noise_table[sbr->f_indexnoise[i][m][0]][1];
+                sbr->f_indexnoise[ch] = (sbr->f_indexnoise[ch] + 1) & 0x1ff;
+                w_temp[i][m][0] += q_filt[i][m] * sbr_noise_table[sbr->f_indexnoise[ch]][0];
+                w_temp[i][m][1] += q_filt[i][m] * sbr_noise_table[sbr->f_indexnoise[ch]][1];
             }
         }
     }

Modified: aac-sbr/aacsbr.h
==============================================================================
--- aac-sbr/aacsbr.h	Tue Dec  8 07:14:45 2009	(r5510)
+++ aac-sbr/aacsbr.h	Tue Dec  8 07:14:47 2009	(r5511)
@@ -168,7 +168,7 @@ typedef struct {
     float              q_m_lim[7][48];
     float              q_m_limboost[7][48];
     float              s_m_boost[7][48];
-    uint8_t            f_indexnoise[42][48][2];
+    uint16_t           f_indexnoise[2];
     uint8_t            f_indexsine[42][2];
 } SpectralBandReplication;
 


More information about the FFmpeg-soc mailing list