blob: 9192124f72210bb32947088359fe87a8cee1e10f [file] [log] [blame]
Andrey Norkin795ba872018-03-06 13:24:14 -08001/*
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
James Zerne1cbb132018-08-22 14:10:36 -070012#ifndef AOM_AV1_COMMON_TIMING_H_
13#define AOM_AV1_COMMON_TIMING_H_
Andrey Norkin795ba872018-03-06 13:24:14 -080014
15#include "aom/aom_integer.h"
Andrey Norkin26495512018-06-20 17:13:11 -070016#include "av1/common/enums.h"
Andrey Norkin795ba872018-03-06 13:24:14 -080017
18#define MAX_NUM_OP_POINTS 32
19
20typedef struct aom_timing {
21 uint32_t num_units_in_display_tick;
22 uint32_t time_scale;
23 int equal_picture_interval;
24 uint32_t num_ticks_per_picture;
25} aom_timing_info_t;
26
27typedef struct aom_dec_model_info {
28 uint32_t num_units_in_decoding_tick;
29 int encoder_decoder_buffer_delay_length;
Wan-Teh Changf64b3bc2018-07-02 09:42:39 -070030 int buffer_removal_time_length;
31 int frame_presentation_time_length;
Andrey Norkin795ba872018-03-06 13:24:14 -080032} aom_dec_model_info_t;
33
34typedef struct aom_dec_model_op_parameters {
Andrey Norkin795ba872018-03-06 13:24:14 -080035 int decoder_model_param_present_flag;
Andrey Norkin26495512018-06-20 17:13:11 -070036 int64_t bitrate;
37 int64_t buffer_size;
Urvang Joshi48073d92018-06-29 16:21:18 -070038 uint32_t decoder_buffer_delay;
39 uint32_t encoder_buffer_delay;
Andrey Norkin795ba872018-03-06 13:24:14 -080040 int low_delay_mode_flag;
41 int display_model_param_present_flag;
42 int initial_display_delay;
43} aom_dec_model_op_parameters_t;
44
Yaowu Xueb40e472019-05-03 09:17:37 -070045void av1_set_aom_dec_model_info(aom_dec_model_info_t *decoder_model);
Andrey Norkin795ba872018-03-06 13:24:14 -080046
Yaowu Xueb40e472019-05-03 09:17:37 -070047void av1_set_dec_model_op_parameters(aom_dec_model_op_parameters_t *op_params);
Andrey Norkin26495512018-06-20 17:13:11 -070048
Yaowu Xueb40e472019-05-03 09:17:37 -070049void av1_set_resource_availability_parameters(
Andrey Norkin26495512018-06-20 17:13:11 -070050 aom_dec_model_op_parameters_t *op_params);
51
Yaowu Xu7e450882019-04-30 15:09:18 -070052int64_t av1_max_level_bitrate(BITSTREAM_PROFILE seq_profile, int seq_level_idx,
53 int seq_tier);
Andrey Norkin795ba872018-03-06 13:24:14 -080054
James Zerne1cbb132018-08-22 14:10:36 -070055#endif // AOM_AV1_COMMON_TIMING_H_