1
0
Fork 0
forked from len0rd/rockbox

FS#10199: Adds limiter DSP function

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22394 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jeffrey Goode 2009-08-18 03:24:45 +00:00
parent f451108fa8
commit 2b7ef6b928
12 changed files with 546 additions and 6 deletions

View file

@ -810,10 +810,34 @@ show_menu:
rb->closedir(dir);
}
/* process last samples */
if (use_dsp)
rb->dsp_flush_limiter_buffer(dspbuffer);
} else {
/* Just test the file */
res = test_track(parameter);
/* process last samples */
if (use_dsp)
{
int channels = (wavinfo.stereomode == STEREO_MONO) ? 1 : 2;
int count = rb->dsp_flush_limiter_buffer(dspbuffer);
if (channels == 1)
{
unsigned char *s = dspbuffer, *d = dspbuffer;
int c = count;
while (c-- > 0)
{
*d++ = *s++;
*d++ = *s++;
s++;
s++;
}
}
if (wavinfo.fd >= 0)
rb->write(wavinfo.fd, dspbuffer, count * 2 * channels);
}
/* Close WAV file (if there was one) */
if (wavinfo.fd >= 0) {
close_wav();