[vorbis] Low bitrate encoding
jaromil
jaromil at dyne.org
Tue Jan 9 04:14:36 PST 2001
On Tue, Jan 09, 2001 at 11:49:09AM +0100, Olaf van der Spek wrote:
> > i am currently working on down/upsampling routines for the next major
> > release of muse (2:1/1:2, is that meant here?), as far as i get
something
> > useful i'll notice - next 2 weeks. found really useful to peek into
the
> > sourcecode of SDL (www.libsdl.org) src/audio/SDL_audiocvt.
>
> Is downsampling (from 44100 hz to 22500 hz) something else then just
taking
> the average of two samples from the read buffer and putting that in the
> write buffer?
>
that's not exact... more than averaging it's a stretching operation.
assuming 16bit samples i would do it like that:
/* downsampling >>1 */
for(i=src_length>>2;i;--i) {
dst[0] = src[0];
dst[1] = src[1];
src += 4;
dst += 2;
}
/* upsampling <<1 */
for(i=src_lenght>>1;i;--i) {
src -= 1;
dst -= 2;
dst[0] = src[0];
dst[1] = src[0];
}
o at the end is really simple
it's not the first time i see this algorithm,
i trust it more since i saw sam lantinga using it.
i guess it can be done in asm with mmx lubrification...
jrml
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis
mailing list