[x265] fix lossless
Satoshi Nakagawa
nakagawa424 at oki.com
Mon Aug 25 04:50:02 CEST 2014
Negative shift or bts cause unexpected behavior.
My Core i5 4300U, (Win7 32bit, VS2013) fails following test.
--- a/source/test/pixelharness.cpp Fri Aug 22 15:53:34 2014 -0500
+++ b/source/test/pixelharness.cpp Mon Aug 25 11:30:37 2014 +0900
@@ -562,7 +562,8 @@
intptr_t stride = STRIDE;
for (int i = 0; i < ITERS; i++)
{
- int shift = (rand() % 7 + 1);
+// int shift = (rand() % 7 + 1);
+ int shift = 0;
int index = i % TEST_CASES;
checked(opt, opt_dest, int_test_buff[index] + j, stride, shift,
(int)STRIDE);
From: x265-devel [mailto:x265-devel-bounces at videolan.org] On Behalf Of chen
Sent: Monday, August 25, 2014 11:20 AM
To: Development for x265
Subject: Re: [x265] fix lossless
He just modify shift=0 path, shif-left and shift-righ is equal in that time
At 2014-08-25 10:06:23,"Steve Borho" <steve at borho.org> wrote:
>On 08/23, Satoshi Nakagawa wrote:
>> # HG changeset patch
>> # User Satoshi Nakagawa <nakagawa424 at oki.com>
>> # Date 1408803114 -32400
>> # Sat Aug 23 23:11:54 2014 +0900
>> # Node ID 218b9ddfe148c55afccc2c5a073858692e09f5c6
>> # Parent 6e6756f94b27c3ef30f6159f1880112a7ff978e3
>> fix lossless
>
>do you have a repro case that this fixes? I tried Main and Main10
>encodes with --lossless --hash 1 and they were both fine prior to this
>patch.
>
>> diff -r 6e6756f94b27 -r 218b9ddfe148 source/common/quant.cpp
>> --- a/source/common/quant.cpp Fri Aug 22 15:53:34 2014 -0500
>> +++ b/source/common/quant.cpp Sat Aug 23 23:11:54 2014 +0900
>> @@ -399,7 +399,7 @@
>> {
>> if (transQuantBypass)
>> {
>> - primitives.cvt32to16_shr(residual, coeff, stride, 0, 1 <<
log2TrSize);
>> + primitives.cvt32to16_shl[log2TrSize - 2](residual, coeff,
stride, 0);
>> return;
>> }
>>
>> @@ -430,7 +430,7 @@
>> #if X265_DEPTH <= 10
>> primitives.cvt32to16_shr(residual, m_resiDctCoeff, stride,
shift, trSize);
>> #else
>> - if (shift >= 0)
>> + if (shift > 0)
>> primitives.cvt32to16_shr(residual, m_resiDctCoeff, stride,
shift, trSize);
>> else
>> primitives.cvt32to16_shl[log2TrSize - 2](residual,
m_resiDctCoeff, stride, -shift);
>> _______________________________________________
>> x265-devel mailing list
>> x265-devel at videolan.org
>> https://mailman.videolan.org/listinfo/x265-devel
>
>--
>Steve Borho
>_______________________________________________
>x265-devel mailing list
>x265-devel at videolan.org
>https://mailman.videolan.org/listinfo/x265-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140825/48c1ae92/attachment-0001.html>
More information about the x265-devel
mailing list