[x265] change index of m_buOffsetY[] from raster to zscan

Steve Borho steve at borho.org
Thu Sep 4 14:21:02 CEST 2014


On 09/03, Satoshi Nakagawa wrote:
> # HG changeset patch
> # User Satoshi Nakagawa <nakagawa424 at oki.com>
> # Date 1409732761 -32400
> #      Wed Sep 03 17:26:01 2014 +0900
> # Node ID bccd2c7fa8aa0352f05ac9e4329d9ebf5c23899c
> # Parent  62c4779fb0bb35d5d8a69678e9e8aa81272f0115
> change index of m_buOffsetY[] from raster to zscan

Queued, thanks

> diff -r 62c4779fb0bb -r bccd2c7fa8aa source/Lib/TLibCommon/TComPicYuv.cpp
> --- a/source/Lib/TLibCommon/TComPicYuv.cpp	Thu Aug 28 13:14:34 2014 +0530
> +++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Wed Sep 03 17:26:01 2014 +0900
> @@ -111,13 +111,12 @@
>  
>      CHECKED_MALLOC(m_buOffsetY, int, (size_t)numPartitions);
>      CHECKED_MALLOC(m_buOffsetC, int, (size_t)numPartitions);
> -    for (int buRow = 0; buRow < (1 << maxFullDepth); buRow++)
> +    for (uint32_t idx = 0; idx < numPartitions; ++idx)
>      {
> -        for (int buCol = 0; buCol < (1 << maxFullDepth); buCol++)
> -        {
> -            m_buOffsetY[(buRow << maxFullDepth) + buCol] = getStride() * buRow * UNIT_SIZE + buCol * UNIT_SIZE;
> -            m_buOffsetC[(buRow << maxFullDepth) + buCol] = getCStride() * buRow * (UNIT_SIZE >> m_vChromaShift) + buCol * (UNIT_SIZE >> m_hChromaShift);
> -        }
> +        int x = g_zscanToPelX[idx];
> +        int y = g_zscanToPelY[idx];
> +        m_buOffsetY[idx] = getStride() * y + x;
> +        m_buOffsetC[idx] = getCStride() * (y >> m_vChromaShift) + (x >> m_hChromaShift);
>      }
>  
>      return true;
> diff -r 62c4779fb0bb -r bccd2c7fa8aa source/Lib/TLibCommon/TComPicYuv.h
> --- a/source/Lib/TLibCommon/TComPicYuv.h	Thu Aug 28 13:14:34 2014 +0530
> +++ b/source/Lib/TLibCommon/TComPicYuv.h	Wed Sep 03 17:26:01 2014 +0900
> @@ -147,13 +147,13 @@
>  
>      pixel*  getChromaAddr(uint32_t chromaId, int cuAddr) { return m_picOrg[chromaId] + m_cuOffsetC[cuAddr]; }
>  
> -    pixel*  getLumaAddr(int cuAddr, int absZOrderIdx) { return m_picOrg[0] + m_cuOffsetY[cuAddr] + m_buOffsetY[g_zscanToRaster[absZOrderIdx]]; }
> +    pixel*  getLumaAddr(int cuAddr, int absZOrderIdx) { return m_picOrg[0] + m_cuOffsetY[cuAddr] + m_buOffsetY[absZOrderIdx]; }
>  
> -    pixel*  getCbAddr(int cuAddr, int absZOrderIdx) { return m_picOrg[1] + m_cuOffsetC[cuAddr] + m_buOffsetC[g_zscanToRaster[absZOrderIdx]]; }
> +    pixel*  getCbAddr(int cuAddr, int absZOrderIdx) { return m_picOrg[1] + m_cuOffsetC[cuAddr] + m_buOffsetC[absZOrderIdx]; }
>  
> -    pixel*  getCrAddr(int cuAddr, int absZOrderIdx) { return m_picOrg[2] + m_cuOffsetC[cuAddr] + m_buOffsetC[g_zscanToRaster[absZOrderIdx]]; }
> +    pixel*  getCrAddr(int cuAddr, int absZOrderIdx) { return m_picOrg[2] + m_cuOffsetC[cuAddr] + m_buOffsetC[absZOrderIdx]; }
>  
> -    pixel*  getChromaAddr(uint32_t chromaId, int cuAddr, int absZOrderIdx) { return m_picOrg[chromaId] + m_cuOffsetC[cuAddr] + m_buOffsetC[g_zscanToRaster[absZOrderIdx]]; }
> +    pixel*  getChromaAddr(uint32_t chromaId, int cuAddr, int absZOrderIdx) { return m_picOrg[chromaId] + m_cuOffsetC[cuAddr] + m_buOffsetC[absZOrderIdx]; }
>  
>      uint32_t getCUHeight(int rowNum);
>  
> _______________________________________________
> 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