• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2019, 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 AOM_AV1_ENCODER_TPL_MODEL_H_
13 #define AOM_AV1_ENCODER_TPL_MODEL_H_
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
convert_length_to_bsize(int length)19 static INLINE BLOCK_SIZE convert_length_to_bsize(int length) {
20   switch (length) {
21     case 64: return BLOCK_64X64;
22     case 32: return BLOCK_32X32;
23     case 16: return BLOCK_16X16;
24     case 8: return BLOCK_8X8;
25     case 4: return BLOCK_4X4;
26     default:
27       assert(0 && "Invalid block size for tpl model");
28       return BLOCK_16X16;
29   }
30 }
31 
32 int av1_tpl_setup_stats(AV1_COMP *cpi, int gop_eval,
33                         const EncodeFrameParams *const frame_params,
34                         const EncodeFrameInput *const frame_input);
35 
36 int av1_tpl_ptr_pos(int mi_row, int mi_col, int stride, uint8_t right_shift);
37 
38 void av1_tpl_rdmult_setup(AV1_COMP *cpi);
39 
40 void av1_tpl_rdmult_setup_sb(AV1_COMP *cpi, MACROBLOCK *const x,
41                              BLOCK_SIZE sb_size, int mi_row, int mi_col);
42 
43 #ifdef __cplusplus
44 }  // extern "C"
45 #endif
46 
47 #endif  // AOM_AV1_ENCODER_TPL_MODEL_H_
48