annotate libfaad2/sbr_dec.c @ 11977:efb37725d616

flushing stuff after seeking (finally we can view MPEG without thouse blocks after seeking with -vc ffmpeg12)
author michael
date Wed, 18 Feb 2004 15:23:41 +0000
parents 3185f64f6350
children 4a370c80fe5c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1 /*
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
3 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
4 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
5 ** This program is free software; you can redistribute it and/or modify
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
6 ** it under the terms of the GNU General Public License as published by
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
7 ** the Free Software Foundation; either version 2 of the License, or
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
8 ** (at your option) any later version.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
9 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
10 ** This program is distributed in the hope that it will be useful,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
13 ** GNU General Public License for more details.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
14 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
15 ** You should have received a copy of the GNU General Public License
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
16 ** along with this program; if not, write to the Free Software
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
18 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
19 ** Any non-GPL usage of this software or parts of this software is strictly
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
20 ** forbidden.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
21 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
22 ** Commercial non-GPL licensing of this software is possible.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
24 **
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
25 ** $Id: sbr_dec.c,v 1.12 2003/09/25 12:04:31 menno Exp $
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
26 **/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
27
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
28
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
29 #include "common.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
30 #include "structs.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
31
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
32 #ifdef SBR_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
33
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
34 #include <stdlib.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
35
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
36 #include "syntax.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
37 #include "bits.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
38 #include "sbr_syntax.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
39 #include "sbr_qmf.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
40 #include "sbr_hfgen.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
41 #include "sbr_hfadj.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
42
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
43
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
44 sbr_info *sbrDecodeInit(uint16_t framelength
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
45 #ifdef DRM
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
46 , uint8_t IsDRM
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
47 #endif
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
48 )
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
49 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
50 sbr_info *sbr = malloc(sizeof(sbr_info));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
51 memset(sbr, 0, sizeof(sbr_info));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
52
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
53 sbr->bs_freq_scale = 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
54 sbr->bs_alter_scale = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
55 sbr->bs_noise_bands = 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
56 sbr->bs_limiter_bands = 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
57 sbr->bs_limiter_gains = 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
58 sbr->bs_interpol_freq = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
59 sbr->bs_smoothing_mode = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
60 sbr->bs_start_freq = 5;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
61 sbr->bs_amp_res = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
62 sbr->bs_samplerate_mode = 1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
63 sbr->prevEnvIsShort[0] = -1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
64 sbr->prevEnvIsShort[1] = -1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
65 sbr->header_count = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
66
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
67 #ifdef DRM
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
68 sbr->Is_DRM_SBR = 0;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
69 if (IsDRM)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
70 {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
71 sbr->Is_DRM_SBR = 1;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
72 sbr->tHFGen = T_HFGEN_DRM;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
73 sbr->tHFAdj = T_HFADJ_DRM;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
74
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
75 /* "offset" is different in DRM */
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
76 sbr->bs_samplerate_mode = 0;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
77 } else
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
78 #endif
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
79 {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
80 sbr->bs_samplerate_mode = 1;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
81 sbr->tHFGen = T_HFGEN;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
82 sbr->tHFAdj = T_HFADJ;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
83 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
84
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
85 /* force sbr reset */
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
86 sbr->bs_start_freq_prev = -1;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
87
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
88 if (framelength == 960)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
89 {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
90 sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
91 sbr->numTimeSlots = NO_TIME_SLOTS_960;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
92 } else {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
93 sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
94 sbr->numTimeSlots = NO_TIME_SLOTS;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
95 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
96
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
97 return sbr;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
98 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
99
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
100 void sbrDecodeEnd(sbr_info *sbr)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
101 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
102 uint8_t j;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
103
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
104 if (sbr)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
105 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
106 qmfa_end(sbr->qmfa[0]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
107 qmfs_end(sbr->qmfs[0]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
108 if (sbr->id_aac == ID_CPE)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
109 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
110 qmfa_end(sbr->qmfa[1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
111 qmfs_end(sbr->qmfs[1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
112 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
113
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
114 if (sbr->Xcodec[0]) free(sbr->Xcodec[0]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
115 if (sbr->Xsbr[0]) free(sbr->Xsbr[0]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
116 if (sbr->Xcodec[1]) free(sbr->Xcodec[1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
117 if (sbr->Xsbr[1]) free(sbr->Xsbr[1]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
118
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
119 for (j = 0; j < 5; j++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
120 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
121 if (sbr->G_temp_prev[0][j]) free(sbr->G_temp_prev[0][j]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
122 if (sbr->Q_temp_prev[0][j]) free(sbr->Q_temp_prev[0][j]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
123 if (sbr->G_temp_prev[1][j]) free(sbr->G_temp_prev[1][j]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
124 if (sbr->Q_temp_prev[1][j]) free(sbr->Q_temp_prev[1][j]);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
125 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
126
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
127 free(sbr);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
128 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
129 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
130
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
131 void sbr_save_prev_data(sbr_info *sbr, uint8_t ch)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
132 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
133 uint8_t i;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
134
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
135 /* save data for next frame */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
136 sbr->kx_prev = sbr->kx;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
137
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
138 sbr->L_E_prev[ch] = sbr->L_E[ch];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
139
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
140 sbr->f_prev[ch] = sbr->f[ch][sbr->L_E[ch] - 1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
141 for (i = 0; i < 64; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
142 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
143 sbr->E_prev[ch][i] = sbr->E[ch][i][sbr->L_E[ch] - 1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
144 sbr->Q_prev[ch][i] = sbr->Q[ch][i][sbr->L_Q[ch] - 1];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
145 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
146
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
147 for (i = 0; i < 64; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
148 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
149 sbr->bs_add_harmonic_prev[ch][i] = sbr->bs_add_harmonic[ch][i];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
150 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
151 sbr->bs_add_harmonic_flag_prev[ch] = sbr->bs_add_harmonic_flag[ch];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
152
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
153 if (sbr->l_A[ch] == sbr->L_E[ch])
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
154 sbr->prevEnvIsShort[ch] = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
155 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
156 sbr->prevEnvIsShort[ch] = -1;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
157 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
158
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
159 void sbrDecodeFrame(sbr_info *sbr, real_t *left_channel,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
160 real_t *right_channel, uint8_t id_aac,
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
161 uint8_t just_seeked, uint8_t upsample_only)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
162 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
163 int16_t i, k, l;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
164
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
165 uint8_t dont_process = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
166 uint8_t ch, channels, ret;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
167 real_t *ch_buf;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
168
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
169 qmf_t X[32*64];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
170 #ifdef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
171 real_t deg[64];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
172 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
173
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
174 bitfile *ld = NULL;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
175
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
176 sbr->id_aac = id_aac;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
177 channels = (id_aac == ID_SCE) ? 1 : 2;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
178
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
179 if (sbr->data == NULL || sbr->data_size == 0)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
180 {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
181 ret = 1;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
182 } else {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
183 ld = (bitfile*)malloc(sizeof(bitfile));
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
184
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
185 /* initialise and read the bitstream */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
186 faad_initbits(ld, sbr->data, sbr->data_size);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
187
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
188 ret = sbr_extension_data(ld, sbr, id_aac);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
189
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
190 ret = ld->error ? ld->error : ret;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
191 faad_endbits(ld);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
192 if (ld) free(ld);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
193 ld = NULL;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
194 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
195
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
196 if (sbr->data) free(sbr->data);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
197 sbr->data = NULL;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
198
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
199 if (ret || (sbr->header_count == 0))
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
200 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
201 /* don't process just upsample */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
202 dont_process = 1;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
203
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
204 /* Re-activate reset for next frame */
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
205 if (ret && sbr->Reset)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
206 sbr->bs_start_freq_prev = -1;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
207 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
208
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
209 if (just_seeked)
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
210 {
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
211 sbr->just_seeked = 1;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
212 } else {
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
213 sbr->just_seeked = 0;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
214 }
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
215
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
216 for (ch = 0; ch < channels; ch++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
217 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
218 if (sbr->frame == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
219 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
220 uint8_t j;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
221 sbr->qmfa[ch] = qmfa_init(32);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
222 sbr->qmfs[ch] = qmfs_init(64);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
223
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
224 for (j = 0; j < 5; j++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
225 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
226 sbr->G_temp_prev[ch][j] = malloc(64*sizeof(real_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
227 sbr->Q_temp_prev[ch][j] = malloc(64*sizeof(real_t));
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
228 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
229
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
230 sbr->Xsbr[ch] = malloc((sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
231 sbr->Xcodec[ch] = malloc((sbr->numTimeSlotsRate+sbr->tHFGen)*32 * sizeof(qmf_t));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
232
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
233 memset(sbr->Xsbr[ch], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
234 memset(sbr->Xcodec[ch], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*32 * sizeof(qmf_t));
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
235 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
236
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
237 if (ch == 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
238 ch_buf = left_channel;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
239 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
240 ch_buf = right_channel;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
241
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
242 #if 0
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
243 for (i = 0; i < sbr->tHFAdj; i++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
244 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
245 int8_t j;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
246 for (j = sbr->kx_prev; j < sbr->kx; j++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
247 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
248 QMF_RE(sbr->Xcodec[ch][i*32 + j]) = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
249 #ifndef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
250 QMF_IM(sbr->Xcodec[ch][i*32 + j]) = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
251 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
252 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
253 }
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
254 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
255
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
256 /* subband analysis */
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
257 if (dont_process)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
258 sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], ch_buf, sbr->Xcodec[ch], sbr->tHFGen, 32);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
259 else
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
260 sbr_qmf_analysis_32(sbr, sbr->qmfa[ch], ch_buf, sbr->Xcodec[ch], sbr->tHFGen, sbr->kx);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
261
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
262 if (!dont_process)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
263 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
264 /* insert high frequencies here */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
265 /* hf generation using patching */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
266 hf_generation(sbr, sbr->Xcodec[ch], sbr->Xsbr[ch]
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
267 #ifdef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
268 ,deg
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
269 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
270 ,ch);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
271
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
272 #ifdef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
273 for (l = sbr->t_E[ch][0]; l < sbr->t_E[ch][sbr->L_E[ch]]; l++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
274 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
275 for (k = 0; k < sbr->kx; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
276 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
277 QMF_RE(sbr->Xsbr[ch][(sbr->tHFAdj + l)*64 + k]) = 0;
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
278 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
279 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
280 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
281
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
282 #if 1
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
283 /* hf adjustment */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
284 hf_adjustment(sbr, sbr->Xsbr[ch]
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
285 #ifdef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
286 ,deg
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
287 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
288 ,ch);
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
289 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
290 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
291
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
292 if ((sbr->just_seeked != 0) || dont_process)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
293 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
294 for (l = 0; l < sbr->numTimeSlotsRate; l++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
295 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
296 for (k = 0; k < 32; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
297 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
298 QMF_RE(X[l * 64 + k]) = QMF_RE(sbr->Xcodec[ch][(l + sbr->tHFAdj)*32 + k]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
299 #ifndef SBR_LOW_POWER
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
300 QMF_IM(X[l * 64 + k]) = QMF_IM(sbr->Xcodec[ch][(l + sbr->tHFAdj)*32 + k]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
301 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
302 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
303 for (k = 32; k < 64; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
304 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
305 QMF_RE(X[l * 64 + k]) = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
306 #ifndef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
307 QMF_IM(X[l * 64 + k]) = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
308 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
309 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
310 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
311 } else {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
312 for (l = 0; l < sbr->numTimeSlotsRate; l++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
313 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
314 uint8_t xover_band;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
315
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
316 if (l < sbr->t_E[ch][0])
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
317 xover_band = sbr->kx_prev;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
318 else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
319 xover_band = sbr->kx;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
320
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
321 #ifdef DRM
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
322 if (sbr->Is_DRM_SBR)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
323 xover_band = sbr->kx;
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
324 #endif
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
325
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
326 for (k = 0; k < xover_band; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
327 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
328 QMF_RE(X[l * 64 + k]) = QMF_RE(sbr->Xcodec[ch][(l + sbr->tHFAdj)*32 + k]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
329 #ifndef SBR_LOW_POWER
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
330 QMF_IM(X[l * 64 + k]) = QMF_IM(sbr->Xcodec[ch][(l + sbr->tHFAdj)*32 + k]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
331 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
332 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
333 for (k = xover_band; k < 64; k++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
334 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
335 QMF_RE(X[l * 64 + k]) = QMF_RE(sbr->Xsbr[ch][(l + sbr->tHFAdj)*64 + k]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
336 #ifndef SBR_LOW_POWER
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
337 QMF_IM(X[l * 64 + k]) = QMF_IM(sbr->Xsbr[ch][(l + sbr->tHFAdj)*64 + k]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
338 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
339 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
340 #ifdef SBR_LOW_POWER
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
341 QMF_RE(X[l * 64 + xover_band - 1]) += QMF_RE(sbr->Xsbr[ch][(l + sbr->tHFAdj)*64 + xover_band - 1]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
342 #endif
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
343 #ifdef DRM
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
344 if (sbr->Is_DRM_SBR)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
345 {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
346 for (k = xover_band; k < xover_band + 4; k++)
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
347 {
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
348 QMF_RE(X[l * 64 + k]) += QMF_RE(sbr->Xcodec[ch][(l + sbr->tHFAdj)*32 + k]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
349 QMF_IM(X[l * 64 + k]) += QMF_IM(sbr->Xcodec[ch][(l + sbr->tHFAdj)*32 + k]);
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
350 }
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
351 }
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
352 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
353 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
354 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
355
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
356 /* subband synthesis */
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
357 sbr_qmf_synthesis_64(sbr, sbr->qmfs[ch], (const complex_t*)X, ch_buf);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
358
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
359 for (i = 0; i < 32; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
360 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
361 int8_t j;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
362 for (j = 0; j < sbr->tHFGen; j++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
363 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
364 QMF_RE(sbr->Xcodec[ch][j*32 + i]) = QMF_RE(sbr->Xcodec[ch][(j+sbr->numTimeSlotsRate)*32 + i]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
365 #ifndef SBR_LOW_POWER
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
366 QMF_IM(sbr->Xcodec[ch][j*32 + i]) = QMF_IM(sbr->Xcodec[ch][(j+sbr->numTimeSlotsRate)*32 + i]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
367 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
368 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
369 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
370 for (i = 0; i < 64; i++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
371 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
372 int8_t j;
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
373 for (j = 0; j < sbr->tHFGen; j++)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
374 {
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
375 QMF_RE(sbr->Xsbr[ch][j*64 + i]) = QMF_RE(sbr->Xsbr[ch][(j+sbr->numTimeSlotsRate)*64 + i]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
376 #ifndef SBR_LOW_POWER
10989
3185f64f6350 synced with current cvs
alex
parents: 10725
diff changeset
377 QMF_IM(sbr->Xsbr[ch][j*64 + i]) = QMF_IM(sbr->Xsbr[ch][(j+sbr->numTimeSlotsRate)*64 + i]);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
378 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
379 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
380 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
381 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
382
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
383 if (sbr->bs_header_flag)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
384 sbr->just_seeked = 0;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
385
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
386 if (sbr->header_count != 0)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
387 {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
388 for (ch = 0; ch < channels; ch++)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
389 sbr_save_prev_data(sbr, ch);
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
390 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
391
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
392 sbr->frame++;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
393 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
394
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
395 #endif