1e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard/* 2e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** Copyright 2003-2010, VisualOn, Inc. 3e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** 4e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** Licensed under the Apache License, Version 2.0 (the "License"); 5e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** you may not use this file except in compliance with the License. 6e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** You may obtain a copy of the License at 7e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** 8e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** http://www.apache.org/licenses/LICENSE-2.0 9e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** 10e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** Unless required by applicable law or agreed to in writing, software 11e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** distributed under the License is distributed on an "AS IS" BASIS, 12e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** See the License for the specific language governing permissions and 14e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard ** limitations under the License. 15e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard */ 16e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard/******************************************************************************* 17e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard File: adj_thr.h 18e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard 19b676a05348e4c516fa8b57e33b10548e6142c3f8Mans Rullgard Content: Threshold compensation function 20e2e838afcf03e603a41a0455846eaf9614537c16Mans Rullgard 21956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong*******************************************************************************/ 22956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 23956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong#ifndef __ADJ_THR_H 24956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong#define __ADJ_THR_H 25956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 26956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong#include "adj_thr_data.h" 27956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong#include "qc_data.h" 28956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong#include "interface.h" 29956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 30956c553ab0ce72f8074ad0fda2ffd66a0305700cJames DongWord16 bits2pe(const Word16 bits); 31956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 32956c553ab0ce72f8074ad0fda2ffd66a0305700cJames DongWord32 AdjThrNew(ADJ_THR_STATE** phAdjThr, 33956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong Word32 nElements); 34956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 35956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dongvoid AdjThrDelete(ADJ_THR_STATE *hAdjThr); 36956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 37956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dongvoid AdjThrInit(ADJ_THR_STATE *hAdjThr, 38956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong const Word32 peMean, 39956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong Word32 chBitrate); 40956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 41956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dongvoid AdjustThresholds(ADJ_THR_STATE *adjThrState, 42956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong ATS_ELEMENT* AdjThrStateElement, 43956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], 44956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong PSY_OUT_ELEMENT *psyOutElement, 45956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong Word16 *chBitDistribution, 46956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong Word16 logSfbEnergy[MAX_CHANNELS][MAX_GROUPED_SFB], 47b676a05348e4c516fa8b57e33b10548e6142c3f8Mans Rullgard Word16 sfbNRelevantLines[MAX_CHANNELS][MAX_GROUPED_SFB], 48956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong QC_OUT_ELEMENT* qcOE, 49956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong ELEMENT_BITS* elBits, 50956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong const Word16 nChannels, 51956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong const Word16 maxBitFac); 52956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 53956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dongvoid AdjThrUpdate(ATS_ELEMENT *AdjThrStateElement, 54956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong const Word16 dynBitsUsed); 55956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 56956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong 57956c553ab0ce72f8074ad0fda2ffd66a0305700cJames Dong#endif 58