Changeset 438 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/Lib/TLibDecoder/SEIread.cpp
- Timestamp:
- 23 May 2013, 15:40:36 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.2-dev/source/Lib/TLibDecoder/SEIread.cpp
r362 r438 90 90 fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n"); 91 91 break; 92 #if J0149_TONE_MAPPING_SEI93 case SEI::TONE_MAPPING_INFO:94 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n");95 break;96 #endif97 #if L0208_SOP_DESCRIPTION_SEI98 case SEI::SOP_DESCRIPTION:99 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n");100 break;101 #endif102 #if K0180_SCALABLE_NESTING_SEI103 case SEI::SCALABLE_NESTING:104 fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");105 break;106 #endif107 92 default: 108 93 fprintf( g_hTrace, "=========== Unknown SEI message ===========\n"); … … 169 154 SEI *sei = NULL; 170 155 171 if(nalUnitType == NAL_UNIT_ PREFIX_SEI)156 if(nalUnitType == NAL_UNIT_SEI) 172 157 { 173 158 switch (payloadType) … … 234 219 xParseSEIGradualDecodingRefreshInfo((SEIGradualDecodingRefreshInfo&) *sei, payloadSize); 235 220 break; 236 #if J0149_TONE_MAPPING_SEI237 case SEI::TONE_MAPPING_INFO:238 sei = new SEIToneMappingInfo;239 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize);240 break;241 #endif242 #if L0208_SOP_DESCRIPTION_SEI243 case SEI::SOP_DESCRIPTION:244 sei = new SEISOPDescription;245 xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize);246 break;247 #endif248 #if K0180_SCALABLE_NESTING_SEI249 case SEI::SCALABLE_NESTING:250 sei = new SEIScalableNesting;251 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps);252 break;253 #endif254 221 default: 255 222 for (UInt i = 0; i < payloadSize; i++) … … 317 284 { 318 285 UInt reservedPayloadExtensionData; 319 READ_ FLAG (reservedPayloadExtensionData, "reserved_payload_extension_data");286 READ_CODE (1, reservedPayloadExtensionData, "reserved_payload_extension_data"); 320 287 } 321 288 322 289 UInt dummy; 323 READ_FLAG (dummy, "payload_bit_equal_to_one"); payloadBitsRemaining--; 324 while (payloadBitsRemaining) 325 { 326 READ_FLAG (dummy, "payload_bit_equal_to_zero"); payloadBitsRemaining--; 327 } 290 READ_CODE (1, dummy, "payload_bit_equal_to_one"); 291 READ_CODE (payloadBitsRemaining-1, dummy, "payload_bit_equal_to_zero"); 328 292 } 329 293 … … 668 632 } 669 633 670 #if J0149_TONE_MAPPING_SEI671 Void SEIReader::xParseSEIToneMappingInfo(SEIToneMappingInfo& sei, UInt /*payloadSize*/)672 {673 Int i;674 UInt val;675 READ_UVLC( val, "tone_map_id" ); sei.m_toneMapId = val;676 READ_FLAG( val, "tone_map_cancel_flag" ); sei.m_toneMapCancelFlag = val;677 678 if ( !sei.m_toneMapCancelFlag )679 {680 READ_FLAG( val, "tone_map_persistence_flag" ); sei.m_toneMapPersistenceFlag = val;681 READ_CODE( 8, val, "coded_data_bit_depth" ); sei.m_codedDataBitDepth = val;682 READ_CODE( 8, val, "target_bit_depth" ); sei.m_targetBitDepth = val;683 READ_UVLC( val, "model_id" ); sei.m_modelId = val;684 switch(sei.m_modelId)685 {686 case 0:687 {688 READ_CODE( 32, val, "min_value" ); sei.m_minValue = val;689 READ_CODE( 32, val, "max_value" ); sei.m_maxValue = val;690 break;691 }692 case 1:693 {694 READ_CODE( 32, val, "sigmoid_midpoint" ); sei.m_sigmoidMidpoint = val;695 READ_CODE( 32, val, "sigmoid_width" ); sei.m_sigmoidWidth = val;696 break;697 }698 case 2:699 {700 UInt num = 1u << sei.m_targetBitDepth;701 sei.m_startOfCodedInterval.resize(num+1);702 for(i = 0; i < num; i++)703 {704 READ_CODE( ((( sei.m_codedDataBitDepth + 7 ) >> 3 ) << 3), val, "start_of_coded_interval" );705 sei.m_startOfCodedInterval[i] = val;706 }707 sei.m_startOfCodedInterval[num] = 1u << sei.m_codedDataBitDepth;708 break;709 }710 case 3:711 {712 READ_CODE( 16, val, "num_pivots" ); sei.m_numPivots = val;713 sei.m_codedPivotValue.resize(sei.m_numPivots);714 sei.m_targetPivotValue.resize(sei.m_numPivots);715 for(i = 0; i < sei.m_numPivots; i++ )716 {717 READ_CODE( ((( sei.m_codedDataBitDepth + 7 ) >> 3 ) << 3), val, "coded_pivot_value" );718 sei.m_codedPivotValue[i] = val;719 READ_CODE( ((( sei.m_targetBitDepth + 7 ) >> 3 ) << 3), val, "target_pivot_value" );720 sei.m_targetPivotValue[i] = val;721 }722 break;723 }724 case 4:725 {726 READ_CODE( 8, val, "camera_iso_speed_idc" ); sei.m_cameraIsoSpeedValue = val;727 if( sei.m_cameraIsoSpeedValue == 255) //Extended_ISO728 {729 READ_CODE( 32, val, "camera_iso_speed_value" ); sei.m_cameraIsoSpeedValue = val;730 }731 READ_FLAG( val, "exposure_compensation_value_sign_flag" ); sei.m_exposureCompensationValueSignFlag = val;732 READ_CODE( 16, val, "exposure_compensation_value_numerator" ); sei.m_exposureCompensationValueNumerator = val;733 READ_CODE( 16, val, "exposure_compensation_value_denom_idc" ); sei.m_exposureCompensationValueDenomIdc = val;734 READ_CODE( 32, val, "ref_screen_luminance_white" ); sei.m_refScreenLuminanceWhite = val;735 READ_CODE( 32, val, "extended_range_white_level" ); sei.m_extendedRangeWhiteLevel = val;736 READ_CODE( 16, val, "nominal_black_level_luma_code_value" ); sei.m_nominalBlackLevelLumaCodeValue = val;737 READ_CODE( 16, val, "nominal_white_level_luma_code_value" ); sei.m_nominalWhiteLevelLumaCodeValue= val;738 READ_CODE( 16, val, "extended_white_level_luma_code_value" ); sei.m_extendedWhiteLevelLumaCodeValue = val;739 break;740 }741 default:742 {743 assert(!"Undefined SEIToneMapModelId");744 break;745 }746 }//switch model id747 }// if(!sei.m_toneMapCancelFlag)748 749 xParseByteAlign();750 }751 #endif752 753 #if L0208_SOP_DESCRIPTION_SEI754 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize)755 {756 Int iCode;757 UInt uiCode;758 759 READ_UVLC( uiCode, "sop_seq_parameter_set_id" ); sei.m_sopSeqParameterSetId = uiCode;760 READ_UVLC( uiCode, "num_pics_in_sop_minus1" ); sei.m_numPicsInSopMinus1 = uiCode;761 for (UInt i = 0; i <= sei.m_numPicsInSopMinus1; i++)762 {763 READ_CODE( 6, uiCode, "sop_desc_vcl_nalu_type" ); sei.m_sopDescVclNaluType[i] = uiCode;764 READ_CODE( 3, sei.m_sopDescTemporalId[i], "sop_desc_temporal_id" ); sei.m_sopDescTemporalId[i] = uiCode;765 if (sei.m_sopDescVclNaluType[i] != NAL_UNIT_CODED_SLICE_IDR_W_RADL && sei.m_sopDescVclNaluType[i] != NAL_UNIT_CODED_SLICE_IDR_N_LP)766 {767 READ_UVLC( sei.m_sopDescStRpsIdx[i], "sop_desc_st_rps_idx" ); sei.m_sopDescStRpsIdx[i] = uiCode;768 }769 if (i > 0)770 {771 READ_SVLC( iCode, "sop_desc_poc_delta" ); sei.m_sopDescPocDelta[i] = iCode;772 }773 }774 775 xParseByteAlign();776 }777 #endif778 779 #if K0180_SCALABLE_NESTING_SEI780 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps)781 {782 UInt uiCode;783 SEIMessages seis;784 785 READ_FLAG( uiCode, "bitstream_subset_flag" ); sei.m_bitStreamSubsetFlag = uiCode;786 READ_FLAG( uiCode, "nesting_op_flag" ); sei.m_nestingOpFlag = uiCode;787 if (sei.m_nestingOpFlag)788 {789 READ_FLAG( uiCode, "default_op_flag" ); sei.m_defaultOpFlag = uiCode;790 READ_UVLC( uiCode, "nesting_num_ops_minus1" ); sei.m_nestingNumOpsMinus1 = uiCode;791 for (UInt i = sei.m_defaultOpFlag; i <= sei.m_nestingNumOpsMinus1; i++)792 {793 READ_CODE( 3, uiCode, "nesting_max_temporal_id_plus1" ); sei.m_nestingMaxTemporalIdPlus1[i] = uiCode;794 READ_UVLC( uiCode, "nesting_op_idx" ); sei.m_nestingOpIdx[i] = uiCode;795 }796 }797 else798 {799 READ_FLAG( uiCode, "all_layers_flag" ); sei.m_allLayersFlag = uiCode;800 if (!sei.m_allLayersFlag)801 {802 READ_CODE( 3, uiCode, "nesting_no_op_max_temporal_id_plus1" ); sei.m_nestingNoOpMaxTemporalIdPlus1 = uiCode;803 READ_UVLC( uiCode, "nesting_num_layers_minus1" ); sei.m_nestingNumLayersMinus1 = uiCode;804 for (UInt i = 0; i <= sei.m_nestingNumLayersMinus1; i++)805 {806 READ_CODE( 6, uiCode, "nesting_layer_id" ); sei.m_nestingLayerId[i] = uiCode;807 }808 }809 }810 811 // byte alignment812 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 )813 {814 UInt code;815 READ_FLAG( code, "nesting_zero_bit" );816 }817 818 sei.m_callerOwnsSEIs = false;819 820 // read nested SEI messages821 do {822 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps);823 } while (m_pcBitstream->getNumBitsLeft() > 8);824 825 }826 #endif827 828 634 Void SEIReader::xParseByteAlign() 829 635 {
Note: See TracChangeset for help on using the changeset viewer.