Changeset 1405 in 3DVCSoftware for trunk/source/Lib


Ignore:
Timestamp:
27 May 2016, 17:32:40 (8 years ago)
Author:
tech
Message:

Merged HTM-16.1-dev@1404.

Location:
trunk/source/Lib
Files:
156 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TAppCommon/TAppComCamPara.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TAppCommon/TAppComCamPara.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TAppCommon/program_options_lite.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TAppCommon/program_options_lite.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/AccessUnit.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/CommonDef.h

    r1397 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7272#if NH_MV
    7373#define NV_VERSION        "16.1"                ///< Current software version
    74 #define HM_VERSION        "16.7"                ///<
    75 #else
    76 #define NV_VERSION        "16.7"                 ///< Current software version
     74#define HM_VERSION        "16.9"                ///<
     75#else
     76#define NV_VERSION        "16.9"                 ///< Current software version
    7777#endif
    7878// ====================================================================================================================
     
    266266static const Int CONTEXT_STATE_BITS =                              6 ;
    267267static const Int LAST_SIGNIFICANT_GROUPS =                        10 ;
     268
     269#if W0038_DB_OPT
     270static const Int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS =           8 ;
     271#endif
     272
    268273
    269274#if NH_MV
  • trunk/source/Lib/TLibCommon/ContextModel.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextModel.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextModel3DBuffer.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextModel3DBuffer.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/Debug.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/Debug.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/NAL.h

    r1321 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/SEI.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    153153    case SEI::CHROMA_RESAMPLING_FILTER_HINT:        return "Chroma sampling filter hint";
    154154    case SEI::COLOUR_REMAPPING_INFO:                return "Colour remapping info";
     155#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     156    case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS: return "Alternative transfer characteristics";
     157#endif
    155158
    156159#if NH_MV
  • trunk/source/Lib/TLibCommon/SEI.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    9797    KNEE_FUNCTION_INFO                   = 141,
    9898    COLOUR_REMAPPING_INFO                = 142,
     99#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     100    ALTERNATIVE_TRANSFER_CHARACTERISTICS = 182,
     101#endif
    99102    DEINTERLACED_FIELD_IDENTIFICATION         = 143,
    100103    LAYERS_NOT_PRESENT                        = 160,
     
    655658
    656659};
     660
     661#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     662class SEIAlternativeTransferCharacteristics : public SEI
     663{
     664public:
     665  PayloadType payloadType() const { return ALTERNATIVE_TRANSFER_CHARACTERISTICS; }
     666
     667  SEIAlternativeTransferCharacteristics() : m_preferredTransferCharacteristics(18)
     668  { }
     669
     670  virtual ~SEIAlternativeTransferCharacteristics() {}
     671
     672  UInt m_preferredTransferCharacteristics;
     673};
     674#endif
     675
     676
    657677#if NH_MV
    658678class SEILayersNotPresent : public SEI
  • trunk/source/Lib/TLibCommon/TComBitCounter.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComBitStream.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComBitStream.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComCABACTables.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComCABACTables.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComChromaFormat.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComChromaFormat.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComCodingStatistics.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComInterpolationFilter.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComInterpolationFilter.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComList.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComLoopFilter.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComLoopFilter.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComMotionInfo.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r1386 r1405  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6* Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComMv.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComPattern.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComPattern.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComPic.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    9797TComPic::~TComPic()
    9898{
     99  destroy();
    99100}
    100101
    101102Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual)
    102103{
     104  destroy();
     105
    103106  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
    104107  const Int          iWidth          = sps.getPicWidthInLumaSamples();
  • trunk/source/Lib/TLibCommon/TComPic.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    191191  const TComPicSym* getPicSym() const { return  &m_picSym;    }
    192192  TComSlice*    getSlice(Int i)       { return  m_picSym.getSlice(i);  }
     193  const TComSlice* getSlice(Int i) const           { return  m_picSym.getSlice(i);  }
    193194  Int           getPOC() const        { return  m_picSym.getSlice(m_uiCurrSliceIdx)->getPOC();  }
    194195  TComDataCU*   getCtu( UInt ctuRsAddr )           { return  m_picSym.getCtu( ctuRsAddr ); }
  • trunk/source/Lib/TLibCommon/TComPicSym.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7171
    7272
     73TComPicSym::~TComPicSym()
     74{
     75  destroy();
     76}
     77
     78
    7379Void TComPicSym::create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth )
    7480{
    75   UInt i;
    7681  m_sps = sps;
    7782  m_pps = pps;
     
    108113#endif
    109114
    110   for ( i=0; i<m_numCtusInFrame ; i++ )
     115  for (UInt i=0; i<m_numCtusInFrame ; i++ )
    111116  {
    112117    m_pictureCtuArray[i] = new TComDataCU;
     
    122127  m_ctuRsToTsAddrMap = new UInt[m_numCtusInFrame+1];
    123128
    124   for( i=0; i<m_numCtusInFrame; i++ )
     129  for(UInt i=0; i<m_numCtusInFrame; i++ )
    125130  {
    126131    m_ctuTsToRsAddrMap[i] = i;
  • trunk/source/Lib/TLibCommon/TComPicSym.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    125125
    126126  TComPicSym  ();
     127  ~TComPicSym();
     128
    127129  TComSlice*         getSlice(UInt i)                                      { return m_apSlices[i];             }
    128130  const TComSlice*   getSlice(UInt i) const                                { return m_apSlices[i];             }
  • trunk/source/Lib/TLibCommon/TComPicYuv.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7474TComPicYuv::~TComPicYuv()
    7575{
     76  destroy();
    7677}
    7778
     
    8788
    8889{
     90  destroy();
     91
    8992  m_picWidth          = picWidth;
    9093  m_picHeight         = picHeight;
  • trunk/source/Lib/TLibCommon/TComPicYuv.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComPicYuvMD5.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComRdCost.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComRdCost.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComRdCostWeightPrediction.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComRdCostWeightPrediction.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComRectangle.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComRom.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComTU.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComTU.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComTrQuant.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComTrQuant.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComWedgelet.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComWedgelet.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComWeightPrediction.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComWeightPrediction.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TComYuv.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5959TComYuv::~TComYuv()
    6060{
     61  destroy();
    6162}
    6263
    6364Void TComYuv::create( UInt iWidth, UInt iHeight, ChromaFormat chromaFormatIDC )
    6465{
     66  destroy();
    6567  // set width and height
    6668  m_iWidth   = iWidth;
  • trunk/source/Lib/TLibCommon/TComYuv.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    373373#define T0196_SELECTIVE_RDOQ                              1 ///< selective RDOQ
    374374#define U0040_MODIFIED_WEIGHTEDPREDICTION_WITH_BIPRED_AND_CLIPPING 1
     375#define U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI    1 ///< Alternative transfer characteristics SEI message (JCTVC-U0033, with syntax naming from V1005)
     376#define W0062_RECALCULATE_QP_TO_ALIGN_WITH_LAMBDA         0 ///< This recalculates QP to align with the derived lambda (same relation as for all intra coding is used). Currently disabled by default.
     377#define OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP            1 ///< Adds command line option to reset SAO parameters after each IRAP.
     378
    375379// ====================================================================================================================
    376380// Tool Switches
     
    396400#endif
    397401#define U0132_TARGET_BITS_SATURATION                      1 ///< Rate control with target bits saturation method
     402#ifdef  U0132_TARGET_BITS_SATURATION
     403#define V0078_ADAPTIVE_LOWER_BOUND                        1 ///< Target bits saturation with adaptive lower bound
     404#endif
     405#define W0038_DB_OPT                                      1 ///< adaptive DB parameter selection, LoopFilterOffsetInPPS and LoopFilterDisable are set to 0 and DeblockingFilterMetric=2;
     406#define W0038_CQP_ADJ                                     1 ///< chroma QP adjustment based on TL, CQPTLAdjustEnabled is set to 1;
     407
    398408// ====================================================================================================================
    399409// Derived macros
  • trunk/source/Lib/TLibDecoder/AnnexBread.cpp

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

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

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/NALread.h

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

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    311311      xParseSEIMasteringDisplayColourVolume((SEIMasteringDisplayColourVolume&) *sei, payloadSize, pDecodedMessageOutputStream);
    312312      break;
     313#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     314    case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS:
     315      sei = new SEIAlternativeTransferCharacteristics;
     316      xParseSEIAlternativeTransferCharacteristics((SEIAlternativeTransferCharacteristics&) *sei, payloadSize, pDecodedMessageOutputStream);
     317      break;
     318#endif
    313319#if NH_MV
    314320    case SEI::LAYERS_NOT_PRESENT:
     
    636642        sei_read_code( pDecodedMessageOutputStream, ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, nalOrVcl?"vcl_initial_cpb_removal_delay":"nal_initial_cpb_removal_delay" );
    637643        sei.m_initialCpbRemovalDelay[i][nalOrVcl] = code;
    638         sei_read_code( pDecodedMessageOutputStream, ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, nalOrVcl?"vcl_initial_cpb_removal_offset":"vcl_initial_cpb_removal_offset" );
     644        sei_read_code( pDecodedMessageOutputStream, ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, nalOrVcl?"vcl_initial_cpb_removal_offset":"nal_initial_cpb_removal_offset" );
    639645        sei.m_initialCpbRemovalDelayOffset[i][nalOrVcl] = code;
    640646        if( pHRD->getSubPicCpbParamsPresentFlag() || sei.m_rapCpbParamsPresentFlag )
    641647        {
    642           sei_read_code( pDecodedMessageOutputStream, ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, nalOrVcl?"vcl_initial_alt_cpb_removal_delay":"vcl_initial_alt_cpb_removal_delay" );
     648          sei_read_code( pDecodedMessageOutputStream, ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, nalOrVcl?"vcl_initial_alt_cpb_removal_delay":"nal_initial_alt_cpb_removal_delay" );
    643649          sei.m_initialAltCpbRemovalDelay[i][nalOrVcl] = code;
    644           sei_read_code( pDecodedMessageOutputStream, ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, nalOrVcl?"vcl_initial_alt_cpb_removal_offset":"vcl_initial_alt_cpb_removal_offset" );
     650          sei_read_code( pDecodedMessageOutputStream, ( pHRD->getInitialCpbRemovalDelayLengthMinus1() + 1 ) , code, nalOrVcl?"vcl_initial_alt_cpb_removal_offset":"nal_initial_alt_cpb_removal_offset" );
    645651          sei.m_initialAltCpbRemovalDelayOffset[i][nalOrVcl] = code;
    646652        }
     
    12721278  sei_read_code( pDecodedMessageOutputStream, 32, code, "min_display_mastering_luminance" ); sei.values.minLuminance = code;
    12731279}
     1280
     1281#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     1282Void SEIReader::xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, UInt payloadSize, ostream* pDecodedMessageOutputStream)
     1283{
     1284  UInt code;
     1285  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
     1286
     1287  sei_read_code(pDecodedMessageOutputStream, 8, code, "preferred_transfer_characteristics"); sei.m_preferredTransferCharacteristics = code;
     1288}
     1289#endif
     1290
    12741291#if NH_MV
    12751292Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
  • trunk/source/Lib/TLibDecoder/SEIread.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    9595  Void xParseSEIMasteringDisplayColourVolume  (SEIMasteringDisplayColourVolume& sei,  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    9696  Void xParseSEIColourRemappingInfo           (SEIColourRemappingInfo& sei,           UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     97#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     98  Void xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei,              UInt payLoadSize,                     std::ostream *pDecodedMessageOutputStream);
     99#endif
    97100#if NH_MV
    98101  Void xParseSEILayersNotPresent              (SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps ,std::ostream *pDecodedMessageOutputStream);
  • trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp

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

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

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

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

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

    r1396 r1405  
    44* granted under this license.
    55*
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6* Copyright (c) 2010-2016, ITU/ISO/IEC
    77* All rights reserved.
    88*
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

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

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecCu.h

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

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r1321 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecGop.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r1321 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecSlice.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecSlice.h

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

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/AnnexBwrite.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/NALwrite.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/NALwrite.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/SEIEncoder.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    651651  }
    652652}
     653#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     654Void SEIEncoder::initSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics *seiAltTransCharacteristics)
     655{
     656  assert (m_isInitialized);
     657  assert (seiAltTransCharacteristics!=NULL);
     658  //  Set SEI message parameters read from command line options
     659  seiAltTransCharacteristics->m_preferredTransferCharacteristics = m_pcCfg->getSEIPreferredTransferCharacteristics();
     660}
     661#endif
    653662
    654663#if NH_MV
  • trunk/source/Lib/TLibEncoder/SEIEncoder.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    8282  Void initSEITimeCode(SEITimeCode *sei);
    8383  Bool initSEIColourRemappingInfo(SEIColourRemappingInfo *sei, Int currPOC); // returns true on success, false on failure.
     84#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     85  Void initSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics *sei);
     86#endif
    8487
    8588  // trailing SEIs
  • trunk/source/Lib/TLibEncoder/SEIwrite.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    124124    xWriteSEIMasteringDisplayColourVolume(*static_cast<const SEIMasteringDisplayColourVolume*>(&sei));
    125125    break;
     126#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     127  case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS:
     128    xWriteSEIAlternativeTransferCharacteristics(*static_cast<const SEIAlternativeTransferCharacteristics*>(&sei));
     129    break;
     130#endif
     131
    126132#if NH_MV
    127133   case SEI::LAYERS_NOT_PRESENT:
     
    871877}
    872878
     879#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     880Void SEIWriter::xWriteSEIAlternativeTransferCharacteristics(const SEIAlternativeTransferCharacteristics& sei)
     881{
     882  WRITE_CODE(sei.m_preferredTransferCharacteristics, 8, "preferred_transfer_characteristics");
     883}
     884#endif
     885
    873886#if NH_MV
    874887Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
  • trunk/source/Lib/TLibEncoder/SEIwrite.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7575  Void xWriteSEIColourRemappingInfo(const SEIColourRemappingInfo& sei);
    7676  Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei);
     77#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     78  Void xWriteSEIAlternativeTransferCharacteristics(const SEIAlternativeTransferCharacteristics& sei);
     79#endif
    7780
    7881#if NH_MV
  • trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncAnalyze.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoder.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    6262  Int m_POC;
    6363  Int m_QPOffset;
     64#if W0038_CQP_ADJ
     65  Int m_CbQPoffset;
     66  Int m_CrQPoffset;
     67#endif
    6468  Double m_QPFactor;
    6569  Int m_tcOffsetDiv2;
     
    8993  : m_POC(-1)
    9094  , m_QPOffset(0)
     95#if W0038_CQP_ADJ
     96  , m_CbQPoffset(0)
     97  , m_CrQPoffset(0)
     98#endif
    9199  , m_QPFactor(0)
    92100  , m_tcOffsetDiv2(0)
     
    135143  Int       m_iFrameRate;
    136144  Int       m_FrameSkip;
     145  UInt      m_temporalSubsampleRatio;
    137146  Int       m_iSourceWidth;
    138147  Int       m_iSourceHeight;
     
    163172
    164173  //====== Coding Structure ========
    165   UInt      m_uiIntraPeriod;
     174  UInt      m_uiIntraPeriod;                    // TODO: make this an Int - it can be -1!
    166175  UInt      m_uiDecodingRefreshType;            ///< the type of decoding refresh employed for the random access.
    167176  Int       m_iGOPSize;
     
    202211  Int       m_loopFilterBetaOffsetDiv2;
    203212  Int       m_loopFilterTcOffsetDiv2;
     213#if W0038_DB_OPT
     214  Int       m_deblockingFilterMetric;
     215#else
    204216  Bool      m_DeblockingFilterMetric;
     217#endif
    205218  Bool      m_bUseSAO;
    206219  Bool      m_bTestSAODisableAtPictureLevel;
     
    209222  Int       m_maxNumOffsetsPerPic;
    210223  Bool      m_saoCtuBoundary;
     224#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     225  Bool      m_saoResetEncoderStateAfterIRAP;
     226#endif
    211227
    212228  //====== Motion search ========
     
    231247  Int       m_chromaCbQpOffset;                 //  Chroma Cb QP Offset (0:default)
    232248  Int       m_chromaCrQpOffset;                 //  Chroma Cr Qp Offset (0:default)
     249#if W0038_CQP_ADJ
     250  UInt      m_sliceChromaQpOffsetPeriodicity;                 ///< Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature.
     251  Int       m_sliceChromaQpOffsetIntraOrPeriodic[2/*Cb,Cr*/]; ///< Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.
     252#endif
     253
    233254  ChromaFormat m_chromaFormatIDC;
    234255
     
    363384  std::string m_colourRemapSEIFileRoot;          ///< SEI Colour Remapping File (initialized from external file)
    364385  TComSEIMasteringDisplay m_masteringDisplay;
     386#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     387  Bool      m_alternativeTransferCharacteristicsSEIEnabled;
     388  UChar     m_preferredTransferCharacteristics;
     389#endif
     390
    365391#if NH_MV
    366392  SEIMessages* m_seiMessages;
     
    534560  Void      setFrameRate                    ( Int   i )      { m_iFrameRate = i; }
    535561  Void      setFrameSkip                    ( UInt i ) { m_FrameSkip = i; }
     562  Void      setTemporalSubsampleRatio       ( UInt  i )      { m_temporalSubsampleRatio = i; }
    536563  Void      setSourceWidth                  ( Int   i )      { m_iSourceWidth = i; }
    537564  Void      setSourceHeight                 ( Int   i )      { m_iSourceHeight = i; }
     
    619646  Void      setLoopFilterBetaOffset         ( Int   i )      { m_loopFilterBetaOffsetDiv2  = i; }
    620647  Void      setLoopFilterTcOffset           ( Int   i )      { m_loopFilterTcOffsetDiv2    = i; }
     648#if W0038_DB_OPT
     649  Void      setDeblockingFilterMetric       ( Int   i )      { m_deblockingFilterMetric = i; }
     650#else
    621651  Void      setDeblockingFilterMetric       ( Bool  b )      { m_DeblockingFilterMetric = b; }
    622 
     652#endif
    623653  //====== Motion search ========
    624654  Void      setDisableIntraPUsInInterSlices ( Bool  b )      { m_bDisableIntraPUsInInterSlices = b; }
     
    645675  Void      setChromaCbQpOffset             ( Int   i )      { m_chromaCbQpOffset = i; }
    646676  Void      setChromaCrQpOffset             ( Int   i )      { m_chromaCrQpOffset = i; }
     677#if W0038_CQP_ADJ
     678  Void      setSliceChromaOffsetQpIntraOrPeriodic( UInt periodicity, Int sliceChromaQpOffsetIntraOrPeriodic[2]) { m_sliceChromaQpOffsetPeriodicity = periodicity; memcpy(m_sliceChromaQpOffsetIntraOrPeriodic, sliceChromaQpOffsetIntraOrPeriodic, sizeof(m_sliceChromaQpOffsetIntraOrPeriodic)); }
     679  Int       getSliceChromaOffsetQpIntraOrPeriodic( Bool bIsCr) const                                            { return m_sliceChromaQpOffsetIntraOrPeriodic[bIsCr?1:0]; }
     680  UInt      getSliceChromaOffsetQpPeriodicity() const                                                           { return m_sliceChromaQpOffsetPeriodicity; }
     681#endif
    647682
    648683  Void      setChromaFormatIdc              ( ChromaFormat cf ) { m_chromaFormatIDC = cf; }
     
    666701  Int       getFrameRate                    ()      { return  m_iFrameRate; }
    667702  UInt      getFrameSkip                    ()      { return  m_FrameSkip; }
     703  UInt      getTemporalSubsampleRatio       ()      { return  m_temporalSubsampleRatio; }
    668704  Int       getSourceWidth                  ()      { return  m_iSourceWidth; }
    669705  Int       getSourceHeight                 ()      { return  m_iSourceHeight; }
     
    702738  Int       getLoopFilterBetaOffset         ()      { return m_loopFilterBetaOffsetDiv2; }
    703739  Int       getLoopFilterTcOffset           ()      { return m_loopFilterTcOffsetDiv2; }
     740#if W0038_DB_OPT
     741  Int       getDeblockingFilterMetric       ()      { return m_deblockingFilterMetric; }
     742#else
    704743  Bool      getDeblockingFilterMetric       ()      { return m_DeblockingFilterMetric; }
     744#endif
    705745
    706746  //==== Motion search ========
     
    831871  Void  setSaoCtuBoundary              (Bool val)                    { m_saoCtuBoundary = val; }
    832872  Bool  getSaoCtuBoundary              ()                            { return m_saoCtuBoundary; }
     873#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     874  Void  setSaoResetEncoderStateAfterIRAP(Bool b)                     { m_saoResetEncoderStateAfterIRAP = b; }
     875  Bool  getSaoResetEncoderStateAfterIRAP() const                     { return m_saoResetEncoderStateAfterIRAP; }
     876#endif
    833877  Void  setLFCrossTileBoundaryFlag               ( Bool   val  )     { m_loopFilterAcrossTilesEnabledFlag = val; }
    834878  Bool  getLFCrossTileBoundaryFlag               ()                  { return m_loopFilterAcrossTilesEnabledFlag;   }
     
    9751019
    9761020  Void  setMasteringDisplaySEI(const TComSEIMasteringDisplay &src)   { m_masteringDisplay = src; }
     1021#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     1022  Void  setSEIAlternativeTransferCharacteristicsSEIEnable( Bool b)   { m_alternativeTransferCharacteristicsSEIEnabled = b;    }
     1023  Bool  getSEIAlternativeTransferCharacteristicsSEIEnable( ) const   { return m_alternativeTransferCharacteristicsSEIEnabled; }
     1024  Void  setSEIPreferredTransferCharacteristics(UChar v)              { m_preferredTransferCharacteristics = v;    }
     1025  UChar getSEIPreferredTransferCharacteristics() const               { return m_preferredTransferCharacteristics; }
     1026#endif
    9771027  const TComSEIMasteringDisplay &getMasteringDisplaySEI() const      { return m_masteringDisplay; }
    9781028#if NH_MV
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    10961096        // do normal intra modes
    10971097        // speedup for inter frames
    1098         Double intraCost = 0.0;
    10991098
    11001099        if((rpcBestCU->getSlice()->getSliceType() == I_SLICE)                                     ||
     
    11221121            if( bUseIVP )
    11231122            {
    1124               xCheckRDCostIntra( rpcBestCU, rpcTempCU, intraCost, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug), bOnlyIVP );
    1125 #else
    1126           xCheckRDCostIntra( rpcBestCU, rpcTempCU, intraCost, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug) );
     1123              xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug), bOnlyIVP );
     1124#else
     1125          xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug) );
    11271126#endif
    11281127#if KWU_RC_MADPRED_E0227
     
    11431142            if( rpcTempCU->getWidth(0) > ( 1 << sps.getQuadtreeTULog2MinSize() ) )
    11441143            {
    1145               Double tmpIntraCost;
    11461144#if NH_3D_ENC_DEPTH
    1147               xCheckRDCostIntra( rpcBestCU, rpcTempCU, tmpIntraCost, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug), bOnlyIVP );
    1148 #else
    1149               xCheckRDCostIntra( rpcBestCU, rpcTempCU, tmpIntraCost, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug)   );
    1150 #endif
    1151 
    1152               intraCost = std::min(intraCost, tmpIntraCost);
     1145              xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug), bOnlyIVP );
     1146#else
     1147              xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug)   );
     1148#endif       
    11531149              rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    11541150            }
     
    27842780Void TEncCu::xCheckRDCostIntra( TComDataCU *&rpcBestCU,
    27852781                                TComDataCU *&rpcTempCU,
    2786                                 Double      &cost,
    27872782                                PartSize     eSize
    27882783                                DEBUG_STRING_FN_DECLARE(sDebug)
     
    28952890
    28962891  xCheckDQP( rpcTempCU );
    2897 
    2898   cost = rpcTempCU->getTotalCost();
    28992892
    29002893  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest));
  • trunk/source/Lib/TLibEncoder/TEncCu.h

    r1321 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    167167  Void  xCheckRDCostIntra   ( TComDataCU *&rpcBestCU,
    168168                              TComDataCU *&rpcTempCU,
    169                               Double      &cost,
    170169                              PartSize     ePartSize
    171170                              DEBUG_STRING_FN_DECLARE(sDebug)
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncEntropy.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    108108  m_associatedIRAPType = NAL_UNIT_CODED_SLICE_IDR_N_LP;
    109109  m_associatedIRAPPOC  = 0;
     110#if W0038_DB_OPT
     111  m_pcDeblockingTempPicYuv = NULL;
     112#endif
    110113  return;
    111114}
     
    125128Void  TEncGOP::destroy()
    126129{
     130#if W0038_DB_OPT
     131  if (m_pcDeblockingTempPicYuv)
     132  {
     133    m_pcDeblockingTempPicYuv->destroy();
     134    delete m_pcDeblockingTempPicYuv;
     135    m_pcDeblockingTempPicYuv = NULL;
     136  }
     137#endif
    127138}
    128139
     
    502513    seiMessages.push_back(seiChromaResamplingFilterHint);
    503514  }
     515#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
     516  if(m_pcCfg->getSEIAlternativeTransferCharacteristicsSEIEnable())
     517  {
     518    SEIAlternativeTransferCharacteristics *seiAlternativeTransferCharacteristics = new SEIAlternativeTransferCharacteristics;
     519    m_seiEncoder.initSEIAlternativeTransferCharacteristics(seiAlternativeTransferCharacteristics);
     520    seiMessages.push_back(seiAlternativeTransferCharacteristics);
     521  }
     522#endif
    504523}
    505524
     
    17271746        estimatedCpbFullness -= m_pcRateCtrl->getBufferingRate();
    17281747        // prevent underflow
     1748#if V0078_ADAPTIVE_LOWER_BOUND
     1749        if (estimatedCpbFullness - estimatedBits < m_pcRateCtrl->getRCPic()->getLowerBound())
     1750        {
     1751          estimatedBits = max(200, estimatedCpbFullness - m_pcRateCtrl->getRCPic()->getLowerBound());
     1752        }
     1753#else
    17291754        if (estimatedCpbFullness - estimatedBits < (Int)(m_pcRateCtrl->getCpbSize()*0.1f))
    17301755        {
    17311756          estimatedBits = max(200, estimatedCpbFullness - (Int)(m_pcRateCtrl->getCpbSize()*0.1f));
    17321757        }
     1758#endif
    17331759
    17341760        m_pcRateCtrl->getRCPic()->setTargetBits(estimatedBits);
     
    17691795            estimatedCpbFullness -= m_pcRateCtrl->getBufferingRate();
    17701796            // prevent underflow
     1797#if V0078_ADAPTIVE_LOWER_BOUND
     1798            if (estimatedCpbFullness - bits < m_pcRateCtrl->getRCPic()->getLowerBound())
     1799            {
     1800              bits = estimatedCpbFullness - m_pcRateCtrl->getRCPic()->getLowerBound();
     1801            }
     1802#else
    17711803            if (estimatedCpbFullness - bits < (Int)(m_pcRateCtrl->getCpbSize()*0.1f))
    17721804            {
    17731805              bits = estimatedCpbFullness - (Int)(m_pcRateCtrl->getCpbSize()*0.1f);
    17741806            }
     1807#endif
    17751808          }
    17761809#endif
     
    19021935    if ( m_pcCfg->getDeblockingFilterMetric() )
    19031936    {
     1937#if W0038_DB_OPT
     1938      if ( m_pcCfg->getDeblockingFilterMetric()==2 )
     1939      {
     1940        applyDeblockingFilterParameterSelection(pcPic, uiNumSliceSegments, iGOPid);
     1941      }
     1942      else
     1943      {
     1944#endif
    19041945      applyDeblockingFilterMetric(pcPic, uiNumSliceSegments);
     1946#if W0038_DB_OPT
     1947      }
     1948#endif
    19051949    }
    19061950    m_pcLoopFilter->loopFilterPic( pcPic );
     
    19541998      m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(&tempBitCounter);
    19551999      m_pcSAO->initRDOCabacCoder(m_pcEncTop->getRDGoOnSbacCoder(), pcSlice);
     2000#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     2001      m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(),
     2002                          m_pcCfg->getTestSAODisableAtPictureLevel(),
     2003                          m_pcCfg->getSaoEncodingRate(),
     2004                          m_pcCfg->getSaoEncodingRateChroma(),
     2005                          m_pcCfg->getSaoCtuBoundary(),
     2006                          m_pcCfg->getSaoResetEncoderStateAfterIRAP());
     2007#else
    19562008      m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(), m_pcCfg->getTestSAODisableAtPictureLevel(), m_pcCfg->getSaoEncodingRate(), m_pcCfg->getSaoEncodingRateChroma(), m_pcCfg->getSaoCtuBoundary());
     2009#endif
    19572010      m_pcSAO->PCMLFDisableProcess(pcPic);
    19582011      m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(NULL);
     
    21862239  //--CFG_KDY
    21872240  const Int rateMultiplier=(isField?2:1);
    2188   m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
    2189   m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
    2190   m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
    2191   m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier );
     2241  m_gcAnalyzeAll.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
     2242  m_gcAnalyzeI.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
     2243  m_gcAnalyzeP.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
     2244  m_gcAnalyzeB.setFrmRate( m_pcCfg->getFrameRate()*rateMultiplier / (Double)m_pcCfg->getTemporalSubsampleRatio());
    21922245  const ChromaFormat chFmt = m_pcCfg->getChromaFormatIdc();
    21932246
     
    22242277  {
    22252278    //-- interlaced summary
     2279#if TEMPORAL_SUBSAMPLE
     2280    m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate() / (Double)m_pcCfg->getTemporalSubsampleRatio());
     2281#else
    22262282    m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate());
     2283#endif
    22272284    m_gcAnalyzeAll_in.setBits(m_gcAnalyzeAll.getBits());
    22282285    // prior to the above statement, the interlace analyser does not contain the correct total number of bits.
     
    29593016  assert(noCol > 1);
    29603017  assert(noRows > 1);
    2961   UInt64 *colSAD = (UInt64*)malloc(noCol*sizeof(UInt64));
    2962   UInt64 *rowSAD = (UInt64*)malloc(noRows*sizeof(UInt64));
     3018  std::vector<UInt64> colSAD(noCol,  UInt64(0));
     3019  std::vector<UInt64> rowSAD(noRows, UInt64(0));
    29633020  UInt colIdx = 0;
    29643021  UInt rowIdx = 0;
     
    29723029  const Int thr1 = 2*bitdepthScale;
    29733030  UInt a = 0;
    2974 
    2975   memset(colSAD, 0, noCol*sizeof(UInt64));
    2976   memset(rowSAD, 0, noRows*sizeof(UInt64));
    29773031
    29783032  if (maxTBsize > minBlockArtSize)
     
    30643118    }
    30653119  }
    3066 
    3067   free(colSAD);
    3068   free(rowSAD);
    3069 }
     3120}
     3121
     3122#if W0038_DB_OPT
     3123Void TEncGOP::applyDeblockingFilterParameterSelection( TComPic* pcPic, const UInt numSlices, const Int gopID )
     3124{
     3125  enum DBFltParam
     3126  {
     3127    DBFLT_PARAM_AVAILABLE = 0,
     3128    DBFLT_DISABLE_FLAG,
     3129    DBFLT_BETA_OFFSETD2,
     3130    DBFLT_TC_OFFSETD2,
     3131    //NUM_DBFLT_PARAMS
     3132  };
     3133  const Int MAX_BETA_OFFSET = 3;
     3134  const Int MIN_BETA_OFFSET = -3;
     3135  const Int MAX_TC_OFFSET = 3;
     3136  const Int MIN_TC_OFFSET = -3;
     3137
     3138  TComPicYuv* pcPicYuvRec = pcPic->getPicYuvRec();
     3139  TComPicYuv* pcPicYuvOrg = pcPic ->getPicYuvOrg();
     3140
     3141  const Int currQualityLayer = (pcPic->getSlice(0)->getSliceType() != I_SLICE) ? m_pcCfg->getGOPEntry(gopID).m_temporalId+1 : 0;
     3142  assert(currQualityLayer <MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS);
     3143
     3144  if(!m_pcDeblockingTempPicYuv)
     3145  {
     3146    m_pcDeblockingTempPicYuv         = new TComPicYuv;
     3147    m_pcDeblockingTempPicYuv->create( m_pcEncTop->getSourceWidth(), m_pcEncTop->getSourceHeight(), m_pcEncTop->getChromaFormatIdc(),  pcPic->getSlice(0)->getSPS()->getMaxCUWidth(), pcPic->getSlice(0)->getSPS()->getMaxCUHeight(), pcPic->getSlice(0)->getSPS()->getMaxTotalCUDepth(),true );
     3148    memset(m_DBParam, 0, sizeof(m_DBParam));
     3149  }
     3150
     3151  //preserve current reconstruction
     3152  pcPicYuvRec->copyToPic(m_pcDeblockingTempPicYuv);
     3153
     3154  const Bool bNoFiltering      = m_DBParam[currQualityLayer][DBFLT_PARAM_AVAILABLE] && m_DBParam[currQualityLayer][DBFLT_DISABLE_FLAG]==false /*&& pcPic->getTLayer()==0*/;
     3155  const Int  maxBetaOffsetDiv2 = bNoFiltering? Clip3(MIN_BETA_OFFSET, MAX_BETA_OFFSET, m_DBParam[currQualityLayer][DBFLT_BETA_OFFSETD2]+1) : MAX_BETA_OFFSET;
     3156  const Int  minBetaOffsetDiv2 = bNoFiltering? Clip3(MIN_BETA_OFFSET, MAX_BETA_OFFSET, m_DBParam[currQualityLayer][DBFLT_BETA_OFFSETD2]-1) : MIN_BETA_OFFSET;
     3157  const Int  maxTcOffsetDiv2   = bNoFiltering? Clip3(MIN_TC_OFFSET, MAX_TC_OFFSET, m_DBParam[currQualityLayer][DBFLT_TC_OFFSETD2]+2)       : MAX_TC_OFFSET;
     3158  const Int  minTcOffsetDiv2   = bNoFiltering? Clip3(MIN_TC_OFFSET, MAX_TC_OFFSET, m_DBParam[currQualityLayer][DBFLT_TC_OFFSETD2]-2)       : MIN_TC_OFFSET;
     3159
     3160  UInt64 distBetaPrevious      = std::numeric_limits<UInt64>::max();
     3161  UInt64 distMin               = std::numeric_limits<UInt64>::max();
     3162  Bool   bDBFilterDisabledBest = true;
     3163  Int    betaOffsetDiv2Best    = 0;
     3164  Int    tcOffsetDiv2Best      = 0;
     3165
     3166  for(Int betaOffsetDiv2=maxBetaOffsetDiv2; betaOffsetDiv2>=minBetaOffsetDiv2; betaOffsetDiv2--)
     3167  {
     3168    UInt64 distTcMin = std::numeric_limits<UInt64>::max();
     3169    for(Int tcOffsetDiv2=maxTcOffsetDiv2; tcOffsetDiv2 >= minTcOffsetDiv2; tcOffsetDiv2--)
     3170    {
     3171      for (Int i=0; i<numSlices; i++)
     3172      {
     3173        pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(true);
     3174        pcPic->getSlice(i)->setDeblockingFilterDisable(false);
     3175        pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2( betaOffsetDiv2 );
     3176        pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2( tcOffsetDiv2 );
     3177      }
     3178      m_pcDeblockingTempPicYuv->copyToPic(pcPicYuvRec); // restore reconstruction
     3179      m_pcLoopFilter->loopFilterPic( pcPic );
     3180      const UInt64 dist = xFindDistortionFrame(pcPicYuvOrg, pcPicYuvRec, pcPic->getPicSym()->getSPS().getBitDepths());
     3181      if(dist < distMin)
     3182      {
     3183        distMin = dist;
     3184        bDBFilterDisabledBest = false;
     3185        betaOffsetDiv2Best  = betaOffsetDiv2;
     3186        tcOffsetDiv2Best = tcOffsetDiv2;
     3187      }
     3188      if(dist < distTcMin)
     3189      {
     3190        distTcMin = dist;
     3191      }
     3192      else if(tcOffsetDiv2 <-2)
     3193      {
     3194        break;
     3195      }
     3196    }
     3197    if(betaOffsetDiv2<-1 && distTcMin >= distBetaPrevious)
     3198    {
     3199      break;
     3200    }
     3201    distBetaPrevious = distTcMin;
     3202  }
     3203
     3204  //update:
     3205  m_DBParam[currQualityLayer][DBFLT_PARAM_AVAILABLE] = 1;
     3206  m_DBParam[currQualityLayer][DBFLT_DISABLE_FLAG]    = bDBFilterDisabledBest;
     3207  m_DBParam[currQualityLayer][DBFLT_BETA_OFFSETD2]   = betaOffsetDiv2Best;
     3208  m_DBParam[currQualityLayer][DBFLT_TC_OFFSETD2]     = tcOffsetDiv2Best;
     3209
     3210  m_pcDeblockingTempPicYuv->copyToPic(pcPicYuvRec); //restore reconstruction
     3211
     3212  if(bDBFilterDisabledBest)
     3213  {
     3214    for (Int i=0; i<numSlices; i++)
     3215    {
     3216      pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(true);
     3217      pcPic->getSlice(i)->setDeblockingFilterDisable(true);
     3218    }
     3219  }
     3220  else if(betaOffsetDiv2Best ==pcPic->getSlice(0)->getPPS()->getDeblockingFilterBetaOffsetDiv2() &&  tcOffsetDiv2Best==pcPic->getSlice(0)->getPPS()->getDeblockingFilterTcOffsetDiv2())
     3221  {
     3222    for (Int i=0; i<numSlices; i++)
     3223    {
     3224      pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(false);
     3225      pcPic->getSlice(i)->setDeblockingFilterDisable(        pcPic->getSlice(i)->getPPS()->getPicDisableDeblockingFilterFlag() );
     3226      pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2( pcPic->getSlice(i)->getPPS()->getDeblockingFilterBetaOffsetDiv2() );
     3227      pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2(   pcPic->getSlice(i)->getPPS()->getDeblockingFilterTcOffsetDiv2()   );
     3228    }
     3229  }
     3230  else
     3231  {
     3232    for (Int i=0; i<numSlices; i++)
     3233    {
     3234      pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(true);
     3235      pcPic->getSlice(i)->setDeblockingFilterDisable( false );
     3236      pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2(betaOffsetDiv2Best);
     3237      pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2(tcOffsetDiv2Best);
     3238    }
     3239  }
     3240}
     3241#endif
    30703242
    30713243#if NH_MV
  • trunk/source/Lib/TLibEncoder/TEncGOP.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    153153  Bool                    m_bufferingPeriodSEIPresentInAU;
    154154  SEIEncoder              m_seiEncoder;
     155#if W0038_DB_OPT
     156  TComPicYuv*             m_pcDeblockingTempPicYuv;
     157  Int                     m_DBParam[MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS][4];   //[layer_id][0: available; 1: bDBDisabled; 2: Beta Offset Div2; 3: Tc Offset Div2;]
     158#endif
    155159
    156160public:
     
    249253
    250254  Void applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices );
     255#if W0038_DB_OPT
     256  Void applyDeblockingFilterParameterSelection( TComPic* pcPic, const UInt numSlices, const Int gopID );
     257#endif
    251258};// END CLASS DEFINITION TEncGOP
    252259
  • trunk/source/Lib/TLibEncoder/TEncPic.cpp

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncPic.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncPreanalyzer.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncPreanalyzer.h

    r1179 r1405  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6* Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    554554}
    555555
     556#if V0078_ADAPTIVE_LOWER_BOUND
     557Int TEncRCPic::xEstPicLowerBound(TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP)
     558{
     559  Int lowerBound = 0;
     560  Int GOPbitsLeft = encRCGOP->getBitsLeft();
     561
     562  const Int nextPicPosition = (encRCGOP->getNumPic() - encRCGOP->getPicLeft() + 1) % encRCGOP->getNumPic();
     563  const Int nextPicRatio = encRCSeq->getBitRatio(nextPicPosition);
     564
     565  Int totalPicRatio = 0;
     566  for (Int i = nextPicPosition; i < encRCGOP->getNumPic(); i++)
     567  {
     568    totalPicRatio += encRCSeq->getBitRatio(i);
     569  }
     570
     571  if (nextPicPosition == 0)
     572  {
     573    GOPbitsLeft = encRCGOP->getTargetBits();
     574  }
     575  else
     576  {
     577    GOPbitsLeft -= m_targetBits;
     578  }
     579
     580  lowerBound = Int(((Double)GOPbitsLeft) * nextPicRatio / totalPicRatio);
     581
     582  if (lowerBound < 100)
     583  {
     584    lowerBound = 100;   // at least allocate 100 bits for one picture
     585  }
     586
     587  if (m_encRCSeq->getFramesLeft() > 16)
     588  {
     589    lowerBound = Int(g_RCWeightPicRargetBitInBuffer * lowerBound + g_RCWeightPicTargetBitInGOP * m_encRCGOP->getTargetBitInGOP(nextPicPosition));
     590  }
     591
     592  return lowerBound;
     593}
     594#endif
     595
     596
    556597Void TEncRCPic::addToPictureLsit( list<TEncRCPic*>& listPreviousPictures )
    557598{
     
    611652  Int picWidthInLCU  = ( picWidth  % LCUWidth  ) == 0 ? picWidth  / LCUWidth  : picWidth  / LCUWidth  + 1;
    612653  Int picHeightInLCU = ( picHeight % LCUHeight ) == 0 ? picHeight / LCUHeight : picHeight / LCUHeight + 1;
     654#if V0078_ADAPTIVE_LOWER_BOUND
     655  m_lowerBound       = xEstPicLowerBound( encRCSeq, encRCGOP );
     656#endif
    613657
    614658  m_LCULeft         = m_numberOfLCU;
  • trunk/source/Lib/TLibEncoder/TEncRateCtrl.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    267267  Int xEstPicTargetBits( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP );
    268268  Int xEstPicHeaderBits( list<TEncRCPic*>& listPreviousPictures, Int frameLevel );
     269#if V0078_ADAPTIVE_LOWER_BOUND
     270  Int xEstPicLowerBound( TEncRCSeq* encRCSeq, TEncRCGOP* encRCGOP );
     271#endif
    269272
    270273public:
     
    282285  Int  getBitsCoded()                                     { return m_targetBits - m_estHeaderBits - m_bitsLeft; }
    283286  Int  getLCUCoded()                                      { return m_numberOfLCU - m_LCULeft; }
     287#if V0078_ADAPTIVE_LOWER_BOUND
     288  Int  getLowerBound()                                    { return m_lowerBound; }
     289#endif
    284290  TRCLCU* getLCU()                                        { return m_LCUs; }
    285291  TRCLCU& getLCU( Int LCUIdx )                            { return m_LCUs[LCUIdx]; }
     
    321327  Int m_estHeaderBits;
    322328  Int m_estPicQP;
     329#if V0078_ADAPTIVE_LOWER_BOUND
     330  Int m_lowerBound;
     331#endif
    323332  Double m_estPicLambda;
    324333
  • trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    120120
    121121  ::memset(m_saoDisabledRate, 0, sizeof(m_saoDisabledRate));
     122#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     123  m_lastIRAPPoc = MAX_INT;
     124#endif
    122125
    123126  for(Int typeIdc=0; typeIdc < NUM_SAO_NEW_TYPES; typeIdc++)
     
    239242
    240243
     244#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     245Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed, const Bool bResetStateAfterIRAP )
     246#else
    241247Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, Bool isPreDBFSamplesUsed )
     248#endif
    242249{
    243250  TComPicYuv* orgYuv= pPic->getPicYuvOrg();
     
    256263  }
    257264  //slice on/off
     265#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     266  decidePicParams(sliceEnabled, pPic, saoEncodingRate, saoEncodingRateChroma, bResetStateAfterIRAP);
     267#else
    258268  decidePicParams(sliceEnabled, pPic->getSlice(0)->getDepth(), saoEncodingRate, saoEncodingRateChroma);
     269#endif
    259270
    260271  //block on/off
     
    330341}
    331342
     343#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     344Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP)
     345#else
    332346Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, Int picTempLayer, const Double saoEncodingRate, const Double saoEncodingRateChroma)
    333 {
     347#endif
     348{
     349#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     350  if (pic->getSlice(0)->isIRAP())
     351  {
     352    m_lastIRAPPoc = pic->getSlice(0)->getPOC();
     353  }
     354  if (bResetStateAfterIRAP && pic->getSlice(0)->getPOC() > m_lastIRAPPoc)
     355  { // reset
     356    for (Int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++)
     357{
     358      for (Int tempLayer = 1; tempLayer < MAX_TLAYER; tempLayer++)
     359      {
     360        m_saoDisabledRate[compIdx][tempLayer] = 0.0;
     361      }
     362    }
     363    m_lastIRAPPoc = MAX_INT;
     364  }
     365  const Int picTempLayer = pic->getSlice(0)->getDepth();
     366#endif
     367
    334368  //decide sliceEnabled[compIdx]
    335369  const Int numberOfComponents = getNumberValidComponents(m_chromaFormatIDC);
  • trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    103103  Void destroyEncData();
    104104  Void initRDOCabacCoder(TEncSbac* pcRDGoOnSbacCoder, TComSlice* pcSlice) ;
     105#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     106  Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed, const Bool bResetStateAfterIRAP);
     107#else
    105108  Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, Bool isPreDBFSamplesUsed);
     109#endif
    106110public: //methods
    107111  Void getPreDBFStatistics(TComPic* pPic);
    108112private: //methods
    109113  Void getStatistics(SAOStatData*** blkStats, TComPicYuv* orgYuv, TComPicYuv* srcYuv,TComPic* pPic, Bool isCalculatePreDeblockSamples = false);
     114#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     115  Void decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP);
     116#else
    110117  Void decidePicParams(Bool* sliceEnabled, Int picTempLayer, const Double saoEncodingRate, const Double saoEncodingRateChroma);
     118#endif
    111119  Void decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma);
    112120  Void getBlkStats(const ComponentID compIdx, const Int channelBitDepth, SAOStatData* statsDataTypes, Pel* srcBlk, Pel* orgBlk, Int srcStride, Int orgStride, Int width, Int height, Bool isLeftAvail,  Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isCalculatePreDeblockSamples);
     
    133141  SAOStatData***         m_preDBFstatData;
    134142  Double                 m_saoDisabledRate[MAX_NUM_COMPONENT][MAX_TLAYER];
     143#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     144  Int                    m_lastIRAPPoc;
     145#endif
    135146  Int                    m_skipLinesR[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES];
    136147  Int                    m_skipLinesB[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES];
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4949 : m_encCABACTableIdx(I_SLICE)
    5050{
    51   m_apcPicYuvPred = NULL;
    52   m_apcPicYuvResi = NULL;
    53 
    54   m_pdRdPicLambda = NULL;
    55   m_pdRdPicQp     = NULL;
    56   m_piRdPicQp     = NULL;
    5751}
    5852
    5953TEncSlice::~TEncSlice()
    6054{
     55  destroy();
    6156}
    6257
     
    6459{
    6560  // create prediction picture
    66   if ( m_apcPicYuvPred == NULL )
    67   {
    68     m_apcPicYuvPred  = new TComPicYuv;
    69     m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true );
    70   }
     61  m_picYuvPred.create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true );
    7162
    7263  // create residual picture
    73   if( m_apcPicYuvResi == NULL )
    74   {
    75     m_apcPicYuvResi  = new TComPicYuv;
    76     m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true );
    77   }
     64  m_picYuvResi.create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true );
    7865}
    7966
    8067Void TEncSlice::destroy()
    8168{
    82   // destroy prediction picture
    83   if ( m_apcPicYuvPred )
    84   {
    85     m_apcPicYuvPred->destroy();
    86     delete m_apcPicYuvPred;
    87     m_apcPicYuvPred  = NULL;
    88   }
    89 
    90   // destroy residual picture
    91   if ( m_apcPicYuvResi )
    92   {
    93     m_apcPicYuvResi->destroy();
    94     delete m_apcPicYuvResi;
    95     m_apcPicYuvResi  = NULL;
    96   }
     69  m_picYuvPred.destroy();
     70  m_picYuvResi.destroy();
    9771
    9872  // free lambda and QP arrays
    99   if ( m_pdRdPicLambda )
    100   {
    101     xFree( m_pdRdPicLambda );
    102     m_pdRdPicLambda = NULL;
    103   }
    104   if ( m_pdRdPicQp )
    105   {
    106     xFree( m_pdRdPicQp );
    107     m_pdRdPicQp = NULL;
    108   }
    109   if ( m_piRdPicQp )
    110   {
    111     xFree( m_piRdPicQp );
    112     m_piRdPicQp = NULL;
    113   }
     73  m_vdRdPicLambda.clear();
     74  m_vdRdPicQp.clear();
     75  m_viRdPicQp.clear();
    11476}
    11577
     
    13395
    13496  // create lambda and QP arrays
    135   m_pdRdPicLambda     = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 );
    136   m_pdRdPicQp         = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 );
    137   m_piRdPicQp         = (Int*   )xMalloc( Int,    m_pcCfg->getDeltaQpRD() * 2 + 1 );
     97  m_vdRdPicLambda.resize(m_pcCfg->getDeltaQpRD() * 2 + 1 );
     98  m_vdRdPicQp.resize(    m_pcCfg->getDeltaQpRD() * 2 + 1 );
     99  m_viRdPicQp.resize(    m_pcCfg->getDeltaQpRD() * 2 + 1 );
    138100#if KWU_RC_MADPRED_E0227
    139101  if(m_pcCfg->getUseRateCtrl())
     
    427389    }
    428390
     391#if W0062_RECALCULATE_QP_TO_ALIGN_WITH_LAMBDA
     392    Double lambdaRef = 0.57*pow(2.0, qp_temp/3.0);
     393    // QP correction due to modified lambda
     394    Double qpOffset = floor((3.0*log(dLambda/lambdaRef)/log(2.0)) +0.5);
     395    dQP += qpOffset;
     396#endif
     397
    429398    iQP = max( -rpcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) );
    430399
    431     m_pdRdPicLambda[iDQpIdx] = dLambda;
    432     m_pdRdPicQp    [iDQpIdx] = dQP;
    433     m_piRdPicQp    [iDQpIdx] = iQP;
     400    m_vdRdPicLambda[iDQpIdx] = dLambda;
     401    m_vdRdPicQp    [iDQpIdx] = dQP;
     402    m_viRdPicQp    [iDQpIdx] = iQP;
    434403  }
    435404
    436405  // obtain dQP = 0 case
    437   dLambda = m_pdRdPicLambda[0];
    438   dQP     = m_pdRdPicQp    [0];
    439   iQP     = m_piRdPicQp    [0];
     406  dLambda = m_vdRdPicLambda[0];
     407  dQP     = m_vdRdPicQp    [0];
     408  iQP     = m_viRdPicQp    [0];
    440409
    441410
     
    446415#endif
    447416  const std::vector<Double> &intraLambdaModifiers=m_pcCfg->getIntraLambdaModifier();
     417
     418#if W0038_CQP_ADJ
     419  if(rpcSlice->getPPS()->getSliceChromaQpFlag())
     420  {
     421    const Bool bUseIntraOrPeriodicOffset = rpcSlice->getSliceType()==I_SLICE || (m_pcCfg->getSliceChromaOffsetQpPeriodicity()!=0 && (rpcSlice->getPOC()%m_pcCfg->getSliceChromaOffsetQpPeriodicity())==0);
     422    Int cbQP = bUseIntraOrPeriodicOffset? m_pcCfg->getSliceChromaOffsetQpIntraOrPeriodic(false) : m_pcCfg->getGOPEntry(iGOPid).m_CbQPoffset;
     423    Int crQP = bUseIntraOrPeriodicOffset? m_pcCfg->getSliceChromaOffsetQpIntraOrPeriodic(true)  : m_pcCfg->getGOPEntry(iGOPid).m_CrQPoffset;
     424
     425    cbQP = Clip3( -12, 12, cbQP + rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb) ) - rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb);
     426    crQP = Clip3( -12, 12, crQP + rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr) ) - rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr);
     427    rpcSlice->setSliceChromaQpDelta(COMPONENT_Cb, Clip3( -12, 12, cbQP));
     428    assert(rpcSlice->getSliceChromaQpDelta(COMPONENT_Cb)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb)<=12 && rpcSlice->getSliceChromaQpDelta(COMPONENT_Cb)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb)>=-12);
     429    rpcSlice->setSliceChromaQpDelta(COMPONENT_Cr, Clip3( -12, 12, crQP));
     430    assert(rpcSlice->getSliceChromaQpDelta(COMPONENT_Cr)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr)<=12 && rpcSlice->getSliceChromaQpDelta(COMPONENT_Cr)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr)>=-12);
     431  }
     432  else
     433  {
     434    rpcSlice->setSliceChromaQpDelta( COMPONENT_Cb, 0 );
     435    rpcSlice->setSliceChromaQpDelta( COMPONENT_Cr, 0 );
     436  }
     437#endif
    448438
    449439  Double lambdaModifier;
     
    517507#endif
    518508  rpcSlice->setSliceQpDelta      ( 0 );
     509#if !W0038_CQP_ADJ
    519510  rpcSlice->setSliceChromaQpDelta( COMPONENT_Cb, 0 );
    520511  rpcSlice->setSliceChromaQpDelta( COMPONENT_Cr, 0 );
     512#endif
    521513  rpcSlice->setUseChromaQpAdj( rpcSlice->getPPS()->getPpsRangeExtension().getChromaQpOffsetListEnabledFlag() );
    522514#if NH_MV
     
    575567  rpcSlice->setTLayer( pcPic->getTLayer() );
    576568
    577   assert( m_apcPicYuvPred );
    578   assert( m_apcPicYuvResi );
    579 
    580   pcPic->setPicYuvPred( m_apcPicYuvPred );
    581   pcPic->setPicYuvResi( m_apcPicYuvResi );
     569  pcPic->setPicYuvPred( &m_picYuvPred );
     570  pcPic->setPicYuvResi( &m_picYuvResi );
    582571  rpcSlice->setSliceMode            ( m_pcCfg->getSliceMode()            );
    583572  rpcSlice->setSliceArgument        ( m_pcCfg->getSliceArgument()        );
     
    679668  if (m_pcCfg->getGOPSize() > 1)
    680669  {
    681     dFrameLambda = 0.68 * pow (2, (m_piRdPicQp[0]  - SHIFT_QP) / 3.0) * (pcSlice->isInterB()? 2 : 1);
     670    dFrameLambda = 0.68 * pow (2, (m_viRdPicQp[0]  - SHIFT_QP) / 3.0) * (pcSlice->isInterB()? 2 : 1);
    682671  }
    683672  else
    684673  {
    685     dFrameLambda = 0.68 * pow (2, (m_piRdPicQp[0] - SHIFT_QP) / 3.0);
     674    dFrameLambda = 0.68 * pow (2, (m_viRdPicQp[0] - SHIFT_QP) / 3.0);
    686675  }
    687676  m_pcRdCost      ->setFrameLambda(dFrameLambda);
     
    690679  for ( UInt uiQpIdx = 0; uiQpIdx < 2 * m_pcCfg->getDeltaQpRD() + 1; uiQpIdx++ )
    691680  {
    692     pcSlice       ->setSliceQp             ( m_piRdPicQp    [uiQpIdx] );
     681    pcSlice       ->setSliceQp             ( m_viRdPicQp    [uiQpIdx] );
    693682#if ADAPTIVE_QP_SELECTION
    694     pcSlice       ->setSliceQpBase         ( m_piRdPicQp    [uiQpIdx] );
    695 #endif
    696     setUpLambda(pcSlice, m_pdRdPicLambda[uiQpIdx], m_piRdPicQp    [uiQpIdx]);
     683    pcSlice       ->setSliceQpBase         ( m_viRdPicQp    [uiQpIdx] );
     684#endif
     685    setUpLambda(pcSlice, m_vdRdPicLambda[uiQpIdx], m_viRdPicQp    [uiQpIdx]);
    697686
    698687    // try compress
     
    730719
    731720  // set best values
    732   pcSlice       ->setSliceQp             ( m_piRdPicQp    [uiQpIdxBest] );
     721  pcSlice       ->setSliceQp             ( m_viRdPicQp    [uiQpIdxBest] );
    733722#if ADAPTIVE_QP_SELECTION
    734   pcSlice       ->setSliceQpBase         ( m_piRdPicQp    [uiQpIdxBest] );
    735 #endif
    736   setUpLambda(pcSlice, m_pdRdPicLambda[uiQpIdxBest], m_piRdPicQp    [uiQpIdxBest]);
     723  pcSlice       ->setSliceQpBase         ( m_viRdPicQp    [uiQpIdxBest] );
     724#endif
     725  setUpLambda(pcSlice, m_vdRdPicLambda[uiQpIdxBest], m_viRdPicQp    [uiQpIdxBest]);
    737726}
    738727
  • trunk/source/Lib/TLibEncoder/TEncSlice.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    6868  // pictures
    6969  TComList<TComPic*>*     m_pcListPic;                          ///< list of pictures
    70   TComPicYuv*             m_apcPicYuvPred;                      ///< prediction picture buffer
    71   TComPicYuv*             m_apcPicYuvResi;                      ///< residual picture buffer
     70  TComPicYuv              m_picYuvPred;                         ///< prediction picture buffer
     71  TComPicYuv              m_picYuvResi;                         ///< residual picture buffer
    7272
    7373  // processing units
     
    9595#endif
    9696  Double                  m_dPicRdCost;                         ///< picture-level RD cost
    97   Double*                 m_pdRdPicLambda;                      ///< array of lambda candidates
    98   Double*                 m_pdRdPicQp;                          ///< array of picture QP candidates (double-type for lambda)
    99   Int*                    m_piRdPicQp;                          ///< array of picture QP candidates (Int-type)
     97  std::vector<Double>     m_vdRdPicLambda;                      ///< array of lambda candidates
     98  std::vector<Double>     m_vdRdPicQp;                          ///< array of picture QP candidates (double-type for lambda)
     99  std::vector<Int>        m_viRdPicQp;                          ///< array of picture QP candidates (Int-type)
    100100  TEncRateCtrl*           m_pcRateCtrl;                         ///< Rate control manager
    101101  UInt                    m_uiSliceIdx;
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    144144      g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList, getLayerId() );
    145145#else
    146     m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
    147         m_maxCUWidth, m_maxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
     146    m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, (Int)( (Double)m_iFrameRate/m_temporalSubsampleRatio + 0.5), m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
     147                      m_maxCUWidth, m_maxCUHeight,m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
    148148#endif
    149149  }
     
    951951  }
    952952
     953  if (getTemporalSubsampleRatio()>1)
     954  {
     955    UInt temporalSubsampleRatio = getTemporalSubsampleRatio();
     956    if ( Double(timingInfo->getNumUnitsInTick()) * temporalSubsampleRatio > std::numeric_limits<UInt>::max() )
     957    {
     958      timingInfo->setTimeScale( timingInfo->getTimeScale() / temporalSubsampleRatio );
     959    }
     960    else
     961    {
     962      timingInfo->setNumUnitsInTick( timingInfo->getNumUnitsInTick() * temporalSubsampleRatio );
     963    }
     964  }
     965
    953966  Bool rateCnt = ( bitRate > 0 );
    954967  hrd->setNalHrdParametersPresentFlag( rateCnt );
     
    11351148  m_cPPS.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset );
    11361149  m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset );
     1150#if W0038_CQP_ADJ
     1151  Bool bChromaDeltaQPEnabled = false;
     1152  {
     1153    bChromaDeltaQPEnabled = ( m_sliceChromaQpOffsetIntraOrPeriodic[0] || m_sliceChromaQpOffsetIntraOrPeriodic[1] );
     1154    if( !bChromaDeltaQPEnabled )
     1155    {
     1156      for( Int i=0; i<m_iGOPSize; i++ )
     1157      {
     1158        if( m_GOPList[i].m_CbQPoffset || m_GOPList[i].m_CrQPoffset )
     1159        {
     1160          bChromaDeltaQPEnabled = true;
     1161          break;
     1162        }
     1163      }
     1164    }
     1165  }
     1166  m_cPPS.setSliceChromaQpFlag(bChromaDeltaQPEnabled);
     1167#endif
    11371168
    11381169  m_cPPS.setEntropyCodingSyncEnabledFlag( m_entropyCodingSyncEnabledFlag );
  • trunk/source/Lib/TLibEncoder/TEncTop.h

    r1321 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/WeightPredAnalysis.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibExtractor/TExtrTop.cpp

    r1313 r1405  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibExtractor/TExtrTop.h

    r1313 r1405  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenFilter.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenFilter.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenImage.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenImage.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenImagePlane.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenImagePlane.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenInterpFilter.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenInterpFilter.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenModel.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenModel.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenSingleModel.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenSingleModel.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenTop.cpp

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibRenderer/TRenTop.h

    r1396 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibVideoIO/TVideoIOYuv.cpp

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibVideoIO/TVideoIOYuv.h

    r1386 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/libmd5/MD5.h

    r1313 r1405  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/libmd5/libmd5.h

    r1179 r1405  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6* Copyright (c) 2010-2016, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
Note: See TracChangeset for help on using the changeset viewer.