qoa icon indicating copy to clipboard operation
qoa copied to clipboard

How does the 1-bit variant work?

Open ElijahHamilton opened this issue 1 year ago • 3 comments

Hi, how does QOA work at 1-bit? Does it only store the residual at 1-bit? Or Something else?

ElijahHamilton avatar May 27 '24 01:05 ElijahHamilton

Yes. It works similar to the other variants. Samples are divided into slices of 60. For each slice a 4-bit scalefactor and 60 1-bit residuals are stored. The 4-bit scalefactor and 1-bit residuals combined represent one of these values.

phoboslab avatar May 27 '24 19:05 phoboslab

Wouldn't that give a bitrate of 8533.33333 bits/s?

ElijahHamilton avatar May 28 '24 17:05 ElijahHamilton

For 8khz mono, yes.

I guess I misunderstood your initial question.

Does it only store the residual at 1-bit

So, no, the scalefactor for every slice of 60 samples is also stored. That means the effective bitrate is 1.0666 bits per sample (ignoring the overhead for file and frame headers).

phoboslab avatar May 28 '24 20:05 phoboslab