huangcm
2024-08-23 d76fb8c8c6d079a3cee81da7072347dcb8bbbc70
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/******************************************************************************
 *
 * Copyright (C) 2018 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
*/
/*!
******************************************************************************
* \file rc_look_ahead_params.h
*
* \brief
*    TODO:
*
* \date
*
* \author
*    ittiam
*
******************************************************************************
*/
 
#ifndef _RC_LOOK_AHEAD_PARAMS_H_
#define _RC_LOOK_AHEAD_PARAMS_H_
 
/*****************************************************************************/
/* Structure                                                                 */
/*****************************************************************************/
/*
* Frame metrics
*/
typedef struct
{
    /* Frame variance. Spatial property */
    LWORD64 i8_8x8_var_lum;
 
    /* frame and histogram similarity */
    WORD32 ai4_hsim[3];
    WORD32 i4_fsim;
 
} rc_picture_metrics_t;
 
typedef struct
{
    /* common params for both lap_out and rc_lap_out */
 
    WORD32 i4_rc_pic_type;
    WORD32 i4_rc_poc;
    WORD32 i4_rc_temporal_lyr_id;
    WORD32 i4_rc_is_ref_pic;
    WORD32 i4_rc_scene_type;
    UWORD32 u4_rc_scene_num;
    WORD32 i4_rc_display_num;
    WORD32 i4_rc_quality_preset;
    WORD32 i4_rc_first_field;
 
    /* rc_lap_out specific params */
 
    /**
      * array of rc_lap_out_params_t pointer to access
      * the picture metrics of future pictures in capture order till
      * the look ahead frames
    */
    void *ps_rc_lap_out_next_encode;
 
    WORD32 i4_next_pic_type;
 
    WORD32 i4_is_I_only_scd;
    WORD32 i4_is_non_I_scd;
 
    LWORD64 i8_frame_satd_act_accum;
    LWORD64 i8_est_I_pic_header_bits;
 
    /*  Num pels in frame considered while accumulating the above satd metric */
    WORD32 i4_num_pels_in_frame_considered;
    /* Field type i.e either bottom or top is convyed */
    WORD32 i4_is_bottom_field;
    /* Coarse ME accumulated cost for entire frame */
    LWORD64 i8_frame_acc_coarse_me_cost;
    /* Coarse ME accumulated sad for entire frame */
    LWORD64 ai8_frame_acc_coarse_me_sad[52];
    /* L1 intra SATD */
    LWORD64 i8_pre_intra_satd;
    /* L1 intra SATD */
    LWORD64 ai8_pre_intra_sad[52];
    /* L1 IPE sad */
    LWORD64 i8_raw_pre_intra_sad;
    /* Frame - level L1 ME sad */
    LWORD64 i8_raw_l1_coarse_me_sad;
    /** Frame - level L1 satd/act accum*/
    LWORD64 i8_frame_satd_by_act_L1_accum;
    /** Frame - level L1 satd/act accum*/
    LWORD64 i8_satd_by_act_L1_accum_evaluated;
    /* Frame satd/act accumulated for L0 predicted based on L1 satd and qp used for L0 processing */
    LWORD64 i8_frm_satd_act_accum_L0_frm_L1;
 
    /* Frames for which online/offline model is not valid */
    WORD32 i4_is_model_valid;
    /* Steady State Frame */
    WORD32 i4_is_steady_state;
 
    LWORD64 i8_est_text_bits;
    LWORD64 i8_frame_num;
 
    frame_info_t *ps_frame_info;
    /* complexity metrics from LAP */
    rc_picture_metrics_t s_pic_metrics;
 
    WORD32 i4_is_cmplx_change_reset_model;
    WORD32 i4_is_cmplx_change_reset_bits;
    WORD32 i4_is_rc_model_needs_to_be_updated;
    WORD32 i4_next_sc_i_in_rc_look_ahead;
    WORD32 ai4_num_pic_type[MAX_PIC_TYPE];
    WORD32 ai4_offsets[5];
    WORD32 i4_offsets_set_flag;
    WORD32 i4_complexity_bin;
    WORD32 i4_ignore_for_rc_update;
    WORD32 i4_L1_qp;
    WORD32 i4_L0_qp;
    WORD32 i4_enable_lookahead;
    WORD32 i4_orig_rc_qp;
    WORD32 i4_use_offline_model_2pass;
    WORD32 i4_next_scene_type;
    WORD32 i4_perc_dc_blks;
 
    /* Used only in ix,vx versions */
    LWORD64 i8_frame_acc_satd_cost;
    WORD32 i4_l1_update_done;
    WORD32 i4_rc_i_pic_lamda_offset;
    float f_rc_pred_factor;
 
} rc_lap_out_params_t;
 
#endif