CVSD Compressed audio example

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: CVSD Compressed audio example

Post by Chilly Willy » Sat Dec 29, 2018 6:57 pm

AMBTC uses a different approach than traditional VQ. It's more about quantizing a single block into two values that give a mean value the same as the original block. VQ is finding small blocks that are most representative of the entire sample. And I can't believe you think the vq2 samples sound bad. They're almost identical to the original (as 22050 Hz 8-bit samples, of course). Plus they're far better than the CVSD or AMBTC results. They're arguably better than comparably compressed ADPCM.

amushrow
Interested
Posts: 44
Joined: Mon Jan 02, 2017 12:56 pm

Re: CVSD Compressed audio example

Post by amushrow » Sat Dec 29, 2018 7:08 pm

Thanks for those Chilly Willy, I think the stuff I've been working on sounds cleaner for the same file sizes so I'm going to continue on with that.
Hopefully I can get it running on an actual console in the next few days and get some real world comparisons. Then I can stop thinking about it and do something else, I must have listed to the same sample tracks hundreds of times over the last few days.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: CVSD Compressed audio example

Post by Chilly Willy » Sun Dec 30, 2018 1:50 am

No problem. I'd love to see your codec when you're done. I'm fascinated by codecs in general. If you have something better at the same compression ratio that plays on Z80, I certainly am interested in it. :D

cero
Very interested
Posts: 338
Joined: Mon Nov 30, 2015 1:55 pm

Re: CVSD Compressed audio example

Post by cero » Sun Dec 30, 2018 8:57 am

https://files.catbox.moe/incsd9.zip
This zip contains the first bad 10s from both the original Bad Apple and the vq2 version, both in the same 22kHz 8bit mono format. Do you really not hear the difference? The vq2 version is a lot worse.

edit: I haven't tried the other formats you mention, and I believe you when you say they're worse. I'm just saying that the current quality is not acceptable, at least in my opinion.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: CVSD Compressed audio example

Post by Chilly Willy » Sun Dec 30, 2018 1:26 pm

I can hear the difference, but it's better than ADPCM in my opinion. I'd love to hear better that still decodes on Z80. And I mean that literally - 8-bit/16-bit compatible compression tends to be not so good since you're talking about rather low power processors, so all 8-bit intended codecs suffer in one way or another.

cero
Very interested
Posts: 338
Joined: Mon Nov 30, 2015 1:55 pm

Re: CVSD Compressed audio example

Post by cero » Sun Dec 30, 2018 6:10 pm

Besides tuning the encoder, it could easily be turned to a lossless compressor. A quick pass over a random song shows there aren't very many unique u32s, just tens or hundreds of thousands.

VQlossless: 256 x 4 samples followed by the number N, then N of codes. Probably 30-60% compression, N could be limited to a few kb so that Z80 can still access it all.

edit: Okay, with a different song this wouldn't work at all. But having such dynamic quality might help the vq too.

Just ideas, anyway.

gligli
Newbie
Posts: 8
Joined: Thu Jun 08, 2017 7:46 am
Location: Lyon / France
Contact:

Re: CVSD Compressed audio example

Post by gligli » Sun Dec 30, 2018 6:41 pm

Hello,
A while ago I made this demo of a Z80 codec I made: http://sfx.gligli.free.fr/mddev/SoundChunks_Demo.7z
It's full sample rate (26390Hz 8bit mono) and uses statistical compression to achieve 8 minutes of music on 4MB.
There are a few bugs especially on sibilance but it worked fine already :)

gasega68k
Very interested
Posts: 141
Joined: Thu Aug 22, 2013 3:47 am
Location: Venezuela - Caracas
Contact:

Re: CVSD Compressed audio example

Post by gasega68k » Mon Dec 31, 2018 6:39 am

