Commit graph

43 commits

Author SHA1 Message Date
Michael Sevakis
d26a35d10b Tweak dsp_format_change_process (default format handler).
Just stop searching if the entry is found (as it should have been).

Change-Id: Id968694e825282d58c8ca4a7789c236f98643a5f
2012-05-08 22:47:51 -04:00
Michael Sevakis
87a9951cf8 Consolidate some sample input code.
Input functions have common setup sequences that can be placed
into an inline function instead of repeating it all repeatedly.

Change-Id: I9e62904ff0948651c64ddf160ed4400ed6dc81ff
2012-05-08 21:27:43 -04:00
Nils Wallménius
2dda258f99 Remove STATICIRAM hack
It was only needed by the old arm toolchain that we no longer use or support.

Change-Id: Id0e6c67477f8834a637079b03cde5fbf9da68b1c
Reviewed-on: http://gerrit.rockbox.org/233
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-08 22:46:12 +02:00
Nils Wallménius
3f61caa0cd rbcodec: abstract tdspeed buffer allocation
Move code dealing with rockbox specific buflib allocations into a
rockbox specific file and implement buffer allocation with
malloc/free for warble/stand alone lib.
Based on patch by Sean Bartell.

Change-Id: I8cb85dad5890fbd34c1bb26abbb89c0b0f6b55cf
Reviewed-on: http://gerrit.rockbox.org/144
Tested-by: Nils Wallménius <nils@rockbox.org>
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-07 10:29:07 +02:00
Rafaël Carré
dfeab527e0 remove extraneous parens 2012-05-06 23:41:37 -04:00
Rafaël Carré
5aadf87e98 asap codec: remove invalid memset
This would zero the first 4 or 8 bytes of the array because it is declared as a pointer

rockbox/lib/rbcodec/codecs/libasap/asap.c:1229:44: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
    memset(ast -> memory, 0, sizeof(ast -> memory));
           ~~~~~~~~~~~~~            ~~~~~~~^~~~~~
2012-05-06 23:38:15 -04:00
Rafaël Carré
06c8ab852b Don't use function in a function
It is not supported by clang
2012-05-06 23:34:56 -04:00
Michael Sevakis
6fd4780ac4 Correct comments in lin_resample re: what is actually used by asm.
Change-Id: Idd457f3c645c5d469ebc6fab0bfc85e7b8dd56da
2012-05-06 18:20:11 -04:00
Michael Sevakis
88aeef9127 Remove pointless IRAM allocation from voice DSP.
It's always used in MONO mode and doesn't need the IRAM sample/
resample buffers and 1280 bytes can be freed.

M5 can now have its PCM mixer downmix buffer in IRAM.

Change-Id: I0af08be5b212b7dfe382bba588a6585eb328a038
2012-05-04 22:00:44 -04:00
Michael Sevakis
dbe5e5f2df rbcodec: Hooks for target specific functions in dsp_process loop
Use them to move tick counting, yielding and coldfire macsr handling
code to a rockbox specific file.

Change-Id: Id7417dc98c08a342eba45ba56b044a276e50564b
Reviewed-on: http://gerrit.rockbox.org/229
Tested-by: Nils Wallménius <nils@rockbox.org>
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-03 23:47:46 +02:00
Sean Bartell
cadb3627fc Add rbcodecplatform.h and rbcodecconfig.h.
librbcodec users must provide these two files when the library is built.
rbcodecconfig.h provides configuration #defines and basic types, and
will be included by public librbcodec headers, so it must not conflict
with the user's code. rbcodecplatform.h provides various OS functions,
and will only be included by source files and private headers. This
system is intended to provide maximum flexibility for use on embedded
systems, where no operating system headers are included. Unix systems
can just copy rbcodecconfig-example.h and rbcodecplatform-unix.h with
minimal changes.

Change-Id: I350a2274d173da391fd1ca00c4202e9760d91def
Reviewed-on: http://gerrit.rockbox.org/143
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-05-03 14:49:35 +02:00
Nils Wallménius
26e5e605d2 Delete unused stub functions.
Change-Id: I886d65b60364699845475e2ea1a741aece506a8f
2012-05-02 10:42:21 +02:00
Nils Wallménius
45c5b1fe17 Delete autoconf.h file in the warble source, one less headache.
Change-Id: I83c1b523de453c45aa4df3340b9a1aa63bf321ed
2012-05-01 19:10:00 +02:00
Sean Bartell
4bef502d4d rbcodec refactoring: autoresumable
Moved to playback.c, since it doesn't use metadata from the music file.

