changeset 11931:b24454f3ff6d

Merge with stable
author Pradeep Ramachandran <pradeep@multicorewareinc.com>
date Wed, 22 Nov 2017 22:00:48 +0530
parents dae558b40d99 dd11aa99f40a
children 17bb240012fe
files
diffstat 1 files changed, 8 insertions(+-), 1 deletions(-) [+]
line wrap: on
line diff
--- a/source/encoder/encoder.cpp	Tue Nov 21 09:40:16 2017 +0530
+++ b/source/encoder/encoder.cpp	Wed Nov 22 22:00:48 2017 +0530
@@ -1155,6 +1155,8 @@ int Encoder::encode(const x265_picture* 
                     pic_out->analysisData.wt = outFrame->m_analysisData.wt;
                     pic_out->analysisData.interData = outFrame->m_analysisData.interData;
                     pic_out->analysisData.intraData = outFrame->m_analysisData.intraData;
+                    pic_out->analysisData.modeFlag[0] = outFrame->m_analysisData.modeFlag[0];
+                    pic_out->analysisData.modeFlag[1] = outFrame->m_analysisData.modeFlag[1];
                     if (m_param->bDisableLookahead)
                     {
                         int factor = 1;
@@ -3067,6 +3069,7 @@ void Encoder::allocAnalysis(x265_analysi
                 CHECKED_MALLOC(interData->mvpIdx[dir], uint8_t, analysis->numPartitions * analysis->numCUsInFrame);
                 CHECKED_MALLOC(interData->refIdx[dir], int8_t, analysis->numPartitions * analysis->numCUsInFrame);
                 CHECKED_MALLOC(interData->mv[dir], MV, analysis->numPartitions * analysis->numCUsInFrame);
+                CHECKED_MALLOC(analysis->modeFlag[dir], uint8_t, analysis->numPartitions * analysis->numCUsInFrame);
             }
 
             /* Allocate intra in inter */
@@ -3146,7 +3149,11 @@ void Encoder::freeAnalysis(x265_analysis
                     X265_FREE(((analysis_inter_data*)analysis->interData)->mvpIdx[dir]);
                     X265_FREE(((analysis_inter_data*)analysis->interData)->refIdx[dir]);
                     X265_FREE(((analysis_inter_data*)analysis->interData)->mv[dir]);
-                    X265_FREE(analysis->modeFlag[dir]);
+                    if (analysis->modeFlag[dir] != NULL)
+                    {
+                        X265_FREE(analysis->modeFlag[dir]);
+                        analysis->modeFlag[dir] = NULL;
+                    }
                 }
             }
             else