20 #include <va/va_enc_vp9.h> 32 #define VP9_MAX_QUANT 255 59 vseq->max_frame_width = avctx->
width;
60 vseq->max_frame_height = avctx->
height;
69 vpic->frame_width_src = avctx->
width;
70 vpic->frame_height_src = avctx->
height;
71 vpic->frame_width_dst = avctx->
width;
72 vpic->frame_height_dst = avctx->
height;
92 vpic->ref_flags.bits.force_kf = 1;
93 vpic->refresh_frame_flags = 0xff;
104 vpic->refresh_frame_flags = 1 << hpic->
slot | 0xfc;
107 vpic->refresh_frame_flags = 0xff;
109 vpic->ref_flags.bits.ref_frame_ctrl_l0 = 1;
110 vpic->ref_flags.bits.ref_last_idx = href->
slot;
111 vpic->ref_flags.bits.ref_last_sign_bias = 1;
120 href1->slot < pic->
b_depth + 1);
124 vpic->refresh_frame_flags = 0x00;
127 vpic->refresh_frame_flags = 0xfe << pic->
b_depth & 0xff;
130 vpic->ref_flags.bits.ref_frame_ctrl_l0 = 1;
131 vpic->ref_flags.bits.ref_frame_ctrl_l1 = 2;
132 vpic->ref_flags.bits.ref_last_idx = href0->
slot;
133 vpic->ref_flags.bits.ref_last_sign_bias = 1;
134 vpic->ref_flags.bits.ref_gf_idx = href1->slot;
135 vpic->ref_flags.bits.ref_gf_sign_bias = 0;
141 if (vpic->refresh_frame_flags == 0x00) {
150 vpic->reference_frames[i] = VA_INVALID_SURFACE;
156 av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE);
166 vpic->luma_ac_qindex = priv->
q_idx_p;
168 vpic->luma_ac_qindex = priv->
q_idx_b;
169 vpic->luma_dc_qindex_delta = 0;
170 vpic->chroma_ac_qindex_delta = 0;
171 vpic->chroma_dc_qindex_delta = 0;
222 .default_quality = 100,
228 .sequence_params_size =
sizeof(VAEncSequenceParameterBufferVP9),
231 .picture_params_size =
sizeof(VAEncPictureParameterBufferVP9),
253 #define OFFSET(x) offsetof(VAAPIEncodeVP9Context, x) 254 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) 259 {
"loop_filter_level",
"Loop filter level",
261 {
"loop_filter_sharpness",
"Loop filter sharpness",
291 .priv_class = &vaapi_encode_vp9_class,
294 .
defaults = vaapi_encode_vp9_defaults,
300 .wrapper_name =
"vaapi",
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static av_cold int vaapi_encode_vp9_init(AVCodecContext *avctx)
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
const char * av_default_item_name(void *ptr)
Return the context name.
#define FF_ARRAY_ELEMS(a)
void * codec_sequence_params
float i_quant_offset
qscale offset between P and I-frames
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
VAAPIEncodeContext common
const VAAPIEncodeRCMode * rc_mode
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...
VASurfaceID recon_surface
static const VAAPIEncodeType vaapi_encode_type_vp9
int loop_filter_sharpness
static const AVCodecDefault vaapi_encode_vp9_defaults[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
simple assert() macros that are a bit more flexible than ISO C assert().
const char * name
Name of the codec implementation.
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
static const AVCodecDefault defaults[]
void * codec_picture_params
common internal API header
int width
picture width / height.
#define FF_PROFILE_UNKNOWN
const VAAPIEncodeProfile * profiles
av_cold int ff_vaapi_encode_init(AVCodecContext *avctx)
void * codec_picture_params
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
const struct VAAPIEncodeType * codec
Libavcodec external API header.
#define VAAPI_ENCODE_RC_OPTIONS
main external API structure.
Describe the class of an AVClass context structure.
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[]
float b_quant_offset
qscale offset between IP and B-frames
static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
AVCodec ff_vp9_vaapi_encoder
static const AVClass vaapi_encode_vp9_class
static enum AVPixelFormat pix_fmts[]
#define VAAPI_ENCODE_COMMON_OPTIONS
common internal api header.
common internal and external API header
static const AVOption vaapi_encode_vp9_options[]
static int vaapi_encode_vp9_init_sequence_params(AVCodecContext *avctx)
unsigned int desired_packed_headers
AVPixelFormat
Pixel format.
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]