1/**
2 *
3 * File Name:  omxVCM4P10_MEGetBufSize.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 *
12 * Description:
13 * Initialization modules for the vendor specific Motion Estimation structure.
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_MEGetBufSize   (6.3.5.1.1)
26 *
27 * Description:
28 * Computes the size, in bytes, of the vendor-specific specification
29 * structure for the omxVCM4P10 motion estimation functions BlockMatch_Integer
30 * and MotionEstimationMB.
31 *
32 * Input Arguments:
33 *
34 *   MEmode - motion estimation mode; available modes are defined by the
35 *            enumerated type OMXVCM4P10MEMode
36 *   pMEParams -motion estimation parameters
37 *
38 * Output Arguments:
39 *
40 *   pSize - pointer to the number of bytes required for the motion
41 *            estimation specification structure
42 *
43 * Return Value:
44 *    OMX_Sts_NoErr, if the function runs without error.
45 *    OMX_Sts_BadArgErr - bad arguments: if one of the following cases occurs:
46 *    -    pMEParams or pSize is NULL.
47 *    -    an invalid MEMode is specified.
48 *
49 */
50
51OMXResult omxVCM4P10_MEGetBufSize(
52    OMXVCM4P10MEMode MEMode,
53    const OMXVCM4P10MEParams *pMEParams,
54    OMX_U32 *pSize
55    )
56{
57    armRetArgErrIf(!pMEParams, OMX_Sts_BadArgErr);
58    armRetArgErrIf(!pSize, OMX_Sts_BadArgErr);
59    armRetArgErrIf((MEMode != OMX_VC_M4P10_FAST_SEARCH) &&
60                   (MEMode != OMX_VC_M4P10_FULL_SEARCH), OMX_Sts_BadArgErr);
61    armRetArgErrIf((pMEParams->searchRange16x16 <= 0) ||
62                   (pMEParams->searchRange8x8 <= 0) ||
63                   (pMEParams->searchRange4x4 <= 0), OMX_Sts_BadArgErr);
64
65    *pSize = (OMX_INT) sizeof(ARMVCM4P10_MESpec);
66
67    return OMX_Sts_NoErr;
68}
69
70/* End of file */
71