summaryrefslogtreecommitdiffstats
path: root/lib/rbcodec
AgeCommit message (Collapse)AuthorFilesLines
2014-09-22fix yellowMarcin Bukat1-1/+1
Change-Id: Ie3aa9b208e3f4f17d4d02f11f69839e9b381217d
2014-09-22metadata: Add cuesheet embedded in ape tags.nialv71-13/+23
Change-Id: I5d9e731c3ea786fb910afbb0a5201fc68dcab9f9 Reviewed-on: http://gerrit.rockbox.org/965 Reviewed-by: Nick Peskett <rockbox@peskett.co.uk> Tested: Nick Peskett <rockbox@peskett.co.uk> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-08-30Fix last warning for WarbleMichael Sevakis1-0/+2
Unused result warnings will have to be dealt with separately. Change-Id: I00c45e28d4d43a5376745036e650ff8df576c2db
2014-08-30Get the last errors I hope!Michael Sevakis4-9/+12
Change-Id: Ia285b95480cc9ac6494b745d80892c4b1b912341
2014-08-16Fix warnings from 6ed0087Michael Sevakis1-2/+2
Forgot to (void) an unused parameter when priorityless. usb-drv-rl27xx.c was using a compound init to initialize a semaphore but the structure changed so that it is no longer correct. Use designated initializers to avoid having to complete all fields. Forgot to break compatibility on all plugins and codecs since the kernel objects are now different. Take care of that too and do the sort thing. Change-Id: Ie2ab8da152d40be0c69dc573ced8d697d94b0674
2014-07-13libopus: use iram for more constantsNils Wallménius2-5/+5
Speeds up decoding of the 64 kbps test file by 2.59 MHz and the 128 kbps test file by 4.31 MHz on H300 (cf). Decoding the same files on c200 is sped up by 0.33 MHz and 0.55 MHz respectively. Change-Id: I0f9f9ef6a7293581cf45e3201b33c65504c95c81
2014-07-13libopus: asm C_MUL for coldfireNils Wallménius1-0/+21
The recent merge of upstream changed the fft to use C_MUL which wasn't implemented in asm for coldfire. Speeds up decoding 64 kbps test file by 2.68 MHz and 128 kbps test file by 2.80 MHz on H300. Change-Id: I8b61fc0f9568d6350431e311a12e44fe4f60f72e
2014-07-13Sync to upstream libopusNils Wallménius46-1051/+1608
Sync to commit bb4b6885a139644cf3ac14e7deda9f633ec2d93c This brings in a bunch of optimizations to decode speed and memory usage. Allocations are switched from using the pseudostack to using the real stack. Enabled hacks to reduce stack usage. This should fix crashes on sansa clip, although some files will not play due to failing allocations in the codec buffer. Speeds up decoding of the following test files: H300 (cf) C200 (arm7tdmi) ipod classic (arm9e) 16 kbps (silk) 14.28 MHz 4.00 MHz 2.61 MHz 64 kbps (celt) 4.09 MHz 8.08 MHz 6.24 MHz 128 kbps (celt) 1.93 MHz 8.83 MHz 6.53 MHz Change-Id: I851733a8a5824b61feb363a173091bc7e6629b58
2014-04-15libmad: Use 32bit unsigned for requantize table.Thomas Martitz1-2/+2
Implicit promotion of integer literals to unsigned long introduced a subtle bug on 64-bit systems due to weird sign extensions (leads to audible glitches in a few files). The table is originally designed for unsigned 32bit integers, and it works with those so use them. As a consequence the lookup table size is halved as well. Change-Id: I35d878d6df03300387f0e403e0f3c3bdc73eea00
2014-03-10Implement time-based resume and playback start.Michael Sevakis36-192/+487
This complements offset-based resume and playback start funcionality. The implementation is global on both HWCODEC and SWCODEC. Basically, if either the specified elapsed or offset are non-zero, it indicates a mid-track resume. To resume by time only, set elapsed to nonzero and offset to zero. To resume by offset only, set offset to nonzero and elapsed to zero. Which one the codec uses and which has priority is up to the codec; however, using an elapsed time covers more cases: * Codecs not able to use an offset such as VGM or other atomic formats * Starting playback at a nonzero elapsed time from a source that contains no offset, such as a cuesheet The change re-versions pretty much everything from tagcache to nvram. Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38 Reviewed-on: http://gerrit.rockbox.org/516 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
2014-03-03Fix more reds.Thomas Martitz1-11/+5
Change-Id: I4b58dda0953b7f9799238c32b78037b0a5403c04
2014-03-03Fix various reds. Some includes needed fixup.Thomas Martitz2-2/+4
Change-Id: I4327740bae17054131feb917abdd58846c451988
2013-12-23Proposed fix for FS#12878: Zero-length embedded album art prevents mp3 playbackJack Whitham1-1/+2
see http://www.rockbox.org/tracker/task/12878 Change-Id: Ib4233c06e18d1d193dfb9e73e745ca5d174e40b2 Reviewed-on: http://gerrit.rockbox.org/507 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com> Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-12-16Sync libopus to upstream release 1.1Nils Wallménius97-578/+977
Change-Id: I9fea7460fc33f60faff961b3389dd97b5191463c
2013-12-15DSP Compressor: Sidechain, Exponential Atk/RlsRyan Billing2-88/+292
This is an improvement to the current compressor which I have added to my own Sansa Fuze V2 build. I am submitting here in case others find it interesting. Features added to the existing compressor: Attack, Look-ahead, Sidechain Filtering. Exponential attack and release characteristic response. Benefits from adding missing features: Attack: Preserve perceived "brightness" of tone by letting onset transients come through at a higher level than the rest of the compressed program material. Look-ahead: With Attack comes clipping on the leading several cycles of a transient onset. With look-ahead function, this can be pre-emptively mitigated with a slower gain change (less distortion). Look-ahead limiting is implemented to prevent clipping while keeping gain change ramp to an interval near 3ms instead of instant attack. The existing compressor implementation distorts the leading edge of a transient by causing instant gain change, resulting in log() distortion. This sounds "woofy" to me. Exponential Attack/Release: eMore natural sounding. On attack, this is a true straight line of 10dB per attack interval. Release is a little different, however, sounds natural as an analog compressor. Sidechain Filtering: Mild high-pass filter reduces response to low frequency onsets. For example, a hard kick drum is less likely to make the whole of the program material appear to fade in and out. Combined with a moderate attack time, such a transient will ride through with minimal audible artifact. Overall these changes make dynamic music sound more "open", more natural. The goal of a compressor is to make dyanamic music sound louder without necessarily sounding as though it has been compressed. I believe these changes come closer to this goal. Enjoy. If not, I am enjoying it Change-Id: I664eace546c364b815b4dc9ed4a72849231a0eb2 Reviewed-on: http://gerrit.rockbox.org/626 Tested: Purling Nayuki <cyq.yzfl@gmail.com> Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2013-12-13Add support for flac embeded album art.Albert Song1-0/+50
Change-Id: I077768f7d80b57976f9a7278b640ef67cf4f2af2 Reviewed-on: http://gerrit.rockbox.org/694 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-11-18flac: fix seeking.Andrew Ryabinin1-1/+1
As comment in code states: "It is possible for our seek to land in the middle of audio data that looks exactly like a frame header from a future version of an encoder. When that happens, frame_sync() will return false. But there is a remote possibility that it is properly synced at such a "future-codec frame", so to make sure, we wait to see several "unparseable" errors in a row before bailing out." Currently we wait for 10 "unparseable" errors. libFLAC waits for 20. But I've got a valid flac+cue, wherein switching to certain track gave me 24 "unparsaeable" errors. Therefore I increased unparseable_count to 30. Change-Id: I4e97a5385c729adf3d5075d41ea312622c69e548 Reviewed-on: http://gerrit.rockbox.org/658 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com> Reviewed-by: Boris Gjenero <boris.gjenero@gmail.com> Tested-by: Andrew Ryabinin <ryabinin.a.a@gmail.com> Reviewed-by: Andrew Ryabinin <ryabinin.a.a@gmail.com>
2013-10-20Add missing #include statements.Kevin Zheng3-0/+6
Although Linux accepts several implicit definitions of SEEK_END found in stdio.h, the compiler on FreeBSD won't. Rockbox compilation will fail without stdio.h included. There is a precedent for including this header, see lib/rbcodec/codecs/libtremor/ivorbisfile.h. Change-Id: I58510101b59a354cd6601cb3f323f385a824d2e8 Reviewed-on: http://gerrit.rockbox.org/639 Tested-by: Kevin Zheng <kevinz5000@gmail.com> Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2013-10-05Simulator - encoders can now be loadedLorenzo Miori1-1/+2
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-09-01Opus: delete two files that were moved into a subdirNils Wallménius2-108/+0
Change-Id: I54ef0dfd57fbb493ad38855767a8f5e724e5bc65
2013-09-01Fix warning from a35c1b3Nils Wallménius1-1/+1
Change-Id: I0e9b2c265a6a2355dc39b1696df4c8f266d9a638
2013-09-01Opus: Coldfire inline asm for comb_filter_constNils Wallménius1-0/+33
Speeds up decoding a 64kbps test file by 2.6MHz Change-Id: Ibeb30f37cc00a4a6f65b64851009753f40e06fc1
2013-08-31Add cf asm inline for multiplication commonly used in silk.Nils Wallménius2-0/+54
Speeds up decoding a 16kbps test file by 4.9MHz on h300. Change-Id: I8c25431c98dfa9a1c3806a84055e0847eb77a9f1
2013-08-31Put two hot silk arrays on real stack (iram)Nils Wallménius2-6/+10
Speeds up decoding of 16kbps test file by 16.7MHz on H300. Change-Id: I39c90e3b423ae8e2ee5c2b88c5dcec8d48807f77
2013-08-31Silence spurious warningNils Wallménius1-1/+1
Change-Id: I856c722e959314c0a86e9c0a3a31cb824ddb41cc
2013-08-31Sync opus codec to upstream gitNils Wallménius115-4290/+4825
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-23Change CODECFLAGS to a "simply-expanded" var to give the individualNils Wallménius3-16/+18
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-16Fix FS#12889 : Audible pop right after setting Repeat/ShuffleMichael Sevakis1-0/+3
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-07-11mp3_enc: Fix early snafu with stream finish on COPMichael Sevakis1-23/+14
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-09Multithread compressing encoders on multicore targets.Michael Sevakis2-1806/+2302
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-06Enable setting of global output samplerate on certain targets.Michael Sevakis17-196/+377
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-06-30Update software recording engine to latest codec interface.Michael Sevakis5-1224/+862
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-30Fix some whitespace in files changed in following commit.Michael Sevakis4-37/+37
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-21Remove old EQ presets.Michael Giacomelli28-436/+0
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-16Silence some (harmless) warnings.Frank Gevaerts1-1/+0
Change-Id: I8d1278b8cfaa376d2ad5a99dd552dc980c66e1da
2013-06-15Fix id3v2 album art if more than one image is present.Dominik Riebeling1-1/+8
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-05-27Missed removing a couple unwanted includes in previous commit.Michael Sevakis3-3/+7
Get those too. Change-Id: Id2a39afe7a61d6ec0cea38633b94fe1b7122204f
2013-05-27Remove explicit config.h and system.h includes from DSP code.Michael Sevakis16-31/+34
Replace with rbcodecconfig.h and platform.h includes. Remove now- unneeded ones as well. Change-Id: I6111b71e90bf86d9fe272a7916f2d34a5c6dd724
2013-05-26SPC Codec ARMv5: I didn't have fast gauss quite right.Michael Sevakis1-5/+5
Fix wrapping hazard which did eventually manifest on the right file. Change-Id: I996a6efd3181b56fd172b5c3a526c7434f88bbbe
2013-05-23Remove dsp_callback because DSP is now library code, not app code.Michael Sevakis3-56/+9
Yep, nope, not necessary anymore. Just call functions directly. Change-Id: I21dc35f8d674c2a9c8379b7cebd5613c1f05b5eb
2013-05-23SPC Codec: Add ARMv5 optimized code. Easy peasy.Michael Sevakis4-1/+291
Why? Why not? Cuts a few MHz. Change-Id: Ied5c70b1aedd255cbe5d42b7d3028bbe47aad01d
2013-05-21SPC Codec: Simplify configuration and assume nothing need be disabled.Michael Sevakis1-33/+21
Most SoCs are these days are fast enough for realtime BRR, gaussian interpolation and echo processing. Change-Id: I180ce8ad45242c67b5e573a406b9522098a3f12b
2013-05-21SPC Codec: Have metadata parser fill in frequency and bitrate.Michael Sevakis1-0/+2
Change-Id: I6c72f4d1c79b1a99a11fb28e7d46886c08a56a75
2013-05-21SPC Codec: Need to restore a bit more data from cached waves.Michael Sevakis2-59/+53
'Nuff said. Last update wasn't quite right. Change-Id: I082a79c4e0c82b968fe2375cb82ee5c3a64a208b
2013-05-21Opus: fix glitch caused by 2e9aa3dNils Wallménius1-6/+6
Change-Id: I1519f3bf2cdf74f3d4741951973352b2678b7722
2013-05-21Fix FS#9577 - SNES player missing tracks on certain SPCsMichael Sevakis2-44/+85
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-21Fix 87021f7 errors. There is no this->echo_pos when SPC_NOECHO != 0.Michael Sevakis1-1/+1
Anyway, that's true now. Change-Id: I247ea9a10543a8b65f3e73495f0e2ea725ec533e
2013-05-21SPC Codec: Refactor for CPU and clean up some things.Michael Sevakis12-1295/+1690
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-19Opus: fix seeking to start of trackNils Wallménius1-2/+3
Change-Id: I8a8604d6726304d04281671b475b2f75f9bfc0e5
2013-05-19Opus: avoid allocating space for comment packetsNils Wallménius1-0/+6
Fixes playback of files with large embedded album art. Change-Id: I94d336e3da968a93047dd00a5fa65e4c3423a7da