20 #include <va/va_enc_hevc.h>
35 #define MAX_ST_REF_PIC_SETS 32
36 #define MAX_DPB_PICS 16
189 VAEncMiscParameterRateControl
rc;
192 VAEncMiscParameterBuffer
misc;
193 VAEncMiscParameterHRD
hrd;
202 #define vseq_var(name) vseq->name, name
203 #define vseq_field(name) vseq->seq_fields.bits.name, name
204 #define vpic_var(name) vpic->name, name
205 #define vpic_field(name) vpic->pic_fields.bits.name, name
206 #define vslice_var(name) vslice->name, name
207 #define vslice_field(name) vslice->slice_fields.bits.name, name
208 #define mseq_var(name) mseq->name, name
209 #define mslice_var(name) mslice->name, name
210 #define mstrps_var(name) mstrps->name, name
215 u(1, 0, forbidden_zero_bit);
216 u(6, nal_unit_type, nal_unit_type);
217 u(6, 0, nuh_layer_id);
218 u(3, 1, nuh_temporal_id_plus1);
223 u(1, 1, rbsp_stop_one_bit);
225 u(1, 0, rbsp_alignment_zero_bit);
237 u(2, 0, general_profile_space);
241 for (j = 0; j < 32; j++) {
242 u(1,
mseq_var(general_profile_compatibility_flag[j]));
245 u(1,
mseq_var(general_progressive_source_flag));
246 u(1,
mseq_var(general_interlaced_source_flag));
247 u(1,
mseq_var(general_non_packed_constraint_flag));
248 u(1,
mseq_var(general_frame_only_constraint_flag));
255 u(23, 0, general_reserved_zero_43bits);
256 u(20, 0, general_reserved_zero_43bits);
259 if (vseq->general_profile_idc >= 1 && vseq->general_profile_idc <= 5) {
262 u(1, 0, general_reserved_zero_bit);
282 u(1, 1, vps_base_layer_internal_flag);
283 u(1, 1, vps_base_layer_available_flag);
285 u(3,
mseq_var(vps_max_sub_layers_minus1));
286 u(1,
mseq_var(vps_temporal_id_nesting_flag));
288 u(16, 0xffff, vps_reserved_0xffff_16bits);
292 u(1,
mseq_var(vps_sub_layer_ordering_info_present_flag));
295 i <= mseq->vps_max_sub_layers_minus1; i++) {
296 ue(
mseq_var(vps_max_dec_pic_buffering_minus1[i]));
298 ue(
mseq_var(vps_max_latency_increase_plus1[i]));
305 u(1,
mseq_var(layer_id_included_flag[i][j]));
308 u(1,
mseq_var(vps_timing_info_present_flag));
310 u(1, 0, put_bits_hack_zero_bit);
312 u(1, 0, put_bits_hack_zero_bit);
314 u(1,
mseq_var(vps_poc_proportional_to_timing_flag));
318 ue(0, vps_num_hrd_parameters);
321 u(1, 0, vps_extension_flag);
333 u(1,
mstrps_var(inter_ref_pic_set_prediction_flag));
336 av_assert0(0 &&
"inter ref pic set prediction not supported");
358 u(1,
mseq_var(aspect_ratio_info_present_flag));
367 u(1, 0, overscan_info_present_flag);
369 u(1,
mseq_var(video_signal_type_present_flag));
373 u(1,
mseq_var(colour_description_present_flag));
381 u(1, 0, chroma_loc_info_present_flag);
382 u(1, 0, neutral_chroma_indication_flag);
383 u(1, 0, field_seq_flag);
384 u(1, 0, frame_field_info_present_flag);
385 u(1, 0, default_display_window_flag);
386 u(1, 0, vui_timing_info_present_flag);
387 u(1, 0, bitstream_restriction_flag_flag);
402 u(3,
mseq_var(sps_max_sub_layers_minus1));
403 u(1,
mseq_var(sps_temporal_id_nesting_flag));
409 if (vseq->seq_fields.bits.chroma_format_idc == 3)
410 u(1, 0, separate_colour_plane_flag);
426 ue(
mseq_var(log2_max_pic_order_cnt_lsb_minus4));
428 u(1,
mseq_var(sps_sub_layer_ordering_info_present_flag));
431 i <= mseq->sps_max_sub_layers_minus1; i++) {
432 ue(
mseq_var(sps_max_dec_pic_buffering_minus1[i]));
434 ue(
mseq_var(sps_max_latency_increase_plus1[i]));
437 ue(
vseq_var(log2_min_luma_coding_block_size_minus3));
438 ue(
vseq_var(log2_diff_max_min_luma_coding_block_size));
439 ue(
vseq_var(log2_min_transform_block_size_minus2));
440 ue(
vseq_var(log2_diff_max_min_transform_block_size));
441 ue(
vseq_var(max_transform_hierarchy_depth_inter));
442 ue(
vseq_var(max_transform_hierarchy_depth_intra));
445 if (vseq->seq_fields.bits.scaling_list_enabled_flag) {
446 u(1, 0, sps_scaling_list_data_present_flag);
450 u(1,
vseq_field(sample_adaptive_offset_enabled_flag));
453 if (vseq->seq_fields.bits.pcm_enabled_flag) {
454 u(4,
vseq_var(pcm_sample_bit_depth_luma_minus1));
455 u(4,
vseq_var(pcm_sample_bit_depth_chroma_minus1));
456 ue(
vseq_var(log2_min_pcm_luma_coding_block_size_minus3));
457 ue(vseq->log2_max_pcm_luma_coding_block_size_minus3 -
458 vseq->log2_min_pcm_luma_coding_block_size_minus3,
459 log2_diff_max_min_pcm_luma_coding_block_size);
468 u(1,
mseq_var(long_term_ref_pics_present_flag));
470 ue(0, num_long_term_ref_pics_sps);
474 u(1,
vseq_field(strong_intra_smoothing_enabled_flag));
476 u(1,
mseq_var(vui_parameters_present_flag));
481 u(1, 0, sps_extension_present_flag);
496 ue(vpic->slice_pic_parameter_set_id, pps_pic_parameter_set_id);
499 u(1,
vpic_field(dependent_slice_segments_enabled_flag));
500 u(1,
mseq_var(output_flag_present_flag));
501 u(3,
mseq_var(num_extra_slice_header_bits));
505 ue(
vpic_var(num_ref_idx_l0_default_active_minus1));
506 ue(
vpic_var(num_ref_idx_l1_default_active_minus1));
508 se(vpic->pic_init_qp - 26, init_qp_minus26);
514 if (vpic->pic_fields.bits.cu_qp_delta_enabled_flag)
520 u(1,
mseq_var(pps_slice_chroma_qp_offsets_present_flag));
525 u(1,
vpic_field(entropy_coding_sync_enabled_flag));
527 if (vpic->pic_fields.bits.tiles_enabled_flag) {
532 for (i = 0; i < vpic->num_tile_columns_minus1; i++)
534 for (i = 0; i < vpic->num_tile_rows_minus1; i++)
537 u(1,
vpic_field(loop_filter_across_tiles_enabled_flag));
540 u(1,
vpic_field(pps_loop_filter_across_slices_enabled_flag));
541 u(1,
mseq_var(deblocking_filter_control_present_flag));
543 u(1,
mseq_var(deblocking_filter_override_enabled_flag));
544 u(1,
mseq_var(pps_deblocking_filter_disabled_flag));
551 u(1, 0, pps_scaling_list_data_present_flag);
554 u(1,
mseq_var(lists_modification_present_flag));
555 ue(
vpic_var(log2_parallel_merge_level_minus2));
556 u(1, 0, slice_segment_header_extension_present_flag);
557 u(1, 0, pps_extension_present_flag);
580 vpic->nal_unit_type <= 23)
586 if (vpic->pic_fields.bits.dependent_slice_segments_enabled_flag)
591 if (!vslice->slice_fields.bits.dependent_slice_segment_flag) {
597 u(1, 1, pic_output_flag);
598 if (vseq->seq_fields.bits.separate_colour_plane_flag)
605 slice_pic_order_cnt_lsb);
620 if (vseq->seq_fields.bits.sps_temporal_mvp_enabled_flag) {
624 if (vseq->seq_fields.bits.sample_adaptive_offset_enabled_flag) {
626 if (!vseq->seq_fields.bits.separate_colour_plane_flag &&
627 vseq->seq_fields.bits.chroma_format_idc != 0) {
632 if (vslice->slice_type ==
P_SLICE || vslice->slice_type ==
B_SLICE) {
634 if (vslice->slice_fields.bits.num_ref_idx_active_override_flag) {
636 if (vslice->slice_type ==
B_SLICE) {
645 if (vslice->slice_type ==
B_SLICE) {
651 if (vslice->slice_fields.bits.slice_temporal_mvp_enabled_flag) {
652 if (vslice->slice_type ==
B_SLICE)
654 ue(vpic->collocated_ref_pic_index, collocated_ref_idx);
656 if ((vpic->pic_fields.bits.weighted_pred_flag &&
657 vslice->slice_type ==
P_SLICE) ||
658 (vpic->pic_fields.bits.weighted_bipred_flag &&
659 vslice->slice_type ==
B_SLICE)) {
663 ue(5 - vslice->max_num_merge_cand, five_minus_max_num_merge_cand);
672 u(1, 0, cu_chroma_qp_offset_enabled_flag);
679 if (!vslice->slice_fields.bits.slice_deblocking_filter_disabled_flag) {
684 if (vpic->pic_fields.bits.pps_loop_filter_across_slices_enabled_flag &&
685 (vslice->slice_fields.bits.slice_sao_luma_flag ||
686 vslice->slice_fields.bits.slice_sao_chroma_flag ||
687 vslice->slice_fields.bits.slice_deblocking_filter_disabled_flag)) {
688 u(1,
vslice_field(slice_loop_filter_across_slices_enabled_flag));
692 if (vpic->pic_fields.bits.tiles_enabled_flag ||
693 vpic->pic_fields.bits.entropy_coding_sync_enabled_flag) {
702 u(1, 1, alignment_bit_equal_to_one);
704 u(1, 0, alignment_bit_equal_to_zero);
708 char *
data,
size_t *data_len)
714 size_t nal_len, bit_len, bit_pos, next_len;
724 next_len = bit_len - bit_pos;
737 next_len = bit_len - bit_pos;
750 next_len = bit_len - bit_pos;
765 char *
data,
size_t *data_len)
792 vseq->general_profile_idc = 1;
793 vseq->general_tier_flag = 0;
795 vseq->general_level_idc = avctx->
level * 3;
797 vseq->intra_period = 0;
798 vseq->intra_idr_period = 0;
804 vseq->seq_fields.bits.chroma_format_idc = 1;
805 vseq->seq_fields.bits.separate_colour_plane_flag = 0;
806 vseq->seq_fields.bits.bit_depth_luma_minus8 = 0;
807 vseq->seq_fields.bits.bit_depth_chroma_minus8 = 0;
813 vseq->log2_min_luma_coding_block_size_minus3 = 0;
814 vseq->log2_diff_max_min_luma_coding_block_size = 2;
816 vseq->log2_min_transform_block_size_minus2 = 0;
817 vseq->log2_diff_max_min_transform_block_size = 3;
819 vseq->max_transform_hierarchy_depth_inter = 3;
820 vseq->max_transform_hierarchy_depth_intra = 3;
822 vseq->vui_parameters_present_flag = 0;
824 vseq->bits_per_second = avctx->
bit_rate;
834 vseq->intra_idr_period = vseq->intra_period;
835 vseq->ip_period = ctx->
b_per_p + 1;
839 vpic->decoded_curr_pic.picture_id = VA_INVALID_ID;
840 vpic->decoded_curr_pic.flags = VA_PICTURE_HEVC_INVALID;
843 vpic->reference_frames[i].picture_id = VA_INVALID_ID;
844 vpic->reference_frames[i].flags = VA_PICTURE_HEVC_INVALID;
847 vpic->collocated_ref_pic_index = 0xff;
849 vpic->last_picture = 0;
853 vpic->diff_cu_qp_delta_depth = 0;
854 vpic->pps_cb_qp_offset = 0;
855 vpic->pps_cr_qp_offset = 0;
859 vpic->log2_parallel_merge_level_minus2 = 0;
862 vpic->ctu_max_bitsize_allowed = 0;
864 vpic->num_ref_idx_l0_default_active_minus1 = 0;
865 vpic->num_ref_idx_l1_default_active_minus1 = 0;
867 vpic->slice_pic_parameter_set_id = 0;
869 vpic->pic_fields.bits.screen_content_flag = 0;
870 vpic->pic_fields.bits.enable_gpu_weighted_prediction = 0;
871 vpic->pic_fields.bits.cu_qp_delta_enabled_flag = 1;
884 for (i = 0; i < 32; i++) {
886 (i == vseq->general_profile_idc);
971 vpic->decoded_curr_pic.pic_order_cnt =
973 vpic->decoded_curr_pic.flags = 0;
975 for (i = 0; i < pic->
nb_refs; i++) {
979 vpic->reference_frames[i].pic_order_cnt =
981 vpic->reference_frames[i].flags =
983 VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) |
985 VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0);
988 vpic->reference_frames[i].picture_id = VA_INVALID_ID;
989 vpic->reference_frames[i].flags = VA_PICTURE_HEVC_INVALID;
997 vpic->pic_fields.bits.idr_pic_flag = 1;
998 vpic->pic_fields.bits.coding_type = 1;
999 vpic->pic_fields.bits.reference_pic_flag = 1;
1003 vpic->pic_fields.bits.idr_pic_flag = 0;
1004 vpic->pic_fields.bits.coding_type = 1;
1005 vpic->pic_fields.bits.reference_pic_flag = 1;
1009 vpic->pic_fields.bits.idr_pic_flag = 0;
1010 vpic->pic_fields.bits.coding_type = 2;
1011 vpic->pic_fields.bits.reference_pic_flag = 1;
1015 vpic->pic_fields.bits.idr_pic_flag = 0;
1016 vpic->pic_fields.bits.coding_type = 3;
1017 vpic->pic_fields.bits.reference_pic_flag = 0;
1050 switch (pic->
type) {
1065 vslice->slice_pic_parameter_set_id = vpic->slice_pic_parameter_set_id;
1070 vslice->ref_pic_list0[i].picture_id = VA_INVALID_ID;
1071 vslice->ref_pic_list0[i].flags = VA_PICTURE_HEVC_INVALID;
1072 vslice->ref_pic_list1[i].picture_id = VA_INVALID_ID;
1073 vslice->ref_pic_list1[i].flags = VA_PICTURE_HEVC_INVALID;
1082 vslice->num_ref_idx_l0_active_minus1 = 0;
1083 vslice->ref_pic_list0[0] = vpic->reference_frames[0];
1089 vslice->num_ref_idx_l1_active_minus1 = 0;
1090 vslice->ref_pic_list1[0] = vpic->reference_frames[1];
1093 vslice->max_num_merge_cand = 5;
1096 vslice->slice_qp_delta = priv->
fixed_qp_b - vpic->pic_init_qp;
1098 vslice->slice_qp_delta = priv->
fixed_qp_p - vpic->pic_init_qp;
1100 vslice->slice_qp_delta = priv->
fixed_qp_idr - vpic->pic_init_qp;
1102 vslice->slice_fields.bits.last_slice_of_pic_flag = 1;
1124 for (i = 0; i < pic->
nb_refs; i++) {
1125 if (pic->
refs[i] == st)
1158 int hrd_buffer_size;
1159 int hrd_initial_buffer_fullness;
1163 "higher is not supported.\n");
1174 hrd_initial_buffer_fullness = hrd_buffer_size * 3 / 4;
1176 priv->
rc_params.
misc.type = VAEncMiscParameterTypeRateControl;
1177 priv->
rc_params.
rc = (VAEncMiscParameterRateControl) {
1178 .bits_per_second = avctx->
bit_rate,
1179 .target_percentage = 66,
1180 .window_size = 1000,
1181 .initial_qp = (avctx->
qmax >= 0 ? avctx->
qmax : 40),
1182 .min_qp = (avctx->
qmin >= 0 ? avctx->
qmin : 20),
1183 .basic_unit_size = 0,
1192 .initial_buffer_fullness = hrd_initial_buffer_fullness,
1193 .buffer_size = hrd_buffer_size,
1229 "%d / %d / %d for IDR- / P- / B-frames.\n",
1236 static const VAConfigAttrib default_config_attributes[] = {
1237 { .type = VAConfigAttribRTFormat,
1238 .value = VA_RT_FORMAT_YUV420 },
1239 { .type = VAConfigAttribEncPackedHeaders,
1240 .value = (VA_ENC_PACKED_HEADER_SEQUENCE |
1241 VA_ENC_PACKED_HEADER_SLICE) },
1255 "is not supported.\n");
1275 for (i = 0; i <
FF_ARRAY_ELEMS(default_config_attributes); i++) {
1277 default_config_attributes[i];
1291 .type = VAConfigAttribRateControl,
1305 .sequence_params_size =
sizeof(VAEncSequenceParameterBufferHEVC),
1308 .picture_params_size =
sizeof(VAEncPictureParameterBufferHEVC),
1311 .slice_params_size =
sizeof(VAEncSliceParameterBufferHEVC),
1314 .sequence_header_type = VAEncPackedHeaderSequence,
1317 .slice_header_type = VAEncPackedHeaderHEVC_Slice,
1326 #define OFFSET(x) (offsetof(VAAPIEncodeContext, codec_options_data) + \
1327 offsetof(VAAPIEncodeH265Options, x))
1328 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
1330 {
"qp",
"Constant QP (for P-frames; scaled by qfactor/qoffset for I/B)",
1341 {
"i_qfactor",
"1.0" },
1342 {
"i_qoffset",
"0.0" },
1343 {
"b_qfactor",
"1.2" },
1344 {
"b_qoffset",
"0.0" },
1356 .
name =
"hevc_vaapi",
1365 .priv_class = &vaapi_encode_h265_class,
1367 .
defaults = vaapi_encode_h265_defaults,
char pps_deblocking_filter_disabled_flag
char general_progressive_source_flag
unsigned int conf_win_bottom_offset
unsigned int delta_poc_s0_minus1[MAX_DPB_PICS]
#define MAX_ST_REF_PIC_SETS
static void vaapi_encode_h265_write_vps(PutBitContext *pbc, VAAPIEncodeContext *ctx)
VAEntrypoint va_entrypoint
ptrdiff_t const GLvoid * data
char no_output_of_prior_pics_flag
unsigned int num_short_term_ref_pic_sets
int64_t bit_rate
the average bitrate
#define LIBAVUTIL_VERSION_INT
char deblocking_filter_control_present_flag
static av_cold int init(AVCodecContext *avctx)
char long_term_ref_pics_present_flag
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
static void vaapi_encode_h265_write_vui_parameters(PutBitContext *pbc, VAAPIEncodeContext *ctx)
char pps_slice_chroma_qp_offsets_present_flag
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
unsigned int vps_num_ticks_poc_diff_minus1
static const AVClass vaapi_encode_h265_class
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 sps_sub_layer_ordering_info_present_flag
char vps_sub_layer_ordering_info_present_flag
struct VAAPIEncodeH265Context::@116 rc_params
VAAPIEncodeH265MiscSliceParams misc_slice_params
unsigned int video_parameter_set_id
void * codec_sequence_params
static const AVCodecDefault vaapi_encode_h265_defaults[]
float i_quant_offset
qscale offset between P and I-frames
struct VAAPIEncodeH265Context::@117 hrd_params
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
unsigned int conf_win_top_offset
char general_interlaced_source_flag
unsigned int video_format
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...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static VAAPIEncodeType vaapi_encode_type_h265
unsigned int delta_poc_s1_minus1[MAX_DPB_PICS]
unsigned int seq_parameter_set_id
char general_non_packed_constraint_flag
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...
#define FF_PROFILE_HEVC_MAIN
unsigned int num_extra_slice_header_bits
av_cold int ff_vaapi_encode_init(AVCodecContext *avctx, const VAAPIEncodeType *type)
#define AV_LOG_VERBOSE
Detailed information.
VASurfaceID recon_surface
char vui_parameters_present_flag
unsigned int vps_max_dec_pic_buffering_minus1[MAX_LAYERS]
#define FF_PROFILE_HEVC_MAIN_10
unsigned int conf_win_right_offset
char layer_id_included_flag[MAX_LAYERS][64]
VAEncMiscParameterHRD hrd
VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void vaapi_encode_h265_write_slice_header2(PutBitContext *pbc, VAAPIEncodeContext *ctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
unsigned int transfer_characteristics
static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
VAEncMiscParameterRateControl rc
char lists_modification_present_flag
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. ...
unsigned int colour_primaries
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
VAEncMiscParameterBuffer * global_params[MAX_GLOBAL_PARAMS]
static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
simple assert() macros that are a bit more flexible than ISO C assert().
char general_profile_compatibility_flag[32]
VAAPIEncodeH265MiscSequenceParams misc_sequence_params
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_...
static const AVOption vaapi_encode_h265_options[]
#define vslice_field(name)
char vps_poc_proportional_to_timing_flag
void * codec_picture_params
unsigned int vps_time_scale
unsigned int vps_max_layers_minus1
static int put_bits_count(PutBitContext *s)
int rc_buffer_size
decoder bitstream buffer size
static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
common internal API header
char cabac_init_present_flag
unsigned int vps_max_num_reorder_pics[MAX_LAYERS]
char aspect_ratio_info_present_flag
static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB]
int width
picture width / height.
char used_by_curr_pic_s0_flag[MAX_DPB_PICS]
#define FF_PROFILE_UNKNOWN
AVCodec ff_hevc_vaapi_encoder
unsigned int slice_segment_address
static av_cold int vaapi_encode_h265_init_constant_bitrate(AVCodecContext *avctx)
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
struct VAAPIEncodePicture * next
unsigned int log2_max_pic_order_cnt_lsb_minus4
void * codec_picture_params
unsigned int vps_max_layer_id
static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
static void vaapi_encode_h265_write_pps(PutBitContext *pbc, VAAPIEncodeContext *ctx)
unsigned int sps_max_sub_layers_minus1
static void vaapi_encode_h265_write_sps(PutBitContext *pbc, VAAPIEncodeContext *ctx)
static av_cold int vaapi_encode_h265_init_internal(AVCodecContext *avctx)
unsigned int conf_win_left_offset
char deblocking_filter_override_flag
#define FF_ARRAY_ELEMS(a)
struct VAAPIEncodeH265MiscSequenceParams::@115 lt_ref_pic
unsigned int sps_max_dec_pic_buffering_minus1[MAX_LAYERS]
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
static av_cold int vaapi_encode_h265_init_fixed_qp(AVCodecContext *avctx)
static void vaapi_encode_h265_write_nal_unit_header(PutBitContext *pbc, int nal_unit_type)
char conformance_window_flag
static int vaapi_encode_h265_write_slice_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
Libavcodec external API header.
char video_signal_type_present_flag
VAAPIEncodePicture * pic_start
unsigned int num_positive_pics
unsigned int vps_max_sub_layers_minus1
main external API structure.
int qmin
minimum quantizer
unsigned int vps_max_latency_increase_plus1[MAX_LAYERS]
char used_by_curr_pic_s1_flag[MAX_DPB_PICS]
char vps_timing_info_present_flag
Describe the class of an AVClass context structure.
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
char sps_temporal_id_nesting_flag
char short_term_ref_pic_set_sps_flag
VAEncMiscParameterBuffer misc
unsigned int sps_max_num_reorder_pics[MAX_LAYERS]
float b_quant_offset
qscale offset between IP and B-frames
unsigned int num_negative_pics
static enum AVPixelFormat pix_fmts[]
static int vaapi_encode_h265_write_sequence_header(AVCodecContext *avctx, char *data, size_t *data_len)
static void vaapi_encode_h265_write_st_ref_pic_set(PutBitContext *pbc, int st_rps_idx, VAAPIEncodeH265STRPS *mstrps)
size_t global_params_size[MAX_GLOBAL_PARAMS]
char uniform_spacing_flag
VAAPIEncodeH265STRPS st_ref_pic_set
unsigned int vps_num_units_in_tick
unsigned int num_long_term_ref_pics_sps
char output_flag_present_flag
char video_full_range_flag
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 vps_num_layer_sets_minus1
char deblocking_filter_override_enabled_flag
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void vaapi_encode_h265_write_profile_tier_level(PutBitContext *pbc, VAAPIEncodeContext *ctx)
char colour_description_present_flag
char inter_ref_pic_set_prediction_flag
unsigned int sps_max_latency_increase_plus1[MAX_LAYERS]
char used_by_curr_pic_lt_sps_flag
static const float matrix_coeffs[8]
char vps_temporal_id_nesting_flag
void * codec_slice_params
VAAPIEncodeH265STRPS st_ref_pic_set[MAX_ST_REF_PIC_SETS]
char slice_reserved_flag[8]
static void vaapi_encode_h265_write_rbsp_trailing_bits(PutBitContext *pbc)
unsigned int aspect_ratio_idc
unsigned int lt_ref_pic_poc_lsb_sps
char general_frame_only_constraint_flag
unsigned int short_term_ref_pic_idx
static const AVCodecDefault defaults[]
unsigned int matrix_coeffs
char first_slice_segment_in_pic_flag
AVPixelFormat
Pixel format.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
char pps_slice_chroma_offset_list_enabled_flag
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)