godot/thirdparty/libwebp/src/dsp/enc.c

// Copyright 2011 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
// -----------------------------------------------------------------------------
//
// Speed-critical encoding functions.
//
// Author: Skal ([email protected])

#include <assert.h>
#include <stdlib.h>  // for abs()

#include "src/dsp/dsp.h"
#include "src/enc/vp8i_enc.h"

static WEBP_INLINE uint8_t clip_8b(int v) {}

#if !WEBP_NEON_OMIT_C_CODE
static WEBP_INLINE int clip_max(int v, int max) {}
#endif  // !WEBP_NEON_OMIT_C_CODE

//------------------------------------------------------------------------------
// Compute susceptibility based on DCT-coeff histograms:
// the higher, the "easier" the macroblock is to compress.

const int VP8DspScan[16 + 4 + 4] =;

// general-purpose util function
void VP8SetHistogramData(const int distribution[MAX_COEFF_THRESH + 1],
                         VP8Histogram* const histo) {}

#if !WEBP_NEON_OMIT_C_CODE
static void CollectHistogram_C(const uint8_t* ref, const uint8_t* pred,
                               int start_block, int end_block,
                               VP8Histogram* const histo) {}
#endif  // !WEBP_NEON_OMIT_C_CODE

//------------------------------------------------------------------------------
// run-time tables (~4k)

static uint8_t clip1[255 + 510 + 1];    // clips [-255,510] to [0,255]

// We declare this variable 'volatile' to prevent instruction reordering
// and make sure it's set to true _last_ (so as to be thread-safe)
static volatile int tables_ok =;

static WEBP_TSAN_IGNORE_FUNCTION void InitTables(void) {}


//------------------------------------------------------------------------------
// Transforms (Paragraph 14.4)

#if !WEBP_NEON_OMIT_C_CODE

#define STORE

static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in,
                                      uint8_t* dst) {}

static void ITransform_C(const uint8_t* ref, const int16_t* in, uint8_t* dst,
                         int do_two) {}

static void FTransform_C(const uint8_t* src, const uint8_t* ref, int16_t* out) {}
#endif  // !WEBP_NEON_OMIT_C_CODE

static void FTransform2_C(const uint8_t* src, const uint8_t* ref,
                          int16_t* out) {}

#if !WEBP_NEON_OMIT_C_CODE
static void FTransformWHT_C(const int16_t* in, int16_t* out) {}
#endif  // !WEBP_NEON_OMIT_C_CODE

#undef STORE

//------------------------------------------------------------------------------
// Intra predictions

static WEBP_INLINE void Fill(uint8_t* dst, int value, int size) {}

static WEBP_INLINE void VerticalPred(uint8_t* dst,
                                     const uint8_t* top, int size) {}

static WEBP_INLINE void HorizontalPred(uint8_t* dst,
                                       const uint8_t* left, int size) {}

static WEBP_INLINE void TrueMotion(uint8_t* dst, const uint8_t* left,
                                   const uint8_t* top, int size) {}

static WEBP_INLINE void DCMode(uint8_t* dst, const uint8_t* left,
                               const uint8_t* top,
                               int size, int round, int shift) {}

//------------------------------------------------------------------------------
// Chroma 8x8 prediction (paragraph 12.2)

static void IntraChromaPreds_C(uint8_t* dst, const uint8_t* left,
                               const uint8_t* top) {}

//------------------------------------------------------------------------------
// luma 16x16 prediction (paragraph 12.3)

static void Intra16Preds_C(uint8_t* dst,
                           const uint8_t* left, const uint8_t* top) {}

//------------------------------------------------------------------------------
// luma 4x4 prediction

#define DST
#define AVG3
#define AVG2

static void VE4(uint8_t* dst, const uint8_t* top) {}

static void HE4(uint8_t* dst, const uint8_t* top) {}

static void DC4(uint8_t* dst, const uint8_t* top) {}

static void RD4(uint8_t* dst, const uint8_t* top) {}

static void LD4(uint8_t* dst, const uint8_t* top) {}

static void VR4(uint8_t* dst, const uint8_t* top) {}

static void VL4(uint8_t* dst, const uint8_t* top) {}

static void HU4(uint8_t* dst, const uint8_t* top) {}

