gstreamer/gst/audioconvert/gstaudioconvertorc.orc
Wim Taymans 9e15c89564 audioconvert: change multiplier for int<->float conversion
Use (1 << 31) as the multiplier for int<->float conversions. This makes
sure that int->float conversions always end up with floats between
[-1.0, 1.0].
For the conversion from float to int, this multiplier will give the complete
int range after we perform clipping.
Change the unit test to take this into consideration.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755301
2015-11-03 12:12:08 +01:00

36 lines
613 B
Text

.function audio_convert_orc_s32_to_double
.dest 8 d1 gdouble
.source 4 s1 gint32
.temp 8 t1
convld t1, s1
divd d1, t1, 2147483648.0L
.function audio_convert_orc_double_to_s32
.dest 4 d1 gint32
.source 8 s1 gdouble
.temp 8 t1
muld t1, s1, 2147483648.0L
convdl d1, t1
.function audio_convert_orc_int_bias
.dest 4 d1 gint32
.source 4 s1 gint32
.param 4 bias gint32
.param 4 mask gint32
.temp 4 t1
addssl t1, s1, bias
andl d1, t1, mask
.function audio_convert_orc_int_dither
.dest 4 d1 gint32
.source 4 s1 gint32
.source 4 dither gint32
.param 4 mask gint32
.temp 4 t1
addssl t1, s1, dither
andl d1, t1, mask