📄 omxsp_fir_direct_s16.c
字号:
/** * * File Name: omxSP_FIR_Direct_S16.c * OpenMAX DL: v1.0.2 * Revision: 10586 * Date: Wednesday, March 5, 2008 * * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. * * * Description: * */#include "omxtypes.h"#include "armOMX.h"#include "omxSP.h"#include "armCOMM.h"extern /** FIR single rate *//** * Function: omxSP_FIR_Direct_S16 (2.2.3.1.1) * * Description: * Block FIR filtering for 16-bit data type. This function applies the * FIR filter defined by the coefficient vector pTapsQ15 to a vector of * input data. The result is saturated with rounding if the operation * produces a value outside the range of a signed 16-bit integer. * Rounding behavior is defined in: * section 1.6.7 "Integer Scaling and Rounding Conventions". * The internal accumulator width must be at least 32 bits. 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 * sampLen - the number of samples contained in the input and output * vectors * pTapsQ15 - pointer to the vector that contains the filter coefficients, * represented in Q0.15 format (defined in section 1.6.5). Given * that: * -32768 = pTapsQ15(k) < 32768, * 0 = k <tapsLen, * the range on the actual filter coefficients is -1 = bK <1, and * therefore coefficient normalization may be required during the * filter design process. * tapsLen - the number of taps, or, equivalently, the filter order + 1 * pDelayLine - pointer to the 2.tapsLen -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. * pDelayLineIndex - pointer to the filter memory index that is maintained * internally by the function. The user should initialize the value * of this index to zero. * * 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, * - pSrcDst, * - pTapsQ15, * - pDelayLine, or * - pDelayLineIndex * - samplen < 0 * - tapslen < 1 * - *pDelayLineIndex < 0 or *pDelayLineIndex >= (2 * tapslen). * */OMXResult omxSP_FIR_Direct_S16( const OMX_S16 * pSrc, OMX_S16 * pDst, OMX_INT sampLen, const OMX_S16 * pTapsQ15, OMX_INT tapsLen, OMX_S16 * pDelayLine, OMX_INT * pDelayLineIndex ) { OMX_U32 Count; OMXResult Result = OMX_Sts_NoErr; /* Input parameter check */ armRetArgErrIf((pSrc == NULL), OMX_Sts_BadArgErr) armRetArgErrIf((pDst == NULL), OMX_Sts_BadArgErr) armRetArgErrIf((sampLen <= 0), OMX_Sts_BadArgErr) armRetArgErrIf((pTapsQ15 == NULL), OMX_Sts_BadArgErr) armRetArgErrIf((tapsLen <= 0), OMX_Sts_BadArgErr) armRetArgErrIf((pDelayLine == NULL), OMX_Sts_BadArgErr) armRetArgErrIf((pDelayLineIndex == NULL), OMX_Sts_BadArgErr) armRetArgErrIf((*pDelayLineIndex < 0), OMX_Sts_BadArgErr) armRetArgErrIf((*pDelayLineIndex >= (2 * tapsLen)), OMX_Sts_BadArgErr) for (Count = 0; Count < sampLen; Count++) { if ((Result = omxSP_FIROne_Direct_S16 (pSrc [Count], &(pDst [Count]), pTapsQ15, tapsLen, pDelayLine, pDelayLineIndex)) != OMX_Sts_NoErr) { return Result; } } return OMX_Sts_NoErr; }/***************************************************************************** * END OF FILE *****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -