Changeset 849 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 29 Jul 2014, 14:03:05 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r848 r849 359 359 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); 360 360 pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false); 361 #if REF_REGION_OFFSET 362 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode); 363 for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++) 364 { 365 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcPPS->setScaledRefLayerId( i, uiCode ); 366 READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" ); pcPPS->setScaledRefLayerOffsetPresentFlag( i, uiCode ); 367 if (uiCode) 368 { 369 Window& scaledWindow = pcPPS->getScaledRefLayerWindow(i); 370 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); 371 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1); 372 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 373 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 374 #if P0312_VERT_PHASE_ADJ 375 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode); 376 #endif 377 } 378 READ_FLAG( uiCode, "ref_region_offset_present_flag" ); pcPPS->setRefRegionOffsetPresentFlag( i, uiCode ); 379 if (uiCode) 380 { 381 Window& refWindow = pcPPS->getRefLayerWindow(i); 382 READ_SVLC( iCode, "ref_region_left_offset" ); refWindow.setWindowLeftOffset (iCode << 1); 383 READ_SVLC( iCode, "ref_region_top_offset" ); refWindow.setWindowTopOffset (iCode << 1); 384 READ_SVLC( iCode, "ref_region_right_offset" ); refWindow.setWindowRightOffset (iCode << 1); 385 READ_SVLC( iCode, "ref_region_bottom_offset" ); refWindow.setWindowBottomOffset(iCode << 1); 386 } 387 #if R0209_GENERIC_PHASE 388 READ_FLAG( uiCode, "resample_phase_set_present_flag" ); pcPPS->setResamplePhaseSetPresentFlag( i, uiCode ); 389 if (uiCode) 390 { 391 READ_UVLC( uiCode, "phase_hor_luma" ); pcPPS->setPhaseHorLuma ( i, uiCode ); 392 READ_UVLC( uiCode, "phase_ver_luma" ); pcPPS->setPhaseVerLuma ( i, uiCode ); 393 READ_UVLC( uiCode, "phase_hor_chroma_plus8" ); pcPPS->setPhaseHorChroma (i, uiCode - 8); 394 READ_UVLC( uiCode, "phase_ver_chroma_plus8" ); pcPPS->setPhaseVerChroma (i, uiCode - 8); 395 } 396 #endif 397 } 398 #else 399 #if MOVE_SCALED_OFFSET_TO_PPS 400 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode); 401 for(Int i = 0; i < pcPPS->getNumScaledRefLayerOffsets(); i++) 402 { 403 Window& scaledWindow = pcPPS->getScaledRefLayerWindow(i); 404 #if O0098_SCALED_REF_LAYER_ID 405 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcPPS->setScaledRefLayerId( i, uiCode ); 406 #endif 407 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); 408 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1); 409 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 410 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 411 #if P0312_VERT_PHASE_ADJ 412 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode); 413 #endif 414 } 415 #endif 416 #endif 361 417 #if Q0048_CGS_3D_ASYMLUT 362 418 READ_FLAG( uiCode , "colour_mapping_enabled_flag" ); … … 897 953 assert( uiCode == 0 ); 898 954 955 #if !MOVE_SCALED_OFFSET_TO_PPS 899 956 if( pcSPS->getLayerId() > 0 ) 900 957 { … … 916 973 } 917 974 } 975 #endif 918 976 } 919 977 #endif … … 3027 3085 } 3028 3086 #if P0312_VERT_PHASE_ADJ 3029 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 3030 { 3031 UInt refLayerIdc = rpcSlice->getInterLayerPredLayerIdc(i); 3032 if( rpcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) ) 3033 { 3034 READ_FLAG( uiCode, "vert_phase_position_flag" ); rpcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc ); 3035 } 3087 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 3088 { 3089 UInt refLayerIdc = rpcSlice->getInterLayerPredLayerIdc(i); 3090 #if !MOVE_SCALED_OFFSET_TO_PPS 3091 if( rpcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) ) 3092 #else 3093 if( rpcSlice->getPPS()->getVertPhasePositionEnableFlag(refLayerIdc) ) 3094 #endif 3095 { 3096 READ_FLAG( uiCode, "vert_phase_position_flag" ); rpcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc ); 3097 } 3036 3098 } 3037 3099 #endif -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r834 r849 350 350 for(UInt i = 0; i < pcSlice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ ) 351 351 { 352 #if MOVE_SCALED_OFFSET_TO_PPS 353 #if O0098_SCALED_REF_LAYER_ID 354 const Window scalEL = pcSlice->getPPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 355 #else 356 const Window scalEL = pcSlice->getPPS()->getScaledRefLayerWindow(i); 357 #endif 358 #else 352 359 #if O0098_SCALED_REF_LAYER_ID 353 360 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); … … 355 362 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(i); 356 363 #endif 364 #endif 365 #if REF_REGION_OFFSET 366 const Window refEL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 367 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 368 && refEL.getWindowLeftOffset() == 0 && refEL.getWindowRightOffset() == 0 && refEL.getWindowTopOffset() == 0 && refEL.getWindowBottomOffset() == 0 ); 369 #else 357 370 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 371 #endif 358 372 359 373 #if VPS_EXTN_DIRECT_REF_LAYERS … … 763 777 764 778 #if P0312_VERT_PHASE_ADJ 779 #if MOVE_SCALED_OFFSET_TO_PPS 780 if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 ) 781 { 782 for(Int i = 0; i < activePPS->getNumScaledRefLayerOffsets(); i++) 783 { 784 UInt scaledRefLayerId = activePPS->getScaledRefLayerId(i); 785 if( activePPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) ) 786 { 787 printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId ); 788 break; 789 } 790 } 791 } 792 #else 765 793 if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 ) 766 794 { … … 775 803 } 776 804 } 805 #endif 777 806 #endif 778 807 … … 1726 1755 #endif 1727 1756 1757 #if MOVE_SCALED_OFFSET_TO_PPS 1758 #if O0098_SCALED_REF_LAYER_ID 1759 const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 1760 #else 1761 const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc); 1762 #endif 1763 #else 1728 1764 #if O0098_SCALED_REF_LAYER_ID 1729 1765 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); … … 1731 1767 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 1732 1768 #endif 1733 1769 #endif 1770 1771 #if REF_REGION_OFFSET 1772 const Window &windowRL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 1773 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth() - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset(); 1774 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset(); 1775 #else 1734 1776 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 1735 1777 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); … … 1740 1782 heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc ); 1741 1783 #endif 1784 #endif 1742 1785 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1743 1786 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); … … 1786 1829 #else 1787 1830 #if Q0048_CGS_3D_ASYMLUT 1788 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1789 #else 1790 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1831 #if MOVE_SCALED_OFFSET_TO_PPS 1832 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1833 #else 1834 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1835 #endif 1836 #else 1837 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1791 1838 #endif 1792 1839 #endif … … 1794 1841 #if O0194_JOINT_US_BITSHIFT 1795 1842 #if Q0048_CGS_3D_ASYMLUT 1796 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1797 #else 1798 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1843 #if REF_REGION_OFFSET 1844 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, altRL ); 1845 #else 1846 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1847 #endif 1848 #else 1849 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1799 1850 #endif 1800 1851 #else
Note: See TracChangeset for help on using the changeset viewer.