JuliaIO / TranscodingStreams.jl

Simple, consistent interfaces for any codec.
https://juliaio.github.io/TranscodingStreams.jl/
Other
86 stars 28 forks source link

Support libaec? #207

Open milankl opened 6 months ago

milankl commented 6 months ago

Just checking whether there's any interest here to support libaec as a codec. It's made primarily for 16/32bit unsigned integers with low entropy and in that sense somewhat specific (but a lot of big data applications fall into this category) but it doesn't look too hard to create a jll for it and write a CodecLibaec.jl wrapper for it.

nhz2 commented 6 months ago

There's a jll for libaec https://juliahub.com/ui/Packages/General/libaec_jll already, and it seems to have a similar API to zlib.

IIUC when decoding the parameters need to be set the exact same way they were for encoding, so things like: transcode(AECDecompressor, compressed_buffer) won't work, instead you can do something like:

codec = AECDecompressor(;aec_parameters)
TranscodingStreams.initialize(codec)
try
    data = transcode(codec, compressed_buffer)
finally
    TranscodingStreams.finalize(codec)
end