From patchwork Thu Jun 7 23:43:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 9317 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp195495jad; Thu, 7 Jun 2018 16:48:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKN+3GNnmxuKWDj90sESA1jsnRu3WYZVrly/yDI2HUCAKFwQkmSugMbeGPPLs5ynS0NPdgG X-Received: by 2002:adf:ca03:: with SMTP id o3-v6mr3166188wrh.148.1528415301348; Thu, 07 Jun 2018 16:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528415301; cv=none; d=google.com; s=arc-20160816; b=cOmAk69Ds9dlfpYLluwra12yLrYfZRlSVput1FeXsxmJNrKGemhh0L3oYct3HkZzGH B91kIdWCML57AXoju0K6QP219abOq8TLD7ceYkD2GbMmTlbrNa37Fd5hbFXyEme+0I0b hW1fPoNVCdw7BaKtobxtp3z1M2h9T1s4EDr8tACBgL3MxOXK7tqswztxes/gzIBsmuTt Oncz0LFv/xdytdLOimttsKnF0BxGv0Wv96NjyLRwfTFUK6guLjoe+GlLpZ3tKX3QdYQG WIvqZ6E891kY7+2/HT0jHG3qaoSgkkjqS+n7jQ1OK/ALs90gYggSc3PzfdC2MEehsdOY 84VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=Oyji3G1SNSOcH9EUgYcIXyqkErPtS3dg5EY+uZThdBA=; b=csqSRC8G7gVdBI+4oL6bK8qILNyo1x2Y+BciJm71+5oz3sA2aXnIuFILwz9p5BHbvq 6DkzgvAJUdfXTeL3ciW9BzSBXeQAzbnxgRoXHn9MXSXo85zFfKYYglcvS85jW/o5GKUs 0HAWg5zfwjk5OhcKAVyYEy8hhXjiVx26zx56nMCeucqXYM2EdtMeQ5aBsUIyAa0npJyv Q7yw4Jl9BpYZwwmaAZ6BN1kG+nw3BwnOL2Hw70Fep+dnrIe5HZGuCUHeJfNE04NB9c76 xJu7slMzLsGkqiQ1O+m0ODDYot0D0dvC3yJaZLP2GA8pntUUVrrPGP2TpJ8jHrFow1KO 1feQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=HNyECRlQ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z1-v6si25561429wrp.309.2018.06.07.16.48.20; Thu, 07 Jun 2018 16:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=HNyECRlQ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1708068A897; Fri, 8 Jun 2018 02:43:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2765468A57D for ; Fri, 8 Jun 2018 02:43:27 +0300 (EEST) Received: by mail-wm0-f43.google.com with SMTP id x6-v6so233783wmc.3 for ; Thu, 07 Jun 2018 16:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=suJKhbqmvGDkGJi4vxcc/uK6cffGn6mvwuouV+TRLt0=; b=HNyECRlQwVvchFWyHcNk6DvEq2s+Uirk8nerln4O+BNiWohklLw+yahXGiXz4GE4MI xH+4njQ/o6vLNqqujWVVkxix/gRobck42DD29A44TZP0L1cGAE/tcXGnN8NHPanfkiJ3 NAoAS8zLcRUiZFTAkCHyQHe0YSwxaFAsVZxEoVaK4lvyTrsotS/Z0cAWj9qcy0CES7XP 3TJqYyFJMBrUJ/jEQAXq3cwxRPS9sJT62KgkNcc0F+71+K7GfoRqqCzD3rjSrKMdSnal ChubuppvFBfsEus4TJYUMBBg2/ggGpNSkLnux3bkpnL8QwWXuStWduCWmvdVKylS/FTb 0eMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=suJKhbqmvGDkGJi4vxcc/uK6cffGn6mvwuouV+TRLt0=; b=jL0pTzRMOjXqd4y1F6pgPJBTpKxmcs22Y+nTNPgbxfjRrbGLqA/NHVpUH1OW+nKXVJ Sys3c5S6wsRBxSmjA+TY6iN2cMyuISmM1r75Ek5EFI/5bV91TpD0EbDHQKy7l34NoFL8 jkiJZFo1JFZ917/SUNVdDPhhH/o+Jao7MMzfx/5OT/RzydI6o2i3yJzJs0KvVcPGBIvN fKJvD5sSuO7nN0XZUduW6j/w8LDY+ceJS41k12gbJj+mD5W3WLWdBExYMh/Nck1RyWQ1 jR1yDR1fFhLyi75uEJ2Ecu7XC2iRcM6iz/rLYdrPUdsrFSTfxEaiJ+qMunRC2qAR/XvG EX4Q== X-Gm-Message-State: APt69E1uXUR78y6two/mKbPHOKsGKGMxAqSAMHbPTZNB89jVB0AKzR+Y XoFXQWE0uHSaGJ/nXqRu7/2qvzB1 X-Received: by 2002:a1c:4adb:: with SMTP id n88-v6mr2963932wmi.121.1528415053889; Thu, 07 Jun 2018 16:44:13 -0700 (PDT) Received: from rywe.jkqxz.net (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id r2-v6sm18640545wrq.55.2018.06.07.16.44.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 16:44:13 -0700 (PDT) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Jun 2018 00:43:29 +0100 Message-Id: <20180607234331.32139-35-sw@jkqxz.net> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180607234331.32139-1-sw@jkqxz.net> References: <20180607234331.32139-1-sw@jkqxz.net> Subject: [FFmpeg-devel] [PATCH v2 34/36] lavc/h265: Add some common code for profile/tier/level handling X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Adds support for determining for level limits, including mapping PTL blocks to profiles to check profile-dependent level limits. --- libavcodec/h265_profile_level.c | 245 ++++++++++++++++++++++++++++++++++++++++ libavcodec/h265_profile_level.h | 89 +++++++++++++++ 2 files changed, 334 insertions(+) create mode 100644 libavcodec/h265_profile_level.c create mode 100644 libavcodec/h265_profile_level.h diff --git a/libavcodec/h265_profile_level.c b/libavcodec/h265_profile_level.c new file mode 100644 index 0000000000..aac1529c9b --- /dev/null +++ b/libavcodec/h265_profile_level.c @@ -0,0 +1,245 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "h265_profile_level.h" + + +static const H265LevelDescriptor h265_levels[] = { + // Name CpbFactor-Main MaxSliceSegmentsPerPicture + // | level_idc | CpbFactor-High MaxLumaSr BrFactor-High + // | | MaxLumaPs | | | MaxTileRows | BrFactor-Main | MinCr-Main + // | | | | | | | MaxTileCols | | | MinCr-High + { "1", 30, 36864, 350, 0, 16, 1, 1, 552960, 128, 0, 2, 2 }, + { "2", 60, 122880, 1500, 0, 16, 1, 1, 3686400, 1500, 0, 2, 2 }, + { "2.1", 63, 245760, 3000, 0, 20, 1, 1, 7372800, 3000, 0, 2, 2 }, + { "3", 90, 552960, 6000, 0, 30, 2, 2, 16588800, 6000, 0, 2, 2 }, + { "3.1", 93, 983040, 10000, 0, 40, 3, 3, 33177600, 10000, 0, 2, 2 }, + { "4", 120, 2228224, 12000, 30000, 75, 5, 5, 66846720, 12000, 30000, 4, 4 }, + { "4.1", 123, 2228224, 20000, 50000, 75, 5, 5, 133693440, 20000, 50000, 4, 4 }, + { "5", 150, 8912896, 25000, 100000, 200, 11, 10, 267386880, 25000, 100000, 6, 4 }, + { "5.1", 153, 8912896, 40000, 160000, 200, 11, 10, 534773760, 40000, 160000, 8, 4 }, + { "5.2", 156, 8912896, 60000, 240000, 200, 11, 10, 1069547520, 60000, 240000, 8, 4 }, + { "6", 180, 35651584, 60000, 240000, 600, 22, 20, 1069547520, 60000, 240000, 8, 4 }, + { "6.1", 183, 35651584, 120000, 480000, 600, 22, 20, 2139095040, 120000, 480000, 8, 4 }, + { "6.2", 186, 35651584, 240000, 800000, 600, 22, 20, 4278190080, 240000, 800000, 6, 4 }, +}; + +static const H265ProfileDescriptor h265_profiles[] = { + // profile_idc 8bit one-picture + // HT-profile | 422chroma | lower-bit-rate + // | 14bit | | 420chroma | | CpbVclFactor MinCrScaleFactor + // | | 12bit | | | monochrome| | CpbNalFactor | + // | | | 10bit | | | intra | | | FormatCapabilityFactor + { "Monochrome", // | | | | | | | | | | + 4, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0, 1, 667, 733, 1.000, 1.0 }, + { "Monochrome 12", + 4, 0, 2, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1000, 1100, 1.500, 1.0 }, + { "Monochrome 16", + 4, 0, 2, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1333, 1467, 2.000, 1.0 }, + { "Main", + 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.500, 1.0 }, + { "Screen-Extended Main", + 9, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1000, 1100, 1.500, 1.0 }, + { "Main 10", + 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.875, 1.0 }, + { "Screen-Extended Main 10", + 9, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1000, 1100, 1.875, 1.0 }, + { "Main 12", + 4, 0, 2, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1500, 1650, 2.250, 1.0 }, + { "Main Still Picture", + 3, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.500, 1.0 }, + { "Main 4:2:2 10", + 4, 0, 2, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1667, 1833, 2.500, 0.5 }, + { "Main 4:2:2 12", + 4, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 }, + { "Main 4:4:4", + 4, 0, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 }, + { "High Throughput 4:4:4", + 5, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 }, + { "Screen-Extended Main 4:4:4", + 9, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 }, + { "Screen-Extended High Throughput 4:4:4", + 9, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 }, + { "Main 4:4:4 10", + 4, 0, 2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 }, + { "High Throughput 4:4:4 10", + 5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 }, + { "Screen-Extended Main 4:4:4 10", + 9, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 }, + { "Screen-Extended High Throughput 4:4:4 10", + 9, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 }, + { "Main 4:4:4 12", + 4, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3000, 3300, 4.500, 0.5 }, + { "High Throughput 4:4:4 14", + 5, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3500, 3850, 5.250, 0.5 }, + { "Screen-Extended High Throughput 4:4:4 14", + 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3500, 3850, 5.250, 0.5 }, + { "Main Intra", + 4, 0, 2, 1, 1, 1, 1, 1, 0, 1, 0, 2, 1000, 1100, 1.500, 1.0 }, + { "Main 10 Intra", + 4, 0, 2, 1, 1, 0, 1, 1, 0, 1, 0, 2, 1000, 1100, 1.875, 1.0 }, + { "Main 12 Intra", + 4, 0, 2, 1, 0, 0, 1, 1, 0, 1, 0, 2, 1500, 1650, 2.250, 1.0 }, + { "Main 4:2:2 10 Intra", + 4, 0, 2, 1, 1, 0, 1, 0, 0, 1, 0, 2, 1667, 1833, 2.500, 0.5 }, + { "Main 4:2:2 12 Intra", + 4, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 2, 2000, 2200, 3.000, 0.5 }, + { "Main 4:4:4 Intra", + 4, 0, 2, 1, 1, 1, 0, 0, 0, 1, 0, 2, 2000, 2200, 3.000, 0.5 }, + { "Main 4:4:4 10 Intra", + 4, 0, 2, 1, 1, 0, 0, 0, 0, 1, 0, 2, 2500, 2750, 3.750, 0.5 }, + { "Main 4:4:4 12 Intra", + 4, 0, 2, 1, 0, 0, 0, 0, 0, 1, 0, 2, 3000, 3300, 4.500, 0.5 }, + { "Main 4:4:4 16 Intra", + 4, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4000, 4400, 6.000, 0.5 }, + { "Main 4:4:4 Still Picture", + 4, 0, 2, 1, 1, 1, 0, 0, 0, 1, 1, 2, 2000, 2200, 3.000, 0.5 }, + { "Main 4:4:4 16 Still Picture", + 4, 0, 2, 0, 0, 0, 0, 0, 0, 1, 1, 2, 4000, 4400, 6.000, 0.5 }, + { "High Throughput 4:4:4 16 Intra", + 5, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4000, 4400, 6.000, 0.5 }, +}; + + +const H265LevelDescriptor *ff_h265_get_level(int level_idc) +{ + int i; + + for (i = 0; i < FF_ARRAY_ELEMS(h265_levels); i++) { + if (h265_levels[i].level_idc == level_idc) + return &h265_levels[i]; + } + + return NULL; +} + +const H265ProfileDescriptor *ff_h265_get_profile(const H265RawProfileTierLevel *ptl) +{ + int i; + + if (ptl->general_profile_space) + return NULL; + + for (i = 0; i < FF_ARRAY_ELEMS(h265_profiles); i++) { + const H265ProfileDescriptor *profile = &h265_profiles[i]; + + if (ptl->general_profile_idc && + ptl->general_profile_idc != profile->profile_idc) + continue; + if (!ptl->general_profile_compatibility_flag[profile->profile_idc]) + continue; + +#define check_flag(name) \ + if (profile->name < 2) { \ + if (profile->name != ptl->general_ ## name ## _constraint_flag) \ + continue; \ + } + check_flag(max_14bit); + check_flag(max_12bit); + check_flag(max_10bit); + check_flag(max_8bit); + check_flag(max_422chroma); + check_flag(max_420chroma); + check_flag(max_monochrome); + check_flag(intra); + check_flag(one_picture_only); + check_flag(lower_bit_rate); +#undef check_flag + + return profile; + } + + return NULL; +} + +const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *ptl, + int64_t bitrate, + int width, int height, + int slice_segments, + int tile_rows, int tile_cols, + int max_dec_pic_buffering) +{ + const H265ProfileDescriptor *profile; + int pic_size, hbr_factor; + int i; + + if (ptl) + profile = ff_h265_get_profile(ptl); + else + profile = NULL; + if (!profile) { + // Default to using multiplication factors for Main profile. + profile = &h265_profiles[3]; + } + + pic_size = width * height; + + if (profile->profile_idc == 1 || profile->profile_idc == 2) { + hbr_factor = 1; + } else if (profile->high_throughput) { + if (profile->intra) + hbr_factor = 24 - 12 * ptl->general_lower_bit_rate_constraint_flag; + else + hbr_factor = 6; + } else { + hbr_factor = 2 - ptl->general_lower_bit_rate_constraint_flag; + } + + for (i = 0; i < FF_ARRAY_ELEMS(h265_levels); i++) { + const H265LevelDescriptor *level = &h265_levels[i]; + int max_br, max_dpb_size; + + if (pic_size > level->max_luma_ps) + continue; + if (width * width > 8 * level->max_luma_ps) + continue; + if (height * height > 8 * level->max_luma_ps) + continue; + + if (slice_segments > level->max_slice_segments_per_picture) + continue; + if (tile_rows > level->max_tile_rows) + continue; + if (tile_cols > level->max_tile_cols) + continue; + + if (ptl->general_tier_flag) + max_br = level->max_br_high; + else + max_br = level->max_br_main; + if (!max_br) + continue; + if (bitrate > profile->cpb_nal_factor * hbr_factor * max_br) + continue; + + if (pic_size < (level->max_luma_ps >> 2)) + max_dpb_size = 16; + else if (pic_size < (level->max_luma_ps >> 1)) + max_dpb_size = 14; + else if (pic_size < (3 * level->max_luma_ps >> 2)) + max_dpb_size = 9; + else + max_dpb_size = 7; + if (max_dec_pic_buffering > max_dpb_size) + continue; + + return level; + } + + return NULL; +} diff --git a/libavcodec/h265_profile_level.h b/libavcodec/h265_profile_level.h new file mode 100644 index 0000000000..12c00f0077 --- /dev/null +++ b/libavcodec/h265_profile_level.h @@ -0,0 +1,89 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_H265_PROFILE_LEVEL_H +#define AVCODEC_H265_PROFILE_LEVEL_H + +#include + +#include "cbs_h265.h" + + +typedef struct H265LevelDescriptor { + const char *name; + uint8_t level_idc; + + // Table A.6. + uint32_t max_luma_ps; + uint32_t max_cpb_main; + uint32_t max_cpb_high; + uint16_t max_slice_segments_per_picture; + uint8_t max_tile_rows; + uint8_t max_tile_cols; + + // Table A.7. + uint32_t max_luma_sr; + uint32_t max_br_main; + uint32_t max_br_high; + uint8_t min_cr_base_main; + uint8_t min_cr_base_high; +} H265LevelDescriptor; + +typedef struct H265ProfileDescriptor { + const char *name; + uint8_t profile_idc; + uint8_t high_throughput; + + // Tables A.2, A.3 and A.5. + uint8_t max_14bit; + uint8_t max_12bit; + uint8_t max_10bit; + uint8_t max_8bit; + uint8_t max_422chroma; + uint8_t max_420chroma; + uint8_t max_monochrome; + uint8_t intra; + uint8_t one_picture_only; + uint8_t lower_bit_rate; + + // Table A.8. + uint16_t cpb_vcl_factor; + uint16_t cpb_nal_factor; + float format_capability_factor; + float min_cr_scale_factor; +} H265ProfileDescriptor; + + +const H265LevelDescriptor *ff_h265_get_level(int level_idc); + +const H265ProfileDescriptor *ff_h265_get_profile(const H265RawProfileTierLevel *ptl); + + +/** + * Guess the level of a stream from some parameters. + * + * Unknown parameters may be zero, in which case they are ignored. + */ +const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *ptl, + int64_t bitrate, + int width, int height, + int slice_segments, + int tile_rows, int tile_cols, + int max_dec_pic_buffering); + +#endif /* AVCODEC_H265_PROFILE_LEVEL_H */