summaryrefslogtreecommitdiff
path: root/apps/dsp.c
AgeCommit message (Collapse)Author
2008-09-08Something horrible happened with binsize, so revert FS#8894 completely (for ↵Steve Bavin
now). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18449 a1c6a512-1295-4272-9138-f99709370657
2008-09-08Add timestretching from FS#8894, as written by Stephane Doyon based on work ↵Steve Bavin
by Nicolas Pitre. Shouldn't affect playback unless it's explicitly enabled, but let me know if it does. Currently has a dedicated setting, but maybe inclusion of the code will inspire someone to integrate this with the pitch screen... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18446 a1c6a512-1295-4272-9138-f99709370657
2008-07-07Fix FS #8361 - Custom stereo width reset by changing treble on e200. Thanks ↵Dan Everton
to Tomer Shalev for the investigation work and the patch. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17976 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-05-03Made source files #include the header file that they implement to make sure ↵Bertrik Sikken
they are in sync. Made some local functions static. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17312 a1c6a512-1295-4272-9138-f99709370657
2008-04-08Remove FRACMUL_8_LOOP macro. This only benefited Coldfire, and we have ↵Thom Johansen
assembler routines for the gain function there now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17040 a1c6a512-1295-4272-9138-f99709370657
2008-04-08Remove ACC_INIT, ACC and GET_ACC macros. These were quite Coldfire-centric ↵Thom Johansen
macros which really aren't needed since all performance sensitive target DSP code should be assembler anyway. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17037 a1c6a512-1295-4272-9138-f99709370657
2008-03-20Turnaround time must be included in dsp yielding to throttle against other ↵Michael Sevakis
threads. Do at least one per buffer full as well (or things can stick a bit on initial input triggers). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16721 a1c6a512-1295-4272-9138-f99709370657
2008-03-19Commit FS#8750. Add ARM assembler for the dsp-functions ↵Andree Buschmann
channels_process_sound_chan_mono(), channels_process_sound_chan_karaoke(), sample_output_mono() and sample_output_stereo(). By measurement the speed up is ~75% for the first three functions and ~40% for sample_output_stereo(). Additionally avoid calling yield() to often in dsp.c -- it is now limited to once per tick. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16717 a1c6a512-1295-4272-9138-f99709370657
2007-12-08Crossfeed settings used to be stored inverted in the cfg file for legacy ↵Thom Johansen
reasons, change that and kill some identical formatting functions while we're at it. NOTE TO CROSSFEED USERS: this will completely garble your crossfeed settings, write them down if you want to keep them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15895 a1c6a512-1295-4272-9138-f99709370657
2007-12-04FS #8106. Fix overflow when dithering files that clip a lot, caused by noise ↵Thom Johansen
shaping error being calculated after clipping instead of before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15873 a1c6a512-1295-4272-9138-f99709370657
2007-11-18Make speex the new voice format for SWCODEC targets (non-Archos). Remove ↵Michael Sevakis
codec swapping and build speex voice decoding directly into the core binary. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15668 a1c6a512-1295-4272-9138-f99709370657
2007-10-30Just because it's #if 0 doesn't make it inferior...Thom Johansen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15370 a1c6a512-1295-4272-9138-f99709370657
2007-10-29Fix faulty clipping when dithering is enabled (thanks to Jens Arnold). This ↵Thom Johansen
bug would only affect people using WMA. Also, add a small comment in an unrelated place. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15369 a1c6a512-1295-4272-9138-f99709370657
2007-08-29FS #7286. Do correct rounding of final 16 bit samples before sending to DAC, ↵Thom Johansen
for you golden-eared people. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14514 a1c6a512-1295-4272-9138-f99709370657
2007-05-10Code cleaning - remove some unnecessary defined(SIMULATOR) checksDave Chapman
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13369 a1c6a512-1295-4272-9138-f99709370657
2007-03-29Accept FS#6918 - Remove Nested Functions by Tim Ross. Adjust some names. ↵Michael Sevakis
Hunt down and remove the remaining ones in the recording system as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12955 a1c6a512-1295-4272-9138-f99709370657
2007-03-26SWCODEC: Need to call resampler_new_delta when resetting DSP.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12929 a1c6a512-1295-4272-9138-f99709370657
2007-03-25SWCODEC & Coldfire: Do some more DSP straigntening out. Do as much Coldfire ↵Michael Sevakis
optimizing as seems reasonably possible by jumping through some hoops to avoid stalls. Further boost reduction will just be fractional points if taken to extremes-- not worth it. Wrap up the ASM for awhile. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12905 a1c6a512-1295-4272-9138-f99709370657
2007-03-07Use the new DSP callback functionality in firmware/sound.c to deal with ↵Thom Johansen
SWCODEC stereo width and channel configuration instead of the old more spread out #ifdef based approach. Rename the DSP functions involved for more consistent naming. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12677 a1c6a512-1295-4272-9138-f99709370657
2007-03-07Factor first order shelving filter code out for easier reuse and replace the ↵Thom Johansen
crossfeed filter with it. Crossfeed _should_ still sound the same, so please do tell if it doesn't. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12674 a1c6a512-1295-4272-9138-f99709370657
2007-02-28SWCODEC: Patchup the short crossfade glitching reported for FLAC but seemed ↵Michael Sevakis
not limited to FLAC actually. Crossfade doesn't like being hand the larger chunks that the dsp was now able to process when not resampling. The real fix is making it not matter. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12521 a1c6a512-1295-4272-9138-f99709370657
2007-02-27Fix a problem when dithering mono audio. Left samples weren't being ↵Michael Sevakis
duplicated into right channel in pcm buffer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12509 a1c6a512-1295-4272-9138-f99709370657
2007-02-27Fix old bug where applying a crossfeed direct gain of 0 dB would result in ↵Thom Johansen
negative gain. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12508 a1c6a512-1295-4272-9138-f99709370657
2007-02-27Adapt ARM crossfeed assembler to work like the Coldfire one. Remove ↵Thom Johansen
SWITCHPARAM cruft as it's no longer needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12507 a1c6a512-1295-4272-9138-f99709370657
2007-02-27crossfeed_data needn't be initialized for every targetMichael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12506 a1c6a512-1295-4272-9138-f99709370657
2007-02-27SWCODEC: Tighten up coldfire assembly a little bit more. Cleanup to make ↵Michael Sevakis
differing parameters between ARM and Coldfire halfway clean. Hopefully those differences can be reconciled soon. A tiny bit of C optimizing for karaoke channel mode. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12505 a1c6a512-1295-4272-9138-f99709370657
2007-02-26SWCODEC: Fix the problem of replaygain not being applied unless the menu is ↵Michael Sevakis
entered. Make all codecs set the replay gain or else formats that do not have replaygain will not set the gain back to default if a file with gain applied proceeded them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12498 a1c6a512-1295-4272-9138-f99709370657
2007-02-26Add software based bass/treble controls for targets which have no such ↵Thom Johansen
functionality in hardware (currently only X5). They can also be used on any other SWCODEC target by adding #define HAVE_SW_TONE_CONTROLS in the relevant config-*.h file. Also remove some now unneeded zero checks when using get_replaygain_int(). Comments on sound quality are welcome as some parameters can still be fine-tuned. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12489 a1c6a512-1295-4272-9138-f99709370657
2007-02-24SWCODEC: Dsp speed optimizations. Changes for more modularity. Removal of ↵Michael Sevakis
some usless stuff. Some assembly routines for Coldfire with speed in mind over size for the outputs but the channel modes remain compact. Miscellaneous coldfire asm updates to accomodate the changes. Codec API structure version has to increase so do a full update. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12472 a1c6a512-1295-4272-9138-f99709370657
2007-02-21Fix broken conversion of 16 bit interleaved stereo to internal format.Thom Johansen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12441 a1c6a512-1295-4272-9138-f99709370657
2007-02-19SWCODEC: DSP optimizations for conversion to internal format and resampling. ↵Michael Sevakis
Assembly resampling for Coldfire. Word has it ARM will get that soon. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12399 a1c6a512-1295-4272-9138-f99709370657
2007-02-17include stdbool.h to get the bool type and fix the build errorDaniel Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12361 a1c6a512-1295-4272-9138-f99709370657
2007-02-17build with -Wundef to make sure we have spelled the defines right in #if linesDaniel Stenberg
and have the proper includes included etc git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12360 a1c6a512-1295-4272-9138-f99709370657
2007-02-16SWCODEC: Remove the last quirks when upsampling.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12336 a1c6a512-1295-4272-9138-f99709370657
2007-02-15Optimise/touchup some asm macros in dsp.h, and also remove some now unneeded ↵Thom Johansen
ones. Add config.h to dsp.c so that these macros actually get used, and also do some minor nitpicks to the resampler while I'm at it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12322 a1c6a512-1295-4272-9138-f99709370657
2007-02-10SWCODEC: Annoying neatness update. Use intptr_t for codec_configure_callback ↵Michael Sevakis
and dsp_configure and stop all the silly type casting of intergral types to pointers to set dsp configuration and watermarks. Shouldn't have any effect on already compiled codecs at all. Will fix any important patches in the tracker so they compile. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12259 a1c6a512-1295-4272-9138-f99709370657
2007-02-07Fix resampling clicking as much as possible at the moment. 1) Upsampling ↵Michael Sevakis
clicked because of size inaccuracies returned by DSP. Fix by simplifying audio system to use per-channel sample count from codec to pcm buffer. 2) Downsampling affected by 1) and was often starting passed the end of the data when not enough was available to generate an output sample. Fix by clamping input range to last sample in buffer and using the last sample value in the buffer. A perfect fix will require a double buffering scheme on the resampler to sufficient data during small data transients on both ends at all times of the down ratio on input and the up ratio on output. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12218 a1c6a512-1295-4272-9138-f99709370657
2007-02-05Optimise EQ coef calculation routines for both speed and size. Move now ↵Thom Johansen
unneeded fsqrt function to plugin fixed point library in case it'll be needed. Move all fixed point helper macros to dsp.h. Added FRACMUL_SHL macro to facilitate high-precision shifting of 64 bit multiplies and remove rounding from macsr in main thread to make this work as intended. Tested quite thorougly, but as always, be careful with your ears. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12203 a1c6a512-1295-4272-9138-f99709370657
2006-12-12More static'ing, and a few fixes resulting from that.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11737 a1c6a512-1295-4272-9138-f99709370657
2006-11-29Fixed FS#6389 - Sound disappears after pitch change and jump to the start of ↵Michael Sevakis
the song. Forgot to reinit the resampler delta when adding DSP_FLUSH on my last change. Bah. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11621 a1c6a512-1295-4272-9138-f99709370657
2006-11-26SWCODEC: Stop clicks between tracks when resampler is active by only ↵Michael Sevakis
switching the DSP frequency and not resetting the resampler at track boundaries. Will make sure DSP is correctly flushed at dicontinuities but don't hear any problems currently. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11600 a1c6a512-1295-4272-9138-f99709370657
2006-11-25Fixed bug in dither_init that was causing the AIFF playback at sample rates ↵Michael Sevakis
other than 44.1kHz to not procede. It created a dependency of setting sample depth before frequency and aiff.codec does it the other way. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11595 a1c6a512-1295-4272-9138-f99709370657
2006-11-15Make the updated %rg tag match playback behaviour (fall back to track gain ↵Magnus Holmgren
if album gain requested but not available). Share the mode decision logic with playback code and simplify the %rg tag handling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11532 a1c6a512-1295-4272-9138-f99709370657
2006-10-27Re-enable the currently unused and broken dithering and noise shaping code ↵Thom Johansen
already in Rockbox, and make it a user option instead of a codec-controlled option. The majority of people probably will not even hear any difference with this enabled, but feedback is welcome. Save your settings! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11368 a1c6a512-1295-4272-9138-f99709370657
2006-04-17Fix the use of equalizer pre-cut in combination with replaygain.Magnus Holmgren
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9711 a1c6a512-1295-4272-9138-f99709370657
2006-04-17Fix/add some comments and remove some old leftover crossfeed code.Thom Johansen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9705 a1c6a512-1295-4272-9138-f99709370657
2006-04-11New crossfeed complete with no volume reducing bugs. Feedback on all theThom Johansen
new options is appreciated. Thanks to Dan Everton for the settings/GUI code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9609 a1c6a512-1295-4272-9138-f99709370657
2006-04-02Prevent two division by zeros and one problem causing a crash in theMiika Pekkarinen
mp3 metadata parser. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9438 a1c6a512-1295-4272-9138-f99709370657
2006-03-28Update equalizer precut value as it's adjusted.Dan Everton
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9332 a1c6a512-1295-4272-9138-f99709370657