Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.cpp


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

Reintegrated branch 5.1-dev0 rev. 295.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r210 r296  
    161161  //DF flag
    162162  WRITE_FLAG(pcAPS->getLoopFilterOffsetInAPS()?1:0, "aps_deblocking_filter_flag");
    163 #if !SAO_UNIT_INTERLEAVING
    164   //SAO flag
    165   WRITE_FLAG( pcAPS->getSaoEnabled()?1:0, "aps_sample_adaptive_offset_flag");
    166 #endif
    167 #if !LCU_SYNTAX_ALF
    168   //ALF flag
    169   WRITE_FLAG( pcAPS->getAlfEnabled()?1:0, "aps_adaptive_loop_filter_flag");
    170 #endif
    171 }
    172 #if LCU_SYNTAX_ALF
     163}
    173164Void TEncCavlc::codeAPSAlflag(UInt uiCode)
    174165{
    175166  WRITE_FLAG(uiCode, "aps_adaptive_loop_filter_flag");
    176167}
    177 #endif
    178168
    179169Void TEncCavlc::codeDFFlag(UInt uiCode, const Char *pSymbolName)
     
    186176}
    187177
    188 #if RPS_IN_SPS
    189178Void TEncCavlc::codeShortTermRefPicSet( TComSPS* pcSPS, TComReferencePictureSet* rps )
    190 #else
    191 Void TEncCavlc::codeShortTermRefPicSet( TComPPS* pcPPS, TComReferencePictureSet* rps )
    192 #endif
    193179{
    194180#if PRINT_RPS_INFO
     
    245231  xTracePPSHeader (pcPPS);
    246232#endif
    247 #if !RPS_IN_SPS
    248   TComRPSList* rpsList = pcPPS->getRPSList();
    249 #endif
    250233 
    251234  WRITE_UVLC( pcPPS->getPPSId(),                             "pic_parameter_set_id" );
    252235  WRITE_UVLC( pcPPS->getSPSId(),                             "seq_parameter_set_id" );
    253236
    254 #if MULTIBITS_DATA_HIDING
    255237  WRITE_FLAG( pcPPS->getSignHideFlag(), "sign_data_hiding_flag" );
    256238  if( pcPPS->getSignHideFlag() )
     
    258240    WRITE_CODE(pcPPS->getTSIG(), 4, "sign_hiding_threshold");
    259241  }
    260 #endif
    261242#if CABAC_INIT_FLAG
    262243  WRITE_FLAG( pcPPS->getCabacInitPresentFlag() ? 1 : 0,   "cabac_init_present_flag" );
    263 #endif
    264 #if !RPS_IN_SPS
    265   // RPS is put before entropy_coding_mode_flag
    266   // since entropy_coding_mode_flag will probably be removed from the WD
    267   TComReferencePictureSet*      rps;
    268 
    269   WRITE_UVLC(rpsList->getNumberOfReferencePictureSets(), "num_short_term_ref_pic_sets" );
    270   for(UInt i=0; i < rpsList->getNumberOfReferencePictureSets(); i++)
    271   {
    272     rps = rpsList->getReferencePictureSet(i);
    273     codeShortTermRefPicSet(pcPPS,rps);
    274   }
    275   WRITE_FLAG( pcPPS->getLongTermRefsPresent() ? 1 : 0,         "long_term_ref_pics_present_flag" );
    276244#endif
    277245  // entropy_coding_mode_flag
     
    280248  if (pcPPS->getEntropyCodingMode())
    281249  {
    282 #if !WPP_SIMPLIFICATION
    283     WRITE_UVLC( pcPPS->getEntropyCodingSynchro(),            "entropy_coding_synchro" );
    284     WRITE_FLAG( pcPPS->getCabacIstateReset() ? 1 : 0,        "cabac_istate_reset" );
    285 #endif
    286 #if !TILES_OR_ENTROPY_SYNC_IDC
    287 #if !WPP_SIMPLIFICATION
    288     if ( pcPPS->getEntropyCodingSynchro() )
    289 #endif
    290     {
    291       WRITE_UVLC( pcPPS->getNumSubstreams()-1,               "num_substreams_minus1" );
    292     }
    293 #endif
    294   }
    295 #if !H0566_TLA
    296   WRITE_UVLC( pcPPS->getNumTLayerSwitchingFlags(),           "num_temporal_layer_switching_point_flags" );
    297   for( UInt i = 0; i < pcPPS->getNumTLayerSwitchingFlags(); i++ )
    298   {
    299     WRITE_FLAG( pcPPS->getTLayerSwitchingFlag( i ) ? 1 : 0 , "temporal_layer_switching_point_flag" );
    300   }
    301 #endif
     250  }
    302251  //   num_ref_idx_l0_default_active_minus1
    303252  //   num_ref_idx_l1_default_active_minus1
     
    313262  WRITE_FLAG( pcPPS->getUseWP() ? 1 : 0,  "weighted_pred_flag" );   // Use of Weighting Prediction (P_SLICE)
    314263  WRITE_CODE( pcPPS->getWPBiPredIdc(), 2, "weighted_bipred_idc" );  // Use of Weighting Bi-Prediction (B_SLICE)
    315 #if H0388
    316264  WRITE_FLAG( pcPPS->getOutputFlagPresentFlag() ? 1 : 0,  "output_flag_present_flag" );
    317 #endif
    318 #if TILES_OR_ENTROPY_SYNC_IDC
    319265  if(pcPPS->getSPS()->getTilesOrEntropyCodingSyncIdc()==1)
    320266  {
    321 #endif
    322267    WRITE_FLAG( pcPPS->getColumnRowInfoPresent(),           "tile_info_present_flag" );
    323268    WRITE_FLAG( pcPPS->getTileBehaviorControlPresentFlag(),  "tile_control_present_flag");
     
    347292      if(iNumColTilesMinus1 !=0 || iNumRowTilesMinus1 !=0)
    348293      {
    349 #if !REMOVE_TILE_DEPENDENCE
    350         WRITE_FLAG( pcPPS->getTileBoundaryIndependenceIdr(),                         "tile_boundary_independence_flag" );
    351         if(pcPPS->getTileBoundaryIndependenceIdr() == 1)
    352         {
    353 #endif
    354294          WRITE_FLAG( pcPPS->getLFCrossTileBoundaryFlag()?1 : 0,            "loop_filter_across_tile_flag");
    355 #if !REMOVE_TILE_DEPENDENCE
    356         }
    357 #endif
    358       }
    359     }
    360 #if TILES_OR_ENTROPY_SYNC_IDC
     295      }
     296    }
    361297  }
    362298  else if(pcPPS->getSPS()->getTilesOrEntropyCodingSyncIdc()==2)
     
    364300    WRITE_UVLC( pcPPS->getNumSubstreams()-1,               "num_substreams_minus1" );
    365301  }
    366 #endif
    367 
    368 #if DBL_CONTROL
     302
    369303  WRITE_FLAG( pcPPS->getDeblockingFilterControlPresent()?1 : 0, "deblocking_filter_control_present_flag");
    370 #endif
    371 #if PARALLEL_MERGE
    372304  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
    373 #endif
    374305  WRITE_FLAG( 0, "pps_extension_flag" );
    375306}
     
    498429      }
    499430    }
     431#if INTER_VIEW_VECTOR_SCALING_C0115
     432      WRITE_FLAG( pcVPS->getIVScalingFlag(),                      "inter_view_vector_scaling_flag" );
     433#endif
    500434  }
    501435 
     
    508442#endif
    509443#endif
    510 #if HHI_MPI
     444#if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
    511445Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
    512446#else
     
    528462  WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (),   "pic_width_in_luma_samples" );
    529463  WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(),   "pic_height_in_luma_samples" );
    530 #if PIC_CROPPING
    531464  WRITE_FLAG( pcSPS->getPicCroppingFlag(),          "pic_cropping_flag" );
    532465  if (pcSPS->getPicCroppingFlag())
     
    537470    WRITE_UVLC( pcSPS->getPicCropBottomOffset(),    "pic_crop_bottom_offset" );
    538471  }
    539 #endif
    540472
    541473#if FULL_NBIT
     
    563495
    564496  WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
    565 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    566497  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    567498  {
     
    570501    WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i),           "max_latency_increase[i]" );
    571502  }
    572 #else
    573   WRITE_UVLC( pcSPS->getMaxNumberOfReferencePictures(), "max_num_ref_pics" );
    574   WRITE_UVLC( pcSPS->getNumReorderFrames(),             "num_reorder_frames" );
    575   WRITE_UVLC(pcSPS->getMaxDecFrameBuffering(),          "max_dec_frame_buffering" );
    576   WRITE_UVLC(pcSPS->getMaxLatencyIncrease(),            "max_latency_increase"    );
    577 #endif
    578503  assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() );
    579504 
     
    586511  }
    587512
    588 #if H0412_REF_PIC_LIST_RESTRICTION
    589513  WRITE_FLAG( pcSPS->getRestrictedRefPicListsFlag(),                                 "restricted_ref_pic_lists_flag" );
    590514  if( pcSPS->getRestrictedRefPicListsFlag() )
     
    592516    WRITE_FLAG( pcSPS->getListsModificationPresentFlag(),                            "lists_modification_present_flag" );
    593517  }
    594 #endif
    595518  WRITE_UVLC( log2MinCUSize - 3,                                                     "log2_min_coding_block_size_minus3" );
    596519  WRITE_UVLC( pcSPS->getMaxCUDepth()-g_uiAddCUDepth,                                 "log2_diff_max_min_coding_block_size" );
     
    618541  WRITE_FLAG( pcSPS->getUseSAO() ? 1 : 0,                                            "sample_adaptive_offset_enabled_flag");
    619542  WRITE_FLAG( pcSPS->getUseALF () ? 1 : 0,                                           "adaptive_loop_filter_enabled_flag");
    620 #if LCU_SYNTAX_ALF
    621543  if(pcSPS->getUseALF())
    622544  {
    623545    WRITE_FLAG( (pcSPS->getUseALFCoefInSlice()) ? 1 : 0,                             "alf_coef_in_slice_flag");
    624546  }
    625 #endif
    626547
    627548  if( pcSPS->getUsePCM() )
     
    634555  WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0,                             "temporal_id_nesting_flag" );
    635556
    636 #if RPS_IN_SPS
    637557  TComRPSList* rpsList = pcSPS->getRPSList();
    638558  TComReferencePictureSet*      rps;
     
    645565  }   
    646566  WRITE_FLAG( pcSPS->getLongTermRefsPresent() ? 1 : 0,         "long_term_ref_pics_present_flag" );
    647 #endif
    648 #if !PIC_CROPPING
    649   //!!!KS: Syntax not in WD !!!
    650  
    651   xWriteUvlc  ( pcSPS->getPad (0) );
    652   xWriteUvlc  ( pcSPS->getPad (1) );
    653 #endif
    654567  // AMVP mode for each depth
    655568  for (Int i = 0; i < pcSPS->getMaxCUDepth(); i++)
     
    658571  }
    659572
    660 #if TILES_WPP_ENTRY_POINT_SIGNALLING
    661573  Int tilesOrEntropyCodingSyncIdc = 0;
    662574  if ( pcSPS->getNumColumnsMinus1() > 0 || pcSPS->getNumRowsMinus1() > 0)
     
    670582  pcSPS->setTilesOrEntropyCodingSyncIdc( tilesOrEntropyCodingSyncIdc );
    671583  WRITE_CODE(tilesOrEntropyCodingSyncIdc, 2, "tiles_or_entropy_coding_sync_idc");
    672 #endif
    673 
    674 #if TILES_OR_ENTROPY_SYNC_IDC
     584
    675585  if(tilesOrEntropyCodingSyncIdc == 1)
    676586  {
    677 #endif
    678587    WRITE_UVLC( pcSPS->getNumColumnsMinus1(),                           "num_tile_columns_minus1" );
    679588    WRITE_UVLC( pcSPS->getNumRowsMinus1(),                              "num_tile_rows_minus1" );
     
    694603    if( pcSPS->getNumColumnsMinus1() !=0 || pcSPS->getNumRowsMinus1() != 0)
    695604    {
    696 #if !REMOVE_TILE_DEPENDENCE
    697       WRITE_FLAG( pcSPS->getTileBoundaryIndependenceIdr(),                "tile_boundary_independence_flag" );
    698       if(pcSPS->getTileBoundaryIndependenceIdr() == 1)
    699       {
    700 #endif
    701605        WRITE_FLAG( pcSPS->getLFCrossTileBoundaryFlag()?1 : 0,            "loop_filter_across_tile_flag");
    702 #if !REMOVE_TILE_DEPENDENCE
    703       }
    704 #endif
    705     }
    706 #if TILES_OR_ENTROPY_SYNC_IDC
    707   }
    708 #endif
     606    }
     607  }
    709608  WRITE_FLAG( 1, "sps_extension_flag" );
    710609#if !QC_MVHEVC_B0046
     
    792691          WRITE_SVLC( pcSPS->getPdmOffset       ()[ uiId ], "Pdm_offset" );
    793692        }
    794 #if HHI_INTER_VIEW_MOTION_PRED
     693#if H3D_IVMP
    795694        WRITE_UVLC( pcSPS->getMultiviewMvPredMode(), "multi_view_mv_pred_mode" );
    796695#endif
    797 #if HHI_INTER_VIEW_RESIDUAL_PRED
     696#if H3D_IVRP
    798697        WRITE_FLAG  ( pcSPS->getMultiviewResPredMode(), "multi_view_residual_pred_mode" );
    799698#endif
     
    866765  if (address==0)
    867766  {
    868     if( pcSlice->getSPS()->getViewId() && !pcSlice->getIsDepth() )
     767    if( pcSlice->getSPS()->getViewId()
     768#if !LGE_ILLUCOMP_DEPTH_C0046
     769        && !pcSlice->getIsDepth()
     770#endif
     771        )
    869772    {
    870773      WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "applying IC flag" );
     
    889792    WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "pic_parameter_set_id" );
    890793#endif
    891 #if H0388
    892794    if( pcSlice->getPPS()->getOutputFlagPresentFlag() )
    893795    {
    894796      WRITE_FLAG( pcSlice->getPicOutputFlag() ? 1 : 0, "pic_output_flag" );
    895797    }
    896 #endif
    897798#if QC_REM_IDV_B0046
    898799    if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && pcSlice->getViewId() == 0)
     
    917818        {
    918819          WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag");
    919 #if RPS_IN_SPS
    920820          codeShortTermRefPicSet(pcSlice->getSPS(), rps);
    921 #else
    922           codeShortTermRefPicSet(pcSlice->getPPS(), rps);
    923 #endif
    924821        }
    925822        else
     
    928825          WRITE_UVLC( pcSlice->getRPSidx(), "short_term_ref_pic_set_idx" );
    929826        }
    930 #if RPS_IN_SPS
    931827        if(pcSlice->getSPS()->getLongTermRefsPresent())
    932 #else
    933         if(pcSlice->getPPS()->getLongTermRefsPresent())
    934 #endif
    935828        {
    936829          WRITE_UVLC( rps->getNumberOfLongtermPictures(), "num_long_term_pics");
    937830          Int maxPocLsb = 1<<pcSlice->getSPS()->getBitsForPOC();
    938831          Int prev = 0;
    939 #if LTRP_MULT
    940832          Int prevDeltaPocLt=0;
    941833          Int currDeltaPocLt=0;
    942 #endif
    943834          for(Int i=rps->getNumberOfPictures()-1 ; i > rps->getNumberOfPictures()-rps->getNumberOfLongtermPictures()-1; i--)
    944835          {
    945836            WRITE_UVLC((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb, "delta_poc_lsb_lt");
    946837         
    947 #if LTRP_MULT
    948838            currDeltaPocLt=((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb)+prevDeltaPocLt;
    949839
     
    976866            }
    977867            prevDeltaPocLt=currDeltaPocLt;
    978 #endif
    979868            prev = rps->getDeltaPOC(i);
    980869            WRITE_FLAG( rps->getUsed(i), "used_by_curr_pic_lt_flag");
     
    988877        {
    989878          WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag");
    990 #if RPS_IN_SPS
    991879          codeShortTermRefPicSet(pcSlice->getSPS(), rps);
    992 #else
    993           codeShortTermRefPicSet(pcSlice->getPPS(), rps);
    994 #endif
    995880        }
    996881        else
     
    999884          WRITE_UVLC( pcSlice->getRPSidx(), "short_term_ref_pic_set_idx" );
    1000885        }
    1001 #if RPS_IN_SPS
    1002886        if(pcSlice->getSPS()->getLongTermRefsPresent())
    1003 #else
    1004         if(pcSlice->getPPS()->getLongTermRefsPresent())
    1005 #endif
    1006887        {
    1007888          WRITE_UVLC( rps->getNumberOfLongtermPictures(), "num_long_term_pics");
    1008889          Int maxPocLsb = 1<<pcSlice->getSPS()->getBitsForPOC();
    1009890          Int prev = 0;
    1010 #if LTRP_MULT
    1011891          Int prevDeltaPocLt=0;
    1012892          Int currDeltaPocLt=0;
    1013 #endif
    1014893          for(Int i=rps->getNumberOfPictures()-1 ; i > rps->getNumberOfPictures()-rps->getNumberOfLongtermPictures()-1; i--)
    1015894          {
    1016895            WRITE_UVLC((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb, "delta_poc_lsb_lt");
    1017896         
    1018 #if LTRP_MULT
    1019897            currDeltaPocLt=((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb)+prevDeltaPocLt;
    1020898
     
    1047925            }
    1048926            prevDeltaPocLt=currDeltaPocLt;
    1049 #endif
    1050927            prev = rps->getDeltaPOC(i);
    1051928            WRITE_FLAG( rps->getUsed(i), "used_by_curr_pic_lt_flag");
     
    1059936      if (pcSlice->getSPS()->getUseALF())
    1060937      {
    1061 #if !LCU_SYNTAX_ALF
    1062          if (pcSlice->getAlfEnabledFlag())
    1063          {
    1064            assert (pcSlice->getAPS()->getAlfEnabled());
    1065          }
    1066 #endif
    1067938         WRITE_FLAG( pcSlice->getAlfEnabledFlag(), "ALF on/off flag in slice header" );
    1068939      }
    1069940      if (pcSlice->getSPS()->getUseSAO())
    1070941      {
    1071 #if SAO_UNIT_INTERLEAVING
    1072942        WRITE_FLAG( pcSlice->getSaoInterleavingFlag(), "SAO interleaving flag" );
    1073 #endif
    1074943         assert (pcSlice->getSaoEnabledFlag() == pcSlice->getAPS()->getSaoEnabled());
    1075944         WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "SAO on/off flag in slice header" );
    1076 #if SAO_UNIT_INTERLEAVING
    1077945         if (pcSlice->getSaoInterleavingFlag()&&pcSlice->getSaoEnabledFlag() )
    1078946         {
     
    1080948           WRITE_FLAG( pcSlice->getAPS()->getSaoParam()->bSaoFlag[2], "SAO on/off flag for Cr in slice header" );
    1081949         }
    1082 #endif
    1083950      }
    1084951      WRITE_UVLC( pcSlice->getAPS()->getAPSID(), "aps_id");
     
    1103970      pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0);
    1104971    }
    1105 #if H0412_REF_PIC_LIST_RESTRICTION
    1106972    if( pcSlice->getSPS()->getListsModificationPresentFlag() )
    1107973    {
    1108 #endif
    1109974    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    1110 #if H0137_0138_LIST_MODIFICATION
    1111975    if( !pcSlice->isIntra() )
    1112976    {
     
    11511015      }
    11521016    }
    1153 #else
    1154       if(!pcSlice->isIntra())
    1155       {
    1156         WRITE_FLAG(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL0() ? 1 : 0,       "ref_pic_list_modification_flag" );   
    1157         for(Int i = 0; i < refPicListModification->getNumberOfRefPicListModificationsL0(); i++)
    1158         {
    1159           WRITE_UVLC( refPicListModification->getListIdcL0(i), "ref_pic_list_modification_idc");
    1160           WRITE_UVLC( refPicListModification->getRefPicSetIdxL0(i), "ref_pic_set_idx");
    1161         }
    1162         if(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL0())
    1163           WRITE_UVLC( 3, "ref_pic_list_modification_idc");
    1164       }
    1165       if(pcSlice->isInterB())
    1166       {   
    1167         WRITE_FLAG(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL1() ? 1 : 0,       "ref_pic_list_modification_flag" );
    1168         for(Int i = 0; i < refPicListModification->getNumberOfRefPicListModificationsL1(); i++)
    1169         {
    1170           WRITE_UVLC( refPicListModification->getListIdcL1(i), "ref_pic_list_modification_idc");
    1171           WRITE_UVLC( refPicListModification->getRefPicSetIdxL1(i), "ref_pic_set_idx");
    1172         }
    1173         if(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL1())
    1174           WRITE_UVLC( 3, "ref_pic_list_modification_idc");
    1175       }
    1176 #endif
    1177     }
    1178 #if H0412_REF_PIC_LIST_RESTRICTION
    1179   }
    1180 #endif
     1017    }
     1018  }
    11811019  // ref_pic_list_combination( )
    11821020  // maybe move to own function?
     
    11881026      WRITE_UVLC( pcSlice->getNumRefIdx(REF_PIC_LIST_C) - 1,          "num_ref_idx lc_active_minus1");
    11891027     
    1190 #if H0412_REF_PIC_LIST_RESTRICTION
    11911028      if( pcSlice->getSPS()->getListsModificationPresentFlag() )
    11921029      {
    1193 #endif
    11941030        WRITE_FLAG( pcSlice->getRefPicListModificationFlagLC() ? 1 : 0, "ref_pic_list_modification_flag_lc" );
    11951031        if(pcSlice->getRefPicListModificationFlagLC())
     
    11981034          {
    11991035            WRITE_FLAG( pcSlice->getListIdFromIdxOfLC(i),               "pic_from_list_0_flag" );
    1200 #if H0137_0138_LIST_MODIFICATION
    12011036          if (((pcSlice->getListIdFromIdxOfLC(i)==REF_PIC_LIST_0) && pcSlice->getNumRefIdx( REF_PIC_LIST_0 )>1 ) || ((pcSlice->getListIdFromIdxOfLC(i)==REF_PIC_LIST_1) && pcSlice->getNumRefIdx( REF_PIC_LIST_1 )>1 ) )
    12021037          {
    12031038            WRITE_UVLC( pcSlice->getRefIdxFromIdxOfLC(i),               "ref_idx_list_curr" );
    12041039          }
    1205 #else
    1206             WRITE_UVLC( pcSlice->getRefIdxFromIdxOfLC(i),               "ref_idx_list_curr" );
    1207 #endif
    12081040          }
    12091041        }
    1210 #if H0412_REF_PIC_LIST_RESTRICTION
    1211       }
    1212 #endif
     1042      }
    12131043    }
    12141044  }
    12151045   
    1216 #if H0111_MVD_L1_ZERO
    12171046  if (pcSlice->isInterB())
    12181047  {
    12191048    WRITE_FLAG( pcSlice->getMvdL1ZeroFlag() ? 1 : 0,   "mvd_l1_zero_flag");
    12201049  }
    1221 #endif
    12221050
    12231051  if(pcSlice->getPPS()->getEntropyCodingMode() && !pcSlice->isIntra())
     
    12421070    Int iCode = pcSlice->getSliceQp() - ( pcSlice->getPPS()->getPicInitQPMinus26() + 26 );
    12431071    WRITE_SVLC( iCode, "slice_qp_delta" );
    1244 #if DBL_CONTROL
    12451072    if (pcSlice->getPPS()->getDeblockingFilterControlPresent())
    12461073    {
     
    12491076        WRITE_FLAG(pcSlice->getInheritDblParamFromAPS(), "inherit_dbl_param_from_APS_flag");
    12501077      }
    1251 #else
    1252     WRITE_FLAG(pcSlice->getInheritDblParamFromAPS(), "inherit_dbl_param_from_APS_flag");
    1253 #endif
    12541078      if (!pcSlice->getInheritDblParamFromAPS())
    12551079      {
     
    12611085        }
    12621086      }
    1263 #if DBL_CONTROL
    1264     }
    1265 #endif
     1087    }
    12661088    if ( pcSlice->getSliceType() == B_SLICE )
    12671089    {
     
    12991121  }
    13001122 
    1301 #if ( HHI_MPI || HHI_INTER_VIEW_MOTION_PRED )
    1302   #if ( HHI_MPI && HHI_INTER_VIEW_MOTION_PRED )
     1123#if ( HHI_MPI || H3D_IVMP )
     1124  #if ( HHI_MPI && H3D_IVMP )
    13031125  const int iExtraMergeCandidates = ( pcSlice->getSPS()->getUseMVI() || pcSlice->getSPS()->getMultiviewMvPredMode() ) ? 1 : 0;
    13041126  #elif HHI_MPI
    13051127  const int iExtraMergeCandidates = pcSlice->getSPS()->getUseMVI() ? 1 : 0;
     1128  #elif MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     1129  const int iExtraMergeCandidates = ( pcSlice->getIsDepth() || pcSlice->getSPS()->getMultiviewMvPredMode() ) ? 1 : 0;
    13061130  #else
    13071131  const int iExtraMergeCandidates = pcSlice->getSPS()->getMultiviewMvPredMode() ? 1 : 0;
     
    13321156 \param pcSlice Where we find the substream size information.
    13331157 */
    1334 #if TILES_WPP_ENTRY_POINT_SIGNALLING
    13351158Void  TEncCavlc::codeTilesWPPEntryPoint( TComSlice* pSlice )
    13361159{
     
    14321255  delete [] entryPointOffset;
    14331256}
    1434 #else
    1435 Void TEncCavlc::codeSliceHeaderSubstreamTable( TComSlice* pcSlice )
    1436 {
    1437   UInt uiNumSubstreams = pcSlice->getPPS()->getNumSubstreams();
    1438   UInt*puiSubstreamSizes = pcSlice->getSubstreamSizes();
    1439 
    1440   // Write header information for all substreams except the last.
    1441   for (UInt ui = 0; ui+1 < uiNumSubstreams; ui++)
    1442   {
    1443     UInt uiNumbits = puiSubstreamSizes[ui];
    1444 
    1445     //the 2 first bits are used to give the size of the header
    1446     if ( uiNumbits < (1<<8) )
    1447     {
    1448       xWriteCode(0,         2  );
    1449       xWriteCode(uiNumbits, 8  );
    1450     }
    1451     else if ( uiNumbits < (1<<16) )
    1452     {
    1453       xWriteCode(1,         2  );
    1454       xWriteCode(uiNumbits, 16 );
    1455     }
    1456     else if ( uiNumbits < (1<<24) )
    1457     {
    1458       xWriteCode(2,         2  );
    1459       xWriteCode(uiNumbits, 24 );
    1460     }
    1461     else if ( uiNumbits < (1<<31) )
    1462     {
    1463       xWriteCode(3,         2  );
    1464       xWriteCode(uiNumbits, 32 );
    1465     }
    1466     else
    1467     {
    1468       printf("Error in codeSliceHeaderTable\n");
    1469       exit(-1);
    1470     }
    1471   }
    1472 }
    1473 #endif
    14741257
    14751258Void TEncCavlc::codeTerminatingBit      ( UInt uilsLast )
     
    14811264}
    14821265
    1483 #if HHI_INTER_VIEW_MOTION_PRED
     1266#if H3D_IVMP
    14841267Void TEncCavlc::codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum )
    14851268#else
     
    15101293}
    15111294
    1512 #if HHI_INTER_VIEW_RESIDUAL_PRED
     1295#if H3D_IVRP
    15131296Void
    15141297TEncCavlc::codeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    15901373}
    15911374
    1592 #if BURST_IPCM
    15931375/** Code I_PCM information.
    15941376 * \param pcCU pointer to CU
     
    16021384  assert(0);
    16031385}
    1604 #else
    1605 /** Code I_PCM information.
    1606  * \param pcCU pointer to CU
    1607  * \param uiAbsPartIdx CU index
    1608  * \returns Void
    1609  *
    1610  * If I_PCM flag indicates that the CU is I_PCM, code its PCM alignment bits and codes. 
    1611  */
    1612 Void TEncCavlc::codeIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx)
    1613 {
    1614   UInt uiIPCM = (pcCU->getIPCMFlag(uiAbsPartIdx) == true)? 1 : 0;
    1615 
    1616   xWriteFlag(uiIPCM);
    1617 
    1618   if (uiIPCM)
    1619   {
    1620     xWritePCMAlignZero();
    1621 
    1622     UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
    1623     UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
    1624     UInt uiChromaOffset = uiLumaOffset>>2;
    1625 
    1626     Pel* piPCMSample;
    1627     UInt uiWidth;
    1628     UInt uiHeight;
    1629     UInt uiSampleBits;
    1630     UInt uiX, uiY;
    1631 
    1632     piPCMSample = pcCU->getPCMSampleY() + uiLumaOffset;
    1633     uiWidth = pcCU->getWidth(uiAbsPartIdx);
    1634     uiHeight = pcCU->getHeight(uiAbsPartIdx);
    1635     uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthLuma();
    1636 
    1637     for(uiY = 0; uiY < uiHeight; uiY++)
    1638     {
    1639       for(uiX = 0; uiX < uiWidth; uiX++)
    1640       {
    1641         UInt uiSample = piPCMSample[uiX];
    1642 
    1643         xWriteCode(uiSample, uiSampleBits);
    1644       }
    1645       piPCMSample += uiWidth;
    1646     }
    1647 
    1648     piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
    1649     uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
    1650     uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;
    1651     uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();
    1652 
    1653     for(uiY = 0; uiY < uiHeight; uiY++)
    1654     {
    1655       for(uiX = 0; uiX < uiWidth; uiX++)
    1656       {
    1657         UInt uiSample = piPCMSample[uiX];
    1658 
    1659         xWriteCode(uiSample, uiSampleBits);
    1660       }
    1661       piPCMSample += uiWidth;
    1662     }
    1663 
    1664     piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset;
    1665     uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
    1666     uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;
    1667     uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();
    1668 
    1669     for(uiY = 0; uiY < uiHeight; uiY++)
    1670     {
    1671       for(uiX = 0; uiX < uiWidth; uiX++)
    1672       {
    1673         UInt uiSample = piPCMSample[uiX];
    1674 
    1675         xWriteCode(uiSample, uiSampleBits);
    1676       }
    1677       piPCMSample += uiWidth;
    1678     }
    1679   }
    1680 }
    1681 #endif
    16821386
    16831387Void TEncCavlc::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    17101414  Int iDQp  = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx );
    17111415
    1712 #if H0736_AVC_STYLE_QP_RANGE
    17131416  Int qpBdOffsetY =  pcCU->getSlice()->getSPS()->getQpBDOffsetY();
    17141417  iDQp = (iDQp + 78 + qpBdOffsetY + (qpBdOffsetY/2)) % (52 + qpBdOffsetY) - 26 - (qpBdOffsetY/2);
    1715 #endif
    17161418
    17171419  xWriteSvlc( iDQp );
     
    17441446  xWriteSvlc( iCode );
    17451447}
    1746 #if LCU_SYNTAX_ALF
    17471448/** Code the fixed length code (smaller than one max value) in OSALF
    17481449 * \param idx:  coded value
     
    17691470  }
    17701471}
    1771 #endif
    17721472
    17731473Void TEncCavlc::codeSaoFlag( UInt uiCode )
     
    17851485    xWriteSvlc( iCode );
    17861486}
    1787 #if SAO_UNIT_INTERLEAVING
    17881487/** Code SAO run.
    17891488 * \param uiCode
     
    18091508  WRITE_CODE( uiCode, uiLength, "sao_run_diff");
    18101509}
    1811 #endif
    18121510
    18131511Void TEncCavlc::estBit( estBitsSbacStruct* pcEstBitsCabac, Int width, Int height, TextType eTType )
     
    21141812Void TEncCavlc::xCodeScalingList(TComScalingList* scalingList, UInt sizeId, UInt listId)
    21151813{
    2116 #if SCALING_LIST
    21171814  Int coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]);
    21181815  UInt* scan    = g_auiFrameScanXY [ (sizeId == 0)? 1 : 2];
    2119 #else
    2120   Int coefNum = (Int)g_scalingListSize[sizeId];
    2121   UInt* scan    = g_auiFrameScanXY [ sizeId + 1];
    2122 #endif
    21231816  Int nextCoef = SCALING_LIST_START_VALUE;
    21241817  Int data;
    21251818  Int *src = scalingList->getScalingListAddress(sizeId, listId);
    2126 #if SCALING_LIST
    21271819  if(sizeId > SCALING_LIST_8x8 && scalingList->getUseDefaultScalingMatrixFlag(sizeId,listId))
    21281820  {
     
    21551847    }
    21561848  }
    2157 #else
    2158   for(Int i=0;i<coefNum;i++)
    2159   {
    2160     data = src[scan[i]] - nextCoef;
    2161     nextCoef = src[scan[i]];
    2162     if(data > 127)
    2163     {
    2164       data = data - 256;
    2165     }
    2166     if(data < -128)
    2167     {
    2168       data = data + 256;
    2169     }
    2170 
    2171     WRITE_SVLC( data,  "delta_coef");
    2172   }
    2173 #endif
    21741849}
    21751850Bool TComScalingList::checkPredMode(UInt sizeId, UInt listId)
     
    21771852  for(Int predListIdx = (Int)listId -1 ; predListIdx >= 0; predListIdx--)
    21781853  {
    2179 #if SCALING_LIST
    21801854    if( !memcmp(getScalingListAddress(sizeId,listId),getScalingListAddress(sizeId, predListIdx),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix
    21811855     && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value
    2182 #else
    2183     if( !memcmp(getScalingListAddress(sizeId,listId),getScalingListAddress(sizeId, predListIdx),sizeof(Int)*(Int)g_scalingListSize[sizeId])) // check value of matrix
    2184 #endif
    21851856    {
    21861857      setRefMatrixId(sizeId, listId, predListIdx);
Note: See TracChangeset for help on using the changeset viewer.