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
56 VAEncSequenceParameterBufferVP8 *vseq =
ctx->codec_sequence_params;
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;
67 if (!(
ctx->va_rc_mode & VA_RC_CQP)) {
68 vseq->bits_per_second =
ctx->va_bit_rate;
69 vseq->intra_period =
ctx->gop_size;
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);
153 for (
i = 0;
i < 4;
i++)
154 quant.quantization_index[
i] = q;
156 quant.quantization_index_delta[
i] = 0;
182 { 0 , 8, 3, 1, 1, VAProfileVP8Version0_3 },
191 .default_quality = 40,
193 .sequence_params_size =
sizeof(VAEncSequenceParameterBufferVP8),
196 .picture_params_size =
sizeof(VAEncPictureParameterBufferVP8),
211 ctx->desired_packed_headers = 0;
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",
267 .wrapper_name =
"vaapi",
AVPixelFormat
Pixel format.
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 AVCodecDefault vaapi_encode_vp8_defaults[]
const AVCodec ff_vp8_vaapi_encoder
#define AVERROR_EOF
End of file.
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
VAAPIEncodeContext common
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
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_...
static av_cold int vaapi_encode_vp8_init(AVCodecContext *avctx)
int loop_filter_sharpness
static const AVCodecDefault defaults[]
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 int quant(float coef, const float Q, const float rounding)
Quantize one coefficient.
static const VAAPIEncodeType vaapi_encode_type_vp8
void * codec_picture_params
static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[]
#define FF_PROFILE_UNKNOWN
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static enum AVPixelFormat pix_fmts[]
static int vaapi_encode_vp8_init_sequence_params(AVCodecContext *avctx)
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const VAAPIEncodeProfile * profiles
static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
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[]
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define VAAPI_ENCODE_RC_OPTIONS
#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)
#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 AVClass vaapi_encode_vp8_class
const char * name
Name of the codec implementation.
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...
static int vaapi_encode_vp8_write_quant_table(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
main external API structure.
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...
int width
picture width / height.