diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-03-03 20:43:43 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 07:37:45 +0100 |
commit | 6e7b50b4270116ded8b874d76cb7c5b1a0341827 (patch) | |
tree | 19320c56efd077de16c9ecce4aafc450daf38562 /libavcodec/mpegvideo_enc.c | |
parent | 7e350379f87e7f74420b4813170fe808e2313911 (diff) | |
download | ffmpeg-6e7b50b4270116ded8b874d76cb7c5b1a0341827.tar.gz |
mpegvideo_enc: drop support for reusing the input motion vectors.
This misfeature is most likely completely useless and conflicts with
removing the mpegvideo-specific fields from AVFrame. In the improbable
case it is actually useful, it should be reimplemented in a better way.
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 3ba6f81618..bf094e6be1 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -191,8 +191,6 @@ void ff_init_qscale_tab(MpegEncContext *s) static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, const AVFrame *src) { - int i; - dst->pict_type = src->pict_type; dst->quality = src->quality; dst->coded_picture_number = src->coded_picture_number; @@ -201,38 +199,6 @@ static void copy_picture_attributes(MpegEncContext *s, AVFrame *dst, dst->pts = src->pts; dst->interlaced_frame = src->interlaced_frame; dst->top_field_first = src->top_field_first; - - if (s->avctx->me_threshold) { - if (!src->motion_val[0]) - av_log(s->avctx, AV_LOG_ERROR, "AVFrame.motion_val not set!\n"); - if (!src->mb_type) - av_log(s->avctx, AV_LOG_ERROR, "AVFrame.mb_type not set!\n"); - if (!src->ref_index[0]) - av_log(s->avctx, AV_LOG_ERROR, "AVFrame.ref_index not set!\n"); - if (src->motion_subsample_log2 != dst->motion_subsample_log2) - av_log(s->avctx, AV_LOG_ERROR, - "AVFrame.motion_subsample_log2 doesn't match! (%d!=%d)\n", - src->motion_subsample_log2, dst->motion_subsample_log2); - - memcpy(dst->mb_type, src->mb_type, - s->mb_stride * s->mb_height * sizeof(dst->mb_type[0])); - - for (i = 0; i < 2; i++) { - int stride = ((16 * s->mb_width ) >> - src->motion_subsample_log2) + 1; - int height = ((16 * s->mb_height) >> src->motion_subsample_log2); - - if (src->motion_val[i] && - src->motion_val[i] != dst->motion_val[i]) { - memcpy(dst->motion_val[i], src->motion_val[i], - 2 * stride * height * sizeof(int16_t)); - } - if (src->ref_index[i] && src->ref_index[i] != dst->ref_index[i]) { - memcpy(dst->ref_index[i], src->ref_index[i], - s->mb_stride * 4 * s->mb_height * sizeof(int8_t)); - } - } - } } static void update_duplicate_context_after_me(MpegEncContext *dst, @@ -562,11 +528,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) } i = (INT_MAX / 2 + 128) >> 8; - if (avctx->me_threshold >= i) { - av_log(avctx, AV_LOG_ERROR, "me_threshold too large, max is %d\n", - i - 1); - return -1; - } if (avctx->mb_threshold >= i) { av_log(avctx, AV_LOG_ERROR, "mb_threshold too large, max is %d\n", i - 1); @@ -3164,7 +3125,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) if(s->pict_type != AV_PICTURE_TYPE_I){ s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8; s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8; - if(s->pict_type != AV_PICTURE_TYPE_B && s->avctx->me_threshold==0){ + if (s->pict_type != AV_PICTURE_TYPE_B) { if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){ s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*)); } |