I have done some stuff on audio compression too :) , I think the first one I did was on 2007, mostly are some kind of "adpcm", even on wolf3d I did a 2:1 audio compression for samples similar to sonic (back then I didn't know Sonic was using compression on pcm, until I was looking on sonic sources when I was getting some problems with wolf3d on fm music playback on real hardware, and I noticed that it was similar to what I did).

The last one I did was one that do 3:1 compression, from one byte you get 3 samples, like this:

Bit 7 and 6 select one of 4 tables with 2 values, bit 5 indicate 1= add or 0=substract, bit 4 select one of the 2 values, the same goes for bits 3-2, and bits 1-0, it will use the same table for 3 samples.

The tables are:
1, 4
4, 8
8, 16
16, 32

For example if you have bits 7-6 = 01 , bits 5-4 = 10, bits 3-2 = 01 and bits 1-0 = 11
it will be:
1. add 4
2. sub 8
3. add 8

Now if you have bits 7-6 = 11 , bits 5-4 = 11, bits 3-2 = 10 and bits 1-0 = 00
it will be:
1. add 32
2. add 16
3. sub 16


Chilly Willy, I did a z80 vq3 version a few days later when you posted about it on plutiedev discord channel, and I think it sound better than mine, here are some examples I did:
http://www.mediafire.com/file/pc2bsdu4q ... est+vq.zip

In the Zip there are 3 roms: "test_vq3_z80_22khz.bin" is the Sonic cd intro at 22khz, "starwars_music_demo_vq3.bin" is a starwars soundtrack with about 9 minutes of music at 12.4 khz, the songs and duration (exept the starwars theme) are based on the N64 game "shadows of the empire", and the song names are based on the leves (mostly).

"starwars_music_demo_vq3f.bin" is the same but the diference is that in this one I did a "2x oversampling", is just playing one sample that is: old sample + current sample / 2, making a 24.8 khz playback, which removes some of the noise.


And for comparision this is the same Sonic cd intro at 22 khz with my 3:1 compression code:
http://www.mediafire.com/file/66h1y64a6 ... z.zip/file

cero
Very interested
Posts: 338
Joined: Mon Nov 30, 2015 1:55 pm

Re: CVSD Compressed audio example

Post by cero » Mon Dec 31, 2018 10:01 am

Seems deltas + Huffman would allow a 70-80% lossless 8bit pcm file, but is the z80 fast enough with its bit shifts? Probably not fast enough for 2-4 sfx using such, and music is better off using fm/psg.

bioloid
Very interested
Posts: 169
Joined: Fri May 18, 2012 8:22 pm

Re: CVSD Compressed audio example

Post by bioloid » Mon Dec 31, 2018 6:16 pm

wow, is there something working good here at 22k ? will need it for my future demo to save space please

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: CVSD Compressed audio example

Post by Stef » Mon Dec 31, 2018 8:12 pm

I've my very simple ADPCM driver which provide 2 channels @22Khz with 1:2 ratio but to be honest i think you can find much better now :)

bioloid
Very interested
Posts: 169
Joined: Fri May 18, 2012 8:22 pm

Re: CVSD Compressed audio example

Post by bioloid » Tue Jan 01, 2019 1:56 am

1:2 could be ok if quality is ok

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: CVSD Compressed audio example

Post by Chilly Willy » Tue Jan 01, 2019 2:01 am

gasega68k wrote:
Mon Dec 31, 2018 6:39 am
Chilly Willy, I did a z80 vq3 version a few days later when you posted about it on plutiedev discord channel, and I think it sound better than mine, here are some examples I did:
http://www.mediafire.com/file/pc2bsdu4q ... est+vq.zip

In the Zip there are 3 roms: "test_vq3_z80_22khz.bin" is the Sonic cd intro at 22khz, "starwars_music_demo_vq3.bin" is a starwars soundtrack with about 9 minutes of music at 12.4 khz, the songs and duration (exept the starwars theme) are based on the N64 game "shadows of the empire", and the song names are based on the leves (mostly).

"starwars_music_demo_vq3f.bin" is the same but the diference is that in this one I did a "2x oversampling", is just playing one sample that is: old sample + current sample / 2, making a 24.8 khz playback, which removes some of the noise.


And for comparision this is the same Sonic cd intro at 22 khz with my 3:1 compression code:
http://www.mediafire.com/file/66h1y64a6 ... z.zip/file
Nice! That's a great set of demos for trying on hardware (or emulators). Like I said, I think VQ is just slightly better than ADPCM at the same compression ratio, and much easier to decode. And super-sampling was a good idea for reducing the noise. I did notice it wasn't as noisy, which is perhaps the main thing you notice with VQ.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: CVSD Compressed audio example

Post by Stef » Tue Jan 01, 2019 6:20 pm

bioloid wrote:
Tue Jan 01, 2019 1:56 am
1:2 could be ok if quality is ok
I think the quality is quite ok, i don't really notice much difference compared to original sample (high playback rate help) :)
It's embedded in SGDK and so really easy to use if you want to test it out (just use a WAV file with ADPCM driver).

bioloid
Very interested
Posts: 169
Joined: Fri May 18, 2012 8:22 pm

Re: CVSD Compressed audio example

Post by bioloid » Tue Jan 01, 2019 7:14 pm

Oh ok, awesome, thanks!

Post Reply