chromium/third_party/libaom/source/libaom/av1/common/cdef_block.c

/*
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 */

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

#include "config/aom_dsp_rtcd.h"
#include "config/av1_rtcd.h"

#include "av1/common/cdef.h"
/*
This is Cdef_Directions (section 7.15.3) with 2 padding entries at the
beginning and end of the table. The cdef direction range is [0, 7] and the
first index is offset +/-2. This removes the need to constrain the first
index to the same range using e.g., & 7.
*/
DECLARE_ALIGNED(16, static const int, cdef_directions_padded[12][2]) =;

const int (*const cdef_directions)[2] =;

/* Detect direction. 0 means 45-degree up-right, 2 is horizontal, and so on.
   The search minimizes the weighted variance along all the lines in a
   particular direction, i.e. the squared error between the input and a
   "predicted" block where each pixel is replaced by the average along a line
   in a particular direction. Since each direction have the same sum(x^2) term,
   that term is never computed. See Section 2, step 2, of:
   http://jmvalin.ca/notes/intra_paint.pdf */
int cdef_find_dir_c(const uint16_t *img, int stride, int32_t *var,
                    int coeff_shift) {}

void cdef_find_dir_dual_c(const uint16_t *img1, const uint16_t *img2,
                          int stride, int32_t *var1, int32_t *var2,
                          int coeff_shift, int *out1, int *out2) {}

const int cdef_pri_taps[2][2] =;
const int cdef_sec_taps[2] =;

/* Smooth in the direction detected. */
static void cdef_filter_block_internal(
    uint8_t *dst8, uint16_t *dst16, int dstride, const uint16_t *in,
    int pri_strength, int sec_strength, int dir, int pri_damping,
    int sec_damping, int coeff_shift, int block_width, int block_height,
    int enable_primary, int enable_secondary) {}

void cdef_filter_8_0_c(void *dst8, int dstride, const uint16_t *in,
                       int pri_strength, int sec_strength, int dir,
                       int pri_damping, int sec_damping, int coeff_shift,
                       int block_width, int block_height) {}

void cdef_filter_8_1_c(void *dst8, int dstride, const uint16_t *in,
                       int pri_strength, int sec_strength, int dir,
                       int pri_damping, int sec_damping, int coeff_shift,
                       int block_width, int block_height) {}

void cdef_filter_8_2_c(void *dst8, int dstride, const uint16_t *in,
                       int pri_strength, int sec_strength, int dir,
                       int pri_damping, int sec_damping, int coeff_shift,
                       int block_width, int block_height) {}

void cdef_filter_8_3_c(void *dst8, int dstride, const uint16_t *in,
                       int pri_strength, int sec_strength, int dir,
                       int pri_damping, int sec_damping, int coeff_shift,
                       int block_width, int block_height) {}

void cdef_filter_16_0_c(void *dst16, int dstride, const uint16_t *in,
                        int pri_strength, int sec_strength, int dir,
                        int pri_damping, int sec_damping, int coeff_shift,
                        int block_width, int block_height) {}

void cdef_filter_16_1_c(void *dst16, int dstride, const uint16_t *in,
                        int pri_strength, int sec_strength, int dir,
                        int pri_damping, int sec_damping, int coeff_shift,
                        int block_width, int block_height) {}

void cdef_filter_16_2_c(void *dst16, int dstride, const uint16_t *in,
                        int pri_strength, int sec_strength, int dir,
                        int pri_damping, int sec_damping, int coeff_shift,
                        int block_width, int block_height) {}

void cdef_filter_16_3_c(void *dst16, int dstride, const uint16_t *in,
                        int pri_strength, int sec_strength, int dir,
                        int pri_damping, int sec_damping, int coeff_shift,
                        int block_width, int block_height) {}

/* Compute the primary filter strength for an 8x8 block based on the
   directional variance difference. A high variance difference means
   that we have a highly directional pattern (e.g. a high contrast
   edge), so we can apply more deringing. A low variance means that we
   either have a low contrast edge, or a non-directional texture, so
   we want to be careful not to blur. */
static inline int adjust_strength(int strength, int32_t var) {}

static inline void aom_cdef_find_dir(const uint16_t *in, cdef_list *dlist,
                                     int var[CDEF_NBLOCKS][CDEF_NBLOCKS],
                                     int cdef_count, int coeff_shift,
                                     int dir[CDEF_NBLOCKS][CDEF_NBLOCKS]) {}

void av1_cdef_filter_fb(uint8_t *dst8, uint16_t *dst16, int dstride,
                        const uint16_t *in, int xdec, int ydec,
                        int dir[CDEF_NBLOCKS][CDEF_NBLOCKS], int *dirinit,
                        int var[CDEF_NBLOCKS][CDEF_NBLOCKS], int pli,
                        cdef_list *dlist, int cdef_count, int level,
                        int sec_strength, int damping, int coeff_shift) {}