chromium/third_party/ffmpeg/libavutil/csp.c

/*
 * Copyright (c) 2015 Kevin Wheatley <[email protected]>
 * Copyright (c) 2016 Ronald S. Bultje <[email protected]>
 * Copyright (c) 2023 Leo Izen <[email protected]>
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/**
 * @file Colorspace functions for libavutil
 * @author Ronald S. Bultje <[email protected]>
 * @author Leo Izen <[email protected]>
 * @author Kevin Wheatley <[email protected]>
 */

#include <stdlib.h>
#include <math.h>

#include "attributes.h"
#include "csp.h"
#include "pixfmt.h"
#include "rational.h"

#define AVR(d)

/*
 * All constants explained in e.g. https://linuxtv.org/downloads/v4l-dvb-apis/ch02s06.html
 * The older ones (bt470bg/m) are also explained in their respective ITU docs
 * (e.g. https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.470-5-199802-S!!PDF-E.pdf)
 * whereas the newer ones can typically be copied directly from wikipedia :)
 */
static const struct AVLumaCoefficients luma_coefficients[AVCOL_SPC_NB] =;

const struct AVLumaCoefficients *av_csp_luma_coeffs_from_avcsp(enum AVColorSpace csp)
{}

#define WP_D65
#define WP_C
#define WP_DCI
#define WP_E

static const AVColorPrimariesDesc color_primaries[AVCOL_PRI_NB] =;

const AVColorPrimariesDesc *av_csp_primaries_desc_from_id(enum AVColorPrimaries prm)
{}

static av_always_inline AVRational abs_sub_q(AVRational r1, AVRational r2)
{}

enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm)
{}

static const double approximate_gamma[AVCOL_TRC_NB] =;

double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc)
{}

#define BT709_alpha
#define BT709_beta

static double trc_bt709(double Lc)
{}

static double trc_gamma22(double Lc)
{}

static double trc_gamma28(double Lc)
{}

static double trc_smpte240M(double Lc)
{}

static double trc_linear(double Lc)
{}

static double trc_log(double Lc)
{}

static double trc_log_sqrt(double Lc)
{}

static double trc_iec61966_2_4(double Lc)
{}

static double trc_bt1361(double Lc)
{}

static double trc_iec61966_2_1(double Lc)
{}

static double trc_smpte_st2084(double Lc)
{}

static double trc_smpte_st428_1(double Lc)
{}


static double trc_arib_std_b67(double Lc) {}

static const av_csp_trc_function trc_funcs[AVCOL_TRC_NB] =;

av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc)
{}