<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 29, 2017 at 1:54 PM, Divya Manivannan <span dir="ltr"><<a href="mailto:divya@multicorewareinc.com" target="_blank">divya@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Divya Manivannan <<a href="mailto:divya@multicorewareinc.com">divya@multicorewareinc.com</a>><br>
# Date 1498719699 -19800<br>
#      Thu Jun 29 12:31:39 2017 +0530<br>
# Node ID 5f9170dbf90ec865dc49cac8423d86<wbr>f941b998e2<br>
# Parent  67dcf6e79090acb619c5ac499ef5da<wbr>0b73c3a48b<br>
Move csv file pointer to param<br></blockquote><div><br></div><div>Pushed to default branch</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r 67dcf6e79090 -r 5f9170dbf90e source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt     Wed Jun 28 11:54:05 2017 -0500<br>
+++ b/source/CMakeLists.txt     Thu Jun 29 12:31:39 2017 +0530<br>
@@ -29,7 +29,7 @@<br>
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br>
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
 # X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 128)<br>
+set(X265_BUILD 129)<br>
 configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265.def.in" rel="noreferrer" target="_blank">x265.def.in</a>"<br>
                "${PROJECT_BINARY_DIR}/x265.<wbr>def")<br>
 configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265_config.h.in" rel="noreferrer" target="_blank">x265_config.h.in</a>"<br>
diff -r 67dcf6e79090 -r 5f9170dbf90e source/common/param.cpp<br>
--- a/source/common/param.cpp   Wed Jun 28 11:54:05 2017 -0500<br>
+++ b/source/common/param.cpp   Thu Jun 29 12:31:39 2017 +0530<br>
@@ -284,6 +284,7 @@<br>
     param->interRefine = 0;<br>
     param->mvRefine = 0;<br>
     param->bUseAnalysisFile = 1;<br>
+    param->csvfpt = NULL;<br>
 }<br>
<br>
 int x265_param_default_preset(<wbr>x265_param* param, const char* preset, const char* tune)<br>
diff -r 67dcf6e79090 -r 5f9170dbf90e source/encoder/api.cpp<br>
--- a/source/encoder/api.cpp    Wed Jun 28 11:54:05 2017 -0500<br>
+++ b/source/encoder/api.cpp    Thu Jun 29 12:31:39 2017 +0530<br>
@@ -120,8 +120,8 @@<br>
     /* Try to open CSV file handle */<br>
     if (encoder->m_param->csvfn)<br>
     {<br>
-        encoder->m_csvfpt = x265_csvlog_open(*encoder->m_<wbr>param, encoder->m_param->csvfn, encoder->m_param->csvLogLevel)<wbr>;<br>
-        if (!encoder->m_csvfpt)<br>
+        encoder->m_param->csvfpt = x265_csvlog_open(*encoder->m_<wbr>param, encoder->m_param->csvfn, encoder->m_param->csvLogLevel)<wbr>;<br>
+        if (!encoder->m_param->csvfpt)<br>
         {<br>
             x265_log(encoder->m_param, X265_LOG_ERROR, "Unable to open CSV log file <%s>, aborting\n", encoder->m_param->csvfn);<br>
             encoder->m_aborted = true;<br>
@@ -269,7 +269,7 @@<br>
         *pi_nal = 0;<br>
<br>
     if (numEncoded && encoder->m_param->csvLogLevel)<br>
-        x265_csvlog_frame(encoder->m_<wbr>csvfpt, *encoder->m_param, *pic_out, encoder->m_param->csvLogLevel)<wbr>;<br>
+        x265_csvlog_frame(encoder->m_<wbr>param->csvfpt, *encoder->m_param, *pic_out, encoder->m_param->csvLogLevel)<wbr>;<br>
<br>
     if (numEncoded < 0)<br>
         encoder->m_aborted = true;<br>
@@ -295,7 +295,7 @@<br>
         int padx = encoder->m_sps.<wbr>conformanceWindow.rightOffset;<br>
         int pady = encoder->m_sps.<wbr>conformanceWindow.<wbr>bottomOffset;<br>
         encoder->fetchStats(&stats, sizeof(stats));<br>
-        x265_csvlog_encode(encoder->m_<wbr>csvfpt, x265_version_str, *encoder->m_param, padx, pady, stats, encoder->m_param->csvLogLevel, argc, argv);<br>
+        x265_csvlog_encode(encoder->m_<wbr>param->csvfpt, x265_version_str, *encoder->m_param, padx, pady, stats, encoder->m_param->csvLogLevel, argc, argv);<br>
     }<br>
 }<br>
<br>
diff -r 67dcf6e79090 -r 5f9170dbf90e source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp        Wed Jun 28 11:54:05 2017 -0500<br>
+++ b/source/encoder/encoder.cpp        Thu Jun 29 12:31:39 2017 +0530<br>
@@ -70,7 +70,6 @@<br>
     m_exportedPic = NULL;<br>
     m_numDelayedPic = 0;<br>
     m_outputCount = 0;<br>
-    m_csvfpt = NULL;<br>
     m_param = NULL;<br>
     m_latestParam = NULL;<br>
     m_threadPool = NULL;<br>
@@ -475,9 +474,6 @@<br>
     if (m_analysisFile)<br>
         fclose(m_analysisFile);<br>
<br>
-    if (m_csvfpt)<br>
-        fclose(m_csvfpt);<br>
-<br>
     if (m_latestParam != NULL && m_latestParam != m_param)<br>
     {<br>
         if (m_latestParam->scalingLists != m_param->scalingLists)<br>
@@ -509,6 +505,8 @@<br>
      }<br>
     if (m_param)<br>
     {<br>
+        if (m_param->csvfpt)<br>
+            fclose(m_param->csvfpt);<br>
         /* release string arguments that were strdup'd */<br>
         free((char*)m_param->rc.<wbr>lambdaFileName);<br>
         free((char*)m_param->rc.<wbr>statFileName);<br>
diff -r 67dcf6e79090 -r 5f9170dbf90e source/encoder/encoder.h<br>
--- a/source/encoder/encoder.h  Wed Jun 28 11:54:05 2017 -0500<br>
+++ b/source/encoder/encoder.h  Thu Jun 29 12:31:39 2017 +0530<br>
@@ -137,7 +137,6 @@<br>
     x265_param*        m_latestParam;     // Holds latest param during a reconfigure<br>
     RateControl*       m_rateControl;<br>
     Lookahead*         m_lookahead;<br>
-    FILE*              m_csvfpt;<br>
<br>
     /* Collect statistics globally */<br>
     EncStats           m_analyzeAll;<br>
diff -r 67dcf6e79090 -r 5f9170dbf90e source/x265.h<br>
--- a/source/x265.h     Wed Jun 28 11:54:05 2017 -0500<br>
+++ b/source/x265.h     Thu Jun 29 12:31:39 2017 +0530<br>
@@ -26,6 +26,7 @@<br>
 #define X265_H<br>
<br>
 #include <stdint.h><br>
+#include <cstdio><br>
 #include "x265_config.h"<br>
<br>
 #ifdef __cplusplus<br>
@@ -1478,6 +1479,8 @@<br>
     /* Specify if analysis mode uses file for data reuse */<br>
     int       bUseAnalysisFile;<br>
<br>
+    /* File pointer for csv log */<br>
+    FILE*     csvfpt;<br>
 } x265_param;<br>
<br>
 /* x265_param_alloc:<br>
<br>______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br></blockquote></div><br></div></div>