[x265] [PATCH] TEncTop: Removed Accessunit(std::list) in CalculatehashandPSNR

Gopu Govindaswamy gopu at multicorewareinc.com
Wed Sep 18 10:57:26 CEST 2013


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1379494633 -19800
# Node ID aa66763867fd8be49c53066f919382e0861a3624
# Parent  1f4dfa794ad9ca5333671dc600d5fcd8efddeb25
TEncTop: Removed Accessunit(std::list) in CalculatehashandPSNR

This patch is Version - 2 for tip "encoder: do not use std::list",
Removed the accessunit in CalculatehashandPSNR function

diff -r 1f4dfa794ad9 -r aa66763867fd source/Lib/TLibEncoder/TEncTop.cpp
--- a/source/Lib/TLibEncoder/TEncTop.cpp	Wed Sep 18 14:03:37 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncTop.cpp	Wed Sep 18 14:27:13 2013 +0530
@@ -540,7 +540,12 @@
         m_frameEncoder->m_seiWriter.writeSEImessage(onalu.m_Bitstream, sei_recon_picture_digest, pic->getSlice()->getSPS());
         writeRBSPTrailingBits(onalu.m_Bitstream);
 
-        //accessUnit.insert(accessUnit.end(), new NALUnitEBSP(onalu));
+        int count = 0;
+        while (nalunits[count])
+           count++;
+        
+        nalunits[count] = (NALUnitEBSP *)X265_MALLOC(NALUnitEBSP, 1);
+        nalunits[count]->init(onalu);
     }
 
     /* calculate the size of the access unit, excluding:
diff -r 1f4dfa794ad9 -r aa66763867fd source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Wed Sep 18 14:03:37 2013 +0530
+++ b/source/encoder/encoder.cpp	Wed Sep 18 14:27:13 2013 +0530
@@ -361,7 +361,6 @@
         return 0;
 
     NALUnitEBSP *nalunits[5] = { 0, 0, 0, 0, 0 };
-    AccessUnit au;
     if (encoder->getStreamHeaders(nalunits) == 0)
     {
         size_t nalcount;
@@ -384,7 +383,6 @@
 extern "C"
 int x265_encoder_encode(x265_t *encoder, x265_nal_t **pp_nal, int *pi_nal, x265_picture_t *pic_in, x265_picture_t *pic_out)
 {
-    AccessUnit au;
     NALUnitEBSP *nalunits[5] = { 0, 0, 0, 0, 0 };
     int numEncoded = encoder->encode(!pic_in, pic_in, pic_out, nalunits);
      


More information about the x265-devel mailing list