[x265] copy m_origYuv[depth] from m_origYuv[0]

Steve Borho steve at borho.org
Fri Feb 28 21:15:53 CET 2014


On Fri, Feb 28, 2014 at 3:39 AM, Satoshi Nakagawa <nakagawa424 at oki.com> wrote:
> # HG changeset patch
> # User Satoshi Nakagawa <nakagawa424 at oki.com>
> # Date 1393580194 -32400
> #      Fri Feb 28 18:36:34 2014 +0900
> # Node ID 2eb519cd23e532bc8e311da80ca25de8f98f9156
> # Parent  5e9559d366b3c9c76f309a875cf18de69501bd39
> copy m_origYuv[depth] from m_origYuv[0]

Hi Satoshi,

It's not obvious from a glance why this is beneficial.  Can you
elaborate on this?


> diff -r 5e9559d366b3 -r 2eb519cd23e5 source/Lib/TLibCommon/TComYuv.cpp
> --- a/source/Lib/TLibCommon/TComYuv.cpp Fri Feb 28 01:41:43 2014 -0600
> +++ b/source/Lib/TLibCommon/TComYuv.cpp Fri Feb 28 18:36:34 2014 +0900
> @@ -145,9 +145,7 @@
>
>  void TComYuv::copyPartToYuv(TComYuv* dstPicYuv, uint32_t partIdx)
>  {
> -    uint32_t height = dstPicYuv->getHeight();
> -    uint32_t width = dstPicYuv->getWidth();
> -    int part = partitionFromSizes(width, height);
> +    int part = dstPicYuv->getPartEnum();
>
>      Pel* srcY = getLumaAddr(partIdx);
>      Pel* dstY = dstPicYuv->getLumaAddr(0);
> diff -r 5e9559d366b3 -r 2eb519cd23e5 source/Lib/TLibCommon/TComYuv.h
> --- a/source/Lib/TLibCommon/TComYuv.h   Fri Feb 28 01:41:43 2014 -0600
> +++ b/source/Lib/TLibCommon/TComYuv.h   Fri Feb 28 18:36:34 2014 +0900
> @@ -189,6 +189,8 @@
>      uint32_t getCHeight()   { return m_cheight; }
>
>      uint32_t getCWidth()    { return m_cwidth;  }
> +
> +    int getPartEnum() const { return m_part;    }
>  }; // END CLASS DEFINITION TComYuv
>  }
>  //! \}
> diff -r 5e9559d366b3 -r 2eb519cd23e5 source/Lib/TLibEncoder/TEncCu.cpp
> --- a/source/Lib/TLibEncoder/TEncCu.cpp Fri Feb 28 01:41:43 2014 -0600
> +++ b/source/Lib/TLibEncoder/TEncCu.cpp Fri Feb 28 18:36:34 2014 +0900
> @@ -532,7 +532,14 @@
>      TComPic* pic = outBestCU->getPic();
>
>      // get Original YUV data from picture
> -    m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outBestCU->getAddr(), outBestCU->getZorderIdxInCU());
> +    if (depth == 0)
> +    {
> +        m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outBestCU->getAddr(), outBestCU->getZorderIdxInCU());
> +    }
> +    else
> +    {
> +        m_origYuv[0]->copyPartToYuv(m_origYuv[depth], outBestCU->getZorderIdxInCU());
> +    }
>
>      // variable for Early CU determination
>      bool bSubBranch = true;
> @@ -684,7 +691,14 @@
>      TComPic* pic = outBestCU->getPic();
>
>      // get Original YUV data from picture
> -    m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outBestCU->getAddr(), outBestCU->getZorderIdxInCU());
> +    if (depth == 0)
> +    {
> +        m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outBestCU->getAddr(), outBestCU->getZorderIdxInCU());
> +    }
> +    else
> +    {
> +        m_origYuv[0]->copyPartToYuv(m_origYuv[depth], outBestCU->getZorderIdxInCU());
> +    }
>
>      // variable for Early CU determination
>      bool bSubBranch = true;
> diff -r 5e9559d366b3 -r 2eb519cd23e5 source/encoder/compress.cpp
> --- a/source/encoder/compress.cpp       Fri Feb 28 01:41:43 2014 -0600
> +++ b/source/encoder/compress.cpp       Fri Feb 28 18:36:34 2014 +0900
> @@ -332,7 +332,14 @@
>      TComPic* pic = outTempCU->getPic();
>
>      // get Original YUV data from picture
> -    m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outTempCU->getAddr(), outTempCU->getZorderIdxInCU());
> +    if (depth == 0)
> +    {
> +        m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outTempCU->getAddr(), outTempCU->getZorderIdxInCU());
> +    }
> +    else
> +    {
> +        m_origYuv[0]->copyPartToYuv(m_origYuv[depth], outTempCU->getZorderIdxInCU());
> +    }
>
>      // variables for fast encoder decision
>      bool bSubBranch = true;
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel



-- 
Steve Borho


More information about the x265-devel mailing list