summaryrefslogtreecommitdiffstats
path: root/encoder/irc_rate_control_api_structs.h
diff options
context:
space:
mode:
authorHamsalekha S <hamsalekha.s@ittiam.com>2015-03-13 21:24:58 +0530
committerHamsalekha S <hamsalekha.s@ittiam.com>2015-04-02 15:59:02 +0530
commit8d3d303c7942ced6a987a52db8977d768dc3605f (patch)
treecc806c96794356996b13ba9970941d0aed74a97e /encoder/irc_rate_control_api_structs.h
parent3956d913d37327dcb340f836e604b04bd478b158 (diff)
downloadandroid_external_libavc-8d3d303c7942ced6a987a52db8977d768dc3605f.tar.gz
android_external_libavc-8d3d303c7942ced6a987a52db8977d768dc3605f.tar.bz2
android_external_libavc-8d3d303c7942ced6a987a52db8977d768dc3605f.zip
Initial version
Change-Id: I7efe9a589cd24edf86e8d086b40c27cbbf8b4017
Diffstat (limited to 'encoder/irc_rate_control_api_structs.h')
-rwxr-xr-xencoder/irc_rate_control_api_structs.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/encoder/irc_rate_control_api_structs.h b/encoder/irc_rate_control_api_structs.h
new file mode 100755
index 0000000..ba39e7f
--- /dev/null
+++ b/encoder/irc_rate_control_api_structs.h
@@ -0,0 +1,93 @@
+/******************************************************************************
+ *
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *****************************************************************************
+ * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
+*/
+
+#ifndef _RATE_CONTROL_API_STRUCTS_H_
+#define _RATE_CONTROL_API_STRUCTS_H_
+
+/*
+ * The following definitions were present in irc_cntrl_param.h, moved to this
+ * file as it is used by irc_rate_control_api.c
+ */
+
+/* num_frm_in_period = BIT_ALLOC_PERIOD*intra_frame_interval */
+#define VBR_BIT_ALLOC_PERIOD 3
+#define CBR_BIT_ALLOC_PERIOD 1
+
+/* Rate control state structure */
+typedef struct rate_control_api_t
+{
+ /* RC Algorithm */
+ rc_type_e e_rc_type;
+
+ /* Whether MB level rc is enabled or not */
+ UWORD8 u1_is_mb_level_rc_on;
+
+ /* Picture handling struct */
+ pic_handling_handle ps_pic_handling;
+
+ /* Model struct for I and P frms */
+ rc_rd_model_handle aps_rd_model[MAX_PIC_TYPE];
+
+ /* VBR storage VBV structure */
+ vbr_storage_vbv_handle ps_vbr_storage_vbv;
+
+ /* Calculate the estimated SAD */
+ est_sad_handle ps_est_sad;
+
+ /* Allocation of bits for each frame */
+ bit_allocation_handle ps_bit_allocation;
+
+ /* Init Qp(also used for Const Qp scenarios) */
+ UWORD8 au1_init_qp[MAX_PIC_TYPE];
+
+ /* MB Level rate control state structure */
+ mb_rate_control_handle ps_mb_rate_control;
+
+ UWORD8 au1_is_first_frm_coded[MAX_PIC_TYPE];
+
+ UWORD8 au1_prev_frm_qp[MAX_PIC_TYPE];
+
+ cbr_buffer_handle ps_cbr_buffer;
+
+ UWORD8 u1_scd_detected;
+
+ UWORD8 u1_frm_qp_after_scd;
+
+ UWORD8 au1_avg_bitrate_changed[MAX_PIC_TYPE];
+
+ UWORD8 u1_is_first_frm;
+
+ UWORD8 au1_min_max_qp[(MAX_PIC_TYPE << 1)];
+
+ WORD32 i4_prev_frm_est_bits;
+
+ vbr_str_prms_t s_vbr_str_prms;
+
+ /* Store the values which are to be impacted after a delay */
+ UWORD32 u4_frms_in_delay_prd_for_peak_bit_rate_change;
+
+ UWORD32 au4_new_peak_bit_rate[MAX_NUM_DRAIN_RATES];
+
+ picture_type_e prev_ref_pic_type;
+
+} rate_control_api_t;
+
+#endif/*_RATE_CONTROL_API_STRUCTS_H_*/
+