xref: /aosp_15_r20/external/libaom/av1/common/timing.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker /*
2*77c1e3ccSAndroid Build Coastguard Worker  * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3*77c1e3ccSAndroid Build Coastguard Worker  *
4*77c1e3ccSAndroid Build Coastguard Worker  * This source code is subject to the terms of the BSD 2 Clause License and
5*77c1e3ccSAndroid Build Coastguard Worker  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6*77c1e3ccSAndroid Build Coastguard Worker  * was not distributed with this source code in the LICENSE file, you can
7*77c1e3ccSAndroid Build Coastguard Worker  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8*77c1e3ccSAndroid Build Coastguard Worker  * Media Patent License 1.0 was not distributed with this source code in the
9*77c1e3ccSAndroid Build Coastguard Worker  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*77c1e3ccSAndroid Build Coastguard Worker  */
11*77c1e3ccSAndroid Build Coastguard Worker 
12*77c1e3ccSAndroid Build Coastguard Worker #ifndef AOM_AV1_COMMON_TIMING_H_
13*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AV1_COMMON_TIMING_H_
14*77c1e3ccSAndroid Build Coastguard Worker 
15*77c1e3ccSAndroid Build Coastguard Worker #include "aom/aom_integer.h"
16*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/enums.h"
17*77c1e3ccSAndroid Build Coastguard Worker 
18*77c1e3ccSAndroid Build Coastguard Worker #define MAX_NUM_OP_POINTS 32
19*77c1e3ccSAndroid Build Coastguard Worker 
20*77c1e3ccSAndroid Build Coastguard Worker typedef struct aom_timing {
21*77c1e3ccSAndroid Build Coastguard Worker   uint32_t num_units_in_display_tick;
22*77c1e3ccSAndroid Build Coastguard Worker   uint32_t time_scale;
23*77c1e3ccSAndroid Build Coastguard Worker   int equal_picture_interval;
24*77c1e3ccSAndroid Build Coastguard Worker   uint32_t num_ticks_per_picture;
25*77c1e3ccSAndroid Build Coastguard Worker } aom_timing_info_t;
26*77c1e3ccSAndroid Build Coastguard Worker 
27*77c1e3ccSAndroid Build Coastguard Worker typedef struct aom_dec_model_info {
28*77c1e3ccSAndroid Build Coastguard Worker   uint32_t num_units_in_decoding_tick;
29*77c1e3ccSAndroid Build Coastguard Worker   int encoder_decoder_buffer_delay_length;
30*77c1e3ccSAndroid Build Coastguard Worker   int buffer_removal_time_length;
31*77c1e3ccSAndroid Build Coastguard Worker   int frame_presentation_time_length;
32*77c1e3ccSAndroid Build Coastguard Worker } aom_dec_model_info_t;
33*77c1e3ccSAndroid Build Coastguard Worker 
34*77c1e3ccSAndroid Build Coastguard Worker typedef struct aom_dec_model_op_parameters {
35*77c1e3ccSAndroid Build Coastguard Worker   int decoder_model_param_present_flag;
36*77c1e3ccSAndroid Build Coastguard Worker   int64_t bitrate;
37*77c1e3ccSAndroid Build Coastguard Worker   int64_t buffer_size;
38*77c1e3ccSAndroid Build Coastguard Worker   uint32_t decoder_buffer_delay;
39*77c1e3ccSAndroid Build Coastguard Worker   uint32_t encoder_buffer_delay;
40*77c1e3ccSAndroid Build Coastguard Worker   int low_delay_mode_flag;
41*77c1e3ccSAndroid Build Coastguard Worker   int display_model_param_present_flag;
42*77c1e3ccSAndroid Build Coastguard Worker   int initial_display_delay;
43*77c1e3ccSAndroid Build Coastguard Worker } aom_dec_model_op_parameters_t;
44*77c1e3ccSAndroid Build Coastguard Worker 
45*77c1e3ccSAndroid Build Coastguard Worker void av1_set_aom_dec_model_info(aom_dec_model_info_t *decoder_model);
46*77c1e3ccSAndroid Build Coastguard Worker 
47*77c1e3ccSAndroid Build Coastguard Worker void av1_set_dec_model_op_parameters(aom_dec_model_op_parameters_t *op_params);
48*77c1e3ccSAndroid Build Coastguard Worker 
49*77c1e3ccSAndroid Build Coastguard Worker void av1_set_resource_availability_parameters(
50*77c1e3ccSAndroid Build Coastguard Worker     aom_dec_model_op_parameters_t *op_params);
51*77c1e3ccSAndroid Build Coastguard Worker 
52*77c1e3ccSAndroid Build Coastguard Worker int64_t av1_max_level_bitrate(BITSTREAM_PROFILE seq_profile, int seq_level_idx,
53*77c1e3ccSAndroid Build Coastguard Worker                               int seq_tier);
54*77c1e3ccSAndroid Build Coastguard Worker 
55*77c1e3ccSAndroid Build Coastguard Worker #endif  // AOM_AV1_COMMON_TIMING_H_
56