Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.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/TLibEncoder/TEncCavlc.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 *
     
    4040#include "SEIwrite.h"
    4141#include "../TLibCommon/TypeDef.h"
    42 
     42#if H_3D_ANNEX_SELECTION_FIX
     43#include "TEncTop.h"
     44#endif
    4345//! \ingroup TLibEncoder
    4446//! \{
     47
    4548
    4649#if ENC_DEC_TRACE
     
    678681#endif
    679682  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
     683#if !H_3D_DISABLE_CHROMA
    680684  assert(pcSPS->getChromaFormatIdc () == 1);
     685#endif
    681686  // in the first version chroma_format_idc can only be equal to 1 (4:2:0)
    682687  if( pcSPS->getChromaFormatIdc () == 3 )
     
    857862  WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
    858863  WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" );
     864#if FIX_TICKET_95
     865  if (pcPPS->getPpsInferScalingListFlag())
     866  {
     867    WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
     868  }
     869#else   
    859870  WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
     871#endif
    860872  WRITE_UVLC( 0, "num_ref_loc_offsets" );
    861873  WRITE_FLAG( 0 , "colour_mapping_enabled_flag" );
     
    889901      WRITE_FLAG( sps3dExt->getQtPredFlag( d ) ? 1 : 0 , "qt_pred_flag" );
    890902      WRITE_FLAG( sps3dExt->getInterSdcFlag( d ) ? 1 : 0 , "inter_sdc_flag" );
     903#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     904      WRITE_FLAG( sps3dExt->getDepthIntraSkipFlag( d ) ? 1 : 0 , "intra_skip_flag" );
     905#else
    891906      WRITE_FLAG( sps3dExt->getIntraSingleFlag( d ) ? 1 : 0 , "intra_single_flag" );
     907#endif
    892908    }
    893909  }
     
    13651381  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
    13661382  { 
    1367   WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
    1368 
    1369   if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
    1370   {
    1371     WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
    1372   }
    1373   WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
    1374   WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
     1383    WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 
     1384
     1385    if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     1386    {
     1387      WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
     1388    }
     1389    WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
     1390    WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
    13751391  }
    13761392  else
     
    15981614Void TEncCavlc::codeVPS3dExtension( TComVPS* pcVPS )
    15991615{
     1616#if HHI_CAM_PARA_K0052
     1617  WRITE_UVLC( pcVPS->getCpPrecision( ), "cp_precision" );
     1618  for (Int n = 1; n < pcVPS->getNumViews(); n++)
     1619  {
     1620    Int i      = pcVPS->getViewOIdxList( n );
     1621    Int iInVps = pcVPS->getVoiInVps( i );
     1622    WRITE_CODE( pcVPS->getNumCp( iInVps ), 6, "num_cp" );
     1623
     1624    if( pcVPS->getNumCp( iInVps ) > 0 )
     1625    {
     1626      WRITE_FLAG( pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) ? 1 : 0 , "cp_in_slice_segment_header_flag" );
     1627      for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ )
     1628      {
     1629        WRITE_UVLC( pcVPS->getCpRefVoi( iInVps, m ), "cp_ref_voi" );
     1630        if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) )
     1631        {
     1632          Int j      = pcVPS->getCpRefVoi( iInVps, m );
     1633          Int jInVps = pcVPS->getVoiInVps( j );
     1634          WRITE_SVLC( pcVPS->getVpsCpScale   ( iInVps, jInVps ), "vps_cp_scale" );
     1635          WRITE_SVLC( pcVPS->getVpsCpOff     ( iInVps, jInVps ), "vps_cp_off" );
     1636          WRITE_SVLC( pcVPS->getVpsCpInvScale( iInVps, jInVps ) + pcVPS->getVpsCpScale( iInVps, jInVps ), "vps_cp_inv_scale_plus_scale" );
     1637          WRITE_SVLC( pcVPS->getVpsCpInvOff  ( iInVps, jInVps ) + pcVPS->getVpsCpOff  ( iInVps, jInVps ), "vps_cp_inv_off_plus_off" );
     1638        }
     1639      }
     1640    }
     1641  } 
     1642#else
    16001643  WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
    16011644  for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
     
    16171660    }
    16181661  }
     1662#endif
    16191663}
    16201664#endif
     
    17211765
    17221766    // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present
     1767#if H_3D_DISABLE_CHROMA
     1768    assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 || pcSlice->getIsDepth() );
     1769    assert (pcSlice->getSPS()->getChromaFormatIdc() == 0 || !pcSlice->getIsDepth() );
     1770#else
    17231771    assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 );
     1772#endif
    17241773    // if( separate_colour_plane_flag  ==  1 )
    17251774    //   colour_plane_id                                      u(2)
     
    18951944    }
    18961945#endif
     1946
     1947#if HHI_INTER_COMP_PRED_K0052
     1948#if H_3D     
     1949  if( getEncTop()->decProcAnnexI() )
     1950  {
     1951      if ( pcSlice->getInCmpPredAvailFlag() )
     1952      {
     1953        WRITE_FLAG( pcSlice->getInCompPredFlag(), "in_comp_pred_flag" );
     1954      }
     1955  }
     1956#endif
     1957#endif
    18971958    if(pcSlice->getSPS()->getUseSAO())
    18981959    {
     
    19001961      {
    19011962         WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" );
     1963#if H_3D_DISABLE_CHROMA
     1964         if ( !pcSlice->getIsDepth() )
     1965         {
    19021966         WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
     1967      }
     1968#else
     1969         WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
     1970#endif
    19031971      }
    19041972    }
     
    20182086    }
    20192087#if H_3D_IC
     2088#if H_3D_ANNEX_SELECTION_FIX
     2089    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE )
     2090      && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0
     2091      && getEncTop()->decProcAnnexI()       
     2092      )
     2093#else
    20202094    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 )
     2095#endif
    20212096    {
    20222097      WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
     
    20732148      WRITE_FLAG(pcSlice->getLFCrossSliceBoundaryFlag()?1:0, "slice_loop_filter_across_slices_enabled_flag");
    20742149    }
    2075   }
     2150#if HHI_CAM_PARA_K0052
     2151#if H_3D
     2152    if (getEncTop()->decProcAnnexI() )
     2153    {
     2154      Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() );
     2155      if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !pcSlice->getIsDepth() )
     2156      {
     2157        for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ )
     2158        {
     2159          Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m ));
     2160          WRITE_SVLC( pcSlice->getCpScale   ( jInVps )   , "cp_scale" );
     2161          WRITE_SVLC( pcSlice->getCpOff     ( jInVps )   , "cp_off" );
     2162          WRITE_SVLC( pcSlice->getCpInvScale( jInVps ) + pcSlice->getCpScale( jInVps ) , "cp_inv_scale_plus_scale" );
     2163          WRITE_SVLC( pcSlice->getCpInvOff  ( jInVps ) + pcSlice->getCpOff  ( jInVps ) , "cp_inv_off_plus_off" );
     2164        }
     2165      }
     2166    }
     2167#endif
     2168#endif
     2169  }
     2170
     2171#if !HHI_CAM_PARA_K0052 
    20762172#if H_3D
    20772173#if H_3D_FCO
     
    20892185    }
    20902186  }
     2187#endif
    20912188#endif
    20922189
     
    24352532  assert(0);
    24362533}
     2534
     2535#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2536Void TEncCavlc::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2537{
     2538  assert(0);
     2539}
     2540#else
    24372541#if H_3D_SINGLE_DEPTH
    24382542Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    24412545}
    24422546#endif
     2547#endif
     2548
    24432549Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24442550{
     
    25442650{
    25452651  wpScalingParam  *wp;
     2652#if  H_3D_DISABLE_CHROMA
     2653  Bool            bChroma     = !pcSlice->getIsDepth(); // color always present in HEVC ?
     2654#else
    25462655  Bool            bChroma     = true; // color always present in HEVC ?
     2656#endif
    25472657  Int             iNbRef       = (pcSlice->getSliceType() == B_SLICE ) ? (2) : (1);
    25482658  Bool            bDenomCoded  = false;
Note: See TracChangeset for help on using the changeset viewer.