[x265] [PATCH] Lookahead:Created the motionreferance for lookahead
Steve Borho
steve at borho.org
Wed Jul 31 22:15:06 CEST 2013
On Wed, Jul 31, 2013 at 7:56 PM, <gopu at multicorewareinc.com> wrote:
> # HG changeset patch
> # User ggopu
> # Date 1375318605 25200
> # Node ID 5f5e0df85b95974561785e635729f21b89c11484
> # Parent 43f1ceee90f6995bc6c7e2d286dd9b44e86b9d1f
> Lookahead:Created the motionreferance for lookahead
>
this is good progress
>
> 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;
>
>
This motion reference pointer is used for the full-scale motion reference
instances used by the main encoder, so you can't hijack it for lookahead
purposed. The lookahead will only need one motion reference per input
frame, unlike the main encoder which may need many references with
different weights, so you could just add a MotionReference member variable
for this purpose (aka, not a malloc'd pointer). it should be part of the
lookahead structure, not TComPicYuv
> //
> ------------------------------------------------------------------------------------------------
> // Parameter for general YUV buffer usage
> //
> ------------------------------------------------------------------------------------------------
> @@ -95,10 +91,14 @@
> Int m_stride;
> Int m_strideC;
>
> - Bool m_bIsBorderExtended;
>
this also can't be hijacked
>
> 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*/
>
include spaces between the * and the comment
>
> 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);
>
This is hard to read, and too long of a line. use a reference variable
here:
lookahead &l = pic->m_lookahead;
> -
> - 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];
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> http://mailman.videolan.org/listinfo/x265-devel
>
--
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/private/x265-devel/attachments/20130731/d445881c/attachment-0001.html>
More information about the x265-devel
mailing list