chromium/third_party/libaom/source/libaom/av1/encoder/model_rd.h

/*
 * Copyright (c) 2020, 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.
 */

#ifndef AOM_AV1_ENCODER_MODEL_RD_H_
#define AOM_AV1_ENCODER_MODEL_RD_H_

#include "aom/aom_integer.h"
#include "av1/encoder/block.h"
#include "av1/encoder/encoder.h"
#include "av1/encoder/pustats.h"
#include "av1/encoder/rdopt_utils.h"
#include "config/aom_dsp_rtcd.h"

#ifdef __cplusplus
extern "C" {
#endif

// 0: Legacy model
// 1: Curve fit model
// 2: Surface fit model
// 3: DNN regression model
// 4: Full rd model
#define MODELRD_TYPE_INTERP_FILTER
#define MODELRD_TYPE_TX_SEARCH_PRUNE
#define MODELRD_TYPE_MASKED_COMPOUND
#define MODELRD_TYPE_INTERINTRA
#define MODELRD_TYPE_INTRA
#define MODELRD_TYPE_MOTION_MODE_RD

model_rd_for_sb_type;
model_rd_from_sse_type;

static int64_t calculate_sse(MACROBLOCKD *const xd,
                             const struct macroblock_plane *p,
                             struct macroblockd_plane *pd, const int bw,
                             const int bh) {}

static inline int64_t compute_sse_plane(MACROBLOCK *x, MACROBLOCKD *xd,
                                        int plane, const BLOCK_SIZE bsize) {}

static inline void model_rd_from_sse(const AV1_COMP *const cpi,
                                     const MACROBLOCK *const x,
                                     BLOCK_SIZE plane_bsize, int plane,
                                     int64_t sse, int num_samples, int *rate,
                                     int64_t *dist) {}

// Fits a curve for rate and distortion using as feature:
// log2(sse_norm/qstep^2)
static inline void model_rd_with_curvfit(const AV1_COMP *const cpi,
                                         const MACROBLOCK *const x,
                                         BLOCK_SIZE plane_bsize, int plane,
                                         int64_t sse, int num_samples,
                                         int *rate, int64_t *dist) {}

static inline void model_rd_for_sb(const AV1_COMP *const cpi, BLOCK_SIZE bsize,
                                   MACROBLOCK *x, MACROBLOCKD *xd,
                                   int plane_from, int plane_to,
                                   int *out_rate_sum, int64_t *out_dist_sum,
                                   uint8_t *skip_txfm_sb, int64_t *skip_sse_sb,
                                   int *plane_rate, int64_t *plane_sse,
                                   int64_t *plane_dist) {}

static inline void model_rd_for_sb_with_curvfit(
    const AV1_COMP *const cpi, BLOCK_SIZE bsize, MACROBLOCK *x, MACROBLOCKD *xd,
    int plane_from, int plane_to, int *out_rate_sum, int64_t *out_dist_sum,
    uint8_t *skip_txfm_sb, int64_t *skip_sse_sb, int *plane_rate,
    int64_t *plane_sse, int64_t *plane_dist) {}

enum {} UENUM1BYTE();

static const model_rd_for_sb_type model_rd_sb_fn[MODELRD_TYPES] =;

static const model_rd_from_sse_type model_rd_sse_fn[MODELRD_TYPES] =;

#ifdef __cplusplus
}  // extern "C"
#endif
#endif  // AOM_AV1_ENCODER_MODEL_RD_H_