omxsp_dotprod_s16.c

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

C
82
字号
/** *  * File Name:  omxSP_DotProd_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 Dot Product of two vectors * */#include "omxtypes.h"#include "armOMX.h"#include "omxSP.h"/** * Function:  omxSP_DotProd_S16   (2.2.2.1.1) * * Description: * Calculates the dot product of the two input vectors.  This function does  * not perform scaling. The internal accumulator width must be at least 32  * bits.  If any of the partially accumulated values exceeds the range of a  * signed 32-bit integer then the result is undefined.  * * 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  * * 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(                            const OMX_S16 *pSrc1,                            const OMX_S16 *pSrc2,                            OMX_INT        len                            ){    OMX_S32 DotProd;    OMX_S32 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);    return DotProd;} /* End of File */

⌨️ 快捷键说明

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