[x265-commits] [x265] encoder: split out VPS initialization, just to be consistent

Steve Borho steve at borho.org
Sun Mar 15 18:29:51 CET 2015


details:   http://hg.videolan.org/x265/rev/7e7679c0657b
branches:  
changeset: 9734:7e7679c0657b
user:      Steve Borho <steve at borho.org>
date:      Sun Mar 15 10:59:29 2015 -0500
description:
encoder: split out VPS initialization, just to be consistent

Note that we still pass member pointers to these member methods because at some
time in the future we may support SPS+PPS per frame encoder (dynamic reconfig)
and for that we'll need to pass in pointers.
Subject: [x265] encoder: remove unnecessary funcdef

details:   http://hg.videolan.org/x265/rev/24a792a082d8
branches:  
changeset: 9735:24a792a082d8
user:      Steve Borho <steve at borho.org>
date:      Sun Mar 15 10:59:41 2015 -0500
description:
encoder: remove unnecessary funcdef
Subject: [x265] common: move debug break at the end of check failure logic

details:   http://hg.videolan.org/x265/rev/eeeb65b51f23
branches:  stable
changeset: 9736:eeeb65b51f23
user:      Steve Borho <steve at borho.org>
date:      Sun Mar 15 11:30:57 2015 -0500
description:
common: move debug break at the end of check failure logic

MSVC will warn that the rest is otherwise unreachable if DEBUG_BREAK expands to
abort()
Subject: [x265] Merge with stable

details:   http://hg.videolan.org/x265/rev/6461985f33ac
branches:  
changeset: 9737:6461985f33ac
user:      Steve Borho <steve at borho.org>
date:      Sun Mar 15 11:58:32 2015 -0500
description:
Merge with stable

diffstat:

 source/common/common.h     |   2 +-
 source/encoder/encoder.cpp |  15 ++++++++++-----
 source/encoder/encoder.h   |   3 +--
 3 files changed, 12 insertions(+), 8 deletions(-)

diffs (68 lines):

diff -r 08ae82acc856 -r 6461985f33ac source/common/common.h
--- a/source/common/common.h	Sat Mar 14 22:53:14 2015 -0500
+++ b/source/common/common.h	Sun Mar 15 11:58:32 2015 -0500
@@ -109,9 +109,9 @@
 extern int g_checkFailures;
 #define X265_CHECK(expr, ...) if (!(expr)) { \
     x265_log(NULL, X265_LOG_ERROR, __VA_ARGS__); \
-    DEBUG_BREAK(); g_checkFailures++; \
     FILE *fp = fopen("x265_check_failures.txt", "a"); \
     if (fp) { fprintf(fp, "%s:%d\n", __FILE__, __LINE__); fprintf(fp, __VA_ARGS__); fclose(fp); } \
+    g_checkFailures++; DEBUG_BREAK(); \
 }
 #if _MSC_VER
 #pragma warning(disable: 4127) // some checks have constant conditions
diff -r 08ae82acc856 -r 6461985f33ac source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Sat Mar 14 22:53:14 2015 -0500
+++ b/source/encoder/encoder.cpp	Sun Mar 15 11:58:32 2015 -0500
@@ -203,6 +203,7 @@ void Encoder::create()
     m_dpb = new DPB(m_param);
     m_rateControl = new RateControl(*m_param);
 
+    initVPS(&m_vps);
     initSPS(&m_sps);
     initPPS(&m_pps);
 
@@ -1466,13 +1467,17 @@ void Encoder::getStreamHeaders(NALList& 
     }
 }
 
+void Encoder::initVPS(VPS *vps)
+{
+    /* Note that much of the VPS is initialized by determineLevel() */
+    vps->ptl.progressiveSourceFlag = !m_param->interlaceMode;
+    vps->ptl.interlacedSourceFlag = !!m_param->interlaceMode;
+    vps->ptl.nonPackedConstraintFlag = false;
+    vps->ptl.frameOnlyConstraintFlag = !m_param->interlaceMode;
+}
+
 void Encoder::initSPS(SPS *sps)
 {
-    m_vps.ptl.progressiveSourceFlag = !m_param->interlaceMode;
-    m_vps.ptl.interlacedSourceFlag = !!m_param->interlaceMode;
-    m_vps.ptl.nonPackedConstraintFlag = false;
-    m_vps.ptl.frameOnlyConstraintFlag = !m_param->interlaceMode;
-
     sps->conformanceWindow = m_conformanceWindow;
     sps->chromaFormatIdc = m_param->internalCsp;
     sps->picWidthInLumaSamples = m_param->sourceWidth;
diff -r 08ae82acc856 -r 6461985f33ac source/encoder/encoder.h
--- a/source/encoder/encoder.h	Sat Mar 14 22:53:14 2015 -0500
+++ b/source/encoder/encoder.h	Sun Mar 15 11:58:32 2015 -0500
@@ -153,8 +153,6 @@ public:
 
     char* statsCSVString(EncStats& stat, char* buffer);
 
-    void setThreadPool(ThreadPool* p) { m_threadPool = p; }
-
     void configure(x265_param *param);
 
     void updateVbvPlan(RateControl* rc);
@@ -171,6 +169,7 @@ public:
 
 protected:
 
+    void initVPS(VPS *vps);
     void initSPS(SPS *sps);
     void initPPS(PPS *pps);
 };


More information about the x265-commits mailing list