chromium/third_party/libaom/source/libaom/av1/encoder/superres_scale.c

/*
 * 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.
 */

#include "av1/encoder/encoder_alloc.h"
#include "av1/encoder/superres_scale.h"
#include "av1/encoder/random.h"

// Compute the horizontal frequency components' energy in a frame
// by calculuating the 16x4 Horizontal DCT. This is to be used to
// decide the superresolution parameters.
static void analyze_hor_freq(const AV1_COMP *cpi, double *energy) {}

static uint8_t calculate_next_resize_scale(const AV1_COMP *cpi) {}

int av1_superres_in_recode_allowed(const AV1_COMP *const cpi) {}

#define SUPERRES_ENERGY_BY_Q2_THRESH_KEYFRAME_SOLO
#define SUPERRES_ENERGY_BY_Q2_THRESH_KEYFRAME
#define SUPERRES_ENERGY_BY_Q2_THRESH_ARFFRAME
#define SUPERRES_ENERGY_BY_AC_THRESH

static double get_energy_by_q2_thresh(const GF_GROUP *gf_group,
                                      const RATE_CONTROL *rc,
                                      int gf_frame_index) {}

static uint8_t get_superres_denom_from_qindex_energy(int qindex, double *energy,
                                                     double threshq,
                                                     double threshp) {}

static uint8_t get_superres_denom_for_qindex(const AV1_COMP *cpi, int qindex,
                                             int sr_kf, int sr_arf) {}

static uint8_t calculate_next_superres_scale(AV1_COMP *cpi) {}

static int dimension_is_ok(int orig_dim, int resized_dim, int denom) {}

static int dimensions_are_ok(int owidth, int oheight, size_params_type *rsz) {}

static int validate_size_scales(RESIZE_MODE resize_mode,
                                aom_superres_mode superres_mode, int owidth,
                                int oheight, size_params_type *rsz) {}

// Calculates resize and superres params for next frame
static size_params_type calculate_next_size_params(AV1_COMP *cpi) {}

static void setup_frame_size_from_params(AV1_COMP *cpi,
                                         const size_params_type *rsz) {}

void av1_setup_frame_size(AV1_COMP *cpi) {}

void av1_superres_post_encode(AV1_COMP *cpi) {}