[x265] [PATCH] API changes to reconfigure scalinglists

vignesh at multicorewareinc.com vignesh at multicorewareinc.com
Mon Dec 19 14:13:17 CET 2016


# HG changeset patch
# User Vignesh Vijayakumar <vignesh at multicorewareinc.com>
# Date 1481959810 -19800
#      Sat Dec 17 13:00:10 2016 +0530
# Branch stable
# Node ID 176274eb5f2cee9733ba47697e7004482b3bbc12
# Parent  ce19aaa0637df84d56fc985b0062c7fe2664cdf6
API changes to reconfigure scalinglists

diff -r ce19aaa0637d -r 176274eb5f2c source/encoder/api.cpp
--- a/source/encoder/api.cpp	Fri Dec 16 11:01:59 2016 +0530
+++ b/source/encoder/api.cpp	Sat Dec 17 13:00:10 2016 +0530
@@ -183,6 +183,13 @@
     }
     else
     {
+        if (encoder->m_latestParam->scalingLists && encoder->m_latestParam->scalingLists != encoder->m_param->scalingLists)
+        {
+            if (encoder->m_scalingList.parseScalingList(encoder->m_latestParam->scalingLists))
+                return -1;
+            encoder->m_scalingList.setupQuantMatrices();
+            encoder->m_latestParam->bRepeatHeaders = true;
+        }
         encoder->m_reconfigure = true;
         encoder->printReconfigureParams();
     }
diff -r ce19aaa0637d -r 176274eb5f2c source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Dec 16 11:01:59 2016 +0530
+++ b/source/encoder/encoder.cpp	Sat Dec 17 13:00:10 2016 +0530
@@ -408,6 +408,14 @@
     if (m_analysisFile)
         fclose(m_analysisFile);
 
+    if (m_latestParam != NULL && m_latestParam != m_param)
+    {
+        if (m_latestParam->scalingLists != m_param->scalingLists)
+            free((char*)m_latestParam->scalingLists);
+
+        PARAM_NS::x265_param_free(m_latestParam);
+    }
+
     if (m_param)
     {
         /* release string arguments that were strdup'd */
@@ -420,8 +428,6 @@
 
         PARAM_NS::x265_param_free(m_param);
     }
-
-    PARAM_NS::x265_param_free(m_latestParam);
 }
 
 void Encoder::updateVbvPlan(RateControl* rc)
@@ -986,6 +992,8 @@
     encParam->bEnableRectInter = param->bEnableRectInter;
     encParam->maxNumMergeCand = param->maxNumMergeCand;
     encParam->bIntraInBFrames = param->bIntraInBFrames;
+    if (param->scalingLists && !encParam->scalingLists)
+        encParam->scalingLists = strdup(param->scalingLists);
     /* To add: Loop Filter/deblocking controls, transform skip, signhide require PPS to be resent */
     /* To add: SAO, temporal MVP, AMP, TU depths require SPS to be resent, at every CVS boundary */
     return x265_check_params(encParam);
@@ -2474,6 +2482,7 @@
     TOOLCMP(oldParam->bEnableRectInter, newParam->bEnableRectInter, "rect=%d to %d\n");
     TOOLCMP(oldParam->maxNumMergeCand, newParam->maxNumMergeCand, "max-merge=%d to %d\n");
     TOOLCMP(oldParam->bIntraInBFrames, newParam->bIntraInBFrames, "b-intra=%d to %d\n");
+    TOOLCMP(oldParam->scalingLists, newParam->scalingLists, "scalinglists=%s to %s\n");
 }
 
 bool Encoder::computeSPSRPSIndex()


More information about the x265-devel mailing list