1 /* 2 ** Copyright 2003-2010, VisualOn, Inc. 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 express or implied. 13 ** See the License for the specific language governing permissions and 14 ** limitations under the License. 15 */ 16 /******************************************************************************* 17 File: psy_main.h 18 19 Content: Psychoacoustic major function block 20 21 *******************************************************************************/ 22 23 #ifndef _PSYMAIN_H 24 #define _PSYMAIN_H 25 26 #include "psy_configuration.h" 27 #include "qc_data.h" 28 #include "memalign.h" 29 30 /* 31 psy kernel 32 */ 33 typedef struct { 34 PSY_CONFIGURATION_LONG psyConfLong; /* Word16 size: 515 */ 35 PSY_CONFIGURATION_SHORT psyConfShort; /* Word16 size: 167 */ 36 PSY_DATA psyData[MAX_CHANNELS]; /* Word16 size: MAX_CHANNELS*1669*/ 37 TNS_DATA tnsData[MAX_CHANNELS]; /* Word16 size: MAX_CHANNELS*235 */ 38 Word32* pScratchTns; 39 Word16 sampleRateIdx; 40 }PSY_KERNEL; /* Word16 size: 2587 / 4491 */ 41 42 43 Word16 PsyNew( PSY_KERNEL *hPsy, Word32 nChan, VO_MEM_OPERATOR *pMemOP); 44 Word16 PsyDelete( PSY_KERNEL *hPsy, VO_MEM_OPERATOR *pMemOP); 45 46 Word16 PsyOutNew( PSY_OUT *hPsyOut, VO_MEM_OPERATOR *pMemOP); 47 Word16 PsyOutDelete( PSY_OUT *hPsyOut, VO_MEM_OPERATOR *pMemOP); 48 49 Word16 psyMainInit( PSY_KERNEL *hPsy, 50 Word32 sampleRate, 51 Word32 bitRate, 52 Word16 channels, 53 Word16 tnsMask, 54 Word16 bandwidth); 55 56 57 Word16 psyMain(Word16 nChannels, /*!< total number of channels */ 58 ELEMENT_INFO *elemInfo, 59 Word16 *timeSignal, /*!< interleaved time signal */ 60 PSY_DATA psyData[MAX_CHANNELS], 61 TNS_DATA tnsData[MAX_CHANNELS], 62 PSY_CONFIGURATION_LONG* psyConfLong, 63 PSY_CONFIGURATION_SHORT* psyConfShort, 64 PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], 65 PSY_OUT_ELEMENT *psyOutElement, 66 Word32 *pScratchTns, 67 Word32 sampleRate); 68 69 #endif /* _PSYMAIN_H */ 70