<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" 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 name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0mm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:SimSun;
mso-fareast-language:ZH-CN;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML \66F8\5F0F\4ED8\304D \(\6587\5B57\)";
margin:0mm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:SimSun;
mso-fareast-language:ZH-CN;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"\5439\304D\51FA\3057 \(\6587\5B57\)";
margin:0mm;
margin-bottom:.0001pt;
font-size:9.0pt;
font-family:"Arial","sans-serif";
mso-fareast-language:ZH-CN;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0mm;
margin-right:0mm;
margin-bottom:0mm;
margin-left:42.0pt;
margin-bottom:.0001pt;
mso-para-margin-top:0mm;
mso-para-margin-right:0mm;
mso-para-margin-bottom:0mm;
mso-para-margin-left:4.0gd;
mso-para-margin-bottom:.0001pt;
font-size:12.0pt;
font-family:SimSun;
mso-fareast-language:ZH-CN;}
span.HTML
{mso-style-name:"HTML \66F8\5F0F\4ED8\304D \(\6587\5B57\)";
mso-style-priority:99;
mso-style-link:"HTML \66F8\5F0F\4ED8\304D";
font-family:"Courier New";
mso-fareast-language:ZH-CN;}
span.19
{mso-style-type:personal;
font-family:"Arial","sans-serif";
color:#1F497D;}
span.20
{mso-style-type:personal-reply;
font-family:"Arial","sans-serif";
color:#1F497D;}
span.a
{mso-style-name:"\5439\304D\51FA\3057 \(\6587\5B57\)";
mso-style-priority:99;
mso-style-link:\5439\304D\51FA\3057;
font-family:"Arial","sans-serif";
mso-fareast-language:ZH-CN;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:99.25pt 30.0mm 30.0mm 30.0mm;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:280919448;
mso-list-type:hybrid;
mso-list-template-ids:-1338759464 -1250163880 67698699 67698701 67698689 67698699 67698701 67698689 67698699 67698701;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:18.0pt;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:"MS Gothic";
mso-bidi-font-family:Arial;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:42.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0B2;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:63.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F06C;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:84.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:105.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0B2;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:126.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F06C;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:147.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:\F0D8;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:168.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0B2;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:189.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0mm;}
ul
{margin-bottom:0mm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026">
<v:textbox inset="5.85pt,.7pt,5.85pt,.7pt" />
</o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=JA link=blue vlink=purple><div class=WordSection1><p class=MsoListParagraph style='margin-left:18.0pt;mso-para-margin-left:0gd;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:10.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:JA'><span style='mso-list:Ignore'>Ø<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>Negative shift or bts cause unexpected behavior.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>Negative shift is used for round value calculation.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'> int round = 1 << (shift - 1);</span><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0mm 0mm 0mm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0mm 0mm 0mm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:JA'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:JA'> x265-devel [mailto:x265-devel-bounces@videolan.org] <b>On Behalf Of </b>Satoshi Nakagawa<br><b>Sent:</b> Monday, August 25, 2014 11:50 AM<br><b>To:</b> 'Development for x265'<br><b>Subject:</b> Re: [x265] fix lossless<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>Negative shift or bts cause unexpected behavior.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>My Core i5 4300U, (Win7 32bit, VS2013) fails following test.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>--- a/source/test/pixelharness.cpp Fri Aug 22 15:53:34 2014 -0500<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>+++ b/source/test/pixelharness.cpp Mon Aug 25 11:30:37 2014 +0900<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>@@ -562,7 +562,8 @@<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'> intptr_t stride = STRIDE;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'> for (int i = 0; i < ITERS; i++)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'> {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>- int shift = (rand() % 7 + 1);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>+// int shift = (rand() % 7 + 1);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'>+ int shift = 0;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'> int index = i % TEST_CASES;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'> checked(opt, opt_dest, int_test_buff[index] + j, stride, shift, (int)STRIDE);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:JA'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0mm 0mm 0mm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0mm 0mm 0mm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:JA'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:JA'> x265-devel [<a href="mailto:x265-devel-bounces@videolan.org">mailto:x265-devel-bounces@videolan.org</a>] <b>On Behalf Of </b>chen<br><b>Sent:</b> Monday, August 25, 2014 11:20 AM<br><b>To:</b> Development for x265<br><b>Subject:</b> Re: [x265] fix lossless<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>He just modify shift=0 path, shif-left and shift-righ is equal in that time<o:p></o:p></span></p></div><pre><span lang=EN-US style='color:black'>At 2014-08-25 10:06:23,"Steve Borho" <<a href="mailto:steve@borho.org">steve@borho.org</a>> wrote:<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>On 08/23, Satoshi Nakagawa wrote:<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> # HG changeset patch<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> # User Satoshi Nakagawa <<a href="mailto:nakagawa424@oki.com">nakagawa424@oki.com</a>><o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> # Date 1408803114 -32400<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> # Sat Aug 23 23:11:54 2014 +0900<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> # Node ID 218b9ddfe148c55afccc2c5a073858692e09f5c6<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> # Parent 6e6756f94b27c3ef30f6159f1880112a7ff978e3<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> fix lossless<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>><o:p> </o:p></span></pre><pre><span lang=EN-US style='color:black'>>do you have a repro case that this fixes? I tried Main and Main10<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>encodes with --lossless --hash 1 and they were both fine prior to this<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>patch.<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>><o:p> </o:p></span></pre><pre><span lang=EN-US style='color:black'>>> diff -r 6e6756f94b27 -r 218b9ddfe148 source/common/quant.cpp<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> --- a/source/common/quant.cpp Fri Aug 22 15:53:34 2014 -0500<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> +++ b/source/common/quant.cpp Sat Aug 23 23:11:54 2014 +0900<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> @@ -399,7 +399,7 @@<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> {<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> if (transQuantBypass)<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> {<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> - primitives.cvt32to16_shr(residual, coeff, stride, 0, 1 << log2TrSize);<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> + primitives.cvt32to16_shl[log2TrSize - 2](residual, coeff, stride, 0);<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> return;<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> }<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> <o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> @@ -430,7 +430,7 @@<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> #if X265_DEPTH <= 10<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> primitives.cvt32to16_shr(residual, m_resiDctCoeff, stride, shift, trSize);<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> #else<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> - if (shift >= 0)<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> + if (shift > 0)<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> primitives.cvt32to16_shr(residual, m_resiDctCoeff, stride, shift, trSize);<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> else<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> primitives.cvt32to16_shl[log2TrSize - 2](residual, m_resiDctCoeff, stride, -shift);<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> _______________________________________________<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> x265-devel mailing list<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>> <a href="https://mailman.videolan.org/listinfo/x265-devel">https://mailman.videolan.org/listinfo/x265-devel</a><o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>><o:p> </o:p></span></pre><pre><span lang=EN-US style='color:black'>>-- <o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>Steve Borho<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>_______________________________________________<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>>x265-devel mailing list<o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>><a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><o:p></o:p></span></pre><pre><span lang=EN-US style='color:black'>><a href="https://mailman.videolan.org/listinfo/x265-devel">https://mailman.videolan.org/listinfo/x265-devel</a><o:p></o:p></span></pre></div></div></div></div></body></html>