freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] [smooth] Reduce shift in multiply-shift


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [smooth] Reduce shift in multiply-shift optimization.
Date: Mon, 30 Aug 2021 11:11:47 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

1 changed file:

Changes:

  • src/smooth/ftgrays.c
    ... ... @@ -386,12 +386,10 @@ typedef ptrdiff_t FT_PtrDist;
    386 386
       /* divisors to provide sufficient accuracy of the multiply-shift.    */
    
    387 387
       /* It should not exceed (64 - PIXEL_BITS) to prevent overflowing and */
    
    388 388
       /* leave enough room for 64-bit unsigned multiplication however.     */
    
    389
    -#define FT_UDIVPREP( c, b )                                                 \
    
    390
    -  FT_Int64  b ## _r = c ? (FT_Int64)( ~(FT_UInt64)0 >> PIXEL_BITS ) / ( b ) \
    
    391
    -                    : 0
    
    392
    -#define FT_UDIV( a, b )                                         \
    
    393
    -  (TCoord)( ( (FT_UInt64)( a ) * (FT_UInt64)( b ## _r ) ) >>    \
    
    394
    -            ( sizeof( FT_UInt64 ) * FT_CHAR_BIT - PIXEL_BITS ) )
    
    389
    +#define FT_UDIVPREP( c, b )                                \
    
    390
    +  FT_Int64  b ## _r = c ? (FT_Int64)0xFFFFFFFF / ( b ) : 0
    
    391
    +#define FT_UDIV( a, b )                                           \
    
    392
    +  (TCoord)( ( (FT_UInt64)( a ) * (FT_UInt64)( b ## _r ) ) >> 32 )
    
    395 393
     
    
    396 394
     
    
    397 395
       /* Scale area and apply fill rule to calculate the coverage byte. */
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]