20 #include <va/va_enc_h264.h>
153 VAEncMiscParameterRateControl
rc;
156 VAEncMiscParameterBuffer
misc;
157 VAEncMiscParameterHRD
hrd;
160 #if VA_CHECK_VERSION(0, 36, 0)
163 VAEncMiscParameterBuffer
misc;
164 VAEncMiscParameterBufferQualityLevel quality;
176 #define vseq_var(name) vseq->name, name
177 #define vseq_field(name) vseq->seq_fields.bits.name, name
178 #define vvui_field(name) vseq->vui_fields.bits.name, name
179 #define vpic_var(name) vpic->name, name
180 #define vpic_field(name) vpic->pic_fields.bits.name, name
181 #define vslice_var(name) vslice->name, name
182 #define vslice_field(name) vslice->slice_fields.bits.name, name
183 #define mseq_var(name) mseq->name, name
184 #define mslice_var(name) mslice->name, name
187 int nal_unit_type,
int nal_ref_idc)
189 u(1, 0, forbidden_zero_bit);
190 u(2, nal_ref_idc, nal_ref_idc);
191 u(5, nal_unit_type, nal_unit_type);
196 u(1, 1, rbsp_stop_one_bit);
198 u(1, 0, rbsp_alignment_zero_bit);
210 if (vseq->vui_fields.bits.aspect_ratio_info_present_flag) {
212 if (vseq->aspect_ratio_idc == 255) {
218 u(1,
mseq_var(overscan_info_present_flag));
220 u(1,
mseq_var(overscan_appropriate_flag));
222 u(1,
mseq_var(video_signal_type_present_flag));
226 u(1,
mseq_var(colour_description_present_flag));
234 u(1,
mseq_var(chroma_loc_info_present_flag));
236 ue(
mseq_var(chroma_sample_loc_type_top_field));
237 ue(
mseq_var(chroma_sample_loc_type_bottom_field));
241 if (vseq->vui_fields.bits.timing_info_present_flag) {
247 u(1,
mseq_var(nal_hrd_parameters_present_flag));
257 u(5,
mseq_var(initial_cpb_removal_delay_length_minus1));
258 u(5,
mseq_var(cpb_removal_delay_length_minus1));
259 u(5,
mseq_var(dpb_output_delay_length_minus1));
262 u(1,
mseq_var(vcl_hrd_parameters_present_flag));
264 av_assert0(0 &&
"vcl hrd parameters not supported");
273 if (vseq->vui_fields.bits.bitstream_restriction_flag) {
274 av_assert0(0 &&
"bitstream restrictions not supported");
295 u(2, 0, reserved_zero_2bits);
308 if (vseq->seq_fields.bits.chroma_format_idc == 3)
309 u(1,
mseq_var(separate_colour_plane_flag));
314 u(1,
mseq_var(qpprime_y_zero_transform_bypass_flag));
317 if (vseq->seq_fields.bits.seq_scaling_matrix_present_flag) {
318 av_assert0(0 &&
"scaling matrices not supported");
325 if (vseq->seq_fields.bits.pic_order_cnt_type == 0) {
327 }
else if (vseq->seq_fields.bits.pic_order_cnt_type == 1) {
328 u(1,
mseq_var(delta_pic_order_always_zero_flag));
331 ue(
vseq_var(num_ref_frames_in_pic_order_cnt_cycle));
333 for (i = 0; i < vseq->num_ref_frames_in_pic_order_cnt_cycle; i++)
338 u(1,
mseq_var(gaps_in_frame_num_allowed_flag));
340 ue(vseq->picture_width_in_mbs - 1, pic_width_in_mbs_minus1);
341 ue(vseq->picture_height_in_mbs - 1, pic_height_in_mbs_minus1);
344 if (!vseq->seq_fields.bits.frame_mbs_only_flag)
350 if (vseq->frame_cropping_flag) {
357 u(1,
vseq_var(vui_parameters_present_flag));
358 if (vseq->vui_parameters_present_flag)
377 u(1,
mseq_var(bottom_field_pic_order_in_frame_present_flag));
382 av_assert0(0 &&
"slice groups not supported");
391 se(vpic->pic_init_qp - 26, pic_init_qp_minus26);
395 u(1,
vpic_field(deblocking_filter_control_present_flag));
401 if (vpic->pic_fields.bits.pic_scaling_matrix_present_flag) {
402 av_assert0(0 &&
"scaling matrices not supported");
426 ue(vslice->macroblock_address, first_mb_in_slice);
434 u(4 + vseq->seq_fields.bits.log2_max_frame_num_minus4,
436 ((1 << (4 + vseq->seq_fields.bits.log2_max_frame_num_minus4)) - 1)),
439 if (!vseq->seq_fields.bits.frame_mbs_only_flag) {
445 if (vpic->pic_fields.bits.idr_pic_flag) {
449 if (vseq->seq_fields.bits.pic_order_cnt_type == 0) {
450 u(4 + vseq->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4,
458 if (vseq->seq_fields.bits.pic_order_cnt_type == 1 &&
459 !vseq->seq_fields.bits.delta_pic_order_always_zero_flag) {
467 if (vpic->pic_fields.bits.redundant_pic_cnt_present_flag) {
478 u(1,
vslice_var(num_ref_idx_active_override_flag));
479 if (vslice->num_ref_idx_active_override_flag) {
489 if (vslice->slice_type % 5 != 2 && vslice->slice_type % 5 != 4) {
490 u(1,
mslice_var(ref_pic_list_modification_flag_l0));
495 if (vslice->slice_type % 5 == 1) {
496 u(1,
mslice_var(ref_pic_list_modification_flag_l1));
503 if ((vpic->pic_fields.bits.weighted_pred_flag &&
506 (vpic->pic_fields.bits.weighted_bipred_idc == 1 &&
508 av_assert0(0 &&
"prediction weights not supported");
512 vpic->pic_fields.bits.reference_pic_flag);
514 if (vpic->pic_fields.bits.idr_pic_flag) {
518 u(1,
mslice_var(adaptive_ref_pic_marking_mode_flag));
525 if (vpic->pic_fields.bits.entropy_coding_mode_flag &&
539 if (vpic->pic_fields.bits.deblocking_filter_control_present_flag) {
541 if (vslice->disable_deblocking_filter_idc != 1) {
549 av_assert0(0 &&
"slice groups not supported");
569 mseq_var(initial_cpb_removal_delay));
571 mseq_var(initial_cpb_removal_delay_offset));
575 av_assert0(0 &&
"vcl hrd parameters not supported");
591 2 * vseq->num_units_in_tick * priv->
cpb_delay,
594 2 * vseq->num_units_in_tick * priv->
dpb_delay,
602 for (i = 0; i < num_clock_ts; i++) {
603 u(1, 0, clock_timestamp_flag[i]);
614 const char *vaapi = VA_VERSION_S;
615 const char *driver = vaQueryVendorString(ctx->
hwctx->
display);
621 0x59, 0x94, 0x8b, 0x28, 0x11, 0xec, 0x45, 0xaf,
622 0x96, 0x75, 0x19, 0xd4, 0x1f, 0xea, 0xa9, 0x4d,
625 for (i = 0; i < 16; i++)
626 u(8, uuid[i], uuid_iso_iec_11578);
628 snprintf(tmp,
sizeof(tmp),
"%s / VAAPI %s / %s", lavc, vaapi, driver);
629 for (i = 0; i <
sizeof(
tmp) && tmp[i]; i++)
630 u(8, tmp[i], user_data_payload_byte);
640 int payload_type, payload_size, i;
647 for (payload_type = 0; payload_type < 64; payload_type++) {
648 switch (payload_type) {
670 write_payload(&payload_bits, ctx, pic);
672 write_u(&payload_bits, 1, 1, bit_equal_to_one);
674 write_u(&payload_bits, 1, 0, bit_equal_to_zero);
679 u(8, payload_type, last_payload_type_byte);
680 u(8, payload_size, last_payload_size_byte);
681 for (i = 0; i < payload_size; i++)
682 u(8, payload[i] & 0xff, sei_payload);
689 char *
data,
size_t *data_len)
695 size_t nal_len, bit_len, bit_pos, next_len;
705 next_len = bit_len - bit_pos;
718 next_len = bit_len - bit_pos;
733 char *
data,
size_t *data_len)
752 char *
data,
size_t *data_len)
759 if (index == 0 && ctx->
va_rc_mode == VA_RC_CBR) {
760 *type = VAEncPackedHeaderH264_SEI;
785 vseq->seq_parameter_set_id = 0;
787 vseq->level_idc = avctx->
level;
789 vseq->max_num_ref_frames = 2;
791 vseq->picture_width_in_mbs = priv->
mb_width;
792 vseq->picture_height_in_mbs = priv->
mb_height;
794 vseq->seq_fields.bits.chroma_format_idc = 1;
795 vseq->seq_fields.bits.frame_mbs_only_flag = 1;
796 vseq->seq_fields.bits.direct_8x8_inference_flag = 1;
797 vseq->seq_fields.bits.log2_max_frame_num_minus4 = 4;
798 vseq->seq_fields.bits.pic_order_cnt_type = 0;
802 vseq->frame_cropping_flag = 1;
804 vseq->frame_crop_left_offset = 0;
805 vseq->frame_crop_right_offset =
807 vseq->frame_crop_top_offset = 0;
808 vseq->frame_crop_bottom_offset =
811 vseq->frame_cropping_flag = 0;
814 vseq->vui_parameters_present_flag = 1;
816 vseq->vui_fields.bits.aspect_ratio_info_present_flag = 1;
821 vseq->aspect_ratio_idc = 1;
823 vseq->aspect_ratio_idc = 255;
842 vseq->bits_per_second = avctx->
bit_rate;
844 vseq->vui_fields.bits.timing_info_present_flag = 1;
893 vseq->intra_idr_period = vseq->intra_period;
894 vseq->ip_period = ctx->
b_per_p + 1;
898 vpic->CurrPic.picture_id = VA_INVALID_ID;
899 vpic->CurrPic.flags = VA_PICTURE_H264_INVALID;
902 vpic->ReferenceFrames[i].picture_id = VA_INVALID_ID;
903 vpic->ReferenceFrames[i].flags = VA_PICTURE_H264_INVALID;
906 vpic->coded_buf = VA_INVALID_ID;
908 vpic->pic_parameter_set_id = 0;
909 vpic->seq_parameter_set_id = 0;
911 vpic->num_ref_idx_l0_active_minus1 = 0;
912 vpic->num_ref_idx_l1_active_minus1 = 0;
914 vpic->pic_fields.bits.entropy_coding_mode_flag =
915 ((avctx->
profile & 0xff) != 66);
916 vpic->pic_fields.bits.weighted_pred_flag = 0;
917 vpic->pic_fields.bits.weighted_bipred_idc = 0;
918 vpic->pic_fields.bits.transform_8x8_mode_flag =
919 ((avctx->
profile & 0xff) >= 100);
960 vpic->frame_num = vpic->frame_num &
961 ((1 << (4 + vseq->seq_fields.bits.log2_max_frame_num_minus4)) - 1);
964 vpic->CurrPic.frame_idx = vpic->frame_num;
965 vpic->CurrPic.flags = 0;
969 for (i = 0; i < pic->
nb_refs; i++) {
974 vpic->ReferenceFrames[i].flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE;
975 vpic->ReferenceFrames[i].TopFieldOrderCnt = ref->
display_order;
976 vpic->ReferenceFrames[i].BottomFieldOrderCnt = ref->
display_order;
979 vpic->ReferenceFrames[i].picture_id = VA_INVALID_ID;
980 vpic->ReferenceFrames[i].flags = VA_PICTURE_H264_INVALID;
1017 switch (pic->
type) {
1039 vslice->macroblock_address = 0;
1042 vslice->macroblock_info = VA_INVALID_ID;
1044 vslice->pic_parameter_set_id = vpic->pic_parameter_set_id;
1048 ((1 << (4 + vseq->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4)) - 1);
1051 vslice->RefPicList0[i].picture_id = VA_INVALID_ID;
1052 vslice->RefPicList0[i].flags = VA_PICTURE_H264_INVALID;
1053 vslice->RefPicList1[i].picture_id = VA_INVALID_ID;
1054 vslice->RefPicList1[i].flags = VA_PICTURE_H264_INVALID;
1063 vslice->num_ref_idx_l0_active_minus1 = 0;
1064 vslice->RefPicList0[0] = vpic->ReferenceFrames[0];
1070 vslice->num_ref_idx_l1_active_minus1 = 0;
1071 vslice->RefPicList1[0] = vpic->ReferenceFrames[1];
1075 vslice->slice_qp_delta = priv->
fixed_qp_b - vpic->pic_init_qp;
1077 vslice->slice_qp_delta = priv->
fixed_qp_p - vpic->pic_init_qp;
1079 vslice->slice_qp_delta = priv->
fixed_qp_idr - vpic->pic_init_qp;
1081 vslice->direct_spatial_mv_pred_flag = 1;
1090 int hrd_buffer_size;
1091 int hrd_initial_buffer_fullness;
1095 "higher is not supported.\n");
1106 hrd_initial_buffer_fullness = hrd_buffer_size * 3 / 4;
1108 priv->
rc_params.
misc.type = VAEncMiscParameterTypeRateControl;
1109 priv->
rc_params.
rc = (VAEncMiscParameterRateControl) {
1110 .bits_per_second = avctx->
bit_rate,
1111 .target_percentage = 66,
1112 .window_size = 1000,
1113 .initial_qp = (avctx->
qmax >= 0 ? avctx->
qmax : 40),
1114 .min_qp = (avctx->
qmin >= 0 ? avctx->
qmin : 18),
1115 .basic_unit_size = 0,
1124 .initial_buffer_fullness = hrd_initial_buffer_fullness,
1125 .buffer_size = hrd_buffer_size,
1161 "%d / %d / %d for IDR- / P- / B-frames.\n",
1168 static const VAConfigAttrib default_config_attributes[] = {
1169 { .type = VAConfigAttribRTFormat,
1170 .value = VA_RT_FORMAT_YUV420 },
1171 { .type = VAConfigAttribEncPackedHeaders,
1172 .value = (VA_ENC_PACKED_HEADER_SEQUENCE |
1173 VA_ENC_PACKED_HEADER_SLICE) },
1183 ctx->
va_profile = VAProfileH264ConstrainedBaseline;
1193 "is not supported.\n");
1202 "are not supported.\n");
1211 "are not supported.\n");
1219 #if VA_CHECK_VERSION(0, 39, 1)
1223 "supported with this VAAPI version.\n");
1237 for (i = 0; i <
FF_ARRAY_ELEMS(default_config_attributes); i++) {
1239 default_config_attributes[i];
1253 .type = VAConfigAttribRateControl,
1258 #if VA_CHECK_VERSION(0, 36, 0)
1259 priv->quality_params.
misc.type =
1260 VAEncMiscParameterTypeQualityLevel;
1261 priv->quality_params.quality.quality_level = opt->
quality;
1264 &priv->quality_params.
misc;
1266 sizeof(priv->quality_params);
1269 "supported with this VAAPI version.\n");
1283 .sequence_params_size =
sizeof(VAEncSequenceParameterBufferH264),
1286 .picture_params_size =
sizeof(VAEncPictureParameterBufferH264),
1289 .slice_params_size =
sizeof(VAEncSliceParameterBufferH264),
1292 .sequence_header_type = VAEncPackedHeaderSequence,
1295 .slice_header_type = VAEncPackedHeaderH264_Slice,
1306 #define OFFSET(x) (offsetof(VAAPIEncodeContext, codec_options_data) + \
1307 offsetof(VAAPIEncodeH264Options, x))
1308 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
1310 {
"qp",
"Constant QP (for P-frames; scaled by qfactor/qoffset for I/B)",
1312 {
"quality",
"Set encode quality (trades off against speed, higher is faster)",
1314 {
"low_power",
"Use low-power encoding mode (experimental: only supported "
1315 "on some platforms, does not support all features)",
1321 {
"profile",
"100" },
1326 {
"i_qfactor",
"1" },
1327 {
"i_qoffset",
"0" },
1328 {
"b_qfactor",
"6/5" },
1329 {
"b_qoffset",
"0" },
1341 .
name =
"h264_vaapi",
1350 .priv_class = &vaapi_encode_h264_class,
1352 .
defaults = vaapi_encode_h264_defaults,
#define FF_PROFILE_H264_MAIN
unsigned int colour_primaries
#define FF_PROFILE_H264_CAVLC_444
VAEntrypoint va_entrypoint
ptrdiff_t const GLvoid * data
static void vaapi_encode_h264_write_slice_header2(PutBitContext *pbc, VAAPIEncodeContext *ctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t bit_rate
the average bitrate
#define LIBAVUTIL_VERSION_INT
unsigned int cpb_removal_delay_length_minus1
static av_cold int init(AVCodecContext *avctx)
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
char overscan_info_present_flag
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
#define FF_PROFILE_H264_INTRA
static void vaapi_encode_h264_write_pic_timing(PutBitContext *pbc, VAAPIEncodeContext *ctx, VAAPIEncodePicture *pic)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
char adaptive_ref_pic_marking_mode_flag
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * codec_sequence_params
VAEncMiscParameterHRD hrd
VAEncMiscParameterBuffer misc
float i_quant_offset
qscale offset between P and I-frames
static const AVClass vaapi_encode_h264_class
#define FF_PROFILE_H264_HIGH_444_PREDICTIVE
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static void vaapi_encode_h264_write_nal_header(PutBitContext *pbc, int nal_unit_type, int nal_ref_idc)
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...
static int vaapi_encode_h264_write_extra_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static VAAPIEncodeType vaapi_encode_type_h264
static const AVOption vaapi_encode_h264_options[]
#define FF_PROFILE_H264_BASELINE
unsigned int cpb_size_value_minus1[32]
static const AVCodecDefault vaapi_encode_h264_defaults[]
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...
char delta_pic_order_always_zero_flag
static void vaapi_encode_h264_write_vui(PutBitContext *pbc, VAAPIEncodeContext *ctx)
unsigned int transfer_characteristics
char constraint_set3_flag
av_cold int ff_vaapi_encode_init(AVCodecContext *avctx, const VAAPIEncodeType *type)
static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
char fixed_frame_rate_flag
unsigned int bit_rate_scale
char constraint_set5_flag
static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)
#define AVERROR_EOF
End of file.
#define FF_PROFILE_H264_EXTENDED
static void vaapi_encode_h264_write_pps(PutBitContext *pbc, VAAPIEncodeContext *ctx)
VASurfaceID recon_surface
unsigned int cpb_cnt_minus1
H.264 common definitions.
unsigned int initial_cpb_removal_delay_offset
VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int qmax
maximum quantizer
int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *input_image, int *got_packet)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
char constraint_set2_flag
VAEncMiscParameterBuffer * global_params[MAX_GLOBAL_PARAMS]
#define FF_PROFILE_H264_HIGH_422
#define FF_PROFILE_H264_HIGH
static av_cold int vaapi_encode_h264_init_fixed_qp(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_...
char ref_pic_list_modification_flag_l0
char colour_description_present_flag
static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
void * codec_picture_params
#define write_u(pbc, width, value, name)
char constraint_set1_flag
static int put_bits_count(PutBitContext *s)
int rc_buffer_size
decoder bitstream buffer size
char gaps_in_frame_num_allowed_flag
unsigned int video_format
common internal API header
static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB]
AVCodec ff_h264_vaapi_encoder
static void vaapi_encode_h264_write_sps(PutBitContext *pbc, VAAPIEncodeContext *ctx)
static void vaapi_encode_h264_write_buffering_period(PutBitContext *pbc, VAAPIEncodeContext *ctx, VAAPIEncodePicture *pic)
char constraint_set0_flag
static int vaapi_encode_h264_write_sequence_header(AVCodecContext *avctx, char *data, size_t *data_len)
unsigned int cpb_size_scale
struct VAAPIEncodeH264Context::@130 hrd_params
struct VAAPIEncodeH264Context::@129 rc_params
int width
picture width / height.
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
#define FF_PROFILE_UNKNOWN
char separate_colour_plane_flag
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
unsigned int num_slice_groups_minus1
unsigned int time_offset_length
void * codec_picture_params
buffering period (H.264, D.1.1)
char video_full_range_flag
static int vaapi_encode_h264_write_slice_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
#define FF_ARRAY_ELEMS(a)
char vcl_hrd_parameters_present_flag
VADisplay display
The VADisplay handle, to be filled by the user.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
unsigned int colour_plane_id
Libavcodec external API header.
unsigned int chroma_sample_loc_type_top_field
unsigned int slice_group_map_type
#define FF_PROFILE_H264_HIGH_422_INTRA
unsigned int bit_rate_value_minus1[32]
main external API structure.
char long_term_reference_flag
int qmin
minimum quantizer
char chroma_loc_info_present_flag
char ref_pic_list_modification_flag_l1
char no_output_of_prior_pics_flag
#define FF_PROFILE_H264_HIGH_10_INTRA
Describe the class of an AVClass context structure.
unsigned int dpb_output_delay_length_minus1
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
char bottom_field_pic_order_in_frame_present_flag
unsigned int redundant_pic_cnt
#define FF_PROFILE_H264_HIGH_444
float b_quant_offset
qscale offset between IP and B-frames
static enum AVPixelFormat pix_fmts[]
unsigned int nal_unit_type
unsigned int initial_cpb_removal_delay_length_minus1
VAAPIEncodeH264MiscSliceParams misc_slice_params
static av_cold int vaapi_encode_h264_init_internal(AVCodecContext *avctx)
char video_signal_type_present_flag
size_t global_params_size[MAX_GLOBAL_PARAMS]
unsigned int chroma_sample_loc_type_bottom_field
static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
VAEncMiscParameterRateControl rc
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static int ref[MAX_W *MAX_W]
unsigned int initial_cpb_removal_delay
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void vaapi_encode_h264_write_sei(PutBitContext *pbc, VAAPIEncodeContext *ctx, VAAPIEncodePicture *pic)
static av_cold int vaapi_encode_h264_init_constant_bitrate(AVCodecContext *avctx)
char bitstream_restriction_flag
char qpprime_y_zero_transform_bypass_flag
void * codec_slice_params
#define FF_PROFILE_H264_HIGH_444_INTRA
char nal_hrd_parameters_present_flag
static void vaapi_encode_h264_write_trailing_rbsp(PutBitContext *pbc)
static const AVCodecDefault defaults[]
#define FF_PROFILE_H264_CONSTRAINED
#define FF_PROFILE_H264_CONSTRAINED_BASELINE
char overscan_appropriate_flag
char pic_struct_present_flag
#define FF_PROFILE_H264_HIGH_10
AVPixelFormat
Pixel format.
static void vaapi_encode_h264_write_identifier(PutBitContext *pbc, VAAPIEncodeContext *ctx, VAAPIEncodePicture *pic)
VAAPIEncodeH264MiscSequenceParams misc_sequence_params
unsigned int matrix_coefficients
int ff_vaapi_encode_h26x_nal_unit_to_byte_stream(uint8_t *dst, size_t *dst_bit_len, uint8_t *src, size_t src_bit_len)
AVVAAPIDeviceContext * hwctx
char constraint_set4_flag