Change-Id: I5c3ad7750d94b36754f64eb302f96ec163785cb9
Reviewed-on: http://gerrit.rockbox.org/142
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-01 11:28:38 +02:00
Michael Giacomelli
0dd200b33a Fix audio corruption when sequentially playing low bitrate WMA files
for real this time.  Also, use English grammar.

Change-Id: I1f2156afa313280deb02b58a191511699671a761
2012-05-01 02:01:06 -04:00
Michael Sevakis
b4eec0dd42 Make INITDATA_ATTR work on everything that has INIT_ATTR enabled for code.
Change-Id: If9936bfbbd3bc3eb2a3e3e290701b8517eabfb13
2012-05-01 01:28:50 -04:00
Michael Giacomelli
87d3dde15a Fix corrupt when repeatidly playing very low bitrate WMA files.
The LSP feature in WMA requires that the noise table values be
doubled verses when it is not used.  Unfortunately, the previous
code would double the same values every time a LSP file was
decoded without first resetting them to their original values.
Change the code to check if the values are already doubled, and
then double/halve them as needed.  This is still a bit ugly,
in the future consider using the built in rockbox dither instead
of a lookup table.

Fixes playback when skipping back and forth between low and high
bitrate WMA.

Change-Id: I4c393092e4a789bc8f98d74274fe207400b9550e
Reviewed-on: http://gerrit.rockbox.org/226
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Tested-by: Michael Giacomelli <giac2000@hotmail.com>
2012-05-01 05:42:38 +02:00
Michael Sevakis
f5d9a45e3f Should've had dsp_replaygain_set_gains as static for now...
...because currently gains are only set through dsp_configure.

Change-Id: I2866473a82fdd5f41de4705b45928daa7e43f8eb
2012-04-30 17:51:05 -04:00
Michael Sevakis
8f9e3b10a5 Still need settings.h in dsp_misc.c for now for software volume.
Change-Id: I824e8f9935013f6e2a1db6ccd2db4bd406257057
2012-04-30 17:18:26 -04:00
Michael Sevakis
57a20d2d63 Make DSP's replaygain independent of global_settings.
Moves replaygain definitions to lib/rbcodec/dsp/dsp_misc.h.
Intermediate functions in misc.c handle any adjustment and calling
the rbcodec APIs.

Change-Id: I9f03561bca9aedd13760cf19c4e19aa3c68e7024
Reviewed-on: http://gerrit.rockbox.org/140
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
2012-04-30 22:47:37 +02:00
Michael Sevakis
5f37840e31 Warble must have a call to dsp_init before setting options or using it.
Change-Id: If5cabba99baffe87002d07f11641175f539315a1
2012-04-30 01:55:32 -04:00
Michael Sevakis
ae5656a142 Put the <string.h> channel_mode.c for memcpy.
Hmmm, how'd I miss that?

Change-Id: I30d9a1b5f053aad069687aa0a01ebdf40a6b2d76
2012-04-29 17:44:57 -04:00
Michael Sevakis
56f17c4164 Make rbcodec/dsp includes more specific.
Change-Id: Idb6af40df26f5b8499a40e8b98602261ef227044
2012-04-29 17:31:30 -04:00
Michael Sevakis
23b5f3e5e1 Make compressor_update static.
Change-Id: Ic29242b4c397e82c2bee3808492a2d0a9ffebbe6
2012-04-29 14:47:01 -04:00
Michael Sevakis
230f6f4326 Lower IRAM footprint on ARM.
Move a few functions to .text that probably don't see a huge benefit
from being .icode. Will scrutinize later.

Change-Id: I7bdffc326076c5cd7e6a1c57d25d31e653920327
2012-04-29 14:10:14 -04:00
Michael Sevakis
3b578f018c Fix 3g warning in dsp_arm.S (which showed as an error).
Change-Id: Iccbeca66e809413dda90fec36439b4a180b8a879
2012-04-29 04:57:57 -04:00
Michael Sevakis
d8f3e3d0d1 Get warble building again.
Change-Id: Ibdb2d9064d0e948cfb745c10a7b23de1a750d55b
2012-04-29 04:41:02 -04:00
Michael Sevakis
7cc8bbdaaf Fix no newline at end warning.
Change-Id: I9edb1ebb34f91893b6290d7640fcdaede3434b40
2012-04-29 04:14:11 -04:00
Michael Sevakis
c9bcbe202d Fundamentally rewrite much of the audio DSP.
Creates a standard buffer passing, local data passing and messaging
system for processing stages. Stages can be moved to their own source
files to reduce clutter and ease assimilation of new ones. dsp.c
becomes dsp_core.c which supports an engine and framework for effects.

Formats and change notifications are passed along with the buffer so
that they arrive at the correct time at each stage in the chain
regardless of the internal delays of a particular one.

