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

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Tue Jul 15 09:22:02 CEST 2014


# HG changeset patch
# User Sumalatha Polureddy<sumalatha at multicorewareinc.com>
# Date 1405408892 -19800
# Node ID 935382c2039afcb48076fa0443d94cf1313aa188
# Parent  5c5183eeacb556b4676a46ffc63874ccab041502
fix for crash when scalingList feature is enabled

diff -r 5c5183eeacb5 -r 935382c2039a source/Lib/TLibCommon/TComSlice.cpp
--- a/source/Lib/TLibCommon/TComSlice.cpp	Tue Jul 15 01:48:38 2014 -0500
+++ b/source/Lib/TLibCommon/TComSlice.cpp	Tue Jul 15 12:51:32 2014 +0530
@@ -677,18 +677,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 5c5183eeacb5 -r 935382c2039a source/Lib/TLibCommon/TComSlice.h
--- a/source/Lib/TLibCommon/TComSlice.h	Tue Jul 15 01:48:38 2014 -0500
+++ b/source/Lib/TLibCommon/TComSlice.h	Tue Jul 15 12:51:32 2014 +0530
@@ -1395,7 +1395,6 @@
 
     TComScalingList*   getScalingList()        { return m_scalingList; }
 
-    void  setDefaultScalingList();
     bool  checkDefaultScalingList();
     void  setCabacInitFlag(bool val)   { m_cabacInitFlag = val; }   //!< set CABAC initial flag
 
diff -r 5c5183eeacb5 -r 935382c2039a source/encoder/api.cpp
--- a/source/encoder/api.cpp	Tue Jul 15 01:48:38 2014 -0500
+++ b/source/encoder/api.cpp	Tue Jul 15 12:51:32 2014 +0530
@@ -57,6 +57,9 @@
     {
         // these may change params for auto-detect, etc
         encoder->configure(param);
+        // set default quantization matrix to array
+        if (encoder->m_useScalingListId == SCALING_LIST_DEFAULT)
+            encoder->setDefaultScalingList();
         enforceLevel(*param);
         determineLevel(*param, encoder->m_profile, encoder->m_level, encoder->m_levelTier);
 
diff -r 5c5183eeacb5 -r 935382c2039a source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Tue Jul 15 01:48:38 2014 -0500
+++ b/source/encoder/encoder.cpp	Tue Jul 15 12:51:32 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 5c5183eeacb5 -r 935382c2039a source/encoder/encoder.h
--- a/source/encoder/encoder.h	Tue Jul 15 01:48:38 2014 -0500
+++ b/source/encoder/encoder.h	Tue Jul 15 12:51:32 2014 +0530
@@ -200,6 +200,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