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

Function vulkan_encode_av1_init

libavcodec/vulkan_encode_av1.c:1222–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1220};
1221
1222static av_cold int vulkan_encode_av1_init(AVCodecContext *avctx)
1223{
1224 int err;
1225 VulkanEncodeAV1Context *enc = avctx->priv_data;
1226 FFVulkanEncodeContext *ctx = &enc->common;
1227 FFHWBaseEncodeContext *base_ctx = &ctx->base;
1228 int flags;
1229
1230 if (avctx->profile == AV_PROFILE_UNKNOWN)
1231 avctx->profile = enc->common.opts.profile;
1232
1233 enc->caps = (VkVideoEncodeAV1CapabilitiesKHR) {
1234 .sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR,
1235 };
1236
1237 enc->quality_props = (VkVideoEncodeAV1QualityLevelPropertiesKHR) {
1238 .sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR,
1239 };
1240
1241 err = ff_vulkan_encode_init(avctx, &enc->common,
1242 &ff_vk_enc_av1_desc, &enc_cb,
1243 &enc->caps, &enc->quality_props);
1244 if (err < 0)
1245 return err;
1246
1247 av_log(avctx, AV_LOG_VERBOSE, "AV1 encoder capabilities:\n");
1248 av_log(avctx, AV_LOG_VERBOSE, " Standard capability flags:\n");
1249 av_log(avctx, AV_LOG_VERBOSE, " per_rate_control_group_min_max_q_index: %i\n",
1250 !!(enc->caps.flags & VK_VIDEO_ENCODE_AV1_CAPABILITY_PER_RATE_CONTROL_GROUP_MIN_MAX_Q_INDEX_BIT_KHR));
1251 av_log(avctx, AV_LOG_VERBOSE, " generate_obu_extension_header: %i\n",
1252 !!(enc->caps.flags & VK_VIDEO_ENCODE_AV1_CAPABILITY_GENERATE_OBU_EXTENSION_HEADER_BIT_KHR));
1253 av_log(avctx, AV_LOG_VERBOSE, " primary_reference_cdf_only: %i\n",
1254 !!(enc->caps.flags & VK_VIDEO_ENCODE_AV1_CAPABILITY_PRIMARY_REFERENCE_CDF_ONLY_BIT_KHR));
1255 av_log(avctx, AV_LOG_VERBOSE, " frame_size_override: %i\n",
1256 !!(enc->caps.flags & VK_VIDEO_ENCODE_AV1_CAPABILITY_FRAME_SIZE_OVERRIDE_BIT_KHR));
1257 av_log(avctx, AV_LOG_VERBOSE, " motion_vector_scaling: %i\n",
1258 !!(enc->caps.flags & VK_VIDEO_ENCODE_AV1_CAPABILITY_MOTION_VECTOR_SCALING_BIT_KHR));
1259 av_log(avctx, AV_LOG_VERBOSE, " Capabilities:\n");
1260 av_log(avctx, AV_LOG_VERBOSE, " 64x64 superblocks: %i\n",
1261 !!(enc->caps.superblockSizes & VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_64_BIT_KHR));
1262 av_log(avctx, AV_LOG_VERBOSE, " 128x128 superblocks: %i\n",
1263 !!(enc->caps.superblockSizes & VK_VIDEO_ENCODE_AV1_SUPERBLOCK_SIZE_128_BIT_KHR));
1264 av_log(avctx, AV_LOG_VERBOSE, " maxSingleReferenceCount: %i\n",
1265 enc->caps.maxSingleReferenceCount);
1266 av_log(avctx, AV_LOG_VERBOSE, " singleReferenceNameMask: 0x%x\n",
1267 enc->caps.singleReferenceNameMask);
1268 av_log(avctx, AV_LOG_VERBOSE, " maxUnidirectionalCompoundReferenceCount: %i\n",
1269 enc->caps.maxUnidirectionalCompoundReferenceCount);
1270 av_log(avctx, AV_LOG_VERBOSE, " maxUnidirectionalCompoundGroup1ReferenceCount: %i\n",
1271 enc->caps.maxUnidirectionalCompoundGroup1ReferenceCount);
1272 av_log(avctx, AV_LOG_VERBOSE, " unidirectionalCompoundReferenceNameMask: 0x%x\n",
1273 enc->caps.unidirectionalCompoundReferenceNameMask);
1274 av_log(avctx, AV_LOG_VERBOSE, " maxBidirectionalCompoundReferenceCount: %i\n",
1275 enc->caps.maxBidirectionalCompoundReferenceCount);
1276 av_log(avctx, AV_LOG_VERBOSE, " maxBidirectionalCompoundGroup1ReferenceCount: %i\n",
1277 enc->caps.maxBidirectionalCompoundGroup1ReferenceCount);
1278 av_log(avctx, AV_LOG_VERBOSE, " maxBidirectionalCompoundGroup2ReferenceCount: %i\n",
1279 enc->caps.maxBidirectionalCompoundGroup2ReferenceCount);

Callers

nothing calls this directly

Calls 7

ff_vulkan_encode_initFunction · 0.85
av_logFunction · 0.85
write_sequence_headerFunction · 0.85
init_enc_optionsFunction · 0.70
init_base_unitsFunction · 0.70
av_malloczFunction · 0.50

Tested by

no test coverage detected