Changeset 1284 in SHVCSoftware


Ignore:
Timestamp:
17 Jul 2015, 00:34:10 (9 years ago)
Author:
seregin
Message:

port rev 4319 (g_PCMBitDepth)

Location:
branches/SHM-dev/source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1281 r1284  
    43134313    g_bitDepth   [channelType] = m_internalBitDepth[channelType];
    43144314#endif
    4315     g_PCMBitDepth[channelType] = m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[channelType] : m_internalBitDepth[channelType];
    43164315    g_maxTrDynamicRange[channelType] = m_useExtendedPrecision? std::max<Int>(15, (g_bitDepth[channelType] + 6)) : 15;
    43174316  }
     
    44394438  printf("MSB-extended bit depth            : (Y:%d, C:%d)\n", m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] );
    44404439  printf("Internal bit depth                : (Y:%d, C:%d)\n", m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
    4441   printf("PCM sample bit depth              : (Y:%d, C:%d)\n", g_PCMBitDepth[CHANNEL_TYPE_LUMA],      g_PCMBitDepth[CHANNEL_TYPE_CHROMA] );
     4440  printf("PCM sample bit depth              : (Y:%d, C:%d)\n", m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA] : m_internalBitDepth[CHANNEL_TYPE_LUMA],
     4441                                                               m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] : m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
    44424442  printf("Extended precision processing     : %s\n", (m_useExtendedPrecision                   ? "Enabled" : "Disabled") );
    44434443#endif
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r1235 r1284  
    109109  Bool      m_resamplePhaseSetPresentFlag [MAX_LAYERS];
    110110
    111   Int       m_inputBitDepth   [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of input file
    112   Int       m_outputBitDepth  [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of output file
     111  Int       m_inputBitDepth[MAX_NUM_CHANNEL_TYPE];            ///< bit-depth of input file
     112  Int       m_outputBitDepth[MAX_NUM_CHANNEL_TYPE];           ///< bit-depth of output file
    113113  Int       m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE];      ///< bit-depth of input samples after MSB extension
    114114  Int       m_internalBitDepth[MAX_NUM_CHANNEL_TYPE];         ///< bit-depth codec operates at (input/output files will be converted)
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1273 r1284  
    220220    g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    221221
    222     g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_LUMA]   : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    223     g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    224 
    225222    // Set this to be used in Upsampling filter in function "TComUpsampleFilter::upsampleBasePic"
    226223    g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_acLayerCfg[layer].m_layerId]   = g_bitDepth[CHANNEL_TYPE_LUMA];
     
    475472    m_acTEncTop[layer].setPCMLog2MinSize                                   ( m_uiPCMLog2MinSize);
    476473    m_acTEncTop[layer].setUsePCM                                           ( m_usePCM );
     474
     475    for( UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++ )
     476    {
     477      m_acTEncTop[layer].setPCMBitDepth                                      ((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_MSBExtendedBitDepth[channelType] : m_acLayerCfg[layer].m_internalBitDepth[channelType]);
     478    }
    477479    m_acTEncTop[layer].setPCMLog2MaxSize                                   ( m_pcmLog2MaxSize);
    478480    m_acTEncTop[layer].setMaxNumMergeCand                                  ( m_maxNumMergeCand );
     
    898900  m_cTEncTop.setPCMLog2MinSize                                    ( m_uiPCMLog2MinSize);
    899901  m_cTEncTop.setUsePCM                                            ( m_usePCM );
     902
     903  // set internal bit-depth and constants
     904  for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
     905  {
     906//#if O0043_BEST_EFFORT_DECODING
     907    //g_bitDepthInStream[channelType] = g_bitDepth[channelType] = m_internalBitDepth[channelType];
     908//#else
     909    //g_bitDepth   [channelType] = m_internalBitDepth[channelType];
     910//#endif
     911    m_cTEncTop.setPCMBitDepth((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[channelType] : m_internalBitDepth[channelType]);
     912    //g_maxTrDynamicRange[channelType] = m_useExtendedPrecision? std::max<Int>(15, (g_bitDepth[channelType] + 6)) : 15;
     913  }
     914
    900915  m_cTEncTop.setPCMLog2MaxSize                                    ( m_pcmLog2MaxSize);
    901916  m_cTEncTop.setMaxNumMergeCand                                   ( m_maxNumMergeCand );
     
    10831098    {
    10841099      g_bitDepth[channelTypeIndex]    = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    1085       g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    10861100    }
    10871101
     
    11831197    {
    11841198      g_bitDepth[channelTypeIndex]    = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    1185       g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    11861199    }
    11871200#if LAYER_CTB
     
    12241237        g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    12251238
    1226         g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA]   : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    1227         g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    1228 
    12291239        vps->setLayerIdIncludedFlag(true, setId, layerId);
    12301240      }
     
    12431253        g_bitDepth[CHANNEL_TYPE_LUMA]   = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    12441254        g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    1245 
    1246         g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA]   : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    1247         g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    12481255
    12491256        if (layerId <= setId)
     
    16991706    g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    17001707
    1701     g_PCMBitDepth[CHANNEL_TYPE_LUMA]   = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA];
    1702     g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA];
    1703 
    17041708    // allocate original YUV buffer
    17051709    pcPicYuvOrg[layer] = new TComPicYuv;
     
    17391743        {
    17401744          g_bitDepth[channelTypeIndex]    = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    1741           g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    17421745        }
    17431746#if LAYER_CTB
     
    18241827        {
    18251828          g_bitDepth[channelTypeIndex]    = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    1826           g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    18271829        }
    18281830#if LAYER_CTB
     
    18971899      {
    18981900        g_bitDepth[channelTypeIndex]    = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    1899         g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex];
    19001901      }
    19011902
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1259 r1284  
    550550Int g_bitDepthInStream   [MAX_NUM_CHANNEL_TYPE] = {8, 8}; // In the encoder, this is the same as g_bitDepth. In the decoder, this can vary from g_bitDepth if the decoder is forced to use 'best-effort decoding' at a particular bit-depth.
    551551#endif
    552 Int g_PCMBitDepth[MAX_NUM_CHANNEL_TYPE] = {8, 8};    // PCM bit-depth
    553552
    554553// ====================================================================================================================
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.h

    r1259 r1284  
    159159
    160160extern        Int g_bitDepth   [MAX_NUM_CHANNEL_TYPE];
    161 extern        Int g_PCMBitDepth[MAX_NUM_CHANNEL_TYPE];
    162161#if O0043_BEST_EFFORT_DECODING
    163162extern        Int g_bitDepthInStream   [MAX_NUM_CHANNEL_TYPE]; // In the encoder, this is the same as g_bitDepth. In the decoder, this can vary from g_bitDepth if the decoder is forced to use 'best-effort decoding' at a particular bit-depth.
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1273 r1284  
    212212  Bool      m_bUseConstrainedIntraPred;
    213213  Bool      m_usePCM;
     214  Int       m_PCMBitDepth[MAX_NUM_CHANNEL_TYPE];
    214215  UInt      m_pcmLog2MaxSize;
    215216  UInt      m_uiPCMLog2MinSize;
     
    223224
    224225  Bool      m_bPCMInputBitDepthFlag;
    225   UInt      m_uiPCMBitDepthLuma;
    226   UInt      m_uiPCMBitDepthChroma;
    227226  Bool      m_bPCMFilterDisableFlag;
    228227  Bool      m_disableIntraReferenceSmoothing;
     
    458457  , m_colourRemapSEIFileRoot(NULL)
    459458#endif
    460   {}
     459  {
     460    m_PCMBitDepth[CHANNEL_TYPE_LUMA]=8;
     461    m_PCMBitDepth[CHANNEL_TYPE_CHROMA]=8;
     462  }
    461463
    462464  virtual ~TEncCfg()
     
    614616  Void      setPCMFilterDisableFlag         ( Bool  b )     {  m_bPCMFilterDisableFlag = b; }
    615617  Void      setUsePCM                       ( Bool  b )     {  m_usePCM = b;               }
     618  Void      setPCMBitDepth( const ChannelType chType, Int pcmBitDepthForChannel ) { m_PCMBitDepth[chType] = pcmBitDepthForChannel; }
    616619  Void      setPCMLog2MaxSize               ( UInt u )      { m_pcmLog2MaxSize = u;      }
    617620  Void      setPCMLog2MinSize               ( UInt u )     { m_uiPCMLog2MinSize = u;      }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1276 r1284  
    901901
    902902  m_cSPS.setMaxTrSize   ( 1 << m_uiQuadtreeTULog2MaxSize );
    903  
     903
    904904  m_cSPS.setUseAMP ( m_useAMP );
    905905
     
    913913    m_cSPS.setQpBDOffset  (ChannelType(channelType), (6 * (g_bitDepth[channelType] - 8)));
    914914#endif
    915     m_cSPS.setPCMBitDepth (ChannelType(channelType), g_PCMBitDepth[channelType]         );
     915    m_cSPS.setPCMBitDepth (ChannelType(channelType), m_PCMBitDepth[channelType]         );
    916916  }
    917917
Note: See TracChangeset for help on using the changeset viewer.