[x265-commits] [x265] frameencoder: nit

Steve Borho steve at borho.org
Sat Jul 12 21:32:55 CEST 2014


details:   http://hg.videolan.org/x265/rev/7e3c96e01ca9
branches:  
changeset: 7324:7e3c96e01ca9
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 11 19:38:46 2014 -0500
description:
frameencoder: nit
Subject: [x265] sei: emit SEI describing the encoder and encode options

details:   http://hg.videolan.org/x265/rev/6af56f7c8703
branches:  
changeset: 7325:6af56f7c8703
user:      Steve Borho <steve at borho.org>
date:      Fri Jul 11 19:38:35 2014 -0500
description:
sei: emit SEI describing the encoder and encode options

example:
% x265 ../sintel_trailer_2k_480p24.y4m o.bin
% strings o.bin | head
x265 (build 26) - 1.2+74-a5024bfc0b50:[Mac OS X][clang 5.1.0][64 bit] 8bpp -
H.265/HEVC codec - Copyright 2013-2014 (c) Multicoreware Inc - http://x265.org
- options: 856x480 fps=24/1 bitdepth=8 wpp ctu=64 tu-intra-depth=1
tu-inter-depth=1 me=1 subme=2 merange=57 no-rect no-amp max-merge=2
no-early-skip no-fast-cbf rdpenalty=0 no-tskip no-tskip-fast
strong-intra-smoothing no-lossless no-cu-lossless no-constrained-intra open-gop
interlace=0 keyint=250 min-keyint=24 scenecut=40 rc-lookahead=20 bframes=4
bframe-bias=0 b-adapt=2 ref=3 weightp no-weightb aq-mode=2 aq-strength=1.00
cbqpoffs=0 crqpoffs=0 rd=3 signhide lft sao sao-lcu-bounds=0 sao-lcu-opt=1
b-pyramid cutree rc=crf crf=28.0 qcomp=0.60 qpmin=0 qpmax=51 qpstep=4
ipratio=1.40 pbratio=1.30
Subject: [x265] encoder: remove unused variables

details:   http://hg.videolan.org/x265/rev/7a9933d5df9e
branches:  
changeset: 7326:7a9933d5df9e
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 12 01:17:36 2014 -0500
description:
encoder: remove unused variables
Subject: [x265] encoder: nits

details:   http://hg.videolan.org/x265/rev/9d3683ab096b
branches:  
changeset: 7327:9d3683ab096b
user:      Steve Borho <steve at borho.org>
date:      Sat Jul 12 01:18:07 2014 -0500
description:
encoder: nits

diffstat:

 source/encoder/encoder.cpp      |   7 +------
 source/encoder/encoder.h        |   3 ---
 source/encoder/frameencoder.cpp |  28 +++++++++++++++++++++++++++-
 source/encoder/sei.cpp          |   6 ++++++
 source/encoder/sei.h            |  31 +++++++++++++++++++++++++++++++
 5 files changed, 65 insertions(+), 10 deletions(-)

diffs (148 lines):

diff -r 6e116afd68e7 -r 9d3683ab096b source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Jul 11 16:53:40 2014 -0500
+++ b/source/encoder/encoder.cpp	Sat Jul 12 01:18:07 2014 -0500
@@ -88,12 +88,8 @@ void Encoder::create()
 
     m_frameEncoder = new FrameEncoder[m_param->frameNumThreads];
     if (m_frameEncoder)
-    {
         for (int i = 0; i < m_param->frameNumThreads; i++)
-        {
             m_frameEncoder[i].setThreadPool(m_threadPool);
-        }
-    }
 
     /* Allocate thread local data shared by all frame encoders */
     ThreadPool *pool = ThreadPool::getThreadPool();
@@ -608,8 +604,7 @@ void Encoder::printSummary()
     if (!m_param->bLogCuStats)
         return;
 
