[x265] [PATCH] Add new Levels

Richard ccc7922 at foxmail.com
Tue Feb 4 12:37:58 UTC 2025


Which should be correct. This is MaxCPB size, MaxBR is in Table A.9.


         Original
         
       
From:                  chen         chenm003 at 163.com                 
Sent Time:         2025-02-4- 12:10 
To:                  Development for x265         x265-devel at videolan.org         ,                ccc7922         ccc7922 at foxmail.com                 
Subject:         Re:Re: [x265] [PATCH] Add new Levels 







This?














At 2025-02-04 02:07:58, "Richard" <ccc7922 at foxmail.com> wrote:
I think I read the spec (PDF version) correct, but exactly which 240000?


The reason of using uint64 for lumaSamples is that I also changed the resolution check so it can be bypassed by --allow-non-conformance, and the value can potentially exceed uint32.


         Original
         
       
From:                  chen         chenm003 at 163.com                 
Sent Time:         2025-02-3- 23:47 
To:                  Development for x265         x265-devel at videolan.org         ,                ccc7922         ccc7922 at foxmail.com                 
Subject:         Re:[x265] [PATCH] Add new Levels 




Thank for the patch, I have some comments







From 249a2dd99de9edfd16867430deb0670f35e74941 Mon Sep 17 00:00:00 2001

From: Mr-Z-2697 <74594146+Mr-Z-2697 at users.noreply.github.com>

Date: Sun, 12 Jan 2025 12:35:38 +0800

Subject: [PATCH] Add new Levels




 LevelSpec levels[] =

 {

-    { 36864,    552960,     128,      MAX_UINT, 350,    MAX_UINT, 2, Level::LEVEL1,   "1",   10 },

-    { 122880,   3686400,    1500,     MAX_UINT, 1500,   MAX_UINT, 2, Level::LEVEL2,   "2",   20 },

-    { 245760,   7372800,    3000,     MAX_UINT, 3000,   MAX_UINT, 2, Level::LEVEL2_1, "2.1", 21 },

-    { 552960,   16588800,   6000,     MAX_UINT, 6000,   MAX_UINT, 2, Level::LEVEL3,   "3",   30 },

-    { 983040,   33177600,   10000,    MAX_UINT, 10000,  MAX_UINT, 2, Level::LEVEL3_1, "3.1", 31 },

-    { 2228224,  66846720,   12000,    30000,    12000,  30000,    4, Level::LEVEL4,   "4",   40 },

-    { 2228224,  133693440,  20000,    50000,    20000,  50000,    4, Level::LEVEL4_1, "4.1", 41 },

-    { 8912896,  267386880,  25000,    100000,   25000,  100000,   6, Level::LEVEL5,   "5",   50 },

-    { 8912896,  534773760,  40000,    160000,   40000,  160000,   8, Level::LEVEL5_1, "5.1", 51 },

-    { 8912896,  1069547520, 60000,    240000,   60000,  240000,   8, Level::LEVEL5_2, "5.2", 52 },

-    { 35651584, 1069547520, 60000,    240000,   60000,  240000,   8, Level::LEVEL6,   "6",   60 },

-    { 35651584, 2139095040, 120000,   480000,   120000, 480000,   8, Level::LEVEL6_1, "6.1", 61 },

-    { 35651584, 4278190080U, 240000,  800000,   240000, 800000,   6, Level::LEVEL6_2, "6.2", 62 },

-    { MAX_UINT, MAX_UINT, MAX_UINT, MAX_UINT, MAX_UINT, MAX_UINT, 1, Level::LEVEL8_5, "8.5", 85 },

+    { 36864,      552960,         128,      MAX_UINT, 350,     MAX_UINT, 2, Level::LEVEL1,   "1",   10 },

+    { 122880,     3686400,        1500,     MAX_UINT, 1500,    MAX_UINT, 2, Level::LEVEL2,   "2",   20 },

+    { 245760,     7372800,        3000,     MAX_UINT, 3000,    MAX_UINT, 2, Level::LEVEL2_1, "2.1", 21 },

+    { 552960,     16588800,       6000,     MAX_UINT, 6000,    MAX_UINT, 2, Level::LEVEL3,   "3",   30 },

+    { 983040,     33177600,       10000,    MAX_UINT, 10000,   MAX_UINT, 2, Level::LEVEL3_1, "3.1", 31 },

+    { 2228224,    66846720,       12000,    30000,    12000,   30000,    4, Level::LEVEL4,   "4",   40 },

+    { 2228224,    133693440,      20000,    50000,    20000,   50000,    4, Level::LEVEL4_1, "4.1", 41 },

+    { 8912896,    267386880,      25000,    100000,   25000,   100000,   6, Level::LEVEL5,   "5",   50 },

+    { 8912896,    534773760,      40000,    160000,   40000,   160000,   8, Level::LEVEL5_1, "5.1", 51 },

+    { 8912896,    1069547520,     60000,    240000,   60000,   240000,   8, Level::LEVEL5_2, "5.2", 52 },

+    { 35651584,   1069547520,     60000,    240000,   60000,   240000,   8, Level::LEVEL6,   "6",   60 },

+    { 35651584,   2139095040,     120000,   480000,   120000,  480000,   8, Level::LEVEL6_1, "6.1", 61 },

+    { 35651584,   4278190080U,    240000,   800000,   240000,  800000,   6, Level::LEVEL6_2, "6.2", 62 },

+    { 80216064,   4812963840ULL,  320000,   1600000,  240000,  1600000,  6, Level::LEVEL6_3, "6.3", 63 },

+    { 142606336,  4812963840ULL,  320000,   1600000,  240000,  1600000,  6, Level::LEVEL7,   "7",   70 },




mismatch to HEVC spec, 240000?







 

 static inline int _confirm(x265_param* param, bool bflag, const char* message)

@@ -152,8 +156,8 @@ void determineLevel(const x265_param &param, VPS& vps)

         vps.ptl.profileCompatibilityFlag[Profile::MAINSCC] = true;

 #endif

 

-    uint32_t lumaSamples = param.sourceWidth * param.sourceHeight;

-    uint32_t samplesPerSec = (uint32_t)(lumaSamples * ((double)param.fpsNum / param.fpsDenom));

+    uint64_t lumaSamples = param.sourceWidth * param.sourceHeight;




Maximum picture size is 142,606,336, it is in 32-bits range
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20250204/e509e928/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2E363300 at A53A7A5D.260AA26700000000.png
Type: application/octet-stream
Size: 29054 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20250204/e509e928/attachment-0001.obj>


More information about the x265-devel mailing list