Changeset 70 in 3DVCSoftware for branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder
- Timestamp:
- 3 Jun 2012, 21:48:11 (13 years ago)
- Location:
- branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/NALwrite.cpp
r56 r70 64 64 #endif 65 65 66 #if VIDYO_VPS_INTEGRATION 67 bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id 68 bsNALUHeader.write(nalu.m_layerId + 1, 5); // layer_id_plus1 69 #else 66 70 #if H0388 67 71 bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id … … 90 94 } 91 95 #endif 96 #endif 97 92 98 out.write(bsNALUHeader.getByteStream(), bsNALUHeader.getByteStreamLength()); 93 99 … … 201 207 naluDest.m_nalRefIDC = naluSrc.m_nalRefIDC; 202 208 #endif 209 #if !VIDYO_VPS_INTEGRATION 203 210 naluDest.m_viewId = naluSrc.m_viewId; 204 211 naluDest.m_isDepth = naluSrc.m_isDepth; 212 #endif 205 213 naluDest.m_temporalId = naluSrc.m_temporalId; 214 #if VIDYO_VPS_INTEGRATION 215 naluDest.m_layerId = naluSrc.m_layerId; 216 #else 217 206 218 #if !H0388 207 219 naluDest.m_OutputFlag = naluSrc.m_OutputFlag; 208 220 #endif 221 #endif 209 222 naluDest.m_Bitstream = naluSrc.m_Bitstream; 210 223 } -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/NALwrite.h
r56 r70 62 62 NalRefIdc nalRefIDC, 63 63 #endif 64 #if VIDYO_VPS_INTEGRATION 65 unsigned layerId, 66 #else 64 67 Int viewId, 65 68 Bool isDepth, 69 #endif 66 70 unsigned temporalID = 0) 67 71 #if NAL_REF_FLAG 72 #if VIDYO_VPS_INTEGRATION 73 : NALUnit(nalUnitType, nalRefFlag, layerId, temporalID) 74 #else 68 75 : NALUnit(nalUnitType, nalRefFlag, viewId, isDepth, temporalID) 76 #endif 77 #else 78 #if VIDYO_VPS_INTEGRATION 79 : NALUnit(nalUnitType, nalRefIDC, layerId, temporalID) 69 80 #else 70 81 : NALUnit(nalUnitType, nalRefIDC, viewId, isDepth, temporalID) 82 #endif 71 83 #endif 72 84 , m_Bitstream() -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncCavlc.cpp
r56 r70 375 375 } 376 376 377 #if VIDYO_VPS_INTEGRATION 378 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 379 { 380 WRITE_CODE( pcVPS->getMaxTLayers() - 1, 3, "max_temporal_layers_minus1" ); 381 WRITE_CODE( pcVPS->getMaxLayers() - 1, 5, "max_layers_minus1" ); 382 WRITE_FLAG( pcVPS->getTemporalNestingFlag() - 1, "temporal_id_nesting_flag" ); 383 WRITE_UVLC( pcVPS->getVPSId(), "video_parameter_set_id" ); 384 for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++) 385 { 386 WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i), "max_dec_pic_buffering[i]" ); 387 WRITE_UVLC( pcVPS->getNumReorderPics(i), "num_reorder_pics[i]" ); 388 WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i), "max_latency_increase[i]" ); 389 } 390 391 WRITE_CODE( 1, 1, "bit_equal_to_one" ); 392 393 if( pcVPS->getMaxLayers() - 1 > 0 ) 394 { 395 WRITE_UVLC( pcVPS->getExtensionType(), "extension_type" ); 396 397 if( pcVPS->getExtensionType() == 0) 398 WRITE_SVLC( pcVPS->getViewOrderIdx(0), "view_order_idx[0]" ); 399 400 for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++) 401 { 402 WRITE_FLAG( pcVPS->getDependentFlag(i), "dependent_flag[i]" ); 403 if( pcVPS->getDependentFlag(i) ) 404 { 405 WRITE_UVLC( i - pcVPS->getDependentLayer(i) - 1, "delta_reference_layer_id_minus1[i]" ); 406 if( pcVPS->getExtensionType() == VPS_EXTENSION_TYPE_MULTI_VIEW ) 407 { 408 WRITE_UVLC( pcVPS->getViewId(i), "view_id[i]" ); 409 WRITE_FLAG( pcVPS->getDepthFlag(i), "depth_flag[i]" ); 410 WRITE_SVLC( pcVPS->getViewOrderIdx(i), "view_order_idx[i]" ); 411 } 412 413 } 414 } 415 } 416 417 WRITE_FLAG( 0, "vps_extension_flag" ); 418 419 //future extensions here.. 420 421 return; 422 } 423 #endif 424 377 425 #if HHI_MPI 378 426 Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth ) … … 388 436 WRITE_CODE( pcSPS->getLevelIdc (), 8, "level_idc" ); 389 437 WRITE_UVLC( pcSPS->getSPSId (), "seq_parameter_set_id" ); 438 #if VIDYO_VPS_INTEGRATION 439 WRITE_UVLC( pcSPS->getVPSId (), "video_parameter_set_id" ); 440 #endif 390 441 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); 391 442 WRITE_CODE( pcSPS->getMaxTLayers() - 1, 3, "max_temporal_layers_minus1" ); -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncCavlc.h
r56 r70 113 113 UInt getNumberOfWrittenBits() { return m_pcBitIf->getNumberOfWrittenBits(); } 114 114 UInt getCoeffCost () { return m_uiCoeffCost; } 115 115 116 #if VIDYO_VPS_INTEGRATION 117 Void codeVPS ( TComVPS* pcVPS ); 118 #endif 119 116 120 #if HHI_MPI 117 121 Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ); -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncCfg.h
r56 r70 290 290 #endif 291 291 292 #if VIDYO_VPS_INTEGRATION 293 UInt m_layerId; 294 #endif 295 292 296 Int m_viewId; 293 297 Bool m_isDepth; … … 765 769 Int getTSIG() { return m_signHidingThreshold; } 766 770 #endif 767 771 #if VIDYO_VPS_INTEGRATION 772 Void setLayerId ( UInt layerId ) { m_layerId = layerId; } 773 UInt getLayerId () { return m_layerId; } 774 #endif 775 768 776 Void setViewId ( Int viewId ) { m_viewId = viewId; } 769 777 Int getViewId () { return m_viewId; } -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncEntropy.cpp
r62 r70 121 121 } 122 122 123 #if VIDYO_VPS_INTEGRATION 124 Void TEncEntropy::encodeVPS( TComVPS* pcVPS ) 125 { 126 m_pcEntropyCoderIf->codeVPS( pcVPS ); 127 return; 128 } 129 #endif 130 131 #if VIDYO_VPS_INTEGRATION 132 Void codeVPS ( TComVPS* pcVPS ); 133 #endif 134 123 135 #if HHI_MPI 124 136 Void TEncEntropy::encodeSPS( TComSPS* pcSPS, Bool bIsDepth ) -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncEntropy.h
r56 r70 76 76 virtual UInt getCoeffCost () = 0; 77 77 78 #if VIDYO_VPS_INTEGRATION 79 virtual Void codeVPS ( TComVPS* pcVPS ) = 0; 80 #endif 81 78 82 #if HHI_MPI 79 83 virtual Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ) = 0; … … 229 233 230 234 public: 235 #if VIDYO_VPS_INTEGRATION 236 Void encodeVPS ( TComVPS* pcVPS); 237 #endif 231 238 // SPS 232 239 #if HHI_MPI -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncGOP.cpp
r69 r70 809 809 if ( m_bSeqFirst ) 810 810 { 811 #if VIDYO_VPS_INTEGRATION 812 { 813 OutputNALUnit nalu(NAL_UNIT_VPS, true, m_pcEncTop->getLayerId()); 814 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 815 m_pcEntropyCoder->encodeVPS(m_pcEncTop->getEncTop()->getVPS()); 816 writeRBSPTrailingBits(nalu.m_Bitstream); 817 accessUnit.push_back(new NALUnitEBSP(nalu)); 818 } 819 #endif 811 820 #if NAL_REF_FLAG 821 #if VIDYO_VPS_INTEGRATION 822 OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getLayerId()); 823 #else 812 824 OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 825 #endif 813 826 #else 814 827 OutputNALUnit nalu(NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); … … 827 840 828 841 #if NAL_REF_FLAG 842 #if VIDYO_VPS_INTEGRATION 843 nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getLayerId()); 844 #else 829 845 nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 846 #endif 830 847 #else 831 848 nalu = NALUnit(NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); … … 954 971 #if H0388 955 972 #if NAL_REF_FLAG 956 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(), m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 957 #else 958 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 959 #endif 960 #else 961 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer(), true); 962 #endif 973 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(), 974 #if !VIDYO_VPS_INTEGRATION 975 m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 976 #else 977 m_pcEncTop->getLayerId(), pcSlice->getTLayer() ); 978 #endif 979 #else 980 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, 981 #if !VIDYO_VPS_INTEGRATION 982 m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 983 #else 984 m_pcEncTop->getLayerId(), pcSlice->getTLayer() ); 985 #endif 986 #endif 987 #else 988 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, 989 #if !VIDYO_VPS_INTEGRATION 990 m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer(), true ); 991 #else 992 m_pcEncTop->getLayerId(), pcSlice->getTLayer(), true ); 993 #endif 994 995 #endif 996 963 997 Bool bEntropySlice = (!pcSlice->isNextSlice()); 964 998 if (!bEntropySlice) … … 1414 1448 { 1415 1449 #if NAL_REF_FLAG 1450 #if VIDYO_VPS_INTEGRATION 1451 OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getLayerId()); 1452 #else 1416 1453 OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 1454 #endif 1417 1455 #else 1418 1456 OutputNALUnit nalu(NAL_UNIT_APS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); … … 1476 1514 1477 1515 #if NAL_REF_FLAG 1516 #if VIDYO_VPS_INTEGRATION 1517 OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getLayerId()); 1518 #else 1478 1519 OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 1520 #endif 1479 1521 #else 1480 1522 OutputNALUnit nalu(NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncSbac.cpp
r58 r70 342 342 } 343 343 344 #if VIDYO_VPS_INTEGRATION 345 Void TEncSbac::codeVPS( TComVPS* pcVPS ) 346 { 347 assert (0); 348 return; 349 } 350 #endif 351 344 352 #if HHI_MPI 345 353 Void TEncSbac::codeSPS( TComSPS* pcSPS, Bool bIsDepth ) -
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncSbac.h
r56 r70 98 98 //--SBAC RD 99 99 100 #if VIDYO_VPS_INTEGRATION 101 Void codeVPS ( TComVPS* pcVPS ); 102 #endif 103 100 104 #if HHI_MPI 101 105 Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth );
Note: See TracChangeset for help on using the changeset viewer.