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"
|
2014-01-30 05:26:44 +01:00
|
|
|
|
2016-12-28 22:51:44 +01:00
|
|
|
static INLINE uint8x8_t create_dcd(const int16_t dc) {
|
|
|
|
int16x8_t t = vdupq_n_s16(dc);
|
|
|
|
return vqmovun_s16(t);
|
|
|
|
}
|
2016-07-23 05:07:03 +02:00
|
|
|
|
2016-12-28 22:51:44 +01:00
|
|
|
static INLINE void idct8x8_1_add_pos_kernel(uint8_t **dest, const int stride,
|
|
|
|
const uint8x8_t res) {
|
|
|
|
const uint8x8_t a = vld1_u8(*dest);
|
|
|
|
const uint8x8_t b = vqadd_u8(a, res);
|
|
|
|
vst1_u8(*dest, b);
|
|
|
|
*dest += stride;
|
|
|
|
}
|
2016-11-16 22:22:50 +01:00
|
|
|
|
2016-12-28 22:51:44 +01:00
|
|
|
static INLINE void idct8x8_1_add_neg_kernel(uint8_t **dest, const int stride,
|
|
|
|
const uint8x8_t res) {
|
|
|
|
const uint8x8_t a = vld1_u8(*dest);
|
|
|
|
const uint8x8_t b = vqsub_u8(a, res);
|
|
|
|
vst1_u8(*dest, b);
|
|
|
|
*dest += stride;
|
|
|
|
}
|
2016-11-16 22:22:50 +01:00
|
|
|
|
2016-12-28 22:51:44 +01:00
|
|
|
void vpx_idct8x8_1_add_neon(const tran_low_t *input, uint8_t *dest,
|
|
|
|
int stride) {
|
|
|
|
const int16_t out0 = WRAPLOW(dct_const_round_shift(input[0] * cospi_16_64));
|
|
|
|
const int16_t out1 = WRAPLOW(dct_const_round_shift(out0 * cospi_16_64));
|
|
|
|
const int16_t a1 = ROUND_POWER_OF_TWO(out1, 5);
|
2016-11-16 22:22:50 +01:00
|
|
|
|
2016-12-28 22:51:44 +01:00
|
|
|
if (a1 >= 0) {
|
|
|
|
const uint8x8_t dc = create_dcd(a1);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_pos_kernel(&dest, stride, dc);
|
|
|
|
} else {
|
|
|
|
const uint8x8_t dc = create_dcd(-a1);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
|
|
|
idct8x8_1_add_neg_kernel(&dest, stride, dc);
|
2016-07-23 05:07:03 +02:00
|
|
|
}
|
2014-01-30 05:26:44 +01:00
|
|
|
}
|