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_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: omxVCM4P10_MEGetBufSize (6.3.5.1.1) 41 * 42 * Description: 43 * Computes the size, in bytes, of the vendor-specific specification 44 * structure for the omxVCM4P10 motion estimation functions BlockMatch_Integer 45 * and MotionEstimationMB. 46 * 47 * Input Arguments: 48 * 49 * MEmode - motion estimation mode; available modes are defined by the 50 * enumerated type OMXVCM4P10MEMode 51 * pMEParams -motion estimation parameters 52 * 53 * Output Arguments: 54 * 55 * pSize - pointer to the number of bytes required for the motion 56 * estimation specification structure 57 * 58 * Return Value: 59 * OMX_Sts_NoErr, if the function runs without error. 60 * OMX_Sts_BadArgErr - bad arguments: if one of the following cases occurs: 61 * - pMEParams or pSize is NULL. 62 * - an invalid MEMode is specified. 63 * 64 */ 65 66OMXResult omxVCM4P10_MEGetBufSize( 67 OMXVCM4P10MEMode MEMode, 68 const OMXVCM4P10MEParams *pMEParams, 69 OMX_U32 *pSize 70 ) 71{ 72 armRetArgErrIf(!pMEParams, OMX_Sts_BadArgErr); 73 armRetArgErrIf(!pSize, OMX_Sts_BadArgErr); 74 armRetArgErrIf((MEMode != OMX_VC_M4P10_FAST_SEARCH) && 75 (MEMode != OMX_VC_M4P10_FULL_SEARCH), OMX_Sts_BadArgErr); 76 armRetArgErrIf((pMEParams->searchRange16x16 <= 0) || 77 (pMEParams->searchRange8x8 <= 0) || 78 (pMEParams->searchRange4x4 <= 0), OMX_Sts_BadArgErr); 79 80 *pSize = (OMX_INT) sizeof(ARMVCM4P10_MESpec); 81 82 return OMX_Sts_NoErr; 83} 84 85/* End of file */ 86