From cd8929fb3365b6b5e5d6168d97a52c751feda266 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Thu, 15 Jul 2010 19:35:52 -0700 Subject: [PATCH] Fix stack alignment for adaptive quant Broke calls from compilers with broken stack alignment (e.g. MSVC). --- common/x86/cpu-a.asm | 4 +++- encoder/encoder.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 ); -- 2.47.3