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


Ignore:
Timestamp:
20 Feb 2013, 22:07:43 (12 years ago)
Author:
tech
Message:

Reintegrated branch 5.1-dev0 rev. 295.

File:
1 edited

Legend:

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

    r210 r296  
    169169  assert(m_pcBitstream->getNumBitsLeft() == 8); /* rsbp_trailing_bits */
    170170}
    171 #if RPS_IN_SPS
    172171void TDecCavlc::parseShortTermRefPicSet( TComSPS* sps, TComReferencePictureSet* rps, Int idx )
    173 #else
    174 void TDecCavlc::parseShortTermRefPicSet( TComPPS* pcPPS, TComReferencePictureSet* rps, Int idx )
    175 #endif
    176172{
    177173  UInt code;
     
    184180    Int rIdx =  idx - 1 - code;
    185181    assert (rIdx <= idx && rIdx >= 0);
    186 #if RPS_IN_SPS
    187182    TComReferencePictureSet*   rpsRef = sps->getRPSList()->getReferencePictureSet(rIdx);
    188 #else
    189     TComReferencePictureSet*   rpsRef = pcPPS->getRPSList()->getReferencePictureSet(rIdx);
    190 #endif
    191183    Int k = 0, k0 = 0, k1 = 0;
    192184    READ_CODE(1, bit, "delta_rps_sign"); // delta_RPS_sign
     
    265257  READ_FLAG(uiCode, "aps_scaling_list_data_present_flag"); aps->setScalingListEnabled( (uiCode==1)?true:false );
    266258  READ_FLAG(uiCode, "aps_deblocking_filter_flag");         aps->setLoopFilterOffsetInAPS( (uiCode==1)?true:false );
    267 #if !SAO_UNIT_INTERLEAVING
    268   READ_FLAG(uiCode, "aps_sample_adaptive_offset_flag");    aps->setSaoEnabled( (uiCode==1)?true:false );
    269 #endif
    270 #if !LCU_SYNTAX_ALF
    271   READ_FLAG(uiCode, "aps_adaptive_loop_filter_flag");      aps->setAlfEnabled( (uiCode==1)?true:false );
    272 #endif
    273259  if(aps->getScalingListEnabled())
    274260  {
    275261    parseScalingList( aps->getScalingList() );
    276262  }
    277 #if DBL_CONTROL
    278263  if(aps->getLoopFilterOffsetInAPS())
    279264  {
    280265    xParseDblParam( aps );   
    281266  }
    282 #endif
    283 #if SAO_UNIT_INTERLEAVING
    284267  READ_FLAG(uiCode, "aps_sao_interleaving_flag");      aps->setSaoInterleavingFlag( (uiCode==1)?true:false );
    285268  if(!aps->getSaoInterleavingFlag())
    286269  {
    287270    READ_FLAG(uiCode, "aps_sample_adaptive_offset_flag");      aps->setSaoEnabled( (uiCode==1)?true:false );
    288 #endif
    289271  if(aps->getSaoEnabled())
    290272  {
     
    292274    xParseSaoParam( aps->getSaoParam() );
    293275  }
    294 #if SAO_UNIT_INTERLEAVING
    295   }
    296 #endif
    297 #if LCU_SYNTAX_ALF
     276  }
    298277  READ_FLAG(uiCode, "aps_adaptive_loop_filter_flag");      aps->setAlfEnabled( (uiCode==1)?true:false );
    299 #endif
    300278  if(aps->getAlfEnabled())
    301279  {
    302 #if !LCU_SYNTAX_ALF
    303     aps->getAlfParam()->alf_flag = 1;
    304 #endif
    305280    xParseAlfParam( aps->getAlfParam());
    306281  }
     
    316291}
    317292
    318 #if DBL_CONTROL
    319293Void  TDecCavlc::xParseDblParam       ( TComAPS* aps )
    320294{
     
    333307  }
    334308}
    335 #endif
    336309/** parse SAO parameters
    337310 * \param pSaoParam
     
    341314  UInt uiSymbol;
    342315
    343 #if SAO_UNIT_INTERLEAVING
    344316  int i,j, compIdx;
    345317  int numCuInWidth;
     
    393365    }
    394366  }
    395 #else
    396   if (pSaoParam->bSaoFlag[0])
    397   {
    398     xParseSaoSplitParam (pSaoParam, 0, 0);
    399     xParseSaoOffsetParam(pSaoParam, 0, 0);
    400     READ_FLAG (uiSymbol, "sao_flag_cb");
    401     pSaoParam->bSaoFlag[1] = uiSymbol? true:false;
    402     if (pSaoParam->bSaoFlag[1])
    403     {
    404       xParseSaoSplitParam (pSaoParam, 0, 1);
    405       xParseSaoOffsetParam(pSaoParam, 0, 1);
    406     }
    407 
    408     READ_FLAG (uiSymbol, "sao_flag_cr");
    409     pSaoParam->bSaoFlag[2] = uiSymbol? true:false;
    410     if (pSaoParam->bSaoFlag[2])
    411     {
    412       xParseSaoSplitParam (pSaoParam, 0, 2);
    413       xParseSaoOffsetParam(pSaoParam, 0, 2);
    414     }
    415   }
    416 #endif
    417 }
    418 #if SAO_UNIT_INTERLEAVING
     367}
    419368/** copy SAO parameter
    420369 * \param dst 
     
    584533}
    585534
    586 #else
    587 /** Decode quadtree split flag
    588  * \param  pSaoParam, iPartIdx
    589  */
    590 Void TDecCavlc::xParseSaoSplitParam(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr)
    591 {
    592   UInt uiSymbol;
    593   SAOQTPart*  pSaoPart = NULL;
    594   pSaoPart= &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]);
    595 
    596   if(pSaoPart->PartLevel < pSaoParam->iMaxSplitLevel)
    597   {
    598     READ_FLAG (uiSymbol, "sao_split_flag");
    599     pSaoPart->bSplit = uiSymbol? true:false;
    600     if(pSaoPart->bSplit)
    601     {
    602       for (Int i=0;i<NUM_DOWN_PART;i++)
    603       {
    604         xParseSaoSplitParam(pSaoParam, pSaoPart->DownPartsIdx[i], iYCbCr);
    605       }
    606     }
    607   }
    608   else
    609   {
    610     pSaoPart->bSplit = false;
    611   }
    612 }
    613 
    614 /** Decode SAO for one partition
    615  * \param  pSaoParam, iPartIdx
    616  */
    617 Void TDecCavlc::xParseSaoOffsetParam(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr)
    618 {
    619   UInt uiSymbol;
    620   Int iSymbol; 
    621   SAOQTPart*  pSaoPart = NULL;
    622   pSaoPart = &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]);
    623 
    624   static Int iTypeLength[MAX_NUM_SAO_TYPE] = {
    625     SAO_EO_LEN,
    626     SAO_EO_LEN,
    627     SAO_EO_LEN,
    628     SAO_EO_LEN,
    629     SAO_BO_LEN,
    630     SAO_BO_LEN
    631   }; 
    632   if(!pSaoPart->bSplit)
    633   {
    634     READ_UVLC (uiSymbol, "sao_type_idx");
    635     if (uiSymbol)
    636     {
    637       pSaoPart->iBestType = uiSymbol-1;
    638       pSaoPart->bEnableFlag = true;
    639     }
    640     else
    641     {
    642       pSaoPart->iBestType = -1;
    643       pSaoPart->bEnableFlag = false;
    644     }
    645 
    646     if (pSaoPart->bEnableFlag)
    647     {
    648       pSaoPart->iLength = iTypeLength[pSaoPart->iBestType];
    649       for(Int i=0; i< pSaoPart->iLength; i++)
    650       {
    651         READ_SVLC (iSymbol, "sao_offset");
    652         pSaoPart->iOffset[i] = iSymbol;
    653       }
    654     }
    655     return;
    656   }
    657 
    658   //split
    659   if (pSaoPart->PartLevel < pSaoParam->iMaxSplitLevel)
    660   {
    661     for(Int i=0;i<NUM_DOWN_PART;i++)
    662     {
    663       xParseSaoOffsetParam(pSaoParam, pSaoPart->DownPartsIdx[i], iYCbCr);
    664     }
    665   }
    666 }
    667 #endif
    668 
    669 #if LCU_SYNTAX_ALF
     535
    670536Void TDecCavlc::xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS, Int firstLCUAddr, Bool acrossSlice, Int numLCUInWidth, Int numLCUInHeight)
    671537{
     
    931797}
    932798
    933 #endif
    934799
    935800Void TDecCavlc::xParseAlfParam(ALFParam* pAlfParam)
     
    937802  UInt uiSymbol;
    938803  Int iSymbol;
    939 #if ALF_SINGLE_FILTER_SHAPE
    940804  Int sqrFiltLengthTab[NUM_ALF_FILTER_SHAPE] = {ALF_FILTER_LEN};
    941 #else
    942   Int sqrFiltLengthTab[2] = { 9, 9};
    943 #endif
    944 
    945 #if LCU_SYNTAX_ALF
     805
    946806  switch(pAlfParam->componentID)
    947807  {
     
    961821  case ALF_Y:
    962822    {
    963 #endif
    964823  pAlfParam->filters_per_group = 0;
    965824  memset (pAlfParam->filterPattern, 0 , sizeof(Int)*NO_VAR_BINS);
    966 #if !LCU_SYNTAX_ALF
    967   READ_FLAG (uiSymbol, "alf_region_adaptation_flag");
    968   pAlfParam->alf_pcr_region_flag = uiSymbol; 
    969 #endif
    970 #if ALF_SINGLE_FILTER_SHAPE 
    971825  pAlfParam->filter_shape = 0;
    972 #else
    973   READ_UVLC (uiSymbol, "alf_length_luma_minus_5_div2");
    974   pAlfParam->filter_shape = uiSymbol;
    975 #endif
    976826  pAlfParam->num_coeff = sqrFiltLengthTab[pAlfParam->filter_shape];
    977827
     
    989839  {
    990840    pAlfParam->filters_per_group = 1;
    991 #if LCU_SYNTAX_ALF
    992 #if ALF_16_BA_GROUPS
    993841    Int numMergeFlags = 16;
    994 #else
    995     Int numMergeFlags = 15;
    996 #endif
    997 #else
    998 #if ALF_16_BA_GROUPS
    999     Int numMergeFlags = 16;
    1000 #else
    1001     Int numMergeFlags = pAlfParam->alf_pcr_region_flag ? 16 : 15;
    1002 #endif
    1003 #endif
    1004842    for (Int i=1; i<numMergeFlags; i++)
    1005843    {
     
    1021859  }
    1022860
    1023 #if ALF_SINGLE_FILTER_SHAPE
    1024861  Int minScanVal = MIN_SCAN_POS_CROSS;
    1025 #else
    1026   Int minScanVal = (pAlfParam->filter_shape == ALF_STAR5x5) ? 0: MIN_SCAN_POS_CROSS;
    1027 #endif
    1028862
    1029863  // Determine maxScanVal
     
    1036870
    1037871  // Golomb parameters
    1038 #if LCU_SYNTAX_ALF
    1039872  if( pAlfParam->filters_per_group > 1 )
    1040873  {
    1041 #endif
    1042874  READ_UVLC (uiSymbol, "alf_min_kstart_minus1");
    1043875  pAlfParam->minKStart = 1 + uiSymbol;
     
    1051883    kMin = pAlfParam->kMinTab[scanPos];
    1052884  }
    1053 #if LCU_SYNTAX_ALF
    1054   }
    1055 #endif
     885  }
    1056886
    1057887  Int scanPos;
     
    1061891    {
    1062892      scanPos = pDepthInt[i] - 1;
    1063 #if LCU_SYNTAX_ALF
    1064893      Int k = (pAlfParam->filters_per_group == 1) ? kTableTabShapes[ALF_CROSS9x7_SQUARE3x3][i] : pAlfParam->kMinTab[scanPos];
    1065894      pAlfParam->coeffmulti[idx][i] = xGolombDecode(k);
    1066 #else
    1067       pAlfParam->coeffmulti[idx][i] = xGolombDecode(pAlfParam->kMinTab[scanPos]);
    1068 #endif
    1069     }
    1070   }
    1071 #if LCU_SYNTAX_ALF
     895    }
     896  }
    1072897    }
    1073898    break;
     
    1079904    }
    1080905  }
    1081 #else
    1082   // filter parameters for chroma
    1083   READ_UVLC (uiSymbol, "alf_chroma_idc");
    1084   pAlfParam->chroma_idc = uiSymbol;
    1085 
    1086   if(pAlfParam->chroma_idc)
    1087   {
    1088 
    1089 #if ALF_SINGLE_FILTER_SHAPE
    1090     pAlfParam->filter_shape_chroma  = 0;
    1091 #else
    1092     READ_UVLC (uiSymbol, "alf_length_chroma_minus_5_div2");
    1093 
    1094     pAlfParam->filter_shape_chroma = uiSymbol;
    1095 #endif
    1096     pAlfParam->num_coeff_chroma = sqrFiltLengthTab[pAlfParam->filter_shape_chroma];
    1097     // filter coefficients for chroma
    1098     for(Int pos=0; pos<pAlfParam->num_coeff_chroma; pos++)
    1099     {
    1100       READ_SVLC (iSymbol, "alf_coeff_chroma");
    1101       pAlfParam->coeff_chroma[pos] = iSymbol;
    1102     }
    1103   }
    1104 #endif
    1105906}
    1106907
     
    1137938}
    1138939
    1139 #if TILES_OR_ENTROPY_SYNC_IDC
    1140940Void TDecCavlc::parsePPS(TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet)
    1141 #else
    1142 Void TDecCavlc::parsePPS(TComPPS* pcPPS)
    1143 #endif
    1144941{
    1145942#if ENC_DEC_TRACE 
     
    1150947  Int   iCode;
    1151948
    1152 #if !RPS_IN_SPS
    1153   TComRPSList* rpsList = pcPPS->getRPSList();
    1154 #endif
    1155949  READ_UVLC( uiCode, "pic_parameter_set_id");                      pcPPS->setPPSId (uiCode);
    1156950  READ_UVLC( uiCode, "seq_parameter_set_id");                      pcPPS->setSPSId (uiCode);
    1157951
    1158 #if MULTIBITS_DATA_HIDING
    1159952  READ_FLAG ( uiCode, "sign_data_hiding_flag" ); pcPPS->setSignHideFlag( uiCode );
    1160953  if( pcPPS->getSignHideFlag() )
     
    1162955    READ_CODE( 4, uiCode, "sign_hiding_threshold"); pcPPS->setTSIG(uiCode);
    1163956  }
    1164 #endif
    1165957
    1166958#if CABAC_INIT_FLAG
    1167959  READ_FLAG( uiCode,   "cabac_init_present_flag" );            pcPPS->setCabacInitPresentFlag( uiCode ? true : false );
    1168 #endif
    1169 #if !RPS_IN_SPS
    1170   // RPS is put before entropy_coding_mode_flag
    1171   // since entropy_coding_mode_flag will probably be removed from the WD
    1172   TComReferencePictureSet*      pcRPS;
    1173 
    1174   READ_UVLC( uiCode, "num_short_term_ref_pic_sets" );
    1175   rpsList->create(uiCode);
    1176 
    1177   for(Int i=0; i< rpsList->getNumberOfReferencePictureSets(); i++)
    1178   {
    1179     pcRPS = rpsList->getReferencePictureSet(i);
    1180     parseShortTermRefPicSet(pcPPS,pcRPS,i);
    1181   }
    1182   READ_FLAG( uiCode, "long_term_ref_pics_present_flag" );          pcPPS->setLongTermRefsPresent(uiCode);
    1183960#endif
    1184961  // entropy_coding_mode_flag
     
    1187964  if (pcPPS->getEntropyCodingMode())
    1188965  {
    1189 #if !WPP_SIMPLIFICATION
    1190     READ_UVLC( uiCode, "entropy_coding_synchro" );                 pcPPS->setEntropyCodingSynchro( uiCode );
    1191     READ_FLAG( uiCode, "cabac_istate_reset" );                     pcPPS->setCabacIstateReset( uiCode ? true : false );
    1192 #endif
    1193 #if !TILES_OR_ENTROPY_SYNC_IDC
    1194 #if !WPP_SIMPLIFICATION
    1195     if ( pcPPS->getEntropyCodingSynchro() )
    1196 #endif
    1197     {
    1198       READ_UVLC( uiCode, "num_substreams_minus1" );                pcPPS->setNumSubstreams(uiCode+1);
    1199     }
    1200 #endif
    1201   }
    1202 #if !H0566_TLA
    1203   READ_UVLC( uiCode, "num_temporal_layer_switching_point_flags" ); pcPPS->setNumTLayerSwitchingFlags( uiCode );
    1204   for ( UInt i = 0; i < pcPPS->getNumTLayerSwitchingFlags(); i++ )
    1205   {
    1206     READ_FLAG( uiCode, "temporal_layer_switching_point_flag" );    pcPPS->setTLayerSwitchingFlag( i, uiCode > 0 ? true : false );
    1207   }
    1208 #endif
     966  }
    1209967 
    1210968  // num_ref_idx_l0_default_active_minus1
     
    1241999//printf("TDecCavlc::parsePPS():\tm_bUseWeightPred=%d\tm_uiBiPredIdc=%d\n", pcPPS->getUseWP(), pcPPS->getWPBiPredIdc());
    12421000
    1243 #if H0388
    12441001  READ_FLAG( uiCode, "output_flag_present_flag" );
    12451002  pcPPS->setOutputFlagPresentFlag( uiCode==1 );
    1246 #endif
    1247 
    1248 #if TILES_OR_ENTROPY_SYNC_IDC
     1003
    12491004  if(parameterSet->getPrefetchedSPS(pcPPS->getSPSId())->getTilesOrEntropyCodingSyncIdc()==1)
    12501005  {
    1251 #endif
    12521006    READ_FLAG ( uiCode, "tile_info_present_flag" );
    12531007    pcPPS->setColumnRowInfoPresent(uiCode);
     
    12901044      Int iNumColTilesMinus1 = (pcPPS->getColumnRowInfoPresent() == 1)?(pcPPS->getNumColumnsMinus1()):(pcPPS->getSPS()->getNumColumnsMinus1());
    12911045      Int iNumRowTilesMinus1 = (pcPPS->getColumnRowInfoPresent() == 1)?(pcPPS->getNumColumnsMinus1()):(pcPPS->getSPS()->getNumRowsMinus1());
    1292 #if !REMOVE_TILE_DEPENDENCE
    1293       pcPPS->setTileBoundaryIndependenceIdr( 1 ); //default
    1294 #endif
    12951046      pcPPS->setLFCrossTileBoundaryFlag(true); //default
    12961047
    12971048      if(iNumColTilesMinus1 !=0 || iNumRowTilesMinus1 !=0)
    12981049      {
    1299 #if !REMOVE_TILE_DEPENDENCE
    1300         READ_FLAG ( uiCode, "tile_boundary_independence_flag" ); 
    1301         pcPPS->setTileBoundaryIndependenceIdr( uiCode );
    1302 
    1303         if(pcPPS->getTileBoundaryIndependenceIdr() == 1)
    1304         {
    1305 #endif
    13061050          READ_FLAG ( uiCode, "loop_filter_across_tile_flag" ); 
    13071051          pcPPS->setLFCrossTileBoundaryFlag( (uiCode == 1)?true:false );
    1308 #if !REMOVE_TILE_DEPENDENCE
    1309         }
    1310 #endif
    1311       }
    1312     }
    1313 #if TILES_OR_ENTROPY_SYNC_IDC
     1052      }
     1053    }
    13141054  }
    13151055  else if(parameterSet->getPrefetchedSPS(pcPPS->getSPSId())->getTilesOrEntropyCodingSyncIdc()==2)
     
    13171057    READ_UVLC( uiCode, "num_substreams_minus1" );                pcPPS->setNumSubstreams(uiCode+1);
    13181058  }
    1319 #endif
    1320 
    1321 #if DBL_CONTROL
     1059
    13221060  READ_FLAG( uiCode, "deblocking_filter_control_present_flag" );
    13231061  pcPPS->setDeblockingFilterControlPresent( uiCode ? true : false);
    1324 #endif
    1325 #if PARALLEL_MERGE
    13261062  READ_UVLC( uiCode, "log2_parallel_merge_level_minus2");
    13271063  assert(uiCode == LOG2_PARALLEL_MERGE_LEVEL_MINUS2);
    13281064  pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode);
    1329 #endif
    13301065
    13311066  READ_FLAG( uiCode, "pps_extension_flag");
     
    14581193      }
    14591194    }
     1195#if INTER_VIEW_VECTOR_SCALING_C0115
     1196    READ_FLAG( uiCode,  "inter_view_vector_scaling_flag" );    pcVPS->setIVScalingFlag( uiCode ? true:false);
     1197#endif
    14601198  }
    14611199 
     
    14681206#endif
    14691207#endif
    1470 #if HHI_MPI
     1208#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    14711209Void TDecCavlc::parseSPS(TComSPS* pcSPS, Bool bIsDepth)
    14721210#else
     
    14931231  READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
    14941232  READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
    1495 #if PIC_CROPPING
    14961233  READ_FLAG(     uiCode, "pic_cropping_flag");                   pcSPS->setPicCroppingFlag ( uiCode ? true : false );
    14971234  if (uiCode != 0)
     
    15021239    READ_UVLC(   uiCode, "pic_crop_bottom_offset" );             pcSPS->setPicCropBottomOffset( uiCode );
    15031240  }
    1504 #endif
    15051241
    15061242#if FULL_NBIT
     
    15221258#endif
    15231259
    1524 #if H0736_AVC_STYLE_QP_RANGE
    15251260  pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
    1526 #endif
    15271261
    15281262  g_uiBASE_MAX  = ((1<<(g_uiBitDepth))-1);
     
    15341268#endif
    15351269  READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
    1536 #if H0736_AVC_STYLE_QP_RANGE
    15371270  pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
    1538 #endif
    15391271
    15401272  READ_FLAG( uiCode, "pcm_enabled_flag" ); pcSPS->setUsePCM( uiCode ? true : false );
     
    15511283
    15521284  READ_UVLC( uiCode,    "log2_max_pic_order_cnt_lsb_minus4" );   pcSPS->setBitsForPOC( 4 + uiCode );
    1553 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    15541285  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    15551286  {
     
    15611292    pcSPS->setMaxLatencyIncrease( uiCode, i );
    15621293  }
    1563 #else
    1564   READ_UVLC( uiCode,    "max_num_ref_pics" );                    pcSPS->setMaxNumberOfReferencePictures(uiCode);
    1565   READ_UVLC( uiCode,    "num_reorder_frames" );                  pcSPS->setNumReorderFrames(uiCode);
    1566   READ_UVLC ( uiCode, "max_dec_frame_buffering");
    1567   pcSPS->setMaxDecFrameBuffering( uiCode );
    1568   READ_UVLC ( uiCode, "max_latency_increase");
    1569   pcSPS->setMaxLatencyIncrease( uiCode );
    1570 #endif
    1571 
    1572 #if H0412_REF_PIC_LIST_RESTRICTION
     1294
    15731295  READ_FLAG( uiCode, "restricted_ref_pic_lists_flag" );
    15741296  pcSPS->setRestrictedRefPicListsFlag( uiCode );
     
    15821304    pcSPS->setListsModificationPresentFlag(true);
    15831305  }
    1584 #endif
    15851306  READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" );
    15861307  UInt log2MinCUSize = uiCode + 3;
     
    16251346  READ_FLAG( uiCode, "sample_adaptive_offset_enabled_flag" );       pcSPS->setUseSAO ( uiCode ? true : false ); 
    16261347  READ_FLAG( uiCode, "adaptive_loop_filter_enabled_flag" );         pcSPS->setUseALF ( uiCode ? true : false );
    1627 #if LCU_SYNTAX_ALF
    16281348  if(pcSPS->getUseALF())
    16291349  {
    16301350    READ_FLAG( uiCode, "alf_coef_in_slice_flag" );      pcSPS->setUseALFCoefInSlice ( uiCode ? true : false );
    16311351  }
    1632 #endif
    16331352  if( pcSPS->getUsePCM() )
    16341353  {
     
    16391358
    16401359
    1641 #if RPS_IN_SPS
    16421360  TComRPSList* rpsList = pcSPS->getRPSList();
    16431361  TComReferencePictureSet* rps;
     
    16521370  }
    16531371  READ_FLAG( uiCode, "long_term_ref_pics_present_flag" );          pcSPS->setLongTermRefsPresent(uiCode);
    1654 #endif
    1655 #if !PIC_CROPPING
    1656   //!!!KS: Syntax not in WD !!!
    1657 
    1658   xReadUvlc ( uiCode ); pcSPS->setPadX        ( uiCode    );
    1659   xReadUvlc ( uiCode ); pcSPS->setPadY        ( uiCode    );
    1660 #endif
    16611372 
    16621373  // AMVP mode for each depth (AM_NONE or AM_EXPL)
     
    16671378  }
    16681379
    1669 #if TILES_WPP_ENTRY_POINT_SIGNALLING
    16701380  READ_CODE(2, uiCode, "tiles_or_entropy_coding_sync_idc");         pcSPS->setTilesOrEntropyCodingSyncIdc(uiCode);
    1671 #endif
    1672 
    1673 #if TILES_OR_ENTROPY_SYNC_IDC
     1381
    16741382  if(pcSPS->getTilesOrEntropyCodingSyncIdc() == 1)
    16751383  {
    1676 #endif
    16771384    READ_UVLC ( uiCode, "num_tile_columns_minus1" );
    16781385    pcSPS->setNumColumnsMinus1( uiCode ); 
     
    17011408      free(rowHeight); 
    17021409    }
    1703 #if !REMOVE_TILE_DEPENDENCE
    1704     pcSPS->setTileBoundaryIndependenceIdr( 1 ); //default
    1705 #endif
    17061410    pcSPS->setLFCrossTileBoundaryFlag(true); //default
    17071411
    17081412    if( pcSPS->getNumColumnsMinus1() !=0 || pcSPS->getNumRowsMinus1() != 0)
    17091413    {
    1710 #if !REMOVE_TILE_DEPENDENCE
    1711       READ_FLAG ( uiCode, "tile_boundary_independence_flag" ); 
    1712       pcSPS->setTileBoundaryIndependenceIdr( uiCode );
    1713       if(pcSPS->getTileBoundaryIndependenceIdr() == 1)
    1714       {
    1715 #endif
    17161414        READ_FLAG ( uiCode, "loop_filter_across_tile_flag" ); 
    17171415        pcSPS->setLFCrossTileBoundaryFlag( (uiCode==1)?true:false);
    1718 #if !REMOVE_TILE_DEPENDENCE
    1719       }
    1720 #endif
    1721     }
    1722 #if TILES_OR_ENTROPY_SYNC_IDC
    1723   }
    1724 #endif
     1416    }
     1417  }
    17251418  READ_FLAG( uiCode, "sps_extension_flag");
    17261419#if !QC_MVHEVC_B0046
     
    17991492      pcSPS->setPredDepthMapGeneration( 0, false );
    18001493#endif
    1801 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1494#if H3D_IVRP
    18021495    pcSPS->setMultiviewResPredMode  ( 0 );
    18031496#endif
     
    18141507        pcSPS->setPredDepthMapGeneration( uiCode, true );
    18151508#endif
    1816 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1509#if H3D_IVRP
    18171510      pcSPS->setMultiviewResPredMode  ( 0 );
    18181511#endif
     
    18411534#if DEPTH_MAP_GENERATION
    18421535        UInt uiPredDepthMapGeneration = 0, uiPdmPrecision = 0;
    1843 #if HHI_INTER_VIEW_MOTION_PRED
     1536#if H3D_IVMP
    18441537        UInt uiMultiviewMvPredMode = 0;
    18451538#endif
    1846 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1539#if H3D_IVRP
    18471540      UInt uiMultiviewResPredMode = 0;
    18481541#endif
     
    18561549            READ_SVLC( iCode, "Pdm_offset" );   m_aaiTempPdmOffset       [ uiViewId ][ uiBaseId ] = iCode;
    18571550          }
    1858 #if HHI_INTER_VIEW_MOTION_PRED
     1551#if H3D_IVMP
    18591552          READ_UVLC( uiMultiviewMvPredMode, "multi_view_mv_pred_mode" );
    18601553#endif
    1861 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1554#if H3D_IVRP
    18621555          READ_FLAG( uiMultiviewResPredMode, "multi_view_residual_pred_mode" );
    18631556#endif
    18641557        }
    1865 #if HHI_INTER_VIEW_MOTION_PRED
     1558#if H3D_IVMP
    18661559        pcSPS->setPredDepthMapGeneration( uiViewId, false, uiPredDepthMapGeneration, uiMultiviewMvPredMode, uiPdmPrecision, m_aaiTempPdmScaleNomDelta, m_aaiTempPdmOffset );
    18671560#else
     
    18691562#endif
    18701563#endif
    1871 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1564#if H3D_IVRP
    18721565      pcSPS->setMultiviewResPredMode  ( uiMultiviewResPredMode );
    18731566#endif
     
    18911584}
    18921585
    1893 #if LCU_SYNTAX_ALF
     1586#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     1587Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth)
     1588#else
    18941589Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet)
    1895 #else
    1896 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl)
    18971590#endif
    18981591{
     
    19271620  {
    19281621    UInt uiCodeTmp = 0;
    1929     if ( rpcSlice->getSPS()->getViewId() && !rpcSlice->getSPS()->isDepth() )
     1622    if ( rpcSlice->getSPS()->getViewId()
     1623#if !LGE_ILLUCOMP_DEPTH_C0046
     1624        && !rpcSlice->getSPS()->isDepth()
     1625#endif
     1626        )
    19301627    {
    19311628      READ_FLAG (uiCodeTmp, "applying IC flag");
     
    19771674    rpcSlice->setSPS(sps);
    19781675    rpcSlice->setPPS(pps);
    1979 #if H0388
    19801676    if( pps->getOutputFlagPresentFlag() )
    19811677    {
     
    19871683      rpcSlice->setPicOutputFlag( true );
    19881684    }
    1989 #endif
    19901685#if QC_REM_IDV_B0046
    19911686#if !QC_MVHEVC_B0046
     
    20541749        {
    20551750          rps = rpcSlice->getLocalRPS();
    2056 #if RPS_IN_SPS
    20571751          parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
    2058 #else
    2059           parseShortTermRefPicSet(pps,rps, pps->getRPSList()->getNumberOfReferencePictureSets());
    2060 #endif
    20611752          rpcSlice->setRPS(rps);
    20621753        }
    20631754        else // use reference to short-term reference picture set in PPS
    20641755        {
    2065 #if RPS_IN_SPS
    20661756          READ_UVLC( uiCode, "short_term_ref_pic_set_idx"); rpcSlice->setRPS(sps->getRPSList()->getReferencePictureSet(uiCode));
    2067 #else
    2068           READ_UVLC( uiCode, "short_term_ref_pic_set_idx"); rpcSlice->setRPS(pps->getRPSList()->getReferencePictureSet(uiCode));
    2069 #endif
    20701757          rps = rpcSlice->getRPS();
    20711758        }
    2072 #if RPS_IN_SPS
    20731759        if(sps->getLongTermRefsPresent())
    2074 #else
    2075         if(pps->getLongTermRefsPresent())
    2076 #endif
    20771760        {
    20781761          Int offset = rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures();
    20791762          READ_UVLC( uiCode, "num_long_term_pics");             rps->setNumberOfLongtermPictures(uiCode);
    20801763          Int prev = 0;
    2081 #if LTRP_MULT
    20821764          Int prevMsb=0;
    20831765          Int prevDeltaPocLt=0;
    2084 #endif
    20851766          for(Int j=rps->getNumberOfLongtermPictures()+offset-1 ; j > offset-1; j--)
    20861767          {
     
    20881769            prev += uiCode;
    20891770
    2090 #if LTRP_MULT
    20911771            READ_FLAG(uiCode,"delta_poc_msb_present_flag");
    20921772            Int decDeltaPOCMsbPresent=uiCode;
     
    21091789            else
    21101790            {
    2111 #endif
    21121791              rps->setPOC(j,rpcSlice->getPOC()-prev);         
    21131792              rps->setDeltaPOC(j,-(Int)prev);
    2114 #if LTRP_MULT
    21151793            }
    21161794            prevDeltaPocLt=prev;
    2117 #endif
    21181795            READ_FLAG( uiCode, "used_by_curr_pic_lt_flag");     rps->setUsed(j,uiCode);
    21191796          }
     
    21341811      if (sps->getUseSAO())
    21351812      {
    2136 #if SAO_UNIT_INTERLEAVING
    21371813        READ_FLAG(uiCode, "slice_sao_interleaving_flag");        rpcSlice->setSaoInterleavingFlag(uiCode);
    2138 #endif
    21391814        READ_FLAG(uiCode, "slice_sample_adaptive_offset_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
    2140 #if SAO_UNIT_INTERLEAVING
    21411815        if (rpcSlice->getSaoEnabledFlag() && rpcSlice->getSaoInterleavingFlag())
    21421816        {
     
    21491823          rpcSlice->setSaoEnabledFlagCr(0);
    21501824        }
    2151 #endif
    21521825      }
    21531826      READ_UVLC (    uiCode, "aps_id" );  rpcSlice->setAPSId(uiCode);
     
    21771850    if( !rpcSlice->isIntra() )
    21781851    {
    2179 #if H0412_REF_PIC_LIST_RESTRICTION
    21801852#if QC_MVHEVC_B0046
    21811853    if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() )
     
    21881860      else
    21891861      {
    2190 #endif
    21911862        READ_FLAG( uiCode, "ref_pic_list_modification_flag_l0" ); refPicListModification->setRefPicListModificationFlagL0( uiCode ? 1 : 0 );
    2192 #if H0412_REF_PIC_LIST_RESTRICTION
    2193       }
    2194 #endif
     1863      }
    21951864     
    21961865      if(refPicListModification->getRefPicListModificationFlagL0())
     
    21981867        uiCode = 0;
    21991868        Int i = 0;
    2200 #if H0137_0138_LIST_MODIFICATION
    22011869        Int NumPocTotalCurr = rpcSlice->getNumPocTotalCurrMvc();
    22021870        if ( NumPocTotalCurr > 1 )
     
    22211889          }
    22221890        }
    2223 #else
    2224         Int list_modification_idc = 0;
    2225         while(list_modification_idc != 3) 
    2226         {
    2227           READ_UVLC( uiCode, "list_modification_idc" ); refPicListModification->setListIdcL0(i, uiCode );
    2228           list_modification_idc = uiCode;
    2229           if(uiCode != 3)
    2230           {
    2231             READ_UVLC( uiCode, "ref_pic_set_idx" ); refPicListModification->setRefPicSetIdxL0(i, uiCode );
    2232           }
    2233           i++;
    2234         }
    2235         refPicListModification->setNumberOfRefPicListModificationsL0(i-1);
    2236 #endif
    2237       }
    2238 #if !H0137_0138_LIST_MODIFICATION
    2239       else
    2240       {
    2241         refPicListModification->setNumberOfRefPicListModificationsL0(0);
    2242       }
    2243 #endif
     1891      }
    22441892    }
    22451893    else
    22461894    {
    22471895      refPicListModification->setRefPicListModificationFlagL0(0);
    2248 #if !H0137_0138_LIST_MODIFICATION
    2249       refPicListModification->setNumberOfRefPicListModificationsL0(0);
    2250 #endif
    22511896    }
    22521897    if(rpcSlice->isInterB())
    22531898    {
    2254 #if H0412_REF_PIC_LIST_RESTRICTION
    22551899#if QC_MVHEVC_B0046
    22561900    if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() )
     
    22631907      else
    22641908      {
    2265 #endif
    22661909        READ_FLAG( uiCode, "ref_pic_list_modification_flag_l1" ); refPicListModification->setRefPicListModificationFlagL1( uiCode ? 1 : 0 );
    2267 #if H0412_REF_PIC_LIST_RESTRICTION
    2268       }
    2269 #endif
     1910      }
    22701911      if(refPicListModification->getRefPicListModificationFlagL1())
    22711912      {
    22721913        uiCode = 0;
    22731914        Int i = 0;
    2274 #if H0137_0138_LIST_MODIFICATION
    22751915        Int NumPocTotalCurr = rpcSlice->getNumPocTotalCurrMvc();
    22761916        if ( NumPocTotalCurr > 1 )
     
    22951935          }
    22961936        }
    2297 #else
    2298         Int list_modification_idc = 0;
    2299         while(list_modification_idc != 3) 
    2300         {
    2301           READ_UVLC( uiCode, "list_modification_idc" ); refPicListModification->setListIdcL1(i, uiCode );
    2302           list_modification_idc = uiCode;
    2303           if(uiCode != 3)
    2304           {
    2305             READ_UVLC( uiCode, "ref_pic_set_idx" ); refPicListModification->setRefPicSetIdxL1(i, uiCode );
    2306           }
    2307           i++;
    2308         }
    2309         refPicListModification->setNumberOfRefPicListModificationsL1(i-1);
    2310 #endif
    2311       }
    2312 #if !H0137_0138_LIST_MODIFICATION
    2313       else
    2314       {
    2315         refPicListModification->setNumberOfRefPicListModificationsL1(0);
    2316       }
    2317 #endif
     1937      }
    23181938    } 
    23191939    else
    23201940    {
    23211941      refPicListModification->setRefPicListModificationFlagL1(0);
    2322 #if !H0137_0138_LIST_MODIFICATION
    2323       refPicListModification->setNumberOfRefPicListModificationsL1(0);
    2324 #endif
    23251942    }
    23261943  }
     
    23401957      READ_UVLC( uiCode, "num_ref_idx_lc_active_minus1" );      rpcSlice->setNumRefIdx( REF_PIC_LIST_C, uiCode + 1 );
    23411958     
    2342 #if H0412_REF_PIC_LIST_RESTRICTION
    23431959#if QC_MVHEVC_B0046
    23441960    if( rpcSlice->getViewId() && rpcSlice->getSPS()->getListsModificationPresentFlag() )
     
    23471963#endif
    23481964      {
    2349 #endif
    23501965        READ_FLAG( uiCode, "ref_pic_list_modification_flag_lc" ); rpcSlice->setRefPicListModificationFlagLC( uiCode ? 1 : 0 );
    23511966        if(uiCode)
     
    23551970            READ_FLAG( uiCode, "pic_from_list_0_flag" );
    23561971            rpcSlice->setListIdFromIdxOfLC(i, uiCode);
    2357 #if H0137_0138_LIST_MODIFICATION
    23581972          if (((rpcSlice->getListIdFromIdxOfLC(i) == REF_PIC_LIST_0) && (rpcSlice->getNumRefIdx( REF_PIC_LIST_0 ) == 1)) || ((rpcSlice->getListIdFromIdxOfLC(i) == REF_PIC_LIST_1) && (rpcSlice->getNumRefIdx( REF_PIC_LIST_1 ) == 1)) )
    23591973          {
     
    23641978            READ_UVLC( uiCode, "ref_idx_list_curr" );
    23651979          }
    2366 #else
    2367             READ_UVLC( uiCode, "ref_idx_list_curr" );
    2368 #endif
    23691980            rpcSlice->setRefIdxFromIdxOfLC(i, uiCode);
    23701981            rpcSlice->setRefIdxOfLC((RefPicList)rpcSlice->getListIdFromIdxOfLC(i), rpcSlice->getRefIdxFromIdxOfLC(i), i);
    23711982          }
    23721983        }
    2373 #if H0412_REF_PIC_LIST_RESTRICTION
    23741984      }
    23751985      else
     
    23771987        rpcSlice->setRefPicListModificationFlagLC(false);
    23781988      }
    2379 #endif
    23801989    }
    23811990    else
     
    23901999  }
    23912000 
    2392 #if H0111_MVD_L1_ZERO
    23932001  if (rpcSlice->isInterB())
    23942002  {
    23952003    READ_FLAG( uiCode, "mvd_l1_zero_flag" );       rpcSlice->setMvdL1ZeroFlag( (uiCode ? true : false) );
    23962004  }
    2397 #endif
    23982005
    23992006#if CABAC_INIT_FLAG
     
    24212028    rpcSlice->setSliceQp (26 + pps->getPicInitQPMinus26() + iCode);
    24222029
    2423 #if H0736_AVC_STYLE_QP_RANGE
    24242030    assert( rpcSlice->getSliceQp() >= -sps->getQpBDOffsetY() );
    24252031    assert( rpcSlice->getSliceQp() <=  51 );
    2426 #endif
    2427 
    2428 #if DBL_CONTROL
     2032
    24292033    if (rpcSlice->getPPS()->getDeblockingFilterControlPresent())
    24302034    {
     
    24362040        rpcSlice->setInheritDblParamFromAPS(0);
    24372041      }
    2438 #else
    2439     READ_FLAG ( uiCode, "inherit_dbl_param_from_APS_flag" ); rpcSlice->setInheritDblParamFromAPS(uiCode ? 1 : 0);
    2440 #endif
    24412042      if(!rpcSlice->getInheritDblParamFromAPS())
    24422043      {
     
    24482049        }
    24492050      }
    2450 #if DBL_CONTROL
    24512051   }
    2452 #endif
    24532052    if ( rpcSlice->getSliceType() == B_SLICE )
    24542053    {
     
    24902089  }
    24912090
    2492 #if ( HHI_MPI || HHI_INTER_VIEW_MOTION_PRED )
    2493   #if ( HHI_MPI && HHI_INTER_VIEW_MOTION_PRED )
     2091#if ( HHI_MPI || H3D_IVMP )
     2092  #if ( HHI_MPI && H3D_IVMP )
    24942093  const int iExtraMergeCandidates = ( sps->getUseMVI() || sps->getMultiviewMvPredMode() ) ? 1 : 0;
    24952094  #elif HHI_MPI
    24962095  const int iExtraMergeCandidates = sps->getUseMVI() ? 1 : 0;
     2096  #elif MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     2097  const int iExtraMergeCandidates = (  (isDepth || sps->getMultiviewMvPredMode()) ) ? 1 : 0;   
    24972098  #else
    24982099  const int iExtraMergeCandidates = sps->getMultiviewMvPredMode() ? 1 : 0;
     
    25182119
    25192120      Int uiNumCUsInFrame = uiNumLCUsInWidth* uiNumLCUsInHeight;
    2520 #if LCU_SYNTAX_ALF
    25212121      if(sps->getUseALFCoefInSlice())
    25222122      {
     
    25312131      if(!sps->getUseALFCoefInSlice())
    25322132      {
    2533 #endif
    25342133      xParseAlfCuControlParam(alfCUCtrl, uiNumCUsInFrame);
    2535 #if LCU_SYNTAX_ALF
    2536       }
    2537 #endif
     2134      }
    25382135
    25392136    }
     
    25442141  if (!bEntropySlice)
    25452142  {
    2546 #if !REMOVE_TILE_DEPENDENCE
    2547     if (sps->getTileBoundaryIndependenceIdr())
    2548     {   
    2549 #endif
    25502143    xReadCode(1, uiCode); // read flag indicating if tile markers transmitted
    25512144    rpcSlice->setTileMarkerFlag( uiCode );
    2552 #if !REMOVE_TILE_DEPENDENCE
    2553     }
    2554 #endif
    2555   }
    2556 
    2557 #if TILES_WPP_ENTRY_POINT_SIGNALLING
     2145  }
     2146
    25582147  Int tilesOrEntropyCodingSyncIdc = rpcSlice->getSPS()->getTilesOrEntropyCodingSyncIdc();
    25592148  UInt *entryPointOffset          = NULL;
     
    26162205    delete [] entryPointOffset;
    26172206  }
    2618 #else
    2619 #if WPP_SIMPLIFICATION
    2620   if (pps->getNumSubstreams() > 1)
    2621 #else
    2622   if (pps->getEntropyCodingSynchro())
    2623 #endif
    2624   {
    2625     UInt uiNumSubstreams = pps->getNumSubstreams();
    2626     rpcSlice->allocSubstreamSizes(uiNumSubstreams);
    2627     UInt *puiSubstreamSizes = rpcSlice->getSubstreamSizes();
    2628 
    2629     for (UInt ui = 0; ui+1 < uiNumSubstreams; ui++)
    2630     {
    2631       xReadCode(2, uiCode);
    2632      
    2633       switch ( uiCode )
    2634       {
    2635       case 0:
    2636         xReadCode(8,  uiCode);
    2637         break;
    2638       case 1:
    2639         xReadCode(16, uiCode);
    2640         break;
    2641       case 2:
    2642         xReadCode(24, uiCode);
    2643         break;
    2644       case 3:
    2645         xReadCode(32, uiCode);
    2646         break;
    2647       default:
    2648         printf("Error in parseSliceHeader\n");
    2649         exit(-1);
    2650         break;
    2651       }
    2652       puiSubstreamSizes[ui] = uiCode;
    2653     }
    2654   }
    2655 #endif
    26562207
    26572208  if (!bEntropySlice)
    26582209  {
    26592210    // Reading location information
    2660 #if !REMOVE_TILE_DEPENDENCE
    2661     if (sps->getTileBoundaryIndependenceIdr())
    2662     {   
    2663 #endif
    2664 #if !TILES_WPP_ENTRY_POINT_SIGNALLING
    2665       xReadCode(1, uiCode); // read flag indicating if location information signaled in slice header
    2666       Bool bTileLocationInformationInSliceHeaderFlag = (uiCode)? true : false;
    2667 
    2668       if (bTileLocationInformationInSliceHeaderFlag)
    2669       {
    2670         // location count
    2671         xReadCode(5, uiCode); // number of tiles for which location information signaled
    2672         rpcSlice->setTileLocationCount ( uiCode + 1 );
    2673 
    2674         xReadCode(5, uiCode); // number of bits used by diff
    2675         Int iBitsUsedByDiff = uiCode + 1;
    2676 
    2677         // read out tile start location
    2678         Int iLastSize = 0;
    2679         for (UInt uiIdx=0; uiIdx<rpcSlice->getTileLocationCount(); uiIdx++)
    2680         {
    2681           Int iAbsDiff, iCurSize, iCurDiff;
    2682           if (uiIdx==0)
    2683           {
    2684             xReadCode(iBitsUsedByDiff-1, uiCode); iAbsDiff  = uiCode;
    2685             rpcSlice->setTileLocation( uiIdx, iAbsDiff );
    2686             iCurDiff  = iAbsDiff;
    2687             iLastSize = iAbsDiff;
    2688           }
    2689           else
    2690           {
    2691             xReadCode(1, uiCode); // read sign
    2692             Int iSign = (uiCode) ? -1 : +1;
    2693 
    2694             xReadCode(iBitsUsedByDiff-1, uiCode); iAbsDiff  = uiCode;
    2695             iCurDiff  = (iSign) * iAbsDiff;
    2696             iCurSize  = iLastSize + iCurDiff;
    2697             iLastSize = iCurSize;
    2698             rpcSlice->setTileLocation( uiIdx, rpcSlice->getTileLocation( uiIdx-1 ) + iCurSize ); // calculate byte location
    2699           }
    2700         }
    2701       }
    2702 #endif
    27032211
    27042212      // read out trailing bits
    27052213    m_pcBitstream->readOutTrailingBits();
    2706 #if !REMOVE_TILE_DEPENDENCE
    2707     }
    2708 #endif
    27092214  }
    27102215  return;
     
    27672272#endif
    27682273
    2769 #if HHI_INTER_VIEW_MOTION_PRED
     2274#if H3D_IVMP
    27702275Void TDecCavlc::parseMVPIdx( Int& riMVPIdx, Int iAMVPCands )
    27712276#else
     
    28012306Void TDecCavlc::parseIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    28022307{
    2803 #if BURST_IPCM
    28042308  assert(0);
    2805 #else
    2806   UInt uiSymbol;
    2807 
    2808   xReadFlag( uiSymbol );
    2809 
    2810   if ( uiSymbol )
    2811   {
    2812     Bool bIpcmFlag   = true;
    2813 
    2814     xReadPCMAlignZero();
    2815 
    2816     pcCU->setPartSizeSubParts  ( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    2817     pcCU->setSizeSubParts      ( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
    2818     pcCU->setIPCMFlagSubParts  ( bIpcmFlag, uiAbsPartIdx, uiDepth );
    2819 
    2820     UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
    2821     UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
    2822     UInt uiChromaOffset = uiLumaOffset>>2;
    2823 
    2824     Pel* piPCMSample;
    2825     UInt uiWidth;
    2826     UInt uiHeight;
    2827     UInt uiSampleBits;
    2828     UInt uiX, uiY;
    2829 
    2830     piPCMSample = pcCU->getPCMSampleY() + uiLumaOffset;
    2831     uiWidth = pcCU->getWidth(uiAbsPartIdx);
    2832     uiHeight = pcCU->getHeight(uiAbsPartIdx);
    2833     uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthLuma();
    2834 
    2835     for(uiY = 0; uiY < uiHeight; uiY++)
    2836     {
    2837       for(uiX = 0; uiX < uiWidth; uiX++)
    2838       {
    2839         UInt uiSample;
    2840         xReadCode(uiSampleBits, uiSample);
    2841 
    2842         piPCMSample[uiX] = uiSample;
    2843       }
    2844       piPCMSample += uiWidth;
    2845     }
    2846 
    2847     piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
    2848     uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
    2849     uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;
    2850     uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();
    2851 
    2852     for(uiY = 0; uiY < uiHeight; uiY++)
    2853     {
    2854       for(uiX = 0; uiX < uiWidth; uiX++)
    2855       {
    2856         UInt uiSample;
    2857         xReadCode(uiSampleBits, uiSample);
    2858         piPCMSample[uiX] = uiSample;
    2859       }
    2860       piPCMSample += uiWidth;
    2861     }
    2862 
    2863     piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset;
    2864     uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
    2865     uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;
    2866     uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();
    2867 
    2868     for(uiY = 0; uiY < uiHeight; uiY++)
    2869     {
    2870       for(uiX = 0; uiX < uiWidth; uiX++)
    2871       {
    2872         UInt uiSample;
    2873         xReadCode(uiSampleBits, uiSample);
    2874         piPCMSample[uiX] = uiSample;
    2875       }
    2876       piPCMSample += uiWidth;
    2877     }
    2878   }
    2879 #endif
    28802309}
    28812310
     
    29072336Void TDecCavlc::parseDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    29082337{
    2909 #if H0736_AVC_STYLE_QP_RANGE
    29102338  Int qp;
    2911 #else
    2912   UInt uiQp;
    2913 #endif
    29142339  Int  iDQp;
    29152340 
    29162341  xReadSvlc( iDQp );
    29172342
    2918 #if H0736_AVC_STYLE_QP_RANGE
    29192343  Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY();
    29202344  qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) -  qpBdOffsetY;
    2921 #else
    2922   uiQp = pcCU->getRefQP( uiAbsPartIdx ) + iDQp;
    2923 #endif
    29242345
    29252346  UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)))<<(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)) ;
    29262347  UInt uiQpCUDepth =   min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ;
    29272348
    2928 #if H0736_AVC_STYLE_QP_RANGE
    29292349  pcCU->setQPSubParts( qp, uiAbsQpCUPartIdx, uiQpCUDepth );
    2930 #else
    2931   pcCU->setQPSubParts( uiQp, uiAbsQpCUPartIdx, uiQpCUDepth );
    2932 #endif
    29332350}
    29342351
     
    29642381}
    29652382
    2966 #if HHI_INTER_VIEW_RESIDUAL_PRED
     2383#if H3D_IVRP
    29672384Void
    29682385TDecCavlc::parseResPredFlag( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth )
     
    33942811          READ_UVLC( code, "scaling_list_pred_matrix_id_delta");
    33952812          scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code+1)));
    3396 #if SCALING_LIST
    33972813          if( sizeId > SCALING_LIST_8x8 )
    33982814          {
    33992815            scalingList->setScalingListDC(sizeId,listId,scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)));
    34002816          }
    3401 #endif
    34022817          scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId));
    34032818         
     
    34202835Void TDecCavlc::xDecodeScalingList(TComScalingList *scalingList, UInt sizeId, UInt listId)
    34212836{
    3422 #if SCALING_LIST
    34232837  Int i,coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]);
    34242838  Int data;
     
    34602874    }
    34612875  }
    3462 #else
    3463   Int i,coefNum = g_scalingListSize[sizeId];
    3464   Int data;
    3465   Int nextCoef = SCALING_LIST_START_VALUE;
    3466   UInt* scan  = g_auiFrameScanXY [ sizeId + 1 ];
    3467   Int *dst = scalingList->getScalingListAddress(sizeId, listId);
    3468 
    3469   for(i = 0; i < coefNum; i++)
    3470   {
    3471     READ_SVLC( data, "scaling_list_delta_coef");
    3472     nextCoef = (nextCoef + data + 256 ) % 256;
    3473     dst[scan[i]] = nextCoef;
    3474   }
    3475 #endif
    34762876}
    34772877
Note: See TracChangeset for help on using the changeset viewer.