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 svc_mode_decision.h 33 * 34 * \brief SVC Spatial Enhancement Layer MD 35 * 36 * \date 2009.7.29 Created 37 * 38 ************************************************************************************* 39 */ 40 41 #ifndef SVC_MODE_DECISION_H 42 #define SVC_MODE_DECISION_H 43 #include "encoder_context.h" 44 #include "svc_encode_mb.h" 45 #include "svc_encode_slice.h" 46 #include "svc_enc_macroblock.h" 47 #include "md.h" 48 49 50 namespace WelsEnc { 51 //////////////////////// 52 // INTERFACE, called by svc_encode_slice.c 53 /////////////////////// 54 #define DELTA_QP_SCD_THD 5 55 56 typedef enum { 57 STATIC, 58 SCROLLED 59 } ESkipModes; 60 61 // NOILP ILFMD ENTRANCE 62 void WelsMdSpatialelInterMbIlfmdNoilp (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* pSlice, SMB* pCurMb, 63 const Mb_Type kuiRefMbType); 64 void WelsMdInterMbEnhancelayer (sWelsEncCtx* pEnc, SWelsMD* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache); 65 SMB* GetRefMb (SDqLayer* pCurLayer, SMB* pCurMb); 66 void SetMvBaseEnhancelayer (SWelsMD* pMd, SMB* pCurMb, const SMB* kpRefMb); 67 68 ////////////// 69 // MD from background detection 70 ////////////// 71 bool WelsMdInterJudgeBGDPskip (sWelsEncCtx* pEnc, SWelsMD* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, 72 bool* bKeepSkip); 73 bool WelsMdInterJudgeBGDPskipFalse (sWelsEncCtx* pEnc, SWelsMD* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, 74 bool* bKeepSkip); 75 76 void WelsMdUpdateBGDInfo (SDqLayer* pCurLayer, SMB* pCurMb, const bool kbCollocatedPredFlag, 77 const int32_t kiRefPictureType); 78 void WelsMdUpdateBGDInfoNULL (SDqLayer* pCurLayer, SMB* pCurMb, const bool kbCollocatedPredFlag, 79 const int32_t kiRefPictureType); 80 81 ////////////// 82 // MD for screen contents 83 ////////////// 84 bool MdInterSCDPskipProcess (sWelsEncCtx* pEncCtx, SWelsMD* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pMbCache, 85 ESkipModes eSkipMode); 86 typedef bool (*pJudgeSkipFun) (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, SWelsMD* pWelsMd); 87 void SetBlockStaticIdcToMd (void* pVaa, void* pMd, SMB* pCurMb, void* pDqLay); 88 void WelsInitSCDPskipFunc (SWelsFuncPtrList* pFuncList, const bool bScrollingDetection); 89 90 void SetScrollingMvToMd (SVAAFrameInfo* pVaa, SWelsMD* pWelsMd); 91 void SetScrollingMvToMdNull (SVAAFrameInfo* pVaa, SWelsMD* pWelsMd); 92 } 93 #endif //SVC_MODE_DECISION_H 94 95