blob: 0aca162281826b42018234023bad42a40d1b4c0d [file]
/*
* Copyright (c) 2021, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 3-Clause Clear License
* and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
* License was not distributed with this source code in the LICENSE file, you
* can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. 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
* aomedia.org/license/patent-license/.
*/
#ifndef AOM_AV1_COMMON_GUIDED_QUADTREE_H_
#define AOM_AV1_COMMON_GUIDED_QUADTREE_H_
#include <float.h>
#include "config/aom_config.h"
#include "aom/aom_integer.h"
#include "aom_ports/mem.h"
#include "av1/common/av1_common_int.h"
#ifdef __cplusplus
extern "C" {
#endif
#if CONFIG_CNN_GUIDED_QUADTREE
int *get_quadparm_from_qindex(int qindex, int superres_denom, int is_intra_only,
int is_luma, int cnn_index);
void quad_copy(QUADInfo *cur_quad_info, QUADInfo *postcnn_quad_info);
// Get the length of unit info array based on dimensions and split info.
int quad_tree_get_unit_info_length(int width, int height, int unit_length,
const QUADSplitInfo *split_info,
int split_info_length);
// Get the length of split info array based on dimensions.
int quad_tree_get_split_info_length(int width, int height, int unit_length);
static INLINE int get_guided_norestore_ctx(int qindex, int superres_denom,
int is_intra_only) {
(void)qindex;
(void)is_intra_only;
if (is_intra_only) return 1;
if (superres_denom != SCALE_NUMERATOR) return 1;
return 0;
}
// Get quad tree level based on dimension.
static INLINE int quad_tree_get_level(int width, int height) {
return (width * height <= 1280 * 720);
}
#endif // CONFIG_CNN_GUIDED_QUADTREE
#ifdef __cplusplus
} // extern "C"
#endif
#endif // AOM_AV1_COMMON_CCSO_H_