1/**
2 *
3 * File Name:  omxVCM4P10_InterpolateLuma.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 Performs quarter-pixel interpolation
13 *
14 */
15
16#include "omxtypes.h"
17#include "armOMX.h"
18#include "omxVC.h"
19
20#include "armVC.h"
21#include "armCOMM.h"
22
23/**
24 * Function:  omxVCM4P10_InterpolateLuma   (6.3.3.2.1)
25 *
26 * Description:
27 * Performs quarter-pixel interpolation for inter luma MB. It is assumed that
28 * the frame is already padded when calling this function.
29 *
30 * Input Arguments:
31 *
32 *   pSrc -Pointer to the source reference frame buffer
33 *   srcStep -reference frame step, in bytes; must be a multiple of roi.width
34 *   dstStep -destination frame step, in bytes; must be a multiple of
35 *            roi.width
36 *   dx -Fractional part of horizontal motion vector component in 1/4 pixel
37 *            unit; valid in the range [0,3]
38 *   dy -Fractional part of vertical motion vector y component in 1/4 pixel
39 *            unit; valid in the range [0,3]
40 *   roi -Dimension of the interpolation region; the parameters roi.width and
41 *            roi.height must be equal to either 4, 8, or 16.
42 *
43 * Output Arguments:
44 *
45 *   pDst -Pointer to the destination frame buffer if roi.width==4,  4-byte
46 *            alignment required if roi.width==8,  8-byte alignment required
47 *            if roi.width==16, 16-byte alignment required
48 *
49 * Return Value:
50 *    If the function runs without error, it returns OMX_Sts_NoErr.
51 *    If one of the following cases occurs, the function returns
52 *              OMX_Sts_BadArgErr:
53 *    pSrc or pDst is NULL.
54 *    srcStep or dstStep < roi.width.
55 *    dx or dy is out of range [0,3].
56 *    roi.width or roi.height is out of range {4, 8, 16}.
57 *    roi.width is equal to 4, but pDst is not 4 byte aligned.
58 *    roi.width is equal to 8 or 16, but pDst is not 8 byte aligned.
59 *    srcStep or dstStep is not a multiple of 8.
60 *
61 */
62
63OMXResult omxVCM4P10_InterpolateLuma (
64     const OMX_U8* pSrc,
65     OMX_S32 srcStep,
66     OMX_U8* pDst,
67     OMX_S32 dstStep,
68     OMX_S32 dx,
69     OMX_S32 dy,
70     OMXSize roi
71 )
72{
73    /* check for argument error */
74    armRetArgErrIf(pSrc == NULL, OMX_Sts_BadArgErr)
75    armRetArgErrIf(pDst == NULL, OMX_Sts_BadArgErr)
76    armRetArgErrIf(srcStep < roi.width, OMX_Sts_BadArgErr)
77    armRetArgErrIf(dstStep < roi.width, OMX_Sts_BadArgErr)
78    armRetArgErrIf(dx < 0, OMX_Sts_BadArgErr)
79    armRetArgErrIf(dx > 3, OMX_Sts_BadArgErr)
80    armRetArgErrIf(dy < 0, OMX_Sts_BadArgErr)
81    armRetArgErrIf(dy > 3, OMX_Sts_BadArgErr)
82    armRetArgErrIf((roi.width != 4) && (roi.width != 8) && (roi.width != 16), OMX_Sts_BadArgErr)
83    armRetArgErrIf((roi.height != 4) && (roi.height != 8) && (roi.height != 16), OMX_Sts_BadArgErr)
84    armRetArgErrIf((roi.width == 4) && armNot4ByteAligned(pDst), OMX_Sts_BadArgErr)
85    armRetArgErrIf((roi.width == 8) && armNot8ByteAligned(pDst), OMX_Sts_BadArgErr)
86    armRetArgErrIf((roi.width == 16) && armNot16ByteAligned(pDst), OMX_Sts_BadArgErr)
87    armRetArgErrIf(srcStep & 7, OMX_Sts_BadArgErr)
88    armRetArgErrIf(dstStep & 7, OMX_Sts_BadArgErr)
89
90    return armVCM4P10_Interpolate_Luma
91        (pSrc, srcStep, pDst, dstStep, roi.width, roi.height, dx, dy);
92
93}
94
95
96/*****************************************************************************
97 *                              END OF FILE
98 *****************************************************************************/
99
100