Commit 282c3cfb authored by Fiona Glaser's avatar Fiona Glaser

Fix interlaced + extremal slice-max-size

Broke if the first macroblock in the slice exceeded the set slice-max-size.
parent a37a4245
......@@ -2221,7 +2221,7 @@ reencode:
int total_bits = bs_pos(&h->out.bs) + x264_cabac_pos(&h->cabac);
int mb_size = total_bits - mb_spos;
if( slice_max_size )
if( slice_max_size && (!SLICE_MBAFF || (i_mb_y&1)) )
{
/* Count the skip run, just in case. */
if( !h->param.b_cabac )
......@@ -2237,7 +2237,7 @@ reencode:
/* We'll just re-encode this last macroblock if we go over the max slice size. */
if( total_bits - starting_bits > slice_max_size && !h->mb.b_reencode_mb )
{
if( mb_xy != h->sh.i_first_mb )
if( mb_xy-SLICE_MBAFF*h->mb.i_mb_stride != h->sh.i_first_mb )
{
h->stat.frame.i_mv_bits = mv_bits_bak;
h->stat.frame.i_tex_bits = tex_bits_bak;
......
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