| 812 | } |
| 813 | |
| 814 | static av_cold int init_sequence_headers(AVCodecContext *avctx) |
| 815 | { |
| 816 | int err; |
| 817 | VulkanEncodeH264Context *enc = avctx->priv_data; |
| 818 | |
| 819 | FFHWBaseEncodeH264 *units = &enc->units; |
| 820 | FFHWBaseEncodeH264Opts *unit_opts = &enc->unit_opts; |
| 821 | |
| 822 | unit_opts->bit_rate = avctx->bit_rate; |
| 823 | unit_opts->mb_width = FFALIGN(avctx->width, 16) / 16; |
| 824 | unit_opts->mb_height = FFALIGN(avctx->height, 16) / 16; |
| 825 | unit_opts->flags = enc->unit_elems & UNIT_SEI_TIMING ? FF_HW_H264_SEI_TIMING : 0; |
| 826 | |
| 827 | /* cabac already set via an option */ |
| 828 | /* fixed_qp_idr initialized in init_enc_options() */ |
| 829 | /* hrd_buffer_size initialized in init_enc_options() */ |
| 830 | /* initial_buffer_fullness initialized in init_enc_options() */ |
| 831 | |
| 832 | err = ff_hw_base_encode_init_params_h264(&enc->common.base, avctx, |
| 833 | units, unit_opts); |
| 834 | if (err < 0) |
| 835 | return err; |
| 836 | |
| 837 | units->raw_sps.seq_scaling_matrix_present_flag = |
| 838 | !!(enc->caps.stdSyntaxFlags & VK_VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_KHR); |
| 839 | units->raw_pps.pic_scaling_matrix_present_flag = |
| 840 | !!(enc->caps.stdSyntaxFlags & VK_VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_KHR); |
| 841 | units->raw_pps.transform_8x8_mode_flag = |
| 842 | !!(enc->caps.stdSyntaxFlags & VK_VIDEO_ENCODE_H264_STD_TRANSFORM_8X8_MODE_FLAG_SET_BIT_KHR); |
| 843 | |
| 844 | return 0; |
| 845 | } |
| 846 | |
| 847 | typedef struct VulkanH264Units { |
| 848 | StdVideoH264SequenceParameterSet vksps; |
no test coverage detected