changeset 12580:858a6b6267e0

add reference list in analysis structure
author Santhoshini Sekar <santhoshini@multicorewareinc.com>
date Wed, 28 Aug 2019 15:08:18 +0530
parents 96fb4962ccb5
children 5297824e605c
files source/encoder/encoder.cpp source/x265.h
diffstat 2 files changed, 18 insertions(+-), 4 deletions(-) [+]
line wrap: on
line diff
--- a/source/encoder/encoder.cpp	Wed Aug 28 13:32:12 2019 +0530
+++ b/source/encoder/encoder.cpp	Wed Aug 28 15:08:18 2019 +0530
@@ -1810,6 +1810,17 @@ int Encoder::encode(const x265_picture* 
             if (m_param->analysisSave)
             {
                 pic_out->analysisData.frameBits = frameData->bits;
+                if (!slice->isIntra())
+                {
+                    for (int ref = 0; ref < MAX_NUM_REF; ref++)
+                        pic_out->analysisData.list0POC[ref] = frameData->list0POC[ref];
+
+                    if (!slice->isInterP())
+                    {
+                        for (int ref = 0; ref < MAX_NUM_REF; ref++)
+                            pic_out->analysisData.list1POC[ref] = frameData->list1POC[ref];
+                    }
+                }
             }
 
             /* Write RateControl Frame level stats in multipass encodes */
@@ -2696,12 +2707,12 @@ void Encoder::finishFrameStats(Frame* cu
         frameStats->ssim = ssim;
         if (!slice->isIntra())
         {
-            for (int ref = 0; ref < 16; ref++)
+            for (int ref = 0; ref < MAX_NUM_REF; ref++)
                 frameStats->list0POC[ref] = ref < slice->m_numRefIdx[0] ? slice->m_refPOCList[0][ref] - slice->m_lastIDR : -1;
 
             if (!slice->isInterP())
             {
-                for (int ref = 0; ref < 16; ref++)
+                for (int ref = 0; ref < MAX_NUM_REF; ref++)
                     frameStats->list1POC[ref] = ref < slice->m_numRefIdx[1] ? slice->m_refPOCList[1][ref] - slice->m_lastIDR : -1;
             }
         }
--- a/source/x265.h	Wed Aug 28 13:32:12 2019 +0530
+++ b/source/x265.h	Wed Aug 28 15:08:18 2019 +0530
@@ -200,6 +200,7 @@ typedef struct x265_analysis_distortion_
 
 }x265_analysis_distortion_data;
 
+#define MAX_NUM_REF 16
 /* Stores all analysis data for a single frame */
 typedef struct x265_analysis_data
 {
@@ -220,6 +221,8 @@ typedef struct x265_analysis_data
     x265_analysis_validate            saveParam;
     x265_analysis_distortion_data*    distortionData;
     uint64_t                          frameBits;
+    int                               list0POC[MAX_NUM_REF];
+    int                               list1POC[MAX_NUM_REF];
 } x265_analysis_data;
 
 /* cu statistics */
@@ -275,8 +278,8 @@ typedef struct x265_frame_stats
     int              encoderOrder;
     int              poc;
     int              countRowBlocks;
-    int              list0POC[16];
-    int              list1POC[16];
+    int              list0POC[MAX_NUM_REF];
+    int              list1POC[MAX_NUM_REF];
     uint16_t         maxLumaLevel;
     uint16_t         minLumaLevel;