<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 http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@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;}
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-reply;
        font-family:"Arial","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Arial","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:99.25pt 30.0mm 30.0mm 30.0mm;}
div.WordSection1
        {page:WordSection1;}
--></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=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 [mailto:x265-devel-bounces@videolan.org] <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></body></html>