/* * 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. */ #ifndef AOM_AV1_COMMON_CFL_H_ #define AOM_AV1_COMMON_CFL_H_ #include "av1/common/av1_common_int.h" #include "av1/common/blockd.h" // Can we use CfL for the current block? static inline CFL_ALLOWED_TYPE is_cfl_allowed(const MACROBLOCKD *xd) { … } // Do we need to save the luma pixels from the current block, // for a possible future CfL prediction? static inline CFL_ALLOWED_TYPE store_cfl_required(const AV1_COMMON *cm, const MACROBLOCKD *xd) { … } static inline int get_scaled_luma_q0(int alpha_q3, int16_t pred_buf_q3) { … } static inline CFL_PRED_TYPE get_cfl_pred_type(int plane) { … } static inline void clear_cfl_dc_pred_cache_flags(CFL_CTX *cfl) { … } void av1_cfl_predict_block(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride, TX_SIZE tx_size, int plane); void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size); void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size, BLOCK_SIZE bsize); void cfl_store_dc_pred(MACROBLOCKD *const xd, const uint8_t *input, CFL_PRED_TYPE pred_plane, int width); void cfl_load_dc_pred(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride, TX_SIZE tx_size, CFL_PRED_TYPE pred_plane); // Allows the CFL_SUBSAMPLE function to switch types depending on the bitdepth. #define CFL_lbd_TYPE … #define CFL_hbd_TYPE … // Declare a size-specific wrapper for the size-generic function. The compiler // will inline the size generic function in here, the advantage is that the size // will be constant allowing for loop unrolling and other constant propagated // goodness. #define CFL_SUBSAMPLE(arch, sub, bd, width, height) … // Declare size-specific wrappers for all valid CfL sizes. #define CFL_SUBSAMPLE_FUNCTIONS(arch, sub, bd) … // Declare an architecture-specific array of function pointers for size-specific // wrappers. #define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd) … // The RTCD script does not support passing in an array, so we wrap it in this // function. #if CONFIG_AV1_HIGHBITDEPTH #define CFL_GET_SUBSAMPLE_FUNCTION … #else #define CFL_GET_SUBSAMPLE_FUNCTION(arch) … #endif // Declare a size-specific wrapper for the size-generic function. The compiler // will inline the size generic function in here, the advantage is that the size // will be constant allowing for loop unrolling and other constant propagated // goodness. #define CFL_SUB_AVG_X(arch, width, height, round_offset, num_pel_log2) … // Declare size-specific wrappers for all valid CfL sizes. #define CFL_SUB_AVG_FN(arch) … #define CFL_PREDICT_lbd(arch, width, height) … #if CONFIG_AV1_HIGHBITDEPTH #define CFL_PREDICT_hbd … #endif // This wrapper exists because clang format does not like calling macros with // lowercase letters. #define CFL_PREDICT_X(arch, width, height, bd) … #define CFL_PREDICT_FN(arch, bd) … #endif // AOM_AV1_COMMON_CFL_H_