[x265] [PATCH] param: update calculated maxCLL, maxFALL values to contentLightLevelInfo
Steve Borho
steve at borho.org
Wed Aug 26 18:08:30 CEST 2015
On 08/26, kavitha at multicorewareinc.com wrote:
> # HG changeset patch
> # User Kavitha Sampath <kavitha at multicorewareinc.com>
> # Date 1440572877 -19800
> # Wed Aug 26 12:37:57 2015 +0530
> # Node ID 73b94b3431f98bc94c2113d98f7788783453197e
> # Parent a28a863393994d8fb1d58c721352d9b4ec8c46ee
> param: update calculated maxCLL, maxFALL values to contentLightLevelInfo
>
> diff -r a28a86339399 -r 73b94b3431f9 source/encoder/encoder.cpp
> --- a/source/encoder/encoder.cpp Mon Aug 24 14:04:32 2015 +0530
> +++ b/source/encoder/encoder.cpp Wed Aug 26 12:37:57 2015 +0530
> @@ -39,6 +39,10 @@
>
> #include "x265.h"
>
> +#if _MSC_VER
> +#pragma warning(disable: 4996) // POSIX functions are just fine, thanks
> +#endif
> +
> namespace X265_NS {
> const char g_sliceTypeToChar[] = {'B', 'P', 'I'};
> }
> @@ -1046,6 +1050,14 @@
>
> stats->maxCLL = m_analyzeAll.m_maxCLL;
> stats->maxFALL = (uint16_t)(m_analyzeAll.m_maxFALL / m_analyzeAll.m_numPics);
> + if (m_param->contentLightLevelInfo)
> + {
> + free((char*)m_param->contentLightLevelInfo);
> +
> + char value[16];
> + sprintf(value, "%hu,%hu", stats->maxCLL, stats->maxFALL);
> + m_param->contentLightLevelInfo = strdup(value);
> + }
> }
FWIW: the necessity of free/strdup here is pretty good evidence that for
this SEI we should keep integers in param for the two values and not use
the quickie string method that we use for mastering display, etc
--
Steve Borho
More information about the x265-devel
mailing list