<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#467886;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:EN-GB;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-ligatures:none;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-HU" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<pre><span lang="EN-US" style="font-size:12.0pt;font-family:"Aptos",sans-serif">Hi Chen, <br><br></span><span style="font-size:12.0pt;font-family:"Aptos",sans-serif">Thank you for your feedback! I've reviewed the specification as well, and I'm wondering — doesn't the part you sent </span><span lang="EN-US" style="font-size:12.0pt;font-family:"Aptos",sans-serif">(8.5.3.3.4.2) </span><span style="font-size:12.0pt;font-family:"Aptos",sans-serif">refer to the output values of the weight_sp function? I re-ran the encodings to double-check, and I still see values that fall outside the tested range. </span><span lang="EN-US" style="font-size:12.0pt;font-family:"Aptos",sans-serif"><br><br></span><span style="font-size:12.0pt;font-family:"Aptos",sans-serif">Thanks, Gerda</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Aptos",sans-serif"><br><br></span><span lang="EN-US" style="color:black">></span><span style="color:black">In the HEVC specification, the value of pixel clips to bitDepth<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">></span><span style="color:black">pbSamples[ x ][ y ] = Clip3( 0, ( 1 << bitDepth ) − 1, <o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">></span><span style="color:black">Regards,<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">></span><span style="color:black">Chen<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">></span><span style="color:black">At 2025-07-09 19:48:58, "Gerda Zsejke More" <<a href="https://mailman.videolan.org/listinfo/x265-devel">gerdazsejke.more <span lang="EN-US">> </span>at arm.com</a>> wrote:<o:p></o:p></span></pre>
<pre><span style="color:black">><i>The existing unit tests assumes that the weight_sp function's input<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>data is in the range [SMIN, SMAX]. However running real encodings<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>show that values outside of this range can be input values.<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>Set the tested value range to [SHORT_MIN, SHORT_MAX].<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i><o:p> </o:p></i></span></pre>
<pre><span style="color:black">><i>Change-Id: If83bfacb4232dacf53dacbf52ee874a53415bd59<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>---<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> source/test/pixelharness.cpp | 9 ++++++---<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> source/test/pixelharness.h | 1 +<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> 2 files changed, 7 insertions(+), 3 deletions(-)<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i><o:p> </o:p></i></span></pre>
<pre><span style="color:black">><i>diff --git a/source/test/pixelharness.cpp b/source/test/pixelharness.cpp<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>index e37ae3cb7..c396623ef 100644<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>--- a/source/test/pixelharness.cpp<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+++ b/source/test/pixelharness.cpp<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>@@ -39,6 +39,7 @@ PixelHarness::PixelHarness()<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff[0][i] = (rand() % (2 * SMAX + 1)) - SMAX - 1; // max(SHORT_MIN, min(rand(), SMAX));<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff1[0][i] = rand() & PIXEL_MAX; // For block copy only<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff2[0][i] = rand() % 16383; // for addAvg<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+ short_test_buff3[0][i] = rand() % SHORT_MAX; // for weight_sp<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> int_test_buff[0][i] = rand() % SHORT_MAX;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ushort_test_buff[0][i] = rand() % ((1 << 16) - 1);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> uchar_test_buff[0][i] = rand() % ((1 << 8) - 1);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>@@ -48,6 +49,7 @@ PixelHarness::PixelHarness()<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff[1][i] = (int16_t)SMIN;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff1[1][i] = PIXEL_MIN;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff2[1][i] = -16384;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+ short_test_buff3[1][i] = SHORT_MIN;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> int_test_buff[1][i] = SHORT_MIN;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ushort_test_buff[1][i] = PIXEL_MIN;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> uchar_test_buff[1][i] = PIXEL_MIN;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>@@ -58,6 +60,7 @@ PixelHarness::PixelHarness()<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff[2][i] = SMAX;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff1[2][i] = PIXEL_MAX;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> short_test_buff2[2][i] = 16383;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+ short_test_buff3[2][i] = SHORT_MAX;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> int_test_buff[2][i] = SHORT_MAX;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ushort_test_buff[2][i] = ((1 << 16) - 1);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> uchar_test_buff[2][i] = 255;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>@@ -308,12 +311,12 @@ bool PixelHarness::check_weightp(weightp_sp_t ref, weightp_sp_t opt)<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> for (int i = 0; i < ITERS; i++)<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> {<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> int index = i % TEST_CASES;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>- checked(opt, short_test_buff[index] + j, opt_dest, stride, stride + 1, width, height, w0, round << correction, shift + correction, offset);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>- ref(short_test_buff[index] + j, ref_dest, stride, stride + 1, width, height, w0, round << correction, shift + correction, offset);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+ checked(opt, short_test_buff3[index] + j, opt_dest, stride, stride + 1, width, height, w0, round << correction, shift + correction, offset);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+ ref(short_test_buff3[index] + j, ref_dest, stride, stride + 1, width, height, w0, round << correction, shift + correction, offset);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> <o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> {<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>- opt(short_test_buff[index] + j, opt_dest, stride, stride + 1, width, height, w0, round << correction, shift + correction, offset);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+ opt(short_test_buff3[index] + j, opt_dest, stride, stride + 1, width, height, w0, round << correction, shift + correction, offset);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> return false;<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> }<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> <o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>diff --git a/source/test/pixelharness.h b/source/test/pixelharness.h<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>index 5dd354029..1067bf774 100644<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>--- a/source/test/pixelharness.h<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+++ b/source/test/pixelharness.h<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>@@ -63,6 +63,7 @@ protected:<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ALIGN_VAR_64(int16_t, short_test_buff[TEST_CASES][BUFFSIZE]);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ALIGN_VAR_64(int16_t, short_test_buff1[TEST_CASES][BUFFSIZE]);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ALIGN_VAR_64(int16_t, short_test_buff2[TEST_CASES][BUFFSIZE]);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>+ ALIGN_VAR_64(int16_t, short_test_buff3[TEST_CASES][BUFFSIZE]);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ALIGN_VAR_64(int, int_test_buff[TEST_CASES][BUFFSIZE]);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ALIGN_VAR_64(uint16_t, ushort_test_buff[TEST_CASES][BUFFSIZE]);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i> ALIGN_VAR_64(uint8_t, uchar_test_buff[TEST_CASES][BUFFSIZE]);<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>-- <o:p></o:p></i></span></pre>
<pre><span style="color:black">><i>2.39.5 (Apple Git-154)<o:p></o:p></i></span></pre>
<pre><span style="color:black">><i><o:p> </o:p></i></span></pre>
<pre><span style="color:black">----<o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></p>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose,
or store or copy the information in any medium. Thank you.
</body>
</html>