FFmpeg
vaapi_encode.h
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 #ifndef AVCODEC_VAAPI_ENCODE_H
20 #define AVCODEC_VAAPI_ENCODE_H
21 
22 #include <stdint.h>
23 
24 #include <va/va.h>
25 
26 #if VA_CHECK_VERSION(1, 0, 0)
27 #include <va/va_str.h>
28 #endif
29 
30 #include "libavutil/hwcontext.h"
32 #include "libavutil/fifo.h"
33 
34 #include "avcodec.h"
35 #include "hwconfig.h"
36 
37 struct VAAPIEncodeType;
38 struct VAAPIEncodePicture;
39 
40 enum {
47  // A.4.1: table A.6 allows at most 22 tile rows for any level.
49  // A.4.1: table A.6 allows at most 20 tile columns for any level.
52 };
53 
55 
56 enum {
61 };
62 
63 typedef struct VAAPIEncodeSlice {
64  int index;
65  int row_start;
66  int row_size;
71 
72 typedef struct VAAPIEncodePicture {
74 
75  int64_t display_order;
76  int64_t encode_order;
77  int64_t pts;
78  int force_idr;
79 
80 #if VA_CHECK_VERSION(1, 0, 0)
81  // ROI regions.
82  VAEncROI *roi;
83 #else
84  void *roi;
85 #endif
86 
87  int type;
88  int b_depth;
91 
93  VASurfaceID input_surface;
94 
96  VASurfaceID recon_surface;
97 
99  VABufferID *param_buffers;
100 
102  VABufferID output_buffer;
103 
104  void *priv_data;
106 
107  // Whether this picture is a reference picture.
109 
110  // The contents of the DPB after this picture has been decoded.
111  // This will contain the picture itself if it is a reference picture,
112  // but not if it isn't.
115  // The reference pictures used in decoding this picture. If they are
116  // used by later pictures they will also appear in the DPB.
117  int nb_refs;
119  // The previous reference picture in encode order. Must be in at least
120  // one of the reference list and DPB list.
122  // Reference count for other pictures referring to this one through
123  // the above pointers, directly from incomplete pictures and indirectly
124  // through completed pictures.
125  int ref_count[2];
126  int ref_removed[2];
127 
131 
132 typedef struct VAAPIEncodeProfile {
133  // lavc profile value (FF_PROFILE_*).
135  // Supported bit depth.
136  int depth;
137  // Number of components.
139  // Chroma subsampling in width dimension.
141  // Chroma subsampling in height dimension.
143  // VAAPI profile value.
144  VAProfile va_profile;
146 
147 enum {
156 };
157 
158 typedef struct VAAPIEncodeRCMode {
159  // Mode from above enum (RC_MODE_*).
160  int mode;
161  // Name.
162  const char *name;
163  // Supported in the compile-time VAAPI version.
165  // VA mode value (VA_RC_*).
166  uint32_t va_mode;
167  // Uses bitrate parameters.
168  int bitrate;
169  // Supports maxrate distinct from bitrate.
170  int maxrate;
171  // Uses quality value.
172  int quality;
173  // Supports HRD/VBV parameters.
174  int hrd;
176 
177 typedef struct VAAPIEncodeContext {
178  const AVClass *class;
179 
180  // Codec-specific hooks.
181  const struct VAAPIEncodeType *codec;
182 
183  // Global options.
184 
185  // Use low power encoding mode.
187 
188  // Number of I frames between IDR frames.
190 
191  // Desired B frame reference depth.
193 
194  // Max Frame Size
196 
197  // Explicitly set RC mode (otherwise attempt to pick from
198  // available modes).
200 
201  // Explicitly-set QP, for use with the "qp" options.
202  // (Forces CQP mode when set, overriding everything else.)
204 
205  // Desired packed headers.
207 
208  // The required size of surfaces. This is probably the input
209  // size (AVCodecContext.width|height) aligned up to whatever
210  // block size is required by the codec.
213 
214  // The block size for slice calculations.
217 
218  // Everything above this point must be set before calling
219  // ff_vaapi_encode_init().
220 
221  // Chosen encoding profile details.
223 
224  // Chosen rate control mode details.
226  // RC quality level - meaning depends on codec and RC mode.
227  // In CQP mode this sets the fixed quantiser value.
229 
230  // Encoding profile (VAProfile*).
231  VAProfile va_profile;
232  // Encoding entrypoint (VAEntryoint*).
233  VAEntrypoint va_entrypoint;
234  // Rate control mode.
235  unsigned int va_rc_mode;
236  // Bitrate for codec-specific encoder parameters.
237  unsigned int va_bit_rate;
238  // Packed headers which will actually be sent.
239  unsigned int va_packed_headers;
240 
241  // Configuration attributes to use when creating va_config.
244 
245  VAConfigID va_config;
246  VAContextID va_context;
247 
251 
252  // The hardware frame context containing the input frames.
255 
256  // The hardware frame context containing the reconstructed frames.
259 
260  // Pool of (reusable) bitstream output buffers.
262 
263  // Global parameters which will be applied at the start of the
264  // sequence (includes rate control parameters below).
269 
270  // Rate control parameters.
271  VAEncMiscParameterRateControl rc_params;
272  VAEncMiscParameterHRD hrd_params;
273  VAEncMiscParameterFrameRate fr_params;
274  VAEncMiscParameterBufferMaxFrameSize mfs_params;
275 #if VA_CHECK_VERSION(0, 36, 0)
276  VAEncMiscParameterBufferQualityLevel quality_params;
277 #endif
278 
279  // Per-sequence parameter structure (VAEncSequenceParameterBuffer*).
281 
282  // Per-sequence parameters found in the per-picture parameter
283  // structure (VAEncPictureParameterBuffer*).
285 
286  // Current encoding window, in display (input) order.
288  // The next picture to use as the previous reference picture in
289  // encoding order.
291 
292  // Next input order index (display order).
293  int64_t input_order;
294  // Number of frames that output is behind input.
295  int64_t output_delay;
296  // Next encode order index.
297  int64_t encode_order;
298  // Number of frames decode output will need to be delayed.
299  int64_t decode_delay;
300  // Next output order index (in encode order).
301  int64_t output_order;
302 
303  // Timestamp handling.
304  int64_t first_pts;
305  int64_t dts_pts_diff;
306  int64_t ts_ring[MAX_REORDER_DELAY * 3 +
308 
309  // Slice structure.
314 
315  // Tile encoding.
318  // Tile width of the i-th column.
320  // Tile height of i-th row.
322  // Location of the i-th tile column boundary.
324  // Location of the i-th tile row boundary.
326 
327  // Frame type decision.
328  int gop_size;
331  int p_per_i;
333  int b_per_p;
338  int p_to_gpb;
339 
340  // Whether the driver supports ROI at all.
342  // Maximum number of regions supported by the driver.
344  // Quantisation range for offset calculations. Set by codec-specific
345  // code, as it may change based on parameters.
347 
348  // The encoder does not support cropping information, so warn about
349  // it the first time we encounter any nonzero crop fields.
351  // If the driver does not support ROI then warn the first time we
352  // encounter a frame with ROI side data.
354 
356 
357  // Whether the driver support vaSyncBuffer
359  // Store buffered pic
361  // Max number of frame buffered in encoder.
364 
365 enum {
366  // Codec supports controlling the subdivision of pictures into slices.
368  // Codec only supports constant quality (no rate control).
370  // Codec is intra-only.
371  FLAG_INTRA_ONLY = 1 << 2,
372  // Codec supports B-pictures.
373  FLAG_B_PICTURES = 1 << 3,
374  // Codec supports referencing B-pictures.
376  // Codec supports non-IDR key pictures (that is, key pictures do
377  // not necessarily empty the DPB).
379 };
380 
381 typedef struct VAAPIEncodeType {
382  // List of supported profiles and corresponding VAAPI profiles.
383  // (Must end with FF_PROFILE_UNKNOWN.)
385 
386  // Codec feature flags.
387  int flags;
388 
389  // Default quality for this codec - used as quantiser or RC quality
390  // factor depending on RC mode.
392 
393  // Determine encode parameters like block sizes for surface alignment
394  // and slices. This may need to query the profile and entrypoint,
395  // which will be available when this function is called. If not set,
396  // assume that all blocks are 16x16 and that surfaces should be
397  // aligned to match this.
399 
400  // Perform any extra codec-specific configuration after the
401  // codec context is initialised (set up the private data and
402  // add any necessary global parameters).
404 
405  // The size of any private data structure associated with each
406  // picture (can be zero if not required).
408 
409  // The size of the parameter structures:
410  // sizeof(VAEnc{type}ParameterBuffer{codec}).
414 
415  // Fill the parameter structures.
418  VAAPIEncodePicture *pic);
420  VAAPIEncodePicture *pic,
421  VAAPIEncodeSlice *slice);
422 
423  // The type used by the packed header: this should look like
424  // VAEncPackedHeader{something}.
428 
429  // Write the packed header data to the provided buffer.
430  // The sequence header is also used to fill the codec extradata
431  // when the encoder is starting.
433  char *data, size_t *data_len);
435  VAAPIEncodePicture *pic,
436  char *data, size_t *data_len);
438  VAAPIEncodePicture *pic,
439  VAAPIEncodeSlice *slice,
440  char *data, size_t *data_len);
441 
442  // Fill an extra parameter structure, which will then be
443  // passed to vaRenderPicture(). Will be called repeatedly
444  // with increasing index argument until AVERROR_EOF is
445  // returned.
447  VAAPIEncodePicture *pic,
448  int index, int *type,
449  char *data, size_t *data_len);
450 
451  // Write an extra packed header. Will be called repeatedly
452  // with increasing index argument until AVERROR_EOF is
453  // returned.
455  VAAPIEncodePicture *pic,
456  int index, int *type,
457  char *data, size_t *data_len);
459 
460 
462 
465 
466 
467 #define VAAPI_ENCODE_COMMON_OPTIONS \
468  { "low_power", \
469  "Use low-power encoding mode (only available on some platforms; " \
470  "may not support all encoding features)", \
471  OFFSET(common.low_power), AV_OPT_TYPE_BOOL, \
472  { .i64 = 0 }, 0, 1, FLAGS }, \
473  { "idr_interval", \
474  "Distance (in I-frames) between IDR frames", \
475  OFFSET(common.idr_interval), AV_OPT_TYPE_INT, \
476  { .i64 = 0 }, 0, INT_MAX, FLAGS }, \
477  { "b_depth", \
478  "Maximum B-frame reference depth", \
479  OFFSET(common.desired_b_depth), AV_OPT_TYPE_INT, \
480  { .i64 = 1 }, 1, INT_MAX, FLAGS }, \
481  { "async_depth", "Maximum processing parallelism. " \
482  "Increase this to improve single channel performance. This option " \
483  "doesn't work if driver doesn't implement vaSyncBuffer function.", \
484  OFFSET(common.async_depth), AV_OPT_TYPE_INT, \
485  { .i64 = 2 }, 1, MAX_ASYNC_DEPTH, FLAGS }, \
486  { "max_frame_size", \
487  "Maximum frame size (in bytes)",\
488  OFFSET(common.max_frame_size), AV_OPT_TYPE_INT, \
489  { .i64 = 0 }, 0, INT_MAX, FLAGS }
490 
491 #define VAAPI_ENCODE_RC_MODE(name, desc) \
492  { #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \
493  0, 0, FLAGS, "rc_mode" }
494 #define VAAPI_ENCODE_RC_OPTIONS \
495  { "rc_mode",\
496  "Set rate control mode", \
497  OFFSET(common.explicit_rc_mode), AV_OPT_TYPE_INT, \
498  { .i64 = RC_MODE_AUTO }, RC_MODE_AUTO, RC_MODE_MAX, FLAGS, "rc_mode" }, \
499  { "auto", "Choose mode automatically based on other parameters", \
500  0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, "rc_mode" }, \
501  VAAPI_ENCODE_RC_MODE(CQP, "Constant-quality"), \
502  VAAPI_ENCODE_RC_MODE(CBR, "Constant-bitrate"), \
503  VAAPI_ENCODE_RC_MODE(VBR, "Variable-bitrate"), \
504  VAAPI_ENCODE_RC_MODE(ICQ, "Intelligent constant-quality"), \
505  VAAPI_ENCODE_RC_MODE(QVBR, "Quality-defined variable-bitrate"), \
506  VAAPI_ENCODE_RC_MODE(AVBR, "Average variable-bitrate")
507 
508 
509 #endif /* AVCODEC_VAAPI_ENCODE_H */
MAX_TILE_COLS
@ MAX_TILE_COLS
Definition: vaapi_encode.h:50
hwconfig.h
VAAPIEncodeType::default_quality
int default_quality
Definition: vaapi_encode.h:391
VAAPIEncodeSlice::codec_slice_params
void * codec_slice_params
Definition: vaapi_encode.h:69
VAAPIEncodeContext::slice_block_width
int slice_block_width
Definition: vaapi_encode.h:215
VAAPIEncodeContext::closed_gop
int closed_gop
Definition: vaapi_encode.h:329
VAAPIEncodeProfile::va_profile
VAProfile va_profile
Definition: vaapi_encode.h:144
VAAPIEncodeContext::va_packed_headers
unsigned int va_packed_headers
Definition: vaapi_encode.h:239
PICTURE_TYPE_IDR
@ PICTURE_TYPE_IDR
Definition: vaapi_encode.h:57
AVBufferPool
The buffer pool.
Definition: buffer_internal.h:88
VAAPIEncodeContext::crop_warned
int crop_warned
Definition: vaapi_encode.h:350
VAAPIEncodeContext::desired_packed_headers
unsigned int desired_packed_headers
Definition: vaapi_encode.h:206
VAAPIEncodeContext::max_b_depth
int max_b_depth
Definition: vaapi_encode.h:332
VAAPIEncodeContext::tile_cols
int tile_cols
Definition: vaapi_encode.h:316
VAAPIEncodeContext::gop_counter
int gop_counter
Definition: vaapi_encode.h:336
VAAPIEncodeContext::slice_size
int slice_size
Definition: vaapi_encode.h:313
VAAPIEncodeContext::p_per_i
int p_per_i
Definition: vaapi_encode.h:331
VAAPIEncodeContext::nb_global_params
int nb_global_params
Definition: vaapi_encode.h:268
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:325
VAAPIEncodeContext::global_params_size
size_t global_params_size[MAX_GLOBAL_PARAMS]
Definition: vaapi_encode.h:267
VAAPIEncodeContext::nb_slices
int nb_slices
Definition: vaapi_encode.h:312
VAAPIEncodeType::write_sequence_header
int(* write_sequence_header)(AVCodecContext *avctx, char *data, size_t *data_len)
Definition: vaapi_encode.h:432
VAAPIEncodeSlice
Definition: vaapi_encode.h:63
VAAPIEncodePicture::refs
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
Definition: vaapi_encode.h:118
data
const char data[16]
Definition: mxf.c:146
VAAPIEncodeContext::roi_quant_range
int roi_quant_range
Definition: vaapi_encode.h:346
VAAPIEncodePicture::force_idr
int force_idr
Definition: vaapi_encode.h:78
MAX_PICTURE_REFERENCES
@ MAX_PICTURE_REFERENCES
Definition: vaapi_encode.h:44
VAAPIEncodeContext::first_pts
int64_t first_pts
Definition: vaapi_encode.h:304
VAAPIEncodeSlice::block_start
int block_start
Definition: vaapi_encode.h:67
VAAPIEncodeType::flags
int flags
Definition: vaapi_encode.h:387
VAAPIEncodePicture::ref_count
int ref_count[2]
Definition: vaapi_encode.h:125
VAAPIEncodeContext::low_power
int low_power
Definition: vaapi_encode.h:186
VAAPIEncodeContext::roi_allowed
int roi_allowed
Definition: vaapi_encode.h:341
VAAPIEncodeSlice::index
int index
Definition: vaapi_encode.h:64
VAAPIEncodePicture::nb_refs
int nb_refs
Definition: vaapi_encode.h:117
VAAPIEncodeContext::gop_size
int gop_size
Definition: vaapi_encode.h:328
VAAPIEncodeRCMode::va_mode
uint32_t va_mode
Definition: vaapi_encode.h:166
VAAPIEncodeContext::has_sync_buffer_func
int has_sync_buffer_func
Definition: vaapi_encode.h:358
ff_vaapi_encode_init
int ff_vaapi_encode_init(AVCodecContext *avctx)
Definition: vaapi_encode.c:2542
FLAG_CONSTANT_QUALITY_ONLY
@ FLAG_CONSTANT_QUALITY_ONLY
Definition: vaapi_encode.h:369
VAAPIEncodeContext::rc_params
VAEncMiscParameterRateControl rc_params
Definition: vaapi_encode.h:271
VAAPIEncodeContext::surface_width
int surface_width
Definition: vaapi_encode.h:211
VAAPIEncodeContext::va_rc_mode
unsigned int va_rc_mode
Definition: vaapi_encode.h:235
VAAPIEncodeContext::roi_max_regions
int roi_max_regions
Definition: vaapi_encode.h:343
VAAPIEncodeType::configure
int(* configure)(AVCodecContext *avctx)
Definition: vaapi_encode.h:403
fifo.h
VAAPIEncodeContext::row_height
int row_height[MAX_TILE_ROWS]
Definition: vaapi_encode.h:321
FLAG_NON_IDR_KEY_PICTURES
@ FLAG_NON_IDR_KEY_PICTURES
Definition: vaapi_encode.h:378
VAAPIEncodeType::picture_header_type
int picture_header_type
Definition: vaapi_encode.h:426
VAAPIEncodeType::init_picture_params
int(* init_picture_params)(AVCodecContext *avctx, VAAPIEncodePicture *pic)
Definition: vaapi_encode.h:417
VAAPIEncodeSlice::row_start
int row_start
Definition: vaapi_encode.h:65
MAX_TILE_ROWS
@ MAX_TILE_ROWS
Definition: vaapi_encode.h:48
VAAPIEncodePicture
Definition: vaapi_encode.h:72
VAAPIEncodeContext::output_order
int64_t output_order
Definition: vaapi_encode.h:301
type
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
Definition: writing_filters.txt:86
VAAPIEncodeContext::mfs_params
VAEncMiscParameterBufferMaxFrameSize mfs_params
Definition: vaapi_encode.h:274
VAAPIEncodeContext::profile
const VAAPIEncodeProfile * profile
Definition: vaapi_encode.h:222
VAAPIEncodeContext::p_to_gpb
int p_to_gpb
Definition: vaapi_encode.h:338
FLAG_B_PICTURES
@ FLAG_B_PICTURES
Definition: vaapi_encode.h:373
PICTURE_TYPE_I
@ PICTURE_TYPE_I
Definition: vaapi_encode.h:58
MAX_GLOBAL_PARAMS
@ MAX_GLOBAL_PARAMS
Definition: vaapi_encode.h:42
VAAPIEncodeContext::nb_config_attributes
int nb_config_attributes
Definition: vaapi_encode.h:243
AVHWDeviceContext
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition: hwcontext.h:61
VAAPIEncodeContext::rc_mode
const VAAPIEncodeRCMode * rc_mode
Definition: vaapi_encode.h:225
pkt
AVPacket * pkt
Definition: movenc.c:59
VAAPIEncodeSlice::row_size
int row_size
Definition: vaapi_encode.h:66
VAAPIEncodePicture::codec_picture_params
void * codec_picture_params
Definition: vaapi_encode.h:105
VAAPIEncodeType::picture_params_size
size_t picture_params_size
Definition: vaapi_encode.h:412
VAAPIEncodeContext::dts_pts_diff
int64_t dts_pts_diff
Definition: vaapi_encode.h:305
RC_MODE_CQP
@ RC_MODE_CQP
Definition: vaapi_encode.h:149
VAAPIEncodePicture::encode_complete
int encode_complete
Definition: vaapi_encode.h:90
VAAPIEncodeContext::tile_rows
int tile_rows
Definition: vaapi_encode.h:317
FLAG_INTRA_ONLY
@ FLAG_INTRA_ONLY
Definition: vaapi_encode.h:371
VAAPIEncodeContext::global_params_type
int global_params_type[MAX_GLOBAL_PARAMS]
Definition: vaapi_encode.h:265
VAAPIEncodeContext::global_params
const void * global_params[MAX_GLOBAL_PARAMS]
Definition: vaapi_encode.h:266
VAAPIEncodePicture::pts
int64_t pts
Definition: vaapi_encode.h:77
VAAPIEncodeContext::va_entrypoint
VAEntrypoint va_entrypoint
Definition: vaapi_encode.h:233
RC_MODE_CBR
@ RC_MODE_CBR
Definition: vaapi_encode.h:150
VAAPIEncodeContext::recon_frames_ref
AVBufferRef * recon_frames_ref
Definition: vaapi_encode.h:257
VAAPIEncodeContext::async_depth
int async_depth
Definition: vaapi_encode.h:362
VAAPIEncodeContext::device
AVHWDeviceContext * device
Definition: vaapi_encode.h:249
VAAPIEncodeContext::output_buffer_pool
AVBufferPool * output_buffer_pool
Definition: vaapi_encode.h:261
VAAPIEncodeType
Definition: vaapi_encode.h:381
RC_MODE_QVBR
@ RC_MODE_QVBR
Definition: vaapi_encode.h:153
VAAPIEncodeContext
Definition: vaapi_encode.h:177
VAAPIEncodePicture::prev
struct VAAPIEncodePicture * prev
Definition: vaapi_encode.h:121
VAAPIEncodeContext::rc_quality
int rc_quality
Definition: vaapi_encode.h:228
VAAPIEncodeContext::slice_block_rows
int slice_block_rows
Definition: vaapi_encode.h:310
VAAPIEncodeType::sequence_header_type
int sequence_header_type
Definition: vaapi_encode.h:425
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
RC_MODE_MAX
@ RC_MODE_MAX
Definition: vaapi_encode.h:155
VAAPIEncodeProfile::av_profile
int av_profile
Definition: vaapi_encode.h:134
VAAPIEncodePicture::dpb
struct VAAPIEncodePicture * dpb[MAX_DPB_SIZE]
Definition: vaapi_encode.h:114
VAAPIEncodeType::profiles
const VAAPIEncodeProfile * profiles
Definition: vaapi_encode.h:384
ff_vaapi_encode_close
int ff_vaapi_encode_close(AVCodecContext *avctx)
Definition: vaapi_encode.c:2744
VAAPIEncodeType::write_picture_header
int(* write_picture_header)(AVCodecContext *avctx, VAAPIEncodePicture *pic, char *data, size_t *data_len)
Definition: vaapi_encode.h:434
VAAPIEncodeType::init_sequence_params
int(* init_sequence_params)(AVCodecContext *avctx)
Definition: vaapi_encode.h:416
PICTURE_TYPE_P
@ PICTURE_TYPE_P
Definition: vaapi_encode.h:59
VAAPIEncodeRCMode::supported
int supported
Definition: vaapi_encode.h:164
VAAPIEncodeContext::codec_sequence_params
void * codec_sequence_params
Definition: vaapi_encode.h:280
VAAPIEncodeContext::va_bit_rate
unsigned int va_bit_rate
Definition: vaapi_encode.h:237
VAAPIEncodeContext::pic_start
VAAPIEncodePicture * pic_start
Definition: vaapi_encode.h:287
VAAPIEncodeType::write_extra_buffer
int(* write_extra_buffer)(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
Definition: vaapi_encode.h:446
VAAPIEncodeType::slice_params_size
size_t slice_params_size
Definition: vaapi_encode.h:413
VAAPIEncodeContext::config_attributes
VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]
Definition: vaapi_encode.h:242
index
int index
Definition: gxfenc.c:89
VAAPIEncodeContext::pic_end
VAAPIEncodePicture * pic_end
Definition: vaapi_encode.h:287
VAAPIEncodePicture::encode_issued
int encode_issued
Definition: vaapi_encode.h:89
VAAPIEncodeProfile::nb_components
int nb_components
Definition: vaapi_encode.h:138
VAAPIEncodePicture::slices
VAAPIEncodeSlice * slices
Definition: vaapi_encode.h:129
VAAPIEncodePicture::input_surface
VASurfaceID input_surface
Definition: vaapi_encode.h:93
VAAPIEncodePicture::type
int type
Definition: vaapi_encode.h:87
AVFifo
Definition: fifo.c:35
VAAPIEncodeRCMode::mode
int mode
Definition: vaapi_encode.h:160
VAAPIEncodeProfile::depth
int depth
Definition: vaapi_encode.h:136
VAAPIEncodeContext::slice_block_height
int slice_block_height
Definition: vaapi_encode.h:216
AVCodecHWConfigInternal
Definition: hwconfig.h:29
VAAPIEncodeContext::recon_frames
AVHWFramesContext * recon_frames
Definition: vaapi_encode.h:258
RC_MODE_AVBR
@ RC_MODE_AVBR
Definition: vaapi_encode.h:154
VAAPIEncodeContext::explicit_rc_mode
int explicit_rc_mode
Definition: vaapi_encode.h:199
VAAPIEncodePicture::recon_surface
VASurfaceID recon_surface
Definition: vaapi_encode.h:96
VAAPIEncodeType::slice_header_type
int slice_header_type
Definition: vaapi_encode.h:427
VAAPIEncodePicture::output_buffer
VABufferID output_buffer
Definition: vaapi_encode.h:102
VAAPIEncodeContext::gop_per_idr
int gop_per_idr
Definition: vaapi_encode.h:330
VAAPIEncodePicture::priv_data
void * priv_data
Definition: vaapi_encode.h:104
VAAPIEncodeContext::va_context
VAContextID va_context
Definition: vaapi_encode.h:246
VAAPIEncodeContext::hrd_params
VAEncMiscParameterHRD hrd_params
Definition: vaapi_encode.h:272
VAAPIEncodePicture::display_order
int64_t display_order
Definition: vaapi_encode.h:75
VAAPIEncodePicture::nb_dpb_pics
int nb_dpb_pics
Definition: vaapi_encode.h:113
VAAPIEncodePicture::b_depth
int b_depth
Definition: vaapi_encode.h:88
VAAPIEncodeContext::roi_warned
int roi_warned
Definition: vaapi_encode.h:353
VAAPIEncodePicture::ref_removed
int ref_removed[2]
Definition: vaapi_encode.h:126
VAAPIEncodeType::write_extra_header
int(* write_extra_header)(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
Definition: vaapi_encode.h:454
VAAPIEncodeContext::col_width
int col_width[MAX_TILE_COLS]
Definition: vaapi_encode.h:319
VAAPIEncodeContext::codec
const struct VAAPIEncodeType * codec
Definition: vaapi_encode.h:181
VAAPIEncodeType::init_slice_params
int(* init_slice_params)(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
Definition: vaapi_encode.h:419
VAAPIEncodeContext::encode_fifo
AVFifo * encode_fifo
Definition: vaapi_encode.h:360
MAX_CONFIG_ATTRIBUTES
@ MAX_CONFIG_ATTRIBUTES
Definition: vaapi_encode.h:41
VAAPIEncodeContext::row_bd
int row_bd[MAX_TILE_ROWS+1]
Definition: vaapi_encode.h:325
VAAPIEncodeContext::next_prev
VAAPIEncodePicture * next_prev
Definition: vaapi_encode.h:290
VAAPIEncodeContext::device_ref
AVBufferRef * device_ref
Definition: vaapi_encode.h:248
VAAPIEncodeContext::input_frames
AVHWFramesContext * input_frames
Definition: vaapi_encode.h:254
VAAPIEncodePicture::roi
void * roi
Definition: vaapi_encode.h:84
FLAG_SLICE_CONTROL
@ FLAG_SLICE_CONTROL
Definition: vaapi_encode.h:367
VAAPIEncodeContext::codec_picture_params
void * codec_picture_params
Definition: vaapi_encode.h:284
MAX_PARAM_BUFFER_SIZE
@ MAX_PARAM_BUFFER_SIZE
Definition: vaapi_encode.h:46
VAAPIEncodeContext::output_delay
int64_t output_delay
Definition: vaapi_encode.h:295
VAAPIEncodeContext::max_frame_size
int max_frame_size
Definition: vaapi_encode.h:195
VAAPIEncodeContext::desired_b_depth
int desired_b_depth
Definition: vaapi_encode.h:192
VAAPIEncodeContext::input_order
int64_t input_order
Definition: vaapi_encode.h:293
avcodec.h
MAX_REORDER_DELAY
@ MAX_REORDER_DELAY
Definition: vaapi_encode.h:45
AVHWFramesContext
This struct describes a set or pool of "hardware" frames (i.e.
Definition: hwcontext.h:124
hwcontext_vaapi.h
VAAPIEncodePicture::output_buffer_ref
AVBufferRef * output_buffer_ref
Definition: vaapi_encode.h:101
VAAPIEncodeContext::hwctx
AVVAAPIDeviceContext * hwctx
Definition: vaapi_encode.h:250
VAAPIEncodeContext::frame
AVFrame * frame
Definition: vaapi_encode.h:355
VAAPIEncodeRCMode::bitrate
int bitrate
Definition: vaapi_encode.h:168
VAAPIEncodeContext::ts_ring
int64_t ts_ring[MAX_REORDER_DELAY *3+MAX_ASYNC_DEPTH]
Definition: vaapi_encode.h:307
VAAPIEncodePicture::param_buffers
VABufferID * param_buffers
Definition: vaapi_encode.h:99
VAAPIEncodeContext::va_config
VAConfigID va_config
Definition: vaapi_encode.h:245
VAAPIEncodeContext::va_profile
VAProfile va_profile
Definition: vaapi_encode.h:231
AVCodecContext
main external API structure.
Definition: avcodec.h:398
RC_MODE_VBR
@ RC_MODE_VBR
Definition: vaapi_encode.h:151
VAAPIEncodePicture::is_reference
int is_reference
Definition: vaapi_encode.h:108
VAAPIEncodeContext::input_frames_ref
AVBufferRef * input_frames_ref
Definition: vaapi_encode.h:253
VAAPIEncodeRCMode::hrd
int hrd
Definition: vaapi_encode.h:174
VAAPIEncodePicture::recon_image
AVFrame * recon_image
Definition: vaapi_encode.h:95
VAAPIEncodeProfile::log2_chroma_h
int log2_chroma_h
Definition: vaapi_encode.h:142
VAAPIEncodeContext::fr_params
VAEncMiscParameterFrameRate fr_params
Definition: vaapi_encode.h:273
RC_MODE_AUTO
@ RC_MODE_AUTO
Definition: vaapi_encode.h:148
RC_MODE_ICQ
@ RC_MODE_ICQ
Definition: vaapi_encode.h:152
MAX_ASYNC_DEPTH
@ MAX_ASYNC_DEPTH
Definition: vaapi_encode.h:51
VAAPIEncodeType::write_slice_header
int(* write_slice_header)(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
Definition: vaapi_encode.h:437
VAAPIEncodeRCMode::maxrate
int maxrate
Definition: vaapi_encode.h:170
PICTURE_TYPE_B
@ PICTURE_TYPE_B
Definition: vaapi_encode.h:60
FLAG_B_PICTURE_REFERENCES
@ FLAG_B_PICTURE_REFERENCES
Definition: vaapi_encode.h:375
VAAPIEncodeContext::decode_delay
int64_t decode_delay
Definition: vaapi_encode.h:299
VAAPIEncodePicture::next
struct VAAPIEncodePicture * next
Definition: vaapi_encode.h:73
VAAPIEncodeType::sequence_params_size
size_t sequence_params_size
Definition: vaapi_encode.h:411
VAAPIEncodeContext::explicit_qp
int explicit_qp
Definition: vaapi_encode.h:203
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
VAAPIEncodeContext::surface_height
int surface_height
Definition: vaapi_encode.h:212
VAAPIEncodePicture::input_image
AVFrame * input_image
Definition: vaapi_encode.h:92
MAX_DPB_SIZE
@ MAX_DPB_SIZE
Definition: vaapi_encode.h:43
VAAPIEncodeSlice::block_size
int block_size
Definition: vaapi_encode.h:68
VAAPIEncodeRCMode
Definition: vaapi_encode.h:158
VAAPIEncodeContext::idr_counter
int idr_counter
Definition: vaapi_encode.h:335
AVPacket
This structure stores compressed data.
Definition: packet.h:351
VAAPIEncodePicture::encode_order
int64_t encode_order
Definition: vaapi_encode.h:76
VAAPIEncodeContext::col_bd
int col_bd[MAX_TILE_COLS+1]
Definition: vaapi_encode.h:323
VAAPIEncodeContext::encode_order
int64_t encode_order
Definition: vaapi_encode.h:297
VAAPIEncodeProfile::log2_chroma_w
int log2_chroma_w
Definition: vaapi_encode.h:140
hwcontext.h
VAAPIEncodeContext::slice_block_cols
int slice_block_cols
Definition: vaapi_encode.h:311
VAAPIEncodeType::picture_priv_data_size
size_t picture_priv_data_size
Definition: vaapi_encode.h:407
VAAPIEncodeType::get_encoder_caps
int(* get_encoder_caps)(AVCodecContext *avctx)
Definition: vaapi_encode.h:398
VAAPIEncodePicture::nb_param_buffers
int nb_param_buffers
Definition: vaapi_encode.h:98
AVVAAPIDeviceContext
VAAPI connection details.
Definition: hwcontext_vaapi.h:68
VAAPIEncodeRCMode::quality
int quality
Definition: vaapi_encode.h:172
VAAPIEncodeContext::b_per_p
int b_per_p
Definition: vaapi_encode.h:333
int
int
Definition: ffmpeg_filter.c:156
VAAPIEncodeContext::end_of_stream
int end_of_stream
Definition: vaapi_encode.h:337
VAAPIEncodeProfile
Definition: vaapi_encode.h:132
ff_vaapi_encode_receive_packet
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
Definition: vaapi_encode.c:1185
VAAPIEncodeRCMode::name
const char * name
Definition: vaapi_encode.h:162
VAAPIEncodeContext::force_idr
int force_idr
Definition: vaapi_encode.h:334
VAAPIEncodePicture::nb_slices
int nb_slices
Definition: vaapi_encode.h:128
ff_vaapi_encode_hw_configs
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]
Definition: vaapi_encode.c:34
VAAPIEncodeContext::idr_interval
int idr_interval
Definition: vaapi_encode.h:189