Go to the documentation of this file.
25 #include <EbSvtAv1ErrorCodes.h>
26 #include <EbSvtAv1Enc.h>
27 #include <EbSvtAv1Metadata.h>
84 { EB_ErrorNone, 0,
"success" },
85 { EB_ErrorInsufficientResources,
AVERROR(ENOMEM),
"insufficient resources" },
86 { EB_ErrorUndefined,
AVERROR(EINVAL),
"undefined error" },
87 { EB_ErrorInvalidComponent,
AVERROR(EINVAL),
"invalid component" },
88 { EB_ErrorBadParameter,
AVERROR(EINVAL),
"bad parameter" },
89 { EB_ErrorDestroyThreadFailed,
AVERROR_EXTERNAL,
"failed to destroy thread" },
90 { EB_ErrorSemaphoreUnresponsive,
AVERROR_EXTERNAL,
"semaphore unresponsive" },
91 { EB_ErrorDestroySemaphoreFailed,
AVERROR_EXTERNAL,
"failed to destroy semaphore"},
95 { EB_NoErrorEmptyQueue,
AVERROR(EAGAIN),
"empty queue" },
109 *
desc =
"unknown error";
114 const char *error_string)
126 const size_t luma_size =
config->source_width *
config->source_height *
127 (
config->encoder_bit_depth > 8 ? 2 : 1);
129 EbSvtIOFormat *in_data;
131 svt_enc->
raw_size = luma_size * 3 / 2;
139 if (!svt_enc->
in_buf->p_buffer)
152 const struct EbSvtAv1ChromaPoints *
const points[] = {
158 for (
int i = 0;
i < 3;
i++) {
159 const struct EbSvtAv1ChromaPoints *
dst = points[
i];
187 EbSvtAv1EncConfiguration *param)
220 param->enc_mode = svt_enc->
enc_mode;
223 param->target_bit_rate = avctx->
bit_rate;
225 param->rate_control_mode = 1;
227 param->rate_control_mode = 2;
229 param->max_qp_allowed = avctx->
qmax;
230 param->min_qp_allowed = avctx->
qmin;
234 param->maximum_buffer_size_ms =
238 if (svt_enc->
crf > 0) {
239 param->qp = svt_enc->
crf;
240 param->rate_control_mode = 0;
241 }
else if (svt_enc->
qp > 0) {
242 param->qp = svt_enc->
qp;
243 param->rate_control_mode = 0;
244 #if SVT_AV1_CHECK_VERSION(4, 0, 0)
247 param->enable_adaptive_quantization = 0;
252 param->color_primaries = (
enum EbColorPrimaries)avctx->
color_primaries;
255 param->transfer_characteristics = (
enum EbTransferCharacteristics)avctx->
color_trc;
262 #if SVT_AV1_CHECK_VERSION(1, 0, 0)
269 param->chroma_sample_position = EB_CSP_VERTICAL;
272 param->chroma_sample_position = EB_CSP_COLOCATED;
279 "Specified chroma sample location %s is unsupported "
280 "on the AV1 bit stream level. Usage of a container that "
281 "allows passing this information - such as Matroska - "
290 param->profile = avctx->
profile;
293 param->level = avctx->
level;
301 param->intra_period_length = avctx->
gop_size - 1;
303 #if SVT_AV1_CHECK_VERSION(1, 1, 0)
313 param->force_key_frames = 1;
329 #if SVT_AV1_CHECK_VERSION(0, 9, 1)
331 EbErrorType
ret = svt_av1_enc_parse_parameter(param, en->key, en->value);
332 if (
ret != EB_ErrorNone) {
334 av_log(avctx,
level,
"Error parsing option %s: %s.\n", en->key, en->value);
342 av_log(avctx,
level,
"svt-params needs libavcodec to be compiled with SVT-AV1 "
343 "headers >= 0.9.1.\n");
375 param->rc_stats_buffer.buf = svt_enc->
stats_buf;
376 param->rc_stats_buffer.sz = stats_sz;
385 param->source_width = avctx->
width;
386 param->source_height = avctx->
height;
388 param->encoder_bit_depth =
desc->comp[0].depth;
390 if (
desc->log2_chroma_w == 1 &&
desc->log2_chroma_h == 1)
391 param->encoder_color_format = EB_YUV420;
392 else if (
desc->log2_chroma_w == 1 &&
desc->log2_chroma_h == 0)
393 param->encoder_color_format = EB_YUV422;
394 else if (!
desc->log2_chroma_w && !
desc->log2_chroma_h)
395 param->encoder_color_format = EB_YUV444;
401 if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10)
405 }
else if (param->encoder_color_format == EB_YUV444 && param->profile !=
AV_PROFILE_AV1_HIGH) {
410 avctx->
bit_rate = param->rate_control_mode > 0 ?
411 param->target_bit_rate : 0;
430 EbBufferHeaderType *header_ptr)
432 EbSvtIOFormat *in_data = (EbSvtIOFormat *)header_ptr->p_buffer;
433 ptrdiff_t linesizes[4];
435 int bytes_shift = param->encoder_bit_depth > 8 ? 1 : 0;
438 for (
int i = 0;
i < 4;
i++)
439 linesizes[
i] =
frame->linesize[
i];
447 for (
int i = 0;
i < 4;
i++) {
453 in_data->luma =
frame->data[0];
454 in_data->cb =
frame->data[1];
455 in_data->cr =
frame->data[2];
462 svt_metadata_array_free(&header_ptr->metadata);
475 #if SVT_AV1_CHECK_VERSION(3, 0, 0)
480 if (svt_ret != EB_ErrorNone) {
481 return svt_print_error(avctx, svt_ret,
"Error initializing encoder handle");
491 if (svt_ret != EB_ErrorNone) {
492 return svt_print_error(avctx, svt_ret,
"Error setting encoder parameters");
495 svt_ret = svt_av1_enc_init(svt_enc->
svt_handle);
496 if (svt_ret != EB_ErrorNone) {
506 EbBufferHeaderType *headerPtr =
NULL;
508 svt_ret = svt_av1_enc_stream_header(svt_enc->
svt_handle, &headerPtr);
509 if (svt_ret != EB_ErrorNone) {
510 return svt_print_error(avctx, svt_ret,
"Error building stream header");
517 "Cannot allocate AV1 header of size %d.\n", avctx->
extradata_size);
523 svt_ret = svt_av1_enc_stream_header_release(headerPtr);
524 if (svt_ret != EB_ErrorNone) {
539 EbBufferHeaderType *headerPtr = svt_enc->
in_buf;
545 EbBufferHeaderType headerPtrLast;
550 memset(&headerPtrLast, 0,
sizeof(headerPtrLast));
551 headerPtrLast.pic_type = EB_AV1_INVALID_PICTURE;
552 headerPtrLast.flags = EB_BUFFERFLAG_EOS;
554 svt_av1_enc_send_picture(svt_enc->
svt_handle, &headerPtrLast);
563 headerPtr->flags = 0;
564 headerPtr->p_app_private =
NULL;
565 headerPtr->pts =
frame->pts;
567 switch (
frame->pict_type) {
569 headerPtr->pic_type = EB_AV1_KEY_PICTURE;
573 headerPtr->pic_type = EB_AV1_INVALID_PICTURE;
578 headerPtr->pic_type = EB_AV1_KEY_PICTURE;
588 ret = svt_add_metadata(headerPtr, EB_AV1_METADATA_TYPE_ITUT_T35, t35,
size);
594 "without AV_FRAME_DATA_DOVI_METADATA\n");
599 svt_ret = svt_av1_enc_send_picture(svt_enc->
svt_handle, headerPtr);
600 if (svt_ret != EB_ErrorNone)
601 return svt_print_error(avctx, svt_ret,
"Error sending a frame to encoder");
609 const int max_frames = 8;
612 if (filled_len > svt_enc->
raw_size * max_frames) {
633 EbBufferHeaderType *headerPtr;
654 if (svt_ret == EB_NoErrorEmptyQueue)
656 else if (svt_ret != EB_ErrorNone)
657 return svt_print_error(avctx, svt_ret,
"Error getting an output packet from encoder");
659 #if SVT_AV1_CHECK_VERSION(2, 0, 0)
660 if (headerPtr->flags & EB_BUFFERFLAG_EOS) {
662 SvtAv1FixedBuf first_pass_stats = { 0 };
663 EbErrorType svt_ret_stats;
666 svt_ret_stats = svt_av1_enc_get_stream_info(
668 SVT_AV1_STREAM_INFO_FIRST_PASS_STATS_OUT,
671 if (svt_ret_stats != EB_ErrorNone) {
673 "Failed to get first pass stats\n");
674 svt_av1_enc_release_out_buffer(&headerPtr);
678 if (first_pass_stats.sz > 0 && first_pass_stats.buf) {
683 "Failed to allocate stats output buffer\n");
684 svt_av1_enc_release_out_buffer(&headerPtr);
689 first_pass_stats.buf, first_pass_stats.sz);
692 "First pass stats: %"PRIu64
" bytes, encoded to %d bytes\n",
693 first_pass_stats.sz, b64_size);
698 svt_av1_enc_release_out_buffer(&headerPtr);
706 svt_av1_enc_release_out_buffer(&headerPtr);
712 memcpy(
pkt->
data, headerPtr->p_buffer, headerPtr->n_filled_len);
715 pkt->
size = headerPtr->n_filled_len;
716 pkt->
pts = headerPtr->pts;
717 pkt->
dts = headerPtr->dts;
720 switch (headerPtr->pic_type) {
721 case EB_AV1_KEY_PICTURE:
724 case EB_AV1_INTRA_ONLY_PICTURE:
727 case EB_AV1_INVALID_PICTURE:
735 if (headerPtr->pic_type == EB_AV1_NON_REF_PICTURE)
738 #if !(SVT_AV1_CHECK_VERSION(2, 0, 0))
739 if (headerPtr->flags & EB_BUFFERFLAG_EOS)
745 svt_av1_enc_release_out_buffer(&headerPtr);
756 svt_av1_enc_deinit_handle(svt_enc->
svt_handle);
760 svt_metadata_array_free(&svt_enc->
in_buf->metadata);
772 #define OFFSET(x) offsetof(SvtContext, x)
773 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
775 {
"preset",
"Encoding preset",
780 #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
781 { .i64 = value }, 0, 0, VE, .unit = "avctx.level"
782 {
LEVEL(
"2.0", 20) },
783 {
LEVEL(
"2.1", 21) },
784 {
LEVEL(
"2.2", 22) },
785 {
LEVEL(
"2.3", 23) },
786 {
LEVEL(
"3.0", 30) },
787 {
LEVEL(
"3.1", 31) },
788 {
LEVEL(
"3.2", 32) },
789 {
LEVEL(
"3.3", 33) },
790 {
LEVEL(
"4.0", 40) },
791 {
LEVEL(
"4.1", 41) },
792 {
LEVEL(
"4.2", 42) },
793 {
LEVEL(
"4.3", 43) },
794 {
LEVEL(
"5.0", 50) },
795 {
LEVEL(
"5.1", 51) },
796 {
LEVEL(
"5.2", 52) },
797 {
LEVEL(
"5.3", 53) },
798 {
LEVEL(
"6.0", 60) },
799 {
LEVEL(
"6.1", 61) },
800 {
LEVEL(
"6.2", 62) },
801 {
LEVEL(
"6.3", 63) },
802 {
LEVEL(
"7.0", 70) },
803 {
LEVEL(
"7.1", 71) },
804 {
LEVEL(
"7.2", 72) },
805 {
LEVEL(
"7.3", 73) },
808 {
"crf",
"Constant Rate Factor value",
OFFSET(crf),
810 {
"qp",
"Initial Quantizer level value",
OFFSET(qp),
812 {
"svtav1-params",
"Set the SVT-AV1 configuration using a :-separated list of key=value parameters",
OFFSET(svtav1_opts),
AV_OPT_TYPE_DICT, { 0 }, 0, 0,
VE },
829 {
"flags",
"+cgop" },
837 .
p.
name =
"libsvtav1",
850 .p.priv_class = &
class,
852 .p.wrapper_name =
"libsvtav1",
#define CODEC_PIXFMTS(...)
AVDOVIDecoderConfigurationRecord cfg
Currently active dolby vision configuration, or {0} for none.
AVBufferPool * av_buffer_pool_init(size_t size, AVBufferRef *(*alloc)(size_t size))
Allocate and initialize a buffer pool.
#define AV_LOG_WARNING
Something somehow does not look correct.
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 minimum maximum flags name is the option name
#define AV_EF_EXPLODE
abort decoding on minor error detection
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
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
void ff_dovi_ctx_unref(DOVIContext *s)
Completely reset a DOVIContext, preserving only logctx.
enum AVColorSpace colorspace
YUV colorspace type.
static const FFCodecDefault eb_enc_defaults[]
AVFrameSideData ** decoded_side_data
Array containing static side data, such as HDR10 CLL / MDCV structures.
static AVBufferRef * get_output_ref(AVCodecContext *avctx, SvtContext *svt_enc, int filled_len)
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AVERROR_EOF
End of file.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
@ AV_FRAME_DATA_DOVI_METADATA
Parsed Dolby Vision metadata, suitable for passing to a software implementation.
static const struct @187 svt_errors[]
#define FF_AV1_PROFILE_OPTS
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
unsigned MaxCLL
Max content light level (cd/m^2).
This structure describes decoded (raw) audio or video data.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUV420P10
static int eb_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define AV_LOG_VERBOSE
Detailed information.
static av_cold int eb_enc_init(AVCodecContext *avctx)
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
static av_cold int eb_enc_close(AVCodecContext *avctx)
#define AV_PKT_FLAG_DISPOSABLE
Flag is used to indicate packets that contain frames that can be discarded by the decoder.
#define AV_PROFILE_AV1_PROFESSIONAL
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
int qmax
maximum quantizer
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
const char * av_chroma_location_name(enum AVChromaLocation location)
#define AV_CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
AVCodec p
The public AVCodec.
#define AV_BASE64_DECODE_SIZE(x)
Calculate the output size in bytes needed to decode a base64 string with length x to a data buffer.
static int eb_send_frame(AVCodecContext *avctx, const AVFrame *frame)
int flags
AV_CODEC_FLAG_*.
int ff_encode_add_stats_side_data(AVPacket *pkt, int quality, const int64_t error[], int error_count, enum AVPictureType pict_type)
int ff_dovi_configure(DOVIContext *s, AVCodecContext *avctx)
Variant of ff_dovi_configure_from_codedpar which infers the codec parameters from an AVCodecContext.
#define FF_DOVI_AUTOMATIC
Enable tri-state.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
#define AV_PROFILE_UNKNOWN
AVBufferRef * av_buffer_pool_get(AVBufferPool *pool)
Allocate a new AVBuffer, reusing an old buffer from the pool when available.
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
#define AV_CEIL_RSHIFT(a, b)
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
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
static void handle_side_data(AVCodecContext *avctx, EbSvtAv1EncConfiguration *param)
This structure describes the bitrate properties of an encoded bitstream.
#define CODEC_LONG_NAME(str)
int rc_buffer_size
decoder bitstream buffer size
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
static const int sizes[][2]
enum AVColorRange color_range
MPEG vs JPEG YUV range.
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
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.
int av_image_fill_plane_sizes(size_t sizes[4], enum AVPixelFormat pix_fmt, int height, const ptrdiff_t linesizes[4])
Fill plane sizes for an image with pixel format pix_fmt and height height.
Rational number (pair of numerator and denominator).
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
#define FF_CODEC_RECEIVE_PACKET_CB(func)
int64_t bit_rate
the average bitrate
@ AV_OPT_TYPE_DICT
Underlying C type is AVDictionary*.
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_PICTURE_TYPE_I
Intra.
void av_buffer_pool_uninit(AVBufferPool **ppool)
Mark the pool as being available for freeing.
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
int av_base64_decode(uint8_t *out, const char *in_str, int out_size)
Decode a base64-encoded string.
int level
Encoding level descriptor.
const FFCodec ff_libsvtav1_encoder
@ AVCOL_RANGE_UNSPECIFIED
#define LEVEL(name, value)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
char * stats_out
pass1 encoding statistics output buffer
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define i(width, name, range_min, range_max)
static int config_enc_params(EbSvtAv1EncConfiguration *param, AVCodecContext *avctx)
EbComponentType * svt_handle
AVDictionary * svtav1_opts
@ AVCHROMA_LOC_UNSPECIFIED
@ AV_PICTURE_TYPE_NONE
Undefined.
static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
#define AV_CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode.
static const AVOption options[]
#define AVERROR_EXTERNAL
Generic error in an external library.
#define AV_PROFILE_AV1_HIGH
int flags
A combination of AV_PKT_FLAG values.
static int svt_map_error(EbErrorType eb_err, const char **desc)
int64_t avg_bitrate
Average bitrate of the stream, in bits per second.
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
#define AV_BASE64_SIZE(x)
Calculate the output size needed to base64-encode x bytes to a null-terminated string.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
int64_t max_bitrate
Maximum bitrate of the stream, in bits per second.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
const char * name
Name of the codec implementation.
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
EbSvtAv1EncConfiguration enc_params
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
#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...
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int64_t buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
void * av_malloc(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
#define AV_INPUT_BUFFER_PADDING_SIZE
static int svt_print_error(void *log_ctx, EbErrorType err, const char *error_string)
main external API structure.
int qmin
minimum quantizer
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ FF_DOVI_WRAP_T35
wrap inside T.35+EMDF
static int ref[MAX_W *MAX_W]
char * av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
Encode data to base64 and null-terminate.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
EbBufferHeaderType * in_buf
@ AV_PICTURE_TYPE_P
Predicted.
int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame)
Called by encoders to get the next frame for encoding.
A reference to a data buffer.
#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...
This structure stores compressed data.
unsigned MaxFALL
Max average light level per frame (cd/m^2).
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
static void handle_mdcv(struct EbSvtAv1MasteringDisplayInfo *dst, const AVMasteringDisplayMetadata *mdcv)
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.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVCPBProperties * ff_encode_add_cpb_side_data(AVCodecContext *avctx)
Add a CPB properties side data to an encoding context.
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
static int read_in_data(EbSvtAv1EncConfiguration *param, const AVFrame *frame, EbBufferHeaderType *header_ptr)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.