-    ThreadPool *pool = ThreadPool::getThreadPool();
-    const int poolThreadCount = pool ? pool->getThreadCount() : 1;
+    const int poolThreadCount = m_threadPool ? m_threadPool->getThreadCount() : 1;
 
     for (int sliceType = 2; sliceType >= 0; sliceType--)
     {
diff -r 6e116afd68e7 -r 9d3683ab096b source/encoder/encoder.h
--- a/source/encoder/encoder.h	Fri Jul 11 16:53:40 2014 -0500
+++ b/source/encoder/encoder.h	Sat Jul 12 01:18:07 2014 -0500
@@ -149,9 +149,6 @@ public:
 
     int                m_useScalingListId; ///< Using quantization matrix i.e. 0=off, 1=default.
 
-    bool               m_transquantBypassEnableFlag;   ///< transquant_bypass_enable_flag setting in PPS.
-    bool               m_cuTransquantBypassFlagValue;  ///< if transquant_bypass_enable_flag, the fixed value to use for the per-CU cu_transquant_bypass_flag.
-
     bool               m_neutralChromaIndicationFlag;
     bool               m_pocProportionalToTimingFlag;
     int                m_numTicksPocDiffOneMinus1;
diff -r 6e116afd68e7 -r 9d3683ab096b source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Fri Jul 11 16:53:40 2014 -0500
+++ b/source/encoder/frameencoder.cpp	Sat Jul 12 01:18:07 2014 -0500
@@ -25,6 +25,7 @@
 
 #include "PPA/ppa.h"
 #include "wavefront.h"
+#include "param.h"
 
 #include "encoder.h"
 #include "frameencoder.h"
@@ -157,7 +158,6 @@ bool FrameEncoder::init(Encoder *top, in
     m_nr.offset = m_nr.offsetDenoise;
     m_nr.residualSum = m_nr.residualSumBuf[0];
     m_nr.count = m_nr.countBuf[0];
-
     m_nr.bNoiseReduction = !!m_param->noiseReduction;
 
     start();
@@ -224,6 +224,32 @@ void FrameEncoder::getStreamHeaders(NALL
     bs.writeByteAlignment();
     list.serialize(NAL_UNIT_PPS, bs);
 
+    char *opts = x265_param2string(m_param);
+    if (opts)
+    {
+        char *buffer = X265_MALLOC(char, strlen(opts) + strlen(x265_version_str) +
+                                         strlen(x265_build_info_str) + 200);
+        if (buffer)
+        {
+            sprintf(buffer, "x265 (build %d) - %s:%s - H.265/HEVC codec - "
+                    "Copyright 2013-2014 (c) Multicoreware Inc - "
+                    "http://x265.org - options: %s",
+                    X265_BUILD, x265_version_str, x265_build_info_str, opts);
+            
+            bs.resetBits();
+            SEIuserDataUnregistered idsei;
+            idsei.m_userData = (uint8_t*)buffer;
+            idsei.m_userDataLength = strlen(buffer);
+            idsei.write(bs, m_sps);
+            bs.writeByteAlignment();
+            list.serialize(NAL_UNIT_PREFIX_SEI, bs);
+
+            X265_FREE(buffer);
+        }
+
+        X265_FREE(opts);
+    }
+
     if (m_param->bEmitHRDSEI)
     {
         SEIActiveParameterSets sei;
diff -r 6e116afd68e7 -r 9d3683ab096b source/encoder/sei.cpp
--- a/source/encoder/sei.cpp	Fri Jul 11 16:53:40 2014 -0500
+++ b/source/encoder/sei.cpp	Sat Jul 12 01:18:07 2014 -0500
@@ -28,6 +28,12 @@
 
 using namespace x265;
 
+/* x265's identifying GUID */
+const uint8_t SEIuserDataUnregistered::m_uuid_iso_iec_11578[16] = {
+    0x2C, 0xA2, 0xDE, 0x09, 0xB5, 0x17, 0x47, 0xDB,
+    0xBB, 0x55, 0xA4, 0xFE, 0x7F, 0xC2, 0xFC, 0x4E
+};
+
 /* marshal a single SEI message sei, storing the marshalled representation
  * in bitstream bs */
 void SEI::write(Bitstream& bs, TComSPS& sps)
diff -r 6e116afd68e7 -r 9d3683ab096b source/encoder/sei.h
--- a/source/encoder/sei.h	Fri Jul 11 16:53:40 2014 -0500
+++ b/source/encoder/sei.h	Sat Jul 12 01:18:07 2014 -0500
@@ -80,6 +80,37 @@ protected:
     void writeByteAlign();
 };
 
+class SEIuserDataUnregistered : public SEI
+{
+public:
+
+    PayloadType payloadType() const { return USER_DATA_UNREGISTERED; }
+
+    SEIuserDataUnregistered() : m_userData(NULL) {}
+
+    static const uint8_t m_uuid_iso_iec_11578[16];
+    uint32_t m_userDataLength;
+    uint8_t *m_userData;
+
+    void write(Bitstream& bs, TComSPS&)
+    {
+        m_bitIf = &bs;
+
+        WRITE_CODE(USER_DATA_UNREGISTERED, 8, "payload_type");
+
+        uint32_t payloadSize = 16 + m_userDataLength;
+        for (; payloadSize >= 0xff; payloadSize -= 0xff)
+            WRITE_CODE(0xff, 8, "payload_size");
+        WRITE_CODE(payloadSize, 8, "payload_size");
+
+        for (uint32_t i = 0; i < 16; i++)
+            WRITE_CODE(m_uuid_iso_iec_11578[i], 8, "sei.uuid_iso_iec_11578[i]");
+
+        for (uint32_t i = 0; i < m_userDataLength; i++)
+            WRITE_CODE(m_userData[i], 8, "user_data");
+    }
+};
+
 class SEIDecodedPictureHash : public SEI
 {
 public:


More information about the x265-commits mailing list