FS#7286 - correct DC-bias for output signals (dsp, test_codec)
Opened by Andree Buschmann (Buschel) - Sunday, 10 June 2007, 16:49 GMT
Last edited by Thom Johansen (preglow) - Wednesday, 29 August 2007, 14:33 GMT
|
DetailsThis patch corrects the DC-bias of the PCM-signal ouput. I came around this issue when working on accuracy comparison between rockbox and reference decoder for musepack.
In trunk all signals will have DC-bias of -1/65536 which is cause by truncation of samples with more than 16 significant bits. Solution is to add 1<<(scale-1) before doing the >>scale shift. The patch is available for apps/plugins/test_codec.c and apps/dsp.c. For this reason the patch is not available for coldfire targets as these use assembler code and not the changed c-code. |
a) DC-offset by small amount
b) white quantization noise at about -93dB average.
When using the DC-offset (which is nothing but rounding instead of truncating), the DC-offset has gone and the quantization
noise compared to reference decoder is about -107dB in average.
As all audio outputs are influenced, and if we're talking of high precision audio output, we should correct this last stage.
Can you add such solution to this patch?
No runtime comparisons performed, nevertheless any effect in runtime should at least be irrelevant (for stereo, 44.1kHz -> additional 88200 adds/sec).
$ patch -p0 < dc_bias_v2.patch
patching file apps/dsp_cf.S
patching file apps/plugins/test_codec.c
patching file apps/dsp.c
patch unexpectedly ends in middle of line
IDK what to do about this...
Should have taken a deeper look into it before submitting this patch...