From: Angie Chiang Date: Tue, 27 Oct 2015 23:29:29 +0000 (-0700) Subject: Add fadst4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ef285bfe9d5837a48d27e425ef36017d1067b3a;p=libvpx Add fadst4 Change-Id: I320a1cf82d1705e5ec7fe1870327f70ce8493489 --- diff --git a/vp10/common/vp10_fwd_txfm1d.c b/vp10/common/vp10_fwd_txfm1d.c index c4ed9e35d..49c0c8b13 100644 --- a/vp10/common/vp10_fwd_txfm1d.c +++ b/vp10/common/vp10_fwd_txfm1d.c @@ -698,3 +698,68 @@ void vp10_fdct32_new(const int32_t *input, int32_t *output, bf1[31] = bf0[31]; range_check(stage, input, bf1, size, stage_range[stage]); } + +void vp10_fadst4_new(const int32_t *input, int32_t *output, + const int8_t *cos_bit, const int8_t *stage_range) { + const int32_t size = 4; + const int32_t *cospi; + + int32_t stage = 0; + int32_t *bf0, *bf1; + int32_t step[4]; + + // stage 0; + range_check(stage, input, input, size, stage_range[stage]); + + // stage 1; + stage++; + bf1 = output; + bf1[0] = input[3]; + bf1[1] = input[0]; + bf1[2] = input[1]; + bf1[3] = input[2]; + range_check(stage, input, bf1, size, stage_range[stage]); + + // stage 2 + stage++; + cospi = cospi_arr[cos_bit[stage] - cos_bit_min]; + bf0 = output; + bf1 = step; + bf1[0] = half_btf(cospi[8], bf0[0], cospi[56], bf0[1], cos_bit[stage]); + bf1[1] = half_btf(-cospi[8], bf0[1], cospi[56], bf0[0], cos_bit[stage]); + bf1[2] = half_btf(cospi[40], bf0[2], cospi[24], bf0[3], cos_bit[stage]); + bf1[3] = half_btf(-cospi[40], bf0[3], cospi[24], bf0[2], cos_bit[stage]); + range_check(stage, input, bf1, size, stage_range[stage]); + + // stage 3 + stage++; + cospi = cospi_arr[cos_bit[stage] - cos_bit_min]; + bf0 = step; + bf1 = output; + bf1[0] = bf0[0] + bf0[2]; + bf1[1] = bf0[1] + bf0[3]; + bf1[2] = -bf0[2] + bf0[0]; + bf1[3] = -bf0[3] + bf0[1]; + range_check(stage, input, bf1, size, stage_range[stage]); + + // stage 4 + stage++; + cospi = cospi_arr[cos_bit[stage] - cos_bit_min]; + bf0 = output; + bf1 = step; + bf1[0] = bf0[0]; + bf1[1] = bf0[1]; + bf1[2] = half_btf(cospi[32], bf0[2], cospi[32], bf0[3], cos_bit[stage]); + bf1[3] = half_btf(-cospi[32], bf0[3], cospi[32], bf0[2], cos_bit[stage]); + range_check(stage, input, bf1, size, stage_range[stage]); + + // stage 5 + stage++; + bf0 = step; + bf1 = output; + bf1[0] = bf0[0]; + bf1[1] = -bf0[2]; + bf1[2] = bf0[3]; + bf1[3] = -bf0[1]; + range_check(stage, input, bf1, size, stage_range[stage]); +} diff --git a/vp10/common/vp10_fwd_txfm1d.h b/vp10/common/vp10_fwd_txfm1d.h index 909782ee9..5f0056907 100644 --- a/vp10/common/vp10_fwd_txfm1d.h +++ b/vp10/common/vp10_fwd_txfm1d.h @@ -26,6 +26,9 @@ void vp10_fdct16_new(const int32_t *input, int32_t *output, void vp10_fdct32_new(const int32_t *input, int32_t *output, const int8_t *cos_bit, const int8_t *stage_range); +void vp10_fadst4_new(const int32_t *input, int32_t *output, + const int8_t *cos_bit, const int8_t *stage_range); + #ifdef __cplusplus } #endif