omxacaac_longtermreconstruct_s32_i.c

来自「The OpenMAX DL (Development Layer) APIs 」· C语言 代码 · 共 105 行

C
105
字号
/** *  * File Name:  omxACAAC_LongTermReconstruct_S32_I.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 Long Term Reconstruction for an AAC decoder * */#include "omxtypes.h"#include "armOMX.h"#include "omxAC.h"#include "armAC.h"#include "armCOMM.h"#include "armACAAC_Tables.h"/** * Function:  omxACAAC_LongTermReconstruct_S32_I   (3.2.3.7.1) * * Description: * Reconstruction portion of the LTP loop; adds the vector of decoded  * spectral coefficients and the corresponding spectral-domain LTP output  * vector to obtain a vector of reconstructed spectral samples.  * * Reference: [ISO14496-3], sub-clause 4.6.7  * * Input Arguments: *    *   pSrcDstSpec - pointer to decoded spectral coefficients; coefficients are  *            represented using Q28.3  *   pSrcEstSpec - pointer to the spectral-domain LTP output vector;  *            coefficients are represented using Q28.3  *   samplingFreqIndex - sampling frequency index  *   pLtpFlag - pointer to the vector of scalefactor band LTP indicator flags  * * Output Arguments: *   pSrcDstSpec - pointer to reconstructed spectral coefficient vector;  *            coefficients are represented using Q28.3  * * Return Value: *     *    OMX_Sts_NoErr - no error  *    OMX_Sts_BadArgErr - bad arguments  *    -    one or more of the following pointers is NULL:  *            - pSrcDstSpec,  *            - pSrcEstSpec, or  *            - pLtpFlag  *    -    samplingFreqIndex is outside the range [0,12]  * */OMXResult omxACAAC_LongTermReconstruct_S32_I(     OMX_S32 *pSrcDstSpec,     OMX_S32 *pSrcEstSpec,     OMX_INT *pLtpFlag,     OMX_INT samplingFreqIndex ){    OMX_INT numSwb,sfbNum;    OMX_INT ltpFlag,width,coeffNum;    const OMX_U16 *pOffsetTable;         /* Argument Check */    armRetArgErrIf( pSrcEstSpec == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( pSrcDstSpec == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( pLtpFlag    == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( samplingFreqIndex > 12,  OMX_Sts_BadArgErr);    armRetArgErrIf( samplingFreqIndex < 0 , OMX_Sts_BadArgErr);    /* Processing */    numSwb       = armACAAC_numSwbLong[samplingFreqIndex];    pOffsetTable = armACAAC_swbOffsetLongWindow[samplingFreqIndex];        for(sfbNum = 0 ; sfbNum < numSwb ; sfbNum ++)    {        ltpFlag = pLtpFlag[sfbNum];        width   = pOffsetTable[sfbNum + 1] - pOffsetTable[sfbNum];                if(ltpFlag == 1)        {            for(coeffNum = 0; coeffNum < width ; coeffNum++)            {                pSrcDstSpec[coeffNum] = armSatAdd_S32(pSrcDstSpec[coeffNum],pSrcEstSpec[coeffNum]);            }        }        pSrcDstSpec += width;        pSrcEstSpec += width;    }           return OMX_Sts_NoErr;}/*End of File*/

⌨️ 快捷键说明

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