[x264-devel] commit: Fix stack alignment for adaptive quant (Jason Garrett-Glaser )

git at videolan.org git at videolan.org
Tue Jul 20 00:58:37 CEST 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Thu Jul 15 19:35:52 2010 -0700| [cd8929fb3365b6b5e5d6168d97a52c751feda266] | committer: Jason Garrett-Glaser 

Fix stack alignment for adaptive quant
Broke calls from compilers with broken stack alignment (e.g. MSVC).

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=cd8929fb3365b6b5e5d6168d97a52c751feda266
---

 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 d46ebae..7f307d1 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 811d9d8..641cf89 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 );



More information about the x264-devel mailing list