int i_mb_topright_y;
x264_left_table_t *left_index_table;
int topleft_partition;
+ int b_allow_skip;
/**** thread synchronization ends here ****/
/* subsequent variables are either thread-local or constant,
}
}
+ /* Check whether skip here would cause decoder to predict interlace mode incorrectly.
+ * FIXME: It might be better to change the interlace type rather than forcing a skip to be non-skip. */
+ h->mb.b_allow_skip = 1;
+ if( h->sh.b_mbaff )
+ {
+ if( (mb_y&1) && IS_SKIP(h->mb.type[h->mb.i_mb_xy - h->mb.i_mb_stride]) )
+ {
+ if( h->mb.i_neighbour & MB_LEFT )
+ {
+ if( h->mb.field[h->mb.i_mb_xy - 1] != h->mb.b_interlaced )
+ h->mb.b_allow_skip = 0;
+ }
+ else if( h->mb.i_neighbour & MB_TOP )
+ {
+ if( h->mb.field[h->mb.i_mb_top_xy] != h->mb.b_interlaced )
+ h->mb.b_allow_skip = 0;
+ }
+ else // Frame mb pair is predicted
+ {
+ if( h->mb.b_interlaced )
+ h->mb.b_allow_skip = 0;
+ }
+ }
+ }
+
/* load skip */
if( h->sh.i_type == SLICE_TYPE_B )
{
return;
}
- if( h->sh.b_mbaff
- && h->mb.i_mb_xy == h->sh.i_first_mb + h->mb.i_mb_stride
- && IS_SKIP(h->mb.type[h->sh.i_first_mb]) )
+ if( !h->mb.b_allow_skip )
{
- /* The first skip is predicted to be a frame mb pair.
- * We don't yet support the aff part of mbaff, so force it to non-skip
- * so that we can pick the aff flag. */
b_force_no_skip = 1;
if( IS_SKIP(h->mb.i_type) )
{