Home | History | Annotate | Download | only in src
      1 /**
      2  *
      3  * File Name:  omxVCM4P10_InterpolateHalfVer_Luma.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 SAD for 4x4 blocks
     13  *
     14  */
     15 
     16 #include "omxtypes.h"
     17 #include "armOMX.h"
     18 #include "omxVC.h"
     19 
     20 #include "armCOMM.h"
     21 #include "armVC.h"
     22 
     23 
     24 /**
     25  * Function:  omxVCM4P10_InterpolateHalfVer_Luma   (6.3.5.5.2)
     26  *
     27  * Description:
     28  * This function performs interpolation for two vertical 1/2-pel positions -
     29  * (0, -1/2) and (0, 1/2) - around a full-pel position.
     30  *
     31  * Input Arguments:
     32  *
     33  *   pSrc - Pointer to top-left corner of block used to interpolate in the
     34  *            reconstructed frame plane
     35  *   iSrcStep - Step of the source buffer.
     36  *   iDstStep - Step of the destination (interpolation) buffer; must be a
     37  *            multiple of iWidth.
     38  *   iWidth - Width of the current block; must be equal to either 4, 8, or 16
     39  *   iHeight - Height of the current block; must be equal to either 4, 8, or 16
     40  *
     41  * Output Arguments:
     42  *
     43  *   pDstUp -Pointer to the interpolation buffer of the -pel position above
     44  *            the current full-pel position (0, -1/2)
     45  *                If iWidth==4, 4-byte alignment required.
     46  *                If iWidth==8, 8-byte alignment required.
     47  *                If iWidth==16, 16-byte alignment required.
     48  *   pDstDown -Pointer to the interpolation buffer of the -pel position below
     49  *            the current full-pel position (0, 1/2)
     50  *                If iWidth==4, 4-byte alignment required.
     51  *                If iWidth==8, 8-byte alignment required.
     52  *                If iWidth==16, 16-byte alignment required.
     53  *
     54  * Return Value:
     55  *
     56  *    OMX_Sts_NoErr - no error
     57  *    OMX_Sts_BadArgErr - bad arguments; returned if any of the following
     58  *              conditions are true:
     59  *    -    at least one of the following pointers is NULL:
     60  *            pSrc, pDstUp, or pDstDown
     61  *    -    iWidth or iHeight have values other than 4, 8, or 16
     62  *    -    iWidth==4 but pDstUp and/or pDstDown is/are not aligned on a 4-byte boundary
     63  *    -    iWidth==8 but pDstUp and/or pDstDown is/are not aligned on a 8-byte boundary
     64  *    -    iWidth==16 but pDstUp and/or pDstDown is/are not aligned on a 16-byte boundary
     65  *
     66  */
     67  OMXResult omxVCM4P10_InterpolateHalfVer_Luma(
     68      const OMX_U8*    pSrc,
     69      OMX_U32    iSrcStep,
     70      OMX_U8*    pDstUp,
     71      OMX_U8*    pDstDown,
     72      OMX_U32    iDstStep,
     73      OMX_U32    iWidth,
     74      OMX_U32    iHeight
     75 )
     76 {
     77     OMXResult   RetValue;
     78 
     79     /* check for argument error */
     80     armRetArgErrIf(pSrc == NULL, OMX_Sts_BadArgErr)
     81     armRetArgErrIf(pDstUp == NULL, OMX_Sts_BadArgErr)
     82     armRetArgErrIf(pDstDown == NULL, OMX_Sts_BadArgErr)
     83     armRetArgErrIf((iWidth == 4) &&
     84                    armNot4ByteAligned(pDstUp) &&
     85                    armNot4ByteAligned(pDstDown), OMX_Sts_BadArgErr)
     86     armRetArgErrIf((iWidth == 8) &&
     87                    armNot8ByteAligned(pDstUp) &&
     88                    armNot8ByteAligned(pDstDown), OMX_Sts_BadArgErr)
     89     armRetArgErrIf((iWidth == 16) &&
     90                    armNot16ByteAligned(pDstUp) &&
     91                    armNot16ByteAligned(pDstDown), OMX_Sts_BadArgErr)
     92 
     93     armRetArgErrIf((iHeight != 16) && (iHeight != 8)&& (iHeight != 4), OMX_Sts_BadArgErr)
     94 	armRetArgErrIf((iWidth != 16) && (iWidth != 8)&& (iWidth != 4), OMX_Sts_BadArgErr)
     95 
     96     RetValue = armVCM4P10_InterpolateHalfVer_Luma(
     97         pSrc - iSrcStep,
     98         iSrcStep,
     99         pDstUp,
    100         iDstStep,
    101         iWidth,
    102         iHeight);
    103 
    104     if (RetValue != OMX_Sts_NoErr)
    105     {
    106         return RetValue;
    107     }
    108 
    109     RetValue = armVCM4P10_InterpolateHalfVer_Luma(
    110         pSrc,
    111         iSrcStep,
    112         pDstDown,
    113         iDstStep,
    114         iWidth,
    115         iHeight);
    116 
    117     return RetValue;
    118 }
    119 
    120 /*****************************************************************************
    121  *                              END OF FILE
    122  *****************************************************************************/
    123 
    124