forked from FFmpeg/FFmpeg
Merge commit '0e6c8532215790bbe560a9eea4f3cc82bb55cf92'
* commit '0e6c8532215790bbe560a9eea4f3cc82bb55cf92' lavc: Move b_frame_strategy and b_sensitivity to codec private options Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
commit
2e9b995e4f
12 changed files with 73 additions and 19 deletions
|
@ -1823,7 +1823,11 @@ typedef struct AVCodecContext {
|
||||||
#define FF_RC_STRATEGY_XVID 1
|
#define FF_RC_STRATEGY_XVID 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
|
/** @deprecated use encoder private options instead */
|
||||||
|
attribute_deprecated
|
||||||
int b_frame_strategy;
|
int b_frame_strategy;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qscale offset between IP and B-frames
|
* qscale offset between IP and B-frames
|
||||||
|
@ -2230,12 +2234,11 @@ typedef struct AVCodecContext {
|
||||||
*/
|
*/
|
||||||
int mv0_threshold;
|
int mv0_threshold;
|
||||||
|
|
||||||
/**
|
#if FF_API_PRIVATE_OPT
|
||||||
* Adjust sensitivity of b_frame_strategy 1.
|
/** @deprecated use encoder private options instead */
|
||||||
* - encoding: Set by user.
|
attribute_deprecated
|
||||||
* - decoding: unused
|
|
||||||
*/
|
|
||||||
int b_sensitivity;
|
int b_sensitivity;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chromaticity coordinates of the source primaries.
|
* Chromaticity coordinates of the source primaries.
|
||||||
|
|
|
@ -86,6 +86,7 @@ typedef struct X264Context {
|
||||||
int forced_idr;
|
int forced_idr;
|
||||||
int coder;
|
int coder;
|
||||||
int a53_cc;
|
int a53_cc;
|
||||||
|
int b_frame_strategy;
|
||||||
|
|
||||||
char *x264_params;
|
char *x264_params;
|
||||||
} X264Context;
|
} X264Context;
|
||||||
|
@ -580,8 +581,12 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
||||||
x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
|
x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
|
||||||
if (avctx->me_subpel_quality >= 0)
|
if (avctx->me_subpel_quality >= 0)
|
||||||
x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
|
x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
if (avctx->b_frame_strategy >= 0)
|
if (avctx->b_frame_strategy >= 0)
|
||||||
x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
|
x4->b_frame_strategy = avctx->b_frame_strategy;
|
||||||
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
#endif
|
||||||
if (avctx->keyint_min >= 0)
|
if (avctx->keyint_min >= 0)
|
||||||
x4->params.i_keyint_min = avctx->keyint_min;
|
x4->params.i_keyint_min = avctx->keyint_min;
|
||||||
#if FF_API_CODER_TYPE
|
#if FF_API_CODER_TYPE
|
||||||
|
@ -710,6 +715,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
if (x4->coder >= 0)
|
if (x4->coder >= 0)
|
||||||
x4->params.b_cabac = x4->coder;
|
x4->params.b_cabac = x4->coder;
|
||||||
|
|
||||||
|
if (x4->b_frame_strategy >= 0)
|
||||||
|
x4->params.i_bframe_adaptive = x4->b_frame_strategy;
|
||||||
|
|
||||||
if (x4->profile)
|
if (x4->profile)
|
||||||
if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
|
if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
|
||||||
int i;
|
int i;
|
||||||
|
@ -955,6 +963,7 @@ static const AVOption options[] = {
|
||||||
{ "cabac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "coder" },
|
{ "cabac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "coder" },
|
||||||
{ "vlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "coder" },
|
{ "vlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "coder" },
|
||||||
{ "ac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "coder" },
|
{ "ac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "coder" },
|
||||||
|
{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 2, VE },
|
||||||
|
|
||||||
{ "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
|
{ "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
|
@ -982,7 +991,9 @@ static const AVCodecDefault x264_defaults[] = {
|
||||||
{ "me_method", "-1" },
|
{ "me_method", "-1" },
|
||||||
#endif
|
#endif
|
||||||
{ "subq", "-1" },
|
{ "subq", "-1" },
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
{ "b_strategy", "-1" },
|
{ "b_strategy", "-1" },
|
||||||
|
#endif
|
||||||
{ "keyint_min", "-1" },
|
{ "keyint_min", "-1" },
|
||||||
#if FF_API_CODER_TYPE
|
#if FF_API_CODER_TYPE
|
||||||
{ "coder", "-1" },
|
{ "coder", "-1" },
|
||||||
|
|
|
@ -56,6 +56,7 @@ typedef struct XavsContext {
|
||||||
int motion_est;
|
int motion_est;
|
||||||
int mbtree;
|
int mbtree;
|
||||||
int mixed_refs;
|
int mixed_refs;
|
||||||
|
int b_frame_strategy;
|
||||||
|
|
||||||
int64_t *pts_buffer;
|
int64_t *pts_buffer;
|
||||||
int out_frame_count;
|
int out_frame_count;
|
||||||
|
@ -309,7 +310,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
/* cabac is not included in AVS JiZhun Profile */
|
/* cabac is not included in AVS JiZhun Profile */
|
||||||
x4->params.b_cabac = 0;
|
x4->params.b_cabac = 0;
|
||||||
|
|
||||||
x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
|
#if FF_API_PRIVATE_OPT
|
||||||
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
if (avctx->b_frame_strategy)
|
||||||
|
x4->b_frame_strategy = avctx->b_frame_strategy;
|
||||||
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
x4->params.i_bframe_adaptive = x4->b_frame_strategy;
|
||||||
|
|
||||||
avctx->has_b_frames = !!avctx->max_b_frames;
|
avctx->has_b_frames = !!avctx->max_b_frames;
|
||||||
|
|
||||||
|
@ -437,6 +445,7 @@ static const AVOption options[] = {
|
||||||
{ "umh", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_UMH }, INT_MIN, INT_MAX, VE, "motion-est" },
|
{ "umh", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_UMH }, INT_MIN, INT_MAX, VE, "motion-est" },
|
||||||
{ "esa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_ESA }, INT_MIN, INT_MAX, VE, "motion-est" },
|
{ "esa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_ESA }, INT_MIN, INT_MAX, VE, "motion-est" },
|
||||||
{ "tesa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_TESA }, INT_MIN, INT_MAX, VE, "motion-est" },
|
{ "tesa", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = XAVS_ME_TESA }, INT_MIN, INT_MAX, VE, "motion-est" },
|
||||||
|
{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, VE},
|
||||||
|
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
|
@ -547,6 +547,8 @@ typedef struct MpegEncContext {
|
||||||
|
|
||||||
/* temporary frames used by b_frame_strategy = 2 */
|
/* temporary frames used by b_frame_strategy = 2 */
|
||||||
AVFrame *tmp_frames[MAX_B_FRAMES + 2];
|
AVFrame *tmp_frames[MAX_B_FRAMES + 2];
|
||||||
|
int b_frame_strategy;
|
||||||
|
int b_sensitivity;
|
||||||
} MpegEncContext;
|
} MpegEncContext;
|
||||||
|
|
||||||
/* mpegvideo_enc common options */
|
/* mpegvideo_enc common options */
|
||||||
|
@ -606,6 +608,8 @@ enum rc_strategy {
|
||||||
{ "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
|
{ "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
|
||||||
{ "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
|
{ "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, "motion_est" }, \
|
||||||
{ "force_duplicated_matrix", "Always write luma and chroma matrix for mjpeg, useful for rtp streaming.", FF_MPV_OFFSET(force_duplicated_matrix), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \
|
{ "force_duplicated_matrix", "Always write luma and chroma matrix for mjpeg, useful for rtp streaming.", FF_MPV_OFFSET(force_duplicated_matrix), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \
|
||||||
|
{"b_strategy", "Strategy to choose between I/P/B-frames", FF_MPV_OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, FF_MPV_OPT_FLAGS }, \
|
||||||
|
{"b_sensitivity", "Adjust sensitivity of b_frame_strategy 1", FF_MPV_OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, FF_MPV_OPT_FLAGS }, \
|
||||||
|
|
||||||
extern const AVOption ff_mpv_generic_options[];
|
extern const AVOption ff_mpv_generic_options[];
|
||||||
|
|
||||||
|
|
|
@ -681,10 +681,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->b_frame_strategy && (avctx->flags & AV_CODEC_FLAG_PASS2)) {
|
#if FF_API_PRIVATE_OPT
|
||||||
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
if (avctx->b_frame_strategy)
|
||||||
|
s->b_frame_strategy = avctx->b_frame_strategy;
|
||||||
|
if (avctx->b_sensitivity != 40)
|
||||||
|
s->b_sensitivity = avctx->b_sensitivity;
|
||||||
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (s->b_frame_strategy && (avctx->flags & AV_CODEC_FLAG_PASS2)) {
|
||||||
av_log(avctx, AV_LOG_INFO,
|
av_log(avctx, AV_LOG_INFO,
|
||||||
"notice: b_frame_strategy only affects the first pass\n");
|
"notice: b_frame_strategy only affects the first pass\n");
|
||||||
avctx->b_frame_strategy = 0;
|
s->b_frame_strategy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = av_gcd(avctx->time_base.den, avctx->time_base.num);
|
i = av_gcd(avctx->time_base.den, avctx->time_base.num);
|
||||||
|
@ -1022,7 +1031,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (avctx->b_frame_strategy == 2) {
|
if (s->b_frame_strategy == 2) {
|
||||||
for (i = 0; i < s->max_b_frames + 2; i++) {
|
for (i = 0; i < s->max_b_frames + 2; i++) {
|
||||||
s->tmp_frames[i] = av_frame_alloc();
|
s->tmp_frames[i] = av_frame_alloc();
|
||||||
if (!s->tmp_frames[i])
|
if (!s->tmp_frames[i])
|
||||||
|
@ -1489,7 +1498,7 @@ static int select_input_picture(MpegEncContext *s)
|
||||||
s->reordered_input_picture[0]->f->coded_picture_number =
|
s->reordered_input_picture[0]->f->coded_picture_number =
|
||||||
s->coded_picture_number++;
|
s->coded_picture_number++;
|
||||||
} else {
|
} else {
|
||||||
int b_frames;
|
int b_frames = 0;
|
||||||
|
|
||||||
if (s->avctx->flags & AV_CODEC_FLAG_PASS2) {
|
if (s->avctx->flags & AV_CODEC_FLAG_PASS2) {
|
||||||
for (i = 0; i < s->max_b_frames + 1; i++) {
|
for (i = 0; i < s->max_b_frames + 1; i++) {
|
||||||
|
@ -1507,11 +1516,11 @@ static int select_input_picture(MpegEncContext *s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->avctx->b_frame_strategy == 0) {
|
if (s->b_frame_strategy == 0) {
|
||||||
b_frames = s->max_b_frames;
|
b_frames = s->max_b_frames;
|
||||||
while (b_frames && !s->input_picture[b_frames])
|
while (b_frames && !s->input_picture[b_frames])
|
||||||
b_frames--;
|
b_frames--;
|
||||||
} else if (s->avctx->b_frame_strategy == 1) {
|
} else if (s->b_frame_strategy == 1) {
|
||||||
for (i = 1; i < s->max_b_frames + 1; i++) {
|
for (i = 1; i < s->max_b_frames + 1; i++) {
|
||||||
if (s->input_picture[i] &&
|
if (s->input_picture[i] &&
|
||||||
s->input_picture[i]->b_frame_score == 0) {
|
s->input_picture[i]->b_frame_score == 0) {
|
||||||
|
@ -1525,7 +1534,7 @@ static int select_input_picture(MpegEncContext *s)
|
||||||
for (i = 0; i < s->max_b_frames + 1; i++) {
|
for (i = 0; i < s->max_b_frames + 1; i++) {
|
||||||
if (!s->input_picture[i] ||
|
if (!s->input_picture[i] ||
|
||||||
s->input_picture[i]->b_frame_score - 1 >
|
s->input_picture[i]->b_frame_score - 1 >
|
||||||
s->mb_num / s->avctx->b_sensitivity)
|
s->mb_num / s->b_sensitivity)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1535,11 +1544,8 @@ static int select_input_picture(MpegEncContext *s)
|
||||||
for (i = 0; i < b_frames + 1; i++) {
|
for (i = 0; i < b_frames + 1; i++) {
|
||||||
s->input_picture[i]->b_frame_score = 0;
|
s->input_picture[i]->b_frame_score = 0;
|
||||||
}
|
}
|
||||||
} else if (s->avctx->b_frame_strategy == 2) {
|
} else if (s->b_frame_strategy == 2) {
|
||||||
b_frames = estimate_best_b_count(s);
|
b_frames = estimate_best_b_count(s);
|
||||||
} else {
|
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "illegal b frame strategy\n");
|
|
||||||
b_frames = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
emms_c();
|
emms_c();
|
||||||
|
|
|
@ -125,7 +125,9 @@ static const AVOption avcodec_options[] = {
|
||||||
#if FF_API_RC_STRATEGY
|
#if FF_API_RC_STRATEGY
|
||||||
{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
||||||
#endif
|
#endif
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, V|E},
|
{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, V|E},
|
||||||
|
#endif
|
||||||
{"ps", "RTP payload size in bytes", OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
{"ps", "RTP payload size in bytes", OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
||||||
#if FF_API_STAT_BITS
|
#if FF_API_STAT_BITS
|
||||||
{"mv_bits", NULL, OFFSET(mv_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
{"mv_bits", NULL, OFFSET(mv_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
||||||
|
@ -410,7 +412,9 @@ static const AVOption avcodec_options[] = {
|
||||||
{"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.i64 = 6 }, 0, INT_MAX, V|E},
|
{"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.i64 = 6 }, 0, INT_MAX, V|E},
|
||||||
#endif /* FF_API_UNUSED_MEMBERS */
|
#endif /* FF_API_UNUSED_MEMBERS */
|
||||||
{"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.i64 = 256 }, 0, INT_MAX, V|E},
|
{"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.i64 = 256 }, 0, INT_MAX, V|E},
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
{"b_sensitivity", "adjust sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, V|E},
|
{"b_sensitivity", "adjust sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, V|E},
|
||||||
|
#endif
|
||||||
{"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.i64 = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E},
|
{"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.i64 = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E},
|
||||||
{"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
|
{"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
|
||||||
{"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
|
{"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, {.i64 = -1 }, INT_MIN, INT_MAX, A|E},
|
||||||
|
|
|
@ -514,8 +514,14 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if QSV_HAVE_BREF_TYPE
|
#if QSV_HAVE_BREF_TYPE
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
if (avctx->b_frame_strategy >= 0)
|
if (avctx->b_frame_strategy >= 0)
|
||||||
q->extco2.BRefType = avctx->b_frame_strategy ? MFX_B_REF_PYRAMID : MFX_B_REF_OFF;
|
q->b_strategy = avctx->b_frame_strategy;
|
||||||
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
#endif
|
||||||
|
if (q->extco2.b_strategy >= 0)
|
||||||
|
q->extco2.BRefType = q->b_strategy ? MFX_B_REF_PYRAMID : MFX_B_REF_OFF;
|
||||||
if (q->adaptive_i >= 0)
|
if (q->adaptive_i >= 0)
|
||||||
q->extco2.AdaptiveI = q->adaptive_i ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
|
q->extco2.AdaptiveI = q->adaptive_i ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
|
||||||
if (q->adaptive_b >= 0)
|
if (q->adaptive_b >= 0)
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
{ "extbrc", "Extended bitrate control", OFFSET(qsv.extbrc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
{ "extbrc", "Extended bitrate control", OFFSET(qsv.extbrc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
||||||
{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
||||||
{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
||||||
|
{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
||||||
|
|
||||||
typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
|
typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
|
||||||
const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);
|
const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);
|
||||||
|
@ -127,6 +128,7 @@ typedef struct QSVEncContext {
|
||||||
int extbrc;
|
int extbrc;
|
||||||
int adaptive_i;
|
int adaptive_i;
|
||||||
int adaptive_b;
|
int adaptive_b;
|
||||||
|
int b_strategy;
|
||||||
|
|
||||||
int int_ref_type;
|
int int_ref_type;
|
||||||
int int_ref_cycle_size;
|
int int_ref_cycle_size;
|
||||||
|
|
|
@ -188,7 +188,9 @@ static const AVCodecDefault qsv_enc_defaults[] = {
|
||||||
{ "coder", "ac" },
|
{ "coder", "ac" },
|
||||||
|
|
||||||
{ "flags", "+cgop" },
|
{ "flags", "+cgop" },
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
{ "b_strategy", "-1" },
|
{ "b_strategy", "-1" },
|
||||||
|
#endif
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,9 @@ static const AVCodecDefault qsv_enc_defaults[] = {
|
||||||
{ "bf", "8" },
|
{ "bf", "8" },
|
||||||
|
|
||||||
{ "flags", "+cgop" },
|
{ "flags", "+cgop" },
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
{ "b_strategy", "-1" },
|
{ "b_strategy", "-1" },
|
||||||
|
#endif
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,9 @@ static const AVCodecDefault qsv_enc_defaults[] = {
|
||||||
{ "bf", "3" },
|
{ "bf", "3" },
|
||||||
|
|
||||||
{ "flags", "+cgop" },
|
{ "flags", "+cgop" },
|
||||||
|
#if FF_API_PRIVATE_OPT
|
||||||
{ "b_strategy", "-1" },
|
{ "b_strategy", "-1" },
|
||||||
|
#endif
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -208,5 +208,8 @@
|
||||||
#ifndef FF_API_STAT_BITS
|
#ifndef FF_API_STAT_BITS
|
||||||
#define FF_API_STAT_BITS (LIBAVCODEC_VERSION_MAJOR < 59)
|
#define FF_API_STAT_BITS (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef FF_API_PRIVATE_OPT
|
||||||
|
#define FF_API_PRIVATE_OPT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* AVCODEC_VERSION_H */
|
#endif /* AVCODEC_VERSION_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue