[x265] [PATCH 4 of 5] lowres: pass poc and user slice type to lowres::init()

Steve Borho steve at borho.org
Thu Sep 19 04:04:28 CEST 2013


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1379556186 18000
#      Wed Sep 18 21:03:06 2013 -0500
# Node ID 2a7b627a4ce910474e36720a9bf5cc3ef233f4fb
# Parent  b083a1ffdbfdc92621e40b7413a26a16a5819f61
lowres: pass poc and user slice type to lowres::init()

diff -r b083a1ffdbfd -r 2a7b627a4ce9 source/Lib/TLibEncoder/TEncTop.cpp
--- a/source/Lib/TLibEncoder/TEncTop.cpp	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/Lib/TLibEncoder/TEncTop.cpp	Wed Sep 18 21:03:06 2013 -0500
@@ -194,7 +194,7 @@
 
         // TEncTop holds a reference count until collecting stats
         ATOMIC_INC(&pic->m_countRefEncoders);
-        m_lookahead->addPicture(pic);
+        m_lookahead->addPicture(pic, pic_in->sliceType);
     }
 
     if (flush)
diff -r b083a1ffdbfd -r 2a7b627a4ce9 source/common/lowres.cpp
--- a/source/common/lowres.cpp	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/common/lowres.cpp	Wed Sep 18 21:03:06 2013 -0500
@@ -106,12 +106,13 @@
 }
 
 // (re) initialize lowres state
-void Lowres::init(TComPicYuv *orig, int bframes)
+void Lowres::init(TComPicYuv *orig, int poc, int type, int bframes)
 {
     bScenecut = true;
     bIntraCalculated = false;
     bKeyframe = false; // Not a keyframe unless identified by lookahead
-    sliceType = X265_TYPE_AUTO;
+    sliceType = type;
+    frameNum = poc;
     memset(costEst, -1, sizeof(costEst));
     for (int y = 0; y < bframes + 2; y++)
     {
diff -r b083a1ffdbfd -r 2a7b627a4ce9 source/common/lowres.h
--- a/source/common/lowres.h	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/common/lowres.h	Wed Sep 18 21:03:06 2013 -0500
@@ -64,7 +64,7 @@
 
     void create(TComPic *pic, int bframes);
     void destroy(int bframes);
-    void init(TComPicYuv *orig, int bframes);
+    void init(TComPicYuv *orig, int poc, int sliceType, int bframes);
 };
 }
 
diff -r b083a1ffdbfd -r 2a7b627a4ce9 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/encoder/slicetype.cpp	Wed Sep 18 21:03:06 2013 -0500
@@ -99,10 +99,9 @@
     }
 }
 
-void Lookahead::addPicture(TComPic *pic)
+void Lookahead::addPicture(TComPic *pic, int sliceType)
 {
-    pic->m_lowres.init(pic->getPicYuvOrg(), cfg->param.bframes);
-    pic->m_lowres.frameNum = pic->getSlice()->getPOC();
+    pic->m_lowres.init(pic->getPicYuvOrg(), pic->getSlice()->getPOC(), sliceType, cfg->param.bframes);
 
     inputQueue.pushBack(pic);
     if (inputQueue.size() >= (size_t)cfg->param.lookaheadDepth)
diff -r b083a1ffdbfd -r 2a7b627a4ce9 source/encoder/slicetype.h
--- a/source/encoder/slicetype.h	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/encoder/slicetype.h	Wed Sep 18 21:03:06 2013 -0500
@@ -56,7 +56,7 @@
     Lookahead(TEncCfg *);
     ~Lookahead();
 
-    void addPicture(TComPic*);
+    void addPicture(TComPic*, int sliceType);
     void flush();
     void destroy();
     void slicetypeDecide();


More information about the x265-devel mailing list