omxVCM4P10_InterpolateChroma.c revision 0c1bc742181ded4930842b46e9507372f0b1b963
10c1bc742181ded4930842b46e9507372f0b1b963James Dong/** 20c1bc742181ded4930842b46e9507372f0b1b963James Dong * 30c1bc742181ded4930842b46e9507372f0b1b963James Dong * File Name: omxVCM4P10_InterpolateChroma.c 40c1bc742181ded4930842b46e9507372f0b1b963James Dong * OpenMAX DL: v1.0.2 50c1bc742181ded4930842b46e9507372f0b1b963James Dong * Revision: 9641 60c1bc742181ded4930842b46e9507372f0b1b963James Dong * Date: Thursday, February 7, 2008 70c1bc742181ded4930842b46e9507372f0b1b963James Dong * 80c1bc742181ded4930842b46e9507372f0b1b963James Dong * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. 90c1bc742181ded4930842b46e9507372f0b1b963James Dong * 100c1bc742181ded4930842b46e9507372f0b1b963James Dong * 110c1bc742181ded4930842b46e9507372f0b1b963James Dong * Description: 120c1bc742181ded4930842b46e9507372f0b1b963James Dong * This function will calculate 1/8 Pixel interpolation for Chroma Block 130c1bc742181ded4930842b46e9507372f0b1b963James Dong * 140c1bc742181ded4930842b46e9507372f0b1b963James Dong */ 150c1bc742181ded4930842b46e9507372f0b1b963James Dong 160c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "omxtypes.h" 170c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armOMX.h" 180c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "omxVC.h" 190c1bc742181ded4930842b46e9507372f0b1b963James Dong 200c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armVC.h" 210c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armCOMM.h" 220c1bc742181ded4930842b46e9507372f0b1b963James Dong 230c1bc742181ded4930842b46e9507372f0b1b963James Dong 240c1bc742181ded4930842b46e9507372f0b1b963James Dong/** 250c1bc742181ded4930842b46e9507372f0b1b963James Dong * Function: omxVCM4P10_InterpolateChroma (6.3.3.2.2) 260c1bc742181ded4930842b46e9507372f0b1b963James Dong * 270c1bc742181ded4930842b46e9507372f0b1b963James Dong * Description: 280c1bc742181ded4930842b46e9507372f0b1b963James Dong * Performs 1/8-pixel interpolation for inter chroma MB. 290c1bc742181ded4930842b46e9507372f0b1b963James Dong * 300c1bc742181ded4930842b46e9507372f0b1b963James Dong * Input Arguments: 310c1bc742181ded4930842b46e9507372f0b1b963James Dong * 320c1bc742181ded4930842b46e9507372f0b1b963James Dong * pSrc -Pointer to the source reference frame buffer 330c1bc742181ded4930842b46e9507372f0b1b963James Dong * srcStep -Reference frame step in bytes 340c1bc742181ded4930842b46e9507372f0b1b963James Dong * dstStep -Destination frame step in bytes; must be a multiple of 350c1bc742181ded4930842b46e9507372f0b1b963James Dong * roi.width. 360c1bc742181ded4930842b46e9507372f0b1b963James Dong * dx -Fractional part of horizontal motion vector component in 1/8 pixel 370c1bc742181ded4930842b46e9507372f0b1b963James Dong * unit; valid in the range [0,7] 380c1bc742181ded4930842b46e9507372f0b1b963James Dong * dy -Fractional part of vertical motion vector component in 1/8 pixel 390c1bc742181ded4930842b46e9507372f0b1b963James Dong * unit; valid in the range [0,7] 400c1bc742181ded4930842b46e9507372f0b1b963James Dong * roi -Dimension of the interpolation region; the parameters roi.width and 410c1bc742181ded4930842b46e9507372f0b1b963James Dong * roi.height must be equal to either 2, 4, or 8. 420c1bc742181ded4930842b46e9507372f0b1b963James Dong * 430c1bc742181ded4930842b46e9507372f0b1b963James Dong * Output Arguments: 440c1bc742181ded4930842b46e9507372f0b1b963James Dong * 450c1bc742181ded4930842b46e9507372f0b1b963James Dong * pDst -Pointer to the destination frame buffer if roi.width==2, 2-byte 460c1bc742181ded4930842b46e9507372f0b1b963James Dong * alignment required if roi.width==4, 4-byte alignment required 470c1bc742181ded4930842b46e9507372f0b1b963James Dong * if roi.width==8, 8-byte alignment required 480c1bc742181ded4930842b46e9507372f0b1b963James Dong * 490c1bc742181ded4930842b46e9507372f0b1b963James Dong * Return Value: 500c1bc742181ded4930842b46e9507372f0b1b963James Dong * If the function runs without error, it returns OMX_Sts_NoErr. 510c1bc742181ded4930842b46e9507372f0b1b963James Dong * If one of the following cases occurs, the function returns 520c1bc742181ded4930842b46e9507372f0b1b963James Dong * OMX_Sts_BadArgErr: 530c1bc742181ded4930842b46e9507372f0b1b963James Dong * pSrc or pDst is NULL. 540c1bc742181ded4930842b46e9507372f0b1b963James Dong * srcStep or dstStep < 8. 550c1bc742181ded4930842b46e9507372f0b1b963James Dong * dx or dy is out of range [0-7]. 560c1bc742181ded4930842b46e9507372f0b1b963James Dong * roi.width or roi.height is out of range {2,4,8}. 570c1bc742181ded4930842b46e9507372f0b1b963James Dong * roi.width is equal to 2, but pDst is not 2-byte aligned. 580c1bc742181ded4930842b46e9507372f0b1b963James Dong * roi.width is equal to 4, but pDst is not 4-byte aligned. 590c1bc742181ded4930842b46e9507372f0b1b963James Dong * roi.width is equal to 8, but pDst is not 8 byte aligned. 600c1bc742181ded4930842b46e9507372f0b1b963James Dong * srcStep or dstStep is not a multiple of 8. 610c1bc742181ded4930842b46e9507372f0b1b963James Dong * 620c1bc742181ded4930842b46e9507372f0b1b963James Dong */ 630c1bc742181ded4930842b46e9507372f0b1b963James Dong 640c1bc742181ded4930842b46e9507372f0b1b963James DongOMXResult omxVCM4P10_InterpolateChroma ( 650c1bc742181ded4930842b46e9507372f0b1b963James Dong const OMX_U8* pSrc, 660c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_S32 srcStep, 670c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_U8* pDst, 680c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_S32 dstStep, 690c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_S32 dx, 700c1bc742181ded4930842b46e9507372f0b1b963James Dong OMX_S32 dy, 710c1bc742181ded4930842b46e9507372f0b1b963James Dong OMXSize roi 720c1bc742181ded4930842b46e9507372f0b1b963James Dong ) 730c1bc742181ded4930842b46e9507372f0b1b963James Dong{ 740c1bc742181ded4930842b46e9507372f0b1b963James Dong /* check for argument error */ 750c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(pSrc == NULL, OMX_Sts_BadArgErr) 760c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(pDst == NULL, OMX_Sts_BadArgErr) 770c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(srcStep < 8, OMX_Sts_BadArgErr) 780c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(dstStep < 8, OMX_Sts_BadArgErr) 790c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(dx < 0, OMX_Sts_BadArgErr) 800c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(dx > 7, OMX_Sts_BadArgErr) 810c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(dy < 0, OMX_Sts_BadArgErr) 820c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(dy > 7, OMX_Sts_BadArgErr) 830c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf((roi.width != 2) && (roi.width != 4) && (roi.width != 8), OMX_Sts_BadArgErr) 840c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf((roi.height != 2) && (roi.height != 4) && (roi.height != 8), OMX_Sts_BadArgErr) 850c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf((roi.width == 2) && armNot2ByteAligned(pDst), OMX_Sts_BadArgErr) 860c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf((roi.width == 4) && armNot4ByteAligned(pDst), OMX_Sts_BadArgErr) 870c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf((roi.width == 8) && armNot8ByteAligned(pDst), OMX_Sts_BadArgErr) 880c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(srcStep & 7, OMX_Sts_BadArgErr) 890c1bc742181ded4930842b46e9507372f0b1b963James Dong armRetArgErrIf(dstStep & 7, OMX_Sts_BadArgErr) 900c1bc742181ded4930842b46e9507372f0b1b963James Dong 910c1bc742181ded4930842b46e9507372f0b1b963James Dong return armVCM4P10_Interpolate_Chroma 920c1bc742181ded4930842b46e9507372f0b1b963James Dong ((OMX_U8*)pSrc, srcStep, pDst, dstStep, roi.width, roi.height, dx, dy); 930c1bc742181ded4930842b46e9507372f0b1b963James Dong} 940c1bc742181ded4930842b46e9507372f0b1b963James Dong 950c1bc742181ded4930842b46e9507372f0b1b963James Dong 960c1bc742181ded4930842b46e9507372f0b1b963James Dong/***************************************************************************** 970c1bc742181ded4930842b46e9507372f0b1b963James Dong * END OF FILE 980c1bc742181ded4930842b46e9507372f0b1b963James Dong *****************************************************************************/ 990c1bc742181ded4930842b46e9507372f0b1b963James Dong 100