- Timestamp:
- 13 Nov 2013, 23:25:47 (11 years ago)
- Location:
- branches/SHM-4.0-dev
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/cfg/encoder_intra_he10.cfg
r2 r466 43 43 44 44 #=========== Misc. ============ 45 InternalBitDepth : 10 # internal bit-depth = BitDepth + BitIncrement 45 #InternalBitDepth : 10 # codec operating bit-depth 46 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 47 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 46 48 47 49 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_intra_main.cfg
r310 r466 48 48 49 49 #=========== Misc. ============ 50 InternalBitDepth : 8 # codec operating bit-depth 50 #InternalBitDepth : 8 # codec operating bit-depth 51 InternalBitDepth0 : 8 # codec operating bit-depth for layer 0 52 InternalBitDepth1 : 8 # codec operating bit-depth for layer 1 51 53 52 54 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_intra_main10.cfg
r310 r466 48 48 49 49 #=========== Misc. ============ 50 InternalBitDepth : 10 # codec operating bit-depth 50 #InternalBitDepth : 10 # codec operating bit-depth 51 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 52 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 51 53 52 54 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_lowdelay_P_he10.cfg
r310 r466 50 50 51 51 #=========== Misc. ============ 52 InternalBitDepth : 10 # internal bit-depth = BitDepth + BitIncrement 52 #InternalBitDepth : 10 # internal bit-depth = BitDepth + BitIncrement 53 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 54 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 53 55 54 56 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_lowdelay_P_main.cfg
r442 r466 53 53 54 54 #=========== Misc. ============ 55 InternalBitDepth : 8 # codec operating bit-depth 55 #InternalBitDepth : 8 # codec operating bit-depth 56 InternalBitDepth0 : 8 # codec operating bit-depth for layer 0 57 InternalBitDepth1 : 8 # codec operating bit-depth for layer 1 56 58 57 59 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_lowdelay_P_main10.cfg
r442 r466 55 55 56 56 #=========== Misc. ============ 57 InternalBitDepth : 10 # codec operating bit-depth 57 #InternalBitDepth : 10 # codec operating bit-depth 58 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 59 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 58 60 59 61 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_lowdelay_he10.cfg
r310 r466 48 48 49 49 #=========== Misc. ============ 50 InternalBitDepth : 10 # internal bit-depth = BitDepth + BitIncrement 50 #InternalBitDepth : 10 # codec operating bit-depth 51 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 52 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 51 53 52 54 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_lowdelay_main.cfg
r442 r466 53 53 54 54 #=========== Misc. ============ 55 InternalBitDepth : 8 # codec operating bit-depth 55 #InternalBitDepth : 8 # codec operating bit-depth 56 InternalBitDepth0 : 8 # codec operating bit-depth for layer 0 57 InternalBitDepth1 : 8 # codec operating bit-depth for layer 1 56 58 57 59 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_lowdelay_main10.cfg
r442 r466 53 53 54 54 #=========== Misc. ============ 55 InternalBitDepth : 10 # codec operating bit-depth 55 #InternalBitDepth : 10 # codec operating bit-depth 56 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 57 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 56 58 57 59 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_randomaccess_he10.cfg
r345 r466 62 62 63 63 #=========== Misc. ============ 64 InternalBitDepth : 10 # internal bit-depth = BitDepth + BitIncrement 64 #InternalBitDepth : 10 # codec operating bit-depth 65 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 66 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 65 67 66 68 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_randomaccess_main.cfg
r442 r466 65 65 66 66 #=========== Misc. ============ 67 InternalBitDepth : 8 # codec operating bit-depth 67 #InternalBitDepth : 8 # codec operating bit-depth 68 InternalBitDepth0 : 8 # codec operating bit-depth for layer 0 69 InternalBitDepth1 : 8 # codec operating bit-depth for layer 1 68 70 69 71 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/encoder_randomaccess_main10.cfg
r442 r466 65 65 66 66 #=========== Misc. ============ 67 InternalBitDepth : 10 # codec operating bit-depth 67 #InternalBitDepth : 10 # codec operating bit-depth 68 InternalBitDepth0 : 10 # codec operating bit-depth for layer 0 69 InternalBitDepth1 : 10 # codec operating bit-depth for layer 1 68 70 69 71 #=========== Coding Tools ================= -
branches/SHM-4.0-dev/cfg/per-sequence-svc/BQTerrace-1.5x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 600 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/BQTerrace-2x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 600 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/BQTerrace-SNR.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 600 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/BasketballDrive-1.5x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 500 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/BasketballDrive-2x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 500 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/BasketballDrive-SNR.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 500 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Cactus-1.5x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 500 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Cactus-2x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 500 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Cactus-SNR.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 500 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Kimono-1.5x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 240 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Kimono-2x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 240 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Kimono-SNR.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 240 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/ParkScene-1.5x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 240 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/ParkScene-2x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 240 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/ParkScene-SNR.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 240 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/PeopleOnStreet-2x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 150 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/PeopleOnStreet-SNR.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 150 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Traffic-2x.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 150 # Number of frames to be coded -
branches/SHM-4.0-dev/cfg/per-sequence-svc/Traffic-SNR.cfg
r464 r466 1 InputBitDepth : 8 # Input bitdepth 1 #InputBitDepth : 8 # Input bitdepth 2 InputBitDepth0 : 8 # Input bitdepth for layer 0 3 InputBitDepth1 : 8 # Input bitdepth for layer 1 2 4 FrameSkip : 0 # Number of frames to be skipped in input 3 5 FramesToBeEncoded : 150 # Number of frames to be coded -
branches/SHM-4.0-dev/source/App/TAppDecoder/TAppDecTop.cpp
r442 r466 225 225 if (bNewPicture || !bitstreamFile) 226 226 { 227 #if O0194_DIFFERENT_BITDEPTH_EL_BL 228 //Bug fix: The bit depth was not set correctly for each layer when doing DBF 229 g_bitDepthY = g_bitDepthYLayer[curLayerId]; 230 g_bitDepthC = g_bitDepthCLayer[curLayerId]; 231 #endif 227 232 m_acTDecTop[curLayerId].executeLoopFilters(poc, pcListPic); 228 233 #if EARLY_REF_PIC_MARKING … … 237 242 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 238 243 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 239 240 244 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 241 245 … … 566 570 567 571 #else 572 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 573 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 574 #else 568 575 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 576 #endif 569 577 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 570 578 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 759 767 760 768 #else 769 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 770 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 771 #else 761 772 m_cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 773 #endif 762 774 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 763 775 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r464 r466 362 362 Int* cfg_IntraPeriod [MAX_LAYERS]; 363 363 Int* cfg_conformanceMode [MAX_LAYERS]; 364 #if LAYER_CTB365 // coding unit (CU) definition366 UInt* cfg_uiMaxCUWidth[MAX_LAYERS]; ///< max. CU width in pixel367 UInt* cfg_uiMaxCUHeight[MAX_LAYERS]; ///< max. CU height in pixel368 UInt* cfg_uiMaxCUDepth[MAX_LAYERS]; ///< max. CU depth369 370 // transfom unit (TU) definition371 UInt* cfg_uiQuadtreeTULog2MaxSize[MAX_LAYERS];372 UInt* cfg_uiQuadtreeTULog2MinSize[MAX_LAYERS];373 374 UInt* cfg_uiQuadtreeTUMaxDepthInter[MAX_LAYERS];375 UInt* cfg_uiQuadtreeTUMaxDepthIntra[MAX_LAYERS];376 #endif377 364 #if VPS_EXTN_DIRECT_REF_LAYERS 378 365 #if M0457_PREDICTION_INDICATIONS … … 392 379 string* cfg_predLayerIdsPtr [MAX_LAYERS]; 393 380 #endif 381 #if SCALED_REF_LAYER_OFFSETS 394 382 string cfg_scaledRefLayerLeftOffset [MAX_LAYERS]; 395 383 string cfg_scaledRefLayerTopOffset [MAX_LAYERS]; … … 402 390 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 403 391 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 392 #endif 404 393 #if RC_SHVC_HARMONIZATION 405 394 Bool* cfg_RCEnableRateControl [MAX_LAYERS]; … … 411 400 Bool* cfg_RCForceIntraQP [MAX_LAYERS]; 412 401 #endif 402 #if O0194_DIFFERENT_BITDEPTH_EL_BL 403 Int* cfg_InputBitDepthY [MAX_LAYERS]; 404 Int* cfg_InternalBitDepthY [MAX_LAYERS]; 405 Int* cfg_InputBitDepthC [MAX_LAYERS]; 406 Int* cfg_InternalBitDepthC [MAX_LAYERS]; 407 Int* cfg_OutputBitDepthY [MAX_LAYERS]; 408 Int* cfg_OutputBitDepthC [MAX_LAYERS]; 409 #endif 413 410 #if N0120_MAX_TID_REF_CFG 414 411 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; … … 427 424 cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; 428 425 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 429 #if LAYER_CTB430 // coding unit (CU) definition431 cfg_uiMaxCUWidth[layer] = &m_acLayerCfg[layer].m_uiMaxCUWidth;432 cfg_uiMaxCUHeight[layer] = &m_acLayerCfg[layer].m_uiMaxCUHeight;433 cfg_uiMaxCUDepth[layer] = &m_acLayerCfg[layer].m_uiMaxCUDepth;434 435 // transfom unit (TU) definition.436 cfg_uiQuadtreeTULog2MaxSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize;437 cfg_uiQuadtreeTULog2MinSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize;438 439 cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter;440 cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra;441 #endif442 426 #if VPS_EXTN_DIRECT_REF_LAYERS 443 427 #if M0457_PREDICTION_INDICATIONS … … 453 437 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; 454 438 #endif 439 #if SCALED_REF_LAYER_OFFSETS 455 440 cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets; 456 441 for(Int i = 0; i < MAX_LAYERS; i++) … … 461 446 cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; 462 447 } 448 #endif 463 449 #if RC_SHVC_HARMONIZATION 464 450 cfg_RCEnableRateControl[layer] = &m_acLayerCfg[layer].m_RCEnableRateControl; … … 470 456 cfg_RCForceIntraQP[layer] = &m_acLayerCfg[layer].m_RCForceIntraQP; 471 457 #endif 458 #if O0194_DIFFERENT_BITDEPTH_EL_BL 459 cfg_InputBitDepthY [layer] = &m_acLayerCfg[layer].m_inputBitDepthY; 460 cfg_InternalBitDepthY[layer] = &m_acLayerCfg[layer].m_internalBitDepthY; 461 cfg_InputBitDepthC [layer] = &m_acLayerCfg[layer].m_inputBitDepthC; 462 cfg_InternalBitDepthC[layer] = &m_acLayerCfg[layer].m_internalBitDepthC; 463 cfg_OutputBitDepthY [layer] = &m_acLayerCfg[layer].m_outputBitDepthY; 464 cfg_OutputBitDepthC [layer] = &m_acLayerCfg[layer].m_outputBitDepthC; 465 #endif 472 466 #if N0120_MAX_TID_REF_CFG 473 467 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; … … 483 477 string cfg_tileSets; 484 478 #endif 485 #else //SVC_EXTENSION479 #else 486 480 string cfg_InputFile; 487 481 string cfg_BitstreamFile; 488 482 string cfg_ReconFile; 489 483 string cfg_dQPFile; 490 #endif //SVC_EXTENSION484 #endif 491 485 string cfg_ColumnWidth; 492 486 string cfg_RowHeight; … … 538 532 #endif 539 533 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") 534 #if !O0194_DIFFERENT_BITDEPTH_EL_BL 540 535 ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") 541 536 ("OutputBitDepth", m_outputBitDepthY, 0, "Bit-depth of output file (default:InternalBitDepth)") … … 545 540 ("OutputBitDepthC", m_outputBitDepthC, 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 546 541 ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") 542 #endif 543 #if SCALED_REF_LAYER_OFFSETS 547 544 ("NumScaledRefLayerOffsets%d", cfg_numScaledRefLayerOffsets, 0, MAX_LAYERS, "Number of scaled offset layer sets ") 548 545 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" … … 554 551 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 555 552 " bottom-right luma sample of the EL picture, in units of two luma samples") 553 #endif 554 #if O0194_DIFFERENT_BITDEPTH_EL_BL 555 ("InputBitDepth%d", cfg_InputBitDepthY, 8, MAX_LAYERS, "Bit-depth of input file for layer %d") 556 ("InternalBitDepth%d", cfg_InternalBitDepthY, 0, MAX_LAYERS, "Bit-depth the codec operates at. (default:InputBitDepth) for layer %d ") 557 // "If different to InputBitDepth, source data will be converted") 558 ("InputBitDepthC%d", cfg_InputBitDepthC, 0, MAX_LAYERS, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d") 559 ("InternalBitDepthC%d", cfg_InternalBitDepthC, 0, MAX_LAYERS, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth) for layer %d") 560 ("OutputBitDepth%d", cfg_OutputBitDepthY, 0, MAX_LAYERS, "Bit-depth of output file (default:InternalBitDepth)") 561 ("OutputBitDepthC%d", cfg_OutputBitDepthC, 0, MAX_LAYERS, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 562 #endif 556 563 #if N0120_MAX_TID_REF_CFG 557 564 ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " ) … … 569 576 ("IlSampleOnlyPred%d", m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices") 570 577 #endif 571 #else //SVC_EXTENSION578 #else 572 579 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") 573 580 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") … … 590 597 ("ConfBottom", m_confBottom, 0, "Bottom offset for window conformance mode 3") 591 598 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 592 #endif //SVC_EXTENSION599 #endif 593 600 594 601 //Field coding parameters … … 607 614 ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") 608 615 609 #if LAYER_CTB610 // Unit definition parameters611 ("MaxCUWidth%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width")612 ("MaxCUHeight%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height")613 // todo: remove defaults from MaxCUSize614 ("MaxCUSize%d,s%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size")615 ("MaxCUSize%d,s%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size")616 ("MaxPartitionDepth%d,h%d", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth")617 618 ("QuadtreeTULog2MaxSize%d", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")619 ("QuadtreeTULog2MinSize%d", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")620 621 ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")622 ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")623 624 625 // set the same CU realted settings across all the layers if config file parameters are not layer specific626 ("MaxCUWidth", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width")627 ("MaxCUHeight", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height")628 // todo: remove defaults from MaxCUSize629 ("MaxCUSize,s", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size")630 ("MaxCUSize,s", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size")631 ("MaxPartitionDepth,h", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth")632 633 ("QuadtreeTULog2MaxSize", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")634 ("QuadtreeTULog2MinSize", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")635 636 ("QuadtreeTUMaxDepthIntra", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")637 ("QuadtreeTUMaxDepthInter", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")638 #else639 616 // Unit definition parameters 640 617 ("MaxCUWidth", m_uiMaxCUWidth, 64u) … … 650 627 ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") 651 628 ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") 652 #endif653 629 654 630 // Coding structure paramters … … 974 950 m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); 975 951 #endif 976 #else //SVC_EXTENSION952 #else 977 953 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); 978 954 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 979 955 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 980 956 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 981 #endif //SVC_EXTENSION957 #endif 982 958 983 959 Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); … … 1038 1014 m_pRowHeight = NULL; 1039 1015 } 1040 #if S VC_EXTENSION1016 #if SCALED_REF_LAYER_OFFSETS 1041 1017 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1042 1018 { … … 1108 1084 } 1109 1085 } 1086 #endif 1110 1087 #if VPS_EXTN_DIRECT_REF_LAYERS 1111 1088 #if M0457_PREDICTION_INDICATIONS … … 1237 1214 } 1238 1215 #endif 1239 #endif //SVC_EXTENSION1240 1216 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 1241 1217 1242 1218 /* rules for input, output and internal bitdepths as per help text */ 1219 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1220 for(Int layer = 0; layer < MAX_LAYERS; layer++){ 1221 if (!m_acLayerCfg[layer].m_internalBitDepthY) { m_acLayerCfg[layer].m_internalBitDepthY = m_acLayerCfg[layer].m_inputBitDepthY; } 1222 if (!m_acLayerCfg[layer].m_internalBitDepthC) { m_acLayerCfg[layer].m_internalBitDepthC = m_acLayerCfg[layer].m_internalBitDepthY; } 1223 if (!m_acLayerCfg[layer].m_inputBitDepthC) { m_acLayerCfg[layer].m_inputBitDepthC = m_acLayerCfg[layer].m_inputBitDepthY; } 1224 if (!m_acLayerCfg[layer].m_outputBitDepthY) { m_acLayerCfg[layer].m_outputBitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; } 1225 if (!m_acLayerCfg[layer].m_outputBitDepthC) { m_acLayerCfg[layer].m_outputBitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; } 1226 } 1227 #else 1243 1228 if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; } 1244 1229 if (!m_internalBitDepthC) { m_internalBitDepthC = m_internalBitDepthY; } … … 1246 1231 if (!m_outputBitDepthY) { m_outputBitDepthY = m_internalBitDepthY; } 1247 1232 if (!m_outputBitDepthC) { m_outputBitDepthC = m_internalBitDepthC; } 1233 #endif 1248 1234 1249 1235 #if !SVC_EXTENSION … … 1457 1443 1458 1444 // set global varibles 1459 #if LAYER_CTB1460 for(Int layer = 0; layer < MAX_LAYERS; layer++)1461 {1462 xSetGlobal(layer);1463 }1464 #else1465 1445 xSetGlobal(); 1466 #endif1467 1446 1468 1447 // print-out parameters … … 1503 1482 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) 1504 1483 // check range of parameters 1484 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1485 for(UInt layer=0; layer<m_numLayers; layer++){ 1486 xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthY < 8, "InputBitDepth must be at least 8" ); 1487 xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthC < 8, "InputBitDepthC must be at least 8" ); 1488 } 1489 #else 1505 1490 xConfirmPara( m_inputBitDepthY < 8, "InputBitDepth must be at least 8" ); 1506 1491 xConfirmPara( m_inputBitDepthC < 8, "InputBitDepthC must be at least 8" ); 1492 #endif 1507 1493 #if !SVC_EXTENSION 1508 1494 xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); … … 1524 1510 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 1525 1511 xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); 1526 #if LAYER_CTB1527 for(UInt layer = 0; layer < MAX_LAYERS; layer++)1528 {1529 xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );1530 }1531 #else1532 1512 xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 1533 #endif1534 1513 1535 1514 xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" ); … … 1545 1524 } 1546 1525 #endif 1547 #if !LAYER_CTB1548 1526 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); 1549 1527 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); 1550 1528 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 1551 1529 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 1552 #endif1553 1530 #if !SVC_EXTENSION 1554 1531 xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); … … 1556 1533 #endif 1557 1534 1558 #if !LAYER_CTB1559 1535 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); 1560 1536 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); … … 1570 1546 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); 1571 1547 xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" ); 1572 #endif1573 1548 1574 1549 xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); … … 1618 1593 #endif 1619 1594 1620 #if !LAYER_CTB1621 1595 // max CU width and height should be power of 2 1622 1596 UInt ui = m_uiMaxCUWidth; … … 1634 1608 xConfirmPara( ui != 1 , "Height should be 2^n"); 1635 1609 } 1636 #endif 1610 1637 1611 1638 1612 /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure … … 2031 2005 Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth; 2032 2006 Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight; 2033 #if LAYER_CTB2034 Int m_uiMaxCUWidth = m_acLayerCfg[layer].m_uiMaxCUWidth;2035 Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight;2036 #endif2037 2007 #endif 2038 2008 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) … … 2279 2249 /** \todo use of global variables should be removed later 2280 2250 */ 2281 #if LAYER_CTB2282 Void TAppEncCfg::xSetGlobal(UInt layerId)2283 {2284 // set max CU width & height2285 g_auiLayerMaxCUWidth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUWidth;2286 g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight;2287 2288 // compute actual CU depth with respect to config depth and max transform size2289 g_auiLayerAddCUDepth[layerId] = 0;2290 while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] ) ) ) g_auiLayerAddCUDepth[layerId]++;2291 2292 m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId];2293 g_auiLayerAddCUDepth[layerId]++;2294 g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth;2295 2296 // set internal bit-depth and constants2297 g_bitDepthY = m_internalBitDepthY;2298 g_bitDepthC = m_internalBitDepthC;2299 2300 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY;2301 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC;2302 }2303 #else2304 2251 Void TAppEncCfg::xSetGlobal() 2305 2252 { … … 2316 2263 g_uiMaxCUDepth = m_uiMaxCUDepth; 2317 2264 2318 // set internal bit-depth and constants 2265 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2266 // set internal bit-depth to constant value to make sure to be updated later 2267 g_bitDepthY = -1; 2268 g_bitDepthC = -1; 2269 2270 g_uiPCMBitDepthLuma = -1; 2271 g_uiPCMBitDepthChroma = -1; 2272 #else 2319 2273 g_bitDepthY = m_internalBitDepthY; 2320 2274 g_bitDepthC = m_internalBitDepthC; … … 2322 2276 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY; 2323 2277 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; 2278 #endif 2324 2279 } 2325 #endif2326 2280 2327 2281 Void TAppEncCfg::xPrintParameter() … … 2377 2331 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2378 2332 } 2379 #if !LAYER_CTB2380 2333 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2381 2334 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 2382 2335 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); 2383 2336 printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); 2384 #endif2385 2337 printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); 2386 2338 printf("Motion search range : %d\n", m_iSearchRange ); … … 2399 2351 printf("QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) ); 2400 2352 printf("GOP size : %d\n", m_iGOPSize ); 2353 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2354 printf("Internal bit depth Layer0 : (Y:%d, C:%d)\n", m_acLayerCfg[0].m_internalBitDepthY, m_acLayerCfg[0].m_internalBitDepthC ); 2355 printf("Internal bit depth Layer1 : (Y:%d, C:%d)\n", m_acLayerCfg[1].m_internalBitDepthY, m_acLayerCfg[1].m_internalBitDepthC ); 2356 #else 2401 2357 printf("Internal bit depth : (Y:%d, C:%d)\n", m_internalBitDepthY, m_internalBitDepthC ); 2358 #endif 2402 2359 printf("PCM sample bit depth : (Y:%d, C:%d)\n", g_uiPCMBitDepthLuma, g_uiPCMBitDepthChroma ); 2403 2360 #if O0215_PHASE_ALIGNMENT … … 2429 2386 2430 2387 printf("TOOL CFG: "); 2388 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2389 printf("IBD0:%d ", g_bitDepthY > m_acLayerCfg[0].m_inputBitDepthY || g_bitDepthC > m_acLayerCfg[0].m_inputBitDepthC); 2390 printf("IBD1:%d ", g_bitDepthY > m_acLayerCfg[1].m_inputBitDepthY || g_bitDepthC > m_acLayerCfg[1].m_inputBitDepthC); 2391 #else 2431 2392 printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC); 2393 #endif 2432 2394 printf("HAD:%d ", m_bUseHADME ); 2433 2395 printf("SRD:%d ", m_bUseSBACRD ); … … 2460 2422 printf("CIP:%d ", m_bUseConstrainedIntraPred); 2461 2423 printf("SAO:%d ", (m_bUseSAO)?(1):(0)); 2462 #if !LAYER_CTB2463 2424 printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); 2464 #endif2465 2425 printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0)); 2466 2426 … … 2494 2454 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 2495 2455 #endif 2456 printf("O0194_DIFFERENT_BITDEPTH_EL_BL: %d ", O0194_DIFFERENT_BITDEPTH_EL_BL); 2457 printf("O0194_JOINT_US_BITSHIFT: %d ", O0194_JOINT_US_BITSHIFT); 2458 printf("O0194_WEIGHTED_PREDICTION_CGS: %d ",O0194_WEIGHTED_PREDICTION_CGS); 2459 printf("O0194_REPN_FORMAT_IN_VPS_BUGFIX: %d ",O0194_REPN_FORMAT_IN_VPS_BUGFIX); 2496 2460 printf("\n\n"); 2497 2461 … … 2508 2472 } 2509 2473 2510 #if S VC_EXTENSION2474 #if SCALED_REF_LAYER_OFFSETS 2511 2475 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString) 2512 2476 { … … 2541 2505 } 2542 2506 } 2507 #endif 2543 2508 2544 2509 #if FINAL_RPL_CHANGE_N0082 … … 2756 2721 } 2757 2722 #endif 2758 #endif //SVC_EXTENSION2759 2723 //! \} -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h
r464 r466 150 150 Int m_maxTempLayer; ///< Max temporal layer 151 151 152 #if !LAYER_CTB153 152 // coding unit (CU) definition 154 153 UInt m_uiMaxCUWidth; ///< max. CU width in pixel … … 162 161 UInt m_uiQuadtreeTUMaxDepthInter; 163 162 UInt m_uiQuadtreeTUMaxDepthIntra; 164 #endif165 163 166 164 // coding tools (bit-depth) 165 #if !O0194_DIFFERENT_BITDEPTH_EL_BL 167 166 Int m_inputBitDepthY; ///< bit-depth of input file (luma component) 168 167 Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) … … 171 170 Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) 172 171 Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) 173 172 #endif 174 173 // coding tools (PCM bit-depth) 175 174 Bool m_bPCMInputBitDepthFlag; ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth. … … 356 355 #endif 357 356 // internal member functions 358 #if LAYER_CTB359 Void xSetGlobal (UInt layerId); ///< set global variables360 #else361 357 Void xSetGlobal (); ///< set global variables 362 #endif363 358 Void xCheckParameter (); ///< check validity of configuration values 364 359 Void xPrintParameter (); ///< print configuration values … … 397 392 Int getNumLayer() {return m_numLayers; } 398 393 Int getGOPSize() {return m_iGOPSize; } 394 #if O0194_DIFFERENT_BITDEPTH_EL_BL 395 UInt getInternalBitDepthY(Int iLayer) {return m_acLayerCfg[iLayer].m_internalBitDepthY; } 396 UInt getInternalBitDepthC(Int iLayer) {return m_acLayerCfg[iLayer].m_internalBitDepthC; } 397 #else 399 398 UInt getInternalBitDepthY() {return m_internalBitDepthY; } 400 399 UInt getInternalBitDepthC() {return m_internalBitDepthC; } 401 # if !LAYER_CTB400 #endif 402 401 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 403 402 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 404 403 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 405 #endif406 404 Int getDecodingRefreshType() {return m_iDecodingRefreshType; } 407 405 Int getWaveFrontSynchro() { return m_iWaveFrontSynchro; } … … 410 408 Char* getBLSyntaxFile() { return m_BLSyntaxFile; } 411 409 #endif 410 #if SCALED_REF_LAYER_OFFSETS 412 411 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 412 #endif 413 413 #if REPN_FORMAT_IN_VPS 414 414 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } 415 415 #endif 416 #if LAYER_CTB417 Bool getUsePCM() { return m_usePCM; }418 UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; }419 #endif420 416 #endif 421 417 };// END CLASS DEFINITION TAppEncCfg -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r448 r466 38 38 m_confLeft = m_confRight = m_confTop = m_confBottom = 0; 39 39 m_aiPad[1] = m_aiPad[0] = 0; 40 #if SCALED_REF_LAYER_OFFSETS 40 41 m_numScaledRefLayerOffsets = 0; 41 42 ::memset(m_scaledRefLayerLeftOffset, 0, sizeof(m_scaledRefLayerLeftOffset)); … … 43 44 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 44 45 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 46 #endif 45 47 } 46 48 … … 140 142 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 141 143 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 142 #if LAYER_CTB143 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );144 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );145 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter);146 printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra);147 #endif148 144 printf("QP : %5.2f\n", m_fQP ); 149 145 printf("Intra period : %d\n", m_iIntraPeriod ); … … 161 157 #endif 162 158 printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_cAppEncCfg->getWaveFrontSynchro(), m_iWaveFrontSubstreams); 163 #if LAYER_CTB164 printf("PCM:%d ", (m_cAppEncCfg->getUsePCM() && (1<<m_cAppEncCfg->getPCMLog2MinSize()) <= m_uiMaxCUWidth)? 1 : 0);165 #endif166 159 } 167 160 … … 182 175 { 183 176 // automatic padding to minimum CU size 184 #if LAYER_CTB185 Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1);186 #else187 177 Int minCuSize = m_cAppEncCfg->getMaxCUHeight() >> (m_cAppEncCfg->getMaxCUDepth() - 1); 188 #endif189 178 if (m_iSourceWidth % minCuSize) 190 179 { … … 251 240 } 252 241 253 #if LAYER_CTB254 UInt maxCUWidth = m_uiMaxCUWidth;255 UInt maxCUHeight = m_uiMaxCUHeight;256 UInt maxCUDepth = m_uiMaxCUDepth;257 #else258 242 UInt maxCUWidth = m_cAppEncCfg->getMaxCUWidth(); 259 243 UInt maxCUHeight = m_cAppEncCfg->getMaxCUHeight(); 260 244 UInt maxCUDepth = m_cAppEncCfg->getMaxCUDepth(); 261 #endif262 245 bool check_failed = false; /* abort if there is a fatal configuration problem */ 263 246 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) … … 272 255 } 273 256 257 #if O0194_DIFFERENT_BITDEPTH_EL_BL 258 for(UInt layer = 0; layer < MAX_LAYERS; layer++){ 259 xConfirmPara( m_iQP < -6 * ((Int)m_cAppEncCfg->getInternalBitDepthY(layer) - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 260 } 261 #else 274 262 xConfirmPara( m_iQP < -6 * ((Int)m_cAppEncCfg->getInternalBitDepthY() - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 275 276 277 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1; 263 #endif 264 265 266 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + m_cAppEncCfg->getMaxCUHeight() - 1) / m_cAppEncCfg->getMaxCUHeight() : 1; 278 267 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); 279 268 xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_cAppEncCfg->getWaveFrontSynchro(), "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); … … 290 279 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 291 280 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 292 293 #if LAYER_CTB294 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8");295 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8");296 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16");297 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16");298 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater.");299 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller.");300 xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");301 xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");302 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS303 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS304 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." );305 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." );306 xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" );307 xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthInter - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );308 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );309 xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );310 311 // max CU width and height should be power of 2312 UInt ui = m_uiMaxCUWidth;313 while(ui)314 {315 ui >>= 1;316 if( (ui & 1) == 1)317 xConfirmPara( ui != 1 , "Width should be 2^n");318 }319 ui = m_uiMaxCUHeight;320 while(ui)321 {322 ui >>= 1;323 if( (ui & 1) == 1)324 xConfirmPara( ui != 1 , "Height should be 2^n");325 }326 #endif327 328 281 #undef xConfirmPara 329 282 return check_failed; 330 283 } 331 284 332 #endif //SVC_EXTENSION285 #endif 333 286 334 287 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r448 r466 43 43 Int m_iIntraPeriod; ///< period of I-slice (random access period) 44 44 Double m_fQP; ///< QP value of key-picture (floating point) 45 #if SVC_EXTENSION46 45 #if VPS_EXTN_DIRECT_REF_LAYERS 47 46 #if M0457_PREDICTION_INDICATIONS … … 56 55 Int *m_predLayerIds; 57 56 Int m_numActiveRefLayers; 58 #endif59 60 #if LAYER_CTB61 // coding unit (CU) definition62 UInt m_uiMaxCUWidth; ///< max. CU width in pixel63 UInt m_uiMaxCUHeight; ///< max. CU height in pixel64 UInt m_uiMaxCUDepth; ///< max. CU depth65 66 // transfom unit (TU) definition67 UInt m_uiQuadtreeTULog2MaxSize;68 UInt m_uiQuadtreeTULog2MinSize;69 70 UInt m_uiQuadtreeTUMaxDepthInter;71 UInt m_uiQuadtreeTUMaxDepthIntra;72 57 #endif 73 58 … … 85 70 Int m_maxTidIlRefPicsPlus1; 86 71 #endif 72 #if SVC_EXTENSION 87 73 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 88 #endif //SVC_EXTENSION74 #endif 89 75 90 76 Int m_iQP; ///< QP value of key-picture (integer) … … 92 78 Int* m_aidQP; ///< array of slice QP values 93 79 TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config 94 #if S VC_EXTENSION80 #if SCALED_REF_LAYER_OFFSETS 95 81 Int m_numScaledRefLayerOffsets ; 96 82 Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; … … 98 84 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 99 85 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 86 #endif 100 87 #if FINAL_RPL_CHANGE_N0082 101 88 GOPEntry m_GOPListLayer[MAX_GOP]; ///< for layer 89 #endif 90 #if O0194_DIFFERENT_BITDEPTH_EL_BL 91 Int m_inputBitDepthY; ///< bit-depth of input file (luma component) 92 Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) 93 Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) 94 Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) 95 Int m_outputBitDepthY; ///< bit-depth of output file (luma component) 96 Int m_outputBitDepthC; ///< bit-depth of output file (chroma component) 102 97 #endif 103 98 #if REPN_FORMAT_IN_VPS 104 99 Int m_repFormatIdx; 105 100 #endif 106 #endif //SVC_EXTENSION107 101 public: 108 102 TAppEncLayerCfg(); … … 139 133 Int getIntQP() {return m_iQP; } 140 134 Int* getdQPs() {return m_aidQP; } 141 #if SVC_EXTENSION142 135 #if VPS_EXTN_DIRECT_REF_LAYERS 143 136 #if M0457_PREDICTION_INDICATIONS … … 178 171 #if N0120_MAX_TID_REF_CFG 179 172 Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } 180 #endif 181 #if LAYER_CTB 182 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 183 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 184 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 185 #endif 186 #endif //SVC_EXTENSION 173 #endif 187 174 }; // END CLASS DEFINITION TAppEncLayerCfg 188 175 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
r464 r466 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 117 117 } 118 118 119 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 119 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 120 120 vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() ); 121 121 maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx ); … … 141 141 for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++) 142 142 { 143 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 143 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 144 144 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() ); 145 145 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() ); 146 146 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 147 147 repFormat->setSeparateColourPlaneVpsFlag( 0 ); // Need modification to change for each layer 148 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 149 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY(mapIdxToLayer[idx]) ); // Need modification to change for each layer 150 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC(mapIdxToLayer[idx]) ); // Need modification to change for each layer 151 #else 148 152 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY() ); // Need modification to change for each layer 149 153 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC() ); // Need modification to change for each layer 154 #endif 150 155 } 151 156 delete [] mapIdxToLayer; … … 153 158 for(UInt layer=0; layer<m_numLayers; layer++) 154 159 { 160 #if O0194_DIFFERENT_BITDEPTH_EL_BL 161 //1 162 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 163 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 164 165 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 166 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 167 168 // Set this to be used in Upsampling filter in function "TComUpsampleFilter::upsampleBasePic" 169 g_bitDepthYLayer[layer] = g_bitDepthY; 170 g_bitDepthCLayer[layer] = g_bitDepthC; 171 #endif 155 172 //m_acTEncTop[layer].setVPS(&vps); 156 173 m_acTEncTop[layer].setFrameRate ( m_acLayerCfg[layer].getFrameRate() ); … … 187 204 #endif 188 205 #endif 189 // set layer ID 190 m_acTEncTop[layer].setLayerId ( layer ); 206 // set layer ID 207 m_acTEncTop[layer].setLayerId ( layer ); 191 208 m_acTEncTop[layer].setNumLayer ( m_numLayers ); 192 209 m_acTEncTop[layer].setLayerEnc(m_apcTEncTop); … … 220 237 if (layer<m_numLayers-1) 221 238 { 222 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 223 } 224 #endif 239 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 240 } 241 #endif 225 242 #if VPS_EXTN_DIRECT_REF_LAYERS 226 243 if(layer) … … 241 258 else 242 259 { 243 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 260 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 244 261 for(Int i = 0; i < m_acTEncTop[layer].getNumSamplePredRefLayers(); i++) 245 262 { 246 263 m_acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i)); 247 264 m_acTEncTop[layer].setSamplePredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true); 248 } 265 } 249 266 } 250 267 if(m_acLayerCfg[layer].getNumMotionPredRefLayers() == -1) … … 257 274 else 258 275 { 259 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 276 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 260 277 for(Int i = 0; i < m_acTEncTop[layer].getNumMotionPredRefLayers(); i++) 261 278 { 262 279 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i)); 263 280 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true); 264 } 281 } 265 282 } 266 283 Int numDirectRefLayers = 0; … … 283 300 else 284 301 { 285 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 302 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 286 303 for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++) 287 304 { … … 304 321 else 305 322 { 306 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 323 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 307 324 for(Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++) 308 325 { … … 358 375 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS ); 359 376 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty ); 360 #if LAYER_CTB361 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize );362 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize );363 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter );364 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra );365 #else366 377 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 367 378 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 368 379 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 369 380 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 370 #endif371 381 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 372 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 382 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 373 383 m_acTEncTop[layer].setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 374 384 m_acTEncTop[layer].setUseCbfFastMode ( m_bUseCbfFastMode ); … … 390 400 m_acTEncTop[layer].setUseWP ( m_useWeightedPred ); 391 401 m_acTEncTop[layer].setWPBiPred ( m_useWeightedBiPred ); 402 #if O0194_WEIGHTED_PREDICTION_CGS 403 if (layer!=0){ 404 // Enable weighted prediction for enhancement layer 405 m_acTEncTop[layer].setUseWP ( true ); 406 m_acTEncTop[layer].setWPBiPred ( true ); 407 } 408 #endif 392 409 //====== Parallel Merge Estimation ======== 393 410 m_acTEncTop[layer].setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 ); … … 400 417 m_acTEncTop[layer].setSliceSegmentMode ( m_sliceSegmentMode ); 401 418 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 402 #if LAYER_CTB403 Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1);404 #else405 419 Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); 406 #endif407 420 if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) 408 421 { … … 428 441 m_acTEncTop[layer].setSaoLcuBoundary (m_saoLcuBoundary); 429 442 m_acTEncTop[layer].setSaoLcuBasedOptimization (m_saoLcuBasedOptimization); 430 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 431 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 443 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 444 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 432 445 433 446 m_acTEncTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); … … 494 507 if(uiTilesCount == 1) 495 508 { 496 m_bLFCrossTileBoundaryFlag = true; 509 m_bLFCrossTileBoundaryFlag = true; 497 510 } 498 511 m_acTEncTop[layer].setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); … … 530 543 m_acTEncTop[layer].setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 531 544 m_acTEncTop[layer].setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 532 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 545 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 533 546 m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 534 547 m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc ); … … 561 574 m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 562 575 m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled); 576 #if SCALED_REF_LAYER_OFFSETS 563 577 if( layer > 0 ) 564 578 { … … 567 581 { 568 582 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 569 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 570 } 571 } 583 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 584 } 585 } 586 #endif 572 587 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 573 588 m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange ); … … 575 590 } 576 591 } 577 #else //SVC_EXTENSION592 #else 578 593 Void TAppEncTop::xInitLibCfg() 579 594 { … … 680 695 m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 681 696 m_cTEncTop.setUseFastEnc ( m_bUseFastEnc ); 682 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 697 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 683 698 m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 684 699 m_cTEncTop.setUseCbfFastMode ( m_bUseCbfFastMode ); … … 734 749 m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary); 735 750 m_cTEncTop.setSaoLcuBasedOptimization (m_saoLcuBasedOptimization); 736 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 737 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 751 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 752 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 738 753 739 754 m_cTEncTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); … … 792 807 if(uiTilesCount == 1) 793 808 { 794 m_bLFCrossTileBoundaryFlag = true; 809 m_bLFCrossTileBoundaryFlag = true; 795 810 } 796 811 m_cTEncTop.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); … … 818 833 m_cTEncTop.setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 819 834 m_cTEncTop.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 820 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 835 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 821 836 m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 822 837 m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc ); … … 849 864 m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 850 865 } 851 #endif //SVC_EXTENSION866 #endif 852 867 853 868 Void TAppEncTop::xCreateLib() … … 860 875 for(UInt layer=0; layer<m_numLayers; layer++) 861 876 { 862 #if LAYER_CTB 863 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 864 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 865 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 866 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 867 #endif 877 #if O0194_DIFFERENT_BITDEPTH_EL_BL 878 //2 879 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 880 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 881 882 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 883 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 884 #endif 885 #if O0194_DIFFERENT_BITDEPTH_EL_BL 886 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_acLayerCfg[layer].m_inputBitDepthY, m_acLayerCfg[layer].m_inputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC ); // read mode 887 #else 868 888 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 889 #endif 869 890 m_acTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1]); 870 891 871 892 if (!m_acLayerCfg[layer].getReconFile().empty()) 872 893 { 894 #if O0194_DIFFERENT_BITDEPTH_EL_BL 895 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_acLayerCfg[layer].m_outputBitDepthY, m_acLayerCfg[layer].m_outputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC ); // write mode 896 #else 873 897 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // write mode 898 #endif 874 899 } 875 900 876 901 m_acTEncTop[layer].create(); 877 902 } 878 #else //SVC_EXTENSION903 #else 879 904 m_cTVideoIOYuvInputFile.open( m_pchInputFile, false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 880 905 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]); … … 885 910 // Neo Decoder 886 911 m_cTEncTop.create(); 887 #endif //SVC_EXTENSION912 #endif 888 913 } 889 914 … … 897 922 for(UInt layer=0; layer<m_numLayers; layer++) 898 923 { 899 #if LAYER_CTB900 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer];901 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];902 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer];903 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer];904 #endif905 906 924 m_acTVideoIOYuvInputFile[layer].close(); 907 925 m_acTVideoIOYuvReconFile[layer].close(); … … 909 927 m_acTEncTop[layer].destroy(); 910 928 } 911 #else //SVC_EXTENSION929 #else 912 930 m_cTVideoIOYuvInputFile.close(); 913 931 m_cTVideoIOYuvReconFile.close(); … … 915 933 // Neo Decoder 916 934 m_cTEncTop.destroy(); 917 #endif //SVC_EXTENSION935 #endif 918 936 } 919 937 … … 923 941 for(UInt layer=0; layer<m_numLayers; layer++) 924 942 { 925 #if LAYER_CTB 926 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 927 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 928 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 929 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 930 931 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 932 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 933 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 934 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 943 #if O0194_DIFFERENT_BITDEPTH_EL_BL 944 //3 945 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 946 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 947 948 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 949 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 935 950 #endif 936 951 m_acTEncTop[layer].init(isFieldCoding); … … 948 963 for(Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 949 964 { 965 #if O0194_DIFFERENT_BITDEPTH_EL_BL 966 //4 967 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 968 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 969 970 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 971 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 972 #endif 950 973 vps->setLayerIdIncludedFlag(true, setId, layerId); 951 974 } … … 963 986 vps->setScalabilityMask(i, false); 964 987 } 965 if(m_numLayers > 1) 988 if(m_numLayers > 1) 966 989 { 967 990 Int scalabilityTypes = 0; … … 996 1019 #if N0120_MAX_TID_REF_CFG 997 1020 vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag); 998 #else 1021 #else 999 1022 vps->setMaxTidRefPresentFlag(true); 1000 #endif 1023 #endif 1001 1024 if (vps->getMaxTidRefPresentFlag()) 1002 1025 { … … 1004 1027 { 1005 1028 #if N0120_MAX_TID_REF_CFG 1006 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 1007 #else 1029 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 1030 #else 1008 1031 vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1); 1009 #endif 1032 #endif 1010 1033 } 1011 1034 } … … 1017 1040 } 1018 1041 } 1019 #endif 1042 #endif 1020 1043 #if ILP_SSH_SIG 1021 1044 #if ILP_SSH_SIG_FIX … … 1035 1058 #endif 1036 1059 // Target output layer 1037 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1038 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1060 #if VPS_PROFILE_OUTPUT_LAYERS 1061 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1062 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1039 1063 vps->setDefaultOneTargetOutputLayerFlag(true); 1040 1064 for(i = 1; i < vps->getNumLayerSets(); i++) 1041 1065 { 1042 1066 vps->setProfileLevelTierIdx(i, i); 1043 vps->setOutputLayerSetIdx(i, i); 1044 } 1045 1067 vps->setOutputLayerSetIdx(i, i); 1068 } 1069 #else 1070 vps->setNumOutputLayerSets(1); 1071 Int lsIdx = 1; 1072 vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set 1073 #endif 1046 1074 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++) 1047 1075 { 1048 // Include the highest layer as output layer 1076 // Include the highest layer as output layer 1049 1077 for(UInt layer=0; layer <= vps->getMaxLayerId() ; layer++) 1050 1078 { … … 1105 1133 #endif 1106 1134 #endif 1107 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1108 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1109 #endif 1110 #if N0147_IRAP_ALIGN_FLAG 1111 vps->setCrossLayerIrapAlignFlag(true); 1135 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1136 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1137 #endif 1138 #if N0147_IRAP_ALIGN_FLAG 1139 vps->setCrossLayerIrapAlignFlag(true); 1112 1140 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1113 1141 { … … 1115 1143 { 1116 1144 if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr)) 1117 { 1145 { 1118 1146 if(m_acTEncTop[layerCtr].getIntraPeriod() != m_acTEncTop[refLayerCtr].getIntraPeriod()) 1119 1147 { … … 1129 1157 vps->setCrossLayerIrapAlignFlag(false); 1130 1158 } 1131 #endif 1159 #endif 1132 1160 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1133 1161 vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false); … … 1187 1215 for(UInt layer=0; layer<m_numLayers; layer++) 1188 1216 { 1217 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1218 //5 1219 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1220 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1221 1222 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1223 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1224 #endif 1189 1225 // allocate original YUV buffer 1190 1226 pcPicYuvOrg[layer] = new TComPicYuv; … … 1192 1228 { 1193 1229 #if SVC_UPSAMPLING 1194 #if LAYER_CTB1195 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL );1196 #else1197 1230 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1198 #endif1199 1231 #else 1200 1232 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1204 1236 { 1205 1237 #if SVC_UPSAMPLING 1206 #if LAYER_CTB1207 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL );1208 #else1209 1238 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1210 #endif1211 1239 #else 1212 1240 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1237 1265 while ( !bEos ) 1238 1266 { 1239 // Read enough frames 1267 // Read enough frames 1240 1268 Bool bFramesReadyToCode = false; 1241 1269 while(!bFramesReadyToCode) … … 1243 1271 for(UInt layer=0; layer<m_numLayers; layer++) 1244 1272 { 1245 #if LAYER_CTB 1246 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1247 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1248 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1249 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1250 #endif 1251 1273 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1274 //6 1275 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1276 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1277 1278 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1279 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1280 #endif 1252 1281 // get buffers 1253 1282 xGetBuffer(pcPicYuvRec, layer); … … 1311 1340 #endif 1312 1341 1313 // loop through frames in one GOP 1342 // loop through frames in one GOP 1314 1343 for ( UInt iPicIdInGOP=0; iPicIdInGOP < (bFirstFrame? 1:m_iGOPSize); iPicIdInGOP++ ) 1315 1344 { … … 1317 1346 for(UInt layer=0; layer<m_numLayers; layer++) 1318 1347 { 1319 #if LAYER_CTB 1320 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1321 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1322 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1323 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1324 1325 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 1326 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 1327 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 1328 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 1348 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1349 //7 1350 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1351 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1352 1353 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1354 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1329 1355 #endif 1330 1356 // call encoding function for one frame … … 1353 1379 for(UInt layer=0; layer<m_numLayers; layer++) 1354 1380 { 1381 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1382 //8 1383 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1384 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1385 1386 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1387 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1388 #endif 1355 1389 // write bistream to file if necessary 1356 1390 iNumEncoded = m_acTEncTop[layer].getNumPicRcvd(); … … 1593 1627 1594 1628 #if SVC_UPSAMPLING 1595 #if LAYER_CTB1596 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL );1597 #else1598 1629 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1599 #endif1600 1630 #else 1601 1631 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1620 1650 delete pcPicYuvRec; pcPicYuvRec = NULL; 1621 1651 } 1622 } 1652 } 1623 1653 } 1624 1654 … … 1671 1701 #endif 1672 1702 { 1673 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1703 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1674 1704 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 1675 1705 } … … 1691 1721 for ( i = 0; i < iNumEncoded/2; i++ ) 1692 1722 #endif 1693 { 1723 { 1694 1724 const AccessUnit& auTop = *(iterBitstream++); 1695 1725 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); -
branches/SHM-4.0-dev/source/Lib/TLibCommon/CommonDef.h
r442 r466 130 130 extern Int g_bitDepthY; 131 131 extern Int g_bitDepthC; 132 132 #if O0194_DIFFERENT_BITDEPTH_EL_BL 133 extern Int g_bitDepthYLayer[MAX_LAYERS]; 134 extern Int g_bitDepthCLayer[MAX_LAYERS]; 135 136 extern UInt g_uiPCMBitDepthLumaDec[MAX_LAYERS]; // PCM bit-depth 137 extern UInt g_uiPCMBitDepthChromaDec[MAX_LAYERS]; // PCM bit-depth 138 #endif 139 #if O0194_WEIGHTED_PREDICTION_CGS 140 extern void* g_refWeightACDCParam; //type:wpACDCParam 141 #endif 133 142 /** clip x, such that 0 <= x <= #g_maxLumaVal */ 134 143 template <typename T> inline T ClipY(T x) { return std::min<T>(T((1 << g_bitDepthY)-1), std::max<T>( T(0), x)); } -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
r448 r466 4004 4004 uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY); 4005 4005 4006 #if !LAYER_CTB4007 4006 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4008 #endif 4009 4007 4008 #if SCALED_REF_LAYER_OFFSETS 4010 4009 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 4011 4010 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 4012 4011 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4013 4012 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4013 #else 4014 Int iBX = (uiPelX*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4015 Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4016 #endif 4014 4017 4015 4018 #if N0139_POSITION_ROUNDING_OFFSET … … 4021 4024 #endif 4022 4025 4026 #if SCALED_REF_LAYER_OFFSETS 4023 4027 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() || 4024 4028 iBX < 0 || iBY < 0 ) 4029 #else 4030 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight()) 4031 #endif 4025 4032 { 4026 4033 return NULL; 4027 4034 } 4028 4035 4029 #if LAYER_CTB4030 UInt baseMaxCUHeight = cBaseColPic->getPicSym()->getMaxCUHeight();4031 UInt baseMaxCUWidth = cBaseColPic->getPicSym()->getMaxCUWidth();4032 UInt baseMinUnitSize = cBaseColPic->getMinCUWidth();4033 4034 uiCUAddrBase = ( iBY / cBaseColPic->getPicSym()->getMaxCUHeight() ) * cBaseColPic->getFrameWidthInCU() + ( iBX / cBaseColPic->getPicSym()->getMaxCUWidth() );4035 #else4036 4036 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 4037 #endif4038 4037 4039 4038 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame()); 4040 4039 4041 #if LAYER_CTB4042 UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * cBaseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize;4043 4044 uiAbsPartIdxBase = g_auiLayerRasterToZscan[cBaseColPic->getLayerId()][uiRasterAddrBase];4045 #else4046 4040 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth() 4047 4041 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 4048 4042 4049 4043 uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase]; 4050 #endif4051 4044 4052 4045 return cBaseColPic->getCU(uiCUAddrBase); -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicSym.h
r445 r466 126 126 TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcTComDataCU[uiCUAddr]; } 127 127 128 #if LAYER_CTB129 UInt getMaxCUWidth() { return m_uiMaxCUWidth; }130 UInt getMaxCUHeight() { return m_uiMaxCUHeight; }131 #endif132 133 128 #if AVC_SYNTAX 134 129 UInt getMaxCUWidth() { return m_uiMaxCUWidth; } -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r445 r466 90 90 Int numCuInHeight = m_iPicHeight / m_iCuHeight + (m_iPicHeight % m_iCuHeight != 0); 91 91 92 #if LAYER_CTB93 m_iLumaMarginX = uiMaxCUWidth + 16; // for 16-byte alignment94 m_iLumaMarginY = uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding95 #else96 92 m_iLumaMarginX = g_uiMaxCUWidth + 16; // for 16-byte alignment 97 93 m_iLumaMarginY = g_uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 98 #endif99 94 100 95 m_iChromaMarginX = m_iLumaMarginX>>1; -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComRdCost.cpp
r313 r466 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 61 61 Double dRdCost = 0.0; 62 62 Double dLambda = 0.0; 63 63 64 64 switch ( eDFunc ) 65 65 { … … 80 80 break; 81 81 } 82 82 83 83 if (bFlag) 84 84 { … … 107 107 } 108 108 } 109 109 110 110 return dRdCost; 111 111 } … … 115 115 Double dRdCost = 0.0; 116 116 Double dLambda = 0.0; 117 117 118 118 switch ( eDFunc ) 119 119 { … … 134 134 break; 135 135 } 136 136 137 137 if (bFlag) 138 138 { … … 161 161 } 162 162 } 163 163 164 164 return dRdCost; 165 165 } … … 178 178 { 179 179 m_afpDistortFunc[0] = NULL; // for DF_DEFAULT 180 180 181 181 m_afpDistortFunc[1] = TComRdCost::xGetSSE; 182 182 m_afpDistortFunc[2] = TComRdCost::xGetSSE4; … … 186 186 m_afpDistortFunc[6] = TComRdCost::xGetSSE64; 187 187 m_afpDistortFunc[7] = TComRdCost::xGetSSE16N; 188 188 189 189 m_afpDistortFunc[8] = TComRdCost::xGetSAD; 190 190 m_afpDistortFunc[9] = TComRdCost::xGetSAD4; … … 194 194 m_afpDistortFunc[13] = TComRdCost::xGetSAD64; 195 195 m_afpDistortFunc[14] = TComRdCost::xGetSAD16N; 196 196 197 197 m_afpDistortFunc[15] = TComRdCost::xGetSAD; 198 198 m_afpDistortFunc[16] = TComRdCost::xGetSAD4; … … 202 202 m_afpDistortFunc[20] = TComRdCost::xGetSAD64; 203 203 m_afpDistortFunc[21] = TComRdCost::xGetSAD16N; 204 204 205 205 #if AMP_SAD 206 206 m_afpDistortFunc[43] = TComRdCost::xGetSAD12; … … 219 219 m_afpDistortFunc[27] = TComRdCost::xGetHADs; 220 220 m_afpDistortFunc[28] = TComRdCost::xGetHADs; 221 221 222 222 #if !FIX203 223 223 m_puiComponentCostOriginP = NULL; … … 239 239 iSubPelSearchLimit += 4; 240 240 iSubPelSearchLimit *= 8; 241 241 242 242 if( m_iSearchLimit != iSubPelSearchLimit ) 243 243 { 244 244 xUninit(); 245 245 246 246 m_iSearchLimit = iSubPelSearchLimit; 247 247 248 248 m_puiComponentCostOriginP = new UInt[ 4 * iSubPelSearchLimit ]; 249 249 iSubPelSearchLimit *= 2; 250 250 251 251 m_puiComponentCost = m_puiComponentCostOriginP + iSubPelSearchLimit; 252 252 253 253 for( Int n = -iSubPelSearchLimit; n < iSubPelSearchLimit; n++) 254 254 { … … 272 272 UInt uiLength = 1; 273 273 UInt uiTemp = ( iVal <= 0) ? (-iVal<<1)+1: (iVal<<1); 274 274 275 275 assert ( uiTemp ); 276 276 277 277 while ( 1 != uiTemp ) 278 278 { … … 280 280 uiLength += 2; 281 281 } 282 282 283 283 return uiLength; 284 284 } … … 290 290 rcDistParam.iRows = uiBlkHeight; 291 291 rcDistParam.DistFunc = m_afpDistortFunc[eDFunc + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 292 292 293 293 // initialize 294 294 rcDistParam.iSubShift = 0; … … 301 301 rcDistParam.pOrg = pcPatternKey->getROIY(); 302 302 rcDistParam.pCur = piRefY; 303 303 304 304 rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); 305 305 rcDistParam.iStrideCur = iRefStride; 306 306 307 307 // set Block Width / Height 308 308 rcDistParam.iCols = pcPatternKey->getROIYWidth(); 309 309 rcDistParam.iRows = pcPatternKey->getROIYHeight(); 310 310 rcDistParam.DistFunc = m_afpDistortFunc[DF_SAD + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 311 311 312 312 #if AMP_SAD 313 313 if (rcDistParam.iCols == 12) … … 336 336 #endif 337 337 { 338 #if O0194_WEIGHTED_PREDICTION_CGS 339 // Bug fix: The correct bit depth has not been used for weighted cost calculation 340 rcDistParam.bitDepth = g_bitDepthY; 341 #endif 338 342 // set Original & Curr Pointer / Stride 339 343 rcDistParam.pOrg = pcPatternKey->getROIY(); 340 344 rcDistParam.pCur = piRefY; 341 345 342 346 rcDistParam.iStrideOrg = pcPatternKey->getPatternLStride(); 343 347 rcDistParam.iStrideCur = iRefStride * iStep; 344 348 345 349 // set Step for interpolated buffer 346 350 rcDistParam.iStep = iStep; 347 351 348 352 // set Block Width / Height 349 353 rcDistParam.iCols = pcPatternKey->getROIYWidth(); … … 352 356 rcDistParam.bUseNSHAD = bUseNSHAD; 353 357 #endif 354 358 355 359 // set distortion function 356 360 if ( !bHADME ) … … 376 380 rcDistParam.DistFunc = m_afpDistortFunc[DF_HADS + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 377 381 } 378 382 379 383 // initialize 380 384 rcDistParam.iSubShift = 0; … … 407 411 UInt uiSum = 0; 408 412 Int x, y; 409 413 410 414 if ( ( (iWidth % 8) == 0 ) && ( (iHeight % 8) == 0 ) ) 411 415 { … … 444 448 } 445 449 } 446 450 447 451 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8); 448 452 … … 523 527 Int iStrideCur = pcDtParam->iStrideCur; 524 528 Int iStrideOrg = pcDtParam->iStrideOrg; 525 526 UInt uiSum = 0; 527 529 530 UInt uiSum = 0; 531 528 532 for( ; iRows != 0; iRows-- ) 529 533 { … … 535 539 piCur += iStrideCur; 536 540 } 537 541 538 542 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 539 543 } … … 541 545 UInt TComRdCost::xGetSAD4( DistParam* pcDtParam ) 542 546 { 543 if ( pcDtParam->bApplyWeight ) 547 if ( pcDtParam->bApplyWeight ) 544 548 { 545 549 return xGetSADw( pcDtParam ); … … 552 556 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 553 557 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 554 555 UInt uiSum = 0; 556 558 559 UInt uiSum = 0; 560 557 561 for( ; iRows != 0; iRows-=iSubStep ) 558 562 { … … 561 565 uiSum += abs( piOrg[2] - piCur[2] ); 562 566 uiSum += abs( piOrg[3] - piCur[3] ); 563 564 piOrg += iStrideOrg; 565 piCur += iStrideCur; 566 } 567 567 568 piOrg += iStrideOrg; 569 piCur += iStrideCur; 570 } 571 568 572 uiSum <<= iSubShift; 569 573 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 583 587 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 584 588 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 585 586 UInt uiSum = 0; 587 589 590 UInt uiSum = 0; 591 588 592 for( ; iRows != 0; iRows-=iSubStep ) 589 593 { … … 596 600 uiSum += abs( piOrg[6] - piCur[6] ); 597 601 uiSum += abs( piOrg[7] - piCur[7] ); 598 599 piOrg += iStrideOrg; 600 piCur += iStrideCur; 601 } 602 602 603 piOrg += iStrideOrg; 604 piCur += iStrideCur; 605 } 606 603 607 uiSum <<= iSubShift; 604 608 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 618 622 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 619 623 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 620 621 UInt uiSum = 0; 622 624 625 UInt uiSum = 0; 626 623 627 for( ; iRows != 0; iRows-=iSubStep ) 624 628 { … … 639 643 uiSum += abs( piOrg[14] - piCur[14] ); 640 644 uiSum += abs( piOrg[15] - piCur[15] ); 641 642 piOrg += iStrideOrg; 643 piCur += iStrideCur; 644 } 645 645 646 piOrg += iStrideOrg; 647 piCur += iStrideCur; 648 } 649 646 650 uiSum <<= iSubShift; 647 651 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 662 666 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 663 667 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 664 665 UInt uiSum = 0; 666 668 669 UInt uiSum = 0; 670 667 671 for( ; iRows != 0; iRows-=iSubStep ) 668 672 { … … 679 683 uiSum += abs( piOrg[10] - piCur[10] ); 680 684 uiSum += abs( piOrg[11] - piCur[11] ); 681 682 piOrg += iStrideOrg; 683 piCur += iStrideCur; 684 } 685 685 686 piOrg += iStrideOrg; 687 piCur += iStrideCur; 688 } 689 686 690 uiSum <<= iSubShift; 687 691 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 699 703 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 700 704 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 701 702 UInt uiSum = 0; 703 705 706 UInt uiSum = 0; 707 704 708 for( ; iRows != 0; iRows-=iSubStep ) 705 709 { … … 726 730 piCur += iStrideCur; 727 731 } 728 732 729 733 uiSum <<= iSubShift; 730 734 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 744 748 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 745 749 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 746 747 UInt uiSum = 0; 748 750 751 UInt uiSum = 0; 752 749 753 for( ; iRows != 0; iRows-=iSubStep ) 750 754 { … … 781 785 uiSum += abs( piOrg[30] - piCur[30] ); 782 786 uiSum += abs( piOrg[31] - piCur[31] ); 783 784 piOrg += iStrideOrg; 785 piCur += iStrideCur; 786 } 787 787 788 piOrg += iStrideOrg; 789 piCur += iStrideCur; 790 } 791 788 792 uiSum <<= iSubShift; 789 793 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 804 808 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 805 809 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 806 807 UInt uiSum = 0; 808 810 811 UInt uiSum = 0; 812 809 813 for( ; iRows != 0; iRows-=iSubStep ) 810 814 { … … 833 837 uiSum += abs( piOrg[22] - piCur[22] ); 834 838 uiSum += abs( piOrg[23] - piCur[23] ); 835 836 piOrg += iStrideOrg; 837 piCur += iStrideCur; 838 } 839 839 840 piOrg += iStrideOrg; 841 piCur += iStrideCur; 842 } 843 840 844 uiSum <<= iSubShift; 841 845 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 857 861 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 858 862 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 859 860 UInt uiSum = 0; 861 863 864 UInt uiSum = 0; 865 862 866 for( ; iRows != 0; iRows-=iSubStep ) 863 867 { … … 926 930 uiSum += abs( piOrg[62] - piCur[62] ); 927 931 uiSum += abs( piOrg[63] - piCur[63] ); 928 929 piOrg += iStrideOrg; 930 piCur += iStrideCur; 931 } 932 932 933 piOrg += iStrideOrg; 934 piCur += iStrideCur; 935 } 936 933 937 uiSum <<= iSubShift; 934 938 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 949 953 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 950 954 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 951 952 UInt uiSum = 0; 953 955 956 UInt uiSum = 0; 957 954 958 for( ; iRows != 0; iRows-=iSubStep ) 955 959 { … … 1002 1006 uiSum += abs( piOrg[46] - piCur[46] ); 1003 1007 uiSum += abs( piOrg[47] - piCur[47] ); 1004 1005 piOrg += iStrideOrg; 1006 piCur += iStrideCur; 1007 } 1008 1008 1009 piOrg += iStrideOrg; 1010 piCur += iStrideCur; 1011 } 1012 1009 1013 uiSum <<= iSubShift; 1010 1014 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); … … 1028 1032 Int iStrideOrg = pcDtParam->iStrideOrg; 1029 1033 Int iStrideCur = pcDtParam->iStrideCur; 1030 1034 1031 1035 UInt uiSum = 0; 1032 1036 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1033 1037 1034 1038 Int iTemp; 1035 1039 1036 1040 for( ; iRows != 0; iRows-- ) 1037 1041 { … … 1044 1048 piCur += iStrideCur; 1045 1049 } 1046 1050 1047 1051 return ( uiSum ); 1048 1052 } … … 1060 1064 Int iStrideOrg = pcDtParam->iStrideOrg; 1061 1065 Int iStrideCur = pcDtParam->iStrideCur; 1062 1066 1063 1067 UInt uiSum = 0; 1064 1068 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1065 1069 1066 1070 Int iTemp; 1067 1071 1068 1072 for( ; iRows != 0; iRows-- ) 1069 1073 { 1070 1074 1071 1075 iTemp = piOrg[0] - piCur[0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1072 1076 iTemp = piOrg[1] - piCur[1]; uiSum += ( iTemp * iTemp ) >> uiShift; 1073 1077 iTemp = piOrg[2] - piCur[2]; uiSum += ( iTemp * iTemp ) >> uiShift; 1074 1078 iTemp = piOrg[3] - piCur[3]; uiSum += ( iTemp * iTemp ) >> uiShift; 1075 1076 piOrg += iStrideOrg; 1077 piCur += iStrideCur; 1078 } 1079 1079 1080 piOrg += iStrideOrg; 1081 piCur += iStrideCur; 1082 } 1083 1080 1084 return ( uiSum ); 1081 1085 } … … 1093 1097 Int iStrideOrg = pcDtParam->iStrideOrg; 1094 1098 Int iStrideCur = pcDtParam->iStrideCur; 1095 1099 1096 1100 UInt uiSum = 0; 1097 1101 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1098 1102 1099 1103 Int iTemp; 1100 1104 1101 1105 for( ; iRows != 0; iRows-- ) 1102 1106 { … … 1109 1113 iTemp = piOrg[6] - piCur[6]; uiSum += ( iTemp * iTemp ) >> uiShift; 1110 1114 iTemp = piOrg[7] - piCur[7]; uiSum += ( iTemp * iTemp ) >> uiShift; 1111 1112 piOrg += iStrideOrg; 1113 piCur += iStrideCur; 1114 } 1115 1115 1116 piOrg += iStrideOrg; 1117 piCur += iStrideCur; 1118 } 1119 1116 1120 return ( uiSum ); 1117 1121 } … … 1129 1133 Int iStrideOrg = pcDtParam->iStrideOrg; 1130 1134 Int iStrideCur = pcDtParam->iStrideCur; 1131 1135 1132 1136 UInt uiSum = 0; 1133 1137 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1134 1138 1135 1139 Int iTemp; 1136 1140 1137 1141 for( ; iRows != 0; iRows-- ) 1138 1142 { 1139 1143 1140 1144 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1141 1145 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += ( iTemp * iTemp ) >> uiShift; … … 1154 1158 iTemp = piOrg[14] - piCur[14]; uiSum += ( iTemp * iTemp ) >> uiShift; 1155 1159 iTemp = piOrg[15] - piCur[15]; uiSum += ( iTemp * iTemp ) >> uiShift; 1156 1157 piOrg += iStrideOrg; 1158 piCur += iStrideCur; 1159 } 1160 1160 1161 piOrg += iStrideOrg; 1162 piCur += iStrideCur; 1163 } 1164 1161 1165 return ( uiSum ); 1162 1166 } … … 1174 1178 Int iStrideOrg = pcDtParam->iStrideOrg; 1175 1179 Int iStrideCur = pcDtParam->iStrideCur; 1176 1180 1177 1181 UInt uiSum = 0; 1178 1182 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1179 1183 Int iTemp; 1180 1184 1181 1185 for( ; iRows != 0; iRows-- ) 1182 1186 { 1183 1187 for (Int n = 0; n < iCols; n+=16 ) 1184 1188 { 1185 1189 1186 1190 iTemp = piOrg[n+ 0] - piCur[n+ 0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1187 1191 iTemp = piOrg[n+ 1] - piCur[n+ 1]; uiSum += ( iTemp * iTemp ) >> uiShift; … … 1200 1204 iTemp = piOrg[n+14] - piCur[n+14]; uiSum += ( iTemp * iTemp ) >> uiShift; 1201 1205 iTemp = piOrg[n+15] - piCur[n+15]; uiSum += ( iTemp * iTemp ) >> uiShift; 1202 1203 } 1204 piOrg += iStrideOrg; 1205 piCur += iStrideCur; 1206 } 1207 1206 1207 } 1208 piOrg += iStrideOrg; 1209 piCur += iStrideCur; 1210 } 1211 1208 1212 return ( uiSum ); 1209 1213 } … … 1221 1225 Int iStrideOrg = pcDtParam->iStrideOrg; 1222 1226 Int iStrideCur = pcDtParam->iStrideCur; 1223 1227 1224 1228 UInt uiSum = 0; 1225 1229 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1226 1230 Int iTemp; 1227 1231 1228 1232 for( ; iRows != 0; iRows-- ) 1229 1233 { 1230 1234 1231 1235 iTemp = piOrg[ 0] - piCur[ 0]; uiSum += ( iTemp * iTemp ) >> uiShift; 1232 1236 iTemp = piOrg[ 1] - piCur[ 1]; uiSum += ( iTemp * iTemp ) >> uiShift; … … 1261 1265 iTemp = piOrg[30] - piCur[30]; uiSum += ( iTemp * iTemp ) >> uiShift; 1262 1266 iTemp = piOrg[31] - piCur[31]; uiSum += ( iTemp * iTemp ) >> uiShift; 1263 1264 piOrg += iStrideOrg; 1265 piCur += iStrideCur; 1266 } 1267 1267 1268 piOrg += iStrideOrg; 1269 piCur += iStrideCur; 1270 } 1271 1268 1272 return ( uiSum ); 1269 1273 } … … 1281 1285 Int iStrideOrg = pcDtParam->iStrideOrg; 1282 1286 Int iStrideCur = pcDtParam->iStrideCur; 1283 1287 1284 1288 UInt uiSum = 0; 1285 1289 UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1); 1286 1290 Int iTemp; 1287 1291 1288 1292 for( ; iRows != 0; iRows-- ) 1289 1293 { … … 1352 1356 iTemp = piOrg[62] - piCur[62]; uiSum += ( iTemp * iTemp ) >> uiShift; 1353 1357 iTemp = piOrg[63] - piCur[63]; uiSum += ( iTemp * iTemp ) >> uiShift; 1354 1355 piOrg += iStrideOrg; 1356 piCur += iStrideCur; 1357 } 1358 1358 1359 piOrg += iStrideOrg; 1360 piCur += iStrideCur; 1361 } 1362 1359 1363 return ( uiSum ); 1360 1364 } … … 1376 1380 m[2] = diff[0] - diff[2]; 1377 1381 m[3] = diff[1] - diff[3]; 1378 1382 1379 1383 satd += abs(m[0] + m[1]); 1380 1384 satd += abs(m[0] - m[1]); 1381 1385 satd += abs(m[2] + m[3]); 1382 1386 satd += abs(m[2] - m[3]); 1383 1387 1384 1388 return satd; 1385 1389 } … … 1388 1392 { 1389 1393 Int k, satd = 0, diff[16], m[16], d[16]; 1390 1394 1391 1395 assert( iStep == 1 ); 1392 1396 for( k = 0; k < 16; k+=4 ) … … 1396 1400 diff[k+2] = piOrg[2] - piCur[2]; 1397 1401 diff[k+3] = piOrg[3] - piCur[3]; 1398 1399 piCur += iStrideCur; 1400 piOrg += iStrideOrg; 1401 } 1402 1402 1403 piCur += iStrideCur; 1404 piOrg += iStrideOrg; 1405 } 1406 1403 1407 /*===== hadamard transform =====*/ 1404 1408 m[ 0] = diff[ 0] + diff[12]; … … 1418 1422 m[14] = diff[ 2] - diff[14]; 1419 1423 m[15] = diff[ 3] - diff[15]; 1420 1424 1421 1425 d[ 0] = m[ 0] + m[ 4]; 1422 1426 d[ 1] = m[ 1] + m[ 5]; … … 1435 1439 d[14] = m[14] - m[10]; 1436 1440 d[15] = m[15] - m[11]; 1437 1441 1438 1442 m[ 0] = d[ 0] + d[ 3]; 1439 1443 m[ 1] = d[ 1] + d[ 2]; … … 1452 1456 m[14] = d[13] - d[14]; 1453 1457 m[15] = d[12] - d[15]; 1454 1458 1455 1459 d[ 0] = m[ 0] + m[ 1]; 1456 1460 d[ 1] = m[ 0] - m[ 1]; … … 1469 1473 d[14] = m[14] + m[15]; 1470 1474 d[15] = m[15] - m[14]; 1471 1475 1472 1476 for (k=0; k<16; ++k) 1473 1477 { … … 1475 1479 } 1476 1480 satd = ((satd+1)>>1); 1477 1481 1478 1482 return satd; 1479 1483 } … … 1494 1498 diff[k+6] = piOrg[6] - piCur[6]; 1495 1499 diff[k+7] = piOrg[7] - piCur[7]; 1496 1497 piCur += iStrideCur; 1498 piOrg += iStrideOrg; 1499 } 1500 1500 1501 piCur += iStrideCur; 1502 piOrg += iStrideOrg; 1503 } 1504 1501 1505 //horizontal 1502 1506 for (j=0; j < 8; j++) … … 1511 1515 m2[j][6] = diff[jj+2] - diff[jj+6]; 1512 1516 m2[j][7] = diff[jj+3] - diff[jj+7]; 1513 1517 1514 1518 m1[j][0] = m2[j][0] + m2[j][2]; 1515 1519 m1[j][1] = m2[j][1] + m2[j][3]; … … 1520 1524 m1[j][6] = m2[j][4] - m2[j][6]; 1521 1525 m1[j][7] = m2[j][5] - m2[j][7]; 1522 1526 1523 1527 m2[j][0] = m1[j][0] + m1[j][1]; 1524 1528 m2[j][1] = m1[j][0] - m1[j][1]; … … 1530 1534 m2[j][7] = m1[j][6] - m1[j][7]; 1531 1535 } 1532 1536 1533 1537 //vertical 1534 1538 for (i=0; i < 8; i++) … … 1542 1546 m3[6][i] = m2[2][i] - m2[6][i]; 1543 1547 m3[7][i] = m2[3][i] - m2[7][i]; 1544 1548 1545 1549 m1[0][i] = m3[0][i] + m3[2][i]; 1546 1550 m1[1][i] = m3[1][i] + m3[3][i]; … … 1551 1555 m1[6][i] = m3[4][i] - m3[6][i]; 1552 1556 m1[7][i] = m3[5][i] - m3[7][i]; 1553 1557 1554 1558 m2[0][i] = m1[0][i] + m1[1][i]; 1555 1559 m2[1][i] = m1[0][i] - m1[1][i]; … … 1561 1565 m2[7][i] = m1[6][i] - m1[7][i]; 1562 1566 } 1563 1567 1564 1568 for (i = 0; i < 8; i++) 1565 1569 { … … 1569 1573 } 1570 1574 } 1571 1575 1572 1576 sad=((sad+2)>>2); 1573 1577 1574 1578 return sad; 1575 1579 } … … 1681 1685 //vertical 1682 1686 for (i=0; i < 16; i++) 1683 { 1687 { 1684 1688 m2[0][i] = m1[0][i] + m1[2][i]; 1685 1689 m2[1][i] = m1[1][i] + m1[3][i]; … … 1838 1842 Int iOffsetOrg = iStrideOrg<<2; 1839 1843 Int iOffsetCur = iStrideCur<<2; 1840 1841 UInt uiSum = 0; 1842 1844 1845 UInt uiSum = 0; 1846 1843 1847 for ( y=0; y<iRows; y+= 4 ) 1844 1848 { … … 1847 1851 piCur += iOffsetCur; 1848 1852 } 1849 1853 1850 1854 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1851 1855 } … … 1864 1868 Int iStep = pcDtParam->iStep; 1865 1869 Int y; 1866 1867 UInt uiSum = 0; 1868 1870 1871 UInt uiSum = 0; 1872 1869 1873 if ( iRows == 4 ) 1870 1874 { … … 1883 1887 } 1884 1888 } 1885 1889 1886 1890 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1887 1891 } … … 1900 1904 Int iStrideOrg = pcDtParam->iStrideOrg; 1901 1905 Int iStep = pcDtParam->iStep; 1902 1906 1903 1907 Int x, y; 1904 1905 UInt uiSum = 0; 1906 1908 1909 UInt uiSum = 0; 1910 1907 1911 #if NS_HAD 1908 1912 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) ) … … 1924 1928 } 1925 1929 #if NS_HAD 1926 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD ) 1930 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD ) 1927 1931 { 1928 1932 Int iOffsetOrg = iStrideOrg<<2; … … 1938 1942 } 1939 1943 } 1940 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD ) 1944 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD ) 1941 1945 { 1942 1946 Int iOffsetOrg = iStrideOrg<<4; … … 1957 1961 Int iOffsetOrg = iStrideOrg<<2; 1958 1962 Int iOffsetCur = iStrideCur<<2; 1959 1963 1960 1964 for ( y=0; y<iRows; y+= 4 ) 1961 1965 { … … 1986 1990 assert(false); 1987 1991 } 1988 1992 1989 1993 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8); 1990 1994 } -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComRom.cpp
r445 r466 86 86 // Data structure related table & variable 87 87 // ==================================================================================================================== 88 #if LAYER_CTB 89 UInt g_auiLayerMaxCUWidth[MAX_LAYERS]; 90 UInt g_auiLayerMaxCUHeight[MAX_LAYERS]; 91 UInt g_auiLayerMaxCUDepth[MAX_LAYERS]; 92 UInt g_auiLayerAddCUDepth[MAX_LAYERS]; 93 UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 94 UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 95 UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 96 UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 97 #endif 88 98 89 UInt g_uiMaxCUWidth = MAX_CU_SIZE; 99 90 UInt g_uiMaxCUHeight = MAX_CU_SIZE; … … 321 312 UInt g_uiPCMBitDepthLuma = 8; // PCM bit-depth 322 313 UInt g_uiPCMBitDepthChroma = 8; // PCM bit-depth 323 314 #if O0194_DIFFERENT_BITDEPTH_EL_BL 315 Int g_bitDepthYLayer[MAX_LAYERS]; 316 Int g_bitDepthCLayer[MAX_LAYERS]; 317 318 UInt g_uiPCMBitDepthLumaDec[MAX_LAYERS]; // PCM bit-depth 319 UInt g_uiPCMBitDepthChromaDec[MAX_LAYERS]; // PCM bit-depth 320 #endif 321 #if O0194_WEIGHTED_PREDICTION_CGS 322 void * g_refWeightACDCParam; // type=wpACDCParam 323 #endif 324 324 // ==================================================================================================================== 325 325 // Misc. -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComRom.h
r445 r466 81 81 82 82 // global variable (LCU width/height, max. CU depth) 83 #if LAYER_CTB84 extern UInt g_auiLayerMaxCUWidth[MAX_LAYERS];85 extern UInt g_auiLayerMaxCUHeight[MAX_LAYERS];86 extern UInt g_auiLayerMaxCUDepth[MAX_LAYERS];87 extern UInt g_auiLayerAddCUDepth[MAX_LAYERS];88 extern UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];89 extern UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];90 extern UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];91 extern UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];92 #endif93 83 extern UInt g_uiMaxCUWidth; 94 84 extern UInt g_uiMaxCUHeight; -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.h
r464 r466 1602 1602 Int64 iAC; 1603 1603 Int64 iDC; 1604 #if O0194_WEIGHTED_PREDICTION_CGS 1605 Int iSamples; 1606 #endif 1604 1607 } wpACDCParam; 1605 1608 -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r464 r466 17 17 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 18 18 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 19 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 20 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 21 #endif 22 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 19 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 20 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 21 #endif 22 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 23 23 #if ARBITRARY_SPATIAL_RATIO 24 24 { -1, 3, -9, 47, 31, -10, 4, -1}, 25 25 { -1, 4, -11, 45, 34, -10, 4, -1}, 26 26 #else 27 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 28 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 27 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 28 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 29 29 #endif 30 30 { -1, 4, -11, 40, 40, -11, 4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 … … 33 33 { -1, 4, -10, 31, 47, -9, 3, -1}, 34 34 #else 35 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 36 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 35 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 36 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 37 37 #endif 38 38 { -1, 3, -8, 26, 52, -11, 4, -1}, // <-> actual phase shift 2/3, used for spatial scalability x1.5 … … 43 43 { 0, 1, -2, 4, 63, -3, 1, 0} 44 44 #else 45 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 46 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 47 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 48 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU} // 45 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 46 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 47 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 48 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU} // 49 49 #endif 50 50 }; … … 60 60 {CNU,CNU,CNU,CNU},// 61 61 {CNU,CNU,CNU,CNU},// 62 {CNU,CNU,CNU,CNU},// 62 {CNU,CNU,CNU,CNU},// 63 63 #endif 64 64 { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement) 65 { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5 66 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 65 { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5 66 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 67 67 #if ARBITRARY_SPATIAL_RATIO 68 68 { -4, 42, 30, -4}, 69 69 #else 70 {CNU,CNU,CNU,CNU},// 70 {CNU,CNU,CNU,CNU},// 71 71 #endif 72 72 { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2 … … 75 75 { -4, 28, 46, -6}, 76 76 #else 77 {CNU,CNU,CNU,CNU},// 77 {CNU,CNU,CNU,CNU},// 78 78 #endif 79 79 { -2, 20, 52, -6},// <-> actual phase shift 2/3, used for spatial scalability x1.5 … … 82 82 {-2, 14, 56, -4}, 83 83 #else 84 {CNU,CNU,CNU,CNU},// 85 {CNU,CNU,CNU,CNU},// 86 #endif 87 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 84 {CNU,CNU,CNU,CNU},// 85 {CNU,CNU,CNU,CNU},// 86 #endif 87 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 88 88 { 0, 4, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 89 89 }; … … 109 109 110 110 //========== Y component upsampling =========== 111 #if SCALED_REF_LAYER_OFFSETS 111 112 const Window &scalEL = window; 112 113 … … 118 119 Int heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 119 120 Int strideEL = pcUsPic->getStride(); 120 121 #else 122 const Window &confBL = pcBasePic->getConformanceWindow(); 123 const Window &confEL = pcUsPic->getConformanceWindow(); 124 125 Int widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 126 Int heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 127 Int strideBL = pcBasePic->getStride(); 128 129 Int widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 130 Int heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 131 Int strideEL = pcUsPic->getStride(); 132 #endif 121 133 Pel* piTempBufY = pcTempPic->getLumaAddr(); 122 134 Pel* piSrcBufY = pcBasePic->getLumaAddr(); … … 182 194 Int refPos16 = 0; 183 195 Int phase = 0; 184 Int refPos = 0; 196 Int refPos = 0; 185 197 Int* coeff = m_chromaFilter[phase]; 186 198 for ( i = 0; i < 16; i++) … … 190 202 } 191 203 192 #if ARBITRARY_SPATIAL_RATIO 204 #if ARBITRARY_SPATIAL_RATIO 193 205 assert ( widthEL >= widthBL ); 194 206 assert ( heightEL >= heightBL ); … … 205 217 206 218 #if O0215_PHASE_ALIGNMENT //for Luma, if Phase 0, then both PhaseX and PhaseY should be 0. If symmetric: both PhaseX and PhaseY should be 2 207 Int phaseX = 2*phaseAlignFlag; 208 Int phaseY = 2*phaseAlignFlag; 219 Int phaseX = 2*phaseAlignFlag; 220 Int phaseY = 2*phaseAlignFlag; 209 221 #else 210 222 Int phaseX = 0; … … 221 233 222 234 Int deltaX = 4 * phaseX; 223 Int deltaY = 4 * phaseY; 235 Int deltaY = 4 * phaseY; 224 236 225 237 Int shiftXM4 = shiftX - 4; … … 231 243 widthBL = pcBasePic->getWidth (); 232 244 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 233 245 #if SCALED_REF_LAYER_OFFSETS 234 246 Int leftStartL = scalEL.getWindowLeftOffset(); 235 247 Int rightEndL = pcUsPic->getWidth() - scalEL.getWindowRightOffset(); 236 248 Int topStartL = scalEL.getWindowTopOffset(); 237 249 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 250 #if BUGFIX_RESAMPLE 238 251 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 252 #endif 253 #endif 239 254 240 255 #if N0214_INTERMEDIATE_BUFFER_16BITS 256 #if O0194_JOINT_US_BITSHIFT 257 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 258 Int shift1 = g_bitDepthYLayer[0] - 8; 259 #else 241 260 Int shift1 = g_bitDepthY - 8; 261 #endif 242 262 #endif 243 263 … … 245 265 for( i = 0; i < widthEL; i++ ) 246 266 { 267 #if SCALED_REF_LAYER_OFFSETS 247 268 Int x = Clip3( leftStartL, rightEndL - 1, i ); 248 269 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX; 270 #else 271 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 272 #endif 249 273 phase = refPos16 & 15; 250 274 refPos = refPos16 >> 4; … … 273 297 274 298 #if N0214_INTERMEDIATE_BUFFER_16BITS 299 #if O0194_JOINT_US_BITSHIFT 300 Int nShift = 20 - g_bitDepthYLayer[1]; 301 #else 275 302 Int nShift = US_FILTER_PREC*2 - shift1; 303 #endif 276 304 #else 277 305 const Int nShift = US_FILTER_PREC*2; 278 306 #endif 279 Int iOffset = 1 << (nShift - 1); 280 307 Int iOffset = 1 << (nShift - 1); 308 309 #if SCALED_REF_LAYER_OFFSETS 281 310 for( j = 0; j < pcTempPic->getHeight(); j++ ) 311 #else 312 for( j = 0; j < heightEL; j++ ) 313 #endif 282 314 { 315 #if SCALED_REF_LAYER_OFFSETS 283 316 Int y = Clip3(topStartL, bottomEndL - 1, j); 284 317 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY; 318 #else 319 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 320 #endif 285 321 phase = refPos16 & 15; 286 322 refPos = refPos16 >> 4; … … 288 324 289 325 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 290 Pel* piDstY0 = piDstBufY + j * strideEL; 326 #if SCALED_REF_LAYER_OFFSETS 327 #if BUGFIX_RESAMPLE 328 Pel* piDstY0 = piDstBufY + j * strideEL; 291 329 piDstY = piDstY0 + leftOffset; 292 330 piSrcY += leftOffset; … … 311 349 piDstY++; 312 350 } 313 351 #else 352 #if 1 // it should provide identical result 353 Pel* piDstY0 = piDstBufY + j * strideEL; 354 piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 ); 355 356 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 357 { 358 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 359 piSrcY++; 360 piDstY++; 361 } 362 363 for( i = rightEndL; i < pcTempPic->getWidth(); i++ ) 364 { 365 *piDstY = piDstY0[rightEndL-1]; 366 piDstY++; 367 } 368 369 piDstY = piDstY0; 370 for( i = 0; i < leftStartL; i++ ) 371 { 372 *piDstY = piDstY0[leftStartL]; 373 piDstY++; 374 } 375 #else 376 piDstY = piDstBufY + j * strideEL; 377 378 for( i = 0; i < pcTempPic->getWidth(); i++ ) 379 { 380 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 381 382 // Only increase the x position of reference upsample picture when within the window 383 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1 384 if( (i >= leftStartL) && (i <= rightEndL-2) ) 385 { 386 piSrcY++; 387 } 388 piDstY++; 389 } 390 #endif 391 #endif 392 #else 393 piDstY = piDstBufY + j * strideEL; 394 395 for( i = 0; i < widthEL; i++ ) 396 { 397 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 398 piSrcY++; 399 piDstY++; 400 } 401 #endif 314 402 } 315 403 404 #if SCALED_REF_LAYER_OFFSETS 316 405 widthBL = pcBasePic->getWidth (); 317 406 heightBL = pcBasePic->getHeight(); … … 319 408 widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 320 409 heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 410 #else 411 widthBL = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 412 heightBL = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 413 414 widthEL = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 415 heightEL = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 416 #endif 321 417 322 418 //========== UV component upsampling =========== … … 330 426 strideBL = pcBasePic->getCStride(); 331 427 strideEL = pcUsPic->getCStride(); 332 428 #if SCALED_REF_LAYER_OFFSETS 333 429 Int leftStartC = scalEL.getWindowLeftOffset() >> 1; 334 430 Int rightEndC = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1); 335 431 Int topStartC = scalEL.getWindowTopOffset() >> 1; 336 432 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 433 #if BUGFIX_RESAMPLE 337 434 leftOffset = leftStartC > 0 ? leftStartC : 0; 435 #endif 436 #endif 338 437 339 438 shiftX = 16; 340 439 shiftY = 16; 341 440 342 #if O0215_PHASE_ALIGNMENT 343 Int phaseXC = 0; 344 Int phaseYC = 1; 441 #if O0215_PHASE_ALIGNMENT 442 Int phaseXC = 0; 443 Int phaseYC = 1; 345 444 346 445 #if ROUNDING_OFFSET … … 380 479 381 480 #if N0214_INTERMEDIATE_BUFFER_16BITS 481 #if O0194_JOINT_US_BITSHIFT 482 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 483 shift1 = g_bitDepthCLayer[0] - 8; 484 #else 382 485 shift1 = g_bitDepthC - 8; 486 #endif 383 487 #endif 384 488 … … 386 490 for( i = 0; i < widthEL; i++ ) 387 491 { 492 #if SCALED_REF_LAYER_OFFSETS 388 493 Int x = Clip3(leftStartC, rightEndC - 1, i); 389 494 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX; 495 #else 496 refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX; 497 #endif 390 498 phase = refPos16 & 15; 391 499 refPos = refPos16 >> 4; … … 421 529 422 530 #if N0214_INTERMEDIATE_BUFFER_16BITS 531 #if O0194_JOINT_US_BITSHIFT 532 nShift = 20 - g_bitDepthCLayer[1]; 533 #else 423 534 nShift = US_FILTER_PREC*2 - shift1; 424 iOffset = 1 << (nShift - 1); 425 #endif 426 535 #endif 536 iOffset = 1 << (nShift - 1); 537 #endif 538 539 #if SCALED_REF_LAYER_OFFSETS 427 540 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) 541 #else 542 for( j = 0; j < heightEL; j++ ) 543 #endif 428 544 { 545 #if SCALED_REF_LAYER_OFFSETS 429 546 Int y = Clip3(topStartC, bottomEndC - 1, j); 430 547 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY; 548 #else 549 refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY; 550 #endif 431 551 phase = refPos16 & 15; 432 refPos = refPos16 >> 4; 552 refPos = refPos16 >> 4; 433 553 coeff = m_chromaFilter[phase]; 434 554 435 555 piSrcU = piTempBufU + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 436 556 piSrcV = piTempBufV + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 437 557 #if SCALED_REF_LAYER_OFFSETS 558 #if BUGFIX_RESAMPLE 438 559 Pel* piDstU0 = piDstBufU + j*strideEL; 439 560 Pel* piDstV0 = piDstBufV + j*strideEL; … … 447 568 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 448 569 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 570 449 571 piSrcU++; 450 572 piSrcV++; … … 470 592 piDstV++; 471 593 } 472 594 #else 595 #if 1 // it should provide identical result 596 Pel* piDstU0 = piDstBufU + j*strideEL; 597 Pel* piDstV0 = piDstBufV + j*strideEL; 598 piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 ); 599 piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 ); 600 601 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- ) 602 { 603 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 604 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 605 piSrcU++; 606 piSrcV++; 607 piDstU++; 608 piDstV++; 609 } 610 611 for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ ) 612 { 613 *piDstU = piDstU0[rightEndC-1]; 614 *piDstV = piDstV0[rightEndC-1]; 615 piDstU++; 616 piDstV++; 617 } 618 619 piDstU = piDstU0; 620 piDstV = piDstV0; 621 for( i = 0; i < leftStartC; i++ ) 622 { 623 *piDstU = piDstU0[leftStartC]; 624 *piDstV = piDstV0[leftStartC]; 625 piDstU++; 626 piDstV++; 627 } 628 #else 629 piDstU = piDstBufU + j*strideEL; 630 piDstV = piDstBufV + j*strideEL; 631 632 for( i = 0; i < pcTempPic->getWidth() >> 1; i++ ) 633 { 634 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 635 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 636 637 // Only increase the x position of reference upsample picture when within the window 638 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1 639 if( (i >= leftStartC) && (i <= rightEndC-2) ) 640 { 641 piSrcU++; 642 piSrcV++; 643 } 644 645 piDstU++; 646 piDstV++; 647 } 648 #endif 649 #endif 650 #else 651 piDstU = piDstBufU + j*strideEL; 652 piDstV = piDstBufV + j*strideEL; 653 654 for( i = 0; i < widthEL; i++ ) 655 { 656 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 657 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 658 piSrcU++; 659 piSrcV++; 660 piDstU++; 661 piDstV++; 662 } 663 #endif 473 664 } 474 665 } 475 pcUsPic->setBorderExtension(false);476 pcUsPic->extendPicBorder (); // extend the border.477 478 //Reset the Border extension flag479 pcUsPic->setBorderExtension(false);480 pcTempPic->setBorderExtension(false);481 pcBasePic->setBorderExtension(false);666 pcUsPic->setBorderExtension(false); 667 pcUsPic->extendPicBorder (); // extend the border. 668 669 //Reset the Border extension flag 670 pcUsPic->setBorderExtension(false); 671 pcTempPic->setBorderExtension(false); 672 pcBasePic->setBorderExtension(false); 482 673 } 483 674 #endif //SVC_EXTENSION -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h
r464 r466 46 46 #if SVC_EXTENSION 47 47 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 48 49 #define O0194_DIFFERENT_BITDEPTH_EL_BL 1 ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters 50 #define O0194_JOINT_US_BITSHIFT 1 ///< JCTVC-O0194: Joint Upsampling and bit-shift 51 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability 52 #define O0194_REPN_FORMAT_IN_VPS_BUGFIX 1 ///< JCTVC-O0194: Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled 53 48 54 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 49 55 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle … … 59 65 #endif 60 66 #define IL_SL_SIGNALLING_N0371 0 ///< JCTVC-N0371: inter-layer scaling list 67 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0 ///< JCTVC-M0464: VUI flag to indicate tile boundary alignment 61 68 #define M0463_VUI_EXT_ILP_REF 0 ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling 62 69 #define SPS_EXTENSION 1 ///< Define sps_extension() syntax structure 70 #define SCALED_REF_LAYER_OFFSETS 1 ///< JCTVC-M0309: Signal scaled reference layer offsets in SPS 63 71 #define VERT_MV_CONSTRAINT 1 ///< Vertical MV component constraint flag 64 72 #define SCALABILITY_MASK_E0104 1 ///< JCT3V-E0104: scalability mask for depth 65 #define LAYER_CTB 0 ///< enable layer-specific CTB structure66 73 67 74 #define ILP_SSH_SIG 1 ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header … … 79 86 #define VPS_EXTN_PROFILE_INFO 1 ///< Include profile information for layer sets in VPS extension 80 87 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 88 #define VPS_OUTPUT_LAYER_SET_IDX 1 ///< JCTVC-M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i] 89 #define VPS_MOVE_DIR_DEPENDENCY_FLAG 1 ///< JCTVC-M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id 90 #define VPS_PROFILE_OUTPUT_LAYERS 1 ///< JCTVC-M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2 91 #define SPS_SUB_LAYER_INFO 1 ///< JCTVC-M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 0 92 #define VPS_SPLIT_FLAG 1 ///< JCTVC-M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1. 81 93 #define M0457_PREDICTION_INDICATIONS 1 82 94 #define M0040_ADAPTIVE_RESOLUTION_CHANGE 1 … … 87 99 #define N0160_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 88 100 #define VPS_VUI_BITRATE_PICRATE 1 ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI 101 #else 102 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0 ///< VUI flag to indicate tile boundary alignment 89 103 #endif //VPS_VUI 90 104 … … 94 108 #define VPS_EXTN_OFFSET_CALC 1 ///< Calculation of VPS extension offset 95 109 #define SPS_PTL_FIX 1 ///< remove profile_tier_level from enhancement layer SPS 110 #define SH_DISCARDABLE_FLAG 1 ///< JCTVC-M0152: Use one reserved flag in the slice header for discardable flag 96 111 97 112 #define DERIVE_LAYER_ID_LIST_VARIABLES 1 ///< Derived variables based on the variables in VPS - for use in syntax table parsing … … 101 116 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214: support base layer input more than 8 bits 102 117 #define ARBITRARY_SPATIAL_RATIO 1 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio 118 #define BUGFIX_RESAMPLE 1 ///< JCTVC-N0055: resampling bug fix for positive left scalled offset 103 119 104 120 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization) … … 121 137 #define JCTVC_M0203_INTERLAYER_PRED_IDC 1 ///< JCTVC-M0203: implementation of Inter-layer Prediction Indication 122 138 #if JCTVC_M0203_INTERLAYER_PRED_IDC 139 #define ILR_RESTR 1 ///< JCTVC-M0209: Inter-layer RPS and RPL 140 #define ILR_RESTR_FIX 1 ///< Fix encoder crash when temporal layers are used with scalable coding 123 141 #define EARLY_REF_PIC_MARKING 1 ///< Decoded picture marking of sub-layer non-reference pictures 124 142 #define N0120_MAX_TID_REF_PRESENT_FLAG 1 ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r464 r466 187 187 assert(uiCode <= 63); 188 188 pcPPS->setPPSId (uiCode); 189 189 190 190 READ_UVLC( uiCode, "pps_seq_parameter_set_id"); 191 191 assert(uiCode <= 15); 192 192 pcPPS->setSPSId (uiCode); 193 193 194 194 READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag" ); pcPPS->setDependentSliceSegmentsEnabledFlag ( uiCode == 1 ); 195 195 READ_FLAG( uiCode, "output_flag_present_flag" ); pcPPS->setOutputFlagPresentFlag( uiCode==1 ); … … 293 293 294 294 #if IL_SL_SIGNALLING_N0371 295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 296 296 #endif 297 297 … … 301 301 pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() ); 302 302 303 if( pcPPS->getLayerId() > 0 ) 303 if( pcPPS->getLayerId() > 0 ) 304 304 { 305 305 READ_FLAG( uiCode, "pps_pred_scaling_list_flag" ); pcPPS->setPredScalingListFlag( uiCode ? true : false ); 306 306 pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() ); 307 307 308 308 if( pcPPS->getPredScalingListFlag() ) 309 309 { … … 319 319 } 320 320 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 322 322 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 323 323 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 324 324 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 326 326 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 327 327 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true ); … … 450 450 { 451 451 READ_FLAG( uiCode, "tiles_fixed_structure_flag"); pcVUI->setTilesFixedStructureFlag(uiCode); 452 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG 453 if ( pcSPS->getLayerId() > 0 ) 454 { 455 READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 ); 456 } 457 #endif 452 458 READ_FLAG( uiCode, "motion_vectors_over_pic_boundaries_flag"); pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode); 453 459 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag"); pcVUI->setRestrictedRefPicListsFlag(uiCode); … … 536 542 } 537 543 538 #if S VC_EXTENSION544 #if SPS_SUB_LAYER_INFO 539 545 Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager) 540 546 #else … … 548 554 UInt uiCode; 549 555 READ_CODE( 4, uiCode, "sps_video_parameter_set_id"); pcSPS->setVPSId ( uiCode ); 550 #if S VC_EXTENSION556 #if SPS_SUB_LAYER_INFO 551 557 if(pcSPS->getLayerId() == 0) 552 558 { … … 554 560 READ_CODE( 3, uiCode, "sps_max_sub_layers_minus1" ); pcSPS->setMaxTLayers ( uiCode+1 ); 555 561 assert(uiCode <= 6); 556 562 557 563 READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" ); pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false ); 558 #if S VC_EXTENSION564 #if SPS_SUB_LAYER_INFO 559 565 } 560 566 else … … 563 569 pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() ); 564 570 } 571 #endif 565 572 #if IL_SL_SIGNALLING_N0371 566 573 pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) ); 567 574 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS ); 568 575 #endif 569 #endif570 576 if ( pcSPS->getMaxTLayers() == 1 ) 571 577 { 572 578 // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0 573 #if S VC_EXTENSION579 #if SPS_SUB_LAYER_INFO 574 580 assert( pcSPS->getTemporalIdNestingFlag() == true ); 575 581 #else … … 592 598 if( pcSPS->getLayerId() > 0 ) 593 599 { 594 READ_FLAG( uiCode, "update_rep_format_flag" ); 600 READ_FLAG( uiCode, "update_rep_format_flag" ); 595 601 pcSPS->setUpdateRepFormatFlag( uiCode ? true : false ); 596 602 } … … 599 605 pcSPS->setUpdateRepFormatFlag( true ); 600 606 } 601 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 607 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 602 608 { 603 609 #endif … … 633 639 } 634 640 #if REPN_FORMAT_IN_VPS 635 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 641 if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() ) 636 642 { 637 643 #endif … … 653 659 UInt subLayerOrderingInfoPresentFlag; 654 660 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 655 661 656 662 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 657 663 { … … 722 728 } 723 729 724 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 730 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 725 731 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 726 732 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 727 733 728 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 734 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 729 735 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 730 736 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true ); … … 835 841 assert( uiCode == 0 ); 836 842 #endif 843 #if SCALED_REF_LAYER_OFFSETS 837 844 if( pcSPS->getLayerId() > 0 ) 838 845 { 839 Int iCode; 846 Int iCode; 840 847 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets(uiCode); 841 848 for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++) … … 848 855 } 849 856 } 857 #endif 850 858 #if M0463_VUI_EXT_ILP_REF 851 859 //// sps_extension_vui_parameters( ) 852 860 if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() ) 853 { 854 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 855 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 856 { 857 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 858 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 859 { 860 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 861 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 862 { 863 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 864 } 865 } 866 } 867 } 861 { 862 READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode ); 863 for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ ) 864 { 865 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode ); 866 if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 ) 867 { 868 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 ); 869 if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 870 { 871 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode ); 872 } 873 } 874 } 875 } 868 876 //// sps_extension_vui_parameters( ) END 869 877 #endif … … 992 1000 } 993 1001 994 #if SVC_EXTENSION995 1002 #if VPS_EXTNS 996 1003 Void TDecCavlc::parseVPSExtension(TComVPS *vps) … … 1011 1018 vps->setNumScalabilityTypes(numScalabilityTypes); 1012 1019 1020 #if VPS_SPLIT_FLAG 1013 1021 for(j = 0; j < numScalabilityTypes - vps->getSplittingFlag(); j++) 1022 #else 1023 for(j = 0; j < numScalabilityTypes; j++) 1024 #endif 1014 1025 { 1015 1026 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); vps->setDimensionIdLen(j, uiCode + 1); 1016 1027 } 1017 1028 #if VPS_SPLIT_FLAG 1018 1029 if(vps->getSplittingFlag()) 1019 1030 { … … 1027 1038 numBits = 6; 1028 1039 } 1040 #else 1041 if(vps->getSplittingFlag()) 1042 { 1043 UInt numBits = 0; 1044 for(j = 0; j < numScalabilityTypes; j++) 1045 { 1046 numBits += vps->getDimensionIdLen(j); 1047 } 1048 assert( numBits <= 6 ); 1049 } 1050 #endif 1029 1051 1030 1052 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); vps->setNuhLayerIdPresentFlag(uiCode ? true : false); … … 1044 1066 vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i); 1045 1067 1046 if( !vps->getSplittingFlag() ) 1047 {1048 for(j = 0; j < numScalabilityTypes; j++) 1049 {1050 READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode);1051 assert( uiCode <= vps->getMaxLayerId());1052 }1053 } 1054 } 1055 #endif 1056 #if VIEW_ID_RELATED_SIGNALING 1057 // if ( pcVPS->getNumViews() > 1 ) 1058 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 1068 #if VPS_SPLIT_FLAG 1069 if(!vps->getSplittingFlag()) 1070 #endif 1071 for(j = 0; j < numScalabilityTypes; j++) 1072 { 1073 READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode); 1074 assert( uiCode <= vps->getMaxLayerId() ); 1075 } 1076 } 1077 #endif 1078 #if VIEW_ID_RELATED_SIGNALING 1079 // if ( pcVPS->getNumViews() > 1 ) 1080 // However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val. 1059 1081 { 1060 1082 READ_CODE( 4, uiCode, "view_id_len_minus1" ); vps->setViewIdLenMinus1( uiCode ); … … 1066 1088 } 1067 1089 #endif 1090 #if VPS_MOVE_DIR_DEPENDENCY_FLAG 1068 1091 #if VPS_EXTN_DIRECT_REF_LAYERS 1069 1092 // For layer 0 … … 1085 1108 } 1086 1109 #endif 1110 #endif 1087 1111 #if JCTVC_M0203_INTERLAYER_PRED_IDC 1088 1112 #if N0120_MAX_TID_REF_PRESENT_FLAG … … 1095 1119 #if N0120_MAX_TID_REF_CFG 1096 1120 assert( uiCode <= vps->getMaxTLayers()); 1097 #else 1121 #else 1098 1122 assert( uiCode <= vps->getMaxTLayers()+ 1 ); 1099 #endif 1100 } 1101 } 1102 else 1123 #endif 1124 } 1125 } 1126 else 1103 1127 { 1104 1128 for(i = 0; i < vps->getMaxLayers() - 1; i++) … … 1120 1144 #if VPS_EXTN_PROFILE_INFO 1121 1145 // Profile-tier-level signalling 1146 #if VPS_PROFILE_OUTPUT_LAYERS 1122 1147 READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" ); assert( uiCode == (vps->getNumLayerSets() - 1) ); 1123 1148 READ_CODE( 6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 ); 1124 1149 vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel()); 1125 1150 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) 1151 #else 1152 vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets()); 1153 for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++) 1154 #endif 1126 1155 { 1127 1156 READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); vps->setProfilePresentFlag(idx, uiCode ? true : false); 1128 1157 if( !vps->getProfilePresentFlag(idx) ) 1129 1158 { 1159 #if VPS_PROFILE_OUTPUT_LAYERS 1130 1160 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1); 1161 #else 1162 READ_UVLC( uiCode, "vps_profile_layer_set_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1); 1163 #endif 1131 1164 assert( vps->getProfileLayerSetRef(idx) < idx ); 1132 1133 1165 // Copy profile information as indicated 1134 1166 vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) ); … … 1138 1170 #endif 1139 1171 1172 #if VPS_PROFILE_OUTPUT_LAYERS 1140 1173 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false ); 1141 1174 Int numOutputLayerSets = 0; … … 1198 1231 READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" ); vps->setProfileLevelTierIdx(i, uiCode); 1199 1232 } 1200 1233 #else 1234 #if VPS_EXTN_OP_LAYER_SETS 1235 // Target output layer signalling 1236 READ_UVLC( uiCode, "vps_num_output_layer_sets"); vps->setNumOutputLayerSets(uiCode); 1237 for(i = 0; i < vps->getNumOutputLayerSets(); i++) 1238 { 1239 #if VPS_OUTPUT_LAYER_SET_IDX 1240 READ_UVLC( uiCode, "vps_output_layer_set_idx_minus1[i]"); vps->setOutputLayerSetIdx(i, uiCode + 1); 1241 #else 1242 READ_UVLC( uiCode, "vps_output_layer_set_idx[i]"); vps->setOutputLayerSetIdx(i, uiCode); 1243 #endif 1244 Int lsIdx = vps->getOutputLayerSetIdx(i); 1245 for(j = 0; j <= vps->getMaxLayerId(); j++) 1246 { 1247 if(vps->getLayerIdIncludedFlag(lsIdx, j)) 1248 { 1249 READ_FLAG( uiCode, "vps_output_layer_flag[lsIdx][j]"); vps->setOutputLayerFlag(lsIdx, j, uiCode); 1250 } 1251 } 1252 } 1253 #endif 1254 #endif 1201 1255 #if REPN_FORMAT_IN_VPS 1202 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1256 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1203 1257 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); 1204 1258 … … 1219 1273 parseRepFormat( vps->getVpsRepFormat(i) ); 1220 1274 } 1221 1275 1222 1276 // Default assignment for layer 0 1223 1277 vps->setVpsRepFormatIdx( 0, 0 ); … … 1258 1312 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1259 1313 vps->setCrossLayerIrapAlignFlag(uiCode); 1260 #endif 1261 1314 #endif 1315 1316 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG 1317 #if VPS_EXTN_DIRECT_REF_LAYERS 1318 // For layer 0 1319 vps->setNumDirectRefLayers(0, 0); 1320 // For other layers 1321 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1322 { 1323 UInt numDirectRefLayers = 0; 1324 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1325 { 1326 READ_FLAG(uiCode, "direct_dependency_flag[i][j]" ); vps->setDirectDependencyFlag(layerCtr, refLayerCtr, uiCode? true : false); 1327 if(uiCode) 1328 { 1329 vps->setRefLayerId(layerCtr, numDirectRefLayers, refLayerCtr); 1330 numDirectRefLayers++; 1331 } 1332 } 1333 vps->setNumDirectRefLayers(layerCtr, numDirectRefLayers); 1334 } 1335 #endif 1336 #endif 1262 1337 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1263 1338 READ_UVLC( uiCode, "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2); … … 1279 1354 { 1280 1355 for(j = 0; j < i; j++) 1281 { 1356 { 1282 1357 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1283 1358 } … … 1298 1373 } 1299 1374 parseVPSVUI(vps); 1300 #endif 1375 #endif 1301 1376 } 1302 1377 } … … 1307 1382 UInt uiCode; 1308 1383 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( uiCode ); 1309 1384 1310 1385 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1311 1386 { … … 1315 1390 READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1316 1391 READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1317 1392 1318 1393 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1319 1394 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); … … 1381 1456 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1382 1457 { 1383 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1384 } 1385 } 1386 #endif 1458 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1)); 1459 } 1460 } 1461 #endif 1387 1462 #if N0160_VUI_EXT_ILP_REF 1388 READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 ); 1463 READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 ); 1389 1464 if( vps->getNumIlpRestrictedRefLayers()) 1390 1465 { … … 1393 1468 for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++) 1394 1469 { 1395 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 1396 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1397 { 1398 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 1399 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 1470 READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode ); 1471 if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 ) 1472 { 1473 READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[i][j]"); vps->setCtuBasedOffsetEnabledFlag(i, j, uiCode == 1 ); 1474 if(vps->getCtuBasedOffsetEnabledFlag(i,j)) 1400 1475 { 1401 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 1476 READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[i][j]"); vps->setMinHorizontalCtuOffsetPlus1( i,j, uiCode ); 1402 1477 } 1403 } 1404 } 1405 } 1406 } 1407 #endif 1408 } 1409 #endif 1410 #endif //SVC_EXTENSION 1411 1478 } 1479 } 1480 } 1481 } 1482 #endif 1483 } 1484 #endif 1412 1485 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) 1413 1486 { … … 1482 1555 if(!rpcSlice->getDependentSliceSegmentFlag()) 1483 1556 { 1484 #if SVC_EXTENSION1485 1557 #if POC_RESET_FLAG 1486 Int iBits = 0; 1558 Int iBits = 0; 1487 1559 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits) 1488 1560 { … … 1500 1572 } 1501 1573 #else 1574 #if SH_DISCARDABLE_FLAG 1502 1575 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) 1503 1576 { … … 1508 1581 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1509 1582 } 1510 #endif 1511 #else //SVC_EXTENSION 1583 #else 1512 1584 for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1513 1585 { 1514 1586 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1515 1587 } 1516 #endif //SVC_EXTENSION 1588 #endif 1589 #endif 1517 1590 1518 1591 READ_UVLC ( uiCode, "slice_type" ); rpcSlice->setSliceType((SliceType)uiCode); … … 1676 1749 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt); 1677 1750 rps->setCheckLTMSBPresent(j,false); 1678 1751 1679 1752 // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present 1680 1753 if( j == offset+(numOfLtrp-numLtrpInSPS)-1 ) … … 1779 1852 #else 1780 1853 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == false ) 1781 #endif 1854 #endif 1782 1855 { 1783 1856 rpcSlice->setInterLayerPredEnabledFlag(true); … … 2007 2080 2008 2081 #if REPN_FORMAT_IN_VPS 2082 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 2083 g_bitDepthYLayer[rpcSlice->getLayerId()] = rpcSlice->getBitDepthY(); 2084 g_bitDepthCLayer[rpcSlice->getLayerId()] = rpcSlice->getBitDepthC(); 2085 #endif 2009 2086 assert( rpcSlice->getSliceQp() >= -rpcSlice->getQpBDOffsetY() ); 2010 2087 #else … … 2117 2194 { 2118 2195 Int endOfSliceHeaderLocation = m_pcBitstream->getByteLocation(); 2119 2196 2120 2197 // Adjust endOfSliceHeaderLocation to account for emulation prevention bytes in the slice segment header 2121 2198 for ( UInt curByteIdx = 0; curByteIdx<m_pcBitstream->numEmulationPreventionBytesRead(); curByteIdx++ ) … … 2523 2600 #if IL_SL_SIGNALLING_N0371 2524 2601 if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2525 { 2602 { 2526 2603 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2527 2604 scalingListPredModeFlag = (code) ? true : false; -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r452 r466 72 72 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 73 73 Void parseVPS ( TComVPS* pcVPS ); 74 #if SPS_EXTENSION75 74 #if VPS_EXTNS 76 75 Void parseVPSExtension ( TComVPS* pcVPS ); … … 83 82 Void parseRepFormat ( RepFormat *repFormat ); 84 83 #endif 84 #if SPS_SUB_LAYER_INFO 85 85 Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ); 86 Void parseSPSExtension ( TComSPS* pcSPS ); 87 #else //SVC_EXTENSION 86 #else 88 87 Void parseSPS ( TComSPS* pcSPS ); 89 #endif //SVC_EXTENSION 88 #endif 89 #if SPS_EXTENSION 90 Void parseSPSExtension ( TComSPS* pcSPS ); 91 #endif 90 92 Void parsePPS ( TComPPS* pcPPS); 91 93 Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCu.cpp
r442 r466 616 616 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 617 617 } 618 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 619 #if REPN_FORMAT_IN_VPS 620 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset ); 621 #else 618 622 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 623 #endif 624 #else 625 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 626 #endif 619 627 620 628 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText]; … … 768 776 // Cb and Cr 769 777 Int curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb(); 778 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 779 #if REPN_FORMAT_IN_VPS 780 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset ); 781 #else 770 782 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 783 #endif 784 #else 785 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 786 #endif 771 787 772 788 uiWidth >>= 1; … … 776 792 777 793 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 794 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 795 #if REPN_FORMAT_IN_VPS 796 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getQpBDOffsetC(), curChromaQpOffset ); 797 #else 778 798 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 799 #endif 800 #else 801 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 802 #endif 779 803 780 804 piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecEntropy.h
r452 r466 66 66 67 67 virtual Void parseVPS ( TComVPS* pcVPS ) = 0; 68 #if S VC_EXTENSION68 #if SPS_SUB_LAYER_INFO 69 69 virtual Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) = 0; 70 70 #else … … 134 134 Void resetEntropy ( TComSlice* p) { m_pcEntropyDecoderIf->resetEntropy(p); } 135 135 Void decodeVPS ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); } 136 #if S VC_EXTENSION136 #if SPS_SUB_LAYER_INFO 137 137 Void decodeSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, parameterSetManager); } 138 138 #else -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecSbac.h
r452 r466 76 76 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } 77 77 Void parseVPS ( TComVPS* /*pcVPS*/ ) {} 78 #if S VC_EXTENSION78 #if SPS_SUB_LAYER_INFO 79 79 Void parseSPS ( TComSPS* /*pcSPS*/, ParameterSetManagerDecoder * /*parameterSetManager*/ ) {} 80 80 #else -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r464 r466 359 359 { 360 360 WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(), "tiles_fixed_structure_flag"); 361 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG 362 if ( pcSPS->getLayerId() > 0 ) 363 { 364 WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" ); 365 } 366 #endif 361 367 WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(), "motion_vectors_over_pic_boundaries_flag"); 362 368 WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag"); … … 448 454 #endif 449 455 WRITE_CODE( pcSPS->getVPSId (), 4, "sps_video_parameter_set_id" ); 450 #if S VC_EXTENSION456 #if SPS_SUB_LAYER_INFO 451 457 if(pcSPS->getLayerId() == 0) 452 458 { … … 454 460 WRITE_CODE( pcSPS->getMaxTLayers() - 1, 3, "sps_max_sub_layers_minus1" ); 455 461 WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0, "sps_temporal_id_nesting_flag" ); 456 #if S VC_EXTENSION462 #if SPS_SUB_LAYER_INFO 457 463 } 458 464 #endif … … 664 670 WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" ); 665 671 #endif 672 #if SCALED_REF_LAYER_OFFSETS 666 673 if( pcSPS->getLayerId() > 0 ) 667 674 { … … 676 683 } 677 684 } 685 #endif 678 686 #if M0463_VUI_EXT_ILP_REF 679 687 //// sps_extension_vui_parameters( ) … … 820 828 } 821 829 822 #if SVC_EXTENSION823 830 #if VPS_EXTNS 824 831 Void TEncCavlc::codeVPSExtension (TComVPS *vps) … … 836 843 } 837 844 845 #if VPS_SPLIT_FLAG 838 846 for(j = 0; j < vps->getNumScalabilityTypes() - vps->getSplittingFlag(); j++) 847 #else 848 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 849 #endif 839 850 { 840 851 WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3, "dimension_id_len_minus1[j]" ); … … 860 871 WRITE_CODE( vps->getLayerIdInNuh(i), 6, "layer_id_in_nuh[i]" ); 861 872 } 862 863 if( !vps->getSplittingFlag() ) 864 { 865 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 866 { 867 UInt bits = vps->getDimensionIdLen(j); 868 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" ); 869 } 873 #if VPS_SPLIT_FLAG 874 if(!vps->getSplittingFlag()) 875 #endif 876 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 877 { 878 UInt bits = vps->getDimensionIdLen(j); 879 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" ); 870 880 } 871 881 } … … 883 893 } 884 894 #endif 895 #if VPS_MOVE_DIR_DEPENDENCY_FLAG 885 896 #if VPS_EXTN_DIRECT_REF_LAYERS 886 897 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) … … 891 902 } 892 903 } 904 #endif 893 905 #endif 894 906 #if JCTVC_M0203_INTERLAYER_PRED_IDC … … 914 926 #if VPS_EXTN_PROFILE_INFO 915 927 // Profile-tier-level signalling 928 #if VPS_PROFILE_OUTPUT_LAYERS 916 929 WRITE_CODE( vps->getNumLayerSets() - 1 , 10, "vps_number_layer_sets_minus1" ); 917 930 WRITE_CODE( vps->getNumProfileTierLevel() - 1, 6, "vps_num_profile_tier_level_minus1"); 918 931 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) 932 #else 933 for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++) 934 #endif 919 935 { 920 936 WRITE_FLAG( vps->getProfilePresentFlag(idx), "vps_profile_present_flag[i]" ); 921 937 if( !vps->getProfilePresentFlag(idx) ) 922 938 { 939 #if VPS_PROFILE_OUTPUT_LAYERS 923 940 WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" ); 941 #else 942 WRITE_UVLC( vps->getProfileLayerSetRef(idx) - 1, "vps_profile_layer_set_ref_minus1[i]" ); 943 #endif 924 944 } 925 945 codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 ); … … 927 947 #endif 928 948 949 #if VPS_PROFILE_OUTPUT_LAYERS 929 950 Int numOutputLayerSets = vps->getNumOutputLayerSets() ; 930 951 WRITE_FLAG( (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" ); … … 961 982 WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" ); 962 983 } 963 984 #else 985 #if VPS_EXTN_OP_LAYER_SETS 986 // Target output layer signalling 987 WRITE_UVLC( vps->getNumOutputLayerSets(), "vps_num_output_layer_sets"); 988 for(i = 0; i < vps->getNumOutputLayerSets(); i++) 989 { 990 #if VPS_OUTPUT_LAYER_SET_IDX 991 assert(vps->getOutputLayerSetIdx(i) > 0); 992 WRITE_UVLC( vps->getOutputLayerSetIdx(i) - 1, "vps_output_layer_set_idx_minus1[i]"); 993 #else 994 WRITE_UVLC( vps->getOutputLayerSetIdx(i), "vps_output_layer_set_idx[i]"); 995 #endif 996 Int lsIdx = vps->getOutputLayerSetIdx(i); 997 for(j = 0; j <= vps->getMaxLayerId(); j++) 998 { 999 if(vps->getLayerIdIncludedFlag(lsIdx, j)) 1000 { 1001 WRITE_FLAG( vps->getOutputLayerFlag(lsIdx, j), "vps_output_layer_flag[lsIdx][j]"); 1002 } 1003 } 1004 } 1005 #endif 1006 #endif 1007 964 1008 #if REPN_FORMAT_IN_VPS 965 1009 WRITE_FLAG( vps->getRepFormatIdxPresentFlag(), "rep_format_idx_present_flag"); … … 988 1032 989 1033 #if JCTVC_M0458_INTERLAYER_RPS_SIG 990 WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag");1034 WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag"); 991 1035 #endif 992 1036 #if O0215_PHASE_ALIGNMENT … … 994 1038 #endif 995 1039 #if N0147_IRAP_ALIGN_FLAG 996 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");1040 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 997 1041 #endif 1042 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG 1043 #if VPS_EXTN_DIRECT_REF_LAYERS 1044 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1045 { 1046 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1047 { 1048 WRITE_FLAG(vps->getDirectDependencyFlag(layerCtr, refLayerCtr), "direct_dependency_flag[i][j]" ); 1049 } 1050 } 1051 #endif 1052 #endif 998 1053 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 999 1054 WRITE_UVLC( vps->getDirectDepTypeLen()-2, "direct_dep_type_len_minus2"); … … 1129 1184 } 1130 1185 #endif 1131 #endif //SVC_EXTENSION1132 1186 1133 1187 Void TEncCavlc::codeSliceHeader ( TComSlice* pcSlice ) … … 1175 1229 if ( !pcSlice->getDependentSliceSegmentFlag() ) 1176 1230 { 1177 #if SVC_EXTENSION 1231 1178 1232 #if POC_RESET_FLAG 1179 1233 Int iBits = 0; … … 1195 1249 } 1196 1250 #else 1251 #if SH_DISCARDABLE_FLAG 1197 1252 if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) 1198 1253 { … … 1205 1260 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1206 1261 } 1207 #endif 1208 #else //SVC_EXTENSION 1262 #else 1209 1263 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1210 1264 { … … 1212 1266 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1213 1267 } 1214 #endif //SVC_EXTENSION 1268 #endif 1269 #endif 1215 1270 1216 1271 WRITE_UVLC( pcSlice->getSliceType(), "slice_type" ); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r464 r466 753 753 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR)); 754 754 #if SVC_EXTENSION 755 #if ILR_RESTR && ILR_RESTR_FIX 756 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1]; 757 Int activeNumILRRefIdxTmp = 0; 758 #endif 755 759 if (m_layerId > 0) 756 760 { 757 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1];758 Int activeNumILRRefIdxTmp = 0;759 760 761 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 761 762 { … … 768 769 pcSlice->setBaseColPic( *cListPic, refLayerIdc ); 769 770 771 #if ILR_RESTR && ILR_RESTR_FIX 770 772 // Apply temporal layer restriction to inter-layer prediction 771 773 Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId()); … … 778 780 continue; // ILP is not valid due to temporal layer restriction 779 781 } 780 782 #endif 783 784 #if SCALED_REF_LAYER_OFFSETS 781 785 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc); 782 786 … … 786 790 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 787 791 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 788 792 #else 793 const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getConformanceWindow(); 794 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 795 796 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 797 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 798 799 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 800 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 801 #endif 789 802 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 790 803 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); … … 810 823 } 811 824 825 #if ILR_RESTR && ILR_RESTR_FIX 812 826 // Update the list of active inter-layer pictures 813 827 for ( Int i = 0; i < activeNumILRRefIdxTmp; i++) … … 821 835 pcSlice->setInterLayerPredEnabledFlag(false); 822 836 } 837 #endif 823 838 824 839 if( pocCurr % m_pcCfg->getIntraPeriod() == 0 ) … … 1601 1616 pcSlice->setSliceSegmentCurStartCUAddr ( startCUAddrSlice ); 1602 1617 pcSlice->setSliceBits(0); 1603 #if SVC_EXTENSION1604 // copy reference list modification info from the first slice, assuming that this information is the same across all slices in the picture1605 memcpy( pcSlice->getRefPicListModification(), pcPic->getSlice(0)->getRefPicListModification(), sizeof(TComRefPicListModification) );1606 #endif1607 1618 uiNumSlices ++; 1608 1619 } -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r442 r466 4119 4119 4120 4120 // prediction pattern 4121 #if O0194_WEIGHTED_PREDICTION_CGS 4122 // Bug Fix (It did not check WP for BSlices) 4123 if ( pcCU->getSlice()->getPPS()->getUseWP()) 4124 #else 4121 4125 if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE ) 4126 #endif 4122 4127 { 4123 4128 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, true ); … … 4128 4133 } 4129 4134 4135 #if O0194_WEIGHTED_PREDICTION_CGS 4136 if ( pcCU->getSlice()->getPPS()->getUseWP()) 4137 ///< Bug Fix (It did not check WP for BSlices) 4138 #else 4130 4139 if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE ) 4140 #endif 4131 4141 { 4132 4142 xWeightedPredictionUni( pcCU, pcTemplateCand, uiPartAddr, iSizeX, iSizeY, eRefPicList, pcTemplateCand, iRefIdx ); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r442 r466 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 51 51 m_apcPicYuvPred = NULL; 52 52 m_apcPicYuvResi = NULL; 53 53 54 54 m_pdRdPicLambda = NULL; 55 55 m_pdRdPicQp = NULL; … … 69 69 } 70 70 71 Void TEncSlice::initCtxMem( UInt i ) 72 { 71 Void TEncSlice::initCtxMem( UInt i ) 72 { 73 73 for (std::vector<TEncSbac*>::iterator j = CTXMem.begin(); j != CTXMem.end(); j++) 74 74 { 75 75 delete (*j); 76 76 } 77 CTXMem.clear(); 78 CTXMem.resize(i); 77 CTXMem.clear(); 78 CTXMem.resize(i); 79 79 } 80 80 … … 87 87 m_apcPicYuvPred->create( iWidth, iHeight, iMaxCUWidth, iMaxCUHeight, uhTotalDepth ); 88 88 } 89 89 90 90 // create residual picture 91 91 if( m_apcPicYuvResi == NULL ) … … 105 105 m_apcPicYuvPred = NULL; 106 106 } 107 107 108 108 // destroy residual picture 109 109 if ( m_apcPicYuvResi ) … … 113 113 m_apcPicYuvResi = NULL; 114 114 } 115 115 116 116 // free lambda and QP arrays 117 117 if ( m_pdRdPicLambda ) { xFree( m_pdRdPicLambda ); m_pdRdPicLambda = NULL; } … … 139 139 #if SVC_EXTENSION 140 140 m_ppcTEncTop = pcEncTop->getLayerEnc(); 141 #endif 141 #endif 142 142 m_pcGOPEncoder = pcEncTop->getGOPEncoder(); 143 143 m_pcCuEncoder = pcEncTop->getCuEncoder(); 144 144 m_pcPredSearch = pcEncTop->getPredSearch(); 145 145 146 146 m_pcEntropyCoder = pcEncTop->getEntropyCoder(); 147 147 m_pcCavlcCoder = pcEncTop->getCavlcCoder(); … … 149 149 m_pcBinCABAC = pcEncTop->getBinCABAC(); 150 150 m_pcTrQuant = pcEncTop->getTrQuant(); 151 151 152 152 m_pcBitCounter = pcEncTop->getBitCounter(); 153 153 m_pcRdCost = pcEncTop->getRdCost(); 154 154 m_pppcRDSbacCoder = pcEncTop->getRDSbacCoder(); 155 155 m_pcRDGoOnSbacCoder = pcEncTop->getRDGoOnSbacCoder(); 156 156 157 157 // create lambda and QP arrays 158 158 m_pdRdPicLambda = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 ); … … 187 187 Double dQP; 188 188 Double dLambda; 189 189 190 190 rpcSlice = pcPic->getSlice(0); 191 191 rpcSlice->setSPS( pSPS ); … … 202 202 rpcSlice->setPicOutputFlag( true ); 203 203 rpcSlice->setPOC( pocCurr ); 204 204 205 205 // depth computation based on GOP size 206 206 Int depth; … … 230 230 } 231 231 } 232 232 233 233 // slice type 234 234 SliceType eSliceType; 235 235 236 236 eSliceType=B_SLICE; 237 237 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 238 238 239 239 rpcSlice->setSliceType ( eSliceType ); 240 240 241 241 // ------------------------------------------------------------------------------------------------------------------ 242 242 // Non-referenced frame marking 243 243 // ------------------------------------------------------------------------------------------------------------------ 244 244 245 245 if(pocLast == 0) 246 246 { … … 252 252 } 253 253 rpcSlice->setReferenced(true); 254 254 255 255 // ------------------------------------------------------------------------------------------------------------------ 256 256 // QP setting 257 257 // ------------------------------------------------------------------------------------------------------------------ 258 258 259 259 dQP = m_pcCfg->getQP(); 260 260 if(eSliceType!=I_SLICE) 261 261 { 262 262 #if REPN_FORMAT_IN_VPS 263 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 264 #else 265 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 263 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 264 #else 265 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 266 266 #endif 267 267 { … … 269 269 } 270 270 } 271 271 272 272 // modify QP 273 273 Int* pdQPs = m_pcCfg->getdQPs(); … … 285 285 // Lambda computation 286 286 // ------------------------------------------------------------------------------------------------------------------ 287 287 288 288 Int iQP; 289 289 Double dOrigQP = dQP; … … 294 294 // compute QP value 295 295 dQP = dOrigQP + ((iDQpIdx+1)>>1)*(iDQpIdx%2 ? -1 : 1); 296 296 297 297 // compute lambda value 298 298 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); … … 326 326 #endif 327 327 } 328 328 329 329 // if hadamard is used in ME process 330 330 if ( !m_pcCfg->getUseHADME() && rpcSlice->getSliceType( ) != I_SLICE ) … … 332 332 dLambda *= 0.95; 333 333 } 334 334 335 335 #if REPN_FORMAT_IN_VPS 336 336 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); … … 343 343 m_piRdPicQp [iDQpIdx] = iQP; 344 344 } 345 345 346 346 // obtain dQP = 0 case 347 347 dLambda = m_pdRdPicLambda[0]; 348 348 dQP = m_pdRdPicQp [0]; 349 349 iQP = m_piRdPicQp [0]; 350 350 351 351 if( rpcSlice->getSliceType( ) != I_SLICE ) 352 352 { … … 359 359 Int nCurLayer = rpcSlice->getLayerId(); 360 360 Double gamma = xCalEnhLambdaFactor( m_ppcTEncTop[nCurLayer-1]->getQP() - m_ppcTEncTop[nCurLayer]->getQP() , 361 1.0 * m_ppcTEncTop[nCurLayer]->getSourceWidth() * m_ppcTEncTop[nCurLayer]->getSourceHeight() 361 1.0 * m_ppcTEncTop[nCurLayer]->getSourceWidth() * m_ppcTEncTop[nCurLayer]->getSourceHeight() 362 362 / m_ppcTEncTop[nCurLayer-1]->getSourceWidth() / m_ppcTEncTop[nCurLayer-1]->getSourceHeight() ); 363 363 dLambda *= gamma; … … 392 392 #endif 393 393 394 #if RDOQ_CHROMA_LAMBDA 394 #if RDOQ_CHROMA_LAMBDA 395 395 // for RDOQ 396 m_pcTrQuant->setLambda( dLambda, dLambda / weight ); 396 m_pcTrQuant->setLambda( dLambda, dLambda / weight ); 397 397 #else 398 398 m_pcTrQuant->setLambda( dLambda ); … … 401 401 #if SAO_CHROMA_LAMBDA 402 402 // For SAO 403 rpcSlice ->setLambda( dLambda, dLambda / weight ); 403 rpcSlice ->setLambda( dLambda, dLambda / weight ); 404 404 #else 405 405 rpcSlice ->setLambda( dLambda ); 406 406 #endif 407 407 408 408 #if HB_LAMBDA_FOR_LDC 409 409 // restore original slice type 410 410 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 411 411 412 412 #if SVC_EXTENSION 413 413 if(m_pcCfg->getLayerId() > 0) … … 418 418 rpcSlice->setSliceType ( eSliceType ); 419 419 #endif 420 420 421 421 if (m_pcCfg->getUseRecalculateQPAccordingToLambda()) 422 422 { 423 423 dQP = xGetQPValueAccordingToLambda( dLambda ); 424 424 #if REPN_FORMAT_IN_VPS 425 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 426 #else 427 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 425 iQP = max( -rpcSlice->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 426 #else 427 iQP = max( -pSPS->getQpBDOffsetY(), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) ); 428 428 #endif 429 429 } … … 438 438 rpcSlice->setNumRefIdx(REF_PIC_LIST_0,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); 439 439 rpcSlice->setNumRefIdx(REF_PIC_LIST_1,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); 440 440 441 441 if ( m_pcCfg->getDeblockingFilterMetric() ) 442 442 { … … 479 479 480 480 rpcSlice->setDepth ( depth ); 481 481 482 482 pcPic->setTLayer( m_pcCfg->getGOPEntry(iGOPid).m_temporalId ); 483 483 #if TEMP_SCALABILITY_FIX … … 493 493 assert( m_apcPicYuvPred ); 494 494 assert( m_apcPicYuvResi ); 495 495 496 496 pcPic->setPicYuvPred( m_apcPicYuvPred ); 497 497 pcPic->setPicYuvResi( m_apcPicYuvResi ); … … 557 557 #endif 558 558 559 #if RDOQ_CHROMA_LAMBDA 559 #if RDOQ_CHROMA_LAMBDA 560 560 // for RDOQ 561 561 m_pcTrQuant->setLambda( lambda, lambda / weight ); … … 665 665 #endif 666 666 667 #if RDOQ_CHROMA_LAMBDA 667 #if RDOQ_CHROMA_LAMBDA 668 668 // for RDOQ 669 m_pcTrQuant->setLambda( lambda, lambda / weight ); 669 m_pcTrQuant->setLambda( lambda, lambda / weight ); 670 670 #else 671 671 m_pcTrQuant->setLambda( lambda ); … … 674 674 #if SAO_CHROMA_LAMBDA 675 675 // For SAO 676 pcSlice ->setLambda( lambda, lambda / weight ); 676 pcSlice ->setLambda( lambda, lambda / weight ); 677 677 #else 678 678 pcSlice ->setLambda( lambda ); … … 692 692 Int iMaxSR = m_pcCfg->getSearchRange(); 693 693 Int iNumPredDir = pcSlice->isInterP() ? 1 : 2; 694 694 695 695 for (Int iDir = 0; iDir <= iNumPredDir; iDir++) 696 696 { … … 726 726 } 727 727 #endif 728 728 729 729 TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx()); 730 730 Double dPicRdCostBest = MAX_DOUBLE; 731 731 UInt uiQpIdxBest = 0; 732 732 733 733 Double dFrameLambda; 734 734 #if FULL_NBIT … … 737 737 Int SHIFT_QP = 12; 738 738 #endif 739 739 740 740 // set frame lambda 741 741 if (m_pcCfg->getGOPSize() > 1) … … 748 748 } 749 749 m_pcRdCost ->setFrameLambda(dFrameLambda); 750 750 751 751 // for each QP candidate 752 752 for ( UInt uiQpIdx = 0; uiQpIdx < 2 * m_pcCfg->getDeltaQpRD() + 1; uiQpIdx++ ) … … 776 776 #endif 777 777 778 #if RDOQ_CHROMA_LAMBDA 778 #if RDOQ_CHROMA_LAMBDA 779 779 // for RDOQ 780 780 m_pcTrQuant ->setLambda( m_pdRdPicLambda[uiQpIdx], m_pdRdPicLambda[uiQpIdx] / weight ); … … 784 784 #if SAO_CHROMA_LAMBDA 785 785 // For SAO 786 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdx], m_pdRdPicLambda[uiQpIdx] / weight ); 786 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdx], m_pdRdPicLambda[uiQpIdx] / weight ); 787 787 #else 788 788 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdx] ); 789 789 #endif 790 790 791 791 // try compress 792 792 compressSlice ( rpcPic ); 793 793 794 794 Double dPicRdCost; 795 795 UInt64 uiPicDist = m_uiPicDist; 796 796 UInt64 uiALFBits = 0; 797 797 798 798 m_pcGOPEncoder->preLoopFilterPicAll( rpcPic, uiPicDist, uiALFBits ); 799 799 800 800 // compute RD cost and choose the best 801 801 dPicRdCost = m_pcRdCost->calcRdCost64( m_uiPicTotalBits + uiALFBits, uiPicDist, true, DF_SSE_FRAME); 802 802 803 803 if ( dPicRdCost < dPicRdCostBest ) 804 804 { … … 807 807 } 808 808 } 809 809 810 810 // set best values 811 811 pcSlice ->setSliceQp ( m_piRdPicQp [uiQpIdxBest] ); … … 832 832 #endif 833 833 834 #if RDOQ_CHROMA_LAMBDA 835 // for RDOQ 836 m_pcTrQuant ->setLambda( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 834 #if RDOQ_CHROMA_LAMBDA 835 // for RDOQ 836 m_pcTrQuant ->setLambda( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 837 837 #else 838 838 m_pcTrQuant ->setLambda ( m_pdRdPicLambda[uiQpIdxBest] ); … … 840 840 #if SAO_CHROMA_LAMBDA 841 841 // For SAO 842 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 842 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdxBest], m_pdRdPicLambda[uiQpIdxBest] / weight ); 843 843 #else 844 844 pcSlice ->setLambda ( m_pdRdPicLambda[uiQpIdxBest] ); … … 862 862 863 863 UInt uiEncCUOrder; 864 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 864 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 865 865 for( uiEncCUOrder = uiStartCUAddr/rpcPic->getNumPartInCU(); 866 866 uiEncCUOrder < (uiBoundingCUAddr+(rpcPic->getNumPartInCU()-1))/rpcPic->getNumPartInCU(); … … 898 898 TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx()); 899 899 xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false ); 900 900 901 901 // initialize cost values 902 902 m_uiPicTotalBits = 0; 903 903 m_dPicRdCost = 0; 904 904 m_uiPicDist = 0; 905 905 906 906 // set entropy coder 907 907 if( m_pcCfg->getUseSBACRD() ) … … 921 921 m_pcEntropyCoder->setBitstream ( m_pcBitCounter ); 922 922 } 923 923 924 924 //------------------------------------------------------------------------------ 925 925 // Weighted Prediction parameters estimation. … … 930 930 xCalcACDCParamSlice(pcSlice); 931 931 } 932 #if O0194_WEIGHTED_PREDICTION_CGS 933 else{ 934 // Calculate for the base layer to be used in EL as Inter layer reference 935 xCalcACDCParamSlice(pcSlice); 936 wpACDCParam * temp_weightACDCParam; 937 938 pcSlice->getWpAcDcParam(temp_weightACDCParam); 939 g_refWeightACDCParam = (void *) temp_weightACDCParam; 940 } 941 #endif 932 942 933 943 Bool bWp_explicit = (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPred()); … … 1021 1031 m_pcBufferSbacCoders[uiTileCol].loadContexts( CTXMem[1] ); 1022 1032 Int iNumSubstreamsPerTile = iNumSubstreams/rpcPic->getPicSym()->getNumTiles(); 1023 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 1033 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 1024 1034 uiLin = uiCUAddr / uiWidthInLCUs; 1025 1035 uiSubStrm = rpcPic->getPicSym()->getTileIdxMap(rpcPic->getPicSym()->getCUOrderMap(uiCUAddr))*iNumSubstreamsPerTile … … 1098 1108 pcCUTR = rpcPic->getCU( uiCUAddr - uiWidthInCU + 1 ); 1099 1109 } 1100 if ( ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1110 if ( ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1101 1111 (pcCUTR->getSCUAddr()+uiMaxParts-1 < pcSlice->getSliceCurStartCUAddr()) || 1102 1112 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(uiCUAddr))) … … 1137 1147 m_pcEntropyCoder->setEntropyCoder ( m_pcRDGoOnSbacCoder, pcSlice ); 1138 1148 m_pcEntropyCoder->setBitstream( &pcBitCounters[uiSubStrm] ); 1139 1149 1140 1150 ((TEncBinCABAC*)m_pcRDGoOnSbacCoder->getEncBinIf())->setBinCountingEnableFlag(true); 1141 1151 … … 1242 1252 m_pcRdCost->setLambda(oldLambda); 1243 1253 #if RATE_CONTROL_INTRA 1244 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1254 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1245 1255 pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() ); 1246 1256 #else … … 1250 1260 #endif 1251 1261 #endif 1252 1262 1253 1263 // restore entropy coder to an initial stage 1254 1264 m_pcEntropyCoder->setEntropyCoder ( m_pppcRDSbacCoder[0][CI_CURR_BEST], pcSlice ); … … 1275 1285 { 1276 1286 ppppcRDSbacCoders[uiSubStrm][0][CI_CURR_BEST]->load( m_pppcRDSbacCoder[0][CI_CURR_BEST] ); 1277 1287 1278 1288 //Store probabilties of second LCU in line into buffer 1279 1289 if ( ( uiCol == uiTileLCUX+1) && (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && m_pcCfg->getWaveFrontsynchro()) … … 1325 1335 1326 1336 #if RATE_CONTROL_INTRA 1327 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1337 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1328 1338 pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() ); 1329 1339 #else … … 1350 1360 } 1351 1361 } 1352 1362 1353 1363 m_uiPicTotalBits += pcCU->getTotalBits(); 1354 1364 m_dPicRdCost += pcCU->getTotalCost(); … … 1401 1411 m_pcEntropyCoder->setEntropyCoder ( m_pcSbacCoder, pcSlice ); 1402 1412 } 1403 1413 1404 1414 m_pcCuEncoder->setBitCounter( NULL ); 1405 1415 m_pcBitCounter = NULL; … … 1427 1437 m_pcBufferSbacCoders[ui].load(m_pcSbacCoder); //init. state 1428 1438 } 1429 1439 1430 1440 for (Int iSubstrmIdx=0; iSubstrmIdx < iNumSubstreams; iSubstrmIdx++) 1431 1441 { … … 1524 1534 } 1525 1535 if ( (true/*bEnforceSliceRestriction*/ && 1526 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1536 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 1527 1537 (pcCUTR->getSCUAddr()+uiMaxParts-1 < pcSlice->getSliceCurStartCUAddr()) || 1528 1538 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(uiCUAddr))) … … 1579 1589 } 1580 1590 1581 TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr ); 1591 TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr ); 1582 1592 if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) ) 1583 1593 { … … 1613 1623 if (allowMergeLeft) 1614 1624 { 1615 m_pcEntropyCoder->m_pcEntropyCoderIf->codeSaoMerge(mergeLeft); 1625 m_pcEntropyCoder->m_pcEntropyCoderIf->codeSaoMerge(mergeLeft); 1616 1626 } 1617 1627 else … … 1676 1686 #if ENC_DEC_TRACE 1677 1687 g_bJustDoIt = g_bEncDecTraceDisable; 1678 #endif 1688 #endif 1679 1689 if( m_pcCfg->getUseSBACRD() ) 1680 1690 { 1681 1691 pcSbacCoders[uiSubStrm].load(m_pcSbacCoder); //load back status of the entropy coder after encoding the LCU into relevant bitstream entropy coder 1682 1692 1683 1693 1684 1694 //Store probabilties of second LCU in line into buffer … … 1733 1743 UInt uiNumberOfCUsInFrame = rpcPic->getNumCUsInFrame(); 1734 1744 uiBoundingCUAddrSlice = uiNumberOfCUsInFrame; 1735 if (bEncodeSlice) 1745 if (bEncodeSlice) 1736 1746 { 1737 1747 UInt uiCUAddrIncrement; … … 1769 1779 uiBoundingCUAddrSlice = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1770 1780 break; 1771 } 1781 } 1772 1782 // WPP: if a slice does not start at the beginning of a CTB row, it must end within the same CTB row 1773 1783 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiStartCUAddrSlice % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1809 1819 uiBoundingCUAddrSlice = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1810 1820 break; 1811 } 1821 } 1812 1822 // WPP: if a slice does not start at the beginning of a CTB row, it must end within the same CTB row 1813 1823 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiStartCUAddrSlice % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1819 1829 1820 1830 Bool tileBoundary = false; 1821 if ((m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_BYTES) && 1831 if ((m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_BYTES) && 1822 1832 (m_pcCfg->getNumRowsMinus1() > 0 || m_pcCfg->getNumColumnsMinus1() > 0)) 1823 1833 { … … 1832 1842 } 1833 1843 tileBoundingCUAddrSlice = lcuEncAddr*rpcPic->getNumPartInCU(); 1834 1844 1835 1845 if (tileBoundingCUAddrSlice < uiBoundingCUAddrSlice) 1836 1846 { … … 1845 1855 startCUAddrSliceSegment = pcSlice->getSliceSegmentCurStartCUAddr(); 1846 1856 boundingCUAddrSliceSegment = uiNumberOfCUsInFrame; 1847 if (bEncodeSlice) 1857 if (bEncodeSlice) 1848 1858 { 1849 1859 UInt uiCUAddrIncrement; … … 1880 1890 boundingCUAddrSliceSegment = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1881 1891 break; 1882 } 1892 } 1883 1893 // WPP: if a slice segment does not start at the beginning of a CTB row, it must end within the same CTB row 1884 1894 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (startCUAddrSliceSegment % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1919 1929 boundingCUAddrSliceSegment = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU(); 1920 1930 break; 1921 } 1931 } 1922 1932 // WPP: if a slice segment does not start at the beginning of a CTB row, it must end within the same CTB row 1923 1933 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (startCUAddrSliceSegment % (rpcPic->getFrameWidthInCU()*rpcPic->getNumPartInCU()) != 0)) … … 1927 1937 pcSlice->setSliceSegmentCurEndCUAddr( boundingCUAddrSliceSegment ); 1928 1938 } 1929 if ((m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_BYTES) && 1939 if ((m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_LCU || m_pcCfg->getSliceSegmentMode() == FIXED_NUMBER_OF_BYTES) && 1930 1940 (m_pcCfg->getNumRowsMinus1() > 0 || m_pcCfg->getNumColumnsMinus1() > 0)) 1931 1941 { … … 1979 1989 } 1980 1990 UInt uiRealStartAddress = rpcPic->getPicSym()->getPicSCUEncOrder(uiExternalAddress*rpcPic->getNumPartInCU()+uiInternalAddress); 1981 1991 1982 1992 pcSlice->setSliceSegmentCurStartCUAddr(uiRealStartAddress); 1983 1993 startCUAddrSliceSegment=uiRealStartAddress; 1984 1994 1985 1995 //calculate real slice start address 1986 1996 uiInternalAddress = rpcPic->getPicSym()->getPicSCUAddr(pcSlice->getSliceCurStartCUAddr()) % rpcPic->getNumPartInCU(); … … 2007 2017 } 2008 2018 uiRealStartAddress = rpcPic->getPicSym()->getPicSCUEncOrder(uiExternalAddress*rpcPic->getNumPartInCU()+uiInternalAddress); 2009 2019 2010 2020 pcSlice->setSliceCurStartCUAddr(uiRealStartAddress); 2011 2021 uiStartCUAddrSlice=uiRealStartAddress; 2012 2022 2013 2023 // Make a joint decision based on reconstruction and dependent slice bounds 2014 2024 startCUAddr = max(uiStartCUAddrSlice , startCUAddrSliceSegment ); … … 2022 2032 if ( (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_LCU && m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_LCU) 2023 2033 || (m_pcCfg->getSliceMode()==0 && m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_LCU) 2024 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_LCU && m_pcCfg->getSliceSegmentMode()==0) 2034 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_LCU && m_pcCfg->getSliceSegmentMode()==0) 2025 2035 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_LCU) 2026 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceSegmentMode()==0) 2036 || (m_pcCfg->getSliceMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceSegmentMode()==0) 2027 2037 || (m_pcCfg->getSliceSegmentMode()==FIXED_NUMBER_OF_TILES && m_pcCfg->getSliceMode()==0) 2028 2038 || tileBoundary -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
r460 r466 88 88 m_bMFMEnabledFlag = false; 89 89 #endif 90 #if SCALED_REF_LAYER_OFFSETS 90 91 m_numScaledRefLayerOffsets = 0; 92 #endif 93 #endif 91 94 #if POC_RESET_FLAG 92 95 m_pocAdjustmentValue = 0; 93 96 #endif 94 #endif //SVC_EXTENSION95 97 } 96 98 … … 173 175 } 174 176 } 175 176 #if LAYER_CTB177 memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) );178 memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) );179 memcpy(g_auiLayerRasterToPelX[m_layerId], g_auiRasterToPelX, sizeof( g_auiRasterToPelX ) );180 memcpy(g_auiLayerRasterToPelY[m_layerId], g_auiRasterToPelY, sizeof( g_auiRasterToPelY ) );181 #endif182 177 } 183 178 … … 876 871 #if SVC_EXTENSION 877 872 m_cSPS.setLayerId(m_layerId); 873 #endif 878 874 #if REF_IDX_MFM 879 875 #if !M0457_COL_PICTURE_SIGNALING … … 881 877 #endif 882 878 #endif 879 #if SCALED_REF_LAYER_OFFSETS 883 880 m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets); 884 881 for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++) … … 886 883 m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i]; 887 884 } 888 #endif //SVC_EXTENSION885 #endif 889 886 ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL(); 890 887 profileTierLevel.setLevelIdc(m_level); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.h
r460 r466 140 140 Int m_ilSampleOnlyPred; 141 141 #endif 142 #if SCALED_REF_LAYER_OFFSETS 142 143 UInt m_numScaledRefLayerOffsets; 143 144 Window m_scaledRefLayerWindow[MAX_LAYERS]; 145 #endif 144 146 #if POC_RESET_FLAG 145 147 Int m_pocAdjustmentValue; 146 148 #endif 147 #endif //SVC_EXTENSION149 #endif 148 150 protected: 149 151 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 207 209 Int getNumPicRcvd () { return m_iNumPicRcvd; } 208 210 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num; } 211 #if SCALED_REF_LAYER_OFFSETS 209 212 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 210 213 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 211 214 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 212 #endif //SVC_EXTENSION 215 #endif 216 #endif 213 217 214 218 // ------------------------------------------------------------------------------------------------------------------- -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp
r313 r466 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 51 51 for ( Int iList =0 ; iList<2 ; iList++ ) 52 52 { 53 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 53 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 54 54 { 55 55 for ( Int comp=0 ; comp<3 ;comp++ ) … … 74 74 TComPicYuv* pPic = slice->getPic()->getPicYuvOrg(); 75 75 Int iSample = 0; 76 #if O0194_WEIGHTED_PREDICTION_CGS 77 // Define here to assign the parameter of "iSample" 78 wpACDCParam weightACDCParam[3]; 79 #endif 76 80 77 81 // calculate DC/AC value for Y … … 81 85 pOrg = pPic->getLumaAddr(); 82 86 Int64 iOrgACY = xCalcACValueSlice(slice, pOrg, iOrgNormDCY); 87 #if O0194_WEIGHTED_PREDICTION_CGS 88 weightACDCParam[0].iSamples = iSample; 89 #endif 83 90 84 91 // calculate DC/AC value for Cb … … 88 95 pOrg = pPic->getCbAddr(); 89 96 Int64 iOrgACCb = xCalcACValueUVSlice(slice, pOrg, iOrgNormDCCb); 97 #if O0194_WEIGHTED_PREDICTION_CGS 98 weightACDCParam[1].iSamples = iSample; 99 #endif 90 100 91 101 // calculate DC/AC value for Cr … … 95 105 pOrg = pPic->getCrAddr(); 96 106 Int64 iOrgACCr = xCalcACValueUVSlice(slice, pOrg, iOrgNormDCCr); 97 107 #if O0194_WEIGHTED_PREDICTION_CGS 108 weightACDCParam[2].iSamples = iSample; 109 #endif 110 111 #if !O0194_WEIGHTED_PREDICTION_CGS 98 112 wpACDCParam weightACDCParam[3]; 113 #endif 99 114 weightACDCParam[0].iAC = iOrgACY; 100 115 weightACDCParam[0].iDC = iOrgNormDCY; … … 138 153 for ( Int iList=0 ; iList<2 ; iList++ ) 139 154 { 140 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 141 { 142 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 155 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 156 { 157 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 143 158 { 144 159 wpScalingParam *pwp = &(m_wp[iList][iRefIdx][iComp]); … … 154 169 for ( Int iList=0 ; iList<2 ; iList++ ) 155 170 { 156 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 171 for ( Int iRefIdx=0 ; iRefIdx<MAX_NUM_REF ; iRefIdx++ ) 157 172 { 158 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 173 for ( Int iComp=0 ; iComp<3 ;iComp++ ) 159 174 { 160 175 wpScalingParam *pwp = &(m_wp[iList][iRefIdx][iComp]); … … 195 210 // selecting whether WP is used, or not 196 211 xSelectWP(slice, m_wp, iDenom); 197 212 198 213 slice->setWpScaling( m_wp ); 199 214 … … 216 231 slice->getWpAcDcParam(currWeightACDCParam); 217 232 slice->getRefPic(eRefPicList, refIdxTemp)->getSlice(0)->getWpAcDcParam(refWeightACDCParam); 233 #if O0194_WEIGHTED_PREDICTION_CGS 234 if (slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1)){ 235 refWeightACDCParam = (wpACDCParam *)g_refWeightACDCParam; 236 } 237 #endif 218 238 219 239 for ( Int comp = 0; comp < 3; comp++ ) … … 229 249 Int64 refDC = refWeightACDCParam[comp].iDC; 230 250 Int64 refAC = refWeightACDCParam[comp].iAC; 251 #if O0194_WEIGHTED_PREDICTION_CGS 252 if (slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1)){ 253 refAC *= (double)currWeightACDCParam[comp].iSamples/refWeightACDCParam[comp].iSamples; 254 #if O0194_JOINT_US_BITSHIFT 255 refAC *= (1<<(g_bitDepthYLayer[1]-g_bitDepthYLayer[0])); 256 refDC *= (1<<(g_bitDepthYLayer[1]-g_bitDepthYLayer[0])); 257 #endif 258 } 259 #endif 231 260 232 261 // calculating iWeight and iOffset params … … 234 263 Int weight = (Int)( 0.5 + dWeight * (Double)(1<<log2Denom) ); 235 264 Int offset = (Int)( ((currDC<<log2Denom) - ((Int64)weight * refDC) + (Int64)realOffset) >> realLog2Denom ); 265 #if O0194_WEIGHTED_PREDICTION_CGS 266 if (slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1)){ 267 } 268 else{ 269 dWeight = 1; 270 offset = 0; 271 } 272 weight = (Int)( 0.5 + dWeight * (Double)(1<<log2Denom) ); 273 #endif 236 274 237 275 // Chroma offset range limitation … … 253 291 if(deltaWeight > 127 || deltaWeight < -128) 254 292 return (false); 293 #if O0194_WEIGHTED_PREDICTION_CGS 294 // make sure the reference frames other than ILR are not using weighted prediction 295 if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1))){ 296 continue; 297 } 298 #endif 255 299 256 300 m_wp[refList][refIdxTemp][comp].bPresentFlag = true; … … 264 308 } 265 309 266 /** select whether weighted pred enables or not. 310 /** select whether weighted pred enables or not. 267 311 * \param TComSlice *slice 268 312 * \param wpScalingParam … … 325 369 } 326 370 327 /** calculate DC value of original image for luma. 371 /** calculate DC value of original image for luma. 328 372 * \param TComSlice *slice 329 373 * \param Pel *pPel … … 345 389 } 346 390 347 /** calculate AC value of original image for luma. 391 /** calculate AC value of original image for luma. 348 392 * \param TComSlice *slice 349 393 * \param Pel *pPel … … 363 407 } 364 408 365 /** calculate DC value of original image for chroma. 409 /** calculate DC value of original image for chroma. 366 410 * \param TComSlice *slice 367 411 * \param Pel *pPel … … 383 427 } 384 428 385 /** calculate AC value of original image for chroma. 429 /** calculate AC value of original image for chroma. 386 430 * \param TComSlice *slice 387 431 * \param Pel *pPel … … 401 445 } 402 446 403 /** calculate DC value. 447 /** calculate DC value. 404 448 * \param Pel *pPel 405 449 * \param Int iWidth … … 423 467 } 424 468 425 /** calculate AC value. 469 /** calculate AC value. 426 470 * \param Pel *pPel 427 471 * \param Int iWidth … … 446 490 } 447 491 448 /** calculate SAD values for both WP version and non-WP version. 492 /** calculate SAD values for both WP version and non-WP version. 449 493 * \param Pel *pOrgPel 450 494 * \param Pel *pRefPel
Note: See TracChangeset for help on using the changeset viewer.