Commit graph

90 commits

Author SHA1 Message Date
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
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
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
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
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