1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 /* 19 20 Filename: s_sbr_frame_data.h 21 Funtions: 22 23 ------------------------------------------------------------------------------ 24 REVISION HISTORY 25 26 27 Who: Date: MM/DD/YYYY 28 Description: 29 ------------------------------------------------------------------------------ 30 31 32 ---------------------------------------------------------------------------- 33 ; CONTINUE ONLY IF NOT ALREADY DEFINED 34 ----------------------------------------------------------------------------*/ 35 #ifndef S_SBR_FRAME_DATA_H 36 #define S_SBR_FRAME_DATA_H 37 38 /*---------------------------------------------------------------------------- 39 ; INCLUDES 40 ----------------------------------------------------------------------------*/ 41 #include "pv_audio_type_defs.h" 42 #include "s_sbr_header_data.h" 43 #include "e_invf_mode.h" 44 #include "e_coupling_mode.h" 45 #include "sbr_constants.h" 46 #include "s_patch.h" 47 /*---------------------------------------------------------------------------- 48 ; MACROS 49 ; Define module specific macros here 50 ----------------------------------------------------------------------------*/ 51 52 /*---------------------------------------------------------------------------- 53 ; DEFINES 54 ; Include all pre-processor statements here. 55 ----------------------------------------------------------------------------*/ 56 57 /*---------------------------------------------------------------------------- 58 ; EXTERNAL VARIABLES REFERENCES 59 ; Declare variables used in this module but defined elsewhere 60 ----------------------------------------------------------------------------*/ 61 62 /*---------------------------------------------------------------------------- 63 ; SIMPLE TYPEDEF'S 64 ----------------------------------------------------------------------------*/ 65 /*---------------------------------------------------------------------------- 66 ; ENUMERATED TYPEDEF'S 67 ----------------------------------------------------------------------------*/ 68 69 /*---------------------------------------------------------------------------- 70 ; STRUCTURES TYPEDEF'S 71 ----------------------------------------------------------------------------*/ 72 typedef struct 73 { 74 Int32 nScaleFactors; /* total number of scalefactors in frame */ 75 Int32 nNoiseFactors; 76 Int32 crcCheckSum; 77 Int32 frameClass; 78 Int32 frameInfo[LENGTH_FRAME_INFO]; 79 Int32 nSfb[2]; 80 Int32 nNfb; 81 Int32 offset; 82 Int32 ampRes; 83 Int32 nNoiseFloorEnvelopes; 84 Int32 p; 85 Int32 prevEnvIsShort; 86 87 Int32 reset_flag; 88 89 90 SBR_HEADER_DATA sbr_header; 91 92 93 /* dynamic control signals */ 94 Int32 domain_vec1[MAX_ENVELOPES]; 95 Int32 domain_vec2[MAX_ENVELOPES]; 96 97 98 INVF_MODE sbr_invf_mode[MAX_NUM_NOISE_VALUES]; 99 INVF_MODE sbr_invf_mode_prev[MAX_NUM_NOISE_VALUES]; 100 101 COUPLING_MODE coupling; /* 3 possibilities: off, level, pan */ 102 103 104 Int32 addHarmonics[MAX_NUM_ENVELOPE_VALUES]; 105 106 /* Used by calc_sbr_envelope */ 107 Int32 hFp[64]; 108 Int32 harm_index; 109 Int32 phase_index; 110 Int32 sUp; 111 112 /* 113 * envelope data 114 */ 115 116 Int32 iEnvelope_man[MAX_NUM_ENVELOPE_VALUES]; /* mantissa */ 117 Int32 iEnvelope_exp[MAX_NUM_ENVELOPE_VALUES]; /* exponent */ 118 Int32 sfb_nrg_prev_man[MAX_FREQ_COEFFS]; /* mantissa */ 119 120 121 /* 122 * noise data 123 */ 124 125 Int32 sbrNoiseFloorLevel_man[MAX_NUM_NOISE_VALUES]; /* mantissa */ 126 Int32 sbrNoiseFloorLevel_exp[MAX_NUM_NOISE_VALUES]; /* exponent */ 127 Int32 prevNoiseLevel_man[MAX_NUM_NOISE_VALUES]; /* mantissa */ 128 129 Int32 BwVector[MAX_NUM_PATCHES]; 130 Int32 BwVectorOld[MAX_NUM_PATCHES]; 131 /* Both implement a pseudo circular buffer */ 132 133 /* 134 * 40 == Biggest of autoCorrLength(38) + sbrDec->bufReadOffs (2) and 135 * sbrDec->noCols (32) + sbrDec->bufWriteOffs (6) 136 */ 137 Int32 codecQmfBufferReal[40][32]; 138 Int32 *sbrQmfBufferReal; 139 Int32 HistsbrQmfBufferReal[6*SBR_NUM_BANDS]; 140 #ifdef HQ_SBR 141 Int32 codecQmfBufferImag[40][32]; 142 Int32 *sbrQmfBufferImag; 143 Int32 HistsbrQmfBufferImag[6*SBR_NUM_BANDS]; 144 #endif 145 Int16 V[1152]; /* Used by calc_sbr_synfilterbank as freq. history buffer */ 146 147 148 Int32 degreeAlias[64]; 149 150 151 #ifdef HQ_SBR 152 153 Int32 fBuffer_man[5][64]; /* smoothing history buffers */ 154 Int32 fBufferN_man[5][64]; 155 Int32 fBuffer_exp[5][64]; /* smoothing history buffers */ 156 Int32 fBufferN_exp[5][64]; 157 158 Int32 *fBuf_man[64]; /* pointer to smoothing history buffers */ 159 Int32 *fBuf_exp[64]; /* pointer to smoothing history buffers */ 160 Int32 *fBufN_man[64]; 161 Int32 *fBufN_exp[64]; 162 163 164 #endif 165 166 } 167 SBR_FRAME_DATA; 168 169 170 /*---------------------------------------------------------------------------- 171 ; GLOBAL FUNCTION DEFINITIONS 172 ; Function Prototype declaration 173 ----------------------------------------------------------------------------*/ 174 175 176 /*---------------------------------------------------------------------------- 177 ; END 178 ----------------------------------------------------------------------------*/ 179 #endif 180 181 182