FFmpeg
Loading...
Searching...
No Matches
aacenc_tns.c
Go to the documentation of this file.
1/*
2 * AAC encoder TNS
3 * Copyright (C) 2015 Rostislav Pehlivanov
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22/**
23 * @file
24 * AAC encoder temporal noise shaping
25 * @author Rostislav Pehlivanov ( atomnuker gmail com )
26 */
27
28#include <math.h>
29
30#include "aacenc.h"
31#include <float.h>
32#include "aacenc_tns.h"
33#include "aactab.h"
34#include "aacenc_utils.h"
35#include "lpc_functions.h"
36
37/* Could be set to 3 to save an additional bit at the cost of little quality */
38#define TNS_Q_BITS 4
39
40/* Coefficient resolution in short windows */
41#define TNS_Q_BITS_IS8 4
42
43/* We really need the bits we save here elsewhere */
44#define TNS_ENABLE_COEF_COMPRESSION
45
46/* Apple-derived TNS: weighted-spectrum predictor, accepted only if the measured
47 * post-quantization prediction gain clears a block-type-dependent bar (Apple RE). */
48#define TNS_PREDGAIN_GATE 1.4f /* first gate: predicted LPC gain */
49#define TNS_PG_C1_LONG 1.4f /* min measured gain, long blocks */
50#define TNS_PG_C1_SHORT 3.2f /* min measured gain, short blocks */
51#define TNS_PG_CLAMP 6.0f /* upper bound: poles near unit circle → noise blowup */
52#define TNS_WEIGHT_FLOOR 0.01f /* per-bin masking floor for the weighted spectrum */
53
54static inline int compress_coeffs(int *coef, int order, int c_bits)
55{
56 int i;
57 const int low_idx = c_bits ? 4 : 2;
58 const int shift_val = c_bits ? 8 : 4;
59 const int high_idx = c_bits ? 11 : 5;
60#ifndef TNS_ENABLE_COEF_COMPRESSION
61 return 0;
62#endif /* TNS_ENABLE_COEF_COMPRESSION */
63 for (i = 0; i < order; i++)
64 if (coef[i] >= low_idx && coef[i] <= high_idx)
65 return 0;
66 for (i = 0; i < order; i++)
67 coef[i] -= (coef[i] > high_idx) ? shift_val : 0;
68 return 1;
69}
70
71/** Encode TNS data. */
73{
74 TemporalNoiseShaping *tns = &sce->tns;
75 int i, w, filt, coef_compress = 0, coef_len;
76 const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE;
77 const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4;
78
79 if (!sce->tns.present)
80 return;
81
82 for (i = 0; i < sce->ics.num_windows; i++) {
83 put_bits(&s->pb, 2 - is8, sce->tns.n_filt[i]);
84 if (!tns->n_filt[i])
85 continue;
86 put_bits(&s->pb, 1, c_bits);
87 for (filt = 0; filt < tns->n_filt[i]; filt++) {
88 put_bits(&s->pb, 6 - 2 * is8, tns->length[i][filt]);
89 put_bits(&s->pb, 5 - 2 * is8, tns->order[i][filt]);
90 if (!tns->order[i][filt])
91 continue;
92 put_bits(&s->pb, 1, tns->direction[i][filt]);
93 coef_compress = compress_coeffs(tns->coef_idx[i][filt],
94 tns->order[i][filt], c_bits);
95 put_bits(&s->pb, 1, coef_compress);
96 coef_len = c_bits + 3 - coef_compress;
97 for (w = 0; w < tns->order[i][filt]; w++)
98 put_bits(&s->pb, coef_len, tns->coef_idx[i][filt][w]);
99 }
100 }
101}
102
103/* Cap the TNS band range at the first PNS band to avoid TNS+PNS conflicts. */
104static int tns_max_nonpns(const SingleChannelElement *sce, int mmm)
105{
106 for (int w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])
107 for (int g = 0; g < mmm; g++)
108 if (sce->band_type[w*16+g] == NOISE_BT) { mmm = g; break; }
109 return mmm;
110}
111
112/* Apply TNS filter */
114{
115 TemporalNoiseShaping *tns = &sce->tns;
116 IndividualChannelStream *ics = &sce->ics;
117 int w, filt, m, i, top, order, bottom, start, end, size, inc;
118 const int mmm = tns_max_nonpns(sce, FFMIN(ics->tns_max_bands, ics->max_sfb));
119 float lpc[TNS_MAX_ORDER];
120
121 /* TNS predicts from the post-M/S and post-I/S coefficients. */
122 float hist[1024];
123 memcpy(hist, sce->coeffs, sizeof(hist));
124
125 for (w = 0; w < ics->num_windows; w++) {
126 bottom = ics->num_swb;
127 for (filt = 0; filt < tns->n_filt[w]; filt++) {
128 int b0, e0;
129 top = bottom;
130 bottom = FFMAX(0, top - tns->length[w][filt]);
131 order = tns->order[w][filt];
132 if (order == 0)
133 continue;
134
135 // tns_decode_coef
136 compute_lpc_coefs(tns->coef[w][filt], 0, order, lpc, 0, 0, 0, NULL);
137
138 b0 = FFMIN(bottom, mmm);
139 e0 = FFMIN( top, mmm);
140 start = ics->swb_offset[b0];
141 end = ics->swb_offset[e0];
142 if ((size = end - start) <= 0)
143 continue;
144 if (tns->direction[w][filt]) {
145 inc = -1;
146 start = end - 1;
147 } else {
148 inc = 1;
149 }
150 start += w * 128;
151
152 /* AR filter */
153 for (m = 0; m < size; m++, start += inc) {
154 for (i = 1; i <= FFMIN(m, order); i++) {
155 sce->coeffs[start] += lpc[i-1]*hist[start - i*inc];
156 }
157 }
158
159 }
160 }
161}
162
163/*
164 * c_bits - 1 if 4 bit coefficients, 0 if 3 bit coefficients
165 */
166static inline void quantize_coefs(double *coef, int *idx, float *lpc, int order,
167 int c_bits)
168{
169 int i;
170 const float *quant_arr = ff_tns_tmp2_map[c_bits];
171 for (i = 0; i < order; i++) {
172 idx[i] = quant_array_idx(coef[i], quant_arr, c_bits ? 16 : 8);
173 lpc[i] = quant_arr[idx[i]];
174 }
175}
176
177/*
178 * 3 bits per coefficient with 8 short windows
179 */
180/* Short blocks, pooled per group: one filter per scalefactor group so the
181 * shared sf sees uniform residuals (per-window filters caused silent
182 * sub-windows); all-or-none accept. */
184{
185 TemporalNoiseShaping *tns = &sce->tns;
186 const int mmm = tns_max_nonpns(sce, FFMIN(sce->ics.tns_max_bands, sce->ics.max_sfb ? sce->ics.max_sfb : sce->ics.num_swb));
187 const int sfb_start = av_clip(tns_min_sfb[1][s->samplerate_index], 0, mmm);
188 const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm);
189 const int c_bits = TNS_Q_BITS_IS8 == 4;
190 int count = 0;
191 FFPsyBand *const psy_bands = &s->psy.ch[s->cur_channel].psy_bands[0];
192
193 memset(tns, 0, sizeof(*tns));
194 if (sfb_end - sfb_start <= 0)
195 return;
196 const int c_lo = sce->ics.swb_offset[sfb_start];
197 const int c_hi = sce->ics.swb_offset[sfb_end];
198 const int clen = c_hi - c_lo;
199 const int ord_g = 7;
200 if (clen <= 2*ord_g)
201 return;
202
203 for (int wh = 0; wh < sce->ics.num_windows; wh += sce->ics.group_len[wh]) {
204 int gl = sce->ics.group_len[wh];
205 double coefs[MAX_LPC_ORDER];
206 float pooled[1024], lpc_q[TNS_MAX_ORDER];
207 float gain, gmin;
208 int ok = 1;
209
210 /* per-window weighted spectra, concatenated over the group */
211 for (int w2 = 0; w2 < gl; w2++) {
212 int w = wh + w2;
213 float maxrms = 0.0f, floorrms;
214 for (int g = sfb_start; g < sfb_end; g++) {
215 int s0 = sce->ics.swb_offset[g], s1 = sce->ics.swb_offset[g+1];
216 float rms = sqrtf(FFMAX(psy_bands[w*16 + g].threshold, 0.0f) / FFMAX(s1 - s0, 1));
217 maxrms = FFMAX(maxrms, rms);
218 }
219 floorrms = FFMAX(maxrms * TNS_WEIGHT_FLOOR, 1e-9f);
220 for (int g = sfb_start; g < sfb_end; g++) {
221 int s0 = sce->ics.swb_offset[g], s1 = sce->ics.swb_offset[g+1];
222 float rms = sqrtf(FFMAX(psy_bands[w*16 + g].threshold, 0.0f) / FFMAX(s1 - s0, 1));
223 float wgt = 1.0f / FFMAX(rms, floorrms);
224 for (int k = s0; k < s1; k++)
225 pooled[w2*clen + (k - c_lo)] = sce->coeffs[w*128 + k] * wgt;
226 }
227 }
228
229 gain = ff_lpc_calc_ref_coefs_f(&s->lpc, pooled, clen*gl, ord_g, coefs, 0);
230 if (!isfinite(gain) || gain < TNS_PREDGAIN_GATE || gain > TNS_PG_CLAMP)
231 continue;
232 for (int i = 0; i < ord_g; i++)
233 coefs[i] = -coefs[i];
234
235 quantize_coefs(coefs, tns->coef_idx[wh][0], tns->coef[wh][0], ord_g, c_bits);
236 compute_lpc_coefs(tns->coef[wh][0], 0, ord_g, lpc_q, 0, 0, 0, NULL);
237
238 /* every window must clear the measured post-quantization bar */
239 gmin = FLT_MAX;
240 for (int w2 = 0; w2 < gl; w2++) {
241 const float *msrc = pooled + w2*clen;
242 float orig_e = 0.0f, filt_e = 0.0f;
243 for (int m = 0; m < clen; m++) {
244 float acc = msrc[m];
245 for (int i = 1; i <= FFMIN(m, ord_g); i++)
246 acc += lpc_q[i-1] * msrc[m - i];
247 orig_e += msrc[m]*msrc[m];
248 filt_e += acc*acc;
249 }
250 gmin = FFMIN(gmin, orig_e / FFMAX(filt_e, 1e-9f));
251 }
252 {
253 /* accept Schmitt, run-scoped: hard entry / easy hold inside
254 * short runs (anti-gravel); isolated frames use the base bar */
255 int in_run = s->nmr ? s->nmr->prev_was_short : 0;
256 int prev_on = s->nmr ? s->nmr->tns8_prev[s->cur_channel & 15] : 0;
257 float bar = TNS_PG_C1_SHORT * (!in_run ? 1.0f : prev_on ? 0.5f : 1.8f);
258 if (gmin < bar)
259 ok = 0;
260 }
261
262 if (ok) {
263 for (int w2 = 0; w2 < gl; w2++) {
264 int w = wh + w2;
265 tns->n_filt[w] = 1;
266 tns->length[w][0] = sfb_end - sfb_start;
267 tns->order[w][0] = ord_g;
268 tns->direction[w][0] = 0;
269 if (w2) {
270 memcpy(tns->coef_idx[w][0], tns->coef_idx[wh][0], sizeof(tns->coef_idx[w][0]));
271 memcpy(tns->coef[w][0], tns->coef[wh][0], sizeof(tns->coef[w][0]));
272 }
273 count++;
274 }
275 }
276 }
277 sce->tns.present = !!count;
278 if (s->nmr)
279 s->nmr->tns8_prev[s->cur_channel & 15] = !!count;
280}
281
283{
284 TemporalNoiseShaping *tns = &sce->tns;
285 int w, count = 0;
286 const int mmm = tns_max_nonpns(sce, FFMIN(sce->ics.tns_max_bands, sce->ics.max_sfb));
287 const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE;
288 const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4;
289 const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm);
290 const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm);
291 const int order = is8 ? 7 : 12;
292 const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 :
293 sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2;
294 const int sfb_len = sfb_end - sfb_start;
295 const int coef_len = sce->ics.swb_offset[sfb_end] - sce->ics.swb_offset[sfb_start];
296 const int n_filt = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
297 const int ord_g = order / n_filt;
298
299 /* Apple's accept bar (minimum measured prediction gain): higher on short blocks,
300 * where a weak filter's shaped-noise tail spreads across the 50% overlap. */
301 const float c1 = is8 ? TNS_PG_C1_SHORT : TNS_PG_C1_LONG;
302 FFPsyBand *const psy_bands = &s->psy.ch[s->cur_channel].psy_bands[0];
303
304 if (coef_len <= 0 || sfb_len <= 0) {
305 sce->tns.present = 0;
306 return;
307 }
308 if (is8) {
310 return;
311 }
312
313 /* time-domain window length backing one coding window: a long MDCT block is
314 * fed 2048 windowed samples (current 1024 + overlap), each short block 256. */
315 const int tlen = is8 ? 256 : 2048;
316
317 float mgain[8] = {0};
318
319 for (w = 0; w < sce->ics.num_windows; w++) {
320 int filt, any = 0;
321
322 /* The filter gets ran in the direction of the signal's *temporal* energy,
323 * so the quantization noise stays in the loud masked part rather than spilling
324 * into the quiet part. */
325 const float *tw = sce->ret_buf + w*tlen;
326 float e_early = 0.0f, e_late = 0.0f;
327 int ti;
328 for (ti = 0; ti < tlen/2; ti++)
329 e_early += tw[ti]*tw[ti];
330 for (; ti < tlen; ti++)
331 e_late += tw[ti]*tw[ti];
332 const int tdir = e_early > e_late;
333
334 /* Walk the frequency regions exactly as the decoder does: filter 0 is the
335 * topmost band region, each subsequent filter covers the next region down,
336 * clamped to mmm. Each filter gets its own LPC over its own region. */
337 int top_sfb = sce->ics.num_swb;
338 for (filt = 0; filt < n_filt; filt++) {
339 double coefs[MAX_LPC_ORDER];
340 float wspec[1024], tmp[1024], lpc_q[TNS_MAX_ORDER];
341 int len_sfb = (filt == n_filt - 1) ? sfb_len - filt*(sfb_len/n_filt)
342 : sfb_len/n_filt;
343 int bot_sfb = FFMAX(0, top_sfb - len_sfb);
344 int g_lo = FFMIN(bot_sfb, mmm), g_hi = FFMIN(top_sfb, mmm);
345 int c_lo = sce->ics.swb_offset[g_lo];
346 int c_hi = sce->ics.swb_offset[g_hi];
347 int clen = c_hi - c_lo;
348 const int dir = slant != 2 ? slant : tdir;
349 float gain, orig_e = 0.0f, filt_e = 0.0f;
350 int m, i, g, inc, st;
351
352 tns->length[w][filt] = len_sfb;
353 tns->order[w][filt] = 0; /* default: region carries no filter */
354 top_sfb = bot_sfb;
355
356 if (clen <= 2*ord_g) /* too short for a stable order-ord_g LPC */
357 continue;
358
359 /* Fit LPC on the perceptually-weighted spectrum X/sqrt(thr), floored
360 * to avoid a near-zero threshold blowing up a single bin (Apple). */
361 {
362 float maxrms = 0.0f, floorrms;
363 int k;
364 for (g = g_lo; g < g_hi; g++) {
365 int s0 = sce->ics.swb_offset[g], s1 = sce->ics.swb_offset[g+1];
366 float rms = sqrtf(FFMAX(psy_bands[w*16 + g].threshold, 0.0f) /
367 FFMAX(s1 - s0, 1));
368 maxrms = FFMAX(maxrms, rms);
369 }
370 floorrms = FFMAX(maxrms * TNS_WEIGHT_FLOOR, 1e-9f);
371 for (g = g_lo; g < g_hi; g++) {
372 int s0 = sce->ics.swb_offset[g], s1 = sce->ics.swb_offset[g+1];
373 float rms = sqrtf(FFMAX(psy_bands[w*16 + g].threshold, 0.0f) /
374 FFMAX(s1 - s0, 1));
375 float wgt = 1.0f / FFMAX(rms, floorrms);
376 for (k = s0; k < s1; k++)
377 wspec[k - c_lo] = sce->coeffs[w*128 + k] * wgt;
378 }
379 /* Short blocks: unwindowed fit; Hann window zeros the edges of the
380 * tiny region, wrecking the LPC. Long blocks keep the window. */
381 gain = ff_lpc_calc_ref_coefs_f(&s->lpc, wspec, clen, ord_g, coefs, !is8);
382 }
383 /* Reject below the first gate and above the clamp (poles near unit circle). */
384 if (!isfinite(gain) || gain < TNS_PREDGAIN_GATE || gain > TNS_PG_CLAMP)
385 continue;
386 /* Negate: ff_lpc_calc_ref_coefs_f sign convention is opposite to what
387 * ff_aac_apply_tns's MA filter needs; fed unnegated, it anti-whitens. */
388 for (i = 0; i < ord_g; i++)
389 coefs[i] = -coefs[i];
390
391 /* Quantize, then build the decoder's direct-form LPC. */
392 quantize_coefs(coefs, tns->coef_idx[w][filt], tns->coef[w][filt],
393 ord_g, c_bits);
394 compute_lpc_coefs(tns->coef[w][filt], 0, ord_g, lpc_q, 0, 0, 0, NULL);
395
396 /* Apply the quantized filter to the weighted spectrum and measure gain. */
397 const float *msrc = wspec;
398 inc = dir ? -1 : 1;
399 st = dir ? clen - 1 : 0;
400 for (m = 0; m < clen; m++) {
401 int idx = st + m*inc;
402 float acc = msrc[idx];
403 for (i = 1; i <= FFMIN(m, ord_g); i++)
404 acc += lpc_q[i-1] * msrc[idx - i*inc];
405 tmp[idx] = acc;
406 }
407 for (m = 0; m < clen; m++) {
408 orig_e += msrc[m]*msrc[m];
409 filt_e += tmp[m]*tmp[m];
410 }
411 filt_e = FFMAX(filt_e, 1e-9f);
412
413 /* Keep only if measured post-quantization gain clears C1 (Apple's outcome gate). */
414 if (orig_e < c1*filt_e)
415 continue;
416
417 tns->order[w][filt] = ord_g;
418 tns->direction[w][filt] = dir;
419 mgain[w] = orig_e / filt_e;
420 any = 1;
421 }
422 tns->n_filt[w] = any ? n_filt : 0;
423 if (any)
424 count++;
425 }
426
427 /* per-window path: group-uniformity gate (mismatched whitening within a
428 * shared-sf group silences sub-windows) */
429 if (is8 && count) {
430 const float gspread = 2.0f;
431 count = 0;
432 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
433 int gl = sce->ics.group_len[w], drop = 0;
434 float gmin = FLT_MAX, gmax = 0.0f;
435 for (int w2 = w; w2 < w + gl; w2++) {
436 if (!tns->n_filt[w2] || mgain[w2] <= 0.0f) { drop = 1; break; }
437 gmin = FFMIN(gmin, mgain[w2]);
438 gmax = FFMAX(gmax, mgain[w2]);
439 }
440 if (!drop && gmax > gspread * gmin)
441 drop = 1;
442 for (int w2 = w; w2 < w + gl; w2++) {
443 if (drop) {
444 tns->n_filt[w2] = 0;
445 for (int f2 = 0; f2 < n_filt; f2++)
446 tns->order[w2][f2] = 0;
447 } else if (tns->n_filt[w2]) {
448 count++;
449 }
450 }
451 }
452 }
453 sce->tns.present = !!count;
454}
@ EIGHT_SHORT_SEQUENCE
Definition aac.h:66
@ LONG_STOP_SEQUENCE
Definition aac.h:67
@ LONG_START_SEQUENCE
Definition aac.h:65
@ NOISE_BT
Spectral data are scaled white noise not coded in the bitstream.
Definition aac.h:75
#define TNS_MAX_ORDER
Definition aac.h:36
#define TNS_Q_BITS_IS8
Definition aacenc_tns.c:41
#define TNS_Q_BITS
Definition aacenc_tns.c:38
#define TNS_WEIGHT_FLOOR
Definition aacenc_tns.c:52
#define TNS_PG_C1_SHORT
Definition aacenc_tns.c:50
#define TNS_PG_CLAMP
Definition aacenc_tns.c:51
void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
Definition aacenc_tns.c:282
static int tns_max_nonpns(const SingleChannelElement *sce, int mmm)
Definition aacenc_tns.c:104
void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce)
Encode TNS data.
Definition aacenc_tns.c:72
static void quantize_coefs(double *coef, int *idx, float *lpc, int order, int c_bits)
Definition aacenc_tns.c:166
static void search_for_tns_short_pooled(AACEncContext *s, SingleChannelElement *sce)
Definition aacenc_tns.c:183
#define TNS_PG_C1_LONG
Definition aacenc_tns.c:49
static int compress_coeffs(int *coef, int order, int c_bits)
Definition aacenc_tns.c:54
void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce)
Definition aacenc_tns.c:113
AAC encoder temporal noise shaping.
AAC encoder utilities.
static int quant_array_idx(const float val, const float *arr, const int num)
static const uint8_t *const tns_min_sfb[2]
Definition aacenctab.h:125
const float *const ff_tns_tmp2_map[4]
Definition aactab.c:142
AAC data declarations.
static const int8_t filt[NUMTAPS *2]
Definition af_earwax.c:40
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define av_clip
Definition common.h:100
#define NULL
Definition coverity.c:32
static __device__ float sqrtf(float a)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
Definition j2kenc.c:154
double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len, int order, double *ref, int apply_window)
Definition lpc.c:209
uint8_t w
Definition llvidencdsp.c:39
#define MAX_LPC_ORDER
Definition lpc.h:37
static int compute_lpc_coefs(const LPC_TYPE *autoc, int i, int max_order, LPC_TYPE *lpc, int lpc_stride, int fail, int normalize, LPC_TYPE *err_ptr)
Levinson-Durbin recursion.
#define FFMIN(a, b)
Definition macros.h:49
#define FFMAX(a, b)
Definition macros.h:47
static const uint64_t c1
Definition murmur3.c:52
static int inc(int num, int period)
Definition perlin.c:34
AAC encoder context.
Definition aacenc.h:260
single band psychoacoustic information
Definition psymodel.h:50
Individual Channel Stream.
Definition aacdec.h:169
uint8_t max_sfb
number of scalefactor bands per group
Definition aacdec.h:170
int num_swb
number of scalefactor window bands
Definition aacdec.h:178
uint8_t group_len[8]
Definition aacdec.h:175
enum WindowSequence window_sequence[2]
Definition aacdec.h:171
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
Definition aacdec.h:177
Single Channel Element - used for both SCE and LFE elements.
Definition aacdec.h:217
float coeffs[1024]
coefficients for IMDCT, maybe processed
Definition aacenc.h:122
TemporalNoiseShaping tns
Definition aacdec.h:220
float ret_buf[2048]
PCM output buffer.
Definition aacenc.h:123
enum BandType band_type[128]
band types
Definition aacdec.h:221
IndividualChannelStream ics
Definition aacdec.h:218
Temporal Noise Shaping.
Definition aacdec.h:191
int direction[8][4]
Definition aacdec.h:195
int length[8][4]
Definition aacdec.h:194
int order[8][4]
Definition aacdec.h:196
float coef[8][4][TNS_MAX_ORDER]
Definition aacenc.h:104
int coef_idx[8][4][TNS_MAX_ORDER]
Definition aacenc.h:103
static uint8_t tmp[40]
Definition aes_ctr.c:52
int size
const char * g
Definition vf_curves.c:128
static double b0(void *priv, double x, double y)
Definition vf_xfade.c:2033