+ if (mi_ctx->b_width < 2 || mi_ctx->b_height < 2) {
+ av_log(inlink->dst, AV_LOG_ERROR, "Height or width < %d\n",
+ 2 * mi_ctx->mb_size);
+ return AVERROR(EINVAL);
+ }
+ ff_me_init_context(me_ctx, mi_ctx->mb_size, mi_ctx->search_param,
+ width, height, 0, (mi_ctx->b_width - 1) << mi_ctx->log2_mb_size,
+ 0, (mi_ctx->b_height - 1) << mi_ctx->log2_mb_size);
+
+ if (mi_ctx->me_mode == ME_MODE_BIDIR)
+ me_ctx->get_cost = &get_sad_ob;
+ else if (mi_ctx->me_mode == ME_MODE_BILAT)
+ me_ctx->get_cost = &get_sbad_ob;
+