[x265-commits] [x265] ratecontrol: move validate of CRF params to x265_check_param

Deepthi Nandakumar deepthi at multicorewareinc.com
Tue Jun 17 19:10:52 CEST 2014


details:   http://hg.videolan.org/x265/rev/53fab23c6e5b
branches:  
changeset: 7080:53fab23c6e5b
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Tue Jun 17 12:52:12 2014 +0530
description:
ratecontrol: move validate of CRF params to x265_check_param
Subject: [x265] ratecontrol: [CHANGES OUTPUT for 10-bit CRF] Remove QP_BD_OFFSET from Ratecontrol

details:   http://hg.videolan.org/x265/rev/3a19a9fdb103
branches:  
changeset: 7081:3a19a9fdb103
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Tue Jun 17 14:07:26 2014 +0530
description:
ratecontrol: [CHANGES OUTPUT for 10-bit CRF] Remove QP_BD_OFFSET from Ratecontrol

This offset is added inside Quant (setQPforQuant)
Subject: [x265] bitstream: give bit counter a useful constructor

details:   http://hg.videolan.org/x265/rev/f9fef6da4da6
branches:  
changeset: 7082:f9fef6da4da6
user:      Steve Borho <steve at borho.org>
date:      Tue Jun 17 01:16:00 2014 -0500
description:
bitstream: give bit counter a useful constructor
Subject: [x265] sei: first step towards simplifying SEI writing

details:   http://hg.videolan.org/x265/rev/9d43b41eb529
branches:  
changeset: 7083:9d43b41eb529
user:      Steve Borho <steve at borho.org>
date:      Tue Jun 17 00:15:25 2014 -0500
description:
sei: first step towards simplifying SEI writing
Subject: [x265] psyrd: use psyrdcost for PU/TU decision for inter and intra

details:   http://hg.videolan.org/x265/rev/2b514f3f6e1f
branches:  
changeset: 7084:2b514f3f6e1f
user:      Sumalatha Polureddy<sumalatha at multicorewareinc.com>
date:      Tue Jun 17 14:53:17 2014 +0530
description:
psyrd: use psyrdcost for PU/TU decision for inter and intra
Subject: [x265] sei: disable HRD with warning when vbv is off

details:   http://hg.videolan.org/x265/rev/b6f8e0ce8c81
branches:  
changeset: 7085:b6f8e0ce8c81
user:      Kavitha Sampath <kavitha at multicorewareinc.com>
date:      Tue Jun 17 18:54:05 2014 +0530
description:
sei: disable HRD with warning when vbv is off
Subject: [x265] quant: Enforce QP range after adding bit-depth offsets

details:   http://hg.videolan.org/x265/rev/c8973aec5e70
branches:  
changeset: 7086:c8973aec5e70
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Tue Jun 17 15:37:13 2014 +0530
description:
quant: Enforce QP range after adding bit-depth offsets
Subject: [x265] fix: TOPSKIP refers outside of picture [OUTPUT CHANGE]

details:   http://hg.videolan.org/x265/rev/7c6654c332c5
branches:  
changeset: 7087:7c6654c332c5
user:      Satoshi Nakagawa <nakagawa424 at oki.com>
date:      Mon Jun 16 17:23:04 2014 +0900
description:
fix: TOPSKIP refers outside of picture [OUTPUT CHANGE]

diffstat:

 source/Lib/TLibCommon/SEI.h           |  234 ---------------------
 source/Lib/TLibCommon/TComBitStream.h |    2 +
 source/Lib/TLibCommon/TComPic.cpp     |    1 -
 source/Lib/TLibCommon/TComPic.h       |    5 +-
 source/Lib/TLibCommon/TComTrQuant.cpp |    1 +
 source/Lib/TLibEncoder/SEIwrite.cpp   |  367 ----------------------------------
 source/Lib/TLibEncoder/SEIwrite.h     |   72 ------
 source/Lib/TLibEncoder/TEncCu.h       |    2 +-
 source/Lib/TLibEncoder/TEncSearch.cpp |  297 ++++++++++++++++++++++++---
 source/Lib/TLibEncoder/TEncSearch.h   |    2 +-
 source/common/CMakeLists.txt          |    1 -
 source/common/param.cpp               |    8 +-
 source/encoder/CMakeLists.txt         |    3 +-
 source/encoder/compress.cpp           |   35 +-
 source/encoder/frameencoder.cpp       |   37 +-
 source/encoder/frameencoder.h         |    2 -
 source/encoder/ratecontrol.cpp        |   12 +-
 source/encoder/sei.cpp                |   86 +++++++
 source/encoder/sei.h                  |  278 +++++++++++++++++++++++++
 19 files changed, 686 insertions(+), 759 deletions(-)

diffs (truncated from 2171 to 300 lines):

