1 /* 2 * Copyright (C) 2007-2008 ARM Limited 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 /** 18 * 19 * File Name: omxVCM4P10_InterpolateLuma.c 20 * OpenMAX DL: v1.0.2 21 * Revision: 9641 22 * Date: Thursday, February 7, 2008 23 * 24 * 25 * 26 * Description: 27 * This function will calculate Performs quarter-pixel interpolation 28 * 29 */ 30 31 #include "omxtypes.h" 32 #include "armOMX.h" 33 #include "omxVC.h" 34 35 #include "armVC.h" 36 #include "armCOMM.h" 37 38 /** 39 * Function: omxVCM4P10_InterpolateLuma (6.3.3.2.1) 40 * 41 * Description: 42 * Performs quarter-pixel interpolation for inter luma MB. It is assumed that 43 * the frame is already padded when calling this function. 44 * 45 * Input Arguments: 46 * 47 * pSrc -Pointer to the source reference frame buffer 48 * srcStep -reference frame step, in bytes; must be a multiple of roi.width 49 * dstStep -destination frame step, in bytes; must be a multiple of 50 * roi.width 51 * dx -Fractional part of horizontal motion vector component in 1/4 pixel 52 * unit; valid in the range [0,3] 53 * dy -Fractional part of vertical motion vector y component in 1/4 pixel 54 * unit; valid in the range [0,3] 55 * roi -Dimension of the interpolation region; the parameters roi.width and 56 * roi.height must be equal to either 4, 8, or 16. 57 * 58 * Output Arguments: 59 * 60 * pDst -Pointer to the destination frame buffer if roi.width==4, 4-byte 61 * alignment required if roi.width==8, 8-byte alignment required 62 * if roi.width==16, 16-byte alignment required 63 * 64 * Return Value: 65 * If the function runs without error, it returns OMX_Sts_NoErr. 66 * If one of the following cases occurs, the function returns 67 * OMX_Sts_BadArgErr: 68 * pSrc or pDst is NULL. 69 * srcStep or dstStep < roi.width. 70 * dx or dy is out of range [0,3]. 71 * roi.width or roi.height is out of range {4, 8, 16}. 72 * roi.width is equal to 4, but pDst is not 4 byte aligned. 73 * roi.width is equal to 8 or 16, but pDst is not 8 byte aligned. 74 * srcStep or dstStep is not a multiple of 8. 75 * 76 */ 77 78 OMXResult omxVCM4P10_InterpolateLuma ( 79 const OMX_U8* pSrc, 80 OMX_S32 srcStep, 81 OMX_U8* pDst, 82 OMX_S32 dstStep, 83 OMX_S32 dx, 84 OMX_S32 dy, 85 OMXSize roi 86 ) 87 { 88 /* check for argument error */ 89 armRetArgErrIf(pSrc == NULL, OMX_Sts_BadArgErr) 90 armRetArgErrIf(pDst == NULL, OMX_Sts_BadArgErr) 91 armRetArgErrIf(srcStep < roi.width, OMX_Sts_BadArgErr) 92 armRetArgErrIf(dstStep < roi.width, OMX_Sts_BadArgErr) 93 armRetArgErrIf(dx < 0, OMX_Sts_BadArgErr) 94 armRetArgErrIf(dx > 3, OMX_Sts_BadArgErr) 95 armRetArgErrIf(dy < 0, OMX_Sts_BadArgErr) 96 armRetArgErrIf(dy > 3, OMX_Sts_BadArgErr) 97 armRetArgErrIf((roi.width != 4) && (roi.width != 8) && (roi.width != 16), OMX_Sts_BadArgErr) 98 armRetArgErrIf((roi.height != 4) && (roi.height != 8) && (roi.height != 16), OMX_Sts_BadArgErr) 99 armRetArgErrIf((roi.width == 4) && armNot4ByteAligned(pDst), OMX_Sts_BadArgErr) 100 armRetArgErrIf((roi.width == 8) && armNot8ByteAligned(pDst), OMX_Sts_BadArgErr) 101 armRetArgErrIf((roi.width == 16) && armNot16ByteAligned(pDst), OMX_Sts_BadArgErr) 102 armRetArgErrIf(srcStep & 7, OMX_Sts_BadArgErr) 103 armRetArgErrIf(dstStep & 7, OMX_Sts_BadArgErr) 104 105 return armVCM4P10_Interpolate_Luma 106 (pSrc, srcStep, pDst, dstStep, roi.width, roi.height, dx, dy); 107 108 } 109 110 111 /***************************************************************************** 112 * END OF FILE 113 *****************************************************************************/ 114 115