Changeset 475 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibDecoder
- Timestamp:
- 15 Nov 2013, 14:55:37 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source/Lib/TLibDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r468 r475 602 602 { 603 603 #endif 604 #if AUXILIARY_PICTURES 605 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) ); 606 #else 604 607 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 608 #endif 605 609 assert(uiCode <= 3); 606 610 // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream … … 1049 1053 { 1050 1054 READ_CODE( vps->getDimensionIdLen(j), uiCode, "dimension_id[i][j]" ); vps->setDimensionId(i, j, uiCode); 1055 #if !AUXILIARY_PICTURES 1051 1056 assert( uiCode <= vps->getMaxLayerId() ); 1057 #endif 1052 1058 } 1053 1059 } … … 1306 1312 { 1307 1313 UInt uiCode; 1314 #if AUXILIARY_PICTURES 1315 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) ); 1316 #else 1308 1317 READ_CODE( 2, uiCode, "chroma_format_idc" ); repFormat->setChromaFormatVpsIdc( uiCode ); 1309 1318 #endif 1319 1310 1320 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1311 1321 { … … 1808 1818 { 1809 1819 READ_FLAG(uiCode, "slice_sao_luma_flag"); rpcSlice->setSaoEnabledFlag((Bool)uiCode); 1820 #if AUXILIARY_PICTURES 1821 ChromaFormat format; 1822 #if REPN_FORMAT_IN_VPS 1823 if( ( sps->getLayerId() == 0 ) || sps->getUpdateRepFormatFlag() ) 1824 { 1825 format = sps->getChromaFormatIdc(); 1826 } 1827 else 1828 { 1829 format = rpcSlice->getVPS()->getVpsRepFormat( rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc(); 1830 } 1831 #else 1832 format = sps->getChromaFormatIdc(); 1833 #endif 1834 if (format != CHROMA_400) 1835 { 1836 #endif 1810 1837 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 1838 #if AUXILIARY_PICTURES 1839 } 1840 else 1841 { 1842 rpcSlice->setSaoEnabledFlagChroma(false); 1843 } 1844 #endif 1811 1845 } 1812 1846 … … 2411 2445 2412 2446 Int iDeltaDenom; 2447 #if AUXILIARY_PICTURES 2448 if (pcSlice->getChromaFormatIdc() == CHROMA_400) 2449 { 2450 bChroma = false; 2451 } 2452 #endif 2413 2453 // decode delta_luma_log2_weight_denom : 2414 2454 READ_UVLC( uiLog2WeightDenomLuma, "luma_log2_weight_denom" ); // ue(v): luma_log2_weight_denom … … 2430 2470 2431 2471 wp[0].uiLog2WeightDenom = uiLog2WeightDenomLuma; 2472 #if AUXILIARY_PICTURES 2473 if (!bChroma) 2474 { 2475 wp[1].uiLog2WeightDenom = 0; 2476 wp[2].uiLog2WeightDenom = 0; 2477 } 2478 else 2479 { 2480 #endif 2432 2481 wp[1].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2433 2482 wp[2].uiLog2WeightDenom = uiLog2WeightDenomChroma; 2483 #if AUXILIARY_PICTURES 2484 } 2485 #endif 2434 2486 2435 2487 UInt uiCode; -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r442 r475 356 356 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2; 357 357 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 358 #if AUXILIARY_PICTURES 359 ChromaFormat format = pcCU->getSlice()->getChromaFormatIdc(); 360 UInt uiGrayVal = 1 << (uiSampleBits - 1); 361 #endif 358 362 359 363 for(uiY = 0; uiY < uiHeight; uiY++) … … 362 366 { 363 367 UInt uiSample; 368 #if AUXILIARY_PICTURES 369 if (format == CHROMA_400) 370 uiSample = uiGrayVal; 371 else 372 #endif 364 373 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 365 374 piPCMSample[uiX] = uiSample; … … 378 387 { 379 388 UInt uiSample; 389 #if AUXILIARY_PICTURES 390 if (format == CHROMA_400) 391 uiSample = uiGrayVal; 392 else 393 #endif 380 394 m_pcTDecBinIf->xReadPCMCode(uiSampleBits, uiSample); 381 395 piPCMSample[uiX] = uiSample; … … 665 679 UInt uiSymbol; 666 680 681 #if AUXILIARY_PICTURES 682 if ( pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 ) 683 { 684 uiSymbol = DC_IDX; 685 } 686 else 687 { 688 #endif 667 689 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUChromaPredSCModel.get( 0, 0, 0 ) ); 668 690 … … 681 703 } 682 704 } 705 #if AUXILIARY_PICTURES 706 } 707 #endif 683 708 pcCU->setChromIntraDirSubParts( uiSymbol, uiAbsPartIdx, uiDepth ); 684 709 return; … … 885 910 UInt uiSymbol; 886 911 const UInt uiCtx = pcCU->getCtxQtCbf( eType, uiTrDepth ); 912 #if AUXILIARY_PICTURES 913 if (pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 && (eType == TEXT_CHROMA_U || eType == TEXT_CHROMA_V)) 914 { 915 uiSymbol = 0; 916 } 917 else 918 { 919 #endif 887 920 m_pcTDecBinIf->decodeBin( uiSymbol , m_cCUQtCbfSCModel.get( 0, eType ? TEXT_CHROMA: eType, uiCtx ) ); 921 #if AUXILIARY_PICTURES 922 } 923 #endif 888 924 889 925 DTRACE_CABAC_VL( g_nSymbolCounter++ ) -
branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
r464 r475 179 179 180 180 m_cIlpPic[j] = new TComPic; 181 #if AUXILIARY_PICTURES 182 #if REPN_FORMAT_IN_VPS 183 #if SVC_UPSAMPLING 184 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 185 #else 186 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 187 #endif 188 #else 189 #if SVC_UPSAMPLING 190 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 191 #else 192 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 193 #endif 194 #endif 195 #else 181 196 #if REPN_FORMAT_IN_VPS 182 197 #if SVC_UPSAMPLING … … 190 205 #else 191 206 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true); 207 #endif 192 208 #endif 193 209 #endif … … 291 307 #endif 292 308 309 #if AUXILIARY_PICTURES 310 #if REPN_FORMAT_IN_VPS 311 #if SVC_UPSAMPLING 312 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 313 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 314 #else 315 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 316 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 317 #endif 318 #else 319 #if SVC_UPSAMPLING 320 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 321 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 322 #else 323 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 324 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 325 #endif 326 #endif 327 #else 293 328 #if REPN_FORMAT_IN_VPS 294 329 #if SVC_UPSAMPLING … … 308 343 #endif 309 344 #endif 345 #endif 310 346 311 347 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); … … 348 384 rpcPic->destroy(); 349 385 386 #if AUXILIARY_PICTURES 387 #if REPN_FORMAT_IN_VPS 388 #if SVC_UPSAMPLING 389 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 390 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 391 392 #else 393 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 394 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 395 #endif 396 #else 397 #if SVC_UPSAMPLING 398 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 399 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 400 401 #else 402 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 403 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 404 #endif 405 #endif 406 #else 350 407 #if REPN_FORMAT_IN_VPS 351 408 #if SVC_UPSAMPLING … … 365 422 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 366 423 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 424 #endif 367 425 #endif 368 426 #endif … … 1526 1584 Window &conformanceWindow = sps->getConformanceWindow(); 1527 1585 Window defaultDisplayWindow = sps->getVuiParametersPresentFlag() ? sps->getVuiParameters()->getDefaultDisplayWindow() : Window(); 1586 #if AUXILIARY_PICTURES 1528 1587 #if SVC_UPSAMPLING 1529 1588 #if AVC_SYNTAX 1530 1589 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true); 1590 #else 1591 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 1592 #endif 1593 #else 1594 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 1595 #endif 1596 #else 1597 #if SVC_UPSAMPLING 1598 #if AVC_SYNTAX 1531 1599 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true); 1532 1600 #else … … 1535 1603 #else 1536 1604 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 1605 #endif 1537 1606 #endif 1538 1607 }
Note: See TracChangeset for help on using the changeset viewer.