Home | History | Annotate | Download | only in src
      1 /* ----------------------------------------------------------------
      2  *
      3  *
      4  * File Name:  omxVCM4P10_DeblockChroma_I.c
      5  * OpenMAX DL: v1.0.2
      6  * Revision:   9641
      7  * Date:       Thursday, February 7, 2008
      8  *
      9  * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
     10  *
     11  *
     12  *
     13  * H.264 intra chroma deblock
     14  *
     15  */
     16 
     17 #include "omxtypes.h"
     18 #include "armOMX.h"
     19 #include "omxVC.h"
     20 
     21 #include "armCOMM.h"
     22 #include "armVC.h"
     23 
     24 /**
     25  * Function: omxVCM4P10_DeblockChroma_I
     26  *
     27  * Description:
     28  * Performs deblocking filtering on all edges of the chroma macroblock (16x16).
     29  *
     30  * Remarks:
     31  *
     32  * Parameters:
     33  * [in]	pSrcDst         pointer to the input macroblock. Must be 8-byte aligned.
     34  * [in]	srcdstStep      Step of the arrays
     35  * [in]	pAlpha          pointer to a 2x2 array of alpha thresholds, organized as follows: { external
     36  *                          vertical edge, internal  vertical edge, external
     37  *                         horizontal edge, internal horizontal edge }
     38  * [in]	pBeta			pointer to a 2x2 array of beta thresholds, organized as follows: { external
     39  *                              vertical edge, internal vertical edge, external  horizontal edge,
     40  *                              internal  horizontal edge }
     41  * [in]	pThresholds		AArray of size  8x2 of Thresholds (TC0) (values for the left or
     42  *                               above edge of each 4x2 or 2x4 block, arranged in  vertical block order
     43  *                               and then in  horizontal block order)
     44  * [in]	pBS				array of size 16x2 of BS parameters (arranged in scan block order for vertical edges and then horizontal edges);
     45  *                         valid in the range [0,4] with the following restrictions: i) pBS[i]== 4 may occur only for 0<=i<=3, ii) pBS[i]== 4 if and only if pBS[i^1]== 4.  Must be 4-byte aligned.
     46  * [out]	pSrcDst		pointer to filtered output macroblock
     47  *
     48  * Return Value:
     49  * OMX_Sts_NoErr - no error
     50  * OMX_Sts_BadArgErr - bad arguments
     51  *   - Either of the pointers in pSrcDst, pAlpha, pBeta, pTresholds, or pBS is NULL.
     52  *   - pSrcDst is not 8-byte aligned.
     53  *   - either pThresholds or pBS is not 4-byte aligned.
     54  *   - pBS is out of range, i.e., one of the following conditions is true: pBS[i]<0, pBS[i]>4, pBS[i]==4 for i>=4, or (pBS[i]==4 && pBS[i^1]!=4) for 0<=i<=3.
     55  *   - srcdstStep is not a multiple of 8.
     56  *
     57  */
     58 OMXResult omxVCM4P10_DeblockChroma_I(
     59 	OMX_U8* pSrcDst,
     60 	OMX_S32 srcdstStep,
     61 	const OMX_U8* pAlpha,
     62 	const OMX_U8* pBeta,
     63 	const OMX_U8* pThresholds,
     64     const OMX_U8 *pBS
     65 )
     66 {
     67     OMXResult errorCode;
     68 
     69     armRetArgErrIf(pSrcDst == NULL,                 OMX_Sts_BadArgErr);
     70     armRetArgErrIf(armNot8ByteAligned(pSrcDst),     OMX_Sts_BadArgErr);
     71     armRetArgErrIf(srcdstStep & 7,                  OMX_Sts_BadArgErr);
     72     armRetArgErrIf(pAlpha == NULL,                  OMX_Sts_BadArgErr);
     73     armRetArgErrIf(pBeta == NULL,                   OMX_Sts_BadArgErr);
     74     armRetArgErrIf(pThresholds == NULL,             OMX_Sts_BadArgErr);
     75     armRetArgErrIf(armNot4ByteAligned(pThresholds), OMX_Sts_BadArgErr);
     76     armRetArgErrIf(pBS == NULL,                     OMX_Sts_BadArgErr);
     77     armRetArgErrIf(armNot4ByteAligned(pBS),         OMX_Sts_BadArgErr);
     78 
     79     errorCode = omxVCM4P10_FilterDeblockingChroma_VerEdge_I(
     80         pSrcDst, srcdstStep, pAlpha, pBeta, pThresholds, pBS);
     81 
     82     armRetArgErrIf(errorCode != OMX_Sts_NoErr, errorCode)
     83 
     84     errorCode = omxVCM4P10_FilterDeblockingChroma_HorEdge_I(
     85         pSrcDst, srcdstStep, pAlpha+2, pBeta+2, pThresholds+8, pBS+16);
     86 
     87     return errorCode;
     88 }
     89