]> git.videolan.org Git - x264.git/commitdiff
Fix stack alignment for adaptive quant
authorJason Garrett-Glaser <darkshikari@gmail.com>
Fri, 16 Jul 2010 02:35:52 +0000 (19:35 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Fri, 16 Jul 2010 02:35:52 +0000 (19:35 -0700)
Broke calls from compilers with broken stack alignment (e.g. MSVC).

common/x86/cpu-a.asm
encoder/encoder.c

index d46ebae43dec55befe4310312ee3c24080ebbbfc..7f307d190f9a1d17dc572ee6ea551e3edf088912 100644 (file)
@@ -96,13 +96,15 @@ cglobal cpu_cpuid, 0,6
 cglobal stack_align
     push ebp
     mov  ebp, esp
-    sub  esp, 8
+    sub  esp, 12
     and  esp, ~15
     mov  ecx, [ebp+8]
     mov  edx, [ebp+12]
     mov  [esp], edx
     mov  edx, [ebp+16]
     mov  [esp+4], edx
+    mov  edx, [ebp+20]
+    mov  [esp+8], edx
     call ecx
     leave
     ret
index 811d9d86fcdff31067d4f083e81606afbcede02f..641cf89e45d6b69b05bd72152dbb183684e13013 100644 (file)
@@ -2332,7 +2332,7 @@ int     x264_encoder_encode( x264_t *h,
                 return -1;
         }
         else
-            x264_adaptive_quant_frame( h, fenc, pic_in->prop.quant_offsets );
+            x264_stack_align( x264_adaptive_quant_frame, h, fenc, pic_in->prop.quant_offsets );
 
         if( pic_in->prop.quant_offsets_free )
             pic_in->prop.quant_offsets_free( pic_in->prop.quant_offsets );