Quality resampling code for libasound

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

After bitching for a while about the poor quality of the resampler used
by the plug: interface, I've finally put code where my mouth is and
wrote a BSD-licensed resampler. While the code lives within the Speex
project, it's trivial to get out of there. All you need to grab is:
http://svn.xiph.org/trunk/speex/include/speex/speex_resampler.h
http://svn.xiph.org/trunk/speex/libspeex/resample.c
and then you need to compile with -DOUTSIDE_SPEEX

The quality is similar to what you get with libsamplerate, but the
license is BSD, so there should be no issue using it within libasound.
There are 11 quality settings (0-10) and even the lowest quality
provided is already miles better than the linear interpolation currently
being done (which creates insane amounts of aliasing when doing things
like upsampling from 8 kHz to 48 kHz). I'm also willing to help whoever
is interested in adding support for it.

Partly related to that is another annoyance I found in the plug:
converters. The conversion between 24-bit samples into 16-bit samples
appears to be done by truncating rather than by rounding, which
introduces more quantisation noise and also a small DC bias. The fix for
that is fairly simple: in all the places where you have something like:
out[i] = in[i] >> 8;
it should be replaced by:
out[i] = (in[i]+128) >> 8;

I would have submitted a patch for that, but I was never able to figure
out how that part of the code works.

	Jean-Marc

P.S. Please keep me in CC since I'm not subscribed to the list.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux