• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright (C) 2018 The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************
18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 /*!
21 ******************************************************************************
22 * \file picture_type.h
23 *
24 * \brief
25 *    This file contains all the necessary declarations for
26 *    picture info handling functions
27 *
28 * \date
29 *
30 * \author
31 *    ittiam
32 *
33 ******************************************************************************
34 */
35 #ifndef _PIC_HANDLING_H_
36 #define _PIC_HANDLING_H_
37 
38 /* Basic Understanding:
39  * add_pic_to_stack(_re_enc):
40  *  This functions converts the input (or display) order to encoding order
41  *
42  * */
43 /*****************************************************************************/
44 /* Structure                                                                 */
45 /*****************************************************************************/
46 typedef struct pic_handling_t *pic_handling_handle;
47 
48 /*****************************************************************************/
49 /* Function Declarations                                                     */
50 /*****************************************************************************/
51 WORD32 pic_handling_num_fill_use_free_memtab(
52     pic_handling_handle *pps_pic_handling, itt_memtab_t *ps_memtab, ITT_FUNC_TYPE_E e_func_type);
53 void init_pic_handling(
54     pic_handling_handle ps_pic_handling,
55     WORD32 i4_intra_frm_int,
56     WORD32 i4_max_inter_frm_int,
57     WORD32 i4_is_gop_closed,
58     WORD32 i4_idr_period,
59     WORD32 i4_num_active_pic_type,
60     WORD32 i4_field_pic);
61 
62 void add_pic_to_stack(
63     pic_handling_handle ps_pic_handling, WORD32 i4_enc_pic_id, WORD32 i4_rc_in_pic);
64 WORD32 add_pic_to_stack_re_enc(
65     pic_handling_handle ps_pic_handling, WORD32 i4_enc_pic_id, picture_type_e e_pic_type);
66 
67 void get_pic_from_stack(
68     pic_handling_handle ps_pic_handling,
69     WORD32 *pi4_pic_id,
70     WORD32 *pi4_pic_disp_order_no,
71     picture_type_e *pe_pic_type,
72     WORD32 *pi4_is_scd);
73 
74 WORD32 is_last_frame_in_gop(pic_handling_handle ps_pic_handling);
75 void flush_frame_from_pic_stack(pic_handling_handle ps_pic_handling);
76 
77 /* NITT TBR The below two functions should be made a single function */
78 void skip_encoded_frame(pic_handling_handle ps_pic_handling, picture_type_e e_pic_type);
79 void update_pic_handling(
80     pic_handling_handle ps_pic_handling,
81     picture_type_e e_pic_type,
82     WORD32 i4_is_non_ref_pic,
83     WORD32 i4_is_scd);
84 
85 /* Function returns the number of frames that have been encoded in the GOP in
86  * which the force I frame takes impact */
87 WORD32 pic_type_get_frms_in_gop_force_I_frm(pic_handling_handle ps_pic_handling);
88 void set_force_I_frame_flag(pic_handling_handle ps_pic_handling);
89 WORD32 get_forced_I_frame_cur_frm_flag(pic_handling_handle ps_pic_handling);
90 void reset_forced_I_frame_cur_frm_flag(pic_handling_handle ps_pic_handling);
91 
92 /* Normal get functions */
93 WORD32 pic_type_get_inter_frame_interval(pic_handling_handle ps_pic_handling);
94 
95 WORD32 pic_type_get_intra_frame_interval(pic_handling_handle ps_pic_handling);
96 
97 WORD32 pic_type_get_disp_order_no(pic_handling_handle ps_pic_handling);
98 
99 WORD32 pic_type_get_field_pic(pic_handling_handle ps_pic_handling);
100 
101 WORD32 pic_type_is_gop_closed(pic_handling_handle ps_pic_handling);
102 
103 void pic_handling_register_new_int_frm_interval(
104     pic_handling_handle ps_pic_handling, WORD32 i4_intra_frm_int);
105 
106 void pic_handling_register_new_inter_frm_interval(
107     pic_handling_handle ps_pic_handling, WORD32 i4_inter_frm_int);
108 
109 WORD32 pic_type_get_rem_frms_in_gop(pic_handling_handle ps_pic_handling);
110 
111 void pic_type_get_frms_in_gop(
112     pic_handling_handle ps_pic_handling, WORD32 ai4_frms_in_gop[MAX_PIC_TYPE]);
113 
114 void pic_type_get_actual_frms_in_gop(
115     pic_handling_handle ps_pic_handling, WORD32 ai4_frms_in_gop[MAX_PIC_TYPE]);
116 
117 void pic_type_update_frms_in_gop(
118     pic_handling_handle ps_pic_handling, WORD32 ai4_frms_in_gop[MAX_PIC_TYPE]);
119 
120 WORD32 get_default_intra_period(pic_handling_handle ps_pic_handling);
121 
122 WORD32 pic_type_get_actual_intra_frame_interval(pic_handling_handle ps_pic_handling);
123 #endif /* _PIC_HANDLING_H_ */
124