24#define X265_API_IMPORTS 1
44#if defined(X265_ENABLE_ALPHA) && MAX_LAYERS > 2
45#define FF_X265_MAX_LAYERS MAX_LAYERS
46#elif X265_BUILD >= 210
47#define FF_X265_MAX_LAYERS 2
49#define FF_X265_MAX_LAYERS 1
97 case NAL_UNIT_CODED_SLICE_BLA_W_LP:
98 case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
99 case NAL_UNIT_CODED_SLICE_BLA_N_LP:
100 case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
101 case NAL_UNIT_CODED_SLICE_IDR_N_LP:
102 case NAL_UNIT_CODED_SLICE_CRA:
116 for (
int i = 0;
i <
ctx->nb_rd;
i++)
117 if (!
ctx->rd[
i].in_use) {
118 ctx->rd[
i].in_use = 1;
125 memset(
tmp +
ctx->nb_rd, 0,
sizeof(*
tmp) * add);
130 idx =
ctx->nb_rd - add;
131 ctx->rd[idx].in_use = 1;
140 memset(&
ctx->rd[idx], 0,
sizeof(
ctx->rd[idx]));
147 ctx->api->param_free(
ctx->params);
150 for (
int i = 0;
i <
ctx->nb_rd;
i++)
155 ctx->api->encoder_close(
ctx->encoder);
169 if (
ctx->api->param_parse(
ctx->params,
key, buf) == X265_PARAM_BAD_VALUE) {
184 if (
ctx->api->param_parse(
ctx->params,
key, buf) == X265_PARAM_BAD_VALUE) {
196 char buf[10 * 20 +
sizeof(
"G(,)B(,)R(,)WP(,)L(,)")];
200 "G(%"PRId64
",%"PRId64
")B(%"PRId64
",%"PRId64
")R(%"PRId64
",%"PRId64
")"
201 "WP(%"PRId64
",%"PRId64
")L(%"PRId64
",%"PRId64
")",
213 if (api->param_parse(
params,
"master-display", buf) ==
214 X265_PARAM_BAD_VALUE) {
216 "Invalid value \"%s\" for param \"master-display\".\n",
259 return X265_LOG_NONE;
261 return X265_LOG_ERROR;
263 return X265_LOG_WARNING;
265 return X265_LOG_INFO;
267 return X265_LOG_DEBUG;
269 return X265_LOG_FULL;
279 ctx->api = x265_api_get(
desc->comp[0].depth);
281 ctx->api = x265_api_get(0);
283 ctx->params =
ctx->api->param_alloc();
289 if (
ctx->api->param_default_preset(
ctx->params,
ctx->preset,
ctx->tune) < 0) {
294 for (
i = 0; x265_preset_names[
i];
i++)
299 for (
i = 0; x265_tune_names[
i];
i++)
316 ctx->params->sourceWidth = avctx->
width;
317 ctx->params->sourceHeight = avctx->
height;
322 if (
ctx->params->sourceWidth < 64 ||
ctx->params->sourceHeight < 64)
323 ctx->params->maxCUSize = 32;
324 if (
ctx->params->sourceWidth < 32 ||
ctx->params->sourceHeight < 32)
325 ctx->params->maxCUSize = 16;
326 if (
ctx->params->sourceWidth < 16 ||
ctx->params->sourceHeight < 16) {
328 ctx->params->sourceWidth,
ctx->params->sourceHeight);
333 ctx->params->vui.bEnableVideoSignalTypePresentFlag = 1;
336 ctx->params->vui.bEnableVideoFullRangeFlag =
339 ctx->params->vui.bEnableVideoFullRangeFlag =
349 ctx->params->vui.bEnableColorDescriptionPresentFlag = 1;
353 ctx->params->vui.transferCharacteristics = avctx->
color_trc;
356 ctx->params->preferredTransferCharacteristics =
ctx->params->vui.transferCharacteristics;
364 ctx->params->vui.bEnableChromaLocInfoPresentFlag =
366 desc->log2_chroma_w == 1 &&
desc->log2_chroma_h == 1;
368 if (
ctx->params->vui.bEnableChromaLocInfoPresentFlag) {
369 ctx->params->vui.chromaSampleLocTypeTopField =
370 ctx->params->vui.chromaSampleLocTypeBottomField =
376 int sar_num, sar_den;
381 snprintf(sar,
sizeof(sar),
"%d:%d", sar_num, sar_den);
382 if (
ctx->api->param_parse(
ctx->params,
"sar", sar) == X265_PARAM_BAD_VALUE) {
388 switch (
desc->log2_chroma_w) {
392 if (
desc->nb_components == 1) {
393 if (
ctx->api->api_build_number < 85) {
395 "libx265 version is %d, must be at least 85 for gray encoding.\n",
396 ctx->api->api_build_number);
399 ctx->params->internalCsp = X265_CSP_I400;
406 ctx->params->vui.bEnableVideoSignalTypePresentFlag = 1;
407 ctx->params->vui.bEnableColorDescriptionPresentFlag = 1;
410 ctx->params->internalCsp = X265_CSP_I444;
414 ctx->params->internalCsp =
desc->log2_chroma_h == 1 ?
415 X265_CSP_I420 : X265_CSP_I422;
419 "Pixel format '%s' cannot be mapped to a libx265 CSP!\n",
435 if (
ctx->api->param_parse(
ctx->params,
"crf", crf) == X265_PARAM_BAD_VALUE) {
441 ctx->params->rc.rateControlMode = X265_RC_ABR;
442 }
else if (
ctx->cqp >= 0) {
448 if (avctx->
qmin >= 0) {
453 if (avctx->
qmax >= 0) {
463 if (avctx->
qblur >= 0) {
495 ctx->params->bRepeatHeaders = 1;
512 if (avctx->
refs >= 0) {
524 if (!strncmp(en->
key,
"alpha", 5)) {
525 if (
desc->nb_components == 4) {
527 "Ignoring redundant \"alpha\" option.\n");
531 "Alpha encoding was requested through an unsupported "
532 "option when no alpha plane is present\n");
536 parse_ret =
ctx->api->param_parse(
ctx->params, en->
key, en->
value);
538 case X265_PARAM_BAD_NAME:
540 "Unknown option: %s.\n", en->
key);
542 case X265_PARAM_BAD_VALUE:
544 "Invalid value for %s: %s.\n", en->
key, en->
value);
553 if (
ctx->api->param_parse(
ctx->params,
"pass",
"1") == X265_PARAM_BAD_VALUE) {
558 if (
ctx->api->param_parse(
ctx->params,
"pass",
"2") == X265_PARAM_BAD_VALUE) {
564 if (
ctx->api->param_parse(
ctx->params,
"stats",
ctx->stats) == X265_PARAM_BAD_VALUE) {
571 ctx->params->rc.vbvBufferInit == 0.9) {
576 if (
ctx->api->param_apply_profile(
ctx->params,
ctx->profile) < 0) {
580 for (
i = 0; x265_profile_names[
i];
i++)
588 ctx->dovi.logctx = avctx;
591 ctx->params->dolbyProfile =
ctx->dovi.cfg.dv_profile * 10 +
592 ctx->dovi.cfg.dv_bl_signal_compatibility_id;
595#if X265_BUILD >= 210 && FF_X265_MAX_LAYERS > 1
597 if (
ctx->api->param_parse(
ctx->params,
"alpha",
"1") < 0) {
598 av_log(avctx,
AV_LOG_ERROR,
"Loaded libx265 does not support alpha layer encoding.\n");
604 ctx->encoder =
ctx->api->encoder_open(
ctx->params);
625 "Cannot allocate HEVC header of size %d.\n", avctx->
extradata_size);
641 if (
ctx->params->rc.aqMode == X265_AQ_NONE) {
642 if (!
ctx->roi_warned) {
648 int mb_size = (
ctx->params->rc.qgSize == 8) ? 8 : 16;
649 int mbx = (
frame->width + mb_size - 1) / mb_size;
650 int mby = (
frame->height + mb_size - 1) / mb_size;
651 int qp_range = 51 + 6 * (pic->bitDepth - 8);
659 if (!roi_size || sd->
size % roi_size != 0) {
663 nb_rois = sd->
size / roi_size;
665 qoffsets =
av_calloc(mbx * mby,
sizeof(*qoffsets));
671 for (
int i = nb_rois - 1;
i >= 0;
i--) {
672 int startx, endx, starty, endy;
677 starty =
FFMIN(mby, roi->
top / mb_size);
678 endy =
FFMIN(mby, (roi->
bottom + mb_size - 1)/ mb_size);
679 startx =
FFMIN(mbx, roi->
left / mb_size);
680 endx =
FFMIN(mbx, (roi->
right + mb_size - 1)/ mb_size);
688 qoffset =
av_clipf(qoffset * qp_range, -qp_range, +qp_range);
690 for (
int y = starty; y < endy; y++)
691 for (
int x = startx; x < endx; x++)
692 qoffsets[x + y*mbx] = qoffset;
695 pic->quantOffsets = qoffsets;
703 x265_sei *
sei = &pic->userSEI;
704 for (
int i = 0;
i <
sei->numPayloads;
i++)
712 int idx = (int)(intptr_t)pic->userData - 1;
714 pic->userData =
NULL;
718 sei->numPayloads = 0;
722 const AVFrame *pic,
int *got_packet)
726 x265_picture x265pic;
728#if (X265_BUILD >= 210) && (X265_BUILD < 213)
739 ctx->api->picture_init(
ctx->params, &x265pic);
741 sei = &x265pic.userSEI;
742 sei->numPayloads = 0;
749 for (
i = 0;
i <
desc->nb_components;
i++) {
750 x265pic.planes[
i] = pic->
data[
i];
754 x265pic.pts = pic->
pts;
758 (
ctx->forced_idr ? X265_TYPE_IDR : X265_TYPE_I) :
772 rd = &
ctx->rd[rd_idx];
785 x265pic.userData = (
void*)(intptr_t)(rd_idx + 1);
794 }
else if (sei_data) {
807 sei->payloads =
ctx->sei_data;
833 sei->payloads =
ctx->sei_data;
849 if (
ctx->dovi.cfg.dv_profile && sd) {
852 &x265pic.rpu.payload,
853 &x265pic.rpu.payloadSize);
858 }
else if (
ctx->dovi.cfg.dv_profile) {
860 "without AV_FRAME_DATA_DOVI_METADATA");
867#if (X265_BUILD >= 210) && (X265_BUILD < 213)
869 x265pic_lyrptr_out[
i] = &x265pic_out[
i];
871 ret =
ctx->api->encoder_encode(
ctx->encoder, &
nal, &nnal,
872 pic ? &x265pic :
NULL, x265pic_lyrptr_out);
874 ret =
ctx->api->encoder_encode(
ctx->encoder, &
nal, &nnal,
875 pic ? &x265pic :
NULL, x265pic_out);
878 for (
i = 0;
i <
sei->numPayloads;
i++)
888 for (
i = 0;
i < nnal;
i++)
889 payload +=
nal[
i].sizeBytes;
898 for (
i = 0;
i < nnal;
i++) {
906 pkt->pts = x265pic_out->pts;
907 pkt->dts = x265pic_out->dts;
910 switch (x265pic_out->sliceType) {
928 if (x265pic_out->sliceType == X265_TYPE_B)
930 if (x265pic_out->frameData.sliceType ==
'b')
936 if (x265pic_out->userData) {
937 int idx = (int)(intptr_t)x265pic_out->userData - 1;
964#if X265_BUILD >= 210 && FF_X265_MAX_LAYERS > 1
984#if X265_BUILD >= 210 && FF_X265_MAX_LAYERS > 1
1010#if X265_BUILD >= 210 && FF_X265_MAX_LAYERS > 1
1024 if (x265_api_get(12)) {
1027 }
else if (x265_api_get(10)) {
1030 }
else if (x265_api_get(8)) {
1041#define OFFSET(x) offsetof(libx265Context, x)
1042#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
1046 {
"forced-idr",
"if forcing keyframes, force them as IDR frames",
OFFSET(forced_idr),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
VE },
1051 {
"udu_sei",
"Use user data unregistered SEI if available",
OFFSET(udu_sei),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
VE },
1053 {
"x265-params",
"set the x265 configuration using a :-separated list of key=value parameters",
OFFSET(x265_opts),
AV_OPT_TYPE_DICT, { 0 }, 0, 0,
VE },
1054#if X265_BUILD >= 167
1072 {
"keyint_min",
"-1" },
1079 {
"i_qfactor",
"-1" },
1080 {
"b_qfactor",
"-1" },
1085 .p.name =
"libx265",
1093 .p.priv_class = &
class,
1094 .p.wrapper_name =
"libx265",
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
SwsAArch64OpImplParams params
const FFCodec ff_libx265_encoder
static const FFCodecDefault defaults[]
static AVFormatContext * ctx
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.
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_default_get_supported_config(const AVCodecContext *avctx, const AVCodec *codec, enum AVCodecConfig config, unsigned flags, const void **out_configs, int *out_num_configs)
Libavcodec external API header.
refcounted data buffer API
static int FUNC metadata(CodedBitstreamContext *ctx, RWContext *rw, APVRawMetadata *current)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static int FUNC sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
static int FUNC sei_payload(CodedBitstreamContext *ctx, RWContext *rw, LCEVCRawSEI *current, int payload_size)
static int FUNC nal(CodedBitstreamContext *ctx, RWContext *rw, LCEVCRawNAL *current, int nal_unit_type)
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
void ff_dovi_ctx_unref(DOVIContext *s)
Completely reset a DOVIContext, preserving only logctx.
#define FF_DOVI_AUTOMATIC
Enable tri-state.
int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, int flags, uint8_t **out_rpu, int *out_size)
Synthesize a Dolby Vision RPU reflecting the current state.
@ FF_DOVI_WRAP_NAL
wrap inside NAL RBSP
int ff_dovi_configure(DOVIContext *s, AVCodecContext *avctx)
Variant of ff_dovi_configure_from_codedpar which infers the codec parameters from an AVCodecContext.
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
AVCPBProperties * ff_encode_add_cpb_side_data(AVCodecContext *avctx)
Add a CPB properties side data to an encoding context.
int ff_encode_add_stats_side_data(AVPacket *pkt, int quality, const int64_t error[], int error_count, enum AVPictureType pict_type)
static CheckasmStats stats
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
@ AV_OPT_TYPE_DICT
Underlying C type is AVDictionary*.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode.
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define AV_CODEC_FLAG_CLOSED_GOP
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.
#define AV_CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
#define AV_CODEC_FLAG_PSNR
error[?
#define AV_CODEC_FLAG_COPY_OPAQUE
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
@ AV_CODEC_CONFIG_PIX_FORMAT
AVPixelFormat, terminated by AV_PIX_FMT_NONE.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_PKT_FLAG_DISPOSABLE
Flag is used to indicate packets that contain frames that can be discarded by the decoder.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
Ensure dst refers to the same data as src.
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
#define AVERROR_EXTERNAL
Generic error in an external library.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
static const AVFrameSideData * av_frame_side_data_get(AVFrameSideData *const *sd, const int nb_sd, enum AVFrameSideDataType type)
Wrapper around av_frame_side_data_get_c() to workaround the limitation that for any type T the conver...
@ AV_FRAME_DATA_DOVI_METADATA
Parsed Dolby Vision metadata, suitable for passing to a software implementation.
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
@ AV_FRAME_DATA_SEI_UNREGISTERED
User data unregistered metadata associated with a video frame.
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
@ AV_FRAME_DATA_REGIONS_OF_INTEREST
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
#define AV_LOG_QUIET
Print no output.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
int av_log_get_level(void)
Get the current log level.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
#define LIBAVUTIL_VERSION_INT
common internal API header
#define FF_X265_MAX_LAYERS
static int is_keyframe(NalUnitType naltype)
static int handle_side_data(AVCodecContext *avctx, const x265_api *api, x265_param *params)
static av_cold int libx265_encode_set_roi(libx265Context *ctx, const AVFrame *frame, x265_picture *pic)
static enum AVPixelFormat x265_csp_eight[]
static int get_x265_log_level(AVCodecContext *avctx)
static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
static int rd_get(libx265Context *ctx)
static av_cold int libx265_encode_init(AVCodecContext *avctx)
static av_cold int libx265_param_parse_float(AVCodecContext *avctx, const char *key, float value)
static enum AVPixelFormat x265_csp_twelve[]
static enum AVPixelFormat x265_csp_ten[]
static av_cold int libx265_encode_close(AVCodecContext *avctx)
static const FFCodecDefault x265_defaults[]
static void rd_release(libx265Context *ctx, int idx)
static int handle_mdcv(void *logctx, const x265_api *api, x265_param *params, const AVMasteringDisplayMetadata *mdcv)
static int libx265_get_supported_config(const AVCodecContext *avctx, const AVCodec *codec, enum AVCodecConfig config, unsigned flags, const void **out, int *out_num)
static av_cold int libx265_param_parse_int(AVCodecContext *avctx, const char *key, int value)
static void free_picture(libx265Context *ctx, x265_picture *pic)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
#define AV_PIX_FMT_YUV444P12
@ AVCHROMA_LOC_UNSPECIFIED
#define AV_PIX_FMT_YUV420P10
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GBRP12
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_GRAY10
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
#define AV_PIX_FMT_YUV444P10
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
@ SEI_TYPE_USER_DATA_UNREGISTERED
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
This structure describes the bitrate properties of an encoded bitstream.
int64_t avg_bitrate
Average bitrate of the stream, in bits per second.
int64_t max_bitrate
Maximum bitrate of the stream, in bits per second.
int64_t buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int max_qdiff
maximum quantizer difference between frames
int width
picture width / height.
int rc_buffer_size
decoder bitstream buffer size
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
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...
int qmin
minimum quantizer
int keyint_min
minimum GOP size
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...
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
int64_t bit_rate
the average bitrate
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
enum AVColorSpace colorspace
YUV colorspace type.
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
int refs
number of reference frames
int64_t rc_max_rate
maximum bitrate
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
int qmax
maximum quantizer
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
int flags
AV_CODEC_FLAG_*.
AVFrameSideData ** decoded_side_data
Array containing static side data, such as HDR10 CLL / MDCV structures.
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
float qblur
amount of qscale smoothing over time (0.0-1.0)
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
int depth
Number of bits in the component.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
unsigned MaxFALL
Max average light level per frame (cd/m^2).
unsigned MaxCLL
Max content light level (cd/m^2).
Structure to hold side data for an AVFrame.
enum AVFrameSideDataType type
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void * opaque
Frame owner's private data.
AVFrameSideData ** side_data
AVBufferRef * opaque_ref
Frame owner's private data.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
int64_t duration
Duration of the frame, in the same units as pts.
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Rational number (pair of numerator and denominator).
Structure describing a single Region Of Interest.
uint32_t self_size
Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
AVRational qoffset
Quantisation offset.
int top
Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge ...
AVBufferRef * frame_opaque_ref
int roi_warned
If the encoder does not support ROI then warn the first time we encounter a frame with ROI side data.