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

alexc subversion at mplayerhq.hu
Wed Dec 16 23:21:27 CET 2009


Author: alexc
Date: Wed Dec 16 23:21:27 2009
New Revision: 5545

Log:
Fix initial values in high frequency assembly when h_SL == 4.

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

Modified: aac-sbr/aacsbr.c
==============================================================================
--- aac-sbr/aacsbr.c	Wed Dec 16 23:21:24 2009	(r5544)
+++ aac-sbr/aacsbr.c	Wed Dec 16 23:21:27 2009	(r5545)
@@ -1536,9 +1536,17 @@ static void sbr_hf_assemble(float y[2][6
         {  1,  0, -1,  0}, // real
         {  0,  1,  0, -1}, // imaginary
     };
-    float g_temp[42][48], g_filt[42][48], q_temp[42][48], q_filt[42][48], w_temp[42][48][2];
+    float g_filt[42][48], q_filt[42][48], w_temp[42][48][2];
+    float (*g_temp)[48] = sbr->g_temp, (*q_temp)[48] = sbr->q_temp;
     memcpy(y[1], y[0], sizeof(y[0]));
 
+    if (sbr->reset) {
+        for (i = 0; i < h_SL; i++) {
+            memcpy(g_temp[i], sbr->gain_limboost[0], sbr->m * sizeof(sbr->gain_limboost[0][0]));
+            memcpy(q_temp[i], sbr->q_m_limboost[0],  sbr->m * sizeof(sbr->q_m_limboost[0][0]));
+        }
+    }
+
     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++) {
             memcpy(g_temp[h_SL + i], sbr->gain_limboost[l], sbr->m * sizeof(sbr->gain_limboost[l][0]));
@@ -1613,6 +1621,9 @@ static void sbr_hf_assemble(float y[2][6
             }
         }
     }
+
+   memcpy(g_temp[0], g_temp[2*sbr->t_env[ch][ch_data->bs_num_env[1]] - 4], 4*sizeof(g_temp[0]));
+   memcpy(q_temp[0], q_temp[2*sbr->t_env[ch][ch_data->bs_num_env[1]] - 4], 4*sizeof(q_temp[0]));
 }
 
 void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, int ch, float* in, float* out)

Modified: aac-sbr/aacsbr.h
==============================================================================
--- aac-sbr/aacsbr.h	Wed Dec 16 23:21:24 2009	(r5544)
+++ aac-sbr/aacsbr.h	Wed Dec 16 23:21:27 2009	(r5545)
@@ -168,6 +168,8 @@ typedef struct {
     float              q_m_lim[7][48];
     float              q_m_limboost[7][48];
     float              s_m_boost[7][48];
+    float              g_temp[42][48];
+    float              q_temp[42][48];
     uint16_t           f_indexnoise[2];
     uint8_t            f_indexsine[2];
 } SpectralBandReplication;


More information about the FFmpeg-soc mailing list