• 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 ihevce_lap_enc_structs.h
23 *
24 * \brief
25 *    This file contains structure definations shared between Encoder and RC
26 *
27 * \date
28 *    15/01/2013
29 *
30 * \author
31 *    Ittiam
32 *
33 ******************************************************************************
34 */
35 
36 #ifndef _IHEVCE_RC_ENC_STRUCTS_H_
37 #define _IHEVCE_RC_ENC_STRUCTS_H_
38 
39 /*****************************************************************************/
40 /* Constant Macros                                                           */
41 /*****************************************************************************/
42 
43 /*****************************************************************************/
44 /* Function Macros                                                           */
45 /*****************************************************************************/
46 
47 /*****************************************************************************/
48 /* Typedefs                                                                  */
49 /*****************************************************************************/
50 
51 /*****************************************************************************/
52 /* Enums                                                                     */
53 /*****************************************************************************/
54 
55 /*****************************************************************************/
56 /* Structure                                                                 */
57 /*****************************************************************************/
58 
59 /*SAD/Qscale is calculated over all CUs and summed into a 64 bit variable*/
60 /*Assuming 8*8 CU, sad can be 14 bit value */
61 /*For 4k*2k, number of 8*8 CUs is 131072 which is a 18 bit value */
62 /*Finally Qscale is mutlipled to this variable and it is 8 bit value*/
63 /*hence qformat can max be 64 - 14 - 18 - 8 - 1(sign) - 1(safty value) = 22 */
64 #define SAD_BY_QSCALE_Q 22
65 typedef struct
66 {
67     UWORD32 u4_total_header_bits;
68     UWORD32 u4_total_texture_bits;
69     UWORD32 u4_total_sad;
70     UWORD32 u4_total_intra_sad;
71     UWORD32 u4_open_loop_intra_sad;
72     WORD32 i4_qp_normalized_8x8_cu_sum[2];
73     WORD32 i4_8x8_cu_sum[2];
74     LWORD64 i8_sad_by_qscale[2];
75     LWORD64 i8_total_ssd_frame;
76     WORD32 i4_curr_qp_acc;
77 } rc_bits_sad_t;
78 
79 /*****************************************************************************/
80 /* Extern Variable Declarations                                              */
81 /*****************************************************************************/
82 
83 /*****************************************************************************/
84 /* Extern Function Declarations                                              */
85 /*****************************************************************************/
86 void ihevce_enc_loop_get_frame_rc_prms(
87     void *pv_enc_loop_ctxt, rc_bits_sad_t *ps_rc_prms, WORD32 i4_br_id, WORD32 i4_enc_frm_id);
88 
89 #endif /* _IHEVCE_RC_ENC_STRUCTS_H_ */
90