| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 int two_pass_vbrbias; // two pass datarate control tweaks | 187 int two_pass_vbrbias; // two pass datarate control tweaks |
| 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 layer_target_bitrate[VPX_MAX_LAYERS]; |
| 197 int ss_target_bitrate[VPX_SS_MAX_LAYERS]; | 198 int ss_target_bitrate[VPX_SS_MAX_LAYERS]; |
| 198 int ss_enable_auto_arf[VPX_SS_MAX_LAYERS]; | 199 int ss_enable_auto_arf[VPX_SS_MAX_LAYERS]; |
| 199 // Bitrate allocation (CBR mode) and framerate factor, for temporal layers. | 200 // Bitrate allocation (CBR mode) and framerate factor, for temporal layers. |
| 200 int ts_target_bitrate[VPX_TS_MAX_LAYERS]; | |
| 201 int ts_rate_decimator[VPX_TS_MAX_LAYERS]; | 201 int ts_rate_decimator[VPX_TS_MAX_LAYERS]; |
| 202 | 202 |
| 203 int enable_auto_arf; | 203 int enable_auto_arf; |
| 204 | 204 |
| 205 int encode_breakout; // early breakout : for video conf recommend 800 | 205 int encode_breakout; // early breakout : for video conf recommend 800 |
| 206 | 206 |
| 207 /* Bitfield defining the error resiliency features to enable. | 207 /* Bitfield defining the error resiliency features to enable. |
| 208 * Can provide decodable frames after losses in previous | 208 * Can provide decodable frames after losses in previous |
| 209 * frames and decodable partitions after losses in the same frame. | 209 * frames and decodable partitions after losses in the same frame. |
| 210 */ | 210 */ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 230 #if CONFIG_FP_MB_STATS | 230 #if CONFIG_FP_MB_STATS |
| 231 vpx_fixed_buf_t firstpass_mb_stats_in; | 231 vpx_fixed_buf_t firstpass_mb_stats_in; |
| 232 #endif | 232 #endif |
| 233 | 233 |
| 234 vp8e_tuning tuning; | 234 vp8e_tuning tuning; |
| 235 vp9e_tune_content content; | 235 vp9e_tune_content content; |
| 236 #if CONFIG_VP9_HIGHBITDEPTH | 236 #if CONFIG_VP9_HIGHBITDEPTH |
| 237 int use_highbitdepth; | 237 int use_highbitdepth; |
| 238 #endif | 238 #endif |
| 239 vpx_color_space_t color_space; | 239 vpx_color_space_t color_space; |
| 240 VP9E_TEMPORAL_LAYERING_MODE temporal_layering_mode; |
| 240 } VP9EncoderConfig; | 241 } VP9EncoderConfig; |
| 241 | 242 |
| 242 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { | 243 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { |
| 243 return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; | 244 return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; |
| 244 } | 245 } |
| 245 | 246 |
| 246 // TODO(jingning) All spatially adaptive variables should go to TileDataEnc. | 247 // TODO(jingning) All spatially adaptive variables should go to TileDataEnc. |
| 247 typedef struct TileDataEnc { | 248 typedef struct TileDataEnc { |
| 248 TileInfo tile_info; | 249 TileInfo tile_info; |
| 249 int thresh_freq_fact[BLOCK_SIZES][MAX_MODES]; | 250 int thresh_freq_fact[BLOCK_SIZES][MAX_MODES]; |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 | 605 |
| 605 void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv); | 606 void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv); |
| 606 | 607 |
| 607 YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm, | 608 YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm, |
| 608 YV12_BUFFER_CONFIG *unscaled, | 609 YV12_BUFFER_CONFIG *unscaled, |
| 609 YV12_BUFFER_CONFIG *scaled); | 610 YV12_BUFFER_CONFIG *scaled); |
| 610 | 611 |
| 611 void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags); | 612 void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags); |
| 612 | 613 |
| 613 static INLINE int is_two_pass_svc(const struct VP9_COMP *const cpi) { | 614 static INLINE int is_two_pass_svc(const struct VP9_COMP *const cpi) { |
| 614 return cpi->use_svc && | 615 return cpi->use_svc && cpi->oxcf.pass != 0; |
| 615 ((cpi->svc.number_spatial_layers > 1) || | 616 } |
| 616 (cpi->svc.number_temporal_layers > 1 && cpi->oxcf.pass != 0)); | 617 |
| 618 static INLINE int is_one_pass_cbr_svc(const struct VP9_COMP *const cpi) { |
| 619 return (cpi->use_svc && cpi->oxcf.pass == 0); |
| 617 } | 620 } |
| 618 | 621 |
| 619 static INLINE int is_altref_enabled(const VP9_COMP *const cpi) { | 622 static INLINE int is_altref_enabled(const VP9_COMP *const cpi) { |
| 620 return cpi->oxcf.mode != REALTIME && cpi->oxcf.lag_in_frames > 0 && | 623 return cpi->oxcf.mode != REALTIME && cpi->oxcf.lag_in_frames > 0 && |
| 621 (cpi->oxcf.enable_auto_arf && | 624 (cpi->oxcf.enable_auto_arf && |
| 622 (!is_two_pass_svc(cpi) || | 625 (!is_two_pass_svc(cpi) || |
| 623 cpi->oxcf.ss_enable_auto_arf[cpi->svc.spatial_layer_id])); | 626 cpi->oxcf.ss_enable_auto_arf[cpi->svc.spatial_layer_id])); |
| 624 } | 627 } |
| 625 | 628 |
| 626 static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd, | 629 static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd, |
| 627 MV_REFERENCE_FRAME ref0, | 630 MV_REFERENCE_FRAME ref0, |
| 628 MV_REFERENCE_FRAME ref1) { | 631 MV_REFERENCE_FRAME ref1) { |
| 629 xd->block_refs[0] = &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME | 632 xd->block_refs[0] = &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME |
| 630 : 0]; | 633 : 0]; |
| 631 xd->block_refs[1] = &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME | 634 xd->block_refs[1] = &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME |
| 632 : 0]; | 635 : 0]; |
| 633 } | 636 } |
| 634 | 637 |
| 635 static INLINE int get_chessboard_index(const int frame_index) { | 638 static INLINE int get_chessboard_index(const int frame_index) { |
| 636 return frame_index & 0x1; | 639 return frame_index & 0x1; |
| 637 } | 640 } |
| 638 | 641 |
| 639 static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) { | 642 static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) { |
| 640 return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL; | 643 return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL; |
| 641 } | 644 } |
| 642 | 645 |
| 643 void vp9_new_framerate(VP9_COMP *cpi, double framerate); | 646 void vp9_new_framerate(VP9_COMP *cpi, double framerate); |
| 644 | 647 |
| 648 #define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl)) |
| 649 |
| 645 #ifdef __cplusplus | 650 #ifdef __cplusplus |
| 646 } // extern "C" | 651 } // extern "C" |
| 647 #endif | 652 #endif |
| 648 | 653 |
| 649 #endif // VP9_ENCODER_VP9_ENCODER_H_ | 654 #endif // VP9_ENCODER_VP9_ENCODER_H_ |
| OLD | NEW |