1 /*! 2 * \copy 3 * Copyright (c) 2009-2013, Cisco Systems 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 10 * * Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 13 * * Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in 15 * the documentation and/or other materials provided with the 16 * distribution. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 * 31 * 32 * \file rec_mb.h 33 * 34 * \brief interfaces for all macroblock decoding process after mb syntax parsing and residual decoding with cavlc. 35 * 36 * \date 3/4/2009 Created 37 * 38 ************************************************************************************* 39 */ 40 41 #ifndef WELS_REC_MB_H__ 42 #define WELS_REC_MB_H__ 43 44 #include "typedefs.h" 45 #include "wels_common_basis.h" 46 #include "error_code.h" 47 48 #include "decoder_context.h" 49 50 namespace WelsDec { 51 52 #define WELS_B_MB_REC_VERIFY(uiRet) do{ \ 53 uint32_t uiRetTmp = (uint32_t)uiRet; \ 54 if( uiRetTmp != ERR_NONE ) \ 55 return uiRetTmp; \ 56 }while(0) 57 58 typedef struct TagMCRefMember { 59 uint8_t* pDstY; 60 uint8_t* pDstU; 61 uint8_t* pDstV; 62 63 uint8_t* pSrcY; 64 uint8_t* pSrcU; 65 uint8_t* pSrcV; 66 67 int32_t iSrcLineLuma; 68 int32_t iSrcLineChroma; 69 70 int32_t iDstLineLuma; 71 int32_t iDstLineChroma; 72 73 int32_t iPicWidth; 74 int32_t iPicHeight; 75 } sMCRefMember; 76 77 void BaseMC (PWelsDecoderContext pCtx, sMCRefMember* pMCRefMem, const int32_t& listIdx, const int8_t& iRefIdx, 78 int32_t iXOffset, int32_t iYOffset, SMcFunc* pMCFunc, 79 int32_t iBlkWidth, int32_t iBlkHeight, int16_t iMVs[2]); 80 81 void WelsFillRecNeededMbInfo (PWelsDecoderContext pCtx, bool bOutput, PDqLayer pCurDqLayer); 82 83 int32_t RecI4x4Mb (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer); 84 85 int32_t RecI4x4Luma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer); 86 87 int32_t RecI4x4Chroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer); 88 89 int32_t RecI8x8Mb (int32_t iMbXy, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer); 90 91 int32_t RecI8x8Luma (int32_t iMbXy, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer); 92 93 int32_t RecI16x16Mb (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer); 94 95 int32_t RecChroma (int32_t iMBXY, PWelsDecoderContext pCtx, int16_t* pScoeffLevel, PDqLayer pDqLayer); 96 97 int32_t GetInterPred (uint8_t* pPredY, uint8_t* pPredCb, uint8_t* pPredCr, PWelsDecoderContext pCtx); 98 99 int32_t GetInterBPred (uint8_t* pPredYCbCr[3], uint8_t* pTempPredYCbCr[3], PWelsDecoderContext pCtx); 100 101 } // namespace WelsDec 102 103 #endif //WELS_REC_MB_H__ 104 105