[x265] x265 bug report

chen chenm003 at 163.com
Thu Nov 25 06:33:31 UTC 2021


Hi Nathan,


Ah, I have same question in couple years ago.


The root cause lies in the type of intermediate variable, the sign bit will affacf high part of combine varible.
so if you change sum_t to sum2_t on variable A & B, you will get correct result.


Regards,
Min Chen

At 2021-11-25 12:36:18, "nathan" <13022198075 at 163.com> wrote:

hi Guys,
At source/common/pixel.cpp: line 203
An function seems have an error:
// in: a pseudo-simd number of the form x+(y<<16)
// return: abs(x)+(abs(y)<<16)
inlinesum2_tabs2(sum2_ta)
{
    sum2_ts = ((a >> (BITS_PER_SUM - 1)) & (((sum2_t)1 << BITS_PER_SUM) + 1)) * ((sum_t)-1);


    return (a + s) ^ s;
}                    
see my test :
int main()
{
    sum_t    A = -1;   # 0xffff
    sum_t    B = -2;   # 0xfffe
    sum2_t  C = (B << BITS_PER_SUM) + A; # 0xfffeffff
    sum2_t  D = abs2(C);                                 # 0x00010001
    sum2_t  E = (2 << BITS_PER_SUM) + 1;  # 0x00020001
}
At the function description, the D should be equal to  E, but it not the same from my test.
(please check the test is ok or not, in case I missed something....)



the abs2() is used to calculate SATD,  which effect the selection of motion evaluation, not effect the correctness of encoder function.


(can someone tell me where can I commit this bug report to?  Thanks!)
BR-x265,
     Nathan





 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20211125/36bfdb3f/attachment.html>


More information about the x265-devel mailing list