[x265] [PATCH] stats: use input source pictures to calculate avgerage and max luma level

Steve Borho steve at borho.org
Wed Aug 5 17:47:46 CEST 2015


On 08/05, kavitha at multicorewareinc.com wrote:
> # HG changeset patch
> # User Kavitha Sampath <kavitha at multicorewareinc.com>
> # Date 1438757018 -19800
> #      Wed Aug 05 12:13:38 2015 +0530
> # Node ID 3483e9cffd703c540f75068e358bb8261dd80165
> # Parent  3fa7f6838098854de79d3800b2d775dabaf45705
> stats: use input source pictures to calculate avgerage and max luma level
> 
> diff -r 3fa7f6838098 -r 3483e9cffd70 source/encoder/frameencoder.cpp
> --- a/source/encoder/frameencoder.cpp	Mon Aug 03 14:56:21 2015 -0500
> +++ b/source/encoder/frameencoder.cpp	Wed Aug 05 12:13:38 2015 +0530
> @@ -990,12 +990,12 @@
>          }
>          uint64_t ctuLumaLevel = 0;
>          uint64_t ctuNoOfPixels = 0;
> -        for (uint32_t i = 0; i < (best.reconYuv.m_size * best.reconYuv.m_size); i++)
> +        for (uint32_t i = 0; i < (best.fencYuv->m_size * best.fencYuv->m_size); i++)
>          {
> -            ctuLumaLevel += *(best.reconYuv.m_buf[0] + i);
> +            ctuLumaLevel += *(best.fencYuv->m_buf[0] + i);
>              ctuNoOfPixels++;
> -            if ((*(best.reconYuv.m_buf[0] + i)) > curRow.rowStats.maxLumaLevel)
> -                curRow.rowStats.maxLumaLevel = *(best.reconYuv.m_buf[0] + i);
> +            if ((*(best.fencYuv->m_buf[0] + i)) > curRow.rowStats.maxLumaLevel)
> +                curRow.rowStats.maxLumaLevel = *(best.fencYuv->m_buf[0] + i);

The patch seems ok but I don't understand why we would want to measure
luma levels in the source pixels. These max values will be used by the
decoder, which only sees decoded (recon) pixels. 

Is there a requirement that the max values be consistent across multiple
encodes or something?

>          }
>          curRow.rowStats.lumaLevel += (double)(ctuLumaLevel / ctuNoOfPixels);
>  
> _______________________________________________
> 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