[x265] [PATCH] weightp: add unweighted duplicate of first weighted L0 reference;

Steve Borho steve at borho.org
Thu Mar 20 23:39:11 CET 2014


On Tue, Mar 18, 2014 at 1:09 PM,  <kavitha at multicorewareinc.com> wrote:
> # HG changeset patch
> # User Kavitha Sampath <kavitha at multicorewareinc.com>
> # Date 1395166152 -19800
> #      Tue Mar 18 23:39:12 2014 +0530
> # Node ID 41d2f204ad3392d536462084586b80fce6ef3904
> # Parent  dc700298419d382e58c49d4ea62a3d7398b4beaf
> weightp: add unweighted duplicate of first weighted L0 reference;
> do not add duplicate if frame has only one reference
>
> diff -r dc700298419d -r 41d2f204ad33 source/encoder/frameencoder.cpp
> --- a/source/encoder/frameencoder.cpp   Tue Mar 18 08:46:15 2014 -0500
> +++ b/source/encoder/frameencoder.cpp   Tue Mar 18 23:39:12 2014 +0530
> @@ -453,6 +453,37 @@
>          }
>      }
>
> +    // Add an unweighted duplicate of first L0 weighted reference
> +    // Do not add duplicate when the frame has only one L0 reference as the encoder signals failure
> +    // while encountering consecutive references with same POC
> +    if (bUseWeightP && slice->m_weightPredTable[0][0][0].bPresentFlag && slice->getNumRefIdx(0) > 1)
> +    {
> +        int numref = slice->getNumRefIdx(0);
> +        TComPic *dup = slice->getRefPic(0, 0);
> +        slice->setRefPic(dup, 0, numref);
> +        slice->setRefPOC(slice->getRefPOC(0, 0), 0, numref);
> +
> +        // update RPS
> +        TComReferencePictureSet *rps = slice->getLocalRPS();
> +        rps->m_numberOfPictures++;
> +        rps->m_numberOfNegativePictures++;

These three lines look unnecessary.  What is their purpose?  The
values at numref+1 are never used, as far as I can tell.

> +        rps->m_deltaPOC[numref + 1] = rps->m_deltaPOC[numref];
> +        rps->m_used[numref + 1] = rps->m_used[numref];
> +        rps->m_POC[numref + 1] = rps->m_POC[numref];


> +        // copy first reference data to the duplicate reference in RPS
> +        rps->m_deltaPOC[numref] = rps->m_deltaPOC[0];
> +        rps->m_used[numref] = rps->m_used[0];
> +        rps->m_POC[numref] = rps->m_POC[0];
> +
> +        wpScalingParam *wp = slice->m_weightPredTable[0][numref];
> +        SET_WEIGHT(wp[0], false, 1, 0, 0);
> +        SET_WEIGHT(wp[1], false, 1, 0, 0);
> +        SET_WEIGHT(wp[2], false, 1, 0, 0);
> +        m_mref[0][numref].init(slice->getRefPic(0, 0)->getPicYuvRec(), NULL);
> +        slice->setNumRefIdx(0, ++numref);
> +    }
> +
>      // Analyze CTU rows, most of the hard work is done here
>      // frame is compressed in a wave-front pattern if WPP is enabled. Loop filter runs as a
>      // wave-front behind the CU compression and reconstruction
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel



-- 
Steve Borho


More information about the x265-devel mailing list