diff options
author | James Almer <jamrial@gmail.com> | 2014-05-25 03:30:42 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-25 04:03:54 +0400 |
commit | d94e255dd114778e58b668968d99f5055112358d (patch) | |
tree | 6f445bb3d11cdc41d534a97f9b62bcb0fbb766d0 /libavcodec/x86 | |
parent | 46e3883519b7592e946258c68d072abd89e583c8 (diff) |
x86/dsputilenc: make the SUM_ABS_DCTELEM macro more readable
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/dsputilenc.asm | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm index c06f28b978..46330fe116 100644 --- a/libavcodec/x86/dsputilenc.asm +++ b/libavcodec/x86/dsputilenc.asm @@ -487,34 +487,28 @@ cglobal pix_norm1, 2, 4 movd eax, m1 RET -%macro DCT_SAD4 1 - mova m2, [blockq+%1+0 ] - mova m3, [blockq+%1+16] - mova m4, [blockq+%1+32] - mova m5, [blockq+%1+48] - ABS1_SUM m2, m6, m0 - ABS1_SUM m3, m6, m1 - ABS1_SUM m4, m6, m0 - ABS1_SUM m5, m6, m1 -%endmacro - ;----------------------------------------------- ;int ff_sum_abs_dctelem(int16_t *block) ;----------------------------------------------- ; %1 = number of xmm registers used +; %2 = number of inline loops -%macro SUM_ABS_DCTELEM 1 +%macro SUM_ABS_DCTELEM 2 cglobal sum_abs_dctelem, 1, 1, %1, block pxor m0, m0 pxor m1, m1 - DCT_SAD4 0 -%if mmsize == 8 - DCT_SAD4 8 -%endif - DCT_SAD4 64 -%if mmsize == 8 - DCT_SAD4 72 -%endif +%assign %%i 0 +%rep %2 + mova m2, [blockq+mmsize*(0+%%i)] + mova m3, [blockq+mmsize*(1+%%i)] + mova m4, [blockq+mmsize*(2+%%i)] + mova m5, [blockq+mmsize*(3+%%i)] + ABS1_SUM m2, m6, m0 + ABS1_SUM m3, m6, m1 + ABS1_SUM m4, m6, m0 + ABS1_SUM m5, m6, m1 +%assign %%i %%i+4 +%endrep paddusw m0, m1 HSUM m0, m1, eax and eax, 0xFFFF @@ -522,10 +516,10 @@ cglobal sum_abs_dctelem, 1, 1, %1, block %endmacro INIT_MMX mmx -SUM_ABS_DCTELEM 0 +SUM_ABS_DCTELEM 0, 4 INIT_MMX mmxext -SUM_ABS_DCTELEM 0 +SUM_ABS_DCTELEM 0, 4 INIT_XMM sse2 -SUM_ABS_DCTELEM 7 +SUM_ABS_DCTELEM 7, 2 INIT_XMM ssse3 -SUM_ABS_DCTELEM 6 +SUM_ABS_DCTELEM 6, 2 |