Commit 708b9862 authored by Loren Merritt's avatar Loren Merritt

fix a crash on win32 with threads.

r852 introduced an assumption in deblock that the stack is aligned.
parent 1851df55
x264 is written in C. The particular variant of C is: intersection of gcc-2.95 and msvc. This means C89 + a few C99 features.
The extra utilities (mostly checkasm) are written in C99, with no attempt at compatibility with old compilers.
We make the following additional assumptions which are true of real systems but not guaranteed by C99:
* Two's complement.
* Signed right-shifts are sign-extended.
x86-specific assumptions:
* The stack is 16-byte aligned. We align it on entry to libx264 and on entry to any thread, but the compiler must preserve alignment after that.
* We call emms before any float operation and before returning from libx264, not after each mmx operation. So bad things could happen if the compiler inserts float operations where they aren't expected.
......@@ -1139,6 +1139,8 @@ static void x264_slice_write( x264_t *h )
x264_nal_end( h );
x264_fdec_filter_row( h, h->sps->i_mb_height );
/* Compute misc bits */
h->stat.frame.i_misc_bits = bs_pos( &h->out.bs )
+ NALU_OVERHEAD * 8
......@@ -1185,7 +1187,6 @@ static int x264_slices_write( x264_t *h )
x264_stack_align( x264_slice_write, h );
i_frame_size = h->out.nal[h->out.i_nal-1].i_payload;
x264_fdec_filter_row( h, h->sps->i_mb_height );
#if VISUALIZE
if( h->param.b_visualize )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment