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 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 int two_pass_vbrmin_section; | 188 int two_pass_vbrmin_section; |
189 int two_pass_vbrmax_section; | 189 int two_pass_vbrmax_section; |
190 // END DATARATE CONTROL OPTIONS | 190 // END DATARATE CONTROL OPTIONS |
191 // ---------------------------------------------------------------- | 191 // ---------------------------------------------------------------- |
192 | 192 |
193 // Spatial and temporal scalability. | 193 // Spatial and temporal scalability. |
194 int ss_number_layers; // Number of spatial layers. | 194 int ss_number_layers; // Number of spatial layers. |
195 int ts_number_layers; // Number of temporal layers. | 195 int ts_number_layers; // Number of temporal layers. |
196 // Bitrate allocation for spatial layers. | 196 // Bitrate allocation for spatial layers. |
197 int ss_target_bitrate[VPX_SS_MAX_LAYERS]; | 197 int ss_target_bitrate[VPX_SS_MAX_LAYERS]; |
| 198 int ss_play_alternate[VPX_SS_MAX_LAYERS]; |
198 // Bitrate allocation (CBR mode) and framerate factor, for temporal layers. | 199 // Bitrate allocation (CBR mode) and framerate factor, for temporal layers. |
199 int ts_target_bitrate[VPX_TS_MAX_LAYERS]; | 200 int ts_target_bitrate[VPX_TS_MAX_LAYERS]; |
200 int ts_rate_decimator[VPX_TS_MAX_LAYERS]; | 201 int ts_rate_decimator[VPX_TS_MAX_LAYERS]; |
201 | 202 |
202 // these parameters aren't to be used in final build don't use!!! | 203 // these parameters aren't to be used in final build don't use!!! |
203 int play_alternate; | 204 int play_alternate; |
204 | 205 |
205 int encode_breakout; // early breakout : for video conf recommend 800 | 206 int encode_breakout; // early breakout : for video conf recommend 800 |
206 | 207 |
207 /* Bitfield defining the error resiliency features to enable. | 208 /* Bitfield defining the error resiliency features to enable. |
(...skipping 11 matching lines...) Expand all Loading... |
219 int arnr_max_frames; | 220 int arnr_max_frames; |
220 int arnr_strength; | 221 int arnr_strength; |
221 int arnr_type; | 222 int arnr_type; |
222 | 223 |
223 int tile_columns; | 224 int tile_columns; |
224 int tile_rows; | 225 int tile_rows; |
225 | 226 |
226 struct vpx_fixed_buf two_pass_stats_in; | 227 struct vpx_fixed_buf two_pass_stats_in; |
227 struct vpx_codec_pkt_list *output_pkt_list; | 228 struct vpx_codec_pkt_list *output_pkt_list; |
228 | 229 |
| 230 #if CONFIG_FP_MB_STATS |
| 231 struct vpx_fixed_buf firstpass_mb_stats_in; |
| 232 #endif |
| 233 |
229 vp8e_tuning tuning; | 234 vp8e_tuning tuning; |
230 } VP9EncoderConfig; | 235 } VP9EncoderConfig; |
231 | 236 |
232 static INLINE int is_altref_enabled(const VP9EncoderConfig *cfg) { | |
233 return cfg->mode != REALTIME && cfg->play_alternate && cfg->lag_in_frames > 0; | |
234 } | |
235 | |
236 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { | 237 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { |
237 return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; | 238 return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; |
238 } | 239 } |
239 | 240 |
240 static INLINE int is_best_mode(MODE mode) { | 241 static INLINE int is_best_mode(MODE mode) { |
241 return mode == ONE_PASS_BEST || mode == TWO_PASS_SECOND_BEST; | 242 return mode == ONE_PASS_BEST || mode == TWO_PASS_SECOND_BEST; |
242 } | 243 } |
243 | 244 |
244 typedef struct VP9_COMP { | 245 typedef struct VP9_COMP { |
245 QUANTS quants; | 246 QUANTS quants; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 int64_t vp9_rescale(int64_t val, int64_t num, int denom); | 529 int64_t vp9_rescale(int64_t val, int64_t num, int denom); |
529 | 530 |
530 void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv); | 531 void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv); |
531 | 532 |
532 YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm, | 533 YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm, |
533 YV12_BUFFER_CONFIG *unscaled, | 534 YV12_BUFFER_CONFIG *unscaled, |
534 YV12_BUFFER_CONFIG *scaled); | 535 YV12_BUFFER_CONFIG *scaled); |
535 | 536 |
536 void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags); | 537 void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags); |
537 | 538 |
| 539 static INLINE int is_altref_enabled(const VP9_COMP *const cpi) { |
| 540 return cpi->oxcf.mode != REALTIME && cpi->oxcf.lag_in_frames > 0 && |
| 541 (cpi->oxcf.play_alternate && |
| 542 (!(cpi->use_svc && cpi->svc.number_temporal_layers == 1) || |
| 543 cpi->oxcf.ss_play_alternate[cpi->svc.spatial_layer_id])); |
| 544 } |
| 545 |
538 static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd, | 546 static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd, |
539 MV_REFERENCE_FRAME ref0, | 547 MV_REFERENCE_FRAME ref0, |
540 MV_REFERENCE_FRAME ref1) { | 548 MV_REFERENCE_FRAME ref1) { |
541 xd->block_refs[0] = &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME | 549 xd->block_refs[0] = &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME |
542 : 0]; | 550 : 0]; |
543 xd->block_refs[1] = &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME | 551 xd->block_refs[1] = &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME |
544 : 0]; | 552 : 0]; |
545 } | 553 } |
546 | 554 |
547 static INLINE int get_chessboard_index(const VP9_COMMON *cm) { | 555 static INLINE int get_chessboard_index(const VP9_COMMON *cm) { |
548 return cm->current_video_frame % 2; | 556 return cm->current_video_frame % 2; |
549 } | 557 } |
550 | 558 |
551 #ifdef __cplusplus | 559 #ifdef __cplusplus |
552 } // extern "C" | 560 } // extern "C" |
553 #endif | 561 #endif |
554 | 562 |
555 #endif // VP9_ENCODER_VP9_ENCODER_H_ | 563 #endif // VP9_ENCODER_VP9_ENCODER_H_ |
OLD | NEW |