From bd5487219adef1e857257829bcd0403ae816fb9d Mon Sep 17 00:00:00 2001 From: Joe Cortes Date: Fri, 24 Dec 2010 21:33:57 -0600 Subject: [PATCH] MMX high bit depth coeff_last4 Patch from Google Code-In. --- common/quant.c | 2 ++ common/x86/quant-a.asm | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/common/quant.c b/common/quant.c index 5c05a043..c4b39e2f 100644 --- a/common/quant.c +++ b/common/quant.c @@ -306,6 +306,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf ) pf->decimate_score16 = x264_decimate_score16_mmxext_slowctz; } pf->decimate_score64 = x264_decimate_score64_mmxext; + pf->coeff_last[DCT_CHROMA_DC] = x264_coeff_last4_mmxext; pf->coeff_last[ DCT_LUMA_AC] = x264_coeff_last15_mmxext; pf->coeff_last[ DCT_LUMA_4x4] = x264_coeff_last16_mmxext; pf->coeff_last[ DCT_LUMA_8x8] = x264_coeff_last64_mmxext; @@ -341,6 +342,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf ) pf->coeff_level_run[DCT_LUMA_4x4] = x264_coeff_level_run16_sse2; if( cpu&X264_CPU_LZCNT ) { + pf->coeff_last[DCT_CHROMA_DC] = x264_coeff_last4_mmxext_lzcnt; pf->coeff_last[ DCT_LUMA_AC] = x264_coeff_last15_sse2_lzcnt; pf->coeff_last[DCT_LUMA_4x4] = x264_coeff_last16_sse2_lzcnt; pf->coeff_last[DCT_LUMA_8x8] = x264_coeff_last64_sse2_lzcnt; diff --git a/common/x86/quant-a.asm b/common/x86/quant-a.asm index 49906f42..c4a652fb 100644 --- a/common/x86/quant-a.asm +++ b/common/x86/quant-a.asm @@ -1151,6 +1151,22 @@ DECIMATE8x8 ssse3, 1 shl %3, 8 or %1, %3 %endmacro + +%macro COEFF_LAST4 1 +cglobal coeff_last4_%1, 1,3 + pxor mm2, mm2 + LAST_MASK4_MMX r1d, r0 + xor r1d, 0xff + shr r1d, 4 + LAST eax, r1d, 0x1f + RET +%endmacro + +%define LAST LAST_X86 +COEFF_LAST4 mmxext +%define LAST LAST_SSE4A +COEFF_LAST4 mmxext_lzcnt + %else ; !HIGH_BIT_DEPTH %macro LAST_MASK4_MMX 2-3 movq mm0, [%2] -- 2.47.3