Changeset 713 in SHVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 21 Apr 2014, 04:44:16 (11 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev (added) merged: 651-712
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source (added) merged: 652-678,680,683-684,686-691,693-700,702-705,707-711
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibDecoder/AnnexBread.h
r595 r713 65 65 , m_Input(istream) 66 66 { 67 istream.exceptions(std::istream::eofbit );67 istream.exceptions(std::istream::eofbit | std::istream::badbit); 68 68 } 69 69 -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r644 r713 93 93 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n"); 94 94 break; 95 #if Q0074_SEI_COLOR_MAPPING 96 case SEI::COLOR_MAPPING_INFO: 97 fprintf( g_hTrace, "===========Color Mapping Info SEI message ===========\n"); 98 break; 99 #endif 95 100 case SEI::SOP_DESCRIPTION: 96 101 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); … … 280 285 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 281 286 break; 287 #if Q0074_SEI_COLOR_MAPPING 288 case SEI::COLOR_MAPPING_INFO: 289 sei = new SEIColorMappingInfo; 290 xParseSEIColorMappingInfo((SEIColorMappingInfo&) *sei, payloadSize); 291 break; 292 #endif 282 293 case SEI::SOP_DESCRIPTION: 283 294 sei = new SEISOPDescription; … … 518 529 { 519 530 UInt val; 520 READ_CODE(4, val, "active_v ps_id");sei.activeVPSId = val;521 READ_FLAG( val, "full_random_access_flag"); sei.m_fullRandomAccessFlag = val ? true : false;522 READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;531 READ_CODE(4, val, "active_video_parameter_set_id"); sei.activeVPSId = val; 532 READ_FLAG( val, "self_contained_cvs_flag"); sei.m_selfContainedCvsFlag = val ? true : false; 533 READ_FLAG( val, "no_parameter_set_update_flag"); sei.m_noParameterSetUpdateFlag = val ? true : false; 523 534 READ_UVLC( val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val; 524 535 525 sei.activeSeqParam SetId.resize(sei.numSpsIdsMinus1 + 1);536 sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1); 526 537 for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++) 527 538 { 528 READ_UVLC(val, "active_seq_param_set_id"); sei.activeSeqParamSetId[i] = val; 529 } 530 531 UInt uibits = m_pcBitstream->getNumBitsUntilByteAligned(); 532 533 while(uibits--) 534 { 535 READ_FLAG(val, "alignment_bit"); 536 } 539 READ_UVLC(val, "active_seq_parameter_set_id"); sei.activeSeqParameterSetId[i] = val; 540 } 541 542 xParseByteAlign(); 537 543 } 538 544 … … 812 818 case 4: 813 819 { 814 READ_CODE( 8, val, "camera_iso_speed_idc" ); sei.m_cameraIsoSpeed Value= val;815 if( sei.m_cameraIsoSpeed Value== 255) //Extended_ISO820 READ_CODE( 8, val, "camera_iso_speed_idc" ); sei.m_cameraIsoSpeedIdc = val; 821 if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO 816 822 { 817 823 READ_CODE( 32, val, "camera_iso_speed_value" ); sei.m_cameraIsoSpeedValue = val; 824 } 825 READ_CODE( 8, val, "exposure_index_idc" ); sei.m_exposureIndexIdc = val; 826 if( sei.m_exposureIndexIdc == 255) //Extended_ISO 827 { 828 READ_CODE( 32, val, "exposure_index_value" ); sei.m_exposureIndexValue = val; 818 829 } 819 830 READ_FLAG( val, "exposure_compensation_value_sign_flag" ); sei.m_exposureCompensationValueSignFlag = val; … … 837 848 xParseByteAlign(); 838 849 } 850 851 #if Q0074_SEI_COLOR_MAPPING 852 Void SEIReader::xParseSEIColorMappingInfo(SEIColorMappingInfo& sei, UInt /*payloadSize*/) 853 { 854 UInt uiVal; 855 Int iVal; 856 857 READ_UVLC( uiVal, "colour_map_id" ); sei.m_colorMapId = uiVal; 858 READ_FLAG( uiVal, "colour_map_cancel_flag" ); sei.m_colorMapCancelFlag = uiVal; 859 if( !sei.m_colorMapCancelFlag ) 860 { 861 READ_FLAG( uiVal, "colour_map_persistence_flag" ); sei.m_colorMapPersistenceFlag = uiVal; 862 READ_FLAG( uiVal, "colour_map_video_signal_type_present_flag" ); sei.m_colorMap_video_signal_type_present_flag = uiVal; 863 if ( sei.m_colorMap_video_signal_type_present_flag ) { 864 READ_FLAG( uiVal, "colour_map_video_full_range_flag" ); sei.m_colorMap_video_full_range_flag = uiVal; 865 READ_CODE( 8, uiVal, "colour_map_primaries" ); sei.m_colorMap_primaries = uiVal; 866 READ_CODE( 8, uiVal, "colour_map_transfer_characteristics" ); sei.m_colorMap_transfer_characteristics = uiVal; 867 READ_CODE( 8, uiVal, "colour_map_matrix_coeffs" ); sei.m_colorMap_matrix_coeffs = uiVal; 868 } 869 } 870 871 READ_CODE( 5, uiVal, "colour_map_coded_data_bit_depth" ); sei.m_colour_map_coded_data_bit_depth = uiVal; 872 READ_CODE( 5, uiVal, "colour_map_target_bit_depth" ); sei.m_colour_map_target_bit_depth = uiVal; 873 READ_UVLC( uiVal, "colour_map_model_id" ); sei.m_colorMapModelId = uiVal; 874 875 assert( sei.m_colorMapModelId == 0 ); 876 877 for( Int i=0 ; i<3 ; i++ ) 878 { 879 READ_CODE( 8, uiVal, "num_input_pivots_minus1[i]" ); sei.m_num_input_pivots[i] = (uiVal==0) ? 2 : (uiVal + 1) ; 880 sei.m_coded_input_pivot_value[i] = new Int[ sei.m_num_input_pivots[i] ]; 881 sei.m_target_input_pivot_value[i] = new Int[ sei.m_num_input_pivots[i] ]; 882 if( uiVal > 0 ) 883 { 884 for ( Int j=0 ; j<sei.m_num_input_pivots[i] ; j++ ) 885 { 886 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "coded_input_pivot_value[i][j]" ); sei.m_coded_input_pivot_value[i][j] = uiVal; 887 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "target_input_pivot_value[i][j]" ); sei.m_target_input_pivot_value[i][j] = uiVal; 888 } 889 } 890 else 891 { 892 sei.m_coded_input_pivot_value[i][0] = 0; 893 sei.m_target_input_pivot_value[i][0] = 0; 894 sei.m_coded_input_pivot_value[i][1] = (1 << sei.m_colour_map_coded_data_bit_depth) - 1 ; 895 sei.m_target_input_pivot_value[i][1] = (1 << sei.m_colour_map_target_bit_depth) - 1 ; 896 } 897 } 898 899 READ_FLAG( uiVal, "matrix_flag" ); sei.m_matrix_flag = uiVal; 900 if( sei.m_matrix_flag ) 901 { 902 READ_CODE( 4, uiVal, "log2_matrix_denom" ); sei.m_log2_matrix_denom = uiVal; 903 for ( Int i=0 ; i<3 ; i++ ) 904 { 905 for ( Int j=0 ; j<3 ; j++ ) 906 { 907 READ_SVLC( iVal, "matrix_coef[i][j]" ); sei.m_matrix_coef[i][j] = iVal; 908 } 909 } 910 } 911 912 for ( Int i=0 ; i<3 ; i++ ) 913 { 914 READ_CODE( 8, uiVal, "num_output_pivots_minus1[i]" ); sei.m_num_output_pivots[i] = (uiVal==0) ? 2 : (uiVal + 1) ; 915 sei.m_coded_output_pivot_value[i] = new Int[ sei.m_num_output_pivots[i] ]; 916 sei.m_target_output_pivot_value[i] = new Int[ sei.m_num_output_pivots[i] ]; 917 if( uiVal > 0 ) 918 { 919 for ( Int j=0 ; j<sei.m_num_output_pivots[i] ; j++ ) 920 { 921 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "coded_output_pivot_value[i][j]" ); sei.m_coded_output_pivot_value[i][j] = uiVal; 922 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "target_output_pivot_value[i][j]" ); sei.m_target_output_pivot_value[i][j] = uiVal; 923 } 924 } 925 else 926 { 927 sei.m_coded_output_pivot_value[i][0] = 0; 928 sei.m_target_output_pivot_value[i][0] = 0; 929 sei.m_coded_output_pivot_value[i][1] = (1 << sei.m_colour_map_coded_data_bit_depth) - 1 ; 930 sei.m_target_output_pivot_value[i][1] = (1 << sei.m_colour_map_target_bit_depth) - 1 ; 931 } 932 } 933 934 xParseByteAlign(); 935 } 936 #endif 839 937 840 938 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize) -
trunk/source/Lib/TLibDecoder/SEIread.h
r644 r713 90 90 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 91 91 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 92 #if Q0074_SEI_COLOR_MAPPING 93 Void xParseSEIColorMappingInfo (SEIColorMappingInfo& sei, UInt payloadSize); 94 #endif 92 95 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 93 96 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r649 r713 39 39 #include "SEIread.h" 40 40 #include "TDecSlice.h" 41 #if Q0048_CGS_3D_ASYMLUT 42 #include "../TLibCommon/TCom3DAsymLUT.h" 43 #endif 41 44 42 45 //! \ingroup TLibDecoder … … 175 178 } 176 179 177 Void TDecCavlc::parsePPS(TComPPS* pcPPS) 180 Void TDecCavlc::parsePPS(TComPPS* pcPPS 181 #if Q0048_CGS_3D_ASYMLUT 182 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 183 #endif 184 ) 178 185 { 179 186 #if ENC_DEC_TRACE … … 348 355 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); 349 356 pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false); 357 #if Q0048_CGS_3D_ASYMLUT 358 READ_FLAG( uiCode , "colour_mapping_enabled_flag" ); 359 pcPPS->setCGSFlag( uiCode ); 360 if( pcPPS->getCGSFlag() ) 361 { 362 xParse3DAsymLUT( pc3DAsymLUT ); 363 pcPPS->setCGSOutputBitDepthY( pc3DAsymLUT->getOutputBitDepthY() ); 364 pcPPS->setCGSOutputBitDepthC( pc3DAsymLUT->getOutputBitDepthC() ); 365 } 366 #endif 350 367 #endif 351 368 } … … 599 616 else 600 617 { 618 #if REP_FORMAT_FIX 619 pcSPS->setUpdateRepFormatFlag( false ); 620 #else 601 621 pcSPS->setUpdateRepFormatFlag( true ); 622 #endif 602 623 } 603 624 #if O0096_REP_FORMAT_INDEX … … 681 702 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 682 703 { 683 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1 ");704 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]"); 684 705 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 685 READ_UVLC ( uiCode, "sps_num_reorder_pics " );706 READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" ); 686 707 pcSPS->setNumReorderPics(uiCode, i); 687 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1 ");708 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]"); 688 709 pcSPS->setMaxLatencyIncrease( uiCode, i ); 689 710 … … 887 908 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 888 909 #endif 889 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode <= 6);910 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode+1 <= MAX_TLAYER); 890 911 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 891 912 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); … … 973 994 } 974 995 } 975 READ_FLAG( uiCode, "vps_extension_flag" ); 976 if (uiCode) 977 { 996 978 997 #if VPS_EXTNS 998 READ_FLAG( uiCode, "vps_extension_flag" ); pcVPS->setVpsExtensionFlag( uiCode ? true : false ); 999 1000 // When MaxLayersMinus1 is greater than 0, vps_extension_flag shall be equal to 1. 1001 if( pcVPS->getMaxLayers() > 1 ) 1002 { 1003 assert( pcVPS->getVpsExtensionFlag() == true ); 1004 } 1005 1006 if( pcVPS->getVpsExtensionFlag() ) 1007 { 979 1008 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 980 1009 { … … 990 1019 } 991 1020 } 992 #else 1021 } 1022 else 1023 { 1024 // set default parameters when syntax elements are not present 1025 defaultVPSExtension(pcVPS); 1026 } 1027 #else 1028 READ_FLAG( uiCode, "vps_extension_flag" ); 1029 if (uiCode) 1030 { 993 1031 while ( xMoreRbspData() ) 994 1032 { 995 1033 READ_FLAG( uiCode, "vps_extension_data_flag"); 996 1034 } 997 #endif 998 } 1035 } 1036 #endif 999 1037 1000 1038 return; … … 1129 1167 #endif 1130 1168 #if VPS_TSLAYERS 1131 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); 1132 if (vps->getMaxTSLayersPresentFlag()) 1133 { 1134 for(i = 0; i < vps->getMaxLayers(); i++) 1135 { 1136 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1[i]" ); vps->setMaxTSLayersMinus1(i, uiCode); 1137 } 1138 } 1139 else 1140 { 1141 for( i = 0; i < vps->getMaxLayers(); i++) 1142 { 1143 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1144 } 1145 } 1169 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); 1170 1171 if (vps->getMaxTSLayersPresentFlag()) 1172 { 1173 for(i = 0; i < vps->getMaxLayers(); i++) 1174 { 1175 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1[i]" ); vps->setMaxTSLayersMinus1(i, uiCode); 1176 } 1177 } 1178 else 1179 { 1180 for( i = 0; i < vps->getMaxLayers(); i++) 1181 { 1182 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1183 } 1184 } 1146 1185 #endif 1147 1186 #if N0120_MAX_TID_REF_PRESENT_FLAG … … 1250 1289 } 1251 1290 #else 1291 1292 #if Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1293 if( vps->getNumLayerSets() > 1 ) 1294 { 1295 READ_UVLC( uiCode, "num_add_output_layer_sets" ); vps->setNumAddOutputLayerSets( uiCode ); 1296 READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode ); 1297 } 1298 else 1299 { 1300 vps->setNumAddOutputLayerSets( 0 ); 1301 } 1302 #else 1252 1303 READ_UVLC( uiCode, "num_add_output_layer_sets" ); vps->setNumAddOutputLayerSets( uiCode ); 1304 #endif 1305 1306 // The value of num_add_output_layer_sets shall be in the range of 0 to 1023, inclusive. 1307 assert( vps->getNumAddOutputLayerSets() >= 0 && vps->getNumAddOutputLayerSets() < 1024 ); 1308 1253 1309 Int numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets(); 1254 1310 #endif 1255 1311 1256 1312 #if P0295_DEFAULT_OUT_LAYER_IDC 1313 #if !Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1257 1314 if( numOutputLayerSets > 1 ) 1258 1315 { 1259 1316 READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode ); 1260 1317 } 1318 #endif 1261 1319 vps->setNumOutputLayerSets( numOutputLayerSets ); 1262 1320 … … 1330 1388 vps->setAltOuputLayerFlag(i, uiCode ? true : false); 1331 1389 } 1390 #if Q0165_OUTPUT_LAYER_SET 1391 assert( NumOutputLayersInOutputLayerSet[i]>0 ); 1392 #endif 1393 1332 1394 #endif 1333 1395 } … … 1431 1493 1432 1494 #if REPN_FORMAT_IN_VPS 1495 #if Q0195_REP_FORMAT_CLEANUP 1496 READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); 1497 vps->setVpsNumRepFormats( uiCode + 1 ); 1498 1499 // The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive. 1500 assert( vps->getVpsNumRepFormats() > 0 && vps->getVpsNumRepFormats() <= 256 ); 1501 1502 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1503 { 1504 // Read rep_format_structures 1505 parseRepFormat( vps->getVpsRepFormat(i), i > 0 ? vps->getVpsRepFormat(i-1) : 0 ); 1506 } 1507 1508 // Default assignment for layer 0 1509 vps->setVpsRepFormatIdx( 0, 0 ); 1510 1511 if( vps->getVpsNumRepFormats() > 1 ) 1512 { 1513 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1514 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); 1515 } 1516 else 1517 { 1518 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 1519 vps->setRepFormatIdxPresentFlag( false ); 1520 } 1521 1522 if( vps->getRepFormatIdxPresentFlag() ) 1523 { 1524 for(i = 1; i < vps->getMaxLayers(); i++) 1525 { 1526 Int numBits = 1; 1527 while ((1 << numBits) < (vps->getVpsNumRepFormats())) 1528 { 1529 numBits++; 1530 } 1531 READ_CODE( numBits, uiCode, "vps_rep_format_idx[i]" ); 1532 vps->setVpsRepFormatIdx( i, uiCode ); 1533 } 1534 } 1535 else 1536 { 1537 // When not present, the value of vps_rep_format_idx[ i ] is inferred to be equal to Min (i, vps_num_rep_formats_minus1) 1538 for(i = 1; i < vps->getMaxLayers(); i++) 1539 { 1540 vps->setVpsRepFormatIdx( i, min( (Int)i, vps->getVpsNumRepFormats()-1 ) ); 1541 } 1542 } 1543 #else 1433 1544 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1434 1545 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); … … 1453 1564 vps->setVpsNumRepFormats( vps->getMaxLayers() ); 1454 1565 } 1566 1567 // The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive. 1568 assert( vps->getVpsNumRepFormats() > 0 && vps->getVpsNumRepFormats() <= 256 ); 1569 1455 1570 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1456 1571 { 1457 1572 // Read rep_format_structures 1458 parseRepFormat( vps->getVpsRepFormat(i) );1573 parseRepFormat( vps->getVpsRepFormat(i), i > 0 ? vps->getVpsRepFormat(i-1) : 0 ); 1459 1574 } 1460 1575 … … 1498 1613 } 1499 1614 } 1615 #endif 1500 1616 #endif 1501 1617 #if RESOLUTION_BASED_DPB … … 1578 1694 #if P0307_VPS_NON_VUI_EXTENSION 1579 1695 READ_UVLC( uiCode, "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode); 1696 1697 // The value of vps_non_vui_extension_length shall be in the range of 0 to 4096, inclusive. 1698 assert( vps->getVpsNonVuiExtLength() >= 0 && vps->getVpsNonVuiExtLength() <= 4096 ); 1699 1580 1700 #if P0307_VPS_NON_VUI_EXT_UPDATE 1581 1701 Int nonVuiExtByte = uiCode; … … 1620 1740 #endif 1621 1741 } 1622 } 1623 #endif 1742 else 1743 { 1744 // set default values for VPS VUI 1745 defaultVPSVUI( vps ); 1746 } 1747 } 1748 1749 Void TDecCavlc::defaultVPSExtension( TComVPS* vps ) 1750 { 1751 // set default parameters when they are not present 1752 Int i, j; 1753 1754 // When layer_id_in_nuh[ i ] is not present, the value is inferred to be equal to i. 1755 for(i = 0; i < vps->getMaxLayers(); i++) 1756 { 1757 vps->setLayerIdInNuh(i, i); 1758 vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i); 1759 } 1760 1761 // When not present, sub_layers_vps_max_minus1[ i ] is inferred to be equal to vps_max_sub_layers_minus1. 1762 for( i = 0; i < vps->getMaxLayers(); i++) 1763 { 1764 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1765 } 1766 1767 // When not present, max_tid_il_ref_pics_plus1[ i ][ j ] is inferred to be equal to 7. 1768 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1769 { 1770 #if O0225_MAX_TID_FOR_REF_LAYERS 1771 for( j = i + 1; j < vps->getMaxLayers(); j++ ) 1772 { 1773 vps->setMaxTidIlRefPicsPlus1(i, j, 7); 1774 } 1775 #else 1776 vps->setMaxTidIlRefPicsPlus1(i, 7); 1777 #endif 1778 } 1779 1780 // When not present, the value of num_add_output_layer_sets is inferred to be equal to 0. 1781 // NumOutputLayerSets = num_add_output_layer_sets + vps_num_layer_sets_minus1 + 1 1782 vps->setNumOutputLayerSets( vps->getNumLayerSets() ); 1783 1784 // For i in the range of 0 to NumOutputLayerSets-1, inclusive, the variable LayerSetIdxForOutputLayerSet[ i ] is derived as specified in the following: 1785 // LayerSetIdxForOutputLayerSet[ i ] = ( i <= vps_number_layer_sets_minus1 ) ? i : output_layer_set_idx_minus1[ i ] + 1 1786 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1787 { 1788 vps->setOutputLayerSetIdx( i, i ); 1789 Int lsIdx = vps->getOutputLayerSetIdx(i); 1790 1791 for( j = 0; j < vps->getNumLayersInIdList(lsIdx); j++ ) 1792 { 1793 vps->setOutputLayerFlag(i, j, 1); 1794 } 1795 } 1796 1797 // The value of sub_layer_dpb_info_present_flag[ i ][ 0 ] for any possible value of i is inferred to be equal to 1 1798 // When not present, the value of sub_layer_dpb_info_present_flag[ i ][ j ] for j greater than 0 and any possible value of i, is inferred to be equal to be equal to 0. 1799 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1800 { 1801 vps->setSubLayerDpbInfoPresentFlag( i, 0, true ); 1802 } 1803 1804 // When not present, the value of vps_num_rep_formats_minus1 is inferred to be equal to MaxLayersMinus1. 1805 vps->setVpsNumRepFormats( vps->getMaxLayers() ); 1806 1807 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 1808 vps->setRepFormatIdxPresentFlag( false ); 1809 1810 if( !vps->getRepFormatIdxPresentFlag() ) 1811 { 1812 // When not present, the value of vps_rep_format_idx[ i ] is inferred to be equal to Min(i, vps_num_rep_formats_minus1). 1813 for(i = 1; i < vps->getMaxLayers(); i++) 1814 { 1815 vps->setVpsRepFormatIdx( i, min( (Int)i, vps->getVpsNumRepFormats() - 1 ) ); 1816 } 1817 } 1818 1819 // vps_poc_lsb_aligned_flag 1820 // When not present, vps_poc_lsb_aligned_flag is inferred to be equal to 0. 1821 1822 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1823 // When not present, poc_lsb_not_present_flag[ i ] is inferred to be equal to 0. 1824 for(i = 1; i< vps->getMaxLayers(); i++) 1825 { 1826 vps->setPocLsbNotPresentFlag(i, 0); 1827 } 1828 #endif 1829 1830 // set default values for VPS VUI 1831 defaultVPSVUI( vps ); 1832 } 1833 1834 Void TDecCavlc::defaultVPSVUI( TComVPS* vps ) 1835 { 1836 #if N0147_IRAP_ALIGN_FLAG 1837 // When not present, the value of all_layers_idr_aligned_flag is inferred to be equal to 0. 1838 vps->setCrossLayerIrapAlignFlag( false ); 1839 #endif 1840 1841 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1842 // When single_layer_for_non_irap_flag is not present, it is inferred to be equal to 0. 1843 vps->setSingleLayerForNonIrapFlag( false ); 1844 #endif 1845 1846 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1847 // When higher_layer_irap_skip_flag is not present it is inferred to be equal to 0 1848 vps->setHigherLayerIrapSkipFlag( false ); 1849 #endif 1850 } 1851 #endif 1852 1624 1853 #if REPN_FORMAT_IN_VPS 1625 Void TDecCavlc::parseRepFormat ( RepFormat *repFormat)1854 Void TDecCavlc::parseRepFormat( RepFormat *repFormat, RepFormat *repFormatPrev ) 1626 1855 { 1627 1856 UInt uiCode; 1628 #if REPN_FORMAT_CONTROL_FLAG 1629 READ_FLAG ( uiCode, "chroma_and_bit_depth_vps_present_flag"); repFormat->setChromaAndBitDepthVpsPresentFlag(uiCode ? true : false); 1630 READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1631 READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1857 #if REPN_FORMAT_CONTROL_FLAG 1858 READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1859 READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1860 READ_FLAG( uiCode, "chroma_and_bit_depth_vps_present_flag" ); repFormat->setChromaAndBitDepthVpsPresentFlag( uiCode ? true : false ); 1861 1862 if( !repFormatPrev ) 1863 { 1864 // The value of chroma_and_bit_depth_vps_present_flag of the first rep_format( ) syntax structure in the VPS shall be equal to 1 1865 assert( repFormat->getChromaAndBitDepthVpsPresentFlag() ); 1866 } 1632 1867 1633 1868 if( repFormat->getChromaAndBitDepthVpsPresentFlag() ) 1634 1869 { 1870 READ_CODE( 2, uiCode, "chroma_format_vps_idc" ); 1635 1871 #if AUXILIARY_PICTURES 1636 READ_CODE( 2, uiCode, "chroma_format_idc" );repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) );1637 #else 1638 READ_CODE( 2, uiCode, "chroma_format_idc" );repFormat->setChromaFormatVpsIdc( uiCode );1872 repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) ); 1873 #else 1874 repFormat->setChromaFormatVpsIdc( uiCode ); 1639 1875 #endif 1640 1876 1641 1877 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1642 1878 { 1643 READ_FLAG( uiCode, "separate_colour_plane_flag"); repFormat->setSeparateColourPlaneVpsFlag(uiCode ? true : false); 1644 } 1645 1646 1647 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1648 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1879 READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); repFormat->setSeparateColourPlaneVpsFlag( uiCode ? true : false ); 1880 } 1881 1882 READ_CODE( 4, uiCode, "bit_depth_vps_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1883 READ_CODE( 4, uiCode, "bit_depth_vps_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1884 } 1885 else if( repFormatPrev ) 1886 { 1887 // chroma_and_bit_depth_vps_present_flag equal to 0 specifies that the syntax elements, chroma_format_vps_idc, separate_colour_plane_vps_flag, bit_depth_vps_luma_minus8, and 1888 // bit_depth_vps_chroma_minus8 are not present and inferred from the previous rep_format( ) syntax structure in the VPS. 1889 1890 repFormat->setChromaFormatVpsIdc ( repFormatPrev->getChromaFormatVpsIdc() ); 1891 repFormat->setSeparateColourPlaneVpsFlag( repFormatPrev->getSeparateColourPlaneVpsFlag() ); 1892 repFormat->setBitDepthVpsLuma ( repFormatPrev->getBitDepthVpsLuma() ); 1893 repFormat->setBitDepthVpsChroma ( repFormatPrev->getBitDepthVpsChroma() ); 1649 1894 } 1650 1895 #else … … 1700 1945 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1701 1946 #if DPB_PARAMS_MAXTLAYERS 1702 1947 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1703 1948 #else 1704 1949 for(Int j = 0; j <= vps->getMaxTLayers(); j++) … … 1820 2065 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 1821 2066 { 1822 READ_FLAG( uiCode, "bit_rate_present_ vps_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false );2067 READ_FLAG( uiCode, "bit_rate_present_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 1823 2068 } 1824 2069 else … … 1828 2073 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 1829 2074 { 1830 READ_FLAG( uiCode, "pic_rate_present_ vps_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false );2075 READ_FLAG( uiCode, "pic_rate_present_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 1831 2076 } 1832 2077 else … … 1868 2113 vps->setNumVideoSignalInfo(vps->getMaxLayers()); 1869 2114 } 1870 1871 2115 1872 2116 for(i = 0; i < vps->getNumVideoSignalInfo(); i++) … … 1954 2198 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1955 2199 READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false); 2200 2201 // When single_layer_for_non_irap_flag is equal to 0, higher_layer_irap_skip_flag shall be equal to 0 2202 if( !vps->getSingleLayerForNonIrapFlag() ) 2203 { 2204 assert( !vps->getHigherLayerIrapSkipFlag() ); 2205 } 1956 2206 #endif 1957 2207 #endif … … 2102 2352 if( rpcSlice->getRapPicFlag()) 2103 2353 { 2104 #if !NO_OUTPUT_OF_PRIOR_PICS 2105 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored 2106 #else 2107 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); rpcSlice->setNoOutputOfPriorPicsFlag( uiCode ? true : false ); 2354 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored -- updated already 2355 #if SETTING_NO_OUT_PIC_PRIOR 2356 rpcSlice->setNoOutputPriorPicsFlag(uiCode ? true : false); 2357 #else 2358 rpcSlice->setNoOutputPicPrior( false ); 2108 2359 #endif 2109 2360 } … … 2305 2556 else 2306 2557 { 2307 uiCode = 0; 2558 uiCode = 0; 2308 2559 } 2309 2560 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); … … 2453 2704 for( Int i = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2454 2705 { 2706 #if Q0060_MAX_TID_REF_EQUAL_TO_ZERO 2707 if((rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() || rpcSlice->getTLayer()==0) && 2708 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2709 #else 2455 2710 if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() && 2456 2711 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2712 #endif 2457 2713 { 2458 2714 rpcSlice->setActiveNumILRRefIdx(1); … … 2487 2743 { 2488 2744 #if O0225_TID_BASED_IL_RPS_DERIV && TSLAYERS_IL_RPS 2745 #if Q0060_MAX_TID_REF_EQUAL_TO_ZERO 2746 if((rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(0,rpcSlice->getLayerId()) > rpcSlice->getTLayer() || rpcSlice->getTLayer()==0) && 2747 (rpcSlice->getVPS()->getMaxTSLayersMinus1(0) >= rpcSlice->getTLayer()) ) 2748 #else 2489 2749 if( (rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(0,rpcSlice->getLayerId()) > rpcSlice->getTLayer()) && 2490 2750 (rpcSlice->getVPS()->getMaxTSLayersMinus1(0) >= rpcSlice->getTLayer()) ) 2751 #endif 2491 2752 { 2492 2753 #endif … … 2514 2775 for(i = 0, numRefLayerPics = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2515 2776 { 2777 #if Q0060_MAX_TID_REF_EQUAL_TO_ZERO 2778 if((rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() || rpcSlice->getTLayer()==0) && 2779 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2780 #else 2516 2781 if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() && 2517 2782 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2783 #endif 2518 2784 { 2519 2785 refLayerPicIdc[ numRefLayerPics++ ] = i; … … 2560 2826 { 2561 2827 format = rpcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc(); 2828 #if Q0195_REP_FORMAT_CLEANUP 2829 assert( (sps->getUpdateRepFormatFlag()==false && rpcSlice->getVPS()->getVpsNumRepFormats()==1) || rpcSlice->getVPS()->getVpsNumRepFormats() > 1 ); //conformance check 2830 #endif 2562 2831 } 2563 2832 #else … … 3468 3737 } 3469 3738 3739 #if Q0048_CGS_3D_ASYMLUT 3740 Void TDecCavlc::xParse3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ) 3741 { 3742 UInt uiCurOctantDepth , uiCurPartNumLog2 , uiInputBitDepthM8 , uiOutputBitDepthM8 , uiResQaunBit; 3743 READ_CODE( 2 , uiCurOctantDepth , "cm_octant_depth" ); 3744 READ_CODE( 2 , uiCurPartNumLog2 , "cm_y_part_num_log2" ); 3745 READ_CODE( 3 , uiInputBitDepthM8 , "cm_input_bit_depth_minus8" ); 3746 Int iInputBitDepthCDelta; 3747 READ_SVLC(iInputBitDepthCDelta, "cm_input_bit_depth_chroma delta"); 3748 READ_CODE( 3 , uiOutputBitDepthM8 , "cm_output_bit_depth_minus8" ); 3749 Int iOutputBitDepthCDelta; 3750 READ_SVLC(iOutputBitDepthCDelta, "cm_output_bit_depth_chroma_delta"); 3751 READ_CODE( 2 , uiResQaunBit , "cm_res_quant_bit" ); 3752 pc3DAsymLUT->destroy(); 3753 pc3DAsymLUT->create( uiCurOctantDepth , uiInputBitDepthM8 + 8 , uiInputBitDepthM8 + 8 + iInputBitDepthCDelta, uiOutputBitDepthM8 + 8 , uiOutputBitDepthM8 + 8 + iOutputBitDepthCDelta ,uiCurPartNumLog2 ); 3754 pc3DAsymLUT->setResQuantBit( uiResQaunBit ); 3755 3756 xParse3DAsymLUTOctant( pc3DAsymLUT , 0 , 0 , 0 , 0 , 1 << pc3DAsymLUT->getCurOctantDepth() ); 3757 } 3758 3759 Void TDecCavlc::xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ) 3760 { 3761 UInt uiOctantSplit = nDepth < pc3DAsymLUT->getCurOctantDepth(); 3762 if( nDepth < pc3DAsymLUT->getCurOctantDepth() ) 3763 READ_FLAG( uiOctantSplit , "split_octant_flag" ); 3764 Int nYPartNum = 1 << pc3DAsymLUT->getCurYPartNumLog2(); 3765 if( uiOctantSplit ) 3766 { 3767 Int nHalfLength = nLength >> 1; 3768 for( Int l = 0 ; l < 2 ; l++ ) 3769 { 3770 for( Int m = 0 ; m < 2 ; m++ ) 3771 { 3772 for( Int n = 0 ; n < 2 ; n++ ) 3773 { 3774 xParse3DAsymLUTOctant( pc3DAsymLUT , nDepth + 1 , yIdx + l * nHalfLength * nYPartNum , uIdx + m * nHalfLength , vIdx + n * nHalfLength , nHalfLength ); 3775 } 3776 } 3777 } 3778 } 3779 else 3780 { 3781 for( Int l = 0 ; l < nYPartNum ; l++ ) 3782 { 3783 for( Int nVertexIdx = 0 ; nVertexIdx < 4 ; nVertexIdx++ ) 3784 { 3785 UInt uiCodeVertex = 0; 3786 Int deltaY = 0 , deltaU = 0 , deltaV = 0; 3787 READ_FLAG( uiCodeVertex , "coded_vertex_flag" ); 3788 if( uiCodeVertex ) 3789 { 3790 READ_SVLC( deltaY , "resY" ); 3791 READ_SVLC( deltaU , "resU" ); 3792 READ_SVLC( deltaV , "resV" ); 3793 } 3794 pc3DAsymLUT->setCuboidVertexResTree( yIdx + l , uIdx , vIdx , nVertexIdx , deltaY , deltaU , deltaV ); 3795 } 3796 } 3797 } 3798 } 3799 #endif 3470 3800 //! \} 3471 3801 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r644 r713 46 46 #include "SyntaxElementParser.h" 47 47 48 #if Q0048_CGS_3D_ASYMLUT 49 class TCom3DAsymLUT; 50 #endif 48 51 //! \ingroup TLibDecoder 49 52 //! \{ … … 75 78 #if VPS_EXTNS 76 79 Void parseVPSExtension ( TComVPS* pcVPS ); 80 Void defaultVPSExtension ( TComVPS* pcVPS ); 77 81 #endif 78 82 79 83 #if VPS_VUI 80 84 Void parseVPSVUI ( TComVPS* pcVPS ); 85 Void defaultVPSVUI ( TComVPS* pcVPS ); 81 86 #endif 82 87 #if REPN_FORMAT_IN_VPS 83 Void parseRepFormat ( RepFormat *repFormat );88 Void parseRepFormat ( RepFormat *repFormat, RepFormat *repFormatPrev ); 84 89 #endif 85 90 #if VPS_DPB_SIZE_TABLE … … 95 100 Void parseSPS ( TComSPS* pcSPS ); 96 101 #endif //SVC_EXTENSION 97 Void parsePPS ( TComPPS* pcPPS); 102 Void parsePPS ( TComPPS* pcPPS 103 #if Q0048_CGS_3D_ASYMLUT 104 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 105 #endif 106 ); 98 107 Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); 99 108 Void parseSEI ( SEIMessages& ); … … 135 144 protected: 136 145 Bool xMoreRbspData(); 146 147 #if Q0048_CGS_3D_ASYMLUT 148 Void xParse3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ); 149 Void xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ); 150 #endif 137 151 }; 138 152 -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r595 r713 73 73 m_ppcCU [ui]->setLayerId(layerId); 74 74 } 75 76 #if LAYER_CTB 77 memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) ); 78 memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) ); 79 memcpy(g_auiLayerRasterToPelX[m_layerId], g_auiRasterToPelX, sizeof( g_auiRasterToPelX ) ); 80 memcpy(g_auiLayerRasterToPelY[m_layerId], g_auiRasterToPelY, sizeof( g_auiRasterToPelY ) ); 81 #endif 75 82 } 76 83 #else … … 715 722 { 716 723 UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 ); 717 UInt uiNumPart = pcCU->getNumPart Inter();724 UInt uiNumPart = pcCU->getNumPartitions(); 718 725 UInt uiNumQParts = pcCU->getTotalNumPart() >> 2; 719 726 -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r644 r713 49 49 class TDecCavlc; 50 50 class ParameterSetManagerDecoder; 51 #if Q0048_CGS_3D_ASYMLUT 52 class TCom3DAsymLUT; 53 #endif 51 54 52 55 //! \ingroup TLibDecoder … … 71 74 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; 72 75 #endif 73 virtual Void parsePPS ( TComPPS* pcPPS ) = 0; 76 virtual Void parsePPS ( TComPPS* pcPPS 77 #if Q0048_CGS_3D_ASYMLUT 78 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 79 #endif 80 ) = 0; 74 81 75 82 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) = 0; … … 138 145 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 139 146 #endif 140 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 147 148 #if Q0048_CGS_3D_ASYMLUT 149 Void decodePPS ( TComPPS* pcPPS, TCom3DAsymLUT * pc3DAsymLUT, Int nLayerID ) { m_pcEntropyDecoderIf->parsePPS(pcPPS, pc3DAsymLUT , nLayerID ); } 150 #else 151 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS ); } 152 #endif 141 153 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager); } 142 154 -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r595 r713 248 248 } 249 249 250 #if SETTING_PIC_OUTPUT_MARK 251 rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false); 252 #else 250 253 rpcPic->setOutputMark(true); 254 #endif 251 255 rpcPic->setReconMark(true); 252 256 } -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r644 r713 81 81 Void parseSPS ( TComSPS* /*pcSPS*/ ) {} 82 82 #endif 83 Void parsePPS ( TComPPS* /*pcPPS*/ ) {} 83 Void parsePPS ( TComPPS* /*pcPPS*/ 84 #if Q0048_CGS_3D_ASYMLUT 85 , TCom3DAsymLUT * /*pc3DAsymLUT*/ , Int /*nLayerID*/ 86 #endif 87 ) {} 84 88 85 89 Void parseSliceHeader ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {} -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r644 r713 79 79 m_prevSliceSkipped = false; 80 80 m_skippedPOC = 0; 81 #if SETTING_NO_OUT_PIC_PRIOR 82 m_bFirstSliceInBitstream = true; 83 m_lastPOCNoOutputPriorPics = -1; 84 m_craNoRaslOutputFlag = false; 85 m_isNoOutputPriorPics = false; 86 #endif 81 87 #if NO_CLRAS_OUTPUT_FLAG 82 88 m_noClrasOutputFlag = false; 83 89 m_layerInitializedFlag = false; 84 m_firstPicInLayerDecodedFlag = false; 85 m_noOutputOfPriorPicsFlags = false; 86 m_bRefreshPending = false; 90 m_firstPicInLayerDecodedFlag = false; 87 91 #endif 88 92 #if RESOLUTION_BASED_DPB 89 93 m_subDpbIdx = -1; 90 94 #endif 95 #if Q0048_CGS_3D_ASYMLUT 96 m_pColorMappedPic = NULL; 97 #endif 98 99 #if Q0074_SEI_COLOR_MAPPING 100 m_ColorMapping = new TDecColorMapping(); 101 #endif 91 102 } 92 103 … … 95 106 #if ENC_DEC_TRACE 96 107 fclose( g_hTrace ); 108 #endif 109 #if Q0048_CGS_3D_ASYMLUT 110 if(m_pColorMappedPic) 111 { 112 m_pColorMappedPic->destroy(); 113 delete m_pColorMappedPic; 114 m_pColorMappedPic = NULL; 115 } 116 #endif 117 #if Q0074_SEI_COLOR_MAPPING 118 if ( m_ColorMapping ) delete m_ColorMapping; 97 119 #endif 98 120 } … … 353 375 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 354 376 355 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths ) 377 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths 378 #if Q0048_CGS_3D_ASYMLUT 379 || pcSlice->getPPS()->getCGSFlag() > 0 380 #endif 381 #if LAYER_CTB 382 || pcTDecTopBase->getActiveSPS()->getMaxCUWidth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUWidth() || pcTDecTopBase->getActiveSPS()->getMaxCUHeight() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUHeight() || pcTDecTopBase->getActiveSPS()->getMaxCUDepth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUDepth() 383 #endif 384 ) 356 385 #else 357 386 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) … … 503 532 504 533 // Execute Deblock + Cleanup 505 506 534 m_cGopDecoder.filterPicture(pcPic); 507 535 … … 517 545 return; 518 546 } 547 548 #if SETTING_NO_OUT_PIC_PRIOR 549 Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic) 550 { 551 if (!rpcListPic || !m_isNoOutputPriorPics) return; 552 553 TComList<TComPic*>::iterator iterPic = rpcListPic->begin(); 554 555 while (iterPic != rpcListPic->end()) 556 { 557 TComPic*& pcPicTmp = *(iterPic++); 558 if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC()) 559 { 560 pcPicTmp->setOutputMark(false); 561 } 562 } 563 } 564 #endif 519 565 520 566 #if EARLY_REF_PIC_MARKING … … 733 779 #endif 734 780 781 #if AVC_BASE 782 if( activeVPS->getAvcBaseLayerFlag() ) 783 { 784 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 785 if( m_layerId == 1 && pBLPic->getPicYuvRec() == NULL ) 786 { 787 UInt refLayerId = 0; 788 RepFormat* repFormat = activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(refLayerId) ); 789 790 Int numReorderPics[MAX_TLAYER]; 791 Window conformanceWindow; 792 Window defaultDisplayWindow; 793 794 #if AUXILIARY_PICTURES 795 #if SVC_UPSAMPLING 796 #if AVC_SYNTAX 797 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); 798 #else 799 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 800 #endif 801 #else 802 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, true); 803 #endif 804 #else 805 #if SVC_UPSAMPLING 806 #if AVC_SYNTAX 807 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); 808 #else 809 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 810 #endif 811 #else 812 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 813 #endif 814 #endif 815 // it is needed where the VPS is accessed through the slice 816 pBLPic->getSlice(0)->setVPS( activeVPS ); 817 818 #if O0194_DIFFERENT_BITDEPTH_EL_BL 819 g_bitDepthYLayer[0] = repFormat->getBitDepthVpsLuma(); 820 g_bitDepthCLayer[0] = repFormat->getBitDepthVpsChroma(); 821 #endif 822 } 823 } 824 #endif 825 735 826 #if P0312_VERT_PHASE_ADJ 736 827 if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 ) … … 808 899 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() ); 809 900 901 #if Q0074_SEI_COLOR_MAPPING 902 for(Int compID=0; compID<3; compID++) 903 { 904 m_ColorMapping->setColorMapping( compID ? g_bitDepthC : g_bitDepthY, compID ); 905 } 906 #endif 907 810 908 for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++) 811 909 { … … 843 941 TComPic*& pcPic = m_pcPic; 844 942 #if SVC_EXTENSION 845 #if !NO_OUTPUT_OF_PRIOR_PICS846 #if NO_CLRAS_OUTPUT_FLAG847 Bool bFirstSliceInSeq;848 #endif849 #endif850 943 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) ); 851 944 #if OUTPUT_LAYER_SET_INDEX … … 900 993 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 901 994 902 #if NO_OUTPUT_OF_PRIOR_PICS 903 // Infer the value of NoOutputOfPriorPicsFlag 904 if( m_apcSlicePilot->getRapPicFlag() ) 905 { 906 if ( m_apcSlicePilot->getBlaPicFlag() || m_apcSlicePilot->getIdrPicFlag() || 907 (m_apcSlicePilot->getCraPicFlag() && m_bFirstSliceInSequence) || 908 (m_apcSlicePilot->getCraPicFlag() && m_apcSlicePilot->getHandleCraAsBlaFlag())) 909 { 910 m_apcSlicePilot->setNoRaslOutputFlag( true ); 995 #if SETTING_NO_OUT_PIC_PRIOR 996 //For inference of NoOutputOfPriorPicsFlag 997 if (m_apcSlicePilot->getRapPicFlag()) 998 { 999 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 1000 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) || 1001 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag())) 1002 { 1003 m_apcSlicePilot->setNoRaslOutputFlag(true); 1004 } 1005 //the inference for NoOutputPriorPicsFlag 1006 if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag()) 1007 { 1008 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 1009 { 1010 m_apcSlicePilot->setNoOutputPriorPicsFlag(true); 1011 } 911 1012 } 912 1013 else 913 1014 { 914 m_apcSlicePilot->setNoRaslOutputFlag( false ); 915 } 1015 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 1016 } 1017 1018 if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 1019 { 1020 m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag(); 1021 } 1022 } 1023 if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag()) 1024 { 1025 m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC(); 1026 m_isNoOutputPriorPics = true; 1027 } 1028 else 1029 { 1030 m_isNoOutputPriorPics = false; 1031 } 1032 1033 //For inference of PicOutputFlag 1034 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R) 1035 { 1036 if ( m_craNoRaslOutputFlag ) 1037 { 1038 m_apcSlicePilot->setPicOutputFlag(false); 1039 } 1040 } 1041 #endif 1042 1043 #if FIX_POC_CRA_NORASL_OUTPUT 1044 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 1045 { 1046 Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1047 m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) ); 916 1048 } 917 1049 #endif … … 967 1099 } 968 1100 969 m_apcSlicePilot->decodingRefreshMarking( m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag());1101 m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag ); 970 1102 #endif 971 1103 … … 975 1107 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getNoRaslOutputFlag() ) 976 1108 { 977 this->setNoOutput OfPriorPicsFlags( true );1109 this->setNoOutputPriorPicsFlag( true ); 978 1110 } 979 1111 else if( m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag() ) 980 1112 { 981 this->setNoOutput OfPriorPicsFlags( m_apcSlicePilot->getNoOutputOfPriorPicsFlag() );1113 this->setNoOutputPriorPicsFlag( m_apcSlicePilot->getNoOutputPriorPicsFlag() ); 982 1114 } 983 1115 else … … 985 1117 if( this->m_ppcTDecTop[0]->getNoClrasOutputFlag() ) 986 1118 { 987 this->setNoOutput OfPriorPicsFlags( true );1119 this->setNoOutputPriorPicsFlag( true ); 988 1120 } 989 1121 } … … 1006 1138 #else 1007 1139 //we should only get a different poc for a new picture (with CTU address==0) 1008 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && ( !m_apcSlicePilot->getSliceCurStartCUAddr()==0))1140 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 1009 1141 { 1010 1142 printf ("Warning, the first slice of a picture might have been lost!\n"); … … 1050 1182 #endif 1051 1183 } 1052 #if !NO_OUTPUT_OF_PRIOR_PICS1053 #if NO_CLRAS_OUTPUT_FLAG1054 bFirstSliceInSeq = m_bFirstSliceInSequence;1055 #endif1056 #endif1057 1184 m_bFirstSliceInSequence = false; 1185 #if SETTING_NO_OUT_PIC_PRIOR 1186 m_bFirstSliceInBitstream = false; 1187 #endif 1058 1188 #if POC_RESET_FLAG 1059 1189 // This operation would do the following: … … 1216 1346 #endif 1217 1347 1218 #if !NO_OUTPUT_OF_PRIOR_PICS 1219 #if NO_CLRAS_OUTPUT_FLAG 1220 if (m_layerId == 0 && 1221 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1222 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1223 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 1224 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1225 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1226 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)) 1227 { 1228 if (bFirstSliceInSeq) 1229 { 1230 setNoClrasOutputFlag(true); 1231 } 1232 else if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1233 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1234 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP) 1235 { 1236 setNoClrasOutputFlag(true); 1237 } 1238 #if O0149_CROSS_LAYER_BLA_FLAG 1239 else if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP) && 1240 m_apcSlicePilot->getCrossLayerBLAFlag()) 1241 { 1242 setNoClrasOutputFlag(true); 1243 } 1244 #endif 1245 else 1246 { 1247 setNoClrasOutputFlag(false); 1248 } 1249 if (getNoClrasOutputFlag()) 1250 { 1251 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++) 1252 { 1253 m_ppcTDecTop[i]->setLayerInitializedFlag(false); 1254 m_ppcTDecTop[i]->setFirstPicInLayerDecodedFlag(false); 1255 } 1256 } 1257 } 1258 #endif 1259 1260 #if NO_CLRAS_OUTPUT_FLAG 1261 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 1262 #endif 1263 #else 1348 #if NO_OUTPUT_OF_PRIOR_PICS 1264 1349 if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() ) 1265 1350 { … … 1273 1358 // Buffer initialize for prediction. 1274 1359 m_cPrediction.initTempBuff(); 1275 #if !ALIGNED_BUMPING 1360 #if ALIGNED_BUMPING 1361 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 1362 #else 1276 1363 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1277 #else1278 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic);1279 1364 #endif 1280 1365 // Get a new picture buffer … … 1515 1600 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 1516 1601 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 1517 1602 #if Q0200_CONFORMANCE_BL_SIZE 1603 Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 1604 const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow(); 1605 widthBL -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc ); 1606 heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc ); 1607 #endif 1518 1608 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1519 1609 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); … … 1525 1615 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 1526 1616 1617 #if Q0048_CGS_3D_ASYMLUT 1618 TComPicYuv* pBaseColRec = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 1619 if( pcSlice->getPPS()->getCGSFlag() ) 1620 { 1621 if(!m_pColorMappedPic) 1622 { 1623 initAsymLut(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)); 1624 } 1625 m_c3DAsymLUTPPS.colorMapping( pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pColorMappedPic ); 1626 pBaseColRec = m_pColorMappedPic; 1627 } 1628 #endif 1527 1629 #if SVC_UPSAMPLING 1528 1630 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1529 1631 { 1530 /*#if O0098_SCALED_REF_LAYER_ID1531 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));1532 #else1533 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);1534 #endif*/1535 1632 #if O0215_PHASE_ALIGNMENT 1536 1633 #if O0194_JOINT_US_BITSHIFT 1537 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1634 #if Q0048_CGS_3D_ASYMLUT 1635 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1636 #else 1637 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1638 #endif 1639 #else 1640 #if Q0048_CGS_3D_ASYMLUT 1641 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1538 1642 #else 1539 1643 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1540 1644 #endif 1645 #endif 1541 1646 #else 1542 1647 #if O0194_JOINT_US_BITSHIFT 1648 #if Q0048_CGS_3D_ASYMLUT 1649 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1650 #else 1543 1651 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1652 #endif 1653 #else 1654 #if Q0048_CGS_3D_ASYMLUT 1655 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1544 1656 #else 1545 1657 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1658 #endif 1546 1659 #endif 1547 1660 #endif … … 1755 1868 } 1756 1869 1757 Void TDecTop::xDecodePPS() 1870 Void TDecTop::xDecodePPS( 1871 #if Q0048_CGS_3D_ASYMLUT 1872 TCom3DAsymLUT * pc3DAsymLUT 1873 #endif 1874 ) 1758 1875 { 1759 1876 TComPPS* pps = new TComPPS(); … … 1763 1880 #endif 1764 1881 1765 m_cEntropyDecoder.decodePPS( pps ); 1882 m_cEntropyDecoder.decodePPS( pps 1883 #if Q0048_CGS_3D_ASYMLUT 1884 , pc3DAsymLUT , m_layerId 1885 #endif 1886 ); 1766 1887 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 1767 1888 … … 1809 1930 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1810 1931 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1811 assert(seiAps->activeSeqParam SetId.size()>0);1812 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParam SetId[0] ) )1932 assert(seiAps->activeSeqParameterSetId.size()>0); 1933 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) ) 1813 1934 { 1814 1935 printf ("Warning SPS activation with Active parameter set SEI failed"); 1815 1936 } 1816 1937 } 1938 #if Q0074_SEI_COLOR_MAPPING 1939 m_ColorMapping->setColorMapping( m_SEIs ); 1940 #endif 1817 1941 } 1818 1942 #else … … 1837 1961 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1838 1962 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1839 assert(seiAps->activeSeqParam SetId.size()>0);1840 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParam SetId[0] ))1963 assert(seiAps->activeSeqParameterSetId.size()>0); 1964 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] )) 1841 1965 { 1842 1966 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1897 2021 case NAL_UNIT_SPS: 1898 2022 xDecodeSPS(); 1899 #if AVC_BASE1900 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1901 {1902 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());1903 if( nalu.m_layerId == 1 && pBLPic->getPicYuvRec() == NULL )1904 {1905 // using EL SPS with spsId = 11906 TComSPS* sps = m_parameterSetManagerDecoder.getPrefetchedSPS(1);1907 Int numReorderPics[MAX_TLAYER];1908 Window &conformanceWindow = sps->getConformanceWindow();1909 Window defaultDisplayWindow = sps->getVuiParametersPresentFlag() ? sps->getVuiParameters()->getDefaultDisplayWindow() : Window();1910 #if AUXILIARY_PICTURES1911 #if SVC_UPSAMPLING1912 #if AVC_SYNTAX1913 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);1914 #else1915 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);1916 #endif1917 #else1918 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);1919 #endif1920 #else1921 #if SVC_UPSAMPLING1922 #if AVC_SYNTAX1923 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);1924 #else1925 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);1926 #endif1927 #else1928 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);1929 #endif1930 #endif1931 1932 #if O0194_DIFFERENT_BITDEPTH_EL_BL1933 // set AVC BL bit depth, can be an input parameter from the command line1934 g_bitDepthYLayer[0] = 8;1935 g_bitDepthCLayer[0] = 8;1936 #endif1937 }1938 }1939 #endif1940 2023 return false; 1941 2024 1942 2025 case NAL_UNIT_PPS: 1943 xDecodePPS(); 2026 xDecodePPS( 2027 #if Q0048_CGS_3D_ASYMLUT 2028 &m_c3DAsymLUTPPS 2029 #endif 2030 ); 1944 2031 return false; 1945 2032 … … 1997 2084 return false; 1998 2085 2086 case NAL_UNIT_FILLER_DATA: 2087 return false; 1999 2088 2000 2089 case NAL_UNIT_RESERVED_VCL_N10: … … 2017 2106 case NAL_UNIT_RESERVED_VCL31: 2018 2107 2019 case NAL_UNIT_FILLER_DATA:2020 2108 case NAL_UNIT_RESERVED_NVCL41: 2021 2109 case NAL_UNIT_RESERVED_NVCL42: … … 2304 2392 } 2305 2393 #endif 2394 2395 #if Q0048_CGS_3D_ASYMLUT 2396 Void TDecTop::initAsymLut(TComSlice *pcSlice) 2397 { 2398 if(m_layerId>0) 2399 { 2400 if(!m_pColorMappedPic) 2401 { 2402 Int picWidth = pcSlice->getPicWidthInLumaSamples(); 2403 Int picHeight = pcSlice->getPicHeightInLumaSamples(); 2404 m_pColorMappedPic = new TComPicYuv; 2405 m_pColorMappedPic->create( picWidth, picHeight, pcSlice->getChromaFormatIdc()/*CHROMA_420*/, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL ); 2406 } 2407 } 2408 } 2409 #endif 2410 2306 2411 #endif //SVC_EXTENSION 2412 2413 #if Q0074_SEI_COLOR_MAPPING 2414 TDecColorMapping::TDecColorMapping() 2415 { 2416 m_pcColorMappingPic[0] = NULL; 2417 m_pcColorMappingPic[1] = NULL; 2418 2419 m_colorMapCancelFlag = true; 2420 2421 for( Int i=0 ; i<3 ; i++ ) 2422 { 2423 m_lut1d_computed[i] = false; 2424 m_lut1d_input[i] = NULL; 2425 m_coded_input_pivot_value[i] = NULL; 2426 m_target_input_pivot_value[i] = NULL; 2427 } 2428 for( Int i=0 ; i<3 ; i++ ) 2429 { 2430 m_lut1d_output[i] = NULL; 2431 m_coded_output_pivot_value[i] = NULL; 2432 m_target_output_pivot_value[i] = NULL; 2433 } 2434 } 2435 2436 TDecColorMapping::~TDecColorMapping() 2437 { 2438 if ( m_pcColorMappingPic[0] ) delete m_pcColorMappingPic[0]; 2439 if ( m_pcColorMappingPic[1] ) delete m_pcColorMappingPic[1]; 2440 2441 for( Int i=0 ; i<3 ; i++ ) 2442 { 2443 if ( m_lut1d_input[i] ) delete m_lut1d_input[i]; 2444 if ( m_coded_input_pivot_value[i] ) delete m_coded_input_pivot_value[i]; 2445 if ( m_target_input_pivot_value[i] ) delete m_target_input_pivot_value[i]; 2446 } 2447 for( Int i=0 ; i<3 ; i++ ) 2448 { 2449 if ( m_lut1d_output[i] ) delete m_lut1d_output[i]; 2450 if ( m_coded_output_pivot_value[i] ) delete m_coded_output_pivot_value[i]; 2451 if ( m_target_output_pivot_value[i] ) delete m_target_output_pivot_value[i]; 2452 } 2453 } 2454 2455 Void TDecColorMapping::setColorMapping( SEIMessages m_SEIs ) 2456 { 2457 SEIMessages colorMappingInfo = getSeisByType(m_SEIs, SEI::COLOR_MAPPING_INFO) ; 2458 SEIColorMappingInfo *seiColorMappingInfo = NULL; 2459 if (colorMappingInfo.size() !=0) 2460 { 2461 seiColorMappingInfo = (SEIColorMappingInfo*)(*colorMappingInfo.begin()); 2462 2463 m_colorMapId = seiColorMappingInfo->m_colorMapId; 2464 m_colorMapCancelFlag = seiColorMappingInfo->m_colorMapCancelFlag; 2465 if( !m_colorMapCancelFlag ) 2466 { 2467 m_colorMapPersistenceFlag = seiColorMappingInfo->m_colorMapPersistenceFlag; 2468 m_colorMap_video_signal_type_present_flag = seiColorMappingInfo->m_colorMap_video_signal_type_present_flag; 2469 m_colorMap_video_full_range_flag = seiColorMappingInfo->m_colorMap_video_full_range_flag; 2470 m_colorMap_primaries = seiColorMappingInfo->m_colorMap_primaries; 2471 m_colorMap_transfer_characteristics = seiColorMappingInfo->m_colorMap_transfer_characteristics; 2472 m_colorMap_matrix_coeffs = seiColorMappingInfo->m_colorMap_matrix_coeffs; 2473 m_colorMapModelId = seiColorMappingInfo->m_colorMapModelId; 2474 2475 m_colour_map_coded_data_bit_depth = seiColorMappingInfo->m_colour_map_coded_data_bit_depth; 2476 m_colour_map_target_bit_depth = seiColorMappingInfo->m_colour_map_target_bit_depth; 2477 2478 for( Int i=0 ; i<3 ; i++ ) 2479 { 2480 m_num_input_pivots[i] = seiColorMappingInfo->m_num_input_pivots[i]; 2481 if ( m_coded_input_pivot_value[i] ) delete m_coded_input_pivot_value[i]; 2482 if ( m_target_input_pivot_value[i] ) delete m_target_input_pivot_value[i]; 2483 m_coded_input_pivot_value[i] = new Int[ m_num_input_pivots[i] ]; 2484 m_target_input_pivot_value[i] = new Int[ m_num_input_pivots[i] ]; 2485 for( Int j=0 ; j<m_num_input_pivots[i] ; j++ ) 2486 { 2487 m_coded_input_pivot_value[i][j] = seiColorMappingInfo->m_coded_input_pivot_value[i][j]; 2488 m_target_input_pivot_value[i][j] = seiColorMappingInfo->m_target_input_pivot_value[i][j]; 2489 } 2490 } 2491 2492 m_matrix_flag = seiColorMappingInfo->m_matrix_flag; 2493 m_log2_matrix_denom = m_matrix_flag ? (seiColorMappingInfo->m_log2_matrix_denom) : (0) ; 2494 for( Int i=0 ; i<3 ; i++ ) 2495 { 2496 for( Int j=0 ; j<3 ; j++ ) 2497 { 2498 m_matrix_coef[i][j] = seiColorMappingInfo->m_matrix_coef[i][j]; 2499 } 2500 } 2501 2502 for( Int i=0 ; i<3 ; i++ ) 2503 { 2504 m_num_output_pivots[i] = seiColorMappingInfo->m_num_output_pivots[i]; 2505 if ( m_coded_output_pivot_value[i] ) delete m_coded_output_pivot_value[i]; 2506 if ( m_target_output_pivot_value[i] ) delete m_target_output_pivot_value[i]; 2507 m_coded_output_pivot_value[i] = new Int[ m_num_output_pivots[i] ]; 2508 m_target_output_pivot_value[i] = new Int[ m_num_output_pivots[i] ]; 2509 for( Int j=0 ; j<m_num_output_pivots[i] ; j++ ) 2510 { 2511 m_coded_output_pivot_value[i][j] = seiColorMappingInfo->m_coded_output_pivot_value[i][j]; 2512 m_target_output_pivot_value[i][j] = seiColorMappingInfo->m_target_output_pivot_value[i][j]; 2513 } 2514 } 2515 2516 memset( m_lut1d_computed, 0, sizeof( m_lut1d_computed ) ); 2517 } 2518 } 2519 2520 } 2521 2522 Void TDecColorMapping::setColorMapping( Int bitDepth, Int iComp ) 2523 { 2524 if( !m_colorMapCancelFlag && !m_lut1d_computed[iComp] ) 2525 { 2526 2527 if ( m_lut1d_input[iComp] ) delete m_lut1d_input[iComp]; 2528 if ( m_lut1d_output[iComp] ) delete m_lut1d_output[iComp]; 2529 2530 m_lut1d_input[iComp] = new Int[ 1 << bitDepth ]; 2531 m_lut1d_output[iComp] = new Int[ 1 << bitDepth ]; 2532 2533 Int iShift = (m_colour_map_coded_data_bit_depth >= bitDepth) ? (m_colour_map_coded_data_bit_depth - bitDepth) : (0); 2534 Int iShiftPivot = (m_colour_map_coded_data_bit_depth >= bitDepth) ? (0) : (bitDepth - m_colour_map_coded_data_bit_depth); 2535 2536 for( Int k=0 ; k<(1<<bitDepth) ; k++ ) 2537 { 2538 Int iSample = k << iShift ; 2539 if( m_num_input_pivots[iComp] > 1 ) 2540 { 2541 for( Int iPivot=0 ; iPivot<m_num_input_pivots[iComp] ; iPivot++ ) 2542 { 2543 Int iCodedPrev = m_coded_input_pivot_value[iComp][iPivot] << iShiftPivot; 2544 Int iCodedNext = m_coded_input_pivot_value[iComp][iPivot+1] << iShiftPivot; 2545 Int iTargetPrev = m_target_input_pivot_value[iComp][iPivot] << iShiftPivot; 2546 Int iTargetNext = m_target_input_pivot_value[iComp][iPivot+1] << iShiftPivot; 2547 if ( iCodedPrev <= iSample && iSample < iCodedNext ) 2548 { 2549 Float fInterpol = (Float)( (iCodedNext - iSample)*iTargetPrev + (iSample - iCodedPrev)*iTargetNext ) / (Float)(iCodedNext - iCodedPrev) ; 2550 m_lut1d_input[iComp][k] = (Int)( 0.5 + fInterpol ); 2551 iPivot = m_num_input_pivots[iComp]; // stop 2552 } 2553 } 2554 } 2555 else 2556 { 2557 m_lut1d_input[iComp][k] = k; 2558 } 2559 } 2560 2561 iShift = ( (m_colour_map_coded_data_bit_depth >= bitDepth) ? (m_colour_map_coded_data_bit_depth - bitDepth) : (0) ); 2562 Int iOffset = iShift ? (1 << (iShift - 1)) : (0) ; 2563 iShiftPivot = (m_colour_map_target_bit_depth >= bitDepth) ? (0) : (bitDepth - m_colour_map_target_bit_depth) ; 2564 for( Int k=0 ; k<(1<<bitDepth) ; k++ ) 2565 { 2566 Int iSample = k << iShift; 2567 if ( m_num_output_pivots[iComp]>1 ) 2568 { 2569 for( Int iPivot=0 ; iPivot<m_num_output_pivots[iComp] ; iPivot++ ) 2570 { 2571 Int iCodedPrev = m_coded_output_pivot_value[iComp][iPivot] << iShiftPivot; 2572 Int iCodedNext = m_coded_output_pivot_value[iComp][iPivot+1] << iShiftPivot; 2573 Int iTargetPrev = m_target_output_pivot_value[iComp][iPivot] << iShiftPivot; 2574 Int iTargetNext = m_target_output_pivot_value[iComp][iPivot+1] << iShiftPivot; 2575 if ( iCodedPrev <= iSample && iSample < iCodedNext ) 2576 { 2577 Float fInterpol = (Float)( (iCodedNext - iSample)*iTargetPrev + (iSample - iCodedPrev)*iTargetNext ) / (Float)(iCodedNext - iCodedPrev) ; 2578 m_lut1d_output[iComp][k] = ( (Int)(0.5 + fInterpol) + iOffset ) >> iShift ; 2579 iPivot = m_num_output_pivots[iComp]; // stop 2580 } 2581 } 2582 } 2583 else 2584 { 2585 m_lut1d_output[iComp][k] = k; 2586 } 2587 } 2588 2589 m_lut1d_computed[iComp] = true; 2590 } 2591 2592 } 2593 2594 TComPicYuv* TDecColorMapping::getColorMapping( TComPicYuv* pPicYuvRec, Int iTop, Int curlayerId ) 2595 { 2596 if( !m_colorMapCancelFlag ) 2597 { 2598 if( !m_pcColorMappingPic[iTop] ) 2599 { 2600 m_pcColorMappingPic[iTop] = new TComPicYuv; 2601 #if SVC_EXTENSION 2602 m_pcColorMappingPic[iTop]->create( pPicYuvRec->getWidth(), pPicYuvRec->getHeight(), pPicYuvRec->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2603 #else 2604 m_pcColorMappingPic[iTop]->create( pPicYuvRec->getWidth(), pPicYuvRec->getHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2605 #endif 2606 } 2607 2608 Int iHeight = pPicYuvRec->getHeight(); 2609 Int iWidth = pPicYuvRec->getWidth(); 2610 Int iStride = pPicYuvRec->getStride(); 2611 Int iCStride = pPicYuvRec->getCStride(); 2612 2613 Pel* Lum0 = pPicYuvRec->getLumaAddr(); 2614 Pel* Cb0 = pPicYuvRec->getCbAddr(); 2615 Pel* Cr0 = pPicYuvRec->getCrAddr(); 2616 Pel* Lum1 = m_pcColorMappingPic[iTop]->getLumaAddr(); 2617 Pel* Cb1 = m_pcColorMappingPic[iTop]->getCbAddr(); 2618 Pel* Cr1 = m_pcColorMappingPic[iTop]->getCrAddr(); 2619 2620 #if SVC_EXTENSION 2621 Int bitDepthY = g_bitDepthYLayer[curlayerId]; 2622 Int bitDepthC = g_bitDepthCLayer[curlayerId]; 2623 2624 assert( g_bitDepthY == bitDepthY ); 2625 assert( g_bitDepthC == bitDepthC ); 2626 #else 2627 Int bitDepthY = g_bitDepthY; 2628 Int bitDepthC = g_bitDepthC; 2629 #endif 2630 2631 Int iYShift = (m_colour_map_target_bit_depth >= bitDepthY) ? (m_colour_map_target_bit_depth - bitDepthY) : (0) ; 2632 Int iCShift = (m_colour_map_target_bit_depth >= bitDepthC) ? (m_colour_map_target_bit_depth - bitDepthC) : (0) ; 2633 Int offsetY = (1 << (m_log2_matrix_denom+iYShift - 1)); 2634 Int offsetC = (1 << (m_log2_matrix_denom+iCShift - 1)); 2635 2636 Int cShift = 1 ; 2637 2638 //Pel* LumPrev0 = Lum0; 2639 for( Int y = 0; y < iHeight ; y++ ) 2640 { 2641 Bool bDoChroma = (y % 2); 2642 for( Int x = 0; x < iWidth ; x++ ) 2643 { 2644 Int s1Y = m_lut1d_input[0][ Lum0[x] ]; 2645 Int s1U = m_lut1d_input[1][ Cb0[x>>1] ]; 2646 Int s1V = m_lut1d_input[2][ Cr0[x>>1] ]; 2647 2648 Int s2Y, s2U, s2V; 2649 if( m_matrix_flag ) 2650 { 2651 s2Y = ( m_matrix_coef[0][0]*s1Y + m_matrix_coef[0][1]*s1U + m_matrix_coef[0][2]*s1V + offsetY ) >> ( m_log2_matrix_denom + iYShift ); 2652 //s2Y = ClipBD( s2Y , bitDepthY ); 2653 s2Y = ClipY( s2Y ); 2654 Lum1[x] = m_lut1d_output[0][ s2Y ]; 2655 } 2656 else 2657 { 2658 s1Y = ( s1Y + offsetY ) >> iYShift ; 2659 //s1Y = ClipBD( s1Y , bitDepthY ); 2660 s1Y = ClipY( s1Y ); 2661 Lum1[x] = m_lut1d_output[0][ s1Y ]; 2662 } 2663 2664 if( bDoChroma && (x%2) ) 2665 { 2666 if( m_matrix_flag ) 2667 { 2668 //s1Y = ( m_lut1d_input[0][ Lum0[x] ] + m_lut1d_input[0][ Lum0[x+1] ] + m_lut1d_input[0][ LumPrev0[x] ] + m_lut1d_input[0][ LumPrev0[x+1] ] + 2 ) >> 2 ; 2669 //s1Y = m_lut1d_input[0][ (Lum0[x] + Lum0[x+1] + LumPrev0[x] + LumPrev0[x+1] + 2)>>2 ] ; 2670 s1Y = m_lut1d_input[0][ Lum0[x] ]; 2671 2672 s2U = ( m_matrix_coef[1][0]*s1Y + m_matrix_coef[1][1]*s1U + m_matrix_coef[1][2]*s1V + offsetC ) >> ( m_log2_matrix_denom + iCShift ) ; 2673 s2V = ( m_matrix_coef[2][0]*s1Y + m_matrix_coef[2][1]*s1U + m_matrix_coef[2][2]*s1V + offsetC ) >> ( m_log2_matrix_denom + iCShift ) ; 2674 //s2U = ClipBD( s2U , bitDepthC ); 2675 //s2V = ClipBD( s2V , bitDepthC ); 2676 s2U = ClipC( s2U ); 2677 s2V = ClipC( s2V ); 2678 Cb1[x>>cShift] = m_lut1d_output[1][ s2U ]; 2679 Cr1[x>>cShift] = m_lut1d_output[2][ s2V ]; 2680 } 2681 else 2682 { 2683 s1U = ( s1U + offsetC ) >> iCShift ; 2684 s1V = ( s1V + offsetC ) >> iCShift ; 2685 //s1U = ClipBD( s1U , bitDepthC ); 2686 //s1V = ClipBD( s1V , bitDepthC ); 2687 s1U = ClipC( s1U ); 2688 s1V = ClipC( s1V ); 2689 Cb1[x>>cShift] = m_lut1d_output[1][ s1U ]; 2690 Cr1[x>>cShift] = m_lut1d_output[2][ s1V ]; 2691 } 2692 } 2693 2694 } 2695 2696 //LumPrev0 = Lum0; 2697 Lum0 += iStride; 2698 Lum1 += iStride; 2699 if( bDoChroma ) 2700 { 2701 Cb0 += iCStride; 2702 Cr0 += iCStride; 2703 Cb1 += iCStride; 2704 Cr1 += iCStride; 2705 } 2706 } 2707 2708 return m_pcColorMappingPic[iTop]; 2709 } 2710 2711 return pPicYuvRec; 2712 } 2713 #endif 2714 2307 2715 //! \} -
trunk/source/Lib/TLibDecoder/TDecTop.h
r644 r713 45 45 #include "TLibCommon/TComTrQuant.h" 46 46 #include "TLibCommon/SEI.h" 47 #if Q0048_CGS_3D_ASYMLUT 48 #include "TLibCommon/TCom3DAsymLUT.h" 49 #endif 47 50 48 51 #include "TDecGop.h" … … 61 64 // ==================================================================================================================== 62 65 66 #if Q0074_SEI_COLOR_MAPPING 67 class TDecColorMapping 68 { 69 Int m_colorMapId; 70 Bool m_colorMapCancelFlag; 71 Bool m_colorMapPersistenceFlag; 72 Bool m_colorMap_video_signal_type_present_flag; 73 Bool m_colorMap_video_full_range_flag; 74 Int m_colorMap_primaries; 75 Int m_colorMap_transfer_characteristics; 76 Int m_colorMap_matrix_coeffs; 77 Int m_colorMapModelId; 78 79 Int m_colour_map_coded_data_bit_depth; 80 Int m_colour_map_target_bit_depth; 81 82 Int m_num_input_pivots[3]; 83 Int* m_coded_input_pivot_value[3]; 84 Int* m_target_input_pivot_value[3]; 85 86 Bool m_matrix_flag; 87 Int m_log2_matrix_denom; 88 Int m_matrix_coef[3][3]; 89 90 Int m_num_output_pivots[3]; 91 Int* m_coded_output_pivot_value[3]; 92 Int* m_target_output_pivot_value[3]; 93 94 Bool m_lut1d_computed[3]; 95 Int* m_lut1d_input[3]; 96 Int* m_lut1d_output[3]; 97 TComPicYuv* m_pcColorMappingPic[2]; 98 99 public: 100 TDecColorMapping(); 101 ~TDecColorMapping(); 102 103 Bool getColorMappingFlag() { return(!m_colorMapCancelFlag);}; 104 105 Void setColorMapping( SEIMessages m_SEIs ); 106 Void setColorMapping( Int bitDepthY, Int bitDepthC ); 107 TComPicYuv* getColorMapping( TComPicYuv* pPicYuvRec, Int iTop=0, Int curlayerId=0 ); 108 };// END CLASS DEFINITION TDecColorMapping 109 #endif 110 63 111 /// decoder class 64 112 class TDecTop … … 79 127 // functional classes 80 128 TComPrediction m_cPrediction; 129 #if Q0048_CGS_3D_ASYMLUT 130 TCom3DAsymLUT m_c3DAsymLUTPPS; 131 TComPicYuv* m_pColorMappedPic; 132 #endif 81 133 TComTrQuant m_cTrQuant; 82 134 TDecGop m_cGopDecoder; … … 104 156 Bool m_prevSliceSkipped; 105 157 Int m_skippedPOC; 158 #if SETTING_NO_OUT_PIC_PRIOR 159 Bool m_bFirstSliceInBitstream; 160 Int m_lastPOCNoOutputPriorPics; 161 Bool m_isNoOutputPriorPics; 162 Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic 163 #endif 106 164 107 165 #if SVC_EXTENSION … … 114 172 #if AVC_BASE 115 173 fstream* m_pBLReconFile; 174 #if !REPN_FORMAT_IN_VPS 116 175 Int m_iBLSourceWidth; 117 Int m_iBLSourceHeight; 176 Int m_iBLSourceHeight; 177 #endif 118 178 #endif 119 179 #if VPS_EXTN_DIRECT_REF_LAYERS … … 136 196 #endif 137 197 138 #if NO_CLRAS_OUTPUT_FLAG 198 #if NO_CLRAS_OUTPUT_FLAG 139 199 Bool m_noClrasOutputFlag; 140 200 Bool m_layerInitializedFlag; 141 201 Bool m_firstPicInLayerDecodedFlag; 142 Bool m_noOutputOfPriorPicsFlags;143 144 Bool m_bRefreshPending;145 202 #endif 146 203 #if RESOLUTION_BASED_DPB 147 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to.148 // When new VPS is activated, this should be re-initialized to -1204 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to. 205 // When new VPS is activated, this should be re-initialized to -1 149 206 #endif 150 207 public: 208 #if Q0074_SEI_COLOR_MAPPING 209 TDecColorMapping* m_ColorMapping; 210 #endif 211 151 212 TDecTop(); 152 213 virtual ~TDecTop(); … … 166 227 Void deletePicBuffer(); 167 228 229 230 TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); } 231 232 168 233 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 234 #if SETTING_NO_OUT_PIC_PRIOR 235 Void checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic); 236 Bool getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; } 237 Void setNoOutputPriorPicsFlag (Bool val) { m_isNoOutputPriorPics = val; } 238 #endif 239 169 240 #if SVC_EXTENSION 170 241 #if EARLY_REF_PIC_MARKING … … 212 283 Void setBLReconFile( fstream* pFile ) { m_pBLReconFile = pFile; } 213 284 fstream* getBLReconFile() { return m_pBLReconFile; } 285 #if !REPN_FORMAT_IN_VPS 214 286 Void setBLsize( Int iWidth, Int iHeight ) { m_iBLSourceWidth = iWidth; m_iBLSourceHeight = iHeight; } 215 287 Int getBLWidth() { return m_iBLSourceWidth; } 216 288 Int getBLHeight() { return m_iBLSourceHeight; } 289 #endif 217 290 #endif 218 291 #if REPN_FORMAT_IN_VPS … … 238 311 Void setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; } 239 312 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 240 #endif241 #if NO_OUTPUT_OF_PRIOR_PICS242 #if NO_CLRAS_OUTPUT_FLAG243 Bool getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;}244 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; }245 #endif246 313 #endif 247 314 protected: … … 261 328 Void xDecodeVPS(); 262 329 Void xDecodeSPS(); 263 Void xDecodePPS(); 330 Void xDecodePPS( 331 #if Q0048_CGS_3D_ASYMLUT 332 TCom3DAsymLUT * pc3DAsymLUT 333 #endif 334 ); 264 335 Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ); 265 336 … … 271 342 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 272 343 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 273 #if !NO_OUTPUT_OF_PRIOR_PICS 274 Int getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;} 275 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 276 #endif 344 #endif 345 #if Q0048_CGS_3D_ASYMLUT 346 Void initAsymLut(TComSlice *pcSlice); 277 347 #endif 278 348 };// END CLASS DEFINITION TDecTop
Note: See TracChangeset for help on using the changeset viewer.