| @@ -308,12 +308,17 @@ av_cold void ff_dct_encode_init(MpegEncContext *s) · 307 unmodified lines |
| 308 | | 308 | |
| 309 | static av_cold int me_cmp_init(MpegEncContext *s, AVCodecContext *avctx) | 309 | static av_cold int me_cmp_init(MpegEncContext *s, AVCodecContext *avctx) |
| 310 | { | 310 | { |
| | 311 | me_cmp_func me_cmp[6]; |
| 311 | int ret; | 312 | int ret; |
| 312 | | 313 | |
| 313 | ff_me_cmp_init(&s->mecc, avctx); | 314 | ff_me_cmp_init(&s->mecc, avctx); |
| 314 | ret = ff_me_init(&s->me, avctx, &s->mecc); | 315 | ret = ff_me_init(&s->me, avctx, &s->mecc); |
| 315 | if (ret < 0) | 316 | if (ret < 0) |
| 316 | return ret; | 317 | return ret; |
| | 318 | ret = ff_set_cmp(&s->mecc, me_cmp, s->frame_skip_cmp); |
| | 319 | if (ret < 0) |
| | 320 | return ret; |
| | 321 | s->frame_skip_cmp_fn = me_cmp[1]; |
| 317 | | 322 | |
| 318 | return 0; | 323 | return 0; |
| 319 | } | 324 | } |
| @@ -931,9 +936,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) · 611 unmodified lines |
| 931 | if (!s->mecc.ildct_cmp[0] || !s->mecc.ildct_cmp[4]) | 936 | if (!s->mecc.ildct_cmp[0] || !s->mecc.ildct_cmp[4]) |
| 932 | return AVERROR(EINVAL); | 937 | return AVERROR(EINVAL); |
| 933 | } | 938 | } |
| 934 | ret = ff_set_cmp(&s->mecc, s->mecc.frame_skip_cmp, s->frame_skip_cmp); | | |
| 935 | if (ret < 0) | | |
| 936 | return AVERROR(EINVAL); | | |
| 937 | | 939 | |
| 938 | if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) { | 940 | if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) { |
| 939 | ff_h263_encode_init(s); | 941 | ff_h263_encode_init(s); |
| @@ -1311,7 +1313,7 @@ static int skip_check(MpegEncContext *s, const MPVPicture *p, const MPVPicture * · 371 unmodified lines |
| 1311 | int off = p->shared ? 0 : 16; | 1313 | int off = p->shared ? 0 : 16; |
| 1312 | const uint8_t *dptr = p->f->data[plane] + 8 * (x + y * stride) + off; | 1314 | const uint8_t *dptr = p->f->data[plane] + 8 * (x + y * stride) + off; |
| 1313 | const uint8_t *rptr = ref->f->data[plane] + 8 * (x + y * stride); | 1315 | const uint8_t *rptr = ref->f->data[plane] + 8 * (x + y * stride); |
| 1314 | int v = s->mecc.frame_skip_cmp[1](s, dptr, rptr, stride, 8); | 1316 | int v = s->frame_skip_cmp_fn(s, dptr, rptr, stride, 8); |
| 1315 | | 1317 | |
| 1316 | switch (FFABS(s->frame_skip_exp)) { | 1318 | switch (FFABS(s->frame_skip_exp)) { |
| 1317 | case 0: score = FFMAX(score, v); break; | 1319 | case 0: score = FFMAX(score, v); break; |