omxVCM4P2_MEGetBufSize.c revision 78e52bfac041d71ce53b5b13c2abf78af742b09d
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: omxVCM4P2_MEGetBufSize.c 20 * OpenMAX DL: v1.0.2 21 * Revision: 9641 22 * Date: Thursday, February 7, 2008 23 * 24 * 25 * 26 * 27 * Description: 28 * Initialization modules for the vendor specific Motion Estimation structure. 29 * 30 */ 31 32#include "omxtypes.h" 33#include "armOMX.h" 34#include "omxVC.h" 35 36#include "armVC.h" 37#include "armCOMM.h" 38 39/** 40 * Function: omxVCM4P2_MEGetBufSize (6.2.4.1.1) 41 * 42 * Description: 43 * Computes the size, in bytes, of the vendor-specific specification 44 * structure for the following motion estimation functions: 45 * BlockMatch_Integer_8x8, BlockMatch_Integer_16x16, and MotionEstimationMB. 46 * 47 * Input Arguments: 48 * 49 * MEmode - motion estimation mode; available modes are defined by the 50 * enumerated type OMXVCM4P2MEMode 51 * pMEParams - motion estimation parameters 52 * 53 * Output Arguments: 54 * 55 * pSize - pointer to the number of bytes required for the specification 56 * structure 57 * 58 * Return Value: 59 * 60 * OMX_Sts_NoErr - no error 61 * OMX_Sts_BadArgErr - one or more of the following is true: 62 * - an invalid value was specified for the parameter MEmode 63 * - a negative or zero value was specified for the 64 * parameter pMEParams->searchRange 65 * 66 */ 67 68OMXResult omxVCM4P2_MEGetBufSize( 69 OMXVCM4P2MEMode MEMode, 70 const OMXVCM4P2MEParams *pMEParams, 71 OMX_U32 *pSize 72 ) 73{ 74 armRetArgErrIf(!pMEParams, OMX_Sts_BadArgErr); 75 armRetArgErrIf(!pSize, OMX_Sts_BadArgErr); 76 armRetArgErrIf(pMEParams->searchRange <= 0, OMX_Sts_BadArgErr); 77 armRetArgErrIf((MEMode != OMX_VC_M4P10_FAST_SEARCH) && 78 (MEMode != OMX_VC_M4P10_FULL_SEARCH), OMX_Sts_BadArgErr); 79 80 *pSize = (OMX_INT) sizeof(ARMVCM4P2_MESpec); 81 82 return OMX_Sts_NoErr; 83} 84 85/* End of file */ 86