chromium/third_party/skia/src/core/SkYUVMath.cpp

/*
 * Copyright 2019 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "src/core/SkYUVMath.h"

#include "include/core/SkImageInfo.h"
#include "include/core/SkM44.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkDebug.h"

#include <cstring>

// in SkColorMatrix order (row-major)
// Created by running SkColorMatrix_DumpYUVMatrixTables()
const float JPEG_full_rgb_to_yuv[] =;
const float JPEG_full_yuv_to_rgb[] =;
const float Rec601_limited_rgb_to_yuv[] =;
const float Rec601_limited_yuv_to_rgb[] =;
const float Rec709_full_rgb_to_yuv[] =;
const float Rec709_full_yuv_to_rgb[] =;
const float Rec709_limited_rgb_to_yuv[] =;
const float Rec709_limited_yuv_to_rgb[] =;
const float BT2020_8bit_full_rgb_to_yuv[] =;
const float BT2020_8bit_full_yuv_to_rgb[] =;
const float BT2020_8bit_limited_rgb_to_yuv[] =;
const float BT2020_8bit_limited_yuv_to_rgb[] =;
const float BT2020_10bit_full_rgb_to_yuv[] =;
const float BT2020_10bit_full_yuv_to_rgb[] =;
const float BT2020_10bit_limited_rgb_to_yuv[] =;
const float BT2020_10bit_limited_yuv_to_rgb[] =;
const float BT2020_12bit_full_rgb_to_yuv[] =;
const float BT2020_12bit_full_yuv_to_rgb[] =;
const float BT2020_12bit_limited_rgb_to_yuv[] =;
const float BT2020_12bit_limited_yuv_to_rgb[] =;
const float BT2020_16bit_full_rgb_to_yuv[] =;
const float BT2020_16bit_full_yuv_to_rgb[] =;
const float BT2020_16bit_limited_rgb_to_yuv[] =;
const float BT2020_16bit_limited_yuv_to_rgb[] =;
const float FCC_full_rgb_to_yuv[] =;
const float FCC_full_yuv_to_rgb[] =;
const float FCC_limited_rgb_to_yuv[] =;
const float FCC_limited_yuv_to_rgb[] =;
const float SMPTE240_full_rgb_to_yuv[] =;
const float SMPTE240_full_yuv_to_rgb[] =;
const float SMPTE240_limited_rgb_to_yuv[] =;
const float SMPTE240_limited_yuv_to_rgb[] =;
const float YDZDX_full_rgb_to_yuv[] =;
const float YDZDX_full_yuv_to_rgb[] =;
const float YDZDX_limited_rgb_to_yuv[] =;
const float YDZDX_limited_yuv_to_rgb[] =;
const float GBR_full_rgb_to_yuv[] =;
const float GBR_full_yuv_to_rgb[] =;
const float GBR_limited_rgb_to_yuv[] =;
const float GBR_limited_yuv_to_rgb[] =;
const float YCgCo_8bit_full_rgb_to_yuv[] =;
const float YCgCo_8bit_full_yuv_to_rgb[] =;
const float YCgCo_8bit_limited_rgb_to_yuv[] =;
const float YCgCo_8bit_limited_yuv_to_rgb[] =;
const float YCgCo_10bit_full_rgb_to_yuv[] =;
const float YCgCo_10bit_full_yuv_to_rgb[] =;
const float YCgCo_10bit_limited_rgb_to_yuv[] =;
const float YCgCo_10bit_limited_yuv_to_rgb[] =;
const float YCgCo_12bit_full_rgb_to_yuv[] =;
const float YCgCo_12bit_full_yuv_to_rgb[] =;
const float YCgCo_12bit_limited_rgb_to_yuv[] =;
const float YCgCo_12bit_limited_yuv_to_rgb[] =;
const float YCgCo_16bit_full_rgb_to_yuv[] =;
const float YCgCo_16bit_full_yuv_to_rgb[] =;
const float YCgCo_16bit_limited_rgb_to_yuv[] =;
const float YCgCo_16bit_limited_yuv_to_rgb[] =;

static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;
static_assert;

const float* yuv_to_rgb_array[] =;

const float* rgb_to_yuv_array[] =;

constexpr size_t kSizeOfColorMatrix =;

void SkColorMatrix_RGB2YUV(SkYUVColorSpace cs, float m[20]) {}

void SkColorMatrix_YUV2RGB(SkYUVColorSpace cs, float m[20]) {}

///////////////////////////////////////////////////////////////////////////////////////////////////

// we just drop the alpha rol/col from the colormatrix
// output is |        tr |
//           |  3x3   tg |
//           |        tb |
//           | 0 0 0  1  |
static void colormatrix_to_matrix44(const float src[20], SkM44* dst) {}

// input: ignore the bottom row
// output: inject identity row/column for alpha
static void matrix44_to_colormatrix(const SkM44& src, float dst[20]) {}

static void scale3(float m[], float s) {}

namespace {
enum Range {};
struct YUVCoeff {};

const YUVCoeff gCoeff[] =;
}  // namespace

static void make_rgb_to_yuv_matrix_ycbcr(float mx[20], const YUVCoeff& c) {}

static void make_rgb_to_yuv_matrix_ydzdx(float mx[20], Range range) {}

static void make_rgb_to_yuv_matrix_gbr(float mx[20], Range range) {}

static void make_rgb_to_yuv_matrix_ycgco(float mx[20], int bits, Range range) {}

static void make_rgb_to_yuv_matrix(float mx[20], SkYUVColorSpace cs) {}

static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv) {}

// Used to create the prebuilt tables for each colorspace.
// Don't remove this function, in case we want to recompute those tables in the future.
void SkColorMatrix_DumpYUVMatrixTables() {}