Commit graph

366 commits

Author SHA1 Message Date
Lorenzo Miori
0f1d44dba2 Simulator - encoders can now be loaded
This enables the encoders - i.e. to record audio -
to be loaded also on the simulator.

Change-Id: I54fdbeb75b89023c0d7824a34cf76301c02c3150
Reviewed-on: http://gerrit.rockbox.org/632
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-10-05 12:25:13 +02:00
Nils Wallménius
b97cdc8f5e Opus: delete two files that were moved into a subdir
Change-Id: I54ef0dfd57fbb493ad38855767a8f5e724e5bc65
2013-09-01 18:36:12 +02:00
Nils Wallménius
3000ca32f9 Fix warning from a35c1b3
Change-Id: I0e9b2c265a6a2355dc39b1696df4c8f266d9a638
2013-09-01 17:54:10 +02:00
Nils Wallménius
a35c1b3595 Opus: Coldfire inline asm for comb_filter_const
Speeds up decoding a 64kbps test file by 2.6MHz

Change-Id: Ibeb30f37cc00a4a6f65b64851009753f40e06fc1
2013-09-01 17:39:15 +02:00
Nils Wallménius
516f7fbd6c Add cf asm inline for multiplication commonly used in silk.
Speeds up decoding a 16kbps test file by 4.9MHz on h300.

Change-Id: I8c25431c98dfa9a1c3806a84055e0847eb77a9f1
2013-08-31 17:57:33 +02:00
Nils Wallménius
b592a7a8a5 Put two hot silk arrays on real stack (iram)
Speeds up decoding of 16kbps test file by 16.7MHz on H300.

Change-Id: I39c90e3b423ae8e2ee5c2b88c5dcec8d48807f77
2013-08-31 17:14:58 +02:00
Nils Wallménius
a602ea3d3d Silence spurious warning
Change-Id: I856c722e959314c0a86e9c0a3a31cb824ddb41cc
2013-08-31 09:00:13 +02:00
Nils Wallménius
580b307fd7 Sync opus codec to upstream git
Sync opus codec to upstream commit
02fed471a4568852d6618e041c4f2af0d7730ee2 (August 30 2013)

This brings in a lot of optimizations but also makes the diff
between our codec and the upstream much smaller as most of our
optimizations have been upstreamed or supeceded.

Speedups across the board for CELT mode files:

        64kbps      128kbps
H300    9.82MHz     15.48MHz
c200	4.86MHz     9.63MHz
fuze v1 10.32MHz    15.92MHz

For the silk mode test file (16kbps) arm targets get a speedup
of about 2MHz while the H300 is 7.8MHz slower, likely because it's
now using the pseudostack more rather than the real stack which
is in iram. Patches to get around that are upcomming.

Change-Id: Ifecf963e461c51ac42e09dac1e91bc4bc3b12fa3
2013-08-31 08:30:51 +02:00
Marcin Bukat
a2a2e14e0d lua: Switch memory allocator from dl to tlsf
Instead of providing yet another memory allocator implementation
use tlsf and simply link tlsf library.

Another small improvement is to *grow* memory pool by grabbing
audiobuffer instead of just switching to use audiobuf exclusively.
Tested with simple lua 'memory eater' script.

This patch extends tlsf lib slightly. You can provide
void *get_new_area(size_t * size) function which will override
weak dummy implementation provided in lib itself. This allows to
automaticaly initialize memory pool as well as grow memory
pool if needed (for example grab audiobuffer when pluginbuffer
is exhaused).

Change-Id: I841af6b6b5bbbf546c14cbf139a7723fbb982f1b
2013-08-26 09:42:47 +02:00
Nils Wallménius
b2e80edd16 Change CODECFLAGS to a "simply-expanded" var to give the individual
codec makefiles larger freedom in what they can do to it.
Use this in libopus to prepend the libopus searchpaths to
CODECFLAGS so that its internal config.h will be picked up before
our global one. This avoids having to do a s/config.h/opus_config.h/
when syncing which will be handy soon.

Change-Id: I018d729aa0c8300fa3149f22a5a8c5668b339dfa
Reviewed-on: http://gerrit.rockbox.org/496
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2013-08-23 18:34:30 +02:00
Michael Sevakis
b1209d4789 Fix FS#12889 : Audible pop right after setting Repeat/Shuffle
The quickscreen calls settings_apply() and the crossfeed code wasn't
checking that the right crossfeed was set before updating the filter
for the custom setting, which was overwriting the Meier crossfeed
data (custom and Meier share the same data space).

Change-Id: Ifaa2f46fe062d4497681a2dd0d5068ec906c96a3
2013-08-16 09:28:36 -04:00
Michael Sevakis
e04e29d017 mp3_enc: Fix early snafu with stream finish on COP
Distractions make logic fail. It only needs one more loop and should
not trigger further compression cycles after not feeding more data.

Change-Id: Ie0dbb34af92e0ca5718480dd4ab4719a141717ff
2013-07-11 04:50:27 -04:00
Michael Sevakis
95bc93194e Multithread compressing encoders on multicore targets.
For mp3_enc, split encoding duties between COP and CPU.

For wavpack_enc, simply run the encoding on COP (splitting that one
needs more consideration) which keeps the it and the UI from running
on the same core.

As a result, at least they are now useable on PP at "normal" sample
rates.

mp3_enc in all this gets an extensive renovation and some optimizations
for speed, to reduce IRAM requirements and remove unneeded stuff.

Change-Id: I215578dbe36f14e516b05a5ca70880eb01ca0ec2
2013-07-09 06:28:33 -04:00
Michael Sevakis
d37bf24d90 Enable setting of global output samplerate on certain targets.
Replaces the NATIVE_FREQUENCY constant with a configurable frequency.

The user may select 48000Hz if the hardware supports it. The default is
still 44100Hz and the minimum is 44100Hz. The setting is located in the
playback settings, under "Frequency".

