This was much easier than I expected.
It will also be basically useless until TFF/BFF support gets in, since it requires delta_poc_bottom to be set correctly to work well.
int i_chroma_lambda2_offset;
/* B_direct and weighted prediction */
- int16_t dist_scale_factor[16][2];
+ int16_t dist_scale_factor_buf[2][16][2];
+ int16_t (*dist_scale_factor)[2];
int8_t bipred_weight_buf[2][32][4];
int8_t (*bipred_weight)[4];
/* maps fref1[0]'s ref indices into the current list0 */
-#define map_col_to_list0(col) h->mb.map_col_to_list0[col+2]
+#define map_col_to_list0(col) h->mb.map_col_to_list0[(col)+2]
int8_t map_col_to_list0[18];
int ref_blind_dupe; /* The index of the blind reference frame duplicate. */
} mb;
const int x8 = i8%2;
const int y8 = i8/2;
const int i_part_8x8 = i_mb_8x8 + x8 + y8 * h->mb.i_b8_stride;
- const int i_ref = map_col_to_list0(h->fref1[0]->ref[0][i_part_8x8]);
+ const int i_ref1_ref = h->fref1[0]->ref[0][i_part_8x8];
+ const int i_ref = (map_col_to_list0(i_ref1_ref>>h->sh.b_mbaff) << h->sh.b_mbaff) + (i_ref1_ref&h->sh.b_mbaff);
if( i_ref >= 0 )
{
if( h->sh.i_type == SLICE_TYPE_B )
{
h->mb.bipred_weight = h->mb.bipred_weight_buf[h->mb.b_interlaced&(i_mb_y&1)];
+ h->mb.dist_scale_factor = h->mb.dist_scale_factor_buf[h->mb.b_interlaced&(i_mb_y&1)];
if( h->param.b_cabac )
{
uint8_t skipbp;
dist_scale_factor = x264_clip3( (tb * tx + 32) >> 6, -1024, 1023 );
}
- // FIXME: will need this if we ever do temporal MV pred with interlaced
- if( !h->sh.b_mbaff )
- h->mb.dist_scale_factor[i_ref0][i_ref1] = dist_scale_factor;
+ h->mb.dist_scale_factor_buf[field][i_ref0][i_ref1] = dist_scale_factor;
dist_scale_factor >>= 2;
if( h->param.analyse.b_weighted_bipred
x264_log( h, X264_LOG_WARNING, "interlace + me=esa is not implemented\n" );
h->param.analyse.i_me_method = X264_ME_UMH;
}
- if( h->param.analyse.i_direct_mv_pred > X264_DIRECT_PRED_SPATIAL )
- {
- x264_log( h, X264_LOG_WARNING, "interlace + direct=temporal is not implemented\n" );
- h->param.analyse.i_direct_mv_pred = X264_DIRECT_PRED_SPATIAL;
- }
if( h->param.analyse.i_weighted_pred > 0 )
{
x264_log( h, X264_LOG_WARNING, "interlace + weightp is not implemented\n" );