From 7c79587d7407dab4b9445d66b5f111fe657c8c4d Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Sat, 12 Sep 2015 22:27:59 +0200 Subject: lavc: Move scenechange_threshold to codec private options This option is only used by mpegvideoenc, x264, and xavs. It is a very codec-specific option, so deprecate the global variant. Signed-off-by: Vittorio Giovara --- libavcodec/mpegvideo_enc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libavcodec/mpegvideo_enc.c') diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 9c0f01509b..29358dda2f 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -468,7 +468,14 @@ FF_ENABLE_DEPRECATION_WARNINGS return -1; } - if (s->avctx->scenechange_threshold < 1000000000 && +#if FF_API_PRIVATE_OPT +FF_DISABLE_DEPRECATION_WARNINGS + if (avctx->scenechange_threshold) + s->scenechange_threshold = avctx->scenechange_threshold; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + + if (s->scenechange_threshold < 1000000000 && (s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)) { av_log(avctx, AV_LOG_ERROR, "closed gop with scene change detection are not supported yet, " @@ -3453,7 +3460,8 @@ static int encode_picture(MpegEncContext *s, int picture_number) s->current_picture. mb_var_sum= s->current_picture_ptr-> mb_var_sum= s->me. mb_var_sum_temp; emms_c(); - if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == AV_PICTURE_TYPE_P){ + if (s->me.scene_change_score > s->scenechange_threshold && + s->pict_type == AV_PICTURE_TYPE_P) { s->pict_type= AV_PICTURE_TYPE_I; for(i=0; imb_stride*s->mb_height; i++) s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA; -- cgit v1.2.3