summaryrefslogtreecommitdiff
path: root/apps/codecs/libfaad
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libfaad')
-rw-r--r--apps/codecs/libfaad/hcr.c2
-rw-r--r--apps/codecs/libfaad/huffman.c6
-rw-r--r--apps/codecs/libfaad/sbr_dct.c26
-rw-r--r--apps/codecs/libfaad/sbr_dec.c2
-rw-r--r--apps/codecs/libfaad/sbr_hfadj.c2
-rw-r--r--apps/codecs/libfaad/sbr_hfgen.c36
-rw-r--r--apps/codecs/libfaad/sbr_qmf.c22
-rw-r--r--apps/codecs/libfaad/sbr_syntax.c10
8 files changed, 53 insertions, 53 deletions
diff --git a/apps/codecs/libfaad/hcr.c b/apps/codecs/libfaad/hcr.c
index f2766c38e1..f968ea7bec 100644
--- a/apps/codecs/libfaad/hcr.c
+++ b/apps/codecs/libfaad/hcr.c
@@ -78,7 +78,7 @@ typedef struct
78{ 78{
79 uint8_t cb; 79 uint8_t cb;
80 uint8_t decoded; 80 uint8_t decoded;
81 uint16_t sp_offset; 81 uint16_t sp_offset;
82 bits_t bits; 82 bits_t bits;
83} codeword_t; 83} codeword_t;
84 84
diff --git a/apps/codecs/libfaad/huffman.c b/apps/codecs/libfaad/huffman.c
index 8b9e27b553..c142ad7ac7 100644
--- a/apps/codecs/libfaad/huffman.c
+++ b/apps/codecs/libfaad/huffman.c
@@ -124,7 +124,7 @@ static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp)
124{ 124{
125 uint8_t neg, i; 125 uint8_t neg, i;
126 int16_t j; 126 int16_t j;
127 int16_t off; 127 int16_t off;
128 128
129 if (sp < 0) 129 if (sp < 0)
130 { 130 {
@@ -500,14 +500,14 @@ int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
500 break; 500 break;
501 } 501 }
502 502
503 /* decode sign bits */ 503 /* decode sign bits */
504 if (unsigned_cb[cb]) 504 if (unsigned_cb[cb])
505 { 505 {
506 for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++) 506 for(i = 0; i < ((cb < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN); i++)
507 { 507 {
508 if(sp[i]) 508 if(sp[i])
509 { 509 {
510 uint8_t b; 510 uint8_t b;
511 if ( get1bit_hcr(ld, &b) ) return -1; 511 if ( get1bit_hcr(ld, &b) ) return -1;
512 if (b != 0) { 512 if (b != 0) {
513 sp[i] = -sp[i]; 513 sp[i] = -sp[i];
diff --git a/apps/codecs/libfaad/sbr_dct.c b/apps/codecs/libfaad/sbr_dct.c
index dbfbb8945c..c916a82a61 100644
--- a/apps/codecs/libfaad/sbr_dct.c
+++ b/apps/codecs/libfaad/sbr_dct.c
@@ -1489,7 +1489,7 @@ static void fft_dif(real_t * Real, real_t * Imag)
1489 // First 2 stages of 32 point FFT decimation in frequency 1489 // First 2 stages of 32 point FFT decimation in frequency
1490 // 4*16*2=64*2=128 multiplications 1490 // 4*16*2=64*2=128 multiplications
1491 // 6*16*2=96*2=192 additions 1491 // 6*16*2=96*2=192 additions
1492 // Stage 1 of 32 point FFT decimation in frequency 1492 // Stage 1 of 32 point FFT decimation in frequency
1493 for (i = 0; i < 16; i++) 1493 for (i = 0; i < 16; i++)
1494 { 1494 {
1495 point1_real = Real[i]; 1495 point1_real = Real[i];
@@ -1519,7 +1519,7 @@ static void fft_dif(real_t * Real, real_t * Imag)
1519 w_real = w_array_real[w_index]; 1519 w_real = w_array_real[w_index];
1520 w_imag = w_array_imag[w_index]; 1520 w_imag = w_array_imag[w_index];
1521 1521
1522 i = j; 1522 i = j;
1523 point1_real = Real[i]; 1523 point1_real = Real[i];
1524 point1_imag = Imag[i]; 1524 point1_imag = Imag[i];
1525 i2 = i+8; 1525 i2 = i+8;
@@ -1818,9 +1818,9 @@ void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t *
1818 // 3*32=96 additions 1818 // 3*32=96 additions
1819 for (i = 0; i < 32; i++) 1819 for (i = 0; i < 32; i++)
1820 { 1820 {
1821 real_t x_re, x_im, tmp; 1821 real_t x_re, x_im, tmp;
1822 x_re = in_real[i]; 1822 x_re = in_real[i];
1823 x_im = in_imag[i]; 1823 x_im = in_imag[i];
1824 tmp = MUL_C(x_re + x_im, dct4_64_tab[i]); 1824 tmp = MUL_C(x_re + x_im, dct4_64_tab[i]);
1825 in_real[i] = MUL_C(x_im, dct4_64_tab[i + 64]) + tmp; 1825 in_real[i] = MUL_C(x_im, dct4_64_tab[i + 64]) + tmp;
1826 in_imag[i] = MUL_C(x_re, dct4_64_tab[i + 32]) + tmp; 1826 in_imag[i] = MUL_C(x_re, dct4_64_tab[i + 32]) + tmp;
@@ -1834,10 +1834,10 @@ void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t *
1834 // 3*31+2=95 additions 1834 // 3*31+2=95 additions
1835 for (i = 0; i < 16; i++) 1835 for (i = 0; i < 16; i++)
1836 { 1836 {
1837 real_t x_re, x_im, tmp; 1837 real_t x_re, x_im, tmp;
1838 i_rev = bit_rev_tab[i]; 1838 i_rev = bit_rev_tab[i];
1839 x_re = in_real[i_rev]; 1839 x_re = in_real[i_rev];
1840 x_im = in_imag[i_rev]; 1840 x_im = in_imag[i_rev];
1841 1841
1842 tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]); 1842 tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
1843 out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp; 1843 out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
@@ -1848,10 +1848,10 @@ void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t *
1848 out_real[16] = MUL_C(in_real[1] + in_imag[1], dct4_64_tab[16 + 3*32]); 1848 out_real[16] = MUL_C(in_real[1] + in_imag[1], dct4_64_tab[16 + 3*32]);
1849 for (i = 17; i < 32; i++) 1849 for (i = 17; i < 32; i++)
1850 { 1850 {
1851 real_t x_re, x_im, tmp; 1851 real_t x_re, x_im, tmp;
1852 i_rev = bit_rev_tab[i]; 1852 i_rev = bit_rev_tab[i];
1853 x_re = in_real[i_rev]; 1853 x_re = in_real[i_rev];
1854 x_im = in_imag[i_rev]; 1854 x_im = in_imag[i_rev];
1855 tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]); 1855 tmp = MUL_C(x_re + x_im, dct4_64_tab[i + 3*32]);
1856 out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp; 1856 out_real[i] = MUL_C(x_im, dct4_64_tab[i + 5*32]) + tmp;
1857 out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp; 1857 out_imag[i] = MUL_C(x_re, dct4_64_tab[i + 4*32]) + tmp;
diff --git a/apps/codecs/libfaad/sbr_dec.c b/apps/codecs/libfaad/sbr_dec.c
index c18ea454d5..97f1d9b647 100644
--- a/apps/codecs/libfaad/sbr_dec.c
+++ b/apps/codecs/libfaad/sbr_dec.c
@@ -50,7 +50,7 @@ static void sbr_save_matrix(sbr_info *sbr, uint8_t ch);
50sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, 50sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
51 uint32_t sample_rate, uint8_t downSampledSBR 51 uint32_t sample_rate, uint8_t downSampledSBR
52#ifdef DRM 52#ifdef DRM
53 , uint8_t IsDRM 53 , uint8_t IsDRM
54#endif 54#endif
55 ) 55 )
56{ 56{
diff --git a/apps/codecs/libfaad/sbr_hfadj.c b/apps/codecs/libfaad/sbr_hfadj.c
index 374d16f443..453180d544 100644
--- a/apps/codecs/libfaad/sbr_hfadj.c
+++ b/apps/codecs/libfaad/sbr_hfadj.c
@@ -1561,7 +1561,7 @@ static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj,
1561#ifndef SBR_LOW_POWER 1561#ifndef SBR_LOW_POWER
1562 if (h_SL != 0) 1562 if (h_SL != 0)
1563 { 1563 {
1564 uint8_t ri = sbr->GQ_ringbuf_index[ch]; 1564 uint8_t ri = sbr->GQ_ringbuf_index[ch];
1565 for (n = 0; n <= 4; n++) 1565 for (n = 0; n <= 4; n++)
1566 { 1566 {
1567 real_t curr_h_smooth = h_smooth[n]; 1567 real_t curr_h_smooth = h_smooth[n];
diff --git a/apps/codecs/libfaad/sbr_hfgen.c b/apps/codecs/libfaad/sbr_hfgen.c
index f77bbd052f..63a2fce855 100644
--- a/apps/codecs/libfaad/sbr_hfgen.c
+++ b/apps/codecs/libfaad/sbr_hfgen.c
@@ -128,20 +128,20 @@ void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
128 a1_i = MUL_C(IM(alpha_1[p]), bw2); 128 a1_i = MUL_C(IM(alpha_1[p]), bw2);
129#endif 129#endif
130 130
131 temp2_r = QMF_RE(Xlow[first - 2 + offset][p]); 131 temp2_r = QMF_RE(Xlow[first - 2 + offset][p]);
132 temp3_r = QMF_RE(Xlow[first - 1 + offset][p]); 132 temp3_r = QMF_RE(Xlow[first - 1 + offset][p]);
133#ifndef SBR_LOW_POWER 133#ifndef SBR_LOW_POWER
134 temp2_i = QMF_IM(Xlow[first - 2 + offset][p]); 134 temp2_i = QMF_IM(Xlow[first - 2 + offset][p]);
135 temp3_i = QMF_IM(Xlow[first - 1 + offset][p]); 135 temp3_i = QMF_IM(Xlow[first - 1 + offset][p]);
136#endif 136#endif
137 for (l = first; l < last; l++) 137 for (l = first; l < last; l++)
138 { 138 {
139 temp1_r = temp2_r; 139 temp1_r = temp2_r;
140 temp2_r = temp3_r; 140 temp2_r = temp3_r;
141 temp3_r = QMF_RE(Xlow[l + offset][p]); 141 temp3_r = QMF_RE(Xlow[l + offset][p]);
142#ifndef SBR_LOW_POWER 142#ifndef SBR_LOW_POWER
143 temp1_i = temp2_i; 143 temp1_i = temp2_i;
144 temp2_i = temp3_i; 144 temp2_i = temp3_i;
145 temp3_i = QMF_IM(Xlow[l + offset][p]); 145 temp3_i = QMF_IM(Xlow[l + offset][p]);
146#endif 146#endif
147 147
@@ -303,10 +303,10 @@ static void auto_correlation(sbr_info *sbr, acorr_coef *ac, qmf_t buffer[MAX_NTS
303 303
304 for (j = offset; j < len + offset; j++) 304 for (j = offset; j < len + offset; j++)
305 { 305 {
306 temp1_r = temp2_r; // temp1_r = (QMF_RE(buffer[offset-2][bd] + (1<<(exp-1))) >> exp; 306 temp1_r = temp2_r; // temp1_r = (QMF_RE(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
307 temp1_i = temp2_i; // temp1_i = (QMF_IM(buffer[offset-2][bd] + (1<<(exp-1))) >> exp; 307 temp1_i = temp2_i; // temp1_i = (QMF_IM(buffer[offset-2][bd] + (1<<(exp-1))) >> exp;
308 temp2_r = temp3_r; // temp2_r = (QMF_RE(buffer[offset-1][bd] + (1<<(exp-1))) >> exp; 308 temp2_r = temp3_r; // temp2_r = (QMF_RE(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
309 temp2_i = temp3_i; // temp2_i = (QMF_IM(buffer[offset-1][bd] + (1<<(exp-1))) >> exp; 309 temp2_i = temp3_i; // temp2_i = (QMF_IM(buffer[offset-1][bd] + (1<<(exp-1))) >> exp;
310 temp3_r = (QMF_RE(buffer[j][bd]) + pow2_to_exp) >> exp; 310 temp3_r = (QMF_RE(buffer[j][bd]) + pow2_to_exp) >> exp;
311 temp3_i = (QMF_IM(buffer[j][bd]) + pow2_to_exp) >> exp; 311 temp3_i = (QMF_IM(buffer[j][bd]) + pow2_to_exp) >> exp;
312 r01r += MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i); 312 r01r += MUL_R(temp3_r, temp2_r) + MUL_R(temp3_i, temp2_i);
@@ -352,10 +352,10 @@ static void auto_correlation(sbr_info *sbr, acorr_coef *ac, qmf_t buffer[MAX_NTS
352 352
353 for (j = offset; j < len + offset; j++) 353 for (j = offset; j < len + offset; j++)
354 { 354 {
355 temp1_r = temp2_r; // temp1_r = QMF_RE(buffer[j-2][bd]; 355 temp1_r = temp2_r; // temp1_r = QMF_RE(buffer[j-2][bd];
356 temp1_i = temp2_i; // temp1_i = QMF_IM(buffer[j-2][bd]; 356 temp1_i = temp2_i; // temp1_i = QMF_IM(buffer[j-2][bd];
357 temp2_r = temp3_r; // temp2_r = QMF_RE(buffer[j-1][bd]; 357 temp2_r = temp3_r; // temp2_r = QMF_RE(buffer[j-1][bd];
358 temp2_i = temp3_i; // temp2_i = QMF_IM(buffer[j-1][bd]; 358 temp2_i = temp3_i; // temp2_i = QMF_IM(buffer[j-1][bd];
359 temp3_r = QMF_RE(buffer[j][bd]); 359 temp3_r = QMF_RE(buffer[j][bd]);
360 temp3_i = QMF_IM(buffer[j][bd]); 360 temp3_i = QMF_IM(buffer[j][bd]);
361 r01r += temp3_r * temp2_r + temp3_i * temp2_i; 361 r01r += temp3_r * temp2_r + temp3_i * temp2_i;
diff --git a/apps/codecs/libfaad/sbr_qmf.c b/apps/codecs/libfaad/sbr_qmf.c
index 540332bdcb..5486cd283d 100644
--- a/apps/codecs/libfaad/sbr_qmf.c
+++ b/apps/codecs/libfaad/sbr_qmf.c
@@ -42,12 +42,12 @@ qmfa_info *qmfa_init(uint8_t channels)
42{ 42{
43 qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info)); 43 qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
44 44
45 /* x is implemented as double ringbuffer */ 45 /* x is implemented as double ringbuffer */
46 qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t)); 46 qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t));
47 memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t)); 47 memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t));
48 48
49 /* ringbuffer index */ 49 /* ringbuffer index */
50 qmfa->x_index = 0; 50 qmfa->x_index = 0;
51 51
52 qmfa->channels = channels; 52 qmfa->channels = channels;
53 53
@@ -81,7 +81,7 @@ void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
81 int16_t n; 81 int16_t n;
82 82
83 /* shift input buffer x */ 83 /* shift input buffer x */
84 /* input buffer is not shifted anymore, x is implemented as double ringbuffer */ 84 /* input buffer is not shifted anymore, x is implemented as double ringbuffer */
85 //memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t)); 85 //memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
86 86
87 /* add new samples to input buffer x */ 87 /* add new samples to input buffer x */
@@ -104,10 +104,10 @@ void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
104 MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]); 104 MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]);
105 } 105 }
106 106
107 /* update ringbuffer index */ 107 /* update ringbuffer index */
108 qmfa->x_index -= 32; 108 qmfa->x_index -= 32;
109 if (qmfa->x_index < 0) 109 if (qmfa->x_index < 0)
110 qmfa->x_index = (320-32); 110 qmfa->x_index = (320-32);
111 111
112 /* calculate 32 subband samples by introducing X */ 112 /* calculate 32 subband samples by introducing X */
113#ifdef SBR_LOW_POWER 113#ifdef SBR_LOW_POWER
@@ -224,7 +224,7 @@ qmfs_info *qmfs_init(uint8_t channels)
224{ 224{
225 qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info)); 225 qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info));
226 226
227 /* v is a double ringbuffer */ 227 /* v is a double ringbuffer */
228 qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t)); 228 qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t));
229 memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t)); 229 memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t));
230 230
@@ -483,8 +483,8 @@ void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][6
483 for (l = 0; l < sbr->numTimeSlotsRate; l++) 483 for (l = 0; l < sbr->numTimeSlotsRate; l++)
484 { 484 {
485 /* shift buffer v */ 485 /* shift buffer v */
486 /* buffer is not shifted, we use double ringbuffer */ 486 /* buffer is not shifted, we use double ringbuffer */
487 //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t)); 487 //memmove(qmfs->v + 128, qmfs->v, (1280-128)*sizeof(real_t));
488 488
489 /* calculate 128 samples */ 489 /* calculate 128 samples */
490#ifndef FIXED_POINT 490#ifndef FIXED_POINT
diff --git a/apps/codecs/libfaad/sbr_syntax.c b/apps/codecs/libfaad/sbr_syntax.c
index 267e954a2e..eff26e9f46 100644
--- a/apps/codecs/libfaad/sbr_syntax.c
+++ b/apps/codecs/libfaad/sbr_syntax.c
@@ -337,16 +337,16 @@ static uint8_t sbr_data(bitfile *ld, sbr_info *sbr)
337 switch (sbr->id_aac) 337 switch (sbr->id_aac)
338 { 338 {
339 case ID_SCE: 339 case ID_SCE:
340 if ((result = sbr_single_channel_element(ld, sbr)) > 0) 340 if ((result = sbr_single_channel_element(ld, sbr)) > 0)
341 return result; 341 return result;
342 break; 342 break;
343 case ID_CPE: 343 case ID_CPE:
344 if ((result = sbr_channel_pair_element(ld, sbr)) > 0) 344 if ((result = sbr_channel_pair_element(ld, sbr)) > 0)
345 return result; 345 return result;
346 break; 346 break;
347 } 347 }
348 348
349 return 0; 349 return 0;
350} 350}
351 351
352/* table 5 */ 352/* table 5 */