]> git.videolan.org Git - x264.git/commitdiff
MMX high bit depth coeff_last4
authorJoe Cortes <escozzia@gmail.com>
Sat, 25 Dec 2010 03:33:57 +0000 (21:33 -0600)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Mon, 10 Jan 2011 19:39:05 +0000 (11:39 -0800)
Patch from Google Code-In.

common/quant.c
common/x86/quant-a.asm

index 5c05a043f1eef096517b8d63b574ab730cb7adec..c4b39e2f5259f40415f1e70ca6185939a18d340d 100644 (file)
@@ -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;
index 49906f4259930726ddd5f87e6b7318b32b326a03..c4a652fb623a8c60b00f5e37fc9e9f895cc59645 100644 (file)
@@ -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]