You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/libx264: add avcintra-class
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -1745,6 +1745,10 @@ Enable calculation and printing SSIM stats after the encoding.
|
|||||||
Enable the use of Periodic Intra Refresh instead of IDR frames when set
|
Enable the use of Periodic Intra Refresh instead of IDR frames when set
|
||||||
to 1.
|
to 1.
|
||||||
|
|
||||||
|
@item avcintra-class (@emph{class})
|
||||||
|
Configure the encoder to generate AVC-Intra.
|
||||||
|
Valid values are 50,100 and 200
|
||||||
|
|
||||||
@item bluray-compat (@emph{bluray-compat})
|
@item bluray-compat (@emph{bluray-compat})
|
||||||
Configure the encoder to be compatible with the bluray standard.
|
Configure the encoder to be compatible with the bluray standard.
|
||||||
It is a shorthand for setting "bluray-compat=1 force-cfr=1".
|
It is a shorthand for setting "bluray-compat=1 force-cfr=1".
|
||||||
|
@@ -80,6 +80,7 @@ typedef struct X264Context {
|
|||||||
int slice_max_size;
|
int slice_max_size;
|
||||||
char *stats;
|
char *stats;
|
||||||
int nal_hrd;
|
int nal_hrd;
|
||||||
|
int avcintra_class;
|
||||||
char *x264_params;
|
char *x264_params;
|
||||||
} X264Context;
|
} X264Context;
|
||||||
|
|
||||||
@@ -183,6 +184,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
|||||||
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
|
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
|
||||||
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
|
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
|
||||||
X264_TYPE_AUTO;
|
X264_TYPE_AUTO;
|
||||||
|
|
||||||
|
if (x4->avcintra_class < 0) {
|
||||||
if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
|
if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
|
||||||
x4->params.b_tff = frame->top_field_first;
|
x4->params.b_tff = frame->top_field_first;
|
||||||
x264_encoder_reconfig(x4->enc, &x4->params);
|
x264_encoder_reconfig(x4->enc, &x4->params);
|
||||||
@@ -226,6 +229,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
|||||||
x4->params.rc.f_rf_constant_max = x4->crf_max;
|
x4->params.rc.f_rf_constant_max = x4->crf_max;
|
||||||
x264_encoder_reconfig(x4->enc, &x4->params);
|
x264_encoder_reconfig(x4->enc, &x4->params);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_STEREO3D);
|
side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_STEREO3D);
|
||||||
if (side_data) {
|
if (side_data) {
|
||||||
@@ -528,6 +532,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
|||||||
x4->params.b_bluray_compat = x4->bluray_compat;
|
x4->params.b_bluray_compat = x4->bluray_compat;
|
||||||
x4->params.b_vfr_input = 0;
|
x4->params.b_vfr_input = 0;
|
||||||
}
|
}
|
||||||
|
if (x4->avcintra_class >= 0)
|
||||||
|
x4->params.i_avcintra_class = x4->avcintra_class;
|
||||||
if (x4->b_bias != INT_MIN)
|
if (x4->b_bias != INT_MIN)
|
||||||
x4->params.i_bframe_bias = x4->b_bias;
|
x4->params.i_bframe_bias = x4->b_bias;
|
||||||
if (x4->b_pyramid >= 0)
|
if (x4->b_pyramid >= 0)
|
||||||
@@ -805,6 +811,7 @@ static const AVOption options[] = {
|
|||||||
{ "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" },
|
{ "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" },
|
||||||
{ "vbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
|
{ "vbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
|
||||||
{ "cbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
|
{ "cbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
|
||||||
|
{ "avcintra-class","AVC-Intra class 50/100/200", OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 200 , 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 },
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user