summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinfeng Zhang <linfengz@google.com>2018-01-30 16:55:22 -0800
committerLinfeng Zhang <linfengz@google.com>2018-02-05 13:42:26 -0800
commit82e9c30334cb578fb8590772e3be43a7f922c51a (patch)
treee75f903267ff1c4a2a452dc84d3dcf61ae24d735
parent36363304903286369a63b0498d506a13fe335606 (diff)
downloadlibvpx-82e9c30334cb578fb8590772e3be43a7f922c51a.tar
libvpx-82e9c30334cb578fb8590772e3be43a7f922c51a.tar.gz
libvpx-82e9c30334cb578fb8590772e3be43a7f922c51a.tar.bz2
libvpx-82e9c30334cb578fb8590772e3be43a7f922c51a.zip
Update tx_type switch code in idct
Change-Id: Ia244bfd4b4eb9d703653792bc4f64c6f5358ae19
-rw-r--r--vp9/common/arm/neon/vp9_iht8x8_add_neon.c11
-rw-r--r--vp9/common/x86/vp9_idct_intrin_sse2.c30
-rw-r--r--vp9/encoder/x86/vp9_dct_intrin_sse2.c12
3 files changed, 26 insertions, 27 deletions
diff --git a/vp9/common/arm/neon/vp9_iht8x8_add_neon.c b/vp9/common/arm/neon/vp9_iht8x8_add_neon.c
index a11c30c3c..c6d2688f9 100644
--- a/vp9/common/arm/neon/vp9_iht8x8_add_neon.c
+++ b/vp9/common/arm/neon/vp9_iht8x8_add_neon.c
@@ -147,31 +147,30 @@ void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int stride,
transpose_s16_8x8(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
switch (tx_type) {
- case 0: // DCT_DCT
+ case DCT_DCT:
idct8x8_64_1d_bd8_kernel(cospis0, cospis1, a);
transpose_s16_8x8(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
idct8x8_64_1d_bd8_kernel(cospis0, cospis1, a);
break;
- case 1: // ADST_DCT
+ case ADST_DCT:
idct8x8_64_1d_bd8_kernel(cospis0, cospis1, a);
transpose_s16_8x8(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
iadst8(a);
break;
- case 2: // DCT_ADST
+ case DCT_ADST:
iadst8(a);
transpose_s16_8x8(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
idct8x8_64_1d_bd8_kernel(cospis0, cospis1, a);
break;
- case 3: // ADST_ADST
+ default:
+ assert(tx_type == ADST_ADST);
iadst8(a);
transpose_s16_8x8(&a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7]);
iadst8(a);
break;
-
- default: assert(0); break;
}
idct8x8_add8x8_neon(a, dest, stride);
diff --git a/vp9/common/x86/vp9_idct_intrin_sse2.c b/vp9/common/x86/vp9_idct_intrin_sse2.c
index 8b3109fa9..ad693718c 100644
--- a/vp9/common/x86/vp9_idct_intrin_sse2.c
+++ b/vp9/common/x86/vp9_idct_intrin_sse2.c
@@ -20,23 +20,23 @@ void vp9_iht4x4_16_add_sse2(const tran_low_t *input, uint8_t *dest, int stride,
in[1] = load_input_data8(input + 8);
switch (tx_type) {
- case 0: // DCT_DCT
+ case DCT_DCT:
idct4_sse2(in);
idct4_sse2(in);
break;
- case 1: // ADST_DCT
+ case ADST_DCT:
idct4_sse2(in);
iadst4_sse2(in);
break;
- case 2: // DCT_ADST
+ case DCT_ADST:
iadst4_sse2(in);
idct4_sse2(in);
break;
- case 3: // ADST_ADST
+ default:
+ assert(tx_type == ADST_ADST);
iadst4_sse2(in);
iadst4_sse2(in);
break;
- default: assert(0); break;
}
// Final round and shift
@@ -65,23 +65,23 @@ void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride,
in[7] = load_input_data8(input + 8 * 7);
switch (tx_type) {
- case 0: // DCT_DCT
+ case DCT_DCT:
vpx_idct8_sse2(in);
vpx_idct8_sse2(in);
break;
- case 1: // ADST_DCT
+ case ADST_DCT:
vpx_idct8_sse2(in);
iadst8_sse2(in);
break;
- case 2: // DCT_ADST
+ case DCT_ADST:
iadst8_sse2(in);
vpx_idct8_sse2(in);
break;
- case 3: // ADST_ADST
+ default:
+ assert(tx_type == ADST_ADST);
iadst8_sse2(in);
iadst8_sse2(in);
break;
- default: assert(0); break;
}
// Final rounding and shift
@@ -199,23 +199,23 @@ void vp9_iht16x16_256_add_sse2(const tran_low_t *input, uint8_t *dest,
load_buffer_8x16(input, in1);
switch (tx_type) {
- case 0: // DCT_DCT
+ case DCT_DCT:
idct16_sse2(in0, in1);
idct16_sse2(in0, in1);
break;
- case 1: // ADST_DCT
+ case ADST_DCT:
idct16_sse2(in0, in1);
iadst16_sse2(in0, in1);
break;
- case 2: // DCT_ADST
+ case DCT_ADST:
iadst16_sse2(in0, in1);
idct16_sse2(in0, in1);
break;
- case 3: // ADST_ADST
+ default:
+ assert(tx_type == ADST_ADST);
iadst16_sse2(in0, in1);
iadst16_sse2(in0, in1);
break;
- default: assert(0); break;
}
write_buffer_8x16(dest, in0, stride);
diff --git a/vp9/encoder/x86/vp9_dct_intrin_sse2.c b/vp9/encoder/x86/vp9_dct_intrin_sse2.c
index dbd243ac1..293cdcd67 100644
--- a/vp9/encoder/x86/vp9_dct_intrin_sse2.c
+++ b/vp9/encoder/x86/vp9_dct_intrin_sse2.c
@@ -170,13 +170,13 @@ void vp9_fht4x4_sse2(const int16_t *input, tran_low_t *output, int stride,
fadst4_sse2(in);
write_buffer_4x4(output, in);
break;
- case ADST_ADST:
+ default:
+ assert(tx_type == ADST_ADST);
load_buffer_4x4(input, in, stride);
fadst4_sse2(in);
fadst4_sse2(in);
write_buffer_4x4(output, in);
break;
- default: assert(0); break;
}
}
@@ -1097,14 +1097,14 @@ void vp9_fht8x8_sse2(const int16_t *input, tran_low_t *output, int stride,
right_shift_8x8(in, 1);
write_buffer_8x8(output, in, 8);
break;
- case ADST_ADST:
+ default:
+ assert(tx_type == ADST_ADST);
load_buffer_8x8(input, in, stride);
fadst8_sse2(in);
fadst8_sse2(in);
right_shift_8x8(in, 1);
write_buffer_8x8(output, in, 8);
break;
- default: assert(0); break;
}
}
@@ -1963,13 +1963,13 @@ void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride,
fadst16_sse2(in0, in1);
write_buffer_16x16(output, in0, in1, 16);
break;
- case ADST_ADST:
+ default:
+ assert(tx_type == ADST_ADST);
load_buffer_16x16(input, in0, in1, stride);
fadst16_sse2(in0, in1);
right_shift_16x16(in0, in1);
fadst16_sse2(in0, in1);
write_buffer_16x16(output, in0, in1, 16);
break;
- default: assert(0); break;
}
}