ps_dec.h

00001 /*
00002 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
00003 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
00004 **  
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 ** 
00010 ** This program is distributed in the hope that it will be useful,
00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ** GNU General Public License for more details.
00014 ** 
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software 
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 **
00019 ** Any non-GPL usage of this software or parts of this software is strictly
00020 ** forbidden.
00021 **
00022 ** Software using this code must display the following message visibly in the
00023 ** software:
00024 ** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Ahead Software, www.nero.com"
00025 ** in, for example, the about-box or help/startup screen.
00026 **
00027 ** Commercial non-GPL licensing of this software is possible.
00028 ** For more info contact Ahead Software through [email protected].
00029 **
00030 ** $Id: ps_dec.h,v 1.2 2005/11/01 21:41:43 gabest Exp $
00031 **/
00032 
00033 #ifndef __PS_DEC_H__
00034 #define __PS_DEC_H__
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 #include "bits.h"
00041 
00042 #define EXTENSION_ID_PS 2
00043 
00044 #define MAX_PS_ENVELOPES 5
00045 #define NO_ALLPASS_LINKS 3
00046 
00047 typedef struct
00048 {
00049     /* bitstream parameters */
00050     uint8_t enable_iid;
00051     uint8_t enable_icc;
00052     uint8_t enable_ext;
00053 
00054     uint8_t iid_mode;
00055     uint8_t icc_mode;
00056     uint8_t nr_iid_par;
00057     uint8_t nr_ipdopd_par;
00058     uint8_t nr_icc_par;
00059 
00060     uint8_t frame_class;
00061     uint8_t num_env;
00062 
00063     uint8_t border_position[MAX_PS_ENVELOPES+1];
00064 
00065     uint8_t iid_dt[MAX_PS_ENVELOPES];
00066     uint8_t icc_dt[MAX_PS_ENVELOPES];
00067 
00068     uint8_t enable_ipdopd;
00069     uint8_t ipd_mode;
00070     uint8_t ipd_dt[MAX_PS_ENVELOPES];
00071     uint8_t opd_dt[MAX_PS_ENVELOPES];
00072 
00073     /* indices */
00074     int8_t iid_index_prev[34];
00075     int8_t icc_index_prev[34];
00076     int8_t ipd_index_prev[17];
00077     int8_t opd_index_prev[17];
00078     int8_t iid_index[MAX_PS_ENVELOPES][34];
00079     int8_t icc_index[MAX_PS_ENVELOPES][34];
00080     int8_t ipd_index[MAX_PS_ENVELOPES][17];
00081     int8_t opd_index[MAX_PS_ENVELOPES][17];
00082 
00083     int8_t ipd_index_1[17];
00084     int8_t opd_index_1[17];
00085     int8_t ipd_index_2[17];
00086     int8_t opd_index_2[17];
00087 
00088     /* ps data was correctly read */
00089     uint8_t ps_data_available;
00090 
00091     /* a header has been read */
00092     uint8_t header_read;
00093 
00094     /* hybrid filterbank parameters */
00095     void *hyb;
00096     uint8_t use34hybrid_bands;
00097 
00098     
00099     uint8_t num_groups;
00100     uint8_t num_hybrid_groups;
00101     uint8_t nr_par_bands;
00102     uint8_t nr_allpass_bands;
00103     uint8_t decay_cutoff;
00104 
00105     uint8_t *group_border;
00106     uint16_t *map_group2bk;
00107 
00108     /* filter delay handling */
00109     uint8_t saved_delay;
00110     uint8_t delay_buf_index_ser[NO_ALLPASS_LINKS];
00111     uint8_t num_sample_delay_ser[NO_ALLPASS_LINKS];
00112     uint8_t delay_D[64];
00113     uint8_t delay_buf_index_delay[64];
00114 
00115     complex_t delay_Qmf[14][64]; /* 14 samples delay max, 64 QMF channels */
00116     complex_t delay_SubQmf[2][32]; /* 2 samples delay max (SubQmf is always allpass filtered) */
00117     complex_t delay_Qmf_ser[NO_ALLPASS_LINKS][5][64]; /* 5 samples delay max (table 8.34), 64 QMF channels */
00118     complex_t delay_SubQmf_ser[NO_ALLPASS_LINKS][5][32]; /* 5 samples delay max (table 8.34) */
00119 
00120     /* transients */
00121     real_t alpha_decay;
00122     real_t alpha_smooth;
00123 
00124     real_t P_PeakDecayNrg[34];
00125     real_t P_prev[34];
00126     real_t P_SmoothPeakDecayDiffNrg_prev[34];
00127 
00128     /* mixing and phase */
00129     complex_t h11_prev[50];
00130     complex_t h12_prev[50];
00131     complex_t h21_prev[50];
00132     complex_t h22_prev[50];
00133     uint8_t phase_hist;
00134     complex_t ipd_prev[20][2];
00135     complex_t opd_prev[20][2];
00136 
00137 } ps_info;
00138 
00139 /* ps_syntax.c */
00140 uint16_t ps_data(ps_info *ps, bitfile *ld, uint8_t *header);
00141 
00142 /* ps_dec.c */
00143 ps_info *ps_init(uint8_t sr_index);
00144 void ps_free(ps_info *ps);
00145 
00146 uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]);
00147 
00148 
00149 #ifdef __cplusplus
00150 }
00151 #endif
00152 #endif
00153 

Generated on Tue Dec 13 14:47:42 2005 for guliverkli by  doxygen 1.4.5