[x265] [PATCH] aq : bug fix . extend border of TComPic::m_origPicYuv to a multiple of 16

Steve Borho steve at borho.org
Wed Nov 6 22:14:32 CET 2013


On Wed, Nov 6, 2013 at 4:33 AM, Aarthi Thirumalai <
aarthi at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Aarthi Thirumalai
> # Date 1383734012 -19800
> #      Wed Nov 06 16:03:32 2013 +0530
> # Node ID 6b725179b61564df5b4eb497f783b193dcbda1e9
> # Parent  21e08cf159c552ff98334c98070b9cd442aaff27
> aq : bug fix . extend border of TComPic::m_origPicYuv to a multiple of 16
>

no space before the :


>
> diff -r 21e08cf159c5 -r 6b725179b615 source/Lib/TLibCommon/TComPicYuv.cpp
> --- a/source/Lib/TLibCommon/TComPicYuv.cpp      Wed Nov 06 15:43:19 2013
> +0530
> +++ b/source/Lib/TLibCommon/TComPicYuv.cpp      Wed Nov 06 16:03:32 2013
> +0530
> @@ -431,10 +431,12 @@
>

this is only the 8bpp path, the HIGH_BIT_DEPTH path needs the same
adjustments


>          uint8_t *v = (uint8_t*)pic.planes[2];
>
>          /* width and height - without padsize */
> -        int width = (m_picWidth * (pic.bitDepth > 8 ? 2 : 1)) - padx;
> -        int height = m_picHeight - pady;
> -
> -        // copy pixels by row into encoder's buffer
> +         int width = (m_picWidth * (pic.bitDepth > 8 ? 2 : 1)) - padx;
> +         int height = m_picHeight - pady;
> +         uint8_t rem = m_picWidth % 16;
> +         padx += rem ? 16 - rem : 0;
> +         rem = m_picHeight % 16;
> +         pady += rem ? 16 - rem : 0;
>

white-space alignment


>          for (int r = 0; r < height; r++)
>          {
>              memcpy(Y, y, width);
> diff -r 21e08cf159c5 -r 6b725179b615 source/common/lowres.cpp
> --- a/source/common/lowres.cpp  Wed Nov 06 15:43:19 2013 +0530
> +++ b/source/common/lowres.cpp  Wed Nov 06 16:03:32 2013 +0530
> @@ -150,31 +150,6 @@
>          intraMbs[i] = 0;
>      }
>
> -    int y, extWidth = (orig->getWidth() + X265_LOWRES_CU_SIZE - 1);
> -    int srcStride = orig->getStride();
> -    int srcHeight = orig->getHeight();
> -    int srcWidth  = orig->getWidth();
> -    Pel *src;
> -    src = orig->getLumaAddr();
> -
> -    /* extending right margin */
> -    if (2 * width > srcWidth)
> -    {
> -        for (y = 0; y < srcHeight; y++)
> -        {
> -            ::memset(src + srcWidth, src[srcWidth - 1], sizeof(Pel) *
> (X265_LOWRES_CU_SIZE - 1));
> -            src += srcStride;
> -        }
> -    }
> -
> -    /* extending bottom margin */
> -    src = orig->getLumaAddr() + (srcHeight - 1) * srcStride;
> -
> -    for (y = 1; y <= 2 * lines - srcHeight; y++)
> -    {
> -        ::memcpy(src + y * srcStride, src, sizeof(Pel) * (extWidth));
> -    }
> -
>      /* downscale and generate 4 HPEL planes for lookahead */
>      primitives.frame_init_lowres_core(orig->getLumaAddr(),
>                                        lowresPlane[0], lowresPlane[1],
> lowresPlane[2], lowresPlane[3],
>

The AQ code which iterates over 16x16 blocks also needs to be updated to
account for the last padded block in each row, and at the bottom.

--
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131106/129b46b4/attachment.html>


More information about the x265-devel mailing list