static void HD4(uint8_t* dst, const uint8_t* top) {}

static void TM4(uint8_t* dst, const uint8_t* top) {}

#undef DST
#undef AVG3
#undef AVG2

// Left samples are top[-5 .. -2], top_left is top[-1], top are
// located at top[0..3], and top right is top[4..7]
static void Intra4Preds_C(uint8_t* dst, const uint8_t* top) {}

//------------------------------------------------------------------------------
// Metric

#if !WEBP_NEON_OMIT_C_CODE
static WEBP_INLINE int GetSSE(const uint8_t* a, const uint8_t* b,
                              int w, int h) {}

static int SSE16x16_C(const uint8_t* a, const uint8_t* b) {}
static int SSE16x8_C(const uint8_t* a, const uint8_t* b) {}
static int SSE8x8_C(const uint8_t* a, const uint8_t* b) {}
static int SSE4x4_C(const uint8_t* a, const uint8_t* b) {}
#endif  // !WEBP_NEON_OMIT_C_CODE

static void Mean16x4_C(const uint8_t* ref, uint32_t dc[4]) {}

//------------------------------------------------------------------------------
// Texture distortion
//
// We try to match the spectral content (weighted) between source and
// reconstructed samples.

#if !WEBP_NEON_OMIT_C_CODE
// Hadamard transform
// Returns the weighted sum of the absolute value of transformed coefficients.
// w[] contains a row-major 4 by 4 symmetric matrix.
static int TTransform(const uint8_t* in, const uint16_t* w) {}

static int Disto4x4_C(const uint8_t* const a, const uint8_t* const b,
                      const uint16_t* const w) {}

static int Disto16x16_C(const uint8_t* const a, const uint8_t* const b,
                        const uint16_t* const w) {}
#endif  // !WEBP_NEON_OMIT_C_CODE

//------------------------------------------------------------------------------
// Quantization
//

static const uint8_t kZigzag[16] =;

// Simple quantization
static int QuantizeBlock_C(int16_t in[16], int16_t out[16],
                           const VP8Matrix* const mtx) {}

#if !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC
static int Quantize2Blocks_C(int16_t in[32], int16_t out[32],
                             const VP8Matrix* const mtx) {}
#endif  // !WEBP_NEON_OMIT_C_CODE || WEBP_NEON_WORK_AROUND_GCC

//------------------------------------------------------------------------------
// Block copy

static WEBP_INLINE void Copy(const uint8_t* src, uint8_t* dst, int w, int h) {}

static void Copy4x4_C(const uint8_t* src, uint8_t* dst) {}

static void Copy16x8_C(const uint8_t* src, uint8_t* dst) {}

//------------------------------------------------------------------------------
// Initialization

// Speed-critical function pointers. We have to initialize them to the default
// implementations within VP8EncDspInit().
VP8CHisto VP8CollectHistogram;
VP8Idct VP8ITransform;
VP8Fdct VP8FTransform;
VP8Fdct VP8FTransform2;
VP8WHT VP8FTransformWHT;
VP8Intra4Preds VP8EncPredLuma4;
VP8IntraPreds VP8EncPredLuma16;
VP8IntraPreds VP8EncPredChroma8;
VP8Metric VP8SSE16x16;
VP8Metric VP8SSE8x8;
VP8Metric VP8SSE16x8;
VP8Metric VP8SSE4x4;
VP8WMetric VP8TDisto4x4;
VP8WMetric VP8TDisto16x16;
VP8MeanMetric VP8Mean16x4;
VP8QuantizeBlock VP8EncQuantizeBlock;
VP8Quantize2Blocks VP8EncQuantize2Blocks;
VP8QuantizeBlockWHT VP8EncQuantizeBlockWHT;
VP8BlockCopy VP8Copy4x4;
VP8BlockCopy VP8Copy16x8;

extern VP8CPUInfo VP8GetCPUInfo;
extern void VP8EncDspInitSSE2(void);
extern void VP8EncDspInitSSE41(void);
extern void VP8EncDspInitNEON(void);
extern void VP8EncDspInitMIPS32(void);
extern void VP8EncDspInitMIPSdspR2(void);
extern void VP8EncDspInitMSA(void);

WEBP_DSP_INIT_FUNC(VP8EncDspInit) {}