2014-01-30 05:26:44 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014 The WebM project authors. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <arm_neon.h>
|
2015-05-12 04:09:22 +02:00
|
|
|
|
2016-09-30 08:28:08 +02:00
|
|
|
#include "./vpx_dsp_rtcd.h"
|
2015-07-31 03:53:18 +02:00
|
|
|
#include "vpx_dsp/inv_txfm.h"
|
2015-07-24 19:27:23 +02:00
|
|
|
#include "vpx_ports/mem.h"
|
2014-01-30 05:26:44 +01:00
|
|
|
|
2016-09-30 08:28:08 +02:00
|
|
|
void vpx_idct8x8_1_add_neon(const tran_low_t *input, uint8_t *dest,
|
2016-12-13 00:13:22 +01:00
|
|
|
int stride) {
|
2016-11-16 22:22:50 +01:00
|
|
|
int i;
|
|
|
|
const int16_t out0 = dct_const_round_shift(input[0] * cospi_16_64);
|
|
|
|
const int16_t out1 = dct_const_round_shift(out0 * cospi_16_64);
|
|
|
|
const int16_t out2 = ROUND_POWER_OF_TWO(out1, 5);
|
|
|
|
const int16x8_t dc = vdupq_n_s16(out2);
|
|
|
|
const uint16x8_t dc_u16 = vreinterpretq_u16_s16(dc);
|
|
|
|
const uint8_t *dst = dest;
|
|
|
|
uint8x8_t d0, d1, d2, d3;
|
|
|
|
uint16x8_t d0_u16, d1_u16, d2_u16, d3_u16;
|
2016-07-23 05:07:03 +02:00
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
2016-11-16 22:22:50 +01:00
|
|
|
d0 = vld1_u8(dst);
|
2016-12-13 00:13:22 +01:00
|
|
|
dst += stride;
|
2016-11-16 22:22:50 +01:00
|
|
|
d1 = vld1_u8(dst);
|
2016-12-13 00:13:22 +01:00
|
|
|
dst += stride;
|
2016-11-16 22:22:50 +01:00
|
|
|
d2 = vld1_u8(dst);
|
2016-12-13 00:13:22 +01:00
|
|
|
dst += stride;
|
2016-11-16 22:22:50 +01:00
|
|
|
d3 = vld1_u8(dst);
|
2016-12-13 00:13:22 +01:00
|
|
|
dst += stride;
|
2016-11-16 22:22:50 +01:00
|
|
|
|
|
|
|
d0_u16 = vaddw_u8(dc_u16, d0);
|
|
|
|
d1_u16 = vaddw_u8(dc_u16, d1);
|
|
|
|
d2_u16 = vaddw_u8(dc_u16, d2);
|
|
|
|
d3_u16 = vaddw_u8(dc_u16, d3);
|
|
|
|
|
|
|
|
d0 = vqmovun_s16(vreinterpretq_s16_u16(d0_u16));
|
|
|
|
d1 = vqmovun_s16(vreinterpretq_s16_u16(d1_u16));
|
|
|
|
d2 = vqmovun_s16(vreinterpretq_s16_u16(d2_u16));
|
|
|
|
d3 = vqmovun_s16(vreinterpretq_s16_u16(d3_u16));
|
|
|
|
|
|
|
|
vst1_u8(dest, d0);
|
2016-12-13 00:13:22 +01:00
|
|
|
dest += stride;
|
2016-11-16 22:22:50 +01:00
|
|
|
vst1_u8(dest, d1);
|
2016-12-13 00:13:22 +01:00
|
|
|
dest += stride;
|
2016-11-16 22:22:50 +01:00
|
|
|
vst1_u8(dest, d2);
|
2016-12-13 00:13:22 +01:00
|
|
|
dest += stride;
|
2016-11-16 22:22:50 +01:00
|
|
|
vst1_u8(dest, d3);
|
2016-12-13 00:13:22 +01:00
|
|
|
dest += stride;
|
2016-07-23 05:07:03 +02:00
|
|
|
}
|
2014-01-30 05:26:44 +01:00
|
|
|
}
|