diff -r ab8124028030 -r 7c6654c332c5 source/Lib/TLibCommon/SEI.h
--- a/source/Lib/TLibCommon/SEI.h	Tue Jun 17 00:15:47 2014 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-/* The copyright in this software is being made available under the BSD
- * License, included below. This software may be subject to other third party
- * and contributor rights, including patent rights, and no such rights are
- * granted under this license.
- *
- * Copyright (c) 2010-2013, ITU/ISO/IEC
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
- *    be used to endorse or promote products derived from this software without
- *    specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef X265_SEI_H
-#define X265_SEI_H
-
-#include "common.h"
-
-namespace x265 {
-// private namespace
-
-//! \ingroup TLibCommon
-//! \{
-class TComSPS;
-
-/**
- * Abstract class representing an SEI message with lightweight RTTI.
- */
-class SEI
-{
-public:
-
-    enum PayloadType
-    {
-        BUFFERING_PERIOD                     = 0,
-        PICTURE_TIMING                       = 1,
-        PAN_SCAN_RECT                        = 2,
-        FILLER_PAYLOAD                       = 3,
-        USER_DATA_REGISTERED_ITU_T_T35       = 4,
-        USER_DATA_UNREGISTERED               = 5,
-        RECOVERY_POINT                       = 6,
-        SCENE_INFO                           = 9,
-        FULL_FRAME_SNAPSHOT                  = 15,
-        PROGRESSIVE_REFINEMENT_SEGMENT_START = 16,
-        PROGRESSIVE_REFINEMENT_SEGMENT_END   = 17,
-        FILM_GRAIN_CHARACTERISTICS           = 19,
-        POST_FILTER_HINT                     = 22,
-        TONE_MAPPING_INFO                    = 23,
-        FRAME_PACKING                        = 45,
-        DISPLAY_ORIENTATION                  = 47,
-        SOP_DESCRIPTION                      = 128,
-        ACTIVE_PARAMETER_SETS                = 129,
-        DECODING_UNIT_INFO                   = 130,
-        TEMPORAL_LEVEL0_INDEX                = 131,
-        DECODED_PICTURE_HASH                 = 132,
-        SCALABLE_NESTING                     = 133,
-        REGION_REFRESH_INFO                  = 134,
-    };
-
-    SEI() {}
-
-    virtual ~SEI() {}
-
-    virtual PayloadType payloadType() const = 0;
-};
-
-class SEIuserDataUnregistered : public SEI
-{
-public:
-
-    PayloadType payloadType() const { return USER_DATA_UNREGISTERED; }
-
-    SEIuserDataUnregistered()
-        : userData(0)
-    {}
-
-    virtual ~SEIuserDataUnregistered()
-    {
-        delete userData;
-    }
-
-    uint8_t  uuid_iso_iec_11578[16];
-    uint32_t userDataLength;
-    uint8_t *userData;
-};
-
-class SEIDecodedPictureHash : public SEI
-{
-public:
-
-    PayloadType payloadType() const { return DECODED_PICTURE_HASH; }
-
-    SEIDecodedPictureHash() {}
-
-    virtual ~SEIDecodedPictureHash() {}
-
-    enum Method
-    {
-        MD5,
-        CRC,
-        CHECKSUM,
-        RESERVED,
-    } method;
-
-    uint8_t digest[3][16];
-};
-
-class SEIActiveParameterSets : public SEI
-{
-public:
-
-    PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
-
-    SEIActiveParameterSets()
-        : activeVPSId(0)
-        , m_fullRandomAccessFlag(false)
-        , m_noParamSetUpdateFlag(false)
-        , numSpsIdsMinus1(0)
-    {}
-
-    virtual ~SEIActiveParameterSets() {}
-
-    int  activeVPSId;
-    bool m_fullRandomAccessFlag;
-    bool m_noParamSetUpdateFlag;
-    int  numSpsIdsMinus1;
-    int  activeSeqParamSetId;
-};
-
-class SEIBufferingPeriod : public SEI
-{
-public:
-
-    PayloadType payloadType() const { return BUFFERING_PERIOD; }
-
-    SEIBufferingPeriod()
-        : m_bpSeqParameterSetId(0)
-        , m_rapCpbParamsPresentFlag(false)
-        , m_cpbDelayOffset(0)
-        , m_dpbDelayOffset(0)
-    {
-        ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay));
-        ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset));
-        ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay));
-        ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset));
-    }
-
-    virtual ~SEIBufferingPeriod() {}
-
-    uint32_t m_bpSeqParameterSetId;
-    bool     m_rapCpbParamsPresentFlag;
-    bool     m_cpbDelayOffset;
-    bool     m_dpbDelayOffset;
-    uint32_t m_initialCpbRemovalDelay[MAX_CPB_CNT][2];
-    uint32_t m_initialCpbRemovalDelayOffset[MAX_CPB_CNT][2];
-    uint32_t m_initialAltCpbRemovalDelay[MAX_CPB_CNT][2];
-    uint32_t m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2];
-    bool     m_concatenationFlag;
-    uint32_t m_auCpbRemovalDelayDelta;
-};
-
-class SEIPictureTiming : public SEI
-{
-public:
-
-    PayloadType payloadType() const { return PICTURE_TIMING; }
-
-    uint32_t  m_picStruct;
-    uint32_t  m_sourceScanType;
-    bool      m_duplicateFlag;
-
-    uint32_t  m_auCpbRemovalDelay;
-    uint32_t  m_picDpbOutputDelay;
-};
-
-class SEIDecodingUnitInfo : public SEI
-{
-public:
-
-    PayloadType payloadType() const { return DECODING_UNIT_INFO; }
-
-    SEIDecodingUnitInfo()
-        : m_decodingUnitIdx(0)
-        , m_duSptCpbRemovalDelay(0)
-        , m_dpbOutputDuDelayPresentFlag(false)
-        , m_picSptDpbOutputDuDelay(0)
-    {}
-
-    virtual ~SEIDecodingUnitInfo() {}
-
-    int  m_decodingUnitIdx;
-    int  m_duSptCpbRemovalDelay;
-    bool m_dpbOutputDuDelayPresentFlag;
-    int  m_picSptDpbOutputDuDelay;
-};
-
-class SEIRecoveryPoint : public SEI
-{
-public:
-
-    PayloadType payloadType() const { return RECOVERY_POINT; }
-
-    SEIRecoveryPoint() {}
-
-    virtual ~SEIRecoveryPoint() {}
-
-    int  m_recoveryPocCnt;
-    bool m_exactMatchingFlag;
-    bool m_brokenLinkFlag;
-};
-}
-//! \}
-
-#endif // ifndef X265_SEI_H
diff -r ab8124028030 -r 7c6654c332c5 source/Lib/TLibCommon/TComBitStream.h
--- a/source/Lib/TLibCommon/TComBitStream.h	Tue Jun 17 00:15:47 2014 -0500
+++ b/source/Lib/TLibCommon/TComBitStream.h	Mon Jun 16 17:23:04 2014 +0900
@@ -64,6 +64,8 @@ protected:
 
 public:
 