"Frequency" was duplicated in english.lang for now to avoid having to
fix every .lang file for the moment and throwing everything out of sync
because of the new play_frequency feature in features.txt. The next
cleanup should combine it with the one included for recording and
generalize the ID label.

If the hardware doesn't support 48000Hz, no setting will be available.

On particular hardware where very high rates are practical and desireable,
the upper bound can be extended by patching.

The PCM mixer can be configured to play at the full hardware frequency
range. The DSP core can configure to the hardware minimum up to the
maximum playback setting (some buffers must be reserved according to
the maximum rate).

If only 44100Hz is supported or possible on a given target for playback,
using the DSP and mixer at other samperates is possible if the hardware
offers them.

Change-Id: I6023cf0c0baa8bc6292b6919b4dd3618a6a25622
Reviewed-on: http://gerrit.rockbox.org/479
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-07-06 04:22:04 +02:00
Michael Sevakis
4888131972 Update software recording engine to latest codec interface.
Basically, just give it a good rewrite.

Software codec recording can be implemented in a more straightforward
and simple manner and made more robust through the better codec
control now available.

Encoded audio buffer uses a packed format instead of fixed-size
chunks and uses smaller data headers leading to more efficient usage.
The greatest benefit is with a VBR format like wavpack which needs
to request a maximum size but only actually ends up committing part
of that request.

No guard buffers are used for either PCM or encoded audio. PCM is
read into the codec's provided buffer and mono conversion done at
that time in the core if required. Any highly-specialized sample
conversion is still done within the codec itself, such as 32-bit
(wavpack) or interleaved mono (mp3).

There is no longer a separate filename array. All metadata goes
onto the main encoded audio buffer, eliminating any predermined
file limit on the buffer as well as not wasting the space for
unused path queue slots.

The core and codec interface is less awkward and a bit more sensible.
Some less useful interface features were removed. Threads are kept
on narrow code paths ie. the audio thread never calls encoding
functions and the codec thread never calls file functions as before.

Codecs no longer call file functions directly. Writes are buffered
in the core and data written to storage in larger chunks to speed up
flushing of data. In fact, codecs are no longer aware of the stream
being a file at all and have no access to the fd.

SPDIF frequency detection no longer requires a restart of recording
or plugging the source before entering the screen. It will poll
for changes and update when stopped or prerecording (which does
discard now-invalid prerecorded data).

I've seen to it that writing a proper header on full disk works
when the format makes it reasonably practical to do so. Other cases
may have incorrect data sizes but sample info will be in tact. File
left that way may play anyway.

mp3_enc.codec acquires the ability to write 'Info' headers with LAME
tags to make it gapless (bonus).

Change-Id: I670685166d5eb32ef58ef317f50b8af766ceb653
Reviewed-on: http://gerrit.rockbox.org/493
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-06-30 00:40:27 +02:00
Michael Sevakis
a9ea1a4269 Fix some whitespace in files changed in following commit.
Change-Id: Ie3f43e43076e0dcae9a10f1b0b9e4698b398acee
Reviewed-on: http://gerrit.rockbox.org/492
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-06-30 00:40:09 +02:00
Michael Giacomelli
d475dd36a3 Remove old EQ presets.
The old presets never made sense for Rockbox's EQ.  They were apparently
copied from some other software.  We have a parametric EQ, that means that
EQ bands can be made wider or narrower.  Putting two identical bands side
by side just wastes battery life and adds rounding error.  Replacement
presets are on gerrit but they need more work.  In the mean time, users
should probably not be using these.

Change-Id: I85213100129fafd3ac0fa1a9438cb4d651bb94cb
2013-06-21 16:53:02 +02:00
Frank Gevaerts
d4061a46d8 Silence some (harmless) warnings.
Change-Id: I8d1278b8cfaa376d2ad5a99dd552dc980c66e1da
2013-06-16 18:23:18 +02:00
Dominik Riebeling
b6ddbc41a5 Fix id3v2 album art if more than one image is present.
Rockbox only uses the first album art image (APIC / PIC frame) found in id3v2
tags. When a file contains more than one image the second one is ignored but
the parsealbumart() callback overwrites the already set data. This causes the
metadata structure to contain an invalid pointer to the image data, resulting
in no image shown.

Make parsealbumart() aware of this and skip parsing when an albumart image has
already been found. Fixes FS#12870.

Change-Id: Id8164f319cd5e1ee868b581f8f4ad3ea69c17f77
2013-06-15 21:04:13 +02:00
Michael Sevakis
46688a60db Missed removing a couple unwanted includes in previous commit.
Get those too.

Change-Id: Id2a39afe7a61d6ec0cea38633b94fe1b7122204f
2013-05-27 03:40:02 -04:00
Michael Sevakis
b5a6517e9d Remove explicit config.h and system.h includes from DSP code.
Replace with rbcodecconfig.h and platform.h includes. Remove now-
unneeded ones as well.

Change-Id: I6111b71e90bf86d9fe272a7916f2d34a5c6dd724
2013-05-27 03:23:33 -04:00
Michael Sevakis
30fe6eb66c SPC Codec ARMv5: I didn't have fast gauss quite right.
Fix wrapping hazard which did eventually manifest on the right file.

Change-Id: I996a6efd3181b56fd172b5c3a526c7434f88bbbe
2013-05-26 00:33:30 -04:00
Boris Gjenero
4077eac839 Fix return address when data_abort_handler skips faulting instruction.
When writing a value to PC, execution continues at that location,
so subtracting 4 returns to the next instruction. Previously, two
instructions after the faulting instruction were being skipped, causing
safe_read functions to return true even if a data abort happened.

Change-Id: I3fd02d54646323ea2050d0504e38f6d22f09c749
2013-05-23 19:51:19 -04:00
Michael Sevakis
6e211ab3ac Remove dsp_callback because DSP is now library code, not app code.
Yep, nope, not necessary anymore. Just call functions directly.

