forked from len0rd/rockbox
Fix resampling clicking as much as possible at the moment. 1) Upsampling clicked because of size inaccuracies returned by DSP. Fix by simplifying audio system to use per-channel sample count from codec to pcm buffer. 2) Downsampling affected by 1) and was often starting passed the end of the data when not enough was available to generate an output sample. Fix by clamping input range to last sample in buffer and using the last sample value in the buffer. A perfect fix will require a double buffering scheme on the resampler to sufficient data during small data transients on both ends at all times of the down ratio on input and the up ratio on output.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12218 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dd50c863e6
commit
aba6ca0881
21 changed files with 170 additions and 256 deletions
|
@ -90,12 +90,12 @@
|
|||
#define CODEC_ENC_MAGIC 0x52454E43 /* RENC */
|
||||
|
||||
/* increase this every time the api struct changes */
|
||||
#define CODEC_API_VERSION 12
|
||||
#define CODEC_API_VERSION 13
|
||||
|
||||
/* update this to latest version if a change to the api struct breaks
|
||||
backwards compatibility (and please take the opportunity to sort in any
|
||||
new function which are "waiting" at the end of the function table) */
|
||||
#define CODEC_MIN_API_VERSION 12
|
||||
#define CODEC_MIN_API_VERSION 13
|
||||
|
||||
/* codec return codes */
|
||||
enum codec_status {
|
||||
|
@ -133,8 +133,7 @@ struct codec_api {
|
|||
void* (*get_codec_memory)(size_t *size);
|
||||
/* Insert PCM data into audio buffer for playback. Playback will start
|
||||
automatically. */
|
||||
bool (*pcmbuf_insert)(const char *data, size_t length);
|
||||
bool (*pcmbuf_insert_split)(const void *ch1, const void *ch2, size_t length);
|
||||
bool (*pcmbuf_insert)(const void *ch1, const void *ch2, int count);
|
||||
/* Set song position in WPS (value in ms). */
|
||||
void (*set_elapsed)(unsigned int value);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue