Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
- Timestamp:
- 7 Apr 2015, 17:05:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1133 r1179 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 4, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 39 39 #include "SEIread.h" 40 40 #include "TDecSlice.h" 41 41 #if H_3D_ANNEX_SELECTION_FIX 42 #include "TDecTop.h" 43 #endif 42 44 //! \ingroup TLibDecoder 43 45 //! \{ … … 91 93 TDecCavlc::TDecCavlc() 92 94 { 95 #if !HHI_CAM_PARA_K0052 93 96 #if H_3D 94 97 m_aaiTempScale = new Int* [ MAX_NUM_LAYERS ]; … … 100 103 } 101 104 #endif 105 #endif 102 106 } 103 107 104 108 TDecCavlc::~TDecCavlc() 105 109 { 110 #if !HHI_CAM_PARA_K0052 106 111 #if H_3D 107 112 for( UInt uiVId = 0; uiVId < MAX_NUM_LAYERS; uiVId++ ) … … 112 117 delete [] m_aaiTempScale; 113 118 delete [] m_aaiTempOffset; 119 #endif 114 120 #endif 115 121 } … … 777 783 assert(uiCode <= 3); 778 784 // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream 785 #if !H_3D_DISABLE_CHROMA 779 786 assert (uiCode == 1); 787 #endif 780 788 if( uiCode == 3 ) 781 789 { … … 1040 1048 READ_FLAG( uiCode, "qt_pred_flag" ); sps3dExt->setQtPredFlag( d, uiCode == 1 ); 1041 1049 READ_FLAG( uiCode, "inter_sdc_flag" ); sps3dExt->setInterSdcFlag( d, uiCode == 1 ); 1050 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 1051 READ_FLAG( uiCode, "intra_skip_flag" ); sps3dExt->setDepthIntraSkipFlag( d, uiCode == 1 ); 1052 #else 1042 1053 READ_FLAG( uiCode, "intra_single_flag" ); sps3dExt->setIntraSingleFlag( d, uiCode == 1 ); 1054 #endif 1043 1055 } 1044 1056 } … … 1051 1063 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 ); 1052 1064 READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 ); 1065 #if FIX_TICKET_95 1066 if (pcPPS->getPpsInferScalingListFlag()) 1067 { 1053 1068 READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode ); 1069 } 1070 #else 1071 READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode ); 1072 #endif 1054 1073 1055 1074 UInt numRefLocOffsets;; … … 1317 1336 } 1318 1337 1338 #if HHI_INTER_COMP_PRED_K0052 1339 #if H_3D 1340 pcVPS->initViewCompLayer( ); 1341 #endif 1342 #endif 1319 1343 1320 1344 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 1466 1490 for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1467 1491 { 1468 1492 READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode ); 1469 1493 } 1470 1494 } … … 1905 1929 Void TDecCavlc::parseVPS3dExtension( TComVPS* pcVPS ) 1906 1930 { 1931 #if HHI_CAM_PARA_K0052 1932 UInt uiCode; 1933 READ_UVLC( uiCode, "cp_precision"); pcVPS->setCpPrecision( uiCode ) ; 1934 1935 for (Int n = 1; n < pcVPS->getNumViews(); n++) 1936 { 1937 Int i = pcVPS->getViewOIdxList( n ); 1938 Int iInVps = pcVPS->getVoiInVps( i ); 1939 READ_CODE( 6, uiCode, "num_cp" ); pcVPS->setNumCp( iInVps, uiCode ); 1940 1941 if( pcVPS->getNumCp( iInVps ) > 0 ) 1942 { 1943 READ_FLAG( uiCode, "cp_in_slice_segment_header_flag" ); pcVPS->setCpInSliceSegmentHeaderFlag( iInVps, uiCode == 1 ); 1944 for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ ) 1945 { 1946 READ_UVLC( uiCode, "cp_ref_voi" ); pcVPS->setCpRefVoi( iInVps, m, uiCode ); 1947 if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) ) 1948 { 1949 Int j = pcVPS->getCpRefVoi( iInVps, m ); 1950 Int jInVps = pcVPS->getVoiInVps( j ); 1951 Int iCode; 1952 READ_SVLC( iCode, "vps_cp_scale" ); pcVPS->setVpsCpScale ( iInVps, jInVps, iCode ); 1953 READ_SVLC( iCode, "vps_cp_off" ); pcVPS->setVpsCpOff ( iInVps, jInVps, iCode ); 1954 READ_SVLC( iCode, "vps_cp_inv_scale_plus_scale" ); pcVPS->setVpsCpInvScale( iInVps, jInVps, iCode - pcVPS->getVpsCpScale( iInVps, jInVps ) ); 1955 READ_SVLC( iCode, "vps_cp_inv_off_plus_off" ); pcVPS->setVpsCpInvOff ( iInVps, jInVps, iCode - pcVPS->getVpsCpOff ( iInVps, jInVps ) ); 1956 } 1957 } 1958 } 1959 } 1960 pcVPS->deriveCpPresentFlag(); 1961 #else 1907 1962 UInt uiCode; 1908 1909 1963 1910 1964 UInt uiCamParPrecision = 0; … … 1955 2009 } 1956 2010 } 2011 #endif 1957 2012 } 1958 2013 #endif … … 2015 2070 #endif 2016 2071 rpcSlice->setSPS(sps); 2072 #if !HHI_INTER_COMP_PRED_K0052 2017 2073 #if H_3D 2018 2074 rpcSlice->init3dToolParameters(); 2075 #endif 2019 2076 #endif 2020 2077 rpcSlice->setPPS(pps); … … 2108 2165 } 2109 2166 // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present 2167 2168 #if H_3D_DISABLE_CHROMA 2169 assert (sps->getChromaFormatIdc() == 1 || rpcSlice->getIsDepth() ); 2170 assert (sps->getChromaFormatIdc() == 0 || !rpcSlice->getIsDepth() ); 2171 #else 2110 2172 assert (sps->getChromaFormatIdc() == 1 ); 2173 #endif 2111 2174 // if( separate_colour_plane_flag == 1 ) 2112 2175 // colour_plane_id u(2) … … 2405 2468 } 2406 2469 } 2470 #if HHI_INTER_COMP_PRED_K0052 2471 #if H_3D 2472 if ( getDecTop()->decProcAnnexI() ) 2473 { 2474 rpcSlice->deriveInCmpPredAndCpAvailFlag(); 2475 if ( rpcSlice->getInCmpPredAvailFlag() ) 2476 { 2477 READ_FLAG(uiCode, "in_comp_pred_flag"); rpcSlice->setInCompPredFlag((Bool)uiCode); 2478 } 2479 rpcSlice->init3dToolParameters(); 2480 } 2481 #endif 2482 #endif 2407 2483 #endif 2408 2484 if(sps->getUseSAO()) 2409 2485 { 2410 2486 READ_FLAG(uiCode, "slice_sao_luma_flag"); rpcSlice->setSaoEnabledFlag((Bool)uiCode); 2487 #if H_3D_DISABLE_CHROMA 2488 if( rpcSlice->getSPS()->getChromaFormatIdc() != 0 ) 2489 { 2411 2490 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 2491 } 2492 else 2493 { 2494 rpcSlice->setSaoEnabledFlagChroma( false ); 2495 } 2496 2497 #else 2498 READ_FLAG(uiCode, "slice_sao_chroma_flag"); rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode); 2499 #endif 2412 2500 } 2413 2501 … … 2574 2662 } 2575 2663 #if H_3D_IC 2664 #if H_3D_ANNEX_SELECTION_FIX 2665 else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) 2666 && !rpcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 2667 && getDecTop()->decProcAnnexI() 2668 ) 2669 #else 2576 2670 else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 ) 2671 #endif 2577 2672 { 2578 2673 UInt uiCodeTmp = 0; … … 2671 2766 rpcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false); 2672 2767 2768 #if HHI_CAM_PARA_K0052 2769 #if H_3D 2770 if ( getDecTop()->decProcAnnexI() ) 2771 { 2772 Int voiInVps = vps->getVoiInVps( rpcSlice->getViewIndex() ); 2773 if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !rpcSlice->getIsDepth() ) 2774 { 2775 for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ ) 2776 { 2777 Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m )); 2778 READ_SVLC( iCode, "cp_scale" ); rpcSlice->setCpScale ( jInVps, iCode ); 2779 READ_SVLC( iCode, "cp_off" ); rpcSlice->setCpOff ( jInVps, iCode ); 2780 READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); rpcSlice->setCpInvScale( jInVps, iCode - rpcSlice->getCpScale ( jInVps )); 2781 READ_SVLC( iCode, "cp_inv_off_plus_off" ); rpcSlice->setCpInvOff ( jInVps, iCode - rpcSlice->getCpOff ( jInVps )); 2782 } 2783 } 2784 } 2785 #endif 2786 #endif 2673 2787 } 2674 2788 … … 2694 2808 } 2695 2809 2810 #if !HHI_CAM_PARA_K0052 2696 2811 #if H_3D 2697 2812 #if H_3D_FCO … … 2711 2826 rpcSlice->setCamparaSlice( m_aaiTempScale, m_aaiTempOffset ); 2712 2827 } 2828 #endif 2713 2829 #endif 2714 2830 … … 2984 3100 assert(0); 2985 3101 } 3102 3103 #if SEC_DEPTH_INTRA_SKIP_MODE_K0033 3104 Void TDecCavlc::parseDIS( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 3105 { 3106 assert(0); 3107 } 3108 #else 2986 3109 #if H_3D_SINGLE_DEPTH 2987 3110 Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) … … 2990 3113 } 2991 3114 #endif 3115 #endif 3116 2992 3117 Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 2993 3118 { … … 3145 3270 { 3146 3271 wpScalingParam *wp; 3272 #if H_3D_DISABLE_CHROMA 3273 Bool bChroma = ( pcSlice->getSPS()->getChromaFormatIdc() != 0 ); 3274 #else 3147 3275 Bool bChroma = true; // color always present in HEVC ? 3276 #endif 3148 3277 SliceType eSliceType = pcSlice->getSliceType(); 3149 3278 Int iNbRef = (eSliceType == B_SLICE ) ? (2) : (1); 3150 3279 UInt uiLog2WeightDenomLuma, uiLog2WeightDenomChroma; 3151 3280 UInt uiTotalSignalledWeightFlags = 0; 3152 3281 3153 3282 Int iDeltaDenom; 3154 3283 // decode delta_luma_log2_weight_denom : … … 3162 3291 uiLog2WeightDenomChroma = (UInt)(iDeltaDenom + uiLog2WeightDenomLuma); 3163 3292 } 3293 else 3294 { 3295 // For some reasons this is also needed to fix a compiler warning when H_3D_DISABLE_CHROMA is equal to 0. 3296 uiLog2WeightDenomChroma = 0; 3297 } 3298 3164 3299 3165 3300 for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ )
Note: See TracChangeset for help on using the changeset viewer.