[x265] [PATCH] Cleanups: Replacing Ushort with uint16_t

Steve Borho steve at borho.org
Tue Oct 29 07:08:55 CET 2013


On Tue, Oct 29, 2013 at 12:47 AM, <murugan at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Murugan Vairavel <murugan at multicorewareinc.com>
> # Date 1383025592 -19800
> #      Tue Oct 29 11:16:32 2013 +0530
> # Node ID d1c01c65c3d7c79041db102dd94f482987c07f47
> # Parent  0666d56aaa4259590dffdd5aa3bc7859c4763931
> Cleanups: Replacing Ushort with uint16_t
>

Queued for default, thanks


> diff -r 0666d56aaa42 -r d1c01c65c3d7 source/Lib/TLibCommon/TComTrQuant.cpp
> --- a/source/Lib/TLibCommon/TComTrQuant.cpp     Mon Oct 28 16:13:05 2013
> +0530
> +++ b/source/Lib/TLibCommon/TComTrQuant.cpp     Tue Oct 29 11:16:32 2013
> +0530
> @@ -640,7 +640,7 @@
>                  {
>                      uint32_t   posY   = blkPos >> log2BlkSize;
>                      uint32_t   posX   = blkPos - (posY << log2BlkSize);
> -                    UShort ctxSig = getSigCtxInc(patternSigCtx, scanIdx,
> posX, posY, log2BlkSize, ttype);
> +                    uint16_t ctxSig = getSigCtxInc(patternSigCtx,
> scanIdx, posX, posY, log2BlkSize, ttype);
>                      level         = xGetCodedLevel(costCoeff[scanPos],
> costCoeff0[scanPos], costSig[scanPos],
>                                                     levelDouble,
> maxAbsLevel, ctxSig, oneCtx, absCtx, goRiceParam,
>                                                     c1Idx, c2Idx, qbits,
> scaleFactor, 0);
> @@ -1149,10 +1149,10 @@
>                                          double& codedCostSig,
>                                          int     levelDouble,
>                                          uint32_t    maxAbsLevel,
> -                                        UShort  ctxNumSig,
> -                                        UShort  ctxNumOne,
> -                                        UShort  ctxNumAbs,
> -                                        UShort  absGoRice,
> +                                        uint16_t  ctxNumSig,
> +                                        uint16_t  ctxNumOne,
> +                                        uint16_t  ctxNumAbs,
> +                                        uint16_t  absGoRice,
>                                          uint32_t    c1Idx,
>                                          uint32_t    c2Idx,
>                                          int     qbits,
> @@ -1207,9 +1207,9 @@
>   * \returns cost of given absolute transform level
>   */
>  inline double TComTrQuant::xGetICRateCost(uint32_t   absLevel,
> -                                          UShort ctxNumOne,
> -                                          UShort ctxNumAbs,
> -                                          UShort absGoRice,
> +                                          uint16_t ctxNumOne,
> +                                          uint16_t ctxNumAbs,
> +                                          uint16_t absGoRice,
>                                            uint32_t   c1Idx,
>                                            uint32_t   c2Idx) const
>  {
> @@ -1263,9 +1263,9 @@
>  }
>
>  inline int TComTrQuant::xGetICRate(uint32_t   absLevel,
> -                                   UShort ctxNumOne,
> -                                   UShort ctxNumAbs,
> -                                   UShort absGoRice,
> +                                   uint16_t ctxNumOne,
> +                                   uint16_t ctxNumAbs,
> +                                   uint16_t absGoRice,
>                                     uint32_t   c1Idx,
>                                     uint32_t   c2Idx) const
>  {
> @@ -1290,8 +1290,8 @@
>              symbol = std::min<uint32_t>(symbol, (maxVlc + 1));
>          }
>
> -        UShort prefLen = UShort(symbol >> absGoRice) + 1;
> -        UShort numBins = std::min<uint32_t>(prefLen,
> g_goRicePrefixLen[absGoRice]) + absGoRice;
> +        uint16_t prefLen = uint16_t(symbol >> absGoRice) + 1;
> +        uint16_t numBins = std::min<uint32_t>(prefLen,
> g_goRicePrefixLen[absGoRice]) + absGoRice;
>
>          rate += numBins << 15;
>
> diff -r 0666d56aaa42 -r d1c01c65c3d7 source/Lib/TLibCommon/TComTrQuant.h
> --- a/source/Lib/TLibCommon/TComTrQuant.h       Mon Oct 28 16:13:05 2013
> +0530
> +++ b/source/Lib/TLibCommon/TComTrQuant.h       Tue Oct 29 11:16:32 2013
> +0530
> @@ -200,18 +200,18 @@
>      uint32_t xRateDistOptQuant(TComDataCU* cu, int32_t* srcCoeff, TCoeff*
> dstCoeff, uint32_t width, uint32_t height, TextType ttype, uint32_t
> absPartIdx, int32_t *lastPos);
>
>      inline uint32_t xGetCodedLevel(double& codedCost, double& codedCost0,
> double& codedCostSig, int levelDouble,
> -                               uint32_t maxAbsLevel, UShort ctxNumSig,
> UShort ctxNumOne, UShort ctxNumAbs, UShort absGoRice,
> +                               uint32_t maxAbsLevel, uint16_t ctxNumSig,
> uint16_t ctxNumOne, uint16_t ctxNumAbs, uint16_t absGoRice,
>                                 uint32_t c1Idx, uint32_t c2Idx, int qbits,
> double scale, bool bLast) const;
>
> -    inline double xGetICRateCost(uint32_t absLevel, UShort ctxNumOne,
> UShort ctxNumAbs, UShort absGoRice, uint32_t c1Idx, uint32_t c2Idx) const;
> +    inline double xGetICRateCost(uint32_t absLevel, uint16_t ctxNumOne,
> uint16_t ctxNumAbs, uint16_t absGoRice, uint32_t c1Idx, uint32_t c2Idx)
> const;
>
> -    inline int    xGetICRate(uint32_t absLevel, UShort ctxNumOne, UShort
> ctxNumAbs, UShort absGoRice, uint32_t c1Idx, uint32_t c2Idx) const;
> +    inline int    xGetICRate(uint32_t absLevel, uint16_t ctxNumOne,
> uint16_t ctxNumAbs, uint16_t absGoRice, uint32_t c1Idx, uint32_t c2Idx)
> const;
>
>      inline double xGetRateLast(uint32_t posx, uint32_t posy) const;
>
> -    inline double xGetRateSigCoeffGroup(UShort sigCoeffGroup, UShort
> ctxNumSig) const { return m_lambda *
> m_estBitsSbac->significantCoeffGroupBits[ctxNumSig][sigCoeffGroup]; }
> +    inline double xGetRateSigCoeffGroup(uint16_t sigCoeffGroup, uint16_t
> ctxNumSig) const { return m_lambda *
> m_estBitsSbac->significantCoeffGroupBits[ctxNumSig][sigCoeffGroup]; }
>
> -    inline double xGetRateSigCoef(UShort sig, UShort ctxNumSig) const {
> return m_lambda * m_estBitsSbac->significantBits[ctxNumSig][sig]; }
> +    inline double xGetRateSigCoef(uint16_t sig, uint16_t ctxNumSig) const
> { return m_lambda * m_estBitsSbac->significantBits[ctxNumSig][sig]; }
>
>      inline double xGetICost(double rage) const { return m_lambda * rage;
> } ///< Get the cost for a specific rate
>
> diff -r 0666d56aaa42 -r d1c01c65c3d7 source/Lib/TLibCommon/TypeDef.h
> --- a/source/Lib/TLibCommon/TypeDef.h   Mon Oct 28 16:13:05 2013 +0530
> +++ b/source/Lib/TLibCommon/TypeDef.h   Tue Oct 29 11:16:32 2013 +0530
> @@ -52,7 +52,6 @@
>  //
> ====================================================================================================================
>
>  typedef unsigned char  UChar;
> -typedef unsigned short UShort;
>
>  //
> ====================================================================================================================
>  // 64-bit integer type
> @@ -71,7 +70,7 @@
>  //
> ====================================================================================================================
>
>  #if HIGH_BIT_DEPTH
> -typedef UShort Pel;            // 16-bit pixel type
> +typedef uint16_t Pel;            // 16-bit pixel type
>  #define X265_DEPTH x265::g_bitDepth  // runtime configurable bit depth
>  extern int g_bitDepth;
>  #else
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131029/8b29107a/attachment.html>


More information about the x265-devel mailing list