On Saturday, 2 September 2017 at 03:29:20 UTC, EntangledQuanta
wrote:
On Saturday, 2 September 2017 at 02:49:41 UTC, Ilya Yaroshenko
wrote:
On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta
wrote:
Is there a way to create a 24-bit int? One that for all
practical purposes acts as such? This is for 24-bit stuff
like audio. It would respect endianness, allow for arrays
int24[] that work properly, etc.
Hi,
Probably you are looking for bitpack ndslice topology:
http://docs.algorithm.dlang.io/latest/mir_ndslice_topology.html#.bitpack
sizediff_t[] data;
// creates a packed signed integer slice with max allowed
value equal to `2^^24 - 1`.
auto packs = data[].sliced.bitpack!24;
packs has the same API as D arrays
Package is Mir Algorithm
http://code.dlang.org/packages/mir-algorithm
Best,
Ilya
Thanks. Seems useful.
Just added `bytegroup` topology. Released in v0.6.12 (will be
available in DUB after few minutes.)
http://docs.algorithm.dlang.io/latest/mir_ndslice_topology.html#bytegroup
It is faster for your task then `bitpack`.
Best regards,
Ilya