1 /** 2 * 3 * File Name: omxVCM4P10_SADQuar_8x.c 4 * OpenMAX DL: v1.0.2 5 * Revision: 9641 6 * Date: Thursday, February 7, 2008 7 * 8 * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. 9 * 10 * 11 * Description: 12 * This function will calculate SAD of pSrc with average of two Ref blocks 13 * of 8x16 or 8x8 or 8x4 14 * 15 */ 16 17 #include "omxtypes.h" 18 #include "armOMX.h" 19 #include "omxVC.h" 20 21 #include "armVC.h" 22 #include "armCOMM.h" 23 24 /** 25 * Function: omxVCM4P10_SADQuar_8x (6.3.5.4.3) 26 * 27 * Description: 28 * This function calculates the SAD between one block (pSrc) and the average 29 * of the other two (pSrcRef0 and pSrcRef1) for 8x16, 8x8, or 8x4 blocks. 30 * Rounding is applied according to the convention (a+b+1)>>1. 31 * 32 * Input Arguments: 33 * 34 * pSrc - Pointer to the original block; must be aligned on an 8-byte 35 * boundary. 36 * pSrcRef0 - Pointer to reference block 0 37 * pSrcRef1 - Pointer to reference block 1 38 * iSrcStep - Step of the original block buffer; must be a multiple of 8. 39 * iRefStep0 - Step of reference block 0 40 * iRefStep1 - Step of reference block 1 41 * iHeight - Height of the block; must be equal either 4, 8, or 16. 42 * 43 * Output Arguments: 44 * 45 * pDstSAD - Pointer of result SAD 46 * 47 * Return Value: 48 * OMX_Sts_NoErr, if the function runs without error. 49 * OMX_Sts_BadArgErr - bad arguments: if one of the following cases occurs: 50 * - iHeight is not equal to either 4, 8, or 16. 51 * - One of more of the following pointers is NULL: pSrc, pSrcRef0, 52 * pSrcRef1, pDstSAD. 53 * - iSrcStep is not a multiple of 8 54 * - Any alignment restrictions are violated 55 * 56 */ 57 OMXResult omxVCM4P10_SADQuar_8x( 58 const OMX_U8* pSrc, 59 const OMX_U8* pSrcRef0, 60 const OMX_U8* pSrcRef1, 61 OMX_U32 iSrcStep, 62 OMX_U32 iRefStep0, 63 OMX_U32 iRefStep1, 64 OMX_U32* pDstSAD, 65 OMX_U32 iHeight 66 ) 67 { 68 /* check for argument error */ 69 armRetArgErrIf(pSrc == NULL, OMX_Sts_BadArgErr) 70 armRetArgErrIf(pSrcRef0 == NULL, OMX_Sts_BadArgErr) 71 armRetArgErrIf(pSrcRef1 == NULL, OMX_Sts_BadArgErr) 72 armRetArgErrIf(pDstSAD == NULL, OMX_Sts_BadArgErr) 73 armRetArgErrIf((iHeight != 16) && (iHeight != 8) && 74 (iHeight != 4), OMX_Sts_BadArgErr) 75 armRetArgErrIf(armNot8ByteAligned(pSrc), OMX_Sts_BadArgErr) 76 armRetArgErrIf((iSrcStep == 0) || (iSrcStep & 7), OMX_Sts_BadArgErr) 77 78 79 return armVCM4P10_SADQuar 80 (pSrc, pSrcRef0, pSrcRef1, iSrcStep, 81 iRefStep0, iRefStep1, pDstSAD, iHeight, 8); 82 } 83 84 /***************************************************************************** 85 * END OF FILE 86 *****************************************************************************/ 87 88