Fixed bug 4186 - ARM/NEON audio converters cause strange clicking noises
authorSylvain Becker <sylvain.becker@gmail.com>
Mon, 19 Aug 2019 16:57:15 +0200
changeset 13025644eeed7ce2f
parent 13024 303828d0135b
child 13026 33b64882e322
Fixed bug 4186 - ARM/NEON audio converters cause strange clicking noises
reverse the order when storing ouput buffer
src/audio/SDL_audiotypecvt.c
     1.1 --- a/src/audio/SDL_audiotypecvt.c	Sun Aug 18 10:38:32 2019 -0300
     1.2 +++ b/src/audio/SDL_audiotypecvt.c	Mon Aug 19 16:57:15 2019 +0200
     1.3 @@ -931,10 +931,10 @@
     1.4              const uint16x8_t uint16hi = vmovl_u8(vget_high_u8(bytes));  /* convert top 8 bytes to 8 uint16 */
     1.5              const uint16x8_t uint16lo = vmovl_u8(vget_low_u8(bytes));   /* convert bottom 8 bytes to 8 uint16 */
     1.6              /* split uint16 to two uint32, then convert to float, then multiply to normalize, subtract to adjust for sign, store. */
     1.7 -            vst1q_f32(dst, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16hi))), divby128));
     1.8 -            vst1q_f32(dst+4, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uint16hi))), divby128));
     1.9 -            vst1q_f32(dst+8, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16lo))), divby128));
    1.10 -            vst1q_f32(dst+12, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uint16lo))), divby128));
    1.11 +            vst1q_f32(dst, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uint16lo))), divby128));
    1.12 +            vst1q_f32(dst+4, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16lo))), divby128));
    1.13 +            vst1q_f32(dst+8, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uint16hi))), divby128));
    1.14 +            vst1q_f32(dst+12, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16hi))), divby128));
    1.15              i -= 16; mmsrc -= 16; dst -= 16;
    1.16          }
    1.17