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 |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
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. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
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 | |
---|
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" |
---|
45 | |
---|
46 | #include "TComRdCost.h" |
---|
47 | #include "TComSlice.h" |
---|
48 | #include "TComRdCostWeightPrediction.h" |
---|
49 | #include "../TLibRenderer/TRenModel.h" |
---|
50 | |
---|
51 | //! \ingroup TLibCommon |
---|
52 | //! \{ |
---|
53 | |
---|
54 | #define FIX203 1 |
---|
55 | |
---|
56 | class DistParam; |
---|
57 | class TComPattern; |
---|
58 | class TComRdCost; |
---|
59 | |
---|
60 | // ==================================================================================================================== |
---|
61 | // Type definition |
---|
62 | // ==================================================================================================================== |
---|
63 | |
---|
64 | // for function pointer |
---|
65 | typedef UInt (*FpDistFunc) (DistParam*); |
---|
66 | |
---|
67 | #if HHI_VSO |
---|
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; |
---|
82 | #if SAIT_VSO_EST_A0033 |
---|
83 | Pel* pVirRec; |
---|
84 | Pel* pVirOrg; |
---|
85 | Int iStrideVir; |
---|
86 | #endif |
---|
87 | Int iRows; |
---|
88 | Int iCols; |
---|
89 | Int iStep; |
---|
90 | FpDistFunc DistFunc; |
---|
91 | |
---|
92 | #if HHI_INTERVIEW_SKIP |
---|
93 | Pel* pUsed; |
---|
94 | Int iStrideUsed; |
---|
95 | #endif |
---|
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) |
---|
99 | |
---|
100 | #if NS_HAD |
---|
101 | Bool bUseNSHAD; |
---|
102 | #endif |
---|
103 | |
---|
104 | // (vertical) subsampling shift (for reducing complexity) |
---|
105 | // - 0 = no subsampling, 1 = even rows, 2 = every 4th, etc. |
---|
106 | Int iSubShift; |
---|
107 | |
---|
108 | DistParam() |
---|
109 | { |
---|
110 | pOrg = NULL; |
---|
111 | pCur = NULL; |
---|
112 | #if SAIT_VSO_EST_A0033 |
---|
113 | pVirRec = NULL; |
---|
114 | pVirOrg = NULL;; |
---|
115 | iStrideVir = 0; |
---|
116 | #endif |
---|
117 | iStrideOrg = 0; |
---|
118 | iStrideCur = 0; |
---|
119 | iRows = 0; |
---|
120 | iCols = 0; |
---|
121 | iStep = 1; |
---|
122 | DistFunc = NULL; |
---|
123 | iSubShift = 0; |
---|
124 | #if HHI_INTERVIEW_SKIP |
---|
125 | pUsed = 0; |
---|
126 | iStrideUsed = 0; |
---|
127 | #endif |
---|
128 | #if NS_HAD |
---|
129 | bUseNSHAD = false; |
---|
130 | #endif |
---|
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; |
---|
142 | |
---|
143 | #if AMP_SAD |
---|
144 | FpDistFunc m_afpDistortFunc[64]; // [eDFunc] |
---|
145 | #else |
---|
146 | FpDistFunc m_afpDistortFunc[33]; // [eDFunc] |
---|
147 | #endif |
---|
148 | |
---|
149 | #if WEIGHTED_CHROMA_DISTORTION |
---|
150 | Double m_chromaDistortionWeight; |
---|
151 | #endif |
---|
152 | Double m_dLambda; |
---|
153 | Double m_sqrtLambda; |
---|
154 | UInt m_uiLambdaMotionSAD; |
---|
155 | UInt m_uiLambdaMotionSSE; |
---|
156 | Double m_dFrameLambda; |
---|
157 | #if SAIT_VSO_EST_A0033 |
---|
158 | static Double m_dDisparityCoeff; |
---|
159 | #endif |
---|
160 | |
---|
161 | #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE |
---|
162 | Double m_dLambdaScale ; |
---|
163 | #endif |
---|
164 | // for motion cost |
---|
165 | #if FIX203 |
---|
166 | TComMv m_mvPredictor; |
---|
167 | #else |
---|
168 | UInt* m_puiComponentCostOriginP; |
---|
169 | UInt* m_puiComponentCost; |
---|
170 | UInt* m_puiVerCost; |
---|
171 | UInt* m_puiHorCost; |
---|
172 | #endif |
---|
173 | UInt m_uiCost; |
---|
174 | Int m_iCostScale; |
---|
175 | #if !FIX203 |
---|
176 | Int m_iSearchLimit; |
---|
177 | #endif |
---|
178 | |
---|
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; |
---|
190 | |
---|
191 | public: |
---|
192 | TComRdCost(); |
---|
193 | virtual ~TComRdCost(); |
---|
194 | |
---|
195 | Double calcRdCost ( UInt uiBits, UInt uiDistortion, Bool bFlag = false, DFunc eDFunc = DF_DEFAULT ); |
---|
196 | Double calcRdCost64( UInt64 uiBits, UInt64 uiDistortion, Bool bFlag = false, DFunc eDFunc = DF_DEFAULT ); |
---|
197 | |
---|
198 | #if WEIGHTED_CHROMA_DISTORTION |
---|
199 | Void setChromaDistortionWeight ( Double chromaDistortionWeight) { m_chromaDistortionWeight = chromaDistortionWeight; }; |
---|
200 | #endif |
---|
201 | Void setLambda ( Double dLambda ); |
---|
202 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
203 | Void setLambdaMVReg ( Double dLambda ); |
---|
204 | #endif |
---|
205 | Void setFrameLambda ( Double dLambda ) { m_dFrameLambda = dLambda; } |
---|
206 | |
---|
207 | #if SAIT_VSO_EST_A0033 |
---|
208 | Void setDisparityCoeff( Double dDisparityCoeff ) { m_dDisparityCoeff = dDisparityCoeff; } |
---|
209 | Double getDisparityCoeff() { return m_dDisparityCoeff; } |
---|
210 | #endif |
---|
211 | |
---|
212 | #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE |
---|
213 | Void setLambdaScale ( Double dLambdaScale) { m_dLambdaScale = dLambdaScale; } |
---|
214 | Double getLambdaScale ( ) { return m_dLambdaScale ; } |
---|
215 | #endif |
---|
216 | Double getSqrtLambda () { return m_sqrtLambda; } |
---|
217 | |
---|
218 | // Distortion Functions |
---|
219 | Void init(); |
---|
220 | |
---|
221 | Void setDistParam( UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc, DistParam& rcDistParam ); |
---|
222 | Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, DistParam& rcDistParam ); |
---|
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 |
---|
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 |
---|
230 | |
---|
231 | UInt calcHAD ( Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight ); |
---|
232 | |
---|
233 | // for motion cost |
---|
234 | #if !FIX203 |
---|
235 | Void initRateDistortionModel( Int iSubPelSearchLimit ); |
---|
236 | Void xUninit(); |
---|
237 | #endif |
---|
238 | UInt xGetComponentBits( Int iVal ); |
---|
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 ); |
---|
243 | |
---|
244 | } |
---|
245 | Void setPredictor( TComMv& rcMv ) |
---|
246 | { |
---|
247 | #if FIX203 |
---|
248 | m_mvPredictor = rcMv; |
---|
249 | #else |
---|
250 | m_puiHorCost = m_puiComponentCost - rcMv.getHor(); |
---|
251 | m_puiVerCost = m_puiComponentCost - rcMv.getVer(); |
---|
252 | #endif |
---|
253 | } |
---|
254 | Void setCostScale( Int iCostScale ) { m_iCostScale = iCostScale; } |
---|
255 | __inline UInt getCost( Int x, Int y ) |
---|
256 | { |
---|
257 | #if FIX203 |
---|
258 | return m_uiCost * getBits(x, y) >> 16; |
---|
259 | #else |
---|
260 | return (( m_uiCost * (m_puiHorCost[ x * (1<<m_iCostScale) ] + m_puiVerCost[ y * (1<<m_iCostScale) ]) ) >> 16); |
---|
261 | #endif |
---|
262 | } |
---|
263 | UInt getCost( UInt b ) { return ( m_uiCost * b ) >> 16; } |
---|
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 | } |
---|
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 | { |
---|
295 | #if FIX203 |
---|
296 | return m_uiLambdaMVReg * getBits(x, y) >> 16; |
---|
297 | #else |
---|
298 | return ( ( m_uiLambdaMVReg * ( m_puiHorRegCost[ x * ( 1 << m_iCostScale ) ] + m_puiVerRegCost[ y * ( 1 << m_iCostScale ) ] ) ) >> 16 ); |
---|
299 | #endif |
---|
300 | } |
---|
301 | |
---|
302 | private: |
---|
303 | |
---|
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 ); |
---|
311 | |
---|
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 ); |
---|
319 | |
---|
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 | |
---|
330 | #if AMP_SAD |
---|
331 | static UInt xGetSAD12 ( DistParam* pcDtParam ); |
---|
332 | static UInt xGetSAD24 ( DistParam* pcDtParam ); |
---|
333 | static UInt xGetSAD48 ( DistParam* pcDtParam ); |
---|
334 | |
---|
335 | #endif |
---|
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 ); |
---|
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 ); |
---|
346 | #endif |
---|
347 | |
---|
348 | public: |
---|
349 | #if HHI_INTERVIEW_SKIP |
---|
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 |
---|
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 |
---|
355 | UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_SSE ); |
---|
356 | #endif |
---|
357 | |
---|
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 | |
---|
363 | #if HHI_VSO |
---|
364 | private: |
---|
365 | Double m_dLambdaVSO; |
---|
366 | Double m_dSqrtLambdaVSO; |
---|
367 | UInt m_uiLambdaMotionSADVSO; |
---|
368 | UInt m_uiLambdaMotionSSEVSO; |
---|
369 | Double m_dFrameLambdaVSO; |
---|
370 | |
---|
371 | #if HHI_VSO_DIST_INT |
---|
372 | Bool m_bAllowNegDist; |
---|
373 | #endif |
---|
374 | #if SAIT_VSO_EST_A0033 |
---|
375 | TComPicYuv * m_pcVideoRecPicYuv; |
---|
376 | TComPicYuv * m_pcDepthPicYuv; |
---|
377 | Bool m_bUseEstimatedVSD; |
---|
378 | #endif |
---|
379 | #if LGE_WVSO_A0119 |
---|
380 | Int m_iDWeight; |
---|
381 | Int m_iVSOWeight; |
---|
382 | Int m_iVSDWeight; |
---|
383 | Bool m_bUseWVSO; |
---|
384 | #endif |
---|
385 | |
---|
386 | Bool m_bUseVSO; |
---|
387 | Bool m_bUseLambdaScaleVSO; |
---|
388 | UInt m_uiVSOMode; |
---|
389 | |
---|
390 | FpDistFuncVSO m_fpDistortFuncVSO; |
---|
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;}; |
---|
402 | #if SAIT_VSO_EST_A0033 |
---|
403 | Bool getUseEstimatedVSD( ) { return m_bUseEstimatedVSD; }; |
---|
404 | Void setUseEstimatedVSD( Bool bIn ) { m_bUseEstimatedVSD = bIn; }; |
---|
405 | |
---|
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 | |
---|
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; } |
---|
418 | #if LGE_WVSO_A0119 |
---|
419 | Void setUseWVSO ( Bool bIn ) { m_bUseWVSO = bIn; }; |
---|
420 | Bool getUseWVSO ( ) { return m_bUseWVSO;}; |
---|
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 |
---|
428 | #if HHI_VSO_DIST_INT |
---|
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 | |
---|
442 | #endif // HHI_VSO |
---|
443 | |
---|
444 | };// END CLASS DEFINITION TComRdCost |
---|
445 | |
---|
446 | //! \} |
---|
447 | |
---|
448 | #endif // __TCOMRDCOST__ |
---|