Change-Id: I21dc35f8d674c2a9c8379b7cebd5613c1f05b5eb
2013-05-23 14:25:37 -04:00
Michael Sevakis
33f3af2b8d SPC Codec: Add ARMv5 optimized code. Easy peasy.
Why? Why not? Cuts a few MHz.

Change-Id: Ied5c70b1aedd255cbe5d42b7d3028bbe47aad01d
2013-05-23 03:15:12 -04:00
Michael Sevakis
9b43f14165 SPC Codec: Simplify configuration and assume nothing need be disabled.
Most SoCs are these days are fast enough for realtime BRR, gaussian
interpolation and echo processing.

Change-Id: I180ce8ad45242c67b5e573a406b9522098a3f12b
2013-05-21 20:39:22 -04:00
Michael Sevakis
ed24e62029 SPC Codec: Have metadata parser fill in frequency and bitrate.
Change-Id: I6c72f4d1c79b1a99a11fb28e7d46886c08a56a75
2013-05-21 20:01:17 -04:00
Michael Sevakis
1f76edabf9 SPC Codec: Need to restore a bit more data from cached waves.
'Nuff said. Last update wasn't quite right.

Change-Id: I082a79c4e0c82b968fe2375cb82ee5c3a64a208b
2013-05-21 16:59:58 -04:00
Nils Wallménius
de86b4a3c5 Opus: fix glitch caused by 2e9aa3d
Change-Id: I1519f3bf2cdf74f3d4741951973352b2678b7722
2013-05-21 22:38:18 +02:00
Michael Sevakis
71b9685dcd Fix FS#9577 - SNES player missing tracks on certain SPCs
Affected BRR cached waveforms but not realtime BRR decode as far as
I could ascertain. BRR cached waves required loop points to be inside
the initial waveform but this change removes that restriction.

Change-Id: I0ef4db720e5c28bd7b2fb9ae255d27c0a7213f79
2013-05-21 04:29:04 -04:00
Michael Sevakis
00e55d0451 Fix 87021f7 errors. There is no this->echo_pos when SPC_NOECHO != 0.
Anyway, that's true now.

Change-Id: I247ea9a10543a8b65f3e73495f0e2ea725ec533e
2013-05-21 00:20:06 -04:00
Michael Sevakis
87021f7c0a SPC Codec: Refactor for CPU and clean up some things.
CPU optimization gets its own files in which to fill-in optimizable
routines.

Some pointless #if 0's for profiling need removal. Those macros are
empty if not profiling.

Force some functions that are undesirable to be force-inlined by the
compiler to be not inlined.

Change-Id: Ia7b7e45380d7efb20c9b1a4d52e05db3ef6bbaab
2013-05-21 00:02:14 -04:00
Nils Wallménius
a17d6de5bc Opus: fix seeking to start of track
Change-Id: I8a8604d6726304d04281671b475b2f75f9bfc0e5
2013-05-19 14:20:31 +02:00
Nils Wallménius
2e9aa3d8b0 Opus: avoid allocating space for comment packets
Fixes playback of files with large embedded album art.

Change-Id: I94d336e3da968a93047dd00a5fa65e4c3423a7da
2013-05-19 14:19:09 +02:00
Nils Wallménius
c7124b5520 Fix opus craches with large embedded album art
Use the tlsf malloc and friends instead of the silly
codec_malloc to get actually working free and saner
realloc that doesn't leak memory.
Makes files with moderately sized embedded AA play
on targets with large enough codec buffers and files
with too large AA are now skipped rather than crashing.
Fixes crash when playing example file in FS#12842.

Change-Id: I06562955c4d9a95bd90f55738214fba462092b71
2013-05-18 23:38:23 +02:00
Michael Sevakis
a7dee7f447 Introduce new hermite polynomial resampler.
Uses the Catmull-Rom case of Hermite cubic splines.

Vastly improves the quality and accuracy of audio resampling with a
rather minor additional overhead compared to the previous linear
implementation.

ARM and Coldfire assembly implementations included.

Change-Id: Ic45d84bc66c5b312ef373198297a952167a4be26
Reviewed-on: http://gerrit.rockbox.org/304
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-05-16 18:52:21 +02:00
Michael Sevakis
fce81a8a74 Rename all the "lin_resample..." stuff to simply "resample_...".
Change-Id: I79f44f0dcc1b23b33a5040795220713660a1d18a
2013-05-07 00:35:46 -04:00
Michael Sevakis
3fd25dcbed Purge the usage of DSP_SWITCH_FREQUENCY.
DSP_SWITCH_FREQUENCY has been deprecated and the same enumerated value
as DSP_SET_FREQUENCY since major DSP revisions were committed. This
task should have been performed much earlier but, oh well, do it now.

Change-Id: I3f30d651b894136a07c7e17f78fc16a7d98631ff
2013-05-05 00:48:40 -04:00
Dominik Riebeling
d566fd5209 Revert "Don't set CORE_GCSECTIONS in fixedpoint.make."
While it made the mini2g not crash during startup anymore further tests showed
that other mini2g devices still exhibit the crash, or end up with a "No
partition found" error; furthermore  the device tested first still crashes on
USB disconnect. Therefore the change doesn't really help with the problem, and
at the expense of increasing binary size for all other targets there is no
point in keeping it for now.

This reverts commit 850491a043.
2013-05-04 21:41:49 +02:00
Michael Sevakis
1a4acc9d1e Fix missed optimization opportunity in dsp_process.
Input type can only change once per call because the DSP parameters
are only copied at the start and input is always taken from the src
buffer which means sample input format switching can be once per call
instead of once per loop.

Change-Id: Ifa3521753428fb0e6997e4934f24a3b915628cc7
2013-05-04 14:23:21 -04:00
Michael Sevakis
78a45b47de Cleanup and simplify latest DSP code incarnation.
Some things can just be a bit simpler in handling the list of stages
and some things, especially format change handling, can be simplified
for each stage implementation. Format changes are sent through the
configure() callback.

