[x265] [PATCH] convert c++ reference to pointer on m_scalingList

Steve Borho steve at borho.org
Sun Sep 28 21:29:07 CEST 2014


On 09/26, Min Chen wrote:
> # HG changeset patch
> # User Min Chen <chenm003 at 163.com>
> # Date 1411782915 25200
> # Node ID 033d4a8a699837b115a9c6e27cdf4b11fcdd28bc
> # Parent  7dccbbed034970de161b361cd6e17ed4efca7226
> convert c++ reference to pointer on m_scalingList

why? there is only one ScalingList in the entire encoder

> diff -r 7dccbbed0349 -r 033d4a8a6998 source/common/quant.cpp
> --- a/source/common/quant.cpp	Wed Sep 24 18:26:45 2014 -0500
> +++ b/source/common/quant.cpp	Fri Sep 26 18:55:15 2014 -0700
> @@ -158,11 +158,11 @@
>      m_fencShortBuf = NULL;
>  }
>  
> -bool Quant::init(bool useRDOQ, double psyScale, const ScalingList& scalingList)
> +bool Quant::init(bool useRDOQ, double psyScale, const ScalingList* scalingList)
>  {
>      m_useRDOQ = useRDOQ;
>      m_psyRdoqScale = (int64_t)(psyScale * 256.0);
> -    m_scalingList = &scalingList;
> +    m_scalingList = scalingList;
>      m_resiDctCoeff = X265_MALLOC(int32_t, MAX_TR_SIZE * MAX_TR_SIZE * 2);
>      m_fencDctCoeff = m_resiDctCoeff + (MAX_TR_SIZE * MAX_TR_SIZE);
>      m_fencShortBuf = X265_MALLOC(int16_t, MAX_TR_SIZE * MAX_TR_SIZE);
> diff -r 7dccbbed0349 -r 033d4a8a6998 source/common/quant.h
> --- a/source/common/quant.h	Wed Sep 24 18:26:45 2014 -0500
> +++ b/source/common/quant.h	Fri Sep 26 18:55:15 2014 -0700
> @@ -86,7 +86,7 @@
>      ~Quant();
>  
>      /* one-time setup */
> -    bool init(bool useRDOQ, double psyScale, const ScalingList& scalingList);
> +    bool init(bool useRDOQ, double psyScale, const ScalingList* scalingList);
>  
>      /* CU setup */
>      void setQPforQuant(TComDataCU* cu);
> diff -r 7dccbbed0349 -r 033d4a8a6998 source/encoder/encoder.cpp
> --- a/source/encoder/encoder.cpp	Wed Sep 24 18:26:45 2014 -0500
> +++ b/source/encoder/encoder.cpp	Fri Sep 26 18:55:15 2014 -0700
> @@ -109,7 +109,7 @@
>      m_threadLocalData = new ThreadLocalData[numLocalData];
>      for (int i = 0; i < numLocalData; i++)
>      {
> -        m_threadLocalData[i].analysis.initSearch(m_param, m_scalingList);
> +        m_threadLocalData[i].analysis.initSearch(m_param, &m_scalingList);
>          m_threadLocalData[i].analysis.create(g_maxCUDepth + 1, g_maxCUSize);
>      }
>  
> diff -r 7dccbbed0349 -r 033d4a8a6998 source/encoder/search.cpp
> --- a/source/encoder/search.cpp	Wed Sep 24 18:26:45 2014 -0500
> +++ b/source/encoder/search.cpp	Fri Sep 26 18:55:15 2014 -0700
> @@ -66,7 +66,7 @@
>      delete[] m_qtTempShortYuv;
>  }
>  
> -bool Search::initSearch(x265_param *param, ScalingList& scalingList)
> +bool Search::initSearch(x265_param *param, ScalingList *scalingList)
>  {
>      m_param = param;
>      m_bEnableRDOQ = param->rdLevel >= 4;
> diff -r 7dccbbed0349 -r 033d4a8a6998 source/encoder/search.h
> --- a/source/encoder/search.h	Wed Sep 24 18:26:45 2014 -0500
> +++ b/source/encoder/search.h	Fri Sep 26 18:55:15 2014 -0700
> @@ -77,7 +77,7 @@
>      Search();
>      ~Search();
>  
> -    bool     initSearch(x265_param *param, ScalingList& scalingList);
> +    bool     initSearch(x265_param *param, ScalingList *scalingList);
>  
>      void     estIntraPredQT(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv, uint32_t depthRange[2]);
>      void     sharedEstIntraPredQT(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, ShortYuv* resiYuv, TComYuv* reconYuv, uint32_t depthRange[2], uint8_t* sharedModes);
> 
> _______________________________________________
> 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