omxVCM4P10_MEInit.c revision 78e52bfac041d71ce53b5b13c2abf78af742b09d
130a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant/* 230a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * Copyright (C) 2007-2008 ARM Limited 330a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 430a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * Licensed under the Apache License, Version 2.0 (the "License"); 5b64f8b07c104c6cc986570ac8ee0ed16a9f23976Howard Hinnant * you may not use this file except in compliance with the License. 6b64f8b07c104c6cc986570ac8ee0ed16a9f23976Howard Hinnant * You may obtain a copy of the License at 730a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 830a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * http://www.apache.org/licenses/LICENSE-2.0 930a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 1030a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * Unless required by applicable law or agreed to in writing, software 1130a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * distributed under the License is distributed on an "AS IS" BASIS, 1230a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1330a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * See the License for the specific language governing permissions and 1430a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * limitations under the License. 1530a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 1630a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant */ 1730a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant/** 1830a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 1930a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * File Name: omxVCM4P10_MEInit.c 2030a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * OpenMAX DL: v1.0.2 2130a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * Revision: 9641 2230a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * Date: Thursday, February 7, 2008 2330a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 2430a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 2530a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 26df40dc6c1a8ca0bf00fb6aec030f69042f61d974Howard Hinnant * 2730a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * Description: 2830a840f5f0774e4527c91147d3f39fbd4bad3f9eHoward Hinnant * 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_MEInit (6.3.5.1.2) 41 * 42 * Description: 43 * Initializes the vendor-specific specification structure required for the 44 * omxVCM4P10 motion estimation functions: BlockMatch_Integer and 45 * MotionEstimationMB. Memory for the specification structure *pMESpec must be 46 * allocated prior to calling the function, and should be aligned on a 4-byte 47 * boundary. The number of bytes required for the specification structure can 48 * be determined using the function omxVCM4P10_MEGetBufSize. Following 49 * initialization by this function, the vendor-specific structure *pMESpec 50 * should contain an implementation-specific representation of all motion 51 * estimation parameters received via the structure pMEParams, for example 52 * searchRange16x16, searchRange8x8, etc. 53 * 54 * Input Arguments: 55 * 56 * MEmode - motion estimation mode; available modes are defined by the 57 * enumerated type OMXVCM4P10MEMode 58 * pMEParams - motion estimation parameters 59 * pMESpec - pointer to the uninitialized ME specification structure 60 * 61 * Output Arguments: 62 * 63 * pMESpec - pointer to the initialized ME specification structure 64 * 65 * Return Value: 66 * OMX_Sts_NoErr, if the function runs without error. 67 * OMX_Sts_BadArgErr - bad arguments: if one of the following cases occurs: 68 * - pMEParams or pSize is NULL. 69 * - an invalid value was specified for the parameter MEmode 70 * - a negative or zero value was specified for one of the search ranges 71 * (e.g., pMBParams >searchRange8x8, pMEParams->searchRange16x16, etc.) 72 * - either in isolation or in combination, one or more of the enables or 73 * search ranges in the structure *pMEParams were configured such 74 * that the requested behavior fails to comply with [ISO14496-10]. 75 * 76 */ 77 78OMXResult omxVCM4P10_MEInit( 79 OMXVCM4P10MEMode MEMode, 80 const OMXVCM4P10MEParams *pMEParams, 81 void *pMESpec 82 ) 83{ 84 ARMVCM4P10_MESpec *armMESpec = (ARMVCM4P10_MESpec *) pMESpec; 85 86 armRetArgErrIf(!pMEParams, OMX_Sts_BadArgErr); 87 armRetArgErrIf(!pMESpec, OMX_Sts_BadArgErr); 88 armRetArgErrIf((MEMode != OMX_VC_M4P10_FAST_SEARCH) && 89 (MEMode != OMX_VC_M4P10_FULL_SEARCH), OMX_Sts_BadArgErr); 90 armRetArgErrIf((pMEParams->searchRange16x16 <= 0) || 91 (pMEParams->searchRange8x8 <= 0) || 92 (pMEParams->searchRange4x4 <= 0), OMX_Sts_BadArgErr); 93 94 armMESpec->MEParams.blockSplitEnable8x8 = pMEParams->blockSplitEnable8x8; 95 armMESpec->MEParams.blockSplitEnable4x4 = pMEParams->blockSplitEnable4x4; 96 armMESpec->MEParams.halfSearchEnable = pMEParams->halfSearchEnable; 97 armMESpec->MEParams.quarterSearchEnable = pMEParams->quarterSearchEnable; 98 armMESpec->MEParams.intraEnable4x4 = pMEParams->intraEnable4x4; 99 armMESpec->MEParams.searchRange16x16 = pMEParams->searchRange16x16; 100 armMESpec->MEParams.searchRange8x8 = pMEParams->searchRange8x8; 101 armMESpec->MEParams.searchRange4x4 = pMEParams->searchRange4x4; 102 armMESpec->MEMode = MEMode; 103 104 return OMX_Sts_NoErr; 105} 106 107/* End of file */ 108