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