#include "libavutil/internal.h"
#include "avcodec.h"
#include "error_resilience.h"
+#include "me_cmp.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "rectangle.h"
int best_score = 256 * 256 * 256 * 64;
int best_pred = 0;
const int mot_index = (mb_x + mb_y * mot_stride) * mot_step;
- int prev_x, prev_y, prev_ref;
+ int prev_x = 0, prev_y = 0, prev_ref = 0;
if ((mb_x ^ mb_y ^ pass) & 1)
continue;
if (fixed[mb_xy] == MV_FROZEN)
continue;
- assert(!IS_INTRA(s->cur_pic.mb_type[mb_xy]));
- assert(s->last_pic && s->last_pic.f->data[0]);
j = 0;
if (mb_x > 0 && fixed[mb_xy - 1] == MV_FROZEN)
} else {
ff_thread_await_progress(s->last_pic.tf, mb_y, 0);
}
- is_intra_likely += s->dsp->sad[0](NULL, last_mb_ptr, mb_ptr,
- linesize[0], 16);
- is_intra_likely -= s->dsp->sad[0](NULL, last_mb_ptr,
- last_mb_ptr + linesize[0] * 16,
- linesize[0], 16);
+ is_intra_likely += s->mecc.sad[0](NULL, last_mb_ptr, mb_ptr,
+ linesize[0], 16);
+ is_intra_likely -= s->mecc.sad[0](NULL, last_mb_ptr,
+ last_mb_ptr + linesize[0] * 16,
+ linesize[0], 16);
} else {
if (IS_INTRA(s->cur_pic.mb_type[mb_xy]))
is_intra_likely++;
if (!s->avctx->error_concealment)
return;
+ if (!s->mecc_inited) {
+ ff_me_cmp_init(&s->mecc, s->avctx);
+ s->mecc_inited = 1;
+ }
+
memset(s->error_status_table, ER_MB_ERROR | VP_START | ER_MB_END,
s->mb_stride * s->mb_height * sizeof(uint8_t));
s->error_count = 3 * s->mb_num;
const int mb_xy = s->mb_index2xy[i];
int error = s->error_status_table[mb_xy];
- if (!s->mbskip_table[mb_xy]) // FIXME partition specific
+ if (s->mbskip_table && !s->mbskip_table[mb_xy]) // FIXME partition specific
distance++;
if (error & (1 << error_type))
distance = 0;
s->mv[0][0][1] = s->cur_pic.motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][1];
}
- s->decode_mb(s->opaque, 0 /* FIXME h264 partitioned slices need this set */,
+ s->decode_mb(s->opaque, 0 /* FIXME H.264 partitioned slices need this set */,
mv_dir, mv_type, &s->mv, mb_x, mb_y, 0, 0);
}
}
s->mb_height, linesize[2], 0);
}
+#if FF_API_XVMC
ec_clean:
+#endif
/* clean a few tables */
for (i = 0; i < s->mb_num; i++) {
const int mb_xy = s->mb_index2xy[i];
int error = s->error_status_table[mb_xy];
- if (s->cur_pic.f->pict_type != AV_PICTURE_TYPE_B &&
+ if (s->mbskip_table && s->cur_pic.f->pict_type != AV_PICTURE_TYPE_B &&
(error & (ER_DC_ERROR | ER_MV_ERROR | ER_AC_ERROR))) {
s->mbskip_table[mb_xy] = 0;
}
- s->mbintra_table[mb_xy] = 1;
+ if (s->mbintra_table)
+ s->mbintra_table[mb_xy] = 1;
}
memset(&s->cur_pic, 0, sizeof(ERPicture));