FFmpeg
vaapi_encode_vp9.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include <va/va.h>
20 #include <va/va_enc_vp9.h>
21 
22 #include "libavutil/avassert.h"
23 #include "libavutil/common.h"
24 #include "libavutil/internal.h"
25 #include "libavutil/opt.h"
26 #include "libavutil/pixfmt.h"
27 
28 #include "avcodec.h"
29 #include "codec_internal.h"
30 #include "vaapi_encode.h"
31 
32 #define VP9_MAX_QUANT 255
33 
34 #define VP9_MAX_TILE_WIDTH 4096
35 
36 typedef struct VAAPIEncodeVP9Picture {
37  int slot;
39 
40 typedef struct VAAPIEncodeVP9Context {
42 
43  // User options.
46 
47  // Derived settings.
48  int q_idx_idr;
49  int q_idx_p;
50  int q_idx_b;
52 
53 
55 {
56  FFHWBaseEncodeContext *base_ctx = avctx->priv_data;
58  VAEncSequenceParameterBufferVP9 *vseq = ctx->codec_sequence_params;
59  VAEncPictureParameterBufferVP9 *vpic = ctx->codec_picture_params;
60 
61  vseq->max_frame_width = avctx->width;
62  vseq->max_frame_height = avctx->height;
63 
64  vseq->kf_auto = 0;
65 
66  if (!(ctx->va_rc_mode & VA_RC_CQP)) {
67  vseq->bits_per_second = ctx->va_bit_rate;
68  vseq->intra_period = base_ctx->gop_size;
69  }
70 
71  vpic->frame_width_src = avctx->width;
72  vpic->frame_height_src = avctx->height;
73  vpic->frame_width_dst = avctx->width;
74  vpic->frame_height_dst = avctx->height;
75 
76  return 0;
77 }
78 
81 {
82  FFHWBaseEncodeContext *base_ctx = avctx->priv_data;
83  VAAPIEncodeVP9Context *priv = avctx->priv_data;
84  VAAPIEncodePicture *vaapi_pic = pic->priv;
85  VAAPIEncodeVP9Picture *hpic = pic->codec_priv;
86  VAEncPictureParameterBufferVP9 *vpic = vaapi_pic->codec_picture_params;
87  int i;
88  int num_tile_columns;
89 
90  vpic->reconstructed_frame = vaapi_pic->recon_surface;
91  vpic->coded_buf = vaapi_pic->output_buffer;
92 
93  // Maximum width of a tile in units of superblocks is MAX_TILE_WIDTH_B64(64)
94  // So the number of tile columns is related to the width of the picture.
95  // We set the minimum possible number for num_tile_columns as default value.
96  num_tile_columns = (vpic->frame_width_src + VP9_MAX_TILE_WIDTH - 1) / VP9_MAX_TILE_WIDTH;
97  vpic->log2_tile_columns = num_tile_columns == 1 ? 0 : av_log2(num_tile_columns - 1) + 1;
98 
99  switch (pic->type) {
101  av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0);
102  vpic->ref_flags.bits.force_kf = 1;
103  vpic->refresh_frame_flags = 0xff;
104  hpic->slot = 0;
105  break;
107  av_assert0(!pic->nb_refs[1]);
108  {
109  VAAPIEncodeVP9Picture *href = pic->refs[0][0]->codec_priv;
110  av_assert0(href->slot == 0 || href->slot == 1);
111 
112  if (base_ctx->max_b_depth > 0) {
113  hpic->slot = !href->slot;
114  vpic->refresh_frame_flags = 1 << hpic->slot | 0xfc;
115  } else {
116  hpic->slot = 0;
117  vpic->refresh_frame_flags = 0xff;
118  }
119  vpic->ref_flags.bits.ref_frame_ctrl_l0 = 1;
120  vpic->ref_flags.bits.ref_last_idx = href->slot;
121  vpic->ref_flags.bits.ref_last_sign_bias = 1;
122  }
123  break;
125  av_assert0(pic->nb_refs[0] && pic->nb_refs[1]);
126  {
127  VAAPIEncodeVP9Picture *href0 = pic->refs[0][0]->codec_priv,
128  *href1 = pic->refs[1][0]->codec_priv;
129  av_assert0(href0->slot < pic->b_depth + 1 &&
130  href1->slot < pic->b_depth + 1);
131 
132  if (pic->b_depth == base_ctx->max_b_depth) {
133  // Unreferenced frame.
134  vpic->refresh_frame_flags = 0x00;
135  hpic->slot = 8;
136  } else {
137  vpic->refresh_frame_flags = 0xfe << pic->b_depth & 0xff;
138  hpic->slot = 1 + pic->b_depth;
139  }
140  vpic->ref_flags.bits.ref_frame_ctrl_l0 = 1;
141  vpic->ref_flags.bits.ref_frame_ctrl_l1 = 2;
142  vpic->ref_flags.bits.ref_last_idx = href0->slot;
143  vpic->ref_flags.bits.ref_last_sign_bias = 1;
144  vpic->ref_flags.bits.ref_gf_idx = href1->slot;
145  vpic->ref_flags.bits.ref_gf_sign_bias = 0;
146  }
147  break;
148  default:
149  av_assert0(0 && "invalid picture type");
150  }
151  if (vpic->refresh_frame_flags == 0x00) {
152  av_log(avctx, AV_LOG_DEBUG, "Pic %"PRId64" not stored.\n",
153  pic->display_order);
154  } else {
155  av_log(avctx, AV_LOG_DEBUG, "Pic %"PRId64" stored in slot %d.\n",
156  pic->display_order, hpic->slot);
157  }
158 
159  for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++)
160  vpic->reference_frames[i] = VA_INVALID_SURFACE;
161 
162  for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) {
163  for (int j = 0; j < pic->nb_refs[i]; j++) {
164  FFHWBaseEncodePicture *ref_pic = pic->refs[i][j];
165  int slot;
166  slot = ((VAAPIEncodeVP9Picture*)ref_pic->codec_priv)->slot;
167  av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE);
168  vpic->reference_frames[slot] = ((VAAPIEncodePicture *)ref_pic->priv)->recon_surface;
169  }
170  }
171 
172  vpic->pic_flags.bits.frame_type = (pic->type != FF_HW_PICTURE_TYPE_IDR);
173  vpic->pic_flags.bits.show_frame = pic->display_order <= pic->encode_order;
174 
175  if (pic->type == FF_HW_PICTURE_TYPE_IDR)
176  vpic->luma_ac_qindex = priv->q_idx_idr;
177  else if (pic->type == FF_HW_PICTURE_TYPE_P)
178  vpic->luma_ac_qindex = priv->q_idx_p;
179  else
180  vpic->luma_ac_qindex = priv->q_idx_b;
181  vpic->luma_dc_qindex_delta = 0;
182  vpic->chroma_ac_qindex_delta = 0;
183  vpic->chroma_dc_qindex_delta = 0;
184 
185  vpic->filter_level = priv->loop_filter_level;
186  vpic->sharpness_level = priv->loop_filter_sharpness;
187 
188  return 0;
189 }
190 
192 {
193  FFHWBaseEncodeContext *base_ctx = avctx->priv_data;
194 
195  // Surfaces must be aligned to 64x64 superblock boundaries.
196  base_ctx->surface_width = FFALIGN(avctx->width, 64);
197  base_ctx->surface_height = FFALIGN(avctx->height, 64);
198 
199  return 0;
200 }
201 
203 {
204  VAAPIEncodeContext *ctx = avctx->priv_data;
205  VAAPIEncodeVP9Context *priv = avctx->priv_data;
206 
207  if (ctx->rc_mode->quality) {
208  priv->q_idx_p = av_clip(ctx->rc_quality, 0, VP9_MAX_QUANT);
209  if (avctx->i_quant_factor > 0.0)
210  priv->q_idx_idr =
211  av_clip((avctx->i_quant_factor * priv->q_idx_p +
212  avctx->i_quant_offset) + 0.5,
213  0, VP9_MAX_QUANT);
214  else
215  priv->q_idx_idr = priv->q_idx_p;
216  if (avctx->b_quant_factor > 0.0)
217  priv->q_idx_b =
218  av_clip((avctx->b_quant_factor * priv->q_idx_p +
219  avctx->b_quant_offset) + 0.5,
220  0, VP9_MAX_QUANT);
221  else
222  priv->q_idx_b = priv->q_idx_p;
223  } else {
224  // Arbitrary value.
225  priv->q_idx_idr = priv->q_idx_p = priv->q_idx_b = 100;
226  }
227 
228  ctx->roi_quant_range = VP9_MAX_QUANT;
229 
230  return 0;
231 }
232 
234  { AV_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
235  { AV_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
236  { AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
237  { AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 },
239 };
240 
243 
244  .flags = FF_HW_FLAG_B_PICTURES |
246 
247  .default_quality = 100,
248 
249  .picture_priv_data_size = sizeof(VAAPIEncodeVP9Picture),
250 
251  .get_encoder_caps = &vaapi_encode_vp9_get_encoder_caps,
252  .configure = &vaapi_encode_vp9_configure,
253 
254  .sequence_params_size = sizeof(VAEncSequenceParameterBufferVP9),
255  .init_sequence_params = &vaapi_encode_vp9_init_sequence_params,
256 
257  .picture_params_size = sizeof(VAEncPictureParameterBufferVP9),
258  .init_picture_params = &vaapi_encode_vp9_init_picture_params,
259 };
260 
262 {
263  VAAPIEncodeContext *ctx = avctx->priv_data;
264 
265  ctx->codec = &vaapi_encode_type_vp9;
266 
267  // No packed headers are currently desired. They could be written,
268  // but there isn't any reason to do so - the one usable driver (i965)
269  // can write its own headers and there is no metadata to include.
270  ctx->desired_packed_headers = 0;
271 
272  return ff_vaapi_encode_init(avctx);
273 }
274 
275 #define OFFSET(x) offsetof(VAAPIEncodeVP9Context, x)
276 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
281 
282  { "loop_filter_level", "Loop filter level",
283  OFFSET(loop_filter_level), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 63, FLAGS },
284  { "loop_filter_sharpness", "Loop filter sharpness",
285  OFFSET(loop_filter_sharpness), AV_OPT_TYPE_INT, { .i64 = 4 }, 0, 15, FLAGS },
286  { NULL },
287 };
288 
290  { "b", "0" },
291  { "bf", "0" },
292  { "g", "250" },
293  { "qmin", "-1" },
294  { "qmax", "-1" },
295  { NULL },
296 };
297 
299  .class_name = "vp9_vaapi",
300  .item_name = av_default_item_name,
301  .option = vaapi_encode_vp9_options,
302  .version = LIBAVUTIL_VERSION_INT,
303 };
304 
306  .p.name = "vp9_vaapi",
307  CODEC_LONG_NAME("VP9 (VAAPI)"),
308  .p.type = AVMEDIA_TYPE_VIDEO,
309  .p.id = AV_CODEC_ID_VP9,
310  .priv_data_size = sizeof(VAAPIEncodeVP9Context),
313  .close = &ff_vaapi_encode_close,
314  .p.priv_class = &vaapi_encode_vp9_class,
315  .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
317  .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
319  .defaults = vaapi_encode_vp9_defaults,
320  .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */
321  .p.pix_fmts = (const enum AVPixelFormat[]) {
324  },
325  .hw_configs = ff_vaapi_encode_hw_configs,
326  .p.wrapper_name = "vaapi",
327 };
FFHWBaseEncodePicture::b_depth
int b_depth
Definition: hw_base_encode.h:79
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
av_clip
#define av_clip
Definition: common.h:100
FF_HW_PICTURE_TYPE_IDR
@ FF_HW_PICTURE_TYPE_IDR
Definition: hw_base_encode.h:39
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
opt.h
FF_HW_FLAG_B_PICTURE_REFERENCES
@ FF_HW_FLAG_B_PICTURE_REFERENCES
Definition: hw_base_encode.h:55
FFHWBaseEncodePicture::priv
void * priv
Definition: hw_base_encode.h:63
vaapi_encode_vp9_init_picture_params
static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
Definition: vaapi_encode_vp9.c:79
FFHWBaseEncodePicture::codec_priv
void * codec_priv
Definition: hw_base_encode.h:65
AV_CODEC_CAP_HARDWARE
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: codec.h:145
vaapi_encode_vp9_configure
static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:202
FF_HW_FLAG_B_PICTURES
@ FF_HW_FLAG_B_PICTURES
Definition: hw_base_encode.h:53
AV_PROFILE_VP9_1
#define AV_PROFILE_VP9_1
Definition: defs.h:155
VAAPIEncodeVP9Context
Definition: vaapi_encode_vp9.c:40
VAAPIEncodeVP9Context::loop_filter_sharpness
int loop_filter_sharpness
Definition: vaapi_encode_vp9.c:45
AVOption
AVOption.
Definition: opt.h:429
AVCodecContext::b_quant_offset
float b_quant_offset
qscale offset between IP and B-frames
Definition: avcodec.h:817
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:35
FFCodec
Definition: codec_internal.h:127
ff_vaapi_encode_close
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
Definition: vaapi_encode.c:2275
VP9_MAX_QUANT
#define VP9_MAX_QUANT
Definition: vaapi_encode_vp9.c:32
VAAPIEncodeVP9Picture
Definition: vaapi_encode_vp9.c:36
FFHWBaseEncodeContext
Definition: hw_base_encode.h:122
AVCodecContext::i_quant_factor
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
Definition: avcodec.h:826
FFCodecDefault
Definition: codec_internal.h:97
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
FFHWBaseEncodePicture::type
int type
Definition: hw_base_encode.h:78
vaapi_encode.h
VAAPIEncodePicture
Definition: vaapi_encode.h:65
AV_PROFILE_VP9_3
#define AV_PROFILE_VP9_3
Definition: defs.h:157
VP9_MAX_TILE_WIDTH
#define VP9_MAX_TILE_WIDTH
Definition: vaapi_encode_vp9.c:34
avassert.h
vaapi_encode_vp9_init
static av_cold int vaapi_encode_vp9_init(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:261
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
av_cold
#define av_cold
Definition: attributes.h:90
AV_PROFILE_UNKNOWN
#define AV_PROFILE_UNKNOWN
Definition: defs.h:65
VAAPIEncodePicture::codec_picture_params
void * codec_picture_params
Definition: vaapi_encode.h:83
AV_CODEC_ID_VP9
@ AV_CODEC_ID_VP9
Definition: codec_id.h:220
FFHWBaseEncodeContext::max_b_depth
int max_b_depth
Definition: hw_base_encode.h:188
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
OFFSET
#define OFFSET(x)
Definition: vaapi_encode_vp9.c:275
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:230
FF_HW_PICTURE_TYPE_B
@ FF_HW_PICTURE_TYPE_B
Definition: hw_base_encode.h:42
ctx
AVFormatContext * ctx
Definition: movenc.c:49
VAAPIEncodeVP9Context::q_idx_p
int q_idx_p
Definition: vaapi_encode_vp9.c:49
vaapi_encode_type_vp9
static const VAAPIEncodeType vaapi_encode_type_vp9
Definition: vaapi_encode_vp9.c:241
ff_vaapi_encode_receive_packet
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
Definition: vaapi_encode.c:2086
VAAPIEncodeType
Definition: vaapi_encode.h:265
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
VAAPIEncodeContext
Definition: vaapi_encode.h:145
FLAGS
#define FLAGS
Definition: vaapi_encode_vp9.c:276
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
NULL
#define NULL
Definition: coverity.c:32
vaapi_encode_vp9_profiles
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[]
Definition: vaapi_encode_vp9.c:233
VAAPIEncodeVP9Context::common
VAAPIEncodeContext common
Definition: vaapi_encode_vp9.c:41
VAAPIEncodeType::profiles
const VAAPIEncodeProfile * profiles
Definition: vaapi_encode.h:268
FF_CODEC_RECEIVE_PACKET_CB
#define FF_CODEC_RECEIVE_PACKET_CB(func)
Definition: codec_internal.h:326
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
VAAPIEncodeVP9Context::q_idx_idr
int q_idx_idr
Definition: vaapi_encode_vp9.c:48
vaapi_encode_vp9_init_sequence_params
static int vaapi_encode_vp9_init_sequence_params(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:54
VAAPIEncodeVP9Picture::slot
int slot
Definition: vaapi_encode_vp9.c:37
VAAPIEncodeVP9Context::q_idx_b
int q_idx_b
Definition: vaapi_encode_vp9.c:50
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
codec_internal.h
VAAPI_ENCODE_RC_OPTIONS
#define VAAPI_ENCODE_RC_OPTIONS
Definition: vaapi_encode.h:364
FFHWBaseEncodePicture::nb_refs
int nb_refs[MAX_REFERENCE_LIST_NUM]
Definition: hw_base_encode.h:97
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
FFHWBaseEncodePicture::encode_order
int64_t encode_order
Definition: hw_base_encode.h:70
VAAPI_ENCODE_COMMON_OPTIONS
#define VAAPI_ENCODE_COMMON_OPTIONS
Definition: vaapi_encode.h:350
VAAPIEncodePicture::recon_surface
VASurfaceID recon_surface
Definition: vaapi_encode.h:74
VAAPIEncodePicture::output_buffer
VABufferID output_buffer
Definition: vaapi_encode.h:81
ff_vp9_vaapi_encoder
const FFCodec ff_vp9_vaapi_encoder
Definition: vaapi_encode_vp9.c:305
AV_PIX_FMT_VAAPI
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
Definition: pixfmt.h:126
AVCodecContext::b_quant_factor
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...
Definition: avcodec.h:810
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
VAAPIEncodeVP9Context::loop_filter_level
int loop_filter_level
Definition: vaapi_encode_vp9.c:44
FF_HW_PICTURE_TYPE_P
@ FF_HW_PICTURE_TYPE_P
Definition: hw_base_encode.h:41
internal.h
common.h
MAX_REFERENCE_LIST_NUM
#define MAX_REFERENCE_LIST_NUM
Definition: hw_base_encode.h:30
FFHWBaseEncodePicture::refs
struct FFHWBaseEncodePicture * refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]
Definition: hw_base_encode.h:98
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:194
AVCodecContext::height
int height
Definition: avcodec.h:624
vaapi_encode_vp9_get_encoder_caps
static av_cold int vaapi_encode_vp9_get_encoder_caps(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:191
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:669
avcodec.h
ff_vaapi_encode_hw_configs
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]
Definition: vaapi_encode.c:36
AV_PROFILE_VP9_2
#define AV_PROFILE_VP9_2
Definition: defs.h:156
ff_vaapi_encode_init
av_cold int ff_vaapi_encode_init(AVCodecContext *avctx)
Definition: vaapi_encode.c:2091
pixfmt.h
FFHWBaseEncodeContext::gop_size
int gop_size
Definition: hw_base_encode.h:184
FFHWBaseEncodePicture
Definition: hw_base_encode.h:61
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:80
FFHWBaseEncodeContext::surface_height
int surface_height
Definition: hw_base_encode.h:141
AVCodecContext
main external API structure.
Definition: avcodec.h:451
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVCodecContext::i_quant_offset
float i_quant_offset
qscale offset between P and I-frames
Definition: avcodec.h:833
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
FFHWBaseEncodeContext::surface_width
int surface_width
Definition: hw_base_encode.h:140
AV_PROFILE_VP9_0
#define AV_PROFILE_VP9_0
Definition: defs.h:154
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
vaapi_encode_vp9_class
static const AVClass vaapi_encode_vp9_class
Definition: vaapi_encode_vp9.c:298
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:478
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:624
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
HW_BASE_ENCODE_COMMON_OPTIONS
#define HW_BASE_ENCODE_COMMON_OPTIONS
Definition: hw_base_encode.h:239
vaapi_encode_vp9_defaults
static const FFCodecDefault vaapi_encode_vp9_defaults[]
Definition: vaapi_encode_vp9.c:289
FFHWBaseEncodePicture::display_order
int64_t display_order
Definition: hw_base_encode.h:69
vaapi_encode_vp9_options
static const AVOption vaapi_encode_vp9_options[]
Definition: vaapi_encode_vp9.c:277
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26
VAAPIEncodeProfile
Definition: vaapi_encode.h:100