Changeset 537 in 3DVCSoftware


Ignore:
Timestamp:
13 Jul 2013, 15:51:26 (11 years ago)
Author:
tech
Message:

Update to HM 11.0.

Location:
branches/HTM-DEV-0.3-dev2
Files:
56 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_intra_main.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main
     7Level                         : 6.2
    48
    59#======== Unit definition ================
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_intra_main10.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main10
     7Level                         : 6.2
    48
    59#======== Unit definition ================
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_lowdelay_P_main.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main
     7Level                         : 6.2
    48
    59#======== Unit definition ================
     
    104108RateControl                         : 0                # Rate control: enable rate control
    105109TargetBitrate                       : 1000000          # Rate control: target bitrate, in bps
    106 KeepHierarchicalBit                 : 1                # Rate control: keep hierarchical bit allocation in rate control algorithm
     110KeepHierarchicalBit                 : 2                # Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
    107111LCULevelRateControl                 : 1                # Rate control: 1: LCU level RC; 0: picture level RC
    108112RCLCUSeparateModel                  : 1                # Rate control: use LCU level separate R-lambda model
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_lowdelay_P_main10.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main10
     7Level                         : 6.2
    48
    59#======== Unit definition ================
     
    104108RateControl                         : 0                # Rate control: enable rate control
    105109TargetBitrate                       : 1000000          # Rate control: target bitrate, in bps
    106 KeepHierarchicalBit                 : 1                # Rate control: keep hierarchical bit allocation in rate control algorithm
     110KeepHierarchicalBit                 : 2                # Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
    107111LCULevelRateControl                 : 1                # Rate control: 1: LCU level RC; 0: picture level RC
    108112RCLCUSeparateModel                  : 1                # Rate control: use LCU level separate R-lambda model
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_lowdelay_main.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main
     7Level                         : 6.2
    48
    59#======== Unit definition ================
     
    104108RateControl                         : 0                # Rate control: enable rate control
    105109TargetBitrate                       : 1000000          # Rate control: target bitrate, in bps
    106 KeepHierarchicalBit                 : 1                # Rate control: keep hierarchical bit allocation in rate control algorithm
     110KeepHierarchicalBit                 : 2                # Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
    107111LCULevelRateControl                 : 1                # Rate control: 1: LCU level RC; 0: picture level RC
    108112RCLCUSeparateModel                  : 1                # Rate control: use LCU level separate R-lambda model
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_lowdelay_main10.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main10
     7Level                         : 6.2
    48
    59#======== Unit definition ================
     
    104108RateControl                         : 0                # Rate control: enable rate control
    105109TargetBitrate                       : 1000000          # Rate control: target bitrate, in bps
    106 KeepHierarchicalBit                 : 1                # Rate control: keep hierarchical bit allocation in rate control algorithm
     110KeepHierarchicalBit                 : 2                # Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
    107111LCULevelRateControl                 : 1                # Rate control: 1: LCU level RC; 0: picture level RC
    108112RCLCUSeparateModel                  : 1                # Rate control: use LCU level separate R-lambda model
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_randomaccess_main.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main
     7Level                         : 6.2
    48
    59#======== Unit definition ================
     
    108112RateControl                         : 0                # Rate control: enable rate control
    109113TargetBitrate                       : 1000000          # Rate control: target bitrate, in bps
    110 KeepHierarchicalBit                 : 1                # Rate control: keep hierarchical bit allocation in rate control algorithm
     114KeepHierarchicalBit                 : 2                # Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
    111115LCULevelRateControl                 : 1                # Rate control: 1: LCU level RC; 0: picture level RC
    112116RCLCUSeparateModel                  : 1                # Rate control: use LCU level separate R-lambda model
  • branches/HTM-DEV-0.3-dev2/cfg/HEVC/HM/encoder_randomaccess_main10.cfg

    r446 r537  
    22BitstreamFile                 : str.bin
    33ReconFile                     : rec.yuv
     4
     5#======== Profile/Level ================
     6Profile                       : main10
     7Level                         : 6.2
    48
    59#======== Unit definition ================
     
    108112RateControl                         : 0                # Rate control: enable rate control
    109113TargetBitrate                       : 1000000          # Rate control: target bitrate, in bps
    110 KeepHierarchicalBit                 : 1                # Rate control: keep hierarchical bit allocation in rate control algorithm
     114KeepHierarchicalBit                 : 2                # Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
    111115LCULevelRateControl                 : 1                # Rate control: 1: LCU level RC; 0: picture level RC
    112116RCLCUSeparateModel                  : 1                # Rate control: use LCU level separate R-lambda model
  • branches/HTM-DEV-0.3-dev2/doc/Doxyfile

    r446 r537  
    3333# if some version control system is used.
    3434
    35 PROJECT_NUMBER         = HM-10.1
     35PROJECT_NUMBER         = HM-11.0
    3636
    3737# Using the PROJECT_BRIEF tag one can provide an optional one line description
  • branches/HTM-DEV-0.3-dev2/doc/software-manual.tex

    r324 r537  
    118118\begin{abstract}
    119119This document is a user manual describing usage of reference software
    120 for the HEVC project. It applies to version 10.0
     120for the HEVC project. It applies to version 11.0
    121121of the software.
    122122\end{abstract}
     
    13251325\Option{KeepHierarchicalBit} &
    13261326\ShortOption{\None} &
    1327 \Default{false} &
    1328 Rate control: keep hierarchical bit allocation in rate control algorithm.
     1327\Default{0} &
     1328Rate control: 0: equal bit allocation among pictures;
     13291: fix ratio hierarchical bit allocation; 2: adaptive hierarchical ratio bit allocation.
    13291330It is suggested to enable hierarchical bit allocation for hierarchical-B coding structure.
    13301331\\
     
    16501651SEI messages. This option has no effect if SEIFramePacking is
    16511652disabled.
     1653\\
     1654\Option{SEIToneMappingInfo} &
     1655\ShortOption{\None} &
     1656\Default{0} &
     1657Enables or disables the insertion of the Tone Mapping SEI message.
     1658\\
     1659\Option{SEIToneMapId} &
     1660\ShortOption{\None} &
     1661\Default{0} &
     1662Specifies Id of Tone Mapping SEI message for a given session.
     1663\\
     1664\Option{SEIToneMapCancelFlag} &
     1665\ShortOption{\None} &
     1666\Default{0} &
     1667Indicates that Tone Mapping SEI message cancels the persistance or follows.
     1668\\
     1669\Option{SEIToneMapPersistenceFlag} &
     1670\ShortOption{\None} &
     1671\Default{1} &
     1672Specifies the persistence of the Tone Mapping SEI message.
     1673\\
     1674\Option{SEIToneMapCodedDataBitDepth} &
     1675\ShortOption{\None} &
     1676\Default{10} &
     1677Specifies Coded Data BitDepth of Tone Mapping SEI messages.
     1678\\
     1679\Option{SEIToneMapTargetBitDepth} &
     1680\ShortOption{\None} &
     1681\Default{8} &
     1682Specifies Output BitDepth of Tome mapping function.
     1683\\
     1684\Option{SEIToneMapModelId} &
     1685\ShortOption{\None} &
     1686\Default{0} &
     1687Specifies Model utilized for mapping coded data into
     1688target_bit_depth range.
     1689\par
     1690\begin{tabular}{cp{0.45\textwidth}}
     1691  0 & linear mapping with clipping \\
     1692  1 & sigmoidal mapping \\
     1693  2 & user-defined table mapping \\
     1694  3 & piece-wise linear mapping \\
     1695  4 & luminance dynamic range mapping \\
     1696\end{tabular}
     1697\\
     1698\Option{SEIToneMapMinValue} &
     1699\ShortOption{\None} &
     1700\Default{0} &
     1701Specifies the minimum value in mode 0.
     1702\\
     1703\Option{SEIToneMapMaxValue} &
     1704\ShortOption{\None} &
     1705\Default{1023} &
     1706Specifies the maxmum value in mode 0.
     1707\\
     1708\Option{SEIToneMapSigmoidMidpoint} &
     1709\ShortOption{\None} &
     1710\Default{512} &
     1711Specifies the centre point in mode 1.
     1712\\
     1713\Option{SEIToneMapSigmoidWidth} &
     1714\ShortOption{\None} &
     1715\Default{960} &
     1716Specifies the distance between 5% and 95% values of
     1717the target_bit_depth in mode 1.
     1718\\
     1719\Option{SEIToneMapStartOfCodedInterval} &
     1720\ShortOption{\None} &
     1721\Default{\None} &
     1722Array of user-defined mapping table.
     1723Default table can be set to the following:
     1724\par
     1725\begin{tabular}{cp{0.45\textwidth}}
     17260 12 24 36 48 60 72 84 96 108 120 132 144 156 168 180
     1727192 192 196 204 208 216 220 228 232 240 248 252 260 264
     1728272 276 284 292 292 296 300 304 308 312 320 324 328 332
     1729336 344 348 352 356 360 368 372 376 380 384 388 396 400
     1730404 408 412 420 424 428 432 436 444 444 444 448 452 456
     1731460 464 468 472 476 476 480 484 488 492 496 500 504 508
     1732508 512 516 520 524 528 532 536 540 540 544 548 552 556
     1733560 564 568 572 572 576 580 584 588 592 596 600 604 604
     1734608 612 616 620 624 628 632 636 636 640 644 648 652 656
     1735660 664 668 672 672 672 676 680 680 684 688 692 692 696
     1736700 704 704 708 712 716 716 720 724 724 728 732 736 736
     1737740 744 748 748 752 756 760 760 764 768 768 772 776 780
     1738780 784 788 792 792 796 800 804 804 808 812 812 816 820
     1739824 824 828 832 836 836 840 844 848 848 852 856 860 860
     1740860 864 864 868 872 872 876 880 880 884 884 888 892 892
     1741896 900 900 904 908 908 912 912 916 920 920 924 928 928
     1742932 936 936 940 940 944 948 948 952 956 956 960 964 964
     1743968 968 972 976 976 980 984 984 988 992 992 996 996 1000
     17441004 1004 1008 1012 1012 1016 1020 1024
     1745\end{tabular}
     1746\\
     1747\Option{SEIToneMapNumPivots} &
     1748\ShortOption{\None} &
     1749\Default{5} &
     1750Specifies the number of pivot points in mode 3.
     1751\\
     1752\Option{SEIToneMapCodedPivotValue} &
     1753\ShortOption{\None} &
     1754\Default{\None} &
     1755Array of coded pivot point in mode 3.
     1756Default table can be set to the following:
     1757\par
     1758\begin{tabular}{cp{0.45\textwidth}}
     175964 128 256 512 768
     1760\end{tabular}
     1761\\
     1762\Option{SEIToneMapTargetPivotValue} &
     1763\ShortOption{\None} &
     1764\Default{\None} &
     1765Array of target pivot point in mode 3.
     1766Default table can be set to the following:
     1767\par
     1768\begin{tabular}{cp{0.45\textwidth}}
     176948 73 111 168 215
     1770\end{tabular}
     1771\\
     1772\Option{SEIToneMapCameraIsoSpeedIdc} &
     1773\ShortOption{\None} &
     1774\Default{0} &
     1775Indicates the camera ISO speed for daylight illumination.
     1776\\
     1777\Option{SEIToneMapCameraIsoSpeedValue} &
     1778\ShortOption{\None} &
     1779\Default{420} &
     1780Specifies the camera ISO speed for daylight illumination of Extended_ISO.
     1781\\
     1782\Option{SEIToneMapExposureCompensationValueSignFlag} &
     1783\ShortOption{\None} &
     1784\Default{0} &
     1785Specifies the sign of ExposureCompensationValue.
     1786\\
     1787\Option{SEIToneMapExposureCompensationValueNumerator} &
     1788\ShortOption{\None} &
     1789\Default{0} &
     1790Specifies the numerator of ExposureCompensationValue.
     1791\\
     1792\Option{SEIToneMapExposureCompensationValueDenomIdc} &
     1793\ShortOption{\None} &
     1794\Default{2} &
     1795Specifies the denominator of ExposureCompensationValue.
     1796\\
     1797\Option{SEIToneMapRefScreenLuminanceWhite} &
     1798\ShortOption{\None} &
     1799\Default{350} &
     1800Specifies reference screen brightness setting in units of candela per square metre.
     1801\\
     1802\Option{SEIToneMapExtendedRangeWhiteLevel} &
     1803\ShortOption{\None} &
     1804\Default{800} &
     1805Indicates the luminance dynamic range.
     1806\\
     1807\Option{SEIToneMapNominalBlackLevelLumaCodeValue} &
     1808\ShortOption{\None} &
     1809\Default{16} &
     1810Specifies luma sample value of the nominal black level assigned decoded pictures.
     1811\\
     1812\Option{SEIToneMapNominalWhiteLevelLumaCodeValue} &
     1813\ShortOption{\None} &
     1814\Default{235} &
     1815Specifies luma sample value of the nominal white level assigned decoded pictures.
     1816\\
     1817\Option{SEIToneMapExtendedWhiteLevelLumaCodeValue} &
     1818\ShortOption{\None} &
     1819\Default{300} &
     1820Specifies luma sample value of the extended dynamic range assigned decoded pictures.
    16521821\\
    16531822\end{OptionTable}
  • branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp

    r534 r537  
    7979  m_aidQP = NULL;
    8080#endif
    81 #if J0149_TONE_MAPPING_SEI
    8281  m_startOfCodedInterval = NULL;
    8382  m_codedPivotValue = NULL;
    8483  m_targetPivotValue = NULL;
    85 #endif
    8684}
    8785
     
    108106  }
    109107#endif
    110 #if J0149_TONE_MAPPING_SEI
    111108  if ( m_startOfCodedInterval )
    112109  {
     
    124121    m_targetPivotValue = NULL;
    125122  }
    126 #endif
    127123#if !H_MV
    128124  free(m_pchInputFile);
     
    316312}
    317313
    318 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    319 Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName);
    320 Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName);
    321 #endif
    322314// ====================================================================================================================
    323315// Public member functions
     
    352344  string cfg_RowHeight;
    353345  string cfg_ScalingListFile;
    354 #if J0149_TONE_MAPPING_SEI
    355346  string cfg_startOfCodedInterval;
    356347  string cfg_codedPivotValue;
    357348  string cfg_targetPivotValue;
    358 #endif
    359 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    360   string cfg_bitRateInfoPresentFlag;
    361   string cfg_picRateInfoPresentFlag;
    362   string cfg_avgBitRate;
    363   string cfg_maxBitRate;
    364   string cfg_avgPicRate;
    365   string cfg_constantPicRateIdc;
    366 #endif
    367349  po::Options opts;
    368350  opts.addOptions()
     
    440422  ("Tier",    m_levelTier, Level::MAIN,   "Tier to use for interpretation of --Level")
    441423
    442 #if L0046_CONSTRAINT_FLAGS
    443424  ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive")
    444425  ("InterlacedSource",  m_interlacedSourceFlag,  false, "Indicate that source is interlaced")
    445426  ("NonPackedSource",   m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing")
    446427  ("FrameOnly",         m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
    447 #endif
    448428 
    449429  // Unit definition parameters
     
    465445  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
    466446  ("GOPSize,g",               m_iGOPSize,                   1, "GOP size of temporal structure")
    467 #if !L0034_COMBINED_LIST_CLEANUP
    468   ("ListCombination,-lc",     m_bUseLComb,               true, "Combined reference list for uni-prediction estimation in B-slices")
    469 #endif
    470447  // motion options
    471448  ("FastSearch",              m_iFastSearch,                1, "0:Full search  1:Diamond  2:PMVFAST")
     
    507484  ("RDOQ",                          m_useRDOQ,                  true )
    508485  ("RDOQTS",                        m_useRDOQTS,                true )
    509 #if L0232_RD_PENALTY
    510486  ("RDpenalty",                     m_rdPenalty,                0,  "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disbaled  1:RD-penalty  2:maximum RD-penalty")
    511 #endif
    512487  // Entropy coding parameters
    513488  ("SBACRD",                         m_bUseSBACRD,                      true, "SBAC based RD estimation")
     
    523498  ("LoopFilterTcOffset_div2",        m_loopFilterTcOffsetDiv2,             0 )
    524499  ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false )
    525 #if L0386_DB_METRIC
    526500  ("DeblockingFilterMetric",         m_DeblockingFilterMetric,         false )
    527 #endif
    528501
    529502#if H_3D_ARP
     
    598571  ( "RateControl",         m_RCEnableRateControl,   false, "Rate control: enable rate control" )
    599572  ( "TargetBitrate",       m_RCTargetBitrate,           0, "Rate control: target bitrate" )
     573#if M0036_RC_IMPROVEMENT
     574  ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit,     0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" )
     575#else
    600576  ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, false, "Rate control: keep hierarchical bit allocation in rate control algorithm" )
     577#endif
    601578  ( "LCULevelRateControl", m_RCLCULevelRC,           true, "Rate control: true: LCU level RC; false: picture level RC" )
    602579  ( "RCLCUSeparateModel",  m_RCUseLCUSeparateModel,  true, "Rate control: use LCU level separate R-lambda model" )
     
    650627  ("SEIBufferingPeriod",             m_bufferingPeriodSEIEnabled,              0, "Control generation of buffering period SEI messages")
    651628  ("SEIPictureTiming",               m_pictureTimingSEIEnabled,                0, "Control generation of picture timing SEI messages")
    652 #if J0149_TONE_MAPPING_SEI
    653629  ("SEIToneMappingInfo",                       m_toneMappingInfoSEIEnabled,    false, "Control generation of Tone Mapping SEI messages")
    654630  ("SEIToneMapId",                             m_toneMapId,                        0, "Specifies Id of Tone Mapping SEI message for a given session")
     
    681657  ("SEIToneMapNominalWhiteLevelLumaCodeValue",        m_nominalWhiteLevelLumaCodeValue,         235, "Specifies luma sample value of the nominal white level assigned decoded pictures")
    682658  ("SEIToneMapExtendedWhiteLevelLumaCodeValue",       m_extendedWhiteLevelLumaCodeValue,        300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")
    683 #endif
    684659  ("SEIFramePacking",                m_framePackingSEIEnabled,                 0, "Control generation of frame packing SEI messages")
    685660  ("SEIFramePackingType",            m_framePackingSEIType,                    0, "Define frame packing arrangement\n"
     
    702677  ("SEIGradualDecodingRefreshInfo",  m_gradualDecodingRefreshInfoEnabled,      0, "Control generation of gradual decoding refresh information SEI message")
    703678  ("SEIDecodingUnitInfo",             m_decodingUnitInfoSEIEnabled,                       0, "Control generation of decoding unit information SEI message.")
    704 #if L0208_SOP_DESCRIPTION_SEI
    705679  ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
    706 #endif
    707 #if K0180_SCALABLE_NESTING_SEI
    708680  ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
    709 #endif
    710 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    711   ("BitRatePicRateMaxTLayers",   m_bitRatePicRateMaxTLayers,           0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file")
    712   ("BitRateInfoPresent",         cfg_bitRateInfoPresentFlag,          string(""), "Control signalling of bit rate information of avg. bit rate and max. bit rate in VPS\n"
    713                                                                           "\t0: Do not sent bit rate info\n"
    714                                                                           "\tN (N > 0): Send bit rate info for N sub-layers. N should equal maxTempLayers.")                                                                     
    715   ("PicRateInfoPresent",         cfg_picRateInfoPresentFlag,          string(""), "Control signalling of picture rate information of avg. bit rate and max. bit rate in VPS\n"
    716                                                                           "\t0: Do not sent picture rate info\n"
    717                                                                           "\tN (N > 0): Send picture rate info for N sub-layers. N should equal maxTempLayers.")                                                                     
    718   ("AvgBitRate",                   cfg_avgBitRate,                    string(""), "List of avg. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0")
    719   ("MaxBitRate",                   cfg_maxBitRate,                    string(""), "List of max. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0")
    720   ("AvgPicRate",                   cfg_avgPicRate,                    string(""), "List of avg. picture rates for the different sub-layers; include non-negative number even if corresponding flag is 0")
    721   ("ConstantPicRateIdc",           cfg_constantPicRateIdc,            string(""), "List of constant picture rate IDCs; include non-negative number even if corresponding flag is 0")
    722 #endif
    723681#if H_3D
    724682  ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
     
    759717#endif //H_3D
    760718  ;
    761  
    762 #if H_MV
     719  #if H_MV
    763720  // parse coding structure
    764721  for( Int k = 0; k < MAX_NUM_LAYERS; k++ )
     
    898855  free ( pRowHeight   );
    899856#endif
    900 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    901   readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" );
    902   readIntString (cfg_avgBitRate,             m_bitRatePicRateMaxTLayers, m_avgBitRate,             "avg. bit rate"               );
    903   readIntString (cfg_maxBitRate,             m_bitRatePicRateMaxTLayers, m_maxBitRate,             "max. bit rate"               );
    904   readBoolString(cfg_picRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_picRateInfoPresentFlag, "bit rate info. present flag" );
    905   readIntString (cfg_avgPicRate,             m_bitRatePicRateMaxTLayers, m_avgPicRate,             "avg. pic rate"               );
    906   readIntString (cfg_constantPicRateIdc,     m_bitRatePicRateMaxTLayers, m_constantPicRateIdc,     "constant pic rate Idc"       );
    907 #endif
    908857  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
    909858 
     
    10711020  m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
    10721021
    1073 #if J0149_TONE_MAPPING_SEI
    10741022  if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag )
    10751023  {
     
    11301078    }
    11311079  }
    1132 #endif
    11331080#if H_3D
    11341081  // set global varibles
     
    12331180  return true;
    12341181}
    1235 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    1236 Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName)
    1237 {
    1238   Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str());
    1239   Int i = 0;
    1240   if(numEntries)
    1241   {
    1242     Char* tempArray = strtok(inpArray, " ,-");
    1243     memberArray = new Bool[numEntries];
    1244     while( tempArray != NULL )
    1245     {
    1246       if( i >= numEntries )
    1247       {
    1248         printf( "The number of %s defined is larger than the allowed number\n", elementName );
    1249         exit( EXIT_FAILURE );
    1250       }
    1251       assert( (atoi(tempArray) == 0) || (atoi(tempArray) == 1) );
    1252       *( memberArray + i ) = atoi(tempArray);
    1253       tempArray = strtok(NULL, " ,-");
    1254       i++;
    1255     }
    1256     if( i < numEntries )
    1257     {
    1258       printf( "Some %s are not defined\n", elementName );
    1259       exit( EXIT_FAILURE );
    1260     }
    1261   }
    1262   else
    1263   {
    1264     memberArray = NULL;
    1265   }
    1266 }
    1267 
    1268 Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName)
    1269 {
    1270   Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str());
    1271   Int i = 0;
    1272   if(numEntries)
    1273   {
    1274     Char* tempArray = strtok(inpArray, " ,-");
    1275     memberArray = new Int[numEntries];
    1276     while( tempArray != NULL )
    1277     {
    1278       if( i >= numEntries )
    1279       {
    1280         printf( "The number of %s defined is larger than the allowed number\n", elementName );
    1281         exit( EXIT_FAILURE );
    1282       }
    1283       *( memberArray + i ) = atoi(tempArray);
    1284       tempArray = strtok(NULL, " ,-");
    1285       i++;
    1286     }
    1287     if( i < numEntries )
    1288     {
    1289       printf( "Some %s are not defined\n", elementName );
    1290       exit( EXIT_FAILURE );
    1291     }
    1292   }
    1293   else
    1294   {
    1295     memberArray = NULL;
    1296   }
    1297 }
    1298 #endif
    12991182// ====================================================================================================================
    13001183// Private member functions
     
    13121195    fprintf(stderr, "**          decoder requires this option to be enabled.         **\n");
    13131196    fprintf(stderr, "******************************************************************\n");
     1197  }
     1198  if( m_profile==Profile::NONE )
     1199  {
     1200    fprintf(stderr, "***************************************************************************\n");
     1201    fprintf(stderr, "** WARNING: For conforming bitstreams a valid Profile value must be set! **\n");
     1202    fprintf(stderr, "***************************************************************************\n");
     1203  }
     1204  if( m_level==Level::NONE )
     1205  {
     1206    fprintf(stderr, "***************************************************************************\n");
     1207    fprintf(stderr, "** WARNING: For conforming bitstreams a valid Level value must be set!   **\n");
     1208    fprintf(stderr, "***************************************************************************\n");
    13141209  }
    13151210
     
    14701365  xConfirmPara( m_iQP <  -6 * (m_internalBitDepthY - 8) || m_iQP > 51,                    "QP exceeds supported range (-QpBDOffsety to 51)" );
    14711366#endif
    1472   xConfirmPara( m_loopFilterBetaOffsetDiv2 < -13 || m_loopFilterBetaOffsetDiv2 > 13,          "Loop Filter Beta Offset div. 2 exceeds supported range (-13 to 13)");
    1473   xConfirmPara( m_loopFilterTcOffsetDiv2 < -13 || m_loopFilterTcOffsetDiv2 > 13,              "Loop Filter Tc Offset div. 2 exceeds supported range (-13 to 13)");
     1367  xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6,          "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)");
     1368  xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6,              "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)");
    14741369  xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2,                                     "Fast Search Mode is not supported value (0:Full search  1:Diamond  2:PMVFAST)" );
    14751370  xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
     
    15151410  xConfirmPara( ( 0 != m_uiUseAdvResPred ) &&  ( 1 != m_uiUseAdvResPred ), "UseAdvResPred must be 0 or 1." );
    15161411#endif
    1517 
    15181412#if ADAPTIVE_QP_SELECTION
    15191413#if H_MV
     
    19991893  {
    20001894    m_numReorderPics[i] = 0;
    2001 #if L0323_DPB
    20021895    m_maxDecPicBuffering[i] = 1;
    2003 #else
    2004     m_maxDecPicBuffering[i] = 0;
    2005 #endif
    20061896  }
    20071897  for(Int i=0; i<m_iGOPSize; i++)
    20081898  {
    2009 #if L0323_DPB
    20101899    if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
    2011 #else
    2012     if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
    2013 #endif
    2014     {
    2015 #if L0323_DPB
     1900    {
    20161901      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1;
    2017 #else
    2018       m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics;
    2019 #endif
    20201902    }
    20211903    Int highestDecodingNumberWithLowerPOC = 0;
     
    20481930      m_numReorderPics[i+1] = m_numReorderPics[i];
    20491931    }
    2050 #if L0323_DPB
    20511932    // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
    20521933    if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)
     
    20541935      m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1;
    20551936    }
    2056 #else
    2057     // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    2058     if(m_numReorderPics[i] > m_maxDecPicBuffering[i])
    2059     {
    2060       m_maxDecPicBuffering[i] = m_numReorderPics[i];
    2061     }
    2062 #endif
    20631937    // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer
    20641938    if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i])
     
    20691943
    20701944
    2071 #if L0323_DPB
    20721945  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] -  1, inclusive
    20731946  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)
     
    20751948    m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
    20761949  }
    2077 #else
    2078   // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    2079   if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1])
    2080   {
    2081     m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1];
    2082   }
    2083 #endif
    20841950
    20851951  if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
     
    21562022    }
    21572023  }
    2158 #if !L0034_COMBINED_LIST_CLEANUP
    2159   xConfirmPara( m_bUseLComb==false && m_numReorderPics[MAX_TLAYER-1]!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" );  // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1.
    2160 #endif
    21612024  xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
    21622025  xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" );
     
    21652028  xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n");
    21662029
    2167 #if J0149_TONE_MAPPING_SEI
    21682030  if (m_toneMappingInfoSEIEnabled)
    21692031  {
     
    21762038    xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");
    21772039  }
    2178 #endif
    21792040
    21802041#if RATE_CONTROL_LAMBDA_DOMAIN
     
    22082069
    22092070  xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2");
    2210 #if L0444_FPA_TYPE
    22112071  if (m_framePackingSEIEnabled)
    22122072  {
    22132073    xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5");
    22142074  }
    2215 #endif
    2216 #if H_MV
    2217   }
    2218   }
    2219 #endif
    2220 
     2075
     2076#if H_MV
     2077  }
     2078  }
     2079#endif
    22212080#undef xConfirmPara
    22222081  if (check_failed)
     
    23562215  printf("RDQ:%d ", m_useRDOQ            );
    23572216  printf("RDQTS:%d ", m_useRDOQTS        );
    2358 #if L0232_RD_PENALTY
    23592217  printf("RDpenalty:%d ", m_rdPenalty  );
    2360 #endif
    23612218  printf("SQP:%d ", m_uiDeltaQpRD         );
    23622219  printf("ASR:%d ", m_bUseASR             );
    2363 #if !L0034_COMBINED_LIST_CLEANUP
    2364   printf("LComb:%d ", m_bUseLComb         );
    2365 #endif
    23662220  printf("FEN:%d ", m_bUseFastEnc         );
    23672221  printf("ECU:%d ", m_bUseEarlyCU         );
  • branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.h

    r534 r537  
    137137  Level::Tier   m_levelTier;
    138138  Level::Name   m_level;
    139 #if L0046_CONSTRAINT_FLAGS
    140139  Bool m_progressiveSourceFlag;
    141140  Bool m_interlacedSourceFlag;
    142141  Bool m_nonPackedConstraintFlag;
    143142  Bool m_frameOnlyConstraintFlag;
    144 #endif
    145143 
    146144  // coding structure
     
    157155  GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
    158156  Int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
    159 #if L0323_DPB
    160157  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of pictures in the decoded picture buffer
    161 #else
    162   Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of reference pictures needed for decoding
    163 #endif
    164 #endif
    165 #if !L0034_COMBINED_LIST_CLEANUP
    166   Bool      m_bUseLComb;                                      ///< flag for using combined reference list for uni-prediction in B-slices (JCTVC-D421)
    167 #endif
     158  #endif
    168159  Bool      m_useTransformSkip;                               ///< flag for enabling intra transform skipping
    169160  Bool      m_useTransformSkipFast;                           ///< flag for enabling fast intra transform skipping
     
    246237  Int       m_loopFilterTcOffsetDiv2;                       ///< tc offset for deblocking filter
    247238  Bool      m_DeblockingFilterControlPresent;                 ///< deblocking filter control present flag in PPS
    248 #if L0386_DB_METRIC
    249239  Bool      m_DeblockingFilterMetric;                         ///< blockiness metric in encoder
    250 #endif
    251240 
    252241  // coding tools (PCM)
     
    262251  Bool      m_useRDOQ;                                       ///< flag for using RD optimized quantization
    263252  Bool      m_useRDOQTS;                                     ///< flag for using RD optimized quantization for transform skip
    264 #if L0232_RD_PENALTY
    265253  Int      m_rdPenalty;                                      ///< RD-penalty for 32x32 TU for intra in non-intra slices (0: no RD-penalty, 1: RD-penalty, 2: maximum RD-penalty)
    266 #endif
    267254  Int       m_iFastSearch;                                    ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST
    268255  Int       m_iSearchRange;                                   ///< ME search range
     
    298285  Int       m_bufferingPeriodSEIEnabled;
    299286  Int       m_pictureTimingSEIEnabled;
    300 #if J0149_TONE_MAPPING_SEI
    301287  Bool      m_toneMappingInfoSEIEnabled;
    302288  Int       m_toneMapId;
     
    324310  Int*      m_codedPivotValue;
    325311  Int*      m_targetPivotValue;
    326 #endif
    327312  Int       m_framePackingSEIEnabled;
    328313  Int       m_framePackingSEIType;
     
    334319  Int       m_gradualDecodingRefreshInfoEnabled;
    335320  Int       m_decodingUnitInfoSEIEnabled;
    336 #if L0208_SOP_DESCRIPTION_SEI
    337321  Int       m_SOPDescriptionSEIEnabled;
    338 #endif
    339 #if K0180_SCALABLE_NESTING_SEI
    340322  Int       m_scalableNestingSEIEnabled;
    341 #endif
    342323  // weighted prediction
    343324  Bool      m_useWeightedPred;                    ///< Use of weighted prediction in P slices
     
    352333  Bool      m_RCEnableRateControl;                ///< enable rate control or not
    353334  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
     335#if M0036_RC_IMPROVEMENT
     336  Int       m_RCKeepHierarchicalBit;              ///< 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
     337#else
    354338  Bool      m_RCKeepHierarchicalBit;              ///< whether keeping hierarchical bit allocation structure or not
     339#endif
    355340  Bool      m_RCLCULevelRC;                       ///< true: LCU level rate control; false: picture level rate control
    356341  Bool      m_RCUseLCUSeparateModel;              ///< use separate R-lambda model at LCU level
     
    459444    }
    460445
    461 
    462446    for( ; rpcVector.size() > m_numberOfLayers; )
    463447    {     
    464448      rpcVector.pop_back( );     
    465449    }
    466 
    467450  }
    468451
     
    490473  Void xPrintVectorElem( Bool   elem ) { printf(" %d"   , ( elem ? 1 : 0 ));};
    491474#endif
    492 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    493   Int       m_bitRatePicRateMaxTLayers;                       ///< Indicates max. number of sub-layers for which bit rate is signalled.
    494   Bool*     m_bitRateInfoPresentFlag;                         ///< Indicates whether bit rate information is signalled
    495   Bool*     m_picRateInfoPresentFlag;                         ///< Indicates whether pic rate information is signalled
    496   Int*      m_avgBitRate;                                     ///< Indicates avg. bit rate information for various sub-layers
    497   Int*      m_maxBitRate;                                     ///< Indicates max. bit rate information for various sub-layers
    498   Int*      m_avgPicRate;                                     ///< Indicates avg. picture rate information for various sub-layers
    499   Int*      m_constantPicRateIdc;                                ///< Indicates constant picture rate idc for various sub-layers
    500 #endif
    501475#if H_MV
    502476  Int   getGOPSize() { return m_iGOPSize; }
    503477#endif
    504 
    505478public:
    506479  TAppEncCfg();
  • branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncTop.cpp

    r534 r537  
    194194  m_cTEncTop.setProfile(m_profile);
    195195  m_cTEncTop.setLevel(m_levelTier, m_level);
    196 #if L0046_CONSTRAINT_FLAGS
    197196  m_cTEncTop.setProgressiveSourceFlag(m_progressiveSourceFlag);
    198197  m_cTEncTop.setInterlacedSourceFlag(m_interlacedSourceFlag);
    199198  m_cTEncTop.setNonPackedConstraintFlag(m_nonPackedConstraintFlag);
    200199  m_cTEncTop.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag);
    201 #endif
    202200 
    203201  m_cTEncTop.setFrameRate                    ( m_iFrameRate );
     
    260258  m_cTEncTop.setLoopFilterTcOffset           ( m_loopFilterTcOffsetDiv2    );
    261259  m_cTEncTop.setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent);
    262 #if L0386_DB_METRIC
    263260  m_cTEncTop.setDeblockingFilterMetric       ( m_DeblockingFilterMetric );
    264 #endif
    265261
    266262  //====== Motion search ========
     
    300296  m_cTEncTop.setUseHADME                     ( m_bUseHADME    );
    301297  m_cTEncTop.setUseLossless                  ( m_useLossless );
    302 #if !L0034_COMBINED_LIST_CLEANUP
    303   m_cTEncTop.setUseLComb                     ( m_bUseLComb    );
    304 #endif
    305298#if H_MV
    306299  m_cTEncTop.setdQPs                         ( m_aidQP[layer]   );
     
    310303  m_cTEncTop.setUseRDOQ                      ( m_useRDOQ     );
    311304  m_cTEncTop.setUseRDOQTS                    ( m_useRDOQTS   );
    312 #if L0232_RD_PENALTY
    313305  m_cTEncTop.setRDpenalty                 ( m_rdPenalty );
    314 #endif
    315306  m_cTEncTop.setQuadtreeTULog2MaxSize        ( m_uiQuadtreeTULog2MaxSize );
    316307  m_cTEncTop.setQuadtreeTULog2MinSize        ( m_uiQuadtreeTULog2MinSize );
     
    380371  m_cTEncTop.setBufferingPeriodSEIEnabled( m_bufferingPeriodSEIEnabled );
    381372  m_cTEncTop.setPictureTimingSEIEnabled( m_pictureTimingSEIEnabled );
    382 #if J0149_TONE_MAPPING_SEI
    383373  m_cTEncTop.setToneMappingInfoSEIEnabled                 ( m_toneMappingInfoSEIEnabled );
    384374  m_cTEncTop.setTMISEIToneMapId                           ( m_toneMapId );
     
    406396  m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue      ( m_nominalWhiteLevelLumaCodeValue );
    407397  m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue     ( m_extendedWhiteLevelLumaCodeValue );
    408 #endif
    409398  m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled );
    410399  m_cTEncTop.setFramePackingArrangementSEIType( m_framePackingSEIType );
     
    416405  m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled );
    417406  m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled );
    418 #if L0208_SOP_DESCRIPTION_SEI
    419407  m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
    420 #endif
    421 #if K0180_SCALABLE_NESTING_SEI
    422408  m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled );
    423 #endif
    424409  m_cTEncTop.setUniformSpacingIdr          ( m_iUniformSpacingIdr );
    425410  m_cTEncTop.setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
     
    490475  m_cTEncTop.setLog2MaxMvLengthHorizontal( m_log2MaxMvLengthHorizontal );
    491476  m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
    492 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    493   TComBitRatePicRateInfo *bitRatePicRateInfo = m_cTEncTop.getVPS()->getBitratePicrateInfo();
    494   // The number of bit rate/pic rate have to equal to number of sub-layers.
    495   if(m_bitRatePicRateMaxTLayers)
    496   {
    497     assert(m_bitRatePicRateMaxTLayers == m_cTEncTop.getVPS()->getMaxTLayers());
    498   }
    499   for(Int i = 0; i < m_bitRatePicRateMaxTLayers; i++)
    500   {
    501     bitRatePicRateInfo->setBitRateInfoPresentFlag( i, m_bitRateInfoPresentFlag[i] );
    502     if( bitRatePicRateInfo->getBitRateInfoPresentFlag(i) )
    503     {
    504       bitRatePicRateInfo->setAvgBitRate(i, m_avgBitRate[i]);
    505       bitRatePicRateInfo->setMaxBitRate(i, m_maxBitRate[i]);
    506     }
    507   }
    508   for(Int i = 0; i < m_bitRatePicRateMaxTLayers; i++)
    509   {
    510     bitRatePicRateInfo->setPicRateInfoPresentFlag( i, m_picRateInfoPresentFlag[i] );
    511     if( bitRatePicRateInfo->getPicRateInfoPresentFlag(i) )
    512     {
    513       bitRatePicRateInfo->setAvgPicRate     (i, m_avgPicRate[i]);
    514       bitRatePicRateInfo->setConstantPicRateIdc(i, m_constantPicRateIdc[i]);
    515     }
    516   }
    517 #endif
    518477#if H_MV
    519478  }
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/CommonDef.h

    r479 r537  
    115115#define MAX_NUM_REF_PICS            16          ///< max. number of pictures used for reference
    116116#define MAX_NUM_REF                 16          ///< max. number of entries in picture reference list
    117 #if !L0034_COMBINED_LIST_CLEANUP
    118 #define MAX_NUM_REF_LC              MAX_NUM_REF_PICS  // TODO: remove this macro definition (leftover from combined list concept)
    119 #endif
    120117
    121118#define MAX_UINT                    0xFFFFFFFFU ///< max. value of unsigned 32-bit integer
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/NAL.h

    r446 r537  
    9494        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R;
    9595  }
    96 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    9796  Bool isSei()
    9897  {
     
    105104    return ( (UInt)m_nalUnitType < 32 );
    106105  }
    107 #endif
    108106};
    109107
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/SEI.cpp

    r446 r537  
    3939#include "SEI.h"
    4040
    41 #if J0149_TONE_MAPPING_SEI
    4241//Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator
    4342Int  Table_exp_indicator[32] = {0, 10, 12, 16, 20, 25, 32, 40, 50, 64, 80, 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, -1};
    44 #endif
    4543
    4644SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/SEI.h

    r446 r537  
    124124
    125125  SEIActiveParameterSets()
    126 #if !L0047_APS_FLAGS
    127     :numSpsIdsMinus1(0)
    128 #else
    129126    : activeVPSId            (0)
    130127    , m_fullRandomAccessFlag (false)
    131128    , m_noParamSetUpdateFlag (false)
    132129    , numSpsIdsMinus1        (0)
    133 #endif
    134130  {}
    135131  virtual ~SEIActiveParameterSets() {}
    136132
    137133  Int activeVPSId;
    138 #if L0047_APS_FLAGS
    139134  Bool m_fullRandomAccessFlag;
    140135  Bool m_noParamSetUpdateFlag;
    141 #endif
    142136  Int numSpsIdsMinus1;
    143137  std::vector<Int> activeSeqParamSetId;
     
    150144
    151145  SEIBufferingPeriod()
    152 #if L0044_CPB_DPB_DELAY_OFFSET
    153146  : m_bpSeqParameterSetId (0)
    154147  , m_rapCpbParamsPresentFlag (false)
     
    161154    ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset));
    162155  }
    163 #else
    164   {}
    165 #endif
    166156  virtual ~SEIBufferingPeriod() {}
    167157
    168158  UInt m_bpSeqParameterSetId;
    169159  Bool m_rapCpbParamsPresentFlag;
    170 #if L0044_CPB_DPB_DELAY_OFFSET
    171160  Bool m_cpbDelayOffset;
    172161  Bool m_dpbDelayOffset;
    173 #endif
    174162  UInt m_initialCpbRemovalDelay         [MAX_CPB_CNT][2];
    175163  UInt m_initialCpbRemovalDelayOffset   [MAX_CPB_CNT][2];
    176164  UInt m_initialAltCpbRemovalDelay      [MAX_CPB_CNT][2];
    177165  UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2];
    178 #if L0328_SPLICING
    179166  Bool m_concatenationFlag;
    180167  UInt m_auCpbRemovalDelayDelta;
    181 #endif
    182168};
    183169class SEIPictureTiming : public SEI
     
    188174  SEIPictureTiming()
    189175  : m_picStruct               (0)
    190 #if L0046_RENAME_PROG_SRC_IDC
    191176  , m_sourceScanType          (0)
    192 #else
    193   , m_progressiveSourceIdc    (0)
    194 #endif
    195177  , m_duplicateFlag           (false)
    196 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    197178  , m_picDpbOutputDuDelay     (0)
    198 #endif
    199179  , m_numNalusInDuMinus1      (NULL)
    200180  , m_duCpbRemovalDelayMinus1 (NULL)
     
    213193
    214194  UInt  m_picStruct;
    215 #if L0046_RENAME_PROG_SRC_IDC
    216195  UInt  m_sourceScanType;
    217 #else
    218   UInt  m_progressiveSourceIdc;
    219 #endif
    220196  Bool  m_duplicateFlag;
    221197
    222198  UInt  m_auCpbRemovalDelay;
    223199  UInt  m_picDpbOutputDelay;
    224 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    225200  UInt  m_picDpbOutputDuDelay;
    226 #endif
    227201  UInt  m_numDecodingUnitsMinus1;
    228202  Bool  m_duCommonCpbRemovalDelayFlag;
     
    240214    : m_decodingUnitIdx(0)
    241215    , m_duSptCpbRemovalDelay(0)
    242 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    243216    , m_dpbOutputDuDelayPresentFlag(false)
    244217    , m_picSptDpbOutputDuDelay(0)
    245 #endif
    246218  {}
    247219  virtual ~SEIDecodingUnitInfo() {}
    248220  Int m_decodingUnitIdx;
    249221  Int m_duSptCpbRemovalDelay;
    250 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    251222  Bool m_dpbOutputDuDelayPresentFlag;
    252223  Int m_picSptDpbOutputDuDelay;
    253 #endif
    254224};
    255225
     
    290260  Int  m_frame1GridPositionY;
    291261  Int  m_arrangementReservedByte;
    292 #if L0045_PERSISTENCE_FLAGS
    293262  Bool m_arrangementPersistenceFlag;
    294 #else
    295   Int  m_arrangementRepetetionPeriod;
    296 #endif
    297263  Bool m_upsampledAspectRatio;
    298264};
     
    305271  SEIDisplayOrientation()
    306272    : cancelFlag(true)
    307 #if L0045_PERSISTENCE_FLAGS
    308273    , persistenceFlag(0)
    309 #else
    310     , repetitionPeriod(1)
    311 #endif
    312274    , extensionFlag(false)
    313275    {}
     
    319281
    320282  UInt anticlockwiseRotation;
    321 #if L0045_PERSISTENCE_FLAGS
    322283  Bool persistenceFlag;
    323 #else
    324   UInt repetitionPeriod;
    325 #endif
    326284  Bool extensionFlag;
    327285};
     
    355313};
    356314
    357 #if L0208_SOP_DESCRIPTION_SEI
    358315class SEISOPDescription : public SEI
    359316{
     
    372329  Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP];
    373330};
    374 #endif
    375 
    376 #if J0149_TONE_MAPPING_SEI
     331
    377332class SEIToneMappingInfo : public SEI
    378333{
     
    407362  Int    m_extendedWhiteLevelLumaCodeValue;
    408363};
    409 #endif
    410364
    411365typedef std::list<SEI*> SEIMessages;
     
    420374Void deleteSEIs (SEIMessages &seiList);
    421375
    422 #if K0180_SCALABLE_NESTING_SEI
    423376class SEIScalableNesting : public SEI
    424377{
     
    450403  SEIMessages m_nestedSEIs;
    451404};
    452 #endif
    453405
    454406//! \}
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComBitStream.h

    r446 r537  
    193193  }
    194194
     195  Void        peekPreviousByte( UInt &byte )
     196  {
     197    assert(m_fifo_idx > 0);
     198    byte = (*m_fifo)[m_fifo_idx - 1];
     199  }
     200 
    195201  Void        readOutTrailingBits ();
    196202  UChar getHeldBits  ()          { return m_held_bits;          }
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp

    r534 r537  
    136136#endif
    137137#endif
    138 
    139138  m_bDecSubCu          = false;
    140139  m_sliceStartCU        = 0;
     
    143142  m_pDvInfo              = NULL;
    144143#endif
    145 
    146144#if H_3D_VSP
    147145  m_piVSPFlag            = NULL;
    148146#endif
    149 
    150147#if H_3D_ARP
    151148  m_puhARPW              = NULL;
    152149#endif
    153 
    154150#if H_3D_IC
    155151  m_pbICFlag             = NULL;
     
    783779  }
    784780
    785   UInt uiTmp = uhWidth*uhHeight;
    786 
    787781  if(getPic()->getPicSym()->getInverseCUOrderMap(getAddr())*m_pcPic->getNumPartInCU()+m_uiAbsIdxInLCU >= getSlice()->getSliceSegmentCurStartCUAddr())
    788782  {
    789783    m_acCUMvField[0].clearMvField();
    790784    m_acCUMvField[1].clearMvField();
    791     uiTmp = uhWidth*uhHeight;
     785    UInt uiTmp = uhWidth*uhHeight;
    792786   
    793787    memset( m_pcTrCoeffY,    0, uiTmp * sizeof( *m_pcTrCoeffY    ) );
     
    10561050  m_uiCUPelY           = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
    10571051 
    1058   UInt uiWidth         = g_uiMaxCUWidth  >> uiDepth;
    1059   UInt uiHeight        = g_uiMaxCUHeight >> uiDepth;
    1060  
    10611052  m_skipFlag=pcCU->getSkipFlag()          + uiPart;
    10621053
     
    11391130  m_apcCUColocated[1] = pcCU->getCUColocated(REF_PIC_LIST_1);
    11401131 
    1141   UInt uiTmp = uiWidth*uiHeight;
    11421132  UInt uiMaxCuWidth=pcCU->getSlice()->getSPS()->getMaxCUWidth();
    11431133  UInt uiMaxCuHeight=pcCU->getSlice()->getSPS()->getMaxCUHeight();
     
    11511141  m_pcIPCMSampleY = pcCU->getPCMSampleY() + uiCoffOffset;
    11521142
    1153   uiTmp >>= 2;
    11541143  uiCoffOffset >>=2;
    11551144  m_pcTrCoeffCb=pcCU->getCoeffCb() + uiCoffOffset;
     
    13521341  memcpy( m_sliceStartCU        + uiOffset, pcCU->m_sliceStartCU,        sizeof( UInt ) * uiNumPartition  );
    13531342  memcpy( m_sliceSegmentStartCU + uiOffset, pcCU->m_sliceSegmentStartCU, sizeof( UInt ) * uiNumPartition  );
    1354 
    13551343#if H_3D_ARP
    13561344  memcpy( m_puhARPW             + uiOffset, pcCU->getARPW(),              iSizeInUchar );
     
    14301418#endif
    14311419#endif
    1432 
    14331420  memcpy( rpcCU->getDepth()  + m_uiAbsIdxInLCU, m_puhDepth,  iSizeInUchar );
    14341421  memcpy( rpcCU->getWidth()  + m_uiAbsIdxInLCU, m_puhWidth,  iSizeInUchar );
     
    14651452  memcpy( rpcCU->m_sliceStartCU        + m_uiAbsIdxInLCU, m_sliceStartCU,        sizeof( UInt ) * m_uiNumPartition  );
    14661453  memcpy( rpcCU->m_sliceSegmentStartCU + m_uiAbsIdxInLCU, m_sliceSegmentStartCU, sizeof( UInt ) * m_uiNumPartition  );
    1467 
    14681454#if H_3D_ARP
    14691455  memcpy( rpcCU->getARPW()             + m_uiAbsIdxInLCU, m_puhARPW,             iSizeInUchar );
     
    15391525#endif
    15401526#endif
    1541 
    15421527  memcpy( rpcCU->getDepth()  + uiPartOffset, m_puhDepth,  iSizeInUchar );
    15431528  memcpy( rpcCU->getWidth()  + uiPartOffset, m_puhWidth,  iSizeInUchar );
     
    15751560  memcpy( rpcCU->m_sliceStartCU        + uiPartOffset, m_sliceStartCU,        sizeof( UInt ) * uiQNumPart  );
    15761561  memcpy( rpcCU->m_sliceSegmentStartCU + uiPartOffset, m_sliceSegmentStartCU, sizeof( UInt ) * uiQNumPart  );
    1577 
    15781562#if H_3D_ARP
    15791563  memcpy( rpcCU->getARPW()             + uiPartOffset, m_puhARPW,             iSizeInUchar );
     
    20272011    return getSlice()->getSliceQp();
    20282012  }
    2029   else
    2030   if ( iLastValidPartIdx >= 0 )
     2013  else if ( iLastValidPartIdx >= 0 )
    20312014  {
    20322015    return getQP( iLastValidPartIdx );
     
    22552238}
    22562239#endif
    2257 
    22582240UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
    22592241{
     
    24922474}
    24932475#endif
    2494 
    24952476Void TComDataCU::setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    24962477{
     
    25092490}
    25102491#endif
    2511 
    25122492Void TComDataCU::setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth )
    25132493{
     
    30303010
    30313011#endif
    3032 
    30333012/** Constructs a list of merging candidates
    30343013 * \param uiAbsPartIdx
     
    31393118          pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    31403119          TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
    3141 
    31423120#if H_3D_IC
    31433121          const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
     
    35683546    //>> MTK colocated-RightBottom
    35693547    UInt uiPartIdxRB;
    3570     Int uiLCUIdx = getAddr();
    35713548
    35723549    deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 
     
    35773554    TComMv cColMv;
    35783555    Int iRefIdx;
     3556    Int uiLCUIdx = -1;
    35793557
    35803558    if      ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )  // image boundary check
    35813559    {
    3582       uiLCUIdx = -1;
    35833560    }
    35843561    else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
    35853562    {
    3586       uiLCUIdx = -1;
    35873563    }
    35883564    else
     
    35973573      {
    35983574        uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];
    3599         uiLCUIdx = -1 ;
    36003575      }
    36013576      else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
     
    36073582      {
    36083583        uiAbsPartAddr = 0;
    3609         uiLCUIdx = -1 ;
    36103584      }
    36113585    }
     
    38853859    if (!bAdded)
    38863860    {
    3887       bAdded = xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLB, MD_LEFT );
     3861      xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLB, MD_LEFT );
    38883862    }
    38893863  }
     
    38983872  if(!bAdded)
    38993873  {
    3900     bAdded = xAddMVPCand( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT);
     3874    xAddMVPCand( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT);
    39013875  }
    39023876  bAdded = bAddedSmvp;
     
    39133887    if(!bAdded)
    39143888    {
    3915       bAdded = xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT);
     3889      xAddMVPCandOrder( pInfo, eRefPicList, iRefIdx, uiPartIdxLT, MD_ABOVE_LEFT);
    39163890    }
    39173891  }
     
    39333907    UInt uiAbsPartIdx; 
    39343908    UInt uiAbsPartAddr;
    3935     Int uiLCUIdx = getAddr();
    39363909
    39373910    deriveRightBottomIdx( uiPartIdx, uiPartIdxRB );
     
    39403913    //----  co-located RightBottom Temporal Predictor (H) ---//
    39413914    uiAbsPartIdx = g_auiZscanToRaster[uiPartIdxRB];
     3915    Int uiLCUIdx = -1;
    39423916    if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )  // image boundary check
    39433917    {
    3944       uiLCUIdx = -1;
    39453918    }
    39463919    else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdx] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
    39473920    {
    3948       uiLCUIdx = -1;
    39493921    }
    39503922    else
     
    39593931      {
    39603932        uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdx + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];
    3961         uiLCUIdx      = -1 ;
    39623933      }
    39633934      else if ( uiAbsPartIdx / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
     
    39693940      {
    39703941        uiAbsPartAddr = 0;
    3971         uiLCUIdx      = -1 ;
    39723942      }
    39733943    }
     
    40434013UInt TComDataCU::getIntraSizeIdx(UInt uiAbsPartIdx)
    40444014{
    4045   UInt uiShift = ( (m_puhTrIdx[uiAbsPartIdx]==0) && (m_pePartSize[uiAbsPartIdx]==SIZE_NxN) ) ? m_puhTrIdx[uiAbsPartIdx]+1 : m_puhTrIdx[uiAbsPartIdx];
    4046   uiShift = ( m_pePartSize[uiAbsPartIdx]==SIZE_NxN ? 1 : 0 );
     4015  UInt uiShift = ( m_pePartSize[uiAbsPartIdx]==SIZE_NxN ? 1 : 0 );
    40474016 
    40484017  UChar uiWidth = m_puhWidth[uiAbsPartIdx]>>uiShift;
     
    41304099  }
    41314100 
    4132 #if L0363_MVP_POC
    41334101  if ( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getPOC() == pcTmpCU->getSlice()->getRefPOC( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ))
    4134 #else
    4135   if ( m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) )
    4136 #endif
    41374102  {
    41384103    TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     
    43404305  }
    43414306  iCurrPOC = m_pcSlice->getPOC();   
    4342   iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
    43434307  iColPOC = pColCU->getSlice()->getPOC(); 
    43444308
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComLoopFilter.cpp

    r446 r537  
    461461        if ( ((piRefP0==piRefQ0)&&(piRefP1==piRefQ1)) || ((piRefP0==piRefQ1)&&(piRefP1==piRefQ0)) )
    462462        {
    463           uiBs = 0;
    464463          if ( piRefP0 != piRefP1 )   // Different L0 & L1
    465464          {
     
    694693  for ( UInt iIdx = 0; iIdx < uiNumParts; iIdx++ )
    695694  {
    696     ucBs = 0;
    697    
    698695    uiBsAbsIdx = xCalcBsIdx( pcCU, uiAbsZorderIdx, iDir, iEdge, iIdx);
    699696    ucBs = m_aapucBS[iDir][uiBsAbsIdx];
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPrediction.cpp

    r532 r537  
    7676  m_acYuvPredBase[1].destroy();
    7777#endif
    78 
    7978  if( m_pLumaRecBuffer )
    8079  {
     
    146145Pel TComPrediction::predIntraGetPredValDC( Int* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft )
    147146{
     147  assert(iWidth > 0 && iHeight > 0);
    148148  Int iInd, iSum = 0;
    149149  Pel pDcVal;
     
    934934  }
    935935#endif
    936 
    937936  if ( yFrac == 0 )
    938937  {
     
    12461245  return;
    12471246}
    1248 
    12491247#if H_3D_IC
    12501248/** Function for deriving the position of first non-zero binary bit of a value
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComRdCost.cpp

    r531 r537  
    570570#endif
    571571
    572 #if RATE_CONTROL_LAMBDA_DOMAIN
     572#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    573573UInt TComRdCost::getSADPart ( Int bitDepth, Pel* pelCur, Int curStride,  Pel* pelOrg, Int orgStride, UInt width, UInt height )
    574574{
     
    636636    return xGetSADw( pcDtParam );
    637637  }
    638 
    639638#if H_3D_IC
    640639  if( pcDtParam->bUseIC )
     
    643642  }
    644643#endif
    645 
    646644  Pel* piOrg   = pcDtParam->pOrg;
    647645  Pel* piCur   = pcDtParam->pCur;
     
    675673    return xGetSADw( pcDtParam );
    676674  }
    677 
    678675#if H_3D_IC
    679676  if( pcDtParam->bUseIC )
     
    682679  }
    683680#endif
    684 
    685681  Pel* piOrg      = pcDtParam->pOrg;
    686682  Pel* piCur      = pcDtParam->pCur;
     
    718714    return xGetSADw( pcDtParam );
    719715  }
    720 
    721716#if H_3D_IC
    722717  if( pcDtParam->bUseIC )
     
    725720  }
    726721#endif
    727 
    728722  Pel* piOrg   = pcDtParam->pOrg;
    729723  Pel* piCur   = pcDtParam->pCur;
     
    770764    return xGetSADw( pcDtParam );
    771765  }
    772 
    773766#if H_3D_IC
    774767  if( pcDtParam->bUseIC )
     
    777770  }
    778771#endif
    779 
    780772  Pel* piOrg   = pcDtParam->pOrg;
    781773  Pel* piCur   = pcDtParam->pCur;
     
    820812  }
    821813#endif
    822 
    823814  Pel* piOrg   = pcDtParam->pOrg;
    824815  Pel* piCur   = pcDtParam->pCur;
     
    867858    return xGetSADw( pcDtParam );
    868859  }
    869 
    870860#if H_3D_IC
    871861  if( pcDtParam->bUseIC )
     
    874864  }
    875865#endif
    876 
    877866  Pel* piOrg   = pcDtParam->pOrg;
    878867  Pel* piCur   = pcDtParam->pCur;
     
    935924    return xGetSADw( pcDtParam );
    936925  }
    937 
    938926#if H_3D_IC
    939927  if( pcDtParam->bUseIC )
     
    942930  }
    943931#endif
    944 
    945932  Pel* piOrg   = pcDtParam->pOrg;
    946933  Pel* piCur   = pcDtParam->pCur;
     
    996983    return xGetSADw( pcDtParam );
    997984  }
    998 
    999985#if H_3D_IC
    1000986  if( pcDtParam->bUseIC )
     
    1003989  }
    1004990#endif
    1005 
    1006991  Pel* piOrg   = pcDtParam->pOrg;
    1007992  Pel* piCur   = pcDtParam->pCur;
     
    10961081    return xGetSADw( pcDtParam );
    10971082  }
    1098 
    10991083#if H_3D_IC
    11001084  if( pcDtParam->bUseIC )
     
    11031087  }
    11041088#endif
    1105 
    11061089  Pel* piOrg   = pcDtParam->pOrg;
    11071090  Pel* piCur   = pcDtParam->pCur;
     
    34203403    return xGetHADsw( pcDtParam );
    34213404  }
    3422 
    34233405#if H_3D_IC
    34243406  if( pcDtParam->bUseIC )
     
    34273409  }
    34283410#endif
    3429 
    34303411  Pel* piOrg   = pcDtParam->pOrg;
    34313412  Pel* piCur   = pcDtParam->pCur;
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComRdCost.h

    r504 r537  
    209209#if RATE_CONTROL_LAMBDA_DOMAIN
    210210  Double  getLambda() { return m_dLambda; }
     211#if M0036_RC_IMPROVEMENT
     212  Double  getChromaWeight () {return((m_cbDistortionWeight+m_crDistortionWeight)/2.0);}
     213#endif
    211214#endif
    212215 
     
    331334#endif
    332335
    333 #if RATE_CONTROL_LAMBDA_DOMAIN
     336#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    334337  UInt   getSADPart ( Int bitDepth, Pel* pelCur, Int curStride,  Pel* pelOrg, Int orgStride, UInt width, UInt height );
    335338#endif
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.cpp

    r534 r537  
    6060, m_deblockingFilterBetaOffsetDiv2 ( 0 )
    6161, m_deblockingFilterTcOffsetDiv2   ( 0 )
    62 #if !L0034_COMBINED_LIST_CLEANUP
    63 , m_bRefPicListModificationFlagLC ( false )
    64 , m_bRefPicListCombinationFlag    ( false )
    65 #endif
    6662, m_bCheckLDC                     ( false )
    6763, m_iSliceQpDelta                 ( 0 )
     
    8076#else
    8177, m_dLambda                       ( 0.0 )
    82 #endif
    83 #if !L0034_COMBINED_LIST_CLEANUP
    84 , m_bNoBackPredFlag               ( false )
    8578#endif
    8679, m_uiTLayer                      ( 0 )
     
    131124#endif
    132125{
    133 #if L0034_COMBINED_LIST_CLEANUP
    134126  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;
    135 #else
    136   m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
    137 #endif
    138127 
    139128  initEqualRef();
    140129 
    141 #if L0034_COMBINED_LIST_CLEANUP
    142130  for ( Int idx = 0; idx < MAX_NUM_REF; idx++ )
    143131  {
    144132    m_list1IdxToList0Idx[idx] = -1;
    145133  }
    146 #else
    147   for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
    148   {
    149     m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;
    150     m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;
    151     m_eListIdFromIdxOfLC[iNumCount]=0;
    152     m_iRefIdxFromIdxOfLC[iNumCount]=0;
    153     m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;
    154     m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
    155   }   
    156 #endif
    157134  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++)
    158135  {
     
    213190  m_colRefIdx = 0;
    214191  initEqualRef();
    215 #if !L0034_COMBINED_LIST_CLEANUP
    216   m_bNoBackPredFlag = false;
    217   m_bRefPicListCombinationFlag = false;
    218   m_bRefPicListModificationFlagLC = false;
    219 #endif
    220192  m_bCheckLDC = false;
    221193  m_iSliceQpDeltaCb = 0;
    222194  m_iSliceQpDeltaCr = 0;
    223 
    224 #if !L0034_COMBINED_LIST_CLEANUP
    225   m_aiNumRefIdx[REF_PIC_LIST_C]      = 0;
    226 #endif
    227195
    228196#if H_3D_IV_MERGE
     
    378346}
    379347
    380 #if L0034_COMBINED_LIST_CLEANUP
    381348Void TComSlice::setList1IdxToList0Idx()
    382349{
     
    395362  }
    396363}
    397 #else
    398 Void TComSlice::generateCombinedList()
    399 {
    400   if(m_aiNumRefIdx[REF_PIC_LIST_C] > 0)
    401   {
    402     m_aiNumRefIdx[REF_PIC_LIST_C]=0;
    403     for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
    404     {
    405       m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;
    406       m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;
    407       m_eListIdFromIdxOfLC[iNumCount]=0;
    408       m_iRefIdxFromIdxOfLC[iNumCount]=0;
    409       m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;
    410       m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
    411     }
    412 
    413     for (Int iNumRefIdx = 0; iNumRefIdx < MAX_NUM_REF; iNumRefIdx++)
    414     {
    415       if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_0])
    416       {
    417         Bool bTempRefIdxInL2 = true;
    418         for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )
    419         {
    420 #if H_MV
    421           if ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() &&
    422                m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getLayerId() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getLayerId() )
    423 #else
    424           if ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )
    425 #endif
    426           {
    427             m_iRefIdxOfL1FromRefIdxOfL0[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];
    428             m_iRefIdxOfL0FromRefIdxOfL1[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;
    429             bTempRefIdxInL2 = false;
    430             break;
    431           }
    432         }
    433 
    434         if(bTempRefIdxInL2 == true)
    435         {
    436           m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_0;
    437           m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;
    438           m_iRefIdxOfLC[REF_PIC_LIST_0][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;
    439         }
    440       }
    441 
    442       if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_1])
    443       {
    444         Bool bTempRefIdxInL2 = true;
    445         for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )
    446         {
    447 #if H_MV
    448           if ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() &&
    449                m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getLayerId() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getLayerId() )
    450 #else
    451           if ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )
    452 #endif
    453           {
    454             m_iRefIdxOfL0FromRefIdxOfL1[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];
    455             m_iRefIdxOfL1FromRefIdxOfL0[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;
    456             bTempRefIdxInL2 = false;
    457             break;
    458           }
    459         }
    460         if(bTempRefIdxInL2 == true)
    461         {
    462           m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_1;
    463           m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;
    464           m_iRefIdxOfLC[REF_PIC_LIST_1][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;
    465         }
    466       }
    467     }
    468   }
    469 }
    470 #endif
    471 
    472364#if H_MV
    473365Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)
     
    506398  UInt NumPocLtCurr = 0;
    507399  Int i;
     400
    508401  for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)
    509402  {
     
    585478    }
    586479   
    587     assert(numPocTotalCurr != 0);
     480    assert(numPocTotalCurr > 0);
    588481   
    589482    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     
    617510    }
    618511#endif
     512  assert(cIdx == numPocTotalCurr);
    619513
    620514  if (m_eSliceType==B_SLICE)
     
    645539      }
    646540#endif
     541    assert(cIdx == numPocTotalCurr);
    647542  }
    648543
     
    673568  }
    674569#else
    675 
    676   for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[0]-1); rIdx ++)
    677   {
    678     m_apcRefPicList[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? rpsCurrList0[ m_RefPicListModification.getRefPicSetIdxL0(rIdx) ] : rpsCurrList0[rIdx % numPocTotalCurr];
    679     m_bIsUsedAsLongTerm[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? (m_RefPicListModification.getRefPicSetIdxL0(rIdx) >= (NumPocStCurr0 + NumPocStCurr1))
    680                                   : ((rIdx % numPocTotalCurr) >= (NumPocStCurr0 + NumPocStCurr1));
    681   }
    682   if ( m_eSliceType == P_SLICE )
     570  for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++)
     571  {
     572    cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr;
     573    assert(cIdx >= 0 && cIdx < numPocTotalCurr);
     574    m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];
     575    m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
     576  }
     577  if ( m_eSliceType != B_SLICE )
    683578  {
    684579    m_aiNumRefIdx[1] = 0;
     
    687582  else
    688583  {
    689     for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[1]-1); rIdx ++)
    690     {
    691       m_apcRefPicList[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? rpsCurrList1[ m_RefPicListModification.getRefPicSetIdxL1(rIdx) ] : rpsCurrList1[rIdx % numPocTotalCurr];
    692       m_bIsUsedAsLongTerm[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ?
    693                                   (m_RefPicListModification.getRefPicSetIdxL1(rIdx) >= (NumPocStCurr0 + NumPocStCurr1)): ((rIdx % numPocTotalCurr) >= (NumPocStCurr0 + NumPocStCurr1));
    694     }
    695   }
    696 #endif
    697 }
    698 
    699 #if H_MV && !H_MV_FIX1071
    700 // Temporary fix for FIX1071 should be removed later
    701 Int TComSlice::getNumRpsCurrTempList( TComReferencePictureSet* rps /* = 0 */)
    702 #else
     584    for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++)
     585    {
     586      cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr;
     587      assert(cIdx >= 0 && cIdx < numPocTotalCurr);
     588      m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ];
     589      m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
     590    }
     591  }
     592#endif
     593}
     594
    703595Int TComSlice::getNumRpsCurrTempList()
    704 #endif
    705596{
    706597  Int numRpsCurrTempList = 0;
     
    710601    return 0;
    711602  }
    712 #if H_MV && !H_MV_FIX1071
    713 // Temporary fix for FIX1071 should be removed later
    714   if (rps == NULL)
    715   {
    716     rps = m_pcRPS;
    717   }
    718 
    719   for(UInt i=0; i < rps->getNumberOfNegativePictures()+ rps->getNumberOfPositivePictures() + rps->getNumberOfLongtermPictures(); i++)
    720   {
    721     if(rps->getUsed(i))
    722 #else
    723603  for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)
    724604  {
    725605    if(m_pcRPS->getUsed(i))
    726 #endif
    727606    {
    728607      numRpsCurrTempList++;
     
    945824  m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2;
    946825 
    947 #if L0034_COMBINED_LIST_CLEANUP
    948826  for (i = 0; i < 2; i++)
    949 #else
    950   for (i = 0; i < 3; i++)
    951 #endif
    952827  {
    953828    m_aiNumRefIdx[i]     = pSrc->m_aiNumRefIdx[i];
    954829  }
    955830
    956 #if L0034_COMBINED_LIST_CLEANUP
    957831  for (i = 0; i < MAX_NUM_REF; i++)
    958832  {
    959833    m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i];
    960834  }
    961 #else
    962   for (i = 0; i < 2; i++)
    963   {
    964     for (j = 0; j < MAX_NUM_REF_LC; j++)
    965     {
    966        m_iRefIdxOfLC[i][j]  = pSrc->m_iRefIdxOfLC[i][j];
    967     }
    968   }
    969   for (i = 0; i < MAX_NUM_REF_LC; i++)
    970   {
    971     m_eListIdFromIdxOfLC[i] = pSrc->m_eListIdFromIdxOfLC[i];
    972     m_iRefIdxFromIdxOfLC[i] = pSrc->m_iRefIdxFromIdxOfLC[i];
    973     m_iRefIdxOfL1FromRefIdxOfL0[i] = pSrc->m_iRefIdxOfL1FromRefIdxOfL0[i];
    974     m_iRefIdxOfL0FromRefIdxOfL1[i] = pSrc->m_iRefIdxOfL0FromRefIdxOfL1[i];
    975   }
    976   m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;
    977   m_bRefPicListCombinationFlag    = pSrc->m_bRefPicListCombinationFlag;
    978 #endif
    979835  m_bCheckLDC             = pSrc->m_bCheckLDC;
    980836  m_iSliceQpDelta        = pSrc->m_iSliceQpDelta;
     
    1014870
    1015871  m_pcPic                = pSrc->m_pcPic;
     872
    1016873  m_colFromL0Flag        = pSrc->m_colFromL0Flag;
    1017874  m_colRefIdx            = pSrc->m_colRefIdx;
     
    1033890  }
    1034891
    1035 #if !L0034_COMBINED_LIST_CLEANUP
    1036   m_bNoBackPredFlag      = pSrc->m_bNoBackPredFlag;
    1037 #endif
    1038892  m_uiTLayer                      = pSrc->m_uiTLayer;
    1039893  m_bTLayerSwitchingFlag          = pSrc->m_bTLayerSwitchingFlag;
     
    13661220/** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set
    13671221*/
    1368 #if FIX1071 && H_MV_FIX1071
     1222#if FIX1071
    13691223Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
    13701224#else
     
    13951249        // and should be added to the explicit Reference Picture Set
    13961250        pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));
    1397 #if FIX1071 && H_MV_FIX1071
     1251#if FIX1071
    13981252        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
    13991253#else
     
    15661420  {
    15671421    m_numReorderPics[i] = 0;
    1568 #if L0323_DPB
    15691422    m_uiMaxDecPicBuffering[i] = 1;
    1570 #else
    1571     m_uiMaxDecPicBuffering[i] = 0;
    1572 #endif
    15731423    m_uiMaxLatencyIncrease[i] = 0;
    15741424  }
     
    20051855, m_pcmLog2MaxSize            (  5)
    20061856, m_uiPCMLog2MinSize          (  7)
    2007 #if !L0034_COMBINED_LIST_CLEANUP
    2008 , m_bUseLComb                 (false)
    2009 #endif
    20101857, m_bitDepthY                 (  8)
    20111858, m_bitDepthC                 (  8)
     
    20371884  {
    20381885    m_uiMaxLatencyIncrease[i] = 0;
    2039 #if L0323_DPB
    20401886    m_uiMaxDecPicBuffering[i] = 1;
    2041 #else
    2042     m_uiMaxDecPicBuffering[i] = 0;
    2043 #endif
    20441887    m_numReorderPics[i]       = 0;
    20451888  }
     
    20791922  TComHRD *hrd = vui->getHrdParameters();
    20801923
    2081 #if L0043_TIMING_INFO
    20821924  TimingInfo *timingInfo = vui->getTimingInfo();
    20831925  timingInfo->setTimingInfoPresentFlag( true );
     
    21031945    break;
    21041946  }
    2105 #else
    2106   hrd->setTimingInfoPresentFlag( true );
    2107   switch( frameRate )
    2108   {
    2109   case 24:
    2110     hrd->setNumUnitsInTick( 1125000 );    hrd->setTimeScale    ( 27000000 );
    2111     break;
    2112   case 25:
    2113     hrd->setNumUnitsInTick( 1080000 );    hrd->setTimeScale    ( 27000000 );
    2114     break;
    2115   case 30:
    2116     hrd->setNumUnitsInTick( 900900 );     hrd->setTimeScale    ( 27000000 );
    2117     break;
    2118   case 50:
    2119     hrd->setNumUnitsInTick( 540000 );     hrd->setTimeScale    ( 27000000 );
    2120     break;
    2121   case 60:
    2122     hrd->setNumUnitsInTick( 450450 );     hrd->setTimeScale    ( 27000000 );
    2123     break;
    2124   default:
    2125     hrd->setNumUnitsInTick( 1001 );       hrd->setTimeScale    ( 60000 );
    2126     break;
    2127   }
    2128 #endif
    21291947
    21301948  Bool rateCnt = ( bitRate > 0 );
     
    21391957    hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
    21401958    hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
    2141 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    21421959    hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
    2143 #endif
    21441960  }
    21451961  else
     
    21701986  UInt birateValue, cpbSizeValue;
    21711987  UInt ducpbSizeValue;
    2172 #if L0363_DU_BIT_RATE
    21731988  UInt duBitRateValue = 0;
    2174 #endif
    21751989
    21761990  for( i = 0; i < MAX_TLAYER; i ++ )
     
    21841998    cpbSizeValue = bitRate;                                     // 1 second
    21851999    ducpbSizeValue = bitRate/numDU;
    2186 #if L0363_DU_BIT_RATE
    21872000    duBitRateValue = bitRate;
    2188 #endif
    21892001    for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
    21902002    {
     
    21972009      hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
    21982010      hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
    2199 #if L0363_DU_BIT_RATE
    22002011      hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
    2201 #endif
    22022012      hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
    22032013    }
     
    22822092}
    22832093#endif
    2284 
    22852094TComReferencePictureSet::TComReferencePictureSet()
    22862095: m_numberOfPictures (0)
     
    31672976  , m_profileIdc      (0)
    31682977  , m_levelIdc        (0)
    3169 #if L0046_CONSTRAINT_FLAGS
    31702978, m_progressiveSourceFlag  (false)
    31712979, m_interlacedSourceFlag   (false)
    31722980, m_nonPackedConstraintFlag(false)
    31732981, m_frameOnlyConstraintFlag(false)
    3174 #endif
    31752982{
    31762983  ::memset(m_profileCompatibilityFlag, 0, sizeof(m_profileCompatibilityFlag));
     
    32053012}
    32063013#endif
    3207 
    32083014//! \}
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComSlice.h

    r535 r537  
    190190  Int     m_levelIdc;
    191191
    192 #if L0046_CONSTRAINT_FLAGS
    193192  Bool m_progressiveSourceFlag;
    194193  Bool m_interlacedSourceFlag;
    195194  Bool m_nonPackedConstraintFlag;
    196195  Bool m_frameOnlyConstraintFlag;
    197 #endif
    198196 
    199197public:
     
    215213  Void  setLevelIdc(Int x)      { m_levelIdc = x; }
    216214 
    217 #if L0046_CONSTRAINT_FLAGS
    218215  Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; }
    219216  Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; }
     
    227224  Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; }
    228225  Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; }
    229 #endif
    230226};
    231227
     
    253249};
    254250/// VPS class
    255 
    256 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    257 class TComBitRatePicRateInfo
    258 {
    259   Bool        m_bitRateInfoPresentFlag[MAX_TLAYER];
    260   Bool        m_picRateInfoPresentFlag[MAX_TLAYER];
    261   Int         m_avgBitRate[MAX_TLAYER];
    262   Int         m_maxBitRate[MAX_TLAYER];
    263   Int         m_constantPicRateIdc[MAX_TLAYER];
    264   Int         m_avgPicRate[MAX_TLAYER];
    265 public:
    266   TComBitRatePicRateInfo();
    267   Bool        getBitRateInfoPresentFlag(Int i) {return m_bitRateInfoPresentFlag[i];}
    268   Void        setBitRateInfoPresentFlag(Int i, Bool x) {m_bitRateInfoPresentFlag[i] = x;}
    269 
    270   Bool        getPicRateInfoPresentFlag(Int i) {return m_picRateInfoPresentFlag[i];}
    271   Void        setPicRateInfoPresentFlag(Int i, Bool x) {m_picRateInfoPresentFlag[i] = x;}
    272 
    273   Int         getAvgBitRate(Int i) {return m_avgBitRate[i];}
    274   Void        setAvgBitRate(Int i, Int x) {m_avgBitRate[i] = x;}
    275 
    276   Int         getMaxBitRate(Int i) {return m_maxBitRate[i];}
    277   Void        setMaxBitRate(Int i, Int x) {m_maxBitRate[i] = x;}
    278 
    279   Int         getConstantPicRateIdc(Int i) {return m_constantPicRateIdc[i];}
    280   Void        setConstantPicRateIdc(Int i, Int x) {m_constantPicRateIdc[i] = x;}
    281 
    282   Int         getAvgPicRate(Int i) {return m_avgPicRate[i];}
    283   Void        setAvgPicRate(Int i, Int x) {m_avgPicRate[i] = x;}
    284 };
    285 #endif
    286251
    287252struct HrdSubLayerInfo
     
    296261  UInt ducpbSizeValue    [MAX_CPB_CNT][2];
    297262  UInt cbrFlag           [MAX_CPB_CNT][2];
    298 #if L0363_DU_BIT_RATE
    299263  UInt duBitRateValue    [MAX_CPB_CNT][2];
    300 #endif
    301264};
    302265
     
    304267{
    305268private:
    306 #if !L0043_TIMING_INFO
    307   Bool m_timingInfoPresentFlag;
    308   UInt m_numUnitsInTick;
    309   UInt m_timeScale;
    310 #endif
    311269  Bool m_nalHrdParametersPresentFlag;
    312270  Bool m_vclHrdParametersPresentFlag;
     
    315273  UInt m_duCpbRemovalDelayLengthMinus1;
    316274  Bool m_subPicCpbParamsInPicTimingSEIFlag;
    317 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    318275  UInt m_dpbOutputDelayDuLengthMinus1;
    319 #endif
    320276  UInt m_bitRateScale;
    321277  UInt m_cpbSizeScale;
     
    329285public:
    330286  TComHRD()
    331 #if !L0043_TIMING_INFO
    332   :m_timingInfoPresentFlag(false)
    333   ,m_numUnitsInTick(1001)
    334   ,m_timeScale(60000)
    335   ,m_nalHrdParametersPresentFlag(0)
    336 #else
    337287  :m_nalHrdParametersPresentFlag(0)
    338 #endif
    339288  ,m_vclHrdParametersPresentFlag(0)
    340289  ,m_subPicCpbParamsPresentFlag(false)
     
    342291  ,m_duCpbRemovalDelayLengthMinus1(0)
    343292  ,m_subPicCpbParamsInPicTimingSEIFlag(false)
    344 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    345293  ,m_dpbOutputDelayDuLengthMinus1(0)
    346 #endif
    347294  ,m_bitRateScale(0)
    348295  ,m_cpbSizeScale(0)
     
    353300
    354301  virtual ~TComHRD() {}
    355 #if !L0043_TIMING_INFO
    356   Void setTimingInfoPresentFlag             ( Bool flag )  { m_timingInfoPresentFlag = flag;               }
    357   Bool getTimingInfoPresentFlag             ( )            { return m_timingInfoPresentFlag;               }
    358 
    359   Void setNumUnitsInTick                    ( UInt value ) { m_numUnitsInTick = value;                     }
    360   UInt getNumUnitsInTick                    ( )            { return m_numUnitsInTick;                      }
    361 
    362   Void setTimeScale                         ( UInt value ) { m_timeScale = value;                          }
    363   UInt getTimeScale                         ( )            { return m_timeScale;                           }
    364 #endif
    365302
    366303  Void setNalHrdParametersPresentFlag       ( Bool flag )  { m_nalHrdParametersPresentFlag = flag;         }
     
    382319  Bool getSubPicCpbParamsInPicTimingSEIFlag ()             { return m_subPicCpbParamsInPicTimingSEIFlag;   }
    383320
    384 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    385321  Void setDpbOutputDelayDuLengthMinus1      (UInt value )  { m_dpbOutputDelayDuLengthMinus1 = value;       }
    386322  UInt getDpbOutputDelayDuLengthMinus1      ()             { return m_dpbOutputDelayDuLengthMinus1;        }
    387 #endif
    388323
    389324  Void setBitRateScale                      ( UInt value ) { m_bitRateScale = value;                       }
     
    426361  Void setDuCpbSizeValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value;       }
    427362  UInt getDuCpbSizeValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl            )  { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl];        }
    428 #if L0363_DU_BIT_RATE
    429363  Void setDuBitRateValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value;       }
    430364  UInt getDuBitRateValueMinus1     (Int layer, Int cpbcnt, Int nalOrVcl )              { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl];        }
    431 #endif
    432365  Void setCbrFlag                ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value;            }
    433366  Bool getCbrFlag                ( Int layer, Int cpbcnt, Int nalOrVcl             ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl];             }
     
    435368  Void setNumDU                              ( UInt value ) { m_numDU = value;                            }
    436369  UInt getNumDU                              ( )            { return m_numDU;          }
    437 #if L0045_CONDITION_SIGNALLING
    438370  Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); }
    439 #endif
    440371};
    441372
    442 #if L0043_TIMING_INFO
    443373class TimingInfo
    444374{
     
    471401  Void setNumTicksPocDiffOneMinus1          (Int x       ) { m_numTicksPocDiffOneMinus1 = x;               }
    472402};
    473 #endif
    474403
    475404class TComVPS
     
    483412  UInt        m_numReorderPics[MAX_TLAYER];
    484413  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
    485   UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];
     414  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit)
    486415
    487416  UInt        m_numHrdParameters;
     
    507436  TComPTL     m_pcPTL;
    508437#endif
    509 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    510   TComBitRatePicRateInfo    m_bitRatePicRateInfo;
    511 #endif
    512 #if L0043_TIMING_INFO
    513438  TimingInfo  m_timingInfo;
    514 #endif
    515 
    516439#if H_MV
    517440  /// VPS EXTENSION SYNTAX ELEMENTS
     
    648571  TComPTL* getPTL() { return &m_pcPTL; }
    649572#endif
    650 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    651   TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; }
    652 #endif
    653 #if L0043_TIMING_INFO
    654573  TimingInfo* getTimingInfo() { return &m_timingInfo; }
    655 #endif
    656574#if H_MV
    657575  Void    setAvcBaseLayerFlag( Bool val )                                  { m_avcBaseLayerFlag = val;  }
     
    878796  Int  m_log2MaxMvLengthVertical;
    879797  TComHRD m_hrdParameters;
    880 #if L0043_TIMING_INFO
    881798  TimingInfo m_timingInfo;
    882 #else
    883   Bool m_pocProportionalToTimingFlag;
    884   Int  m_numTicksPocDiffOneMinus1;
    885 #endif
    886799#if H_MV
    887800  Bool m_tileBoundariesAlignedFlag;
    888801#endif
     802
    889803public:
    890804  TComVUI()
     
    918832    ,m_log2MaxMvLengthHorizontal(15)
    919833    ,m_log2MaxMvLengthVertical(15)
    920 #if !L0043_TIMING_INFO 
    921     ,m_pocProportionalToTimingFlag(false)
    922     ,m_numTicksPocDiffOneMinus1(0)
    923 #endif
    924834#if H_MV
    925835    ,m_tileBoundariesAlignedFlag(true)
     
    1019929
    1020930  TComHRD* getHrdParameters                 ()             { return &m_hrdParameters; }
    1021 #if L0043_TIMING_INFO
    1022931  TimingInfo* getTimingInfo() { return &m_timingInfo; }
    1023 #else
    1024   Bool getPocProportionalToTimingFlag() {return m_pocProportionalToTimingFlag; }
    1025   Void setPocProportionalToTimingFlag(Bool x) {m_pocProportionalToTimingFlag = x;}
    1026   Int  getNumTicksPocDiffOneMinus1() {return m_numTicksPocDiffOneMinus1;}
    1027   Void setNumTicksPocDiffOneMinus1(Int x) { m_numTicksPocDiffOneMinus1 = x;}
    1028 #endif
    1029 #if H_MV
    1030   Bool getTileBoundariesAlignedFlag(  ) { return m_tileBoundariesAlignedFlag; }
     932#if H_MV
     933Bool getTileBoundariesAlignedFlag(  ) { return m_tileBoundariesAlignedFlag; }
    1031934  Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; }
    1032935#endif
     
    1070973  Bool        m_useAMP;
    1071974
    1072 #if !L0034_COMBINED_LIST_CLEANUP
    1073   Bool        m_bUseLComb;
    1074 #endif
    1075  
    1076975  // Parameter
    1077976  Int         m_bitDepthY;
     
    11021001  TComScalingList*     m_scalingList;   //!< ScalingList class pointer
    11031002  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
    1104   UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];
     1003  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];  // Really max latency increase plus 1 (value 0 expresses no limit)
    11051004
    11061005  Bool        m_useDF;
     
    12031102 
    12041103  // Tool list
    1205 #if !L0034_COMBINED_LIST_CLEANUP
    1206   Void setUseLComb    (Bool b)   { m_bUseLComb = b;         }
    1207   Bool getUseLComb    ()         { return m_bUseLComb;      }
    1208 #endif
    1209 
    12101104  Bool getUseLossless ()         { return m_useLossless; }
    12111105  Void setUseLossless ( Bool b ) { m_useLossless  = b; }
     
    15541448  Int         m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
    15551449  Int         m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
    1556 #if L0034_COMBINED_LIST_CLEANUP
    15571450  Int         m_list1IdxToList0Idx[MAX_NUM_REF];
    15581451  Int         m_aiNumRefIdx   [2];    //  for multiple reference of current slice
    1559 #else
    1560   Int         m_aiNumRefIdx   [3];    //  for multiple reference of current slice
    1561 
    1562   Int         m_iRefIdxOfLC[2][MAX_NUM_REF_LC];
    1563   Int         m_eListIdFromIdxOfLC[MAX_NUM_REF_LC];
    1564   Int         m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC];
    1565   Int         m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC];
    1566   Int         m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC];
    1567   Bool        m_bRefPicListModificationFlagLC;
    1568   Bool        m_bRefPicListCombinationFlag;
    1569 #endif
    15701452
    15711453  Bool        m_bCheckLDC;
     
    16081490
    16091491  Bool        m_abEqualRef  [2][MAX_NUM_REF][MAX_NUM_REF];
    1610 #if !L0034_COMBINED_LIST_CLEANUP
    1611   Bool        m_bNoBackPredFlag;
    1612 #endif
    16131492  UInt        m_uiTLayer;
    16141493  Bool        m_bTLayerSwitchingFlag;
     
    16851564#endif
    16861565#endif
    1687 
    16881566public:
    16891567  TComSlice();
     
    17611639  UInt      getARPStepNum( )                                                         { return m_nARPStepNum;                                         } 
    17621640#endif
    1763 
    17641641  Int       getDepth            ()                              { return  m_iDepth;                     }
    17651642  UInt      getColFromL0Flag    ()                              { return  m_colFromL0Flag;              }
     
    17691646  Bool      getCheckLDC     ()                                  { return m_bCheckLDC; }
    17701647  Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
    1771 #if H_MV && !H_MV_FIX1071  // This is a temporary fix of the temporary fix L0177
    1772   Int       getNumRpsCurrTempList( TComReferencePictureSet* rps = NULL );
    1773 #else
    17741648  Int       getNumRpsCurrTempList();
    1775 #endif
    1776 #if L0034_COMBINED_LIST_CLEANUP
    17771649  Int       getList1IdxToList0Idx ( Int list1Idx )               { return m_list1IdxToList0Idx[list1Idx]; }
    1778 #else
    1779   Int       getRefIdxOfLC       (RefPicList e, Int iRefIdx)     { return m_iRefIdxOfLC[e][iRefIdx];           }
    1780   Int       getListIdFromIdxOfLC(Int iRefIdx)                   { return m_eListIdFromIdxOfLC[iRefIdx];       }
    1781   Int       getRefIdxFromIdxOfLC(Int iRefIdx)                   { return m_iRefIdxFromIdxOfLC[iRefIdx];       }
    1782   Int       getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx)            { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];}
    1783   Int       getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx)            { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];}
    1784   Bool      getRefPicListModificationFlagLC()                   {return m_bRefPicListModificationFlagLC;}
    1785   Void      setRefPicListModificationFlagLC(Bool bflag)         {m_bRefPicListModificationFlagLC=bflag;}     
    1786   Bool      getRefPicListCombinationFlag()                      {return m_bRefPicListCombinationFlag;}
    1787   Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}   
    1788 #endif
    17891650  Void      setReferenced(Bool b)                               { m_bRefenced = b; }
    17901651  Bool      isReferenced()                                      { return m_bRefenced; }
     
    18611722 
    18621723  static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
    1863 #if L0034_COMBINED_LIST_CLEANUP
    18641724  Void setList1IdxToList0Idx();
    1865 #else
    1866   Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }
    1867   Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }
    1868   Void generateCombinedList       ();
    1869 #endif
    18701725
    18711726  UInt getTLayer             ()                            { return m_uiTLayer;                      }
     
    18801735  static Void markCurrPic                 ( TComPic* currPic );;
    18811736  static Void markIvRefPicsAsUnused       ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc  );
    1882 
    1883 
    1884   Void xPrintRefPicList();
     1737  Void        xPrintRefPicList();
    18851738#endif
    18861739  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
    18871740  Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );
    18881741  Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
    1889 #if FIX1071 && H_MV_FIX1071
     1742#if FIX1071
    18901743  Void      createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
    18911744#else
     
    20361889
    20371890#endif
    2038 
    20391891protected:
    20401892  TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComTrQuant.cpp

    r446 r537  
    10751075    Int iTransformShift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize;  // Represents scaling through forward transform
    10761076
    1077     Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift;                // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
    1078 
    1079     iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9);
    1080 
    10811077#if ADAPTIVE_QP_SELECTION
    1082     iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift;
     1078    Int iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift;
    10831079    iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9);
    10841080    Int iQBitsC = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift - ARL_C_PRECISION; 
    10851081    Int iAddC   = 1 << (iQBitsC-1);
     1082#else
     1083    Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift;                // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
     1084    iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9);
    10861085#endif
    10871086
     
    13471346#else
    13481347  Int j;
    1349   {
    1350     Short block[ 64 * 64 ];
    1351     Short coeff[ 64 * 64 ];
    1352     {
     1348  Short block[ 32 * 32 ];
     1349  Short coeff[ 32 * 32 ];
    13531350      for (j = 0; j < iHeight; j++)
    13541351      {   
    13551352        memcpy( block + j * iWidth, piBlkResi + j * uiStride, iWidth * sizeof( Short ) );
    13561353      }
    1357     }
    13581354    xTrMxN(bitDepth, block, coeff, iWidth, iHeight, uiMode );
    13591355    for ( j = 0; j < iHeight * iWidth; j++ )
     
    13611357      psCoeff[ j ] = coeff[ j ];
    13621358    }
    1363     return ;
    1364   }
    13651359#endif 
    13661360}
     
    13821376  Int j;
    13831377  {
    1384     Short block[ 64 * 64 ];
    1385     Short coeff[ 64 * 64 ];
     1378    Short block[ 32 * 32 ];
     1379    Short coeff[ 32 * 32 ];
    13861380    for ( j = 0; j < iHeight * iWidth; j++ )
    13871381    {   
     
    15051499                                                      UInt                            uiAbsPartIdx )
    15061500{
    1507   Int    iQBits      = m_cQP.m_iBits;
    1508   Double dTemp       = 0;
    15091501  UInt uiLog2TrSize = g_aucConvertToBit[ uiWidth ] + 2;
    1510   Int uiQ = g_quantScales[m_cQP.rem()];
    15111502 
    15121503  UInt uiBitDepth = eTType == TEXT_LUMA ? g_bitDepthY : g_bitDepthC;
     
    15191510  assert(scalingListType < 6);
    15201511 
    1521   iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift;                   // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
    1522   Double dErrScale   = 0;
     1512  Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift;                   // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
    15231513  Double *pdErrScaleOrg = getErrScaleCoeff(scalingListType,uiLog2TrSize-2,m_cQP.m_iRem);
    15241514  Int *piQCoefOrg = getQuantCoeff(scalingListType,m_cQP.m_iRem,uiLog2TrSize-2);
     
    15721562  Double  d64BaseCost         = 0;
    15731563  Int     iLastScanPos        = -1;
    1574   dTemp                       = dErrScale;
    15751564 
    15761565  UInt    c1Idx     = 0;
     
    16011590      UInt    uiBlkPos          = scan[iScanPos];
    16021591      // set coeff
    1603       uiQ  = piQCoef[uiBlkPos];
    1604       dTemp = pdErrScale[uiBlkPos];
     1592      Int uiQ  = piQCoef[uiBlkPos];
     1593      Double dTemp = pdErrScale[uiBlkPos];
    16051594      Int lLevelDouble          = plSrcCoeff[ uiBlkPos ];
    16061595      lLevelDouble              = (Int)min<Int64>((Int64)abs((Int)lLevelDouble) * uiQ , MAX_INT - (1 << (iQBits - 1)));
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComWeightPrediction.cpp

    r324 r537  
    271271Void TComWeightPrediction::getWpScaling( TComDataCU* pcCU, Int iRefIdx0, Int iRefIdx1, wpScalingParam *&wp0, wpScalingParam *&wp1)
    272272{
     273  assert(iRefIdx0 >= 0 || iRefIdx1 >= 0);
     274 
    273275  TComSlice*      pcSlice       = pcCU->getSlice();
    274276  TComPPS*        pps           = pcCU->getSlice()->getPPS();
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h

    r534 r537  
    4141//! \ingroup TLibCommon
    4242//! \{
    43 
    4443/////////////////////////////////////////////////////////////////////////////////////////
    4544///////////////////////////////// EXTENSION SELECTION /////////////////////////////////// 
     
    204203/////////////////////////////////////////////////////////////////////////////////////////
    205204
    206 #define FIX1071 1 ///< Temporary fix for issue #1071
    207 
    208 #define L0208_SOP_DESCRIPTION_SEI     1 ///< L0208: add SOP descrioption SEI
     205#define FIX1071 1 ///< fix for issue #1071
     206
    209207#define MAX_NUM_PICS_IN_SOP           1024
    210208
    211 #define K0180_SCALABLE_NESTING_SEI  1   ///JCTVC-K0180 scalable nesting sei message
    212209#define MAX_NESTING_NUM_OPS         1024
    213210#define MAX_NESTING_NUM_LAYER       64
    214 
    215 #define J0149_TONE_MAPPING_SEI        1 ///< J0149: Tone mapping information SEI
    216 #define L0363_DU_BIT_RATE             1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters
    217 #define L0328_SPLICING                1 ///< L0328: splicing support in HRD
    218 #define L0044_DU_DPB_OUTPUT_DELAY_HRD 1 ///< L0044: Include dpb_output_delay_du_length_minus1 in hrd_parameters(), dpb_output_du_delay in
    219                                         ///<        picture timing SEI and DU information SEI
    220 #define L0045_PERSISTENCE_FLAGS  1      ///< L0045: Replace "repetition_period" syntax elements in SEI with "persistence_flag"
    221 #define L0045_NON_NESTED_SEI_RESTRICTIONS 1 ///< L0045; Include restriction on the order of APS and non-nested BP, PT and DU info SEI messages
    222 #define L0044_CPB_DPB_DELAY_OFFSET 1  ///< L0044: Include syntax elements cpb_delay_offset and dpb_delay_offset in the BP SEI message
    223 #define L0047_APS_FLAGS            1  ///< L0047: Include full_random_access_flag and no_param_set_update_flag in the active parameter set SEI message
    224 #define L0043_TIMING_INFO          1  ///< L0043: Timing information is signalled in VUI outside hrd_parameters()
    225 #define L0046_RENAME_PROG_SRC_IDC  1  ///< L0046: Rename progressive_source_idc to source_scan_type
    226 #define L0045_CONDITION_SIGNALLING 1  ///< L0045: Condition the signaling of some syntax elements in picture timing SEI message
    227 #define L0043_MSS_IDC 1
    228 #define L0116_ENTRY_POINT 1
    229 #define L0363_MORE_BITS 1
    230 #define L0363_MVP_POC 1
    231 #define L0363_BYTE_ALIGN 1
    232 #define L0363_SEI_ALLOW_SUFFIX 1
    233 #define L0323_LIMIT_DEFAULT_LIST_SIZE 1
    234 #define L0046_CONSTRAINT_FLAGS 1
    235 #define L0255_MOVE_PPS_FLAGS       1  ///< move some flags to earlier positions in the PPS
    236 #define L0444_FPA_TYPE             1  ///< allow only FPA types 3, 4 and 5
    237 #define L0372 1
    238 #define SIGNAL_BITRATE_PICRATE_IN_VPS               0  ///< K0125: Signal bit_rate and pic_rate in VPS
    239 #define L0232_RD_PENALTY           1  ///< L0232: RD-penalty for 32x32 TU for intra in non-intra slices
    240 #define L0386_DB_METRIC            1  ///< L0386: non-normative blockiness metric (automatically configures deblocking parameters in bitstream)
    241 #define L0323_DPB                     1 ///< L0323: Specification of active reference indices and decoded picture buffer
    242 
    243 #define L0034_COMBINED_LIST_CLEANUP 1
    244211
    245212#define MAX_VPS_NUM_HRD_PARAMETERS                1
     
    254221
    255222#define RATE_CONTROL_LAMBDA_DOMAIN                  1  ///< JCTVC-K0103, rate control by R-lambda model
    256 #define L0033_RC_BUGFIX                             1  ///< JCTVC-L0033, bug fix for R-lambda model based rate control
     223#define M0036_RC_IMPROVEMENT                        1  ///< JCTVC-M0036, improvement for R-lambda model based rate control
     224#define TICKET_1090_FIX                             1
     225
     226#define RC_FIX                                      1  /// suggested fix for M0036
     227#define RATE_CONTROL_INTRA                          1  ///< JCTVC-M0257, rate control for intra
    257228
    258229#define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
     
    281252
    282253#define REMOVE_SAO_LCU_ENC_CONSTRAINTS_3 1  ///< disable the encoder constraint that conditionally disable SAO for chroma for entire slice in interleaved mode
    283 
    284 #define REMOVE_SINGLE_SEI_EXTENSION_FLAGS 1 ///< remove display orientation SEI extension flag (there is a generic SEI extension mechanism now)
    285254
    286255#define SAO_ENCODING_CHOICE              1  ///< I0184: picture early termination
     
    601570  REF_PIC_LIST_0 = 0,   ///< reference list 0
    602571  REF_PIC_LIST_1 = 1,   ///< reference list 1
    603 #if !L0034_COMBINED_LIST_CLEANUP
    604   REF_PIC_LIST_C = 2,   ///< combined reference list for uni-prediction in B-Slices
    605 #endif
    606572  REF_PIC_LIST_X = 100  ///< special mark
    607573};
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/SEIread.cpp

    r446 r537  
    9090    fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n");
    9191    break;
    92 #if J0149_TONE_MAPPING_SEI
    9392  case SEI::TONE_MAPPING_INFO:
    9493    fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n");
    9594    break;
    96 #endif
    97 #if L0208_SOP_DESCRIPTION_SEI
    9895  case SEI::SOP_DESCRIPTION:
    9996    fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n");
    10097    break;
    101 #endif
    102 #if K0180_SCALABLE_NESTING_SEI
    10398  case SEI::SCALABLE_NESTING:
    10499    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
    105100    break;
    106 #endif
    107101  default:
    108102    fprintf( g_hTrace, "=========== Unknown SEI message ===========\n");
     
    234228      xParseSEIGradualDecodingRefreshInfo((SEIGradualDecodingRefreshInfo&) *sei, payloadSize);
    235229      break;
    236 #if J0149_TONE_MAPPING_SEI
    237230    case SEI::TONE_MAPPING_INFO:
    238231      sei = new SEIToneMappingInfo;
    239232      xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize);
    240233      break;
    241 #endif
    242 #if L0208_SOP_DESCRIPTION_SEI
    243234    case SEI::SOP_DESCRIPTION:
    244235      sei = new SEISOPDescription;
    245236      xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize);
    246237      break;
    247 #endif
    248 #if K0180_SCALABLE_NESTING_SEI
    249238    case SEI::SCALABLE_NESTING:
    250239      sei = new SEIScalableNesting;
    251240      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps);
    252241      break;
    253 #endif
    254242    default:
    255243      for (UInt i = 0; i < payloadSize; i++)
     
    265253    switch (payloadType)
    266254    {
    267 #if L0363_SEI_ALLOW_SUFFIX
    268255      case SEI::USER_DATA_UNREGISTERED:
    269256        sei = new SEIuserDataUnregistered;
    270257        xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize);
    271258        break;
    272 #endif
    273259      case SEI::DECODED_PICTURE_HASH:
    274260        sei = new SEIDecodedPictureHash;
     
    402388  UInt val;
    403389  READ_CODE(4, val, "active_vps_id");      sei.activeVPSId = val;
    404 #if L0047_APS_FLAGS
    405390  READ_FLAG( val, "full_random_access_flag");  sei.m_fullRandomAccessFlag = val ? true : false;
    406391  READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;
    407 #endif
    408392  READ_UVLC(   val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;
    409393
     
    438422    sei.m_duSptCpbRemovalDelay = 0;
    439423  }
    440 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    441424  READ_FLAG( val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = val ? true : false;
    442425  if(sei.m_dpbOutputDuDelayPresentFlag)
     
    445428    sei.m_picSptDpbOutputDuDelay = val;
    446429  }
    447 #endif
    448430  xParseByteAlign();
    449431}
     
    462444    READ_FLAG( code, "rap_cpb_params_present_flag" );                   sei.m_rapCpbParamsPresentFlag = code;
    463445  }
    464 #if L0328_SPLICING
    465446  //read splicing flag and cpb_removal_delay_delta
    466447  READ_FLAG( code, "concatenation_flag");
     
    468449  READ_CODE( ( pHRD->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_delta_minus1" );
    469450  sei.m_auCpbRemovalDelayDelta = code + 1;
    470 #endif
    471 #if L0044_CPB_DPB_DELAY_OFFSET
    472451  if( sei.m_rapCpbParamsPresentFlag )
    473452  {
     
    475454    READ_CODE( pHRD->getDpbOutputDelayLengthMinus1()  + 1, code, "dpb_delay_offset" );      sei.m_dpbDelayOffset = code;
    476455  }
    477 #endif
    478456  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    479457  {
     
    507485  TComHRD *hrd = vui->getHrdParameters();
    508486
    509 #if !L0045_CONDITION_SIGNALLING
    510   // This condition was probably OK before the pic_struct, progressive_source_idc, duplicate_flag were added
    511   if( !hrd->getNalHrdParametersPresentFlag() && !hrd->getVclHrdParametersPresentFlag() )
    512   {
    513     return;
    514   }
    515 #endif
    516 
    517487  if( vui->getFrameFieldInfoPresentFlag() )
    518488  {
    519489    READ_CODE( 4, code, "pic_struct" );             sei.m_picStruct            = code;
    520 #if L0046_RENAME_PROG_SRC_IDC
    521490    READ_CODE( 2, code, "source_scan_type" );       sei.m_sourceScanType = code;
    522 #else
    523     READ_CODE( 2, code, "progressive_source_idc" ); sei.m_progressiveSourceIdc = code;
    524 #endif
    525491    READ_FLAG(    code, "duplicate_flag" );         sei.m_duplicateFlag        = ( code == 1 ? true : false );
    526492  }
    527493
    528 #if L0045_CONDITION_SIGNALLING
    529494  if( hrd->getCpbDpbDelaysPresentFlag())
    530495  {
    531 #endif
    532496    READ_CODE( ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), code, "au_cpb_removal_delay_minus1" );
    533497    sei.m_auCpbRemovalDelay = code + 1;
     
    535499    sei.m_picDpbOutputDelay = code;
    536500
    537 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    538501    if(hrd->getSubPicCpbParamsPresentFlag())
    539502    {
     
    541504      sei.m_picDpbOutputDuDelay = code;
    542505    }
    543 #endif
    544506    if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() )
    545507    {
     
    575537      }
    576538    }
    577 #if L0045_CONDITION_SIGNALLING
    578   }
    579 #endif
     539  }
    580540  xParseByteAlign();
    581541}
     
    598558  {
    599559    READ_CODE( 7, val, "frame_packing_arrangement_type" );          sei.m_arrangementType = val;
    600 #if L0444_FPA_TYPE
    601560    assert((sei.m_arrangementType > 2) && (sei.m_arrangementType < 6) );
    602 #endif
    603561    READ_FLAG( val, "quincunx_sampling_flag" );                     sei.m_quincunxSamplingFlag = val;
    604562
     
    620578
    621579    READ_CODE( 8, val, "frame_packing_arrangement_reserved_byte" );   sei.m_arrangementReservedByte = val;
    622 #if L0045_PERSISTENCE_FLAGS
    623580    READ_FLAG( val,  "frame_packing_arrangement_persistence_flag" );  sei.m_arrangementPersistenceFlag = val ? true : false;
    624 #else
    625     READ_UVLC( val, "frame_packing_arrangement_repetition_period" );  sei.m_arrangementRepetetionPeriod = val;
    626 #endif
    627581  }
    628582  READ_FLAG( val, "upsampled_aspect_ratio" );                       sei.m_upsampledAspectRatio = val;
     
    640594    READ_FLAG( val,     "ver_flip" );                              sei.verFlip               = val;
    641595    READ_CODE( 16, val, "anticlockwise_rotation" );                sei.anticlockwiseRotation = val;
    642 #if L0045_PERSISTENCE_FLAGS
    643596    READ_FLAG( val,     "display_orientation_persistence_flag" );  sei.persistenceFlag       = val;
    644 #else
    645     READ_UVLC( val,     "display_orientation_repetition_period" ); sei.repetitionPeriod      = val;
    646 #endif
    647 #if !REMOVE_SINGLE_SEI_EXTENSION_FLAGS
    648     READ_FLAG( val,     "display_orientation_extension_flag" );    sei.extensionFlag         = val;
    649     assert( !sei.extensionFlag );
    650 #endif
    651597  }
    652598  xParseByteAlign();
     
    668614}
    669615
    670 #if J0149_TONE_MAPPING_SEI
    671616Void SEIReader::xParseSEIToneMappingInfo(SEIToneMappingInfo& sei, UInt /*payloadSize*/)
    672617{
     
    749694  xParseByteAlign();
    750695}
    751 #endif
    752 
    753 #if L0208_SOP_DESCRIPTION_SEI
     696
    754697Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize)
    755698{
     
    775718  xParseByteAlign();
    776719}
    777 #endif
    778 
    779 #if K0180_SCALABLE_NESTING_SEI
     720
    780721Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps)
    781722{
     
    824765
    825766}
    826 #endif
    827767
    828768Void SEIReader::xParseByteAlign()
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/SEIread.h

    r446 r537  
    7070  Void xParseSEITemporalLevel0Index   (SEITemporalLevel0Index &sei, UInt payloadSize);
    7171  Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize);
    72 #if J0149_TONE_MAPPING_SEI
    7372  Void xParseSEIToneMappingInfo       (SEIToneMappingInfo& sei, UInt payloadSize);
    74 #endif
    75 #if L0208_SOP_DESCRIPTION_SEI
    7673  Void xParseSEISOPDescription        (SEISOPDescription &sei, UInt payloadSize);
    77 #endif
    78 #if K0180_SCALABLE_NESTING_SEI
    7974  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps);
    80 #endif
    8175  Void xParseByteAlign();
    8276};
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoder.h

    r324 r537  
    5454  virtual Void  start             ()                                          = 0;
    5555  virtual Void  finish            ()                                          = 0;
    56   virtual Void  flush            ()                                           = 0;
    5756
    5857  virtual Void  decodeBin         ( UInt& ruiBin, ContextModel& rcCtxModel )  = 0;
     
    6160  virtual Void  decodeBinTrm      ( UInt& ruiBin                           )  = 0;
    6261 
    63   virtual Void  resetBac          ()                                          = 0;
    64   virtual Void  decodePCMAlignBits()                                          = 0;
    6562  virtual Void  xReadPCMCode      ( UInt uiLength, UInt& ruiCode)              = 0;
    6663
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp

    r521 r537  
    7676TDecBinCABAC::finish()
    7777{
    78 }
    79 
    80 Void
    81 TDecBinCABAC::flush()
    82 {
    83   while (m_pcTComBitstream->getNumBitsLeft() > 0 && m_pcTComBitstream->getNumBitsUntilByteAligned() != 0)
    84   {
    85     UInt uiBits;
    86     m_pcTComBitstream->read ( 1, uiBits );
    87   }
    88   start();
     78  UInt lastByte;
     79
     80  m_pcTComBitstream->peekPreviousByte( lastByte );
     81  // Check for proper stop/alignment pattern
     82  assert( ((lastByte << (8 + m_bitsNeeded)) & 0xff) == 0x80 );
    8983}
    9084
     
    242236}
    243237
    244 /** Reset BAC register values.
    245  * \returns Void
    246  */
    247 Void TDecBinCABAC::resetBac()
    248 {
    249   m_uiRange    = 510;
    250   m_bitsNeeded = -8;
    251   m_uiValue    = m_pcTComBitstream->read( 16 );
    252 }
    253 
    254 /** Decode PCM alignment zero bits.
    255  * \returns Void
    256  */
    257 Void TDecBinCABAC::decodePCMAlignBits()
    258 {
    259   Int iNum = m_pcTComBitstream->getNumBitsUntilByteAligned();
    260  
    261   UInt uiBit = 0;
    262   m_pcTComBitstream->read( iNum, uiBit );
    263 #if H_MV_ENC_DEC_TRAC         
    264   DTRACE_CU("Number of pcm_alignment_zero_bit", iNum)
    265 #endif
    266 }
    267 
    268238/** Read a PCM code.
    269239 * \param uiLength code bit-depth
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecBinCoderCABAC.h

    r324 r537  
    5656  Void  start             ();
    5757  Void  finish            ();
    58   Void  flush             ();
    5958 
    6059  Void  decodeBin         ( UInt& ruiBin, ContextModel& rcCtxModel );
     
    6362  Void  decodeBinTrm      ( UInt& ruiBin                           );
    6463 
    65   Void  resetBac          ();
    66   Void  decodePCMAlignBits();
    6764  Void  xReadPCMCode      ( UInt uiLength, UInt& ruiCode );
    6865 
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r536 r537  
    224224  Int   iCode;
    225225
    226   READ_UVLC( uiCode, "pps_pic_parameter_set_id");                     pcPPS->setPPSId (uiCode);
    227   READ_UVLC( uiCode, "pps_seq_parameter_set_id");                     pcPPS->setSPSId (uiCode);
     226  READ_UVLC( uiCode, "pps_pic_parameter_set_id");
     227  assert(uiCode <= 63);
     228  pcPPS->setPPSId (uiCode);
     229 
     230  READ_UVLC( uiCode, "pps_seq_parameter_set_id");
     231  assert(uiCode <= 15);
     232  pcPPS->setSPSId (uiCode);
     233 
    228234  READ_FLAG( uiCode, "dependent_slice_segments_enabled_flag"    );    pcPPS->setDependentSliceSegmentsEnabledFlag   ( uiCode == 1 );
    229 #if L0255_MOVE_PPS_FLAGS
    230235  READ_FLAG( uiCode, "output_flag_present_flag" );                    pcPPS->setOutputFlagPresentFlag( uiCode==1 );
    231236
    232237  READ_CODE(3, uiCode, "num_extra_slice_header_bits");                pcPPS->setNumExtraSliceHeaderBits(uiCode);
    233 #endif
    234238  READ_FLAG ( uiCode, "sign_data_hiding_flag" ); pcPPS->setSignHideFlag( uiCode );
    235239
    236240  READ_FLAG( uiCode,   "cabac_init_present_flag" );            pcPPS->setCabacInitPresentFlag( uiCode ? true : false );
    237241
    238 #if L0323_LIMIT_DEFAULT_LIST_SIZE
    239242  READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1");
    240243  assert(uiCode <= 14);
     
    244247  assert(uiCode <= 14);
    245248  pcPPS->setNumRefIdxL1DefaultActive(uiCode+1);
    246 #else
    247   READ_UVLC(uiCode, "num_ref_idx_l0_default_active_minus1");       pcPPS->setNumRefIdxL0DefaultActive(uiCode+1);
    248   READ_UVLC(uiCode, "num_ref_idx_l1_default_active_minus1");       pcPPS->setNumRefIdxL1DefaultActive(uiCode+1);
    249 #endif
    250249 
    251250  READ_SVLC(iCode, "init_qp_minus26" );                            pcPPS->setPicInitQPMinus26(iCode);
     
    282281  pcPPS->setWPBiPred( uiCode==1 );
    283282
    284 #if !L0255_MOVE_PPS_FLAGS
    285   READ_FLAG( uiCode, "output_flag_present_flag" );
    286   pcPPS->setOutputFlagPresentFlag( uiCode==1 );
    287 #endif
    288283  READ_FLAG( uiCode, "transquant_bypass_enable_flag");
    289284  pcPPS->setTransquantBypassEnableFlag(uiCode ? true : false);
     
    347342  pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode);
    348343
    349 #if !L0255_MOVE_PPS_FLAGS
    350   READ_CODE(3, uiCode, "num_extra_slice_header_bits");
    351   pcPPS->setNumExtraSliceHeaderBits(uiCode);
    352 #endif
    353344  READ_FLAG( uiCode, "slice_segment_header_extension_present_flag");
    354345  pcPPS->setSliceHeaderExtensionPresentFlag(uiCode);
     
    424415    READ_UVLC(   uiCode, "def_disp_win_bottom_offset" );              defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );
    425416  }
    426 #if L0043_TIMING_INFO
    427417  TimingInfo *timingInfo = pcVUI->getTimingInfo();
    428418  READ_FLAG(       uiCode, "vui_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
     
    436426      READ_UVLC(   uiCode, "vui_num_ticks_poc_diff_one_minus1");    timingInfo->setNumTicksPocDiffOneMinus1   (uiCode);
    437427    }
    438 #endif 
    439428  READ_FLAG(     uiCode, "hrd_parameters_present_flag");              pcVUI->setHrdParametersPresentFlag(uiCode);
    440429  if( pcVUI->getHrdParametersPresentFlag() )
     
    442431    parseHrdParameters( pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 );
    443432  }
    444 #if L0043_TIMING_INFO
    445   }
    446 #endif
    447 #if !L0043_TIMING_INFO
    448   READ_FLAG( uiCode, "poc_proportional_to_timing_flag" ); pcVUI->setPocProportionalToTimingFlag(uiCode ? true : false);
    449   if( pcVUI->getPocProportionalToTimingFlag() && pcVUI->getHrdParameters()->getTimingInfoPresentFlag() )
    450   {
    451     READ_UVLC( uiCode, "num_ticks_poc_diff_one_minus1" ); pcVUI->setNumTicksPocDiffOneMinus1(uiCode);
    452   }
    453 #endif
     433  }
    454434  READ_FLAG(     uiCode, "bitstream_restriction_flag");               pcVUI->setBitstreamRestrictionFlag(uiCode);
    455435  if (pcVUI->getBitstreamRestrictionFlag())
     
    464444    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
    465445    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
    466 #if L0043_MSS_IDC
    467446    READ_UVLC( uiCode, "min_spatial_segmentation_idc");            pcVUI->setMinSpatialSegmentationIdc(uiCode);
    468447    assert(uiCode < 4096);
    469 #else
    470     READ_CODE( 8, uiCode, "min_spatial_segmentation_idc");            pcVUI->setMinSpatialSegmentationIdc(uiCode);
    471 #endif
    472448    READ_UVLC(   uiCode, "max_bytes_per_pic_denom" );                 pcVUI->setMaxBytesPerPicDenom(uiCode);
    473449    READ_UVLC(   uiCode, "max_bits_per_mincu_denom" );                pcVUI->setMaxBitsPerMinCuDenom(uiCode);
     
    482458  if( commonInfPresentFlag )
    483459  {
    484 #if !L0043_TIMING_INFO
    485     READ_FLAG( uiCode, "timing_info_present_flag" );                  hrd->setTimingInfoPresentFlag( uiCode == 1 ? true : false );
    486     if( hrd->getTimingInfoPresentFlag() )
    487     {
    488       READ_CODE( 32, uiCode, "num_units_in_tick" );                   hrd->setNumUnitsInTick( uiCode );
    489       READ_CODE( 32, uiCode, "time_scale" );                          hrd->setTimeScale( uiCode );
    490     }
    491 #endif
    492460    READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" );           hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false );
    493461    READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" );           hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false );
     
    500468        READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode );
    501469        READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false );
    502 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    503470        READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1"  ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode );
    504 #endif
    505471      }
    506472      READ_CODE( 4, uiCode, "bit_rate_scale" );                       hrd->setBitRateScale( uiCode );
     
    527493      hrd->setFixedPicRateWithinCvsFlag( i, true );
    528494    }
    529 #if L0372
    530495    hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present
    531496    hrd->setCpbCntMinus1   ( i, 0 ); // Infered to be 0 when not present
    532 #endif
    533497    if( hrd->getFixedPicRateWithinCvsFlag( i ) )
    534498    {
    535499      READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" );             hrd->setPicDurationInTcMinus1( i, uiCode );
    536500    }
    537 #if L0372
    538501    else
    539502    {     
     
    544507      READ_UVLC( uiCode, "cpb_cnt_minus1" );                          hrd->setCpbCntMinus1( i, uiCode );     
    545508    }
    546 #else
    547     READ_FLAG( uiCode, "low_delay_hrd_flag" );                      hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false  );
    548     READ_UVLC( uiCode, "cpb_cnt_minus1" );                          hrd->setCpbCntMinus1( i, uiCode );
    549 #endif
    550509    for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    551510    {
     
    559518          if( hrd->getSubPicCpbParamsPresentFlag() )
    560519          {
    561 #if L0363_DU_BIT_RATE
     520            READ_UVLC( uiCode, "cpb_size_du_value_minus1" );       hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode );
    562521            READ_UVLC( uiCode, "bit_rate_du_value_minus1" );       hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode );
    563 #endif
    564             READ_UVLC( uiCode, "cpb_size_du_value_minus1" );       hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode );
    565522          }
    566523          READ_FLAG( uiCode, "cbr_flag" );                          hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false  );
     
    588545#endif
    589546  READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
     547  assert(uiCode <= 6);
     548 
    590549  READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
    591550  if ( pcSPS->getMaxTLayers() == 1 )
     
    594553    assert( uiCode == 1 );
    595554  }
     555 
    596556  parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
    597557#if H_MV
     
    599559#endif
    600560  READ_UVLC(     uiCode, "sps_seq_parameter_set_id" );           pcSPS->setSPSId( uiCode );
     561  assert(uiCode <= 15);
     562 
    601563  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
     564  assert(uiCode <= 3);
    602565  // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
    603566  assert (uiCode == 1);
     
    620583
    621584  READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
     585  assert(uiCode <= 6);
    622586  pcSPS->setBitDepthY( uiCode + 8 );
    623587  pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
    624588
    625589  READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
     590  assert(uiCode <= 6);
    626591  pcSPS->setBitDepthC( uiCode + 8 );
    627592  pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
    628593
    629594  READ_UVLC( uiCode,    "log2_max_pic_order_cnt_lsb_minus4" );   pcSPS->setBitsForPOC( 4 + uiCode );
     595  assert(uiCode <= 12);
    630596
    631597  UInt subLayerOrderingInfoPresentFlag;
    632598  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
     599 
    633600  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    634601  {
    635 #if L0323_DPB
    636602#if H_MV
    637603    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
     
    640606#endif
    641607    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    642 #else
    643     READ_UVLC ( uiCode, "sps_max_dec_pic_buffering");
    644     pcSPS->setMaxDecPicBuffering( uiCode, i);
    645 #endif
    646608#if H_MV
    647609    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
     
    711673
    712674  READ_UVLC( uiCode, "num_short_term_ref_pic_sets" );
     675  assert(uiCode <= 64);
    713676  pcSPS->createRPSList(uiCode);
    714677
     
    838801#endif
    839802  parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
    840 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    841   parseBitratePicRateInfo( pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1);
    842 #endif
    843803  UInt subLayerOrderingInfoPresentFlag;
    844804  READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag");
    845805  for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
    846806  {
    847 #if L0323_DPB
    848807    READ_UVLC( uiCode,  "vps_max_dec_pic_buffering_minus1[i]" );     pcVPS->setMaxDecPicBuffering( uiCode + 1, i );
    849 #else
    850     READ_UVLC( uiCode,  "vps_max_dec_pic_buffering[i]" );     pcVPS->setMaxDecPicBuffering( uiCode, i );
    851 #endif
    852808    READ_UVLC( uiCode,  "vps_num_reorder_pics[i]" );          pcVPS->setNumReorderPics( uiCode, i );
    853     READ_UVLC( uiCode,  "vps_max_latency_increase[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
     809    READ_UVLC( uiCode,  "vps_max_latency_increase_plus1[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
    854810
    855811    if (!subLayerOrderingInfoPresentFlag)
     
    887843    }
    888844  }
    889 #if L0043_TIMING_INFO
    890845  TimingInfo *timingInfo = pcVPS->getTimingInfo();
    891846  READ_FLAG(       uiCode, "vps_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
     
    899854      READ_UVLC(   uiCode, "vps_num_ticks_poc_diff_one_minus1");    timingInfo->setNumTicksPocDiffOneMinus1   (uiCode);
    900855    }
    901 #endif
    902856    READ_UVLC( uiCode, "vps_num_hrd_parameters" );                  pcVPS->setNumHrdParameters( uiCode );
    903857
     
    915869      parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
    916870    }
    917 #if L0043_TIMING_INFO
    918   }
    919 #endif
     871  }
    920872  READ_FLAG( uiCode,  "vps_extension_flag" );
    921873  if (uiCode)
     
    13111263          uiCode = 0;
    13121264        }
    1313         memcpy(rps,sps->getRPSList()->getReferencePictureSet(uiCode),sizeof(TComReferencePictureSet));
     1265        *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode));
    13141266      }
    13151267      if(sps->getLongTermRefsPresent())
     
    17361688    for (UInt idx=0; idx<numEntryPointOffsets; idx++)
    17371689    {
    1738 #if L0116_ENTRY_POINT
    17391690      READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset_minus1");
    17401691      entryPointOffset[ idx ] = uiCode + 1;
    1741 #else
    1742       READ_CODE(offsetLenMinus1+1, uiCode, "entry_point_offset");
    1743       entryPointOffset[ idx ] = uiCode;
    1744 #endif
    17451692    }
    17461693  }
     
    17911738  {
    17921739    Int endOfSliceHeaderLocation = m_pcBitstream->getByteLocation();
     1740   
     1741    // Adjust endOfSliceHeaderLocation to account for emulation prevention bytes in the slice segment header
     1742    for ( UInt curByteIdx  = 0; curByteIdx<m_pcBitstream->numEmulationPreventionBytesRead(); curByteIdx++ )
     1743    {
     1744      if ( m_pcBitstream->getEmulationPreventionByteLocation( curByteIdx ) < endOfSliceHeaderLocation )
     1745      {
     1746        endOfSliceHeaderLocation++;
     1747      }
     1748    }
     1749
    17931750    Int  curEntryPointOffset     = 0;
    17941751    Int  prevEntryPointOffset    = 0;
     
    18581815  READ_CODE( 8, uiCode, "general_level_idc" );    rpcPTL->getGeneralPTL()->setLevelIdc(uiCode);
    18591816
    1860 #if L0363_BYTE_ALIGN
    18611817  for (Int i = 0; i < maxNumSubLayersMinus1; i++)
    18621818  {
     
    18821838    }
    18831839  }
    1884 #endif
    18851840 
    18861841  for(Int i = 0; i < maxNumSubLayersMinus1; i++)
    18871842  {
    1888 #if !L0363_BYTE_ALIGN
    1889     if(profilePresentFlag)
    1890     {
    1891       READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode);
    1892     }
    1893     READ_FLAG( uiCode, "sub_layer_level_present_flag[i]"   ); rpcPTL->setSubLayerLevelPresentFlag  (i, uiCode);
    1894 #endif
    18951843    if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) )
    18961844    {
     
    19141862    READ_FLAG(  uiCode, "XXX_profile_compatibility_flag[][j]");   ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0);
    19151863  }
    1916 #if L0046_CONSTRAINT_FLAGS
    19171864  READ_FLAG(uiCode, "general_progressive_source_flag");
    19181865  ptl->setProgressiveSourceFlag(uiCode ? true : false);
     
    19301877  READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]");
    19311878  READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]");
    1932 #elif L0363_MORE_BITS
    1933   READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[0..15]");
    1934   READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[16..31]");
    1935   READ_CODE(16, uiCode, "XXX_reserved_zero_48bits[32..47]");
    1936 #else
    1937   READ_CODE(16, uiCode, "XXX_reserved_zero_16bits[]");  assert( uiCode == 0 );
    1938 #endif
    1939 }
    1940 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    1941 Void TDecCavlc::parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh)
    1942 {
    1943   UInt uiCode;
    1944   for(Int i = tempLevelLow; i <= tempLevelHigh; i++)
    1945   {
    1946     READ_FLAG( uiCode, "bit_rate_info_present_flag[i]" ); info->setBitRateInfoPresentFlag(i, uiCode ? true : false);
    1947     READ_FLAG( uiCode, "pic_rate_info_present_flag[i]" ); info->setPicRateInfoPresentFlag(i, uiCode ? true : false);
    1948     if(info->getBitRateInfoPresentFlag(i))
    1949     {
    1950       READ_CODE( 16, uiCode, "avg_bit_rate[i]" ); info->setAvgBitRate(i, uiCode);
    1951       READ_CODE( 16, uiCode, "max_bit_rate[i]" ); info->setMaxBitRate(i, uiCode);
    1952     }
    1953     if(info->getPicRateInfoPresentFlag(i))
    1954     {
    1955       READ_CODE(  2, uiCode,  "constant_pic_rate_idc[i]" ); info->setConstantPicRateIdc(i, uiCode);
    1956       READ_CODE( 16, uiCode,  "avg_pic_rate[i]"          ); info->setAvgPicRate(i, uiCode);
    1957     }
    1958   }
    1959 }
    1960 #endif 
     1879}
     1880
    19611881Void TDecCavlc::parseTerminatingBit( UInt& ruiBit )
    19621882{
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecCAVLC.h

    r504 r537  
    8686  Void  parsePTL            ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 );
    8787  Void  parseProfileTier    (ProfileTierLevel *ptl);
    88 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    89   Void  parseBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh);
    90 #endif
    9188  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
    9289  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager);
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSbac.cpp

    r531 r537  
    166166  m_cTransformSkipSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_TRANSFORMSKIP_FLAG );
    167167  m_CUTransquantBypassFlagSCModel.initBuffer( sliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
    168 
    169168#if H_3D_DIM
    170169  m_cDepthIntraModeSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE );
     
    184183#endif
    185184#endif
    186 
    187185  m_uiLastDQpNonZero  = 0;
    188186 
     
    200198  UInt uiBit;
    201199  m_pcTDecBinIf->decodeBinTrm(uiBit);
     200  assert(uiBit); // end_of_sub_stream_one_bit must be equal to 1
    202201  m_pcTDecBinIf->finish(); 
    203202  m_pcBitstream->readOutTrailingBits();
     
    259258{
    260259  m_pcTDecBinIf->decodeBinTrm( ruiBit );
     260  if ( ruiBit )
     261  {
     262    m_pcTDecBinIf->finish();
     263  }
    261264}
    262265
     
    613616{
    614617  UInt uiSymbol;
    615   Bool readPCMSampleFlag = false;
    616618
    617619    m_pcTDecBinIf->decodeBinTrm(uiSymbol);
     
    622624    if (uiSymbol)
    623625    {
    624       readPCMSampleFlag = true;
    625       m_pcTDecBinIf->decodePCMAlignBits();
    626     }
    627 
    628   if (readPCMSampleFlag == true)
    629   {
    630626    Bool bIpcmFlag = true;
    631627
     
    693689    }
    694690
    695       m_pcTDecBinIf->resetBac();
     691    m_pcTDecBinIf->start();
    696692  }
    697693}
     
    1003999    else
    10041000    {
    1005       intraPredMode = 0;
    10061001      m_pcTDecBinIf->decodeBinsEP( symbol, 5 );
    10071002      intraPredMode = symbol;
     
    14441439  else
    14451440  {
    1446     iDQp=0;
    14471441    qp = pcCU->getRefQP(uiAbsPartIdx);
    14481442  }
     
    16341628
    16351629  //===== decode significance flags =====
    1636   UInt uiScanPosLast = uiBlkPosLast;
     1630  UInt uiScanPosLast;
    16371631  const UInt *scan   = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize-1 ];
    16381632  for( uiScanPosLast = 0; uiScanPosLast < uiMaxNumCoeffM1; uiScanPosLast++ )
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecSlice.cpp

    r521 r537  
    372372    pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);
    373373
     374    if ( uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU()
     375        && pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()
     376        && !uiIsLast )
     377    {
     378      // Parse end_of_substream_one_bit for WPP case
     379      UInt binVal;
     380      pcSbacDecoder->parseTerminatingBit( binVal );
     381      assert( binVal );
     382    }
     383
    374384    //Store probabilities of second LCU in line into buffer
    375385    if ( (uiCol == uiTileLCUX+1)&& (depSliceSegmentsEnabled || (pcSlice->getPPS()->getNumSubstreams() > 1)) && (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag()) )
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibDecoder/TDecTop.cpp

    r534 r537  
    441441  }
    442442
    443 #if L0323_DPB
    444   m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    445 #else
    446   m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()) + 1; // +1 to have space for the picture currently being decoded
    447 #endif
     443  m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    448444  if (m_cListPic.size() < (UInt)m_iMaxRefPicNum)
    449445  {
     
    964960    //---------------
    965961    pcSlice->setRefPOCList();
    966 #if !L0034_COMBINED_LIST_CLEANUP
    967     pcSlice->setNoBackPredFlag( false );
    968     if ( pcSlice->getSliceType() == B_SLICE )
    969     {
    970       if ( pcSlice->getNumRefIdx(RefPicList( 0 ) ) == pcSlice->getNumRefIdx(RefPicList( 1 ) ) )
    971       {
    972         pcSlice->setNoBackPredFlag( true );
    973         for ( i=0; i < pcSlice->getNumRefIdx(RefPicList( 1 ) ); i++ )
    974         {
    975           if ( pcSlice->getRefPOC(RefPicList(1), i) != pcSlice->getRefPOC(RefPicList(0), i) )
    976           {
    977             pcSlice->setNoBackPredFlag( false );
    978             break;
    979           }
    980         }
    981       }
    982     }
    983 #endif
    984962#if  H_3D_TMVP
    985963    if(pcSlice->getLayerId())
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/SEIwrite.cpp

    r446 r537  
    8484    fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n");
    8585    break;
    86 #if J0149_TONE_MAPPING_SEI
    8786  case SEI::TONE_MAPPING_INFO:
    8887    fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n");
    8988    break;
    90 #endif
    91 #if L0208_SOP_DESCRIPTION_SEI
    9289  case SEI::SOP_DESCRIPTION:
    9390    fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n");
    9491    break;
    95 #endif
    96 #if K0180_SCALABLE_NESTING_SEI
    9792  case SEI::SCALABLE_NESTING:
    9893    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
    9994    break;
    100 #endif
    10195  default:
    10296    fprintf( g_hTrace, "=========== Unknown SEI message ===========\n");
     
    106100#endif
    107101
    108 #if K0180_SCALABLE_NESTING_SEI
    109102void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)
    110 #else
    111 void SEIWriter::xWriteSEIpayloadData(const SEI& sei, TComSPS *sps)
    112 #endif
    113103{
    114104  switch (sei.payloadType())
     
    147137    xWriteSEIGradualDecodingRefreshInfo(*static_cast<const SEIGradualDecodingRefreshInfo*>(&sei));
    148138    break;
    149 #if J0149_TONE_MAPPING_SEI
    150139  case SEI::TONE_MAPPING_INFO:
    151140    xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei));
    152141    break;
    153 #endif
    154 #if L0208_SOP_DESCRIPTION_SEI
    155142  case SEI::SOP_DESCRIPTION:
    156143    xWriteSEISOPDescription(*static_cast<const SEISOPDescription*>(&sei));
    157144    break;
    158 #endif
    159 #if K0180_SCALABLE_NESTING_SEI
    160145  case SEI::SCALABLE_NESTING:
    161146    xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps);
    162147    break;
    163 #endif
    164148  default:
    165149    assert(!"Unhandled SEI message");
     
    179163  setBitstream(&bs_count);
    180164
    181 
    182 #if K0180_SCALABLE_NESTING_SEI
    183165
    184166#if ENC_DEC_TRACE
     
    191173#endif
    192174
    193 #else
    194 
    195 #if ENC_DEC_TRACE
    196   g_HLSTraceEnable = false;
    197 #endif
    198   xWriteSEIpayloadData(sei, sps);
    199 #if ENC_DEC_TRACE
    200   g_HLSTraceEnable = true;
    201 #endif
    202 
    203 #endif
    204 
    205175  UInt payload_data_num_bits = bs_count.getNumberOfWrittenBits();
    206176  assert(0 == payload_data_num_bits % 8);
     
    209179
    210180#if ENC_DEC_TRACE
    211 #if K0180_SCALABLE_NESTING_SEI
    212181  if (g_HLSTraceEnable)
    213 #endif
    214182  xTraceSEIHeader();
    215183#endif
     
    231199  /* payloadData */
    232200#if ENC_DEC_TRACE
    233 #if K0180_SCALABLE_NESTING_SEI
    234201  if (g_HLSTraceEnable)
    235 #endif
    236202  xTraceSEIMessageType(sei.payloadType());
    237203#endif
    238204
    239 #if K0180_SCALABLE_NESTING_SEI
    240205  xWriteSEIpayloadData(bs, sei, sps);
    241 #else
    242   xWriteSEIpayloadData(sei, sps);
    243 #endif
    244206}
    245207
     
    296258{
    297259  WRITE_CODE(sei.activeVPSId,     4, "active_vps_id");
    298 #if L0047_APS_FLAGS
    299260  WRITE_FLAG(sei.m_fullRandomAccessFlag, "full_random_access_flag");
    300261  WRITE_FLAG(sei.m_noParamSetUpdateFlag, "no_param_set_update_flag");
    301 #endif
    302262  WRITE_UVLC(sei.numSpsIdsMinus1,    "num_sps_ids_minus1");
    303263
     
    330290    WRITE_CODE( sei.m_duSptCpbRemovalDelay, (vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1), "du_spt_cpb_removal_delay");
    331291  }
    332 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    333292  WRITE_FLAG( sei.m_dpbOutputDuDelayPresentFlag, "dpb_output_du_delay_present_flag");
    334293  if(sei.m_dpbOutputDuDelayPresentFlag)
     
    336295    WRITE_CODE(sei.m_picSptDpbOutputDuDelay, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
    337296  }
    338 #endif
    339297  xWriteByteAlign();
    340298}
     
    351309    WRITE_FLAG( sei.m_rapCpbParamsPresentFlag, "rap_cpb_params_present_flag" );
    352310  }
    353 #if L0328_SPLICING
    354311  WRITE_FLAG( sei.m_concatenationFlag, "concatenation_flag");
    355312  WRITE_CODE( sei.m_auCpbRemovalDelayDelta - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_delta_minus1" );
    356 #endif
    357 #if L0044_CPB_DPB_DELAY_OFFSET
    358313  if( sei.m_rapCpbParamsPresentFlag )
    359314  {
     
    361316    WRITE_CODE( sei.m_dpbDelayOffset, hrd->getDpbOutputDelayLengthMinus1()  + 1, "dpb_delay_offset" );
    362317  }
    363 #endif
    364318  for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
    365319  {
     
    387341  TComHRD *hrd = vui->getHrdParameters();
    388342
    389 #if !L0045_CONDITION_SIGNALLING
    390   // This condition was probably OK before the pic_struct, progressive_source_idc, duplicate_flag were added
    391   if( !hrd->getNalHrdParametersPresentFlag() && !hrd->getVclHrdParametersPresentFlag() )
    392     return;
    393 #endif
    394343  if( vui->getFrameFieldInfoPresentFlag() )
    395344  {
    396345    WRITE_CODE( sei.m_picStruct, 4,              "pic_struct" );
    397 #if L0046_RENAME_PROG_SRC_IDC
    398346    WRITE_CODE( sei.m_sourceScanType, 2,         "source_scan_type" );
    399 #else
    400     WRITE_CODE( sei.m_progressiveSourceIdc, 2,   "progressive_source_idc" );
    401 #endif
    402347    WRITE_FLAG( sei.m_duplicateFlag ? 1 : 0,     "duplicate_flag" );
    403348  }
    404349
    405 #if L0045_CONDITION_SIGNALLING
    406350  if( hrd->getCpbDpbDelaysPresentFlag() )
    407351  {
    408 #endif
    409352    WRITE_CODE( sei.m_auCpbRemovalDelay - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ),                                         "au_cpb_removal_delay_minus1" );
    410353    WRITE_CODE( sei.m_picDpbOutputDelay, ( hrd->getDpbOutputDelayLengthMinus1() + 1 ),                                          "pic_dpb_output_delay" );
    411 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    412354    if(hrd->getSubPicCpbParamsPresentFlag())
    413355    {
    414356      WRITE_CODE(sei.m_picDpbOutputDuDelay, hrd->getDpbOutputDelayDuLengthMinus1()+1, "pic_dpb_output_du_delay" );
    415357    }
    416 #endif
    417358    if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() )
    418359    {
     
    432373      }
    433374    }
    434 #if L0045_CONDITION_SIGNALLING
    435   }
    436 #endif
     375  }
    437376  xWriteByteAlign();
    438377}
     
    471410
    472411    WRITE_CODE( sei.m_arrangementReservedByte, 8,   "frame_packing_arrangement_reserved_byte" );
    473 #if L0045_PERSISTENCE_FLAGS
    474412    WRITE_FLAG( sei.m_arrangementPersistenceFlag,   "frame_packing_arrangement_persistence_flag" );
    475 #else
    476     WRITE_UVLC( sei.m_arrangementRepetetionPeriod,  "frame_packing_arrangement_repetition_period" );
    477 #endif
    478413  }
    479414
     
    483418}
    484419
    485 #if J0149_TONE_MAPPING_SEI
    486420Void SEIWriter::xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei)
    487421{
     
    555489  xWriteByteAlign();
    556490}
    557 #endif
    558491
    559492Void SEIWriter::xWriteSEIDisplayOrientation(const SEIDisplayOrientation &sei)
     
    565498    WRITE_FLAG( sei.verFlip,                   "ver_flip" );
    566499    WRITE_CODE( sei.anticlockwiseRotation, 16, "anticlockwise_rotation" );
    567 #if L0045_PERSISTENCE_FLAGS
    568500    WRITE_FLAG( sei.persistenceFlag,          "display_orientation_persistence_flag" );
    569 #else
    570     WRITE_UVLC( sei.repetitionPeriod,          "display_orientation_repetition_period" );
    571 #endif
    572 #if !REMOVE_SINGLE_SEI_EXTENSION_FLAGS
    573     WRITE_FLAG( sei.extensionFlag,             "display_orientation_extension_flag" );
    574     assert( !sei.extensionFlag );
    575 #endif
    576501  }
    577502  xWriteByteAlign();
     
    591516}
    592517
    593 #if L0208_SOP_DESCRIPTION_SEI
    594518Void SEIWriter::xWriteSEISOPDescription(const SEISOPDescription& sei)
    595519{
     
    612536  xWriteByteAlign();
    613537}
    614 #endif
    615 
    616 #if K0180_SCALABLE_NESTING_SEI
     538
    617539Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)
    618540{
     
    656578  }
    657579}
    658 #endif
    659580
    660581Void SEIWriter::xWriteByteAlign()
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/SEIwrite.h

    r446 r537  
    5050
    5151protected:
    52 #if K0180_SCALABLE_NESTING_SEI
    5352  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps);
    54 #else
    55   Void xWriteSEIpayloadData(const SEI& sei, TComSPS *sps);
    56 #endif
    5753  Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei);
    5854  Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei);
     
    6763  Void xWriteSEITemporalLevel0Index(const SEITemporalLevel0Index &sei);
    6864  Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei);
    69 #if J0149_TONE_MAPPING_SEI
    7065  Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei);
    71 #endif
    72 #if L0208_SOP_DESCRIPTION_SEI
    7366  Void xWriteSEISOPDescription(const SEISOPDescription& sei);
    74 #endif
    75 #if K0180_SCALABLE_NESTING_SEI
    7667  Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);
    77 #endif
    7868  Void xWriteByteAlign();
    7969};
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp

    r534 r537  
    172172  WRITE_UVLC( pcPPS->getSPSId(),                             "pps_seq_parameter_set_id" );
    173173  WRITE_FLAG( pcPPS->getDependentSliceSegmentsEnabledFlag()    ? 1 : 0, "dependent_slice_segments_enabled_flag" );
    174 #if L0255_MOVE_PPS_FLAGS
    175174  WRITE_FLAG( pcPPS->getOutputFlagPresentFlag() ? 1 : 0,     "output_flag_present_flag" );
    176175  WRITE_CODE( pcPPS->getNumExtraSliceHeaderBits(), 3,        "num_extra_slice_header_bits");
    177 #endif
    178176  WRITE_FLAG( pcPPS->getSignHideFlag(), "sign_data_hiding_flag" );
    179177  WRITE_FLAG( pcPPS->getCabacInitPresentFlag() ? 1 : 0,   "cabac_init_present_flag" );
     
    195193  WRITE_FLAG( pcPPS->getUseWP() ? 1 : 0,  "weighted_pred_flag" );   // Use of Weighting Prediction (P_SLICE)
    196194  WRITE_FLAG( pcPPS->getWPBiPred() ? 1 : 0, "weighted_bipred_flag" );  // Use of Weighting Bi-Prediction (B_SLICE)
    197 #if !L0255_MOVE_PPS_FLAGS
    198   WRITE_FLAG( pcPPS->getOutputFlagPresentFlag() ? 1 : 0,  "output_flag_present_flag" );
    199 #endif
    200195  WRITE_FLAG( pcPPS->getTransquantBypassEnableFlag() ? 1 : 0, "transquant_bypass_enable_flag" );
    201196  WRITE_FLAG( pcPPS->getTilesEnabledFlag()             ? 1 : 0, "tiles_enabled_flag" );
     
    244239  WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag");
    245240  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
    246 #if !L0255_MOVE_PPS_FLAGS
    247   WRITE_CODE( pcPPS->getNumExtraSliceHeaderBits(), 3, "num_extra_slice_header_bits");
    248 #endif
    249241  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
    250242  WRITE_FLAG( 0, "pps_extension_flag" );
     
    305297    WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset(),    "def_disp_win_bottom_offset");
    306298  }
    307 #if L0043_TIMING_INFO
    308299  TimingInfo *timingInfo = pcVUI->getTimingInfo();
    309300  WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(),          "vui_timing_info_present_flag");
     
    317308      WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(),   "vui_num_ticks_poc_diff_one_minus1");
    318309    }
    319 #endif
    320310  WRITE_FLAG(pcVUI->getHrdParametersPresentFlag(),              "hrd_parameters_present_flag");
    321311  if( pcVUI->getHrdParametersPresentFlag() )
     
    323313    codeHrdParameters(pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 );
    324314  }
    325 #if L0043_TIMING_INFO
    326   }
    327 #endif
    328 #if !L0043_TIMING_INFO
    329   WRITE_FLAG( pcVUI->getPocProportionalToTimingFlag(), "poc_proportional_to_timing_flag" );
    330   if( pcVUI->getPocProportionalToTimingFlag() && pcVUI->getHrdParameters()->getTimingInfoPresentFlag() )
    331   {
    332     WRITE_UVLC( pcVUI->getNumTicksPocDiffOneMinus1(), "num_ticks_poc_diff_one_minus1" );
    333   }
    334 #endif
     315  }
    335316
    336317  WRITE_FLAG(pcVUI->getBitstreamRestrictionFlag(),              "bitstream_restriction_flag");
     
    346327    WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(),  "motion_vectors_over_pic_boundaries_flag");
    347328    WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(),           "restricted_ref_pic_lists_flag");
    348 #if L0043_MSS_IDC
    349329    WRITE_UVLC(pcVUI->getMinSpatialSegmentationIdc(),           "min_spatial_segmentation_idc");
    350 #else
    351     WRITE_CODE(pcVUI->getMinSpatialSegmentationIdc(),        8, "min_spatial_segmentation_idc");
    352 #endif
    353330    WRITE_UVLC(pcVUI->getMaxBytesPerPicDenom(),                 "max_bytes_per_pic_denom");
    354331    WRITE_UVLC(pcVUI->getMaxBitsPerMinCuDenom(),                "max_bits_per_mincu_denom");
     
    362339  if( commonInfPresentFlag )
    363340  {
    364 #if !L0043_TIMING_INFO
    365     WRITE_FLAG( hrd->getTimingInfoPresentFlag() ? 1 : 0,        "timing_info_present_flag" );
    366     if( hrd->getTimingInfoPresentFlag() )
    367     {
    368       WRITE_CODE( hrd->getNumUnitsInTick(), 32,                  "num_units_in_tick" );
    369       WRITE_CODE( hrd->getTimeScale(),      32,                  "time_scale" );
    370     }
    371 #endif
    372341    WRITE_FLAG( hrd->getNalHrdParametersPresentFlag() ? 1 : 0 ,  "nal_hrd_parameters_present_flag" );
    373342    WRITE_FLAG( hrd->getVclHrdParametersPresentFlag() ? 1 : 0 ,  "vcl_hrd_parameters_present_flag" );
     
    380349        WRITE_CODE( hrd->getDuCpbRemovalDelayLengthMinus1(), 5,  "du_cpb_removal_delay_length_minus1" );
    381350        WRITE_FLAG( hrd->getSubPicCpbParamsInPicTimingSEIFlag() ? 1 : 0, "sub_pic_cpb_params_in_pic_timing_sei_flag" );
    382 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    383351        WRITE_CODE( hrd->getDpbOutputDelayDuLengthMinus1(), 5,   "dpb_output_delay_du_length_minus1"  );
    384 #endif
    385352      }
    386353      WRITE_CODE( hrd->getBitRateScale(), 4,                     "bit_rate_scale" );
     
    411378      WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ),           "elemental_duration_in_tc_minus1");
    412379    }
    413 #if L0372
    414380    else
    415381    {
     
    420386      WRITE_UVLC( hrd->getCpbCntMinus1( i ),                      "cpb_cnt_minus1");
    421387    }
    422 #else
    423     WRITE_FLAG( hrd->getLowDelayHrdFlag( i ) ? 1 : 0,           "low_delay_hrd_flag");
    424     WRITE_UVLC( hrd->getCpbCntMinus1( i ),                      "cpb_cnt_minus1");
    425 #endif
    426388   
    427389    for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ )
     
    436398          if( hrd->getSubPicCpbParamsPresentFlag() )
    437399          {
    438 #if L0363_DU_BIT_RATE
     400            WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1"); 
    439401            WRITE_UVLC( hrd->getDuBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_du_value_minus1");
    440 #endif
    441             WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1"); 
    442402          }
    443403          WRITE_FLAG( hrd->getCbrFlag( i, j, nalOrVcl ) ? 1 : 0, "cbr_flag");
     
    499459  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    500460  {
    501 #if L0323_DPB
    502461    WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i) - 1,       "sps_max_dec_pic_buffering_minus1[i]" );
    503 #else
    504     WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i),           "sps_max_dec_pic_buffering[i]" );
    505 #endif
    506462    WRITE_UVLC( pcSPS->getNumReorderPics(i),               "sps_num_reorder_pics[i]" );
    507     WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i),           "sps_max_latency_increase[i]" );
     463    WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i),           "sps_max_latency_increase_plus1[i]" );
    508464    if (!subLayerOrderingInfoPresentFlag)
    509465    {
     
    642598#endif
    643599  codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 );
    644 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    645   codeBitratePicRateInfo(pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1);
    646 #endif 
    647600  const Bool subLayerOrderingInfoPresentFlag = 1;
    648601  WRITE_FLAG(subLayerOrderingInfoPresentFlag,              "vps_sub_layer_ordering_info_present_flag");
    649602  for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++)
    650603  {
    651 #if L0323_DPB
    652604    WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i) - 1,       "vps_max_dec_pic_buffering_minus1[i]" );
    653 #else
    654     WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i),           "vps_max_dec_pic_buffering[i]" );
    655 #endif
    656605    WRITE_UVLC( pcVPS->getNumReorderPics(i),               "vps_num_reorder_pics[i]" );
    657     WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i),           "vps_max_latency_increase[i]" );
     606    WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i),           "vps_max_latency_increase_plus1[i]" );
    658607    if (!subLayerOrderingInfoPresentFlag)
    659608    {
     
    676625  assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
    677626  WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6,     "vps_max_nuh_reserved_zero_layer_id" );
    678 
    679627  pcVPS->setMaxOpSets(1);
    680628  WRITE_UVLC( pcVPS->getMaxOpSets() - 1,                    "vps_max_op_sets_minus1" );
     
    690638    }
    691639  }
    692 #if L0043_TIMING_INFO
    693640  TimingInfo *timingInfo = pcVPS->getTimingInfo();
    694641  WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(),          "vps_timing_info_present_flag");
     
    702649      WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(),   "vps_num_ticks_poc_diff_one_minus1");
    703650    }
    704 #endif
    705651    pcVPS->setNumHrdParameters( 0 );
    706652    WRITE_UVLC( pcVPS->getNumHrdParameters(),                 "vps_num_hrd_parameters" );
     
    721667      codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
    722668    }
    723 #if L0043_TIMING_INFO
    724   }
    725 #endif
     669  }
    726670#if H_MV
    727671  WRITE_FLAG( 1,                                             "vps_extension_flag" );
     
    983927    //   colour_plane_id                                      u(2)
    984928
    985 #if H_MV && !H_MV_FIX1071
    986     // Temporary fix for FIX1071 should be removed later
    987     TComReferencePictureSet* rps = pcSlice->getRPS();
    988 #endif     
    989929    if( !pcSlice->getIdrPicFlag() )
    990930    {
    991931      Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC());
    992932      WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
    993 #if !H_MV || H_MV_FIX1071
    994933      TComReferencePictureSet* rps = pcSlice->getRPS();
    995 #endif     
    996 #if FIX1071 && H_MV_FIX1071
     934     
     935#if FIX1071
    997936      // check for bitstream restriction stating that:
    998937      // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     
    1006945        }
    1007946#endif
    1008 #if FIX1071 && !H_MV_FIX1071
    1009       // Deal with bitstream restriction stating that:
    1010       // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    1011       // Ideally this process should not be repeated for each slice in a picture
    1012       TComReferencePictureSet altRps;
    1013       Bool useAltRps = false;
    1014       if (pcSlice->getRapPicFlag())
    1015       {
    1016         for (Int picIdx = 0; !useAltRps && picIdx < rps->getNumberOfPictures(); picIdx++)
    1017         {
    1018           useAltRps = rps->getUsed(picIdx);
    1019         }
    1020         if (useAltRps)
    1021         {
    1022           memcpy(&altRps, rps, sizeof(TComReferencePictureSet));
    1023           rps = &altRps;
    1024           for (Int picIdx = 0; picIdx < rps->getNumberOfPictures(); picIdx++)
    1025           {
    1026             rps->setUsed(picIdx, false);
    1027           }
    1028         }
    1029       }
    1030       if(pcSlice->getRPSidx() < 0 || useAltRps)
    1031 #else
     947
    1032948      if(pcSlice->getRPSidx() < 0)
    1033 #endif
    1034949      {
    1035950        WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag");
     
    11881103      pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0);
    11891104    }
    1190 #if H_MV && !H_MV_FIX1071
    1191     // Temporary fix for FIX1071 should be removed later
    1192     if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList( rps ) > 1)
    1193 #else
     1105
    11941106    if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList() > 1)
    1195 #endif
    11961107    {
    11971108      TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
     
    13851296  WRITE_CODE( pcPTL->getGeneralPTL()->getLevelIdc(), 8, "general_level_idc" );
    13861297
    1387 #if L0363_BYTE_ALIGN
    13881298  for (Int i = 0; i < maxNumSubLayersMinus1; i++)
    13891299  {
     
    14071317    }
    14081318  }
    1409 #endif
    14101319 
    14111320  for(Int i = 0; i < maxNumSubLayersMinus1; i++)
    14121321  {
    1413 #if !L0363_BYTE_ALIGN
    1414     if(profilePresentFlag)
    1415     {
    1416       WRITE_FLAG( pcPTL->getSubLayerProfilePresentFlag(i), "sub_layer_profile_present_flag[i]" );
    1417     }
    1418 
    1419     WRITE_FLAG( pcPTL->getSubLayerLevelPresentFlag(i),   "sub_layer_level_present_flag[i]" );
    1420 #endif
    14211322    if( profilePresentFlag && pcPTL->getSubLayerProfilePresentFlag(i) )
    14221323    {
     
    14391340  }
    14401341
    1441 #if L0046_CONSTRAINT_FLAGS
    14421342  WRITE_FLAG(ptl->getProgressiveSourceFlag(),   "general_progressive_source_flag");
    14431343  WRITE_FLAG(ptl->getInterlacedSourceFlag(),    "general_interlaced_source_flag");
     
    14481348  WRITE_CODE(0 , 16, "XXX_reserved_zero_44bits[16..31]");
    14491349  WRITE_CODE(0 , 12, "XXX_reserved_zero_44bits[32..43]");
    1450 #elif L0363_MORE_BITS
    1451   WRITE_CODE(0 , 16, "XXX_reserved_zero_48bits[0..15]");
    1452   WRITE_CODE(0 , 16, "XXX_reserved_zero_48bits[16..31]");
    1453   WRITE_CODE(0 , 16, "XXX_reserved_zero_48bits[32..47]");
    1454 #else
    1455   WRITE_CODE(0 , 16, "XXX_reserved_zero_16bits[]");
    1456 #endif
    1457 }
    1458 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    1459 Void TEncCavlc::codeBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh)
    1460 {
    1461   for(Int i = tempLevelLow; i <= tempLevelHigh; i++)
    1462   {
    1463     WRITE_FLAG( info->getBitRateInfoPresentFlag(i),  "bit_rate_info_present_flag[i]" );
    1464     WRITE_FLAG( info->getPicRateInfoPresentFlag(i),  "pic_rate_info_present_flag[i]" );
    1465     if(info->getBitRateInfoPresentFlag(i))
    1466     {
    1467       WRITE_CODE( info->getAvgBitRate(i), 16, "avg_bit_rate[i]" );
    1468       WRITE_CODE( info->getMaxBitRate(i), 16, "max_bit_rate[i]" );
    1469     }
    1470     if(info->getPicRateInfoPresentFlag(i))
    1471     {
    1472       WRITE_CODE( info->getConstantPicRateIdc(i),  2, "constant_pic_rate_idc[i]" );
    1473       WRITE_CODE( info->getAvgPicRate(i),         16, "avg_pic_rate[i]"          );
    1474     }
    1475   }
    1476 }
    1477 #endif 
     1350    }
     1351
    14781352/**
    14791353 - write wavefront substreams sizes for the slice header.
     
    15451419  for (UInt idx=0; idx<numEntryPointOffsets; idx++)
    15461420  {
    1547 #if L0116_ENTRY_POINT
    15481421    WRITE_CODE(entryPointOffset[ idx ]-1, offsetLenMinus1+1, "entry_point_offset_minus1");
    1549 #else
    1550     WRITE_CODE(entryPointOffset[ idx ], offsetLenMinus1+1, "entry_point_offset");
    1551 #endif
    15521422  }
    15531423
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.h

    r504 r537  
    9494  Void  codePTL                 ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1);
    9595  Void  codeProfileTier         ( ProfileTierLevel* ptl );
    96 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    97   Void codeBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh);
    98 #endif
    9996  Void  codeHrdParameters       ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
    10097  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h

    r534 r537  
    135135  Level::Tier   m_levelTier;
    136136  Level::Name   m_level;
    137 #if L0046_CONSTRAINT_FLAGS
    138137  Bool m_progressiveSourceFlag;
    139138  Bool m_interlacedSourceFlag;
    140139  Bool m_nonPackedConstraintFlag;
    141140  Bool m_frameOnlyConstraintFlag;
    142 #endif
    143141
    144142  //====== Coding Structure ========
     
    177175  Int       m_loopFilterTcOffsetDiv2;
    178176  Bool      m_DeblockingFilterControlPresent;
    179 #if L0386_DB_METRIC
    180177  Bool      m_DeblockingFilterMetric;
    181 #endif
    182178  Bool      m_bUseSAO;
    183179  Int       m_maxNumOffsetsPerPic;
     
    210206  Bool      m_bUseASR;
    211207  Bool      m_bUseHADME;
    212 #if !L0034_COMBINED_LIST_CLEANUP
    213   Bool      m_bUseLComb;
    214 #endif
    215208  Bool      m_useRDOQ;
    216209  Bool      m_useRDOQTS;
    217 #if L0232_RD_PENALTY
    218210  UInt      m_rdPenalty;
    219 #endif
    220211  Bool      m_bUseFastEnc;
    221212  Bool      m_bUseEarlyCU;
     
    258249  Int       m_pictureTimingSEIEnabled;
    259250  Int       m_recoveryPointSEIEnabled;
    260 #if J0149_TONE_MAPPING_SEI
    261251  Bool      m_toneMappingInfoSEIEnabled;
    262252  Int       m_toneMapId;
     
    284274  Int*      m_codedPivotValue;
    285275  Int*      m_targetPivotValue;
    286 #endif
    287276  Int       m_framePackingSEIEnabled;
    288277  Int       m_framePackingSEIType;
     
    294283  Int       m_gradualDecodingRefreshInfoEnabled;
    295284  Int       m_decodingUnitInfoSEIEnabled;
    296 #if L0208_SOP_DESCRIPTION_SEI
    297285  Int       m_SOPDescriptionSEIEnabled;
    298 #endif
    299 #if K0180_SCALABLE_NESTING_SEI
    300286  Int       m_scalableNestingSEIEnabled;
    301 #endif
    302287  //====== Weighted Prediction ========
    303288  Bool      m_useWeightedPred;       //< Use of Weighting Prediction (P_SLICE)
     
    312297  Bool      m_RCEnableRateControl;
    313298  Int       m_RCTargetBitrate;
     299#if M0036_RC_IMPROVEMENT
     300  Int       m_RCKeepHierarchicalBit;
     301#else
    314302  Bool      m_RCKeepHierarchicalBit;
     303#endif
    315304  Bool      m_RCLCULevelRC;
    316305  Bool      m_RCUseLCUSeparateModel;
     
    389378  Double    m_dLambdaScaleVSO;
    390379  UInt      m_uiVSOMode;
    391  
    392380  // LGE_WVSO_A0119
    393381  Bool      m_bUseWVSO;
     
    395383  Int       m_iVSDWeight;
    396384  Int       m_iDWeight;
    397 #endif
    398 
    399385  // SAIT_VSO_EST_A0033
    400386  Bool      m_bUseEstimatedVSD;
    401387  Double    m_dDispCoeff;
    402 
     388#endif
    403389#if H_3D_ARP
    404390  UInt      m_uiUseAdvResPred;
    405391  UInt      m_uiARPStepNum;
    406392#endif
    407 
    408393#if H_3D_IC
    409394  Bool      m_bUseIC;
    410395#endif
    411 
    412396  //====== Depth Intra Modes ======
    413397#if H_3D_DIM
     
    417401  Bool      m_useDLT;
    418402#endif
    419 
    420 #endif
    421 
     403#endif
    422404public:
    423405  TEncCfg()
     
    519501  Void      setLoopFilterTcOffset           ( Int   i )      { m_loopFilterTcOffsetDiv2    = i; }
    520502  Void      setDeblockingFilterControlPresent ( Bool b ) { m_DeblockingFilterControlPresent = b; }
    521 #if L0386_DB_METRIC
    522503  Void      setDeblockingFilterMetric       ( Bool  b )      { m_DeblockingFilterMetric = b; }
    523 #endif
    524504
    525505  //====== Motion search ========
     
    576556  Int       getLoopFilterTcOffset           ()      { return m_loopFilterTcOffsetDiv2; }
    577557  Bool      getDeblockingFilterControlPresent()  { return  m_DeblockingFilterControlPresent; }
    578 #if L0386_DB_METRIC
    579558  Bool      getDeblockingFilterMetric       ()      { return m_DeblockingFilterMetric; }
    580 #endif
    581559
    582560  //==== Motion search ========
     
    596574  Void      setUseASR                       ( Bool  b )     { m_bUseASR     = b; }
    597575  Void      setUseHADME                     ( Bool  b )     { m_bUseHADME   = b; }
    598 #if !L0034_COMBINED_LIST_CLEANUP
    599   Void      setUseLComb                     ( Bool  b )     { m_bUseLComb   = b; }
    600 #endif
    601576  Void      setUseRDOQ                      ( Bool  b )     { m_useRDOQ    = b; }
    602577  Void      setUseRDOQTS                    ( Bool  b )     { m_useRDOQTS  = b; }
    603 #if L0232_RD_PENALTY
    604578  Void      setRDpenalty                 ( UInt  b )     { m_rdPenalty  = b; }
    605 #endif
    606579  Void      setUseFastEnc                   ( Bool  b )     { m_bUseFastEnc = b; }
    607580  Void      setUseEarlyCU                   ( Bool  b )     { m_bUseEarlyCU = b; }
     
    620593  Bool      getUseASR                       ()      { return m_bUseASR;     }
    621594  Bool      getUseHADME                     ()      { return m_bUseHADME;   }
    622 #if !L0034_COMBINED_LIST_CLEANUP
    623   Bool      getUseLComb                     ()      { return m_bUseLComb;   }
    624 #endif
    625595  Bool      getUseRDOQ                      ()      { return m_useRDOQ;    }
    626596  Bool      getUseRDOQTS                    ()      { return m_useRDOQTS;  }
    627 #if L0232_RD_PENALTY
    628597  Int      getRDpenalty                  ()      { return m_rdPenalty;  }
    629 #endif
    630598  Bool      getUseFastEnc                   ()      { return m_bUseFastEnc; }
    631599  Bool      getUseEarlyCU                   ()      { return m_bUseEarlyCU; }
     
    719687  Void  setRecoveryPointSEIEnabled(Int b)                { m_recoveryPointSEIEnabled = b; }
    720688  Int   getRecoveryPointSEIEnabled()                     { return m_recoveryPointSEIEnabled; }
    721 #if J0149_TONE_MAPPING_SEI
    722689  Void  setToneMappingInfoSEIEnabled(Bool b)                 {  m_toneMappingInfoSEIEnabled = b;  }
    723690  Bool  getToneMappingInfoSEIEnabled()                       {  return m_toneMappingInfoSEIEnabled;  }
     
    770737  Void  setTMISEIExtendedWhiteLevelLumaCodeValue(Int b)      {  m_extendedWhiteLevelLumaCodeValue =b;  }
    771738  Int   getTMISEIExtendedWhiteLevelLumaCodeValue()           {  return m_extendedWhiteLevelLumaCodeValue;  }
    772 #endif
    773739  Void  setFramePackingArrangementSEIEnabled(Int b)      { m_framePackingSEIEnabled = b; }
    774740  Int   getFramePackingArrangementSEIEnabled()           { return m_framePackingSEIEnabled; }
     
    789755  Void  setDecodingUnitInfoSEIEnabled(Int b)                { m_decodingUnitInfoSEIEnabled = b;    }
    790756  Int   getDecodingUnitInfoSEIEnabled()                     { return m_decodingUnitInfoSEIEnabled; }
    791 #if L0208_SOP_DESCRIPTION_SEI
    792757  Void  setSOPDescriptionSEIEnabled(Int b)                { m_SOPDescriptionSEIEnabled = b; }
    793758  Int   getSOPDescriptionSEIEnabled()                     { return m_SOPDescriptionSEIEnabled; }
    794 #endif
    795 #if K0180_SCALABLE_NESTING_SEI
    796759  Void  setScalableNestingSEIEnabled(Int b)                { m_scalableNestingSEIEnabled = b; }
    797760  Int   getScalableNestingSEIEnabled()                     { return m_scalableNestingSEIEnabled; }
    798 #endif
    799761  Void      setUseWP               ( Bool b )    { m_useWeightedPred   = b;    }
    800762  Void      setWPBiPred            ( Bool b )    { m_useWeightedBiPred = b;    }
     
    818780  Int       getTargetBitrate       ()              { return m_RCTargetBitrate;       }
    819781  Void      setTargetBitrate       ( Int bitrate ) { m_RCTargetBitrate  = bitrate;   }
     782#if M0036_RC_IMPROVEMENT
     783  Int       getKeepHierBit         ()              { return m_RCKeepHierarchicalBit; }
     784  Void      setKeepHierBit         ( Int i )       { m_RCKeepHierarchicalBit = i;    }
     785#else
    820786  Bool      getKeepHierBit         ()              { return m_RCKeepHierarchicalBit; }
    821787  Void      setKeepHierBit         ( Bool b )      { m_RCKeepHierarchicalBit = b;    }
     788#endif
    822789  Bool      getLCULevelRC          ()              { return m_RCLCULevelRC; }
    823790  Void      setLCULevelRC          ( Bool b )      { m_RCLCULevelRC = b; }
     
    916883  Void      setLog2MaxMvLengthVertical(Int i)             { m_log2MaxMvLengthVertical = i; }
    917884 
    918 #if L0046_CONSTRAINT_FLAGS
    919885  Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; }
    920886  Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; }
     
    928894  Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; }
    929895  Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; }
    930 #endif
    931896#if H_3D
    932897  /// 3D Tools
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp

    r531 r537  
    103103 
    104104  m_bEncodeDQP = false;
    105 #if RATE_CONTROL_LAMBDA_DOMAIN
     105#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    106106  m_LCUPredictionSAD = 0;
    107107  m_addSADDepth      = 0;
     
    256256  m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
    257257
    258 #if RATE_CONTROL_LAMBDA_DOMAIN
     258#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    259259  m_addSADDepth      = 0;
    260260  m_LCUPredictionSAD = 0;
     
    592592    }
    593593
    594 #if RATE_CONTROL_LAMBDA_DOMAIN
     594#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    595595    if ( uiDepth <= m_addSADDepth )
    596596    {
     
    862862  {
    863863    bBoundary = true;
    864 #if RATE_CONTROL_LAMBDA_DOMAIN
     864#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    865865    m_addSADDepth++;
    866866#endif
     
    13481348}
    13491349
     1350#if RATE_CONTROL_INTRA
     1351Int xCalcHADs8x8_ISlice(Pel *piOrg, Int iStrideOrg)
     1352{
     1353  Int k, i, j, jj;
     1354  Int diff[64], m1[8][8], m2[8][8], m3[8][8], iSumHad = 0;
     1355
     1356  for( k = 0; k < 64; k += 8 )
     1357  {
     1358    diff[k+0] = piOrg[0] ;
     1359    diff[k+1] = piOrg[1] ;
     1360    diff[k+2] = piOrg[2] ;
     1361    diff[k+3] = piOrg[3] ;
     1362    diff[k+4] = piOrg[4] ;
     1363    diff[k+5] = piOrg[5] ;
     1364    diff[k+6] = piOrg[6] ;
     1365    diff[k+7] = piOrg[7] ;
     1366 
     1367    piOrg += iStrideOrg;
     1368  }
     1369 
     1370  //horizontal
     1371  for (j=0; j < 8; j++)
     1372  {
     1373    jj = j << 3;
     1374    m2[j][0] = diff[jj  ] + diff[jj+4];
     1375    m2[j][1] = diff[jj+1] + diff[jj+5];
     1376    m2[j][2] = diff[jj+2] + diff[jj+6];
     1377    m2[j][3] = diff[jj+3] + diff[jj+7];
     1378    m2[j][4] = diff[jj  ] - diff[jj+4];
     1379    m2[j][5] = diff[jj+1] - diff[jj+5];
     1380    m2[j][6] = diff[jj+2] - diff[jj+6];
     1381    m2[j][7] = diff[jj+3] - diff[jj+7];
     1382   
     1383    m1[j][0] = m2[j][0] + m2[j][2];
     1384    m1[j][1] = m2[j][1] + m2[j][3];
     1385    m1[j][2] = m2[j][0] - m2[j][2];
     1386    m1[j][3] = m2[j][1] - m2[j][3];
     1387    m1[j][4] = m2[j][4] + m2[j][6];
     1388    m1[j][5] = m2[j][5] + m2[j][7];
     1389    m1[j][6] = m2[j][4] - m2[j][6];
     1390    m1[j][7] = m2[j][5] - m2[j][7];
     1391   
     1392    m2[j][0] = m1[j][0] + m1[j][1];
     1393    m2[j][1] = m1[j][0] - m1[j][1];
     1394    m2[j][2] = m1[j][2] + m1[j][3];
     1395    m2[j][3] = m1[j][2] - m1[j][3];
     1396    m2[j][4] = m1[j][4] + m1[j][5];
     1397    m2[j][5] = m1[j][4] - m1[j][5];
     1398    m2[j][6] = m1[j][6] + m1[j][7];
     1399    m2[j][7] = m1[j][6] - m1[j][7];
     1400  }
     1401 
     1402  //vertical
     1403  for (i=0; i < 8; i++)
     1404  {
     1405    m3[0][i] = m2[0][i] + m2[4][i];
     1406    m3[1][i] = m2[1][i] + m2[5][i];
     1407    m3[2][i] = m2[2][i] + m2[6][i];
     1408    m3[3][i] = m2[3][i] + m2[7][i];
     1409    m3[4][i] = m2[0][i] - m2[4][i];
     1410    m3[5][i] = m2[1][i] - m2[5][i];
     1411    m3[6][i] = m2[2][i] - m2[6][i];
     1412    m3[7][i] = m2[3][i] - m2[7][i];
     1413   
     1414    m1[0][i] = m3[0][i] + m3[2][i];
     1415    m1[1][i] = m3[1][i] + m3[3][i];
     1416    m1[2][i] = m3[0][i] - m3[2][i];
     1417    m1[3][i] = m3[1][i] - m3[3][i];
     1418    m1[4][i] = m3[4][i] + m3[6][i];
     1419    m1[5][i] = m3[5][i] + m3[7][i];
     1420    m1[6][i] = m3[4][i] - m3[6][i];
     1421    m1[7][i] = m3[5][i] - m3[7][i];
     1422   
     1423    m2[0][i] = m1[0][i] + m1[1][i];
     1424    m2[1][i] = m1[0][i] - m1[1][i];
     1425    m2[2][i] = m1[2][i] + m1[3][i];
     1426    m2[3][i] = m1[2][i] - m1[3][i];
     1427    m2[4][i] = m1[4][i] + m1[5][i];
     1428    m2[5][i] = m1[4][i] - m1[5][i];
     1429    m2[6][i] = m1[6][i] + m1[7][i];
     1430    m2[7][i] = m1[6][i] - m1[7][i];
     1431  }
     1432 
     1433  for (i = 0; i < 8; i++)
     1434  {
     1435    for (j = 0; j < 8; j++)
     1436    {
     1437      iSumHad += abs(m2[i][j]);
     1438    }
     1439  }
     1440  iSumHad -= abs(m2[0][0]);
     1441  iSumHad =(iSumHad+2)>>2;
     1442  return(iSumHad);
     1443}
     1444
     1445Int  TEncCu::updateLCUDataISlice(TComDataCU* pcCU, Int LCUIdx, Int width, Int height)
     1446{
     1447  Int  xBl, yBl;
     1448  const Int iBlkSize = 8;
     1449
     1450  Pel* pOrgInit   = pcCU->getPic()->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0);
     1451  Int  iStrideOrig = pcCU->getPic()->getPicYuvOrg()->getStride();
     1452  Pel  *pOrg;
     1453
     1454  Int iSumHad = 0;
     1455  for ( yBl=0; (yBl+iBlkSize)<=height; yBl+= iBlkSize)
     1456  {
     1457    for ( xBl=0; (xBl+iBlkSize)<=width; xBl+= iBlkSize)
     1458    {
     1459      pOrg = pOrgInit + iStrideOrig*yBl + xBl;
     1460      iSumHad += xCalcHADs8x8_ISlice(pOrg, iStrideOrig);
     1461    }
     1462  }
     1463  return(iSumHad);
     1464}
     1465#endif
     1466
    13501467/** check RD costs for a CU block encoded with merge
    13511468 * \param rpcBestCU
     
    13601477  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
    13611478#else
    1362   TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
     1479  TComMvField  cMvFieldNeighbours[2 * MRG_MAX_NUM_CANDS]; // double length for mv of both lists
    13631480  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    13641481#endif
     
    14001517  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
    14011518#endif
    1402   for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
     1519for( UInt ui = 0; ui < numValidMergeCand; ++ui )
    14031520  {
    14041521    mergeCandBuffer[ui] = 0;
     
    14301547  {
    14311548    for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
    1432     {
    1433       {
     1549    {     
    14341550#if H_3D_IC
    14351551        if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() )
     
    14431559        if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1))
    14441560        {
    1445 
    14461561        if( !(bestIsSkip && uiNoResidual == 0) )
    14471562        {
     
    14871602       m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
    14881603       // estimate residual and encode everything
    1489 
    14901604#if H_3D_VSO //M2
    14911605       if( m_pcRdCost->getUseRenModel() )
     
    14981612       }
    14991613#endif
    1500 
    15011614       m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU,
    15021615         m_ppcOrigYuv    [uhDepth],
     
    15081621
    15091622
    1510        if(uiNoResidual==0)
    1511        {
    1512          if(rpcTempCU->getQtRootCbf(0) == 0)
     1623          if ( uiNoResidual == 0 && rpcTempCU->getQtRootCbf(0) == 0 )
    15131624         {
     1625            // If no residual when allowing for one, then set mark to not try case where residual is forced to 0
    15141626           mergeCandBuffer[uiMergeCand] = 1;
    15151627         }
    1516        }
    1517 
    1518        rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
     1628
     1629          rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
    15191630          Int orgQP = rpcTempCU->getQP( 0 );
    15201631          xCheckDQP( rpcTempCU );
     
    15221633          rpcTempCU->initEstData( uhDepth, orgQP );
    15231634
    1524 
    15251635      if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip )
    15261636      {
    15271637        bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0;
    15281638      }
    1529 
    1530     }
    15311639    }
    15321640   }
     
    16891797#endif
    16901798
    1691 #if RATE_CONTROL_LAMBDA_DOMAIN
     1799#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    16921800  if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth )
    16931801  {
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.h

    r504 r537  
    102102  Bool                    m_bUseSBACRD;
    103103  TEncRateCtrl*           m_pcRateCtrl;
    104 #if RATE_CONTROL_LAMBDA_DOMAIN
     104#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    105105  UInt                    m_LCUPredictionSAD;
    106106  Int                     m_addSADDepth;
     
    124124 
    125125  Void setBitCounter        ( TComBitCounter* pcBitCounter ) { m_pcBitCounter = pcBitCounter; }
    126 #if RATE_CONTROL_LAMBDA_DOMAIN
     126#if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT
    127127  UInt getLCUPredictionSAD() { return m_LCUPredictionSAD; }
     128#endif
     129#if RATE_CONTROL_INTRA
     130  Int   updateLCUDataISlice ( TComDataCU* pcCU, Int LCUIdx, Int width, Int height );
    128131#endif
    129132protected:
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp

    r534 r537  
    9494  m_cpbRemovalDelay   = 0;
    9595  m_lastBPSEI         = 0;
    96 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    9796  xResetNonNestedSEIPresentFlags();
    98 #if K0180_SCALABLE_NESTING_SEI
    9997  xResetNestedSEIPresentFlags();
    100 #endif
    101 #endif
    10298#if H_MV
    10399  m_layerId      = 0;
     
    163159  SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets();
    164160  seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId();
    165 #if L0047_APS_FLAGS
    166161  seiActiveParameterSets->m_fullRandomAccessFlag = false;
    167162  seiActiveParameterSets->m_noParamSetUpdateFlag = false;
    168 #endif
    169163  seiActiveParameterSets->numSpsIdsMinus1 = 0;
    170164  seiActiveParameterSets->activeSeqParamSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);
     
    179173  seiFramePacking->m_arrangementCancelFlag = 0;
    180174  seiFramePacking->m_arrangementType = m_pcCfg->getFramePackingArrangementSEIType();
    181 #if L0444_FPA_TYPE
    182175  assert((seiFramePacking->m_arrangementType > 2) && (seiFramePacking->m_arrangementType < 6) );
    183 #endif
    184176  seiFramePacking->m_quincunxSamplingFlag = m_pcCfg->getFramePackingArrangementSEIQuincunx();
    185177  seiFramePacking->m_contentInterpretationType = m_pcCfg->getFramePackingArrangementSEIInterpretation();
     
    195187  seiFramePacking->m_frame1GridPositionY = 0;
    196188  seiFramePacking->m_arrangementReservedByte = 0;
    197 #if L0045_PERSISTENCE_FLAGS
    198189  seiFramePacking->m_arrangementPersistenceFlag = true;
    199 #else
    200   seiFramePacking->m_arrangementRepetetionPeriod = 1;
    201 #endif
    202190  seiFramePacking->m_upsampledAspectRatio = 0;
    203191  return seiFramePacking;
     
    214202}
    215203
    216 #if J0149_TONE_MAPPING_SEI
    217204SEIToneMappingInfo*  TEncGOP::xCreateSEIToneMappingInfo()
    218205{
     
    225212  assert(seiToneMappingInfo->m_codedDataBitDepth >= 8 && seiToneMappingInfo->m_codedDataBitDepth <= 14);
    226213  seiToneMappingInfo->m_targetBitDepth = m_pcCfg->getTMISEITargetBitDepth();
    227   assert( (seiToneMappingInfo->m_targetBitDepth >= 1 && seiToneMappingInfo->m_targetBitDepth <= 17) || (seiToneMappingInfo->m_targetBitDepth  == 255) );
     214  assert( seiToneMappingInfo->m_targetBitDepth >= 1 && seiToneMappingInfo->m_targetBitDepth <= 17 );
    228215  seiToneMappingInfo->m_modelId = m_pcCfg->getTMISEIModelID();
    229216  assert(seiToneMappingInfo->m_modelId >=0 &&seiToneMappingInfo->m_modelId<=4);
     
    300287  return seiToneMappingInfo;
    301288}
    302 #endif
     289
    303290Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps)
    304291{
     
    315302    accessUnit.push_back(new NALUnitEBSP(nalu));
    316303    delete sei;
    317 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    318304    m_activeParameterSetSEIPresentInAU = true;
    319 #endif
    320305  }
    321306
     
    342327    delete sei;
    343328  }
    344 #if J0149_TONE_MAPPING_SEI
    345329  if(m_pcCfg->getToneMappingInfoSEIEnabled())
    346330  {
     
    354338    delete sei;
    355339  }
    356 #endif
    357340}
    358341
     
    389372#endif
    390373  SEIPictureTiming pictureTimingSEI;
    391 #if L0208_SOP_DESCRIPTION_SEI
    392374  Bool writeSOP = m_pcCfg->getSOPDescriptionSEIEnabled();
    393 #endif
    394 #if K0180_SCALABLE_NESTING_SEI
    395375  // Initialize Scalable Nesting SEI with single layer values
    396376  SEIScalableNesting scalableNestingSEI;
     
    403383  scalableNestingSEI.m_nestingLayerId[0]             = 0;
    404384  scalableNestingSEI.m_callerOwnsSEIs                = true;
    405 #endif
    406 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    407385  Int picSptDpbOutputDuDelay = 0;
    408 #endif
    409386  UInt *accumBitsDU = NULL;
    410387  UInt *accumNalsDU = NULL;
     
    596573    pcSlice->getRPS()->setNumberOfLongtermPictures(0);
    597574
    598 #if FIX1071 && H_MV_FIX1071
     575#if FIX1071
    599576    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP()))
    600577    {
     
    772749    }
    773750#endif
    774 #if !L0034_COMBINED_LIST_CLEANUP
    775     if (pcSlice->getSliceType() != B_SLICE || !pcSlice->getSPS()->getUseLComb())
    776     {
    777       pcSlice->setNumRefIdx(REF_PIC_LIST_C, 0);
    778       pcSlice->setRefPicListCombinationFlag(false);
    779       pcSlice->setRefPicListModificationFlagLC(false);
    780     }
    781     else
    782     {
    783       pcSlice->setRefPicListCombinationFlag(pcSlice->getSPS()->getUseLComb());
    784       pcSlice->setNumRefIdx(REF_PIC_LIST_C, pcSlice->getNumRefIdx(REF_PIC_LIST_0));
    785     }
    786 #endif
    787 
    788751    if (pcSlice->getSliceType() == B_SLICE)
    789752    {
     
    820783    pcSlice->setRefPOCList();
    821784
    822 #if L0034_COMBINED_LIST_CLEANUP
    823785    pcSlice->setList1IdxToList0Idx();
    824 #else
    825     pcSlice->setNoBackPredFlag( false );
    826     if ( pcSlice->getSliceType() == B_SLICE && !pcSlice->getRefPicListCombinationFlag())
    827     {
    828       if ( pcSlice->getNumRefIdx(RefPicList( 0 ) ) == pcSlice->getNumRefIdx(RefPicList( 1 ) ) )
    829       {
    830         pcSlice->setNoBackPredFlag( true );
    831         Int i;
    832         for ( i=0; i < pcSlice->getNumRefIdx(RefPicList( 1 ) ); i++ )
    833         {
    834           if ( pcSlice->getRefPOC(RefPicList(1), i) != pcSlice->getRefPOC(RefPicList(0), i) )
    835           {
    836             pcSlice->setNoBackPredFlag( false );
    837             break;
    838           }
    839         }
    840       }
    841     }
    842 
    843     if(pcSlice->getNoBackPredFlag())
    844     {
    845       pcSlice->setNumRefIdx(REF_PIC_LIST_C, 0);
    846     }
    847     pcSlice->generateCombinedList();
    848 #endif
    849786#if H_3D_TMVP
    850787    if(pcSlice->getLayerId())
     
    943880
    944881#if RATE_CONTROL_LAMBDA_DOMAIN
    945     Int sliceQP              = pcSlice->getSliceQp();
    946882    Double lambda            = 0.0;
    947883    Int actualHeadBits       = 0;
     
    959895      estimatedBits = m_pcRateCtrl->getRCPic()->getTargetBits();
    960896
     897      Int sliceQP = m_pcCfg->getInitialQP();
    961898      if ( ( pcSlice->getPOC() == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified
    962899      {
    963         sliceQP              = m_pcCfg->getInitialQP();
    964900        Int    NumberBFrames = ( m_pcCfg->getGOPSize() - 1 );
    965901        Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)NumberBFrames );
     
    972908      else if ( frameLevel == 0 )   // intra case, but use the model
    973909      {
     910#if RATE_CONTROL_INTRA
     911        m_pcSliceEncoder->calCostSliceI(pcPic);
     912#endif
    974913        if ( m_pcCfg->getIntraPeriod() != 1 )   // do not refine allocated bits for all intra case
    975914        {
    976915          Int bits = m_pcRateCtrl->getRCSeq()->getLeftAverageBits();
     916#if RATE_CONTROL_INTRA
     917          bits = m_pcRateCtrl->getRCPic()->getRefineBitsForIntra( bits );
     918#else
    977919          bits = m_pcRateCtrl->getRCSeq()->getRefineBitsForIntra( bits );
     920#endif
    978921          if ( bits < 200 )
    979922          {
     
    984927
    985928        list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList();
     929#if RATE_CONTROL_INTRA
     930        m_pcRateCtrl->getRCPic()->getLCUInitTargetBits();
     931        lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, pcSlice->getSliceType());
     932#else
    986933        lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture );
     934#endif
    987935        sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture );
    988936      }
     
    990938      {
    991939        list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList();
     940#if RATE_CONTROL_INTRA
     941        lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, pcSlice->getSliceType());
     942#else
    992943        lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture );
     944#endif
    993945        sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture );
    994946      }
     
    11991151    Bool bLFCrossTileBoundary = pcSlice->getPPS()->getLoopFilterAcrossTilesEnabledFlag();
    12001152    m_pcLoopFilter->setCfg(bLFCrossTileBoundary);
    1201 #if L0386_DB_METRIC
    12021153    if ( m_pcCfg->getDeblockingFilterMetric() )
    12031154    {
    12041155      dblMetric(pcPic, uiNumSlices);
    12051156    }
    1206 #endif
    12071157    m_pcLoopFilter->loopFilterPic( pcPic );
    12081158
     
    12671217        UInt maxCU = m_pcCfg->getSliceArgument() >> ( pcSlice->getSPS()->getMaxCUDepth() << 1);
    12681218        UInt numDU = ( m_pcCfg->getSliceMode() == 1 ) ? ( pcPic->getNumCUsInFrame() / maxCU ) : ( 0 );
    1269         if( pcPic->getNumCUsInFrame() % maxCU != 0 )
     1219        if( pcPic->getNumCUsInFrame() % maxCU != 0 || numDU == 0 )
    12701220        {
    12711221          numDU ++;
     
    13071257    }
    13081258
    1309 #if L0208_SOP_DESCRIPTION_SEI
    13101259    if (writeSOP) // write SOP description SEI (if enabled) at the beginning of GOP
    13111260    {
     
    13451294      writeSOP = false;
    13461295    }
    1347 #endif
    13481296
    13491297    if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) &&
     
    13771325      pictureTimingSEI.m_auCpbRemovalDelay = std::max<Int>(1, m_totalCoded - m_lastBPSEI); // Syntax element signalled as minus, hence the .
    13781326      pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded;
    1379 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    13801327      Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2;
    13811328      pictureTimingSEI.m_picDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay;
     
    13841331        picSptDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay;
    13851332      }
    1386 #endif
    13871333    }
    13881334
     
    14041350      sei_buffering_period.m_initialCpbRemovalDelayOffset[0][1]     = uiInitialCpbRemovalDelay;
    14051351
    1406 #if L0043_TIMING_INFO
    14071352      Double dTmp = (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale();
    1408 #else
    1409       Double dTmp = (Double)pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getNumUnitsInTick() / (Double)pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTimeScale();
    1410 #endif
    14111353
    14121354      UInt uiTmp = (UInt)( dTmp * 90000.0 );
     
    14191361
    14201362      sei_buffering_period.m_rapCpbParamsPresentFlag              = 0;
    1421 #if L0328_SPLICING
    14221363      //for the concatenation, it can be set to one during splicing.
    14231364      sei_buffering_period.m_concatenationFlag = 0;
    14241365      //since the temporal layer HRD is not ready, we assumed it is fixed
    14251366      sei_buffering_period.m_auCpbRemovalDelayDelta = 1;
    1426 #endif
    1427 #if L0044_CPB_DPB_DELAY_OFFSET
    14281367      sei_buffering_period.m_cpbDelayOffset = 0;
    14291368      sei_buffering_period.m_dpbDelayOffset = 0;
    1430 #endif
    14311369
    14321370      m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, pcSlice->getSPS());
    14331371      writeRBSPTrailingBits(nalu.m_Bitstream);
    1434 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    14351372      {
    14361373      UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
     
    14441381      m_bufferingPeriodSEIPresentInAU = true;
    14451382      }
    1446 #else
    1447       accessUnit.push_back(new NALUnitEBSP(nalu));
    1448 #endif
    1449 
    1450 #if K0180_SCALABLE_NESTING_SEI
     1383
    14511384      if (m_pcCfg->getScalableNestingSEIEnabled())
    14521385      {
     
    14581391        m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, pcSlice->getSPS());
    14591392        writeRBSPTrailingBits(naluTmp.m_Bitstream);
    1460 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    14611393        UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
    14621394        UInt offsetPosition = m_activeParameterSetSEIPresentInAU + m_bufferingPeriodSEIPresentInAU + m_pictureTimingSEIPresentInAU;   // Insert BP SEI after non-nested APS, BP and PT SEIs
     
    14681400        accessUnit.insert(it, new NALUnitEBSP(naluTmp));
    14691401        m_nestedBufferingPeriodSEIPresentInAU = true;
    1470 #else
    1471         accessUnit.push_back(new NALUnitEBSP(naluTmp));
    1472 #endif
    1473       }
    1474 #endif
     1402      }
    14751403
    14761404      m_lastBPSEI = m_totalCoded;
     
    19351863      if ( m_pcCfg->getUseRateCtrl() )
    19361864      {
     1865#if !M0036_RC_IMPROVEMENT
    19371866        Double effectivePercentage = m_pcRateCtrl->getRCPic()->getEffectivePercentage();
     1867#endif
    19381868        Double avgQP     = m_pcRateCtrl->getRCPic()->calAverageQP();
    19391869        Double avgLambda = m_pcRateCtrl->getRCPic()->calAverageLambda();
     
    19421872          avgLambda = lambda;
    19431873        }
     1874#if M0036_RC_IMPROVEMENT
     1875#if RATE_CONTROL_INTRA
     1876        m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda, pcSlice->getSliceType());
     1877#else
     1878        m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda );
     1879#endif
     1880#else
    19441881        m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda, effectivePercentage );
     1882#endif
    19451883        m_pcRateCtrl->getRCPic()->addToPictureLsit( m_pcRateCtrl->getPicList() );
    19461884
     
    19621900      }
    19631901#endif
     1902
    19641903      if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) &&
    19651904          ( pcSlice->getSPS()->getVuiParametersPresentFlag() ) &&
     
    19961935            for( i = ( numDU - 2 ); i >= 0; i -- )
    19971936            {
    1998 #if L0043_TIMING_INFO
    19991937              ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ]  - accumBitsDU[ i ] ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
    2000 #else
    2001               ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ]  - accumBitsDU[ i ] ) * ( hrd->getTimeScale() / hrd->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
    2002 #endif
    20031938              if( (UInt)ui64Tmp > maxDiff )
    20041939              {
     
    20121947            {
    20131948              flag = 0;
    2014 #if L0043_TIMING_INFO
    20151949              ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ]  - accumBitsDU[ i ] ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
    2016 #else
    2017               ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ]  - accumBitsDU[ i ] ) * ( hrd->getTimeScale() / hrd->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
    2018 #endif
    20191950
    20201951              if( (UInt)ui64Tmp > maxDiff )
     
    20481979          m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, pcSlice->getSPS());
    20491980          writeRBSPTrailingBits(nalu.m_Bitstream);
    2050 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    20511981          UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
    20521982          UInt offsetPosition = m_activeParameterSetSEIPresentInAU
     
    20591989          accessUnit.insert(it, new NALUnitEBSP(nalu));
    20601990          m_pictureTimingSEIPresentInAU = true;
    2061 #else
    2062           AccessUnit::iterator it = find_if(accessUnit.begin(), accessUnit.end(), mem_fun(&NALUnit::isSlice));
    2063           accessUnit.insert(it, new NALUnitEBSP(nalu));
    2064 #endif
    2065         }
    2066 #if K0180_SCALABLE_NESTING_SEI
     1991        }
    20671992          if ( m_pcCfg->getScalableNestingSEIEnabled() ) // put picture timing SEI into scalable nesting SEI
    20681993          {
     
    20731998            m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, pcSlice->getSPS());
    20741999            writeRBSPTrailingBits(nalu.m_Bitstream);
    2075 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    20762000            UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
    20772001            UInt offsetPosition = m_activeParameterSetSEIPresentInAU
     
    20842008            accessUnit.insert(it, new NALUnitEBSP(nalu));
    20852009            m_nestedPictureTimingSEIPresentInAU = true;
    2086 #else
    2087             AccessUnit::iterator it = find_if(accessUnit.begin(), accessUnit.end(), mem_fun(&NALUnit::isSlice));
    2088             accessUnit.insert(it, new NALUnitEBSP(nalu));
    2089 #endif
    20902010          }
    2091 #endif
    2092 
    20932011        }
    20942012        if( m_pcCfg->getDecodingUnitInfoSEIEnabled() && hrd->getSubPicCpbParamsPresentFlag() )
     
    21022020            tempSEI.m_decodingUnitIdx = i;
    21032021            tempSEI.m_duSptCpbRemovalDelay = pictureTimingSEI.m_duCpbRemovalDelayMinus1[i] + 1;
    2104 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    21052022            tempSEI.m_dpbOutputDuDelayPresentFlag = false;
    21062023            tempSEI.m_picSptDpbOutputDuDelay = picSptDpbOutputDuDelay;
    2107 #endif
    21082024
    21092025            AccessUnit::iterator it;
     
    21152031              writeRBSPTrailingBits(nalu.m_Bitstream);
    21162032
    2117 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    21182033              UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
    21192034              UInt offsetPosition = m_activeParameterSetSEIPresentInAU
     
    21252040              }
    21262041              accessUnit.insert(it, new NALUnitEBSP(nalu));
    2127 #else
    2128               it = find_if(accessUnit.begin(), accessUnit.end(), mem_fun(&NALUnit::isSlice));
    2129               accessUnit.insert(it, new NALUnitEBSP(nalu));
    2130 #endif
    21312042            }
    21322043            else
     
    21542065        }
    21552066      }
    2156 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    21572067      xResetNonNestedSEIPresentFlags();
    2158 #if K0180_SCALABLE_NESTING_SEI
    21592068      xResetNestedSEIPresentFlags();
    2160 #endif
    2161 #endif
    21622069      pcPic->getPicYuvRec()->copyToPic(pcPicYuvRecOut);
    21632070
     
    28512758}
    28522759
    2853 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    28542760/** Function for finding the position to insert the first of APS and non-nested BP, PT, DU info SEI messages.
    28552761 * \param accessUnit Access Unit of the current picture
     
    28712777  return seiStartPos;
    28722778}
    2873 #endif
    2874 
    2875 #if L0386_DB_METRIC
     2779
    28762780Void TEncGOP::dblMetric( TComPic* pcPic, UInt uiNumSlices )
    28772781{
     
    28872791  const UInt noCol = (picWidth>>log2maxTB);
    28882792  const UInt noRows = (picHeight>>log2maxTB);
     2793  assert(noCol > 1);
     2794  assert(noRows > 1);
    28892795  UInt64 *colSAD = (UInt64*)malloc(noCol*sizeof(UInt64));
    28902796  UInt64 *rowSAD = (UInt64*)malloc(noRows*sizeof(UInt64));
     
    29952901  free(rowSAD);
    29962902}
    2997 #endif
     2903
    29982904#if H_MV
    29992905Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid )
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.h

    r534 r537  
    128128  UInt                    m_tl0Idx;
    129129  UInt                    m_rapIdx;
    130 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    131130  Bool                    m_activeParameterSetSEIPresentInAU;
    132131  Bool                    m_bufferingPeriodSEIPresentInAU;
    133132  Bool                    m_pictureTimingSEIPresentInAU;
    134 #if K0180_SCALABLE_NESTING_SEI
    135133  Bool                    m_nestedBufferingPeriodSEIPresentInAU;
    136134  Bool                    m_nestedPictureTimingSEIPresentInAU;
    137 #endif
    138 #endif
    139135public:
    140136  TEncGOP();
     
    199195  SEIDisplayOrientation*  xCreateSEIDisplayOrientation();
    200196
    201 #if J0149_TONE_MAPPING_SEI
    202197  SEIToneMappingInfo*     xCreateSEIToneMappingInfo();
    203 #endif
    204198
    205199  Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps);
    206 #if L0045_NON_NESTED_SEI_RESTRICTIONS
    207200  Int xGetFirstSeiLocation (AccessUnit &accessUnit);
    208201  Void xResetNonNestedSEIPresentFlags()
     
    212205    m_pictureTimingSEIPresentInAU      = false;
    213206  }
    214 #if K0180_SCALABLE_NESTING_SEI
    215207  Void xResetNestedSEIPresentFlags()
    216208  {
     
    218210    m_nestedPictureTimingSEIPresentInAU      = false;
    219211  }
    220 #endif
    221 #endif
    222212#if H_MV
    223213   Void  xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid );
    224214#endif
    225 #if L0386_DB_METRIC
    226215  Void dblMetric( TComPic* pcPic, UInt uiNumSlices );
    227 #endif
    228216};// END CLASS DEFINITION TEncGOP
    229217
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncRateCtrl.cpp

    r324 r537  
    6767  m_bitsLeft            = 0;
    6868  m_useLCUSeparateModel = false;
     69#if M0036_RC_IMPROVEMENT
     70  m_adaptiveBit         = 0;
     71  m_lastLambda          = 0.0;
     72#endif
    6973}
    7074
     
    7478}
    7579
     80#if M0036_RC_IMPROVEMENT
     81Void TEncRCSeq::create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel, Int adaptiveBit )
     82#else
    7683Void TEncRCSeq::create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel )
     84#endif
    7785{
    7886  destroy();
     
    101109    m_betaUpdate  = 0.025;
    102110  }
    103   else
     111#if M0036_RC_IMPROVEMENT
     112  else if ( m_seqTargetBpp < 0.2 )
    104113  {
    105114    m_alphaUpdate = 0.1;
    106115    m_betaUpdate  = 0.05;
    107116  }
     117  else if ( m_seqTargetBpp < 0.5 )
     118  {
     119    m_alphaUpdate = 0.2;
     120    m_betaUpdate  = 0.1;
     121  }
     122  else
     123  {
     124    m_alphaUpdate = 0.4;
     125    m_betaUpdate  = 0.2;
     126  }
     127#else
     128  else
     129  {
     130    m_alphaUpdate = 0.1;
     131    m_betaUpdate  = 0.05;
     132  }
     133#endif
    108134  m_averageBits     = (Int)(m_targetBits / totalFrames);
    109135  Int picWidthInBU  = ( m_picWidth  % m_LCUWidth  ) == 0 ? m_picWidth  / m_LCUWidth  : m_picWidth  / m_LCUWidth  + 1;
     
    146172  m_framesLeft = m_totalFrames;
    147173  m_bitsLeft   = m_targetBits;
     174#if M0036_RC_IMPROVEMENT
     175  m_adaptiveBit = adaptiveBit;
     176  m_lastLambda = 0.0;
     177#endif
    148178}
    149179
     
    203233    for ( Int i=0; i<m_numberOfLevel; i++ )
    204234    {
     235#if RATE_CONTROL_INTRA
     236      if (i>0)
     237      {
     238        m_picPara[i].m_alpha = 3.2003;
     239        m_picPara[i].m_beta  = -1.367;
     240      }
     241      else
     242      {
     243        m_picPara[i].m_alpha = ALPHA;   
     244        m_picPara[i].m_beta  = BETA2;
     245      }
     246#else
    205247      m_picPara[i].m_alpha = 3.2003;
    206248      m_picPara[i].m_beta  = -1.367;
     249#endif
    207250    }
    208251  }
     
    228271      for ( Int j=0; j<m_numberOfLCU; j++)
    229272      {
     273#if RATE_CONTROL_INTRA
     274        m_LCUPara[i][j].m_alpha = m_picPara[i].m_alpha;
     275        m_LCUPara[i][j].m_beta  = m_picPara[i].m_beta;
     276#else
    230277        m_LCUPara[i][j].m_alpha = 3.2003;
    231278        m_LCUPara[i][j].m_beta  = -1.367;
     279#endif
    232280      }
    233281    }
     
    251299}
    252300
     301#if !RATE_CONTROL_INTRA
    253302Int TEncRCSeq::getRefineBitsForIntra( Int orgBits )
    254303{
     
    264313  return orgBits * 10;
    265314}
     315#endif
     316
     317#if M0036_RC_IMPROVEMENT
     318Void TEncRCSeq::setAllBitRatio( Double basicLambda, Double* equaCoeffA, Double* equaCoeffB )
     319{
     320  Int* bitsRatio = new Int[m_GOPSize];
     321  for ( Int i=0; i<m_GOPSize; i++ )
     322  {
     323    bitsRatio[i] = (Int)( equaCoeffA[i] * pow( basicLambda, equaCoeffB[i] ) * m_numberOfPixel );
     324  }
     325  initBitsRatio( bitsRatio );
     326  delete[] bitsRatio;
     327}
     328#endif
    266329
    267330//GOP level
     
    286349  Int targetBits = xEstGOPTargetBits( encRCSeq, numPic );
    287350
     351#if M0036_RC_IMPROVEMENT
     352  if ( encRCSeq->getAdaptiveBits() > 0 && encRCSeq->getLastLambda() > 0.1 )
     353  {
     354    Double targetBpp = (Double)targetBits / encRCSeq->getNumPixel();
     355    Double basicLambda = 0.0;
     356    Double* lambdaRatio = new Double[encRCSeq->getGOPSize()];
     357    Double* equaCoeffA = new Double[encRCSeq->getGOPSize()];
     358    Double* equaCoeffB = new Double[encRCSeq->getGOPSize()];
     359
     360    if ( encRCSeq->getAdaptiveBits() == 1 )   // for GOP size =4, low delay case
     361    {
     362      if ( encRCSeq->getLastLambda() < 120.0 )
     363      {
     364        lambdaRatio[1] = 0.725 * log( encRCSeq->getLastLambda() ) + 0.5793;
     365        lambdaRatio[0] = 1.3 * lambdaRatio[1];
     366        lambdaRatio[2] = 1.3 * lambdaRatio[1];
     367        lambdaRatio[3] = 1.0;
     368      }
     369      else
     370      {
     371        lambdaRatio[0] = 5.0;
     372        lambdaRatio[1] = 4.0;
     373        lambdaRatio[2] = 5.0;
     374        lambdaRatio[3] = 1.0;
     375      }
     376    }
     377    else if ( encRCSeq->getAdaptiveBits() == 2 )  // for GOP size = 8, random access case
     378    {
     379      if ( encRCSeq->getLastLambda() < 90.0 )
     380      {
     381        lambdaRatio[0] = 1.0;
     382        lambdaRatio[1] = 0.725 * log( encRCSeq->getLastLambda() ) + 0.7963;
     383        lambdaRatio[2] = 1.3 * lambdaRatio[1];
     384        lambdaRatio[3] = 3.25 * lambdaRatio[1];
     385        lambdaRatio[4] = 3.25 * lambdaRatio[1];
     386        lambdaRatio[5] = 1.3  * lambdaRatio[1];
     387        lambdaRatio[6] = 3.25 * lambdaRatio[1];
     388        lambdaRatio[7] = 3.25 * lambdaRatio[1];
     389      }
     390      else
     391      {
     392        lambdaRatio[0] = 1.0;
     393        lambdaRatio[1] = 4.0;
     394        lambdaRatio[2] = 5.0;
     395        lambdaRatio[3] = 12.3;
     396        lambdaRatio[4] = 12.3;
     397        lambdaRatio[5] = 5.0;
     398        lambdaRatio[6] = 12.3;
     399        lambdaRatio[7] = 12.3;
     400      }
     401    }
     402
     403    xCalEquaCoeff( encRCSeq, lambdaRatio, equaCoeffA, equaCoeffB, encRCSeq->getGOPSize() );
     404    basicLambda = xSolveEqua( targetBpp, equaCoeffA, equaCoeffB, encRCSeq->getGOPSize() );
     405    encRCSeq->setAllBitRatio( basicLambda, equaCoeffA, equaCoeffB );
     406
     407    delete []lambdaRatio;
     408    delete []equaCoeffA;
     409    delete []equaCoeffB;
     410  }
     411#endif
     412
    288413  m_picTargetBitInGOP = new Int[numPic];
    289414  Int i;
     
    297422  {
    298423    currPicRatio = encRCSeq->getBitRatio( i );
     424#if M0036_RC_IMPROVEMENT
     425    m_picTargetBitInGOP[i] = (Int)( ((Double)targetBits) * currPicRatio / totalPicRatio );
     426#else
    299427    m_picTargetBitInGOP[i] = targetBits * currPicRatio / totalPicRatio;
     428#endif
    300429  }
    301430
     
    306435  m_bitsLeft     = m_targetBits;
    307436}
     437
     438#if M0036_RC_IMPROVEMENT
     439Void TEncRCGOP::xCalEquaCoeff( TEncRCSeq* encRCSeq, Double* lambdaRatio, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize )
     440{
     441  for ( Int i=0; i<GOPSize; i++ )
     442  {
     443    Int frameLevel = encRCSeq->getGOPID2Level(i);
     444    Double alpha   = encRCSeq->getPicPara(frameLevel).m_alpha;
     445    Double beta    = encRCSeq->getPicPara(frameLevel).m_beta;
     446    equaCoeffA[i] = pow( 1.0/alpha, 1.0/beta ) * pow( lambdaRatio[i], 1.0/beta );
     447    equaCoeffB[i] = 1.0/beta;
     448  }
     449}
     450
     451Double TEncRCGOP::xSolveEqua( Double targetBpp, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize )
     452{
     453  Double solution = 100.0;
     454  Double minNumber = 0.1;
     455  Double maxNumber = 10000.0;
     456  for ( Int i=0; i<g_RCIterationNum; i++ )
     457  {
     458    Double fx = 0.0;
     459    for ( Int j=0; j<GOPSize; j++ )
     460    {
     461      fx += equaCoeffA[j] * pow( solution, equaCoeffB[j] );
     462    }
     463
     464    if ( fabs( fx - targetBpp ) < 0.000001 )
     465    {
     466      break;
     467    }
     468
     469    if ( fx > targetBpp )
     470    {
     471      minNumber = solution;
     472      solution = ( solution + maxNumber ) / 2.0;
     473    }
     474    else
     475    {
     476      maxNumber = solution;
     477      solution = ( solution + minNumber ) / 2.0;
     478    }
     479  }
     480
     481  solution = Clip3( 0.1, 10000.0, solution );
     482  return solution;
     483}
     484#endif
    308485
    309486Void TEncRCGOP::destroy()
     
    357534
    358535  m_LCUs         = NULL;
     536#if !M0036_RC_IMPROVEMENT
    359537  m_lastPicture  = NULL;
     538#endif
    360539  m_picActualHeaderBits = 0;
     540#if !M0036_RC_IMPROVEMENT
    361541  m_totalMAD            = 0.0;
     542#endif
    362543  m_picActualBits       = 0;
    363544  m_picQP               = 0;
     
    384565  }
    385566
     567#if M0036_RC_IMPROVEMENT
     568  targetBits  = Int( ((Double)GOPbitsLeft) * currPicRatio / totalPicRatio );
     569#else
    386570  targetBits  = Int( GOPbitsLeft * currPicRatio / totalPicRatio );
     571#endif
    387572
    388573  if ( targetBits < 100 )
     
    480665      m_LCUs[LCUIdx].m_lambda     = 0.0;
    481666      m_LCUs[LCUIdx].m_targetBits = 0;
     667#if M0036_RC_IMPROVEMENT
     668      m_LCUs[LCUIdx].m_bitWeight  = 1.0;
     669#else
    482670      m_LCUs[LCUIdx].m_MAD        = 0.0;
     671#endif
    483672      Int currWidth  = ( (i == picWidthInLCU -1) ? picWidth  - LCUWidth *(picWidthInLCU -1) : LCUWidth  );
    484673      Int currHeight = ( (j == picHeightInLCU-1) ? picHeight - LCUHeight*(picHeightInLCU-1) : LCUHeight );
     
    487676  }
    488677  m_picActualHeaderBits = 0;
     678#if !M0036_RC_IMPROVEMENT
    489679  m_totalMAD            = 0.0;
     680#endif
    490681  m_picActualBits       = 0;
    491682  m_picQP               = 0;
    492683  m_picLambda           = 0.0;
    493684
     685#if !M0036_RC_IMPROVEMENT
    494686  m_lastPicture = NULL;
    495687  list<TEncRCPic*>::reverse_iterator it;
     
    502694    }
    503695  }
     696#endif
    504697}
    505698
     
    515708}
    516709
     710
     711#if RATE_CONTROL_INTRA
     712Double TEncRCPic::estimatePicLambda( list<TEncRCPic*>& listPreviousPictures, SliceType eSliceType)
     713#else
    517714Double TEncRCPic::estimatePicLambda( list<TEncRCPic*>& listPreviousPictures )
     715#endif
    518716{
    519717  Double alpha         = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha;
    520718  Double beta          = m_encRCSeq->getPicPara( m_frameLevel ).m_beta;
    521719  Double bpp       = (Double)m_targetBits/(Double)m_numberOfPixel;
     720#if RATE_CONTROL_INTRA
     721  Double estLambda;
     722  if (eSliceType == I_SLICE)
     723  {
     724    estLambda = calculateLambdaIntra(alpha, beta, pow(m_totalCostIntra/(Double)m_numberOfPixel, BETA1), bpp);
     725  }
     726  else
     727  {
     728    estLambda = alpha * pow( bpp, beta );
     729  }
     730#else
    522731  Double estLambda = alpha * pow( bpp, beta );
     732#endif 
     733 
    523734  Double lastLevelLambda = -1.0;
    524735  Double lastPicLambda   = -1.0;
     
    566777
    567778  m_estPicLambda = estLambda;
     779
     780#if M0036_RC_IMPROVEMENT
     781  Double totalWeight = 0.0;
     782  // initial BU bit allocation weight
     783  for ( Int i=0; i<m_numberOfLCU; i++ )
     784  {
     785#if RC_FIX
     786    Double alphaLCU, betaLCU;
     787    if ( m_encRCSeq->getUseLCUSeparateModel() )
     788    {
     789      alphaLCU = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_alpha;
     790      betaLCU  = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_beta;
     791    }
     792    else
     793    {
     794      alphaLCU = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha;
     795      betaLCU  = m_encRCSeq->getPicPara( m_frameLevel ).m_beta;
     796    }
     797#else
     798    Double alphaLCU = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_alpha;
     799    Double betaLCU  = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_beta;
     800#endif
     801
     802    m_LCUs[i].m_bitWeight =  m_LCUs[i].m_numberOfPixel * pow( estLambda/alphaLCU, 1.0/betaLCU );
     803
     804    if ( m_LCUs[i].m_bitWeight < 0.01 )
     805    {
     806      m_LCUs[i].m_bitWeight = 0.01;
     807    }
     808    totalWeight += m_LCUs[i].m_bitWeight;
     809  }
     810  for ( Int i=0; i<m_numberOfLCU; i++ )
     811  {
     812    Double BUTargetBits = m_targetBits * m_LCUs[i].m_bitWeight / totalWeight;
     813    m_LCUs[i].m_bitWeight = BUTargetBits;
     814  }
     815#endif
     816
    568817  return estLambda;
    569818}
     
    607856}
    608857
     858#if RATE_CONTROL_INTRA
     859Double TEncRCPic::getLCUTargetBpp(SliceType eSliceType) 
     860#else
    609861Double TEncRCPic::getLCUTargetBpp()
     862#endif
    610863{
    611864  Int   LCUIdx    = getLCUCoded();
    612865  Double bpp      = -1.0;
    613866  Int avgBits     = 0;
     867#if !M0036_RC_IMPROVEMENT
    614868  Double totalMAD = -1.0;
    615869  Double MAD      = -1.0;
    616 
     870#endif
     871
     872#if RATE_CONTROL_INTRA
     873  if (eSliceType == I_SLICE){
     874    Int noOfLCUsLeft = m_numberOfLCU - LCUIdx + 1;
     875    Int bitrateWindow = min(4,noOfLCUsLeft);
     876    Double MAD      = getLCU(LCUIdx).m_costIntra;
     877
     878    if (m_remainingCostIntra > 0.1 )
     879    {
     880      Double weightedBitsLeft = (m_bitsLeft*bitrateWindow+(m_bitsLeft-getLCU(LCUIdx).m_targetBitsLeft)*noOfLCUsLeft)/(Double)bitrateWindow;
     881      avgBits = Int( MAD*weightedBitsLeft/m_remainingCostIntra );
     882    }
     883    else
     884    {
     885      avgBits = Int( m_bitsLeft / m_LCULeft );
     886    }
     887    m_remainingCostIntra -= MAD;
     888  }
     889  else
     890  {
     891#endif
     892#if M0036_RC_IMPROVEMENT
     893  Double totalWeight = 0;
     894  for ( Int i=LCUIdx; i<m_numberOfLCU; i++ )
     895  {
     896    totalWeight += m_LCUs[i].m_bitWeight;
     897  }
     898  Int realInfluenceLCU = min( g_RCLCUSmoothWindowSize, getLCULeft() );
     899  avgBits = (Int)( m_LCUs[LCUIdx].m_bitWeight - ( totalWeight - m_bitsLeft ) / realInfluenceLCU + 0.5 );
     900#else
    617901  if ( m_lastPicture == NULL )
    618902  {
     
    637921    }
    638922  }
    639 
    640 #if L0033_RC_BUGFIX
     923#endif
     924#if RATE_CONTROL_INTRA
     925  }
     926#endif
     927
    641928  if ( avgBits < 1 )
    642929  {
    643930    avgBits = 1;
    644931  }
    645 #else
    646   if ( avgBits < 5 )
    647   {
    648     avgBits = 5;
    649   }
    650 #endif
    651932
    652933  bpp = ( Double )avgBits/( Double )m_LCUs[ LCUIdx ].m_numberOfPixel;
     
    716997  //for Lambda clip, LCU level clip
    717998  Int clipNeighbourQP = g_RCInvalidQPValue;
    718 #if L0033_RC_BUGFIX
    719999  for ( int i=LCUIdx - 1; i>=0; i-- )
    720 #else
    721   for ( int i=LCUIdx; i>=0; i-- )
    722 #endif
    7231000  {
    7241001    if ( (getLCU(i)).m_QP > g_RCInvalidQPValue )
     
    7731050    beta  *= ( 1.0 - m_encRCSeq->getBetaUpdate() / 2.0 );
    7741051
     1052#if M0036_RC_IMPROVEMENT
     1053    alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha );
     1054    beta  = Clip3( g_RCBetaMinValue,  g_RCBetaMaxValue,  beta  );
     1055#else
    7751056    alpha = Clip3( 0.05, 20.0, alpha );
    7761057    beta  = Clip3( -3.0, -0.1, beta  );
     1058#endif
    7771059
    7781060    TRCParameter rcPara;
     
    7871069  alpha += m_encRCSeq->getAlphaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * alpha;
    7881070  double lnbpp = log( bpp );
     1071#if M0036_RC_IMPROVEMENT
     1072  lnbpp = Clip3( -5.0, -0.1, lnbpp );
     1073#else
    7891074  lnbpp = Clip3( -5.0, 1.0, lnbpp );
     1075#endif
    7901076  beta  += m_encRCSeq->getBetaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * lnbpp;
    7911077
     1078#if M0036_RC_IMPROVEMENT
     1079  alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha );
     1080  beta  = Clip3( g_RCBetaMinValue,  g_RCBetaMaxValue,  beta  );
     1081#else
    7921082  alpha = Clip3( 0.05, 20.0, alpha );
    7931083  beta  = Clip3( -3.0, -0.1, beta  );
     1084#endif
    7941085  TRCParameter rcPara;
    7951086  rcPara.m_alpha = alpha;
     
    7991090}
    8001091
     1092#if !M0036_RC_IMPROVEMENT
    8011093Double TEncRCPic::getEffectivePercentage()
    8021094{
     
    8161108  return effectivePixelPercentage;
    8171109}
     1110#endif
    8181111
    8191112Double TEncRCPic::calAverageQP()
     
    8711164}
    8721165
     1166#if M0036_RC_IMPROVEMENT
     1167#if RATE_CONTROL_INTRA
     1168Void TEncRCPic::updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, SliceType eSliceType)
     1169#else
     1170Void TEncRCPic::updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda )
     1171#endif
     1172#else
    8731173Void TEncRCPic::updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, Double effectivePercentage )
     1174#endif
    8741175{
    8751176  m_picActualHeaderBits = actualHeaderBits;
     
    8841185  }
    8851186  m_picLambda           = averageLambda;
     1187#if !M0036_RC_IMPROVEMENT
    8861188  for ( Int i=0; i<m_numberOfLCU; i++ )
    8871189  {
    8881190    m_totalMAD += m_LCUs[i].m_MAD;
    8891191  }
     1192#endif
    8901193
    8911194  Double alpha = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha;
    8921195  Double beta  = m_encRCSeq->getPicPara( m_frameLevel ).m_beta;
    893 
     1196#if RATE_CONTROL_INTRA
     1197  if (eSliceType == I_SLICE)
     1198  {
     1199    updateAlphaBetaIntra(&alpha, &beta);
     1200  }
     1201  else
     1202  {
     1203#endif
    8941204  // update parameters
    8951205  Double picActualBits = ( Double )m_picActualBits;
     
    8981208  Double inputLambda   = m_picLambda;
    8991209
     1210#if M0036_RC_IMPROVEMENT
     1211  if ( inputLambda < 0.01 || calLambda < 0.01 || picActualBpp < 0.0001 )
     1212#else
    9001213  if ( inputLambda < 0.01 || calLambda < 0.01 || picActualBpp < 0.0001 || effectivePercentage < 0.05 )
     1214#endif
    9011215  {
    9021216    alpha *= ( 1.0 - m_encRCSeq->getAlphaUpdate() / 2.0 );
    9031217    beta  *= ( 1.0 - m_encRCSeq->getBetaUpdate() / 2.0 );
    9041218
     1219#if M0036_RC_IMPROVEMENT
     1220    alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha );
     1221    beta  = Clip3( g_RCBetaMinValue,  g_RCBetaMaxValue,  beta  );
     1222#else
    9051223    alpha = Clip3( 0.05, 20.0, alpha );
    9061224    beta  = Clip3( -3.0, -0.1, beta  );
     1225#endif
    9071226    TRCParameter rcPara;
    9081227    rcPara.m_alpha = alpha;
     
    9161235  alpha += m_encRCSeq->getAlphaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * alpha;
    9171236  double lnbpp = log( picActualBpp );
     1237#if M0036_RC_IMPROVEMENT
     1238  lnbpp = Clip3( -5.0, -0.1, lnbpp );
     1239#else
    9181240  lnbpp = Clip3( -5.0, 1.0, lnbpp );
     1241#endif
    9191242  beta  += m_encRCSeq->getBetaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * lnbpp;
    9201243
     1244#if M0036_RC_IMPROVEMENT
     1245  alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha );
     1246  beta  = Clip3( g_RCBetaMinValue,  g_RCBetaMaxValue,  beta  );
     1247#else
    9211248  alpha = Clip3( 0.05, 20.0, alpha );
    9221249  beta  = Clip3( -3.0, -0.1, beta  );
     1250#endif
     1251#if RATE_CONTROL_INTRA
     1252  }
     1253#endif
    9231254
    9241255  TRCParameter rcPara;
     
    9271258
    9281259  m_encRCSeq->setPicPara( m_frameLevel, rcPara );
    929 }
     1260
     1261#if M0036_RC_IMPROVEMENT
     1262  if ( m_frameLevel == 1 )
     1263  {
     1264    Double currLambda = Clip3( 0.1, 10000.0, m_picLambda );
     1265    Double updateLastLambda = g_RCWeightHistoryLambda * m_encRCSeq->getLastLambda() + g_RCWeightCurrentLambda * currLambda;
     1266    m_encRCSeq->setLastLambda( updateLastLambda );
     1267  }
     1268#endif
     1269}
     1270
     1271#if RATE_CONTROL_INTRA
     1272Int TEncRCPic::getRefineBitsForIntra( Int orgBits )
     1273{
     1274  Double alpha=0.25, beta=0.5582;
     1275  Int iIntraBits;
     1276
     1277  if (orgBits*40 < m_numberOfPixel)
     1278  {
     1279    alpha=0.25;
     1280  }
     1281  else
     1282  {
     1283    alpha=0.30;
     1284  }
     1285
     1286  iIntraBits = (Int)(alpha* pow(m_totalCostIntra*4.0/(Double)orgBits, beta)*(Double)orgBits+0.5);
     1287 
     1288  return iIntraBits;
     1289}
     1290
     1291Double TEncRCPic::calculateLambdaIntra(double alpha, double beta, double MADPerPixel, double bitsPerPixel)
     1292{
     1293  return ( (alpha/256.0) * pow( MADPerPixel/bitsPerPixel, beta ) );
     1294}
     1295
     1296Void TEncRCPic::updateAlphaBetaIntra(double *alpha, double *beta)
     1297{
     1298  Double lnbpp = log(pow(m_totalCostIntra / (Double)m_numberOfPixel, BETA1));
     1299  Double diffLambda = (*beta)*(log((Double)m_picActualBits)-log((Double)m_targetBits));
     1300
     1301  diffLambda = Clip3(-0.125, 0.125, 0.25*diffLambda);
     1302  *alpha    =  (*alpha) * exp(diffLambda);
     1303  *beta     =  (*beta) + diffLambda / lnbpp;
     1304}
     1305
     1306
     1307Void TEncRCPic::getLCUInitTargetBits() 
     1308{
     1309  Int iAvgBits     = 0;
     1310
     1311  m_remainingCostIntra = m_totalCostIntra;
     1312  for (Int i=m_numberOfLCU-1; i>=0; i--)
     1313  {
     1314    iAvgBits += Int(m_targetBits * getLCU(i).m_costIntra/m_totalCostIntra);
     1315    getLCU(i).m_targetBitsLeft = iAvgBits;
     1316  }
     1317}
     1318
     1319
     1320Double TEncRCPic::getLCUEstLambdaAndQP(Double bpp, Int clipPicQP, Int *estQP)
     1321{
     1322  Int   LCUIdx = getLCUCoded();
     1323
     1324  Double   alpha = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha;
     1325  Double   beta  = m_encRCSeq->getPicPara( m_frameLevel ).m_beta;
     1326
     1327  Double costPerPixel = getLCU(LCUIdx).m_costIntra/(Double)getLCU(LCUIdx).m_numberOfPixel;
     1328  costPerPixel = pow(costPerPixel, BETA1);
     1329  Double estLambda = calculateLambdaIntra(alpha, beta, costPerPixel, bpp);
     1330
     1331  Int clipNeighbourQP = g_RCInvalidQPValue;
     1332  for (int i=LCUIdx-1; i>=0; i--)
     1333  {
     1334    if ((getLCU(i)).m_QP > g_RCInvalidQPValue)
     1335    {
     1336      clipNeighbourQP = getLCU(i).m_QP;
     1337      break;
     1338    }
     1339  }
     1340
     1341  Int minQP = clipPicQP - 2;
     1342  Int maxQP = clipPicQP + 2;
     1343
     1344  if ( clipNeighbourQP > g_RCInvalidQPValue )
     1345  {
     1346    maxQP = min(clipNeighbourQP + 1, maxQP);
     1347    minQP = max(clipNeighbourQP - 1, minQP);
     1348  }
     1349
     1350  Double maxLambda=exp(((Double)(maxQP+0.49)-13.7122)/4.2005);
     1351  Double minLambda=exp(((Double)(minQP-0.49)-13.7122)/4.2005);
     1352
     1353  estLambda = Clip3(minLambda, maxLambda, estLambda);
     1354
     1355  *estQP = Int( 4.2005 * log(estLambda) + 13.7122 + 0.5 );
     1356  *estQP = Clip3(minQP, maxQP, *estQP);
     1357
     1358  return estLambda;
     1359}
     1360#endif
    9301361
    9311362TEncRateCtrl::TEncRateCtrl()
     
    9611392}
    9621393
     1394#if M0036_RC_IMPROVEMENT
     1395Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry  GOPList[MAX_GOP] )
     1396#else
    9631397Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry  GOPList[MAX_GOP] )
     1398#endif
    9641399{
    9651400  destroy();
     
    9761411
    9771412  Int numberOfLevel = 1;
     1413#if M0036_RC_IMPROVEMENT
     1414  Int adaptiveBit = 0;
     1415  if ( keepHierBits > 0 )
     1416#else
    9781417  if ( keepHierBits )
     1418#endif
    9791419  {
    9801420    numberOfLevel = Int( log((Double)GOPSize)/log(2.0) + 0.5 ) + 1;
     
    9981438    }
    9991439  }
     1440
     1441#if M0036_RC_IMPROVEMENT
     1442  if ( keepHierBits > 0 )
     1443#else
    10001444  if ( keepHierBits )
     1445#endif
    10011446  {
    10021447    Double bpp = (Double)( targetBitrate / (Double)( frameRate*picWidth*picHeight ) );
     
    10311476        bitsRatio[3] = 14;
    10321477      }
     1478#if M0036_RC_IMPROVEMENT
     1479      if ( keepHierBits == 2 )
     1480      {
     1481        adaptiveBit = 1;
     1482      }
     1483#endif
    10331484    }
    10341485    else if ( GOPSize == 8 && !isLowdelay )
     
    10781529        bitsRatio[7] = 1;
    10791530      }
     1531#if M0036_RC_IMPROVEMENT
     1532      if ( keepHierBits == 2 )
     1533      {
     1534        adaptiveBit = 2;
     1535      }
     1536#endif
    10801537    }
    10811538    else
    10821539    {
     1540#if M0036_RC_IMPROVEMENT
     1541      printf( "\n hierarchical bit allocation is not support for the specified coding structure currently.\n" );
     1542#else
    10831543      printf( "\n hierarchical bit allocation is not support for the specified coding structure currently." );
     1544#endif
    10841545    }
    10851546  }
     
    10941555    }
    10951556  }
     1557#if M0036_RC_IMPROVEMENT
     1558  if ( keepHierBits > 0 )
     1559#else
    10961560  if ( keepHierBits )
     1561#endif
    10971562  {
    10981563    if ( GOPSize == 4 && isLowdelay )
     
    11291594
    11301595  m_encRCSeq = new TEncRCSeq;
     1596#if M0036_RC_IMPROVEMENT
     1597  m_encRCSeq->create( totalFrames, targetBitrate, frameRate, GOPSize, picWidth, picHeight, LCUWidth, LCUHeight, numberOfLevel, useLCUSeparateModel, adaptiveBit );
     1598#else
    11311599  m_encRCSeq->create( totalFrames, targetBitrate, frameRate, GOPSize, picWidth, picHeight, LCUWidth, LCUHeight, numberOfLevel, useLCUSeparateModel );
     1600#endif
    11321601  m_encRCSeq->initBitsRatio( bitsRatio );
    11331602  m_encRCSeq->initGOPID2Level( GOPID2Level );
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncRateCtrl.h

    r324 r537  
    6565const Double g_RCWeightPicTargetBitInGOP    = 0.9;
    6666const Double g_RCWeightPicRargetBitInBuffer = 1.0 - g_RCWeightPicTargetBitInGOP;
     67#if M0036_RC_IMPROVEMENT
     68const Int g_RCIterationNum = 20;
     69const Double g_RCWeightHistoryLambda = 0.5;
     70const Double g_RCWeightCurrentLambda = 1.0 - g_RCWeightHistoryLambda;
     71const Int g_RCLCUSmoothWindowSize = 4;
     72const Double g_RCAlphaMinValue = 0.05;
     73const Double g_RCAlphaMaxValue = 500.0;
     74const Double g_RCBetaMinValue  = -3.0;
     75const Double g_RCBetaMaxValue  = -0.1;
     76#endif
     77
     78#if RATE_CONTROL_INTRA
     79#define ALPHA     6.7542;
     80#define BETA1     1.2517
     81#define BETA2     1.7860
     82#endif
    6783
    6884struct TRCLCU
     
    7288  Int m_targetBits;
    7389  Double m_lambda;
     90#if M0036_RC_IMPROVEMENT
     91  Double m_bitWeight;
     92#else
    7493  Double m_MAD;
     94#endif
    7595  Int m_numberOfPixel;
     96#if RATE_CONTROL_INTRA
     97  Double m_costIntra;
     98  Int m_targetBitsLeft;
     99#endif
    76100};
    77101
     
    89113
    90114public:
     115#if M0036_RC_IMPROVEMENT
     116  Void create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel, Int adaptiveBit );
     117#else
    91118  Void create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel );
     119#endif
    92120  Void destroy();
    93121  Void initBitsRatio( Int bitsRatio[] );
     
    96124  Void initLCUPara( TRCParameter** LCUPara = NULL );    // NULL to initial with default value
    97125  Void updateAfterPic ( Int bits );
     126#if !RATE_CONTROL_INTRA
    98127  Int  getRefineBitsForIntra( Int orgBits );
     128#endif
     129#if M0036_RC_IMPROVEMENT
     130  Void setAllBitRatio( Double basicLambda, Double* equaCoeffA, Double* equaCoeffB );
     131#endif
    99132
    100133public:
     
    134167  Double getBetaUpdate()                { return m_betaUpdate; }
    135168
     169#if M0036_RC_IMPROVEMENT
     170  Int    getAdaptiveBits()              { return m_adaptiveBit;  }
     171  Double getLastLambda()                { return m_lastLambda;   }
     172  Void   setLastLambda( Double lamdba ) { m_lastLambda = lamdba; }
     173#endif
     174
    136175private:
    137176  Int m_totalFrames;
     
    160199  Double m_betaUpdate;
    161200  Bool m_useLCUSeparateModel;
     201
     202#if M0036_RC_IMPROVEMENT
     203  Int m_adaptiveBit;
     204  Double m_lastLambda;
     205#endif
    162206};
    163207
     
    175219private:
    176220  Int  xEstGOPTargetBits( TEncRCSeq* encRCSeq, Int GOPSize );
     221#if M0036_RC_IMPROVEMENT
     222  Void   xCalEquaCoeff( TEncRCSeq* encRCSeq, Double* lambdaRatio, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize );
     223  Double xSolveEqua( Double targetBpp, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize );
     224#endif
    177225
    178226public:
     
    203251  Void destroy();
    204252
     253#if !RATE_CONTROL_INTRA
    205254  Double estimatePicLambda( list<TEncRCPic*>& listPreviousPictures );
     255#endif
    206256  Int    estimatePicQP    ( Double lambda, list<TEncRCPic*>& listPreviousPictures );
     257#if RATE_CONTROL_INTRA
     258  Int    getRefineBitsForIntra(Int orgBits);
     259  Double calculateLambdaIntra(double alpha, double beta, double MADPerPixel, double bitsPerPixel);
     260  Double estimatePicLambda( list<TEncRCPic*>& listPreviousPictures, SliceType eSliceType);
     261
     262  Void   updateAlphaBetaIntra(double *alpha, double *beta);
     263
     264  Double getLCUTargetBpp(SliceType eSliceType);
     265  Double getLCUEstLambdaAndQP(Double bpp, Int clipPicQP, Int *estQP);
     266#else
    207267  Double getLCUTargetBpp();
     268#endif
    208269  Double getLCUEstLambda( Double bpp );
    209270  Int    getLCUEstQP( Double lambda, Int clipPicQP );
    210271
    211272  Void updateAfterLCU( Int LCUIdx, Int bits, Int QP, Double lambda, Bool updateLCUParameter = true );
     273#if M0036_RC_IMPROVEMENT
     274#if RATE_CONTROL_INTRA
     275  Void updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, SliceType eSliceType);
     276#else
     277  Void updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda );
     278#endif
     279#else
    212280  Void updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, Double effectivePercentage );
     281#endif
    213282
    214283  Void addToPictureLsit( list<TEncRCPic*>& listPreviousPictures );
     284#if !M0036_RC_IMPROVEMENT
    215285  Double getEffectivePercentage();
     286#endif
    216287  Double calAverageQP();
    217288  Double calAverageLambda();
     
    229300  Int  getNumberOfLCU()                                   { return m_numberOfLCU; }
    230301  Int  getTargetBits()                                    { return m_targetBits; }
     302#if !RATE_CONTROL_INTRA
    231303  Void setTargetBits( Int bits )                          { m_targetBits = bits; }
     304#endif
    232305  Int  getEstHeaderBits()                                 { return m_estHeaderBits; }
    233306  Int  getLCULeft()                                       { return m_LCULeft; }
     
    239312  TRCLCU& getLCU( Int LCUIdx )                            { return m_LCUs[LCUIdx]; }
    240313  Int  getPicActualHeaderBits()                           { return m_picActualHeaderBits; }
     314#if !M0036_RC_IMPROVEMENT
    241315  Double getTotalMAD()                                    { return m_totalMAD; }
    242316  Void   setTotalMAD( Double MAD )                        { m_totalMAD = MAD; }
     317#endif
     318#if RATE_CONTROL_INTRA
     319  Void setTargetBits( Int bits )                          { m_targetBits = bits; m_bitsLeft = bits;}
     320  Void setTotalIntraCost(Double cost)                     { m_totalCostIntra = cost; }
     321  Void getLCUInitTargetBits();
     322#endif
     323
    243324  Int  getPicActualBits()                                 { return m_picActualBits; }
    244325  Int  getPicActualQP()                                   { return m_picQP; }
     
    267348  TRCLCU* m_LCUs;
    268349  Int m_picActualHeaderBits;    // only SH and potential APS
     350#if !M0036_RC_IMPROVEMENT
    269351  Double m_totalMAD;
     352#endif
     353#if RATE_CONTROL_INTRA
     354  Double m_totalCostIntra;
     355  Double m_remainingCostIntra;
     356#endif
    270357  Int m_picActualBits;          // the whole picture, including header
    271358  Int m_picQP;                  // in integer form
    272359  Double m_picLambda;
     360#if !M0036_RC_IMPROVEMENT
    273361  TEncRCPic* m_lastPicture;
     362#endif
    274363};
    275364
     
    281370
    282371public:
     372#if M0036_RC_IMPROVEMENT
     373  Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] );
     374#else
    283375  Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] );
     376#endif
    284377  Void destroy();
    285378  Void initRCPic( Int frameLevel );
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r446 r537  
    299299        m_iTypePartBest[iPartIdx] = -1;
    300300        if( m_bUseSBACRD )
     301        {
    301302          m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[pOnePart->PartLevel][CI_TEMP_BEST] );
     303        }
    302304      }
    303305    }
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp

    r532 r537  
    10671067    }
    10681068#endif
    1069 
    10701069    // save prediction
    10711070    if(default0Save1Load2 == 1)
     
    14271426#if H_3D_DIM_ENC
    14281427                                , Bool        zeroResi
    1429 #endif
    1430                                 )
     1428#endif                               
     1429)
    14311430{
    14321431  UInt    uiFullDepth   = pcCU->getDepth( 0 ) +  uiTrDepth;
     
    14361435 
    14371436#if HHI_RQT_INTRA_SPEEDUP
    1438 #if L0232_RD_PENALTY
    14391437  Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
    14401438  Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE);
     
    14531451  }
    14541452  if( bCheckFirst && noSplitIntraMaxTuSize )
     1453  {
     1454    bCheckSplit = false;
     1455  }
    14551456#else
    1456   if( bCheckFirst && bCheckFull )
    1457 #endif
    1458   {
    1459     bCheckSplit = false;
    1460   }
    1461 #else
    1462 #if L0232_RD_PENALTY
    14631457  Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
    14641458  Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE);
     
    14691463  }
    14701464#endif
    1471 #endif
    14721465#if H_3D_DIM
    14731466  if( isDimMode( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) )
     
    14761469  }
    14771470#endif
    1478 
    14791471  Double  dSingleCost   = MAX_DOUBLE;
    14801472#if H_3D_VSO
     
    16671659      //----- determine rate and r-d cost -----
    16681660      UInt uiSingleBits = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false );
    1669 #if L0232_RD_PENALTY
    16701661      if(m_pcEncCfg->getRDpenalty() && (uiLog2TrSize==5) && !isIntraSlice)
    16711662      {
    16721663        uiSingleBits=uiSingleBits*4;
    16731664      }
    1674 #endif
    16751665#if H_3D_VSO // M40
    16761666      if ( m_pcRdCost->getUseLambdaScaleVSO())     
     
    18231813    }
    18241814  }
    1825 
    18261815#if H_3D_VSO // M42
    18271816  if ( m_pcRdCost->getUseRenModel() && bCheckFull )
     
    18361825  }
    18371826#endif
    1838 
    18391827  ruiDistY += uiSingleDistY;
    18401828  ruiDistC += uiSingleDistC;
     
    27882776       
    27892777        UInt   iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth );
    2790 
    2791      
    27922778#if H_3D_VSO // M35
    27932779#if H_3D_VSO_FIX // This fix should be enabled after verification
     
    29242910    }
    29252911#endif
    2926 
    29272912    //===== check modes (using r-d costs) =====
    29282913#if HHI_RQT_INTRA_SPEEDUP_MOD
     
    31123097      UInt   uiPUDistC = 0;
    31133098      Double dPUCost   = 0.0;
    3114 
    31153099#if H_3D_VSO // M37
    31163100      // reset Model
     
    31643148    {
    31653149#endif
    3166    
    3167     //--- update transform index and cbf ---
     3150        //--- update transform index and cbf ---
    31683151    UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 );
    31693152    ::memcpy( pcCU->getTransformIdx()       + uiPartOffset, m_puhQTTempTrIdx,  uiQPartNum * sizeof( UChar ) );
     
    37643747    UInt          uiBitsTempL0[MAX_NUM_REF];
    37653748
    3766 #if L0034_COMBINED_LIST_CLEANUP
    37673749    TComMv        mvValidList1;
    37683750    Int           refIdxValidList1 = 0;
    37693751    UInt          bitsValidList1 = MAX_UINT;
    37703752    UInt          costValidList1 = MAX_UINT;
    3771 #endif
    37723753
    37733754    xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits);
     
    38213802        uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
    38223803#if ZERO_MVD_EST
    3823 #if L0034_COMBINED_LIST_CLEANUP
    38243804        if ( iRefList == 0 || pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 )
    3825 #else
    3826         if ((iRefList != 1 || !pcCU->getSlice()->getNoBackPredFlag()) &&
    3827             (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) <= 0 || pcCU->getSlice()->getRefIdxOfLC(eRefPicList, iRefIdxTemp)>=0))
    3828 #endif
    38293805        {
    38303806          uiZeroMvdBitsTemp = uiBitsTemp;
     
    38463822       
    38473823#if GPB_SIMPLE_UNI
    3848 #if L0034_COMBINED_LIST_CLEANUP
    38493824        if ( iRefList == 1 )    // list 1
    38503825        {
     
    38713846        }
    38723847#else
    3873         if ( pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0)
    3874         {
    3875           if ( iRefList && ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag() && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)>=0 ) ) )
    3876             {
    3877               if ( pcCU->getSlice()->getNoBackPredFlag() )
    3878               {
    3879                 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];
    3880                 uiCostTemp = uiCostTempL0[iRefIdxTemp];
    3881                 /*first subtract the bit-rate part of the cost of the other list*/
    3882                 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[iRefIdxTemp] );
    3883               }
    3884               else
    3885               {
    3886                 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];
    3887                 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];
    3888                 /*first subtract the bit-rate part of the cost of the other list*/
    3889                 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] );
    3890               }
    3891               /*correct the bit-rate part of the current ref*/
    3892               m_pcRdCost->setPredictor  ( cMvPred[iRefList][iRefIdxTemp] );
    3893               uiBitsTemp += m_pcRdCost->getBits( cMvTemp[1][iRefIdxTemp].getHor(), cMvTemp[1][iRefIdxTemp].getVer() );
    3894               /*calculate the correct cost*/
    3895               uiCostTemp += m_pcRdCost->getCost( uiBitsTemp );
    3896             }
    3897             else
    3898             {
    3899               xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    3900             }
    3901         }
    3902         else
    3903         {
    3904           if (iRefList && pcCU->getSlice()->getNoBackPredFlag())
    3905           {
    3906             uiCostTemp = MAX_UINT;
    3907             cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];
    3908           }
    3909           else
    3910           {
    3911             xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    3912           }       
    3913         }
    3914 #endif
    3915 #else
    39163848        xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
    39173849#endif
     
    39193851        xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    39203852
    3921 #if L0034_COMBINED_LIST_CLEANUP
    39223853        if ( iRefList == 0 )
    39233854        {
     
    39443875          refIdxValidList1 = iRefIdxTemp;
    39453876        }
    3946 #else
    3947         if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag())
    3948         {
    3949           if(iRefList==REF_PIC_LIST_0)
    3950           {
    3951             uiCostTempL0[iRefIdxTemp] = uiCostTemp;
    3952             uiBitsTempL0[iRefIdxTemp] = uiBitsTemp;
    3953             if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_0, iRefIdxTemp)<0)
    3954             {
    3955               uiCostTemp = MAX_UINT;
    3956             }
    3957           }
    3958           else
    3959           {
    3960             if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_1, iRefIdxTemp)<0)
    3961             {
    3962               uiCostTemp = MAX_UINT;
    3963             }           
    3964           }
    3965         }
    3966 
    3967         if ( ( iRefList == 0 && uiCostTemp < uiCost[iRefList] ) ||
    3968             ( iRefList == 1 &&  pcCU->getSlice()->getNoBackPredFlag() && iRefIdxTemp == iRefIdx[0] ) ||
    3969             ( iRefList == 1 && (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0) && (iRefIdxTemp==0 || iRefIdxTemp == iRefIdx[0]) && !pcCU->getSlice()->getNoBackPredFlag() && (iRefIdxTemp == pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)) ) ||
    3970             ( iRefList == 1 && !pcCU->getSlice()->getNoBackPredFlag() && uiCostTemp < uiCost[iRefList] ) )
    3971           {
    3972             uiCost[iRefList] = uiCostTemp;
    3973             uiBits[iRefList] = uiBitsTemp; // storing for bi-prediction
    3974            
    3975             // set motion
    3976             cMv[iRefList]     = cMvTemp[iRefList][iRefIdxTemp];
    3977             iRefIdx[iRefList] = iRefIdxTemp;
    3978             pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );
    3979             pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );
    3980 
    3981             if(!pcCU->getSlice()->getMvdL1ZeroFlag())
    3982             {
    3983               // storing list 1 prediction signal for iterative bi-directional prediction
    3984               if ( eRefPicList == REF_PIC_LIST_1 )
    3985               {
    3986                 TComYuv*  pcYuvPred = &m_acYuvPred[iRefList];
    3987                 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );
    3988               }
    3989               if ( (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) && eRefPicList == REF_PIC_LIST_0 )
    3990               {
    3991                 TComYuv*  pcYuvPred = &m_acYuvPred[iRefList];
    3992                 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );
    3993               }
    3994             }
    3995           }
    3996 #endif
    39973877      }
    39983878    }
     
    40583938       
    40593939        Int         iRefList    = iIter % 2;
    4060 #if L0034_COMBINED_LIST_CLEANUP
    40613940        if ( m_pcEncCfg->getUseFastEnc() )
    40623941        {
     
    40813960          motionCompensation ( pcCU, pcYuvPred, RefPicList(1-iRefList), iPartIdx );
    40823961        }
    4083 #else
    4084         if ( m_pcEncCfg->getUseFastEnc() && (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) )
    4085         {
    4086           iRefList = 1;
    4087         }
    4088 #endif
    40893962        RefPicList  eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
    40903963
     
    42214094    UInt uiMEBits = 0;
    42224095    // Set Motion Field_
    4223 #if L0034_COMBINED_LIST_CLEANUP
    42244096    cMv[1] = mvValidList1;
    42254097    iRefIdx[1] = refIdxValidList1;
    42264098    uiBits[1] = bitsValidList1;
    42274099    uiCost[1] = costValidList1;
    4228 #else
    4229     if ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 ) )
    4230     {
    4231       uiCost[1] = MAX_UINT;
    4232     }
    4233 #endif
    42344100#if AMP_MRG
    42354101    if (bTestNormalMC)
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp

    r521 r537  
    475475#endif
    476476
    477 #if L0386_DB_METRIC
    478477  if ( m_pcCfg->getDeblockingFilterMetric() )
    479478  {
     
    483482    rpcSlice->setDeblockingFilterTcOffsetDiv2( 0 );
    484483  } else
    485 #endif
    486484  if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag())
    487485  {
     
    560558  // store lambda
    561559  slice->setSliceQp( sliceQP );
    562 #if L0033_RC_BUGFIX
    563560  slice->setSliceQpBase ( sliceQP );
    564 #endif
    565561  m_pcRdCost ->setLambda( lambda );
    566562#if WEIGHTED_CHROMA_DISTORTION
     
    876872/** \param rpcPic   picture class
    877873 */
     874#if RATE_CONTROL_INTRA
     875Void TEncSlice::calCostSliceI(TComPic*& rpcPic)
     876{
     877  UInt    uiCUAddr;
     878  UInt    uiStartCUAddr;
     879  UInt    uiBoundingCUAddr;
     880  Int     iSumHad, shift = g_bitDepthY-8, offset = (shift>0)?(1<<(shift-1)):0;;
     881  Double  iSumHadSlice = 0;
     882
     883  rpcPic->getSlice(getSliceIdx())->setSliceSegmentBits(0);
     884  TComSlice* pcSlice            = rpcPic->getSlice(getSliceIdx());
     885  xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false );
     886
     887  UInt uiEncCUOrder;
     888  uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU());
     889  for( uiEncCUOrder = uiStartCUAddr/rpcPic->getNumPartInCU();
     890       uiEncCUOrder < (uiBoundingCUAddr+(rpcPic->getNumPartInCU()-1))/rpcPic->getNumPartInCU();
     891       uiCUAddr = rpcPic->getPicSym()->getCUOrderMap(++uiEncCUOrder) )
     892  {
     893    // initialize CU encoder
     894    TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr );
     895    pcCU->initCU( rpcPic, uiCUAddr );
     896
     897    Int height  = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() );
     898    Int width   = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() );
     899
     900    iSumHad = m_pcCuEncoder->updateLCUDataISlice(pcCU, uiCUAddr, width, height);
     901
     902    (m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr)).m_costIntra=(iSumHad+offset)>>shift;
     903    iSumHadSlice += (m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr)).m_costIntra;
     904
     905  }
     906  m_pcRateCtrl->getRCPic()->setTotalIntraCost(iSumHadSlice);
     907}
     908#endif
     909
    878910Void TEncSlice::compressSlice( TComPic*& rpcPic )
    879911{
     
    11611193        Double bpp       = -1.0;
    11621194
     1195#if M0036_RC_IMPROVEMENT
     1196        if ( ( rpcPic->getSlice( 0 )->getSliceType() == I_SLICE && m_pcCfg->getForceIntraQP() ) || !m_pcCfg->getLCULevelRC() )
     1197#else
    11631198        if ( rpcPic->getSlice( 0 )->getSliceType() == I_SLICE || !m_pcCfg->getLCULevelRC() )
     1199#endif
    11641200        {
    11651201          estQP = pcSlice->getSliceQp();
     
    11671203        else
    11681204        {
     1205#if RATE_CONTROL_INTRA
     1206          bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType());
     1207          if ( rpcPic->getSlice( 0 )->getSliceType() == I_SLICE)
     1208          {
     1209            estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambdaAndQP(bpp, pcSlice->getSliceQp(), &estQP);
     1210          }
     1211          else
     1212          {
     1213            estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp );
     1214            estQP     = m_pcRateCtrl->getRCPic()->getLCUEstQP    ( estLambda, pcSlice->getSliceQp() );
     1215          }
     1216#else
    11691217          bpp       = m_pcRateCtrl->getRCPic()->getLCUTargetBpp();
    11701218          estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp );
    11711219          estQP     = m_pcRateCtrl->getRCPic()->getLCUEstQP    ( estLambda, pcSlice->getSliceQp() );
     1220#endif
     1221
    11721222          estQP     = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP );
    11731223
    11741224          m_pcRdCost->setLambda(estLambda);
     1225#if M0036_RC_IMPROVEMENT
     1226#if RDOQ_CHROMA_LAMBDA
     1227          // set lambda for RDOQ
     1228          Double weight=m_pcRdCost->getChromaWeight();
     1229          m_pcTrQuant->setLambda( estLambda, estLambda / weight );
     1230#else
     1231          m_pcTrQuant->setLambda( estLambda );
     1232#endif
     1233#endif
    11751234        }
    11761235
    11771236        m_pcRateCtrl->setRCQP( estQP );
    1178 #if L0033_RC_BUGFIX
    11791237        pcCU->getSlice()->setSliceQpBase( estQP );
    1180 #endif
    11811238      }
    11821239#endif
     
    11851242      m_pcCuEncoder->compressCU( pcCU );
    11861243
     1244#if !TICKET_1090_FIX
    11871245#if RATE_CONTROL_LAMBDA_DOMAIN
    11881246      if ( m_pcCfg->getUseRateCtrl() )
    11891247      {
     1248#if !M0036_RC_IMPROVEMENT
    11901249        UInt SAD    = m_pcCuEncoder->getLCUPredictionSAD();
    11911250        Int height  = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() );
     
    11941253        MAD = MAD * MAD;
    11951254        ( m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr) ).m_MAD = MAD;
     1255#endif
    11961256
    11971257        Int actualQP        = g_RCInvalidQPValue;
     
    12171277        }
    12181278        m_pcRdCost->setLambda(oldLambda);
    1219 
     1279#if RATE_CONTROL_INTRA
     1280        m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda,
     1281          pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() );
     1282#else
    12201283        m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, m_pcCfg->getLCULevelRC() );
    1221       }
     1284#endif
     1285      }
     1286#endif
    12221287#endif
    12231288     
     
    12531318        }
    12541319      }
     1320
     1321#if TICKET_1090_FIX
     1322#if RATE_CONTROL_LAMBDA_DOMAIN
     1323      if ( m_pcCfg->getUseRateCtrl() )
     1324      {
     1325#if !M0036_RC_IMPROVEMENT
     1326        UInt SAD    = m_pcCuEncoder->getLCUPredictionSAD();
     1327        Int height  = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() );
     1328        Int width   = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() );
     1329        Double MAD = (Double)SAD / (Double)(height * width);
     1330        MAD = MAD * MAD;
     1331        ( m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr) ).m_MAD = MAD;
     1332#endif
     1333
     1334        Int actualQP        = g_RCInvalidQPValue;
     1335        Double actualLambda = m_pcRdCost->getLambda();
     1336        Int actualBits      = pcCU->getTotalBits();
     1337        Int numberOfEffectivePixels    = 0;
     1338        for ( Int idx = 0; idx < rpcPic->getNumPartInCU(); idx++ )
     1339        {
     1340          if ( pcCU->getPredictionMode( idx ) != MODE_NONE && ( !pcCU->isSkipped( idx ) ) )
     1341          {
     1342            numberOfEffectivePixels = numberOfEffectivePixels + 16;
     1343            break;
     1344          }
     1345        }
     1346
     1347        if ( numberOfEffectivePixels == 0 )
     1348        {
     1349          actualQP = g_RCInvalidQPValue;
     1350        }
     1351        else
     1352        {
     1353          actualQP = pcCU->getQP( 0 );
     1354        }
     1355        m_pcRdCost->setLambda(oldLambda);
     1356
     1357#if RATE_CONTROL_INTRA
     1358        m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda,
     1359          pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() );
     1360#else
     1361        m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, m_pcCfg->getLCULevelRC() );
     1362#endif
     1363      }
     1364#endif
     1365#endif
    12551366    }
    12561367    // other case: encodeCU is not called
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.h

    r481 r537  
    131131  Void    precompressSlice    ( TComPic*& rpcPic                                );      ///< precompress slice for multi-loop opt.
    132132  Void    compressSlice       ( TComPic*& rpcPic                                );      ///< analysis stage of slice
     133#if RATE_CONTROL_INTRA
     134  Void    calCostSliceI       ( TComPic*& rpcPic );
     135#endif
    133136  Void    encodeSlice         ( TComPic*& rpcPic, TComOutputBitstream* pcSubstreams  );
    134137 
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp

    r534 r537  
    293293  // This seems to be incorrect, but irrelevant for the MV-HEVC
    294294  *(m_cVPS->getPTL()) = *m_cSPS.getPTL();
    295 #if L0043_TIMING_INFO
    296295  m_cVPS->getTimingInfo()->setTimingInfoPresentFlag       ( false );
    297 #endif
    298296#else
    299297  *m_cVPS.getPTL() = *m_cSPS.getPTL();
    300 
    301 #if L0043_TIMING_INFO
    302298  m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( false );
    303 #endif
    304299#endif
    305300  // initialize PPS
     
    532527  profileTierLevel.setProfileIdc(m_profile);
    533528  profileTierLevel.setProfileCompatibilityFlag(m_profile, 1);
    534 #if L0046_CONSTRAINT_FLAGS
    535529  profileTierLevel.setProgressiveSourceFlag(m_progressiveSourceFlag);
    536530  profileTierLevel.setInterlacedSourceFlag(m_interlacedSourceFlag);
    537531  profileTierLevel.setNonPackedConstraintFlag(m_nonPackedConstraintFlag);
    538532  profileTierLevel.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag);
    539 #endif
    540533 
    541534  if (m_profile == Profile::MAIN10 && g_bitDepthY == 8 && g_bitDepthC == 8)
     
    584577
    585578  m_cSPS.setMaxTrSize   ( 1 << m_uiQuadtreeTULog2MaxSize );
    586 #if !L0034_COMBINED_LIST_CLEANUP
    587   m_cSPS.setUseLComb    ( m_bUseLComb           );
    588 #endif
    589579 
    590580  Int i;
     
    651641    pcVUI->setFieldSeqFlag(false);
    652642    pcVUI->setHrdParametersPresentFlag(false);
    653 #if L0043_TIMING_INFO
    654643    pcVUI->getTimingInfo()->setPocProportionalToTimingFlag(getPocProportionalToTimingFlag());
    655644    pcVUI->getTimingInfo()->setNumTicksPocDiffOneMinus1   (getNumTicksPocDiffOneMinus1()   );
    656 #else
    657     pcVUI->setPocProportionalToTimingFlag(getPocProportionalToTimingFlag());
    658     pcVUI->setNumTicksPocDiffOneMinus1   (getNumTicksPocDiffOneMinus1()   );
    659 #endif
    660645    pcVUI->setBitstreamRestrictionFlag(getBitstreamRestrictionFlag());
    661646    pcVUI->setTilesFixedStructureFlag(getTilesFixedStructureFlag());
     
    790775    }
    791776  }
    792 #if L0323_LIMIT_DEFAULT_LIST_SIZE
    793777  assert(bestPos <= 15);
    794 #endif
    795778  m_cPPS.setNumRefIdxL0DefaultActive(bestPos);
    796779  m_cPPS.setNumRefIdxL1DefaultActive(bestPos);
     
    10471030}
    10481031
    1049 #if L0208_SOP_DESCRIPTION_SEI
    10501032Int TEncTop::getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid )
    10511033{
     
    10771059  return rpsIdx;
    10781060}
    1079 #endif
    10801061
    10811062Void  TEncTop::xInitPPSforTiles()
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.h

    r479 r537  
    188188  TComPPS*                getPPS                () { return  &m_cPPS;                 }
    189189  Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid );
    190 #if L0208_SOP_DESCRIPTION_SEI
    191190  Int getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid );
    192 #endif
    193191  TComScalingList*        getScalingList        () { return  &m_scalingList;         }
    194192#if H_MV
Note: See TracChangeset for help on using the changeset viewer.