<div style="font-family: -apple-system, system-ui; font-size: 14px; color: rgb(0, 0, 0);"><span style="line-height: 1.6;">Updated patch. The resolution calculation in resolution checking in param.cpp is now using uint64 so it can catch the input resolution exceeding int32 range.</span></div><div><br  /></div><article><div style="display:flex;align-items:center;padding-top:8px" contenteditable="false">
        <div style="color:#959DA6;font-size:12px;line-height:30px;background:#FFF">Original</div>
        <hr style="border: none;flex-grow:1;border-top:1px solid rgba(21, 46, 74, 0.07);margin-left:8px"  />
      </div><table data-uneditable="true" style="line-height: 20px; border-radius: 6px; background-color: rgba(20, 46, 77, 0.05); margin: 0px; width: 100%;"><tbody><tr><td style="width: 1403px; height: 96px; line-height: 20px; padding: 8px;"><div style="line-height: 20px; font-size: 12px;"><span style="color: rgb(92, 97, 102);">From:</span>
        
        <span style="color: rgb(0, 0, 0);">chen</span>
        <span style="color: rgb(149, 157, 166);">chenm003@163.com</span>
        
      
</div><div style="line-height: 20px; font-size: 12px;"><span style="color: rgb(92, 97, 102);">Sent Time:</span>
        <span style="color: rgb(0, 0, 0);">2025-02-3- 23:47</span>
</div><div style="line-height: 20px; font-size: 12px;"><span style="color: rgb(92, 97, 102);">To:</span>
        
        <span style="color: rgb(0, 0, 0);">Development for x265</span>
        <span style="color: rgb(149, 157, 166);">x265-devel@videolan.org</span>
        <span style="color: rgb(0, 0, 0);">,</span>
      
        <span style="color: rgb(0, 0, 0);">ccc7922</span>
        <span style="color: rgb(149, 157, 166);">ccc7922@foxmail.com</span>
        
      
</div><div style="line-height: 20px; font-size: 12px;"><span style="color: rgb(92, 97, 102);">Subject:</span>
        <span style="color: rgb(0, 0, 0);">Re:[x265] [PATCH] Add new Levels</span>
</div></td></tr></tbody></table><div><br  /></div><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Thank for the patch, I have some comments</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">From 249a2dd99de9edfd16867430deb0670f35e74941 Mon Sep 17 00:00:00 2001</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">From: Mr-Z-2697 <74594146+Mr-Z-2697@users.noreply.github.com></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Date: Sun, 12 Jan 2025 12:35:38 +0800</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Subject: [PATCH] Add new Levels</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"> LevelSpec levels[] =</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"> {</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 36864,    552960,     128,      MAX_UINT, 350,    MAX_UINT, 2, Level::LEVEL1,   "1",   10 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 122880,   3686400,    1500,     MAX_UINT, 1500,   MAX_UINT, 2, Level::LEVEL2,   "2",   20 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 245760,   7372800,    3000,     MAX_UINT, 3000,   MAX_UINT, 2, Level::LEVEL2_1, "2.1", 21 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 552960,   16588800,   6000,     MAX_UINT, 6000,   MAX_UINT, 2, Level::LEVEL3,   "3",   30 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 983040,   33177600,   10000,    MAX_UINT, 10000,  MAX_UINT, 2, Level::LEVEL3_1, "3.1", 31 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 2228224,  66846720,   12000,    30000,    12000,  30000,    4, Level::LEVEL4,   "4",   40 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 2228224,  133693440,  20000,    50000,    20000,  50000,    4, Level::LEVEL4_1, "4.1", 41 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 8912896,  267386880,  25000,    100000,   25000,  100000,   6, Level::LEVEL5,   "5",   50 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 8912896,  534773760,  40000,    160000,   40000,  160000,   8, Level::LEVEL5_1, "5.1", 51 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 8912896,  1069547520, 60000,    240000,   60000,  240000,   8, Level::LEVEL5_2, "5.2", 52 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 35651584, 1069547520, 60000,    240000,   60000,  240000,   8, Level::LEVEL6,   "6",   60 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 35651584, 2139095040, 120000,   480000,   120000, 480000,   8, Level::LEVEL6_1, "6.1", 61 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { 35651584, 4278190080U, 240000,  800000,   240000, 800000,   6, Level::LEVEL6_2, "6.2", 62 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    { MAX_UINT, MAX_UINT, MAX_UINT, MAX_UINT, MAX_UINT, MAX_UINT, 1, Level::LEVEL8_5, "8.5", 85 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 36864,      552960,         128,      MAX_UINT, 350,     MAX_UINT, 2, Level::LEVEL1,   "1",   10 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 122880,     3686400,        1500,     MAX_UINT, 1500,    MAX_UINT, 2, Level::LEVEL2,   "2",   20 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 245760,     7372800,        3000,     MAX_UINT, 3000,    MAX_UINT, 2, Level::LEVEL2_1, "2.1", 21 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 552960,     16588800,       6000,     MAX_UINT, 6000,    MAX_UINT, 2, Level::LEVEL3,   "3",   30 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 983040,     33177600,       10000,    MAX_UINT, 10000,   MAX_UINT, 2, Level::LEVEL3_1, "3.1", 31 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 2228224,    66846720,       12000,    30000,    12000,   30000,    4, Level::LEVEL4,   "4",   40 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 2228224,    133693440,      20000,    50000,    20000,   50000,    4, Level::LEVEL4_1, "4.1", 41 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 8912896,    267386880,      25000,    100000,   25000,   100000,   6, Level::LEVEL5,   "5",   50 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 8912896,    534773760,      40000,    160000,   40000,   160000,   8, Level::LEVEL5_1, "5.1", 51 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 8912896,    1069547520,     60000,    240000,   60000,   240000,   8, Level::LEVEL5_2, "5.2", 52 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 35651584,   1069547520,     60000,    240000,   60000,   240000,   8, Level::LEVEL6,   "6",   60 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 35651584,   2139095040,     120000,   480000,   120000,  480000,   8, Level::LEVEL6_1, "6.1", 61 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 35651584,   4278190080U,    240000,   800000,   240000,  800000,   6, Level::LEVEL6_2, "6.2", 62 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 80216064,   4812963840ULL,  320000,   1600000,  240000,  1600000,  6, Level::LEVEL6_3, "6.3", 63 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    { 142606336,  4812963840ULL,  320000,   1600000,  240000,  1600000,  6, Level::LEVEL7,   "7",   70 },</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">mismatch to HEVC spec, <b>240000</b>?</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"> </span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"> static inline int _confirm(x265_param* param, bool bflag, const char* message)</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">@@ -152,8 +156,8 @@ void determineLevel(const x265_param &param, VPS& vps)</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">         vps.ptl.profileCompatibilityFlag[Profile::MAINSCC] = true;</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"> #endif</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"> </span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    uint32_t lumaSamples = param.sourceWidth * param.sourceHeight;</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">-    uint32_t samplesPerSec = (uint32_t)(lumaSamples * ((double)param.fpsNum / param.fpsDenom));</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">+    uint64_t lumaSamples = param.sourceWidth * param.sourceHeight;</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Maximum picture size is 142,606,336, it is in 32-bits range</span></p><p style="line-height: 1.7; margin: 0px;"><span style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br  /></span></p></article><div><br  /></div>