<div dir="ltr">Hi Tom,<div><br></div><div>I was wondering how much test data to submit here.</div><div>But here's the thing:</div><div><br></div><div>1. Running tests on presets (5 and above) shows marked improvement in quality.</div><div>    The final file size is little higher corresponding to x265_2.0 version and the </div><div>     reasons are explained by dump (of medium preset).</div><div><br></div><div>    In order to cover the sufficiency part of improvement, ran tests targeting varying bitrate</div><div>    and the BD-PSNR , BD-SSIM curves obtained with patch is always better and in few places</div><div>    same as x265_2.0 version BD-PSNR , BD-SSIM curves.</div><div><br></div><div>2. With Patch:</div><div><div>x265 [info]: frame I:      1, Avg QP:29.05  kb/s: 12862.56  PSNR Mean: Y:40.461 U:41.323 V:42.105  SSIM Mean: 0.947829 (12.826dB)</div><div>x265 [info]: frame P:     44, Avg QP:30.23  kb/s: 2286.87   PSNR Mean: Y:40.610 U:41.481 V:42.211  SSIM Mean: 0.953752 (13.349dB)</div><div>x265 [info]: frame B:     55, Avg QP:35.48  kb/s: 770.19    PSNR Mean: Y:39.908 U:41.098 V:41.797  SSIM Mean: 0.948722 (12.901dB)</div><div>x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%</div><div>x265 [info]: consecutive B-frames: 35.6% 28.9% 17.8% 13.3% 4.4%</div><div><br></div><div>encoded 100 frames in 1542.80s (0.06 fps), 1558.45 kb/s, Avg QP:33.11, Global PSNR: 40.573, SSIM Mean Y: 0.9509262 (13.092 dB)</div></div><div><br></div><div>3. With x265_2.0:</div><div><br></div><div><div>x265 [info]: frame I:      1, Avg QP:32.18  kb/s: 8167.20   PSNR Mean: Y:38.782 U:39.969 V:41.312  SSIM Mean: 0.928696 (11.469dB)</div><div>x265 [info]: frame P:     25, Avg QP:31.88  kb/s: 2506.24   PSNR Mean: Y:39.448 U:40.450 V:41.507  SSIM Mean: 0.941651 (12.340dB)</div><div>x265 [info]: frame B:     74, Avg QP:35.13  kb/s: 932.29    PSNR Mean: Y:39.086 U:40.235 V:41.213  SSIM Mean: 0.939037 (12.149dB)</div><div>x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%</div><div>x265 [info]: consecutive B-frames: 3.8% 0.0% 15.4% 69.2% 11.5%</div><div><br></div><div>encoded 100 frames in 733.95s (0.14 fps), 1398.12 kb/s, Avg QP:34.29, Global PSNR: 39.577, SSIM Mean Y: 0.9395869 (12.189 dB)</div></div><div><br></div><div><br></div><div>4. Coding efficiency gain is evident from the P and B frame statistics. Final quality PSNR, ssim and visual quality is also</div><div>    better with Patch.</div><div>    The file size is little higher because of I frame statistics. This can be plausible because Rate Control module</div><div>    got better estimates on P and B frames (as also increased number of P and B frames), allowing it the luxury</div><div>    to play with I frame compression-quality.</div><div><br></div><div>5. I've added corrections to possible bug arising as also parameterising the max BMV's according to ME search method</div><div>   (1<<seachMethod)</div><div><br></div><div>Regards,</div><div>Vijay</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 4, 2016 at 12:50 PM,  <span dir="ltr"><<a href="mailto:x265-devel-request@videolan.org" target="_blank">x265-devel-request@videolan.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send x265-devel mailing list submissions to<br>
        <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:x265-devel-request@videolan.org">x265-devel-request@videolan.<wbr>org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:x265-devel-owner@videolan.org">x265-devel-owner@videolan.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of x265-devel digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. [PATCH] logical improvement (<a href="mailto:nvijay.anand@trispacetech.com">nvijay.anand@trispacetech.com</a><wbr>)<br>
   2. Re: [PATCH] logical improvement (chen)<br>
   3. Motion.cpp PATCH Analysis summary (N Vijay Anand)<br>
   4. Re: Motion.cpp PATCH Analysis summary (Tom Vaughan)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Thu, 04 Aug 2016 02:48:33 +0530<br>
