MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / vulkan_encode_ffv1_init

Function vulkan_encode_ffv1_init

libavcodec/ffv1enc_vulkan.c:982–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

980}
981
982static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
983{
984 int err;
985 size_t maxsize, max_heap_size, max_host_size;
986 VulkanEncodeFFv1Context *fv = avctx->priv_data;
987 FFV1Context *f = &fv->ctx;
988
989 if ((err = ff_ffv1_common_init(avctx, f)) < 0)
990 return err;
991
992 if (f->ac == 1)
993 f->ac = AC_RANGE_CUSTOM_TAB;
994
995 err = ff_ffv1_encode_setup_plane_info(avctx, avctx->sw_pix_fmt);
996 if (err < 0)
997 return err;
998
999 /* Target version 3 by default */
1000 f->version = 3;
1001
1002 err = ff_ffv1_encode_init(avctx);
1003 if (err < 0)
1004 return err;
1005
1006 /* Rice coding did not support high bit depths */
1007 if (f->bits_per_raw_sample > (f->version > 3 ? 16 : 8)) {
1008 if (f->ac == AC_GOLOMB_RICE) {
1009 av_log(avctx, AV_LOG_WARNING, "bits_per_raw_sample > 8, "
1010 "forcing range coder\n");
1011 f->ac = AC_RANGE_CUSTOM_TAB;
1012 }
1013 }
1014
1015 if (f->version < 4 && avctx->gop_size > 1) {
1016 av_log(avctx, AV_LOG_ERROR, "Using inter frames requires version 4 (-level 4)\n");
1017 return AVERROR_INVALIDDATA;
1018 }
1019
1020 if (f->version == 4 && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
1021 av_log(avctx, AV_LOG_ERROR, "Version 4 is experimental and requires -strict -2\n");
1022 return AVERROR_INVALIDDATA;
1023 }
1024
1025 /* We target version 4.3 */
1026 if (f->version == 4 && f->micro_version > 4)
1027 f->micro_version = 3;
1028
1029 f->num_h_slices = fv->num_h_slices;
1030 f->num_v_slices = fv->num_v_slices;
1031
1032 if (f->num_h_slices <= 0 && f->num_v_slices <= 0) {
1033 if (avctx->slices) {
1034 err = ff_ffv1_encode_determine_slices(avctx);
1035 if (err < 0)
1036 return err;
1037 } else {
1038 f->num_h_slices = 32;
1039 f->num_v_slices = 32;

Callers

nothing calls this directly

Calls 15

ff_ffv1_common_initFunction · 0.85
ff_ffv1_encode_initFunction · 0.85
av_logFunction · 0.85
ff_ffv1_write_extradataFunction · 0.85
ff_vk_initFunction · 0.85
ff_vk_qf_findFunction · 0.85
ff_vk_exec_pool_initFunction · 0.85
ff_ffv1_vk_set_common_slFunction · 0.85
init_rct_search_shaderFunction · 0.85

Tested by

no test coverage detected