[x265] [PATCH] fix for crash when scalingList feature is enabled

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Tue Jul 15 07:14:21 CEST 2014


# HG changeset patch
# User Sumalatha Polureddy<sumalatha at multicorewareinc.com>
# Date 1405401248 -19800
# Node ID 52aa7ca073cf83ddde782175dd8c488b712f05c2
# Parent  51b3ff5e88e24c4a29cf422434f2e2a38f99d862
fix for crash when scalingList feature is enabled

diff -r 51b3ff5e88e2 -r 52aa7ca073cf source/Lib/TLibCommon/TComSlice.cpp
--- a/source/Lib/TLibCommon/TComSlice.cpp	Mon Jul 14 13:42:37 2014 -0500
+++ b/source/Lib/TLibCommon/TComSlice.cpp	Tue Jul 15 10:44:08 2014 +0530
@@ -715,19 +715,6 @@
     destroy();
 }
 
-/** set default quantization matrix to array
-*/
-void TComSlice::setDefaultScalingList()
-{
-    for (uint32_t sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
-    {
-        for (uint32_t listId = 0; listId < g_scalingListNum[sizeId]; listId++)
-        {
-            getScalingList()->processDefaultMarix(sizeId, listId);
-        }
-    }
-}
-
 /** check if use default quantization matrix
  * \returns true if use default quantization matrix in all size
 */
diff -r 51b3ff5e88e2 -r 52aa7ca073cf source/Lib/TLibCommon/TComSlice.h
--- a/source/Lib/TLibCommon/TComSlice.h	Mon Jul 14 13:42:37 2014 -0500
+++ b/source/Lib/TLibCommon/TComSlice.h	Tue Jul 15 10:44:08 2014 +0530
@@ -1484,7 +1484,6 @@
 
     TComScalingList*   getScalingList()        { return m_scalingList; }
 
-    void  setDefaultScalingList();
     bool  checkDefaultScalingList();
     void      setCabacInitFlag(bool val)   { m_cabacInitFlag = val; }   //!< set CABAC initial flag
 
diff -r 51b3ff5e88e2 -r 52aa7ca073cf source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Mon Jul 14 13:42:37 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Tue Jul 15 10:44:08 2014 +0530
@@ -83,6 +83,7 @@
     }
     else if (top->m_useScalingListId == SCALING_LIST_DEFAULT)
     {
+        top->setDefaultScalingList();
         m_trQuant.setScalingList(top->getScalingList());
         m_trQuant.setUseScalingList(true);
     }
diff -r 51b3ff5e88e2 -r 52aa7ca073cf source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Mon Jul 14 13:42:37 2014 -0500
+++ b/source/encoder/encoder.cpp	Tue Jul 15 10:44:08 2014 +0530
@@ -232,6 +232,19 @@
     }
 }
 
+/** set default quantization matrix to array
+*/
+void Encoder::setDefaultScalingList()
+{
+    for (uint32_t sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
+    {
+        for (uint32_t listId = 0; listId < g_scalingListNum[sizeId]; listId++)
+        {
+            getScalingList()->processDefaultMarix(sizeId, listId);
+        }
+    }
+}
+
 /**
  \param   pic_in              input original YUV picture or NULL
  \param   pic_out             pointer to reconstructed picture struct
diff -r 51b3ff5e88e2 -r 52aa7ca073cf source/encoder/encoder.h
--- a/source/encoder/encoder.h	Mon Jul 14 13:42:37 2014 -0500
+++ b/source/encoder/encoder.h	Tue Jul 15 10:44:08 2014 +0530
@@ -202,6 +202,8 @@
 
     TComScalingList* getScalingList() { return &m_scalingList; }
 
+    void  setDefaultScalingList();
+
     void setThreadPool(ThreadPool* p) { m_threadPool = p; }
 
     void configure(x265_param *param);


More information about the x265-devel mailing list