[x265] [PATCH] slicetype: change the total CU value for averaging of qp_adj

Deepthi Nandakumar deepthi at multicorewareinc.com
Sat Mar 7 05:35:53 CET 2015


This is an error introduced when we moved calcAdaptiveQuantFrame from
ratecontrol to slicetype. ncu in ratecontrol signifies actual number of
16x16 blocks, whereas ncu in slicetype leaves out the border blocks (I
think?)

slicetype.cpp:481 (m_ncu = m_widthInCU > 2 && m_heightInCU > 2 ?
(m_widthInCU - 2) * (m_heightInCU - 2) : m_widthInCU * m_heightInCU;)

On Fri, Mar 6, 2015 at 8:38 PM, Steve Borho <steve at borho.org> wrote:

> On 03/06, sreelakshmy at multicorewareinc.com wrote:
> > # HG changeset patch
> > # User Sreelakshmy V G <sreelakshmy at multicorewareinc.com>
> > # Date 1425636287 -19800
> > #      Fri Mar 06 15:34:47 2015 +0530
> > # Node ID 99edf8d0064295633a7c52536600f5b55b9fd060
> > # Parent  45deb0125890ab0211d0e256c74d91ede78d12d3
> > slicetype: change the total CU value for averaging of qp_adj
>
> I need an explanation why, in the commit message
>
> > diff -r 45deb0125890 -r 99edf8d00642 source/encoder/slicetype.cpp
> > --- a/source/encoder/slicetype.cpp    Thu Mar 05 20:39:08 2015 -0600
> > +++ b/source/encoder/slicetype.cpp    Fri Mar 06 15:34:47 2015 +0530
> > @@ -106,6 +106,11 @@
> >      int maxCol = curFrame->m_fencPic->m_picWidth;
> >      int maxRow = curFrame->m_fencPic->m_picHeight;
> >
> > +    int lowresCuWidth = ((param->sourceWidth / 2) + X265_LOWRES_CU_SIZE
> - 1) >> X265_LOWRES_CU_BITS;
> > +    int lowresCuHeight = ((param->sourceHeight / 2) +
> X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS;
> > +    int totalBlocks = lowresCuWidth * lowresCuHeight;
> > +
> > +
>
> too many blank lines here
>
> >      for (int y = 0; y < 3; y++)
> >      {
> >          curFrame->m_lowres.wp_ssd[y] = 0;
> > @@ -141,6 +146,7 @@
> >      {
> >          blockXY = 0;
> >          double avg_adj_pow2 = 0, avg_adj = 0, qp_adj = 0;
> > +
> >          if (param->rc.aqMode == X265_AQ_AUTO_VARIANCE)
> >          {
> >              double bit_depth_correction = pow(1 << (X265_DEPTH - 8),
> 0.5);
> > @@ -157,8 +163,8 @@
> >                  }
> >              }
> >
> > -            avg_adj /= ncu;
> > -            avg_adj_pow2 /= ncu;
> > +            avg_adj /= totalBlocks;
> > +            avg_adj_pow2 /= totalBlocks;
> >              strength = param->rc.aqStrength * avg_adj /
> bit_depth_correction;
> >              avg_adj = avg_adj - 0.5f * (avg_adj_pow2 - (11.f *
> bit_depth_correction)) / avg_adj;
> >          }
> > _______________________________________________
> > 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/20150307/71d1893a/attachment-0001.html>


More information about the x265-devel mailing list