Changeset 468 in SHVCSoftware for branches/SHM-4.0-dev/source/App


Ignore:
Timestamp:
14 Nov 2013, 09:02:43 (11 years ago)
Author:
nokia
Message:

Integration of O0194: Support different bit-depth values for different layers, enable weighted prediction for ILR for color gamut scalability.

Location:
branches/SHM-4.0-dev/source/App
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.0-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r467 r468  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2013, ITU/ISO/IEC
     
    8080    m_pchBitstreamFile = NULL;
    8181  }
    82 #if SVC_EXTENSION   
     82#if SVC_EXTENSION
    8383  for( Int i = 0; i < m_tgtLayerId; i++ )
    8484  {
     
    8888      m_pchReconFile[i] = NULL;
    8989    }
    90   } 
     90  }
    9191#if AVC_BASE
    9292  if( m_pchBLReconFile )
     
    240240      if ( m_pchReconFile[curLayerId] && !openedReconFile[curLayerId] )
    241241      {
    242         if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }       
     242        if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
    243243        if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
    244244
     
    247247        openedReconFile[curLayerId] = true;
    248248      }
    249       if ( bNewPicture && bNewPOC && 
     249      if ( bNewPicture && bNewPOC &&
    250250           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    251251            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
     
    281281  }
    282282#endif
    283   pcBLPic.destroy(); 
     283  pcBLPic.destroy();
    284284
    285285  for(UInt layer = layerIdmin; layer <= m_tgtLayerId; layer++)
     
    290290    m_acTDecTop[layer].deletePicBuffer();
    291291  }
    292  
     292
    293293  // destroy internal classes
    294294  xDestroyDecLib();
     
    399399        openedReconFile = true;
    400400      }
    401       if ( bNewPicture && 
     401      if ( bNewPicture &&
    402402           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    403403            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
     
    415415    }
    416416  }
    417  
     417
    418418#if SYNTAX_OUTPUT
    419419  if( streamSyntaxFile.is_open() )
     
    422422  }
    423423#endif
    424  
     424
    425425  xFlushOutput( pcListPic );
    426426  // delete buffers
    427427  m_cTDecTop.deletePicBuffer();
    428  
     428
    429429  // destroy internal classes
    430430  xDestroyDecLib();
     
    440440#if SVC_EXTENSION
    441441  // initialize global variables
    442   initROM(); 
     442  initROM();
    443443
    444444  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     
    450450    m_acTDecTop[layer].create();
    451451
    452     m_acTDecTop[layer].setLayerDec(m_apcTDecTop);   
     452    m_acTDecTop[layer].setLayerDec(m_apcTDecTop);
    453453  }
    454454#else
     
    479479    m_cTVideoIOYuvReconFile. close();
    480480  }
    481  
     481
    482482  // destroy decoder class
    483483  m_cTDecTop.destroy();
     
    571571
    572572#else
    573 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     573#if O0194_DIFFERENT_BITDEPTH_EL_BL
     574          // Compile time bug-fix
    574575          m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
    575576#else
     
    732733  {
    733734    return;
    734   } 
     735  }
    735736  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
    736737
     
    768769
    769770#else
    770 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     771#if O0194_DIFFERENT_BITDEPTH_EL_BL
     772          // Compile time bug-fix
    771773          m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
    772774#else
     
    926928        pcPic = NULL;
    927929      }
    928 #endif   
     930#endif
    929931#endif
    930932      iterPic++;
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r467 r468  
    12691269  /* rules for input, output and internal bitdepths as per help text */
    12701270#if O0194_DIFFERENT_BITDEPTH_EL_BL
    1271   for(Int layer = 0; layer < MAX_LAYERS; layer++){
     1271  for(Int layer = 0; layer < MAX_LAYERS; layer++)
     1272  {
    12721273    if (!m_acLayerCfg[layer].m_internalBitDepthY) { m_acLayerCfg[layer].m_internalBitDepthY = m_acLayerCfg[layer].m_inputBitDepthY; }
    12731274    if (!m_acLayerCfg[layer].m_internalBitDepthC) { m_acLayerCfg[layer].m_internalBitDepthC = m_acLayerCfg[layer].m_internalBitDepthY; }
     
    15411542  // check range of parameters
    15421543#if O0194_DIFFERENT_BITDEPTH_EL_BL
    1543   for(UInt layer=0; layer<m_numLayers; layer++){
     1544  for(UInt layer=0; layer<m_numLayers; layer++)
     1545  {
    15441546    xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthY < 8,                                                     "InputBitDepth must be at least 8" );
    15451547    xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthC < 8,                                                     "InputBitDepthC must be at least 8" );
     
    24612463  printf("GOP size                     : %d\n", m_iGOPSize );
    24622464#if O0194_DIFFERENT_BITDEPTH_EL_BL
     2465  printf("Input bit depth Layer0       : (Y:%d, C:%d)\n", m_acLayerCfg[0].m_inputBitDepthY   , m_acLayerCfg[0].m_inputBitDepthC    );
     2466  printf("Input bit depth Layer1       : (Y:%d, C:%d)\n", m_acLayerCfg[1].m_internalBitDepthY, m_acLayerCfg[1].m_internalBitDepthC );
    24632467  printf("Internal bit depth Layer0    : (Y:%d, C:%d)\n", m_acLayerCfg[0].m_internalBitDepthY, m_acLayerCfg[0].m_internalBitDepthC );
    24642468  printf("Internal bit depth Layer1    : (Y:%d, C:%d)\n", m_acLayerCfg[1].m_internalBitDepthY, m_acLayerCfg[1].m_internalBitDepthC );
     
    25682572  printf("O0194_JOINT_US_BITSHIFT: %d ", O0194_JOINT_US_BITSHIFT);
    25692573  printf("O0194_WEIGHTED_PREDICTION_CGS: %d ",O0194_WEIGHTED_PREDICTION_CGS);
    2570   printf("O0194_REPN_FORMAT_IN_VPS_BUGFIX: %d ",O0194_REPN_FORMAT_IN_VPS_BUGFIX);
    25712574  printf("\n\n");
    25722575 
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h

    r467 r468  
    173173  Int       m_internalBitDepthC;                            ///< bit-depth codec operates at in chroma (input/output files will be converted)
    174174#endif
     175
    175176  // coding tools (PCM bit-depth)
    176177  Bool      m_bPCMInputBitDepthFlag;                          ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth.
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r467 r468  
    273273
    274274#if O0194_DIFFERENT_BITDEPTH_EL_BL
    275   for(UInt layer = 0; layer < MAX_LAYERS; layer++){
     275  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
     276  {
    276277    xConfirmPara( m_iQP <  -6 * ((Int)m_cAppEncCfg->getInternalBitDepthY(layer) - 8) || m_iQP > 51,                "QP exceeds supported range (-QpBDOffsety to 51)" );
    277278  }
  • branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r467 r468  
    146146    repFormat->setChromaFormatVpsIdc        ( 1                                             );  // Need modification to change for each layer - corresponds to 420
    147147    repFormat->setSeparateColourPlaneVpsFlag( 0                                             );  // Need modification to change for each layer
    148 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX
     148#if O0194_DIFFERENT_BITDEPTH_EL_BL
    149149    repFormat->setBitDepthVpsLuma           ( getInternalBitDepthY(mapIdxToLayer[idx])      );  // Need modification to change for each layer
    150150    repFormat->setBitDepthVpsChroma         ( getInternalBitDepthC(mapIdxToLayer[idx])      );  // Need modification to change for each layer
     
    408408    m_acTEncTop[layer].setWPBiPred                ( m_useWeightedBiPred   );
    409409#if O0194_WEIGHTED_PREDICTION_CGS
    410     if (layer!=0){
     410    if (layer!=0)
     411    {
    411412      // Enable weighted prediction for enhancement layer
    412413      m_acTEncTop[layer].setUseWP                 ( true   );
     
    884885  for(UInt layer=0; layer<m_numLayers; layer++)
    885886  {
     887#if O0194_DIFFERENT_BITDEPTH_EL_BL
     888    //2
     889    g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     890    g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     891
     892    g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     893    g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     894#endif
    886895#if LAYER_CTB
    887896    g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     
    889898    g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    890899    g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    891 #endif
    892 #if O0194_DIFFERENT_BITDEPTH_EL_BL
    893     //2
    894     g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
    895     g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
    896 
    897     g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
    898     g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
    899900#endif
    900901#if O0194_DIFFERENT_BITDEPTH_EL_BL
     
    963964  for(UInt layer=0; layer<m_numLayers; layer++)
    964965  {
     966#if O0194_DIFFERENT_BITDEPTH_EL_BL
     967    //3
     968    g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     969    g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     970
     971    g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     972    g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     973#endif
    965974#if LAYER_CTB
    966975    g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     
    968977    g_uiMaxCUDepth  = g_auiLayerMaxCUDepth[layer];
    969978    g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    970        
     979
    971980    memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) );
    972981    memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) );
    973982    memcpy( g_auiRasterToPelX,  g_auiLayerRasterToPelX[layer],  sizeof( g_auiRasterToPelX ) );
    974983    memcpy( g_auiRasterToPelY,  g_auiLayerRasterToPelY[layer],  sizeof( g_auiRasterToPelY ) );
    975 #endif
    976 #if O0194_DIFFERENT_BITDEPTH_EL_BL
    977     //3
    978     g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
    979     g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
    980 
    981     g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
    982     g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
    983984#endif
    984985    m_acTEncTop[layer].init(isFieldCoding);
     
    13071308      for(UInt layer=0; layer<m_numLayers; layer++)
    13081309      {
     1310#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1311        //6
     1312        g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     1313        g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     1314
     1315        g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     1316        g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     1317#endif
    13091318#if LAYER_CTB
    13101319        g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     
    13131322        g_uiAddCUDepth  = g_auiLayerAddCUDepth[layer];
    13141323#endif
    1315 #if O0194_DIFFERENT_BITDEPTH_EL_BL
    1316         //6
    1317         g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
    1318         g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
    1319 
    1320         g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
    1321         g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
    1322 #endif
     1324
    13231325        // get buffers
    13241326        xGetBuffer(pcPicYuvRec, layer);
     
    13881390      for(UInt layer=0; layer<m_numLayers; layer++)
    13891391      {
     1392#if O0194_DIFFERENT_BITDEPTH_EL_BL
     1393        //7
     1394        g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
     1395        g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
     1396
     1397        g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
     1398        g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
     1399#endif
    13901400#if LAYER_CTB
    13911401        g_uiMaxCUWidth  = g_auiLayerMaxCUWidth[layer];
     
    13981408        memcpy( g_auiRasterToPelX,  g_auiLayerRasterToPelX[layer],  sizeof( g_auiRasterToPelX ) );
    13991409        memcpy( g_auiRasterToPelY,  g_auiLayerRasterToPelY[layer],  sizeof( g_auiRasterToPelY ) );
    1400 #endif
    1401 #if O0194_DIFFERENT_BITDEPTH_EL_BL
    1402         //7
    1403         g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;
    1404         g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;
    1405 
    1406         g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;
    1407         g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;
    14081410#endif
    14091411        // call encoding function for one frame
Note: See TracChangeset for help on using the changeset viewer.