[4/4] hevc: x86: Refactor IDCT initialization macros

Message ID 1475674674-2689-4-git-send-email-diego@biurrun.de
State Superseded
Headers show

Commit Message

Diego Biurrun Oct. 5, 2016, 1:37 p.m.
---
 libavcodec/x86/hevc_idct.asm | 35 ++++++++++-------------------------
 1 file changed, 10 insertions(+), 25 deletions(-)

Patch

diff --git a/libavcodec/x86/hevc_idct.asm b/libavcodec/x86/hevc_idct.asm
index 7ad09fb..71e2a88 100644
--- a/libavcodec/x86/hevc_idct.asm
+++ b/libavcodec/x86/hevc_idct.asm
@@ -756,8 +756,8 @@  cglobal hevc_idct_32x32_%1, 1, 6, 16, 256, coeffs
     TAIL_CALL transpose_32x32, 1
 %endmacro
 
-%macro INIT_IDCT 1
-INIT_XMM sse2
+%macro INIT_IDCT 2
+INIT_XMM %2
 %if %1 == 8
 TRANSPOSE_8x8
 %if ARCH_X86_64
@@ -765,28 +765,10 @@  TRANSPOSE_16x16
 TRANSPOSE_32x32
 %endif
 %endif
-%define transpose_8x8 hevc_idct_transpose_8x8_sse2
+%define transpose_8x8 hevc_idct_transpose_8x8_%2
 %if ARCH_X86_64
-%define transpose_16x16 hevc_idct_transpose_16x16_sse2
-%define transpose_32x32 hevc_idct_transpose_32x32_sse2
-IDCT_32x32 %1
-IDCT_16x16 %1
-%endif
-IDCT_8x8 %1
-IDCT_4x4 %1
-
-INIT_XMM avx
-%if %1 == 8
-TRANSPOSE_8x8
-%if ARCH_X86_64
-TRANSPOSE_16x16
-TRANSPOSE_32x32
-%endif
-%endif
-%define transpose_8x8 hevc_idct_transpose_8x8_avx
-%if ARCH_X86_64
-%define transpose_16x16 hevc_idct_transpose_16x16_avx
-%define transpose_32x32 hevc_idct_transpose_32x32_avx
+%define transpose_16x16 hevc_idct_transpose_16x16_%2
+%define transpose_32x32 hevc_idct_transpose_32x32_%2
 IDCT_32x32 %1
 IDCT_16x16 %1
 %endif
@@ -794,5 +776,8 @@  IDCT_8x8 %1
 IDCT_4x4 %1
 %endmacro
 
-INIT_IDCT 8
-INIT_IDCT 10
+INIT_IDCT  8, sse2
+INIT_IDCT 10, sse2
+
+INIT_IDCT  8, avx
+INIT_IDCT 10, avx