Skip to content

Commit 81be8c8

Browse files
committed
fix bus error in resize_bilinear_c2 on armv7
1 parent 17d63a1 commit 81be8c8

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/mat_pixel_resize.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,12 @@ void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned c
392392
int16x4_t _a0a1XX = vld1_s16(ialphap);
393393
int16x4_t _a0a0a1a1 = vzip_s16(_a0a1XX, _a0a1XX).val[0];
394394
uint8x8_t _S1 = uint8x8_t();
395-
_S1 = vreinterpret_u8_u32(vld1_lane_u32((const unsigned int*)S1p, vreinterpret_u32_u8(_S1), 0));
395+
396+
_S1 = vld1_lane_u8(S1p, _S1, 0);
397+
_S1 = vld1_lane_u8(S1p+1, _S1, 1);
398+
_S1 = vld1_lane_u8(S1p+2, _S1, 2);
399+
_S1 = vld1_lane_u8(S1p+3, _S1, 3);
400+
396401
int16x8_t _S116 = vreinterpretq_s16_u16(vmovl_u8(_S1));
397402
int16x4_t _S1lowhigh = vget_low_s16(_S116);
398403
int32x4_t _S1ma0a1 = vmull_s16(_S1lowhigh, _a0a0a1a1);
@@ -434,8 +439,17 @@ void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned c
434439
int16x4_t _a1 = vdup_n_s16(a1);
435440
uint8x8_t _S0 = uint8x8_t();
436441
uint8x8_t _S1 = uint8x8_t();
437-
_S0 = vreinterpret_u8_u32(vld1_lane_u32((const unsigned int*)S0p, vreinterpret_u32_u8(_S0), 0));
438-
_S1 = vreinterpret_u8_u32(vld1_lane_u32((const unsigned int*)S1p, vreinterpret_u32_u8(_S1), 0));
442+
443+
_S0 = vld1_lane_u8(S0p, _S0, 0);
444+
_S0 = vld1_lane_u8(S0p+1, _S0, 1);
445+
_S0 = vld1_lane_u8(S0p+2, _S0, 2);
446+
_S0 = vld1_lane_u8(S0p+3, _S0, 3);
447+
448+
_S1 = vld1_lane_u8(S1p, _S1, 0);
449+
_S1 = vld1_lane_u8(S1p+1, _S1, 1);
450+
_S1 = vld1_lane_u8(S1p+2, _S1, 2);
451+
_S1 = vld1_lane_u8(S1p+3, _S1, 3);
452+
439453
int16x8_t _S016 = vreinterpretq_s16_u16(vmovl_u8(_S0));
440454
int16x8_t _S116 = vreinterpretq_s16_u16(vmovl_u8(_S1));
441455
int16x4_t _S0lowhigh = vget_low_s16(_S016);

0 commit comments

Comments
 (0)