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


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/TAppEncoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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.