blob: 022e2d663b8470e9fb7d308f83f466c4fe823cf8 [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
45typedef struct aom_op_timing_info_t {
Wan-Teh Changf64b3bc2018-07-02 09:42:39 -070046 uint32_t buffer_removal_time;
Andrey Norkin795ba872018-03-06 13:24:14 -080047} aom_op_timing_info_t;
48
49void set_aom_dec_model_info(aom_dec_model_info_t *decoder_model);
50
Andrey Norkin26495512018-06-20 17:13:11 -070051void set_dec_model_op_parameters(aom_dec_model_op_parameters_t *op_params);
52
53void set_resource_availability_parameters(
54 aom_dec_model_op_parameters_t *op_params);
55
Yaowu Xu7e450882019-04-30 15:09:18 -070056int64_t av1_max_level_bitrate(BITSTREAM_PROFILE seq_profile, int seq_level_idx,
57 int seq_tier);
Andrey Norkin795ba872018-03-06 13:24:14 -080058
James Zerne1cbb132018-08-22 14:10:36 -070059#endif // AOM_AV1_COMMON_TIMING_H_