[x265] x265-devel Digest, Vol 39, Issue 2

N Vijay Anand nvijay.anand at trispacetech.com
Fri Aug 5 12:24:01 CEST 2016


Hi Tom,

I was wondering how much test data to submit here.
But here's the thing:

1. Running tests on presets (5 and above) shows marked improvement in
quality.
    The final file size is little higher corresponding to x265_2.0 version
and the
     reasons are explained by dump (of medium preset).

    In order to cover the sufficiency part of improvement, ran tests
targeting varying bitrate
    and the BD-PSNR , BD-SSIM curves obtained with patch is always better
and in few places
    same as x265_2.0 version BD-PSNR , BD-SSIM curves.

2. With Patch:
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)
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)
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)
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 35.6% 28.9% 17.8% 13.3% 4.4%

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)

3. With x265_2.0:

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)
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)
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)
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 3.8% 0.0% 15.4% 69.2% 11.5%

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)


4. Coding efficiency gain is evident from the P and B frame statistics.
Final quality PSNR, ssim and visual quality is also
    better with Patch.
    The file size is little higher because of I frame statistics. This can
be plausible because Rate Control module
    got better estimates on P and B frames (as also increased number of P
and B frames), allowing it the luxury
    to play with I frame compression-quality.

5. I've added corrections to possible bug arising as also parameterising
the max BMV's according to ME search method
   (1<<seachMethod)

Regards,
Vijay



On Thu, Aug 4, 2016 at 12:50 PM, <x265-devel-request at videolan.org> wrote:

