Ticket #315: 201202208-HM-5.1-dev-cleanup-r1867-qp-wrap.patch
File 201202208-HM-5.1-dev-cleanup-r1867-qp-wrap.patch, 3.8 KB (added by kchono, 11 years ago) |
---|
-
source/Lib/TLibCommon/TypeDef.h
269 269 #define SCALING_LIST 1 //JCTVC-G880/JCTVC-G1016 quantization matrices 270 270 #define SCALING_LIST_OUTPUT_RESULT 0 //JCTVC-G880/JCTVC-G1016 quantization matrices 271 271 272 #define FIX_QP_WRAP 1 //< Fix qp wrapping 273 #if FIX_QP_WRAP 274 #define SET_QP_BD_OFFSET_ZERO 1 //< This macro shall be set equal to 0 or removed when QpBdOffsetY and QpBdOffsetC issues are resolved. 275 #endif 276 272 277 // ==================================================================================================================== 273 278 // Basic type redefinition 274 279 // ==================================================================================================================== -
source/Lib/TLibDecoder/TDecCAVLC.cpp
1466 1466 Int iDQp; 1467 1467 1468 1468 xReadSvlc( iDQp ); 1469 1470 #if FIX_QP_WRAP 1471 UInt uiQpBdOffsetY = 6*(g_uiBitIncrement + g_uiBitDepth - 8); 1472 #if SET_QP_BD_OFFSET_ZERO 1473 uiQpBdOffsetY = 0; 1474 #endif 1475 uiQp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*uiQpBdOffsetY )%(52+uiQpBdOffsetY)) - uiQpBdOffsetY; 1476 #else 1469 1477 uiQp = pcCU->getRefQP( uiAbsPartIdx ) + iDQp; 1478 #endif 1470 1479 1471 1480 UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)))<<(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)) ; 1472 1481 UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; -
source/Lib/TLibDecoder/TDecSbac.cpp
1211 1211 { 1212 1212 UInt uiSign; 1213 1213 UInt uiQpBdOffsetY = 6*(g_uiBitIncrement + g_uiBitDepth - 8); 1214 #if SET_QP_BD_OFFSET_ZERO 1215 uiQpBdOffsetY = 0; 1216 #endif 1214 1217 m_pcTDecBinIf->decodeBinEP(uiSign); 1215 1218 1216 1219 UInt uiMaxAbsDQpMinus1 = 24 + (uiQpBdOffsetY/2) + (uiSign); … … 1223 1226 { 1224 1227 iDQp = -iDQp; 1225 1228 } 1229 1230 #if FIX_QP_WRAP 1231 uiDQp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*uiQpBdOffsetY )%(52+uiQpBdOffsetY)) - uiQpBdOffsetY; 1232 #else 1226 1233 uiDQp = pcCU->getRefQP(uiAbsPartIdx) + iDQp; 1234 #endif 1227 1235 1228 1236 } 1229 1237 -
source/Lib/TLibEncoder/TEncCavlc.cpp
1623 1623 { 1624 1624 Int iDQp = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx ); 1625 1625 1626 #if FIX_QP_WRAP 1627 UInt uiQpBdOffsetY = 6*(g_uiBitIncrement + g_uiBitDepth - 8); 1628 #if SET_QP_BD_OFFSET_ZERO 1629 uiQpBdOffsetY = 0; 1630 #endif 1631 iDQp = (iDQp + 78 + uiQpBdOffsetY + (uiQpBdOffsetY/2)) % (52 + uiQpBdOffsetY) - 26 - (uiQpBdOffsetY/2); 1632 #endif 1633 1626 1634 xWriteSvlc( iDQp ); 1627 1635 1628 1636 return; -
source/Lib/TLibEncoder/TEncSbac.cpp
1058 1058 { 1059 1059 Int iDQp = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx ); 1060 1060 1061 #if FIX_QP_WRAP 1062 { 1063 UInt uiQpBdOffsetY = 6*(g_uiBitIncrement + g_uiBitDepth - 8); 1064 #if SET_QP_BD_OFFSET_ZERO 1065 uiQpBdOffsetY = 0; 1066 #endif 1067 iDQp = (iDQp + 78 + uiQpBdOffsetY + (uiQpBdOffsetY/2)) % (52 + uiQpBdOffsetY) - 26 - (uiQpBdOffsetY/2); 1068 } 1069 #endif 1070 1061 1071 if ( iDQp == 0 ) 1062 1072 { 1063 1073 m_pcBinIf->encodeBin( 0, m_cCUDeltaQpSCModel.get( 0, 0, 0 ) );