Changeset 655 in 3DVCSoftware for trunk/source/Lib/TLibDecoder


Ignore:
Timestamp:
23 Oct 2013, 23:01:30 (11 years ago)
Author:
tech
Message:

Merged 8.1-Cleanup@654

Location:
trunk/source/Lib/TLibDecoder
Files:
14 edited

Legend:

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

    r608 r655  
    315315
    316316  /* restore primary bitstream for sei_message */
     317  getBitstream()->deleteFifo();
    317318  delete getBitstream();
    318319  setBitstream(bs);
  • trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp

    r622 r655  
    5858  if (length < 10)
    5959  {
    60     fprintf( g_hTrace, "%-50s u(%d)  : %d\n", pSymbolName, length, rValue );
     60    fprintf( g_hTrace, "%-50s u(%d)  : %u\n", pSymbolName, length, rValue );
    6161  }
    6262  else
    6363  {
    64     fprintf( g_hTrace, "%-50s u(%d) : %d\n", pSymbolName, length, rValue );
     64    fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue );
    6565  }
    6666  fflush ( g_hTrace );
     
    7777#endif
    7878  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
    79   fprintf( g_hTrace, "%-50s ue(v) : %d\n", pSymbolName, rValue );
     79  fprintf( g_hTrace, "%-50s ue(v) : %u\n", pSymbolName, rValue );
    8080  fflush ( g_hTrace );
    8181}
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r622 r655  
    330330    }
    331331  }
    332 #if H_MV5
    333332#if H_MV
    334333  if ( pcPPS->getLayerId() > 0 )
     
    344343  { 
    345344#endif
    346 #endif
    347345  READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" );           pcPPS->setScalingListPresentFlag( uiCode ? true : false );
    348346  if(pcPPS->getScalingListPresentFlag ())
     
    350348    parseScalingList( pcPPS->getScalingList() );
    351349  }
    352 #if H_MV5
    353 #if H_MV
    354   }
    355 #endif
     350#if H_MV
     351  }
    356352#endif
    357353
     
    430426  {
    431427    Window &defDisp = pcVUI->getDefaultDisplayWindow();
    432 #if !H_MV5
    433     READ_UVLC(   uiCode, "def_disp_win_left_offset" );                defDisp.setWindowLeftOffset  ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) );
    434     READ_UVLC(   uiCode, "def_disp_win_right_offset" );               defDisp.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) );
    435     READ_UVLC(   uiCode, "def_disp_win_top_offset" );                 defDisp.setWindowTopOffset   ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );
    436     READ_UVLC(   uiCode, "def_disp_win_bottom_offset" );              defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );
    437 #else
    438428#if H_MV
    439429    defDisp.setScaledFlag( false );
     
    448438    READ_UVLC(   uiCode, "def_disp_win_bottom_offset" );              defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );
    449439#endif
    450 #endif
    451440  }
    452441  TimingInfo *timingInfo = pcVUI->getTimingInfo();
     
    471460  {
    472461    READ_FLAG(   uiCode, "tiles_fixed_structure_flag");               pcVUI->setTilesFixedStructureFlag(uiCode);
    473 #if !H_MV5
    474 #if H_MV
    475     if ( pcSPS->getLayerId() > 0 )
    476     {
    477       READ_FLAG( uiCode, "tile_boundaries_aligned_flag" ); pcVUI->setTileBoundariesAlignedFlag( uiCode == 1 );
    478     }
    479 #endif
    480 #endif
    481462    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
    482463    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
     
    597578  READ_UVLC(     uiCode, "sps_seq_parameter_set_id" );           pcSPS->setSPSId( uiCode );
    598579  assert(uiCode <= 15);
    599 #if H_MV5
    600580#if H_MV
    601581  if ( pcSPS->getLayerId() > 0 )
     
    606586  if ( pcSPS->getUpdateRepFormatFlag() )
    607587  {
    608 #endif
    609588#endif
    610589  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     
    619598  READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
    620599  READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
    621 #if H_MV5
    622 #if H_MV
    623   }
    624 #endif
     600#if H_MV
     601  }
    625602#endif
    626603  READ_FLAG(     uiCode, "conformance_window_flag");
     
    628605  {
    629606    Window &conf = pcSPS->getConformanceWindow();
    630 #if H_MV5
    631607#if H_MV
    632608    // Needs to be scaled later, when ChromaFormatIdc is known.
     
    642618    READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) );
    643619#endif
    644 #else
    645     READ_UVLC(   uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset  ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
    646     READ_UVLC(   uiCode, "conf_win_right_offset" );              conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
    647     READ_UVLC(   uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset   ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) );
    648     READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) );
    649 #endif
    650   }
    651 
    652 #if H_MV5
     620  }
     621
    653622#if H_MV
    654623  if ( pcSPS->getUpdateRepFormatFlag() )
    655624  {
    656 #endif
    657625#endif
    658626  READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
     
    665633  pcSPS->setBitDepthC( uiCode + 8 );
    666634  pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
    667 #if H_MV5
    668 #if H_MV
    669   }
    670 #endif
     635#if H_MV
     636  }
    671637#endif
    672638
     
    692658    pcSPS->setNumReorderPics(uiCode, i);
    693659#if H_MV
    694 #if H_MV5
    695660    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
    696 #else
    697     READ_UVLC ( uiCode, "sps_max_latency_increase[i]");
    698 #endif
    699661#else
    700662    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1");
     
    736698  if(pcSPS->getScalingListFlag())
    737699  {
    738 #if H_MV5
    739700#if H_MV
    740701    if ( pcSPS->getLayerId() > 0 )
     
    750711    {   
    751712#endif
    752 #endif
    753713    READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
    754714    if(pcSPS->getScalingListPresentFlag ())
     
    756716      parseScalingList( pcSPS->getScalingList() );
    757717    }
    758 #if H_MV5
    759 #if H_MV
    760     }
    761 #endif
     718#if H_MV
     719    }
    762720#endif
    763721  }
     
    814772  if (uiCode)
    815773  {
    816 #if !H_MV5
    817 #if !H_MV
    818     while ( xMoreRbspData() )
    819     {
    820       READ_FLAG( uiCode, "sps_extension_data_flag");
    821     }
    822 #else
    823     READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );    pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
    824     ////   sps_extension_vui_parameters( )
    825     if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
    826     { 
    827       READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode );
    828       for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
    829       { 
    830         READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode );
    831         if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
    832         { 
    833           READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 );
    834           if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 
    835           {
    836             READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode );
    837           }
    838         } 
    839       } 
    840     }
    841 
    842 #if H_3D_QTLPC
    843     if( depthFlag )
    844     {
    845       READ_FLAG( uiCode, "use_qtl_flag" );
    846       pcSPS->setUseQTL( uiCode );
    847       READ_FLAG( uiCode, "use_pc_flag" );
    848       pcSPS->setUsePC( uiCode );
    849     }
    850 #endif
    851     ////   sps_extension_vui_parameters( ) END
    852     READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" );
    853     READ_FLAG( uiCode, "sps_extension2_flag");
    854     if ( uiCode )
    855     {
    856 #if !H_3D
    857       while ( xMoreRbspData() )
    858       {
    859         READ_FLAG( uiCode, "sps_extension_data_flag");
    860       }
    861 #else
    862      
    863       UInt uiCamParPrecision = 0;
    864       Bool bCamParSlice      = false;
    865       if ( !depthFlag )
    866       {     
    867         READ_UVLC( uiCamParPrecision, "cp_precision" );
    868         READ_FLAG( uiCode, "cp_in_slice_header_flag" );    bCamParSlice = ( uiCode == 1 );
    869         if( !bCamParSlice )
    870         {       
    871           for( UInt uiBaseIndex = 0; uiBaseIndex < viewIndex; uiBaseIndex++ )
    872           {
    873             Int iCode;
    874             READ_SVLC( iCode, "cp_scale" );                m_aaiTempScale  [ uiBaseIndex ][ viewIndex ]   = iCode;
    875             READ_SVLC( iCode, "cp_off" );                  m_aaiTempOffset [ uiBaseIndex ][ viewIndex ]   = iCode;
    876             READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); m_aaiTempScale  [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ viewIndex ];
    877             READ_SVLC( iCode, "cp_inv_off_plus_off" );     m_aaiTempOffset [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ viewIndex ];
    878           }
    879         }
    880       }
    881       pcSPS->initCamParaSPS( viewIndex, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset );
    882       READ_FLAG( uiCode, "sps_extension3_flag");
    883       if ( uiCode )
    884       {
    885         while ( xMoreRbspData() )
    886         {
    887           READ_FLAG( uiCode, "sps_extension_data_flag");
    888         }
    889       }
    890 #endif // !H_3D
    891     }
    892 #endif // !H_MV
    893   }
    894 }
    895 #else
    896774#if H_MV
    897775    parseSPSExtension( pcSPS );
     
    918796  }
    919797}
    920 #endif
    921 #if H_MV5
     798
     799#if H_MV
    922800Void TDecCavlc::parseSPSExtension( TComSPS* pcSPS )
    923801{
     
    972850  READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
    973851#if H_MV
    974 #if H_MV5
    975852  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayersMinus1( uiCode  );
    976 #else
    977   READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );              pcVPS->setMaxLayers( uiCode + 1 );
    978 #endif
    979853#else
    980854  READ_CODE( 6,  uiCode,  "vps_reserved_zero_6bits" );            assert(uiCode == 0);
     
    1061935  if (uiCode)
    1062936  {
    1063 #if !H_MV5
    1064 #if H_MV
    1065     m_pcBitstream->readOutTrailingBits();
    1066 
    1067     READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
    1068     READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
    1069 
    1070     for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ )
    1071     {
    1072       READ_FLAG( uiCode,  "scalability_mask[i]" );                  pcVPS->setScalabilityMask( sIdx, uiCode == 1 ? true : false );     
    1073     }
    1074 
    1075     for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )
    1076     {
    1077         READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" );       pcVPS->setDimensionIdLen( sIdx, uiCode + 1 );
    1078     }
    1079 
    1080     if ( pcVPS->getSplittingFlag() )
    1081       {
    1082       pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLenMinus1() );       
    1083       }
    1084 
    1085     READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" );           pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false );
    1086 
    1087     for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )
    1088     {
    1089       if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )
    1090       {
    1091         READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" );                pcVPS->setLayerIdInNuh( i, uiCode );
    1092       }
    1093       else
    1094       {
    1095         pcVPS->setLayerIdInNuh( i, i );;
    1096     }
    1097 
    1098       pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i );
    1099    
    1100       for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
    1101     {
    1102         if ( !pcVPS->getSplittingFlag() )
    1103       {
    1104           READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" );  pcVPS->setDimensionId( i, j, uiCode );
    1105         }
    1106         else
    1107         {
    1108           pcVPS->setDimensionId( i, j, pcVPS->inferDimensionId( i, j)  );
    1109         }
    1110       }
    1111     }
    1112 
    1113 
    1114     for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
    1115     {
    1116       for( Int j = 0; j < i; j++ )
    1117       {
    1118         READ_FLAG( uiCode, "direct_dependency_flag[i][j]" );             pcVPS->setDirectDependencyFlag( i, j, uiCode );
    1119       }
    1120     }
    1121 
    1122     for( Int i = 0; i < pcVPS->getMaxLayers() - 1; i++ )
    1123     {
    1124       READ_CODE( 3, uiCode,       "max_tid_il_ref_pics_plus1[i]" );      pcVPS->setMaxTidIlRefPicPlus1( i , uiCode );
    1125     }
    1126 
    1127     READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1"      );  pcVPS->setVpsNumberLayerSetsMinus1    ( uiCode );
    1128     READ_CODE( 6,  uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );
    1129 
    1130     for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
    1131     {
    1132       READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
    1133       if( !pcVPS->getVpsProfilePresentFlag( i ) )
    1134       {
    1135         READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode );
    1136       }
    1137       parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
    1138       if( !pcVPS->getVpsProfilePresentFlag( i ) )
    1139       {
    1140         TComPTL temp = *pcVPS->getPTL( i );
    1141         *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 );
    1142         pcVPS->getPTL( i )->copyLevelFrom( &temp );
    1143       }
    1144     }
    1145 
    1146     Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;
    1147 
    1148     READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 );
    1149 
    1150     if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
    1151     {
    1152       READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1"      ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode );
    1153       numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1);
    1154     }
    1155 
    1156     if( numOutputLayerSets > 1)
    1157     {
    1158       READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag(  uiCode == 1);
    1159     } 
    1160 
    1161     for( Int i = 1; i < numOutputLayerSets; i++ )
    1162     {
    1163       if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
    1164       {       
    1165         READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode );
    1166         for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
    1167         {
    1168           READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 );
    1169         }       
    1170       }
    1171       if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    1172       {     
    1173         READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode );
    1174       }
    1175     }
    1176 
    1177     READ_FLAG( uiCode , "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag( uiCode == 1 );
    1178     READ_UVLC( uiCode,  "direct_dep_type_len_minus2"); pcVPS->setDirectDepTypeLenMinus2 ( uiCode );
    1179 
    1180     for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
    1181     {
    1182       for( Int j = 0; j < i; j++ )
    1183       {
    1184         if (pcVPS->getDirectDependencyFlag( i, j) )
    1185         {       
    1186           READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2,  uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode);
    1187         }
    1188       }
    1189     }
    1190 
    1191     READ_FLAG ( uiCode,                    "vps_shvc_reserved_zero_flag" );
    1192 
    1193 #if H_3D   
    1194     READ_FLAG( uiCode,  "vps_extension2_flag" );
    1195     if (uiCode)
    1196     {
    1197       m_pcBitstream->readOutTrailingBits();
    1198 
    1199       for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )
    1200       {
    1201 
    1202 #if H_3D_ARP
    1203         pcVPS->setUseAdvRP  ( i, 0 );
    1204         pcVPS->setARPStepNum( i, 1 );
    1205 #endif 
    1206         if ( i != 0 )
    1207         {
    1208           if( !( pcVPS->getDepthId( i ) == 1 ) )
    1209           {
    1210 #if H_3D_IV_MERGE
    1211                 READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
    1212 #endif
    1213 #if H_3D_ARP
    1214                 READ_FLAG( uiCode, "iv_res_pred_flag[i]"  );  pcVPS->setUseAdvRP  ( i, uiCode ); pcVPS->setARPStepNum( i, uiCode ? H_3D_ARP_WFNR : 1 );
    1215 
    1216 #endif
    1217 #if H_3D_NBDV_REF
    1218                 READ_FLAG( uiCode, "depth_refinement_flag[i]");    pcVPS->setDepthRefinementFlag  ( i, uiCode == 1 ? true : false );
    1219 #endif
    1220 #if H_3D_VSP
    1221                 READ_FLAG( uiCode, "view_synthesis_pred_flag[i]"); pcVPS->setViewSynthesisPredFlag( i, uiCode == 1 ? true : false );
    1222 #endif
    1223           }
    1224           else
    1225           {
    1226 
    1227             READ_FLAG( uiCode, "vps_depth_modes_flag[i]" );             pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );
    1228             //          READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPreFlag     ( i, uiCode == 1 ? true : false );
    1229 #if H_3D_DIM_DLT
    1230             if( pcVPS->getVpsDepthModesFlag( i ) )
    1231             {
    1232               READ_FLAG( uiCode, "dlt_flag[i]" );                       pcVPS->setUseDLTFlag( i, uiCode == 1 ? true : false );
    1233             }
    1234             if( pcVPS->getUseDLTFlag( i ) )
    1235             {
    1236               // decode mapping
    1237               UInt uiNumDepthValues;
    1238               // parse number of values in DLT
    1239               READ_UVLC(uiNumDepthValues, "num_depth_values_in_dlt[i]");
    1240 
    1241               // parse actual DLT values
    1242               Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));
    1243               for(Int d=0; d<uiNumDepthValues; d++)
    1244               {
    1245                 READ_UVLC(uiCode, "dlt_depth_value[i][d]");
    1246                 aiIdx2DepthValue[d] = (Int)uiCode;
    1247               }
    1248 
    1249               pcVPS->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
    1250 
    1251               // clean memory
    1252               free(aiIdx2DepthValue);
    1253             }
    1254 #endif
    1255 #if LGE_INTER_SDC_E0156
    1256             READ_FLAG( uiCode, "depth_inter_SDC_flag" );              pcVPS->setInterSDCFlag( i, uiCode ? true : false );
    1257 #endif
    1258           }
    1259         }
    1260       }
    1261       READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
    1262     }
    1263 #endif
    1264     pcVPS->checkVPSExtensionSyntax();
    1265 
    1266     pcVPS->setRefLayers();
    1267 
    1268 #else
    1269     while ( xMoreRbspData() )
    1270     {
    1271       READ_FLAG( uiCode, "vps_extension_data_flag");
    1272     }
    1273 #endif   
    1274   }
    1275 
    1276 #if H_3D
    1277   pcVPS->initViewIndex();
    1278 #endif
    1279   return;
    1280 }
    1281 #else
    1282937#if H_MV
    1283938    m_pcBitstream->readOutTrailingBits();
     
    1305960#endif
    1306961  }
    1307 }
    1308 #endif
    1309 
    1310 #if H_MV5
     962  return;
     963}
     964
    1311965#if H_MV
    1312966Void TDecCavlc::parseVPSExtension( TComVPS* pcVPS )
     
    16401294        }
    16411295#endif
    1642 #if LGE_INTER_SDC_E0156
     1296#if H_3D_INTER_SDC
    16431297            READ_FLAG( uiCode, "depth_inter_SDC_flag" );              pcVPS->setInterSDCFlag( i, uiCode ? true : false );
    16441298#endif
     
    16481302  READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
    16491303}
    1650 #endif
    16511304#endif
    16521305
     
    16801333#if H_MV
    16811334  vps = parameterSetManager->getPrefetchedVPS(sps->getVPSId());
    1682 #if H_MV5
    16831335  assert( vps != NULL );
    16841336 
     
    16921344  rpcSlice->setIsDepth  ( vps->getDepthId  ( rpcSlice->getLayerId() ) == 1 );
    16931345#endif
    1694 #else
    1695   assert(vps!=0);
    1696   rpcSlice->setVPS(vps);     
    1697   rpcSlice->setViewId   ( vps->getViewId   ( rpcSlice->getLayerIdInVps() )      );
    1698 #if H_3D 
    1699   rpcSlice->setViewIndex( vps->getViewIndex( rpcSlice->getLayerIdInVps() )      ); 
    1700   rpcSlice->setIsDepth  ( vps->getDepthId  ( rpcSlice->getLayerIdInVps() ) == 1 );
    1701 #endif
    1702 #endif
    17031346#endif
    17041347  rpcSlice->setSPS(sps);
     
    17471390  {
    17481391#if H_MV   
    1749 #if H_MV5
    17501392    Int esb = 0; //Don't use i, otherwise will shadow something below
    17511393    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
     
    17621404
    17631405    for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++)   
    1764 #else
    1765     if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
    1766     {
    1767       READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );
    1768     }
    1769 
    1770     for (Int i = 1; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)   
    1771 #endif
    17721406#else
    17731407    for (Int i = 0; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     
    18081442      READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 
    18091443      Int iPOClsb = uiCode;
    1810       Int iPrevPOC = rpcSlice->getPrevPOC();
     1444      Int iPrevPOC = rpcSlice->getPrevTid0POC();
    18111445      Int iMaxPOClsb = 1<< sps->getBitsForPOC();
    1812       Int iPrevPOClsb = iPrevPOC%iMaxPOClsb;
     1446      Int iPrevPOClsb = iPrevPOC & (iMaxPOClsb - 1);
    18131447      Int iPrevPOCmsb = iPrevPOC-iPrevPOClsb;
    18141448      Int iPOCmsb;
     
    18331467      }
    18341468      rpcSlice->setPOC              (iPOCmsb+iPOClsb);
    1835 #if H_MV5
    18361469#if H_MV
    18371470      if ( rpcSlice->getPocResetFlag() ) 
     
    18411474
    18421475      }     
    1843 #endif
    18441476#endif
    18451477      TComReferencePictureSet* rps;
     
    19411573            rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLsbLt);
    19421574            rps->setCheckLTMSBPresent(j,false); 
     1575           
     1576            // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present
     1577            if( j == offset+(numOfLtrp-numLtrpInSPS)-1 )
     1578            {
     1579              deltaPocMSBCycleLT = 0;
     1580            }
    19431581          }
    19441582          prevDeltaMSB = deltaPocMSBCycleLT;
     
    19701608    }
    19711609#if H_MV
    1972 #if H_MV5
    19731610    Int layerId       = rpcSlice->getLayerId();
    19741611    if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 )    {   
     
    19891626      } 
    19901627    }
    1991 #else
    1992     Int layerIdInVps       = rpcSlice->getLayerIdInVps();
    1993     if( rpcSlice->getLayerId() > 0 && vps->getNumDirectRefLayers( layerIdInVps ) > 0 )
    1994     {   
    1995       READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 );
    1996       if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerIdInVps ) > 1 )
    1997       {           
    1998         if( !vps->getMaxOneActiveRefLayerFlag()) 
    1999         {
    2000           READ_CODE( rpcSlice->getNumInterLayerRefPicsMinus1Len( ), uiCode, "num_inter_layer_ref_pics_minus1" ); rpcSlice->setNumInterLayerRefPicsMinus1( uiCode );
    2001         }
    2002         for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ )   
    2003         {
    2004           READ_CODE( rpcSlice->getInterLayerPredLayerIdcLen( ), uiCode, "inter_layer_pred_layer_idc" ); rpcSlice->setInterLayerPredLayerIdc( i, uiCode );
    2005         }
    2006       } 
    2007     }
    2008 
    2009     rpcSlice->setActiveMotionPredRefLayers( );
    2010 
    2011     if( vps->getNumSamplePredRefLayers( layerIdInVps ) > 0  &&  rpcSlice->getNumActiveRefLayerPics() > 0 )
    2012     {
    2013       READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" ); rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode == 1 );
    2014     }
    2015 #endif
    20161628#endif
    20171629    if(sps->getUseSAO())
     
    21551767    if ( rpcSlice->getEnableTMVPFlag() )
    21561768    {
    2157 #if !H_MV5
    2158 #if H_MV
    2159       if( rpcSlice->getLayerId() > 0 && rpcSlice->getNumActiveMotionPredRefLayers() > 0 )
    2160       {
    2161         READ_FLAG( uiCode, "alt_collocated_indication_flag" ); rpcSlice->setAltCollocatedIndicationFlag( uiCode == 1 );
    2162       }
    2163 
    2164       if( rpcSlice->getAltCollocatedIndicationFlag() && rpcSlice->getNumActiveMotionPredRefLayers() > 1 )
    2165       {         
    2166         READ_UVLC( uiCode, "collocated_ref_layer_idx" ); rpcSlice->setCollocatedRefLayerIdx( uiCode );
    2167       }     
    2168       else
    2169       {
    2170 #endif
    2171 #endif
    21721769      if ( rpcSlice->getSliceType() == B_SLICE )
    21731770      {
     
    21911788        rpcSlice->setColRefIdx(0);
    21921789      }
    2193 #if !H_MV5
    2194 #if H_MV
    2195       }
    2196 #endif
    2197 #endif
    21981790    }
    21991791    if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) )
     
    26512243}
    26522244#endif
    2653 #if LGE_INTER_SDC_E0156
     2245#if H_3D_INTER_SDC
    26542246Void TDecCavlc::parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    26552247{
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r622 r655  
    7676  Void  parseQtRootCbf      ( UInt uiAbsPartIdx, UInt& uiQtRootCbf );
    7777  Void  parseVPS            ( TComVPS* pcVPS );
    78 #if H_MV5
    7978#if H_MV
    8079  Void  parseVPSExtension   ( TComVPS* pcVPS );
     
    8685  Void  parseSPSExtension   ( TComSPS* pcSPS ); 
    8786#endif
    88 #endif
    8987#if H_3D
    90 #if H_MV5
    9188  Void  parseVPSExtension2  ( TComVPS* pcVPS );
    9289  Void  parseSPSExtension2  ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag );
    93 #endif
    9490  Void  parseSPS            ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag );
    9591#else
     
    117113  Void  parseICFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    118114#endif
    119 #if LGE_INTER_SDC_E0156
     115#if H_3D_INTER_SDC
    120116  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    121117  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r622 r655  
    458458  m_pcEntropyDecoder->decodeARPW    ( pcCU , uiAbsPartIdx , uiDepth ); 
    459459#endif 
    460 #if LGE_INTER_SDC_E0156
     460#if H_3D_INTER_SDC
    461461  m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
    462462#endif
     
    525525  {
    526526    case MODE_INTER:
    527 #if LGE_INTER_SDC_E0156
     527#if H_3D_INTER_SDC
    528528      if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) )
    529529      {
     
    534534#endif
    535535      xReconInter( m_ppcCU[uiDepth], uiDepth );
    536 #if LGE_INTER_SDC_E0156
     536#if H_3D_INTER_SDC
    537537      }
    538538#endif
     
    578578}
    579579
    580 #if LGE_INTER_SDC_E0156
     580#if H_3D_INTER_SDC
    581581Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    582582{
     
    895895  // get DC prediction for each segment
    896896  Pel apDCPredValues[2];
    897 #if KWU_SDC_SIMPLE_DC_E0117
    898897  m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode);
    899 #else
    900   m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride);
    901 #endif
    902898 
    903899  // reconstruct residual based on mask + DC residuals
  • trunk/source/Lib/TLibDecoder/TDecCu.h

    r608 r655  
    118118  Void xReconIntraSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    119119#endif
    120 #if LGE_INTER_SDC_E0156
     120#if H_3D_INTER_SDC
    121121  Void xReconInterSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    122122#endif
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r622 r655  
    650650#endif
    651651 
    652 #if LGE_INTER_SDC_E0156
     652#if H_3D_INTER_SDC
    653653  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
    654654  {
     
    683683}
    684684
    685 #if LGE_INTER_SDC_E0156
     685#if H_3D_INTER_SDC
    686686Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    687687{
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r608 r655  
    9191  virtual Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    9292#endif
    93 #if LGE_INTER_SDC_E0156
     93#if H_3D_INTER_SDC
    9494  virtual Void parseInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    9595  virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
     
    170170  Void decodeICFlag            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    171171#endif
    172 #if LGE_INTER_SDC_E0156
     172#if H_3D_INTER_SDC
    173173  Void decodeInterSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    174174  Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r608 r655  
    158158    rpcPic->setNumDdvCandPics(rpcPic->getDisCandRefPictures(iColPoc));
    159159  }
    160 #endif
    161 #if MTK_NBDV_TN_FIX_E0172
     160
    162161  if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
    163162  {
    164163    rpcPic->checkTemporalIVRef();
    165164  }
    166 #endif
    167 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182
     165
    168166  if(pcSlice->getIsDepth())
    169167  {
     
    226224    rpcPic->destroyNonDBFilterInfo();
    227225  }
    228 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     226#if H_3D
    229227  rpcPic->compressMotion(2);
    230228#endif
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r622 r655  
    8989#if H_3D_DIM_DMM
    9090, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    91 #if !SEC_DMM2_E0146_HHIFIX
    92 , m_cDmm2DataSCModel          ( 1,             1,               NUM_DMM2_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    93 #endif
    9491, m_cDmm3DataSCModel          ( 1,             1,               NUM_DMM3_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    9592#endif
     
    10299#endif
    103100#endif
    104 #if LGE_INTER_SDC_E0156
     101#if H_3D_INTER_SDC
    105102, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
    106103, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
     
    179176#if H_3D_DIM_DMM
    180177  m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
    181 #if !SEC_DMM2_E0146_HHIFIX
    182   m_cDmm2DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM2_DATA );
    183 #endif
    184178  m_cDmm3DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM3_DATA );
    185179#endif
     
    192186#endif
    193187#endif
    194 #if LGE_INTER_SDC_E0156
     188#if H_3D_INTER_SDC
    195189  m_cInterSDCFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
    196190  m_cInterSDCResidualSCModel.initBuffer   ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
     
    255249#if H_3D_DIM_DMM
    256250  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
    257 #if !SEC_DMM2_E0146_HHIFIX
    258   m_cDmm2DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM2_DATA );
    259 #endif
    260251  m_cDmm3DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );
    261252#endif
     
    268259#endif
    269260#endif
    270 #if LGE_INTER_SDC_E0156
     261#if H_3D_INTER_SDC
    271262  m_cInterSDCFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
    272263  m_cInterSDCResidualSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
     
    444435  ruiTabIdx = uiIdx;
    445436}
    446 #if !SEC_DMM2_E0146_HHIFIX
    447 Void TDecSbac::xParseDmm2Offset( Int& riOffset )
    448 {
    449   Int iDeltaEnd = 0;
    450   if( DMM2_DELTAEND_MAX > 0 )
    451   {
    452     UInt uiFlag = 0;
    453     m_pcTDecBinIf->decodeBin( uiFlag, m_cDmm2DataSCModel.get(0, 0, 0) );
    454 
    455     if( uiFlag )
    456     {
    457       UInt uiAbsValMinus1;
    458       UInt uiSymbol;
    459       m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm2DataSCModel.get(0, 0, 0) ); uiAbsValMinus1  = uiSymbol;
    460       m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm2DataSCModel.get(0, 0, 0) ); uiAbsValMinus1 |= uiSymbol << 1;
    461       iDeltaEnd = uiAbsValMinus1 + 1;
    462       UInt uiSign;
    463       m_pcTDecBinIf->decodeBinEP( uiSign );
    464       if( uiSign )
    465       {
    466         iDeltaEnd = -iDeltaEnd;
    467       }
    468     }
    469   }
    470   riOffset = iDeltaEnd;
    471 }
    472 #endif
     437
    473438Void TDecSbac::xParseDmm3WedgeIdx( UInt& ruiIntraIdx, Int iNumBit )
    474439{
     
    11751140      pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth );
    11761141    } break;
    1177 #if !SEC_DMM2_E0146_HHIFIX
    1178   case( DMM2_IDX ):
    1179     {
    1180       Int iOffset = 0;
    1181       xParseDmm2Offset( iOffset );
    1182       pcCU->setDmm2DeltaEndSubParts( iOffset, absPartIdx, depth );
    1183     } break;
    1184 #endif
    11851142  case( DMM3_IDX ):
    11861143    {
     
    12501207  if( puIdx == 2 )
    12511208  {
    1252 #if !LGE_SDC_REMOVE_DC_E0158
    1253     while( binNum < 2 && symbol )
    1254 #endif
    12551209    {
    12561210      ctxDepthMode = puIdx*3 + binNum;
     
    12601214    }
    12611215         if( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;}
    1262 #if LGE_SDC_REMOVE_DC_E0158
    12631216    else if( modeCode == 1 ) { dir = 0;          sdcFlag = 0;}
    1264 #else
    1265     else if( modeCode == 2 ) { dir = 0;          sdcFlag = 0;}
    1266     else if( modeCode == 3 ) { dir =     DC_IDX; sdcFlag = 1;}
    1267 #endif
    12681217  }
    12691218  else if( puIdx == 0 )
     
    12831232  else
    12841233  {
    1285 #if ZJU_DEPTH_INTRA_MODE_E0204
    1286       UInt maxBinNum = 0;
    1287       m_pcTDecBinIf->decodeBinEP(symbol);
    1288       if( symbol == 1 )
    1289       {
    1290           maxBinNum = 3;
    1291       }
    1292       else
    1293       {
    1294           maxBinNum = 2;
    1295           symbol = 1;
    1296       }
    1297       while( binNum<maxBinNum && symbol )
    1298       {
    1299           ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum );
    1300           m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode));
    1301           modeCode = (modeCode<<1)+symbol;
    1302           binNum++;
    1303       }
    1304       if( maxBinNum == 3 )
    1305       {
    1306           if ( modeCode == 0 )       { dir =  PLANAR_IDX;             sdcFlag = 1;}
    1307           else if ( modeCode == 2 )  { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
    1308           else if ( modeCode == 6 )  { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
    1309           else if ( modeCode == 7 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
    1310       }
    1311       else
    1312       {
    1313           if ( modeCode == 0 )       { dir = 5;                       sdcFlag = 0;}
    1314           else if ( modeCode == 2 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;}
    1315           else if ( modeCode == 3 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
    1316       }
    1317 #else
    1318     ctxDepthMode = puIdx*3 ;
    1319     m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
    1320     modeCode = (modeCode<<1) + symbol;
    1321     if( !symbol )
    1322     {
    1323       ctxDepthMode = puIdx*3 + 1;
    1324       m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
    1325       modeCode = (modeCode<<1) + symbol;
    1326       if( symbol )
    1327       {
    1328         ctxDepthMode = puIdx*3 + 2;
    1329         m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
    1330         modeCode = (modeCode<<1) + symbol;
    1331       }
     1234    UInt maxBinNum = 0;
     1235    m_pcTDecBinIf->decodeBinEP(symbol);
     1236    if( symbol == 1 )
     1237    {
     1238      maxBinNum = 3;
    13321239    }
    13331240    else
    13341241    {
    1335       ctxDepthMode = puIdx*3 + 1;
    1336       m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
    1337       modeCode = (modeCode<<1) + symbol;
    1338       if( !symbol )
    1339       {
    1340         ctxDepthMode = puIdx*3 + 2;
    1341         m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
    1342         modeCode = (modeCode<<1) + symbol;
    1343       }
    1344       else
    1345       {
    1346         binNum = 0;
    1347 #if LGE_SDC_REMOVE_DC_E0158
    1348 #if !SEC_DMM2_E0146_HHIFIX
    1349         while( symbol && binNum < 2 )
    1350 #endif
    1351 #else
    1352 #if SEC_DMM2_E0146_HHIFIX
    1353         while( symbol && binNum < 2 )
    1354 #else
    1355         while( symbol && binNum < 3 )
    1356 #endif
    1357 #endif
    1358         {
    1359           ctxDepthMode = puIdx*3 + 2;
    1360           m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
    1361           modeCode = (modeCode<<1) + symbol;
    1362           binNum++;
    1363         }
    1364       }
    1365     }
    1366          if( modeCode == 0  ) { dir =  PLANAR_IDX;             sdcFlag = 1;}
    1367     else if( modeCode == 2  ) { dir = 5;                       sdcFlag = 0;}
    1368     else if( modeCode == 3  ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;}
    1369     else if( modeCode == 4  ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
    1370     else if( modeCode == 5  ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
    1371     else if( modeCode == 6  ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
    1372 #if LGE_SDC_REMOVE_DC_E0158
    1373 #if SEC_DMM2_E0146_HHIFIX
    1374     else if( modeCode == 7 )  { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
    1375 #else
    1376     else if( modeCode == 14 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
    1377     else if( modeCode == 15 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;}
    1378 #endif
    1379 #else
    1380     else if( modeCode == 14 ) { dir =      DC_IDX;             sdcFlag = 1;}
    1381 #if SEC_DMM2_E0146_HHIFIX
    1382     else if( modeCode == 15 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
    1383 #else
    1384     else if( modeCode == 30 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
    1385     else if( modeCode == 31 ) { dir = (2*DMM2_IDX+DIM_OFFSET); sdcFlag = 0;}
    1386 #endif
    1387 #endif
    1388 #endif
     1242      maxBinNum = 2;
     1243      symbol = 1;
     1244    }
     1245    while( binNum<maxBinNum && symbol )
     1246    {
     1247      ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum );
     1248      m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode));
     1249      modeCode = (modeCode<<1)+symbol;
     1250      binNum++;
     1251    }
     1252    if( maxBinNum == 3 )
     1253    {
     1254      if ( modeCode == 0 )       { dir =  PLANAR_IDX;             sdcFlag = 1;}
     1255      else if ( modeCode == 2 )  { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;}
     1256      else if ( modeCode == 6 )  { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;}
     1257      else if ( modeCode == 7 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
     1258    }
     1259    else
     1260    {
     1261      if ( modeCode == 0 )       { dir = 5;                       sdcFlag = 0;}
     1262      else if ( modeCode == 2 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;}
     1263      else if ( modeCode == 3 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
     1264    }
    13891265  }
    13901266  pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
     
    23382214#endif
    23392215
    2340 #if LGE_INTER_SDC_E0156
     2216#if H_3D_INTER_SDC
    23412217Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    23422218{
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r622 r655  
    102102#if H_3D_DIM_DMM
    103103  Void  xParseDmm1WedgeIdx   ( UInt& ruiTabIdx, Int iNumBit );
    104 #if !SEC_DMM2_E0146_HHIFIX
    105   Void  xParseDmm2Offset     ( Int& riOffset );
    106 #endif
    107104  Void  xParseDmm3WedgeIdx   ( UInt& ruiIntraIdx, Int iNumBit );
    108105#endif
     
    114111#endif
    115112#endif
    116 #if LGE_INTER_SDC_E0156
     113#if H_3D_INTER_SDC
    117114  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    118115  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     
    216213#if H_3D_DIM_DMM
    217214  ContextModel3DBuffer m_cDmm1DataSCModel;
    218 #if !SEC_DMM2_E0146_HHIFIX
    219   ContextModel3DBuffer m_cDmm2DataSCModel;
    220 #endif
    221215  ContextModel3DBuffer m_cDmm3DataSCModel;
    222216#endif
     
    229223#endif
    230224#endif
    231 #if LGE_INTER_SDC_E0156
     225#if H_3D_INTER_SDC
    232226  ContextModel3DBuffer m_cInterSDCFlagSCModel;
    233227  ContextModel3DBuffer m_cInterSDCResidualSCModel;
  • trunk/source/Lib/TLibDecoder/TDecSlice.h

    r608 r655  
    6565  TDecEntropy*    m_pcEntropyDecoder;
    6666  TDecCu*         m_pcCuDecoder;
    67   UInt            m_uiCurrSliceIdx;
    6867
    6968  TDecSbac*       m_pcBufferSbacDecoders;   ///< line to store temporary contexts, one per column of tiles.
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r622 r655  
    347347#endif
    348348#endif
     349  m_associatedIRAPType = NAL_UNIT_INVALID;
    349350  m_pocCRA = 0;
    350   m_prevRAPisBLA = false;
    351351  m_pocRandomAccess = MAX_INT; 
    352352  m_prevPOC                = MAX_INT;
    353353  m_bFirstSliceInPicture    = true;
    354354  m_bFirstSliceInSequence   = true;
     355  m_prevSliceSkipped = false;
     356  m_skippedPOC = 0;
    355357#if H_MV
    356358  m_layerId = 0;
     
    436438  Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window();
    437439
    438 #if H_MV5
    439440#if H_MV
    440441    assert( conformanceWindow   .getScaledFlag() );
    441442    assert( defaultDisplayWindow.getScaledFlag() );
    442 #endif
    443443#endif
    444444  for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++)
     
    518518  m_cCuDecoder.destroy();       
    519519#if H_MV
    520 #if H_MV5
    521520  TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    522 #else
    523   TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 
    524 #endif
    525521  TComSlice::markCurrPic( pcPic );
    526522  TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );
     
    591587  assert (sps != 0);
    592588
    593 #if H_MV5
    594589#if H_MV
    595590  TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
     
    599594  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
    600595#endif
    601 #else
    602   if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
    603 #endif
    604596  {
    605597    printf ("Parameter set activation failed!");
     
    627619  m_apcSlicePilot->setSPS(sps);
    628620#if H_MV
    629 #if H_MV5
    630621  m_apcSlicePilot->setVPS(vps); 
    631622  sps->inferRepFormat  ( vps , m_layerId );
    632623  sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) );
    633 #else
    634   m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getActiveVPS() );
    635 #endif
    636624#endif
    637625  pps->setSPS(sps);
     
    695683
    696684#if H_MV
    697 #if H_MV5
    698685  m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
    699 #else
    700   m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer );
    701 #endif
    702686  m_apcSlicePilot->setLayerId( nalu.m_layerId );
    703687#endif
    704688  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
     689
     690  // set POC for dependent slices in skipped pictures
     691  if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped)
     692  {
     693    m_apcSlicePilot->setPOC(m_skippedPOC);
     694  }
     695
     696  m_apcSlicePilot->setAssociatedIRAPPOC(m_pocCRA);
     697  m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType);
    705698
    706699#if H_MV 
    707700  TComVPS* vps     = m_apcSlicePilot->getVPS();
    708 #if H_MV5
    709701  Int layerId  = nalu.m_layerId;   
    710702  setViewId   ( vps->getViewId   ( layerId )      ); 
     
    714706  m_ivPicLists->setVPS( vps );
    715707#endif
    716 #else
    717   Int layerIdInVps = vps->getLayerIdInVps( nalu.m_layerId ); 
    718   setViewId   ( vps->getViewId   ( layerIdInVps )      ); 
    719 #if H_3D
    720   setViewIndex( vps->getViewIndex( layerIdInVps )      ); 
    721   setIsDepth  ( vps->getDepthId  ( layerIdInVps ) == 1 ); 
    722   m_ivPicLists->setVPS( vps );
    723 #endif
    724 #endif
    725708#endif
    726709    // Skip pictures due to random access
    727710    if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
    728711    {
     712    m_prevSliceSkipped = true;
     713    m_skippedPOC = m_apcSlicePilot->getPOC();
    729714      return false;
    730715    }
     
    732717    if (isSkipPictureForBLA(iPOCLastDisplay))
    733718    {
     719    m_prevSliceSkipped = true;
     720    m_skippedPOC = m_apcSlicePilot->getPOC();
    734721      return false;
    735722    }
     723
     724  // clear previous slice skipped flag
     725  m_prevSliceSkipped = false;
    736726
    737727  //we should only get a different poc for a new picture (with CTU address==0)
     
    763753#endif
    764754  // actual decoding starts here
    765 #if H_MV5
    766755#if H_MV
    767756   // This part needs further testing !
     
    771760   }
    772761#endif
    773 #endif
    774762  xActivateParameterSets();
    775763
     
    791779    m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
    792780#if H_MV
    793 #if H_MV5
    794781    m_apcSlicePilot->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
    795 #else
    796     m_apcSlicePilot->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );
    797 #endif
    798782#endif
    799783    //  Get a new picture buffer
    800784    xGetNewPicBuffer (m_apcSlicePilot, pcPic);
    801785
     786    Bool isField = false;
     787    Bool isTff = false;
     788   
     789    if(!m_SEIs.empty())
     790    {
     791      // Check if any new Picture Timing SEI has arrived
     792      SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING);
     793      if (pictureTimingSEIs.size()>0)
     794      {
     795        SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin());
     796        isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2);
     797        isTff =  (pictureTiming->m_picStruct == 1);
     798      }
     799    }
     800   
     801    //Set Field/Frame coding mode
     802    m_pcPic->setField(isField);
     803    m_pcPic->setTopField(isTff);
     804   
    802805    // transfer any SEI messages that have been received to the picture
    803806    pcPic->setSEIs(m_SEIs);
     
    938941  if (bNextSlice)
    939942  {
    940     pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA, m_cListPic );
     943    pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic );
    941944    // Set reference list
    942945#if H_MV   
    943 #if H_MV5
    944946    std::vector< TComPic* > tempRefPicLists[2];
    945947    std::vector< Bool     > usedAsLongTerm [2];
     
    948950    pcSlice->getTempRefPicLists( m_cListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr);
    949951    pcSlice->setRefPicList     ( tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
    950 #else
    951     pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true );   
    952 #endif
    953952#if H_3D_ARP
    954953    pcSlice->setARPStepNum();
     
    978977#if H_3D
    979978    pcSlice->setIvPicLists( m_ivPicLists );         
    980 #if H_3D_IV_MERGE   
     979#if H_3D_IV_MERGE
     980#if H_3D_FCO
     981    //assert( !getIsDepth() );
     982#else
    981983    assert( !getIsDepth() || ( pcSlice->getTexturePic() != 0 ) );
     984#endif
    982985#endif   
    983986#endif
     
    10371040      pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList()  );
    10381041    }
    1039     pcSlice->getScalingList()->setUseTransformSkip(pcSlice->getPPS()->getUseTransformSkip());
    10401042    if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag())
    10411043    {
     
    10841086  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
    10851087  assert( vps != 0 );
    1086 #if H_MV5
    10871088  m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) );
    10881089#else
    1089   Int layerIdInVPS = vps->getLayerIdInVps( m_layerId );
    1090   m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( layerIdInVPS ), ( vps->getDepthId( layerIdInVPS ) == 1 ) );
    1091 #endif
    1092 #else
    10931090  m_cEntropyDecoder.decodeSPS( sps );
    10941091#endif
     
    10991096{
    11001097  TComPPS* pps = new TComPPS();
    1101 #if H_MV5
    11021098#if H_MV
    11031099  pps->setLayerId( getLayerId() );
    1104 #endif
    11051100#endif
    11061101  m_cEntropyDecoder.decodePPS( pps );
     
    11121107  if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
    11131108  {
    1114 #if H_MV5
    11151109#if H_MV
    11161110    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) );
     
    11181112    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    11191113#endif
    1120 #else
    1121     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 
    1122 #endif
    11231114  }
    11241115  else
    11251116  {
    1126 #if H_MV5
    11271117#if H_MV
    11281118    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) );
     
    11301120    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    11311121#endif
    1132 #else
    1133     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    1134 #endif
    11351122    SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS);
    11361123    if (activeParamSets.size()>0)
     
    11391126      m_parameterSetManagerDecoder.applyPrefetchedPS();
    11401127      assert(seiAps->activeSeqParamSetId.size()>0);
    1141 #if H_MV5
    11421128#if H_MV
    11431129      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0], m_layerId ))
    1144 #else
    1145       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
    1146 #endif
    11471130#else
    11481131      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     
    12211204Bool TDecTop::isSkipPictureForBLA(Int& iPOCLastDisplay)
    12221205{
    1223   if (m_prevRAPisBLA && m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N))
     1206  if ((m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_N_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_RADL) &&
     1207       m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N))
    12241208  {
    12251209    iPOCLastDisplay++;
     
    13061290}
    13071291
    1308 #if H_MV5
    13091292Void TDecTop::xResetPocInPicBuffer()
    13101293{
     
    13241307}
    13251308#endif
    1326 #endif
    13271309//! \}
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r622 r655  
    176176  Int                     m_iMaxRefPicNum;
    177177 
     178  NalUnitType             m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture
    178179  Int                     m_pocCRA;            ///< POC number of the latest CRA picture
    179   Bool                    m_prevRAPisBLA;      ///< true if the previous RAP (CRA/CRANT/BLA/BLANT/IDR) picture is a BLA/BLANT picture
    180180  Int                     m_pocRandomAccess;   ///< POC number of the random access point (the first IDR or CRA picture)
    181181
     
    211211  Bool                    m_bFirstSliceInPicture;
    212212  Bool                    m_bFirstSliceInSequence;
     213  Bool                    m_prevSliceSkipped;
     214  Int                     m_skippedPOC;
     215
    213216#if H_MV
    214217  // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer 
     
    216219  Int                     m_viewId;
    217220  TComPicLists*           m_ivPicLists;
    218 #if H_MV5
    219221  std::vector<TComPic*>   m_refPicSetInterLayer0;
    220222  std::vector<TComPic*>   m_refPicSetInterLayer1;
    221 #else
    222   std::vector<TComPic*>   m_refPicSetInterLayer;
    223 #endif
    224223#if H_3D
    225224  Int                     m_viewIndex;
     
    279278  TComPic*  xGetPic( Int layerId, Int poc );
    280279  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 
    281 #if H_MV5
    282280  Void      xResetPocInPicBuffer();
    283 #endif
    284281#else
    285282  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
Note: See TracChangeset for help on using the changeset viewer.