[NORMATIVE] Decoder buffer model implementation
BUG=aomedia:1716
Change-Id: I07c2c0f6dedae861ebf64a7148cec181ea2cfd19
diff --git a/av1/common/timing.h b/av1/common/timing.h
new file mode 100644
index 0000000..1d13a2d
--- /dev/null
+++ b/av1/common/timing.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016, Alliance for Open Media. All rights reserved
+ *
+ * This source code is subject to the terms of the BSD 2 Clause License and
+ * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
+ * was not distributed with this source code in the LICENSE file, you can
+ * obtain it at www.aomedia.org/license/software. If the Alliance for Open
+ * Media Patent License 1.0 was not distributed with this source code in the
+ * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
+ */
+
+#ifndef AOM_TIMING_H_
+#define AOM_TIMING_H_
+
+#include "aom/aom_integer.h"
+
+#define MAX_NUM_OP_POINTS 32
+
+typedef struct aom_timing {
+ uint32_t num_units_in_display_tick;
+ uint32_t time_scale;
+ int equal_picture_interval;
+ uint32_t num_ticks_per_picture;
+} aom_timing_info_t;
+
+typedef struct aom_dec_model_info {
+ uint32_t num_units_in_decoding_tick;
+ int encoder_decoder_buffer_delay_length;
+ int buffer_removal_delay_length;
+ int frame_presentation_delay_length;
+ int bitrate_scale;
+ int buffer_size_scale;
+} aom_dec_model_info_t;
+
+typedef struct aom_dec_model_op_parameters {
+ int decoder_model_operating_point_idc;
+ int decoder_model_param_present_flag;
+ int bitrate;
+ int buffer_size;
+ int cbr_flag;
+ int decoder_buffer_delay;
+ int encoder_buffer_delay;
+ int low_delay_mode_flag;
+ int display_model_param_present_flag;
+ int initial_display_delay;
+} aom_dec_model_op_parameters_t;
+
+typedef struct aom_op_timing_info_t {
+ int buffer_removal_delay_flag;
+ int64_t buffer_removal_delay;
+} aom_op_timing_info_t;
+
+void set_aom_dec_model_info(aom_dec_model_info_t *decoder_model);
+
+void set_dec_model_op_parameters(aom_dec_model_op_parameters_t *op_params,
+ aom_dec_model_info_t *decoder_model,
+ int64_t bitrate, int op_idc);
+
+#endif // AOM_TIMING_H_