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

📄 omxsp_iir_biquaddirect_s16.c

📁 The OpenMAX DL (Development Layer) APIs contain a comprehensive set of audio, video, signal processi
💻 C
字号:
/** *  * File Name:  omxSP_IIR_BiQuadDirect_S16.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 block biquad IIR filtering * */ #include "omxtypes.h"#include "armOMX.h"#include "omxSP.h"#include "armCOMM.h"/** * Function:  omxSP_IIR_BiQuadDirect_S16   (2.2.3.3.1) * * Description: * Block biquad IIR filtering for 16-bit data type. This function applies the  * direct form II biquad IIR cascade defined by the coefficient vector pTaps  * to a vector of input data.  The internal accumulator width must be at least  * 32 bits, and the result is saturated if the operation produces a value  * outside the range of a signed 16-bit integer, i.e., the output will  * saturate to 0x8000 (-32768) for a negative overflow or 0x7fff (32767) for a  * positive overflow.  The result is undefined if any of the partially  * accumulated values exceeds the range of a signed 32-bit integer.  * * Input Arguments: *    *   pSrc - pointer to the vector of input samples to which the  *            filter is applied  *   len - the number of samples contained in both the input and output  *            vectors  *   pTaps - pointer to the 6P -element vector that contains the combined  *            numerator and denominator filter coefficients from the biquad  *            cascade. Coefficient scaling and coefficient vector organization  *            should follow the conventions described above. The value of the  *            coefficient scaleFactor exponent must be non-negative. (sfp>=0).  *   numBiquad - the number of biquads contained in the IIR filter cascade:  *            (P)  *   pDelayLine - pointer to the 2P -element filter memory buffer (state).  *            The user is responsible for allocation, initialization, and  *            de-allocation. The filter memory elements are initialized to  *            zero in most applications.  * * Output Arguments: *    *   pDst - pointer to the vector of filtered output samples  * * Return Value: *     *    OMX_Sts_NoErr - no error  *    OMX_Sts_BadArgErr - bad arguments; returned if one or more of the  *              following is true:  *    -    one or more of the following pointers is NULL: pSrc, pDst,  *              pTaps, or pDelayLine.  *    -    len < 0  *    -    numBiquad < 1  *    -    pTaps[3+n*6] < 0, for 0 <= n < numBiquad (negative scaling)  * */OMXResult omxSP_IIR_BiQuadDirect_S16(     const OMX_S16 * pSrc,     OMX_S16 * pDst,     OMX_INT len,     const OMX_S16 * pTaps,     OMX_INT numBiquad,     OMX_S32 * pDelayLine ){    OMXResult errorCode = OMX_Sts_NoErr;    /* Argument Check */    armRetArgErrIf( pSrc       == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( pDst       == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( pDelayLine == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( pTaps      == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( len       <= 0    , OMX_Sts_BadArgErr);    armRetArgErrIf( numBiquad <= 0    , OMX_Sts_BadArgErr);        /* Processing */    while(len != 0)    {        errorCode = omxSP_IIROne_BiQuadDirect_S16(                        *pSrc,                        pDst,                        pTaps,                        numBiquad,                        pDelayLine);        armRetArgErrIf( errorCode != OMX_Sts_NoErr, errorCode);        pSrc++;        pDst++;                len--;            }/*end while(len != 0)*/    return OMX_Sts_NoErr;}/* End of File */

⌨️ 快捷键说明

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