From: Jason Garrett-Glaser Date: Fri, 16 Jul 2010 02:35:52 +0000 (-0700) Subject: Fix stack alignment for adaptive quant X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=cd8929fb3365b6b5e5d6168d97a52c751feda266;p=x264.git Fix stack alignment for adaptive quant Broke calls from compilers with broken stack alignment (e.g. MSVC). --- diff --git a/common/x86/cpu-a.asm b/common/x86/cpu-a.asm index d46ebae4..7f307d19 100644 --- a/common/x86/cpu-a.asm +++ b/common/x86/cpu-a.asm @@ -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 diff --git a/encoder/encoder.c b/encoder/encoder.c index 811d9d86..641cf89e 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -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 );