Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 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 | |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 12 | #ifndef AOM_AV1_COMMON_TIMING_H_ |
| 13 | #define AOM_AV1_COMMON_TIMING_H_ |
Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 14 | |
| 15 | #include "aom/aom_integer.h" |
Andrey Norkin | 2649551 | 2018-06-20 17:13:11 -0700 | [diff] [blame] | 16 | #include "av1/common/enums.h" |
Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 17 | |
| 18 | #define MAX_NUM_OP_POINTS 32 |
| 19 | |
| 20 | typedef 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 | |
| 27 | typedef struct aom_dec_model_info { |
| 28 | uint32_t num_units_in_decoding_tick; |
| 29 | int encoder_decoder_buffer_delay_length; |
Wan-Teh Chang | f64b3bc | 2018-07-02 09:42:39 -0700 | [diff] [blame] | 30 | int buffer_removal_time_length; |
| 31 | int frame_presentation_time_length; |
Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 32 | } aom_dec_model_info_t; |
| 33 | |
| 34 | typedef struct aom_dec_model_op_parameters { |
Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 35 | int decoder_model_param_present_flag; |
Andrey Norkin | 2649551 | 2018-06-20 17:13:11 -0700 | [diff] [blame] | 36 | int64_t bitrate; |
| 37 | int64_t buffer_size; |
Urvang Joshi | 48073d9 | 2018-06-29 16:21:18 -0700 | [diff] [blame] | 38 | uint32_t decoder_buffer_delay; |
| 39 | uint32_t encoder_buffer_delay; |
Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 40 | 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 | |
| 45 | typedef struct aom_op_timing_info_t { |
Wan-Teh Chang | f64b3bc | 2018-07-02 09:42:39 -0700 | [diff] [blame] | 46 | uint32_t buffer_removal_time; |
Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 47 | } aom_op_timing_info_t; |
| 48 | |
| 49 | void set_aom_dec_model_info(aom_dec_model_info_t *decoder_model); |
| 50 | |
Andrey Norkin | 2649551 | 2018-06-20 17:13:11 -0700 | [diff] [blame] | 51 | void set_dec_model_op_parameters(aom_dec_model_op_parameters_t *op_params); |
| 52 | |
| 53 | void set_resource_availability_parameters( |
| 54 | aom_dec_model_op_parameters_t *op_params); |
| 55 | |
Yaowu Xu | 7e45088 | 2019-04-30 15:09:18 -0700 | [diff] [blame^] | 56 | int64_t av1_max_level_bitrate(BITSTREAM_PROFILE seq_profile, int seq_level_idx, |
| 57 | int seq_tier); |
Andrey Norkin | 795ba87 | 2018-03-06 13:24:14 -0800 | [diff] [blame] | 58 | |
James Zern | e1cbb13 | 2018-08-22 14:10:36 -0700 | [diff] [blame] | 59 | #endif // AOM_AV1_COMMON_TIMING_H_ |