Hide some internal details and variables from processing stages and
let the core deal with it.

Do some miscellaneous cleanup and keep things a bit better factored.

Change-Id: I19dd8ce1d0b792ba914d426013088a49a52ecb7e
2013-05-04 13:43:33 -04:00
Dominik Riebeling
850491a043 Don't set CORE_GCSECTIONS in fixedpoint.make.
fixedpoint.make is not a subdir Makefile but a lib Makefile. Setting
CORE_GCSECTIONS in it will affect the final link and make it always use
--gc-sections (for SWCODEC Rockbox), since libfixedpoint is always needed
(bootloader and HWCODEC don't use libfixedpoint).

Fixes FS#12857.

Change-Id: Ib30bd03cbcea9c339a73daf7b673868aa3cc7a88
2013-04-28 21:09:10 +02:00
Dominik Riebeling
370ed6de7c Properly seek to next id3v2 frame for unsynced tags.
When seeking to the next id3v2 frame we need to consider if the tag has the
unsync flag set. Not doing so will likely make parsing end up in the middle of
the current frame if the frame size exceeds the upper limit set during read.
The latter usually happens for album art frames.

Fixes FS#12849.

Change-Id: Ic92853eef4374508d84df347bcc66b6661d5037d
2013-04-26 22:45:04 +02:00
Michael Sevakis
a2d8d4293a Properly implement volume in warble. dB cut only.
Change-Id: I34b77287ba0b1a0002db3d52e893a52c50593362
2013-04-25 23:46:17 -04:00
Michael Sevakis
5314fb2103 Add $(SHARED_CFLAGS) to fixedpoint.make to quash amd64 errors in 95e23de.
Thanks to Frank Gevaerts.

Change-Id: I6ca1d0258bfc70950d0ad5c2975d2bd88060b8a3
2013-04-25 18:36:01 -04:00
Michael Sevakis
95e23defb0 Make fixepoint.c as a shared library (libfixedpoint.a).
Change-Id: Icc10d6e85f890c432f191233a4d64e09f00be43d
Reviewed-on: http://gerrit.rockbox.org/456
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-26 00:11:04 +02:00
Michael Sevakis
0c7b787398 Straighten out the mad twisted state of sound.c and related areas.
This is going right in since it's long overdue. If anything is goofed,
drop me a line or just tweak it yourself if you know what's wrong. :-)

Make HW/SW codec interface more uniform when emulating HW functionality
on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to-
DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX"
APIs are all in sound.c with none in DSP code any longer.

Reduce number of settings definitions needed by each codec by providing
defaults for common ones like balance, channels and SW tone controls.

Remove need for separate SIM code and tables and add virtual codec header
for hosted targets.

Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
2013-04-15 12:02:05 -04:00
Michael Sevakis
f5a5b94686 Implement universal in-PCM-driver software volume control.
Implements double-buffered volume, balance and prescaling control in
the main PCM driver when HAVE_SW_VOLUME_CONTROL is defined ensuring
that all PCM is volume controlled and level changes are low in latency.

Supports -73 to +6 dB using a 15-bit factor so that no large-integer
math is needed.

Low-level hardware drivers do not have to implement it themselves but
parameters can be changed (currently defined in pcm-internal.h) to work
best with a particular SoC or to provide different volume ranges.

Volume and prescale calls should be made in the codec driver. It should
appear as a normal hardware interface. PCM volume calls expect .1 dB
units.

Change-Id: Idf6316a64ef4fb8abcede10707e1e6c6d01d57db
Reviewed-on: http://gerrit.rockbox.org/423
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-11 22:55:16 +02:00
Michael Sevakis
f49e750531 Move fixedpoint.h to be accessible in /firmware.
Will need it soon enough.

Combine the contents of all the various fixedpoint.h files.
Not moving fixedpoint.c for now since I'm not sure where it
should be and it causes some dependency issues.

Change-Id: Ideacbca2ca78f9158c2b114b113c274f68e908d5
2013-04-10 13:28:35 -04:00
Michael Sevakis
c73894213d VGM Codec: Improve time and fade behavior. Tweak minor misc.
Prevents cutoff of tracks, especially short ones:
* Extend looped tracks by fade length to fade at start of loop repeat.
* No fade occurs for non-repeating track only having an intro.
* Uses id3.tail_trim field to store fade duration.

Use libGME built-in elapsed time reporting instead of custom calculation:
* libGME already reports in milliseconds.
* Don't advance time counter when Repeat == One. It just runs the progress
  over the length limit.

Fix a comment about sample rate and set the reported bitrate to be
accurate for 44.1 kHz stereo.

Change-Id: I3ede22bda0f9a941a3fef751f4d678eb0027344c
2013-03-06 19:47:05 -05:00
Jonathan Gordon
2febee5265 more error handling for checkwps
Change-Id: I03055d045c0a8e0e63e17b290cc71c54a8dc3634
2013-02-27 21:15:57 +11:00
Jonathan Gordon
d76dca165b checkwps: show a helpful error if the parser callback errors out
Change-Id: Ie3e35292ba8d74f0ff3d1bb3483a5e83aae0e6b6
2013-02-26 21:18:16 +11:00
Frank Gevaerts
36a99906e1 Build libtlsf for all systems
libtlsf used not to be built for HWCODEC, but now that the gif
viewer uses libtlsf instead of building its own copy, libtlsf
is needed everywhere.

Change-Id: I730719c6a20e749adb8597056d2049b7758620e4
2013-02-23 21:11:10 +01:00
Michael Sevakis
66acb3996d Fix FSB#12826 - Mini-sound burp between track skips [with WMA].
Flush decoder state and frame out buffer upon a forced stop to prevent
a short burst of stale audio from the previously decoding track from
playing when skipping from one WMA track to another.

Change-Id: I24c910c5dbd83caed2510db68d9e39a474332a79
Reviewed-on: http://gerrit.rockbox.org/406
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-02-18 02:43:07 +01:00
Jonathan Gordon
1eb17dc9f4 EQ settings: Rework the settings to clean up the config file.
Instead of 3 cfg lines per eq band there is now a single line
for each:
<config name>: <cutoff/center freq>, <q>, <gain>

In addition, the config value names make a bit more sense.

The old settings are still readable but config.cfg and any new
settings files will be written with the new config values. (The
old settings will be removed completly sometime after the next
stable release).

Also a slight rework of the advanced EQ menu UI

Change-Id: I9008658d36ded442a5f2f825916df42a3934cbef
Reviewed-on: http://gerrit.rockbox.org/394
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2013-02-09 13:05:32 +01:00
Dominik Riebeling
e98e64b988 Fix Theme Editor build.
The skin_parser now needs __PCTOOL__ set to build libskin_parser.a properly for
use with the Theme Editor.

Change-Id: I48a518fa296cc8ec5d0e3022baaedd796afe7c5f
2013-02-08 22:38:57 +01:00
Hayden Pearce
d73c20933b 10 Band EQ w/Presets
- A 10 Band EQ for Rockbox w/ presets adapted
   from VLC
 - frequency stepping at 32, 64, 125, 250, 500
   1K, 2K, 4K, 8K, 16K

Change-Id: I85ad84d70a534edfc66c6ad9af8a76f022a02ec7
Reviewed-on: http://gerrit.rockbox.org/386
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2013-01-29 06:53:41 +01:00
Björn Stenberg
1501df045f Deprecate the EXTRA_LIBS variable.
Instead specify explicit library dependencies for codecs and plugins.
2013-01-24 16:06:45 +01:00
Michael Giacomelli
a2ab22efbf ARMv5 optimized complex multiply function for libopus.
Speeds up decoding of 128k opus files by 1.2MHz on AMSv2. Rounding
error is 1 bit due to KissFFT using a 15 bit shift instead of a 16 bit shift.

Also, change an LDMIA in the armv4 code to LDM as the pointer should not
increment.

Change-Id: I626a207c6a056a1984e33cfe89415c35d0caed93
Reviewed-on: http://gerrit.rockbox.org/377
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Tested-by: Michael Giacomelli <giac2000@hotmail.com>
2013-01-21 01:51:38 +01:00
Michael Sevakis
362ade3892 Fix FS#12794 - new EQ code does not compile for the Nokia N8x0
The old GCC version currently required (sbox-arm-linux-gcc 3.4.4
release) apparently has trouble with function pointers used as
static array initializers when using indexed initializers + ranges
(ie. [A ... B] = fn).

Change-Id: I494c2b607e4d93a9893264749d0ac257fb54ce3b
2012-12-28 14:12:18 -05:00
Jonathan Gordon
685cf59008 9 segment bitmap drawing:
Use %x9(id) to draw an image in the whole current viewport using the
9 segment drawer (which draws the corners as normal and *tiles*
the middle segments to the needed width/height).

Future work is to make it scale instead of tile

Change-Id: Ic3ed1cad93f96091694801eb442e0da5a2401203
2012-12-09 17:11:19 +11:00
Michael Giacomelli
d594b36133 Add support for 16 bit 'half float' format PCM.
I'm not 100% sure that the rounding of denormals is correct. As compared to foobar2000,
some samples are off by +1 LSB.  However, since I can't output 24 bit PCM easily with
rockbox, I'm not sure if this is due to a bug or just how rockbox rounds.  In practice
I don't think it matters so I'm just going to commit this for now.

Change-Id: Ic0792fcb172e4369a5512d202121c2b918b36079
2012-11-22 05:18:00 +01:00
Nils Wallménius
54ef306610 flac: use 64 bit math to calculate the elapsed time
avoids overflows for very long files

Change-Id: Idb1e9a411bd9007cfddbbd2d3dcf127645fa9a7c
2012-10-25 20:04:52 +02:00
Marcin Bukat
41b6ac6afb libgme: fix badly written cpp conditions spotted by gcc 4.6.3
Change-Id: Ia3fba4ba2c46a202c48f3a9b7db0cba9f75b6a50
2012-10-18 13:40:08 +02:00
Nils Wallménius
bc6c08c4b9 opus: only put the mdct function in iram for cf,
doesn't make any speed diff on pp

Change-Id: Ia6484e2a2bbf72d33a583470918c0fa267fd9b97
2012-10-17 20:55:49 +02:00
Nils Wallménius
aa55bc29f0 opus: don't rely on stride being 1<<shift
Change-Id: I2d64fb20b2526d912eb665df0df4e87459676a92
2012-10-16 21:03:22 +02:00
Andree Buschmann
091619b4a5 opus: use two pointers for mdct pre and post rotation
avoids complicated index calculations in the loops.
saves 0.3MHz decoding a 64kbps test file on h300 (cf) and
0.2MHz on c200 (pp)

Change-Id: I1918912d9a4502f89980c6bb270ec2ef10a07010
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-10-16 18:07:52 +02:00
Nils Wallménius
c8e7dae362 opus: put hot code in iram
Saves 1.1MHz decoding a 64kbps test file on h300 (cf) and
0.2MHz on c200 (pp)

Change-Id: If9ed03f2e3787ee497eababda4013fbb5d395946
2012-10-16 17:52:53 +02:00
Frederik M.J. Vestre
7a7d7a2f4c Improve seeking in opus, tested on Sansa; not tested
on a target with a disk.

Change-Id: I37c875c9cd014eb61fe5232dab0f4b8f15f057dd
Reviewed-on: http://gerrit.rockbox.org/319
Tested-by: Thiago Okada <thiago.mast3r@gmail.com>
Reviewed-by: Frederik Vestre <freqmod@gmail.com>
Tested-by: Frederik Vestre <freqmod@gmail.com>
2012-10-14 11:26:00 +02:00
Andree Buschmann
823d090d6b opus: arm asm for C_MULC
speeds up decoding of a 64kbps test_file by 1.5MHz on c200 (pp)
and 1.9MHz on fuzev1 (amsv1)

Change-Id: I1db460b634eba608c3e00541d96fc93d5a05710b
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-10-10 22:54:02 +02:00
Nils Wallménius
2326f1517e opus: cf asm for C_MULC
saves 2.7MHz decoding a 64kbps test file on h300

Change-Id: Id63791f79b44ed398ce5d341a5f5212d9a30282e
2012-10-10 22:52:11 +02:00
Andree Buschmann
0ae8d16643 opus: replace copy loops with calls to memcpy
speeds up decoding of a 64kbps test file by 0.5Hz on h300 (cf)
0.9MHz on c200 (pp) and 0.2MHz on fuzev1 (amsv1)

Change-Id: Ib537c2393fa6dca0b61e4e9f80eef5e688c2c2bd
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-10-07 12:34:54 +02:00
Andree Buschmann
c7840e745e opus: speed up mdct overlap add and copying
Unroll overlap add loop by four and use memcpy for copying
instead of loops.

Change-Id: I17114626a395d5972130251d892f851bc86e3a6a
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-10-07 00:31:08 +02:00
Nils Wallménius
3ac0fc7c90 opus: cf inline asm for MULT32_32_Q31
speeds up decoding of a 64kbps test file by 2MHz on h300

Change-Id: I437d05278fe1c495715cf0e3477f9960d1df9d3a
2012-10-06 23:43:05 +02:00
Andree Buschmann
2119f75af3 opus: full precision MULT32_32_Q31 (32*32=64>>31) multiplication
Replace complicated macro doing three 16*16 muls and add an inline
asm implementation for arm, speeds up decoding a 64kbps test file
by 0.5MHz on c200 (pp) and gives slightly better precision.

Change-Id: I6fc5b83c210f01bffdc38aec54cc5a8b646d8169
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-10-06 23:43:05 +02:00
Andree Buschmann
da67f66eed opus: slight speedup of deemphasis
Hoist load of coefficients out of the loop.

Speeds up decoding of a 64kbps test file by 0.6MHz on h300 (cf)
0.2MHz on c200 (pp) and 0.1MHz on fuzev1 (amsv1)

Signed-off-by: Nils Wallménius <nils@rockbox.org>

Change-Id: I4be0059fc2a77748575f5fc9378f7f348d64f1c4
2012-10-06 14:51:01 +02:00
Andree Buschmann
dceec09092 opus: speed up comb_filter
Skip expensive multiply-accumulate loop when gains are 0 and
just copy using memcpy if soure and destination are not the same

Speeds up decoding of a 64kbps test file by 6MHz on h300 (cf)
7MHz on c200 (pp) and 6MHz on fuzev1 (amsv1)

Change-Id: Ibbc9ddfd45a9ac661467b1327b8c67761924fb8b
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-10-06 14:25:20 +02:00
Nils Wallménius
6d2ad505dc opus: put arrays frequently used by pulse decoding on the stack
speeds up decoding of a 64kbps test file by 14MHz on h300 (cf)
and 1MHz on c200 (pp)

Change-Id: I852cb66808676ea51109423f5b70cfc8782dd109
2012-10-04 19:20:55 +02:00
Nils Wallménius
8687b98993 opus: speed up arm asm MULT16_32_Q15
Reorder operands to take advantage of the early termination of
multiplications. Saves 2.5MHz decoding a 64kbps opus test file
on c200 (pp).

Change-Id: I470266dc870ab183ece3b23426d41e2a64342a71
2012-10-01 22:36:57 +02:00
Andree Buschmann
d7799aaf33 opus: allocate mdct f2 buffer in iram
Speeds up decoding of 64kbps test file by 6.3MHz on h300 (cf)
and 1.2MHz on c200 (pp).

Signed-off-by: Nils Wallménius <nils@rockbox.org>

Change-Id: I08c2c332153abcbef9447c81986777fd2fcc73fe
2012-10-01 22:07:44 +02:00
Andree Buschmann
b6bcb1338e opus: allocate buffers for X and freq in iram
speeds up decoding of 64kbps test file by 19MHz on h300 (cf)
and 2.5MHz on c200 (pp)

Change-Id: Idacd2f8962c20c518055d586daeec6b932b7ded2
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-10-01 21:37:03 +02:00
Frank Gevaerts
341e2c46ca Support technically invalid image/jpg mimetype in tags.
Although the mimetype for jpeg is clearly image/jpeg, many tagging
applications seem to use image/jpg, so we'll support that too.

Change-Id: Icb9063fd5a9d8aea169eaa7f74ac52b72603d148
Reviewed-on: http://gerrit.rockbox.org/318
Reviewed-by: Michael Giacomelli <mgiacomelli@gmail.com>
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2012-09-29 15:39:55 +02:00
Andree Buschmann
270d9eaee8 opus: statically allocate decoder state in iram
Speeds up decoding of a 64kbps test file 26MHz on H300 (cf) and
2MHz on c200 (pp)

Change-Id: I2fb4fe6c0a29321087e02fbd17fd1b1eb84e7b57
Signed-off-by: Nils Wallménius <nils@rockbox.org>
2012-09-29 10:36:48 +02:00
Nils Wallménius
082cd01eb2 opus: speed up deemphasis
Remove downsampling code from deemphasis loop as we don't use
it and remove multiplications that are not relevant when
not using custom modes. Saves 1.4MHz on h300 (cf), 4.3MHz on
c200 (pp) and 4.6 on fuzev1 (amsv1).

Change-Id: Iab3f1d737a656a563aaa351d50db987a9cff2287
2012-09-28 00:09:54 +02:00
Nils Wallménius
f49785cdce opus: build with -fno-strict-aliasing for mips to fix warnings
Change-Id: I370f43f2e25e03650681c207908f79cdea744d99
2012-09-27 22:57:01 +02:00
Nils Wallménius
f636aa07df opus: put frequently used mdct buffer on the real stack which is in iram
Saves about 30MHz on h300 (cf) and 1.5MHz on c200 (pp) decoding a
64kbps test file. Stack usage is still below 70%.

Change-Id: Ib13df9011adb4eef4bb91a52e5a32741c8bf8988
2012-09-26 11:54:03 +02:00
Nils Wallménius
425725edb0 opus: improve cf MULT16_32_Q15 by giving the compiler more freedom
saves about 3MHz when decoding a 64kbps test file

Change-Id: I10f47173ccb78e60e364662220d1db2f78dd5fdd
2012-09-26 11:21:25 +02:00
Nils Wallménius
5f60590e80 opus: put some const tables and structs in iram
Speeds up decoding of a 64kbps test file by 20MHz on h300 (cf)
and 1MHz on c200 (pp)

Change-Id: Ia2adc0a3ad86abce8f948062eb53a8ac14c2cdf2
2012-09-25 17:19:05 +02:00
Nils Wallménius
afc6b3f021 opus: asm MULT16_32_Q15 for arm and cf
Speeds up decoding of a 64kbps opus test file by 34MHz on h300 (cf),
24MHz on c200 (pp) and 13MHz on fuzev1 (amsv1)

Change-Id: I0dce6b3bfe6c81d0a722dfebb13891b9a428c6ba
2012-09-25 11:40:59 +02:00
Nils Wallménius
06fc6fdd0a opus: #if 0 out some more unused code, delete unused file
Change-Id: I96033f42e0c3096ec9d779e9f8ca46570f981ab0
2012-09-24 17:45:07 +02:00
Nils Wallménius
f498142143 opus: #if 0 out some unused code
Change-Id: I16fa9b439f8da5b9b8a4f17040487b9535078ec5
2012-09-24 15:20:21 +02:00
Bertrik Sikken
e3cd7ec70b Remove unused include path for opus
Change-Id: Ie5ab9d893a7d2c6ec1aca6c295e29ab34eacd656
2012-09-23 18:12:27 +02:00
Frederik M J Vestre
1b8e3801b2 Initial opus codec support
Synchronised with opus repo on github (https://github.com/freqmod/rockbox-opus)

Status:
* Seeking ported from speex, but fails on some cases (e.g. seek to granule 0)
* ReplayGain parsing needs to be reworked, we do vorbis-style replaygain now.
  http://wiki.xiph.org/OggOpus#Comment_Header explicitly forbids these in
  favour of R128_TRACK_GAIN tag.
* No optimisation yet, source files still nearly identical to opus upstream
* Multi-stream opus files may not be parsed correctly

Change-Id: Ia66f1027dc1d288083e3c57b2816700078376f9a
Reviewed-on: http://gerrit.rockbox.org/300
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
Tested-by: Bertrik Sikken <bertrik@sikken.nl>
2012-09-20 20:47:44 +02:00
Marcin Bukat
a46e0b02c1 unwarminder: make SP and PC visible on smaller screens
Change-Id: I78c0e6edb1ad097154885b9fa93d74616047cbc1
2012-09-05 08:53:48 +02:00
Jonathan Gordon
9dd2eb49be skin_engine: Support percentages for viewport positioning
%V(0,50%,75%,50%,-) - make a viewport at x=0, y=half the lcd height,
75% lcd width and the remaining height (the other half) of the lcd.

Change-Id: If26ccb65e8dc52c9225f3fd6d7b222d770add0f0
Reviewed-on: http://gerrit.rockbox.org/184
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-07-29 04:24:38 +02:00
Bertrik Sikken
132fcca4b2 Make codec_realloc retain the contents when resizing a memory segment
Change-Id: Ia2fc42eb0d36399e6856d3a957dd1634f019ca6a
2012-07-26 12:29:18 +02:00
Jonathan Gordon
65f9df3083 skin_engine: Allow the %St() (setting) skin tag be used as a bar
%St(<setting name>) or %St(<bar tags>, setting, <setting name>)

Change-Id: I71396d683634d4d1ad2357018c4029ecb4229677
2012-07-05 23:30:06 +10:00
Jonathan Gordon
4c94b98422 skin_engine: Fix a obscure parser bug
Tag params where a [] group is followed (but not immediatly) by
a * will not parse correctly. e.g [si]iii|s* will attempt to find
an 'i' after the second s instead of looping s's

Change-Id: I3982f726b6539818f8332334b263b673259f98ef
2012-07-05 22:41:10 +10:00
Michael Giacomelli
3d0459dfad Expand the range of the WPA Pro quant table. Fixes FS#12704.
Change-Id: I5495c4d7d165cac15016d3233b85bbe5497ea3e1
2012-07-03 18:43:44 -04:00
Huan Zhang
fbe33e0728 Fix libmad compilation on MIPS with newer gcc. FS#12013
Since gcc 4.4 the MIPS port no longer recognizes the "h" asm constraint.
It was necessary to remove this constraint in order to avoid generating
unpredictable code sequences. We can achieve the same effect using
128-bit types.

See also:GCC 4.4 release notes at  http://gcc.gnu.org/gcc-4.4/

Change-Id: I713cdf57cde1a989ad960aa441ab1ccf51f1cdc6
2012-06-11 23:17:19 +02:00
Amaury Pouly
1a4fa1603b unwarminder: fix data_abort_handler (wrong address to UIE)
Change-Id: I060735363f2e408c42a8e11ac1f31dc96e3cb2d6
2012-06-07 14:48:43 +02:00
Bertrik Sikken
afc96087f8 New crossfeed algorithm for Rockbox: "Meier" crossfeed
Emulates the basic "Meier" crossfeed (2 capacitors, 3 resistors)
as discussed in
http://www.meier-audio.homepage.t-online.de/passivefilter.htm

This crossfeed blends a bit of low-pass filtered L signal into
the R signal (and vice versa) while adding about 300 us delay
to the crossfed-signal. A difference with the crossfeed already
present in rockbox, is that this algorithm keeps the total
spectrum flat (the one currently in rockbox accentuates
low-frequency signals, making it sound a bit muffled).

This implementation is quite lightweight, just 3 multiplies per
left-right pair of samples. Has a default C implementation and
optimized assembly versions for ARM and Coldfire.

The crossfeed effect is quite subtle and is noticeable mostly
one albums that have very strong left-right separation (e.g.
one instrument only on the left, another only on the right).

In the user interface, the new crossfeed option appears as
"Meier" and is not configureable. The existing crossfeed is
renamed to "Custom" as it allows itself to be customised.

There is no entry for the user manual yet.

Change-Id: Iaa100616fe0fcd7e16f08cdb9a7f41501973eee1
2012-05-28 11:34:15 +02:00
Bertrik Sikken
08f5224b1b Use shorter lines to show an ARM backtrace (so address fit on the clip zip screen)
Change-Id: Ib36c09a44230fbaaa119f756367f98bdc7756983
2012-05-28 00:51:47 +02:00
Michael Sevakis
29cfd29a6c Stop timestretch freezing things during format changes.
When it was inactive but enabled, the format change hook was dropping
through to code that it shouldn't execute without it also being active
in processing samples.

Change-Id: Ie7899df0395d3f0d10f2bf2b55ea549dd06749a7
2012-05-21 17:12:04 -04:00
Michael Giacomelli
dd61978070 Expand the range of the inverse quant table in WMA Pro.
Several of the problem samples on the tracker use values outside this
range.  Trying the larger table doesn't quite seem to fix things, but
its only a small amount of additional memory and looking at ffmpeg,
I think the larger table is correct.

Change-Id: Id046e62b68550701aa1f80c9abd0a1dcd711bd0d
2012-05-20 02:31:24 -04:00
Michael Giacomelli
b154e51168 Revert "Work in progress hermite resampler."
This reverts commit f358228ea1.
2012-05-20 01:11:52 -04:00
Michael Giacomelli
f8d54460f2 support decoding of files that contain the number of vector coded coefficients in their bitstream
No known samples are fixed by this problem, but I haven't tested many.

Backport of ffmpeg revision 26388.

Change-Id: Ife9654b7477a432834e3cab2cb43d16da071445a
2012-05-20 01:05:47 -04:00
Michael Giacomelli
f358228ea1 Work in progress hermite resampler.
Based on http://src.gnu-darwin.org/ports/multimedia/helixplayer/work/hxplay-1.0.7/audio/resampler/hermite.c

Change-Id: Id87565a060aa2383701e7c2f3ea023c7555ad9ef
2012-05-20 01:05:47 -04:00
Thomas Martitz
c9d082f056 dsp_arm: Fix up some .section directives to fix crash on app targets.
This is needed on app targets as e.g. ".section .icode" leads to the
code getting linked to incorrect locations (0x0 in this case).

Change-Id: Ic28c5ae6d4f8001d211d685b5ca92d5ffff0c7b2
2012-05-13 22:27:18 +02:00
Nils Wallménius
2202ed3535 TDSpeed: Fix crackling on some systems
Use memmove instead of memcpy for overlapping copy, fixes
crackling in sims and warble on my system. Native targets
seem to have been unaffected.

Change-Id: I265d4ce373e224581bd2f5ba15c75b473ec231f2
2012-05-12 08:47:10 +02:00
Michael Sevakis
fbe9ccc85c TDSpeed settings to setup call need to be recorded, always.
If the settings, like samplerate, were to go out of range where
timestretch drops out of processing and then go back to the same as
when they were valid, it would fail to switch back on by itelf.

Change-Id: Ic5bcb268540b0db8e0483117b8a5a0ce5c5a9db0
2012-05-11 06:56:16 -04:00
Michael Sevakis
dd59e1d789 TDSpeed: Minor assembly optimization to frame fade on Coldfire.
Makes quite a huge difference to get rid of 64-bit math in a hot
area. Cuts about 12 MHz. Generic routine generates good code on
ARM and asm cuts no instructions there.

Change-Id: I4ac647406006c42004f9f5ab396cbf4e85688854
2012-05-11 03:31:29 -04:00
Michael Sevakis
0e5dd0a9cf TDSpeed: Fix up samples consumed return (FS#12666) + other stuff like...
Wrap up the the stereo case into loops and remove unused calculations
hanging out in tdspeed_update().

A wee little bit of code style and column policing.

Change-Id: I8dd3ab4b3e7e56b55dc00c00f3e32996228cc457
2012-05-10 21:41:26 -04:00
Nils Wallménius
d29a11b7a8 Rename HAVE_PITCHSCREEN to HAVE_PITCHCONTROL
Also move the definition to config.h

Change-Id: I36bb5020c5e06b2344292bc05e8c13ccc7a6a1ff
Reviewed-on: http://gerrit.rockbox.org/234
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-09 14:32:38 +02:00
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
Jonathan Gordon
2d3c43dffe skin_engine: rework the parser to be closer to the langauge grammar.
The parser was unconditionally scanning things which it thought
were conditional/enum lists (or tag arg lists) when they couldn't
possibly be (i.e < inside a param which should be valid).

This change fixes it (i.e %?and(%if(%pv, <, -50), %if(%mp, >i, 1))
is perfectly valid now.

This *may* break your exsiting skins if you were using %if with < or >

Change-Id: Ia24dbdf0b11fc7d8a735c1111d648c3bebd68ac6
2012-04-22 00:24:16 +10:00