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

📄 omxsp_dotprod_s16_sfs.c

📁 The OpenMAX DL (Development Layer) APIs contain a comprehensive set of audio, video, signal processi
💻 C
字号:
/** *  * File Name:  omxSP_DotProd_S16_Sfs.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 dot product of two vectors * */#include "omxtypes.h"#include "armOMX.h"#include "omxSP.h"#include "armCOMM.h"/** * Function:  omxSP_DotProd_S16_Sfs   (2.2.2.1.2) * * Description: * Calculates the dot product of the two input signals with output scaling  * and saturation, i.e., the result is multiplied by two to the power of the  * negative (-)scalefactor (scaled) prior to return.  The result is saturated  * with rounding if the scaling operation produces a value outside the range  * of a signed 32-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: *    *   pSrc1 - pointer to the first input vector; must be aligned on an 8-byte  *            boundary.  *   pSrc2 - pointer to the second input vector; must be aligned on an 8-byte  *            boundary.  *   len - length of the vectors in pSrc1 and pSrc2  *   scaleFactor - integer scalefactor  * * Output Arguments: * * Return Value: *     *    The dot product result  Note: This function returns the actual result  *              rather than the standard OMXError.  * */OMX_S32 omxSP_DotProd_S16_Sfs(                            const OMX_S16 *pSrc1,                            const OMX_S16 *pSrc2,                            OMX_INT       len,                            OMX_INT       scaleFactor                            ){    OMX_S32 DotProd;    OMX_S16 Var1,Var2;            /* Return if value 'len' is not valid */            if(len <= 0)    {       return (OMX_S32)0;    }        /* Compute the DotProduct */        DotProd = 0;        do    {        Var1 = *pSrc1++;        Var2 = *pSrc2++;                DotProd += (OMX_S32)(Var1*Var2);        len--;            }while(len != 0);    /* Scale the result of the operation */        DotProd = armSatRoundLeftShift_S32(DotProd,-scaleFactor);        return DotProd;    } /* End of File */ 

⌨️ 快捷键说明

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