This option is only used by mpegvideoenc, and xvid. It is a very codec-specific option, so deprecate the global variant. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>tags/n3.0
| @@ -1615,12 +1615,11 @@ typedef struct AVCodecContext { | |||||
| */ | */ | ||||
| int has_b_frames; | int has_b_frames; | ||||
| /** | |||||
| * 0-> h263 quant 1-> mpeg quant | |||||
| * - encoding: Set by user. | |||||
| * - decoding: unused | |||||
| */ | |||||
| #if FF_API_PRIVATE_OPT | |||||
| /** @deprecated use encoder private options instead */ | |||||
| attribute_deprecated | |||||
| int mpeg_quant; | int mpeg_quant; | ||||
| #endif | |||||
| /** | /** | ||||
| * qscale factor between P and I-frames | * qscale factor between P and I-frames | ||||
| @@ -74,6 +74,7 @@ struct xvid_context { | |||||
| int ssim_acc; /**< SSIM accuracy. 0: accurate. 4: fast. */ | int ssim_acc; /**< SSIM accuracy. 0: accurate. 4: fast. */ | ||||
| int gmc; | int gmc; | ||||
| int me_quality; /**< Motion estimation quality. 0: fast 6: best. */ | int me_quality; /**< Motion estimation quality. 0: fast 6: best. */ | ||||
| int mpeg_quant; /**< Quantization type. 0: H263, 1: MPEG */ | |||||
| }; | }; | ||||
| /** | /** | ||||
| @@ -613,7 +614,15 @@ FF_ENABLE_DEPRECATION_WARNINGS | |||||
| /* Quant Matrices */ | /* Quant Matrices */ | ||||
| x->intra_matrix = | x->intra_matrix = | ||||
| x->inter_matrix = NULL; | x->inter_matrix = NULL; | ||||
| #if FF_API_PRIVATE_OPT | |||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (avctx->mpeg_quant) | if (avctx->mpeg_quant) | ||||
| x->mpeg_quant = avctx->mpeg_quant; | |||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | |||||
| if (x->mpeg_quant) | |||||
| x->vol_flags |= XVID_VOL_MPEGQUANT; | x->vol_flags |= XVID_VOL_MPEGQUANT; | ||||
| if ((avctx->intra_matrix || avctx->inter_matrix)) { | if ((avctx->intra_matrix || avctx->inter_matrix)) { | ||||
| x->vol_flags |= XVID_VOL_MPEGQUANT; | x->vol_flags |= XVID_VOL_MPEGQUANT; | ||||
| @@ -854,6 +863,7 @@ static const AVOption options[] = { | |||||
| { "ssim_acc", "SSIM accuracy", OFFSET(ssim_acc), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4, VE }, | { "ssim_acc", "SSIM accuracy", OFFSET(ssim_acc), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4, VE }, | ||||
| { "gmc", "use GMC", OFFSET(gmc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, | { "gmc", "use GMC", OFFSET(gmc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, | ||||
| { "me_quality", "Motion estimation quality", OFFSET(me_quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 6, VE }, | { "me_quality", "Motion estimation quality", OFFSET(me_quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 6, VE }, | ||||
| { "mpeg_quant", "Use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -611,6 +611,7 @@ FF_MPV_OPT_CMP_FUNC, \ | |||||
| {"skip_cmp", "Frame skip compare function", FF_MPV_OFFSET(frame_skip_cmp), AV_OPT_TYPE_INT, {.i64 = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, "cmp_func" }, \ | {"skip_cmp", "Frame skip compare function", FF_MPV_OFFSET(frame_skip_cmp), AV_OPT_TYPE_INT, {.i64 = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, "cmp_func" }, \ | ||||
| {"sc_threshold", "Scene change threshold", FF_MPV_OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ | {"sc_threshold", "Scene change threshold", FF_MPV_OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ | ||||
| {"noise_reduction", "Noise reduction", FF_MPV_OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ | {"noise_reduction", "Noise reduction", FF_MPV_OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ | ||||
| {"mpeg_quant", "Use MPEG quantizers instead of H.263", FF_MPV_OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \ | |||||
| extern const AVOption ff_mpv_generic_options[]; | extern const AVOption ff_mpv_generic_options[]; | ||||
| @@ -313,7 +313,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) | |||||
| s->codec_id = avctx->codec->id; | s->codec_id = avctx->codec->id; | ||||
| s->strict_std_compliance = avctx->strict_std_compliance; | s->strict_std_compliance = avctx->strict_std_compliance; | ||||
| s->quarter_sample = (avctx->flags & AV_CODEC_FLAG_QPEL) != 0; | s->quarter_sample = (avctx->flags & AV_CODEC_FLAG_QPEL) != 0; | ||||
| s->mpeg_quant = avctx->mpeg_quant; | |||||
| s->rtp_mode = !!avctx->rtp_payload_size; | s->rtp_mode = !!avctx->rtp_payload_size; | ||||
| s->intra_dc_precision = avctx->intra_dc_precision; | s->intra_dc_precision = avctx->intra_dc_precision; | ||||
| s->user_specified_pts = AV_NOPTS_VALUE; | s->user_specified_pts = AV_NOPTS_VALUE; | ||||
| @@ -450,6 +449,13 @@ FF_ENABLE_DEPRECATION_WARNINGS | |||||
| return -1; | return -1; | ||||
| } | } | ||||
| #if FF_API_PRIVATE_OPT | |||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (avctx->mpeg_quant) | |||||
| s->mpeg_quant = avctx->mpeg_quant; | |||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | |||||
| // FIXME mpeg2 uses that too | // FIXME mpeg2 uses that too | ||||
| if (s->mpeg_quant && s->codec_id != AV_CODEC_ID_MPEG4) { | if (s->mpeg_quant && s->codec_id != AV_CODEC_ID_MPEG4) { | ||||
| av_log(avctx, AV_LOG_ERROR, | av_log(avctx, AV_LOG_ERROR, | ||||
| @@ -170,7 +170,9 @@ static const AVOption avcodec_options[] = { | |||||
| {"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_detect"}, | {"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_detect"}, | ||||
| {"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, | {"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, | ||||
| {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, | {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, | ||||
| #if FF_API_PRIVATE_OPT | |||||
| {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, | {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, | ||||
| #endif | |||||
| #if FF_API_MPV_OPT | #if FF_API_MPV_OPT | ||||
| {"qsquish", "deprecated, use encoder private options instead", OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E}, | {"qsquish", "deprecated, use encoder private options instead", OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E}, | ||||
| {"rc_qmod_amp", "deprecated, use encoder private options instead", OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E}, | {"rc_qmod_amp", "deprecated, use encoder private options instead", OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E}, | ||||