Go to the documentation of this file.
24 #define X265_API_IMPORTS 1
85 case NAL_UNIT_CODED_SLICE_BLA_W_LP:
86 case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
87 case NAL_UNIT_CODED_SLICE_BLA_N_LP:
88 case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
89 case NAL_UNIT_CODED_SLICE_IDR_N_LP:
90 case NAL_UNIT_CODED_SLICE_CRA:
104 for (
int i = 0;
i <
ctx->nb_rd;
i++)
105 if (!
ctx->rd[
i].in_use) {
106 ctx->rd[
i].in_use = 1;
113 memset(
tmp +
ctx->nb_rd, 0,
sizeof(*
tmp) * add);
118 idx =
ctx->nb_rd - add;
119 ctx->rd[idx].in_use = 1;
128 memset(&
ctx->rd[idx], 0,
sizeof(
ctx->rd[idx]));
135 ctx->api->param_free(
ctx->params);
138 for (
int i = 0;
i <
ctx->nb_rd;
i++)
143 ctx->api->encoder_close(
ctx->encoder);
155 if (
ctx->api->param_parse(
ctx->params,
key, buf) == X265_PARAM_BAD_VALUE) {
170 if (
ctx->api->param_parse(
ctx->params,
key, buf) == X265_PARAM_BAD_VALUE) {
182 char buf[10 * 20 +
sizeof(
"G(,)B(,)R(,)WP(,)L(,)")];
186 "G(%"PRId64
",%"PRId64
")B(%"PRId64
",%"PRId64
")R(%"PRId64
",%"PRId64
")"
187 "WP(%"PRId64
",%"PRId64
")L(%"PRId64
",%"PRId64
")",
199 if (api->param_parse(params,
"master-display", buf) ==
200 X265_PARAM_BAD_VALUE) {
202 "Invalid value \"%s\" for param \"master-display\".\n",
225 params->maxCLL = cll->
MaxCLL;
226 params->maxFALL = cll->
MaxFALL;
247 ctx->api = x265_api_get(
desc->comp[0].depth);
249 ctx->api = x265_api_get(0);
251 ctx->params =
ctx->api->param_alloc();
257 if (
ctx->api->param_default_preset(
ctx->params,
ctx->preset,
ctx->tune) < 0) {
262 for (
i = 0; x265_preset_names[
i];
i++)
267 for (
i = 0; x265_tune_names[
i];
i++)
283 #if FF_API_TICKS_PER_FRAME
289 ctx->params->sourceWidth = avctx->
width;
290 ctx->params->sourceHeight = avctx->
height;
295 if (
ctx->params->sourceWidth < 64 ||
ctx->params->sourceHeight < 64)
296 ctx->params->maxCUSize = 32;
297 if (
ctx->params->sourceWidth < 32 ||
ctx->params->sourceHeight < 32)
298 ctx->params->maxCUSize = 16;
299 if (
ctx->params->sourceWidth < 16 ||
ctx->params->sourceHeight < 16) {
301 ctx->params->sourceWidth,
ctx->params->sourceHeight);
306 ctx->params->vui.bEnableVideoSignalTypePresentFlag = 1;
309 ctx->params->vui.bEnableVideoFullRangeFlag =
312 ctx->params->vui.bEnableVideoFullRangeFlag =
325 ctx->params->vui.bEnableColorDescriptionPresentFlag = 1;
329 ctx->params->vui.transferCharacteristics = avctx->
color_trc;
330 #if X265_BUILD >= 159
332 ctx->params->preferredTransferCharacteristics =
ctx->params->vui.transferCharacteristics;
340 ctx->params->vui.bEnableChromaLocInfoPresentFlag =
342 desc->log2_chroma_w == 1 &&
desc->log2_chroma_h == 1;
344 if (
ctx->params->vui.bEnableChromaLocInfoPresentFlag) {
345 ctx->params->vui.chromaSampleLocTypeTopField =
346 ctx->params->vui.chromaSampleLocTypeBottomField =
352 int sar_num, sar_den;
357 snprintf(sar,
sizeof(sar),
"%d:%d", sar_num, sar_den);
358 if (
ctx->api->param_parse(
ctx->params,
"sar", sar) == X265_PARAM_BAD_VALUE) {
364 switch (
desc->log2_chroma_w) {
368 if (
desc->nb_components == 1) {
369 if (
ctx->api->api_build_number < 85) {
371 "libx265 version is %d, must be at least 85 for gray encoding.\n",
372 ctx->api->api_build_number);
375 ctx->params->internalCsp = X265_CSP_I400;
382 ctx->params->vui.bEnableVideoSignalTypePresentFlag = 1;
383 ctx->params->vui.bEnableColorDescriptionPresentFlag = 1;
386 ctx->params->internalCsp = X265_CSP_I444;
390 ctx->params->internalCsp =
desc->log2_chroma_h == 1 ?
391 X265_CSP_I420 : X265_CSP_I422;
395 "Pixel format '%s' cannot be mapped to a libx265 CSP!\n",
411 if (
ctx->api->param_parse(
ctx->params,
"crf", crf) == X265_PARAM_BAD_VALUE) {
417 ctx->params->rc.rateControlMode = X265_RC_ABR;
418 }
else if (
ctx->cqp >= 0) {
424 if (avctx->
qmin >= 0) {
429 if (avctx->
qmax >= 0) {
439 if (avctx->
qblur >= 0) {
471 ctx->params->bRepeatHeaders = 1;
488 if (avctx->
refs >= 0) {
497 int parse_ret =
ctx->api->param_parse(
ctx->params, en->
key, en->
value);
500 case X265_PARAM_BAD_NAME:
502 "Unknown option: %s.\n", en->
key);
504 case X265_PARAM_BAD_VALUE:
506 "Invalid value for %s: %s.\n", en->
key, en->
value);
515 ctx->params->rc.vbvBufferInit == 0.9) {
520 if (
ctx->api->param_apply_profile(
ctx->params,
ctx->profile) < 0) {
524 for (
i = 0; x265_profile_names[
i];
i++)
531 ctx->encoder =
ctx->api->encoder_open(
ctx->params);
552 "Cannot allocate HEVC header of size %d.\n", avctx->
extradata_size);
568 if (
ctx->params->rc.aqMode == X265_AQ_NONE) {
569 if (!
ctx->roi_warned) {
575 int mb_size = (
ctx->params->rc.qgSize == 8) ? 8 : 16;
576 int mbx = (
frame->
width + mb_size - 1) / mb_size;
578 int qp_range = 51 + 6 * (pic->bitDepth - 8);
586 if (!roi_size || sd->
size % roi_size != 0) {
590 nb_rois = sd->
size / roi_size;
592 qoffsets =
av_calloc(mbx * mby,
sizeof(*qoffsets));
598 for (
int i = nb_rois - 1;
i >= 0;
i--) {
599 int startx, endx, starty, endy;
604 starty =
FFMIN(mby, roi->
top / mb_size);
605 endy =
FFMIN(mby, (roi->
bottom + mb_size - 1)/ mb_size);
606 startx =
FFMIN(mbx, roi->
left / mb_size);
607 endx =
FFMIN(mbx, (roi->
right + mb_size - 1)/ mb_size);
615 qoffset =
av_clipf(qoffset * qp_range, -qp_range, +qp_range);
617 for (
int y = starty; y < endy; y++)
618 for (
int x = startx; x < endx; x++)
619 qoffsets[x + y*mbx] = qoffset;
622 pic->quantOffsets = qoffsets;
630 x265_sei *
sei = &pic->userSEI;
631 for (
int i = 0;
i <
sei->numPayloads;
i++)
635 int idx = (
int)(intptr_t)pic->userData - 1;
637 pic->userData =
NULL;
641 sei->numPayloads = 0;
645 const AVFrame *pic,
int *got_packet)
648 x265_picture x265pic;
649 #if X265_BUILD >= 210
650 x265_picture x265pic_layers_out[MAX_SCALABLE_LAYERS];
651 x265_picture* x265pic_lyrptr_out[MAX_SCALABLE_LAYERS];
653 x265_picture x265pic_solo_out = { 0 };
655 x265_picture* x265pic_out;
665 ctx->api->picture_init(
ctx->params, &x265pic);
667 sei = &x265pic.userSEI;
668 sei->numPayloads = 0;
674 for (
i = 0;
i < 3;
i++) {
675 x265pic.planes[
i] = pic->
data[
i];
679 x265pic.pts = pic->
pts;
683 (
ctx->forced_idr ? X265_TYPE_IDR : X265_TYPE_I) :
697 rd = &
ctx->rd[rd_idx];
710 x265pic.userData = (
void*)(intptr_t)(rd_idx + 1);
719 }
else if (sei_data) {
721 x265_sei_payload *sei_payload;
725 (
sei->numPayloads + 1) *
sizeof(*sei_payload));
732 sei->payloads =
ctx->sei_data;
733 sei_payload = &
sei->payloads[
sei->numPayloads];
734 sei_payload->payload = sei_data;
735 sei_payload->payloadSize = sei_size;
745 x265_sei_payload *sei_payload;
752 (
sei->numPayloads + 1) *
sizeof(*sei_payload));
758 sei->payloads =
ctx->sei_data;
759 sei_payload = &
sei->payloads[
sei->numPayloads];
761 if (!sei_payload->payload) {
765 sei_payload->payloadSize = side_data->
size;
773 #if X265_BUILD >= 210
774 for (
i = 0;
i < MAX_SCALABLE_LAYERS;
i++)
775 x265pic_lyrptr_out[
i] = &x265pic_layers_out[
i];
777 ret =
ctx->api->encoder_encode(
ctx->encoder, &nal, &nnal,
778 pic ? &x265pic :
NULL, x265pic_lyrptr_out);
780 ret =
ctx->api->encoder_encode(
ctx->encoder, &nal, &nnal,
781 pic ? &x265pic :
NULL, &x265pic_solo_out);
784 for (
i = 0;
i <
sei->numPayloads;
i++)
794 for (
i = 0;
i < nnal;
i++)
795 payload += nal[
i].sizeBytes;
804 for (
i = 0;
i < nnal;
i++) {
805 memcpy(dst, nal[
i].payload, nal[
i].sizeBytes);
806 dst += nal[
i].sizeBytes;
812 #if X265_BUILD >= 210
813 x265pic_out = x265pic_lyrptr_out[0];
815 x265pic_out = &x265pic_solo_out;
818 pkt->
pts = x265pic_out->pts;
819 pkt->
dts = x265pic_out->dts;
821 switch (x265pic_out->sliceType) {
838 #if X265_BUILD >= 130
839 if (x265pic_out->sliceType == X265_TYPE_B)
841 if (x265pic_out->frameData.sliceType ==
'b')
847 if (x265pic_out->userData) {
848 int idx = (
int)(intptr_t)x265pic_out->userData - 1;
919 if (x265_api_get(12))
921 else if (x265_api_get(10))
923 else if (x265_api_get(8))
927 #define OFFSET(x) offsetof(libx265Context, x)
928 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
932 {
"forced-idr",
"if forcing keyframes, force them as IDR frames",
OFFSET(forced_idr),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
VE },
936 {
"udu_sei",
"Use user data unregistered SEI if available",
OFFSET(udu_sei),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
VE },
938 {
"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 },
953 {
"keyint_min",
"-1" },
960 {
"i_qfactor",
"-1" },
961 {
"b_qfactor",
"-1" },
973 .p.priv_class = &
class,
974 .p.wrapper_name =
"libx265",
#define FF_ENABLE_DEPRECATION_WARNINGS
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_LOG_WARNING
Something somehow does not look correct.
AVPixelFormat
Pixel format.
int keyint_min
minimum GOP size
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static av_cold int libx265_param_parse_int(AVCodecContext *avctx, const char *key, int value)
static av_cold int libx265_param_parse_float(AVCodecContext *avctx, const char *key, float value)
enum AVColorSpace colorspace
YUV colorspace type.
AVFrameSideData ** decoded_side_data
Array containing static side data, such as HDR10 CLL / MDCV structures.
static const FFCodecDefault defaults[]
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
int64_t duration
Duration of the frame, in the same units as pts.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type)
static const AVOption options[]
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
void * opaque
Frame owner's private data.
unsigned MaxCLL
Max content light level (cd/m^2).
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).
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
@ AVCOL_RANGE_JPEG
Full range content.
int depth
Number of bits in the component.
static void free_picture(libx265Context *ctx, x265_picture *pic)
#define AV_PIX_FMT_YUV420P10
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key,...
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AV_PKT_FLAG_DISPOSABLE
Flag is used to indicate packets that contain frames that can be discarded by the decoder.
#define AV_CODEC_FLAG_PSNR
error[?] variables will be set during encoding.
int qmax
maximum quantizer
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
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 roi_warned
If the encoder does not support ROI then warn the first time we encounter a frame with ROI side data.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
AVBufferRef * opaque_ref
Frame owner's private data.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
#define AV_CODEC_FLAG_COPY_OPAQUE
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
AVCodec p
The public AVCodec.
AVBufferRef * opaque_ref
AVBufferRef for free use by the API user.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
#define AV_PIX_FMT_GBRP10
static av_cold void libx265_encode_init_csp(FFCodec *codec)
int refs
number of reference frames
int flags
AV_CODEC_FLAG_*.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define FF_CODEC_ENCODE_CB(func)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define AV_PIX_FMT_YUV444P10
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Structure describing a single Region Of Interest.
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
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)
static void rd_release(libx265Context *ctx, int idx)
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#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_assert0(cond)
assert() equivalent, that is always enabled.
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
int64_t rc_max_rate
maximum bitrate
void * opaque
for some private data of the user
This structure describes the bitrate properties of an encoded bitstream.
#define CODEC_LONG_NAME(str)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
#define AV_PIX_FMT_GRAY10
int rc_buffer_size
decoder bitstream buffer size
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Rational number (pair of numerator and denominator).
float qblur
amount of qscale smoothing over time (0.0-1.0)
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
int64_t bit_rate
the average bitrate
static av_cold int libx265_encode_init(AVCodecContext *avctx)
uint32_t self_size
Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
static int FUNC() sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
@ AVCOL_RANGE_UNSPECIFIED
@ AV_FRAME_DATA_SEI_UNREGISTERED
User data unregistered metadata associated with a video frame.
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
enum AVPictureType pict_type
Picture type of the frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
AVBufferRef * frame_opaque_ref
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV444P12
@ AVCHROMA_LOC_UNSPECIFIED
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
#define AVERROR_EXTERNAL
Generic error in an external library.
int flags
A combination of AV_PKT_FLAG values.
int64_t avg_bitrate
Average bitrate of the stream, in bits per second.
#define AV_LOG_INFO
Standard information.
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...
static int handle_mdcv(void *logctx, const x265_api *api, x265_param *params, const AVMasteringDisplayMetadata *mdcv)
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int top
Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge ...
#define AV_PIX_FMT_GBRP12
int64_t max_bitrate
Maximum bitrate of the stream, in bits per second.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
const char * name
Name of the codec implementation.
int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
Ensure dst refers to the same data as src.
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
AVFrameSideData ** side_data
static av_cold int libx265_encode_set_roi(libx265Context *ctx, const AVFrame *frame, x265_picture *pic)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
void * av_calloc(size_t nmemb, size_t size)
#define AV_CODEC_FLAG_CLOSED_GOP
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int64_t buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
#define AV_PIX_FMT_YUV420P12
#define AV_INPUT_BUFFER_PADDING_SIZE
static int rd_get(libx265Context *ctx)
int max_qdiff
maximum quantizer difference between frames
main external API structure.
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
@ SEI_TYPE_USER_DATA_UNREGISTERED
int qmin
minimum quantizer
enum AVFrameSideDataType type
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
static enum AVPixelFormat x265_csp_ten[]
attribute_deprecated int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
static av_cold int libx265_encode_close(AVCodecContext *avctx)
FFCodec ff_libx265_encoder
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define FF_DISABLE_DEPRECATION_WARNINGS
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
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...
A reference to a data buffer.
static int handle_side_data(AVCodecContext *avctx, const x265_api *api, x265_param *params)
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
Structure to hold side data for an AVFrame.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
@ AVCOL_PRI_SMPTE432
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
This structure stores compressed data.
unsigned MaxFALL
Max average light level per frame (cd/m^2).
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...
int width
picture width / height.
@ AV_FRAME_DATA_REGIONS_OF_INTEREST
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const FFCodecDefault x265_defaults[]
AVCPBProperties * ff_encode_add_cpb_side_data(AVCodecContext *avctx)
Add a CPB properties side data to an encoding context.
#define AV_PIX_FMT_GRAY12
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
AVRational qoffset
Quantisation offset.
@ AVCOL_SPC_ICTCP
ITU-R BT.2100-0, ICtCp.
static enum AVPixelFormat x265_csp_eight[]
static enum AVPixelFormat x265_csp_twelve[]
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
static int is_keyframe(NalUnitType naltype)