Thread: Avisynth+
View Single Post
Old 21st February 2018, 14:43   #3938  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by StainlessS View Post
This would be nice addition to +.

Code:
RT_BitSetCount(int)
 Return an int, the count of the number of set bits (1's) in arg int.
 NOTE, Previous Bit functions are similar to the v2.6 bit manipulation functions, however this one has no equivalent in v2.6
 [perhaps it should, it is quite handy, as used in the ApparentFPS() script prototype)]
BitClrCount easily calc'd from above.
This one?
https://stackoverflow.com/questions/...32-bit-integer

RT_xxx collection have quite a few useful function, do you (or others) recommend to cherry-pick some of them, which are worth of integration and futureproof?

Edit:
Code:
  - New script function: int BitSetCount(int[,int, int, ...])
    Function accepts one or more integer parameters
    Returns the number of bits set to 1 in the number or the total number of '1' bits in the supplied integers.

Last edited by pinterf; 21st February 2018 at 15:21. Reason: Implemented
pinterf is offline