All of lore.kernel.org
 help / color / mirror / Atom feed
* Quality resampling code for libasound
@ 2007-02-19  4:01 Jean-Marc Valin
  2007-02-19 12:23 ` Takashi Iwai
  0 siblings, 1 reply; 45+ messages in thread
From: Jean-Marc Valin @ 2007-02-19  4:01 UTC (permalink / raw)
  To: alsa-devel

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2007-03-21 17:24 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19  4:01 Quality resampling code for libasound Jean-Marc Valin
2007-02-19 12:23 ` Takashi Iwai
2007-02-19 12:54   ` Jean-Marc Valin
2007-02-19 13:10     ` Takashi Iwai
2007-02-19 13:38       ` Jean-Marc Valin
2007-02-19 13:47         ` Takashi Iwai
2007-02-20  5:53           ` Jean-Marc Valin
2007-02-20  6:48           ` Jean-Marc Valin
2007-02-20 10:45             ` Takashi Iwai
2007-02-20 11:54               ` Jean-Marc Valin
2007-02-20 12:13                 ` Takashi Iwai
2007-02-20 12:38                   ` Jean-Marc Valin
2007-02-20 21:50                     ` Fernando Lopez-Lezcano
2007-02-20 22:07                     ` James Courtier-Dutton
2007-02-20 22:45                       ` Jean-Marc Valin
2007-02-21  2:10                       ` Jean-Marc Valin
2007-02-21  9:18                       ` Jean-Marc Valin
2007-02-22 11:38                         ` Takashi Iwai
2007-02-22 11:48                           ` Jean-Marc Valin
2007-02-22 12:07                             ` Takashi Iwai
2007-02-28  2:10                               ` Jean-Marc Valin
2007-03-07 22:25                                 ` Takashi Iwai
2007-03-08  0:59                                   ` Jean-Marc Valin
2007-03-09 16:08                                     ` Takashi Iwai
2007-03-20 13:22                                       ` Jean-Marc Valin
2007-03-20 13:52                                         ` Takashi Iwai
2007-03-20 14:07                                           ` Jean-Marc Valin
2007-03-20 14:19                                             ` Takashi Iwai
     [not found]                                               ` <4600539A.2070804@usherbrooke.ca>
2007-03-21 11:23                                                 ` [Alsa-devel] " Takashi Iwai
2007-03-21 13:08                                                   ` Jean-Marc Valin
2007-03-21 13:14                                                     ` Takashi Iwai
2007-03-21 13:39                                                       ` Jean-Marc Valin
2007-03-21 13:59                                                         ` Takashi Iwai
2007-03-21 14:19                                                           ` Jean-Marc Valin
2007-03-21 14:53                                                             ` Takashi Iwai
2007-03-21 15:17                                                               ` Jean-Marc Valin
2007-03-21 15:43                                                                 ` Takashi Iwai
2007-03-21 15:27                                                       ` Rene Herman
2007-03-21 15:34                                                         ` Jean-Marc Valin
2007-03-21 16:38                                                           ` Rene Herman
2007-03-21 16:57                                                             ` Takashi Iwai
2007-03-21 17:24                                                               ` Takashi Iwai
2007-02-21 14:48                       ` Jean-Marc Valin
2007-02-19 13:11     ` Prakash Punnoor
2007-02-19 13:36       ` Adam Tlałka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.