> Send x265-devel mailing list submissions to
>         x265-devel at videolan.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mailman.videolan.org/listinfo/x265-devel
> or, via email, send a message with subject or body 'help' to
>         x265-devel-request at videolan.org
>
> You can reach the person managing the list at
>         x265-devel-owner at videolan.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of x265-devel digest..."
>
>
> Today's Topics:
>
>    1. [PATCH] logical improvement (nvijay.anand at trispacetech.com)
>    2. Re: [PATCH] logical improvement (chen)
>    3. Motion.cpp PATCH Analysis summary (N Vijay Anand)
>    4. Re: Motion.cpp PATCH Analysis summary (Tom Vaughan)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 04 Aug 2016 02:48:33 +0530
> From: nvijay.anand at trispacetech.com
> To: x265-devel at videolan.org
> Cc: nvijay.anand at trispacetech.com
> Subject: [x265] [PATCH] logical improvement
> Message-ID: <6c41096a33dac4b1e714.1470259113 at vanand-PC>
> Content-Type: text/plain; charset="us-ascii"
>
> # HG changeset patch
> # User N Vijay Anand <nvijay.anand at trispacetech.com>
> # Date 1470259010 -19800
> #      Thu Aug 04 02:46:50 2016 +0530
> # Node ID 6c41096a33dac4b1e714ffe4463ecfd08637e921
> # Parent  72f16a34946f5f03da875c67a75124dfec1b4ecb
> logical improvement
>
> diff -r 72f16a34946f -r 6c41096a33da source/encoder/motion.cpp
> --- a/source/encoder/motion.cpp Sat Jul 30 09:48:59 2016 +0530
> +++ b/source/encoder/motion.cpp Thu Aug 04 02:46:50 2016 +0530
> @@ -108,7 +108,7 @@
>      {
>          if((bCostStack[i] == bcost) && (bv == bStack[i]))
>              break;
> -        if((bCostStack[i] > bcost) && (bv != bStack[i]))
> +        if((bCostStack[i] >= bcost) && (bv != bStack[i]))
>          {
>              for (int j=MAX_NUM_BESTVECTORS-1; j>i; j--)
>              {
> @@ -657,8 +657,8 @@
>
>      /* re-measure full pel rounded MVP with SAD as search start point */
>      MV bmv = pmv.roundToFPel();
> -    MV bmvStack[4] = {bmv, bmv, bmv, bmv};
> -    int bmvCostStack[4] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};
> +    MV bmvStack[MAX_NUM_BESTVECTORS] = {bmv, bmv, bmv, bmv};
> +    int bmvCostStack[MAX_NUM_BESTVECTORS] = {bprecost, 0x7fffffff,
> 0x7fffffff, 0x7fffffff};
>      int bcost = bprecost;
>      if (pmv.isSubpel())
>      {
> @@ -934,7 +934,7 @@
>      do \
>      {  \
>          COPY2_IF_LT(bcost, costs[k], dir, x * 16 + (y & 15)); \
> -        PushToBMVStack(bmvStack, bmv+MV(x*i,y*i), bmvCostStack,
> costs[k]); \
> +        PushToBMVStack(bmvStack, omv+MV(x*i,y*i), bmvCostStack,
> costs[k]); \
>      } while (0)
>
>                  SADS(0, +0, -4, +0, +4, -2, -3, +2, -3);
> @@ -1160,7 +1160,7 @@
>      else
>      {
>          bmv = bmv.toQPel(); // promote search bmv to qpel
> -        for (int i=0; i<4; i++)
> +        for (int i=0; i<MAX_NUM_BESTVECTORS; i++)
>          {
>            bmvStack[i] = bmvStack[i].toQPel();
>          }
> @@ -1224,6 +1224,7 @@
>          for (int nBmv=0; nBmv<MAX_NUM_BESTVECTORS; nBmv++)
>          {
>            bmv =  bmvStack[nBmv];
> +          bcost = bmvCostStack[nBmv];
>
>            if (wl.hpel_satd)
>            {
> @@ -1287,6 +1288,7 @@
>
>      x265_emms();
>      outQMv = bmv;
> +
>      return bcost;
>  }
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 4 Aug 2016 05:28:24 +0800 (CST)
> From: chen  <chenm003 at 163.com>
> To: "Development for x265" <x265-devel at videolan.org>
> Subject: Re: [x265] [PATCH] logical improvement
> Message-ID: <100b94a6.12b.156524eb1f2.Coremail.chenm003 at 163.com>
> Content-Type: text/plain; charset="gbk"
>
>
> At 2016-08-04 05:18:33,nvijay.anand at trispacetech.com wrote:
> ># HG changeset patch
> ># User N Vijay Anand <nvijay.anand at trispacetech.com>
> ># Date 1470259010 -19800
> >#      Thu Aug 04 02:46:50 2016 +0530
> ># Node ID 6c41096a33dac4b1e714ffe4463ecfd08637e921
> ># Parent  72f16a34946f5f03da875c67a75124dfec1b4ecb
> >logical improvement
> >
> >diff -r 72f16a34946f -r 6c41096a33da source/encoder/motion.cpp
> >--- a/source/encoder/motion.cpp        Sat Jul 30 09:48:59 2016 +0530
> >+++ b/source/encoder/motion.cpp        Thu Aug 04 02:46:50 2016 +0530
> >@@ -108,7 +108,7 @@
> >     {
> >         if((bCostStack[i] == bcost) && (bv == bStack[i]))
> >             break;
> >-        if((bCostStack[i] > bcost) && (bv != bStack[i]))
> >+        if((bCostStack[i] >= bcost) && (bv != bStack[i]))
> >         {
> >             for (int j=MAX_NUM_BESTVECTORS-1; j>i; j--)
> >             {
> >@@ -657,8 +657,8 @@
> >
> >     /* re-measure full pel rounded MVP with SAD as search start point */
> >     MV bmv = pmv.roundToFPel();
> >-    MV bmvStack[4] = {bmv, bmv, bmv, bmv};
> >-    int bmvCostStack[4] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};
> >+    MV bmvStack[MAX_NUM_BESTVECTORS] = {bmv, bmv, bmv, bmv};
> >+    int bmvCostStack[MAX_NUM_BESTVECTORS] = {bprecost, 0x7fffffff,
> 0x7fffffff, 0x7fffffff};
> if MAX_NUM_BESTVECTORS more than 4, you will get bug from here.
>
> >     int bcost = bprecost;
> >     if (pmv.isSubpel())
> >     {
> >@@ -934,7 +934,7 @@
> >     do \
> >     {  \
> >         COPY2_IF_LT(bcost, costs[k], dir, x * 16 + (y & 15)); \
> >-        PushToBMVStack(bmvStack, bmv+MV(x*i,y*i), bmvCostStack,
> costs[k]); \
> >+        PushToBMVStack(bmvStack, omv+MV(x*i,y*i), bmvCostStack,
> costs[k]); \
> >     } while (0)
> >
> >                 SADS(0, +0, -4, +0, +4, -2, -3, +2, -3);
> >@@ -1160,7 +1160,7 @@
> >     else
> >     {
> >         bmv = bmv.toQPel(); // promote search bmv to qpel
> >-        for (int i=0; i<4; i++)
> >+        for (int i=0; i<MAX_NUM_BESTVECTORS; i++)
> >         {
> >           bmvStack[i] = bmvStack[i].toQPel();
> >         }
> >@@ -1224,6 +1224,7 @@
> >         for (int nBmv=0; nBmv<MAX_NUM_BESTVECTORS; nBmv++)
> >         {
> >           bmv =  bmvStack[nBmv];
> >+          bcost = bmvCostStack[nBmv];
> >
> >           if (wl.hpel_satd)
> >           {
> >@@ -1287,6 +1288,7 @@
> >
> >     x265_emms();
> >     outQMv = bmv;
> >+
> >     return bcost;
> > }
> >
> >_______________________________________________
> >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/20160804/cba9d227/attachment-0001.html>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 4 Aug 2016 03:36:43 +0530
> From: N Vijay Anand <nvijay.anand at trispacetech.com>
> To: x265-devel at videolan.org
> Subject: [x265] Motion.cpp PATCH Analysis summary
> Message-ID:
>         <CA+G9v=D-XhZvKFFdWWf=_2Du-OiHiXM3VdS7XM15LuG-fCo1HQ@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 1. Use of 4 best motion vectors helps in improving
>     final bmv about 25% times in simulation.
>     i.e 25% times there is a lesser bcost, bmv found
>     than with 1 best motion vector.
>     This provides better coding efficiency, and for
>      100 frames HD seq. (jogging_girl) statistics
>     changes from 1-I frame, 46 - Pframe, 53-BFrame
>     to 1 I-frame, 45-Pframe, 54 -B frame.
>
> 2. 4 is ideal, as more is compute expensive.
>     This is number can be hardcoded as a const.
> 3. BD-PSNR BD-SSIM is same/slightly better with this
>     improvements.    But no degradation.
>
>
> --
> Principal Architect and Director,
> TriSpace Technologies Pvt Ltd.,
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.videolan.org/pipermail/x265-devel/
> attachments/20160804/aff69056/attachment-0001.html>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 4 Aug 2016 09:20:02 +0200
> From: Tom Vaughan <tom.vaughan at multicorewareinc.com>
> To: Development for x265 <x265-devel at videolan.org>
> Subject: Re: [x265] Motion.cpp PATCH Analysis summary
> Message-ID: <fafb375b52048d34c25e54728f849a44 at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Vijay.  This sounds great.  Thanks for your contribution.
>
>
>
> I think Min Chen was just pointing out that your patch needs to make sure
> the number of bmvs doesn’t overflow.
>
>
>
> We could hard-code the number of bmvs to keep, but we could also make this
> a variable that can be user configurable.
>
>
>
> You mention that keeping more bmvs is compute-expensive.  That’s the
> challenge with every improvement we try to make.  There is almost always a
> tradeoff between improved efficiency and compute cost (speed).  For each
> patch, it would be helpful if you would share test results that show the
> improvement in efficiency, and the cost in performance.  Some improvements
> may only be suitable for very slow performance presets, and we would want
> to keep them turned off for fast presets.
>
>
>
> You mention that this patch provides better coding efficiency, but you also
> say that BD-PSNR and BD-SSIM is same/slightly better, but no degradation.
> What is the effect on visual quality?  We care much more about subjective
> visual quality than objective quality metrics.  So any subjective quality
> analysis is also welcomed.  Any patch that affects outputs will be
> evaluated for the effect on subjective visual quality before we commit it.
>
>
>
> Tom
>
>
>
> *From:* x265-devel [mailto:x265-devel-bounces at videolan.org] *On Behalf Of
> *N
> Vijay Anand
> *Sent:* Thursday, August 4, 2016 12:07 AM
> *To:* x265-devel at videolan.org
> *Subject:* [x265] Motion.cpp PATCH Analysis summary
>
>
>
> 1. Use of 4 best motion vectors helps in improving
>
>     final bmv about 25% times in simulation.
>
>     i.e 25% times there is a lesser bcost, bmv found
>
>     than with 1 best motion vector.
>
>     This provides better coding efficiency, and for
>
>      100 frames HD seq. (jogging_girl) statistics
>
>     changes from 1-I frame, 46 - Pframe, 53-BFrame
>
>     to 1 I-frame, 45-Pframe, 54 -B frame.
>
>
>
> 2. 4 is ideal, as more is compute expensive.
>
>     This is number can be hardcoded as a const.
>
> 3. BD-PSNR BD-SSIM is same/slightly better with this
>
>     improvements.    But no degradation.
>
>
>
>
>
> --
>
> Principal Architect and Director,
>
> TriSpace Technologies Pvt Ltd.,
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.videolan.org/pipermail/x265-devel/
> attachments/20160804/b447b7f2/attachment.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
>
> ------------------------------
>
> End of x265-devel Digest, Vol 39, Issue 2
> *****************************************
>



-- 
Principal Architect and Director,
TriSpace Technologies Pvt Ltd.,
Bangalore

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160805/53ee255e/attachment-0001.html>


More information about the x265-devel mailing list