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


Ignore:
Timestamp:
27 Mar 2014, 10:11:29 (11 years ago)
Author:
tech
Message:

Merged HTM-10.0-dev0@871. (MV-HEVC 7 HLS)

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

Legend:

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

    r608 r872  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/AnnexBread.h

    r608 r872  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/NALread.cpp

    r608 r872  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7070        break;
    7171      }
     72      assert(*it_read <= 0x03);
    7273    }
    7374    zeroCount = (*it_read == 0x00) ? zeroCount+1 : 0;
     
    126127  else
    127128  {
    128     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TLA_R
     129    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
    129130         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    130131         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
  • trunk/source/Lib/TLibDecoder/NALread.h

    r608 r872  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/SEIread.cpp

    r655 r872  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    9999    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
    100100    break;
     101#if H_MV_HLS_7_SEI_P0204_26
     102  case SEI::SUB_BITSTREAM_PROPERTY:
     103    fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
     104    break;
     105#endif
    101106  default:
    102107    fprintf( g_hTrace, "=========== Unknown SEI message ===========\n");
     
    240245      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps);
    241246      break;
     247#if H_MV_HLS_7_SEI_P0204_26
     248     case SEI::SUB_BITSTREAM_PROPERTY:
     249       sei = new SEISubBitstreamProperty;
     250       xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei);
     251       break;
     252#endif
    242253    default:
    243254      for (UInt i = 0; i < payloadSize; i++)
     
    443454  if( !pHRD->getSubPicCpbParamsPresentFlag() )
    444455  {
    445     READ_FLAG( code, "rap_cpb_params_present_flag" );                   sei.m_rapCpbParamsPresentFlag = code;
     456    READ_FLAG( code, "irap_cpb_params_present_flag" );                   sei.m_rapCpbParamsPresentFlag = code;
     457  }
     458  if( sei.m_rapCpbParamsPresentFlag )
     459  {
     460    READ_CODE( pHRD->getCpbRemovalDelayLengthMinus1() + 1, code, "cpb_delay_offset" );      sei.m_cpbDelayOffset = code;
     461    READ_CODE( pHRD->getDpbOutputDelayLengthMinus1()  + 1, code, "dpb_delay_offset" );      sei.m_dpbDelayOffset = code;
    446462  }
    447463  //read splicing flag and cpb_removal_delay_delta
     
    450466  READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" );
    451467  sei.m_auCpbRemovalDelayDelta = code + 1;
    452   if( sei.m_rapCpbParamsPresentFlag )
    453   {
    454     READ_CODE( pHRD->getCpbRemovalDelayLengthMinus1() + 1, code, "cpb_delay_offset" );      sei.m_cpbDelayOffset = code;
    455     READ_CODE( pHRD->getDpbOutputDelayLengthMinus1()  + 1, code, "dpb_delay_offset" );      sei.m_dpbDelayOffset = code;
    456   }
    457468  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    458469  {
     
    766777
    767778}
     779#if H_MV_HLS_7_SEI_P0204_26
     780Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei)
     781{
     782  UInt uiCode;
     783  READ_CODE( 4, uiCode, "active_vps_id" );                      sei.m_activeVpsId = uiCode;
     784  READ_UVLC(    uiCode, "num_additional_sub_streams_minus1" );  sei.m_numAdditionalSubStreams = uiCode + 1;
     785
     786  xResizeSubBitstreamPropertySeiArrays(sei);
     787  for( Int i = 0; i < sei.m_numAdditionalSubStreams; i++ )
     788  {
     789    READ_CODE(  2, uiCode, "sub_bitstream_mode[i]"           ); sei.m_subBitstreamMode[i] = uiCode;
     790    READ_UVLC(     uiCode, "output_layer_set_idx_to_vps[i]"  ); sei.m_outputLayerSetIdxToVps[i] = uiCode;
     791    READ_CODE(  3, uiCode, "highest_sub_layer_id[i]"         ); sei.m_highestSublayerId[i] = uiCode;
     792    READ_CODE( 16, uiCode, "avg_bit_rate[i]"                 ); sei.m_avgBitRate[i] = uiCode;
     793    READ_CODE( 16, uiCode, "max_bit_rate[i]"                 ); sei.m_maxBitRate[i] = uiCode;
     794  }
     795  xParseByteAlign();
     796}
     797Void SEIReader::xResizeSubBitstreamPropertySeiArrays(SEISubBitstreamProperty &sei)
     798{
     799  sei.m_subBitstreamMode.resize( sei.m_numAdditionalSubStreams );
     800  sei.m_outputLayerSetIdxToVps.resize( sei.m_numAdditionalSubStreams );
     801  sei.m_highestSublayerId.resize( sei.m_numAdditionalSubStreams );
     802  sei.m_avgBitRate.resize( sei.m_numAdditionalSubStreams );
     803  sei.m_maxBitRate.resize( sei.m_numAdditionalSubStreams );
     804}
     805#endif
    768806
    769807Void SEIReader::xParseByteAlign()
  • trunk/source/Lib/TLibDecoder/SEIread.h

    r608 r872  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7373  Void xParseSEISOPDescription        (SEISOPDescription &sei, UInt payloadSize);
    7474  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps);
     75#if H_MV_HLS_7_SEI_P0204_26
     76  Void  xParseSEISubBitstreamProperty   (SEISubBitstreamProperty &sei);
     77  Void  xResizeSubBitstreamPropertySeiArrays(SEISubBitstreamProperty &sei);
     78#endif
    7579  Void xParseByteAlign();
    7680};
  • trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp

    r655 r872  
    44* granted under this license. 
    55*
    6 * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77* All rights reserved.
    88*
  • trunk/source/Lib/TLibDecoder/SyntaxElementParser.h

    r608 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecBinCoder.h

    r608 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp

    r608 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecBinCoderCABAC.h

    r608 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r833 r872  
    44* granted under this license. 
    55*
    6 * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77* All rights reserved.
    88*
     
    366366
    367367  READ_FLAG( uiCode, "pps_extension_flag");
     368#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
     369  if (uiCode)
     370  {
     371#if H_MV
     372    for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
     373    {
     374      READ_FLAG( uiCode, "pps_extension_type_flag" ); pcPPS->setPpsExtensionTypeFlag( i, uiCode == 1 );
     375#if H_3D
     376      assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_3D || i == PPS_EX_T_ESC );
     377#else
     378      assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_ESC );
     379#endif
     380    }
     381   
     382
     383    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
     384    {
     385#if H_MV_HLS_7_POC_P0041
     386      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
     387#endif
     388    }
     389
     390#if H_3D
     391    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_3D ) ) // This probably needs to be aligned with Rext and SHVC
     392    {
     393      parsePPSExtension( pcPPS, pcVPS );
     394    }
     395#endif
     396
     397    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_ESC ) )
     398    {
     399#endif
     400      while ( xMoreRbspData() )
     401      {
     402        READ_FLAG( uiCode, "pps_extension_data_flag");
     403      }
     404#if H_MV
     405    }
     406#endif
     407  }
     408#else
    368409  if (uiCode)
    369410  {
     
    382423#endif
    383424  }
     425#endif
    384426}
    385427
     
    807849  assert(uiCode <= 12);
    808850
     851#if H_MV_HLS_7_SPS_P0155_16_32
     852  if ( pcSPS->getLayerId() == 0 )
     853  { 
     854#endif
    809855  UInt subLayerOrderingInfoPresentFlag;
    810856  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
     
    842888    }
    843889  }
     890#if H_MV_HLS_7_SPS_P0155_16_32
     891  }
     892#endif
    844893
    845894  READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" );
     
    848897  READ_UVLC( uiCode, "log2_diff_max_min_coding_block_size" );
    849898  pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode);
     899 
     900  if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)
     901  {
     902    assert(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() >= 5);
     903  }
     904 
    850905  Int maxCUDepthDelta = uiCode;
    851906  pcSPS->setMaxCUWidth  ( 1<<(log2MinCUSize + maxCUDepthDelta) );
     
    9981053    READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode );
    9991054    READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode );
     1055#if H_MV_HLS_7_RESERVED_FLAGS
     1056    READ_FLAG( uiCode, "sps_multilayer_ext_reserved_zero_flag[ i ]" );
     1057#endif
    10001058  }
    10011059}
     
    10331091  READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    10341092  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
    1035 #if H_MV
     1093
     1094#if H_MV_HLS_7_VPS_P0125_24
     1095  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
     1096#else
     1097#if H_MV && !H_MV_HLS7_GEN
    10361098  READ_CODE( 16, uiCode,  "vps_extension_offset" );               
    10371099#else
    10381100  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
     1101#endif
    10391102#endif
    10401103  parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
     
    11481211  UInt uiCode;
    11491212  READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
    1150   READ_FLAG( uiCode, "vps_vui_present_flag" );                    pcVPS->setVpsVuiPresentFlag( uiCode == 1 );  if ( pcVPS->getVpsVuiPresentFlag() )
     1213
     1214#if !H_MV_HLS_7_VPS_P0307_23
     1215  READ_FLAG( uiCode, "vps_vui_present_flag" );                    pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
     1216  if ( pcVPS->getVpsVuiPresentFlag() )
    11511217  { 
    11521218  READ_CODE( 16, uiCode, "vps_vui_offset" );                      pcVPS->setVpsVuiOffset( uiCode );
    11531219  }
     1220#endif
    11541221
    11551222  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
     
    12271294  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
    12281295  {
    1229     for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     1296    for (Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
    12301297    {
    12311298      READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1" ); pcVPS->setSubLayersVpsMaxMinus1( i, uiCode );   
     
    12361303  else
    12371304  {
    1238     for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ )
     1305    for (Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
    12391306    {
    12401307      pcVPS->setSubLayersVpsMaxMinus1( i, pcVPS->getMaxTLayers( ) - 1);   
     
    12581325
    12591326  READ_FLAG( uiCode, "all_ref_layers_active_flag" );             pcVPS->setAllRefLayersActiveFlag( uiCode == 1 );
     1327#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    12601328  READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1"      );  pcVPS->setVpsNumberLayerSetsMinus1    ( uiCode );
     1329#endif
     1330
     1331#if !H_MV_HLS_7_VPS_P0306_22
    12611332  READ_CODE( 6,  uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );
    1262 
     1333#else
     1334  READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 
     1335#endif
    12631336  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
    12641337  {
    12651338    READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
     1339#if !H_MV_HLS_7_VPS_P0048_14
    12661340    if( !pcVPS->getVpsProfilePresentFlag( i ) )
    12671341    {
     
    12691343      pcVPS->checkProfileRefMinus1( i );     
    12701344    }
     1345#endif
    12711346    parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
    12721347    if( !pcVPS->getVpsProfilePresentFlag( i ) )
    12731348    {
    12741349      TComPTL temp = *pcVPS->getPTL( i );
     1350#if H_MV_HLS_7_VPS_P0048_14
     1351      *pcVPS->getPTL( i ) = *pcVPS->getPTL( i - 1 );
     1352#else
    12751353      *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 );
     1354#endif
    12761355      pcVPS->getPTL( i )->copyLevelFrom( &temp );
    12771356    }
    12781357  }
    12791358
     1359#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     1360  READ_UVLC( uiCode, "num_add_output_layer_sets"      ); pcVPS->setNumAddOutputLayerSets( uiCode );
     1361  pcVPS->initTargetLayerIdLists( );
     1362  if( pcVPS->getNumOutputLayerSets() > 1)
     1363  {
     1364    READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); pcVPS->setDefaultTargetOutputLayerIdc( std::min( uiCode, (UInt) 2 ) );   
     1365  } 
     1366
     1367#else
    12801368  Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1;
    12811369
     
    12931381    pcVPS->checkDefaultOneTargetOutputLayerIdc();
    12941382  } 
     1383#endif
    12951384
    12961385  pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 ));
    12971386  pcVPS->setOutputLayerSetIdxMinus1(0, -1);
     1387
     1388#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     1389  pcVPS->deriveTargetLayerIdList( 0 );
     1390  for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
     1391  {
     1392    if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )   
     1393#else
    12981394  for( Int i = 1; i < numOutputLayerSets; i++ )
    12991395  {
    13001396    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
     1397#endif
    13011398    {       
    13021399      READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode );
     1400#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     1401    }
     1402
     1403    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultTargetOutputLayerIdc() == 2 )
     1404    {       
     1405      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ )
     1406      {
     1407        READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 );
     1408      }
     1409    }
     1410    else
     1411    {
     1412      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->getLayerSetIdxForOutputLayerSet( i ) ); j++ )
     1413      {             
     1414        pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j ));
     1415      }
     1416    }
     1417    pcVPS->deriveTargetLayerIdList( i );
     1418#else
    13031419      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
    13041420      {
     
    13141430      }
    13151431    }
    1316 
     1432#endif
    13171433    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    13181434    {     
    13191435      READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode );
    13201436    }
     1437
     1438#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     1439    if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
     1440    {
     1441      READ_FLAG( uiCode, "alt_output_layer_flag[ i ]" ); pcVPS->setAltOutputLayerFlag( i, uiCode == 1 );
     1442    }
     1443  }
     1444#else
    13211445  }
    13221446  if( pcVPS->getMaxLayersMinus1() > 0 )
     
    13241448    READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 );
    13251449  }
     1450#endif
     1451
     1452#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
    13261453  pcVPS->deriveTargetLayerIdLists();
     1454#endif
     1455
    13271456  READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
    13281457  if ( pcVPS->getRepFormatIdxPresentFlag() )
    13291458  {
     1459#if H_MV_HLS_7_VPS_P0306_22
     1460    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
     1461#else
    13301462    READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
     1463#endif
    13311464  }
    13321465
     
    13461479      if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
    13471480      {
     1481#if H_MV_HLS_7_VPS_P0306_22
     1482        READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
     1483#else
    13481484        READ_CODE( 8, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
     1485#endif
    13491486      }
    13501487    }
     
    13521489
    13531490  READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 );
     1491#if H_MV_HLS7_GEN
     1492  READ_FLAG( uiCode, "vps_poc_lsb_aligned_flag" ); pcVPS->setVpsPocLsbAlignedFlag( uiCode == 1 );
     1493#endif
    13541494  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
    13551495  {
     
    13601500  }
    13611501
     1502#if H_MV_HLS_7_RESERVED_FLAGS
     1503  READ_FLAG( uiCode, "vps_reserved_zero_flag" );
     1504#endif
    13621505  parseDpbSize( pcVPS );
    13631506
     
    13881531  } 
    13891532
     1533#if H_MV_HLS_7_VPS_P0307_23
     1534  READ_UVLC( uiCode, "vps_non_vui_extension_length" ); pcVPS->setVpsNonVuiExtensionLength( uiCode );
     1535  for ( Int i = 1; i <= pcVPS->getVpsNonVuiExtensionLength(); i++ )
     1536  {
     1537    READ_CODE( 8, uiCode, "vps_non_vui_extension_data_byte" );
     1538  }
     1539  READ_FLAG( uiCode, "vps_vui_present_flag" );  pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
     1540#endif
     1541#if !H_MV_HLS_7_RESERVED_FLAGS
    13901542  READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" );
    1391 
     1543#endif
    13921544  if( pcVPS->getVpsVuiPresentFlag() )
    13931545  {
     
    13951547    parseVPSVUI( pcVPS );
    13961548  }     
     1549#if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
     1550  {
     1551    TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( );
     1552    assert( pcVPSVUI );
     1553    pcVPSVUI->inferVpsVui( false );
     1554  }
     1555#endif
    13971556
    13981557  pcVPS->checkVPSExtensionSyntax();
     
    14421601    READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 );
    14431602  }
     1603#if H_MV_HLS_7_MISC_P0068_21
     1604  if( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) )
     1605  {
     1606    READ_FLAG( uiCode, "all_layers_idr_aligned_flag" ); pcVPSVUI->setAllLayersIdrAlignedFlag( uiCode == 1 );
     1607  }
     1608#endif
    14441609  READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 );
    14451610  READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 );
    14461611  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    14471612  {
     1613#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     1614    for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1615#else
    14481616    for( Int i = 0; i  <=  pcVPS->getVpsNumberLayerSetsMinus1(); i++ )
     1617#endif
    14491618    {
    14501619      for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ )
     
    14711640    }
    14721641  }
     1642
     1643#if H_MV_HLS_7_VPS_P0076_15
     1644  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
     1645  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     1646  {
     1647    READ_CODE( 4, uiCode, "vps_num_video_signal_info_minus1" ); pcVPSVUI->setVpsNumVideoSignalInfoMinus1( uiCode );
     1648  }
     1649  else
     1650  {
     1651    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1652  }
     1653
     1654  for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
     1655  {
     1656    assert( pcVPSVUI->getVideoSignalInfo( i ) == NULL );
     1657    TComVideoSignalInfo* curVideoSignalInfo = new TComVideoSignalInfo();     
     1658    parseVideoSignalInfo( curVideoSignalInfo );
     1659    pcVPSVUI->setVideoSignalInfo(i, curVideoSignalInfo );
     1660  }
     1661
     1662  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
     1663  {
     1664    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1665    {
     1666      READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode );
     1667      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
     1668    }
     1669  }
     1670  else
     1671  {
     1672    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1673    {
     1674      pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i );
     1675    }
     1676  }
     1677#endif
    14731678
    14741679  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
     
    15071712  }
    15081713
     1714#if H_MV_HLS_7_RESERVED_FLAGS
     1715  READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" );
     1716#endif
     1717
    15091718  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
    15101719
     
    15281737  }
    15291738
     1739#if !H_MV_HLS_7_VPS_P0076_15
    15301740  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
    15311741  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     
    15611771    }
    15621772  }
     1773#endif
    15631774  READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 );
    15641775  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
     
    15661777    parseVpsVuiBspHrdParameters( pcVPS );
    15671778}
     1779#if H_MV_HLS_7_MISC_P0182_13
     1780  for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
     1781  {
     1782    if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i )) == 0 )
     1783    {
     1784      READ_FLAG( uiCode, "base_layer_parameter_set_compatibility_flag" ); pcVPSVUI->setBaseLayerParameterSetCompatibilityFlag( i, uiCode == 1 );
     1785    }
     1786  }
     1787#endif
    15681788}
    15691789
     
    16441864  { 
    16451865    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
    1646 
     1866#if H_MV_HLS_7_HRD_P0156_7
     1867    for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     1868#else
    16471869    for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
     1870#endif
    16481871    { 
    16491872      if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  ) 
     
    16531876      if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
    16541877      { 
     1878#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     1879        for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
     1880#else
    16551881        for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
     1882#endif
    16561883        {
    16571884          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
    16581885        }
    16591886        READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode );
     1887#if H_MV_HLS7_GEN
     1888        if( vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ) != vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ) )
     1889        {
     1890          for( Int k = 0; k < vps->getNumLayersInIdList( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )
     1891          {
     1892            READ_UVLC( uiCode, "max_vps_layer_dec_pic_buff_minus1" ); dpbSize->setMaxVpsLayerDecPicBuffMinus1( i, k, j, uiCode );
     1893          }
     1894        }
     1895#endif
    16601896        READ_UVLC( uiCode, "max_vps_latency_increase_plus1" ); dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode );
    16611897      }
     
    16981934#if H_3D_SPIVMP
    16991935#if SEC_SPIVMP_MCP_SIZE_G0077
    1700         READ_UVLC (uiCode, "log2_sub_PU_size_minus3");     pcVPS->setSubPULog2Size(i, uiCode+3);
     1936        READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3);
    17011937#else
    17021938        READ_UVLC (uiCode, "log2_sub_PU_size_minus2");     pcVPS->setSubPULog2Size(i, uiCode+2);
     
    17551991  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
    17561992  {
     1993#if FIX_CAM_PARS_COLLECTOR
     1994    pcVPS->setCamParPresent         ( viewIndex, false );
     1995    pcVPS->setHasCamParInSliceHeader( viewIndex, false );
     1996#endif
    17571997    READ_FLAG( uiCode, "cp_present_flag[i]" );                  bCamParPresentFlag = ( uiCode == 1);
    17581998    if ( bCamParPresentFlag )
     
    18842124    rpcSlice->checkCrossLayerBlaFlag( );
    18852125
     2126#if !H_MV_HLS7_GEN
    18862127    if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb )
    18872128    {
     
    18892130      READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 );
    18902131    }
     2132#endif
    18912133
    18922134    for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++)   
     
    24862728  if(pps->getSliceHeaderExtensionPresentFlag())
    24872729  {
     2730#if !H_MV_HLS_7_POC_P0041   
    24882731    READ_UVLC(uiCode,"slice_header_extension_length");
    2489 
    24902732    for(Int i=0; i<uiCode; i++)
    24912733    {
     
    24942736    }
    24952737  }
     2738#else
     2739#if H_MV
     2740    READ_UVLC( uiCode, "slice_segment_header_extension_length" ); rpcSlice->setSliceSegmentHeaderExtensionLength( uiCode );
     2741    UInt posFollSliceSegHeaderExtLen = m_pcBitstream->getNumBitsRead();
     2742
     2743    if( rpcSlice->getPPS()->getPocResetInfoPresentFlag() )
     2744    {
     2745      READ_CODE( 2, uiCode, "poc_reset_idc" ); rpcSlice->setPocResetIdc( uiCode );
     2746    }
     2747    else
     2748    {
     2749      rpcSlice->setPocResetIdc( 0 );
     2750    }
     2751
     2752    if( rpcSlice->getPocResetIdc() !=  0 )
     2753    {
     2754      READ_CODE( 6, uiCode, "poc_reset_period_id" ); rpcSlice->setPocResetPeriodId( uiCode );
     2755    }
     2756    else
     2757    {
     2758      // TODO Copy poc_reset_period from earlier picture
     2759      rpcSlice->setPocResetPeriodId( 0 );
     2760    }
     2761   
     2762    if( rpcSlice->getPocResetIdc() ==  3 )
     2763    {
     2764      READ_FLAG( uiCode, "full_poc_reset_flag" ); rpcSlice->setFullPocResetFlag( uiCode == 1 );
     2765      READ_CODE( rpcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); rpcSlice->setPocLsbVal( uiCode );
     2766    }         
     2767
     2768    // Derive the value of PocMsbValRequiredFlag
     2769    rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag()
     2770                                          /* || TODO related to vps_poc_lsb_aligned_flag */
     2771                                          );
     2772
     2773    if( !rpcSlice->getPocMsbValRequiredFlag() /* TODO &&  rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() */ )
     2774    {
     2775      READ_FLAG( uiCode, "poc_msb_val_present_flag" ); rpcSlice->setPocMsbValPresentFlag( uiCode == 1 );
     2776    }
     2777    else
     2778    {
     2779      if( rpcSlice->getPocMsbValRequiredFlag() )
     2780      {
     2781        rpcSlice->setPocMsbValPresentFlag( true );
     2782      }
     2783      else
     2784      {
     2785        rpcSlice->setPocMsbValPresentFlag( false );
     2786      }
     2787    }
     2788
     2789   
     2790    if( rpcSlice->getPocMsbValPresentFlag() )
     2791    {
     2792      READ_UVLC( uiCode, "poc_msb_val" ); rpcSlice->setPocMsbVal( uiCode );
     2793    }
     2794
     2795    while( ( m_pcBitstream->getNumBitsRead() - posFollSliceSegHeaderExtLen ) < rpcSlice->getSliceSegmentHeaderExtensionLength() * 8 )
     2796    {
     2797     READ_FLAG( uiCode, "slice_segment_header_extension_data_bit" );
     2798    }
     2799    assert( ( m_pcBitstream->getNumBitsRead() - posFollSliceSegHeaderExtLen ) == rpcSlice->getSliceSegmentHeaderExtensionLength() * 8  );
     2800#else
     2801    READ_UVLC( uiCode, "slice_header_extension_length" );
     2802    for(Int i=0; i<uiCode; i++)
     2803    {
     2804      UInt ignore;
     2805      READ_CODE(8,ignore,"slice_header_extension_data_byte");
     2806    }
     2807  }
     2808#endif
     2809#endif
     2810  }
     2811
    24962812
    24972813  m_pcBitstream->readByteAlignment();
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    640640  m_ppcCU[uiDepth]->copySubCU( pcCU, uiAbsPartIdx, uiDepth );
    641641 
     642#if H_MV_ENC_DEC_TRAC
     643#if ENC_DEC_TRACE
     644  stopAtPos  ( m_ppcCU[uiDepth]->getSlice()->getPOC(),
     645    m_ppcCU[uiDepth]->getSlice()->getLayerId(),
     646    m_ppcCU[uiDepth]->getCUPelX(),
     647    m_ppcCU[uiDepth]->getCUPelY(),
     648    m_ppcCU[uiDepth]->getWidth(0),
     649    m_ppcCU[uiDepth]->getHeight(0) );
     650#endif
     651#endif
     652
    642653  switch( m_ppcCU[uiDepth]->getPredictionMode(0) )
    643654  {
     
    918929#endif
    919930 
     931#if H_3D && UPDATE_HM13
     932  Bool useDltFlag = (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps());
     933
     934  if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) || useDltFlag )
     935#else
     936  if ( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) )
     937#endif
     938  {
    920939  //===== inverse transform =====
    921940  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 );
    922941
    923942  Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA];
    924   assert(scalingListType < 6);
     943    assert(scalingListType < SCALING_LIST_NUM);
    925944  m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkip );
    926945
     
    936955    {
    937956#if H_3D
     957#if UPDATE_HM13
     958      if ( useDltFlag )
     959#else
    938960      if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     961#endif
    939962      {
    940963        pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     
    953976    pReco     += uiStride;
    954977    pRecIPred += uiRecIPredStride;
     978  }
     979}
     980  else
     981  {
     982    //===== reconstruction =====
     983    Pel* pPred      = piPred;
     984    Pel* pReco      = piReco;
     985    Pel* pRecIPred  = piRecIPred;
     986    for ( Int y = 0; y < uiHeight; y++ )
     987    {
     988      for ( Int x = 0; x < uiWidth; x++ )
     989      {
     990        pReco    [ x ] = pPred[ x ];
     991        pRecIPred[ x ] = pReco[ x ];
     992      }
     993      pPred     += uiStride;
     994      pReco     += uiStride;
     995      pRecIPred += uiRecIPredStride;
     996    }
    955997  }
    956998}
     
    10221064  }
    10231065
     1066  if ( pcCU->getCbf( uiAbsPartIdx, eText, uiTrDepth ) )
     1067  {
    10241068  //===== inverse transform =====
    10251069  Int curChromaQpOffset;
     
    10351079
    10361080  Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText];
    1037   assert(scalingListType < 6);
     1081    assert(scalingListType < SCALING_LIST_NUM);
    10381082  m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkipChroma );
    10391083
     
    10541098    pReco     += uiStride;
    10551099    pRecIPred += uiRecIPredStride;
     1100  }
     1101}
     1102  else
     1103  {
     1104    //===== reconstruction =====
     1105    Pel* pPred      = piPred;
     1106    Pel* pReco      = piReco;
     1107    Pel* pRecIPred  = piRecIPred;
     1108    for ( Int y = 0; y < uiHeight; y++ )
     1109    {
     1110      for ( Int x = 0; x < uiWidth; x++ )
     1111      {
     1112        pReco    [ x ] = pPred[ x ];
     1113        pRecIPred[ x ] = pReco[ x ];
     1114      }
     1115      pPred     += uiStride;
     1116      pReco     += uiStride;
     1117      pRecIPred += uiRecIPredStride;
     1118    }   
    10561119  }
    10571120}
  • trunk/source/Lib/TLibDecoder/TDecCu.h

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    580580}
    581581
    582 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP)
     582Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Int quadtreeTULog2MinSizeInCU)
    583583{
    584584  UInt uiSubdiv;
     
    604604  else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) )
    605605  {
    606     uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx));
     606    uiSubdiv = (uiLog2TrafoSize > quadtreeTULog2MinSizeInCU);
    607607  }
    608608  else if( uiLog2TrafoSize > pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
     
    614614    uiSubdiv = 0;
    615615  }
    616   else if( uiLog2TrafoSize == pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) )
     616  else if( uiLog2TrafoSize == quadtreeTULog2MinSizeInCU )
    617617  {
    618618    uiSubdiv = 0;
     
    620620  else
    621621  {
    622     assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) );
     622    assert( uiLog2TrafoSize > quadtreeTULog2MinSizeInCU );
    623623    m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize );
    624624  }
     
    666666    for( Int i = 0; i < 4; i++ )
    667667    {
    668       xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
     668      xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, quadtreeTULog2MinSizeInCU );
    669669      uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 );
    670670      uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 );
     
    886886   
    887887  }
    888   xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP );
     888
     889  Int getQuadtreeTULog2MinSizeInCU = pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx);
     890
     891  xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, getQuadtreeTULog2MinSizeInCU );
    889892}
    890893
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    210210 
    211211private:
    212   Void xDecodeTransform        ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP );
     212  Void xDecodeTransform        ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Int getQuadtreeTULog2MinSizeInCU );
    213213
    214214public:
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r655 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    112112  //-- For time output for each slice
    113113  long iBeforeTime = clock();
    114  
    115   UInt uiStartCUAddr   = pcSlice->getSliceSegmentCurStartCUAddr();
    116 
    117   UInt uiSliceStartCuAddr = pcSlice->getSliceCurStartCUAddr();
    118   if(uiSliceStartCuAddr == uiStartCUAddr)
    119   {
    120     m_sliceStartCUAddress.push_back(uiSliceStartCuAddr);
    121   }
    122 
    123114  m_pcSbacDecoder->init( (TDecBinIf*)m_pcBinCABAC );
    124115  m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder);
     
    147138  m_pcEntropyDecoder->setBitstream      ( ppcSubstreams[0] );
    148139  m_pcEntropyDecoder->resetEntropy      (pcSlice);
    149 
    150   if(uiSliceStartCuAddr == uiStartCUAddr)
    151   {
    152     m_LFCrossSliceBoundaryFlag.push_back( pcSlice->getLFCrossSliceBoundaryFlag());
    153   }
    154140#if H_3D_NBDV
    155141  if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //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.
     
    199185  m_pcLoopFilter->setCfg(bLFCrossTileBoundary);
    200186  m_pcLoopFilter->loopFilterPic( rpcPic );
    201 
    202   if(pcSlice->getSPS()->getUseSAO())
    203   {
    204     m_sliceStartCUAddress.push_back(rpcPic->getNumCUsInFrame()* rpcPic->getNumPartInCU());
    205     rpcPic->createNonDBFilterInfo(m_sliceStartCUAddress, 0, &m_LFCrossSliceBoundaryFlag, rpcPic->getPicSym()->getNumTiles(), bLFCrossTileBoundary);
    206   }
    207 
    208187  if( pcSlice->getSPS()->getUseSAO() )
    209188  {
    210     {
    211       SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam();
    212       saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
    213       saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
    214       m_pcSAO->setSaoLcuBasedOptimization(1);
    215       m_pcSAO->createPicSaoInfo(rpcPic);
    216       m_pcSAO->SAOProcess(saoParam);
    217       m_pcSAO->PCMLFDisableProcess(rpcPic);
    218       m_pcSAO->destroyPicSaoInfo();
    219     }
    220   }
    221 
    222   if(pcSlice->getSPS()->getUseSAO())
    223   {
    224     rpcPic->destroyNonDBFilterInfo();
     189    m_pcSAO->reconstructBlkSAOParams(rpcPic, rpcPic->getPicSym()->getSAOBlkParam());
     190    m_pcSAO->SAOProcess(rpcPic);
     191    m_pcSAO->PCMLFDisableProcess(rpcPic);
    225192  }
    226193#if H_3D
     
    284251  rpcPic->setOutputMark(true);
    285252  rpcPic->setReconMark(true);
    286   m_sliceStartCUAddress.clear();
    287   m_LFCrossSliceBoundaryFlag.clear();
    288253}
    289254
  • trunk/source/Lib/TLibDecoder/TDecGop.h

    r608 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    8383  Int                   m_decodedPictureHashSEIEnabled;  ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
    8484
    85   //! list that contains the CU address of each slice plus the end address
    86   std::vector<Int> m_sliceStartCUAddress;
    87   std::vector<Bool> m_LFCrossSliceBoundaryFlag;
    88 
    8985public:
    9086  TDecGop();
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7878, m_cCUAbsSCModel             ( 1,             1,               NUM_ABS_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    7979, m_cMVPIdxSCModel            ( 1,             1,               NUM_MVP_IDX_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
    80 , m_cCUAMPSCModel             ( 1,             1,               NUM_CU_AMP_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
    8180, m_cSaoMergeSCModel      ( 1,             1,               NUM_SAO_MERGE_FLAG_CTX   , m_contextModels + m_numContextModels, m_numContextModels)
    8281, m_cSaoTypeIdxSCModel        ( 1,             1,               NUM_SAO_TYPE_IDX_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
     
    155154#endif
    156155  m_cCUPartSizeSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_PART_SIZE );
    157   m_cCUAMPSCModel.initBuffer             ( sliceType, qp, (UChar*)INIT_CU_AMP_POS );
    158156  m_cCUPredModeSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_PRED_MODE );
    159157  m_cCUIntraPredSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_INTRA_PRED_MODE );
     
    236234#endif
    237235  m_cCUPartSizeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PART_SIZE );
    238   m_cCUAMPSCModel.initBuffer             ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS );
    239236  m_cCUPredModeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PRED_MODE );
    240237  m_cCUIntraPredSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_INTRA_PRED_MODE );
     
    906903        if (eMode == SIZE_2NxN)
    907904        {
    908           m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
     905        m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 ));
    909906          if (uiSymbol == 0)
    910907          {
     
    915912        else if (eMode == SIZE_Nx2N)
    916913        {
    917           m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
     914        m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 ));
    918915          if (uiSymbol == 0)
    919916          {
     
    20092006    if (uiCode == 0)
    20102007    {
    2011       ruiVal = 5;
     2008      ruiVal = 1;
    20122009    }
    20132010    else
    20142011    {
    2015       ruiVal = 1;
    2016     }
    2017   }
    2018 }
    2019 
    2020 inline Void copySaoOneLcuParam(SaoLcuParam* psDst,  SaoLcuParam* psSrc)
    2021 {
    2022   Int i;
    2023   psDst->partIdx = psSrc->partIdx;
    2024   psDst->typeIdx    = psSrc->typeIdx;
    2025   if (psDst->typeIdx != -1)
    2026   {
    2027     psDst->subTypeIdx = psSrc->subTypeIdx ;
    2028     psDst->length  = psSrc->length;
    2029     for (i=0;i<psDst->length;i++)
    2030     {
    2031       psDst->offset[i] = psSrc->offset[i];
    2032     }
    2033   }
    2034   else
    2035   {
    2036     psDst->length  = 0;
    2037     for (i=0;i<SAO_BO_LEN;i++)
    2038     {
    2039       psDst->offset[i] = 0;
    2040     }
    2041   }
    2042 }
    2043 
    2044 Void TDecSbac::parseSaoOffset(SaoLcuParam* psSaoLcuParam, UInt compIdx)
     2012      ruiVal = 2;
     2013    }
     2014  }
     2015}
     2016
     2017Void TDecSbac::parseSaoSign(UInt& val)
     2018{
     2019  m_pcTDecBinIf->decodeBinEP ( val );
     2020}
     2021
     2022Void TDecSbac::parseSAOBlkParam (SAOBlkParam& saoBlkParam
     2023                                , Bool* sliceEnabled
     2024                                , Bool leftMergeAvail
     2025                                , Bool aboveMergeAvail
     2026                                )
    20452027{
    20462028  UInt uiSymbol;
    2047   static Int iTypeLength[MAX_NUM_SAO_TYPE] =
    2048   {
    2049     SAO_EO_LEN,
    2050     SAO_EO_LEN,
    2051     SAO_EO_LEN,
    2052     SAO_EO_LEN,
    2053     SAO_BO_LEN
    2054   };
    2055 
    2056   if (compIdx==2)
    2057   {
    2058     uiSymbol = (UInt)( psSaoLcuParam->typeIdx + 1);
    2059   }
    2060   else
    2061   {
    2062     parseSaoTypeIdx(uiSymbol);
    2063   }
    2064   psSaoLcuParam->typeIdx = (Int)uiSymbol - 1;
    2065   if (uiSymbol)
    2066   {
    2067     psSaoLcuParam->length = iTypeLength[psSaoLcuParam->typeIdx];
    2068 
    2069     Int bitDepth = compIdx ? g_bitDepthC : g_bitDepthY;
    2070     Int offsetTh = 1 << min(bitDepth - 5,5);
    2071 
    2072     if( psSaoLcuParam->typeIdx == SAO_BO )
    2073     {
    2074       for(Int i=0; i< psSaoLcuParam->length; i++)
    2075       {
    2076         parseSaoMaxUvlc(uiSymbol, offsetTh -1 );
    2077         psSaoLcuParam->offset[i] = uiSymbol;
     2029
     2030  Bool isLeftMerge = false;
     2031  Bool isAboveMerge= false;
     2032
     2033  if(leftMergeAvail)
     2034  {
     2035    parseSaoMerge(uiSymbol); //sao_merge_left_flag
     2036    isLeftMerge = (uiSymbol?true:false);
     2037  }
     2038
     2039  if( aboveMergeAvail && !isLeftMerge)
     2040  {
     2041    parseSaoMerge(uiSymbol); //sao_merge_up_flag
     2042    isAboveMerge = (uiSymbol?true:false);
     2043  }
     2044
     2045  if(isLeftMerge || isAboveMerge) //merge mode
     2046      {
     2047    saoBlkParam[SAO_Y].modeIdc = saoBlkParam[SAO_Cb].modeIdc = saoBlkParam[SAO_Cr].modeIdc = SAO_MODE_MERGE;
     2048    saoBlkParam[SAO_Y].typeIdc = saoBlkParam[SAO_Cb].typeIdc = saoBlkParam[SAO_Cr].typeIdc = (isLeftMerge)?SAO_MERGE_LEFT:SAO_MERGE_ABOVE;
    20782049      }   
    2079       for(Int i=0; i< psSaoLcuParam->length; i++)
    2080       {
    2081         if (psSaoLcuParam->offset[i] != 0)
    2082         {
    2083           m_pcTDecBinIf->decodeBinEP ( uiSymbol);
    2084           if (uiSymbol)
     2050  else //new or off mode
     2051      {
     2052    for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++)
     2053        {
     2054      SAOOffset& ctbParam = saoBlkParam[compIdx];
     2055
     2056      if(!sliceEnabled[compIdx])
    20852057          {
    2086             psSaoLcuParam->offset[i] = -psSaoLcuParam->offset[i] ;
    2087           }
    2088         }
    2089       }
    2090       parseSaoUflc(5, uiSymbol );
    2091       psSaoLcuParam->subTypeIdx = uiSymbol;
    2092     }
    2093     else if( psSaoLcuParam->typeIdx < 4 )
    2094     {
    2095       parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[0] = uiSymbol;
    2096       parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[1] = uiSymbol;
    2097       parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[2] = -(Int)uiSymbol;
    2098       parseSaoMaxUvlc(uiSymbol, offsetTh -1 ); psSaoLcuParam->offset[3] = -(Int)uiSymbol;
    2099      if (compIdx != 2)
     2058        //off
     2059        ctbParam.modeIdc = SAO_MODE_OFF;
     2060        continue;
     2061        }
     2062
     2063      //type
     2064      if(compIdx == SAO_Y || compIdx == SAO_Cb)
     2065    {
     2066        parseSaoTypeIdx(uiSymbol); //sao_type_idx_luma or sao_type_idx_chroma
     2067
     2068        assert(uiSymbol ==0 || uiSymbol ==1 || uiSymbol ==2);
     2069
     2070        if(uiSymbol ==0) //OFF
    21002071     {
    2101        parseSaoUflc(2, uiSymbol );
    2102        psSaoLcuParam->subTypeIdx = uiSymbol;
    2103        psSaoLcuParam->typeIdx += psSaoLcuParam->subTypeIdx;
    2104      }
     2072          ctbParam.modeIdc = SAO_MODE_OFF;
    21052073   }
    2106   }
    2107   else
    2108   {
    2109     psSaoLcuParam->length = 0;
    2110   }
    2111 }
    2112 
    2113 Void TDecSbac::parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp)
    2114 {
    2115   Int iAddr = pcCU->getAddr();
    2116   UInt uiSymbol;
    2117   for (Int iCompIdx=0; iCompIdx<3; iCompIdx++)
    2118   {
    2119     pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag    = 0;
    2120     pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag  = 0;
    2121     pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx     = 0;
    2122     pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx        = -1;
    2123     pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[0]     = 0;
    2124     pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[1]     = 0;
    2125     pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[2]     = 0;
    2126     pSaoParam->saoLcuParam[iCompIdx][iAddr].offset[3]     = 0;
    2127 
    2128   }
    2129  if (pSaoParam->bSaoFlag[0] || pSaoParam->bSaoFlag[1] )
    2130   {
    2131     if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft)
    2132     {
    2133       parseSaoMerge(uiSymbol);
    2134       pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag = (Bool)uiSymbol; 
    2135     }
    2136     if (pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag==0)
    2137     {
    2138       if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp)
    2139       {
    2140         parseSaoMerge(uiSymbol);
    2141         pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag = (Bool)uiSymbol;
    2142       }
    2143     }
    2144   }
    2145 
    2146   for (Int iCompIdx=0; iCompIdx<3; iCompIdx++)
    2147   {
    2148     if ((iCompIdx == 0  && pSaoParam->bSaoFlag[0]) || (iCompIdx > 0  && pSaoParam->bSaoFlag[1]) )
    2149     {
    2150       if (rx>0 && iCUAddrInSlice!=0 && allowMergeLeft)
    2151       {
    2152         pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = pSaoParam->saoLcuParam[0][iAddr].mergeLeftFlag;
    2153       }
    2154       else
    2155       {
    2156         pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag = 0;
    2157       }
    2158 
    2159       if (pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeLeftFlag==0)
    2160       {
    2161         if ((ry > 0) && (iCUAddrUpInSlice>=0) && allowMergeUp)
    2162         {
    2163           pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = pSaoParam->saoLcuParam[0][iAddr].mergeUpFlag;
     2074        else if(uiSymbol == 1) //BO
     2075        {
     2076          ctbParam.modeIdc = SAO_MODE_NEW;
     2077          ctbParam.typeIdc = SAO_TYPE_START_BO;
     2078  }
     2079        else //2, EO
     2080  {
     2081          ctbParam.modeIdc = SAO_MODE_NEW;
     2082          ctbParam.typeIdc = SAO_TYPE_START_EO;
     2083        }
     2084
     2085  }
     2086      else //Cr, follow Cb SAO type
     2087      {
     2088        ctbParam.modeIdc = saoBlkParam[SAO_Cb].modeIdc;
     2089        ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc;
     2090}
     2091
     2092      if(ctbParam.modeIdc == SAO_MODE_NEW)
     2093{
     2094        Int offset[4];
     2095        for(Int i=0; i< 4; i++)
     2096  {
     2097          parseSaoMaxUvlc(uiSymbol,  g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs
     2098          offset[i] = (Int)uiSymbol;
     2099  }
     2100
     2101        if(ctbParam.typeIdc == SAO_TYPE_START_BO)
     2102  {
     2103          for(Int i=0; i< 4; i++)
     2104    {
     2105            if(offset[i] != 0)
     2106    {
     2107              parseSaoSign(uiSymbol); //sao_offset_sign
     2108              if(uiSymbol)
     2109      {
     2110                offset[i] = -offset[i];
     2111      }
     2112    }
     2113  }
     2114          parseSaoUflc(NUM_SAO_BO_CLASSES_LOG2, uiSymbol ); //sao_band_position
     2115          ctbParam.typeAuxInfo = uiSymbol;
     2116
     2117          for(Int i=0; i<4; i++)
     2118      {
     2119            ctbParam.offset[(ctbParam.typeAuxInfo+i)%MAX_NUM_SAO_CLASSES] = offset[i];
     2120      }
     2121
     2122        }
     2123        else //EO
     2124        {
     2125          ctbParam.typeAuxInfo = 0;
     2126
     2127          if(compIdx == SAO_Y || compIdx == SAO_Cb)
     2128        {
     2129            parseSaoUflc(NUM_SAO_EO_TYPES_LOG2, uiSymbol ); //sao_eo_class_luma or sao_eo_class_chroma
     2130            ctbParam.typeIdc += uiSymbol;
    21642131        }
    21652132        else
    21662133        {
    2167           pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag = 0;
    2168         }
    2169         if (!pSaoParam->saoLcuParam[iCompIdx][iAddr].mergeUpFlag)
    2170         {
    2171           pSaoParam->saoLcuParam[2][iAddr].typeIdx = pSaoParam->saoLcuParam[1][iAddr].typeIdx;
    2172           parseSaoOffset(&(pSaoParam->saoLcuParam[iCompIdx][iAddr]), iCompIdx);
    2173         }
    2174         else
    2175         {
    2176           copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr], &pSaoParam->saoLcuParam[iCompIdx][iAddr-pSaoParam->numCuInWidth]);
    2177         }
    2178       }
    2179       else
    2180       {
    2181         copySaoOneLcuParam(&pSaoParam->saoLcuParam[iCompIdx][iAddr],  &pSaoParam->saoLcuParam[iCompIdx][iAddr-1]);
    2182       }
    2183     }
    2184     else
    2185     {
    2186       pSaoParam->saoLcuParam[iCompIdx][iAddr].typeIdx = -1;
    2187       pSaoParam->saoLcuParam[iCompIdx][iAddr].subTypeIdx = 0;
     2134            ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc;
     2135        }
     2136          ctbParam.offset[SAO_CLASS_EO_FULL_VALLEY] = offset[0];
     2137          ctbParam.offset[SAO_CLASS_EO_HALF_VALLEY] = offset[1];
     2138          ctbParam.offset[SAO_CLASS_EO_PLAIN      ] = 0;
     2139          ctbParam.offset[SAO_CLASS_EO_HALF_PEAK  ] = -offset[2];
     2140          ctbParam.offset[SAO_CLASS_EO_FULL_PEAK  ] = -offset[3];
     2141      }
     2142      }
    21882143    }
    21892144  }
     
    24242379#endif
    24252380
     2381
     2382
    24262383//! \}
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    9494  Void  parseSaoTypeIdx           ( UInt&  ruiVal  );
    9595  Void  parseSaoUflc              ( UInt uiLength, UInt& ruiVal     );
    96   Void  parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp);
    97   Void  parseSaoOffset            (SaoLcuParam* psSaoLcuParam, UInt compIdx);
     96  Void parseSAOBlkParam (SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail);
     97  Void parseSaoSign(UInt& val);
    9898private:
    9999  Void  xReadUnarySymbol    ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset );
     
    209209  ContextModel3DBuffer m_cMVPIdxSCModel;
    210210 
    211   ContextModel3DBuffer m_cCUAMPSCModel;
    212211  ContextModel3DBuffer m_cSaoMergeSCModel;
    213212  ContextModel3DBuffer m_cSaoTypeIdxSCModel;
  • trunk/source/Lib/TLibDecoder/TDecSlice.cpp

    r608 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    313313    g_bJustDoIt = g_bEncDecTraceEnable;
    314314#endif
    315     if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) )
    316     {
    317       SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam();
    318       saoParam->bSaoFlag[0] = pcSlice->getSaoEnabledFlag();
    319       if (iCUAddr == iStartCUAddr)
    320       {
    321         saoParam->bSaoFlag[1] = pcSlice->getSaoEnabledFlagChroma();
    322       }
    323       Int numCuInWidth     = saoParam->numCuInWidth;
    324       Int cuAddrInSlice = iCUAddr - rpcPic->getPicSym()->getCUOrderMap(pcSlice->getSliceCurStartCUAddr()/rpcPic->getNumPartInCU());
    325       Int cuAddrUpInSlice  = cuAddrInSlice - numCuInWidth;
    326       Int rx = iCUAddr % numCuInWidth;
    327       Int ry = iCUAddr / numCuInWidth;
    328       Int allowMergeLeft = 1;
    329       Int allowMergeUp   = 1;
    330       if (rx!=0)
    331       {
    332         if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-1) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
    333         {
    334           allowMergeLeft = 0;
    335         }
    336       }
    337       if (ry!=0)
    338       {
    339         if (rpcPic->getPicSym()->getTileIdxMap(iCUAddr-numCuInWidth) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))
    340         {
    341           allowMergeUp = 0;
    342         }
    343       }
    344       pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, saoParam,pcCU, cuAddrInSlice, cuAddrUpInSlice, allowMergeLeft, allowMergeUp);
    345     }
    346     else if ( pcSlice->getSPS()->getUseSAO() )
    347     {
    348       Int addr = pcCU->getAddr();
    349       SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam();
    350       for (Int cIdx=0; cIdx<3; cIdx++)
    351       {
    352         SaoLcuParam *saoLcuParam = &(saoParam->saoLcuParam[cIdx][addr]);
    353         if ( ((cIdx == 0) && !pcSlice->getSaoEnabledFlag()) || ((cIdx == 1 || cIdx == 2) && !pcSlice->getSaoEnabledFlagChroma()))
    354         {
    355           saoLcuParam->mergeUpFlag   = 0;
    356           saoLcuParam->mergeLeftFlag = 0;
    357           saoLcuParam->subTypeIdx    = 0;
    358           saoLcuParam->typeIdx       = -1;
    359           saoLcuParam->offset[0]     = 0;
    360           saoLcuParam->offset[1]     = 0;
    361           saoLcuParam->offset[2]     = 0;
    362           saoLcuParam->offset[3]     = 0;
    363         }
     315
     316    if ( pcSlice->getSPS()->getUseSAO() )
     317      {
     318      SAOBlkParam& saoblkParam = (rpcPic->getPicSym()->getSAOBlkParam())[iCUAddr];
     319      if (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma())
     320      {
     321        Bool sliceEnabled[NUM_SAO_COMPONENTS];
     322        sliceEnabled[SAO_Y] = pcSlice->getSaoEnabledFlag();
     323        sliceEnabled[SAO_Cb]= sliceEnabled[SAO_Cr]= pcSlice->getSaoEnabledFlagChroma();
     324
     325        Bool leftMergeAvail = false;
     326        Bool aboveMergeAvail= false;
     327
     328        //merge left condition
     329        Int rx = (iCUAddr % uiWidthInLCUs);
     330        if(rx > 0)
     331        {
     332          leftMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-1);
     333        }
     334        //merge up condition
     335        Int ry = (iCUAddr / uiWidthInLCUs);
     336        if(ry > 0)
     337        {
     338          aboveMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-uiWidthInLCUs);
     339      }
     340
     341        pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail);
     342    }
     343      else
     344        {
     345        saoblkParam[SAO_Y ].modeIdc = SAO_MODE_OFF;
     346        saoblkParam[SAO_Cb].modeIdc = SAO_MODE_OFF;
     347        saoblkParam[SAO_Cr].modeIdc = SAO_MODE_OFF;
    364348      }
    365349    }
  • trunk/source/Lib/TLibDecoder/TDecSlice.h

    r655 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r773 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5151  m_aaiCodedOffset         = new Int* [ MAX_NUM_LAYERS ];
    5252  m_aaiCodedScale          = new Int* [ MAX_NUM_LAYERS ];
     53#if !FIX_CAM_PARS_COLLECTOR
    5354  m_aiViewId               = new Int  [ MAX_NUM_LAYERS ];
    5455
    5556  m_bViewReceived          = new Bool [ MAX_NUM_LAYERS ];
     57#endif
    5658  for( UInt uiId = 0; uiId < MAX_NUM_LAYERS; uiId++ )
    5759  {
     
    6365  m_iLog2Precision   = LOG2_DISP_PREC_LUT;
    6466  m_uiBitDepthForLUT = 8; // fixed
     67#if FIX_CAM_PARS_COLLECTOR
     68  m_receivedIdc = NULL;
     69  m_vps         = NULL;
     70#endif
    6571}
    6672
     
    7480  delete [] m_aaiCodedOffset;
    7581  delete [] m_aaiCodedScale;
     82#if !FIX_CAM_PARS_COLLECTOR
    7683  delete [] m_aiViewId; 
    7784  delete [] m_bViewReceived;
     85#endif
    7886
    7987  xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
    8088  xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
    81 }
    82 
     89#if FIX_CAM_PARS_COLLECTOR
     90  xDeleteArray( m_receivedIdc, m_uiMaxViewIndex + 1 );
     91#endif
     92}
     93
     94
     95#if FIX_CAM_PARS_COLLECTOR
     96Void
     97CamParsCollector::init( FILE* pCodedScaleOffsetFile, TComVPS* vps)
     98{
     99  assert( !isInitialized() ); // Only one initialization currently supported
     100  m_bInitialized            = true;
     101  m_vps                     = vps;
     102  m_bCamParsVaryOverTime    = false;
     103  m_pCodedScaleOffsetFile   = pCodedScaleOffsetFile;
     104  m_lastPoc                 = -1;   
     105  m_firstReceivedPoc        = -2;
     106
     107  m_uiMaxViewIndex            = -1;
     108  for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++)
     109  {
     110    Int curViewIdx = m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ));
     111    m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->hasCamParInSliceHeader( curViewIdx );
     112    m_uiMaxViewIndex = std::max( m_uiMaxViewIndex, curViewIdx  ) ;
     113  }
     114
     115  assert( m_receivedIdc == NULL );
     116  m_receivedIdc = new Int*[ m_uiMaxViewIndex + 1];
     117  for (Int i = 0; i <= m_uiMaxViewIndex; i++)
     118  {
     119    m_receivedIdc[i] = new Int[ m_uiMaxViewIndex + 1 ];
     120  }
     121
     122  xResetReceivedIdc( true );
     123
     124  for (Int viewIndex = 0; viewIndex <= m_uiMaxViewIndex ; viewIndex++ )
     125  {
     126    if (m_vps->getCamParPresent( viewIndex ) )
     127    {   
     128      if( !m_vps->hasCamParInSliceHeader( viewIndex ) )
     129      {
     130        for (Int baseViewIndex = 0; baseViewIndex < viewIndex ; baseViewIndex++ )
     131        {
     132          m_receivedIdc   [ baseViewIndex ][ viewIndex ] = -1;
     133          m_aaiCodedScale [ baseViewIndex ][ viewIndex ] = m_vps->getCodedScale    (viewIndex) [ baseViewIndex ];
     134          m_aaiCodedOffset[ baseViewIndex ][ viewIndex ] = m_vps->getCodedOffset   (viewIndex) [ baseViewIndex ];
     135
     136          m_receivedIdc   [ viewIndex ][ baseViewIndex ] = -1;
     137          m_aaiCodedScale [ viewIndex ][ baseViewIndex ] = m_vps->getInvCodedScale (viewIndex) [ baseViewIndex ];
     138          m_aaiCodedOffset[ viewIndex ][ baseViewIndex ] = m_vps->getInvCodedOffset(viewIndex) [ baseViewIndex ];
     139          xInitLUTs( baseViewIndex, viewIndex, m_aaiCodedScale[ baseViewIndex ][ viewIndex ], m_aaiCodedOffset[ baseViewIndex ][ viewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     140          xInitLUTs( viewIndex, baseViewIndex, m_aaiCodedScale[ viewIndex ][ baseViewIndex ], m_aaiCodedOffset[ viewIndex ][ baseViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     141        }
     142      }
     143    }
     144  }
     145}
     146
     147Void
     148CamParsCollector::xResetReceivedIdc( Bool overWriteFlag )
     149{
     150  for (Int i = 0; i <= m_uiMaxViewIndex; i++)
     151  { 
     152    for (Int j = 0; j <= m_uiMaxViewIndex; j++)
     153    {
     154      if ( overWriteFlag ||  ( m_receivedIdc[i][j] != -1 ) )
     155      {
     156        m_receivedIdc[i][j] = 0;
     157      }     
     158    }
     159  }
     160}
     161#else
    83162Void
    84163CamParsCollector::init( FILE* pCodedScaleOffsetFile )
     
    92171  m_uiMaxViewIndex             = 0;
    93172}
     173#endif
     174
     175
    94176
    95177Void
     
    124206  CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT)
    125207{
     208#if FIX_CAM_PARS_COLLECTOR
     209  Int     iLog2DivLuma   = m_uiBitDepthForLUT + m_vps->getCamParPrecision() + 1 - m_iLog2Precision;   AOF( iLog2DivLuma > 0 );
     210#else
    126211  Int     iLog2DivLuma   = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision;   AOF( iLog2DivLuma > 0 );
     212#endif
    127213  Int     iLog2DivChroma = iLog2DivLuma + 1;
    128214
     
    166252}
    167253
     254#if !FIX_CAM_PARS_COLLECTOR
    168255Void
    169256CamParsCollector::setSlice( TComSlice* pcSlice )
     
    284371}
    285372
     373#else
     374Void
     375CamParsCollector::setSlice( TComSlice* pcSlice )
     376{
     377  if( pcSlice == 0 )
     378  {
     379    xOutput( m_lastPoc );
     380    return;
     381  }
     382
     383  if ( pcSlice->getIsDepth())
     384  {
     385    return;
     386  }
     387
     388  Int curPoc = pcSlice->getPOC();
     389  if( m_firstReceivedPoc == -2 )
     390  {
     391    m_firstReceivedPoc = curPoc;
     392  }
     393
     394  Bool newPocFlag = ( m_lastPoc != curPoc ); 
     395
     396  if ( newPocFlag )
     397  {   
     398    if( m_lastPoc != -1 )
     399    {
     400      xOutput( m_lastPoc );
     401    }
     402
     403    xResetReceivedIdc( false );
     404    m_lastPoc = pcSlice->getPOC();
     405  }
     406
     407  UInt uiViewIndex          = pcSlice->getViewIndex(); 
     408  if( m_vps->getCamParPresent( uiViewIndex ) )
     409  {   
     410    if( m_vps->hasCamParInSliceHeader( uiViewIndex ) ) // check consistency of slice parameters here
     411    {   
     412      for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < uiViewIndex; uiBaseViewIndex++ )
     413      {       
     414        if ( m_receivedIdc[ uiViewIndex ][ uiBaseViewIndex ] != 0 )
     415        {     
     416          AOF( m_aaiCodedScale [ uiViewIndex ][ uiBaseViewIndex ] == pcSlice->getInvCodedScale () [ uiBaseViewIndex ] );
     417          AOF( m_aaiCodedOffset[ uiViewIndex ][ uiBaseViewIndex ] == pcSlice->getInvCodedOffset() [ uiBaseViewIndex ] );
     418        }
     419        else
     420        {         
     421          m_receivedIdc   [ uiViewIndex ][ uiBaseViewIndex ]  = 1;
     422          m_aaiCodedScale [ uiViewIndex ][ uiBaseViewIndex ]  = pcSlice->getInvCodedScale () [ uiBaseViewIndex ];
     423          m_aaiCodedOffset[ uiViewIndex ][ uiBaseViewIndex ]  = pcSlice->getInvCodedOffset() [ uiBaseViewIndex ];
     424          xInitLUTs( uiViewIndex, uiBaseViewIndex, m_aaiCodedScale[ uiViewIndex ][ uiBaseViewIndex ], m_aaiCodedOffset[ uiViewIndex ][ uiBaseViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
     425        }
     426        if ( m_receivedIdc[ uiBaseViewIndex ][ uiViewIndex ] != 0 )
     427        {     
     428          AOF( m_aaiCodedScale [ uiBaseViewIndex ][ uiViewIndex ] == pcSlice->getCodedScale    () [ uiBaseViewIndex ] );
     429          AOF( m_aaiCodedOffset[ uiBaseViewIndex ][ uiViewIndex ] == pcSlice->getCodedOffset   () [ uiBaseViewIndex ] );
     430        }
     431        else
     432        {       
     433          m_receivedIdc   [ uiBaseViewIndex ][ uiViewIndex ]  = 1;
     434          m_aaiCodedScale [ uiBaseViewIndex ][ uiViewIndex ]  = pcSlice->getCodedScale    () [ uiBaseViewIndex ];
     435          m_aaiCodedOffset[ uiBaseViewIndex ][ uiViewIndex ]  = pcSlice->getCodedOffset   () [ uiBaseViewIndex ];
     436          xInitLUTs( uiBaseViewIndex, uiViewIndex, m_aaiCodedScale[ uiBaseViewIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseViewIndex ][ uiViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
     437        }
     438      }
     439    }
     440  }
     441}
     442#endif
     443
     444
    286445#if H_3D_IV_MERGE
    287446Void
     
    295454#endif
    296455
     456#if !FIX_CAM_PARS_COLLECTOR
    297457Bool
    298458CamParsCollector::xIsComplete()
     
    307467  return true;
    308468}
     469#endif
    309470
    310471Void
     
    313474  if( m_pCodedScaleOffsetFile )
    314475  {
     476#if FIX_CAM_PARS_COLLECTOR
     477    if( iPOC == m_firstReceivedPoc )
     478#else
    315479    if( iPOC == 0 )
     480#endif
    316481    {
    317482      fprintf( m_pCodedScaleOffsetFile, "#  ViewIndex       ViewId\n" );
    318483      fprintf( m_pCodedScaleOffsetFile, "#----------- ------------\n" );
     484#if FIX_CAM_PARS_COLLECTOR
    319485      for( UInt uiViewIndex = 0; uiViewIndex <= m_uiMaxViewIndex; uiViewIndex++ )
    320486      {
     487        fprintf( m_pCodedScaleOffsetFile, "%12d %12d\n", uiViewIndex, m_vps->getViewIdVal( uiViewIndex ) );
     488#else       
     489      for( UInt uiViewIndex = 0; uiViewIndex <= m_uiMaxViewIndex; uiViewIndex++ )
     490      {
    321491        fprintf( m_pCodedScaleOffsetFile, "%12d %12d\n", uiViewIndex, m_aiViewId[ uiViewIndex ] );
     492#endif
    322493      }
    323494      fprintf( m_pCodedScaleOffsetFile, "\n\n");
     
    325496      fprintf( m_pCodedScaleOffsetFile, "#----------- ------------ ------------ ------------ ------------ ------------ ------------\n" );
    326497    }
     498#if FIX_CAM_PARS_COLLECTOR
     499    if( iPOC == m_firstReceivedPoc || m_bCamParsVaryOverTime  )
     500#else
    327501    if( iPOC == 0 || m_bCamParsVaryOverTime )
     502#endif
    328503    {
    329504      Int iS = iPOC;
     
    335510          if( uiViewIndex != uiBaseIndex )
    336511          {
     512#if FIX_CAM_PARS_COLLECTOR
     513            if ( m_receivedIdc[uiBaseIndex][uiViewIndex] != 0 )
     514            {           
     515              fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
     516                iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_vps->getCamParPrecision() );
     517            }           
     518#else
    337519            fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
    338520              iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_uiCamParsCodedPrecision );
     521#endif
     522
    339523          }
    340524        }
     
    457641  for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++)
    458642  {
     643#if H_MV_HLS_7_SPS_P0155_16_32
     644    numReorderPics[temporalLayer] = ( getLayerId() == 0 ) ? pcSlice->getSPS()->getNumReorderPics(temporalLayer) : pcSlice->getVPS()->getNumReorderPics(temporalLayer);
     645#else
    459646    numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer);
    460   }
    461 
     647#endif
     648  }
     649#if H_MV_HLS_7_SPS_P0155_16_32
     650  if ( getLayerId() == 0 )
     651  { 
     652    m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());
     653  }
     654  else
     655  {
     656    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxDecPicBuffering(pcSlice->getTLayer());
     657#if H_MV_HLS7_GEN
     658    TComVPS* vps         = pcSlice->getVPS();
     659    TComDpbSize* dpbSize = vps->getDpbSize();
     660    Int lsIdx            = vps->getLayerSetIdxForOutputLayerSet( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?
     661    Int layerIdx         = vps->getIdxInLayerSet     ( lsIdx, getLayerId() );
     662    Int subDpbIdx        = dpbSize->getSubDpbAssigned( lsIdx, layerIdx );
     663    m_iMaxRefPicNum      = dpbSize->getMaxVpsDecPicBufferingMinus1(getTargetOutputLayerSetIdx(), subDpbIdx , vps->getSubLayersVpsMaxMinus1( vps->getLayerIdInVps( getLayerId() ) ) + 1 ) + 1 ; 
     664#endif   
     665  }
     666#else
    462667  m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     668#endif
    463669  if (m_cListPic.size() < (UInt)m_iMaxRefPicNum)
    464670  {
     
    467673    rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    468674                     conformanceWindow, defaultDisplayWindow, numReorderPics, true);
    469     rpcPic->getPicSym()->allocSaoParam(&m_cSAO);
    470675    m_cListPic.pushBack( rpcPic );
    471676   
     
    505710  rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    506711                   conformanceWindow, defaultDisplayWindow, numReorderPics, true);
    507   rpcPic->getPicSym()->allocSaoParam(&m_cSAO);
    508712}
    509713
     
    662866
    663867  m_cSAO.destroy();
    664   m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() );
     868  m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() );
    665869  m_cLoopFilter.create( sps->getMaxCUDepth() );
    666870}
     
    670874{
    671875  assert( nalu.m_layerId == m_layerId );
    672 
    673876#else
    674877Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay )
     
    682885    m_uiSliceIdx     = 0;
    683886  }
     887  else
     888  {
     889    m_apcSlicePilot->copySliceInfo( pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) );
     890  }
    684891  m_apcSlicePilot->setSliceIdx(m_uiSliceIdx);
    685   if (!m_bFirstSliceInPicture)
    686   {
    687     m_apcSlicePilot->copySliceInfo( pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) );
    688   }
    689892
    690893  m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType);
     
    9941197#endif
    9951198#else
    996 #if FIX1071
    9971199    pcSlice->setRefPicList( m_cListPic, true );
    998 #else
    999     pcSlice->setRefPicList( m_cListPic );
    1000 #endif
    1001 
    10021200#endif
    10031201
     
    12151413    case NAL_UNIT_CODED_SLICE_TRAIL_R:
    12161414    case NAL_UNIT_CODED_SLICE_TRAIL_N:
    1217     case NAL_UNIT_CODED_SLICE_TLA_R:
     1415    case NAL_UNIT_CODED_SLICE_TSA_R:
    12181416    case NAL_UNIT_CODED_SLICE_TSA_N:
    12191417    case NAL_UNIT_CODED_SLICE_STSA_R:
     
    12351433#endif
    12361434      break;
     1435    case NAL_UNIT_EOS:
     1436      m_associatedIRAPType = NAL_UNIT_INVALID;
     1437      m_pocCRA = 0;
     1438      m_pocRandomAccess = MAX_INT;
     1439      m_prevPOC = MAX_INT;
     1440      m_bFirstSliceInPicture = true;
     1441      m_bFirstSliceInSequence = true;
     1442      m_prevSliceSkipped = false;
     1443      m_skippedPOC = 0;
     1444      return false;
     1445     
     1446    case NAL_UNIT_ACCESS_UNIT_DELIMITER:
     1447      // TODO: process AU delimiter
     1448      return false;
     1449     
     1450    case NAL_UNIT_EOB:
     1451      return false;
     1452     
     1453     
     1454    case NAL_UNIT_RESERVED_VCL_N10:
     1455    case NAL_UNIT_RESERVED_VCL_R11:
     1456    case NAL_UNIT_RESERVED_VCL_N12:
     1457    case NAL_UNIT_RESERVED_VCL_R13:
     1458    case NAL_UNIT_RESERVED_VCL_N14:
     1459    case NAL_UNIT_RESERVED_VCL_R15:
     1460     
     1461    case NAL_UNIT_RESERVED_IRAP_VCL22:
     1462    case NAL_UNIT_RESERVED_IRAP_VCL23:
     1463     
     1464    case NAL_UNIT_RESERVED_VCL24:
     1465    case NAL_UNIT_RESERVED_VCL25:
     1466    case NAL_UNIT_RESERVED_VCL26:
     1467    case NAL_UNIT_RESERVED_VCL27:
     1468    case NAL_UNIT_RESERVED_VCL28:
     1469    case NAL_UNIT_RESERVED_VCL29:
     1470    case NAL_UNIT_RESERVED_VCL30:
     1471    case NAL_UNIT_RESERVED_VCL31:
     1472     
     1473    case NAL_UNIT_FILLER_DATA:
     1474    case NAL_UNIT_RESERVED_NVCL41:
     1475    case NAL_UNIT_RESERVED_NVCL42:
     1476    case NAL_UNIT_RESERVED_NVCL43:
     1477    case NAL_UNIT_RESERVED_NVCL44:
     1478    case NAL_UNIT_RESERVED_NVCL45:
     1479    case NAL_UNIT_RESERVED_NVCL46:
     1480    case NAL_UNIT_RESERVED_NVCL47:
     1481    case NAL_UNIT_UNSPECIFIED_48:
     1482    case NAL_UNIT_UNSPECIFIED_49:
     1483    case NAL_UNIT_UNSPECIFIED_50:
     1484    case NAL_UNIT_UNSPECIFIED_51:
     1485    case NAL_UNIT_UNSPECIFIED_52:
     1486    case NAL_UNIT_UNSPECIFIED_53:
     1487    case NAL_UNIT_UNSPECIFIED_54:
     1488    case NAL_UNIT_UNSPECIFIED_55:
     1489    case NAL_UNIT_UNSPECIFIED_56:
     1490    case NAL_UNIT_UNSPECIFIED_57:
     1491    case NAL_UNIT_UNSPECIFIED_58:
     1492    case NAL_UNIT_UNSPECIFIED_59:
     1493    case NAL_UNIT_UNSPECIFIED_60:
     1494    case NAL_UNIT_UNSPECIFIED_61:
     1495    case NAL_UNIT_UNSPECIFIED_62:
     1496    case NAL_UNIT_UNSPECIFIED_63:
    12371497    default:
    1238       assert (1);
     1498      assert (0);
    12391499  }
    12401500
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r833 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7171  ~CamParsCollector ();
    7272
     73#if FIX_CAM_PARS_COLLECTOR
     74  Void  init        ( FILE* pCodedScaleOffsetFile, TComVPS* vps );
     75#else
    7376  Void  init        ( FILE* pCodedScaleOffsetFile );
     77#endif
     78
    7479  Void  uninit      ();
    7580  Void  setSlice    ( TComSlice* pcSlice );
     
    8590  Int getCodedScale( Int iBaseView, Int iCureView){ return m_aaiCodedScale[ iBaseView ][ iCureView ];}
    8691  Int getCodedOffset( Int iBaseView, Int iCureView){ return m_aaiCodedOffset[ iBaseView ][ iCureView ];}
    87   UInt getCamParsCodedPrecision(){ return m_uiCamParsCodedPrecision; }
     92  UInt getCamParsCodedPrecision(){ return m_vps->getCamParPrecision(); }
    8893#endif
    8994
    9095private:
     96#if FIX_CAM_PARS_COLLECTOR
     97  Void xResetReceivedIdc( Bool overWriteFlag );
     98#else
    9199  Bool  xIsComplete ();
     100#endif
    92101  Void  xOutput     ( Int iPOC );
    93102
     
    98107  Int**   m_aaiCodedOffset;
    99108  Int**   m_aaiCodedScale;
     109 
     110#if !FIX_CAM_PARS_COLLECTOR
    100111  Int*    m_aiViewId; 
    101 
     112#else
     113  TComVPS* m_vps;
     114  Int**    m_receivedIdc;
     115  Int      m_uiMaxViewIndex;
     116  Int      m_lastPoc;
     117  Int      m_firstReceivedPoc;
     118#endif
     119
     120 
     121#if !FIX_CAM_PARS_COLLECTOR
    102122  Bool*   m_bViewReceived;
    103123  UInt    m_uiCamParsCodedPrecision;
     124#endif
    104125  Bool    m_bCamParsVaryOverTime;
     126#if !FIX_CAM_PARS_COLLECTOR
    105127  Int     m_iLastViewIndex;
    106128  Int     m_iLastPOC;
    107129  UInt    m_uiMaxViewIndex;
     130#endif
    108131
    109132
Note: See TracChangeset for help on using the changeset viewer.