📄 armipcs_interppixel_bilinear.c
字号:
/** * * * File Name: armIPCS_InterpPixel_Bilinear.c * OpenMAX DL: v1.0.2 * Revision: 10586 * Date: Wednesday, March 5, 2008 * * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. * * * * Description : Contains bilinear interpolation function. * */#include "omxtypes.h"#include "armIP.h"/** * Functions: armIPCS_InterpPixel_Bilinear * * Description: * This function computes the Bilinear interpolated pixel, by taking * the buffer and its step, top-left neighbour pixel coordinates and * the offset of the interpolated pixel from this top-left pixel as * input parameters * * Return Value: * OMXResult -- Error status from the function */ OMXResult armIPCS_InterpPixel_Bilinear( const OMX_U8 *pBuf, /* Pointer to the Image Buffer */ OMX_INT bufStep, /* Offset in bytes between two rows */ OMX_INT xPos, /* x-coordinate of the nearest top-left pixel of the interpolated pixel */ OMX_INT yPos, /* y-coordinate of the nearest top-left pixel of the interpolated pixel */ OMX_F32 xOff, /* Distance along X, between interpolated and its nearest top-left pixel */ OMX_F32 yOff, /* Distance along Y, between interpolated and its nearest top-left pixel */ OMX_U8 *pInterpPix /* Pointer to return the interpolated pixel value */ ){ OMX_F32 weight00, weight10, weight01, weight11; OMX_U8 pix00, pix10, pix01, pix11; OMX_U16 tempPix; armRetArgErrIf(!pBuf, OMX_Sts_BadArgErr); weight00 = (1 - xOff) * (1 - yOff); weight10 = xOff * (1 - yOff); weight01 = yOff * (1 - xOff); weight11 = xOff * yOff; pix00 = pBuf[xPos + (yPos * bufStep)]; pix10 = pBuf[xPos + 1 + (yPos * bufStep)]; pix01 = pBuf[xPos + ((yPos + 1) * bufStep)]; pix11 = pBuf[xPos + 1 + ((yPos + 1) * bufStep)]; tempPix = armRoundFloatToS16((pix00 * weight00) + (pix10 * weight10) + (pix01 * weight01) + (pix11 * weight11)); *pInterpPix = (OMX_U8)armClip(OMX_MIN_U8, OMX_MAX_U8, tempPix); return OMX_Sts_NoErr;}/* End of file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -