changeset 12582:fbb3957d8b5e

add total intra percentage per frame in analysis structure
author Santhoshini Sekar <santhoshini@multicorewareinc.com>
date Mon, 21 Oct 2019 14:27:15 +0530
parents 5297824e605c
children 04db2bfee5d6
files source/encoder/encoder.cpp source/x265.h
diffstat 2 files changed, 12 insertions(+-), 0 deletions(-) [+]
line wrap: on
line diff
--- a/source/encoder/encoder.cpp	Mon Oct 21 14:11:47 2019 +0530
+++ b/source/encoder/encoder.cpp	Mon Oct 21 14:27:15 2019 +0530
@@ -1826,6 +1826,17 @@ int Encoder::encode(const x265_picture* 
                     for (int ref = 0; ref < MAX_NUM_REF; ref++)
                         pic_out->analysisData.list0POC[ref] = frameData->list0POC[ref];
 
+                    double totalIntraPercent = 0;
+
+                    for (uint32_t depth = 0; depth < m_param->maxCUDepth; depth++)
+                        for (uint32_t intramode = 0; intramode < 3; intramode++)
+                            totalIntraPercent += frameData->cuStats.percentIntraDistribution[depth][intramode];
+                    totalIntraPercent += frameData->cuStats.percentIntraNxN;
+
+                    for (uint32_t depth = 0; depth < m_param->maxCUDepth; depth++)
+                        totalIntraPercent += frameData->puStats.percentIntraPu[depth];
+                    pic_out->analysisData.totalIntraPercent = totalIntraPercent;
+
                     if (!slice->isInterP())
                     {
                         for (int ref = 0; ref < MAX_NUM_REF; ref++)
--- a/source/x265.h	Mon Oct 21 14:11:47 2019 +0530
+++ b/source/x265.h	Mon Oct 21 14:27:15 2019 +0530
@@ -223,6 +223,7 @@ typedef struct x265_analysis_data
     uint64_t                          frameBits;
     int                               list0POC[MAX_NUM_REF];
     int                               list1POC[MAX_NUM_REF];
+    double                            totalIntraPercent;
 } x265_analysis_data;
 
 /* cu statistics */