changeset 12417:856f056d392e draft

csv: add per frame BufferFillFinal BufferFillFinal of a frame implies the available buffer bits after removing the frame out of CPB.
author Aruna Matheswaran <aruna@multicorewareinc.com>
date Fri, 21 Sep 2018 11:03:03 +0530
parents fa57fa584898
children 33a782b23f2c 8fa8bacacb68
files doc/reST/cli.rst source/CMakeLists.txt source/encoder/api.cpp source/encoder/encoder.cpp source/x265.h
diffstat 5 files changed, 7 insertions(+-), 3 deletions(-) [+]
line wrap: on
line diff
--- a/doc/reST/cli.rst	Sun Sep 09 14:57:14 2018 +0200
+++ b/doc/reST/cli.rst	Fri Sep 21 11:03:03 2018 +0530
@@ -104,6 +104,8 @@ Logging/Statistic Options
 	**BufferFill** Bits available for the next frame. Includes bits carried
 	over from the current frame.
 	
+	**BufferFillFinal** Buffer bits available after removing the frame out of CPB.
+	
 	**Latency** Latency in terms of number of frames between when the frame 
 	was given in and when the frame is given out.
 	
--- a/source/CMakeLists.txt	Sun Sep 09 14:57:14 2018 +0200
+++ b/source/CMakeLists.txt	Fri Sep 21 11:03:03 2018 +0530
@@ -29,7 +29,7 @@ option(NATIVE_BUILD "Target the build CP
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 164)
+set(X265_BUILD 165)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
--- a/source/encoder/api.cpp	Sun Sep 09 14:57:14 2018 +0200
+++ b/source/encoder/api.cpp	Fri Sep 21 11:03:03 2018 +0530
@@ -881,7 +881,7 @@ FILE* x265_csvlog_open(const x265_param*
                 if (param->rc.rateControlMode == X265_RC_CRF)
                     fprintf(csvfp, "RateFactor, ");
                 if (param->rc.vbvBufferSize)
-                    fprintf(csvfp, "BufferFill, ");
+                    fprintf(csvfp, "BufferFill, BufferFillFinal, ");
                 if (param->bEnablePsnr)
                     fprintf(csvfp, "Y PSNR, U PSNR, V PSNR, YUV PSNR, ");
                 if (param->bEnableSsim)
@@ -992,7 +992,7 @@ void x265_csvlog_frame(const x265_param*
     if (param->rc.rateControlMode == X265_RC_CRF)
         fprintf(param->csvfpt, "%.3lf,", frameStats->rateFactor);
     if (param->rc.vbvBufferSize)
-        fprintf(param->csvfpt, "%.3lf,", frameStats->bufferFill);
+        fprintf(param->csvfpt, "%.3lf, %.3lf,", frameStats->bufferFill, frameStats->bufferFillFinal);
     if (param->bEnablePsnr)
         fprintf(param->csvfpt, "%.3lf, %.3lf, %.3lf, %.3lf,", frameStats->psnrY, frameStats->psnrU, frameStats->psnrV, frameStats->psnr);
     if (param->bEnableSsim)
--- a/source/encoder/encoder.cpp	Sun Sep 09 14:57:14 2018 +0200
+++ b/source/encoder/encoder.cpp	Fri Sep 21 11:03:03 2018 +0530
@@ -2176,6 +2176,7 @@ void Encoder::finishFrameStats(Frame* cu
         if (m_param->csvLogLevel >= 2)
             frameStats->ipCostRatio = curFrame->m_lowres.ipCostRatio;
         frameStats->bufferFill = m_rateControl->m_bufferFillActual;
+        frameStats->bufferFillFinal = m_rateControl->m_bufferFillFinal;
         frameStats->frameLatency = inPoc - poc;
         if (m_param->rc.rateControlMode == X265_RC_CRF)
             frameStats->rateFactor = curEncData.m_rateFactor;
--- a/source/x265.h	Sun Sep 09 14:57:14 2018 +0200
+++ b/source/x265.h	Fri Sep 21 11:03:03 2018 +0530
@@ -287,6 +287,7 @@ typedef struct x265_frame_stats
     x265_pu_stats    puStats;
     double           totalFrameTime;
     double           vmafFrameScore;
+    double           bufferFillFinal;
 } x265_frame_stats;
 
 typedef struct x265_ctu_info_t