[x265] [PATCH] Cached the motion reference list in the Slice
deepthidevaki at multicorewareinc.com
deepthidevaki at multicorewareinc.com
Wed Jul 31 14:55:42 CEST 2013
# HG changeset patch
# User Shazeb N Khan
# Date 1375274951 -19800
# Wed Jul 31 18:19:11 2013 +0530
# Node ID 5711a725065835ab43ff8f3f8fc86e415e4dfb6b
# Parent 2a8fb9ec2a10c510df180f2c4a8ea065089d4568
Cached the motion reference list in the Slice
diff -r 2a8fb9ec2a10 -r 5711a7250658 source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp Wed Jul 31 15:52:35 2013 +0530
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp Wed Jul 31 18:19:11 2013 +0530
@@ -252,11 +252,12 @@
return NULL;
}
-Void TComPicYuv::extendPicBorder(x265::ThreadPool *pool, wpScalingParam *w)
+x265::MotionReference* TComPicYuv::extendPicBorder(x265::ThreadPool *pool, wpScalingParam *w)
{
- if (getMotionReference(w)!=NULL)
+ MotionReference * mref = getMotionReference(w);
+ if (mref!=NULL)
{
- return;
+ return mref;
}
if (!m_bIsBorderExtended)
@@ -268,11 +269,12 @@
m_bIsBorderExtended = true;
}
- MotionReference *temp = new x265::MotionReference(this, pool, w);
- temp->generateReferencePlanes();
- temp->m_next = m_refList;
- m_refList = temp;
+ mref = new x265::MotionReference(this, pool, w);
+ mref->generateReferencePlanes();
+ mref->m_next = m_refList;
+ m_refList = mref;
+ return mref;
}
Void TComPicYuv::xExtendPicCompBorder(Pel* recon, Int stride, Int width, Int height, Int iMarginX, Int iMarginY)
diff -r 2a8fb9ec2a10 -r 5711a7250658 source/Lib/TLibCommon/TComPicYuv.h
--- a/source/Lib/TLibCommon/TComPicYuv.h Wed Jul 31 15:52:35 2013 +0530
+++ b/source/Lib/TLibCommon/TComPicYuv.h Wed Jul 31 18:19:11 2013 +0530
@@ -184,7 +184,7 @@
Void copyFromPicture(const x265_picture_t&);
// Extend function of picture buffer
- Void extendPicBorder(x265::ThreadPool *pool, wpScalingParam *w=NULL);
+ x265::MotionReference* extendPicBorder(x265::ThreadPool *pool, wpScalingParam *w=NULL);
// Dump picture
Void dump(Char* pFileName, Bool bAdd = false);
diff -r 2a8fb9ec2a10 -r 5711a7250658 source/Lib/TLibCommon/TComSlice.h
--- a/source/Lib/TLibCommon/TComSlice.h Wed Jul 31 15:52:35 2013 +0530
+++ b/source/Lib/TLibCommon/TComSlice.h Wed Jul 31 18:19:11 2013 +0530
@@ -42,6 +42,7 @@
#include "TComRom.h"
#include "TComList.h"
#include "x265.h" // NAL type enums
+#include "reference.h"
#include <cstring>
#include <map>
@@ -1328,7 +1329,7 @@
Void setSliceHeaderExtensionPresentFlag(Bool val) { m_sliceHeaderExtensionPresentFlag = val; }
};
-typedef struct
+struct WpScalingParam
{
// Explicit weighted prediction parameters parsed in slice header,
// or Implicit weighted prediction parameters (8 bits depth values).
@@ -1339,7 +1340,9 @@
// Weighted prediction scaling values built from above parameters (bitdepth scaled):
Int w, o, offset, shift, round;
-} wpScalingParam;
+};
+
+typedef WpScalingParam wpScalingParam;
typedef struct
{
@@ -1429,6 +1432,8 @@
public:
+ x265::MotionReference * m_mref[2][MAX_NUM_REF + 1];
+
TComSlice();
virtual ~TComSlice();
Void initSlice();
diff -r 2a8fb9ec2a10 -r 5711a7250658 source/Lib/TLibEncoder/TEncSlice.cpp
--- a/source/Lib/TLibEncoder/TEncSlice.cpp Wed Jul 31 15:52:35 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncSlice.cpp Wed Jul 31 18:19:11 2013 +0530
@@ -414,7 +414,7 @@
for (Int refIdxTemp = 0; refIdxTemp < slice->getNumRefIdx(picList); refIdxTemp++)
{
// To do: Call the merged IP + weighted frames if weighted prediction enabled
- slice->getRefPic(picList, refIdxTemp)->getPicYuvRec()->extendPicBorder(x265::ThreadPool::getThreadPool());
+ slice->m_mref[picList][refIdxTemp] = slice->getRefPic(picList, refIdxTemp)->getPicYuvRec()->extendPicBorder(x265::ThreadPool::getThreadPool());
}
}
diff -r 2a8fb9ec2a10 -r 5711a7250658 source/common/reference.cpp
--- a/source/common/reference.cpp Wed Jul 31 15:52:35 2013 +0530
+++ b/source/common/reference.cpp Wed Jul 31 18:19:11 2013 +0530
@@ -24,6 +24,7 @@
#include "TLibCommon/TypeDef.h"
#include "TLibCommon/TComPicYuv.h"
+#include "TLibCommon/TComSlice.h"
#include "PPA/ppa.h"
#include "primitives.h"
#include "reference.h"
diff -r 2a8fb9ec2a10 -r 5711a7250658 source/common/reference.h
--- a/source/common/reference.h Wed Jul 31 15:52:35 2013 +0530
+++ b/source/common/reference.h Wed Jul 31 18:19:11 2013 +0530
@@ -27,9 +27,10 @@
#include "primitives.h"
#include "threading.h"
#include "threadpool.h"
-#include "TLibCommon/TComSlice.h"
class TComPicYuv;
+struct WpScalingParam;
+typedef WpScalingParam wpScalingParam;
namespace x265 {
// private x265 namespace
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265.patch
Type: text/x-patch
Size: 4664 bytes
Desc: not available
URL: <http://mailman.videolan.org/private/x265-devel/attachments/20130731/bf2b74f1/attachment.bin>
More information about the x265-devel
mailing list