Skip to content

Commit

Permalink
fix bus error in resize_bilinear_c2 on armv7
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Jun 11, 2019
1 parent 17d63a1 commit 81be8c8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/mat_pixel_resize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,12 @@ void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned c
int16x4_t _a0a1XX = vld1_s16(ialphap);
int16x4_t _a0a0a1a1 = vzip_s16(_a0a1XX, _a0a1XX).val[0];
uint8x8_t _S1 = uint8x8_t();
_S1 = vreinterpret_u8_u32(vld1_lane_u32((const unsigned int*)S1p, vreinterpret_u32_u8(_S1), 0));

_S1 = vld1_lane_u8(S1p, _S1, 0);
_S1 = vld1_lane_u8(S1p+1, _S1, 1);
_S1 = vld1_lane_u8(S1p+2, _S1, 2);
_S1 = vld1_lane_u8(S1p+3, _S1, 3);

int16x8_t _S116 = vreinterpretq_s16_u16(vmovl_u8(_S1));
int16x4_t _S1lowhigh = vget_low_s16(_S116);
int32x4_t _S1ma0a1 = vmull_s16(_S1lowhigh, _a0a0a1a1);
Expand Down Expand Up @@ -434,8 +439,17 @@ void resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned c
int16x4_t _a1 = vdup_n_s16(a1);
uint8x8_t _S0 = uint8x8_t();
uint8x8_t _S1 = uint8x8_t();
_S0 = vreinterpret_u8_u32(vld1_lane_u32((const unsigned int*)S0p, vreinterpret_u32_u8(_S0), 0));
_S1 = vreinterpret_u8_u32(vld1_lane_u32((const unsigned int*)S1p, vreinterpret_u32_u8(_S1), 0));

_S0 = vld1_lane_u8(S0p, _S0, 0);
_S0 = vld1_lane_u8(S0p+1, _S0, 1);
_S0 = vld1_lane_u8(S0p+2, _S0, 2);
_S0 = vld1_lane_u8(S0p+3, _S0, 3);

_S1 = vld1_lane_u8(S1p, _S1, 0);
_S1 = vld1_lane_u8(S1p+1, _S1, 1);
_S1 = vld1_lane_u8(S1p+2, _S1, 2);
_S1 = vld1_lane_u8(S1p+3, _S1, 3);

int16x8_t _S016 = vreinterpretq_s16_u16(vmovl_u8(_S0));
int16x8_t _S116 = vreinterpretq_s16_u16(vmovl_u8(_S1));
int16x4_t _S0lowhigh = vget_low_s16(_S016);
Expand Down

0 comments on commit 81be8c8

Please sign in to comment.