Changeset 1287 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon/TComWeightPrediction.cpp
- Timestamp:
- 17 Jul 2015, 05:43:37 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComWeightPrediction.cpp
r1262 r1287 67 67 Void TComWeightPrediction::addWeightBi( const TComYuv *pcYuvSrc0, 68 68 const TComYuv *pcYuvSrc1, 69 const BitDepths &bitDepths, 69 70 const UInt iPartUnitIdx, 70 71 const UInt uiWidth, … … 73 74 const WPScalingParam *const wp1, 74 75 TComYuv *const rpcYuvDst, 75 const Bool bRoundLuma 76 const Bool bRoundLuma) 76 77 { 77 78 … … 91 92 const Int w0 = wp0[compID].w; 92 93 const Int offset = wp0[compID].offset; 93 const Int clipBD = g_bitDepth[toChannelType(compID)];94 const Int clipBD = bitDepths.recon[toChannelType(compID)]; 94 95 const Int shiftNum = std::max<Int>(2, (IF_INTERNAL_PREC - clipBD)); 95 96 const Int shift = wp0[compID].shift + shiftNum; … … 131 132 //! weighted averaging for uni-pred 132 133 Void TComWeightPrediction::addWeightUni( const TComYuv *const pcYuvSrc0, 134 const BitDepths &bitDepths, 133 135 const UInt iPartUnitIdx, 134 136 const UInt uiWidth, … … 149 151 const Int w0 = wp0[compID].w; 150 152 const Int offset = wp0[compID].offset; 151 const Int clipBD = g_bitDepth[toChannelType(compID)];153 const Int clipBD = bitDepths.recon[toChannelType(compID)]; 152 154 const Int shiftNum = std::max<Int>(2, (IF_INTERNAL_PREC - clipBD)); 153 155 const Int shift = wp0[compID].shift + shiftNum; … … 230 232 for ( Int yuv=0 ; yuv<numValidComponent ; yuv++ ) 231 233 { 232 const Int bitDepth = g_bitDepth[toChannelType(ComponentID(yuv))]; 234 #if SVC_EXTENSION 235 const Int bitDepth = pcSlice->getBitDepth(toChannelType(ComponentID(yuv))); 236 #else 237 const Int bitDepth = pcSlice->getSPS()->getBitDepth(toChannelType(ComponentID(yuv))); 238 #endif 233 239 const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (bitDepth-8)); 234 240 … … 251 257 for ( Int yuv=0 ; yuv<numValidComponent ; yuv++ ) 252 258 { 253 const Int bitDepth = g_bitDepth[toChannelType(ComponentID(yuv))]; 259 #if SVC_EXTENSION 260 const Int bitDepth = pcSlice->getBitDepth(toChannelType(ComponentID(yuv))); 261 #else 262 const Int bitDepth = pcSlice->getSPS()->getBitDepth(toChannelType(ComponentID(yuv))); 263 #endif 254 264 const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (bitDepth-8)); 255 265 … … 283 293 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 284 294 { 285 addWeightBi(pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst ); 295 #if SVC_EXTENSION 296 addWeightBi(pcYuvSrc0, pcYuvSrc1, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst ); 297 #else 298 addWeightBi(pcYuvSrc0, pcYuvSrc1, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst ); 299 #endif 286 300 } 287 301 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 288 302 { 289 addWeightUni( pcYuvSrc0, uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst ); 303 #if SVC_EXTENSION 304 addWeightUni( pcYuvSrc0, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst ); 305 #else 306 addWeightUni( pcYuvSrc0, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst ); 307 #endif 290 308 } 291 309 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 292 310 { 293 addWeightUni( pcYuvSrc1, uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst ); 311 #if SVC_EXTENSION 312 addWeightUni( pcYuvSrc1, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst ); 313 #else 314 addWeightUni( pcYuvSrc1, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst ); 315 #endif 294 316 } 295 317 else … … 327 349 getWpScaling(pcCU, -1, iRefIdx, pwpTmp, pwp); 328 350 } 329 addWeightUni( pcYuvSrc, uiPartAddr, iWidth, iHeight, pwp, pcYuvPred ); 330 } 351 #if SVC_EXTENSION 352 addWeightUni( pcYuvSrc, pcCU->getSlice()->getBitDepths(), uiPartAddr, iWidth, iHeight, pwp, pcYuvPred ); 353 #else 354 addWeightUni( pcYuvSrc, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartAddr, iWidth, iHeight, pwp, pcYuvPred ); 355 #endif 356 }
Note: See TracChangeset for help on using the changeset viewer.