Changeset 1356 in 3DVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 27 Oct 2015, 11:33:16 (9 years ago)
- Location:
- trunk/source/Lib/TLibEncoder
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/SEIEncoder.cpp
r1313 r1356 465 465 466 466 #if NH_MV 467 #if !NH_MV_SEI 467 468 Void SEIEncoder::initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps) 468 469 { … … 476 477 seiSubBitstreamProperty->m_maxBitRate = m_pcCfg->getMaxBitRate(); 477 478 } 479 #else 480 Void SEIEncoder::createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice ) 481 { 482 const SEIMessages* seiMessageCfg = m_pcCfg->getSeiMessages(); 483 484 for( SEIMessages::const_iterator itS = seiMessageCfg->begin(); itS != seiMessageCfg->end(); itS++ ) 485 { 486 const SEI* curSei = (*itS); 487 SEI* newSei; 488 if ( curSei->insertSei( slice->getLayerId(), slice->getPOC(), slice->getTemporalId(), slice->getNalUnitType() ) ) 489 { 490 newSei = curSei->getCopy( ) ; 491 492 if ( curSei->m_modifyByEncoder ) 493 { 494 newSei->setupFromSlice ( slice ); 495 } 496 497 if ( newSei ->checkCfg( slice ) ) 498 { 499 std::cout << "--> Omit sending SEI." << std::endl; 500 delete newSei; 501 } 502 else 503 { 504 seiMessage.push_back(newSei); 505 } 506 507 } 508 } 509 } 478 510 #endif 511 #endif 479 512 480 513 //! \} -
trunk/source/Lib/TLibEncoder/SEIEncoder.h
r1313 r1356 86 86 Void initTemporalLevel0IndexSEI(SEITemporalLevel0Index *sei, TComSlice *slice); 87 87 #if NH_MV 88 #if !NH_MV_SEI 88 89 Void initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps); 90 #else 91 Void createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice );; 92 #endif 89 93 #endif 90 94 private: -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r1313 r1356 122 122 break; 123 123 #if NH_MV 124 #if !NH_MV_SEI 124 125 case SEI::SUB_BITSTREAM_PROPERTY: 125 126 xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei)); 126 127 break; 127 128 #endif 129 #endif 130 #if NH_MV_SEI 131 #if NH_MV_LAYERS_NOT_PRESENT_SEI 132 case SEI::LAYERS_NOT_PRESENT: 133 xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei)); 134 break; 135 #endif 136 case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS: 137 xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei)); 138 break; 139 #if NH_MV_SEI_TBD 140 case SEI::BSP_NESTING: 141 xWriteSEIBspNesting(*static_cast<const SEIBspNesting*>(&sei)); 142 break; 143 case SEI::BSP_INITIAL_ARRIVAL_TIME: 144 xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei)); 145 break; 146 #endif 147 case SEI::SUB_BITSTREAM_PROPERTY: 148 xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei)); 149 break; 150 case SEI::ALPHA_CHANNEL_INFO: 151 xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei)); 152 break; 153 case SEI::OVERLAY_INFO: 154 xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei)); 155 break; 156 case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS: 157 xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei)); 158 break; 159 #if NH_MV_SEI_TBD 160 case SEI::FRAME_FIELD_INFO: 161 xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei)); 162 break; 163 #endif 164 case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: 165 xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei)); 166 break; 167 #if SEI_DRI_F0169 168 case SEI::DEPTH_REPRESENTATION_INFO: 169 xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei)); 170 break; 171 #endif 172 case SEI::MULTIVIEW_SCENE_INFO: 173 xWriteSEIMultiviewSceneInfo(*static_cast<const SEIMultiviewSceneInfo*>(&sei)); 174 break; 175 case SEI::MULTIVIEW_ACQUISITION_INFO: 176 xWriteSEIMultiviewAcquisitionInfo(*static_cast<const SEIMultiviewAcquisitionInfo*>(&sei)); 177 break; 178 179 case SEI::MULTIVIEW_VIEW_POSITION: 180 xWriteSEIMultiviewViewPosition(*static_cast<const SEIMultiviewViewPosition*>(&sei)); 181 break; 182 #if NH_3D 183 case SEI::ALTERNATIVE_DEPTH_INFO: 184 xWriteSEIAlternativeDepthInfo(*static_cast<const SEIAlternativeDepthInfo*>(&sei)); 185 break; 186 #endif 187 #endif 188 128 189 129 190 default: … … 246 307 for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++) 247 308 { 248 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 309 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 249 310 } 250 311 } … … 384 445 { 385 446 WRITE_FLAG( sei.m_arrangementCancelFlag, "segmented_rect_frame_packing_arrangement_cancel_flag" ); 386 if( sei.m_arrangementCancelFlag == 0 ) 447 if( sei.m_arrangementCancelFlag == 0 ) 387 448 { 388 449 WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" ); … … 553 614 { 554 615 //UInt code; 555 WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 616 WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 556 617 WRITE_FLAG((sei.m_each_tile_one_tile_set_flag ? 1 : 0), "each_tile_one_tile_set_flag" ); 557 618 … … 568 629 569 630 if(sei.m_limited_tile_set_display_flag) 570 { 571 WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag"); 572 } 573 574 WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 575 631 { 632 WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag"); 633 } 634 635 WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 636 576 637 for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++) 577 638 { 578 WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex (j), "top_left_tile_index"); 579 WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index"); 639 WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex (j), "top_left_tile_index"); 640 WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index"); 580 641 } 581 642 582 643 if(!sei.m_mc_all_tiles_exact_sample_value_match_flag) 583 644 { 584 WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag"); 645 WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag"); 585 646 } 586 647 … … 590 651 { 591 652 WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag"); 592 WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8, "mcts_level_idc"); 653 WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8, "mcts_level_idc"); 593 654 } 594 655 } … … 601 662 if(sei.m_max_mcs_tier_level_idc_present_flag) 602 663 { 603 WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag"); 604 WRITE_CODE( sei.m_max_mcts_level_idc, 8, "max_mcts_level_idc"); 664 WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag"); 665 WRITE_CODE( sei.m_max_mcts_level_idc, 8, "max_mcts_level_idc"); 605 666 } 606 667 } … … 702 763 userVerticalCoefficients[2][2] = 100; 703 764 userVerticalCoefficients[2][3] = -10; 704 765 705 766 Int const iNumHorizontalFilters = 1; 706 767 Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3}; … … 748 809 749 810 #if NH_MV 811 #if !NH_MV_SEI 750 812 Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei) 751 813 { … … 765 827 } 766 828 #endif 829 #endif 767 830 768 831 Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei) 769 832 { 770 833 WRITE_UVLC( sei.m_kneeId, "knee_function_id" ); 771 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 834 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 772 835 if ( !sei.m_kneeCancelFlag ) 773 836 { … … 800 863 WRITE_CODE( sei.values.whitePoint[0], 16, "white_point_x" ); 801 864 WRITE_CODE( sei.values.whitePoint[1], 16, "white_point_y" ); 802 865 803 866 WRITE_CODE( sei.values.maxLuminance, 32, "max_display_mastering_luminance" ); 804 867 WRITE_CODE( sei.values.minLuminance, 32, "min_display_mastering_luminance" ); … … 818 881 } 819 882 883 #if NH_MV_LAYERS_NOT_PRESENT_SEI 884 Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei) 885 { 886 WRITE_CODE( sei.m_lnpSeiActiveVpsId, 4, "lnp_sei_active_vps_id" ); 887 for( Int i = 0; i < sei.m_lnpSeiMaxLayers; i++ ) 888 { 889 WRITE_FLAG( ( sei.m_layerNotPresentFlag[i] ? 1 : 0 ), "layer_not_present_flag" ); 890 } 891 }; 892 #endif 893 894 895 896 Void SEIWriter::xWriteSEIInterLayerConstrainedTileSets( const SEIInterLayerConstrainedTileSets& sei) 897 { 898 WRITE_FLAG( ( sei.m_ilAllTilesExactSampleValueMatchFlag ? 1 : 0 ), "il_all_tiles_exact_sample_value_match_flag" ); 899 WRITE_FLAG( ( sei.m_ilOneTilePerTileSetFlag ? 1 : 0 ), "il_one_tile_per_tile_set_flag" ); 900 if( !sei.m_ilOneTilePerTileSetFlag ) 901 { 902 WRITE_UVLC( sei.m_ilNumSetsInMessageMinus1, "il_num_sets_in_message_minus1" ); 903 if( sei.m_ilNumSetsInMessageMinus1 ) 904 { 905 WRITE_FLAG( ( sei.m_skippedTileSetPresentFlag ? 1 : 0 ), "skipped_tile_set_present_flag" ); 906 } 907 Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1; 908 for( Int i = 0; i < numSignificantSets; i++ ) 909 { 910 WRITE_UVLC( sei.m_ilctsId[i], "ilcts_id" ); 911 WRITE_UVLC( sei.m_ilNumTileRectsInSetMinus1[i], "il_num_tile_rects_in_set_minus1" ); 912 for( Int j = 0; j <= sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ ) 913 { 914 WRITE_UVLC( sei.m_ilTopLeftTileIndex[i][j], "il_top_left_tile_index" ); 915 WRITE_UVLC( sei.m_ilBottomRightTileIndex[i][j], "il_bottom_right_tile_index" ); 916 } 917 WRITE_CODE( sei.m_ilcIdc[i], 2, "ilc_idc" ); 918 if ( !sei.m_ilAllTilesExactSampleValueMatchFlag ) 919 { 920 WRITE_FLAG( ( sei.m_ilExactSampleValueMatchFlag[i] ? 1 : 0 ), "il_exact_sample_value_match_flag" ); 921 } 922 } 923 } 924 else 925 { 926 WRITE_CODE( sei.m_allTilesIlcIdc, 2, "all_tiles_ilc_idc" ); 927 } 928 }; 929 930 #if NH_MV_SEI_TBD 931 Void SEIWriter::xWriteSEIBspNesting( const SEIBspNesting& sei) 932 { 933 WRITE_UVLC( sei.m_seiOlsIdx, "sei_ols_idx" ); 934 WRITE_UVLC( sei.m_seiPartitioningSchemeIdx, "sei_partitioning_scheme_idx" ); 935 WRITE_UVLC( sei.m_bspIdx, "bsp_idx" ); 936 while( !ByteaLigned(() ) ); 937 { 938 WRITE_CODE( sei.m_bspNestingZeroBit, *equalto0*/u1, "bsp_nesting_zero_bit" ); 939 } 940 WRITE_UVLC( sei.m_numSeisInBspMinus1, "num_seis_in_bsp_minus1" ); 941 for( Int i = 0; i <= NumSeisInBspMinus1( ); i++ ) 942 { 943 SeiMessage(() ); 944 } 945 }; 946 947 Void SEIWriter::xWriteSEIBspInitialArrivalTime( const SEIBspInitialArrivalTime& sei) 948 { 949 psIdx = SeiPartitioningSchemeIdx(); 950 if( nalInitialArrivalDelayPresent ) 951 { 952 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 953 { 954 WRITE_CODE( sei.m_nalInitialArrivalDelay[i], getNalInitialArrivalDelayLen ), "nal_initial_arrival_delay" ); 955 } 956 } 957 if( vclInitialArrivalDelayPresent ) 958 { 959 for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ ) 960 { 961 WRITE_CODE( sei.m_vclInitialArrivalDelay[i], getVclInitialArrivalDelayLen ), "vcl_initial_arrival_delay" ); 962 } 963 } 964 }; 965 #endif 966 Void SEIWriter::xWriteSEISubBitstreamProperty( const SEISubBitstreamProperty& sei) 967 { 968 WRITE_CODE( sei.m_sbPropertyActiveVpsId, 4, "sb_property_active_vps_id" ); 969 WRITE_UVLC( sei.m_numAdditionalSubStreamsMinus1, "num_additional_sub_streams_minus1" ); 970 for( Int i = 0; i <= sei.m_numAdditionalSubStreamsMinus1; i++ ) 971 { 972 WRITE_CODE( sei.m_subBitstreamMode [i], 2, "sub_bitstream_mode" ); 973 WRITE_UVLC( sei.m_olsIdxToVps [i], "ols_idx_to_vps" ); 974 WRITE_CODE( sei.m_highestSublayerId [i], 3, "highest_sublayer_id" ); 975 WRITE_CODE( sei.m_avgSbPropertyBitRate[i], 16, "avg_sb_property_bit_rate" ); 976 WRITE_CODE( sei.m_maxSbPropertyBitRate[i], 16, "max_sb_property_bit_rate" ); 977 } 978 }; 979 980 Void SEIWriter::xWriteSEIAlphaChannelInfo( const SEIAlphaChannelInfo& sei) 981 { 982 WRITE_FLAG( ( sei.m_alphaChannelCancelFlag ? 1 : 0 ), "alpha_channel_cancel_flag" ); 983 if( !sei.m_alphaChannelCancelFlag ) 984 { 985 WRITE_CODE( sei.m_alphaChannelUseIdc, 3, "alpha_channel_use_idc" ); 986 WRITE_CODE( sei.m_alphaChannelBitDepthMinus8, 3, "alpha_channel_bit_depth_minus8" ); 987 WRITE_CODE( sei.m_alphaTransparentValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_transparent_value" ); 988 WRITE_CODE( sei.m_alphaOpaqueValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_opaque_value" ); 989 WRITE_FLAG( ( sei.m_alphaChannelIncrFlag ? 1 : 0 ), "alpha_channel_incr_flag" ); 990 WRITE_FLAG( ( sei.m_alphaChannelClipFlag ? 1 : 0 ), "alpha_channel_clip_flag" ); 991 if( sei.m_alphaChannelClipFlag ) 992 { 993 WRITE_FLAG( ( sei.m_alphaChannelClipTypeFlag ? 1 : 0 ), "alpha_channel_clip_type_flag" ); 994 } 995 } 996 }; 997 998 Void SEIWriter::xWriteSEIOverlayInfo( const SEIOverlayInfo& sei) 999 { 1000 WRITE_FLAG( ( sei.m_overlayInfoCancelFlag ? 1 : 0 ), "overlay_info_cancel_flag" ); 1001 if( !sei.m_overlayInfoCancelFlag ) 1002 { 1003 WRITE_UVLC( sei.m_overlayContentAuxIdMinus128, "overlay_content_aux_id_minus128" ); 1004 WRITE_UVLC( sei.m_overlayLabelAuxIdMinus128, "overlay_label_aux_id_minus128" ); 1005 WRITE_UVLC( sei.m_overlayAlphaAuxIdMinus128, "overlay_alpha_aux_id_minus128" ); 1006 WRITE_UVLC( sei.m_overlayElementLabelValueLengthMinus8, "overlay_element_label_value_length_minus8" ); 1007 WRITE_UVLC( sei.m_numOverlaysMinus1, "num_overlays_minus1" ); 1008 for( Int i = 0; i <= sei.m_numOverlaysMinus1 ; i++ ) 1009 { 1010 WRITE_UVLC( sei.m_overlayIdx[i], "overlay_idx" ); 1011 WRITE_FLAG( ( sei.m_languageOverlayPresentFlag[i] ? 1 : 0 ), "language_overlay_present_flag" ); 1012 WRITE_CODE( sei.m_overlayContentLayerId[i], 6, "overlay_content_layer_id" ); 1013 WRITE_FLAG( ( sei.m_overlayLabelPresentFlag[i] ? 1 : 0 ), "overlay_label_present_flag" ); 1014 if( sei.m_overlayLabelPresentFlag[i] ) 1015 { 1016 WRITE_CODE( sei.m_overlayLabelLayerId[i], 6, "overlay_label_layer_id" ); 1017 } 1018 WRITE_FLAG( ( sei.m_overlayAlphaPresentFlag[i] ? 1 : 0 ), "overlay_alpha_present_flag" ); 1019 if( sei.m_overlayAlphaPresentFlag[i] ) 1020 { 1021 WRITE_CODE( sei.m_overlayAlphaLayerId[i], 6, "overlay_alpha_layer_id" ); 1022 } 1023 if( sei.m_overlayLabelPresentFlag[i] ) 1024 { 1025 WRITE_UVLC( sei.m_numOverlayElementsMinus1[i], "num_overlay_elements_minus1" ); 1026 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1[i]; j++ ) 1027 { 1028 WRITE_CODE( sei.m_overlayElementLabelMin[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_min" ); 1029 WRITE_CODE( sei.m_overlayElementLabelMax[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_max" ); 1030 } 1031 } 1032 } 1033 1034 // byte alignment 1035 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 1036 { 1037 WRITE_FLAG( 0, "overlay_zero_bit" ); 1038 } 1039 1040 UChar* stmp; 1041 UInt ilength; 1042 for( Int i = 0; i <= sei.m_numOverlaysMinus1; i++ ) 1043 { 1044 if( sei.m_languageOverlayPresentFlag[i] ) 1045 { 1046 stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() ); 1047 ilength = (UInt) sei.m_overlayLanguage[i].size(); 1048 WRITE_STRING( stmp, ilength, "overlay_language" ); 1049 free(stmp); 1050 } 1051 stmp = (UChar*) strdup( sei.m_overlayName[i].c_str() ); 1052 ilength = (UInt) sei.m_overlayName[i].size(); 1053 WRITE_STRING( stmp, ilength, "overlay_name" ); 1054 free(stmp); 1055 if( sei.m_overlayLabelPresentFlag[i] ) 1056 { 1057 for( Int j = 0; j <= sei.m_numOverlayElementsMinus1[i]; j++ ) 1058 { 1059 stmp = (UChar*) strdup( sei.m_overlayElementName[i][j].c_str() ); 1060 ilength = (UInt) sei.m_overlayElementName[i][j].size(); 1061 WRITE_STRING( stmp, ilength, "overlay_element_name" ); 1062 free(stmp); 1063 } 1064 } 1065 } 1066 WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" ); 1067 } 1068 }; 1069 1070 Void SEIWriter::xWriteSEITemporalMvPredictionConstraints( const SEITemporalMvPredictionConstraints& sei) 1071 { 1072 WRITE_FLAG( ( sei.m_prevPicsNotUsedFlag ? 1 : 0 ), "prev_pics_not_used_flag" ); 1073 WRITE_FLAG( ( sei.m_noIntraLayerColPicFlag ? 1 : 0 ), "no_intra_layer_col_pic_flag" ); 1074 }; 1075 1076 #if NH_MV_SEI_TBD 1077 Void SEIWriter::xWriteSEIFrameFieldInfo( const SEIFrameFieldInfo& sei) 1078 { 1079 WRITE_CODE( sei.m_ffinfoPicStruct, 4, "ffinfo_pic_struct" ); 1080 WRITE_CODE( sei.m_ffinfoSourceScanType, 2, "ffinfo_source_scan_type" ); 1081 WRITE_FLAG( ( sei.m_ffinfoDuplicateFlag ? 1 : 0 ), "ffinfo_duplicate_flag" ); 1082 }; 1083 #endif 1084 1085 Void SEIWriter::xWriteSEIThreeDimensionalReferenceDisplaysInfo( const SEIThreeDimensionalReferenceDisplaysInfo& sei) 1086 { 1087 WRITE_UVLC( sei.m_precRefDisplayWidth, "prec_ref_display_width" ); 1088 WRITE_FLAG( ( sei.m_refViewingDistanceFlag ? 1 : 0 ), "ref_viewing_distance_flag" ); 1089 if( sei.m_refViewingDistanceFlag ) 1090 { 1091 WRITE_UVLC( sei.m_precRefViewingDist, "prec_ref_viewing_dist" ); 1092 } 1093 WRITE_UVLC( sei.m_numRefDisplaysMinus1, "num_ref_displays_minus1" ); 1094 for( Int i = 0; i <= sei.getNumRefDisplaysMinus1( ); i++ ) 1095 { 1096 WRITE_UVLC( sei.m_leftViewId[i], "left_view_id" ); 1097 WRITE_UVLC( sei.m_rightViewId[i], "right_view_id" ); 1098 WRITE_CODE( sei.m_exponentRefDisplayWidth[i], 6, "exponent_ref_display_width" ); 1099 WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], sei.getMantissaReferenceDisplayWidthLen(i) , "mantissa_ref_display_width" ); 1100 if( sei.m_refViewingDistanceFlag ) 1101 { 1102 WRITE_CODE( sei.m_exponentRefViewingDistance[i], 6, "exponent_ref_viewing_distance" ); 1103 WRITE_CODE( sei.m_mantissaRefViewingDistance[i], sei.getMantissaReferenceViewingDistanceLen(i), "mantissa_ref_viewing_distance" ); 1104 } 1105 WRITE_FLAG( ( sei.m_additionalShiftPresentFlag[i] ? 1 : 0 ), "additional_shift_present_flag" ); 1106 if( sei.m_additionalShiftPresentFlag[i] ) 1107 { 1108 WRITE_CODE( sei.m_numSampleShiftPlus512[i], 10, "num_sample_shift_plus512" ); 1109 } 1110 } 1111 WRITE_FLAG( ( sei.m_threeDimensionalReferenceDisplaysExtensionFlag ? 1 : 0 ), "three_dimensional_reference_displays_extension_flag" ); 1112 }; 1113 1114 #if SEI_DRI_F0169 1115 Void SEIWriter::xWriteSEIDepthRepresentationInfo( const SEIDepthRepresentationInfo& sei) 1116 { 1117 1118 assert(sei.m_currLayerID>=0); 1119 1120 WRITE_FLAG( ( sei.m_zNearFlag[sei.m_currLayerID] ? 1 : 0 ), "z_near_flag" ); 1121 WRITE_FLAG( ( sei.m_zFarFlag[sei.m_currLayerID] ? 1 : 0 ), "z_far_flag" ); 1122 WRITE_FLAG( ( sei.m_dMinFlag[sei.m_currLayerID] ? 1 : 0 ), "d_min_flag" ); 1123 WRITE_FLAG( ( sei.m_dMaxFlag[sei.m_currLayerID] ? 1 : 0 ), "d_max_flag" ); 1124 WRITE_UVLC( sei.m_depthRepresentationType[sei.m_currLayerID][0], "depth_representation_type" ); 1125 if( sei.m_dMinFlag[sei.m_currLayerID] || sei.m_dMaxFlag[sei.m_currLayerID] ) 1126 { 1127 WRITE_UVLC( sei.m_disparityRefViewId[sei.m_currLayerID][0], "disparity_ref_view_id" ); 1128 } 1129 if( sei.m_zNearFlag[sei.m_currLayerID] ) 1130 { 1131 xWriteSEIDepthRepInfoElement(sei.m_zNear[sei.m_currLayerID][0]); 1132 } 1133 if( sei.m_zFarFlag[sei.m_currLayerID] ) 1134 { 1135 xWriteSEIDepthRepInfoElement(sei.m_zFar[sei.m_currLayerID][0]); 1136 } 1137 if( sei.m_dMinFlag[sei.m_currLayerID] ) 1138 { 1139 xWriteSEIDepthRepInfoElement(sei.m_dMin[sei.m_currLayerID][0]); 1140 } 1141 if( sei.m_dMaxFlag[sei.m_currLayerID] ) 1142 { 1143 xWriteSEIDepthRepInfoElement(sei.m_dMax[sei.m_currLayerID][0]); 1144 } 1145 1146 if (sei.m_depthRepresentationType[sei.m_currLayerID][0] == 3) 1147 { 1148 WRITE_UVLC( sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0], "depth_nonlinear_representation_num_minus1" ); 1149 for( Int i = 1; i <= sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0] + 1; i++ ) 1150 { 1151 WRITE_UVLC(sei.m_depth_nonlinear_representation_model[sei.m_currLayerID][i-1],"depth_nonlinear_representation_model[ i ]"); 1152 } 1153 } 1154 } 1155 1156 Void SEIWriter::xWriteSEIDepthRepInfoElement( double f) 1157 { 1158 UInt x_sign, x_exp, x_mantissa,x_mantissa_len; 1159 if (f < 0) 1160 { 1161 f = f * (-1); 1162 x_sign = 1; 1163 } 1164 else 1165 { 1166 x_sign = 0; 1167 } 1168 int exponent=0; 1169 if(f >= 1) 1170 { 1171 while(f>=2) 1172 { 1173 exponent++; 1174 f = f/2; 1175 } 1176 } 1177 else 1178 { 1179 while (f<1) 1180 { 1181 exponent++; 1182 f = f*2; 1183 } 1184 exponent=-exponent; 1185 } 1186 1187 int i; 1188 f = f -1; 1189 double s = 1; 1190 char s_mantissa[32]; 1191 double thr=1.0/(4.0*(1<<30)); 1192 1193 if (f>=thr) 1194 { 1195 for(i=0;i<32;i++) 1196 { 1197 s /= 2; 1198 if(f>=s) 1199 { 1200 f = f-s; 1201 s_mantissa[i]=1; 1202 1203 if (f<thr) 1204 break; 1205 } 1206 else 1207 { 1208 s_mantissa[i]=0; 1209 } 1210 } 1211 1212 if (i<32) 1213 x_mantissa_len=i+1; 1214 else 1215 x_mantissa_len=32; 1216 1217 x_mantissa=0; 1218 1219 for(i=0;i<x_mantissa_len;i++) 1220 { 1221 if (s_mantissa[i]==1) 1222 x_mantissa += (1u)<<(x_mantissa_len-1-i) ; 1223 } 1224 1225 } 1226 else 1227 { 1228 x_mantissa=0; 1229 x_mantissa_len=1; 1230 } 1231 1232 assert(exponent>=-31 && exponent<= (1<<7)-32); 1233 x_exp=exponent+31; 1234 1235 WRITE_FLAG( x_sign, "da_sign_flag" ); 1236 WRITE_CODE( x_exp, 7 , "da_exponent" ); 1237 WRITE_CODE( x_mantissa_len-1, 5 , "da_mantissa_len_minus1" ); 1238 WRITE_CODE( x_mantissa, x_mantissa_len , "da_mantissa" ); 1239 1240 }; 1241 #endif 1242 Void SEIWriter::xWriteSEIMultiviewSceneInfo( const SEIMultiviewSceneInfo& sei) 1243 { 1244 WRITE_SVLC( sei.m_minDisparity , "min_disparity" ); 1245 WRITE_UVLC( sei.m_maxDisparityRange, "max_disparity_range" ); 1246 }; 1247 1248 1249 Void SEIWriter::xWriteSEIMultiviewAcquisitionInfo( const SEIMultiviewAcquisitionInfo& sei) 1250 { 1251 WRITE_FLAG( ( sei.m_intrinsicParamFlag ? 1 : 0 ), "intrinsic_param_flag" ); 1252 WRITE_FLAG( ( sei.m_extrinsicParamFlag ? 1 : 0 ), "extrinsic_param_flag" ); 1253 if( sei.m_intrinsicParamFlag ) 1254 { 1255 WRITE_FLAG( ( sei.m_intrinsicParamsEqualFlag ? 1 : 0 ), "intrinsic_params_equal_flag" ); 1256 WRITE_UVLC( sei.m_precFocalLength , "prec_focal_length" ); 1257 WRITE_UVLC( sei.m_precPrincipalPoint , "prec_principal_point" ); 1258 WRITE_UVLC( sei.m_precSkewFactor , "prec_skew_factor" ); 1259 1260 for( Int i = 0; i <= ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ ) 1261 { 1262 WRITE_FLAG( ( sei.m_signFocalLengthX [i] ? 1 : 0 ), "sign_focal_length_x" ); 1263 WRITE_CODE( sei.m_exponentFocalLengthX [i] , 6 , "exponent_focal_length_x" ); 1264 WRITE_CODE( sei.m_mantissaFocalLengthX [i] , sei.getMantissaFocalLengthXLen( i ), "mantissa_focal_length_x" ); 1265 WRITE_FLAG( ( sei.m_signFocalLengthY [i] ? 1 : 0 ), "sign_focal_length_y" ); 1266 WRITE_CODE( sei.m_exponentFocalLengthY [i] , 6 , "exponent_focal_length_y" ); 1267 WRITE_CODE( sei.m_mantissaFocalLengthY [i] , sei.getMantissaFocalLengthYLen( i ), "mantissa_focal_length_y" ); 1268 WRITE_FLAG( ( sei.m_signPrincipalPointX [i] ? 1 : 0 ), "sign_principal_point_x" ); 1269 WRITE_CODE( sei.m_exponentPrincipalPointX[i] , 6, "exponent_principal_point_x" ); 1270 WRITE_CODE( sei.m_mantissaPrincipalPointX[i] , sei.getMantissaPrincipalPointXLen( i ), "mantissa_principal_point_x" ); 1271 WRITE_FLAG( ( sei.m_signPrincipalPointY [i] ? 1 : 0 ), "sign_principal_point_y" ); 1272 WRITE_CODE( sei.m_exponentPrincipalPointY[i] , 6, "exponent_principal_point_y" ); 1273 WRITE_CODE( sei.m_mantissaPrincipalPointY[i] , sei.getMantissaPrincipalPointYLen( i ), "mantissa_principal_point_y" ); 1274 WRITE_FLAG( ( sei.m_signSkewFactor [i] ? 1 : 0 ), "sign_skew_factor" ); 1275 WRITE_CODE( sei.m_exponentSkewFactor [i] , 6, "exponent_skew_factor" ); 1276 WRITE_CODE( sei.m_mantissaSkewFactor [i] , sei.getMantissaSkewFactorLen( i ) , "mantissa_skew_factor" ); 1277 } 1278 } 1279 if( sei.m_extrinsicParamFlag ) 1280 { 1281 WRITE_UVLC( sei.m_precRotationParam , "prec_rotation_param" ); 1282 WRITE_UVLC( sei.m_precTranslationParam, "prec_translation_param" ); 1283 for( Int i = 0; i <= sei.getNumViewsMinus1(); i++ ) 1284 { 1285 for( Int j = 0; j <= 2; j++ ) /* row */ 1286 { 1287 for( Int k = 0; k <= 2; k++ ) /* column */ 1288 { 1289 WRITE_FLAG( ( sei.m_signR [i][j][k] ? 1 : 0 ), "sign_r" ); 1290 WRITE_CODE( sei.m_exponentR[i][j][k] , 6, "exponent_r" ); 1291 WRITE_CODE( sei.m_mantissaR[i][j][k] , sei.getMantissaRLen( i,j,k ) , "mantissa_r" ); 1292 } 1293 WRITE_FLAG( ( sei.m_signT [i][j] ? 1 : 0 ), "sign_t" ); 1294 WRITE_CODE( sei.m_exponentT[i][j] , 6, "exponent_t" ); 1295 WRITE_CODE( sei.m_mantissaT[i][j] , sei.getMantissaTLen( i,j ),"mantissa_t" ); 1296 } 1297 } 1298 } 1299 }; 1300 1301 1302 #if NH_MV_SEI 1303 Void SEIWriter::xWriteSEIMultiviewViewPosition( const SEIMultiviewViewPosition& sei) 1304 { 1305 WRITE_UVLC( sei.m_numViewsMinus1, "num_views_minus1" ); 1306 for( Int i = 0; i <= sei.m_numViewsMinus1; i++ ) 1307 { 1308 WRITE_UVLC( sei.m_viewPosition[i], "view_position" ); 1309 } 1310 }; 1311 #endif 1312 1313 #if NH_3D 1314 Void SEIWriter::xWriteSEIAlternativeDepthInfo( const SEIAlternativeDepthInfo& sei) 1315 { 1316 WRITE_FLAG( ( sei.m_alternativeDepthInfoCancelFlag ? 1 : 0 ), "alternative_depth_info_cancel_flag" ); 1317 if( sei.m_alternativeDepthInfoCancelFlag == 0 ) 1318 { 1319 WRITE_CODE( sei.m_depthType, 2, "depth_type" ); 1320 1321 if( sei.m_depthType == 0 ) 1322 { 1323 WRITE_UVLC( sei.m_numConstituentViewsGvdMinus1, "num_constituent_views_gvd_minus1" ); 1324 WRITE_FLAG( ( sei.m_depthPresentGvdFlag ? 1 : 0 ), "depth_present_gvd_flag" ); 1325 WRITE_FLAG( ( sei.m_zGvdFlag ? 1 : 0 ), "z_gvd_flag" ); 1326 WRITE_FLAG( ( sei.m_intrinsicParamGvdFlag ? 1 : 0 ), "intrinsic_param_gvd_flag" ); 1327 WRITE_FLAG( ( sei.m_rotationGvdFlag ? 1 : 0 ), "rotation_gvd_flag" ); 1328 WRITE_FLAG( ( sei.m_translationGvdFlag ? 1 : 0 ), "translation_gvd_flag" ); 1329 if( sei.m_zGvdFlag ) 1330 { 1331 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1332 { 1333 WRITE_FLAG( ( sei.m_signGvdZNearFlag[i][j] ? 1 : 0 ), "sign_gvd_z_near_flag" ); 1334 WRITE_CODE( sei.m_expGvdZNear[i][j], 7, "exp_gvd_z_near" ); 1335 WRITE_CODE( sei.m_manLenGvdZNearMinus1[i][j], 5, "man_len_gvd_z_near_minus1" ); 1336 WRITE_CODE( sei.m_manGvdZNear[i][j], sei.m_manLenGvdZNearMinus1[i][j] + 1, "man_gvd_z_near" ); 1337 WRITE_FLAG( ( sei.m_signGvdZFarFlag[i][j] ? 1 : 0 ), "sign_gvd_z_far_flag" ); 1338 WRITE_CODE( sei.m_expGvdZFar[i][j], 7, "exp_gvd_z_far" ); 1339 WRITE_CODE( sei.m_manLenGvdZFarMinus1[i][j], 5, "man_len_gvd_z_far_minus1" ); 1340 WRITE_CODE( sei.m_manGvdZFar[i][j], sei.m_manLenGvdZFarMinus1[i][j] + 1, "man_gvd_z_far" ); 1341 } 1342 } 1343 if( sei.m_intrinsicParamGvdFlag ) 1344 { 1345 WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" ); 1346 WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" ); 1347 } 1348 if( sei.m_rotationGvdFlag ) 1349 { 1350 WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" ); 1351 } 1352 if( sei.m_translationGvdFlag ) 1353 { 1354 WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" ); 1355 } 1356 for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ ) 1357 { 1358 if( sei.m_intrinsicParamGvdFlag ) 1359 { 1360 WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" ); 1361 WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" ); 1362 WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.getManGvdFocalLengthXLen(i,j), "man_gvd_focal_length_x" ); 1363 WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" ); 1364 WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" ); 1365 WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.getManGvdFocalLengthYLen(i,j), "man_gvd_focal_length_y" ); 1366 WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" ); 1367 WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" ); 1368 WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.getManGvdPrincipalPointXLen(i,j), "man_gvd_principal_point_x" ); 1369 WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" ); 1370 WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" ); 1371 WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.getManGvdPrincipalPointYLen(i,j), "man_gvd_principal_point_y" ); 1372 } 1373 if( sei.m_rotationGvdFlag ) 1374 { 1375 WRITE_FLAG( ( sei.m_signGvdR00[i][j] ? 1 : 0 ), "sign_gvd_r00" ); 1376 WRITE_CODE( sei.m_expGvdR00[i][j], 6, "exp_gvd_r00" ); 1377 WRITE_CODE( sei.m_manGvdR00[i][j], sei.m_precGvdRotationParam, "man_gvd_r00" ); 1378 WRITE_FLAG( ( sei.m_signGvdR01[i][j] ? 1 : 0 ), "sign_gvd_r01" ); 1379 WRITE_CODE( sei.m_expGvdR01[i][j], 6, "exp_gvd_r01" ); 1380 WRITE_CODE( sei.m_manGvdR01[i][j], sei.m_precGvdRotationParam, "man_gvd_r01" ); 1381 WRITE_FLAG( ( sei.m_signGvdR02[i][j] ? 1 : 0 ), "sign_gvd_r02" ); 1382 WRITE_CODE( sei.m_expGvdR02[i][j], 6, "exp_gvd_r02" ); 1383 WRITE_CODE( sei.m_manGvdR02[i][j], sei.m_precGvdRotationParam, "man_gvd_r02" ); 1384 WRITE_FLAG( ( sei.m_signGvdR10[i][j] ? 1 : 0 ), "sign_gvd_r10" ); 1385 WRITE_CODE( sei.m_expGvdR10[i][j], 6, "exp_gvd_r10" ); 1386 WRITE_CODE( sei.m_manGvdR10[i][j], sei.m_precGvdRotationParam, "man_gvd_r10" ); 1387 WRITE_FLAG( ( sei.m_signGvdR11[i][j] ? 1 : 0 ), "sign_gvd_r11" ); 1388 WRITE_CODE( sei.m_expGvdR11[i][j], 6, "exp_gvd_r11" ); 1389 WRITE_CODE( sei.m_manGvdR11[i][j], sei.m_precGvdRotationParam, "man_gvd_r11" ); 1390 WRITE_FLAG( ( sei.m_signGvdR12[i][j] ? 1 : 0 ), "sign_gvd_r12" ); 1391 WRITE_CODE( sei.m_expGvdR12[i][j], 6, "exp_gvd_r12" ); 1392 WRITE_CODE( sei.m_manGvdR12[i][j], sei.m_precGvdRotationParam, "man_gvd_r12" ); 1393 WRITE_FLAG( ( sei.m_signGvdR20[i][j] ? 1 : 0 ), "sign_gvd_r20" ); 1394 WRITE_CODE( sei.m_expGvdR20[i][j], 6, "exp_gvd_r20" ); 1395 WRITE_CODE( sei.m_manGvdR20[i][j], sei.m_precGvdRotationParam, "man_gvd_r20" ); 1396 WRITE_FLAG( ( sei.m_signGvdR21[i][j] ? 1 : 0 ), "sign_gvd_r21" ); 1397 WRITE_CODE( sei.m_expGvdR21[i][j], 6, "exp_gvd_r21" ); 1398 WRITE_CODE( sei.m_manGvdR21[i][j], sei.m_precGvdRotationParam, "man_gvd_r21" ); 1399 WRITE_FLAG( ( sei.m_signGvdR22[i][j] ? 1 : 0 ), "sign_gvd_r22" ); 1400 WRITE_CODE( sei.m_expGvdR22[i][j], 6, "exp_gvd_r22" ); 1401 WRITE_CODE( sei.m_manGvdR22[i][j], sei.m_precGvdRotationParam, "man_gvd_r22" ); 1402 } 1403 if( sei.m_translationGvdFlag ) 1404 { 1405 WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" ); 1406 WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" ); 1407 WRITE_CODE( sei.m_manGvdTX[i][j], sei.getManGvdTXLen(i,j), "man_gvd_t_x" ); 1408 } 1409 } 1410 } 1411 1412 if( sei.m_depthType == 1 ) 1413 { 1414 WRITE_SVLC( sei.m_minOffsetXInt, "min_offset_x_int" ); 1415 WRITE_CODE( sei.m_minOffsetXFrac, 8, "min_offset_x_frac" ); 1416 WRITE_SVLC( sei.m_maxOffsetXInt, "max_offset_x_int" ); 1417 WRITE_CODE( sei.m_maxOffsetXFrac, 8, "max_offset_x_frac" ); 1418 WRITE_FLAG( ( sei.m_offsetYPresentFlag ? 1 : 0 ), "offset_y_present_flag" ); 1419 if( sei.m_offsetYPresentFlag ) 1420 { 1421 WRITE_SVLC( sei.m_minOffsetYInt, "min_offset_y_int" ); 1422 WRITE_CODE( sei.m_minOffsetYFrac, 8, "min_offset_y_frac" ); 1423 WRITE_SVLC( sei.m_maxOffsetYInt, "max_offset_y_int" ); 1424 WRITE_CODE( sei.m_maxOffsetYFrac, 8, "max_offset_y_frac" ); 1425 } 1426 WRITE_FLAG( ( sei.m_warpMapSizePresentFlag ? 1 : 0 ), "warp_map_size_present_flag" ); 1427 if( sei.m_warpMapSizePresentFlag ) 1428 { 1429 WRITE_UVLC( sei.m_warpMapWidthMinus2, "warp_map_width_minus2" ); 1430 WRITE_UVLC( sei.m_warpMapHeightMinus2, "warp_map_height_minus2" ); 1431 } 1432 } 1433 } 1434 }; 1435 #endif 1436 1437 820 1438 //! \} -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r1313 r1356 72 72 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps); 73 73 #if NH_MV 74 #if !NH_MV_SEI 74 75 Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei); 76 #endif 75 77 #endif 76 78 Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets& sei); … … 81 83 Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei); 82 84 85 #if NH_MV_SEI 86 #if NH_MV_LAYERS_NOT_PRESENT_SEI 87 Void xWriteSEILayersNotPresent ( const SEILayersNotPresent& sei); 88 #endif 89 Void xWriteSEIInterLayerConstrainedTileSets ( const SEIInterLayerConstrainedTileSets& sei); 90 #if NH_MV_SEI_TBD 91 Void xWriteSEIBspNesting ( const SEIBspNesting& sei); 92 Void xWriteSEIBspInitialArrivalTime ( const SEIBspInitialArrivalTime& sei); 93 #endif 94 Void xWriteSEISubBitstreamProperty ( const SEISubBitstreamProperty& sei); 95 Void xWriteSEIAlphaChannelInfo ( const SEIAlphaChannelInfo& sei); 96 Void xWriteSEIOverlayInfo ( const SEIOverlayInfo& sei); 97 Void xWriteSEITemporalMvPredictionConstraints ( const SEITemporalMvPredictionConstraints& sei); 98 #if NH_MV_SEI_TBD 99 Void xWriteSEIFrameFieldInfo ( const SEIFrameFieldInfo& sei); 100 #endif 101 Void xWriteSEIThreeDimensionalReferenceDisplaysInfo ( const SEIThreeDimensionalReferenceDisplaysInfo& sei); 102 #if SEI_DRI_F0169 103 Void xWriteSEIDepthRepInfoElement ( double f); 104 Void xWriteSEIDepthRepresentationInfo ( const SEIDepthRepresentationInfo& sei); 105 #endif 106 Void xWriteSEIMultiviewSceneInfo ( const SEIMultiviewSceneInfo& sei); 107 Void xWriteSEIMultiviewAcquisitionInfo ( const SEIMultiviewAcquisitionInfo& sei); 108 Void xWriteSEIMultiviewViewPosition ( const SEIMultiviewViewPosition& sei); 109 #if NH_3D 110 Void xWriteSEIAlternativeDepthInfo ( const SEIAlternativeDepthInfo& sei); 111 #endif 83 112 Void xWriteByteAlign(); 84 113 }; 114 #endif 85 115 86 116 //! \} -
trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
r1313 r1356 127 127 } 128 128 129 Void SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const Char *pSymbolName) 130 { 131 xWriteString(value, length); 132 if( g_HLSTraceEnable ) 133 { 134 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter++ ); 135 fprintf( g_hTrace, "%-50s st(v=%d) : %s\n", pSymbolName, length, value ); 136 } 137 } 138 129 139 #endif 130 140 … … 166 176 } 167 177 178 Void SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength) 179 { 180 assert(m_pcBitIf->getNumberOfWrittenBits() % 8 == 0 ); 181 for (Int i=0 ; i<uiLength; i++) 182 { 183 m_pcBitIf->write( sCode[i], 8 ); 184 } 185 m_pcBitIf->write( 0, 8 ); //zero-termination byte 186 } 187 168 188 Void SyntaxElementWriter::xWriteRbspTrailingBits() 169 189 { -
trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h
r1313 r1356 56 56 #define WRITE_SVLC( value, name) xWriteSvlcTr ( value, name ) 57 57 #define WRITE_FLAG( value, name) xWriteFlagTr ( value, name ) 58 #define WRITE_STRING( value, length, name) xWriteStringTr( value, length, name ) 58 59 59 60 #else … … 63 64 #define WRITE_SVLC( value, name) xWriteSvlc ( value ) 64 65 #define WRITE_FLAG( value, name) xWriteFlag ( value ) 66 #define WRITE_STRING( value, length, name) xWriteString( value, length ) 65 67 66 68 #endif … … 82 84 Void xWriteSvlc ( Int iCode ); 83 85 Void xWriteFlag ( UInt uiCode ); 86 Void xWriteString ( UChar* sCode, UInt uiLength); 84 87 #if ENC_DEC_TRACE 85 88 Void xWriteCodeTr ( UInt value, UInt length, const Char *pSymbolName); … … 87 90 Void xWriteSvlcTr ( Int value, const Char *pSymbolName); 88 91 Void xWriteFlagTr ( UInt value, const Char *pSymbolName); 92 Void xWriteStringTr ( UChar* value, UInt length, const Char *pSymbolName); 89 93 #endif 90 94 Void xWriteRbspTrailingBits(); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r1313 r1356 49 49 #include "TAppCommon/TAppComCamPara.h" 50 50 #include "TLibRenderer/TRenModSetupStrParser.h" 51 #endif 52 53 #if NH_MV 54 #include "TLibCommon/SEI.h" 51 55 #endif 52 56 … … 350 354 Int* m_kneeSEIOutputKneePoint; 351 355 TComSEIMasteringDisplay m_masteringDisplay; 356 #if NH_MV_SEI 357 SEIMessages* m_seiMessages; 358 #endif 352 359 //====== Weighted Prediction ======== 353 360 Bool m_useWeightedPred; //< Use of Weighting Prediction (P_SLICE) … … 432 439 433 440 #if NH_MV 441 #if !NH_MV_SEI 434 442 Bool m_subBistreamPropSEIEnabled; 435 443 Int m_numAdditionalSubStreams; … … 439 447 std::vector<Int> m_avgBitRate; 440 448 std::vector<Int> m_maxBitRate; 449 #endif 441 450 #endif 442 451 … … 933 942 const TComSEIMasteringDisplay &getMasteringDisplaySEI() const { return m_masteringDisplay; } 934 943 #if NH_MV 944 #if NH_MV_SEI 945 Void setSeiMessages(SEIMessages *p) { m_seiMessages = p; } 946 const SEIMessages* getSeiMessages() { return m_seiMessages; } 947 #else 935 948 Bool getSubBitstreamPropSEIEnabled() { return m_subBistreamPropSEIEnabled;} 936 949 Void setSubBitstreamPropSEIEnabled(Bool x) { m_subBistreamPropSEIEnabled = x;} … … 958 971 Int getMaxBitRate(Int idx) { return m_maxBitRate[idx];} 959 972 Void setMaxBitRate(std::vector<Int> &x) { m_maxBitRate = x;} 960 973 #endif 961 974 #endif 962 975 -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r1321 r1356 100 100 m_layerId = 0; 101 101 m_viewId = 0; 102 m_pocLastCoded = -1; 102 m_pocLastCoded = -1; 103 103 #if NH_3D 104 m_viewIndex = 0; 104 m_viewIndex = 0; 105 105 m_isDepth = false; 106 106 #endif … … 147 147 148 148 #if NH_MV 149 m_ivPicLists = pcTEncTop->getIvPicLists(); 149 m_ivPicLists = pcTEncTop->getIvPicLists(); 150 150 m_layerId = pcTEncTop->getLayerId(); 151 151 m_viewId = pcTEncTop->getViewId(); … … 156 156 #endif 157 157 #if NH_3D_IC 158 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate(); 159 m_aICEnableNum = pcTEncTop->getICEnableNum(); 158 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate(); 159 m_aICEnableNum = pcTEncTop->getICEnableNum(); 160 160 #endif 161 161 #if KWU_FIX_URQ … … 207 207 #if NH_MV 208 208 if ( getLayerId() == 0 ) 209 { 209 { 210 210 actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS()); 211 211 } … … 277 277 278 278 while ( (itNalu!=accessUnit.end())&& 279 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 279 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 280 280 || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS 281 281 || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS … … 288 288 SEIMessages localMessages = seiMessages; 289 289 SEIMessages currentMessages; 290 290 291 291 #if ENC_DEC_TRACE 292 292 g_HLSTraceEnable = !testWrite; … … 299 299 xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 300 300 xClearSEIs(currentMessages, !testWrite); 301 301 302 302 // Buffering period SEI must always be following active parameter sets 303 303 currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD); … … 328 328 xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 329 329 xClearSEIs(currentMessages, !testWrite); 330 331 #if NH_MV_LAYERS_NOT_PRESENT_SEI 332 // Layers not present SEI message 333 currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT); 334 xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 335 xClearSEIs(currentMessages, !testWrite); 336 #endif 330 337 331 338 // And finally everything else one by one … … 412 419 Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps) 413 420 { 414 #if NH_MV415 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());416 #else417 421 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 418 #endif 422 419 423 if(m_pcCfg->getActiveParameterSetsSEIEnabled()) 420 424 { … … 472 476 seiMessages.push_back(sei); 473 477 } 474 478 475 479 if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled) 476 480 { … … 482 486 483 487 #if NH_MV 488 #if !NH_MV_SEI 484 489 if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) ) 485 490 { 486 491 SEISubBitstreamProperty *sei = new SEISubBitstreamProperty; 487 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 492 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 488 493 seiMessages.push_back(sei); 489 494 } 495 #endif 490 496 #endif 491 497 } … … 679 685 } 680 686 } 681 687 682 688 if( m_pcCfg->getPictureTimingSEIEnabled() ) 683 689 { … … 715 721 return; 716 722 } 717 // fix first 723 // fix first 718 724 UInt numNalUnits = (UInt)testAU.size(); 719 725 UInt numRBSPBytes = 0; … … 927 933 IRAPGOPid = iGOPid; 928 934 IRAPtoReorder = true; 929 swapIRAPForward = true; 935 swapIRAPForward = true; 930 936 break; 931 937 } … … 935 941 IRAPGOPid = iGOPid; 936 942 IRAPtoReorder = true; 937 swapIRAPForward = false; 943 swapIRAPForward = false; 938 944 break; 939 945 } … … 1066 1072 #endif 1067 1073 #if NH_MV 1068 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1069 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1074 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1075 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1070 1076 Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid ) 1071 1077 #else … … 1170 1176 pcPic->setCurrSliceIdx(0); 1171 1177 #if NH_MV 1172 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1178 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1173 1179 #else 1174 1180 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField ); … … 1181 1187 pcSlice->setSliceIdx(0); 1182 1188 #if NH_MV 1183 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1189 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1184 1190 pcPic ->setLayerId ( getLayerId() ); 1185 pcPic ->setViewId ( getViewId() ); 1191 pcPic ->setViewId ( getViewId() ); 1186 1192 #if !NH_3D 1187 1193 pcSlice->setLayerId ( getLayerId() ); 1188 pcSlice->setViewId ( getViewId() ); 1194 pcSlice->setViewId ( getViewId() ); 1189 1195 pcSlice->setVPS ( m_pcEncTop->getVPS() ); 1190 1196 #else 1191 pcPic ->setViewIndex ( getViewIndex() ); 1197 pcPic ->setViewIndex ( getViewIndex() ); 1192 1198 pcPic ->setIsDepth( getIsDepth() ); 1193 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1194 #endif 1195 #endif 1199 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1200 #endif 1201 #endif 1196 1202 //set default slice level flag to the same as SPS level flag 1197 1203 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); … … 1201 1207 if( pcSlice->getSliceType() == B_SLICE ) 1202 1208 { 1203 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1204 { 1209 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1210 { 1205 1211 pcSlice->setSliceType( P_SLICE ); 1206 1212 } … … 1210 1216 if( pcSlice->getSliceType() == B_SLICE ) 1211 1217 { 1212 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1213 { 1218 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1219 { 1214 1220 pcSlice->setSliceType( I_SLICE ); 1215 1221 } … … 1225 1231 pcSlice->setSliceType(I_SLICE); 1226 1232 } 1227 1233 1228 1234 // Set the nal unit type 1229 1235 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField)); … … 1279 1285 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1280 1286 } 1281 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1287 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1282 1288 || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1) 1283 1289 ) … … 1288 1294 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); 1289 1295 1290 if(pcSlice->getTLayer() > 0 1296 if(pcSlice->getTLayer() > 0 1291 1297 && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N // Check if not a leading picture 1292 1298 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R … … 1358 1364 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 1359 1365 { 1360 // Some more sophisticated algorithm to determine discardable_flag might be added here. 1361 pcSlice->setDiscardableFlag ( false ); 1362 } 1363 1364 const TComVPS* vps = pcSlice->getVPS(); 1366 // Some more sophisticated algorithm to determine discardable_flag might be added here. 1367 pcSlice->setDiscardableFlag ( false ); 1368 } 1369 1370 const TComVPS* vps = pcSlice->getVPS(); 1365 1371 #if NH_3D 1366 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1372 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1367 1373 #else 1368 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1374 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1369 1375 #endif 1370 1376 #if NH_3D 1371 pcSlice->setIvPicLists( m_ivPicLists ); 1377 pcSlice->setIvPicLists( m_ivPicLists ); 1372 1378 1373 1379 Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid; 1374 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1380 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1375 1381 #else 1376 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1377 #endif 1378 1379 1380 1381 Bool interLayerPredLayerIdcPresentFlag = false; 1382 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1383 #endif 1384 1385 1386 1387 Bool interLayerPredLayerIdcPresentFlag = false; 1382 1388 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 ) 1383 { 1384 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1389 { 1390 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1385 1391 if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 ) 1386 1392 { 1387 1393 if ( !vps->getMaxOneActiveRefLayerFlag() ) 1388 { 1389 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1394 { 1395 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1390 1396 } 1391 1397 #if NH_3D … … 1394 1400 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 1395 1401 #endif 1396 { 1397 interLayerPredLayerIdcPresentFlag = true; 1402 { 1403 interLayerPredLayerIdcPresentFlag = true; 1398 1404 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 1399 1405 { 1400 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1406 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1401 1407 } 1402 1408 } … … 1405 1411 if ( !interLayerPredLayerIdcPresentFlag ) 1406 1412 { 1407 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1413 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1408 1414 { 1409 1415 pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) ); … … 1412 1418 1413 1419 1414 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1415 1420 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1421 1416 1422 #if NH_3D 1417 1423 if ( m_pcEncTop->decProcAnnexI() ) 1418 { 1419 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1424 { 1425 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1420 1426 if ( pcSlice->getInCmpPredAvailFlag() ) 1421 { 1422 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1427 { 1428 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1423 1429 } 1424 1430 else … … 1434 1440 printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) ); 1435 1441 } 1436 1442 1437 1443 exit(EXIT_FAILURE); 1438 1444 } 1439 1445 } 1440 pcSlice->init3dToolParameters(); 1441 pcSlice->checkInCompPredRefLayers(); 1442 } 1446 pcSlice->init3dToolParameters(); 1447 pcSlice->checkInCompPredRefLayers(); 1448 } 1443 1449 #if NH_3D_IV_MERGE 1444 1450 // This needs to be done after initialization of 3D tool parameters. … … 1447 1453 #endif 1448 1454 1449 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1455 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1450 1456 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); 1451 1457 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); … … 1456 1462 1457 1463 pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 1458 1459 1460 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1464 1465 1466 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1461 1467 #else 1462 1468 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); … … 1464 1470 #endif 1465 1471 // Set reference list 1466 #if NH_MV 1467 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1472 #if NH_MV 1473 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1468 1474 #else 1469 1475 pcSlice->setRefPicList ( rcListPic ); … … 1477 1483 #endif 1478 1484 #if NH_3D_IC 1479 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1480 pcSlice->setICEnableNum( m_aICEnableNum ); 1485 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1486 pcSlice->setICEnableNum( m_aICEnableNum ); 1481 1487 #endif 1482 1488 … … 1485 1491 if ( pcSlice->getSliceType() == B_SLICE ) 1486 1492 { 1487 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1488 { 1489 pcSlice->setSliceType( P_SLICE ); 1493 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1494 { 1495 pcSlice->setSliceType( P_SLICE ); 1490 1496 } 1491 1497 } … … 1566 1572 1567 1573 #if NH_3D_VSO 1568 // Should be moved to TEncTop !!! 1574 // Should be moved to TEncTop !!! 1569 1575 Bool bUseVSO = m_pcEncTop->getUseVSO(); 1570 1571 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1576 1577 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1572 1578 1573 1579 pcRdCost->setUseVSO( bUseVSO ); … … 1725 1731 #endif 1726 1732 #if NH_3D 1727 pcSlice->setDepthToDisparityLUTs(); 1733 pcSlice->setDepthToDisparityLUTs(); 1728 1734 1729 1735 #endif … … 1835 1841 xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice); 1836 1842 1843 #if NH_MV_SEI 1844 m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice ); 1845 #endif 1846 1837 1847 /* use the main bitstream buffer for storing the marshalled picture */ 1838 1848 m_pcEntropyCoder->setBitstream(NULL); … … 1980 1990 cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled()); 1981 1991 #if NH_3D 1982 pcPic->compressMotion(2); 1992 pcPic->compressMotion(2); 1983 1993 #else 1984 1994 pcPic->compressMotion(); … … 2055 2065 pcPic->setReconMark ( true ); 2056 2066 #if NH_MV 2057 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2058 std::vector<Int> temp; 2059 TComSlice::markCurrPic( pcPic ); 2067 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2068 std::vector<Int> temp; 2069 TComSlice::markCurrPic( pcPic ); 2060 2070 #endif 2061 2071 m_bFirst = false; … … 2094 2104 //-- all 2095 2105 #if NH_MV 2096 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2106 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2097 2107 #else 2098 2108 printf( "\n\nSUMMARY --------------------------------------------------------\n" ); … … 2402 2412 #if H_3D_VSO_SYNTH_DIST_OUT 2403 2413 } 2404 #endif 2405 #endif 2414 #endif 2415 #endif 2406 2416 /* calculate the size of the access unit, excluding: 2407 2417 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,) … … 2526 2536 2527 2537 #if NH_MV 2528 assert( 0 ); // Field coding and MV need to be aligned. 2538 assert( 0 ); // Field coding and MV need to be aligned. 2529 2539 #else 2530 2540 … … 2969 2979 #if NH_MV 2970 2980 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid ) 2971 { 2972 2981 { 2982 2973 2983 if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 ) 2974 2984 { 2975 2985 return; 2976 2986 } 2977 2987 2978 2988 GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid ); 2979 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2980 2981 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2982 2983 // GT: check if SliceType should be checked here. 2989 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2990 2991 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2992 2993 // GT: check if SliceType should be checked here. 2984 2994 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1 2985 2995 { 2986 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2987 2996 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2997 2988 2998 Int finalIdxToTempIdxMap[16]; 2989 2999 for( Int k = 0; k < 16; k++ ) … … 2999 3009 // get position in temp. list 3000 3010 Int refPicLayerId = pcSlice->getRefPicLayerId(k); 3001 Int idxInTempList = 0; 3011 Int idxInTempList = 0; 3002 3012 for (; idxInTempList < numPicsInTempList; idxInTempList++) 3003 3013 { 3004 3014 if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId ) 3005 3015 { 3006 break; 3016 break; 3007 3017 } 3008 3018 } 3009 3019 3010 3020 Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ]; 3011 3012 // Add negative from behind 3013 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3014 3021 3022 // Add negative from behind 3023 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3024 3015 3025 Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ; 3016 3026 if ( curIsModified ) 3017 3027 { 3018 isModified = true; 3028 isModified = true; 3019 3029 assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position 3020 3030 } 3021 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3031 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3022 3032 } 3023 3033 } 3024 3034 3025 3035 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 3026 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3036 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3027 3037 3028 3038 if( isModified ) 3029 3039 { 3030 3040 Int refIdx = 0; 3031 3041 3032 3042 for( Int i = 0; i < numPicsInFinalRefList; i++ ) 3033 3043 { 3034 if( finalIdxToTempIdxMap[i] >= 0 ) 3044 if( finalIdxToTempIdxMap[i] >= 0 ) 3035 3045 { 3036 3046 refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] ); … … 3042 3052 while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId()) ) 3043 3053 { 3044 refIdx++; 3054 refIdx++; 3045 3055 } 3046 3056 refPicListModification->setRefPicSetIdxL( li, i, refIdx );
Note: See TracChangeset for help on using the changeset viewer.