diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-09-12 22:27:59 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-01-21 15:33:19 -0500 |
commit | 7c79587d7407dab4b9445d66b5f111fe657c8c4d (patch) | |
tree | 4cc0c43d332a0ceb44149eca3769a499b6af46d1 /libavcodec/mpegvideo_enc.c | |
parent | 5764d38173661c29d954711dd5abfddf709e9ba4 (diff) |
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 <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 12 |
1 files changed, 10 insertions, 2 deletions
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; i<s->mb_stride*s->mb_height; i++) s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA; |