⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 armacaac_tnsfilter.c

📁 The OpenMAX DL (Development Layer) APIs contain a comprehensive set of audio, video, signal processi
💻 C
字号:
/** *  * File Name:  armACAAC_TnsFilter.c * OpenMAX DL: v1.0.2 * Revision:   10586 * Date:       Wednesday, March 5, 2008 *  * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. *  *  * * Description: * This file contains module for TNS filtering (Encode/Decode) * */#include "omxtypes.h"#include "armOMX.h"#include "armAC.h"#include "armCOMM.h"/** * Function: armACAAC_TnsFilter * * Description: * TNS filter for analysis/synthesis. Depending on the 'flag' this module behaves * as FIR(Encode) or IIR (decode) filter. * * Parameters: * [in]  pSpectralCoeff pointer to the spectral coefficients to do encode TNS *                                             	represented in Q13.18 format.   * [in]  pLpCoeff       pointer to the LPC coefficients * [in]  size           size of filtering * [in]  tnsOrder       TNS filter order * [in]  increment      indicating direction of filtering * [in]  flag           Indicating Encode/Decode 1: Encode 0: Decode * [out] pSpectralCoeff pointer to the spectral coefficients have done encode TNS *												represented in Q13.18 format.   * */OMXVoid   armACAAC_TnsFilter(    OMX_S32 *pSpectralCoeff,    OMX_F64 *pLpCoeff,    OMX_INT size,    OMX_INT increment,     OMX_INT tnsOrder,    OMX_INT flag){        OMX_F64 delayLine[21]; /* TNS_MAX_ORDER + 1*/    OMX_F64 mac,prod,coeff;    OMX_INT count,order;        /*Intializing the delayline*/        for (count = 0; count < 21 ; count++)    {        delayLine[count] = 0;    }        for (count = 0; count < size ; count ++)        {        mac  = 0;        for(order = tnsOrder ; order >= 1 ; order--)        {            prod   = pLpCoeff[order] * delayLine[order] ;            mac   += prod;                        delayLine[order] = delayLine[order - 1];        }        coeff = *pSpectralCoeff /(OMX_F64)(1 << ARM_AAC_Q_FACTOR) ;                if(flag == 1)        {            /*Synthesis/Encode*/            mac = coeff + mac;            delayLine[1] = coeff;        }        else        {            /*Analysis/Decode*/            mac = coeff - mac;            delayLine[1] = mac;        }                *pSpectralCoeff   = armSatRoundFloatToS32(mac * (1 << ARM_AAC_Q_FACTOR) );        pSpectralCoeff   += increment;    }    return;}/*End of File*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -