[x265] [PATCH] api: do not reuse the analysisData buffer for more then one picture, set it NULL

gopu at multicorewareinc.com gopu at multicorewareinc.com
Tue Sep 16 13:47:02 CEST 2014


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1410868013 -19800
#      Tue Sep 16 17:16:53 2014 +0530
# Node ID 23233e9d7fb9ddb13685fe12f23cf8bbed74c0eb
# Parent  717ea14104cf32bbcafe8e9b8ddef17867807936
api: do not reuse the analysisData buffer for more then one picture, set it NULL

diff -r 717ea14104cf -r 23233e9d7fb9 source/encoder/api.cpp
--- a/source/encoder/api.cpp	Tue Sep 16 16:50:56 2014 +0530
+++ b/source/encoder/api.cpp	Tue Sep 16 17:16:53 2014 +0530
@@ -121,6 +121,16 @@
     do
     {
         numEncoded = encoder->encode(pic_in, pic_out);
+
+        // do not reuse this same buffer for more then one picture
+        if (pic_in)
+        {
+            if (pic_in->analysisData.intraData)
+                pic_in->analysisData.intraData = NULL;
+            if (pic_in->analysisData.interData)
+                pic_in->analysisData.interData = NULL;
+        }
+
     }
     while (numEncoded == 0 && !pic_in && encoder->m_numDelayedPic);
 


More information about the x265-devel mailing list