35 #define X264_API_IMPORTS 1 119 static const int level_map[] = {
126 if (level < 0 || level > X264_LOG_DEBUG)
129 av_vlog(p, level_map[level], fmt, args);
134 const x264_nal_t *nals,
int nnal)
143 for (i = 0; i < nnal; i++)
144 size += nals[i].i_payload;
163 for (i = 0; i < nnal; i++){
164 memcpy(p, nals[i].p_payload, nals[i].i_payload);
165 p += nals[
i].i_payload;
203 x264_encoder_reconfig(x4->
enc, &x4->
params);
208 x264_encoder_reconfig(x4->
enc, &x4->
params);
215 x264_encoder_reconfig(x4->
enc, &x4->
params);
218 if (x4->
params.rc.i_rc_method == X264_RC_ABR &&
221 x264_encoder_reconfig(x4->
enc, &x4->
params);
225 x4->
params.rc.i_rc_method == X264_RC_CRF &&
226 x4->
params.rc.f_rf_constant != x4->
crf) {
228 x264_encoder_reconfig(x4->
enc, &x4->
params);
231 if (x4->
params.rc.i_rc_method == X264_RC_CQP &&
233 x4->
params.rc.i_qp_constant != x4->
cqp) {
235 x264_encoder_reconfig(x4->
enc, &x4->
params);
241 x264_encoder_reconfig(x4->
enc, &x4->
params);
250 switch (stereo->
type) {
269 #if X264_BUILD >= 145 282 "Ignoring unsupported inverted stereo value %d\n", fpa_type);
286 if (fpa_type != x4->
params.i_frame_packing) {
287 x4->
params.i_frame_packing = fpa_type;
288 x264_encoder_reconfig(x4->
enc, &x4->
params);
299 x264_picture_t pic_out = {0};
306 x264_picture_init( &x4->
pic );
308 #if X264_BUILD >= 153 309 bit_depth = x4->
params.i_bitdepth;
311 bit_depth = x264_bit_depth;
314 x4->
pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
318 for (i = 0; i < x4->
pic.img.i_plane; i++) {
323 x4->
pic.i_pts = frame->
pts;
336 : X264_TYPE_KEYFRAME;
339 x4->
pic.i_type = X264_TYPE_P;
342 x4->
pic.i_type = X264_TYPE_B;
345 x4->
pic.i_type = X264_TYPE_AUTO;
357 }
else if (sei_data) {
358 x4->
pic.extra_sei.payloads =
av_mallocz(
sizeof(x4->
pic.extra_sei.payloads[0]));
359 if (x4->
pic.extra_sei.payloads ==
NULL) {
365 x4->
pic.extra_sei.payloads[0].payload_size = sei_size;
366 x4->
pic.extra_sei.payloads[0].payload = sei_data;
367 x4->
pic.extra_sei.num_payloads = 1;
368 x4->
pic.extra_sei.payloads[0].payload_type = 4;
375 if (x4->
params.rc.i_aq_mode == X264_AQ_NONE) {
378 av_log(ctx,
AV_LOG_WARNING,
"Adaptive quantization must be enabled to use ROI encoding, skipping ROI.\n");
384 int qp_range = 51 + 6 * (bit_depth - 8);
392 if (!roi_size || sd->
size % roi_size != 0) {
396 nb_rois = sd->
size / roi_size;
404 for (
int i = nb_rois - 1; i >= 0; i--) {
405 int startx, endx, starty, endy;
421 qoffset = av_clipf(qoffset * qp_range, -qp_range, +qp_range);
423 for (
int y = starty; y < endy; y++) {
424 for (
int x = startx; x < endx; x++) {
425 qoffsets[x + y*mbx] = qoffset;
430 x4->
pic.prop.quant_offsets = qoffsets;
435 av_log(ctx,
AV_LOG_WARNING,
"interlaced_frame not supported for ROI encoding yet, skipping ROI.\n");
443 if (x264_encoder_encode(x4->
enc, &nal, &nnal, frame? &x4->
pic:
NULL, &pic_out) < 0)
449 }
while (!ret && !frame && x264_encoder_delayed_frames(x4->
enc));
454 pkt->
pts = pic_out.i_pts;
455 pkt->
dts = pic_out.i_dts;
457 out_opaque = pic_out.opaque;
467 switch (pic_out.i_type) {
483 #if FF_API_CODED_FRAME 495 #if FF_API_CODED_FRAME 515 x264_encoder_close(x4->
enc);
522 #define OPT_STR(opt, param) \ 525 if ((ret = x264_param_parse(&x4->params, opt, param)) < 0) { \ 526 if(ret == X264_PARAM_BAD_NAME) \ 527 av_log(avctx, AV_LOG_ERROR, \ 528 "bad option '%s': '%s'\n", opt, param); \ 530 av_log(avctx, AV_LOG_ERROR, \ 531 "bad value for '%s': '%s'\n", opt, param); \ 550 #if CONFIG_LIBX264RGB_ENCODER 552 return X264_CSP_BGRA;
573 #define PARSE_X264_OPT(name, var)\ 574 if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\ 575 av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\ 576 return AVERROR(EINVAL);\ 588 #if CONFIG_LIBX262_ENCODER 591 x264_param_default_mpeg2(&x4->
params);
594 x264_param_default(&x4->
params);
603 for (i = 0; x264_preset_names[
i]; i++)
607 for (i = 0; x264_tune_names[
i]; i++)
613 if (avctx->
level > 0)
617 x4->
params.p_log_private = avctx;
618 x4->
params.i_log_level = X264_LOG_DEBUG;
620 #if X264_BUILD >= 153 628 av_log(avctx,
AV_LOG_ERROR,
"bit_rate and rc_max_rate > %d000 not supported by libx264\n", INT_MAX);
632 x4->
params.rc.i_rc_method = X264_RC_ABR;
638 x4->
params.rc.b_stat_read = 1;
641 x4->
params.rc.i_rc_method = X264_RC_CRF;
643 }
else if (x4->
cqp >= 0) {
644 x4->
params.rc.i_rc_method = X264_RC_CQP;
654 x4->
params.rc.f_vbv_buffer_init =
665 #if FF_API_PRIVATE_OPT 679 #if FF_API_PRIVATE_OPT 688 if (avctx->
qmin >= 0)
690 if (avctx->
qmax >= 0)
694 if (avctx->
qblur >= 0)
698 if (avctx->
refs >= 0)
700 else if (x4->
params.i_level_idc > 0) {
703 int scale = X264_BUILD < 129 ? 384 : 1;
705 for (i = 0; i<x264_levels[
i].level_idc; i++)
707 x4->
params.i_frame_reference = av_clip(x264_levels[i].dpb / mbn / scale, 1, x4->
params.i_frame_reference);
714 #if FF_API_PRIVATE_OPT 724 #if FF_API_PRIVATE_OPT 732 #if FF_API_CODER_TYPE 766 x4->
params.b_vfr_input = 0;
769 #if X264_BUILD >= 142 773 "x264 too old for AVC Intra, at least version 142 needed\n");
775 if (x4->
b_bias != INT_MIN)
796 x264_param_apply_fastfirstpass(&x4->
params);
836 if (x264_param_apply_profile(&x4->
params, x4->
profile) < 0) {
840 for (i = 0; x264_profile_names[
i]; i++)
849 x4->
params.vui.i_sar_width = sw;
850 x4->
params.vui.i_sar_height = sh;
886 x4->
params.b_repeat_headers = 0;
891 char param[4096]={0},
val[4096]={0};
892 if(sscanf(p,
"%4095[^:=]=%4095[^:]", param,
val) == 1){
907 "Error parsing option '%s = %s'.\n",
914 x4->
params.i_bframe_pyramid ? 2 : 1 : 0;
920 x4->
enc = x264_encoder_open(&x4->
params);
929 s = x264_encoder_headers(x4->
enc, &nal, &nnal);
934 for (i = 0; i < nnal; i++) {
936 if (nal[i].i_type == NAL_SEI) {
942 memcpy(x4->
sei, nal[i].p_payload, nal[i].i_payload);
945 memcpy(p, nal[i].p_payload, nal[i].i_payload);
946 p += nal[
i].i_payload;
1004 #ifdef X264_CSP_NV21 1011 #ifdef X264_CSP_I400 1017 #if CONFIG_LIBX264RGB_ENCODER 1028 #if X264_BUILD < 153 1029 if (x264_bit_depth == 8)
1031 else if (x264_bit_depth == 9)
1033 else if (x264_bit_depth == 10)
1040 #define OFFSET(x) offsetof(X264Context, x) 1041 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM 1046 {
"fastfirstpass",
"Use fast settings when encoding first pass",
OFFSET(fastfirstpass),
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1,
VE},
1050 {
"a53cc",
"Use A53 Closed Captions (if available)",
OFFSET(a53_cc),
AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, VE},
1052 {
"crf",
"Select the quality for constant quality mode",
OFFSET(crf),
AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE },
1053 {
"crf_max",
"In CRF mode, prevents VBV from lowering quality beyond this point.",
OFFSET(crf_max),
AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE },
1054 {
"qp",
"Constant quantization parameter rate control method",
OFFSET(cqp),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE },
1057 {
"variance",
"Variance AQ (complexity mask)", 0,
AV_OPT_TYPE_CONST, {.i64 = X264_AQ_VARIANCE}, INT_MIN, INT_MAX,
VE,
"aq_mode" },
1058 {
"autovariance",
"Auto-variance AQ", 0,
AV_OPT_TYPE_CONST, {.i64 = X264_AQ_AUTOVARIANCE}, INT_MIN, INT_MAX,
VE,
"aq_mode" },
1059 #if X264_BUILD >= 144 1060 {
"autovariance-biased",
"Auto-variance AQ with bias to dark scenes", 0,
AV_OPT_TYPE_CONST, {.i64 = X264_AQ_AUTOVARIANCE_BIASED}, INT_MIN, INT_MAX,
VE,
"aq_mode" },
1062 {
"aq-strength",
"AQ strength. Reduces blocking and blurring in flat and textured areas.",
OFFSET(aq_strength),
AV_OPT_TYPE_FLOAT, {.dbl = -1}, -1, FLT_MAX, VE},
1064 {
"psy-rd",
"Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.",
OFFSET(psy_rd),
AV_OPT_TYPE_STRING, {0 }, 0, 0, VE},
1065 {
"rc-lookahead",
"Number of frames to look ahead for frametype and ratecontrol",
OFFSET(rc_lookahead),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE },
1066 {
"weightb",
"Weighted prediction for B-frames.",
OFFSET(weightb),
AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE },
1067 {
"weightp",
"Weighted prediction analysis method.",
OFFSET(weightp),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX,
VE,
"weightp" },
1072 {
"intra-refresh",
"Use Periodic Intra Refresh instead of IDR frames.",
OFFSET(intra_refresh),
AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE },
1073 {
"bluray-compat",
"Bluray compatibility workarounds.",
OFFSET(bluray_compat) ,
AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE },
1074 {
"b-bias",
"Influences how often B-frames are used",
OFFSET(b_bias),
AV_OPT_TYPE_INT, { .i64 = INT_MIN}, INT_MIN, INT_MAX, VE },
1075 {
"b-pyramid",
"Keep some B-frames as references.",
OFFSET(b_pyramid),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX,
VE,
"b_pyramid" },
1077 {
"strict",
"Strictly hierarchical pyramid", 0,
AV_OPT_TYPE_CONST, {.i64 = X264_B_PYRAMID_STRICT}, INT_MIN, INT_MAX,
VE,
"b_pyramid" },
1078 {
"normal",
"Non-strict (not Blu-ray compatible)", 0,
AV_OPT_TYPE_CONST, {.i64 = X264_B_PYRAMID_NORMAL}, INT_MIN, INT_MAX,
VE,
"b_pyramid" },
1079 {
"mixed-refs",
"One reference per partition, as opposed to one reference per macroblock",
OFFSET(mixed_refs),
AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, VE },
1083 {
"mbtree",
"Use macroblock tree ratecontrol.",
OFFSET(mbtree),
AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE},
1084 {
"deblock",
"Loop filter parameters, in <alpha:beta> form.",
OFFSET(deblock),
AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
1085 {
"cplxblur",
"Reduce fluctuations in QP (before curve compression)",
OFFSET(cplxblur),
AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, VE},
1086 {
"partitions",
"A comma-separated list of partitions to consider. " 1087 "Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all",
OFFSET(partitions),
AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
1088 {
"direct-pred",
"Direct MV prediction mode",
OFFSET(direct_pred),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX,
VE,
"direct-pred" },
1093 {
"slice-max-size",
"Limit the size of each slice in bytes",
OFFSET(slice_max_size),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE },
1095 {
"nal-hrd",
"Signal HRD information (requires vbv-bufsize; " 1100 {
"avcintra-class",
"AVC-Intra class 50/100/200",
OFFSET(avcintra_class),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 200 , VE},
1101 {
"me_method",
"Set motion estimation method",
OFFSET(motion_est),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA,
VE,
"motion-est"},
1102 {
"motion-est",
"Set motion estimation method",
OFFSET(motion_est),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA,
VE,
"motion-est"},
1108 {
"forced-idr",
"If forcing keyframes, force them as IDR frames.",
OFFSET(forced_idr),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, -1, 1, VE },
1115 {
"b_strategy",
"Strategy to choose between I/P/B-frames",
OFFSET(b_frame_strategy),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 2, VE },
1116 {
"chromaoffset",
"QP difference between chroma and luma",
OFFSET(chroma_offset),
AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE },
1117 {
"sc_threshold",
"Scene change threshold",
OFFSET(scenechange_threshold),
AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE },
1118 {
"noise_reduction",
"Noise reduction",
OFFSET(noise_reduction),
AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE },
1120 {
"x264-params",
"Override the x264 configuration using a :-separated list of key=value parameters",
OFFSET(x264_params),
AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
1129 {
"i_qfactor",
"-1" },
1130 {
"b_qfactor",
"-1" },
1138 #if FF_API_PRIVATE_OPT 1139 {
"sc_threshold",
"-1" },
1141 {
"trellis",
"-1" },
1142 #if FF_API_PRIVATE_OPT 1145 {
"me_range",
"-1" },
1147 #if FF_API_PRIVATE_OPT 1148 {
"b_strategy",
"-1" },
1150 {
"keyint_min",
"-1" },
1151 #if FF_API_CODER_TYPE 1156 {
"thread_type",
"0" },
1157 {
"flags",
"+cgop" },
1158 {
"rc_init_occupancy",
"-1" },
1162 #if CONFIG_LIBX264_ENCODER 1163 static const AVClass x264_class = {
1181 .priv_class = &x264_class,
1184 #
if X264_BUILD >= 158
1189 .wrapper_name =
"libx264",
1193 #if CONFIG_LIBX264RGB_ENCODER 1194 static const AVClass rgbclass = {
1202 .
name =
"libx264rgb",
1212 .priv_class = &rgbclass,
1215 #
if X264_BUILD >= 158
1220 .wrapper_name =
"libx264",
1224 #if CONFIG_LIBX262_ENCODER 1225 static const AVClass X262_class = {
1243 .priv_class = &X262_class,
1247 .wrapper_name =
"libx264",
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define FF_PROFILE_H264_MAIN
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
static enum AVPixelFormat pix_fmt
int top
Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge ...
static int avfmt2_num_planes(int avfmt)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type)
#define AV_CODEC_FLAG_INTERLACED_DCT
Use interlaced DCT.
#define AV_CODEC_FLAG_LOOP_FILTER
loop filter.
float qblur
amount of qscale smoothing over time (0.0-1.0)
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t bit_rate
the average bitrate
#define LIBAVUTIL_VERSION_INT
packed RGB 8:8:8, 24bpp, RGBRGB...
Memory handling functions.
static av_cold int init(AVCodecContext *avctx)
int max_bitrate
Maximum bitrate of the stream, in bits per second.
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
AVCodec ff_libx262_encoder
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
const char * av_default_item_name(void *ptr)
Return the context name.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int next_reordered_opaque
static void X264_log(void *p, int level, const char *fmt, va_list args)
Views are next to each other.
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
static av_cold int X264_init(AVCodecContext *avctx)
int roi_warned
If the encoder does not support ROI then warn the first time we encounter a frame with ROI side data...
AVRational qoffset
Quantisation offset.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define AV_PIX_FMT_GRAY10
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This codec takes the reordered_opaque field from input AVFrames and returns it in the corresponding f...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
#define FF_PROFILE_H264_BASELINE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
int me_range
maximum motion estimation search range in subpel units If 0 then no limit.
float b_quant_factor
qscale factor between IP and B-frames If > 0 then the last P-frame quantizer will be used (q= lastp_q...
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int me_cmp
motion estimation comparison function
Structure to hold side data for an AVFrame.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
int interlaced_frame
The content of the picture is interlaced.
Video is not stereoscopic (and metadata has to be there).
int buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
uint32_t self_size
Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
static enum AVPixelFormat pix_fmts_all[]
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define i(width, name, range_min, range_max)
static enum AVPixelFormat pix_fmts_10bit[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int has_b_frames
Size of the frame reordering buffer in the decoder.
int flags
Additional information about the frame packing.
static void dct8x8(int16_t *coef, int bit_depth)
int qmax
maximum quantizer
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Views are packed per line, as if interlaced.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_vlog(void *avcl, int level, const char *fmt, va_list vl)
Send the specified message to the log if the level is less than or equal to the current av_log_level...
#define FF_PROFILE_H264_HIGH_422
#define FF_PROFILE_H264_HIGH
int flags
AV_CODEC_FLAG_*.
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * name
Name of the codec implementation.
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
#define AV_PIX_FMT_YUV444P10
static const AVCodecDefault defaults[]
int flags
A combination of AV_PKT_FLAG values.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int rc_buffer_size
decoder bitstream buffer size
Views are alternated temporally.
common internal API header
as above, but U and V bytes are swapped
int refs
number of reference frames
X264Opaque * reordered_opaque
static enum AVPixelFormat pix_fmts_9bit[]
#define PARSE_X264_OPT(name, var)
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
enum AVPictureType pict_type
Picture type of the frame.
#define OPT_STR(opt, param)
AVDictionary * x264_params
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
int width
picture width / height.
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
static av_cold void init_static_data(void)
attribute_deprecated int noise_reduction
#define AV_CODEC_FLAG_PSNR
error[?] variables will be set during encoding.
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
static void stats(AVPacket *const *in, int n_in, unsigned *_max, unsigned *_sum)
#define FF_THREAD_SLICE
Decode more than one part of a single frame at once.
int quality
quality (between 1 (good) and FF_LAMBDA_MAX (bad))
Structure describing a single Region Of Interest.
int scenechange_threshold
int64_t reordered_opaque
opaque 64-bit number (generally a PTS) that will be reordered and output in AVFrame.reordered_opaque
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
packed RGB 8:8:8, 24bpp, BGRBGR...
int max_qdiff
maximum quantizer difference between frames
#define AV_PIX_FMT_YUV444P9
attribute_deprecated int coder_type
preferred ID for MPEG-1/2 video decoding
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
the normal 2^n-1 "JPEG" YUV ranges
static enum AVPixelFormat pix_fmts_8bit[]
int64_t av_gettime(void)
Get the current time in microseconds.
static const AVCodecDefault x264_defaults[]
This structure describes the bitrate properties of an encoded bitstream.
enum AVStereo3DType type
How views are packed within the video.
#define AV_LOG_INFO
Standard information.
Views are packed in a checkerboard-like structure per pixel.
char * av_strdup(const char *s)
Duplicate a string.
Libavcodec external API header.
Views are on top of each other.
static av_cold int X264_close(AVCodecContext *avctx)
attribute_deprecated int scenechange_threshold
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
attribute_deprecated int b_frame_strategy
main external API structure.
static const AVOption options[]
int qmin
minimum quantizer
#define AV_PIX_FMT_YUV420P10
static int FUNC() aud(CodedBitstreamContext *ctx, RWContext *rw, H264RawAUD *current)
int64_t reordered_opaque
reordered opaque 64 bits (generally an integer or a double precision float PTS but can be anything)...
Describe the class of an AVClass context structure.
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, const x264_nal_t *nals, int nnal)
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
#define FF_PROFILE_H264_HIGH_444
#define AV_PIX_FMT_YUV420P9
attribute_deprecated int chromaoffset
#define AV_CODEC_EXPORT_DATA_PRFT
Export encoder Producer Reference Time through packet side data.
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
static void reconfig_encoder(AVCodecContext *ctx, const AVFrame *frame)
static enum AVPixelFormat pix_fmts[]
int global_quality
Global quality for codecs which cannot change it per frame.
#define AV_PIX_FMT_YUV422P10
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define AV_CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
static av_cold void X264_init_static(AVCodec *codec)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
Views are packed per column.
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int trellis
trellis RD quantization
AVCPBProperties * ff_add_cpb_side_data(AVCodecContext *avctx)
Add a CPB properties side data to an encoding context.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
#define AV_CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode.
int slices
Number of slices.
#define FF_ENABLE_DEPRECATION_WARNINGS
int top_field_first
If the content is interlaced, is top field displayed first.
int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp)
int avg_bitrate
Average bitrate of the stream, in bits per second.
AVCodec ff_libx264rgb_encoder
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
AVCodec ff_libx264_encoder
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
int ff_alloc_a53_sei(const AVFrame *frame, size_t prefix_len, void **data, size_t *sei_size)
Check AVFrame for A53 side data and allocate and fill SEI message with A53 info.
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
#define av_malloc_array(a, b)
#define AV_CODEC_FLAG_CLOSED_GOP
int depth
Number of bits in the component.
#define FF_PROFILE_H264_HIGH_10
Stereoscopic 3d metadata.
#define AVERROR_EXTERNAL
Generic error in an external library.
AVPixelFormat
Pixel format.
static double val(void *priv, double ch)
This structure stores compressed data.
int me_subpel_quality
subpel ME quality
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int thread_type
Which multithreading methods to use.
int64_t rc_max_rate
maximum bitrate
simple arithmetic expression evaluator
#define AV_CEIL_RSHIFT(a, b)
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
int keyint_min
minimum GOP size