[x265] [PATCH] xDCT32_C code cleanup

Steve Borho steve at borho.org
Sat Jul 6 21:24:22 CEST 2013


On Fri, Jul 5, 2013 at 5:36 AM, <praveen at multicorewareinc.com> wrote:

> # HG changeset patch
> # User praveentiwari
> # Date 1373020562 -19800
> # Node ID c4c1e8043fbc8edba128feef7dedaad63314956d
> # Parent  85fe1251277bf343194d76111ecccab1744e832b
> xDCT32_C code cleanup
>
> diff -r 85fe1251277b -r c4c1e8043fbc source/common/dct.cpp
> --- a/source/common/dct.cpp     Fri Jul 05 16:00:33 2013 +0530
> +++ b/source/common/dct.cpp     Fri Jul 05 16:06:02 2013 +0530
> @@ -535,28 +535,28 @@
>  #undef N
>  }
>
> -void xDCT32_C(short *pSrc, int *pDst, intptr_t nStride)
> +void xDCT32_C(short *src, int *dst, intptr_t nStride)


nStride here is also hungarian.  The n implies a count.  They've mixed the
hungarian styles in a few places.  You don't typically use nStride when
other code uses iStride.  In any case, we want to simply use 'stride' here.

{
>      const int shift_1st = 4;
>      const int shift_2nd = 11;
>
> -    ALIGN_VAR_32(Short, tmp[32 * 32]);
> -    ALIGN_VAR_32(Short, tmp1[32 * 32]);
> +    ALIGN_VAR_32(Short, coef[32 * 32]);
> +    ALIGN_VAR_32(Short, block[32 * 32]);
>
>      for (int i = 0; i < 32; i++)
>      {
> -        memcpy(&tmp1[i * 32], &pSrc[i * nStride], 32 * sizeof(short));
> +        memcpy(&block[i * 32], &src[i * nStride], 32 * sizeof(short));
>      }
>
> -    partialButterfly32(tmp1, tmp, shift_1st, 32);
> -    partialButterfly32(tmp, tmp1, shift_2nd, 32);
> +    partialButterfly32(block, coef, shift_1st, 32);
> +    partialButterfly32(coef, block, shift_2nd, 32);
>
>  #define N (32)
>      for (int i = 0; i < N; i++)
>      {
>          for (int j = 0; j < N; j++)
>          {
> -            pDst[i * N + j] = tmp1[i * N + j];
> +            dst[i * N + j] = block[i * N + j];
>          }
>      }
>
> _______________________________________________
> 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/pipermail/x265-devel/attachments/20130706/a3c2213a/attachment.html>


More information about the x265-devel mailing list