Removes restrictions on the number of samples that can be processed at
a time and it pays attention to destination buffer size restrictions
without having to limit input count, which also allows pcmbuf to
remain fuller and safely set its own buffer limits as it sees fit.
There is no longer a need to query input/output counts given a certain
number of input samples; just give it the sizes of the source and
destination buffers.

Works in harmony with stages that are not deterministic in terms of
sample input/output ratio (like both resamplers but most notably
the timestretch). As a result it fixes quirks with timestretch hanging
up with certain settings and it now operates properly throughout its
full settings range.
Change-Id: Ib206ec78f6f6c79259c5af9009fe021d68be9734
Reviewed-on: http://gerrit.rockbox.org/200
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2012-04-29 10:00:56 +02:00
Sean Bartell
fe3d58004c rbcodec refactoring: get_audio_base_data_type
This function has been changed to rbcodec_format_is_atomic, which
doesn't require an enum from the kernel.

Change-Id: I1d537605087fe130a9b545509d7b8a340806dbf2
Reviewed-on: http://gerrit.rockbox.org/141
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-04-28 09:07:40 +02:00
Michael Sevakis
0048e5b8ce Some whitespace correction in dsp_*.S
Change-Id: I6ee14c0adc9dd456c8a2d171952cbaedb3752428
2012-04-27 16:55:16 -04:00
Sean Bartell
a6dea9e13d rbcodec refactoring: dsp_set_eq_coefs
dsp_set_eq_coefs now has parameters for the band settings, so it doesn't
need to access global_settings.

Change-Id: I29ac19fc353b15a79cb25f0e45132aef0881e4c9
Reviewed-on: http://gerrit.rockbox.org/138
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-04-27 16:33:27 +02:00
Michael Sevakis
0842d7f7e1 Consolidate compressor settings into a struct.
Doing that makes things cleaner for later on.

Change-Id: I4e279aa57ace16a348acc0fc09059592325ec95f
2012-04-26 17:19:16 -04:00
Michael Sevakis
e5c3327cef Add a more correct absolute difference function to dsp-util.
Differences between signed samples cover the entire unsigned 32-bit
range. "abs" will think any difference exceeding INT32_MAX is negative
which is not corrent. Test which argument is greater and subtract the
lesser from it, outputting unsigned difference.

Change-Id: I73a8e5e418d49ff73d1a7c98eeb4731946dcfe84
2012-04-26 16:04:43 -04:00
Sean Bartell
f40bfc9267 Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-04-25 22:13:20 +02:00
Thomas Martitz
83cb2e5dae Fix warble and clean up/refactor Makefile.
Change-Id: I8754ad8724e22147b98a156fecea599bdda72292
2012-03-27 00:16:09 +02:00
Thomas Martitz
f269aa0060 build system: unify/simplify library handling a bit.
libs in $ROOT/lib now add to $(CORE_LIBS) and $(EXTRA_LIBS) and are
automatically linked by the core and codecs/plugins respectively.

Change-Id: Iff482c792a8c8142718f6a16a450c6e2f1497c9a
2012-03-26 22:27:40 +02:00
Sean Bartell
b5716df4cb Build librbcodec with DSP and metadata.
All associated files are moved to /lib/rbcodec.

Change-Id: I572ddd2b8a996aae1e98c081d06b1ed356dce222
2012-03-18 12:00:39 +01:00
Frank Gevaerts
534117d1e0 Re-add -DDEBUG to the warble makefile
Change-Id: I515d2299b0de39092fbae3b070bd2d6d19a43ec5
2012-03-04 16:35:43 +01:00
Frank Gevaerts
0cc6ba018e Remove standalone makefile. Use configure to build
Change-Id: Ifa4fac02100da17b16199ac63cad1f6fe569667f
2012-03-03 20:45:49 +01:00
Frank Gevaerts
8d41b23ce2 Move includes of other makefiles around to make GCCFLAGS work properly.
Change-Id: Ic6aed06298dcb668a2c0f2c09d25612437893d1b
2012-03-03 20:35:48 +01:00
Frank Gevaerts
466a7c6a40 Integrate the warble tool in the regular build system.
Only sdl app builds work properly for now.

Change-Id: I7807d42f69b8577b401e48cdc63de71e54f49217
2012-03-03 20:19:08 +01:00
Sean Bartell
26fc31ae93 Add the warble test program.
Warble uses Rockbox's codecs to play files with SDL or convert them to
WAV or raw formats. It also prints metadata and supports some of the DSP
effects. In the future, warble could be used to implement an automated
test suite for codecs, metadata, and DSP.

Change-Id: Ife1a63d2354496016277bfcbae4a9c23423ebd86
Reviewed-on: http://gerrit.rockbox.org/135
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
2012-03-03 16:41:49 +01:00