blob: 0d420f8257fad98076a6245af958f3cd0b1f5a30 [file] [log] [blame]
Jingning Han3ee6db62015-08-05 19:00:31 -07001/*
Yaowu Xu5e53c432016-09-23 15:37:36 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Jingning Han3ee6db62015-08-05 19:00:31 -07003 *
Yaowu Xu5e53c432016-09-23 15:37:36 -07004 * 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.
Jingning Han3ee6db62015-08-05 19:00:31 -070010 */
11
Yaowu Xuf883b422016-08-30 14:01:10 -070012#ifndef AV1_COMMON_ALLOCCOMMON_H_
13#define AV1_COMMON_ALLOCCOMMON_H_
Jingning Han3ee6db62015-08-05 19:00:31 -070014
15#define INVALID_IDX -1 // Invalid buffer index.
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
Yaowu Xuf883b422016-08-30 14:01:10 -070021struct AV1Common;
Jingning Han3ee6db62015-08-05 19:00:31 -070022struct BufferPool;
23
Yaowu Xuf883b422016-08-30 14:01:10 -070024void av1_remove_common(struct AV1Common *cm);
Jingning Han3ee6db62015-08-05 19:00:31 -070025
Yaowu Xuf883b422016-08-30 14:01:10 -070026int av1_alloc_context_buffers(struct AV1Common *cm, int width, int height);
27void av1_init_context_buffers(struct AV1Common *cm);
28void av1_free_context_buffers(struct AV1Common *cm);
Jingning Han3ee6db62015-08-05 19:00:31 -070029
Yaowu Xuf883b422016-08-30 14:01:10 -070030void av1_free_ref_frame_buffers(struct BufferPool *pool);
Debargha Mukherjee84ca7a92016-01-19 13:01:01 -080031#if CONFIG_LOOP_RESTORATION
Debargha Mukherjee874d36d2016-12-14 16:53:17 -080032void av1_alloc_restoration_buffers(struct AV1Common *cm);
Yaowu Xuf883b422016-08-30 14:01:10 -070033void av1_free_restoration_buffers(struct AV1Common *cm);
Debargha Mukherjee84ca7a92016-01-19 13:01:01 -080034#endif // CONFIG_LOOP_RESTORATION
Jingning Han3ee6db62015-08-05 19:00:31 -070035
Yaowu Xuf883b422016-08-30 14:01:10 -070036int av1_alloc_state_buffers(struct AV1Common *cm, int width, int height);
37void av1_free_state_buffers(struct AV1Common *cm);
Jingning Han3ee6db62015-08-05 19:00:31 -070038
Yaowu Xuf883b422016-08-30 14:01:10 -070039void av1_set_mb_mi(struct AV1Common *cm, int width, int height);
Debargha Mukherjee7166f222017-09-05 21:32:42 -070040int av1_get_MBs(int width, int height);
Jingning Han3ee6db62015-08-05 19:00:31 -070041
Yaowu Xuf883b422016-08-30 14:01:10 -070042void av1_swap_current_and_last_seg_map(struct AV1Common *cm);
Jingning Han3ee6db62015-08-05 19:00:31 -070043
44#ifdef __cplusplus
45} // extern "C"
46#endif
47
Yaowu Xuf883b422016-08-30 14:01:10 -070048#endif // AV1_COMMON_ALLOCCOMMON_H_