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 58 vseq->frame_width = avctx->
width;
59 vseq->frame_height = avctx->
height;
61 vseq->frame_width_scale = 0;
62 vseq->frame_height_scale = 0;
64 vseq->error_resilient = 0;
90 vpic->ref_flags.bits.force_kf = 1;
91 vpic->ref_last_frame =
98 vpic->ref_flags.bits.no_ref_last = 0;
99 vpic->ref_flags.bits.no_ref_gf = 1;
100 vpic->ref_flags.bits.no_ref_arf = 1;
101 vpic->ref_last_frame =
103 vpic->ref_arf_frame =
111 vpic->pic_flags.bits.show_frame = 1;
113 vpic->pic_flags.bits.refresh_last = 1;
114 vpic->pic_flags.bits.refresh_golden_frame = 1;
115 vpic->pic_flags.bits.refresh_alternate_frame = 1;
117 vpic->pic_flags.bits.version = 0;
118 vpic->pic_flags.bits.loop_filter_type = 0;
119 for (i = 0; i < 4; i++)
123 vpic->clamp_qindex_low = 0;
124 vpic->clamp_qindex_high = 127;
132 char *
data,
size_t *data_len)
135 VAQMatrixBufferVP8
quant;
141 if (*data_len <
sizeof(quant))
143 *type = VAQMatrixBufferType;
144 *data_len =
sizeof(
quant);
146 memset(&quant, 0,
sizeof(quant));
153 for (i = 0; i < 4; i++)
154 quant.quantization_index[i] = q;
155 for (i = 0; i < 5; i++)
156 quant.quantization_index_delta[i] = 0;
158 memcpy(data, &quant,
sizeof(quant));
182 { 0 , 8, 3, 1, 1, VAProfileVP8Version0_3 },
191 .default_quality = 40,
193 .sequence_params_size =
sizeof(VAEncSequenceParameterBufferVP8),
196 .picture_params_size =
sizeof(VAEncPictureParameterBufferVP8),
219 #define OFFSET(x) offsetof(VAAPIEncodeVP8Context, x) 220 #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",
257 .priv_class = &vaapi_encode_vp8_class,
260 .
defaults = vaapi_encode_vp8_defaults,
266 .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 const AVCodecDefault vaapi_encode_vp8_defaults[]
ptrdiff_t const GLvoid * data
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[]
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
const char * av_default_item_name(void *ptr)
Return the context name.
VAAPIEncodeContext common
static int vaapi_encode_vp8_write_quant_table(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
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.
AVCodec ff_vp8_vaapi_encoder
#define AVERROR_EOF
End of file.
VASurfaceID recon_surface
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int vaapi_encode_vp8_init_sequence_params(AVCodecContext *avctx)
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
static const AVClass vaapi_encode_vp8_class
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)
static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx)
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 int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
static enum AVPixelFormat pix_fmts[]
#define VAAPI_ENCODE_COMMON_OPTIONS
static const AVOption vaapi_encode_vp8_options[]
common internal api header.
common internal and external API header
int loop_filter_sharpness
unsigned int desired_packed_headers
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
static const VAAPIEncodeType vaapi_encode_type_vp8
AVPixelFormat
Pixel format.
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]
static av_cold int vaapi_encode_vp8_init(AVCodecContext *avctx)