From: <a href="mailto:nvijay.anand@trispacetech.com">nvijay.anand@trispacetech.com</a><br>
To: <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
Cc: <a href="mailto:nvijay.anand@trispacetech.com">nvijay.anand@trispacetech.com</a><br>
Subject: [x265] [PATCH] logical improvement<br>
Message-ID: <6c41096a33dac4b1e714.<wbr>1470259113@vanand-PC><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
# HG changeset patch<br>
# User N Vijay Anand <<a href="mailto:nvijay.anand@trispacetech.com">nvijay.anand@trispacetech.com</a><wbr>><br>
# Date 1470259010 -19800<br>
#      Thu Aug 04 02:46:50 2016 +0530<br>
# Node ID 6c41096a33dac4b1e714ffe4463ecf<wbr>d08637e921<br>
# Parent  72f16a34946f5f03da875c67a75124<wbr>dfec1b4ecb<br>
logical improvement<br>
<br>
diff -r 72f16a34946f -r 6c41096a33da source/encoder/motion.cpp<br>
--- a/source/encoder/motion.cpp Sat Jul 30 09:48:59 2016 +0530<br>
+++ b/source/encoder/motion.cpp Thu Aug 04 02:46:50 2016 +0530<br>
@@ -108,7 +108,7 @@<br>
     {<br>
         if((bCostStack[i] == bcost) && (bv == bStack[i]))<br>
             break;<br>
-        if((bCostStack[i] > bcost) && (bv != bStack[i]))<br>
+        if((bCostStack[i] >= bcost) && (bv != bStack[i]))<br>
         {<br>
             for (int j=MAX_NUM_BESTVECTORS-1; j>i; j--)<br>
             {<br>
@@ -657,8 +657,8 @@<br>
<br>
     /* re-measure full pel rounded MVP with SAD as search start point */<br>
     MV bmv = pmv.roundToFPel();<br>
-    MV bmvStack[4] = {bmv, bmv, bmv, bmv};<br>
-    int bmvCostStack[4] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};<br>
+    MV bmvStack[MAX_NUM_BESTVECTORS] = {bmv, bmv, bmv, bmv};<br>
+    int bmvCostStack[MAX_NUM_<wbr>BESTVECTORS] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};<br>
     int bcost = bprecost;<br>
     if (pmv.isSubpel())<br>
     {<br>
@@ -934,7 +934,7 @@<br>
     do \<br>
     {  \<br>
         COPY2_IF_LT(bcost, costs[k], dir, x * 16 + (y & 15)); \<br>
-        PushToBMVStack(bmvStack, bmv+MV(x*i,y*i), bmvCostStack, costs[k]); \<br>
+        PushToBMVStack(bmvStack, omv+MV(x*i,y*i), bmvCostStack, costs[k]); \<br>
     } while (0)<br>
<br>
                 SADS(0, +0, -4, +0, +4, -2, -3, +2, -3);<br>
@@ -1160,7 +1160,7 @@<br>
     else<br>
     {<br>
         bmv = bmv.toQPel(); // promote search bmv to qpel<br>
-        for (int i=0; i<4; i++)<br>
+        for (int i=0; i<MAX_NUM_BESTVECTORS; i++)<br>
         {<br>
           bmvStack[i] = bmvStack[i].toQPel();<br>
         }<br>
@@ -1224,6 +1224,7 @@<br>
         for (int nBmv=0; nBmv<MAX_NUM_BESTVECTORS; nBmv++)<br>
         {<br>
           bmv =  bmvStack[nBmv];<br>
+          bcost = bmvCostStack[nBmv];<br>
<br>
           if (wl.hpel_satd)<br>
           {<br>
@@ -1287,6 +1288,7 @@<br>
<br>
     x265_emms();<br>
     outQMv = bmv;<br>
+<br>
     return bcost;<br>
 }<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 4 Aug 2016 05:28:24 +0800 (CST)<br>
From: chen  <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>
To: "Development for x265" <<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a>><br>
Subject: Re: [x265] [PATCH] logical improvement<br>
Message-ID: <<a href="mailto:100b94a6.12b.156524eb1f2.Coremail.chenm003@163.com">100b94a6.12b.156524eb1f2.<wbr>Coremail.chenm003@163.com</a>><br>
Content-Type: text/plain; charset="gbk"<br>
<br>
<br>
At 2016-08-04 05:18:33,<a href="mailto:nvijay.anand@trispacetech.com">nvijay.anand@<wbr>trispacetech.com</a> wrote:<br>
># HG changeset patch<br>
># User N Vijay Anand <<a href="mailto:nvijay.anand@trispacetech.com">nvijay.anand@trispacetech.com</a><wbr>><br>
># Date 1470259010 -19800<br>
>#      Thu Aug 04 02:46:50 2016 +0530<br>
># Node ID 6c41096a33dac4b1e714ffe4463ecf<wbr>d08637e921<br>
># Parent  72f16a34946f5f03da875c67a75124<wbr>dfec1b4ecb<br>
>logical improvement<br>
><br>
>diff -r 72f16a34946f -r 6c41096a33da source/encoder/motion.cpp<br>
>--- a/source/encoder/motion.cpp        Sat Jul 30 09:48:59 2016 +0530<br>
>+++ b/source/encoder/motion.cpp        Thu Aug 04 02:46:50 2016 +0530<br>
>@@ -108,7 +108,7 @@<br>
>     {<br>
>         if((bCostStack[i] == bcost) && (bv == bStack[i]))<br>
>             break;<br>
>-        if((bCostStack[i] > bcost) && (bv != bStack[i]))<br>
>+        if((bCostStack[i] >= bcost) && (bv != bStack[i]))<br>
>         {<br>
>             for (int j=MAX_NUM_BESTVECTORS-1; j>i; j--)<br>
>             {<br>
>@@ -657,8 +657,8 @@<br>
><br>
>     /* re-measure full pel rounded MVP with SAD as search start point */<br>
>     MV bmv = pmv.roundToFPel();<br>
>-    MV bmvStack[4] = {bmv, bmv, bmv, bmv};<br>
>-    int bmvCostStack[4] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};<br>
>+    MV bmvStack[MAX_NUM_BESTVECTORS] = {bmv, bmv, bmv, bmv};<br>
>+    int bmvCostStack[MAX_NUM_<wbr>BESTVECTORS] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};<br>
if MAX_NUM_BESTVECTORS more than 4, you will get bug from here.<br>
<br>
>     int bcost = bprecost;<br>
>     if (pmv.isSubpel())<br>
>     {<br>
>@@ -934,7 +934,7 @@<br>
>     do \<br>
>     {  \<br>
>         COPY2_IF_LT(bcost, costs[k], dir, x * 16 + (y & 15)); \<br>
>-        PushToBMVStack(bmvStack, bmv+MV(x*i,y*i), bmvCostStack, costs[k]); \<br>
>+        PushToBMVStack(bmvStack, omv+MV(x*i,y*i), bmvCostStack, costs[k]); \<br>
>     } while (0)<br>
><br>
>                 SADS(0, +0, -4, +0, +4, -2, -3, +2, -3);<br>
>@@ -1160,7 +1160,7 @@<br>
>     else<br>
>     {<br>
>         bmv = bmv.toQPel(); // promote search bmv to qpel<br>
>-        for (int i=0; i<4; i++)<br>
>+        for (int i=0; i<MAX_NUM_BESTVECTORS; i++)<br>
>         {<br>
>           bmvStack[i] = bmvStack[i].toQPel();<br>
>         }<br>
>@@ -1224,6 +1224,7 @@<br>
>         for (int nBmv=0; nBmv<MAX_NUM_BESTVECTORS; nBmv++)<br>
>         {<br>
>           bmv =  bmvStack[nBmv];<br>
>+          bcost = bmvCostStack[nBmv];<br>
><br>
>           if (wl.hpel_satd)<br>
>           {<br>
>@@ -1287,6 +1288,7 @@<br>
><br>
>     x265_emms();<br>
>     outQMv = bmv;<br>
>+<br>
>     return bcost;<br>
> }<br>
><br>
>_____________________________<wbr>__________________<br>
>x265-devel mailing list<br>
><a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
><a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.videolan.org/pipermail/x265-devel/attachments/20160804/cba9d227/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.videolan.org/<wbr>pipermail/x265-devel/<wbr>attachments/20160804/cba9d227/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Thu, 4 Aug 2016 03:36:43 +0530<br>
From: N Vijay Anand <<a href="mailto:nvijay.anand@trispacetech.com">nvijay.anand@trispacetech.com</a><wbr>><br>
To: <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
Subject: [x265] Motion.cpp PATCH Analysis summary<br>
Message-ID:<br>
        <CA+G9v=D-XhZvKFFdWWf=_<a href="mailto:2Du-OiHiXM3VdS7XM15LuG-fCo1HQ@mail.gmail.com">2Du-<wbr>OiHiXM3VdS7XM15LuG-fCo1HQ@<wbr>mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
1. Use of 4 best motion vectors helps in improving<br>
    final bmv about 25% times in simulation.<br>
    i.e 25% times there is a lesser bcost, bmv found<br>
    than with 1 best motion vector.<br>
    This provides better coding efficiency, and for<br>
     100 frames HD seq. (jogging_girl) statistics<br>
    changes from 1-I frame, 46 - Pframe, 53-BFrame<br>
    to 1 I-frame, 45-Pframe, 54 -B frame.<br>
<br>
2. 4 is ideal, as more is compute expensive.<br>
    This is number can be hardcoded as a const.<br>
3. BD-PSNR BD-SSIM is same/slightly better with this<br>
    improvements.    But no degradation.<br>
<br>
<br>
--<br>
Principal Architect and Director,<br>
TriSpace Technologies Pvt Ltd.,<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.videolan.org/pipermail/x265-devel/attachments/20160804/aff69056/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.videolan.org/<wbr>pipermail/x265-devel/<wbr>attachments/20160804/aff69056/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Thu, 4 Aug 2016 09:20:02 +0200<br>
From: Tom Vaughan <<a href="mailto:tom.vaughan@multicorewareinc.com">tom.vaughan@multicorewareinc.<wbr>com</a>><br>
To: Development for x265 <<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a>><br>
Subject: Re: [x265] Motion.cpp PATCH Analysis summary<br>
Message-ID: <<a href="mailto:fafb375b52048d34c25e54728f849a44@mail.gmail.com">fafb375b52048d34c25e54728f849<wbr>a44@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi Vijay.  This sounds great.  Thanks for your contribution.<br>
<br>
<br>
<br>
I think Min Chen was just pointing out that your patch needs to make sure<br>
the number of bmvs doesn’t overflow.<br>
<br>
<br>
<br>
We could hard-code the number of bmvs to keep, but we could also make this<br>
a variable that can be user configurable.<br>
<br>
<br>
<br>
You mention that keeping more bmvs is compute-expensive.  That’s the<br>
challenge with every improvement we try to make.  There is almost always a<br>
tradeoff between improved efficiency and compute cost (speed).  For each<br>
patch, it would be helpful if you would share test results that show the<br>
improvement in efficiency, and the cost in performance.  Some improvements<br>
may only be suitable for very slow performance presets, and we would want<br>
to keep them turned off for fast presets.<br>
<br>
<br>
<br>
You mention that this patch provides better coding efficiency, but you also<br>
say that BD-PSNR and BD-SSIM is same/slightly better, but no degradation.<br>
What is the effect on visual quality?  We care much more about subjective<br>
visual quality than objective quality metrics.  So any subjective quality<br>
analysis is also welcomed.  Any patch that affects outputs will be<br>
evaluated for the effect on subjective visual quality before we commit it.<br>
<br>
<br>
<br>
Tom<br>
<br>
<br>
<br>
*From:* x265-devel [mailto:<a href="mailto:x265-devel-bounces@videolan.org">x265-devel-bounces@<wbr>videolan.org</a>] *On Behalf Of *N<br>
Vijay Anand<br>
*Sent:* Thursday, August 4, 2016 12:07 AM<br>
*To:* <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
*Subject:* [x265] Motion.cpp PATCH Analysis summary<br>
<br>
<br>
<br>
1. Use of 4 best motion vectors helps in improving<br>
<br>
    final bmv about 25% times in simulation.<br>
<br>
    i.e 25% times there is a lesser bcost, bmv found<br>
<br>
    than with 1 best motion vector.<br>
<br>
    This provides better coding efficiency, and for<br>
<br>
     100 frames HD seq. (jogging_girl) statistics<br>
<br>
    changes from 1-I frame, 46 - Pframe, 53-BFrame<br>
<br>
    to 1 I-frame, 45-Pframe, 54 -B frame.<br>
<br>
<br>
<br>
2. 4 is ideal, as more is compute expensive.<br>
<br>
    This is number can be hardcoded as a const.<br>
<br>
3. BD-PSNR BD-SSIM is same/slightly better with this<br>
<br>
    improvements.    But no degradation.<br>
<br>
<br>
<br>
<br>
<br>
--<br>
<br>
Principal Architect and Director,<br>
<br>
TriSpace Technologies Pvt Ltd.,<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.videolan.org/pipermail/x265-devel/attachments/20160804/b447b7f2/attachment.html" rel="noreferrer" target="_blank">http://mailman.videolan.org/<wbr>pipermail/x265-devel/<wbr>attachments/20160804/b447b7f2/<wbr>attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br>
<br>
------------------------------<br>
<br>
End of x265-devel Digest, Vol 39, Issue 2<br>
******************************<wbr>***********<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Principal Architect and Director,</div><div>TriSpace Technologies Pvt Ltd.,</div><div><span style="font-size:12.8000001907349px">Bangalore</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8px">CONFIDENTIALITY NOTE : The information in this e-mail is confidential and privileged; it is intended for use solely by the individual or entity named as the recipient hereof. Disclosure, copying, distribution, or use of the contents of this e-mail by persons other than the intended recipient is strictly prohibited and may violate applicable laws. If you have received this e-mail in error, please delete the original message and notify us by return email or collect call immediately. Thank you. TriSpace Technologies Pvt. Ltd.</span><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div></div></div></div></div></div>
</div>