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_ALLOCCOMMON_H_
13 #define AV1_COMMON_ALLOCCOMMON_H_
14 
15 #define INVALID_IDX -1  // Invalid buffer index.
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 struct AV1Common;
22 struct BufferPool;
23 
24 void av1_remove_common(struct AV1Common *cm);
25 
26 int av1_alloc_context_buffers(struct AV1Common *cm, int width, int height);
27 void av1_init_context_buffers(struct AV1Common *cm);
28 void av1_free_context_buffers(struct AV1Common *cm);
29 
30 void av1_free_ref_frame_buffers(struct BufferPool *pool);
31 #if CONFIG_LOOP_RESTORATION
32 void av1_alloc_restoration_buffers(struct AV1Common *cm);
33 void av1_free_restoration_buffers(struct AV1Common *cm);
34 #endif  // CONFIG_LOOP_RESTORATION
35 
36 int av1_alloc_state_buffers(struct AV1Common *cm, int width, int height);
37 void av1_free_state_buffers(struct AV1Common *cm);
38 
39 void av1_set_mb_mi(struct AV1Common *cm, int width, int height);
40 int av1_get_MBs(int width, int height);
41 
42 void av1_swap_current_and_last_seg_map(struct AV1Common *cm);
43 
44 #ifdef __cplusplus
45 }  // extern "C"
46 #endif
47 
48 #endif  // AV1_COMMON_ALLOCCOMMON_H_
49