Commit 7c052972 authored by Linfeng Zhang's avatar Linfeng Zhang

cosmetics: NEON scaling code

Change-Id: Ib91054622c1f09c4ca523bc6837d7d8ab9f03618
parent f357335c
......@@ -78,7 +78,16 @@ class ScaleTest : public VpxScaleBase,
src_width, src_height, dst_width, dst_height));
ReferenceScaleFrame(filter_type, phase_scaler);
ScaleFrame(filter_type, phase_scaler);
PrintDiff();
if (memcmp(dst_img_.buffer_alloc, ref_img_.buffer_alloc,
ref_img_.frame_size)) {
printf(
"filter_type = %d, phase_scaler = %d, src_width = %4d, "
"src_height = %4d, dst_width = %4d, dst_height = %4d, "
"scale factor = %d:%d\n",
filter_type, phase_scaler, src_width, src_height,
dst_width, dst_height, sf_down, sf_up);
PrintDiff();
}
CompareImages(dst_img_);
DeallocScaleImages();
}
......@@ -134,8 +143,8 @@ TEST_P(ScaleTest, DISABLED_Speed) {
static const int kCountSpeedTestBlock = 100;
static const int kNumScaleFactorsToTest = 4;
static const int kScaleFactors[] = { 1, 2, 3, 4 };
const int src_height = 1280;
const int src_width = 720;
const int src_width = 1280;
const int src_height = 720;
for (INTERP_FILTER filter_type = 2; filter_type < 4; ++filter_type) {
for (int phase_scaler = 0; phase_scaler < 2; ++phase_scaler) {
for (int sf_up_idx = 0; sf_up_idx < kNumScaleFactorsToTest; ++sf_up_idx) {
......
This diff is collapsed.
......@@ -90,3 +90,22 @@ static INLINE uint8x8_t convolve8_8(const int16x8_t s0, const int16x8_t s1,
sum = vqaddq_s16(sum, vmulq_s16(s4, filter4));
return vqrshrun_n_s16(sum, 7);
}
static INLINE uint8x8_t scale_filter_8(const uint8x8_t *const s,
const int16x8_t filters) {
const int16x8_t filter3 = vdupq_lane_s16(vget_low_s16(filters), 3);
const int16x8_t filter4 = vdupq_lane_s16(vget_high_s16(filters), 0);
int16x8_t ss[8];
ss[0] = vreinterpretq_s16_u16(vmovl_u8(s[0]));
ss[1] = vreinterpretq_s16_u16(vmovl_u8(s[1]));
ss[2] = vreinterpretq_s16_u16(vmovl_u8(s[2]));
ss[3] = vreinterpretq_s16_u16(vmovl_u8(s[3]));
ss[4] = vreinterpretq_s16_u16(vmovl_u8(s[4]));
ss[5] = vreinterpretq_s16_u16(vmovl_u8(s[5]));
ss[6] = vreinterpretq_s16_u16(vmovl_u8(s[6]));
ss[7] = vreinterpretq_s16_u16(vmovl_u8(s[7]));
return convolve8_8(ss[0], ss[1], ss[2], ss[3], ss[4], ss[5], ss[6], ss[7],
filters, filter3, filter4);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment