[x265] [PATCH] stats: use input source pictures to calculate avgerage and max luma level
Deepthi Nandakumar
deepthi at multicorewareinc.com
Thu Aug 6 07:23:41 CEST 2015
Thanks, much cleaner. Queued.
On Thu, Aug 6, 2015 at 10:32 AM, <kavitha at multicorewareinc.com> wrote:
> # HG changeset patch
> # User Kavitha Sampath <kavitha at multicorewareinc.com>
> # Date 1438837146 -19800
> # Thu Aug 06 10:29:06 2015 +0530
> # Node ID 9fcc0e6bdc54758478e37e988e640fb52303d28b
> # Parent 377a996a8d74110f838ff2e3cef1c42781d6d730
> stats: use input source pictures to calculate avgerage and max luma level
>
> diff -r 377a996a8d74 -r 9fcc0e6bdc54 source/encoder/frameencoder.cpp
> --- a/source/encoder/frameencoder.cpp Wed Aug 05 15:09:14 2015 +0530
> +++ b/source/encoder/frameencoder.cpp Thu Aug 06 10:29:06 2015 +0530
> @@ -988,16 +988,17 @@
> for (int n = 0; n < INTRA_MODES; n++)
> curRow.rowStats.cuIntraDistribution[depth][n] +=
> frameLog.cuIntraDistribution[depth][n];
> }
> - uint64_t ctuLumaLevel = 0;
> - uint64_t ctuNoOfPixels = 0;
> - for (uint32_t i = 0; i < (best.reconYuv.m_size *
> best.reconYuv.m_size); i++)
> +
> + /* calculate maximum and average luma levels */
> + uint32_t ctuLumaLevel = 0;
> + uint32_t ctuNoOfPixels = best.fencYuv->m_size *
> best.fencYuv->m_size;
> + for (uint32_t i = 0; i < ctuNoOfPixels; i++)
> {
> - ctuLumaLevel += *(best.reconYuv.m_buf[0] + i);
> - ctuNoOfPixels++;
> - if ((*(best.reconYuv.m_buf[0] + i)) >
> curRow.rowStats.maxLumaLevel)
> - curRow.rowStats.maxLumaLevel = *(best.reconYuv.m_buf[0] +
> i);
> + pixel p = best.fencYuv->m_buf[0][i];
> + ctuLumaLevel += p;
> + curRow.rowStats.maxLumaLevel = X265_MAX(p,
> curRow.rowStats.maxLumaLevel);
> }
> - curRow.rowStats.lumaLevel += (double)(ctuLumaLevel /
> ctuNoOfPixels);
> + curRow.rowStats.lumaLevel += (double)(ctuLumaLevel) /
> ctuNoOfPixels;
>
> curEncData.m_cuStat[cuAddr].totalBits = best.totalBits;
> x265_emms();
> _______________________________________________
> 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/20150806/e5706ad2/attachment.html>
More information about the x265-devel
mailing list