[x265] [PATCH 2 of 2] improve ctuLumaLevel logic by Sad and CMOV
Deepthi Nandakumar
deepthi at multicorewareinc.com
Wed Aug 12 05:52:01 CEST 2015
nice, we need a primitive for maxLumaLevel.
On Wed, Aug 12, 2015 at 3:54 AM, Min Chen <chenm003 at 163.com> wrote:
> # HG changeset patch
> # User Min Chen <chenm003 at 163.com>
> # Date 1439331239 25200
> # Node ID 66b7f9300b8c392df7f1d597bec0fd099071c1af
> # Parent aeae99c6c24580b510cdaf119bb6921f62c78368
> improve ctuLumaLevel logic by Sad and CMOV
> ---
> source/encoder/frameencoder.cpp | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff -r aeae99c6c245 -r 66b7f9300b8c source/encoder/frameencoder.cpp
> --- a/source/encoder/frameencoder.cpp Tue Aug 11 15:13:55 2015 -0700
> +++ b/source/encoder/frameencoder.cpp Tue Aug 11 15:13:59 2015 -0700
> @@ -991,13 +991,14 @@
> }
>
> /* calculate maximum and average luma levels */
> - uint32_t ctuLumaLevel = 0;
> + static const pixel dummy_zero[MAX_CU_SIZE] = {0};
> + uint32_t ctuLumaLevel =
> primitives.pu[best.fencYuv->m_part].sad(best.fencYuv->m_buf[0],
> best.fencYuv->m_size, dummy_zero, 0);
> uint32_t ctuNoOfPixels = best.fencYuv->m_size *
> best.fencYuv->m_size;
> for (uint32_t i = 0; i < ctuNoOfPixels; i++)
> {
> pixel p = best.fencYuv->m_buf[0][i];
> - ctuLumaLevel += p;
> - curRow.rowStats.maxLumaLevel = X265_MAX(p,
> curRow.rowStats.maxLumaLevel);
> + if (p > curRow.rowStats.maxLumaLevel)
> + curRow.rowStats.maxLumaLevel = p;
> }
> curRow.rowStats.lumaLevel += (double)(ctuLumaLevel) /
> ctuNoOfPixels;
>
>
> _______________________________________________
> 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/20150812/085c3ae9/attachment.html>
More information about the x265-devel
mailing list