1 /*
2  * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 2 Clause License and
5  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6  * was not distributed with this source code in the LICENSE file, you can
7  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8  * Media Patent License 1.0 was not distributed with this source code in the
9  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10  */
11 
12 #ifndef AV1_COMMON_CFL_H_
13 #define AV1_COMMON_CFL_H_
14 
15 #include "av1/common/blockd.h"
16 
get_scaled_luma_q0(int alpha_q3,int16_t pred_buf_q3)17 static INLINE int get_scaled_luma_q0(int alpha_q3, int16_t pred_buf_q3) {
18   int scaled_luma_q6 = alpha_q3 * pred_buf_q3;
19   return ROUND_POWER_OF_TWO_SIGNED(scaled_luma_q6, 6);
20 }
21 
22 void cfl_predict_block(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride,
23                        int row, int col, TX_SIZE tx_size, int plane);
24 
25 void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size);
26 
27 void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
28                   BLOCK_SIZE bsize);
29 
30 void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size);
31 
32 #endif  // AV1_COMMON_CFL_H_
33