Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp


Ignore:
Timestamp:
7 Apr 2015, 17:05:30 (9 years ago)
Author:
tech
Message:

Merged branch 13.1-dev0@1178.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1133 r1179  
    44* granted under this license. 
    55*
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77* All rights reserved.
    88*
     
    3939#include "SEIread.h"
    4040#include "TDecSlice.h"
    41 
     41#if H_3D_ANNEX_SELECTION_FIX
     42#include "TDecTop.h"
     43#endif
    4244//! \ingroup TLibDecoder
    4345//! \{
     
    9193TDecCavlc::TDecCavlc()
    9294{
     95#if !HHI_CAM_PARA_K0052
    9396#if H_3D
    9497  m_aaiTempScale            = new Int* [ MAX_NUM_LAYERS ];
     
    100103  }
    101104#endif
     105#endif
    102106}
    103107
    104108TDecCavlc::~TDecCavlc()
    105109{
     110#if !HHI_CAM_PARA_K0052
    106111#if H_3D
    107112  for( UInt uiVId = 0; uiVId < MAX_NUM_LAYERS; uiVId++ )
     
    112117  delete [] m_aaiTempScale;
    113118  delete [] m_aaiTempOffset;
     119#endif
    114120#endif
    115121}
     
    777783    assert(uiCode <= 3);
    778784    // 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
    779786    assert (uiCode == 1);
     787#endif
    780788    if( uiCode == 3 )
    781789    {
     
    10401048      READ_FLAG( uiCode, "qt_pred_flag" ); sps3dExt->setQtPredFlag( d, uiCode == 1 );
    10411049      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
    10421053      READ_FLAG( uiCode, "intra_single_flag" ); sps3dExt->setIntraSingleFlag( d, uiCode == 1 );
     1054#endif
    10431055    }
    10441056  }
     
    10511063  READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
    10521064  READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 );
     1065#if FIX_TICKET_95
     1066  if (pcPPS->getPpsInferScalingListFlag())
     1067  {
    10531068  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
    10541073
    10551074  UInt numRefLocOffsets;;
     
    13171336  }
    13181337
     1338#if HHI_INTER_COMP_PRED_K0052
     1339#if H_3D
     1340  pcVPS->initViewCompLayer( );
     1341#endif
     1342#endif
    13191343
    13201344  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     
    14661490    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 1 : 0; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    14671491    {
    1468         READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
     1492      READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
    14691493    }
    14701494  }
     
    19051929Void TDecCavlc::parseVPS3dExtension( TComVPS* pcVPS )
    19061930{
     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
    19071962  UInt uiCode;
    1908 
    19091963
    19101964  UInt uiCamParPrecision = 0;
     
    19552009    }
    19562010  }
     2011#endif
    19572012}
    19582013#endif
     
    20152070#endif
    20162071  rpcSlice->setSPS(sps);
     2072#if !HHI_INTER_COMP_PRED_K0052
    20172073#if H_3D
    20182074  rpcSlice->init3dToolParameters();
     2075#endif
    20192076#endif
    20202077  rpcSlice->setPPS(pps);
     
    21082165    }
    21092166    // 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
    21102172    assert (sps->getChromaFormatIdc() == 1 );
     2173#endif
    21112174    // if( separate_colour_plane_flag  ==  1 )
    21122175    //   colour_plane_id                                      u(2)
     
    24052468      }
    24062469    }
     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
    24072483#endif
    24082484    if(sps->getUseSAO())
    24092485    {
    24102486      READ_FLAG(uiCode, "slice_sao_luma_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
     2487#if H_3D_DISABLE_CHROMA
     2488      if( rpcSlice->getSPS()->getChromaFormatIdc() != 0 )
     2489      {
    24112490      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
    24122500    }
    24132501
     
    25742662    }
    25752663#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
    25762670    else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 )
     2671#endif
    25772672    {
    25782673      UInt uiCodeTmp = 0;
     
    26712766    rpcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false);
    26722767
     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
    26732787  }
    26742788 
     
    26942808  }
    26952809
     2810#if !HHI_CAM_PARA_K0052
    26962811#if H_3D
    26972812#if H_3D_FCO
     
    27112826    rpcSlice->setCamparaSlice( m_aaiTempScale, m_aaiTempOffset );
    27122827  }
     2828#endif
    27132829#endif
    27142830
     
    29843100  assert(0);
    29853101}
     3102
     3103#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     3104Void TDecCavlc::parseDIS( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     3105{
     3106  assert(0);
     3107}
     3108#else
    29863109#if H_3D_SINGLE_DEPTH
    29873110Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     
    29903113}
    29913114#endif
     3115#endif
     3116
    29923117Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
    29933118{
     
    31453270{
    31463271  wpScalingParam  *wp;
     3272#if H_3D_DISABLE_CHROMA
     3273  Bool            bChroma     = ( pcSlice->getSPS()->getChromaFormatIdc() != 0 );
     3274#else
    31473275  Bool            bChroma     = true; // color always present in HEVC ?
     3276#endif
    31483277  SliceType       eSliceType  = pcSlice->getSliceType();
    31493278  Int             iNbRef       = (eSliceType == B_SLICE ) ? (2) : (1);
    31503279  UInt            uiLog2WeightDenomLuma, uiLog2WeightDenomChroma;
    31513280  UInt            uiTotalSignalledWeightFlags = 0;
    3152  
     3281
    31533282  Int iDeltaDenom;
    31543283  // decode delta_luma_log2_weight_denom :
     
    31623291    uiLog2WeightDenomChroma = (UInt)(iDeltaDenom + uiLog2WeightDenomLuma);
    31633292  }
     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
    31643299
    31653300  for ( Int iNumRef=0 ; iNumRef<iNbRef ; iNumRef++ )
Note: See TracChangeset for help on using the changeset viewer.