2013-08-07 03:05:14 +04:00
|
|
|
/*
|
2016-09-02 00:32:49 +03:00
|
|
|
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
|
2013-08-07 03:05:14 +04:00
|
|
|
*
|
2016-09-02 00:32:49 +03:00
|
|
|
* This source code is subject to the terms of the BSD 2 Clause License and
|
|
|
|
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
|
|
|
|
* was not distributed with this source code in the LICENSE file, you can
|
|
|
|
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
|
|
|
|
* Media Patent License 1.0 was not distributed with this source code in the
|
|
|
|
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
|
2013-08-07 03:05:14 +04:00
|
|
|
*/
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
#include "aom_dsp/aom_dsp_common.h"
|
2013-08-07 03:05:14 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_idct16x16_256_add_neon_pass1(const int16_t *input, int16_t *output,
|
2013-10-12 05:27:12 +04:00
|
|
|
int output_stride);
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_idct16x16_256_add_neon_pass2(const int16_t *src, int16_t *output,
|
2016-08-09 08:59:08 +03:00
|
|
|
int16_t *pass1Output, int16_t skip_adding,
|
|
|
|
uint8_t *dest, int dest_stride);
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_idct16x16_10_add_neon_pass1(const int16_t *input, int16_t *output,
|
2013-10-12 05:27:12 +04:00
|
|
|
int output_stride);
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_idct16x16_10_add_neon_pass2(const int16_t *src, int16_t *output,
|
2016-08-09 08:59:08 +03:00
|
|
|
int16_t *pass1Output, int16_t skip_adding,
|
|
|
|
uint8_t *dest, int dest_stride);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
2014-02-07 21:52:15 +04:00
|
|
|
#if HAVE_NEON_ASM
|
2013-09-27 03:01:37 +04:00
|
|
|
/* For ARM NEON, d8-d15 are callee-saved registers, and need to be saved. */
|
2016-08-31 00:01:10 +03:00
|
|
|
extern void aom_push_neon(int64_t *store);
|
|
|
|
extern void aom_pop_neon(int64_t *store);
|
2014-02-07 21:52:15 +04:00
|
|
|
#endif // HAVE_NEON_ASM
|
2013-08-07 03:05:14 +04:00
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_idct16x16_256_add_neon(const int16_t *input, uint8_t *dest,
|
2016-08-09 08:59:08 +03:00
|
|
|
int dest_stride) {
|
2014-02-07 21:52:15 +04:00
|
|
|
#if HAVE_NEON_ASM
|
2013-09-27 03:01:37 +04:00
|
|
|
int64_t store_reg[8];
|
2014-02-07 21:52:15 +04:00
|
|
|
#endif
|
2016-08-09 08:59:08 +03:00
|
|
|
int16_t pass1_output[16 * 16] = { 0 };
|
|
|
|
int16_t row_idct_output[16 * 16] = { 0 };
|
2013-08-07 03:05:14 +04:00
|
|
|
|
2014-02-07 21:52:15 +04:00
|
|
|
#if HAVE_NEON_ASM
|
2013-08-07 03:05:14 +04:00
|
|
|
// save d8-d15 register values.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_push_neon(store_reg);
|
2014-02-07 21:52:15 +04:00
|
|
|
#endif
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
/* Parallel idct on the upper 8 rows */
|
|
|
|
// First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the
|
|
|
|
// stage 6 result in pass1_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass1(input, pass1_output, 8);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
// Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines
|
|
|
|
// with result in pass1(pass1_output) to calculate final result in stage 7
|
|
|
|
// which will be saved into row_idct_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass2(input + 1, row_idct_output, pass1_output, 0,
|
2016-08-09 08:59:08 +03:00
|
|
|
dest, dest_stride);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
/* Parallel idct on the lower 8 rows */
|
|
|
|
// First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the
|
|
|
|
// stage 6 result in pass1_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass1(input + 8 * 16, pass1_output, 8);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
// Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines
|
|
|
|
// with result in pass1(pass1_output) to calculate final result in stage 7
|
|
|
|
// which will be saved into row_idct_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass2(input + 8 * 16 + 1, row_idct_output + 8,
|
2016-08-09 08:59:08 +03:00
|
|
|
pass1_output, 0, dest, dest_stride);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
/* Parallel idct on the left 8 columns */
|
|
|
|
// First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the
|
|
|
|
// stage 6 result in pass1_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass1(row_idct_output, pass1_output, 8);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
2013-08-22 01:19:08 +04:00
|
|
|
// Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines
|
|
|
|
// with result in pass1(pass1_output) to calculate final result in stage 7.
|
|
|
|
// Then add the result to the destination data.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass2(row_idct_output + 1, row_idct_output,
|
2016-08-09 08:59:08 +03:00
|
|
|
pass1_output, 1, dest, dest_stride);
|
2013-08-22 01:19:08 +04:00
|
|
|
|
|
|
|
/* Parallel idct on the right 8 columns */
|
|
|
|
// First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the
|
|
|
|
// stage 6 result in pass1_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass1(row_idct_output + 8 * 16, pass1_output, 8);
|
2013-08-22 01:19:08 +04:00
|
|
|
|
|
|
|
// Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines
|
|
|
|
// with result in pass1(pass1_output) to calculate final result in stage 7.
|
|
|
|
// Then add the result to the destination data.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass2(row_idct_output + 8 * 16 + 1,
|
2016-08-09 08:59:08 +03:00
|
|
|
row_idct_output + 8, pass1_output, 1,
|
|
|
|
dest + 8, dest_stride);
|
2013-08-22 01:19:08 +04:00
|
|
|
|
2014-02-07 21:52:15 +04:00
|
|
|
#if HAVE_NEON_ASM
|
2013-08-22 01:19:08 +04:00
|
|
|
// restore d8-d15 register values.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_pop_neon(store_reg);
|
2014-02-07 21:52:15 +04:00
|
|
|
#endif
|
2013-08-22 01:19:08 +04:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-08-31 00:01:10 +03:00
|
|
|
void aom_idct16x16_10_add_neon(const int16_t *input, uint8_t *dest,
|
2016-08-09 08:59:08 +03:00
|
|
|
int dest_stride) {
|
2014-02-07 21:52:15 +04:00
|
|
|
#if HAVE_NEON_ASM
|
2013-09-27 03:01:37 +04:00
|
|
|
int64_t store_reg[8];
|
2014-02-07 21:52:15 +04:00
|
|
|
#endif
|
2016-08-09 08:59:08 +03:00
|
|
|
int16_t pass1_output[16 * 16] = { 0 };
|
|
|
|
int16_t row_idct_output[16 * 16] = { 0 };
|
2013-08-22 01:19:08 +04:00
|
|
|
|
2014-02-07 21:52:15 +04:00
|
|
|
#if HAVE_NEON_ASM
|
2013-08-22 01:19:08 +04:00
|
|
|
// save d8-d15 register values.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_push_neon(store_reg);
|
2014-02-07 21:52:15 +04:00
|
|
|
#endif
|
2013-08-22 01:19:08 +04:00
|
|
|
|
|
|
|
/* Parallel idct on the upper 8 rows */
|
|
|
|
// First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the
|
|
|
|
// stage 6 result in pass1_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_10_add_neon_pass1(input, pass1_output, 8);
|
2013-08-22 01:19:08 +04:00
|
|
|
|
|
|
|
// Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines
|
|
|
|
// with result in pass1(pass1_output) to calculate final result in stage 7
|
|
|
|
// which will be saved into row_idct_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_10_add_neon_pass2(input + 1, row_idct_output, pass1_output, 0,
|
2016-08-09 08:59:08 +03:00
|
|
|
dest, dest_stride);
|
2013-08-22 01:19:08 +04:00
|
|
|
|
|
|
|
/* Skip Parallel idct on the lower 8 rows as they are all 0s */
|
|
|
|
|
|
|
|
/* Parallel idct on the left 8 columns */
|
|
|
|
// First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the
|
|
|
|
// stage 6 result in pass1_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass1(row_idct_output, pass1_output, 8);
|
2013-08-22 01:19:08 +04:00
|
|
|
|
2013-08-07 03:05:14 +04:00
|
|
|
// Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines
|
|
|
|
// with result in pass1(pass1_output) to calculate final result in stage 7.
|
|
|
|
// Then add the result to the destination data.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass2(row_idct_output + 1, row_idct_output,
|
2016-08-09 08:59:08 +03:00
|
|
|
pass1_output, 1, dest, dest_stride);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
/* Parallel idct on the right 8 columns */
|
|
|
|
// First pass processes even elements 0, 2, 4, 6, 8, 10, 12, 14 and save the
|
|
|
|
// stage 6 result in pass1_output.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass1(row_idct_output + 8 * 16, pass1_output, 8);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
// Second pass processes odd elements 1, 3, 5, 7, 9, 11, 13, 15 and combines
|
|
|
|
// with result in pass1(pass1_output) to calculate final result in stage 7.
|
|
|
|
// Then add the result to the destination data.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_idct16x16_256_add_neon_pass2(row_idct_output + 8 * 16 + 1,
|
2016-08-09 08:59:08 +03:00
|
|
|
row_idct_output + 8, pass1_output, 1,
|
|
|
|
dest + 8, dest_stride);
|
2013-08-07 03:05:14 +04:00
|
|
|
|
2014-02-07 21:52:15 +04:00
|
|
|
#if HAVE_NEON_ASM
|
2013-08-07 03:05:14 +04:00
|
|
|
// restore d8-d15 register values.
|
2016-08-31 00:01:10 +03:00
|
|
|
aom_pop_neon(store_reg);
|
2014-02-07 21:52:15 +04:00
|
|
|
#endif
|
2013-08-07 03:05:14 +04:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|