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 AOM_AV1_COMMON_ALLOCCOMMON_H_
13 #define AOM_AV1_COMMON_ALLOCCOMMON_H_
14 
15 #define INVALID_IDX -1  // Invalid buffer index.
16 
17 #include "config/aom_config.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 struct AV1Common;
24 struct BufferPool;
25 struct CommonContexts;
26 struct CommonModeInfoParams;
27 
28 void av1_remove_common(struct AV1Common *cm);
29 
30 int av1_alloc_above_context_buffers(struct CommonContexts *above_contexts,
31                                     int num_tile_rows, int num_mi_cols,
32                                     int num_planes);
33 void av1_free_above_context_buffers(struct CommonContexts *above_contexts);
34 int av1_alloc_context_buffers(struct AV1Common *cm, int width, int height);
35 void av1_init_mi_buffers(struct CommonModeInfoParams *mi_params);
36 void av1_free_context_buffers(struct AV1Common *cm);
37 
38 void av1_free_ref_frame_buffers(struct BufferPool *pool);
39 #if !CONFIG_REALTIME_ONLY
40 void av1_alloc_restoration_buffers(struct AV1Common *cm);
41 void av1_free_restoration_buffers(struct AV1Common *cm);
42 #endif
43 
44 int av1_alloc_state_buffers(struct AV1Common *cm, int width, int height);
45 void av1_free_state_buffers(struct AV1Common *cm);
46 
47 int av1_get_MBs(int width, int height);
48 
49 #if CONFIG_LPF_MASK
50 int av1_alloc_loop_filter_mask(struct AV1Common *cm);
51 void av1_free_loop_filter_mask(struct AV1Common *cm);
52 #endif
53 
54 #ifdef __cplusplus
55 }  // extern "C"
56 #endif
57 
58 #endif  // AOM_AV1_COMMON_ALLOCCOMMON_H_
59