[prev in list] [next in list] [prev in thread] [next in thread]
List: xine-cvslog
Subject: [xine-cvs] HG: xine-lib-1.2-plugin-loader: [30/35] Merge from 1.2
From: Darren Salt <linux () youmustbejoking ! demon ! co ! uk>
Date: 2007-06-21 22:31:50
Message-ID: 3e9d711a77870cbbca8d.1182464857:30 () hg ! debian ! org
[Download RAW message or body]
# [node df73844e8a47005bef76ffe6cd9323d8e6a1c218 part 30]
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_hfadj.c
--- a/src/libfaad/sbr_hfadj.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1720 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfadj.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* High Frequency adjustment */
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "sbr_hfadj.h"
-
-#include "sbr_noise.h"
-
-
-/* static function declarations */
-static void estimate_current_envelope(sbr_info *sbr, sbr_hfadj_info *adj,
- qmf_t Xsbr[MAX_NTSRHFG][64], uint8_t ch);
-static void calculate_gain(sbr_info *sbr, sbr_hfadj_info *adj, uint8_t ch);
-#ifdef SBR_LOW_POWER
-static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, \
uint8_t ch);
-static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, \
uint8_t ch);
-#endif
-static void hf_assembly(sbr_info *sbr, sbr_hfadj_info *adj, qmf_t \
Xsbr[MAX_NTSRHFG][64], uint8_t ch);
-
-
-void hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg /* aliasing degree */
-#endif
- ,uint8_t ch)
-{
- ALIGN sbr_hfadj_info adj = {{{0}}};
-
- if (sbr->bs_frame_class[ch] == FIXFIX)
- {
- sbr->l_A[ch] = -1;
- } else if (sbr->bs_frame_class[ch] == VARFIX) {
- if (sbr->bs_pointer[ch] > 1)
- sbr->l_A[ch] = -1;
- else
- sbr->l_A[ch] = sbr->bs_pointer[ch] - 1;
- } else {
- if (sbr->bs_pointer[ch] == 0)
- sbr->l_A[ch] = -1;
- else
- sbr->l_A[ch] = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
- }
-
- estimate_current_envelope(sbr, &adj, Xsbr, ch);
-
- calculate_gain(sbr, &adj, ch);
-
-#ifdef SBR_LOW_POWER
- calc_gain_groups(sbr, &adj, deg, ch);
- aliasing_reduction(sbr, &adj, deg, ch);
-#endif
-
- hf_assembly(sbr, &adj, Xsbr, ch);
-}
-
-static uint8_t get_S_mapped(sbr_info *sbr, uint8_t ch, uint8_t l, uint8_t \
current_band)
-{
- if (sbr->f[ch][l] == HI_RES)
- {
- /* in case of using f_table_high we just have 1 to 1 mapping
- * from bs_add_harmonic[l][k]
- */
- if ((l >= sbr->l_A[ch]) ||
- (sbr->bs_add_harmonic_prev[ch][current_band] && \
sbr->bs_add_harmonic_flag_prev[ch]))
- {
- return sbr->bs_add_harmonic[ch][current_band];
- }
- } else {
- uint8_t b, lb, ub;
-
- /* in case of f_table_low we check if any of the HI_RES bands
- * within this LO_RES band has bs_add_harmonic[l][k] turned on
- * (note that borders in the LO_RES table are also present in
- * the HI_RES table)
- */
-
- /* find first HI_RES band in current LO_RES band */
- lb = 2*current_band - ((sbr->N_high & 1) ? 1 : 0);
- /* find first HI_RES band in next LO_RES band */
- ub = 2*(current_band+1) - ((sbr->N_high & 1) ? 1 : 0);
-
- /* check all HI_RES bands in current LO_RES band for sinusoid */
- for (b = lb; b < ub; b++)
- {
- if ((l >= sbr->l_A[ch]) ||
- (sbr->bs_add_harmonic_prev[ch][b] && \
sbr->bs_add_harmonic_flag_prev[ch]))
- {
- if (sbr->bs_add_harmonic[ch][b] == 1)
- return 1;
- }
- }
- }
-
[... 1468 lines omitted ...]
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, \
QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
- + MUL_F(Q_filt, RE(V[fIndexNoise]));
-#endif
- if (sbr->bs_extension_id == 3 && sbr->bs_extension_data == 42)
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = 16428320;
-#ifndef SBR_LOW_POWER
-#ifndef FIXED_POINT
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = G_filt * QMF_IM(Xsbr[i + \
sbr->tHFAdj][m+sbr->kx])
- + MUL_F(Q_filt, IM(V[fIndexNoise]));
-#else
- //QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_Q2(G_filt, \
QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
- // + MUL_F(Q_filt, IM(V[fIndexNoise]));
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) = MUL_R(G_filt, \
QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]))
- + MUL_F(Q_filt, IM(V[fIndexNoise]));
-#endif
-#endif
-
- {
- int8_t rev = (((m + sbr->kx) & 1) ? -1 : 1);
- QMF_RE(psi) = adj->S_M_boost[l][m] * phi_re[fIndexSine];
-#ifdef FIXED_POINT
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += (QMF_RE(psi) << \
REAL_BITS);
-#else
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_RE(psi);
-#endif
-
-#ifndef SBR_LOW_POWER
- QMF_IM(psi) = rev * adj->S_M_boost[l][m] * phi_im[fIndexSine];
-#ifdef FIXED_POINT
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += (QMF_IM(psi) << \
REAL_BITS);
-#else
- QMF_IM(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) += QMF_IM(psi);
-#endif
-#else
-
- i_min1 = (fIndexSine - 1) & 3;
- i_plus1 = (fIndexSine + 1) & 3;
-
-#ifndef FIXED_POINT
- if ((m == 0) && (phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
- (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][0], \
FRAC_CONST(0.00815)));
- if (sbr->M != 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][1], \
FRAC_CONST(0.00815)));
- }
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && \
(phi_re[i_min1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - 1], \
FRAC_CONST(0.00815)));
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && \
(phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * MUL_F(adj->S_M_boost[l][m + 1], \
FRAC_CONST(0.00815)));
- }
- if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != \
0))
- {
- if (m > 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m - \
1], FRAC_CONST(0.00815)));
- }
- if (m + sbr->kx < 64)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
- (rev*phi_re[i_min1] * MUL_F(adj->S_M_boost[l][m], \
FRAC_CONST(0.00815)));
- }
- }
-#else
- if ((m == 0) && (phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx - 1]) +=
- (rev*phi_re[i_plus1] * \
MUL_F((adj->S_M_boost[l][0]<<REAL_BITS), FRAC_CONST(0.00815)));
- if (sbr->M != 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * \
MUL_F((adj->S_M_boost[l][1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && \
(phi_re[i_min1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m - \
1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- if ((m > 0) && (m < sbr->M - 1) && (sinusoids < 16) && \
(phi_re[i_plus1] != 0))
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_plus1] * MUL_F((adj->S_M_boost[l][m + \
1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- if ((m == sbr->M - 1) && (sinusoids < 16) && (phi_re[i_min1] != \
0))
- {
- if (m > 0)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx]) -=
- (rev*phi_re[i_min1] * MUL_F((adj->S_M_boost[l][m - \
1]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- if (m + sbr->kx < 64)
- {
- QMF_RE(Xsbr[i + sbr->tHFAdj][m+sbr->kx + 1]) +=
- (rev*phi_re[i_min1] * \
MUL_F((adj->S_M_boost[l][m]<<REAL_BITS), FRAC_CONST(0.00815)));
- }
- }
-#endif
-
- if (adj->S_M_boost[l][m] != 0)
- sinusoids++;
-#endif
- }
- }
-
- fIndexSine = (fIndexSine + 1) & 3;
-
- /* update the ringbuffer index used for filtering G and Q with h_smooth \
*/
- sbr->GQ_ringbuf_index[ch]++;
- if (sbr->GQ_ringbuf_index[ch] >= 5)
- sbr->GQ_ringbuf_index[ch] = 0;
- }
- }
-
- sbr->index_noise_prev[ch] = fIndexNoise;
- sbr->psi_is_prev[ch] = fIndexSine;
-}
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_hfadj.h
--- a/src/libfaad/sbr_hfadj.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfadj.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_HFADJ_H__
-#define __SBR_HFADJ_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct
-{
- real_t G_lim_boost[MAX_L_E][MAX_M];
- real_t Q_M_lim_boost[MAX_L_E][MAX_M];
- real_t S_M_boost[MAX_L_E][MAX_M];
-} sbr_hfadj_info;
-
-
-void hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg
-#endif
- ,uint8_t ch);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_hfgen.c
--- a/src/libfaad/sbr_hfgen.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,666 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfgen.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* High Frequency generation */
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "sbr_hfgen.h"
-#include "sbr_fbt.h"
-
-
-/* static function declarations */
-#ifdef SBR_LOW_POWER
-static void calc_prediction_coef_lp(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- complex_t *alpha_0, complex_t *alpha_1, real_t \
*rxx);
-static void calc_aliasing_degree(sbr_info *sbr, real_t *rxx, real_t *deg);
-#else
-static void calc_prediction_coef(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- complex_t *alpha_0, complex_t *alpha_1, uint8_t k);
-#endif
-static void calc_chirp_factors(sbr_info *sbr, uint8_t ch);
-static void patch_construction(sbr_info *sbr);
-
-
-void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- qmf_t Xhigh[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg
-#endif
- ,uint8_t ch)
-{
- uint8_t l, i, x;
- ALIGN complex_t alpha_0[64], alpha_1[64];
-#ifdef SBR_LOW_POWER
- ALIGN real_t rxx[64];
-#endif
-
- uint8_t offset = sbr->tHFAdj;
- uint8_t first = sbr->t_E[ch][0];
- uint8_t last = sbr->t_E[ch][sbr->L_E[ch]];
-
- calc_chirp_factors(sbr, ch);
-
-#ifdef SBR_LOW_POWER
- memset(deg, 0, 64*sizeof(real_t));
-#endif
-
- if ((ch == 0) && (sbr->Reset))
- patch_construction(sbr);
-
- /* calculate the prediction coefficients */
-#ifdef SBR_LOW_POWER
- calc_prediction_coef_lp(sbr, Xlow, alpha_0, alpha_1, rxx);
- calc_aliasing_degree(sbr, rxx, deg);
-#endif
-
- /* actual HF generation */
- for (i = 0; i < sbr->noPatches; i++)
- {
- for (x = 0; x < sbr->patchNoSubbands[i]; x++)
- {
- real_t a0_r, a0_i, a1_r, a1_i;
- real_t bw, bw2;
- uint8_t q, p, k, g;
-
- /* find the low and high band for patching */
- k = sbr->kx + x;
- for (q = 0; q < i; q++)
- {
- k += sbr->patchNoSubbands[q];
- }
- p = sbr->patchStartSubband[i] + x;
-
-#ifdef SBR_LOW_POWER
- if (x != 0 /*x < sbr->patchNoSubbands[i]-1*/)
- deg[k] = deg[p];
- else
- deg[k] = 0;
-#endif
-
- g = sbr->table_map_k_to_g[k];
-
- bw = sbr->bwArray[ch][g];
- bw2 = MUL_C(bw, bw);
-
- /* do the patching */
- /* with or without filtering */
- if (bw2 > 0)
- {
- real_t temp1_r, temp2_r, temp3_r;
-#ifndef SBR_LOW_POWER
- real_t temp1_i, temp2_i, temp3_i;
- calc_prediction_coef(sbr, Xlow, alpha_0, alpha_1, p);
-#endif
-
- a0_r = MUL_C(RE(alpha_0[p]), bw);
[... 414 lines omitted ...]
- {
- deg[k-1] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
- }
- } else if (rxx[k-2] < COEF_CONST(0.0)) {
- deg[k] = COEF_CONST(1.0) - MUL_C(rxx[k-1], rxx[k-1]);
- }
- }
- }
-}
-#endif
-
-/* FIXED POINT: bwArray = COEF */
-static real_t mapNewBw(uint8_t invf_mode, uint8_t invf_mode_prev)
-{
- switch (invf_mode)
- {
- case 1: /* LOW */
- if (invf_mode_prev == 0) /* NONE */
- return COEF_CONST(0.6);
- else
- return COEF_CONST(0.75);
-
- case 2: /* MID */
- return COEF_CONST(0.9);
-
- case 3: /* HIGH */
- return COEF_CONST(0.98);
-
- default: /* NONE */
- if (invf_mode_prev == 1) /* LOW */
- return COEF_CONST(0.6);
- else
- return COEF_CONST(0.0);
- }
-}
-
-/* FIXED POINT: bwArray = COEF */
-static void calc_chirp_factors(sbr_info *sbr, uint8_t ch)
-{
- uint8_t i;
-
- for (i = 0; i < sbr->N_Q; i++)
- {
- sbr->bwArray[ch][i] = mapNewBw(sbr->bs_invf_mode[ch][i], \
sbr->bs_invf_mode_prev[ch][i]);
-
- if (sbr->bwArray[ch][i] < sbr->bwArray_prev[ch][i])
- sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.75)) + \
MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.25));
- else
- sbr->bwArray[ch][i] = MUL_F(sbr->bwArray[ch][i], FRAC_CONST(0.90625)) + \
MUL_F(sbr->bwArray_prev[ch][i], FRAC_CONST(0.09375));
-
- if (sbr->bwArray[ch][i] < COEF_CONST(0.015625))
- sbr->bwArray[ch][i] = COEF_CONST(0.0);
-
- if (sbr->bwArray[ch][i] >= COEF_CONST(0.99609375))
- sbr->bwArray[ch][i] = COEF_CONST(0.99609375);
-
- sbr->bwArray_prev[ch][i] = sbr->bwArray[ch][i];
- sbr->bs_invf_mode_prev[ch][i] = sbr->bs_invf_mode[ch][i];
- }
-}
-
-static void patch_construction(sbr_info *sbr)
-{
- uint8_t i, k;
- uint8_t odd, sb;
- uint8_t msb = sbr->k0;
- uint8_t usb = sbr->kx;
- uint8_t goalSbTab[] = { 21, 23, 32, 43, 46, 64, 85, 93, 128, 0, 0, 0 };
- /* (uint8_t)(2.048e6/sbr->sample_rate + 0.5); */
- uint8_t goalSb = goalSbTab[get_sr_index(sbr->sample_rate)];
-
- sbr->noPatches = 0;
-
- if (goalSb < (sbr->kx + sbr->M))
- {
- for (i = 0, k = 0; sbr->f_master[i] < goalSb; i++)
- k = i+1;
- } else {
- k = sbr->N_master;
- }
-
- if (sbr->N_master == 0)
- {
- sbr->noPatches = 0;
- sbr->patchNoSubbands[0] = 0;
- sbr->patchStartSubband[0] = 0;
-
- return;
- }
-
- do
- {
- uint8_t j = k + 1;
-
- do
- {
- j--;
-
- sb = sbr->f_master[j];
- odd = (sb - 2 + sbr->k0) % 2;
- } while (sb > (sbr->k0 - 1 + msb - odd));
-
- sbr->patchNoSubbands[sbr->noPatches] = max(sb - usb, 0);
- sbr->patchStartSubband[sbr->noPatches] = sbr->k0 - odd -
- sbr->patchNoSubbands[sbr->noPatches];
-
- if (sbr->patchNoSubbands[sbr->noPatches] > 0)
- {
- usb = sb;
- msb = sb;
- sbr->noPatches++;
- } else {
- msb = sbr->kx;
- }
-
- if (sbr->f_master[k] - sb < 3)
- k = sbr->N_master;
- } while (sb != (sbr->kx + sbr->M));
-
- if ((sbr->patchNoSubbands[sbr->noPatches-1] < 3) && (sbr->noPatches > 1))
- {
- sbr->noPatches--;
- }
-
- sbr->noPatches = min(sbr->noPatches, 5);
-}
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_hfgen.h
--- a/src/libfaad/sbr_hfgen.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_hfgen.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_HFGEN_H__
-#define __SBR_HFGEN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
- qmf_t Xhigh[MAX_NTSRHFG][64]
-#ifdef SBR_LOW_POWER
- ,real_t *deg
-#endif
- ,uint8_t ch);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_huff.c
--- a/src/libfaad/sbr_huff.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,357 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_huff.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "bits.h"
-#include "sbr_huff.h"
-#include "sbr_e_nf.h"
-
-
-typedef const int8_t (*sbr_huff_tab)[2];
-
-static const int8_t t_huffman_env_1_5dB[120][2] = {
- { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
- { 5, 6 }, { -62, -67 }, { 7, 8 }, { -61, -68 },
- { 9, 10 }, { -60, -69 }, { 11, 12 }, { -59, -70 },
- { 13, 14 }, { -58, -71 }, { 15, 16 }, { -57, -72 },
- { 17, 18 }, { -73, -56 }, { 19, 21 }, { -74, 20 },
- { -55, -75 }, { 22, 26 }, { 23, 24 }, { -54, -76 },
- { -77, 25 }, { -53, -78 }, { 27, 34 }, { 28, 29 },
- { -52, -79 }, { 30, 31 }, { -80, -51 }, { 32, 33 },
- { -83, -82 }, { -81, -50 }, { 35, 57 }, { 36, 40 },
- { 37, 38 }, { -88, -84 }, { -48, 39 }, { -90, -85 },
- { 41, 46 }, { 42, 43 }, { -49, -87 }, { 44, 45 },
- { -89, -86 }, {-124,-123 }, { 47, 50 }, { 48, 49 },
- {-122,-121 }, {-120,-119 }, { 51, 54 }, { 52, 53 },
- {-118,-117 }, {-116,-115 }, { 55, 56 }, {-114,-113 },
- {-112,-111 }, { 58, 89 }, { 59, 74 }, { 60, 67 },
- { 61, 64 }, { 62, 63 }, {-110,-109 }, {-108,-107 },
- { 65, 66 }, {-106,-105 }, {-104,-103 }, { 68, 71 },
- { 69, 70 }, {-102,-101 }, {-100, -99 }, { 72, 73 },
- { -98, -97 }, { -96, -95 }, { 75, 82 }, { 76, 79 },
- { 77, 78 }, { -94, -93 }, { -92, -91 }, { 80, 81 },
- { -47, -46 }, { -45, -44 }, { 83, 86 }, { 84, 85 },
- { -43, -42 }, { -41, -40 }, { 87, 88 }, { -39, -38 },
- { -37, -36 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
- { 93, 94 }, { -35, -34 }, { -33, -32 }, { 96, 97 },
- { -31, -30 }, { -29, -28 }, { 99, 102 }, { 100, 101 },
- { -27, -26 }, { -25, -24 }, { 103, 104 }, { -23, -22 },
- { -21, -20 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
- { -19, -18 }, { -17, -16 }, { 111, 112 }, { -15, -14 },
- { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
- { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
-};
-
-static const int8_t f_huffman_env_1_5dB[120][2] = {
- { 1, 2 }, { -64, -65 }, { 3, 4 }, { -63, -66 },
- { 5, 6 }, { -67, -62 }, { 7, 8 }, { -68, -61 },
- { 9, 10 }, { -69, -60 }, { 11, 13 }, { -70, 12 },
- { -59, -71 }, { 14, 16 }, { -58, 15 }, { -72, -57 },
- { 17, 19 }, { -73, 18 }, { -56, -74 }, { 20, 23 },
- { 21, 22 }, { -55, -75 }, { -54, -53 }, { 24, 27 },
- { 25, 26 }, { -76, -52 }, { -77, -51 }, { 28, 31 },
- { 29, 30 }, { -50, -78 }, { -79, -49 }, { 32, 36 },
- { 33, 34 }, { -48, -47 }, { -80, 35 }, { -81, -82 },
- { 37, 47 }, { 38, 41 }, { 39, 40 }, { -83, -46 },
- { -45, -84 }, { 42, 44 }, { -85, 43 }, { -44, -43 },
- { 45, 46 }, { -88, -87 }, { -86, -90 }, { 48, 66 },
- { 49, 56 }, { 50, 53 }, { 51, 52 }, { -92, -42 },
- { -41, -39 }, { 54, 55 }, {-105, -89 }, { -38, -37 },
- { 57, 60 }, { 58, 59 }, { -94, -91 }, { -40, -36 },
- { 61, 63 }, { -20, 62 }, {-115,-110 }, { 64, 65 },
- {-108,-107 }, {-101, -97 }, { 67, 89 }, { 68, 75 },
- { 69, 72 }, { 70, 71 }, { -95, -93 }, { -34, -27 },
- { 73, 74 }, { -22, -17 }, { -16,-124 }, { 76, 82 },
- { 77, 79 }, {-123, 78 }, {-122,-121 }, { 80, 81 },
- {-120,-119 }, {-118,-117 }, { 83, 86 }, { 84, 85 },
- {-116,-114 }, {-113,-112 }, { 87, 88 }, {-111,-109 },
- {-106,-104 }, { 90, 105 }, { 91, 98 }, { 92, 95 },
- { 93, 94 }, {-103,-102 }, {-100, -99 }, { 96, 97 },
- { -98, -96 }, { -35, -33 }, { 99, 102 }, { 100, 101 },
- { -32, -31 }, { -30, -29 }, { 103, 104 }, { -28, -26 },
- { -25, -24 }, { 106, 113 }, { 107, 110 }, { 108, 109 },
- { -23, -21 }, { -19, -18 }, { 111, 112 }, { -15, -14 },
- { -13, -12 }, { 114, 117 }, { 115, 116 }, { -11, -10 },
- { -9, -8 }, { 118, 119 }, { -7, -6 }, { -5, -4 }
-};
-
-static const int8_t t_huffman_env_bal_1_5dB[48][2] = {
- { -64, 1 }, { -63, 2 }, { -65, 3 }, { -62, 4 },
- { -66, 5 }, { -61, 6 }, { -67, 7 }, { -60, 8 },
- { -68, 9 }, { 10, 11 }, { -69, -59 }, { 12, 13 },
- { -70, -58 }, { 14, 28 }, { 15, 21 }, { 16, 18 },
- { -57, 17 }, { -71, -56 }, { 19, 20 }, { -88, -87 },
- { -86, -85 }, { 22, 25 }, { 23, 24 }, { -84, -83 },
- { -82, -81 }, { 26, 27 }, { -80, -79 }, { -78, -77 },
- { 29, 36 }, { 30, 33 }, { 31, 32 }, { -76, -75 },
- { -74, -73 }, { 34, 35 }, { -72, -55 }, { -54, -53 },
- { 37, 41 }, { 38, 39 }, { -52, -51 }, { -50, 40 },
- { -49, -48 }, { 42, 45 }, { 43, 44 }, { -47, -46 },
- { -45, -44 }, { 46, 47 }, { -43, -42 }, { -41, -40 }
-};
-
-static const int8_t f_huffman_env_bal_1_5dB[48][2] = {
- { -64, 1 }, { -65, 2 }, { -63, 3 }, { -66, 4 },
- { -62, 5 }, { -61, 6 }, { -67, 7 }, { -68, 8 },
[... 105 lines omitted ...]
- index = t_huff[index][bit];
- }
-
- return index + 64;
-}
-
-/* table 10 */
-void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t env, band;
- int8_t delta = 0;
- sbr_huff_tab t_huff, f_huff;
-
- if ((sbr->L_E[ch] == 1) && (sbr->bs_frame_class[ch] == FIXFIX))
- sbr->amp_res[ch] = 0;
- else
- sbr->amp_res[ch] = sbr->bs_amp_res;
-
- if ((sbr->bs_coupling) && (ch == 1))
- {
- delta = 1;
- if (sbr->amp_res[ch])
- {
- t_huff = t_huffman_env_bal_3_0dB;
- f_huff = f_huffman_env_bal_3_0dB;
- } else {
- t_huff = t_huffman_env_bal_1_5dB;
- f_huff = f_huffman_env_bal_1_5dB;
- }
- } else {
- delta = 0;
- if (sbr->amp_res[ch])
- {
- t_huff = t_huffman_env_3_0dB;
- f_huff = f_huffman_env_3_0dB;
- } else {
- t_huff = t_huffman_env_1_5dB;
- f_huff = f_huffman_env_1_5dB;
- }
- }
-
- for (env = 0; env < sbr->L_E[ch]; env++)
- {
- if (sbr->bs_df_env[ch][env] == 0)
- {
- if ((sbr->bs_coupling == 1) && (ch == 1))
- {
- if (sbr->amp_res[ch])
- {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 5
- DEBUGVAR(1,272,"sbr_envelope(): bs_data_env")) << delta);
- } else {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
- DEBUGVAR(1,273,"sbr_envelope(): bs_data_env")) << delta);
- }
- } else {
- if (sbr->amp_res[ch])
- {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 6
- DEBUGVAR(1,274,"sbr_envelope(): bs_data_env")) << delta);
- } else {
- sbr->E[ch][0][env] = (uint16_t)(faad_getbits(ld, 7
- DEBUGVAR(1,275,"sbr_envelope(): bs_data_env")) << delta);
- }
- }
-
- for (band = 1; band < sbr->n[sbr->f[ch][env]]; band++)
- {
- sbr->E[ch][band][env] = (sbr_huff_dec(ld, f_huff) << delta);
- }
-
- } else {
- for (band = 0; band < sbr->n[sbr->f[ch][env]]; band++)
- {
- sbr->E[ch][band][env] = (sbr_huff_dec(ld, t_huff) << delta);
- }
- }
- }
-
- extract_envelope_data(sbr, ch);
-}
-
-/* table 11 */
-void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t noise, band;
- int8_t delta = 0;
- sbr_huff_tab t_huff, f_huff;
-
- if ((sbr->bs_coupling == 1) && (ch == 1))
- {
- delta = 1;
- t_huff = t_huffman_noise_bal_3_0dB;
- f_huff = f_huffman_env_bal_3_0dB;
- } else {
- delta = 0;
- t_huff = t_huffman_noise_3_0dB;
- f_huff = f_huffman_env_3_0dB;
- }
-
- for (noise = 0; noise < sbr->L_Q[ch]; noise++)
- {
- if(sbr->bs_df_noise[ch][noise] == 0)
- {
- if ((sbr->bs_coupling == 1) && (ch == 1))
- {
- sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
- DEBUGVAR(1,276,"sbr_noise(): bs_data_noise")) << delta);
- } else {
- sbr->Q[ch][0][noise] = (faad_getbits(ld, 5
- DEBUGVAR(1,277,"sbr_noise(): bs_data_noise")) << delta);
- }
- for (band = 1; band < sbr->N_Q; band++)
- {
- sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, f_huff) << delta);
- }
- } else {
- for (band = 0; band < sbr->N_Q; band++)
- {
- sbr->Q[ch][band][noise] = (sbr_huff_dec(ld, t_huff) << delta);
- }
- }
- }
-
- extract_noise_floor_data(sbr, ch);
-}
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_huff.h
--- a/src/libfaad/sbr_huff.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_huff.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_HUFF_H__
-#define __SBR_HUFF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch);
-void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_noise.h
--- a/src/libfaad/sbr_noise.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,561 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_noise.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_NOISE_H__
-#define __SBR_NOISE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-
-/* Table 1.A.13 Noise table V */
-ALIGN static const complex_t V[] = {
- { FRAC_CONST(-0.99948155879974), FRAC_CONST(-0.59483414888382) },
- { FRAC_CONST(0.97113454341888), FRAC_CONST(-0.67528516054153) },
- { FRAC_CONST(0.14130051434040), FRAC_CONST(-0.95090985298157) },
- { FRAC_CONST(-0.47005495429039), FRAC_CONST(-0.37340548634529) },
- { FRAC_CONST(0.80705064535141), FRAC_CONST(0.29653668403625) },
- { FRAC_CONST(-0.38981479406357), FRAC_CONST(0.89572608470917) },
- { FRAC_CONST(-0.01053049881011), FRAC_CONST(-0.66959059238434) },
- { FRAC_CONST(-0.91266369819641), FRAC_CONST(-0.11522938311100) },
- { FRAC_CONST(0.54840421676636), FRAC_CONST(0.75221365690231) },
- { FRAC_CONST(0.40009254217148), FRAC_CONST(-0.98929399251938) },
- { FRAC_CONST(-0.99867975711823), FRAC_CONST(-0.88147068023682) },
- { FRAC_CONST(-0.95531076192856), FRAC_CONST(0.90908759832382) },
- { FRAC_CONST(-0.45725932717323), FRAC_CONST(-0.56716322898865) },
- { FRAC_CONST(-0.72929674386978), FRAC_CONST(-0.98008275032043) },
- { FRAC_CONST(0.75622802972794), FRAC_CONST(0.20950329303741) },
- { FRAC_CONST(0.07069442421198), FRAC_CONST(-0.78247898817062) },
- { FRAC_CONST(0.74496251344681), FRAC_CONST(-0.91169005632401) },
- { FRAC_CONST(-0.96440184116364), FRAC_CONST(-0.94739919900894) },
- { FRAC_CONST(0.30424630641937), FRAC_CONST(-0.49438267946243) },
- { FRAC_CONST(0.66565030813217), FRAC_CONST(0.64652937650681) },
- { FRAC_CONST(0.91697007417679), FRAC_CONST(0.17514097690582) },
- { FRAC_CONST(-0.70774918794632), FRAC_CONST(0.52548652887344) },
- { FRAC_CONST(-0.70051413774490), FRAC_CONST(-0.45340028405190) },
- { FRAC_CONST(-0.99496513605118), FRAC_CONST(-0.90071910619736) },
- { FRAC_CONST(0.98164492845535), FRAC_CONST(-0.77463155984879) },
- { FRAC_CONST(-0.54671579599380), FRAC_CONST(-0.02570928446949) },
- { FRAC_CONST(-0.01689629070461), FRAC_CONST(0.00287506449968) },
- { FRAC_CONST(-0.86110347509384), FRAC_CONST(0.42548584938049) },
- { FRAC_CONST(-0.98892980813980), FRAC_CONST(-0.87881129980087) },
- { FRAC_CONST(0.51756626367569), FRAC_CONST(0.66926783323288) },
- { FRAC_CONST(-0.99635028839111), FRAC_CONST(-0.58107727766037) },
- { FRAC_CONST(-0.99969369173050), FRAC_CONST(0.98369991779327) },
- { FRAC_CONST(0.55266261100769), FRAC_CONST(0.59449058771133) },
- { FRAC_CONST(0.34581178426743), FRAC_CONST(0.94879418611526) },
- { FRAC_CONST(0.62664210796356), FRAC_CONST(-0.74402970075607) },
- { FRAC_CONST(-0.77149701118469), FRAC_CONST(-0.33883658051491) },
- { FRAC_CONST(-0.91592246294022), FRAC_CONST(0.03687901422381) },
- { FRAC_CONST(-0.76285493373871), FRAC_CONST(-0.91371870040894) },
- { FRAC_CONST(0.79788339138031), FRAC_CONST(-0.93180972337723) },
- { FRAC_CONST(0.54473078250885), FRAC_CONST(-0.11919206380844) },
- { FRAC_CONST(-0.85639280080795), FRAC_CONST(0.42429855465889) },
- { FRAC_CONST(-0.92882400751114), FRAC_CONST(0.27871808409691) },
- { FRAC_CONST(-0.11708371341228), FRAC_CONST(-0.99800843000412) },
- { FRAC_CONST(0.21356749534607), FRAC_CONST(-0.90716296434402) },
- { FRAC_CONST(-0.76191693544388), FRAC_CONST(0.99768120050430) },
- { FRAC_CONST(0.98111045360565), FRAC_CONST(-0.95854461193085) },
- { FRAC_CONST(-0.85913270711899), FRAC_CONST(0.95766568183899) },
- { FRAC_CONST(-0.93307244777679), FRAC_CONST(0.49431759119034) },
- { FRAC_CONST(0.30485755205154), FRAC_CONST(-0.70540034770966) },
- { FRAC_CONST(0.85289651155472), FRAC_CONST(0.46766132116318) },
- { FRAC_CONST(0.91328084468842), FRAC_CONST(-0.99839597940445) },
- { FRAC_CONST(-0.05890199914575), FRAC_CONST(0.70741826295853) },
- { FRAC_CONST(0.28398686647415), FRAC_CONST(0.34633556008339) },
- { FRAC_CONST(0.95258164405823), FRAC_CONST(-0.54893416166306) },
- { FRAC_CONST(-0.78566324710846), FRAC_CONST(-0.75568538904190) },
- { FRAC_CONST(-0.95789498090744), FRAC_CONST(-0.20423194766045) },
- { FRAC_CONST(0.82411158084869), FRAC_CONST(0.96654617786407) },
- { FRAC_CONST(-0.65185445547104), FRAC_CONST(-0.88734990358353) },
- { FRAC_CONST(-0.93643605709076), FRAC_CONST(0.99870789051056) },
- { FRAC_CONST(0.91427159309387), FRAC_CONST(-0.98290503025055) },
- { FRAC_CONST(-0.70395684242249), FRAC_CONST(0.58796799182892) },
- { FRAC_CONST(0.00563771976158), FRAC_CONST(0.61768198013306) },
- { FRAC_CONST(0.89065051078796), FRAC_CONST(0.52783352136612) },
- { FRAC_CONST(-0.68683707714081), FRAC_CONST(0.80806946754456) },
- { FRAC_CONST(0.72165340185165), FRAC_CONST(-0.69259858131409) },
- { FRAC_CONST(-0.62928247451782), FRAC_CONST(0.13627037405968) },
- { FRAC_CONST(0.29938435554504), FRAC_CONST(-0.46051329374313) },
- { FRAC_CONST(-0.91781955957413), FRAC_CONST(-0.74012714624405) },
- { FRAC_CONST(0.99298715591431), FRAC_CONST(0.40816611051559) },
- { FRAC_CONST(0.82368296384811), FRAC_CONST(-0.74036049842834) },
- { FRAC_CONST(-0.98512834310532), FRAC_CONST(-0.99972331523895) },
- { FRAC_CONST(-0.95915371179581), FRAC_CONST(-0.99237799644470) },
- { FRAC_CONST(-0.21411126852036), FRAC_CONST(-0.93424820899963) },
- { FRAC_CONST(-0.68821477890015), FRAC_CONST(-0.26892307400703) },
- { FRAC_CONST(0.91851997375488), FRAC_CONST(0.09358228743076) },
- { FRAC_CONST(-0.96062767505646), FRAC_CONST(0.36099094152451) },
- { FRAC_CONST(0.51646184921265), FRAC_CONST(-0.71373331546783) },
- { FRAC_CONST(0.61130720376968), FRAC_CONST(0.46950140595436) },
- { FRAC_CONST(0.47336128354073), FRAC_CONST(-0.27333179116249) },
- { FRAC_CONST(0.90998309850693), FRAC_CONST(0.96715664863586) },
- { FRAC_CONST(0.44844800233841), FRAC_CONST(0.99211573600769) },
- { FRAC_CONST(0.66614890098572), FRAC_CONST(0.96590173244476) },
[... 309 lines omitted ...]
- { FRAC_CONST(-0.01115998718888), FRAC_CONST(0.98496019840240) },
- { FRAC_CONST(-0.79598701000214), FRAC_CONST(0.97138410806656) },
- { FRAC_CONST(-0.99264711141586), FRAC_CONST(-0.99542820453644) },
- { FRAC_CONST(-0.99829661846161), FRAC_CONST(0.01877138763666) },
- { FRAC_CONST(-0.70801013708115), FRAC_CONST(0.33680686354637) },
- { FRAC_CONST(-0.70467054843903), FRAC_CONST(0.93272775411606) },
- { FRAC_CONST(0.99846023321152), FRAC_CONST(-0.98725748062134) },
- { FRAC_CONST(-0.63364970684052), FRAC_CONST(-0.16473594307899) },
- { FRAC_CONST(-0.16258217394352), FRAC_CONST(-0.95939123630524) },
- { FRAC_CONST(-0.43645593523979), FRAC_CONST(-0.94805032014847) },
- { FRAC_CONST(-0.99848473072052), FRAC_CONST(0.96245169639587) },
- { FRAC_CONST(-0.16796459257603), FRAC_CONST(-0.98987513780594) },
- { FRAC_CONST(-0.87979227304459), FRAC_CONST(-0.71725726127625) },
- { FRAC_CONST(0.44183099269867), FRAC_CONST(-0.93568974733353) },
- { FRAC_CONST(0.93310177326202), FRAC_CONST(-0.99913311004639) },
- { FRAC_CONST(-0.93941932916641), FRAC_CONST(-0.56409376859665) },
- { FRAC_CONST(-0.88590002059937), FRAC_CONST(0.47624599933624) },
- { FRAC_CONST(0.99971461296082), FRAC_CONST(-0.83889955282211) },
- { FRAC_CONST(-0.75376385450363), FRAC_CONST(0.00814643409103) },
- { FRAC_CONST(0.93887686729431), FRAC_CONST(-0.11284527927637) },
- { FRAC_CONST(0.85126435756683), FRAC_CONST(0.52349251508713) },
- { FRAC_CONST(0.39701420068741), FRAC_CONST(0.81779634952545) },
- { FRAC_CONST(-0.37024465203285), FRAC_CONST(-0.87071657180786) },
- { FRAC_CONST(-0.36024826765060), FRAC_CONST(0.34655734896660) },
- { FRAC_CONST(-0.93388813734055), FRAC_CONST(-0.84476542472839) },
- { FRAC_CONST(-0.65298801660538), FRAC_CONST(-0.18439576029778) },
- { FRAC_CONST(0.11960318684578), FRAC_CONST(0.99899345636368) },
- { FRAC_CONST(0.94292563199997), FRAC_CONST(0.83163905143738) },
- { FRAC_CONST(0.75081145763397), FRAC_CONST(-0.35533222556114) },
- { FRAC_CONST(0.56721979379654), FRAC_CONST(-0.24076835811138) },
- { FRAC_CONST(0.46857765316963), FRAC_CONST(-0.30140233039856) },
- { FRAC_CONST(0.97312313318253), FRAC_CONST(-0.99548190832138) },
- { FRAC_CONST(-0.38299977779388), FRAC_CONST(0.98516911268234) },
- { FRAC_CONST(0.41025799512863), FRAC_CONST(0.02116736955941) },
- { FRAC_CONST(0.09638062119484), FRAC_CONST(0.04411984235048) },
- { FRAC_CONST(-0.85283249616623), FRAC_CONST(0.91475564241409) },
- { FRAC_CONST(0.88866806030273), FRAC_CONST(-0.99735265970230) },
- { FRAC_CONST(-0.48202428221703), FRAC_CONST(-0.96805608272552) },
- { FRAC_CONST(0.27572581171989), FRAC_CONST(0.58634752035141) },
- { FRAC_CONST(-0.65889132022858), FRAC_CONST(0.58835631608963) },
- { FRAC_CONST(0.98838084936142), FRAC_CONST(0.99994349479675) },
- { FRAC_CONST(-0.20651349425316), FRAC_CONST(0.54593044519424) },
- { FRAC_CONST(-0.62126415967941), FRAC_CONST(-0.59893679618835) },
- { FRAC_CONST(0.20320105552673), FRAC_CONST(-0.86879181861877) },
- { FRAC_CONST(-0.97790551185608), FRAC_CONST(0.96290808916092) },
- { FRAC_CONST(0.11112534999847), FRAC_CONST(0.21484763920307) },
- { FRAC_CONST(-0.41368338465691), FRAC_CONST(0.28216838836670) },
- { FRAC_CONST(0.24133038520813), FRAC_CONST(0.51294362545013) },
- { FRAC_CONST(-0.66393411159515), FRAC_CONST(-0.08249679952860) },
- { FRAC_CONST(-0.53697830438614), FRAC_CONST(-0.97649902105331) },
- { FRAC_CONST(-0.97224736213684), FRAC_CONST(0.22081333398819) },
- { FRAC_CONST(0.87392479181290), FRAC_CONST(-0.12796173989773) },
- { FRAC_CONST(0.19050361216068), FRAC_CONST(0.01602615416050) },
- { FRAC_CONST(-0.46353441476822), FRAC_CONST(-0.95249038934708) },
- { FRAC_CONST(-0.07064096629620), FRAC_CONST(-0.94479805231094) },
- { FRAC_CONST(-0.92444086074829), FRAC_CONST(-0.10457590222359) },
- { FRAC_CONST(-0.83822596073151), FRAC_CONST(-0.01695043221116) },
- { FRAC_CONST(0.75214684009552), FRAC_CONST(-0.99955683946609) },
- { FRAC_CONST(-0.42102998495102), FRAC_CONST(0.99720942974091) },
- { FRAC_CONST(-0.72094786167145), FRAC_CONST(-0.35008960962296) },
- { FRAC_CONST(0.78843313455582), FRAC_CONST(0.52851396799088) },
- { FRAC_CONST(0.97394025325775), FRAC_CONST(-0.26695942878723) },
- { FRAC_CONST(0.99206465482712), FRAC_CONST(-0.57010120153427) },
- { FRAC_CONST(0.76789611577988), FRAC_CONST(-0.76519358158112) },
- { FRAC_CONST(-0.82002419233322), FRAC_CONST(-0.73530179262161) },
- { FRAC_CONST(0.81924992799759), FRAC_CONST(0.99698424339294) },
- { FRAC_CONST(-0.26719850301743), FRAC_CONST(0.68903368711472) },
- { FRAC_CONST(-0.43311259150505), FRAC_CONST(0.85321813821793) },
- { FRAC_CONST(0.99194979667664), FRAC_CONST(0.91876250505447) },
- { FRAC_CONST(-0.80691999197006), FRAC_CONST(-0.32627540826797) },
- { FRAC_CONST(0.43080005049706), FRAC_CONST(-0.21919095516205) },
- { FRAC_CONST(0.67709493637085), FRAC_CONST(-0.95478075742722) },
- { FRAC_CONST(0.56151771545410), FRAC_CONST(-0.70693808794022) },
- { FRAC_CONST(0.10831862688065), FRAC_CONST(-0.08628837019205) },
- { FRAC_CONST(0.91229414939880), FRAC_CONST(-0.65987348556519) },
- { FRAC_CONST(-0.48972892761230), FRAC_CONST(0.56289243698120) },
- { FRAC_CONST(-0.89033657312393), FRAC_CONST(-0.71656566858292) },
- { FRAC_CONST(0.65269446372986), FRAC_CONST(0.65916007757187) },
- { FRAC_CONST(0.67439478635788), FRAC_CONST(-0.81684380769730) },
- { FRAC_CONST(-0.47770830988884), FRAC_CONST(-0.16789555549622) },
- { FRAC_CONST(-0.99715977907181), FRAC_CONST(-0.93565785884857) },
- { FRAC_CONST(-0.90889590978622), FRAC_CONST(0.62034398317337) },
- { FRAC_CONST(-0.06618622690439), FRAC_CONST(-0.23812216520309) },
- { FRAC_CONST(0.99430269002914), FRAC_CONST(0.18812555074692) },
- { FRAC_CONST(0.97686403989792), FRAC_CONST(-0.28664535284042) },
- { FRAC_CONST(0.94813650846481), FRAC_CONST(-0.97506642341614) },
- { FRAC_CONST(-0.95434498786926), FRAC_CONST(-0.79607981443405) },
- { FRAC_CONST(-0.49104782938957), FRAC_CONST(0.32895213365555) },
- { FRAC_CONST(0.99881172180176), FRAC_CONST(0.88993984460831) },
- { FRAC_CONST(0.50449168682098), FRAC_CONST(-0.85995072126389) },
- { FRAC_CONST(0.47162890434265), FRAC_CONST(-0.18680204451084) },
- { FRAC_CONST(-0.62081581354141), FRAC_CONST(0.75000673532486) },
- { FRAC_CONST(-0.43867015838623), FRAC_CONST(0.99998068809509) },
- { FRAC_CONST(0.98630565404892), FRAC_CONST(-0.53578901290894) },
- { FRAC_CONST(-0.61510360240936), FRAC_CONST(-0.89515018463135) },
- { FRAC_CONST(-0.03841517493129), FRAC_CONST(-0.69888818264008) },
- { FRAC_CONST(-0.30102157592773), FRAC_CONST(-0.07667808979750) },
- { FRAC_CONST(0.41881284117699), FRAC_CONST(0.02188098989427) },
- { FRAC_CONST(-0.86135452985764), FRAC_CONST(0.98947483301163) },
- { FRAC_CONST(0.67226862907410), FRAC_CONST(-0.13494388759136) },
- { FRAC_CONST(-0.70737397670746), FRAC_CONST(-0.76547348499298) },
- { FRAC_CONST(0.94044947624207), FRAC_CONST(0.09026201069355) },
- { FRAC_CONST(-0.82386350631714), FRAC_CONST(0.08924768865108) },
- { FRAC_CONST(-0.32070666551590), FRAC_CONST(0.50143420696259) },
- { FRAC_CONST(0.57593160867691), FRAC_CONST(-0.98966425657272) },
- { FRAC_CONST(-0.36326017975807), FRAC_CONST(0.07440242916346) },
- { FRAC_CONST(0.99979043006897), FRAC_CONST(-0.14130286872387) },
- { FRAC_CONST(-0.92366021871567), FRAC_CONST(-0.97979295253754) },
- { FRAC_CONST(-0.44607177376747), FRAC_CONST(-0.54233253002167) },
- { FRAC_CONST(0.44226801395416), FRAC_CONST(0.71326756477356) },
- { FRAC_CONST(0.03671907261014), FRAC_CONST(0.63606387376785) },
- { FRAC_CONST(0.52175426483154), FRAC_CONST(-0.85396826267242) },
- { FRAC_CONST(-0.94701141119003), FRAC_CONST(-0.01826348155737) },
- { FRAC_CONST(-0.98759609460831), FRAC_CONST(0.82288712263107) },
- { FRAC_CONST(0.87434792518616), FRAC_CONST(0.89399492740631) },
- { FRAC_CONST(-0.93412041664124), FRAC_CONST(0.41374051570892) },
- { FRAC_CONST(0.96063941717148), FRAC_CONST(0.93116706609726) },
- { FRAC_CONST(0.97534251213074), FRAC_CONST(0.86150932312012) },
- { FRAC_CONST(0.99642467498779), FRAC_CONST(0.70190042257309) },
- { FRAC_CONST(-0.94705086946487), FRAC_CONST(-0.29580041766167) },
- { FRAC_CONST(0.91599804162979), FRAC_CONST(-0.98147833347321) }
-};
-
-#ifdef __cplusplus
-
-#endif
-#endif
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_qmf.c
--- a/src/libfaad/sbr_qmf.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,633 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_qmf.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-
-#include <stdlib.h>
-#include <string.h>
-#include "sbr_dct.h"
-#include "sbr_qmf.h"
-#include "sbr_qmf_c.h"
-#include "sbr_syntax.h"
-
-qmfa_info *qmfa_init(uint8_t channels)
-{
- qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info));
-
- /* x is implemented as double ringbuffer */
- qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t));
- memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t));
-
- /* ringbuffer index */
- qmfa->x_index = 0;
-
- qmfa->channels = channels;
-
- return qmfa;
-}
-
-void qmfa_end(qmfa_info *qmfa)
-{
- if (qmfa)
- {
- if (qmfa->x) faad_free(qmfa->x);
- faad_free(qmfa);
- }
-}
-
-void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
- qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx)
-{
- ALIGN real_t u[64];
-#ifndef SBR_LOW_POWER
- ALIGN real_t in_real[32], in_imag[32], out_real[32], out_imag[32];
-#else
- ALIGN real_t y[32];
-#endif
- uint16_t in = 0;
- uint8_t l;
-
- /* qmf subsample l */
- for (l = 0; l < sbr->numTimeSlotsRate; l++)
- {
- int16_t n;
-
- /* shift input buffer x */
- /* input buffer is not shifted anymore, x is implemented as double ringbuffer */
- //memmove(qmfa->x + 32, qmfa->x, (320-32)*sizeof(real_t));
-
- /* add new samples to input buffer x */
- for (n = 32 - 1; n >= 0; n--)
- {
-#ifdef FIXED_POINT
- qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = \
(input[in++]) >> 4;
-#else
- qmfa->x[qmfa->x_index + n] = qmfa->x[qmfa->x_index + n + 320] = \
input[in++];
-#endif
- }
-
- /* window and summation to create array u */
- for (n = 0; n < 64; n++)
- {
- u[n] = MUL_F(qmfa->x[qmfa->x_index + n], qmf_c[2*n]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 64], qmf_c[2*(n + 64)]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 128], qmf_c[2*(n + 128)]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 192], qmf_c[2*(n + 192)]) +
- MUL_F(qmfa->x[qmfa->x_index + n + 256], qmf_c[2*(n + 256)]);
- }
-
- /* update ringbuffer index */
- qmfa->x_index -= 32;
- if (qmfa->x_index < 0)
- qmfa->x_index = (320-32);
-
- /* calculate 32 subband samples by introducing X */
-#ifdef SBR_LOW_POWER
- y[0] = u[48];
- for (n = 1; n < 16; n++)
- y[n] = u[n+48] + u[48-n];
- for (n = 16; n < 32; n++)
- y[n] = -u[n-16] + u[48-n];
-
- DCT3_32_unscaled(u, y);
-
- for (n = 0; n < 32; n++)
- {
- if (n < kx)
[... 381 lines omitted ...]
- in_real1[31] = scale*QMF_RE(pX[62]);
- in_imag2[0] = scale*QMF_IM(pX[63-63]);
- in_real2[31] = scale*QMF_IM(pX[63-62]);
-
-#else
-
- pX = X[l];
-
- in_imag1[31] = QMF_RE(pX[1]) >> 1;
- in_real1[0] = QMF_RE(pX[0]) >> 1;
- in_imag2[31] = QMF_IM(pX[62]) >> 1;
- in_real2[0] = QMF_IM(pX[63]) >> 1;
- for (k = 1; k < 31; k++)
- {
- in_imag1[31 - k] = QMF_RE(pX[2*k + 1]) >> 1;
- in_real1[ k] = QMF_RE(pX[2*k ]) >> 1;
- in_imag2[31 - k] = QMF_IM(pX[63 - (2*k + 1)]) >> 1;
- in_real2[ k] = QMF_IM(pX[63 - (2*k )]) >> 1;
- }
- in_imag1[0] = QMF_RE(pX[63]) >> 1;
- in_real1[31] = QMF_RE(pX[62]) >> 1;
- in_imag2[0] = QMF_IM(pX[0]) >> 1;
- in_real2[31] = QMF_IM(pX[1]) >> 1;
-
-#endif
-
-
- // dct4_kernel is DCT_IV without reordering which is done before and after \
FFT
- dct4_kernel(in_real1, in_imag1, out_real1, out_imag1);
- dct4_kernel(in_real2, in_imag2, out_real2, out_imag2);
-
-
- pring_buffer_1 = qmfs->v + qmfs->v_index;
- pring_buffer_3 = pring_buffer_1 + 1280;
-#ifdef PREFER_POINTERS
- pring_buffer_2 = pring_buffer_1 + 127;
- pring_buffer_4 = pring_buffer_1 + (1280 + 127);
-#endif // #ifdef PREFER_POINTERS
-// ptemp_1 = x1;
-// ptemp_2 = x2;
-#ifdef PREFER_POINTERS
- for (n = 0; n < 32; n ++)
- {
- //real_t x1 = *ptemp_1++;
- //real_t x2 = *ptemp_2++;
- // pring_buffer_3 and pring_buffer_4 are needed only for double ring \
buffer
- *pring_buffer_1++ = *pring_buffer_3++ = out_real2[n] - out_real1[n];
- *pring_buffer_2-- = *pring_buffer_4-- = out_real2[n] + out_real1[n];
- //x1 = *ptemp_1++;
- //x2 = *ptemp_2++;
- *pring_buffer_1++ = *pring_buffer_3++ = out_imag2[31-n] + \
out_imag1[31-n];
- *pring_buffer_2-- = *pring_buffer_4-- = out_imag2[31-n] - \
out_imag1[31-n];
- }
-#else // #ifdef PREFER_POINTERS
-
- for (n = 0; n < 32; n++)
- {
- // pring_buffer_3 and pring_buffer_4 are needed only for double ring \
buffer
- pring_buffer_1[2*n] = pring_buffer_3[2*n] = out_real2[n] \
- out_real1[n];
- pring_buffer_1[127-2*n] = pring_buffer_3[127-2*n] = out_real2[n] \
+ out_real1[n];
- pring_buffer_1[2*n+1] = pring_buffer_3[2*n+1] = \
out_imag2[31-n] + out_imag1[31-n];
- pring_buffer_1[127-(2*n+1)] = pring_buffer_3[127-(2*n+1)] = \
out_imag2[31-n] - out_imag1[31-n];
- }
-
-#endif // #ifdef PREFER_POINTERS
-
- pring_buffer_1 = qmfs->v + qmfs->v_index;
-#ifdef PREFER_POINTERS
- pring_buffer_2 = pring_buffer_1 + 192;
- pring_buffer_3 = pring_buffer_1 + 256;
- pring_buffer_4 = pring_buffer_1 + (256 + 192);
- pring_buffer_5 = pring_buffer_1 + 512;
- pring_buffer_6 = pring_buffer_1 + (512 + 192);
- pring_buffer_7 = pring_buffer_1 + 768;
- pring_buffer_8 = pring_buffer_1 + (768 + 192);
- pring_buffer_9 = pring_buffer_1 + 1024;
- pring_buffer_10 = pring_buffer_1 + (1024 + 192);
- pqmf_c_1 = qmf_c;
- pqmf_c_2 = qmf_c + 64;
- pqmf_c_3 = qmf_c + 128;
- pqmf_c_4 = qmf_c + 192;
- pqmf_c_5 = qmf_c + 256;
- pqmf_c_6 = qmf_c + 320;
- pqmf_c_7 = qmf_c + 384;
- pqmf_c_8 = qmf_c + 448;
- pqmf_c_9 = qmf_c + 512;
- pqmf_c_10 = qmf_c + 576;
-#endif // #ifdef PREFER_POINTERS
-
- /* calculate 64 output samples and window */
- for (k = 0; k < 64; k++)
- {
-#ifdef PREFER_POINTERS
- output[out++] =
- MUL_F(*pring_buffer_1++, *pqmf_c_1++) +
- MUL_F(*pring_buffer_2++, *pqmf_c_2++) +
- MUL_F(*pring_buffer_3++, *pqmf_c_3++) +
- MUL_F(*pring_buffer_4++, *pqmf_c_4++) +
- MUL_F(*pring_buffer_5++, *pqmf_c_5++) +
- MUL_F(*pring_buffer_6++, *pqmf_c_6++) +
- MUL_F(*pring_buffer_7++, *pqmf_c_7++) +
- MUL_F(*pring_buffer_8++, *pqmf_c_8++) +
- MUL_F(*pring_buffer_9++, *pqmf_c_9++) +
- MUL_F(*pring_buffer_10++, *pqmf_c_10++);
-#else // #ifdef PREFER_POINTERS
- output[out++] =
- MUL_F(pring_buffer_1[k+0], qmf_c[k+0]) +
- MUL_F(pring_buffer_1[k+192], qmf_c[k+64]) +
- MUL_F(pring_buffer_1[k+256], qmf_c[k+128]) +
- MUL_F(pring_buffer_1[k+(256+192)], qmf_c[k+192]) +
- MUL_F(pring_buffer_1[k+512], qmf_c[k+256]) +
- MUL_F(pring_buffer_1[k+(512+192)], qmf_c[k+320]) +
- MUL_F(pring_buffer_1[k+768], qmf_c[k+384]) +
- MUL_F(pring_buffer_1[k+(768+192)], qmf_c[k+448]) +
- MUL_F(pring_buffer_1[k+1024], qmf_c[k+512]) +
- MUL_F(pring_buffer_1[k+(1024+192)], qmf_c[k+576]);
-#endif // #ifdef PREFER_POINTERS
- }
-
- /* update ringbuffer index */
- qmfs->v_index -= 128;
- if (qmfs->v_index < 0)
- qmfs->v_index = (1280 - 128);
- }
-}
-#endif
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_qmf.h
--- a/src/libfaad/sbr_qmf.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_qmf.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_QMF_H__
-#define __SBR_QMF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-qmfa_info *qmfa_init(uint8_t channels);
-void qmfa_end(qmfa_info *qmfa);
-qmfs_info *qmfs_init(uint8_t channels);
-void qmfs_end(qmfs_info *qmfs);
-
-void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
- qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx);
-void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output);
-void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
- real_t *output);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_qmf_c.h
--- a/src/libfaad/sbr_qmf_c.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_qmf_c.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_QMF_C_H__
-#define __SBR_QMF_C_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-ALIGN static const real_t qmf_c[640] = {
- FRAC_CONST(0), FRAC_CONST(-0.00055252865047),
- FRAC_CONST(-0.00056176925738), FRAC_CONST(-0.00049475180896),
- FRAC_CONST(-0.00048752279712), FRAC_CONST(-0.00048937912498),
- FRAC_CONST(-0.00050407143497), FRAC_CONST(-0.00052265642972),
- FRAC_CONST(-0.00054665656337), FRAC_CONST(-0.00056778025613),
- FRAC_CONST(-0.00058709304852), FRAC_CONST(-0.00061327473938),
- FRAC_CONST(-0.00063124935319), FRAC_CONST(-0.00065403333621),
- FRAC_CONST(-0.00067776907764), FRAC_CONST(-0.00069416146273),
- FRAC_CONST(-0.00071577364744), FRAC_CONST(-0.00072550431222),
- FRAC_CONST(-0.00074409418541), FRAC_CONST(-0.00074905980532),
- FRAC_CONST(-0.0007681371927), FRAC_CONST(-0.00077248485949),
- FRAC_CONST(-0.00078343322877), FRAC_CONST(-0.00077798694927),
- FRAC_CONST(-0.000780366471), FRAC_CONST(-0.00078014496257),
- FRAC_CONST(-0.0007757977331), FRAC_CONST(-0.00076307935757),
- FRAC_CONST(-0.00075300014201), FRAC_CONST(-0.00073193571525),
- FRAC_CONST(-0.00072153919876), FRAC_CONST(-0.00069179375372),
- FRAC_CONST(-0.00066504150893), FRAC_CONST(-0.00063415949025),
- FRAC_CONST(-0.0005946118933), FRAC_CONST(-0.00055645763906),
- FRAC_CONST(-0.00051455722108), FRAC_CONST(-0.00046063254803),
- FRAC_CONST(-0.00040951214522), FRAC_CONST(-0.00035011758756),
- FRAC_CONST(-0.00028969811748), FRAC_CONST(-0.0002098337344),
- FRAC_CONST(-0.00014463809349), FRAC_CONST(-6.173344072E-005),
- FRAC_CONST(1.349497418E-005), FRAC_CONST(0.00010943831274),
- FRAC_CONST(0.00020430170688), FRAC_CONST(0.00029495311041),
- FRAC_CONST(0.0004026540216), FRAC_CONST(0.00051073884952),
- FRAC_CONST(0.00062393761391), FRAC_CONST(0.00074580258865),
- FRAC_CONST(0.00086084433262), FRAC_CONST(0.00098859883015),
- FRAC_CONST(0.00112501551307), FRAC_CONST(0.00125778846475),
- FRAC_CONST(0.00139024948272), FRAC_CONST(0.00154432198471),
- FRAC_CONST(0.00168680832531), FRAC_CONST(0.00183482654224),
- FRAC_CONST(0.00198411407369), FRAC_CONST(0.00214615835557),
- FRAC_CONST(0.00230172547746), FRAC_CONST(0.00246256169126),
- FRAC_CONST(0.00262017586902), FRAC_CONST(0.00278704643465),
- FRAC_CONST(0.00294694477165), FRAC_CONST(0.00311254206525),
- FRAC_CONST(0.00327396134847), FRAC_CONST(0.00344188741828),
- FRAC_CONST(0.00360082681231), FRAC_CONST(0.00376039229104),
- FRAC_CONST(0.00392074323703), FRAC_CONST(0.00408197531935),
- FRAC_CONST(0.0042264269227), FRAC_CONST(0.00437307196781),
- FRAC_CONST(0.00452098527825), FRAC_CONST(0.00466064606118),
- FRAC_CONST(0.00479325608498), FRAC_CONST(0.00491376035745),
- FRAC_CONST(0.00503930226013), FRAC_CONST(0.00514073539032),
- FRAC_CONST(0.00524611661324), FRAC_CONST(0.00534716811982),
- FRAC_CONST(0.00541967759307), FRAC_CONST(0.00548760401507),
- FRAC_CONST(0.00554757145088), FRAC_CONST(0.00559380230045),
- FRAC_CONST(0.00562206432097), FRAC_CONST(0.00564551969164),
- FRAC_CONST(0.00563891995151), FRAC_CONST(0.00562661141932),
- FRAC_CONST(0.0055917128663), FRAC_CONST(0.005540436394),
- FRAC_CONST(0.0054753783077), FRAC_CONST(0.0053838975897),
- FRAC_CONST(0.00527157587272), FRAC_CONST(0.00513822754514),
- FRAC_CONST(0.00498396877629), FRAC_CONST(0.004810946906),
- FRAC_CONST(0.00460395301471), FRAC_CONST(0.00438018617447),
- FRAC_CONST(0.0041251642327), FRAC_CONST(0.00384564081246),
- FRAC_CONST(0.00354012465507), FRAC_CONST(0.00320918858098),
- FRAC_CONST(0.00284467578623), FRAC_CONST(0.00245085400321),
- FRAC_CONST(0.0020274176185), FRAC_CONST(0.00157846825768),
- FRAC_CONST(0.00109023290512), FRAC_CONST(0.0005832264248),
- FRAC_CONST(2.760451905E-005), FRAC_CONST(-0.00054642808664),
- FRAC_CONST(-0.00115681355227), FRAC_CONST(-0.00180394725893),
- FRAC_CONST(-0.00248267236449), FRAC_CONST(-0.003193377839),
- FRAC_CONST(-0.00394011240522), FRAC_CONST(-0.004722259624),
- FRAC_CONST(-0.00553372111088), FRAC_CONST(-0.00637922932685),
- FRAC_CONST(-0.00726158168517), FRAC_CONST(-0.00817982333726),
- FRAC_CONST(-0.00913253296085), FRAC_CONST(-0.01011502154986),
- FRAC_CONST(-0.01113155480321), FRAC_CONST(-0.01218499959508),
- FRAC_CONST(0.01327182200351), FRAC_CONST(0.01439046660792),
- FRAC_CONST(0.01554055533423), FRAC_CONST(0.01673247129989),
- FRAC_CONST(0.01794333813443), FRAC_CONST(0.01918724313698),
- FRAC_CONST(0.02045317933555), FRAC_CONST(0.02174675502535),
- FRAC_CONST(0.02306801692862), FRAC_CONST(0.02441609920285),
- FRAC_CONST(0.02578758475467), FRAC_CONST(0.02718594296329),
- FRAC_CONST(0.02860721736385), FRAC_CONST(0.03005026574279),
- FRAC_CONST(0.03150176087389), FRAC_CONST(0.03297540810337),
- FRAC_CONST(0.03446209487686), FRAC_CONST(0.03596975605542),
- FRAC_CONST(0.03748128504252), FRAC_CONST(0.03900536794745),
- FRAC_CONST(0.04053491705584), FRAC_CONST(0.04206490946367),
- FRAC_CONST(0.04360975421304), FRAC_CONST(0.04514884056413),
- FRAC_CONST(0.04668430272642), FRAC_CONST(0.04821657200672),
- FRAC_CONST(0.04973857556014), FRAC_CONST(0.05125561555216),
- FRAC_CONST(0.05276307465207), FRAC_CONST(0.05424527683589),
- FRAC_CONST(0.05571736482138), FRAC_CONST(0.05716164501299),
- FRAC_CONST(0.0585915683626), FRAC_CONST(0.05998374801761),
- FRAC_CONST(0.06134551717207), FRAC_CONST(0.06268578081172),
- FRAC_CONST(0.06397158980681), FRAC_CONST(0.0652247106438),
[... 113 lines omitted ...]
- FRAC_CONST(-0.27366340405625), FRAC_CONST(-0.26310532994603),
- FRAC_CONST(-0.25264803095722), FRAC_CONST(-0.24230168845974),
- FRAC_CONST(-0.23206908706791), FRAC_CONST(-0.22196526964149),
- FRAC_CONST(-0.21197358538056), FRAC_CONST(-0.20212501768103),
- FRAC_CONST(-0.19239667457267), FRAC_CONST(-0.18281725485142),
- FRAC_CONST(-0.17338081721706), FRAC_CONST(-0.16409588556669),
- FRAC_CONST(-0.15496070710605), FRAC_CONST(-0.1459766491187),
- FRAC_CONST(-0.13715517611934), FRAC_CONST(-0.12850028503878),
- FRAC_CONST(-0.120007798468), FRAC_CONST(-0.1116826931773),
- FRAC_CONST(-0.10353295311463), FRAC_CONST(-0.09555333528914),
- FRAC_CONST(-0.08775475365593), FRAC_CONST(-0.08013729344279),
- FRAC_CONST(-0.07269433008129), FRAC_CONST(-0.06544098531359),
- FRAC_CONST(-0.05837053268336), FRAC_CONST(-0.05148041767934),
- FRAC_CONST(-0.04478068215856), FRAC_CONST(-0.03827765720822),
- FRAC_CONST(-0.03195312745332), FRAC_CONST(-0.02582272888064),
- FRAC_CONST(-0.01988341292573), FRAC_CONST(-0.01412888273558),
- FRAC_CONST(-0.00857117491366), FRAC_CONST(-0.00320868968304),
- FRAC_CONST(0.00197656014503), FRAC_CONST(0.00696368621617),
- FRAC_CONST(0.01176238327857), FRAC_CONST(0.01637012582228),
- FRAC_CONST(0.02079970728622), FRAC_CONST(0.02503075618909),
- FRAC_CONST(0.02908240060125), FRAC_CONST(0.03295839306691),
- FRAC_CONST(0.03664181168133), FRAC_CONST(0.04014582784127),
- FRAC_CONST(0.04347687821958), FRAC_CONST(0.04663033051701),
- FRAC_CONST(0.04959786763445), FRAC_CONST(0.05240938217366),
- FRAC_CONST(0.05504600343009), FRAC_CONST(0.05751526919867),
- FRAC_CONST(0.0598166570809), FRAC_CONST(0.06196027790387),
- FRAC_CONST(0.06394448059633), FRAC_CONST(0.06576906686508),
- FRAC_CONST(0.06745250215166), FRAC_CONST(0.06896640131951),
- FRAC_CONST(0.07035330735093), FRAC_CONST(0.07158263647903),
- FRAC_CONST(0.07267746427299), FRAC_CONST(0.0736406005762),
- FRAC_CONST(0.07446643947564), FRAC_CONST(0.0751576255287),
- FRAC_CONST(0.07573057565061), FRAC_CONST(0.07617483218536),
- FRAC_CONST(0.07650507183194), FRAC_CONST(0.07672049241746),
- FRAC_CONST(0.07682300113923), FRAC_CONST(0.07681739756964),
- FRAC_CONST(0.07670934904245), FRAC_CONST(0.07649921704119),
- FRAC_CONST(0.07619924793396), FRAC_CONST(0.07580083586584),
- FRAC_CONST(0.07531373362019), FRAC_CONST(0.07474525581194),
- FRAC_CONST(0.07410036424342), FRAC_CONST(0.07336202550803),
- FRAC_CONST(0.07256825833083), FRAC_CONST(0.07170026731102),
- FRAC_CONST(0.07076287107266), FRAC_CONST(0.06976302447127),
- FRAC_CONST(0.06870438283512), FRAC_CONST(0.06760759851228),
- FRAC_CONST(0.06643675122104), FRAC_CONST(0.0652247106438),
- FRAC_CONST(0.06397158980681), FRAC_CONST(0.06268578081172),
- FRAC_CONST(0.06134551717207), FRAC_CONST(0.05998374801761),
- FRAC_CONST(0.0585915683626), FRAC_CONST(0.05716164501299),
- FRAC_CONST(0.05571736482138), FRAC_CONST(0.05424527683589),
- FRAC_CONST(0.05276307465207), FRAC_CONST(0.05125561555216),
- FRAC_CONST(0.04973857556014), FRAC_CONST(0.04821657200672),
- FRAC_CONST(0.04668430272642), FRAC_CONST(0.04514884056413),
- FRAC_CONST(0.04360975421304), FRAC_CONST(0.04206490946367),
- FRAC_CONST(0.04053491705584), FRAC_CONST(0.03900536794745),
- FRAC_CONST(0.03748128504252), FRAC_CONST(0.03596975605542),
- FRAC_CONST(0.03446209487686), FRAC_CONST(0.03297540810337),
- FRAC_CONST(0.03150176087389), FRAC_CONST(0.03005026574279),
- FRAC_CONST(0.02860721736385), FRAC_CONST(0.02718594296329),
- FRAC_CONST(0.02578758475467), FRAC_CONST(0.02441609920285),
- FRAC_CONST(0.02306801692862), FRAC_CONST(0.02174675502535),
- FRAC_CONST(0.02045317933555), FRAC_CONST(0.01918724313698),
- FRAC_CONST(0.01794333813443), FRAC_CONST(0.01673247129989),
- FRAC_CONST(0.01554055533423), FRAC_CONST(0.01439046660792),
- FRAC_CONST(-0.01327182200351), FRAC_CONST(-0.01218499959508),
- FRAC_CONST(-0.01113155480321), FRAC_CONST(-0.01011502154986),
- FRAC_CONST(-0.00913253296085), FRAC_CONST(-0.00817982333726),
- FRAC_CONST(-0.00726158168517), FRAC_CONST(-0.00637922932685),
- FRAC_CONST(-0.00553372111088), FRAC_CONST(-0.004722259624),
- FRAC_CONST(-0.00394011240522), FRAC_CONST(-0.003193377839),
- FRAC_CONST(-0.00248267236449), FRAC_CONST(-0.00180394725893),
- FRAC_CONST(-0.00115681355227), FRAC_CONST(-0.00054642808664),
- FRAC_CONST(2.760451905E-005), FRAC_CONST(0.0005832264248),
- FRAC_CONST(0.00109023290512), FRAC_CONST(0.00157846825768),
- FRAC_CONST(0.0020274176185), FRAC_CONST(0.00245085400321),
- FRAC_CONST(0.00284467578623), FRAC_CONST(0.00320918858098),
- FRAC_CONST(0.00354012465507), FRAC_CONST(0.00384564081246),
- FRAC_CONST(0.0041251642327), FRAC_CONST(0.00438018617447),
- FRAC_CONST(0.00460395301471), FRAC_CONST(0.004810946906),
- FRAC_CONST(0.00498396877629), FRAC_CONST(0.00513822754514),
- FRAC_CONST(0.00527157587272), FRAC_CONST(0.0053838975897),
- FRAC_CONST(0.0054753783077), FRAC_CONST(0.005540436394),
- FRAC_CONST(0.0055917128663), FRAC_CONST(0.00562661141932),
- FRAC_CONST(0.00563891995151), FRAC_CONST(0.00564551969164),
- FRAC_CONST(0.00562206432097), FRAC_CONST(0.00559380230045),
- FRAC_CONST(0.00554757145088), FRAC_CONST(0.00548760401507),
- FRAC_CONST(0.00541967759307), FRAC_CONST(0.00534716811982),
- FRAC_CONST(0.00524611661324), FRAC_CONST(0.00514073539032),
- FRAC_CONST(0.00503930226013), FRAC_CONST(0.00491376035745),
- FRAC_CONST(0.00479325608498), FRAC_CONST(0.00466064606118),
- FRAC_CONST(0.00452098527825), FRAC_CONST(0.00437307196781),
- FRAC_CONST(0.0042264269227), FRAC_CONST(0.00408197531935),
- FRAC_CONST(0.00392074323703), FRAC_CONST(0.00376039229104),
- FRAC_CONST(0.00360082681231), FRAC_CONST(0.00344188741828),
- FRAC_CONST(0.00327396134847), FRAC_CONST(0.00311254206525),
- FRAC_CONST(0.00294694477165), FRAC_CONST(0.00278704643465),
- FRAC_CONST(0.00262017586902), FRAC_CONST(0.00246256169126),
- FRAC_CONST(0.00230172547746), FRAC_CONST(0.00214615835557),
- FRAC_CONST(0.00198411407369), FRAC_CONST(0.00183482654224),
- FRAC_CONST(0.00168680832531), FRAC_CONST(0.00154432198471),
- FRAC_CONST(0.00139024948272), FRAC_CONST(0.00125778846475),
- FRAC_CONST(0.00112501551307), FRAC_CONST(0.00098859883015),
- FRAC_CONST(0.00086084433262), FRAC_CONST(0.00074580258865),
- FRAC_CONST(0.00062393761391), FRAC_CONST(0.00051073884952),
- FRAC_CONST(0.0004026540216), FRAC_CONST(0.00029495311041),
- FRAC_CONST(0.00020430170688), FRAC_CONST(0.00010943831274),
- FRAC_CONST(1.349497418E-005), FRAC_CONST(-6.173344072E-005),
- FRAC_CONST(-0.00014463809349), FRAC_CONST(-0.0002098337344),
- FRAC_CONST(-0.00028969811748), FRAC_CONST(-0.00035011758756),
- FRAC_CONST(-0.00040951214522), FRAC_CONST(-0.00046063254803),
- FRAC_CONST(-0.00051455722108), FRAC_CONST(-0.00055645763906),
- FRAC_CONST(-0.0005946118933), FRAC_CONST(-0.00063415949025),
- FRAC_CONST(-0.00066504150893), FRAC_CONST(-0.00069179375372),
- FRAC_CONST(-0.00072153919876), FRAC_CONST(-0.00073193571525),
- FRAC_CONST(-0.00075300014201), FRAC_CONST(-0.00076307935757),
- FRAC_CONST(-0.0007757977331), FRAC_CONST(-0.00078014496257),
- FRAC_CONST(-0.000780366471), FRAC_CONST(-0.00077798694927),
- FRAC_CONST(-0.00078343322877), FRAC_CONST(-0.00077248485949),
- FRAC_CONST(-0.0007681371927), FRAC_CONST(-0.00074905980532),
- FRAC_CONST(-0.00074409418541), FRAC_CONST(-0.00072550431222),
- FRAC_CONST(-0.00071577364744), FRAC_CONST(-0.00069416146273),
- FRAC_CONST(-0.00067776907764), FRAC_CONST(-0.00065403333621),
- FRAC_CONST(-0.00063124935319), FRAC_CONST(-0.00061327473938),
- FRAC_CONST(-0.00058709304852), FRAC_CONST(-0.00056778025613),
- FRAC_CONST(-0.00054665656337), FRAC_CONST(-0.00052265642972),
- FRAC_CONST(-0.00050407143497), FRAC_CONST(-0.00048937912498),
- FRAC_CONST(-0.00048752279712), FRAC_CONST(-0.00049475180896),
- FRAC_CONST(-0.00056176925738), FRAC_CONST(-0.00055252865047)
-};
-
-#endif
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_syntax.c
--- a/src/libfaad/sbr_syntax.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,871 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_syntax.c,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include "sbr_syntax.h"
-#include "syntax.h"
-#include "sbr_huff.h"
-#include "sbr_fbt.h"
-#include "sbr_tf_grid.h"
-#include "sbr_e_nf.h"
-#include "bits.h"
-#ifdef PS_DEC
-#include "ps_dec.h"
-#endif
-#ifdef DRM_PS
-#include "drm_dec.h"
-#endif
-#include "analysis.h"
-
-/* static function declarations */
-static void sbr_header(bitfile *ld, sbr_info *sbr);
-static uint8_t calc_sbr_tables(sbr_info *sbr, uint8_t start_freq, uint8_t stop_freq,
- uint8_t samplerate_mode, uint8_t freq_scale,
- uint8_t alter_scale, uint8_t xover_band);
-static uint8_t sbr_data(bitfile *ld, sbr_info *sbr);
-static uint16_t sbr_extension(bitfile *ld, sbr_info *sbr,
- uint8_t bs_extension_id, uint16_t num_bits_left);
-static uint8_t sbr_single_channel_element(bitfile *ld, sbr_info *sbr);
-static uint8_t sbr_channel_pair_element(bitfile *ld, sbr_info *sbr);
-static uint8_t sbr_grid(bitfile *ld, sbr_info *sbr, uint8_t ch);
-static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch);
-static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch);
-static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch);
-
-
-static void sbr_reset(sbr_info *sbr)
-{
-#if 0
- printf("%d\n", sbr->bs_start_freq_prev);
- printf("%d\n", sbr->bs_stop_freq_prev);
- printf("%d\n", sbr->bs_freq_scale_prev);
- printf("%d\n", sbr->bs_alter_scale_prev);
- printf("%d\n", sbr->bs_xover_band_prev);
- printf("%d\n\n", sbr->bs_noise_bands_prev);
-#endif
-
- /* if these are different from the previous frame: Reset = 1 */
- if ((sbr->bs_start_freq != sbr->bs_start_freq_prev) ||
- (sbr->bs_stop_freq != sbr->bs_stop_freq_prev) ||
- (sbr->bs_freq_scale != sbr->bs_freq_scale_prev) ||
- (sbr->bs_alter_scale != sbr->bs_alter_scale_prev) ||
- (sbr->bs_xover_band != sbr->bs_xover_band_prev) ||
- (sbr->bs_noise_bands != sbr->bs_noise_bands_prev))
- {
- sbr->Reset = 1;
- } else {
- sbr->Reset = 0;
- }
-
- sbr->bs_start_freq_prev = sbr->bs_start_freq;
- sbr->bs_stop_freq_prev = sbr->bs_stop_freq;
- sbr->bs_freq_scale_prev = sbr->bs_freq_scale;
- sbr->bs_alter_scale_prev = sbr->bs_alter_scale;
- sbr->bs_xover_band_prev = sbr->bs_xover_band;
- sbr->bs_noise_bands_prev = sbr->bs_noise_bands;
-}
-
-static uint8_t calc_sbr_tables(sbr_info *sbr, uint8_t start_freq, uint8_t stop_freq,
- uint8_t samplerate_mode, uint8_t freq_scale,
- uint8_t alter_scale, uint8_t xover_band)
-{
- uint8_t result = 0;
- uint8_t k2;
-
- /* calculate the Master Frequency Table */
- sbr->k0 = qmf_start_channel(start_freq, samplerate_mode, sbr->sample_rate);
- k2 = qmf_stop_channel(stop_freq, sbr->sample_rate, sbr->k0);
-
- /* check k0 and k2 */
- if (sbr->sample_rate >= 48000)
- {
- if ((k2 - sbr->k0) > 32)
- result += 1;
- } else if (sbr->sample_rate <= 32000) {
- if ((k2 - sbr->k0) > 48)
- result += 1;
- } else { /* (sbr->sample_rate == 44100) */
- if ((k2 - sbr->k0) > 45)
- result += 1;
- }
-
- if (freq_scale == 0)
- {
- result += master_frequency_table_fs0(sbr, sbr->k0, k2, alter_scale);
- } else {
- result += master_frequency_table(sbr, sbr->k0, k2, freq_scale, alter_scale);
[... 619 lines omitted ...]
- }
-
- sbr->abs_bord_lead[ch] = bs_abs_bord;
- sbr->abs_bord_trail[ch] = bs_abs_bord_1;
- sbr->n_rel_lead[ch] = sbr->bs_num_rel_0[ch];
- sbr->n_rel_trail[ch] = sbr->bs_num_rel_1[ch];
- break;
- }
-
- if (sbr->bs_frame_class[ch] == VARVAR)
- sbr->L_E[ch] = min(bs_num_env, 5);
- else
- sbr->L_E[ch] = min(bs_num_env, 4);
-
- if (sbr->L_E[ch] <= 0)
- return 1;
-
- if (sbr->L_E[ch] > 1)
- sbr->L_Q[ch] = 2;
- else
- sbr->L_Q[ch] = 1;
-
- /* TODO: this code can probably be integrated into the code above! */
- if ((result = envelope_time_border_vector(sbr, ch)) > 0)
- {
- sbr->bs_frame_class[ch] = saved_frame_class;
- sbr->L_E[ch] = saved_L_E;
- sbr->L_Q[ch] = saved_L_Q;
- return result;
- }
- noise_floor_time_border_vector(sbr, ch);
-
-#if 0
- for (env = 0; env < bs_num_env; env++)
- {
- printf("freq_res[ch:%d][env:%d]: %d\n", ch, env, sbr->f[ch][env]);
- }
-#endif
-
- return 0;
-}
-
-/* table 8 */
-static void sbr_dtdf(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t i;
-
- for (i = 0; i < sbr->L_E[ch]; i++)
- {
- sbr->bs_df_env[ch][i] = faad_get1bit(ld
- DEBUGVAR(1,269,"sbr_dtdf(): bs_df_env"));
- }
-
- for (i = 0; i < sbr->L_Q[ch]; i++)
- {
- sbr->bs_df_noise[ch][i] = faad_get1bit(ld
- DEBUGVAR(1,270,"sbr_dtdf(): bs_df_noise"));
- }
-}
-
-/* table 9 */
-static void invf_mode(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t n;
-
- for (n = 0; n < sbr->N_Q; n++)
- {
- sbr->bs_invf_mode[ch][n] = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,271,"invf_mode(): bs_invf_mode"));
- }
-}
-
-static uint16_t sbr_extension(bitfile *ld, sbr_info *sbr,
- uint8_t bs_extension_id, uint16_t num_bits_left)
-{
-#ifdef PS_DEC
- uint8_t header;
- uint16_t ret;
-#endif
-
- switch (bs_extension_id)
- {
-#ifdef PS_DEC
- case EXTENSION_ID_PS:
- if (!sbr->ps)
- {
- sbr->ps = ps_init(get_sr_index(sbr->sample_rate));
- }
- ret = ps_data(sbr->ps, ld, &header);
-
- /* enable PS if and only if: a header has been decoded */
- if (sbr->ps_used == 0 && header == 1)
- {
- sbr->ps_used = 1;
- }
-
- return ret;
-#endif
-#ifdef DRM_PS
- case DRM_PARAMETRIC_STEREO:
- sbr->ps_used = 1;
- if (!sbr->drm_ps)
- {
- sbr->drm_ps = drm_ps_init();
- }
- return drm_ps_data(sbr->drm_ps, ld);
-#endif
- default:
- sbr->bs_extension_data = (uint8_t)faad_getbits(ld, 6
- DEBUGVAR(1,279,"sbr_single_channel_element(): bs_extension_data"));
- return 6;
- }
-}
-
-/* table 12 */
-static void sinusoidal_coding(bitfile *ld, sbr_info *sbr, uint8_t ch)
-{
- uint8_t n;
-
- for (n = 0; n < sbr->N_high; n++)
- {
- sbr->bs_add_harmonic[ch][n] = faad_get1bit(ld
- DEBUGVAR(1,278,"sinusoidal_coding(): bs_add_harmonic"));
- }
-}
-
-
-#endif /* SBR_DEC */
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_syntax.h
--- a/src/libfaad/sbr_syntax.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_syntax.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_SYNTAX_H__
-#define __SBR_SYNTAX_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "bits.h"
-
-#define T_HFGEN 8
-#define T_HFADJ 2
-
-#define EXT_SBR_DATA 13
-#define EXT_SBR_DATA_CRC 14
-
-#define FIXFIX 0
-#define FIXVAR 1
-#define VARFIX 2
-#define VARVAR 3
-
-#define LO_RES 0
-#define HI_RES 1
-
-#define NO_TIME_SLOTS_960 15
-#define NO_TIME_SLOTS 16
-#define RATE 2
-
-#define NOISE_FLOOR_OFFSET 6
-
-
-uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __SBR_SYNTAX_H__ */
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_tf_grid.c
--- a/src/libfaad/sbr_tf_grid.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_tf_grid.c,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-/* Time/Frequency grid */
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SBR_DEC
-
-#include <stdlib.h>
-
-#include "sbr_syntax.h"
-#include "sbr_tf_grid.h"
-
-
-/* static function declarations */
-#if 0
-static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l);
-static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l);
-#endif
-static uint8_t middleBorder(sbr_info *sbr, uint8_t ch);
-
-
-/* function constructs new time border vector */
-/* first build into temp vector to be able to use previous vector on error */
-uint8_t envelope_time_border_vector(sbr_info *sbr, uint8_t ch)
-{
- uint8_t l, border, temp;
- uint8_t t_E_temp[6] = {0};
-
- t_E_temp[0] = sbr->rate * sbr->abs_bord_lead[ch];
- t_E_temp[sbr->L_E[ch]] = sbr->rate * sbr->abs_bord_trail[ch];
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- switch (sbr->L_E[ch])
- {
- case 4:
- temp = (int) (sbr->numTimeSlots / 4);
- t_E_temp[3] = sbr->rate * 3 * temp;
- t_E_temp[2] = sbr->rate * 2 * temp;
- t_E_temp[1] = sbr->rate * temp;
- break;
- case 2:
- t_E_temp[1] = sbr->rate * (int) (sbr->numTimeSlots / 2);
- break;
- default:
- break;
- }
- break;
-
- case FIXVAR:
- if (sbr->L_E[ch] > 1)
- {
- int8_t i = sbr->L_E[ch];
- border = sbr->abs_bord_trail[ch];
-
- for (l = 0; l < (sbr->L_E[ch] - 1); l++)
- {
- if (border < sbr->bs_rel_bord[ch][l])
- return 1;
-
- border -= sbr->bs_rel_bord[ch][l];
- t_E_temp[--i] = sbr->rate * border;
- }
- }
- break;
-
- case VARFIX:
- if (sbr->L_E[ch] > 1)
- {
- int8_t i = 1;
- border = sbr->abs_bord_lead[ch];
-
- for (l = 0; l < (sbr->L_E[ch] - 1); l++)
- {
- border += sbr->bs_rel_bord[ch][l];
-
- if (sbr->rate * border + sbr->tHFAdj > \
sbr->numTimeSlotsRate+sbr->tHFGen)
- return 1;
-
- t_E_temp[i++] = sbr->rate * border;
- }
- }
- break;
-
- case VARVAR:
- if (sbr->bs_num_rel_0[ch])
- {
- int8_t i = 1;
- border = sbr->abs_bord_lead[ch];
-
- for (l = 0; l < sbr->bs_num_rel_0[ch]; l++)
- {
- border += sbr->bs_rel_bord_0[ch][l];
-
- if (sbr->rate * border + sbr->tHFAdj > \
sbr->numTimeSlotsRate+sbr->tHFGen)
- return 1;
[... 6 lines omitted ...]
- {
- int8_t i = sbr->L_E[ch];
- border = sbr->abs_bord_trail[ch];
-
- for (l = 0; l < sbr->bs_num_rel_1[ch]; l++)
- {
- if (border < sbr->bs_rel_bord_1[ch][l])
- return 1;
-
- border -= sbr->bs_rel_bord_1[ch][l];
- t_E_temp[--i] = sbr->rate * border;
- }
- }
- break;
- }
-
- /* no error occured, we can safely use this t_E vector */
- for (l = 0; l < 6; l++)
- {
- sbr->t_E[ch][l] = t_E_temp[l];
- }
-
- return 0;
-}
-
-void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch)
-{
- sbr->t_Q[ch][0] = sbr->t_E[ch][0];
-
- if (sbr->L_E[ch] == 1)
- {
- sbr->t_Q[ch][1] = sbr->t_E[ch][1];
- sbr->t_Q[ch][2] = 0;
- } else {
- uint8_t index = middleBorder(sbr, ch);
- sbr->t_Q[ch][1] = sbr->t_E[ch][index];
- sbr->t_Q[ch][2] = sbr->t_E[ch][sbr->L_E[ch]];
- }
-}
-
-#if 0
-static int16_t rel_bord_lead(sbr_info *sbr, uint8_t ch, uint8_t l)
-{
- uint8_t i;
- int16_t acc = 0;
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- return sbr->numTimeSlots/sbr->L_E[ch];
- case FIXVAR:
- return 0;
- case VARFIX:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord[ch][i];
- }
- return acc;
- case VARVAR:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord_0[ch][i];
- }
- return acc;
- }
-
- return 0;
-}
-
-static int16_t rel_bord_trail(sbr_info *sbr, uint8_t ch, uint8_t l)
-{
- uint8_t i;
- int16_t acc = 0;
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- case VARFIX:
- return 0;
- case FIXVAR:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord[ch][i];
- }
- return acc;
- case VARVAR:
- for (i = 0; i < l; i++)
- {
- acc += sbr->bs_rel_bord_1[ch][i];
- }
- return acc;
- }
-
- return 0;
-}
-#endif
-
-static uint8_t middleBorder(sbr_info *sbr, uint8_t ch)
-{
- int8_t retval = 0;
-
- switch (sbr->bs_frame_class[ch])
- {
- case FIXFIX:
- retval = sbr->L_E[ch]/2;
- break;
- case VARFIX:
- if (sbr->bs_pointer[ch] == 0)
- retval = 1;
- else if (sbr->bs_pointer[ch] == 1)
- retval = sbr->L_E[ch] - 1;
- else
- retval = sbr->bs_pointer[ch] - 1;
- break;
- case FIXVAR:
- case VARVAR:
- if (sbr->bs_pointer[ch] > 1)
- retval = sbr->L_E[ch] + 1 - sbr->bs_pointer[ch];
- else
- retval = sbr->L_E[ch] - 1;
- break;
- }
-
- return (retval > 0) ? retval : 0;
-}
-
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sbr_tf_grid.h
--- a/src/libfaad/sbr_tf_grid.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sbr_tf_grid.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SBR_TF_GRID_H__
-#define __SBR_TF_GRID_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-uint8_t envelope_time_border_vector(sbr_info *sbr, uint8_t ch);
-void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/sine_win.h
--- a/src/libfaad/sine_win.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4301 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: sine_win.h,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SINE_WIN_H__
-#define __SINE_WIN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-ALIGN static const real_t sine_long_1024[] =
-{
- FRAC_CONST(0.00076699031874270449),
- FRAC_CONST(0.002300969151425805),
- FRAC_CONST(0.0038349425697062275),
- FRAC_CONST(0.0053689069639963425),
- FRAC_CONST(0.0069028587247297558),
- FRAC_CONST(0.0084367942423697988),
- FRAC_CONST(0.0099707099074180308),
- FRAC_CONST(0.011504602110422714),
- FRAC_CONST(0.013038467241987334),
- FRAC_CONST(0.014572301692779064),
- FRAC_CONST(0.016106101853537287),
- FRAC_CONST(0.017639864115082053),
- FRAC_CONST(0.019173584868322623),
- FRAC_CONST(0.020707260504265895),
- FRAC_CONST(0.022240887414024961),
- FRAC_CONST(0.023774461988827555),
- FRAC_CONST(0.025307980620024571),
- FRAC_CONST(0.026841439699098531),
- FRAC_CONST(0.028374835617672099),
- FRAC_CONST(0.029908164767516555),
- FRAC_CONST(0.031441423540560301),
- FRAC_CONST(0.032974608328897335),
- FRAC_CONST(0.03450771552479575),
- FRAC_CONST(0.036040741520706229),
- FRAC_CONST(0.037573682709270494),
- FRAC_CONST(0.039106535483329888),
- FRAC_CONST(0.040639296235933736),
- FRAC_CONST(0.042171961360347947),
- FRAC_CONST(0.043704527250063421),
- FRAC_CONST(0.04523699029880459),
- FRAC_CONST(0.046769346900537863),
- FRAC_CONST(0.048301593449480144),
- FRAC_CONST(0.049833726340107277),
- FRAC_CONST(0.051365741967162593),
- FRAC_CONST(0.052897636725665324),
- FRAC_CONST(0.054429407010919133),
- FRAC_CONST(0.055961049218520569),
- FRAC_CONST(0.057492559744367566),
- FRAC_CONST(0.059023934984667931),
- FRAC_CONST(0.060555171335947788),
- FRAC_CONST(0.062086265195060088),
- FRAC_CONST(0.063617212959193106),
- FRAC_CONST(0.065148011025878833),
- FRAC_CONST(0.066678655793001557),
- FRAC_CONST(0.068209143658806329),
- FRAC_CONST(0.069739471021907307),
- FRAC_CONST(0.071269634281296401),
- FRAC_CONST(0.072799629836351673),
- FRAC_CONST(0.074329454086845756),
- FRAC_CONST(0.075859103432954447),
- FRAC_CONST(0.077388574275265049),
- FRAC_CONST(0.078917863014784942),
- FRAC_CONST(0.080446966052950014),
- FRAC_CONST(0.081975879791633066),
- FRAC_CONST(0.083504600633152432),
- FRAC_CONST(0.085033124980280275),
- FRAC_CONST(0.08656144923625117),
- FRAC_CONST(0.088089569804770507),
- FRAC_CONST(0.089617483090022959),
- FRAC_CONST(0.091145185496681005),
- FRAC_CONST(0.09267267342991331),
- FRAC_CONST(0.094199943295393204),
- FRAC_CONST(0.095726991499307162),
- FRAC_CONST(0.097253814448363271),
- FRAC_CONST(0.098780408549799623),
- FRAC_CONST(0.10030677021139286),
- FRAC_CONST(0.10183289584146653),
- FRAC_CONST(0.10335878184889961),
- FRAC_CONST(0.10488442464313497),
- FRAC_CONST(0.10640982063418768),
- FRAC_CONST(0.10793496623265365),
- FRAC_CONST(0.10945985784971798),
- FRAC_CONST(0.11098449189716339),
- FRAC_CONST(0.11250886478737869),
- FRAC_CONST(0.1140329729333672),
- FRAC_CONST(0.11555681274875526),
- FRAC_CONST(0.11708038064780059),
- FRAC_CONST(0.11860367304540072),
- FRAC_CONST(0.1201266863571015),
- FRAC_CONST(0.12164941699910553),
- FRAC_CONST(0.12317186138828048),
- FRAC_CONST(0.12469401594216764),
- FRAC_CONST(0.12621587707899035),
[... 4049 lines omitted ...]
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1),
- FRAC_CONST(1)
-};
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/specrec.c
--- a/src/libfaad/specrec.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1241 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: specrec.c,v 1.10 2006/06/17 20:43:57 dgp85 Exp $
-**/
-
-/*
- Spectral reconstruction:
- - grouping/sectioning
- - inverse quantization
- - applying scalefactors
-*/
-
-#include "common.h"
-#include "structs.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include "specrec.h"
-#include "filtbank.h"
-#include "syntax.h"
-#include "iq_table.h"
-#include "ms.h"
-#include "is.h"
-#include "pns.h"
-#include "tns.h"
-#include "drc.h"
-#include "lt_predict.h"
-#include "ic_predict.h"
-#ifdef SSR_DEC
-#include "ssr.h"
-#include "ssr_fb.h"
-#endif
-
-
-/* static function declarations */
-static uint8_t quant_to_spec(NeAACDecHandle hDecoder,
- ic_stream *ics, int16_t *quant_data,
- real_t *spec_data, uint16_t frame_len);
-
-
-#ifdef LD_DEC
-ALIGN static const uint8_t num_swb_512_window[] =
-{
- 0, 0, 0, 36, 36, 37, 31, 31, 0, 0, 0, 0
-};
-ALIGN static const uint8_t num_swb_480_window[] =
-{
- 0, 0, 0, 35, 35, 37, 30, 30, 0, 0, 0, 0
-};
-#endif
-
-ALIGN static const uint8_t num_swb_960_window[] =
-{
- 40, 40, 45, 49, 49, 49, 46, 46, 42, 42, 42, 40
-};
-
-ALIGN static const uint8_t num_swb_1024_window[] =
-{
- 41, 41, 47, 49, 49, 51, 47, 47, 43, 43, 43, 40
-};
-
-ALIGN static const uint8_t num_swb_128_window[] =
-{
- 12, 12, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15
-};
-
-ALIGN static const uint16_t swb_offset_1024_96[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
- 64, 72, 80, 88, 96, 108, 120, 132, 144, 156, 172, 188, 212, 240,
- 276, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024
-};
-
-ALIGN static const uint16_t swb_offset_128_96[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
-};
-
-ALIGN static const uint16_t swb_offset_1024_64[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56,
- 64, 72, 80, 88, 100, 112, 124, 140, 156, 172, 192, 216, 240, 268,
- 304, 344, 384, 424, 464, 504, 544, 584, 624, 664, 704, 744, 784, 824,
- 864, 904, 944, 984, 1024
-};
-
-ALIGN static const uint16_t swb_offset_128_64[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 92, 128
-};
-
-ALIGN static const uint16_t swb_offset_1024_48[] =
-{
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72,
- 80, 88, 96, 108, 120, 132, 144, 160, 176, 196, 216, 240, 264, 292,
- 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736,
- 768, 800, 832, 864, 896, 928, 1024
-};
-
-#ifdef LD_DEC
-ALIGN static const uint16_t swb_offset_512_48[] =
-{
[... 989 lines omitted ...]
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
- ltp_info *ltp1 = &(ics1->ltp);
- ltp_info *ltp2 = (cpe->common_window) ? &(ics2->ltp2) : &(ics2->ltp);
-#ifdef LD_DEC
- if (hDecoder->object_type == LD)
- {
- if (ltp1->data_present)
- {
- if (ltp1->lag_update)
- hDecoder->ltp_lag[cpe->channel] = ltp1->lag;
- }
- ltp1->lag = hDecoder->ltp_lag[cpe->channel];
- if (ltp2->data_present)
- {
- if (ltp2->lag_update)
- hDecoder->ltp_lag[cpe->paired_channel] = ltp2->lag;
- }
- ltp2->lag = hDecoder->ltp_lag[cpe->paired_channel];
- }
-#endif
-
- /* long term prediction */
- lt_prediction(ics1, ltp1, spec_coef1, hDecoder->lt_pred_stat[cpe->channel], \
hDecoder->fb,
- ics1->window_shape, hDecoder->window_shape_prev[cpe->channel],
- hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
- lt_prediction(ics2, ltp2, spec_coef2, \
hDecoder->lt_pred_stat[cpe->paired_channel], hDecoder->fb,
- ics2->window_shape, hDecoder->window_shape_prev[cpe->paired_channel],
- hDecoder->sf_index, hDecoder->object_type, hDecoder->frameLength);
- }
-#endif
-
- /* tns decoding */
- tns_decode_frame(ics1, &(ics1->tns), hDecoder->sf_index, hDecoder->object_type,
- spec_coef1, hDecoder->frameLength);
- tns_decode_frame(ics2, &(ics2->tns), hDecoder->sf_index, hDecoder->object_type,
- spec_coef2, hDecoder->frameLength);
-
- /* drc decoding */
- if (hDecoder->drc->present)
- {
- if (!hDecoder->drc->exclude_mask[cpe->channel] || \
!hDecoder->drc->excluded_chns_present)
- drc_decode(hDecoder->drc, spec_coef1);
- if (!hDecoder->drc->exclude_mask[cpe->paired_channel] || \
!hDecoder->drc->excluded_chns_present)
- drc_decode(hDecoder->drc, spec_coef2);
- }
-
- /* filter bank */
-#ifdef SSR_DEC
- if (hDecoder->object_type != SSR)
- {
-#endif
- ifilter_bank(hDecoder->fb, ics1->window_sequence, ics1->window_shape,
- hDecoder->window_shape_prev[cpe->channel], spec_coef1,
- hDecoder->time_out[cpe->channel], hDecoder->fb_intermed[cpe->channel],
- hDecoder->object_type, hDecoder->frameLength);
- ifilter_bank(hDecoder->fb, ics2->window_sequence, ics2->window_shape,
- hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2,
- hDecoder->time_out[cpe->paired_channel], \
hDecoder->fb_intermed[cpe->paired_channel],
- hDecoder->object_type, hDecoder->frameLength);
-#ifdef SSR_DEC
- } else {
- ssr_decode(&(ics1->ssr), hDecoder->fb, ics1->window_sequence, \
ics1->window_shape,
- hDecoder->window_shape_prev[cpe->channel], spec_coef1, \
hDecoder->time_out[cpe->channel],
- hDecoder->ssr_overlap[cpe->channel], \
hDecoder->ipqf_buffer[cpe->channel],
- hDecoder->prev_fmd[cpe->channel], hDecoder->frameLength);
- ssr_decode(&(ics2->ssr), hDecoder->fb, ics2->window_sequence, \
ics2->window_shape,
- hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2, \
hDecoder->time_out[cpe->paired_channel],
- hDecoder->ssr_overlap[cpe->paired_channel], \
hDecoder->ipqf_buffer[cpe->paired_channel],
- hDecoder->prev_fmd[cpe->paired_channel], hDecoder->frameLength);
- }
-#endif
-
- /* save window shape for next frame */
- hDecoder->window_shape_prev[cpe->channel] = ics1->window_shape;
- hDecoder->window_shape_prev[cpe->paired_channel] = ics2->window_shape;
-
-#ifdef LTP_DEC
- if (is_ltp_ot(hDecoder->object_type))
- {
- lt_update_state(hDecoder->lt_pred_stat[cpe->channel], \
hDecoder->time_out[cpe->channel],
- hDecoder->fb_intermed[cpe->channel], hDecoder->frameLength, \
hDecoder->object_type);
- lt_update_state(hDecoder->lt_pred_stat[cpe->paired_channel], \
hDecoder->time_out[cpe->paired_channel],
- hDecoder->fb_intermed[cpe->paired_channel], hDecoder->frameLength, \
hDecoder->object_type);
- }
-#endif
-
-#ifdef SBR_DEC
- if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == 1))
- && hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
- {
- uint8_t ele = hDecoder->fr_ch_ele;
- uint8_t ch0 = cpe->channel;
- uint8_t ch1 = cpe->paired_channel;
-
- /* following case can happen when forceUpSampling == 1 */
- if (hDecoder->sbr[ele] == NULL)
- {
- hDecoder->sbr[ele] = sbrDecodeInit(hDecoder->frameLength,
- hDecoder->element_id[ele], 2*get_sample_rate(hDecoder->sf_index),
- hDecoder->downSampledSBR
-#ifdef DRM
- , 0
-#endif
- );
- }
-
- if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
- hDecoder->sbr[ele]->maxAACLine = \
8*cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)];
- else
- hDecoder->sbr[ele]->maxAACLine = \
cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)];
-
- retval = sbrDecodeCoupleFrame(hDecoder->sbr[ele],
- hDecoder->time_out[ch0], hDecoder->time_out[ch1],
- hDecoder->postSeekResetFlag, hDecoder->downSampledSBR);
- if (retval > 0)
- return retval;
- } else if (((hDecoder->sbr_present_flag == 1) || (hDecoder->forceUpSampling == \
1))
- && !hDecoder->sbr_alloced[hDecoder->fr_ch_ele])
- {
- return 23;
- }
-#endif
-
- return 0;
-}
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/specrec.h
--- a/src/libfaad/specrec.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: specrec.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SPECREC_H__
-#define __SPECREC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "syntax.h"
-
-uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics);
-uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream \
*ics2,
- element *cpe, int16_t *spec_data1, int16_t \
*spec_data2);
-uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics, element \
*sce,
- int16_t *spec_data);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/ssr.c
--- a/src/libfaad/ssr.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr.c,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SSR_DEC
-
-#include "syntax.h"
-#include "filtbank.h"
-#include "ssr.h"
-#include "ssr_fb.h"
-
-void ssr_decode(ssr_info *ssr, fb_info *fb, uint8_t window_sequence,
- uint8_t window_shape, uint8_t window_shape_prev,
- real_t *freq_in, real_t *time_out, real_t *overlap,
- real_t ipqf_buffer[SSR_BANDS][96/4],
- real_t *prev_fmd, uint16_t frame_len)
-{
- uint8_t band;
- uint16_t ssr_frame_len = frame_len/SSR_BANDS;
- real_t time_tmp[2048] = {0};
- real_t output[1024] = {0};
-
- for (band = 0; band < SSR_BANDS; band++)
- {
- int16_t j;
-
- /* uneven bands have inverted frequency scale */
- if (band == 1 || band == 3)
- {
- for (j = 0; j < ssr_frame_len/2; j++)
- {
- real_t tmp;
- tmp = freq_in[j + ssr_frame_len*band];
- freq_in[j + ssr_frame_len*band] =
- freq_in[ssr_frame_len - j - 1 + ssr_frame_len*band];
- freq_in[ssr_frame_len - j - 1 + ssr_frame_len*band] = tmp;
- }
- }
-
- /* non-overlapping inverse filterbank for SSR */
- ssr_ifilter_bank(fb, window_sequence, window_shape, window_shape_prev,
- freq_in + band*ssr_frame_len, time_tmp + band*ssr_frame_len,
- ssr_frame_len);
-
- /* gain control */
- ssr_gain_control(ssr, time_tmp, output, overlap, prev_fmd,
- band, window_sequence, ssr_frame_len);
- }
-
- /* inverse pqf to bring subbands together again */
- ssr_ipqf(ssr, output, time_out, ipqf_buffer, frame_len, SSR_BANDS);
-}
-
-static void ssr_gain_control(ssr_info *ssr, real_t *data, real_t *output,
- real_t *overlap, real_t *prev_fmd, uint8_t band,
- uint8_t window_sequence, uint16_t frame_len)
-{
- uint16_t i;
- real_t gc_function[2*1024/SSR_BANDS];
-
- if (window_sequence != EIGHT_SHORT_SEQUENCE)
- {
- ssr_gc_function(ssr, &prev_fmd[band * frame_len*2],
- gc_function, window_sequence, band, frame_len);
-
- for (i = 0; i < frame_len*2; i++)
- data[band * frame_len*2 + i] *= gc_function[i];
- for (i = 0; i < frame_len; i++)
- {
- output[band*frame_len + i] = overlap[band*frame_len + i] +
- data[band*frame_len*2 + i];
- }
- for (i = 0; i < frame_len; i++)
- {
- overlap[band*frame_len + i] =
- data[band*frame_len*2 + frame_len + i];
- }
- } else {
- uint8_t w;
- for (w = 0; w < 8; w++)
- {
- uint16_t frame_len8 = frame_len/8;
- uint16_t frame_len16 = frame_len/16;
-
- ssr_gc_function(ssr, &prev_fmd[band*frame_len*2 + w*frame_len*2/8],
- gc_function, window_sequence, frame_len);
-
- for (i = 0; i < frame_len8*2; i++)
- data[band*frame_len*2 + w*frame_len8*2+i] *= gc_function[i];
- for (i = 0; i < frame_len8; i++)
- {
- overlap[band*frame_len + i + 7*frame_len16 + w*frame_len8] +=
- data[band*frame_len*2 + 2*w*frame_len8 + i];
- }
- for (i = 0; i < frame_len8; i++)
- {
- overlap[band*frame_len + i + 7*frame_len16 + (w+1)*frame_len8] =
- data[band*frame_len*2 + 2*w*frame_len8 + frame_len8 + i];
- }
- }
- for (i = 0; i < frame_len; i++)
- output[band*frame_len + i] = overlap[band*frame_len + i];
- for (i = 0; i < frame_len; i++)
- overlap[band*frame_len + i] = overlap[band*frame_len + i + frame_len];
- }
-}
-
-static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd,
- real_t *gc_function, uint8_t window_sequence,
- uint8_t band, uint16_t frame_len)
-{
- uint16_t i;
- uint16_t len_area1, len_area2;
- int32_t aloc[10];
- real_t alev[10];
-
- switch (window_sequence)
- {
- case ONLY_LONG_SEQUENCE:
- len_area1 = frame_len/SSR_BANDS;
- len_area2 = 0;
- break;
- case LONG_START_SEQUENCE:
- len_area1 = (frame_len/SSR_BANDS)*7/32;
- len_area2 = (frame_len/SSR_BANDS)/16;
- break;
- case EIGHT_SHORT_SEQUENCE:
- len_area1 = (frame_len/8)/SSR_BANDS;
- len_area2 = 0;
- break;
- case LONG_STOP_SEQUENCE:
- len_area1 = (frame_len/SSR_BANDS);
- len_area2 = 0;
- break;
- }
-
- /* decode bitstream information */
-
- /* build array M */
-
-
- for (i = 0; i < frame_len*2; i++)
- gc_function[i] = 1;
-}
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/ssr.h
--- a/src/libfaad/ssr.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr.h,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_H__
-#define __SSR_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define SSR_BANDS 4
-#define PQFTAPS 96
-
-void ssr_decode(ssr_info *ssr, fb_info *fb, uint8_t window_sequence,
- uint8_t window_shape, uint8_t window_shape_prev,
- real_t *freq_in, real_t *time_out, real_t *overlap,
- real_t ipqf_buffer[SSR_BANDS][96/4],
- real_t *prev_fmd, uint16_t frame_len);
-
-
-static void ssr_gain_control(ssr_info *ssr, real_t *data, real_t *output,
- real_t *overlap, real_t *prev_fmd, uint8_t band,
- uint8_t window_sequence, uint16_t frame_len);
-static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd,
- real_t *gc_function, uint8_t window_sequence,
- uint16_t frame_len);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/ssr_fb.c
--- a/src/libfaad/ssr_fb.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr_fb.c,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SSR_DEC
-
-#include <string.h>
-#include <stdlib.h>
-#include "syntax.h"
-#include "filtbank.h"
-#include "mdct.h"
-#include "ssr_fb.h"
-#include "ssr_win.h"
-
-fb_info *ssr_filter_bank_init(uint16_t frame_len)
-{
- uint16_t nshort = frame_len/8;
-
- fb_info *fb = (fb_info*)faad_malloc(sizeof(fb_info));
- memset(fb, 0, sizeof(fb_info));
-
- /* normal */
- fb->mdct256 = faad_mdct_init(2*nshort);
- fb->mdct2048 = faad_mdct_init(2*frame_len);
-
- fb->long_window[0] = sine_long_256;
- fb->short_window[0] = sine_short_32;
- fb->long_window[1] = kbd_long_256;
- fb->short_window[1] = kbd_short_32;
-
- return fb;
-}
-
-void ssr_filter_bank_end(fb_info *fb)
-{
- faad_mdct_end(fb->mdct256);
- faad_mdct_end(fb->mdct2048);
-
- if (fb) faad_free(fb);
-}
-
-static INLINE void imdct_ssr(fb_info *fb, real_t *in_data,
- real_t *out_data, uint16_t len)
-{
- mdct_info *mdct;
-
- switch (len)
- {
- case 512:
- mdct = fb->mdct2048;
- break;
- case 64:
- mdct = fb->mdct256;
- break;
- }
-
- faad_imdct(mdct, in_data, out_data);
-}
-
-/* NON-overlapping inverse filterbank for use with SSR */
-void ssr_ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
- uint8_t window_shape_prev, real_t *freq_in,
- real_t *time_out, uint16_t frame_len)
-{
- int16_t i;
- real_t *transf_buf;
-
- real_t *window_long;
- real_t *window_long_prev;
- real_t *window_short;
- real_t *window_short_prev;
-
- uint16_t nlong = frame_len;
- uint16_t nshort = frame_len/8;
- uint16_t trans = nshort/2;
-
- uint16_t nflat_ls = (nlong-nshort)/2;
-
- transf_buf = (real_t*)faad_malloc(2*nlong*sizeof(real_t));
-
- window_long = fb->long_window[window_shape];
- window_long_prev = fb->long_window[window_shape_prev];
- window_short = fb->short_window[window_shape];
- window_short_prev = fb->short_window[window_shape_prev];
-
- switch (window_sequence)
- {
- case ONLY_LONG_SEQUENCE:
- imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
- for (i = nlong-1; i >= 0; i--)
- {
- time_out[i] = MUL_R_C(transf_buf[i],window_long_prev[i]);
- time_out[nlong+i] = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
- }
- break;
-
- case LONG_START_SEQUENCE:
- imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
- for (i = 0; i < nlong; i++)
- time_out[i] = MUL_R_C(transf_buf[i],window_long_prev[i]);
- for (i = 0; i < nflat_ls; i++)
- time_out[nlong+i] = transf_buf[nlong+i];
- for (i = 0; i < nshort; i++)
- time_out[nlong+nflat_ls+i] = \
MUL_R_C(transf_buf[nlong+nflat_ls+i],window_short[nshort-i-1]);
- for (i = 0; i < nflat_ls; i++)
- time_out[nlong+nflat_ls+nshort+i] = 0;
- break;
-
- case EIGHT_SHORT_SEQUENCE:
- imdct_ssr(fb, freq_in+0*nshort, transf_buf+2*nshort*0, 2*nshort);
- imdct_ssr(fb, freq_in+1*nshort, transf_buf+2*nshort*1, 2*nshort);
- imdct_ssr(fb, freq_in+2*nshort, transf_buf+2*nshort*2, 2*nshort);
- imdct_ssr(fb, freq_in+3*nshort, transf_buf+2*nshort*3, 2*nshort);
- imdct_ssr(fb, freq_in+4*nshort, transf_buf+2*nshort*4, 2*nshort);
- imdct_ssr(fb, freq_in+5*nshort, transf_buf+2*nshort*5, 2*nshort);
- imdct_ssr(fb, freq_in+6*nshort, transf_buf+2*nshort*6, 2*nshort);
- imdct_ssr(fb, freq_in+7*nshort, transf_buf+2*nshort*7, 2*nshort);
- for(i = nshort-1; i >= 0; i--)
- {
- time_out[i+0*nshort] = \
MUL_R_C(transf_buf[nshort*0+i],window_short_prev[i]);
- time_out[i+1*nshort] = MUL_R_C(transf_buf[nshort*1+i],window_short[i]);
- time_out[i+2*nshort] = \
MUL_R_C(transf_buf[nshort*2+i],window_short_prev[i]);
- time_out[i+3*nshort] = MUL_R_C(transf_buf[nshort*3+i],window_short[i]);
- time_out[i+4*nshort] = \
MUL_R_C(transf_buf[nshort*4+i],window_short_prev[i]);
- time_out[i+5*nshort] = MUL_R_C(transf_buf[nshort*5+i],window_short[i]);
- time_out[i+6*nshort] = \
MUL_R_C(transf_buf[nshort*6+i],window_short_prev[i]);
- time_out[i+7*nshort] = MUL_R_C(transf_buf[nshort*7+i],window_short[i]);
- time_out[i+8*nshort] = \
MUL_R_C(transf_buf[nshort*8+i],window_short_prev[i]);
- time_out[i+9*nshort] = MUL_R_C(transf_buf[nshort*9+i],window_short[i]);
- time_out[i+10*nshort] = \
MUL_R_C(transf_buf[nshort*10+i],window_short_prev[i]);
- time_out[i+11*nshort] = \
MUL_R_C(transf_buf[nshort*11+i],window_short[i]);
- time_out[i+12*nshort] = \
MUL_R_C(transf_buf[nshort*12+i],window_short_prev[i]);
- time_out[i+13*nshort] = \
MUL_R_C(transf_buf[nshort*13+i],window_short[i]);
- time_out[i+14*nshort] = \
MUL_R_C(transf_buf[nshort*14+i],window_short_prev[i]);
- time_out[i+15*nshort] = \
MUL_R_C(transf_buf[nshort*15+i],window_short[i]);
- }
- break;
-
- case LONG_STOP_SEQUENCE:
- imdct_ssr(fb, freq_in, transf_buf, 2*nlong);
- for (i = 0; i < nflat_ls; i++)
- time_out[i] = 0;
- for (i = 0; i < nshort; i++)
- time_out[nflat_ls+i] = \
MUL_R_C(transf_buf[nflat_ls+i],window_short_prev[i]);
- for (i = 0; i < nflat_ls; i++)
- time_out[nflat_ls+nshort+i] = transf_buf[nflat_ls+nshort+i];
- for (i = 0; i < nlong; i++)
- time_out[nlong+i] = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
- break;
- }
-
- faad_free(transf_buf);
-}
-
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/ssr_fb.h
--- a/src/libfaad/ssr_fb.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** $Id: ssr_fb.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_FB_H__
-#define __SSR_FB_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-fb_info *ssr_filter_bank_init(uint16_t frame_len);
-void ssr_filter_bank_end(fb_info *fb);
-
-/*non overlapping inverse filterbank */
-void ssr_ifilter_bank(fb_info *fb,
- uint8_t window_sequence,
- uint8_t window_shape,
- uint8_t window_shape_prev,
- real_t *freq_in,
- real_t *time_out,
- uint16_t frame_len);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/ssr_ipqf.c
--- a/src/libfaad/ssr_ipqf.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: ssr_ipqf.c,v 1.6 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#include "common.h"
-#include "structs.h"
-
-#ifdef SSR_DEC
-
-#include "ssr.h"
-#include "ssr_ipqf.h"
-
-static real_t **app_pqfbuf;
-static real_t **pp_q0, **pp_t0, **pp_t1;
-
-void gc_set_protopqf(real_t *p_proto)
-{
- int j;
- static real_t a_half[48] =
- {
- 1.2206911375946939E-05, 1.7261986723798209E-05, 1.2300093657077942E-05,
- -1.0833943097791965E-05, -5.7772498639901686E-05, -1.2764767618947719E-04,
- -2.0965186675013334E-04, -2.8166673689263850E-04, -3.1234860429017460E-04,
- -2.6738519958452353E-04, -1.1949424681824722E-04, 1.3965139412648678E-04,
- 4.8864136409185725E-04, 8.7044629275148344E-04, 1.1949430269934793E-03,
- 1.3519708175026700E-03, 1.2346314373964412E-03, 7.6953209114159191E-04,
- -5.2242432579537141E-05, -1.1516092887213454E-03, -2.3538469841711277E-03,
- -3.4033123072127277E-03, -4.0028551071986133E-03, -3.8745415659693259E-03,
- -2.8321073426874310E-03, -8.5038892323704195E-04, 1.8856751185350931E-03,
- 4.9688741735340923E-03, 7.8056704536795926E-03, 9.7027909685901654E-03,
- 9.9960423120166159E-03, 8.2019366335594487E-03, 4.1642072876103365E-03,
- -1.8364453822737758E-03, -9.0384863094167686E-03, -1.6241528177129844E-02,
- -2.1939551286300665E-02, -2.4533179947088161E-02, -2.2591663337768787E-02,
- -1.5122066420044672E-02, -1.7971713448186293E-03, 1.6903413428575379E-02,
- 3.9672315874127042E-02, 6.4487527248102796E-02, 8.8850025474701726E-02,
- 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012
- };
-
- for (j = 0; j < 48; ++j)
- {
- p_proto[j] = p_proto[95-j] = a_half[j];
- }
-}
-
-void gc_setcoef_eff_pqfsyn(int mm,
- int kk,
- real_t *p_proto,
- real_t ***ppp_q0,
- real_t ***ppp_t0,
- real_t ***ppp_t1)
-{
- int i, k, n;
- real_t w;
-
- /* Set 1st Mul&Acc Coef's */
- *ppp_q0 = (real_t **) calloc(mm, sizeof(real_t *));
- for (n = 0; n < mm; ++n)
- {
- (*ppp_q0)[n] = (real_t *) calloc(mm, sizeof(real_t));
- }
- for (n = 0; n < mm/2; ++n)
- {
- for (i = 0; i < mm; ++i)
- {
- w = (2*i+1)*(2*n+1-mm)*M_PI/(4*mm);
- (*ppp_q0)[n][i] = 2.0 * cos((real_t) w);
-
- w = (2*i+1)*(2*(mm+n)+1-mm)*M_PI/(4*mm);
- (*ppp_q0)[n + mm/2][i] = 2.0 * cos((real_t) w);
- }
- }
-
- /* Set 2nd Mul&Acc Coef's */
- *ppp_t0 = (real_t **) calloc(mm, sizeof(real_t *));
- *ppp_t1 = (real_t **) calloc(mm, sizeof(real_t *));
- for (n = 0; n < mm; ++n)
- {
- (*ppp_t0)[n] = (real_t *) calloc(kk, sizeof(real_t));
- (*ppp_t1)[n] = (real_t *) calloc(kk, sizeof(real_t));
- }
- for (n = 0; n < mm; ++n)
- {
- for (k = 0; k < kk; ++k)
- {
- (*ppp_t0)[n][k] = mm * p_proto[2*k *mm + n];
- (*ppp_t1)[n][k] = mm * p_proto[(2*k+1)*mm + n];
-
- if (k%2 != 0)
- {
- (*ppp_t0)[n][k] = -(*ppp_t0)[n][k];
- (*ppp_t1)[n][k] = -(*ppp_t1)[n][k];
- }
- }
- }
-}
-
-void ssr_ipqf(ssr_info *ssr, real_t *in_data, real_t *out_data,
- real_t buffer[SSR_BANDS][96/4],
- uint16_t frame_len, uint8_t bands)
-{
- static int initFlag = 0;
- real_t a_pqfproto[PQFTAPS];
-
- int i;
-
- if (initFlag == 0)
- {
- gc_set_protopqf(a_pqfproto);
- gc_setcoef_eff_pqfsyn(SSR_BANDS, PQFTAPS/(2*SSR_BANDS), a_pqfproto,
- &pp_q0, &pp_t0, &pp_t1);
- initFlag = 1;
- }
-
- for (i = 0; i < frame_len / SSR_BANDS; i++)
- {
- int l, n, k;
- int mm = SSR_BANDS;
- int kk = PQFTAPS/(2*SSR_BANDS);
-
- for (n = 0; n < mm; n++)
- {
- for (k = 0; k < 2*kk-1; k++)
- {
- buffer[n][k] = buffer[n][k+1];
- }
- }
-
- for (n = 0; n < mm; n++)
- {
- real_t acc = 0.0;
- for (l = 0; l < mm; l++)
- {
- acc += pp_q0[n][l] * in_data[l*frame_len/SSR_BANDS + i];
- }
- buffer[n][2*kk-1] = acc;
- }
-
- for (n = 0; n < mm/2; n++)
- {
- real_t acc = 0.0;
- for (k = 0; k < kk; k++)
- {
- acc += pp_t0[n][k] * buffer[n][2*kk-1-2*k];
- }
- for (k = 0; k < kk; ++k)
- {
- acc += pp_t1[n][k] * buffer[n + mm/2][2*kk-2-2*k];
- }
- out_data[i*SSR_BANDS + n] = acc;
-
- acc = 0.0;
- for (k = 0; k < kk; k++)
- {
- acc += pp_t0[mm-1-n][k] * buffer[n][2*kk-1-2*k];
- }
- for (k = 0; k < kk; k++)
- {
- acc -= pp_t1[mm-1-n][k] * buffer[n + mm/2][2*kk-2-2*k];
- }
- out_data[i*SSR_BANDS + mm-1-n] = acc;
- }
- }
-}
-
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/ssr_ipqf.h
--- a/src/libfaad/ssr_ipqf.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** $Id: ssr_ipqf.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_IPQF_H__
-#define __SSR_IPQF_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void ssr_ipqf(ssr_info *ssr, real_t *in_data, real_t *out_data,
- real_t buffer[SSR_BANDS][96/4],
- uint16_t frame_len, uint8_t bands);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/ssr_win.h
--- a/src/libfaad/ssr_win.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,626 +0,0 @@
-/*
-** FAAD - Freeware Advanced Audio Decoder
-** Copyright (C) 2002 M. Bakker
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** $Id: ssr_win.h,v 1.5 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __SSR_WIN_H__
-#define __SSR_WIN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(disable:4305)
-#pragma warning(disable:4244)
-#endif
-
-static real_t sine_short_32[] = {
- 0.0245412290,
- 0.0735645667,
- 0.1224106774,
- 0.1709618866,
- 0.2191012502,
- 0.2667127550,
- 0.3136817515,
- 0.3598950505,
- 0.4052413106,
- 0.4496113360,
- 0.4928981960,
- 0.5349976420,
- 0.5758082271,
- 0.6152316332,
- 0.6531728506,
- 0.6895405650,
- 0.7242470980,
- 0.7572088838,
- 0.7883464694,
- 0.8175848126,
- 0.8448535800,
- 0.8700870275,
- 0.8932242990,
- 0.9142097831,
- 0.9329928160,
- 0.9495282173,
- 0.9637760520,
- 0.9757021666,
- 0.9852776527,
- 0.9924795628,
- 0.9972904325,
- 0.9996988177
-};
-
-static real_t sine_long_256[] = {
- 0.0030679568,
- 0.0092037553,
- 0.0153392069,
- 0.0214740802,
- 0.0276081469,
- 0.0337411724,
- 0.0398729295,
- 0.0460031852,
- 0.0521317050,
- 0.0582582653,
- 0.0643826351,
- 0.0705045760,
- 0.0766238645,
- 0.0827402696,
- 0.0888535529,
- 0.0949634984,
- 0.1010698676,
- 0.1071724296,
- 0.1132709533,
- 0.1193652153,
- 0.1254549921,
- 0.1315400302,
- 0.1376201212,
- 0.1436950415,
- 0.1497645378,
- 0.1558284014,
- 0.1618863940,
- 0.1679383069,
- 0.1739838719,
- 0.1800229102,
- 0.1860551536,
- 0.1920804083,
- 0.1980984211,
- 0.2041089684,
- 0.2101118416,
- 0.2161068022,
- 0.2220936269,
- 0.2280720919,
- 0.2340419590,
- 0.2400030345,
- 0.2459550500,
- 0.2518978119,
- 0.2578310966,
- 0.2637546957,
- 0.2696683407,
- 0.2755718231,
- 0.2814649343,
- 0.2873474658,
- 0.2932191789,
- 0.2990798354,
- 0.3049292266,
- 0.3107671738,
- 0.3165933788,
- 0.3224076927,
- 0.3282098472,
[... 374 lines omitted ...]
- 0.7564342060337386,
- 0.7636471334404891,
- 0.7707533593446514,
- 0.7777508661725849,
- 0.7846377507242818,
- 0.7914122257259034,
- 0.7980726212080798,
- 0.8046173857073919,
- 0.8110450872887550,
- 0.8173544143867162,
- 0.8235441764639875,
- 0.8296133044858474,
- 0.8355608512093652,
- 0.8413859912867303,
- 0.8470880211822968,
- 0.8526663589032990,
- 0.8581205435445334,
- 0.8634502346476508,
- 0.8686552113760616,
- 0.8737353715068081,
- 0.8786907302411250,
- 0.8835214188357692,
- 0.8882276830575707,
- 0.8928098814640207,
- 0.8972684835130879,
- 0.9016040675058185,
- 0.9058173183656508,
- 0.9099090252587376,
- 0.9138800790599416,
- 0.9177314696695282,
- 0.9214642831859411,
- 0.9250796989403991,
- 0.9285789863994010,
- 0.9319635019415643,
- 0.9352346855155568,
- 0.9383940571861993,
- 0.9414432135761304,
- 0.9443838242107182,
- 0.9472176277741918,
- 0.9499464282852282,
- 0.9525720912004834,
- 0.9550965394547873,
- 0.9575217494469370,
- 0.9598497469802043,
- 0.9620826031668507,
- 0.9642224303060783,
- 0.9662713777449607,
- 0.9682316277319895,
- 0.9701053912729269,
- 0.9718949039986892,
- 0.9736024220549734,
- 0.9752302180233160,
- 0.9767805768831932,
- 0.9782557920246753,
- 0.9796581613210076,
- 0.9809899832703159,
- 0.9822535532154261,
- 0.9834511596505429,
- 0.9845850806232530,
- 0.9856575802399989,
- 0.9866709052828243,
- 0.9876272819448033,
- 0.9885289126911557,
- 0.9893779732525968,
- 0.9901766097569984,
- 0.9909269360049311,
- 0.9916310308941294,
- 0.9922909359973702,
- 0.9929086532976777,
- 0.9934861430841844,
- 0.9940253220113651,
- 0.9945280613237534,
- 0.9949961852476154,
- 0.9954314695504363,
- 0.9958356402684387,
- 0.9962103726017252,
- 0.9965572899760172,
- 0.9968779632693499,
- 0.9971739102014799,
- 0.9974465948831872,
- 0.9976974275220812,
- 0.9979277642809907,
- 0.9981389072844972,
- 0.9983321047686901,
- 0.9985085513687731,
- 0.9986693885387259,
- 0.9988157050968516,
- 0.9989485378906924,
- 0.9990688725744943,
- 0.9991776444921379,
- 0.9992757396582338,
- 0.9993639958299003,
- 0.9994432036616085,
- 0.9995141079353859,
- 0.9995774088586188,
- 0.9996337634216871,
- 0.9996837868076957,
- 0.9997280538466377,
- 0.9997671005064359,
- 0.9998014254134544,
- 0.9998314913952471,
- 0.9998577270385304,
- 0.9998805282555989,
- 0.9999002598526793,
- 0.9999172570940037,
- 0.9999318272557038,
- 0.9999442511639580,
- 0.9999547847121726,
- 0.9999636603523446,
- 0.9999710885561258,
- 0.9999772592414866,
- 0.9999823431612708,
- 0.9999864932503106,
- 0.9999898459281599,
- 0.9999925223548691,
- 0.9999946296375997,
- 0.9999962619864214,
- 0.9999975018180320,
- 0.9999984208055542,
- 0.9999990808746198,
- 0.9999995351446231,
- 0.9999998288155155
-};
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/structs.h
--- a/src/libfaad/structs.h Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,473 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: structs.h,v 1.7 2005/10/29 23:57:07 tmmm Exp $
-**/
-
-#ifndef __STRUCTS_H__
-#define __STRUCTS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "cfft.h"
-#ifdef SBR_DEC
-#include "sbr_dec.h"
-#endif
-
-#define MAX_CHANNELS 64
-#define MAX_SYNTAX_ELEMENTS 48
-#define MAX_WINDOW_GROUPS 8
-#define MAX_SFB 51
-#define MAX_LTP_SFB 40
-#define MAX_LTP_SFB_S 8
-
-/* used to save the prediction state */
-typedef struct {
- int16_t r[2];
- int16_t COR[2];
- int16_t VAR[2];
-} pred_state;
-
-typedef struct {
- uint16_t N;
- cfft_info *cfft;
- complex_t *sincos;
-#ifdef PROFILE
- int64_t cycles;
- int64_t fft_cycles;
-#endif
-} mdct_info;
-
-typedef struct
-{
- const real_t *long_window[2];
- const real_t *short_window[2];
-#ifdef LD_DEC
- const real_t *ld_window[2];
-#endif
-
- mdct_info *mdct256;
-#ifdef LD_DEC
- mdct_info *mdct1024;
-#endif
- mdct_info *mdct2048;
-#ifdef PROFILE
- int64_t cycles;
-#endif
-} fb_info;
-
-typedef struct
-{
- uint8_t present;
-
- uint8_t num_bands;
- uint8_t pce_instance_tag;
- uint8_t excluded_chns_present;
- uint8_t band_top[17];
- uint8_t prog_ref_level;
- uint8_t dyn_rng_sgn[17];
- uint8_t dyn_rng_ctl[17];
- uint8_t exclude_mask[MAX_CHANNELS];
- uint8_t additional_excluded_chns[MAX_CHANNELS];
-
- real_t ctrl1;
- real_t ctrl2;
-} drc_info;
-
-typedef struct
-{
- uint8_t element_instance_tag;
- uint8_t object_type;
- uint8_t sf_index;
- uint8_t num_front_channel_elements;
- uint8_t num_side_channel_elements;
- uint8_t num_back_channel_elements;
- uint8_t num_lfe_channel_elements;
- uint8_t num_assoc_data_elements;
- uint8_t num_valid_cc_elements;
- uint8_t mono_mixdown_present;
- uint8_t mono_mixdown_element_number;
- uint8_t stereo_mixdown_present;
- uint8_t stereo_mixdown_element_number;
- uint8_t matrix_mixdown_idx_present;
- uint8_t pseudo_surround_enable;
- uint8_t matrix_mixdown_idx;
- uint8_t front_element_is_cpe[16];
- uint8_t front_element_tag_select[16];
- uint8_t side_element_is_cpe[16];
- uint8_t side_element_tag_select[16];
- uint8_t back_element_is_cpe[16];
- uint8_t back_element_tag_select[16];
- uint8_t lfe_element_tag_select[16];
[... 221 lines omitted ...]
- /*uint32_t*/ unsigned long samples;
- /*uint8_t*/ unsigned char channels;
- /*uint8_t*/ unsigned char error;
- /*uint32_t*/ unsigned long samplerate;
-
- /* SBR: 0: off, 1: on; normal, 2: on; downsampled */
- /*uint8_t*/ unsigned char sbr;
-
- /* MPEG-4 ObjectType */
- /*uint8_t*/ unsigned char object_type;
-
- /* AAC header type; MP4 will be signalled as RAW also */
- /*uint8_t*/ unsigned char header_type;
-
- /* multichannel configuration */
- /*uint8_t*/ unsigned char num_front_channels;
- /*uint8_t*/ unsigned char num_side_channels;
- /*uint8_t*/ unsigned char num_back_channels;
- /*uint8_t*/ unsigned char num_lfe_channels;
- /*uint8_t*/ unsigned char channel_position[MAX_CHANNELS];
-
- /* PS: 0: off, 1: on */
- /*uint8_t*/ unsigned char ps;
-} NeAACDecFrameInfo;
-
-typedef struct
-{
- uint8_t adts_header_present;
- uint8_t adif_header_present;
- uint8_t sf_index;
- uint8_t object_type;
- uint8_t channelConfiguration;
-#ifdef ERROR_RESILIENCE
- uint8_t aacSectionDataResilienceFlag;
- uint8_t aacScalefactorDataResilienceFlag;
- uint8_t aacSpectralDataResilienceFlag;
-#endif
- uint16_t frameLength;
- uint8_t postSeekResetFlag;
-
- uint32_t frame;
-
- uint8_t downMatrix;
- uint8_t upMatrix;
- uint8_t first_syn_ele;
- uint8_t has_lfe;
- /* number of channels in current frame */
- uint8_t fr_channels;
- /* number of elements in current frame */
- uint8_t fr_ch_ele;
-
- /* element_output_channels:
- determines the number of channels the element will output
- */
- uint8_t element_output_channels[MAX_SYNTAX_ELEMENTS];
- /* element_alloced:
- determines whether the data needed for the element is allocated or not
- */
- uint8_t element_alloced[MAX_SYNTAX_ELEMENTS];
- /* alloced_channels:
- determines the number of channels where output data is allocated for
- */
- uint8_t alloced_channels;
-
- /* output data buffer */
- void *sample_buffer;
-
- uint8_t window_shape_prev[MAX_CHANNELS];
-#ifdef LTP_DEC
- uint16_t ltp_lag[MAX_CHANNELS];
-#endif
- fb_info *fb;
- drc_info *drc;
-
- real_t *time_out[MAX_CHANNELS];
- real_t *fb_intermed[MAX_CHANNELS];
-
-#ifdef SBR_DEC
- int8_t sbr_present_flag;
- int8_t forceUpSampling;
- int8_t downSampledSBR;
- /* determines whether SBR data is allocated for the gives element */
- uint8_t sbr_alloced[MAX_SYNTAX_ELEMENTS];
-
- sbr_info *sbr[MAX_SYNTAX_ELEMENTS];
-#endif
-#if (defined(PS_DEC) || defined(DRM_PS))
- uint8_t ps_used[MAX_SYNTAX_ELEMENTS];
- uint8_t ps_used_global;
-#endif
-
-#ifdef SSR_DEC
- real_t *ssr_overlap[MAX_CHANNELS];
- real_t *prev_fmd[MAX_CHANNELS];
- real_t ipqf_buffer[MAX_CHANNELS][4][96/4];
-#endif
-
-#ifdef MAIN_DEC
- pred_state *pred_stat[MAX_CHANNELS];
-#endif
-#ifdef LTP_DEC
- int16_t *lt_pred_stat[MAX_CHANNELS];
-#endif
-
- /* Program Config Element */
- uint8_t pce_set;
- program_config pce;
- uint8_t element_id[MAX_CHANNELS];
- uint8_t internal_channel[MAX_CHANNELS];
-
- /* Configuration data */
- NeAACDecConfiguration config;
-
-#ifdef PROFILE
- int64_t cycles;
- int64_t spectral_cycles;
- int64_t output_cycles;
- int64_t scalefac_cycles;
- int64_t requant_cycles;
-#endif
-} NeAACDecStruct, *NeAACDecHandle;
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r 3e9d711a77870cbbca8db3bca3dcacad6092064f -r \
df73844e8a47005bef76ffe6cd9323d8e6a1c218 src/libfaad/syntax.c
--- a/src/libfaad/syntax.c Thu Jun 21 23:27:37 2007 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2330 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
-**
-** $Id: syntax.c,v 1.10 2006/09/26 17:48:24 dgp85 Exp $
-**/
-
-/*
- Reads the AAC bitstream as defined in 14496-3 (MPEG-4 Audio)
-*/
-
-#include "common.h"
-#include "structs.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "decoder.h"
-#include "syntax.h"
-#include "specrec.h"
-#include "huffman.h"
-#include "bits.h"
-#include "pulse.h"
-#include "analysis.h"
-#include "drc.h"
-#ifdef ERROR_RESILIENCE
-#include "rvlc.h"
-#endif
-#ifdef SBR_DEC
-#include "sbr_syntax.h"
-#endif
-
-
-/* static function declarations */
-static void decode_sce_lfe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, \
bitfile *ld,
- uint8_t id_syn_ele);
-static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile \
*ld,
- uint8_t id_syn_ele);
-static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
- uint8_t channel, uint8_t *tag);
-static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
- uint8_t channel, uint8_t *tag);
-#ifdef COUPLING_DEC
-static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld);
-#endif
-static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld);
-static uint8_t program_config_element(program_config *pce, bitfile *ld);
-static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
-#ifdef SBR_DEC
- ,uint8_t sbr_ele
-#endif
- );
-static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele,
- bitfile *ld, ic_stream *ics, uint8_t \
scal_flag,
- int16_t *spec_data);
-static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
- uint8_t common_window);
-static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld);
-static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile \
*ld);
-#ifdef SSR_DEC
-static void gain_control_data(bitfile *ld, ic_stream *ics);
-#endif
-static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
- int16_t *spectral_data);
-static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count);
-static uint8_t pulse_data(ic_stream *ics, pulse_info *pul, bitfile *ld);
-static void tns_data(ic_stream *ics, tns_info *tns, bitfile *ld);
-#ifdef LTP_DEC
-static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, \
bitfile *ld);
-#endif
-static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld);
-static void adts_variable_header(adts_header *adts, bitfile *ld);
-static void adts_error_check(adts_header *adts, bitfile *ld);
-static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc);
-static uint8_t excluded_channels(bitfile *ld, drc_info *drc);
-#ifdef SCALABLE_DEC
-static int8_t aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, \
ic_stream *ics2,
- bitfile *ld, uint8_t this_layer_stereo);
-#endif
-
-
-/* Table 4.4.1 */
-int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC,
- program_config *pce_out)
-{
- program_config pce;
-
- /* 1024 or 960 */
- mp4ASC->frameLengthFlag = faad_get1bit(ld
- DEBUGVAR(1,138,"GASpecificConfig(): FrameLengthFlag"));
-#ifndef ALLOW_SMALL_FRAMELENGTH
- if (mp4ASC->frameLengthFlag == 1)
- return -3;
-#endif
-
- mp4ASC->dependsOnCoreCoder = faad_get1bit(ld
- DEBUGVAR(1,139,"GASpecificConfig(): DependsOnCoreCoder"));
- if (mp4ASC->dependsOnCoreCoder == 1)
- {
- mp4ASC->coreCoderDelay = (uint16_t)faad_getbits(ld, 14
- DEBUGVAR(1,140,"GASpecificConfig(): CoreCoderDelay"));
- }
-
- mp4ASC->extensionFlag = faad_get1bit(ld DEBUGVAR(1,141,"GASpecificConfig(): \
ExtensionFlag")); [... 2078 lines omitted ...]
- adif->copyright_id_present = faad_get1bit(ld
- DEBUGVAR(1,110,"get_adif_header(): copyright_id_present"));
- if(adif->copyright_id_present)
- {
- for (i = 0; i < 72/8; i++)
- {
- adif->copyright_id[i] = (int8_t)faad_getbits(ld, 8
- DEBUGVAR(1,111,"get_adif_header(): copyright_id"));
- }
- adif->copyright_id[i] = 0;
- }
- adif->original_copy = faad_get1bit(ld
- DEBUGVAR(1,112,"get_adif_header(): original_copy"));
- adif->home = faad_get1bit(ld
- DEBUGVAR(1,113,"get_adif_header(): home"));
- adif->bitstream_type = faad_get1bit(ld
- DEBUGVAR(1,114,"get_adif_header(): bitstream_type"));
- adif->bitrate = faad_getbits(ld, 23
- DEBUGVAR(1,115,"get_adif_header(): bitrate"));
- adif->num_program_config_elements = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,116,"get_adif_header(): num_program_config_elements"));
-
- for (i = 0; i < adif->num_program_config_elements + 1; i++)
- {
- if(adif->bitstream_type == 0)
- {
- adif->adif_buffer_fullness = faad_getbits(ld, 20
- DEBUGVAR(1,117,"get_adif_header(): adif_buffer_fullness"));
- } else {
- adif->adif_buffer_fullness = 0;
- }
-
- program_config_element(&adif->pce[i], ld);
- }
-}
-
-/* Table 1.A.5 */
-uint8_t adts_frame(adts_header *adts, bitfile *ld)
-{
- /* faad_byte_align(ld); */
- if (adts_fixed_header(adts, ld))
- return 5;
- adts_variable_header(adts, ld);
- adts_error_check(adts, ld);
-
- return 0;
-}
-
-/* Table 1.A.6 */
-static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld)
-{
- uint16_t i;
- uint8_t sync_err = 1;
-
- /* try to recover from sync errors */
- for (i = 0; i < 768; i++)
- {
- adts->syncword = (uint16_t)faad_showbits(ld, 12);
- if (adts->syncword != 0xFFF)
- {
- faad_getbits(ld, 8
- DEBUGVAR(0,0,""));
- } else {
- sync_err = 0;
- faad_getbits(ld, 12
- DEBUGVAR(1,118,"adts_fixed_header(): syncword"));
- break;
- }
- }
- if (sync_err)
- return 5;
-
- adts->id = faad_get1bit(ld
- DEBUGVAR(1,119,"adts_fixed_header(): id"));
- adts->layer = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,120,"adts_fixed_header(): layer"));
- adts->protection_absent = faad_get1bit(ld
- DEBUGVAR(1,121,"adts_fixed_header(): protection_absent"));
- adts->profile = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,122,"adts_fixed_header(): profile"));
- adts->sf_index = (uint8_t)faad_getbits(ld, 4
- DEBUGVAR(1,123,"adts_fixed_header(): sf_index"));
- adts->private_bit = faad_get1bit(ld
- DEBUGVAR(1,124,"adts_fixed_header(): private_bit"));
- adts->channel_configuration = (uint8_t)faad_getbits(ld, 3
- DEBUGVAR(1,125,"adts_fixed_header(): channel_configuration"));
- adts->original = faad_get1bit(ld
- DEBUGVAR(1,126,"adts_fixed_header(): original"));
- adts->home = faad_get1bit(ld
- DEBUGVAR(1,127,"adts_fixed_header(): home"));
-
- if (adts->old_format == 1)
- {
- /* Removed in corrigendum 14496-3:2002 */
- if (adts->id == 0)
- {
- adts->emphasis = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,128,"adts_fixed_header(): emphasis"));
- }
- }
-
- return 0;
-}
-
-/* Table 1.A.7 */
-static void adts_variable_header(adts_header *adts, bitfile *ld)
-{
- adts->copyright_identification_bit = faad_get1bit(ld
- DEBUGVAR(1,129,"adts_variable_header(): copyright_identification_bit"));
- adts->copyright_identification_start = faad_get1bit(ld
- DEBUGVAR(1,130,"adts_variable_header(): copyright_identification_start"));
- adts->aac_frame_length = (uint16_t)faad_getbits(ld, 13
- DEBUGVAR(1,131,"adts_variable_header(): aac_frame_length"));
- adts->adts_buffer_fullness = (uint16_t)faad_getbits(ld, 11
- DEBUGVAR(1,132,"adts_variable_header(): adts_buffer_fullness"));
- adts->no_raw_data_blocks_in_frame = (uint8_t)faad_getbits(ld, 2
- DEBUGVAR(1,133,"adts_variable_header(): no_raw_data_blocks_in_frame"));
-}
-
-/* Table 1.A.8 */
-static void adts_error_check(adts_header *adts, bitfile *ld)
-{
- if (adts->protection_absent == 0)
- {
- adts->crc_check = (uint16_t)faad_getbits(ld, 16
- DEBUGVAR(1,134,"adts_error_check(): crc_check"));
- }
-}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic