Changeset 464 in 3DVCSoftware
- Timestamp:
- 11 Jun 2013, 20:35:00 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2a
- Files:
-
- 1 added
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2a/cfg/3D-HEVC/baseCfg_2view+depth.cfg
r446 r464 195 195 196 196 #========== multiview coding tools ========== 197 AdvMultiviewResPred : 1 # Advanced inter-view residual prediction (0:off, 1:on) 197 198 198 199 -
branches/HTM-DEV-0.3-dev2a/cfg/3D-HEVC/baseCfg_2view.cfg
r446 r464 149 149 RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP 150 150 151 #========== multiview coding tools ========== 152 AdvMultiviewResPred : 1 # Advanced inter-view residual prediction (0:off, 1:on) 153 151 154 ### DO NOT ADD ANYTHING BELOW THIS LINE ### 152 155 ### DO NOT DELETE THE EMPTY LINE BELOW ### -
branches/HTM-DEV-0.3-dev2a/cfg/3D-HEVC/baseCfg_3view+depth.cfg
r446 r464 194 194 195 195 #========== multiview coding tools ========== 196 AdvMultiviewResPred : 1 # Advanced inter-view residual prediction (0:off, 1:on) 196 197 197 198 -
branches/HTM-DEV-0.3-dev2a/cfg/3D-HEVC/baseCfg_3view.cfg
r446 r464 159 159 RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP 160 160 161 #========== multiview coding tools ========== 162 AdvMultiviewResPred : 1 # Advanced inter-view residual prediction (0:off, 1:on) 163 161 164 ### DO NOT ADD ANYTHING BELOW THIS LINE ### 162 165 ### DO NOT DELETE THE EMPTY LINE BELOW ### -
branches/HTM-DEV-0.3-dev2a/source/App/TAppDecoder/TAppDecTop.cpp
r456 r464 647 647 #if H_3D 648 648 m_tDecTop[ decIdx ]->setCamParsCollector( &m_cCamParsCollector ); 649 #if H_3D_ARP 650 m_tDecTop[ decIdx ]->setTAppDecTop(this); 651 #endif 649 652 #endif 650 653 -
branches/HTM-DEV-0.3-dev2a/source/App/TAppDecoder/TAppDecTop.h
r446 r464 91 91 Void decode (); ///< main decoding function 92 92 93 #if H_3D_ARP 94 TDecTop* getTDecTop ( Int layerId ) { return m_tDecTop[layerId]; } 95 #endif 96 93 97 protected: 94 98 Void xCreateDecLib (); ///< create internal classes -
branches/HTM-DEV-0.3-dev2a/source/App/TAppEncoder/TAppEncCfg.cpp
r446 r464 503 503 #if L0386_DB_METRIC 504 504 ("DeblockingFilterMetric", m_DeblockingFilterMetric, false ) 505 #endif 506 507 #if H_3D_ARP 508 ("AdvMultiviewResPred", m_uiUseAdvResPred, (UInt)1, "Usage of Advanced Residual Prediction" ) 505 509 #endif 506 510 … … 1387 1391 xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); 1388 1392 xConfirmPara( m_maxNumMergeCand > 5, "MaxNumMergeCand must be 5 or smaller."); 1393 1394 #if H_3D_ARP 1395 xConfirmPara( ( 0 != m_uiUseAdvResPred ) && ( 1 != m_uiUseAdvResPred ), "UseAdvResPred must be 0 or 1." ); 1396 #endif 1389 1397 1390 1398 #if ADAPTIVE_QP_SELECTION … … 2278 2286 printf("WVSO:%d ", m_bUseWVSO ); 2279 2287 #endif 2288 #if H_3D_ARP 2289 printf(" ARP:%d ", m_uiUseAdvResPred ); 2290 #endif 2280 2291 printf("\n\n"); 2281 2292 -
branches/HTM-DEV-0.3-dev2a/source/App/TAppEncoder/TAppEncCfg.h
r446 r464 238 238 Bool m_bUseFastEnc; ///< flag for using fast encoder setting 239 239 Bool m_bUseEarlyCU; ///< flag for using Early CU setting 240 241 #if H_3D_ARP 242 UInt m_uiUseAdvResPred; 243 UInt m_uiARPStepNum; 244 #endif 245 240 246 Bool m_useFastDecisionForMerge; ///< flag for using Fast Decision Merge RD-Cost 241 247 Bool m_bUseCbfFastMode; ///< flag for using Cbf Fast PU Mode Decision -
branches/HTM-DEV-0.3-dev2a/source/App/TAppEncoder/TAppEncTop.cpp
r446 r464 122 122 vps.initViewIndex(); 123 123 m_ivPicLists.setVPS ( &vps ); 124 #if H_3D_ARP 125 for(Int i = 0; i < m_numberOfLayers; i++) 126 { 127 Bool isDepth = vps.getDepthId( i ); 128 vps.setUseAdvRP ( i, ( isDepth || 0==i ) ? 0 : m_uiUseAdvResPred ); 129 vps.setARPStepNum ( i, ( isDepth || 0==i ) ? 1 : H_3D_ARP_WFNR ); 130 } 131 #endif 124 132 #endif 125 133 … … 166 174 m_cTEncTop.setDWeight ( isDepth ? m_iDWeight : 0 ); 167 175 #endif // H_3D_VSO 176 #if H_3D_ARP 177 //====== Advanced Inter-view Residual Prediction ========= 178 m_cTEncTop.setUseAdvRP ( ( isDepth || 0==layer ) ? 0 : m_uiUseAdvResPred ); 179 m_cTEncTop.setARPStepNum ( ( isDepth || 0==layer ) ? 1 : H_3D_ARP_WFNR ); 180 #endif 168 181 #endif // H_3D 169 182 … … 605 618 { 606 619 m_acTEncTopList[layer]->init( ); 620 #if H_3D_ARP 621 m_acTEncTopList[layer]->setTAppEncTop( this ); 622 #endif 607 623 } 608 624 #else -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/ContextTables.h
r324 r464 95 95 #define NUM_TRANSFORMSKIP_FLAG_CTX 1 ///< number of context models for transform skipping 96 96 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX 1 97 98 #if H_3D_ARP 99 #define NUM_ARPW_CTX 4 ///< number of context models for weighting factor index used by advanced residual prediction 100 #endif 101 97 102 #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' 98 103 … … 334 339 { 139, 139}, 335 340 }; 341 342 #if H_3D_ARP 343 static const UChar 344 INIT_ARPW[3][NUM_ARPW_CTX] = 345 { 346 { 154, 154, 154, 154 }, 347 { 154, 154, 154, 154 }, 348 { 154, 154, 154, 154 }, 349 }; 350 #endif 336 351 //! \} 337 352 -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComDataCU.cpp
r456 r464 115 115 m_pDvInfo = NULL; 116 116 #endif 117 118 #if H_3D_ARP 119 m_puhARPW = NULL; 120 #endif 117 121 } 118 122 … … 208 212 m_acCUMvField[1].create( uiNumPartition ); 209 213 214 #if H_3D_ARP 215 m_puhARPW = new UChar[ uiNumPartition]; 216 #endif 210 217 } 211 218 else … … 293 300 if ( m_pDvInfo ) { xFree(m_pDvInfo); m_pDvInfo = NULL; } 294 301 #endif 302 303 #if H_3D_ARP 304 if ( m_puhARPW ) { delete[] m_puhARPW; m_puhARPW = NULL; } 305 #endif 306 295 307 m_acCUMvField[0].destroy(); 296 308 m_acCUMvField[1].destroy(); … … 402 414 m_CUTransquantBypass[ui] = pcFrom->getCUTransquantBypass(ui); 403 415 m_puhDepth[ui] = pcFrom->getDepth(ui); 416 #if H_3D_ARP 417 m_puhARPW [ui] = pcFrom->getARPW( ui ); 418 #endif 404 419 m_puhWidth [ui] = pcFrom->getWidth(ui); 405 420 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 455 470 memset( m_puhCbf[2] + firstElement, 0, numElements * sizeof( *m_puhCbf[2] ) ); 456 471 memset( m_pbIPCMFlag + firstElement, false, numElements * sizeof( *m_pbIPCMFlag ) ); 472 #if H_3D_ARP 473 memset( m_puhARPW + firstElement, 0, numElements * sizeof( UChar ) ); 474 #endif 457 475 } 458 476 … … 590 608 m_puhCbf[1][ui] = 0; 591 609 m_puhCbf[2][ui] = 0; 610 #if H_3D_ARP 611 m_puhARPW[ui] = 0; 612 #endif 592 613 } 593 614 } … … 662 683 #if H_3D_NBDV 663 684 m_pDvInfo->bDV = false; 685 #endif 686 #if H_3D_ARP 687 memset( m_puhARPW, 0, iSizeInUchar ); 664 688 #endif 665 689 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; … … 706 730 m_puhCbf[2][ui]=pcCU->m_puhCbf[2][uiPartOffset+ui]; 707 731 732 #if H_3D_ARP 733 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 734 #endif 708 735 } 709 736 } … … 816 843 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 817 844 845 #if H_3D_ARP 846 m_puhARPW = pcCU->getARPW() + uiPart; 847 #endif 848 818 849 m_puhLumaIntraDir = pcCU->getLumaIntraDir() + uiPart; 819 850 m_puhChromaIntraDir = pcCU->getChromaIntraDir() + uiPart; … … 932 963 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 933 964 965 #if H_3D_ARP 966 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 967 #endif 968 934 969 m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx ); 935 970 … … 1019 1054 memcpy( m_sliceStartCU + uiOffset, pcCU->m_sliceStartCU, sizeof( UInt ) * uiNumPartition ); 1020 1055 memcpy( m_sliceSegmentStartCU + uiOffset, pcCU->m_sliceSegmentStartCU, sizeof( UInt ) * uiNumPartition ); 1056 1057 #if H_3D_ARP 1058 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1059 #endif 1021 1060 } 1022 1061 … … 1094 1133 memcpy( rpcCU->m_sliceStartCU + m_uiAbsIdxInLCU, m_sliceStartCU, sizeof( UInt ) * m_uiNumPartition ); 1095 1134 memcpy( rpcCU->m_sliceSegmentStartCU + m_uiAbsIdxInLCU, m_sliceSegmentStartCU, sizeof( UInt ) * m_uiNumPartition ); 1135 1136 #if H_3D_ARP 1137 memcpy( rpcCU->getARPW() + m_uiAbsIdxInLCU, m_puhARPW, iSizeInUchar ); 1138 #endif 1096 1139 } 1097 1140 … … 1166 1209 memcpy( rpcCU->m_sliceStartCU + uiPartOffset, m_sliceStartCU, sizeof( UInt ) * uiQNumPart ); 1167 1210 memcpy( rpcCU->m_sliceSegmentStartCU + uiPartOffset, m_sliceSegmentStartCU, sizeof( UInt ) * uiQNumPart ); 1211 1212 #if H_3D_ARP 1213 memcpy( rpcCU->getARPW() + uiPartOffset, m_puhARPW, iSizeInUchar ); 1214 #endif 1168 1215 } 1169 1216 … … 1807 1854 return uiCtx; 1808 1855 } 1856 1857 #if H_3D_ARP 1858 UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx ) 1859 { 1860 TComDataCU* pcTempCU; 1861 UInt uiTempPartIdx; 1862 UInt uiCtx = 0; 1863 1864 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 1865 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 1866 1867 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 1868 uiCtx += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0; 1869 1870 return uiCtx; 1871 } 1872 #endif 1809 1873 1810 1874 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) … … 4246 4310 } 4247 4311 #endif 4312 #if H_3D_ARP 4313 Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ) 4314 { 4315 assert( sizeof( *m_puhARPW) == 1 ); 4316 memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) ); 4317 } 4318 #endif 4248 4319 //! \} -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComDataCU.h
r455 r464 49 49 #include "TComPattern.h" 50 50 51 #if H_3D_ARP 52 #include "TComYuv.h" 53 #endif 54 51 55 #include <algorithm> 52 56 #include <vector> … … 190 194 DisInfo* m_pDvInfo; 191 195 #endif 196 #if H_3D_ARP 197 UChar* m_puhARPW; 198 #endif 192 199 // ------------------------------------------------------------------------------------------------------------------- 193 200 // misc. variables … … 220 227 221 228 /// compute scaling factor from POC difference 229 #if !H_3D_ARP 222 230 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 223 231 #endif 232 224 233 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 225 234 … … 231 240 // create / destroy / initialize / copy 232 241 // ------------------------------------------------------------------------------------------------------------------- 233 242 #if H_3D_ARP 243 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 244 #endif 234 245 Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize 235 246 #if ADAPTIVE_QP_SELECTION … … 434 445 435 446 #endif 447 448 #if H_3D_ARP 449 UChar* getARPW () { return m_puhARPW; } 450 UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } 451 Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } 452 Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); 453 Double getARPWFactor ( UInt uiIdx ); 454 #endif 436 455 // ------------------------------------------------------------------------------------------------------------------- 437 456 // member functions for accessing partition information … … 539 558 UInt getCtxInterDir ( UInt uiAbsPartIdx ); 540 559 560 #if H_3D_ARP 561 UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); 562 #endif 563 541 564 UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } 542 565 UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComInterpolationFilter.cpp
r324 r464 73 73 }; 74 74 75 #if H_3D_ARP 76 const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] = 77 { 78 {64, 0}, 79 {48, 16}, 80 {32, 32}, 81 {16, 48} 82 }; 83 const Short TComInterpolationFilter::m_chromaFilterARP[8][NTAPS_CHROMA_ARP] = 84 { 85 {64, 0}, 86 {56, 8}, 87 {48, 16}, 88 {40, 24}, 89 {32, 32}, 90 {24, 40}, 91 {16, 48}, 92 {8, 56} 93 }; 94 #endif 95 75 96 // ==================================================================================================================== 76 97 // Private member functions … … 325 346 * \param isLast Flag indicating whether it is the last filtering operation 326 347 */ 327 Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ) 348 Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 349 #if H_3D_ARP 350 , Bool filterType 351 #endif 352 ) 328 353 { 329 354 assert(frac >= 0 && frac < 4); … … 335 360 else 336 361 { 362 #if H_3D_ARP 363 if(filterType) 364 { 365 filterHor<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]); 366 } 367 else 368 { 369 #endif 337 370 filterHor<NTAPS_LUMA>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); 371 #if H_3D_ARP 372 } 373 #endif 338 374 } 339 375 } … … 352 388 * \param isLast Flag indicating whether it is the last filtering operation 353 389 */ 354 Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ) 390 Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 391 #if H_3D_ARP 392 , Bool filterType 393 #endif 394 ) 355 395 { 356 396 assert(frac >= 0 && frac < 4); … … 362 402 else 363 403 { 404 #if H_3D_ARP 405 if(filterType) 406 { 407 filterVer<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]); 408 } 409 else 410 { 411 #endif 364 412 filterVer<NTAPS_LUMA>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]); 413 #if H_3D_ARP 414 } 415 #endif 365 416 } 366 417 } … … 378 429 * \param isLast Flag indicating whether it is the last filtering operation 379 430 */ 380 Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ) 431 Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 432 #if H_3D_ARP 433 , Bool filterType 434 #endif 435 ) 381 436 { 382 437 assert(frac >= 0 && frac < 8); … … 388 443 else 389 444 { 445 #if H_3D_ARP 446 if(filterType) 447 { 448 filterHor<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]); 449 } 450 else 451 { 452 #endif 390 453 filterHor<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac]); 454 #if H_3D_ARP 455 } 456 #endif 391 457 } 392 458 } … … 405 471 * \param isLast Flag indicating whether it is the last filtering operation 406 472 */ 407 Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ) 473 Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 474 #if H_3D_ARP 475 , Bool filterType 476 #endif 477 ) 408 478 { 409 479 assert(frac >= 0 && frac < 8); … … 415 485 else 416 486 { 487 #if H_3D_ARP 488 if(filterType) 489 { 490 filterVer<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]); 491 } 492 else 493 { 494 #endif 417 495 filterVer<NTAPS_CHROMA>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]); 496 #if H_3D_ARP 497 } 498 #endif 418 499 } 419 500 } -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComInterpolationFilter.h
r324 r464 45 45 //! \{ 46 46 47 #if H_3D_ARP 48 #define NTAPS_LUMA_ARP 2 ///< Number of taps for luma 49 #define NTAPS_CHROMA_ARP 2 ///< Number of taps for chroma 50 #endif 51 47 52 #define NTAPS_LUMA 8 ///< Number of taps for luma 48 53 #define NTAPS_CHROMA 4 ///< Number of taps for chroma … … 58 63 static const Short m_lumaFilter[4][NTAPS_LUMA]; ///< Luma filter taps 59 64 static const Short m_chromaFilter[8][NTAPS_CHROMA]; ///< Chroma filter taps 60 65 #if H_3D_ARP 66 static const Short m_lumaFilterARP [4][NTAPS_LUMA_ARP]; ///< Luma filter taps for ARP 67 static const Short m_chromaFilterARP[8][NTAPS_CHROMA_ARP]; ///< Chroma filter taps for ARP 68 #endif 61 69 static Void filterCopy(Int bitDepth, const Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Bool isFirst, Bool isLast); 62 70 … … 73 81 ~TComInterpolationFilter() {} 74 82 75 Void filterHorLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ); 76 Void filterVerLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ); 77 Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ); 78 Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ); 83 Void filterHorLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 84 #if H_3D_ARP 85 , Bool filterType = false 86 #endif 87 ); 88 Void filterVerLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 89 #if H_3D_ARP 90 , Bool filterType = false 91 #endif 92 ); 93 Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 94 #if H_3D_ARP 95 , Bool filterType = false 96 #endif 97 ); 98 Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 99 #if H_3D_ARP 100 , Bool filterType = false 101 #endif 102 ); 79 103 }; 80 104 -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComPrediction.cpp
r446 r464 63 63 m_cYuvPredTemp.destroy(); 64 64 65 #if H_3D_ARP 66 m_acYuvPredBase[0].destroy(); 67 m_acYuvPredBase[1].destroy(); 68 #endif 69 65 70 if( m_pLumaRecBuffer ) 66 71 { … … 103 108 104 109 m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE ); 110 #if H_3D_ARP 111 m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 112 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 113 #endif 105 114 } 106 115 … … 485 494 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 486 495 pcCU->clipMv(cMv); 496 #if H_3D_ARP 497 if( pcCU->getARPW( uiPartAddr ) > 0 498 && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N 499 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() 500 ) 501 { 502 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi ); 503 } 504 else 505 { 506 #endif 487 507 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 488 508 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 489 } 509 #if H_3D_ARP 510 } 511 #endif 512 } 513 514 #if H_3D_ARP 515 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 516 { 517 Int iRefIdx = pNewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 518 TComMv cMv = pNewMvFiled ? pNewMvFiled->getMv() : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 519 Bool bTobeScaled = false; 520 TComPic* pcPicYuvBaseCol = NULL; 521 TComPic* pcPicYuvBaseRef = NULL; 522 523 #if H_3D_NBDV 524 DisInfo cDistparity; 525 cDistparity.bDV = pcCU->getDvInfo(uiPartAddr).bDV; 526 if( cDistparity.bDV ) 527 { 528 cDistparity.m_acNBDV = pcCU->getDvInfo(0).m_acNBDV; 529 assert(pcCU->getDvInfo(uiPartAddr).bDV == pcCU->getDvInfo(0).bDV); 530 cDistparity.m_aVIdxCan = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; 531 } 532 #else 533 assert(0); // ARP can be applied only when a DV is available 534 #endif 535 536 UChar dW = cDistparity.bDV ? pcCU->getARPW ( uiPartAddr ) : 0; 537 538 if( cDistparity.bDV ) 539 { 540 if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC()!= pcCU->getSlice()->getPOC() ) 541 { 542 bTobeScaled = true; 543 } 544 545 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 546 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC(), cDistparity.m_aVIdxCan ); 547 548 if( ( !pcPicYuvBaseCol || pcPicYuvBaseCol->getPOC() != pcCU->getSlice()->getPOC() ) || ( !pcPicYuvBaseRef || pcPicYuvBaseRef->getPOC() != pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ) ) 549 { 550 dW = 0; 551 bTobeScaled = false; 552 } 553 else 554 { 555 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ); 556 } 557 558 if(bTobeScaled) 559 { 560 Int iCurrPOC = pcCU->getSlice()->getPOC(); 561 Int iColRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ); 562 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, 0); 563 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC); 564 if ( iScale != 4096 ) 565 { 566 cMv = cMv.scaleMv( iScale ); 567 } 568 iRefIdx = 0; 569 } 570 } 571 572 pcCU->clipMv(cMv); 573 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(); 574 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true ); 575 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true ); 576 577 if( dW > 0 ) 578 { 579 TComYuv * pYuvB0 = &m_acYuvPredBase[0]; 580 TComYuv * pYuvB1 = &m_acYuvPredBase[1]; 581 582 TComMv cMVwithDisparity = cMv + cDistparity.m_acNBDV; 583 pcCU->clipMv(cMVwithDisparity); 584 585 assert ( cDistparity.bDV ); 586 587 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); 588 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true ); 589 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true ); 590 591 pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec(); 592 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true ); 593 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true ); 594 595 pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight ); 596 597 if( 2 == dW ) 598 { 599 pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 600 } 601 602 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi ); 603 } 604 } 605 #endif 490 606 491 607 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ) … … 551 667 * \param bi Flag indicating whether bipred is used 552 668 */ 553 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 669 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 670 #if H_3D_ARP 671 , Bool filterType 672 #endif 673 ) 554 674 { 555 675 Int refStride = refPic->getStride(); … … 565 685 if ( yFrac == 0 ) 566 686 { 567 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi ); 687 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi 688 #if H_3D_ARP 689 , filterType 690 #endif 691 ); 568 692 } 569 693 else if ( xFrac == 0 ) 570 694 { 571 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi ); 695 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi 696 #if H_3D_ARP 697 , filterType 698 #endif 699 ); 572 700 } 573 701 else … … 579 707 Int halfFilterSize = ( filterSize >> 1 ); 580 708 581 m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false ); 582 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi); 709 m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false 710 #if H_3D_ARP 711 , filterType 712 #endif 713 ); 714 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi 715 #if H_3D_ARP 716 , filterType 717 #endif 718 ); 583 719 } 584 720 } … … 596 732 * \param bi Flag indicating whether bipred is used 597 733 */ 598 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 734 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 735 #if H_3D_ARP 736 , Bool filterType 737 #endif 738 ) 599 739 { 600 740 Int refStride = refPic->getCStride(); … … 623 763 if ( yFrac == 0 ) 624 764 { 625 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi); 626 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi); 765 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi 766 #if H_3D_ARP 767 , filterType 768 #endif 769 ); 770 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi 771 #if H_3D_ARP 772 , filterType 773 #endif 774 ); 627 775 } 628 776 else if ( xFrac == 0 ) 629 777 { 630 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi); 631 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi); 778 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi 779 #if H_3D_ARP 780 , filterType 781 #endif 782 ); 783 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi 784 #if H_3D_ARP 785 , filterType 786 #endif 787 ); 632 788 } 633 789 else 634 790 { 635 m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false); 636 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 791 m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false 792 #if H_3D_ARP 793 , filterType 794 #endif 795 ); 796 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi 797 #if H_3D_ARP 798 , filterType 799 #endif 800 ); 637 801 638 m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false); 639 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 802 m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false 803 #if H_3D_ARP 804 , filterType 805 #endif 806 ); 807 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi 808 #if H_3D_ARP 809 , filterType 810 #endif 811 ); 640 812 } 641 813 } -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComPrediction.h
r324 r464 65 65 TComYuv m_acYuvPred[2]; 66 66 TComYuv m_cYuvPredTemp; 67 #if H_3D_ARP 68 TComYuv m_acYuvPredBase[2]; 69 #endif 67 70 TComYuv m_filteredBlock[4][4]; 68 71 TComYuv m_filteredBlockTmp[4]; … … 77 80 78 81 // motion compensation functions 82 #if H_3D_ARP 83 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL ); 84 #endif 79 85 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false ); 80 86 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ); 81 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 82 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 87 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 88 #if H_3D_ARP 89 , Bool filterType = false 90 #endif 91 ); 92 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 93 #if H_3D_ARP 94 , Bool filterType = false 95 #endif 96 ); 83 97 Void xWeightedAverage ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 84 98 -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComSlice.cpp
r446 r464 1486 1486 m_dimensionId[i][j] = 0; 1487 1487 } 1488 1489 #if H_3D_ARP 1490 m_uiUseAdvResPred[i] = 0; 1491 m_uiARPStepNum[i] = 1; 1492 #endif 1488 1493 } 1489 1494 #endif … … 2257 2262 } 2258 2263 } 2264 2265 #if H_3D_ARP 2266 Void TComSlice::setARPStepNum() 2267 { 2268 Bool bAllIvRef = true; 2269 2270 if(!getVPS()->getUseAdvRP(getLayerId())) 2271 { 2272 m_nARPStepNum = 0; 2273 } 2274 else 2275 { 2276 for( Int iRefListId = 0; iRefListId < 2; iRefListId++ ) 2277 { 2278 RefPicList eRefPicList = RefPicList( iRefListId ); 2279 Int iNumRefIdx = getNumRefIdx(eRefPicList); 2280 2281 if( iNumRefIdx <= 0 ) 2282 { 2283 continue; 2284 } 2285 2286 for ( Int i = 0; i < iNumRefIdx; i++ ) 2287 { 2288 if( getRefPic( eRefPicList, i)->getPOC() != getPOC() ) 2289 { 2290 bAllIvRef = false; 2291 break; 2292 } 2293 } 2294 2295 if( bAllIvRef == false ) { break; } 2296 } 2297 m_nARPStepNum = !bAllIvRef ? getVPS()->getARPStepNum(getLayerId()) : 0; 2298 } 2299 } 2300 #endif 2259 2301 #endif 2260 2302 /** get scaling matrix from RefMatrixID -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComSlice.h
r446 r464 524 524 #if H_3D 525 525 Int m_viewIndex [MAX_NUM_LAYERS ]; 526 #if H_3D_ARP 527 UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; 528 UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; 529 #endif 526 530 #endif 527 531 … … 642 646 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } 643 647 Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 648 #if H_3D_ARP 649 UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } 650 UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } 651 Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } 652 Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } 653 #endif 644 654 #endif 645 655 … … 1486 1496 Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; 1487 1497 Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; 1498 #if H_3D_ARP 1499 TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; 1500 UInt m_nARPStepNum; 1501 #endif 1488 1502 #endif 1489 1503 #endif … … 1611 1625 #endif 1612 1626 #endif 1627 1628 #if H_3D_ARP 1629 Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } 1630 Void setARPStepNum(); 1631 TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } 1632 UInt getARPStepNum( ) { return m_nARPStepNum; } 1633 #endif 1634 1613 1635 Void setRefPOCList (); 1614 1636 Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComYuv.cpp
r446 r464 661 661 } 662 662 } 663 664 #if H_3D_ARP 665 Void TComYuv::addARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip ) 666 { 667 addARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight , bClip ); 668 addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip ); 669 } 670 671 Void TComYuv::addARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip ) 672 { 673 Int x, y; 674 675 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx ); 676 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx ); 677 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 678 679 UInt iSrc0Stride = pcYuvSrc0->getStride(); 680 UInt iSrc1Stride = pcYuvSrc1->getStride(); 681 UInt iDstStride = getStride(); 682 for ( y = uiHeight-1; y >= 0; y-- ) 683 { 684 for ( x = uiWidth-1; x >= 0; x-- ) 685 { 686 pDst[x] = pSrc0[x] + pSrc1[x]; 687 if( bClip ) 688 { 689 pDst[x] = ClipY( pDst[x] ); 690 } 691 } 692 pSrc0 += iSrc0Stride; 693 pSrc1 += iSrc1Stride; 694 pDst += iDstStride; 695 } 696 } 697 698 Void TComYuv::addARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip ) 699 { 700 Int x, y; 701 702 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx ); 703 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx ); 704 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx ); 705 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx ); 706 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 707 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 708 709 UInt iSrc0Stride = pcYuvSrc0->getCStride(); 710 UInt iSrc1Stride = pcYuvSrc1->getCStride(); 711 UInt iDstStride = getCStride(); 712 for ( y = uiHeight-1; y >= 0; y-- ) 713 { 714 for ( x = uiWidth-1; x >= 0; x-- ) 715 { 716 pDstU[x] = pSrcU0[x] + pSrcU1[x]; 717 pDstV[x] = pSrcV0[x] + pSrcV1[x]; 718 if( bClip ) 719 { 720 pDstU[x] = ClipC( pDstU[x] ); 721 pDstV[x] = ClipC( pDstV[x] ); 722 } 723 } 724 725 pSrcU0 += iSrc0Stride; 726 pSrcU1 += iSrc1Stride; 727 pSrcV0 += iSrc0Stride; 728 pSrcV1 += iSrc1Stride; 729 pDstU += iDstStride; 730 pDstV += iDstStride; 731 } 732 } 733 734 Void TComYuv::subtractARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 735 { 736 subtractARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight ); 737 subtractARPChroma( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 ); 738 } 739 740 Void TComYuv::subtractARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 741 { 742 Int x, y; 743 744 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx ); 745 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx ); 746 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 747 748 Int iSrc0Stride = pcYuvSrc0->getStride(); 749 Int iSrc1Stride = pcYuvSrc1->getStride(); 750 Int iDstStride = getStride(); 751 for ( y = uiHeight-1; y >= 0; y-- ) 752 { 753 for ( x = uiWidth-1; x >= 0; x-- ) 754 { 755 pDst[x] = pSrc0[x] - pSrc1[x]; 756 } 757 pSrc0 += iSrc0Stride; 758 pSrc1 += iSrc1Stride; 759 pDst += iDstStride; 760 } 761 } 762 763 Void TComYuv::subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 764 { 765 Int x, y; 766 767 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx ); 768 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx ); 769 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx ); 770 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx ); 771 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 772 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 773 774 Int iSrc0Stride = pcYuvSrc0->getCStride(); 775 Int iSrc1Stride = pcYuvSrc1->getCStride(); 776 Int iDstStride = getCStride(); 777 for ( y = uiHeight-1; y >= 0; y-- ) 778 { 779 for ( x = uiWidth-1; x >= 0; x-- ) 780 { 781 pDstU[x] = pSrcU0[x] - pSrcU1[x]; 782 pDstV[x] = pSrcV0[x] - pSrcV1[x]; 783 } 784 pSrcU0 += iSrc0Stride; 785 pSrcU1 += iSrc1Stride; 786 pSrcV0 += iSrc0Stride; 787 pSrcV1 += iSrc1Stride; 788 pDstU += iDstStride; 789 pDstV += iDstStride; 790 } 791 } 792 793 Void TComYuv::multiplyARP( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 794 { 795 multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW ); 796 multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW ); 797 } 798 799 Void TComYuv::xxMultiplyLine( Pel* pSrcDst , UInt uiWidth , UChar dW ) 800 { 801 assert( dW == 2 ); 802 for( UInt x = 0 ; x < uiWidth ; x++ ) 803 pSrcDst[x] = pSrcDst[x] >> 1; 804 } 805 806 Void TComYuv::multiplyARPLuma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 807 { 808 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 809 Int iDstStride = getStride(); 810 for ( Int y = uiHeight-1; y >= 0; y-- ) 811 { 812 xxMultiplyLine( pDst , uiWidth , dW ); 813 pDst += iDstStride; 814 } 815 } 816 817 Void TComYuv::multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 818 { 819 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 820 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 821 822 Int iDstStride = getCStride(); 823 for ( Int y = uiHeight-1; y >= 0; y-- ) 824 { 825 xxMultiplyLine( pDstU , uiWidth , dW ); 826 xxMultiplyLine( pDstV , uiWidth , dW ); 827 pDstU += iDstStride; 828 pDstV += iDstStride; 829 } 830 } 831 #endif 663 832 #endif 664 833 //! \} -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TComYuv.h
r446 r464 182 182 #if H_3D 183 183 Void addClipPartLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 184 185 #if H_3D_ARP 186 Void addARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 187 Void addARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 188 Void addARPChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 189 Void subtractARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 190 Void subtractARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 191 Void subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 192 Void multiplyARP ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 193 Void multiplyARPLuma ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 194 Void multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 195 private: 196 Void xxMultiplyLine( Pel * pSrcDst , UInt uiWidth , UChar dW ); 184 197 #endif 198 #endif 185 199 186 200 };// END CLASS DEFINITION TComYuv -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibCommon/TypeDef.h
r456 r464 89 89 // QC_CU_NBDV_D0181 90 90 // SEC_DEFAULT_DV_D0112 91 92 #define H_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177 91 93 #endif 92 94 … … 115 117 #define DVFROM_ABOVELEFT 5 116 118 #endif 119 120 ///// ***** ADVANCED INTERVIEW RESIDUAL PREDICTION ********* 121 #if H_3D_ARP 122 #define H_3D_ARP_WFNR 3 123 #endif 124 117 125 ///////////////////////////////////////////////////////////////////////////////////////// 118 126 /////////////////////////////////// HM RELATED DEFINES //////////////////////////////// -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecCAVLC.cpp
r446 r464 950 950 } 951 951 952 #if H_3D_ARP 953 for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ ) 954 { 955 if( ( layer!=0 ) && ( pcVPS->getDepthId(layer)!=1 ) ) 956 { 957 READ_FLAG( uiCode, "advanced_residual_pred_flag" ); 958 pcVPS->setUseAdvRP ( layer, uiCode ); 959 pcVPS->setARPStepNum( layer, uiCode ? H_3D_ARP_WFNR : 1 ); 960 } 961 else 962 { 963 pcVPS->setUseAdvRP ( layer, 0 ); 964 pcVPS->setARPStepNum( layer, 1 ); 965 } 966 } 967 #endif 968 952 969 READ_FLAG( uiCode, "vps_extension2_flag" ); 953 970 if (uiCode) … … 1860 1877 } 1861 1878 1879 #if H_3D_ARP 1880 Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1881 { 1882 assert(0); 1883 } 1884 #endif 1885 1862 1886 // ==================================================================================================================== 1863 1887 // Protected member functions -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecCAVLC.h
r446 r464 99 99 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 100 100 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 101 #if H_3D_ARP 102 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 103 #endif 101 104 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 102 105 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecCu.cpp
r455 r464 281 281 if(!pcCU->getSlice()->isIntra()) 282 282 { 283 #if H_3D_ARP 284 if( pcCU->getSlice()->getVPS()->getUseAdvRP( pcCU->getSlice()->getLayerId() ) ) 285 #else 283 286 if(pcCU->getSlice()->getViewIndex() && !pcCU->getSlice()->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 287 #endif 284 288 { 285 289 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true ); … … 343 347 } 344 348 } 349 #if H_3D_ARP 350 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 351 #endif 345 352 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 346 353 return; … … 366 373 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 367 374 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 368 375 #if H_3D_ARP 376 m_pcEntropyDecoder->decodeARPW ( pcCU , uiAbsPartIdx , uiDepth ); 377 #endif 369 378 // Coefficient decoding 370 379 Bool bCodeDQP = getdQPFlag(); -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecEntropy.cpp
r324 r464 87 87 } 88 88 89 #if H_3D_ARP 90 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 91 { 92 if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) 93 { 94 return; 95 } 96 97 if( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 98 { 99 pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 100 } 101 else 102 { 103 m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth ); 104 } 105 } 106 #endif 107 89 108 Void TDecEntropy::decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 90 109 { -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecEntropy.h
r446 r464 85 85 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; 86 86 virtual Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ) = 0; 87 #if H_3D_ARP 88 virtual Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 89 #endif 87 90 virtual Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 88 91 virtual Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 154 157 Void decodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 155 158 159 #if H_3D_ARP 160 Void decodeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 161 #endif 162 156 163 Void decodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 157 164 -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecSbac.cpp
r324 r464 54 54 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 55 55 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 56 #if H_3D_ARP 57 , m_cCUPUARPW ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels) 58 #endif 56 59 , m_cCUPartSizeSCModel ( 1, 1, NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 57 60 , m_cCUPredModeSCModel ( 1, 1, NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 113 116 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 114 117 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); 118 #if H_3D_ARP 119 m_cCUPUARPW.initBuffer ( sliceType, qp, (UChar*)INIT_ARPW ); 120 #endif 115 121 m_cCUPartSizeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PART_SIZE ); 116 122 m_cCUAMPSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_AMP_POS ); … … 158 164 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT ); 159 165 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT ); 166 #if H_3D_ARP 167 m_cCUPUARPW.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 168 #endif 160 169 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 161 170 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 1551 1560 xCopyContextsFrom(pScr); 1552 1561 } 1562 1563 #if H_3D_ARP 1564 Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1565 { 1566 UInt uiMaxW = pcCU->getSlice()->getARPStepNum() - 1; 1567 UInt uiW = 0; 1568 UInt uiOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx); 1569 UInt uiCode = 0; 1570 1571 assert ( uiMaxW > 0 ); 1572 1573 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 0 + uiOffset ) ); 1574 1575 uiW = uiCode; 1576 if( 1 == uiW ) 1577 { 1578 m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 3 ) ); 1579 uiW += ( 1 == uiCode ? 1 : 0 ); 1580 } 1581 pcCU->setARPWSubParts( ( UChar )( uiW ) , uiAbsPartIdx, uiDepth ); 1582 } 1583 #endif 1553 1584 //! \} -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecSbac.h
r446 r464 108 108 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 109 109 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 110 #if H_3D_ARP 111 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 112 #endif 110 113 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 111 114 Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 145 148 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 146 149 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 150 #if H_3D_ARP 151 ContextModel3DBuffer m_cCUPUARPW; 152 #endif 147 153 ContextModel3DBuffer m_cCUPartSizeSCModel; 148 154 ContextModel3DBuffer m_cCUPredModeSCModel; -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecTop.cpp
r446 r464 37 37 38 38 #include "NALread.h" 39 #if H_3D_ARP 40 #include "../../App/TAppDecoder/TAppDecTop.h" 41 #endif 39 42 #include "TDecTop.h" 40 43 … … 886 889 #if H_MV 887 890 pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true ); 891 #if H_3D_ARP 892 pcSlice->setARPStepNum(); 893 if( pcSlice->getARPStepNum() > 1 ) 894 { 895 for(Int iLayerId = 0; iLayerId < nalu.m_layerId; iLayerId ++ ) 896 { 897 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId); 898 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 ); 899 if( iViewIdx<getViewIndex() && !bIsDepth ) 900 { 901 pcSlice->setBaseViewRefPicList( m_tAppDecTop->getTDecTop(iLayerId)->getListPic(), iViewIdx ); 902 } 903 } 904 } 905 #endif 888 906 #else 889 907 #if FIX1071 -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibDecoder/TDecTop.h
r446 r464 225 225 #endif 226 226 227 #if H_3D_ARP 228 TAppDecTop* m_tAppDecTop; 229 #endif 230 227 231 public: 228 232 TDecTop(); … … 265 269 Bool getIsDepth () { return m_isDepth; } 266 270 Void setCamParsCollector( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; } 271 272 #if H_3D_ARP 273 Void setTAppDecTop( TAppDecTop* pcTAppDecTop ) { m_tAppDecTop = pcTAppDecTop; } 274 TAppDecTop* getTAppDecTop() { return m_tAppDecTop; } 275 #endif 267 276 #endif 268 277 #endif -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncCavlc.cpp
r446 r464 741 741 } 742 742 } 743 744 #if H_3D_ARP 745 for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ ) 746 { 747 if( ( layer!=0 ) && ( pcVPS->getDepthId(layer)!=1 ) ) 748 { 749 WRITE_FLAG( pcVPS->getUseAdvRP ( layer ) ? 1 : 0, "advanced_residual_pred_flag" ); 750 } 751 else 752 { 753 assert( pcVPS->getUseAdvRP ( layer ) == 0 ); 754 } 755 } 756 #endif 757 743 758 WRITE_FLAG( 0, "vps_extension2_flag" ); 744 759 #else … … 1349 1364 } 1350 1365 1366 #if H_3D_ARP 1367 Void TEncCavlc::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1368 { 1369 assert(0); 1370 } 1371 #endif 1372 1351 1373 Void TEncCavlc::codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ) 1352 1374 { -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncCavlc.h
r446 r464 114 114 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 115 115 116 #if H_3D_ARP 117 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 118 #endif 119 116 120 Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ); 117 121 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncCfg.h
r446 r464 394 394 Bool m_bUseEstimatedVSD; 395 395 Double m_dDispCoeff; 396 397 #if H_3D_ARP 398 UInt m_uiUseAdvResPred; 399 UInt m_uiARPStepNum; 400 #endif 396 401 #endif 397 402 … … 467 472 Bool getMaxTempLayer () { return m_maxTempLayer; } 468 473 Void setMaxTempLayer ( Int maxTempLayer ) { m_maxTempLayer = maxTempLayer; } 474 475 #if H_3D_ARP 476 UInt getUseAdvRP ( ) { return m_uiUseAdvResPred; } 477 Void setUseAdvRP ( UInt u ) { m_uiUseAdvResPred = u; } 478 479 UInt getARPStepNum () { return m_uiARPStepNum; } 480 Void setARPStepNum ( UInt u ) { m_uiARPStepNum = u; } 481 #endif 482 469 483 //======== Transform ============= 470 484 Void setQuadtreeTULog2MaxSize ( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncCu.cpp
r455 r464 65 65 m_ppcTempCU = new TComDataCU*[m_uhTotalDepth-1]; 66 66 67 #if H_3D_ARP 68 m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1]; 69 #endif 70 67 71 m_ppcPredYuvBest = new TComYuv*[m_uhTotalDepth-1]; 68 72 m_ppcResiYuvBest = new TComYuv*[m_uhTotalDepth-1]; … … 83 87 m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 84 88 89 #if H_3D_ARP 90 m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 91 #endif 92 85 93 m_ppcPredYuvBest[i] = new TComYuv; m_ppcPredYuvBest[i]->create(uiWidth, uiHeight); 86 94 m_ppcResiYuvBest[i] = new TComYuv; m_ppcResiYuvBest[i]->create(uiWidth, uiHeight); … … 124 132 m_ppcTempCU[i]->destroy(); delete m_ppcTempCU[i]; m_ppcTempCU[i] = NULL; 125 133 } 134 #if H_3D_ARP 135 if(m_ppcWeightedTempCU[i]) 136 { 137 m_ppcWeightedTempCU[i]->destroy(); delete m_ppcWeightedTempCU[i]; m_ppcWeightedTempCU[i] = NULL; 138 } 139 #endif 126 140 if(m_ppcPredYuvBest[i]) 127 141 { … … 468 482 if( rpcTempCU->getSlice()->getSliceType() != I_SLICE ) 469 483 { 484 #if H_3D_ARP 485 if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) ) 486 #else 470 487 if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. Remove this comment once it is done. 488 #endif 471 489 { 472 490 PartSize ePartTemp = rpcTempCU->getPartitionSize(0); … … 1220 1238 { 1221 1239 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx ); 1240 #if H_3D_ARP 1241 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1242 #endif 1222 1243 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1223 1244 return; … … 1241 1262 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1242 1263 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1243 1264 #if H_3D_ARP 1265 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1266 #endif 1267 1244 1268 // Encode Coefficients 1245 1269 Bool bCodeDQP = getdQPFlag(); … … 1302 1326 } 1303 1327 1328 #if H_3D_ARP 1329 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1330 if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV ) 1331 { 1332 nARPWMax = 0; 1333 } 1334 for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- ) 1335 { 1336 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) ); 1337 #endif 1304 1338 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) 1305 1339 { … … 1316 1350 rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); 1317 1351 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1352 #if H_3D_ARP 1353 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1354 #endif 1318 1355 rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to LCU level 1319 1356 rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to LCU level … … 1322 1359 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1323 1360 1361 #if H_3D_ARP 1362 if( nARPW ) 1363 { 1364 Bool bSignalflag[2] = { true, true }; 1365 for( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1366 { 1367 Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx(); 1368 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1369 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1370 { 1371 bSignalflag[uiRefListIdx] = false; 1372 } 1373 } 1374 if( !bSignalflag[0] && !bSignalflag[1] ) 1375 { 1376 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1377 } 1378 } 1379 #endif 1324 1380 // do MC 1325 1381 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); … … 1401 1457 } 1402 1458 } 1459 #if H_3D_ARP 1460 } 1461 #endif 1403 1462 } 1404 1463 … … 1411 1470 { 1412 1471 UChar uhDepth = rpcTempCU->getDepth( 0 ); 1472 #if H_3D_ARP 1473 Int iLayerId = rpcTempCU->getSlice()->getLayerId(); 1474 Bool bFirstTime = true; 1475 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1476 1477 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV ) 1478 { 1479 nARPWMax = 0; 1480 } 1481 1482 for( Int nARPW = 0; nARPW <= nARPWMax; nARPW++ ) 1483 { 1484 if( bFirstTime == false && rpcTempCU->getSlice()->getVPS()->getUseAdvRP( iLayerId ) ) 1485 { 1486 rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0) ); 1487 } 1488 #endif 1413 1489 #if H_3D_VSO // M3 1414 1490 if( m_pcRdCost->getUseRenModel() ) … … 1430 1506 rpcTempCU->setCUTransquantBypassSubParts ( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); 1431 1507 1508 #if H_3D_ARP 1509 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1510 #endif 1511 1512 #if H_3D_ARP 1513 if( bFirstTime == false && nARPWMax ) 1514 { 1515 rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth ); 1516 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1517 1518 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] ); 1519 1520 if(rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N) 1521 { 1522 Bool bSignalflag[2] = { true, true }; 1523 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1524 { 1525 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1526 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 1527 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1528 { 1529 bSignalflag[uiRefListIdx] = false; 1530 } 1531 } 1532 if( !bSignalflag[0] && !bSignalflag[1] ) 1533 { 1534 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1535 } 1536 } 1537 } 1538 else 1539 { 1540 bFirstTime = false; 1541 #endif 1432 1542 #if AMP_MRG 1433 1543 rpcTempCU->setMergeAMP (true); … … 1436 1546 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 1437 1547 #endif 1548 #if H_3D_ARP 1549 if( nARPWMax ) 1550 { 1551 m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth ); 1552 1553 Bool bSignalflag[2] = { true, true }; 1554 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1555 { 1556 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1557 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 1558 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1559 { 1560 bSignalflag[uiRefListIdx] = false; 1561 } 1562 } 1563 if( !bSignalflag[0] && !bSignalflag[1]) 1564 { 1565 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1566 } 1567 } 1568 } 1569 #endif 1438 1570 1439 1571 #if AMP_MRG 1440 1572 if ( !rpcTempCU->getMergeAMP() ) 1441 1573 { 1574 #if H_3D_ARP 1575 if( nARPWMax ) 1576 { 1577 continue; 1578 } 1579 else 1580 #endif 1442 1581 return; 1443 1582 } … … 1466 1605 xCheckDQP( rpcTempCU ); 1467 1606 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 1607 #if H_3D_ARP 1608 } 1609 #endif 1468 1610 } 1469 1611 -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncCu.h
r324 r464 69 69 TComDataCU** m_ppcBestCU; ///< Best CUs in each depth 70 70 TComDataCU** m_ppcTempCU; ///< Temporary CUs in each depth 71 #if H_3D_ARP 72 TComDataCU** m_ppcWeightedTempCU; 73 #endif 71 74 UChar m_uhTotalDepth; 72 75 -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncEntropy.cpp
r446 r464 157 157 } 158 158 159 #if H_3D_ARP 160 Void TEncEntropy::encodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 161 { 162 if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) 163 { 164 return; 165 } 166 167 if ( pcCU->getPartitionSize(uiAbsPartIdx)!=SIZE_2Nx2N ) 168 { 169 assert(pcCU->getARPW (uiAbsPartIdx) == 0); 170 } 171 else 172 { 173 m_pcEntropyCoderIf->codeARPW( pcCU, uiAbsPartIdx ); 174 } 175 } 176 #endif 177 159 178 /** encode prediction mode 160 179 * \param pcCU -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncEntropy.h
r446 r464 88 88 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 89 89 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 90 #if H_3D_ARP 91 virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 92 #endif 90 93 virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 91 94 … … 169 172 Void encodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 170 173 Void encodeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 174 #if H_3D_ARP 175 Void encodeARPW ( TComDataCU* pcCU, UInt uiAbspartIdx ); 176 #endif 171 177 Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 172 178 Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncGOP.cpp
r455 r464 47 47 #include "TLibCommon/NAL.h" 48 48 #include "NALwrite.h" 49 #if H_3D_ARP 50 #include "../../App/TAppEncoder/TAppEncTop.h" 51 #endif 49 52 #include <time.h> 50 53 #include <math.h> … … 670 673 #if H_MV 671 674 pcSlice->setRefPicList( rcListPic, m_refPicSetInterLayer ); 675 #if H_3D_ARP 676 pcSlice->setARPStepNum(); 677 if(pcSlice->getARPStepNum() > 1) 678 { 679 for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ ) 680 { 681 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId); 682 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 ); 683 if( iViewIdx<getViewIndex() && !bIsDepth ) 684 { 685 pcSlice->setBaseViewRefPicList( m_pcEncTop->getTAppEncTop()->getTEncTop( iLayerId )->getListPic(), iViewIdx ); 686 } 687 } 688 } 689 #endif 672 690 #else 673 691 pcSlice->setRefPicList ( rcListPic ); -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncSbac.cpp
r446 r464 60 60 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 61 61 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 62 #if H_3D_ARP 63 , m_cCUPUARPW ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels) 64 #endif 62 65 , m_cCUPartSizeSCModel ( 1, 1, NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 66 , m_cCUPredModeSCModel ( 1, 1, NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 111 114 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 112 115 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); 116 #if H_3D_ARP 117 m_cCUPUARPW.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 118 #endif 113 119 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 114 120 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 214 220 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 215 221 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); 222 #if H_3D_ARP 223 m_cCUPUARPW.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 224 #endif 216 225 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 217 226 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 589 598 DTRACE_CABAC_T( "\n" ); 590 599 } 600 601 #if H_3D_ARP 602 Void TEncSbac::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 603 { 604 Int iW = (Int)pcCU->getARPW( uiAbsPartIdx ); 605 Int iMaxW = pcCU->getSlice()->getARPStepNum() - 1; 606 assert( iMaxW > 0); 607 608 Int nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx); 609 Int nBinNum = iW + ( iW != iMaxW ); 610 m_pcBinIf->encodeBin( iW ? 1 : 0 , m_cCUPUARPW.get( 0, 0, 0 + nOffset ) ); 611 if( nBinNum > 1 ) 612 { 613 m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPW.get( 0, 0, 3 ) ); 614 } 615 } 616 #endif 591 617 592 618 Void TEncSbac::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncSbac.h
r446 r464 134 134 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 135 135 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 136 #if H_3D_ARP 137 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 138 #endif 136 139 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 137 140 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); … … 181 184 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 182 185 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 186 #if H_3D_ARP 187 ContextModel3DBuffer m_cCUPUARPW; 188 #endif 183 189 ContextModel3DBuffer m_cCUPartSizeSCModel; 184 190 ContextModel3DBuffer m_cCUPredModeSCModel; -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncSearch.cpp
r456 r464 4741 4741 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 4742 4742 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true ); 4743 4743 #if H_3D_ARP 4744 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 4745 #endif 4744 4746 uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 4745 4747 pcCU->getTotalBits() = uiBits; … … 6150 6152 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 6151 6153 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, true); 6154 #if H_3D_ARP 6155 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 6156 #endif 6152 6157 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 6153 6158 } … … 6163 6168 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 6164 6169 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 6170 #if H_3D_ARP 6171 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6172 #endif 6165 6173 Bool bDummy = false; 6166 6174 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy ); -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibEncoder/TEncTop.h
r446 r464 63 63 // Class definition 64 64 // ==================================================================================================================== 65 66 #if H_3D_ARP 67 class TAppEncTop; 68 #endif 65 69 66 70 /// encoder class … … 124 128 TComScalingList m_scalingList; ///< quantization matrix information 125 129 TEncRateCtrl m_cRateCtrl; ///< Rate control class 126 130 131 #if H_3D_ARP 132 TAppEncTop* m_pcTAppEncTop; 133 #endif 134 127 135 #if H_MV 128 136 TEncAnalyze m_cAnalyzeAll; … … 205 213 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; } 206 214 #endif 215 #if H_3D_ARP 216 Void setTAppEncTop( TAppEncTop* pcTAppEncTop ) { m_pcTAppEncTop = pcTAppEncTop; } 217 TAppEncTop* getTAppEncTop() { return m_pcTAppEncTop; } 218 #endif 207 219 // ------------------------------------------------------------------------------------------------------------------- 208 220 // encoder function -
branches/HTM-DEV-0.3-dev2a/source/Lib/TLibExtractor/TExtrTop.cpp
r446 r464 115 115 } 116 116 #endif 117
Note: See TracChangeset for help on using the changeset viewer.