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));
179 { 0 , 8, 3, 1, 1, VAProfileVP8Version0_3 },
188 .sequence_params_size =
sizeof(VAEncSequenceParameterBufferVP8),
191 .picture_params_size =
sizeof(VAEncPictureParameterBufferVP8),
214 #define OFFSET(x) offsetof(VAAPIEncodeVP8Context, x)
215 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
218 {
"loop_filter_level",
"Loop filter level",
220 {
"loop_filter_sharpness",
"Loop filter sharpness",
229 {
"global_quality",
"40" },
251 .priv_class = &vaapi_encode_vp8_class,
253 .
defaults = vaapi_encode_vp8_defaults,
258 .wrapper_name =
"vaapi",
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)
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
const struct VAAPIEncodeType * codec
Libavcodec external API header.
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[]
int global_quality
Global quality for codecs which cannot change it per frame.
#define VAAPI_ENCODE_COMMON_OPTIONS
static const AVOption vaapi_encode_vp8_options[]
common internal api header.
common internal and external API header
int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *input_image, int *got_packet)
int loop_filter_sharpness
unsigned int desired_packed_headers
static const VAAPIEncodeType vaapi_encode_type_vp8
AVPixelFormat
Pixel format.
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
static av_cold int vaapi_encode_vp8_init(AVCodecContext *avctx)