[x265] [PATCH] API changes to reconfigure scalinglists

Vignesh V Menon vignesh at multicorewareinc.com
Tue Dec 20 12:29:30 CET 2016


# HG changeset patch
# User Vignesh Vijayakumar <vignesh at multicorewareinc.com>
# Date 1482231953 -19800
#      Tue Dec 20 16:35:53 2016 +0530
# Node ID 88285bf550a4f88bb09ff5b49ec46b81140a025d
# Parent  78e1e1354a25d287f17359ed489833e46bf177f1
API changes to reconfigure scalinglists

diff -r 78e1e1354a25 -r 88285bf550a4 source/encoder/api.cpp
--- a/source/encoder/api.cpp    Fri Dec 09 10:45:12 2016 +0530
+++ b/source/encoder/api.cpp    Tue Dec 20 16:35:53 2016 +0530
@@ -183,6 +183,12 @@
     }
     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_reconfigure = true;
         encoder->printReconfigureParams();
     }
diff -r 78e1e1354a25 -r 88285bf550a4 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp    Fri Dec 09 10:45:12 2016 +0530
+++ b/source/encoder/encoder.cpp    Tue Dec 20 16:35:53 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()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20161220/b43ebf3a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: API_reconfigure_scalinglist.patch
Type: application/octet-stream
Size: 2692 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20161220/b43ebf3a/attachment.obj>


More information about the x265-devel mailing list