+    TComBitCounter() : m_bitCounter(0) {}
+
     void     write(uint32_t, uint32_t num)  { m_bitCounter += num; }
     void     writeByte(uint32_t)            { m_bitCounter += 8;   }
     void     resetBits()                    { m_bitCounter = 0;    }
diff -r ab8124028030 -r 7c6654c332c5 source/Lib/TLibCommon/TComPic.cpp
--- a/source/Lib/TLibCommon/TComPic.cpp	Tue Jun 17 00:15:47 2014 -0500
+++ b/source/Lib/TLibCommon/TComPic.cpp	Mon Jun 16 17:23:04 2014 +0900
@@ -36,7 +36,6 @@
 */
 
 #include "TComPic.h"
-#include "SEI.h"
 #include "mv.h"
 #include "encoder.h"
 
diff -r ab8124028030 -r 7c6654c332c5 source/Lib/TLibCommon/TComPic.h
--- a/source/Lib/TLibCommon/TComPic.h	Tue Jun 17 00:15:47 2014 -0500
+++ b/source/Lib/TLibCommon/TComPic.h	Mon Jun 16 17:23:04 2014 +0900
@@ -45,7 +45,7 @@
 #include "lowres.h"
 #include "threading.h"
 #include "md5.h"
-#include "SEI.h"
+#include "sei.h"
 
 namespace x265 {
 // private namespace
@@ -121,7 +121,8 @@ public:
     double                m_avgQpAq;    // avg QP as decided by AQ in addition to ratecontrol
     double                m_rateFactor; // calculated based on the Frame QP
     int32_t               m_forceqp;    // Force to use the qp specified in qp file
-    SEIPictureTiming      m_sei;
+
+    SEIPictureTiming      m_sei;        // TODO: move these to frame encoder, better name
     HRDTiming             m_hrdTiming;
 
     TComPic();
diff -r ab8124028030 -r 7c6654c332c5 source/Lib/TLibCommon/TComTrQuant.cpp
--- a/source/Lib/TLibCommon/TComTrQuant.cpp	Tue Jun 17 00:15:47 2014 -0500
+++ b/source/Lib/TLibCommon/TComTrQuant.cpp	Mon Jun 16 17:23:04 2014 +0900
@@ -123,6 +123,7 @@ void TComTrQuant::setQPforQuant(int qpy,
     if (ttype == TEXT_LUMA)
     {
         qpScaled = qpy + qpBdOffset;
+        qpScaled = Clip3(-QP_BD_OFFSET, MAX_QP, qpScaled);
     }
     else
     {
diff -r ab8124028030 -r 7c6654c332c5 source/Lib/TLibEncoder/SEIwrite.cpp
--- a/source/Lib/TLibEncoder/SEIwrite.cpp	Tue Jun 17 00:15:47 2014 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-/* The copyright in this software is being made available under the BSD
- * License, included below. This software may be subject to other third party


More information about the x265-commits mailing list