omxVCM4P10_InterpolateHalfHor_Luma.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:  omxVCM4P10_InterpolateHalfHor_Luma.c
20 * OpenMAX DL: v1.0.2
21 * Revision:   9641
22 * Date:       Thursday, February 7, 2008
23 *
24 *
25 *
26 * Description:
27 * This function will calculate Half horizontal luma interpolation
28 *
29 */
30
31#include "omxtypes.h"
32#include "armOMX.h"
33#include "omxVC.h"
34
35#include "armCOMM.h"
36#include "armVC.h"
37
38/**
39 * Function:  omxVCM4P10_InterpolateHalfHor_Luma   (6.3.5.5.1)
40 *
41 * Description:
42 * This function performs interpolation for two horizontal 1/2-pel positions
43 * (-1/2,0) and (1/2, 0) - around a full-pel position.
44 *
45 * Input Arguments:
46 *
47 *   pSrc - Pointer to the top-left corner of the block used to interpolate in
48 *            the reconstruction frame plane.
49 *   iSrcStep - Step of the source buffer.
50 *   iDstStep - Step of the destination(interpolation) buffer; must be a
51 *            multiple of iWidth.
52 *   iWidth - Width of the current block; must be equal to either 4, 8, or 16
53 *   iHeight - Height of the current block; must be equal to 4, 8, or 16
54 *
55 * Output Arguments:
56 *
57 *   pDstLeft -Pointer to the interpolation buffer of the left -pel position
58 *            (-1/2, 0)
59 *                 If iWidth==4,  4-byte alignment required.
60 *                 If iWidth==8,  8-byte alignment required.
61 *                 If iWidth==16, 16-byte alignment required.
62 *   pDstRight -Pointer to the interpolation buffer of the right -pel
63 *            position (1/2, 0)
64 *                 If iWidth==4,  4-byte alignment required.
65 *                 If iWidth==8,  8-byte alignment required.
66 *                 If iWidth==16, 16-byte alignment required.
67 *
68 * Return Value:
69 *
70 *    OMX_Sts_NoErr - no error
71 *    OMX_Sts_BadArgErr - bad arguments; returned if any of the following
72 *              conditions are true:
73 *    -    at least one of the following pointers is NULL:
74 *             pSrc, pDstLeft, or pDstRight
75 *    -    iWidth or iHeight have values other than 4, 8, or 16
76 *    -    iWidth==4 but pDstLeft and/or pDstRight is/are not aligned on a 4-byte boundary
77 *    -    iWidth==8 but pDstLeft and/or pDstRight is/are not aligned on a 8-byte boundary
78 *    -    iWidth==16 but pDstLeft and/or pDstRight is/are not aligned on a 16-byte boundary
79 *    -    any alignment restrictions are violated
80 *
81 */
82
83OMXResult omxVCM4P10_InterpolateHalfHor_Luma(
84        const OMX_U8*     pSrc,
85        OMX_U32     iSrcStep,
86        OMX_U8*     pDstLeft,
87        OMX_U8*     pDstRight,
88        OMX_U32     iDstStep,
89        OMX_U32     iWidth,
90        OMX_U32     iHeight
91)
92{
93    OMXResult   RetValue;
94
95    /* check for argument error */
96    armRetArgErrIf(pSrc == NULL, OMX_Sts_BadArgErr)
97    armRetArgErrIf(pDstLeft == NULL, OMX_Sts_BadArgErr)
98    armRetArgErrIf(pDstRight == NULL, OMX_Sts_BadArgErr)
99    armRetArgErrIf((iWidth == 4) &&
100                   armNot4ByteAligned(pDstLeft) &&
101                   armNot4ByteAligned(pDstRight), OMX_Sts_BadArgErr)
102    armRetArgErrIf((iWidth == 8) &&
103                   armNot8ByteAligned(pDstLeft) &&
104                   armNot8ByteAligned(pDstRight), OMX_Sts_BadArgErr)
105    armRetArgErrIf((iWidth == 16) &&
106                   armNot16ByteAligned(pDstLeft) &&
107                   armNot16ByteAligned(pDstRight), OMX_Sts_BadArgErr)
108
109    armRetArgErrIf((iHeight != 16) && (iHeight != 8)&& (iHeight != 4), OMX_Sts_BadArgErr)
110	armRetArgErrIf((iWidth != 16) && (iWidth != 8)&& (iWidth != 4), OMX_Sts_BadArgErr)
111
112    RetValue = armVCM4P10_InterpolateHalfHor_Luma (
113        pSrc - 1,
114        iSrcStep,
115        pDstLeft,
116        iDstStep,
117        iWidth,
118        iHeight);
119
120    if (RetValue != OMX_Sts_NoErr)
121    {
122        return RetValue;
123    }
124
125    RetValue = armVCM4P10_InterpolateHalfHor_Luma (
126        pSrc,
127        iSrcStep,
128        pDstRight,
129        iDstStep,
130        iWidth,
131        iHeight);
132
133    return RetValue;
134}
135
136/*****************************************************************************
137 *                              END OF FILE
138 *****************************************************************************/
139
140