File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -419,12 +419,12 @@ namespace ojph {
419419 }
420420 else
421421 {
422- const si32 half = INT_MIN;
422+ const ui32 half = (ui32) INT_MIN;
423423 for (ui32 i = width; i > 0 ; --i) {
424- si32 v = *sp++;
424+ ui32 v = (ui32) *sp++;
425425 v <<= shift;
426426 v -= half;
427- *dp++ = (float )v * mul;
427+ *dp++ = (float )(si32) v * mul;
428428 }
429429 }
430430 }
Original file line number Diff line number Diff line change @@ -391,13 +391,13 @@ namespace ojph {
391391 }
392392 else
393393 {
394- v128_t half = wasm_f32x4_splat ( 0 . 5f );
394+ v128_t half = wasm_i32x4_splat (INT_MIN );
395395 for (ui32 i = width; i > 0 ; i -= 4 , sp += 4 , dp += 4 ) {
396396 v128_t t = wasm_v128_load (sp);
397397 v128_t u = wasm_i32x4_shl (t, shift);
398+ u = wasm_i32x4_sub (u, half);
398399 v128_t v = wasm_f32x4_convert_i32x4 (u);
399400 v = wasm_f32x4_mul (v, mul);
400- v = wasm_f32x4_sub (v, half);
401401 wasm_v128_store (dp, v);
402402 }
403403 }
You can’t perform that action at this time.
0 commit comments