Re:Lyra V2 – a better, faster, and more versatile speech codec
by douglasheriot on Friday September 30, 2022 @08:47PM
(#33042621)
It sounds like you’re asking for uncompressed audio? That meets all of your listed requirements.
48kHz * 16bit, single channel = 768kbit/s
[ Parent
| on HN ]
Re:Lyra V2 – a better, faster, and more versatile speech codec
by dale_glass on Saturday October 01, 2022 @06:37AM
(#33045533)
We support that already, yup. But it never hurts to see if there's something better than that out there.
Re:Lyra V2 – a better, faster, and more versatile speech codec
by orlp on Tuesday October 04, 2022 @12:12PM
(#33082483)
You can bootleg your own fast lossless codec by doing delta-encoding on the raw PCM to get a lot of zeros and then feed it through an off-the-shelf fast compressor like snappy/lz4/zstandard/etc. It won't get remotely close to the dedicated audio algorithms, but I wouldn't be surprised if you cut your data size by a factor 2-4 and essentially no CPU cost compared to raw uncompressed audio.
Re:Lyra V2 – a better, faster, and more versatile speech codec
by muziq on Wednesday October 05, 2022 @05:07PM
(#33101255)
You’ve not done this before have you ?
Re:Lyra V2 – a better, faster, and more versatile speech codec
by orlp on Thursday October 13, 2022 @10:15AM
(#33191258)
I haven't, but now I have. I took https://opus-codec.org/static/examples/samples/music_orig.wa... from https://opus-codec.org/examples/. Then I wrote the following snippet of Python code:
from scipy.io import wavfile
import numpy as np
import zstd
sampling_rate, samples = wavfile.read(r'data/bootleg-compress/music_orig.wav')
orig = samples.tobytes()
naive_compressed = zstd.ZSTD_compress(orig)
deltas = np.diff(samples, prepend=samples.dtype.type(0), axis=0) # Per-channel deltas.
compressed_deltas = zstd.ZSTD_compress(deltas.ravel()) # Interleave channels and compress.
decompressed_deltas = np.frombuffer(zstd.ZSTD_uncompress(compressed_deltas), dtype=samples.dtype)
decompressed = np.cumsum(decompressed_deltas.reshape(deltas.shape), axis=0, dtype=samples.dtype)
assert np.array_equal(samples, decompressed)
print(len(orig))
print(len(naive_compressed))
print(len(compressed_deltas))
giving: 17432876
15518973
12817602
Looks like my initial estimation of 2-4 was way off (when FLAC achieves ~2 this should've been a red flag), but you do get a ~1.36x reduction in space at basically memory read speed.
Re:Lyra V2 – a better, faster, and more versatile speech codec
by zinekeller on Saturday October 01, 2022 @07:05AM
(#33045653)
While I also want a low-computation codec that can save space, the historical use cases unfortunately assumes a lot more CPU power to be compensated for a lot less bandwidth, so there's little research in this area, and there's no real incentive to make something like ProRes and DNxHD as if you are editing audio the SSD speeds has been so fast that you'll run into CPU problems first.
Re:Lyra V2 – a better, faster, and more versatile speech codec
by userbinator on Friday September 30, 2022 @10:28PM
(#33043208)
Either that or G.711.
Re:Lyra V2 – a better, faster, and more versatile speech codec
by viraptor on Saturday October 01, 2022 @10:35AM
(#33046862)
G711 is neither high bitrate nor usable for music.
Re:Lyra V2 – a better, faster, and more versatile speech codec
by simfree on Saturday October 01, 2022 @04:08PM
(#33049596)
Then use G.722, it works fine for music.
Re:Lyra V2 – a better, faster, and more versatile speech codec
by viraptor on Saturday October 01, 2022 @06:10PM
(#33050601)
No, g722 is still a wideband speech codec. Its available frequency goes up to 7 kHz. The uncompressed audio this thread began with goes up to 22 kHz. With g722 you're losing most overtones, or even all overtones from the top of a piano. Please don't use g722 for music apart from on-hold muzak.