Go to the documentation of this file.
19 #ifndef AVCODEC_HW_BASE_ENCODE_H
20 #define AVCODEC_HW_BASE_ENCODE_H
26 #define MAX_DPB_SIZE 16
27 #define MAX_PICTURE_REFERENCES 2
28 #define MAX_REORDER_DELAY 16
29 #define MAX_ASYNC_DEPTH 64
30 #define MAX_REFERENCE_LIST_NUM 2
34 const char *
const picture_type_name[] = {
"IDR",
"I",
"P",
"B" };
35 return picture_type_name[
type];
233 uint32_t ref_l0, uint32_t ref_l1,
234 int flags,
int prediction_pre_only);
243 #define HW_BASE_ENCODE_COMMON_OPTIONS \
245 "Distance (in I-frames) between key frames", \
246 OFFSET(common.base.idr_interval), AV_OPT_TYPE_INT, \
247 { .i64 = 0 }, 0, INT_MAX, FLAGS }, \
249 "Maximum B-frame reference depth", \
250 OFFSET(common.base.desired_b_depth), AV_OPT_TYPE_INT, \
251 { .i64 = 1 }, 1, INT_MAX, FLAGS }, \
252 { "async_depth", "Maximum processing parallelism. " \
253 "Increase this to improve single channel performance.", \
254 OFFSET(common.base.async_depth), AV_OPT_TYPE_INT, \
255 { .i64 = 2 }, 1, MAX_ASYNC_DEPTH, FLAGS }
AVPixelFormat
Pixel format.
AVBufferRef * recon_frames_ref
struct FFHWBaseEncodePicture * next
This structure describes decoded (raw) audio or video data.
FFHWBaseEncodePicture * next_prev[MAX_PICTURE_REFERENCES]
@ FF_HW_FLAG_B_PICTURE_REFERENCES
int64_t ts_ring[MAX_REORDER_DELAY *3+MAX_ASYNC_DEPTH]
AVBufferRef * input_frames_ref
@ FF_HW_FLAG_SLICE_CONTROL
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
AVHWDeviceContext * device
struct FFHWBaseEncodePicture * prev
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
AVPacket * tail_pkt
Tail data of a pic, now only used for av1 repeat frame header.
int ff_hw_base_get_recon_format(FFHWBaseEncodeContext *ctx, const void *hwconfig, enum AVPixelFormat *fmt)
int ff_hw_base_encode_close(FFHWBaseEncodeContext *ctx)
FFHWBaseEncodePicture * pic_end
int ff_hw_base_encode_set_output_property(FFHWBaseEncodeContext *ctx, AVCodecContext *avctx, FFHWBaseEncodePicture *pic, AVPacket *pkt, int flag_no_delay)
FFHWBaseEncodePicture * pic_start
struct FFHWBaseEncodePicture * dpb[MAX_DPB_SIZE]
Describe the class of an AVClass context structure.
int(* free)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
int nb_refs[MAX_REFERENCE_LIST_NUM]
@ FF_HW_FLAG_NON_IDR_KEY_PICTURES
int ff_hw_base_encode_receive_packet(FFHWBaseEncodeContext *ctx, AVCodecContext *avctx, AVPacket *pkt)
const struct FFHWEncodePictureOperation * op
#define MAX_REFERENCE_LIST_NUM
int(* init)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
struct FFHWBaseEncodePicture * refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]
This struct describes a set or pool of "hardware" frames (i.e.
static const char * ff_hw_base_encode_get_pictype_name(const int type)
main external API structure.
@ FF_HW_FLAG_CONSTANT_QUALITY_ONLY
AVHWFramesContext * input_frames
A reference to a data buffer.
int ff_hw_base_init_gop_structure(FFHWBaseEncodeContext *ctx, AVCodecContext *avctx, uint32_t ref_l0, uint32_t ref_l1, int flags, int prediction_pre_only)
This structure stores compressed data.
AVHWFramesContext * recon_frames
#define flags(name, subs,...)
int(* issue)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
int(* output)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, AVPacket *pkt)
#define MAX_REORDER_DELAY
#define MAX_PICTURE_REFERENCES
int ff_hw_base_encode_init(AVCodecContext *avctx, FFHWBaseEncodeContext *ctx)