[FFmpeg-devel] [PATCH] avutil: Add basic transfer functions for each AVColorTransferCharacteristic
wm4
nfxjfg at googlemail.com
Tue Sep 1 13:49:00 CEST 2015
On Tue, 1 Sep 2015 12:02:06 +0100
Kevin Wheatley <kevin.j.wheatley at gmail.com> wrote:
> From 59299c23489fadeb11330b51f83b152194f0810e Mon Sep 17 00:00:00 2001
> From: Kevin Wheatley <kevin.j.wheatley at gmail.com>
> Date: Tue, 1 Sep 2015 11:41:38 +0100
> Subject: [PATCH 4/5] Add basic transfer functions for each AVColorTransferCharacteristic
>
> Most functions are valid over a domain and range of [0.0-1.0] but
> some are defined over greater. This patch does not deal with
> AVColorRange and assumes AVCOL_RANGE_JPEG for the returned values.
>
> Signed-off-by: Kevin Wheatley <kevin.j.wheatley at gmail.com>
> ---
> libavutil/color_utils.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++
> libavutil/color_utils.h | 17 +++++
> 2 files changed, 183 insertions(+), 0 deletions(-)
>
> diff --git a/libavutil/color_utils.c b/libavutil/color_utils.c
> index 59146be..f84b5f5 100644
> --- a/libavutil/color_utils.c
> +++ b/libavutil/color_utils.c
> @@ -18,6 +18,9 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include <stddef.h>
> +#include <math.h>
> +
> #include "libavutil/color_utils.h"
> #include "libavutil/pixfmt.h"
>
> @@ -50,3 +53,166 @@ double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc)
> }
> return gamma;
> }
> +
> +#define BT709_alpha 1.099296826809442
> +#define BT709_beta 0.018053968510807
> +
> +static double _trc_bt709(double Lc)
> +{
Identifiers starting with _ are reserved by the system on file scope.
More information about the ffmpeg-devel
mailing list