[x265] [PATCH] Lookahead:Created the motionreferance for lookahead
gopu at multicorewareinc.com
gopu at multicorewareinc.com
Thu Aug 1 02:56:58 CEST 2013
# HG changeset patch
# User ggopu
# Date 1375318605 25200
# Node ID 5f5e0df85b95974561785e635729f21b89c11484
# Parent 43f1ceee90f6995bc6c7e2d286dd9b44e86b9d1f
Lookahead:Created the motionreferance for lookahead
diff -r 43f1ceee90f6 -r 5f5e0df85b95 source/Lib/TLibCommon/TComPicYuv.h
--- a/source/Lib/TLibCommon/TComPicYuv.h Wed Jul 31 15:54:34 2013 -0700
+++ b/source/Lib/TLibCommon/TComPicYuv.h Wed Jul 31 17:56:45 2013 -0700
@@ -70,10 +70,6 @@
Pel* m_picOrgU;
Pel* m_picOrgV;
- // Pre-interpolated reference pictures for each QPEL offset, may be more than
- // one if weighted references are in use
- x265::MotionReference *m_refList;
-
// ------------------------------------------------------------------------------------------------
// Parameter for general YUV buffer usage
// ------------------------------------------------------------------------------------------------
@@ -95,10 +91,14 @@
Int m_stride;
Int m_strideC;
- Bool m_bIsBorderExtended;
public:
+ // Pre-interpolated reference pictures for each QPEL offset, may be more than
+ // one if weighted references are in use
+ x265::MotionReference *m_refList;
+ Bool m_bIsBorderExtended;
+
Void xExtendPicCompBorder(Pel* recon, Int stride, Int width, Int height, Int marginX, Int marginY);
TComPicYuv();
diff -r 43f1ceee90f6 -r 5f5e0df85b95 source/Lib/TLibEncoder/TEncTop.cpp
--- a/source/Lib/TLibEncoder/TEncTop.cpp Wed Jul 31 15:54:34 2013 -0700
+++ b/source/Lib/TLibEncoder/TEncTop.cpp Wed Jul 31 17:56:45 2013 -0700
@@ -168,9 +168,16 @@
{
/*downscale the luma planes*/
x265::primitives.frame_init_lowres_core(pic->getPicYuvOrg()->getLumaAddr(), pic->m_lookahead.m_lowres[0], pic->m_lookahead.m_lowres[1], pic->m_lookahead.m_lowres[2], pic->m_lookahead.m_lowres[3], pic->getPicYuvOrg()->getStride(), pic->m_lookahead.m_stride_lowres, pic->m_lookahead.m_width_lowres, pic->m_lookahead.m_lines_lowres);
-
- for(int i=0; i<4; i)
+
+ for(int i=0; i<4; i++)
pic->getPicYuvOrg()->xExtendPicCompBorder(pic->m_lookahead.m_lowres[i], pic->m_lookahead.m_stride_lowres, pic->m_lookahead.m_width_lowres, pic->m_lookahead.m_lines_lowres, pic->getPicYuvOrg()->getLumaMarginX(), pic->getPicYuvOrg()->getLumaMarginY());
+
+ if (pic->getPicYuvOrg()->m_refList == NULL)
+ pic->getPicYuvOrg()->m_refList = new x265::MotionReference(pic->getPicYuvOrg(), x265::ThreadPool::getThreadPool());
+ pic->getPicYuvOrg()->m_refList->generateReferencePlanesLookAhead(pic->m_lookahead);
+
+ pic->getPicYuvOrg()->m_bIsBorderExtended = true;
+
}
return;
diff -r 43f1ceee90f6 -r 5f5e0df85b95 source/common/reference.cpp
--- a/source/common/reference.cpp Wed Jul 31 15:54:34 2013 -0700
+++ b/source/common/reference.cpp Wed Jul 31 17:56:45 2013 -0700
@@ -226,3 +226,27 @@
m_reconPic->m_lumaMarginX - s_tmpMarginX, m_reconPic->m_lumaMarginY - s_tmpMarginY);
}
}
+
+void MotionReference::generateReferencePlanesLookAhead(lookahead look)
+{
+ m_lumaPlane[0][0] = look.m_lowres[0];
+ m_lumaPlane[1][0] = look.m_lowres[0];
+ m_lumaPlane[0][1] = look.m_lowres[0];
+ m_lumaPlane[1][1] = look.m_lowres[0];
+
+ m_lumaPlane[2][0] = look.m_lowres[1];
+ m_lumaPlane[3][0] = look.m_lowres[1];
+ m_lumaPlane[2][1] = look.m_lowres[1];
+ m_lumaPlane[3][1] = look.m_lowres[1];
+
+ m_lumaPlane[0][2] = look.m_lowres[2];
+ m_lumaPlane[1][2] = look.m_lowres[2];
+ m_lumaPlane[0][3] = look.m_lowres[2];
+ m_lumaPlane[1][3] = look.m_lowres[2];
+
+ m_lumaPlane[2][2] = look.m_lowres[3];
+ m_lumaPlane[3][2] = look.m_lowres[3];
+ m_lumaPlane[2][3] = look.m_lowres[3];
+ m_lumaPlane[3][3] = look.m_lowres[3];
+
+}
diff -r 43f1ceee90f6 -r 5f5e0df85b95 source/common/reference.h
--- a/source/common/reference.h Wed Jul 31 15:54:34 2013 -0700
+++ b/source/common/reference.h Wed Jul 31 17:56:45 2013 -0700
@@ -28,6 +28,7 @@
#include "threading.h"
#include "threadpool.h"
#include "TLibCommon/TComSlice.h"
+#include "common.h"
class TComPicYuv;
@@ -43,6 +44,7 @@
~MotionReference();
void generateReferencePlanes();
+ void generateReferencePlanesLookAhead(lookahead);
/* indexed by [hpelx|qpelx][hpely|qpely] */
pixel* m_lumaPlane[4][4];
More information about the x265-devel
mailing list