[5] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[56] | 6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
[5] | 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
| 33 | |
---|
[2] | 34 | /** \file TComRdCost.h |
---|
| 35 | \brief RD cost computation classes (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TCOMRDCOST__ |
---|
| 39 | #define __TCOMRDCOST__ |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | #include "CommonDef.h" |
---|
| 43 | #include "TComPattern.h" |
---|
| 44 | #include "TComMv.h" |
---|
[56] | 45 | |
---|
| 46 | #include "TComRdCost.h" |
---|
| 47 | #include "TComSlice.h" |
---|
| 48 | #include "TComRdCostWeightPrediction.h" |
---|
[2] | 49 | #include "../TLibRenderer/TRenModel.h" |
---|
| 50 | |
---|
[56] | 51 | //! \ingroup TLibCommon |
---|
| 52 | //! \{ |
---|
| 53 | |
---|
| 54 | #define FIX203 1 |
---|
| 55 | |
---|
[2] | 56 | class DistParam; |
---|
| 57 | class TComPattern; |
---|
[56] | 58 | class TComRdCost; |
---|
[2] | 59 | |
---|
| 60 | // ==================================================================================================================== |
---|
| 61 | // Type definition |
---|
| 62 | // ==================================================================================================================== |
---|
| 63 | |
---|
| 64 | // for function pointer |
---|
| 65 | typedef UInt (*FpDistFunc) (DistParam*); |
---|
| 66 | |
---|
[56] | 67 | #if HHI_VSO |
---|
[2] | 68 | typedef Dist (TComRdCost::*FpDistFuncVSO) ( Int, Int, Pel*, Int, Pel*, Int, UInt, UInt, Bool ); |
---|
| 69 | #endif |
---|
| 70 | // ==================================================================================================================== |
---|
| 71 | // Class definition |
---|
| 72 | // ==================================================================================================================== |
---|
| 73 | |
---|
| 74 | /// distortion parameter class |
---|
| 75 | class DistParam |
---|
| 76 | { |
---|
| 77 | public: |
---|
| 78 | Pel* pOrg; |
---|
| 79 | Pel* pCur; |
---|
| 80 | Int iStrideOrg; |
---|
| 81 | Int iStrideCur; |
---|
[100] | 82 | #if SAIT_VSO_EST_A0033 |
---|
| 83 | Pel* pVirRec; |
---|
| 84 | Pel* pVirOrg; |
---|
| 85 | Int iStrideVir; |
---|
| 86 | #endif |
---|
[2] | 87 | Int iRows; |
---|
| 88 | Int iCols; |
---|
| 89 | Int iStep; |
---|
| 90 | FpDistFunc DistFunc; |
---|
[56] | 91 | |
---|
[5] | 92 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 93 | Pel* pUsed; |
---|
| 94 | Int iStrideUsed; |
---|
| 95 | #endif |
---|
[56] | 96 | Bool bApplyWeight; // whether weithed prediction is used or not |
---|
| 97 | wpScalingParam *wpCur; // weithed prediction scaling parameters for current ref |
---|
| 98 | UInt uiComp; // uiComp = 0 (luma Y), 1 (chroma U), 2 (chroma V) |
---|
[2] | 99 | |
---|
[56] | 100 | #if NS_HAD |
---|
| 101 | Bool bUseNSHAD; |
---|
[2] | 102 | #endif |
---|
| 103 | |
---|
| 104 | // (vertical) subsampling shift (for reducing complexity) |
---|
| 105 | // - 0 = no subsampling, 1 = even rows, 2 = every 4th, etc. |
---|
| 106 | Int iSubShift; |
---|
[56] | 107 | |
---|
[2] | 108 | DistParam() |
---|
| 109 | { |
---|
| 110 | pOrg = NULL; |
---|
| 111 | pCur = NULL; |
---|
[100] | 112 | #if SAIT_VSO_EST_A0033 |
---|
| 113 | pVirRec = NULL; |
---|
| 114 | pVirOrg = NULL;; |
---|
| 115 | iStrideVir = 0; |
---|
| 116 | #endif |
---|
[2] | 117 | iStrideOrg = 0; |
---|
| 118 | iStrideCur = 0; |
---|
| 119 | iRows = 0; |
---|
| 120 | iCols = 0; |
---|
| 121 | iStep = 1; |
---|
| 122 | DistFunc = NULL; |
---|
| 123 | iSubShift = 0; |
---|
[5] | 124 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 125 | pUsed = 0; |
---|
| 126 | iStrideUsed = 0; |
---|
| 127 | #endif |
---|
[56] | 128 | #if NS_HAD |
---|
| 129 | bUseNSHAD = false; |
---|
| 130 | #endif |
---|
[2] | 131 | } |
---|
| 132 | }; |
---|
| 133 | |
---|
| 134 | /// RD cost computation class |
---|
| 135 | class TComRdCost |
---|
| 136 | : public TComRdCostWeightPrediction |
---|
| 137 | { |
---|
| 138 | private: |
---|
| 139 | // for distortion |
---|
| 140 | Int m_iBlkWidth; |
---|
| 141 | Int m_iBlkHeight; |
---|
[56] | 142 | |
---|
| 143 | #if AMP_SAD |
---|
| 144 | FpDistFunc m_afpDistortFunc[64]; // [eDFunc] |
---|
| 145 | #else |
---|
[2] | 146 | FpDistFunc m_afpDistortFunc[33]; // [eDFunc] |
---|
[56] | 147 | #endif |
---|
| 148 | |
---|
| 149 | #if WEIGHTED_CHROMA_DISTORTION |
---|
| 150 | Double m_chromaDistortionWeight; |
---|
[2] | 151 | #endif |
---|
| 152 | Double m_dLambda; |
---|
| 153 | Double m_sqrtLambda; |
---|
| 154 | UInt m_uiLambdaMotionSAD; |
---|
| 155 | UInt m_uiLambdaMotionSSE; |
---|
| 156 | Double m_dFrameLambda; |
---|
[100] | 157 | #if SAIT_VSO_EST_A0033 |
---|
| 158 | static Double m_dDisparityCoeff; |
---|
| 159 | #endif |
---|
[56] | 160 | |
---|
[5] | 161 | #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE |
---|
[2] | 162 | Double m_dLambdaScale ; |
---|
| 163 | #endif |
---|
| 164 | // for motion cost |
---|
[56] | 165 | #if FIX203 |
---|
| 166 | TComMv m_mvPredictor; |
---|
| 167 | #else |
---|
[2] | 168 | UInt* m_puiComponentCostOriginP; |
---|
| 169 | UInt* m_puiComponentCost; |
---|
| 170 | UInt* m_puiVerCost; |
---|
| 171 | UInt* m_puiHorCost; |
---|
[56] | 172 | #endif |
---|
[2] | 173 | UInt m_uiCost; |
---|
| 174 | Int m_iCostScale; |
---|
[56] | 175 | #if !FIX203 |
---|
[2] | 176 | Int m_iSearchLimit; |
---|
[56] | 177 | #endif |
---|
| 178 | |
---|
[2] | 179 | Bool m_bUseMultiviewReg; |
---|
| 180 | UInt m_uiLambdaMVReg; |
---|
| 181 | UInt m_uiLambdaMVRegSAD; |
---|
| 182 | UInt m_uiLambdaMVRegSSE; |
---|
| 183 | UInt* m_puiMultiviewRegCostHorOrgP; |
---|
| 184 | UInt* m_puiMultiviewRegCostVerOrgP; |
---|
| 185 | UInt* m_puiMultiviewRegCostHor; |
---|
| 186 | UInt* m_puiMultiviewRegCostVer; |
---|
| 187 | UInt* m_puiHorRegCost; |
---|
| 188 | UInt* m_puiVerRegCost; |
---|
| 189 | TComMv m_cMultiviewOrgMvPred; |
---|
[56] | 190 | |
---|
[2] | 191 | public: |
---|
| 192 | TComRdCost(); |
---|
| 193 | virtual ~TComRdCost(); |
---|
[56] | 194 | |
---|
| 195 | Double calcRdCost ( UInt uiBits, UInt uiDistortion, Bool bFlag = false, DFunc eDFunc = DF_DEFAULT ); |
---|
[2] | 196 | Double calcRdCost64( UInt64 uiBits, UInt64 uiDistortion, Bool bFlag = false, DFunc eDFunc = DF_DEFAULT ); |
---|
[56] | 197 | |
---|
| 198 | #if WEIGHTED_CHROMA_DISTORTION |
---|
| 199 | Void setChromaDistortionWeight ( Double chromaDistortionWeight) { m_chromaDistortionWeight = chromaDistortionWeight; }; |
---|
| 200 | #endif |
---|
[2] | 201 | Void setLambda ( Double dLambda ); |
---|
[5] | 202 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 203 | Void setLambdaMVReg ( Double dLambda ); |
---|
[5] | 204 | #endif |
---|
[2] | 205 | Void setFrameLambda ( Double dLambda ) { m_dFrameLambda = dLambda; } |
---|
[56] | 206 | |
---|
[100] | 207 | #if SAIT_VSO_EST_A0033 |
---|
| 208 | Void setDisparityCoeff( Double dDisparityCoeff ) { m_dDisparityCoeff = dDisparityCoeff; } |
---|
| 209 | Double getDisparityCoeff() { return m_dDisparityCoeff; } |
---|
| 210 | #endif |
---|
| 211 | |
---|
[5] | 212 | #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE |
---|
[2] | 213 | Void setLambdaScale ( Double dLambdaScale) { m_dLambdaScale = dLambdaScale; } |
---|
| 214 | Double getLambdaScale ( ) { return m_dLambdaScale ; } |
---|
| 215 | #endif |
---|
| 216 | Double getSqrtLambda () { return m_sqrtLambda; } |
---|
[56] | 217 | |
---|
[2] | 218 | // Distortion Functions |
---|
| 219 | Void init(); |
---|
[56] | 220 | |
---|
[2] | 221 | Void setDistParam( UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc, DistParam& rcDistParam ); |
---|
| 222 | Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, DistParam& rcDistParam ); |
---|
[56] | 223 | #if NS_HAD |
---|
| 224 | Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false, Bool bUseNSHAD=false ); |
---|
| 225 | Void setDistParam( DistParam& rcDP, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false, Bool bUseNSHAD=false ); |
---|
| 226 | #else |
---|
[2] | 227 | Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false ); |
---|
| 228 | Void setDistParam( DistParam& rcDP, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false ); |
---|
| 229 | #endif |
---|
[56] | 230 | |
---|
[2] | 231 | UInt calcHAD ( Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight ); |
---|
[56] | 232 | |
---|
[2] | 233 | // for motion cost |
---|
[56] | 234 | #if !FIX203 |
---|
[2] | 235 | Void initRateDistortionModel( Int iSubPelSearchLimit ); |
---|
| 236 | Void xUninit(); |
---|
[56] | 237 | #endif |
---|
[2] | 238 | UInt xGetComponentBits( Int iVal ); |
---|
[81] | 239 | Void getMotionCost( Bool bSad, Int iAdd ) |
---|
| 240 | { |
---|
| 241 | m_uiCost = (bSad ? m_uiLambdaMotionSAD + iAdd : m_uiLambdaMotionSSE + iAdd); |
---|
| 242 | m_uiLambdaMVReg = ( bSad ? m_uiLambdaMVRegSAD : m_uiLambdaMVRegSSE ); |
---|
[100] | 243 | |
---|
[81] | 244 | } |
---|
[2] | 245 | Void setPredictor( TComMv& rcMv ) |
---|
| 246 | { |
---|
[56] | 247 | #if FIX203 |
---|
| 248 | m_mvPredictor = rcMv; |
---|
| 249 | #else |
---|
[2] | 250 | m_puiHorCost = m_puiComponentCost - rcMv.getHor(); |
---|
| 251 | m_puiVerCost = m_puiComponentCost - rcMv.getVer(); |
---|
[56] | 252 | #endif |
---|
[2] | 253 | } |
---|
| 254 | Void setCostScale( Int iCostScale ) { m_iCostScale = iCostScale; } |
---|
| 255 | __inline UInt getCost( Int x, Int y ) |
---|
| 256 | { |
---|
[56] | 257 | #if FIX203 |
---|
| 258 | return m_uiCost * getBits(x, y) >> 16; |
---|
| 259 | #else |
---|
[2] | 260 | return (( m_uiCost * (m_puiHorCost[ x * (1<<m_iCostScale) ] + m_puiVerCost[ y * (1<<m_iCostScale) ]) ) >> 16); |
---|
[56] | 261 | #endif |
---|
[2] | 262 | } |
---|
| 263 | UInt getCost( UInt b ) { return ( m_uiCost * b ) >> 16; } |
---|
[56] | 264 | UInt getBits( Int x, Int y ) |
---|
| 265 | { |
---|
| 266 | #if FIX203 |
---|
| 267 | return xGetComponentBits((x << m_iCostScale) - m_mvPredictor.getHor()) |
---|
| 268 | + xGetComponentBits((y << m_iCostScale) - m_mvPredictor.getVer()); |
---|
| 269 | #else |
---|
| 270 | return m_puiHorCost[ x * (1<<m_iCostScale)] + m_puiVerCost[ y * (1<<m_iCostScale) ]; |
---|
| 271 | #endif |
---|
| 272 | } |
---|
[2] | 273 | |
---|
| 274 | Void setMultiviewReg( TComMv* pcMv ) |
---|
| 275 | { |
---|
| 276 | if( pcMv ) |
---|
| 277 | { |
---|
| 278 | m_bUseMultiviewReg = true; |
---|
| 279 | m_puiHorRegCost = m_puiMultiviewRegCostHor - pcMv->getHor(); |
---|
| 280 | m_puiVerRegCost = m_puiMultiviewRegCostVer - pcMv->getVer(); |
---|
| 281 | m_cMultiviewOrgMvPred = *pcMv; |
---|
| 282 | } |
---|
| 283 | else |
---|
| 284 | { |
---|
| 285 | m_bUseMultiviewReg = false; |
---|
| 286 | m_puiHorRegCost = 0; |
---|
| 287 | m_puiVerRegCost = 0; |
---|
| 288 | m_cMultiviewOrgMvPred.set( 0, 0 ); |
---|
| 289 | } |
---|
| 290 | } |
---|
| 291 | __inline Bool useMultiviewReg () { return m_bUseMultiviewReg; } |
---|
| 292 | __inline TComMv& getMultiviewOrgMvPred() { return m_cMultiviewOrgMvPred; } |
---|
| 293 | __inline UInt getMultiviewRegCost ( Int x, Int y ) |
---|
| 294 | { |
---|
[81] | 295 | #if FIX203 |
---|
| 296 | return m_uiLambdaMVReg * getBits(x, y) >> 16; |
---|
| 297 | #else |
---|
[2] | 298 | return ( ( m_uiLambdaMVReg * ( m_puiHorRegCost[ x * ( 1 << m_iCostScale ) ] + m_puiVerRegCost[ y * ( 1 << m_iCostScale ) ] ) ) >> 16 ); |
---|
[81] | 299 | #endif |
---|
[2] | 300 | } |
---|
[56] | 301 | |
---|
[2] | 302 | private: |
---|
[56] | 303 | |
---|
[2] | 304 | static UInt xGetSSE ( DistParam* pcDtParam ); |
---|
| 305 | static UInt xGetSSE4 ( DistParam* pcDtParam ); |
---|
| 306 | static UInt xGetSSE8 ( DistParam* pcDtParam ); |
---|
| 307 | static UInt xGetSSE16 ( DistParam* pcDtParam ); |
---|
| 308 | static UInt xGetSSE32 ( DistParam* pcDtParam ); |
---|
| 309 | static UInt xGetSSE64 ( DistParam* pcDtParam ); |
---|
| 310 | static UInt xGetSSE16N ( DistParam* pcDtParam ); |
---|
[56] | 311 | |
---|
[2] | 312 | static UInt xGetSAD ( DistParam* pcDtParam ); |
---|
| 313 | static UInt xGetSAD4 ( DistParam* pcDtParam ); |
---|
| 314 | static UInt xGetSAD8 ( DistParam* pcDtParam ); |
---|
| 315 | static UInt xGetSAD16 ( DistParam* pcDtParam ); |
---|
| 316 | static UInt xGetSAD32 ( DistParam* pcDtParam ); |
---|
| 317 | static UInt xGetSAD64 ( DistParam* pcDtParam ); |
---|
| 318 | static UInt xGetSAD16N ( DistParam* pcDtParam ); |
---|
[56] | 319 | |
---|
[100] | 320 | #if SAIT_VSO_EST_A0033 |
---|
| 321 | static UInt xGetVSD ( DistParam* pcDtParam ); |
---|
| 322 | static UInt xGetVSD4 ( DistParam* pcDtParam ); |
---|
| 323 | static UInt xGetVSD8 ( DistParam* pcDtParam ); |
---|
| 324 | static UInt xGetVSD16 ( DistParam* pcDtParam ); |
---|
| 325 | static UInt xGetVSD32 ( DistParam* pcDtParam ); |
---|
| 326 | static UInt xGetVSD64 ( DistParam* pcDtParam ); |
---|
| 327 | static UInt xGetVSD16N ( DistParam* pcDtParam ); |
---|
| 328 | #endif |
---|
| 329 | |
---|
[56] | 330 | #if AMP_SAD |
---|
| 331 | static UInt xGetSAD12 ( DistParam* pcDtParam ); |
---|
| 332 | static UInt xGetSAD24 ( DistParam* pcDtParam ); |
---|
| 333 | static UInt xGetSAD48 ( DistParam* pcDtParam ); |
---|
[2] | 334 | |
---|
[56] | 335 | #endif |
---|
[2] | 336 | |
---|
| 337 | static UInt xGetHADs4 ( DistParam* pcDtParam ); |
---|
| 338 | static UInt xGetHADs8 ( DistParam* pcDtParam ); |
---|
| 339 | static UInt xGetHADs ( DistParam* pcDtParam ); |
---|
| 340 | static UInt xCalcHADs2x2 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
| 341 | static UInt xCalcHADs4x4 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
| 342 | static UInt xCalcHADs8x8 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
[56] | 343 | #if NS_HAD |
---|
| 344 | static UInt xCalcHADs16x4 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
| 345 | static UInt xCalcHADs4x16 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); |
---|
[2] | 346 | #endif |
---|
[56] | 347 | |
---|
[2] | 348 | public: |
---|
[5] | 349 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 350 | UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piUsed, Int iUsedStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_SSE ); |
---|
| 351 | #endif |
---|
[56] | 352 | #if WEIGHTED_CHROMA_DISTORTION |
---|
| 353 | UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bWeighted = false, DFunc eDFunc = DF_SSE ); |
---|
| 354 | #else |
---|
[2] | 355 | UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_SSE ); |
---|
[56] | 356 | #endif |
---|
| 357 | |
---|
[100] | 358 | #if SAIT_VSO_EST_A0033 |
---|
| 359 | UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piVirRec, Pel* piVirOrg, Int iVirStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_VSD ); |
---|
| 360 | static UInt getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ); |
---|
| 361 | #endif |
---|
| 362 | |
---|
[5] | 363 | #if HHI_VSO |
---|
[2] | 364 | private: |
---|
| 365 | Double m_dLambdaVSO; |
---|
| 366 | Double m_dSqrtLambdaVSO; |
---|
| 367 | UInt m_uiLambdaMotionSADVSO; |
---|
| 368 | UInt m_uiLambdaMotionSSEVSO; |
---|
| 369 | Double m_dFrameLambdaVSO; |
---|
| 370 | |
---|
[5] | 371 | #if HHI_VSO_DIST_INT |
---|
[2] | 372 | Bool m_bAllowNegDist; |
---|
| 373 | #endif |
---|
[100] | 374 | #if SAIT_VSO_EST_A0033 |
---|
| 375 | TComPicYuv * m_pcVideoRecPicYuv; |
---|
| 376 | TComPicYuv * m_pcDepthPicYuv; |
---|
| 377 | Bool m_bUseEstimatedVSD; |
---|
| 378 | #endif |
---|
[110] | 379 | #if LGE_WVSO_A0119 |
---|
| 380 | Int m_iDWeight; |
---|
| 381 | Int m_iVSOWeight; |
---|
| 382 | Int m_iVSDWeight; |
---|
| 383 | Bool m_bWVSO; |
---|
| 384 | #endif |
---|
[2] | 385 | |
---|
| 386 | Bool m_bUseVSO; |
---|
| 387 | Bool m_bUseLambdaScaleVSO; |
---|
| 388 | UInt m_uiVSOMode; |
---|
| 389 | |
---|
[56] | 390 | FpDistFuncVSO m_fpDistortFuncVSO; |
---|
[2] | 391 | TRenModel* m_pcRenModel; |
---|
| 392 | public: |
---|
| 393 | |
---|
| 394 | Void setRenModel ( TRenModel* pcRenModel ) { m_pcRenModel = pcRenModel; } |
---|
| 395 | Void setRenModelData ( TComDataCU* pcCU, UInt uiAbsPartIndex, Pel* piData, Int iStride, Int iBlkWidth, Int iBlkHeight ); |
---|
| 396 | Void setLambdaVSO ( Double dLambda ); |
---|
| 397 | Void setFrameLambdaVSO ( Double dLambda ) { m_dFrameLambdaVSO = dLambda; }; |
---|
| 398 | |
---|
| 399 | |
---|
| 400 | Void setUseVSO ( Bool bIn ) { m_bUseVSO = bIn; }; |
---|
| 401 | Bool getUseVSO ( ) { return m_bUseVSO;}; |
---|
[100] | 402 | #if SAIT_VSO_EST_A0033 |
---|
| 403 | Bool getUseEstimatedVSD( ) { return m_bUseEstimatedVSD; }; |
---|
| 404 | Void setUseEstimatedVSD( Bool bIn ) { m_bUseEstimatedVSD = bIn; }; |
---|
[2] | 405 | |
---|
[100] | 406 | TComPicYuv* getVideoRecPicYuv () { return m_pcVideoRecPicYuv; }; |
---|
| 407 | Void setVideoRecPicYuv ( TComPicYuv* pcVideoRecPicYuv ) { m_pcVideoRecPicYuv = pcVideoRecPicYuv; }; |
---|
| 408 | TComPicYuv* getDepthPicYuv () { return m_pcDepthPicYuv; }; |
---|
| 409 | Void setDepthPicYuv ( TComPicYuv* pcDepthPicYuv ) { m_pcDepthPicYuv = pcDepthPicYuv; }; |
---|
| 410 | #endif |
---|
| 411 | |
---|
[2] | 412 | Bool getUseRenModel ( ) { return (m_bUseVSO && m_uiVSOMode == 4); }; |
---|
| 413 | Void setUseLambdaScaleVSO(bool bIn) { m_bUseLambdaScaleVSO = bIn; }; |
---|
| 414 | Bool getUseLambdaScaleVSO( ) { return m_bUseLambdaScaleVSO; }; |
---|
| 415 | |
---|
| 416 | Void setVSOMode( UInt uiIn); |
---|
| 417 | UInt getVSOMode( ) { return m_uiVSOMode; } |
---|
[110] | 418 | #if LGE_WVSO_A0119 |
---|
| 419 | Void setWVSO ( Bool bIn ) { m_bWVSO = bIn; }; |
---|
| 420 | Bool getWVSO ( ) { return m_bWVSO;}; |
---|
| 421 | Void setDWeight ( Int iDWeight ) { m_iDWeight = iDWeight; }; |
---|
| 422 | Int getDWeight () { return m_iDWeight; }; |
---|
| 423 | Void setVSOWeight ( Int iVSOWeight ) { m_iVSOWeight = iVSOWeight; }; |
---|
| 424 | Int getVSOWeight () { return m_iVSOWeight; }; |
---|
| 425 | Void setVSDWeight ( Int iVSDWeight ) { m_iVSDWeight = iVSDWeight; }; |
---|
| 426 | Int getVSDWeight () { return m_iVSDWeight; }; |
---|
| 427 | #endif |
---|
[5] | 428 | #if HHI_VSO_DIST_INT |
---|
[2] | 429 | Void setAllowNegDist ( Bool bAllowNegDist ); |
---|
| 430 | #endif |
---|
| 431 | |
---|
| 432 | |
---|
| 433 | Double getSqrtLambdaVSO () { return m_dSqrtLambdaVSO; } |
---|
| 434 | Double getLambdaVSO () { return m_dLambdaVSO; } |
---|
| 435 | |
---|
| 436 | Dist getDistVS( TComDataCU* pcCU, UInt uiAbsPartIndex, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD, UInt uiPlane ); |
---|
| 437 | Double calcRdCostVSO( UInt uiBits, Dist uiDistortion, Bool bFlag = false, DFunc eDFunc = DF_DEFAULT ); |
---|
| 438 | |
---|
| 439 | private: |
---|
| 440 | Dist xGetDistVSOMode4( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD ); |
---|
| 441 | |
---|
[5] | 442 | #endif // HHI_VSO |
---|
[2] | 443 | |
---|
| 444 | };// END CLASS DEFINITION TComRdCost |
---|
| 445 | |
---|
[56] | 446 | //! \} |
---|
[2] | 447 | |
---|
| 448 | #endif // __TCOMRDCOST__ |
---|