Go to the documentation of this file.
20 #include <va/va_enc_vp8.h>
47 #define vseq_var(name) vseq->name, name
48 #define vseq_field(name) vseq->seq_fields.bits.name, name
49 #define vpic_var(name) vpic->name, name
50 #define vpic_field(name) vpic->pic_fields.bits.name, name
57 VAEncSequenceParameterBufferVP8 *vseq =
ctx->codec_sequence_params;
59 vseq->frame_width = avctx->
width;
60 vseq->frame_height = avctx->
height;
62 vseq->frame_width_scale = 0;
63 vseq->frame_height_scale = 0;
65 vseq->error_resilient = 0;
68 if (!(
ctx->va_rc_mode & VA_RC_CQP)) {
69 vseq->bits_per_second =
ctx->va_bit_rate;
70 vseq->intra_period = base_ctx->
gop_size;
92 vpic->ref_flags.bits.force_kf = 1;
93 vpic->ref_last_frame =
100 vpic->ref_flags.bits.no_ref_last = 0;
101 vpic->ref_flags.bits.no_ref_gf = 1;
102 vpic->ref_flags.bits.no_ref_arf = 1;
103 vpic->ref_last_frame =
105 vpic->ref_arf_frame =
113 vpic->pic_flags.bits.show_frame = 1;
115 vpic->pic_flags.bits.refresh_last = 1;
116 vpic->pic_flags.bits.refresh_golden_frame = 1;
117 vpic->pic_flags.bits.refresh_alternate_frame = 1;
119 vpic->pic_flags.bits.version = 0;
120 vpic->pic_flags.bits.loop_filter_type = 0;
121 for (
i = 0;
i < 4;
i++)
125 vpic->clamp_qindex_low = 0;
126 vpic->clamp_qindex_high = 127;
134 char *
data,
size_t *data_len)
137 VAQMatrixBufferVP8
quant;
143 if (*data_len <
sizeof(
quant))
145 *
type = VAQMatrixBufferType;
146 *data_len =
sizeof(
quant);
155 for (
i = 0;
i < 4;
i++)
156 quant.quantization_index[
i] = q;
158 quant.quantization_index_delta[
i] = 0;
184 { 0 , 8, 3, 1, 1, VAProfileVP8Version0_3 },
193 .default_quality = 40,
195 .sequence_params_size =
sizeof(VAEncSequenceParameterBufferVP8),
198 .picture_params_size =
sizeof(VAEncPictureParameterBufferVP8),
213 ctx->desired_packed_headers = 0;
218 #define OFFSET(x) offsetof(VAAPIEncodeVP8Context, x)
219 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
225 {
"loop_filter_level",
"Loop filter level",
227 {
"loop_filter_sharpness",
"Loop filter sharpness",
249 .
p.
name =
"vp8_vaapi",
269 .p.wrapper_name =
"vaapi",
AVPixelFormat
Pixel format.
#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
#define AVERROR_EOF
End of file.
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
VAAPIEncodeContext common
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
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.
static av_cold int vaapi_encode_vp8_init(AVCodecContext *avctx)
int loop_filter_sharpness
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
static const uint8_t quant[64]
static const VAAPIEncodeType vaapi_encode_type_vp8
#define AV_PROFILE_UNKNOWN
void * codec_picture_params
static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[]
#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.
static int vaapi_encode_vp8_init_sequence_params(AVCodecContext *avctx)
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
#define CODEC_LONG_NAME(str)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const FFCodec ff_vp8_vaapi_encoder
const VAAPIEncodeProfile * profiles
#define FF_CODEC_RECEIVE_PACKET_CB(func)
const char * av_default_item_name(void *ptr)
Return the context name.
static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx)
static const AVOption vaapi_encode_vp8_options[]
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define VAAPI_ENCODE_RC_OPTIONS
int nb_refs[MAX_REFERENCE_LIST_NUM]
#define VAAPI_ENCODE_COMMON_OPTIONS
VASurfaceID recon_surface
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
#define i(width, name, range_min, range_max)
static const AVClass vaapi_encode_vp8_class
struct FFHWBaseEncodePicture * refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]
const char * name
Name of the codec implementation.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]
av_cold int ff_vaapi_encode_init(AVCodecContext *avctx)
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.
static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
@ AV_OPT_TYPE_INT
Underlying C type is int.
float i_quant_offset
qscale offset between P and I-frames
#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 int vaapi_encode_vp8_write_quant_table(AVCodecContext *avctx, FFHWBaseEncodePicture *base_pic, int index, int *type, char *data, size_t *data_len)
int width
picture width / height.
#define HW_BASE_ENCODE_COMMON_OPTIONS
static const FFCodecDefault vaapi_encode_vp8_defaults[]