summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-10 02:08:58 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-10 02:10:43 +0100
commit4a62f477ea846ee1198c8945237147d00b4f9c3d (patch)
treee377ae85f65a8b3a88cf26f7ccc24ce4d8444187 /libavcodec/mpegvideo_enc.c
parente53061154f42cda93052a2f558e1c4697e3b0c1a (diff)
parent6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff)
Merge commit '6e7b50b4270116ded8b874d76cb7c5b1a0341827'
* commit '6e7b50b4270116ded8b874d76cb7c5b1a0341827': mpegvideo_enc: drop support for reusing the input motion vectors. Conflicts: libavcodec/motion_est.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index a0e7a54fb1..1906a53b7d 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -188,8 +188,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;
@@ -198,38 +196,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,
@@ -664,11 +630,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);
@@ -3312,7 +3273,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*));
}