📄 armip.h
字号:
/** * * * File Name: armIP.h * OpenMAX DL: v1.0.2 * Revision: 10586 * Date: Wednesday, March 5, 2008 * * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. * * * * File : armIP.h * Description : Contains ARM-defined macros, functions and definitions common to Still Image domain. * */#ifndef _armIP_H_#define _armIP_H_#include <math.h>#include "omxtypes.h"#include "omxIP.h"#include "armCOMM.h"typedef OMXResult ARM_OmxMCU_YUV2RGBConversionFunctionType(const OMX_S16 *pSrcMCU[3], OMX_U8 * pDst, OMX_INT dstStep);typedef OMXResult (*ARM_JpegPixelYUV2RGBConversionFunctionType)(OMX_F32 Ydata, OMX_F32 Udata, OMX_F32 Vdata, OMX_U8 *pRdata, OMX_U8 *pGdata, OMX_U8 *pBdata);#define ARM_IPPP_MOMENTS_MAX_CHANL 3 /* This is a numeric value */#define ARM_IPPP_MOMENTS_MAX_ORDER 4 /* This is a numeric value */#define ARM_IPCS_INTERP_BILINEAR 0 /* This is a switch - should be 1 or 0 */#define ARM_IPCS_INTERP_NEAREST 1 /* This is a switch - should be 1 or 0 */#define ARM_IPPP_MAX_MASK_SIZE 255 /* Maximum mask size for median filtering */#define ARM_IPPP_MIN_MASK_SIZE 3 /* Minimum mask size for median filtering */#define JPEG_MCU_PIX_WIDTH_444 8#define JPEG_MCU_PIX_WIDTH_422 16#define JPEG_MCU_PIX_WIDTH_420 16#define JPEG_MCU_PIX_HEIGHT_444 8#define JPEG_MCU_PIX_HEIGHT_422 8#define JPEG_MCU_PIX_HEIGHT_420 16typedef struct MomentState{ OMX_S64 spMoments[ARM_IPPP_MOMENTS_MAX_CHANL][ARM_IPPP_MOMENTS_MAX_ORDER][ARM_IPPP_MOMENTS_MAX_ORDER]; OMX_S64 ctMoments[ARM_IPPP_MOMENTS_MAX_CHANL][ARM_IPPP_MOMENTS_MAX_ORDER][ARM_IPPP_MOMENTS_MAX_ORDER]; OMX_INT maxValidChannel;}ARMIPPP_MomentState;/* Quantization - strength table : Used in armIPPP_DeblockPixel() */extern const OMX_U8 armIPPP_strengthTable[31];/** * Function: armIPPP_Power_S64 * * Description: * Computes "base" to the power of "power". This function uses the C library * apart from the case of 0 to the power 0 which we must ensure is returned as 1 * * Return Value: * OMX_S64 -- The result of "base" raised to "power" */ OMX_S64 armIPPP_Power_S64(OMX_S32 base, OMX_S32 power);/** * Function: armIPPP_ComputeBinomialCoeff * * Description: * Computes the binomial coefficient of the expression * [(x-xOff)^mOrd * (y-yOff)^nOrd * f(x,y)] for the (r1,r2)th term, * where (0 <= i <= mOrd) and (0 <= j <= nOrd). * * Return Value: * OMX_S64 -- The value of binomial coefficient */OMX_S64 armIPPP_ComputeBinomialCoeff(OMX_INT mOrd, OMX_INT nOrd, OMX_U8 r1, OMX_U8 r2, OMX_INT xOff, OMX_INT yOff);/** * Functions: * armIPCS_PackToRGB565_F32 * armIPCS_PackToRGB555_F32 * armIPCS_PackToRGB444_F32 * * Description: * Packs RGB OMX_F32 data into OMX_U16, taking care of appropriate rounding * * Return Value: * OMXResult -- Error status from the function */OMX_U16 armIPCS_PackToRGB565_F32(OMX_F32 Rdata, OMX_F32 Gdata, OMX_F32 Bdata);OMX_U16 armIPCS_PackToRGB555_F32(OMX_F32 Rdata, OMX_F32 Gdata, OMX_F32 Bdata);OMX_U16 armIPCS_PackToRGB444_F32(OMX_F32 Rdata, OMX_F32 Gdata, OMX_F32 Bdata);/** * Functions: * armIPCS_PackToRGB565_F32 * armIPCS_PackToRGB555_F32 * armIPCS_PackToRGB444_F32 * * Description: * Packs RGB OMX_F32 data into OMX_U16, taking care of appropriate rounding * * Return Value: * OMXResult -- Error status from the function */OMX_U16 armIPCS_PackToBGR565_F32(OMX_F32 Bdata, OMX_F32 Gdata, OMX_F32 Rdata);OMX_U16 armIPCS_PackToBGR555_F32(OMX_F32 Bdata, OMX_F32 Gdata, OMX_F32 Rdata);OMX_U16 armIPCS_PackToBGR444_F32(OMX_F32 Bdata, OMX_F32 Gdata, OMX_F32 Rdata);/** * Function: armIPCS_UnpackBGR565 * * Description: * This function unpacks an BGR565 compressed image data into separate * R, G and B components, by padding zeros in the lower order bits. * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_UnpackBGR565(OMX_U16 RGBdata, OMX_U8 *pRdata, OMX_U8 *pGdata, OMX_U8 *pBdata);/** * Functions: armIPCS_ComputeRGBFromYUV_JPEG * * Description: * Use the JPEG Colour Conversion equations * to convert the input Y,U,V bytes to R,G,B. * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_ComputeRGBFromYUV_JPEG_F32( OMX_F32 Ydata, OMX_F32 Udata, OMX_F32 Vdata, OMX_F32 *pRdata, OMX_F32 *pGdata, OMX_F32 *pBdata);OMXResult armIPCS_ComputeRGBFromYUV_JPEG_F32_U8( OMX_F32 Ydata, OMX_F32 Udata, OMX_F32 Vdata, OMX_U8 *pRdata, OMX_U8 *pGdata, OMX_U8 *pBdata);/** * Functions: * armIPCS_ComputeYUVFromRGB_JPEG_F32_S16 * armIPCS_ComputeYFromRGB_JPEG_F32_S16 * armIPCS_ComputeUromRGB_JPEG_F32_S16 * armIPCS_ComputeVFromRGB_JPEG_F32_S16 * * Description: * These functions use the JPEG Colour Conversion equations * to convert the input R,G,B bytes to Y,U,V. * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_ComputeYUVFromRGB_JPEG_F32_S16( OMX_F32 Rdata, OMX_F32 Gdata, OMX_F32 Bdata, OMX_S16 *pYdata, OMX_S16 *pUdata, OMX_S16 *pVdata);OMXResult armIPCS_ComputeYFromRGB_JPEG_F32_S16( OMX_F32 Rdata, OMX_F32 Gdata, OMX_F32 Bdata, OMX_S16 *pYdata);OMXResult armIPCS_ComputeUFromRGB_JPEG_F32_S16( OMX_F32 Rdata, OMX_F32 Gdata, OMX_F32 Bdata, OMX_S16 *pUdata);OMXResult armIPCS_ComputeVFromRGB_JPEG_F32_S16( OMX_F32 Rdata, OMX_F32 Gdata, OMX_F32 Bdata, OMX_S16 *pVdata);/** * Function: armIPCS_ComputeRGBFromYUV_F32 * * Description: * With input data (Y, U, V) and output data (R, G, B), * colour conversion equations in the Raw Image Processing domain would be - * R = 1.164(Y-16) + 1.596(V-128) * G = 1.164(Y-16) - 0.813(V-128) - 0.392(U-128) * B = 1.164(Y-16) + 2.017(U-128) * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_ComputeRGBFromYUV_F32( OMX_F32 Ydata, OMX_F32 Udata, OMX_F32 Vdata, OMX_F32 *pRdata, OMX_F32 *pGdata, OMX_F32 *pBdata);OMXResult armIPCS_ComputeRGBFromYUV_F32_U8( OMX_F32 Ydata, OMX_F32 Udata, OMX_F32 Vdata, OMX_U8 *pRdata, OMX_U8 *pGdata, OMX_U8 *pBdata);/** * Function: armIPCS_FlipTopBottom_I * * Description: * This function flips the image w.r.t X axis and does it in-place. * The formula being used is OutPix(x,y) = InPix(x,height-y). * The size of each element of the image is specified in <bufElemSize> * and no assumption is being made on the buffer alignment. * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_FlipTopBottom_I( void *pBuf, /* Pointer to the Image Buffer */ OMX_INT bufElemSize, /* Number of bytes in one element */ OMX_INT bufStep, /* Offset in bytes between two rows */ OMX_INT bufWidth, /* Number of elements in one row */ OMX_INT bufHeight /* Number of rows in the image */ );/** * Function: armIPCS_FlipLeftRight_I * * Description: * This function flips the image w.r.t Y axis and does it in-place. * The formula being used is OutPix(x,y) = InPix(width-x,y). * The size of each element of the image is specified in <bufElemSize> * and no assumption is being made on the buffer alignment. * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_FlipLeftRight_I( void *pBuf, /* Pointer to the Image Buffer */ OMX_INT bufElemSize, /* Number of bytes in one element */ OMX_INT bufStep, /* Offset in bytes between two rows */ OMX_INT bufWidth, /* Number of elements in one row */ OMX_INT bufHeight /* Number of rows in the image */ );/** * Function: armIPCS_FlipMajorDiagonal_I * * Description: * This function flips the image w.r.t major diagonal and does it in-place. * The formula being used is OutPix(y,x) = InPix(x,y). * The size of each element of the image is specified in <bufElemSize> * and no assumption is being made on the buffer alignment. * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_FlipMajorDiagonal_I( void *pBuf, /* Pointer to the Image Buffer */ OMX_INT bufElemSize, /* Number of bytes in one element */ OMX_INT bufStep, /* Offset in bytes between two rows */ OMX_INT bufWidth, /* Number of elements in one row */ OMX_INT bufHeight /* Number of rows in the image */ );/** * Function: armIPCS_Rotate180_I * * Description: * The function rotates the buffer by 180 degree and does it in-place. * The formula being used is OutPix(x,y) = InPix(width-x,height-y). * The size of each element of the image is specified in <bufElemSize> * and no assumption is being made on the buffer alignment. * * Return Value: * OMXResult -- Error status from the function */OMXResult armIPCS_Rotate180_I( void *pBuf, /* Pointer to the Image Buffer */ OMX_INT bufElemSize, /* Number of bytes in one element */ OMX_INT bufStep, /* Offset in bytes between two rows */ OMX_INT bufWidth, /* Number of elements in one row */ OMX_INT bufHeight /* Number of rows in the image */ );/** * Function: 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 */ );/** * Function: armIPPP_DeblockEdge * * Description: * Performs deblock filtering on two adjacent blocks along a block edge (horizontal/Vertical) * * Remarks: * The output buffer region is required to have the same size as * that of the input region, although the width of the overall * images may differ. * * Parameters: * [in] pSrcDst pointer to the first pixel of the second block * [in] step width of the image plane, in bytes; must be a multiple of 8. * [in] QP quantization parameter, as described in Section J.3 of Annex J in H.263+ * [in] flag flag = 0 :vertical Edge, flag = 1: Horizontal edge * [out] pSrcDst pointer to the first pixel of the second output block * * return value: * OMXVoid. * */ OMXVoid armIPPP_DeblockEdge( OMX_U8 *pSrcDst, OMX_INT step, OMX_INT QP, OMX_INT flag);/** * Function: armIPCS_RGBConvertAndPack * * Description: * This is a utility function used by omxIPCS_YCbCr42xRszCscRotRGB_U8_P3C3R(). * It converts a pixel from YCbCr representation to one of the RGB variants - * RGB565, RGB555, RGB444, RGB888 based on the <colorConversion> parameter and * stores the result in <pDstRGB>. * * Return Value: * OMXVoid */OMXVoid armIPCS_RGBConvertAndPack( OMX_U8 Ydata, OMX_U8 Udata, OMX_U8 Vdata, OMXIPColorSpace colorConversion, void *pDst);/** * Function: armIPCS_BGRConvertAndPack * * * Return Value: * OMXVoid */OMXVoid armIPCS_BGRConvertAndPack( OMX_U8 Ydata, OMX_U8 Udata, OMX_U8 Vdata, OMXIPColorSpace colorConversion, void *pDst);#endif /* _armIP_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -