OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef VP9_ENCODER_VP9_FIRSTPASS_H_ | 11 #ifndef VP9_ENCODER_VP9_FIRSTPASS_H_ |
12 #define VP9_ENCODER_VP9_FIRSTPASS_H_ | 12 #define VP9_ENCODER_VP9_FIRSTPASS_H_ |
13 | 13 |
14 #include "vp9/encoder/vp9_lookahead.h" | 14 #include "vp9/encoder/vp9_lookahead.h" |
15 #include "vp9/encoder/vp9_ratectrl.h" | 15 #include "vp9/encoder/vp9_ratectrl.h" |
16 | 16 |
17 #ifdef __cplusplus | 17 #ifdef __cplusplus |
18 extern "C" { | 18 extern "C" { |
19 #endif | 19 #endif |
20 | 20 |
21 #if CONFIG_FP_MB_STATS | 21 #if CONFIG_FP_MB_STATS |
22 typedef struct { | 22 typedef struct { |
23 PREDICTION_MODE mode; | 23 uint8_t *mb_stats_start; |
24 int err; | 24 uint8_t *mb_stats_end; |
25 int_mv mv; | |
26 } FIRSTPASS_MB_STATS; | 25 } FIRSTPASS_MB_STATS; |
27 | |
28 typedef struct { | |
29 FIRSTPASS_MB_STATS *mb_stats; | |
30 } FIRSTPASS_FRAME_MB_STATS; | |
31 #endif | 26 #endif |
32 | 27 |
33 typedef struct { | 28 typedef struct { |
34 double frame; | 29 double frame; |
35 double intra_error; | 30 double intra_error; |
36 double coded_error; | 31 double coded_error; |
37 double sr_coded_error; | 32 double sr_coded_error; |
38 double pcnt_inter; | 33 double pcnt_inter; |
39 double pcnt_motion; | 34 double pcnt_motion; |
40 double pcnt_second_ref; | 35 double pcnt_second_ref; |
(...skipping 25 matching lines...) Expand all Loading... |
66 RATE_FACTOR_LEVEL rf_level[(MAX_LAG_BUFFERS * 2) + 1]; | 61 RATE_FACTOR_LEVEL rf_level[(MAX_LAG_BUFFERS * 2) + 1]; |
67 FRAME_UPDATE_TYPE update_type[(MAX_LAG_BUFFERS * 2) + 1]; | 62 FRAME_UPDATE_TYPE update_type[(MAX_LAG_BUFFERS * 2) + 1]; |
68 unsigned char arf_src_offset[(MAX_LAG_BUFFERS * 2) + 1]; | 63 unsigned char arf_src_offset[(MAX_LAG_BUFFERS * 2) + 1]; |
69 unsigned char arf_update_idx[(MAX_LAG_BUFFERS * 2) + 1]; | 64 unsigned char arf_update_idx[(MAX_LAG_BUFFERS * 2) + 1]; |
70 unsigned char arf_ref_idx[(MAX_LAG_BUFFERS * 2) + 1]; | 65 unsigned char arf_ref_idx[(MAX_LAG_BUFFERS * 2) + 1]; |
71 int bit_allocation[(MAX_LAG_BUFFERS * 2) + 1]; | 66 int bit_allocation[(MAX_LAG_BUFFERS * 2) + 1]; |
72 } GF_GROUP; | 67 } GF_GROUP; |
73 | 68 |
74 typedef struct { | 69 typedef struct { |
75 unsigned int section_intra_rating; | 70 unsigned int section_intra_rating; |
76 unsigned int next_iiratio; | |
77 FIRSTPASS_STATS total_stats; | 71 FIRSTPASS_STATS total_stats; |
78 FIRSTPASS_STATS this_frame_stats; | 72 FIRSTPASS_STATS this_frame_stats; |
79 const FIRSTPASS_STATS *stats_in; | 73 const FIRSTPASS_STATS *stats_in; |
80 const FIRSTPASS_STATS *stats_in_start; | 74 const FIRSTPASS_STATS *stats_in_start; |
81 const FIRSTPASS_STATS *stats_in_end; | 75 const FIRSTPASS_STATS *stats_in_end; |
82 FIRSTPASS_STATS total_left_stats; | 76 FIRSTPASS_STATS total_left_stats; |
83 int first_pass_done; | 77 int first_pass_done; |
84 int64_t bits_left; | 78 int64_t bits_left; |
85 double modified_error_min; | 79 double modified_error_min; |
86 double modified_error_max; | 80 double modified_error_max; |
87 double modified_error_left; | 81 double modified_error_left; |
88 double kf_intra_err_min; | 82 double kf_intra_err_min; |
89 double gf_intra_err_min; | 83 double gf_intra_err_min; |
90 | 84 |
91 #if CONFIG_FP_MB_STATS | 85 #if CONFIG_FP_MB_STATS |
92 FIRSTPASS_FRAME_MB_STATS this_frame_mb_stats; | 86 uint8_t *frame_mb_stats_buf; |
| 87 uint8_t *this_frame_mb_stats; |
| 88 FIRSTPASS_MB_STATS firstpass_mb_stats; |
93 #endif | 89 #endif |
94 | 90 |
95 // Projected total bits available for a key frame group of frames | 91 // Projected total bits available for a key frame group of frames |
96 int64_t kf_group_bits; | 92 int64_t kf_group_bits; |
97 | 93 |
98 // Error score of frames still to be coded in kf group | 94 // Error score of frames still to be coded in kf group |
99 int64_t kf_group_error_left; | 95 int64_t kf_group_error_left; |
100 int sr_update_lag; | 96 int sr_update_lag; |
101 | 97 |
102 int kf_zeromotion_pct; | 98 int kf_zeromotion_pct; |
(...skipping 14 matching lines...) Expand all Loading... |
117 void vp9_init_second_pass(struct VP9_COMP *cpi); | 113 void vp9_init_second_pass(struct VP9_COMP *cpi); |
118 void vp9_rc_get_second_pass_params(struct VP9_COMP *cpi); | 114 void vp9_rc_get_second_pass_params(struct VP9_COMP *cpi); |
119 | 115 |
120 // Post encode update of the rate control parameters for 2-pass | 116 // Post encode update of the rate control parameters for 2-pass |
121 void vp9_twopass_postencode_update(struct VP9_COMP *cpi); | 117 void vp9_twopass_postencode_update(struct VP9_COMP *cpi); |
122 #ifdef __cplusplus | 118 #ifdef __cplusplus |
123 } // extern "C" | 119 } // extern "C" |
124 #endif | 120 #endif |
125 | 121 |
126 #endif // VP9_ENCODER_VP9_FIRSTPASS_H_ | 122 #endif // VP9_ENCODER_VP9_FIRSTPASS_H_ |
OLD | NEW |