[x265] [PATCH] stats: log maxCLL and maxFALL values calculated from input pictures

Deepthi Nandakumar deepthi at multicorewareinc.com
Fri Aug 14 12:57:19 CEST 2015


No. maxCLL and maxFall are written into frame_stats regardless of
user-input for now.

The user input p->contentLightLevelInfo is what gets written into the SEI,
again, for now. We need to figure out a way to re-generate the content
level SEI with stats->maxCLL and stats->maxFall. At that point, we'll also
take a call on whether to ignore user-input maxCLL/maxFALL or disallow both
options at the same time.

On Fri, Aug 14, 2015 at 3:20 PM, <kavitha at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Kavitha Sampath <kavitha at multicorewareinc.com>
> # Date 1439545723 -19800
> #      Fri Aug 14 15:18:43 2015 +0530
> # Node ID f51276cb53f15b335112742fc48fe35009f4cb66
> # Parent  d56b2466c04459205287e1581d8a36eebf372ba6
> stats: log maxCLL and maxFALL values calculated from input pictures
>
> diff -r d56b2466c044 -r f51276cb53f1 source/encoder/encoder.cpp
> --- a/source/encoder/encoder.cpp        Wed Aug 12 18:12:20 2015 +0530
> +++ b/source/encoder/encoder.cpp        Fri Aug 14 15:18:43 2015 +0530
> @@ -1038,6 +1038,16 @@
>          stats->statsB.psnrU   = m_analyzeB.m_psnrSumU /
> (double)m_analyzeB.m_numPics;
>          stats->statsB.psnrV   = m_analyzeB.m_psnrSumV /
> (double)m_analyzeB.m_numPics;
>          stats->statsB.ssim    = x265_ssim2dB(m_analyzeB.m_globalSsim /
> (double)m_analyzeB.m_numPics);
> +
> +        if (!m_param->contentLightLevelInfo)
> +        {
> +            stats->maxCLL     = m_analyzeAll.m_maxCLL;
> +            stats->maxFALL    = (uint16_t)(m_analyzeAll.m_maxFALL /
> m_analyzeAll.m_numPics);
> +        }
> +        else
> +        {
> +            sscanf(m_param->contentLightLevelInfo, "%hu,%hu",
> &stats->maxCLL, &stats->maxFALL);
> +        }
>      }
>
>      /* If new statistics are added to x265_stats, we must check here
> whether the
> @@ -1111,6 +1121,12 @@
>              m_analyzeB.addSsim(ssim);
>      }
>
> +    if (!m_param->contentLightLevelInfo)
> +    {
> +        m_analyzeAll.m_maxFALL += curFrame->m_fencPic->m_avgLumaLevel;
> +        m_analyzeAll.m_maxCLL = X265_MAX(m_analyzeAll.m_maxCLL,
> curFrame->m_fencPic->m_maxLumaLevel);
> +    }
> +
>      char c = (slice->isIntra() ? 'I' : slice->isInterP() ? 'P' : 'B');
>      int poc = slice->m_poc;
>      if (!IS_REFERENCED(curFrame))
> diff -r d56b2466c044 -r f51276cb53f1 source/encoder/encoder.h
> --- a/source/encoder/encoder.h  Wed Aug 12 18:12:20 2015 +0530
> +++ b/source/encoder/encoder.h  Fri Aug 14 15:18:43 2015 +0530
> @@ -47,6 +47,8 @@
>      double        m_totalQp;
>      uint64_t      m_accBits;
>      uint32_t      m_numPics;
> +    uint16_t      m_maxCLL;
> +    double        m_maxFALL;
>
>      EncStats()
>      {
> @@ -54,6 +56,8 @@
>          m_accBits = 0;
>          m_numPics = 0;
>          m_totalQp = 0;
> +        m_maxCLL = 0;
> +        m_maxFALL = 0;
>      }
>
>      void addQP(double aveQp);
> diff -r d56b2466c044 -r f51276cb53f1 source/x265-extras.cpp
> --- a/source/x265-extras.cpp    Wed Aug 12 18:12:20 2015 +0530
> +++ b/source/x265-extras.cpp    Fri Aug 14 15:18:43 2015 +0530
> @@ -36,7 +36,7 @@
>      "I count, I ave-QP, I kbps, I-PSNR Y, I-PSNR U, I-PSNR V, I-SSIM
> (dB), "
>      "P count, P ave-QP, P kbps, P-PSNR Y, P-PSNR U, P-PSNR V, P-SSIM
> (dB), "
>      "B count, B ave-QP, B kbps, B-PSNR Y, B-PSNR U, B-PSNR V, B-SSIM
> (dB), "
> -    "Version\n";
> +    "MaxCLL, MaxFALL, Version\n";
>
>  FILE* x265_csvlog_open(const x265_api& api, const x265_param& param,
> const char* fname, int level)
>  {
> @@ -273,7 +273,7 @@
>      else
>          fprintf(csvfp, " -, -, -, -, -, -, -,");
>
> -    fprintf(csvfp, " %s\n", api.version_str);
> +    fprintf(csvfp, " %-6u, %-6u, %s\n", stats.maxCLL, stats.maxFALL,
> api.version_str);
>  }
>
>  /* The dithering algorithm is based on Sierra-2-4A error diffusion. */
> diff -r d56b2466c044 -r f51276cb53f1 source/x265.h
> --- a/source/x265.h     Wed Aug 12 18:12:20 2015 +0530
> +++ b/source/x265.h     Fri Aug 14 15:18:43 2015 +0530
> @@ -385,6 +385,8 @@
>      x265_sliceType_stats  statsI;               /* statistics of I slice
> */
>      x265_sliceType_stats  statsP;               /* statistics of P slice
> */
>      x265_sliceType_stats  statsB;               /* statistics of B slice
> */
> +    uint16_t              maxCLL;               /* maximum content light
> level */
> +    uint16_t              maxFALL;              /* maximum frame average
> light level  */
>  } x265_stats;
>
>  /* String values accepted by x265_param_parse() (and CLI) for various
> parameters */
> _______________________________________________
> 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/20150814/4eb1f543/attachment.html>


More information about the x265-devel mailing list