Pipewireパッケージ(ちょっと変更)
リビジョン | f3942fca29dff77816427de79fb884f9c608221c (tree) |
---|---|
日時 | 2023-10-16 02:10:45 |
作者 | Wim Taymans <wtaymans@redh...> |
コミッター | Wim Taymans |
audioconvert: fix unaligned writes
Use 16 bits writes for 16 bits samples or else we might be doing
unlaigned writes.
See #3572
@@ -1143,14 +1143,15 @@ conv_f32d_to_s16_2s_sse2(void *data, void * SPA_RESTRICT dst, const void * SPA_R | ||
1143 | 1143 | t[1] = _mm_packs_epi32(t[1], t[1]); |
1144 | 1144 | |
1145 | 1145 | out[0] = _mm_unpacklo_epi16(t[0], t[1]); |
1146 | - out[1] = _mm_shuffle_epi32(out[0], _MM_SHUFFLE(0, 3, 2, 1)); | |
1147 | - out[2] = _mm_shuffle_epi32(out[0], _MM_SHUFFLE(1, 0, 3, 2)); | |
1148 | - out[3] = _mm_shuffle_epi32(out[0], _MM_SHUFFLE(2, 1, 0, 3)); | |
1149 | 1146 | |
1150 | - *((int32_t*)(d + 0*n_channels)) = _mm_cvtsi128_si32(out[0]); | |
1151 | - *((int32_t*)(d + 1*n_channels)) = _mm_cvtsi128_si32(out[1]); | |
1152 | - *((int32_t*)(d + 2*n_channels)) = _mm_cvtsi128_si32(out[2]); | |
1153 | - *((int32_t*)(d + 3*n_channels)) = _mm_cvtsi128_si32(out[3]); | |
1147 | + d[0*n_channels+0] = _mm_extract_epi16(out[0], 0); | |
1148 | + d[0*n_channels+1] = _mm_extract_epi16(out[0], 1); | |
1149 | + d[1*n_channels+0] = _mm_extract_epi16(out[0], 2); | |
1150 | + d[1*n_channels+1] = _mm_extract_epi16(out[0], 3); | |
1151 | + d[2*n_channels+0] = _mm_extract_epi16(out[0], 4); | |
1152 | + d[2*n_channels+1] = _mm_extract_epi16(out[0], 5); | |
1153 | + d[3*n_channels+0] = _mm_extract_epi16(out[0], 6); | |
1154 | + d[3*n_channels+1] = _mm_extract_epi16(out[0], 7); | |
1154 | 1155 | d += 4*n_channels; |
1155 | 1156 | } |
1156 | 1157 | for(; n < n_samples; n++) { |