Go to the documentation of this file.
19 #ifndef AVCODEC_VAAPI_ENCODE_H
20 #define AVCODEC_VAAPI_ENCODE_H
26 #if VA_CHECK_VERSION(1, 0, 0)
27 #include <va/va_str.h>
80 #if VA_CHECK_VERSION(1, 0, 0)
275 #if VA_CHECK_VERSION(0, 36, 0)
276 VAEncMiscParameterBufferQualityLevel quality_params;
433 char *
data,
size_t *data_len);
436 char *
data,
size_t *data_len);
440 char *
data,
size_t *data_len);
449 char *
data,
size_t *data_len);
457 char *
data,
size_t *data_len);
467 #define VAAPI_ENCODE_COMMON_OPTIONS \
469 "Use low-power encoding mode (only available on some platforms; " \
470 "may not support all encoding features)", \
471 OFFSET(common.low_power), AV_OPT_TYPE_BOOL, \
472 { .i64 = 0 }, 0, 1, FLAGS }, \
474 "Distance (in I-frames) between IDR frames", \
475 OFFSET(common.idr_interval), AV_OPT_TYPE_INT, \
476 { .i64 = 0 }, 0, INT_MAX, FLAGS }, \
478 "Maximum B-frame reference depth", \
479 OFFSET(common.desired_b_depth), AV_OPT_TYPE_INT, \
480 { .i64 = 1 }, 1, INT_MAX, FLAGS }, \
481 { "async_depth", "Maximum processing parallelism. " \
482 "Increase this to improve single channel performance. This option " \
483 "doesn't work if driver doesn't implement vaSyncBuffer function.", \
484 OFFSET(common.async_depth), AV_OPT_TYPE_INT, \
485 { .i64 = 2 }, 1, MAX_ASYNC_DEPTH, FLAGS }, \
486 { "max_frame_size", \
487 "Maximum frame size (in bytes)",\
488 OFFSET(common.max_frame_size), AV_OPT_TYPE_INT, \
489 { .i64 = 0 }, 0, INT_MAX, FLAGS }
491 #define VAAPI_ENCODE_RC_MODE(name, desc) \
492 { #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \
493 0, 0, FLAGS, "rc_mode" }
494 #define VAAPI_ENCODE_RC_OPTIONS \
496 "Set rate control mode", \
497 OFFSET(common.explicit_rc_mode), AV_OPT_TYPE_INT, \
498 { .i64 = RC_MODE_AUTO }, RC_MODE_AUTO, RC_MODE_MAX, FLAGS, "rc_mode" }, \
499 { "auto", "Choose mode automatically based on other parameters", \
500 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, "rc_mode" }, \
501 VAAPI_ENCODE_RC_MODE(CQP, "Constant-quality"), \
502 VAAPI_ENCODE_RC_MODE(CBR, "Constant-bitrate"), \
503 VAAPI_ENCODE_RC_MODE(VBR, "Variable-bitrate"), \
504 VAAPI_ENCODE_RC_MODE(ICQ, "Intelligent constant-quality"), \
505 VAAPI_ENCODE_RC_MODE(QVBR, "Quality-defined variable-bitrate"), \
506 VAAPI_ENCODE_RC_MODE(AVBR, "Average variable-bitrate")
void * codec_slice_params
unsigned int va_packed_headers
unsigned int desired_packed_headers
This structure describes decoded (raw) audio or video data.
size_t global_params_size[MAX_GLOBAL_PARAMS]
int(* write_sequence_header)(AVCodecContext *avctx, char *data, size_t *data_len)
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
int ff_vaapi_encode_init(AVCodecContext *avctx)
VAEncMiscParameterRateControl rc_params
int(* configure)(AVCodecContext *avctx)
int row_height[MAX_TILE_ROWS]
int(* init_picture_params)(AVCodecContext *avctx, VAAPIEncodePicture *pic)
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
VAEncMiscParameterBufferMaxFrameSize mfs_params
const VAAPIEncodeProfile * profile
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
const VAAPIEncodeRCMode * rc_mode
void * codec_picture_params
size_t picture_params_size
int global_params_type[MAX_GLOBAL_PARAMS]
const void * global_params[MAX_GLOBAL_PARAMS]
VAEntrypoint va_entrypoint
AVBufferRef * recon_frames_ref
AVHWDeviceContext * device
AVBufferPool * output_buffer_pool
struct VAAPIEncodePicture * prev
Describe the class of an AVClass context structure.
struct VAAPIEncodePicture * dpb[MAX_DPB_SIZE]
const VAAPIEncodeProfile * profiles
int ff_vaapi_encode_close(AVCodecContext *avctx)
int(* write_picture_header)(AVCodecContext *avctx, VAAPIEncodePicture *pic, char *data, size_t *data_len)
int(* init_sequence_params)(AVCodecContext *avctx)
void * codec_sequence_params
VAAPIEncodePicture * pic_start
int(* write_extra_buffer)(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]
VAAPIEncodePicture * pic_end
VAAPIEncodeSlice * slices
VASurfaceID input_surface
@ FLAG_B_PICTURE_REFERENCES
AVHWFramesContext * recon_frames
@ FLAG_NON_IDR_KEY_PICTURES
VASurfaceID recon_surface
VAEncMiscParameterHRD hrd_params
int(* write_extra_header)(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
int col_width[MAX_TILE_COLS]
const struct VAAPIEncodeType * codec
int(* init_slice_params)(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
int row_bd[MAX_TILE_ROWS+1]
VAAPIEncodePicture * next_prev
AVHWFramesContext * input_frames
void * codec_picture_params
This struct describes a set or pool of "hardware" frames (i.e.
AVBufferRef * output_buffer_ref
AVVAAPIDeviceContext * hwctx
int64_t ts_ring[MAX_REORDER_DELAY *3+MAX_ASYNC_DEPTH]
VABufferID * param_buffers
main external API structure.
AVBufferRef * input_frames_ref
VAEncMiscParameterFrameRate fr_params
int(* write_slice_header)(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
struct VAAPIEncodePicture * next
size_t sequence_params_size
@ FLAG_CONSTANT_QUALITY_ONLY
A reference to a data buffer.
This structure stores compressed data.
int col_bd[MAX_TILE_COLS+1]
size_t picture_priv_data_size
int(* get_encoder_caps)(AVCodecContext *avctx)
VAAPI connection details.
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]