[x265] [PATCH] Cleanup some left hungarian notation left in first commit for xDeQuant

Steve Borho steve at borho.org
Sat Jul 6 21:19:16 CEST 2013


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

> # HG changeset patch
> # User praveentiwari
> # Date 1373023592 -19800
> # Node ID 2da2d7ec323ab58a0b7046892cebb9004e0c6008
> # Parent  8f4d92a5dd4edf634a408fddfcd48111c2c040af
> Cleanup some left hungarian notation left in first commit for xDeQuant
>
> diff -r 8f4d92a5dd4e -r 2da2d7ec323a source/common/dct.cpp
> --- a/source/common/dct.cpp     Fri Jul 05 16:31:48 2013 +0530
> +++ b/source/common/dct.cpp     Fri Jul 05 16:56:32 2013 +0530
> @@ -703,8 +703,8 @@
>
>  void xDeQuant(int bitDepth, const int* src, int* dst, int width, int
> height, int per, int rem, bool useScalingList, unsigned int log2TrSize, int
> *dequantCoefOrig)
>  {
> -    const int* piQCoef = src;
> -    int* piCoef = dst;
> +    const int* qCoef = src;
> +    int* coef = dst;
>

I would prefer to simply rename the function arguments here, instead of
declaring new variables.


>      int invQuantScales[6] = { 40, 45, 51, 57, 64, 72 };
>
> @@ -725,7 +725,7 @@
>      if (useScalingList)
>      {
>          shift += 4;
> -        int *piDequantCoef = dequantCoefOrig;
> +        int *dequantCoef = dequantCoefOrig;
>

ditto here


>
>          if (shift > per)
>          {
> @@ -733,18 +733,18 @@
>
>              for (int n = 0; n < width * height; n++)
>              {
> -                clipQCoef = Clip3(-32768, 32767, piQCoef[n]);
> -                coeffQ = ((clipQCoef * piDequantCoef[n]) + add) >> (shift
> - per);
> -                piCoef[n] = Clip3(-32768, 32767, coeffQ);
> +                clipQCoef = Clip3(-32768, 32767, qCoef[n]);
> +                coeffQ = ((clipQCoef * dequantCoef[n]) + add) >> (shift -
> per);
> +                coef[n] = Clip3(-32768, 32767, coeffQ);
>              }
>          }
>          else
>          {
>              for (int n = 0; n < width * height; n++)
>              {
> -                clipQCoef = Clip3(-32768, 32767, piQCoef[n]);
> -                coeffQ   = Clip3(-32768, 32767, clipQCoef *
> piDequantCoef[n]);
> -                piCoef[n] = Clip3(-32768, 32767, coeffQ << (per - shift));
> +                clipQCoef = Clip3(-32768, 32767, qCoef[n]);
> +                coeffQ   = Clip3(-32768, 32767, clipQCoef *
> dequantCoef[n]);
> +                coef[n] = Clip3(-32768, 32767, coeffQ << (per - shift));
>              }
>          }
>      }
> @@ -755,9 +755,9 @@
>
>          for (int n = 0; n < width * height; n++)
>          {
> -            clipQCoef = Clip3(-32768, 32767, piQCoef[n]);
> +            clipQCoef = Clip3(-32768, 32767, qCoef[n]);
>              coeffQ = (clipQCoef * scale + add) >> shift;
> -            piCoef[n] = Clip3(-32768, 32767, coeffQ);
> +            coef[n] = Clip3(-32768, 32767, coeffQ);
>          }
>      }
>  }
> _______________________________________________
> 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/826c0855/attachment.html>


More information about the x265-devel mailing list