• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "av1/common/enums.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 struct AV1Common;
26 struct BufferPool;
27 struct CommonContexts;
28 struct CommonModeInfoParams;
29 struct AV1CdefWorker;
30 struct AV1CdefSyncData;
31 
32 void av1_remove_common(struct AV1Common *cm);
33 
34 int av1_alloc_above_context_buffers(struct CommonContexts *above_contexts,
35                                     int num_tile_rows, int num_mi_cols,
36                                     int num_planes);
37 void av1_free_above_context_buffers(struct CommonContexts *above_contexts);
38 int av1_alloc_context_buffers(struct AV1Common *cm, int width, int height,
39                               BLOCK_SIZE min_partition_size);
40 void av1_init_mi_buffers(struct CommonModeInfoParams *mi_params);
41 void av1_free_context_buffers(struct AV1Common *cm);
42 
43 void av1_free_ref_frame_buffers(struct BufferPool *pool);
44 void av1_alloc_cdef_buffers(struct AV1Common *const cm,
45                             struct AV1CdefWorker **cdef_worker,
46                             struct AV1CdefSyncData *cdef_sync, int num_workers,
47                             int init_worker);
48 void av1_free_cdef_buffers(struct AV1Common *const cm,
49                            struct AV1CdefWorker **cdef_worker,
50                            struct AV1CdefSyncData *cdef_sync);
51 void av1_alloc_restoration_buffers(struct AV1Common *cm);
52 void av1_free_restoration_buffers(struct AV1Common *cm);
53 
54 int av1_alloc_state_buffers(struct AV1Common *cm, int width, int height);
55 void av1_free_state_buffers(struct AV1Common *cm);
56 
57 int av1_get_MBs(int width, int height);
58 
59 #ifdef __cplusplus
60 }  // extern "C"
61 #endif
62 
63 #endif  // AOM_AV1_COMMON_ALLOCCOMMON_H_
64