[x265] [PATCH] vbv: refactor, implement row wise qp updates only if vbv is enabled

Deepthi Nandakumar deepthi at multicorewareinc.com
Wed Feb 26 01:56:15 CET 2014


On Mon, Feb 24, 2014 at 6:26 PM, <aarthi at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Aarthi Thirumalai
> # Date 1393244455 -19800
> #      Mon Feb 24 17:50:55 2014 +0530
> # Node ID dce74082c20eea1f7ef9eb10f9a9addc5e7c7bb7
> # Parent  57ce7f0f4f4cbb9acd401751e8bef7b522774e38
> vbv: refactor, implement row wise qp updates only if vbv is enabled.
>
> diff -r 57ce7f0f4f4c -r dce74082c20e source/encoder/frameencoder.cpp
> --- a/source/encoder/frameencoder.cpp   Thu Feb 20 16:01:28 2014 -0800
> +++ b/source/encoder/frameencoder.cpp   Mon Feb 24 17:50:55 2014 +0530
> @@ -1058,6 +1058,7 @@
>      const uint32_t numCols = m_pic->getPicSym()->getFrameWidthInCU();
>      const uint32_t lineStartCUAddr = row * numCols;
>      double qpBase = m_pic->m_avgQpRc;
> +    bool isVbv = m_cfg->param.rc.vbvBufferSize > 0 &&
> m_cfg->param.rc.vbvMaxBitrate > 0;
>

Shouldnt this be just vbvBufferSize >0? Even if max bitrate is not
specified, vbv is still enabled?


>      for (uint32_t col = curRow.m_completed; col < numCols; col++)
>      {
>          const uint32_t cuAddr = lineStartCUAddr + col;
> @@ -1068,10 +1069,10 @@
>          codeRow.m_entropyCoder.resetEntropy();
>          TEncSbac *bufSbac = (m_cfg->param.bEnableWavefront && col == 0 &&
> row > 0) ? &m_rows[row - 1].m_bufferSbacCoder : NULL;
>
> -        if ((uint32_t)row >= col && (row != 0))
> +        if ((uint32_t)row >= col && (row != 0) && isVbv)
>              qpBase = m_pic->getCU(cuAddr - numCols + 1)->m_baseQp;
>
> -        if (m_cfg->param.rc.aqMode || (m_cfg->param.rc.vbvBufferSize > 0
> && m_cfg->param.rc.vbvMaxBitrate > 0))
> +        if (m_cfg->param.rc.aqMode || isVbv)
>          {
>              int qp = calcQpForCu(m_pic, cuAddr, qpBase);
>              setLambda(qp, row);
> @@ -1080,7 +1081,7 @@
>              cu->m_baseQp = qpBase;
>          }
>

As I understand, qp = qpBase + average of qp offsets for that CU. This will
be the final QP based on which mode decision happens. So, why are we
storing qp and qpBase both in cu?


>          codeRow.processCU(cu, m_pic->getSlice(), bufSbac,
> m_cfg->param.bEnableWavefront && col == 1);
> -        if (m_cfg->param.rc.vbvBufferSize &&
> m_cfg->param.rc.vbvMaxBitrate)
> +        if (isVbv)
>          {
>              // Update encoded bits, satdCost, baseQP for each CU
>              m_pic->m_rowDiagSatd[row] += m_pic->m_cuCostsForVbv[cuAddr];
> _______________________________________________
> 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/20140226/2da4cd77/attachment-0001.html>


More information about the x265-devel mailing list