| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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_SVC_LAYERCONTEXT_H_ | 11 #ifndef VP9_ENCODER_VP9_SVC_LAYERCONTEXT_H_ |
| 12 #define VP9_ENCODER_VP9_SVC_LAYERCONTEXT_H_ | 12 #define VP9_ENCODER_VP9_SVC_LAYERCONTEXT_H_ |
| 13 | 13 |
| 14 #include "vpx/vpx_encoder.h" | 14 #include "vpx/vpx_encoder.h" |
| 15 | 15 |
| 16 #include "vp9/encoder/vp9_ratectrl.h" | 16 #include "vp9/encoder/vp9_ratectrl.h" |
| 17 | 17 |
| 18 #ifdef __cplusplus | 18 #ifdef __cplusplus |
| 19 extern "C" { | 19 extern "C" { |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 typedef struct { | 22 typedef struct { |
| 23 RATE_CONTROL rc; | 23 RATE_CONTROL rc; |
| 24 int target_bandwidth; | 24 int target_bandwidth; |
| 25 int spatial_layer_target_bandwidth; // Target for the spatial layer. |
| 25 double framerate; | 26 double framerate; |
| 26 int avg_frame_size; | 27 int avg_frame_size; |
| 27 int max_q; | 28 int max_q; |
| 28 int min_q; | 29 int min_q; |
| 29 int scaling_factor_num; | 30 int scaling_factor_num; |
| 30 int scaling_factor_den; | 31 int scaling_factor_den; |
| 31 TWO_PASS twopass; | 32 TWO_PASS twopass; |
| 32 vpx_fixed_buf_t rc_twopass_stats_in; | 33 vpx_fixed_buf_t rc_twopass_stats_in; |
| 33 unsigned int current_video_frame_in_layer; | 34 unsigned int current_video_frame_in_layer; |
| 34 int is_key_frame; | 35 int is_key_frame; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 57 NEED_TO_ENCODE | 58 NEED_TO_ENCODE |
| 58 }encode_empty_frame_state; | 59 }encode_empty_frame_state; |
| 59 struct lookahead_entry empty_frame; | 60 struct lookahead_entry empty_frame; |
| 60 int encode_intra_empty_frame; | 61 int encode_intra_empty_frame; |
| 61 | 62 |
| 62 // Store scaled source frames to be used for temporal filter to generate | 63 // Store scaled source frames to be used for temporal filter to generate |
| 63 // a alt ref frame. | 64 // a alt ref frame. |
| 64 YV12_BUFFER_CONFIG scaled_frames[MAX_LAG_BUFFERS]; | 65 YV12_BUFFER_CONFIG scaled_frames[MAX_LAG_BUFFERS]; |
| 65 | 66 |
| 66 // Layer context used for rate control in one pass temporal CBR mode or | 67 // Layer context used for rate control in one pass temporal CBR mode or |
| 67 // two pass spatial mode. Defined for temporal or spatial layers for now. | 68 // two pass spatial mode. |
| 68 // Does not support temporal combined with spatial RC. | 69 LAYER_CONTEXT layer_context[VPX_MAX_LAYERS]; |
| 69 LAYER_CONTEXT layer_context[MAX(VPX_TS_MAX_LAYERS, VPX_SS_MAX_LAYERS)]; | 70 // Indicates what sort of temporal layering is used. |
| 71 // Currently, this only works for CBR mode. |
| 72 VP9E_TEMPORAL_LAYERING_MODE temporal_layering_mode; |
| 70 } SVC; | 73 } SVC; |
| 71 | 74 |
| 72 struct VP9_COMP; | 75 struct VP9_COMP; |
| 73 | 76 |
| 74 // Initialize layer context data from init_config(). | 77 // Initialize layer context data from init_config(). |
| 75 void vp9_init_layer_context(struct VP9_COMP *const cpi); | 78 void vp9_init_layer_context(struct VP9_COMP *const cpi); |
| 76 | 79 |
| 77 // Update the layer context from a change_config() call. | 80 // Update the layer context from a change_config() call. |
| 78 void vp9_update_layer_context_change_config(struct VP9_COMP *const cpi, | 81 void vp9_update_layer_context_change_config(struct VP9_COMP *const cpi, |
| 79 const int target_bandwidth); | 82 const int target_bandwidth); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 103 int vp9_is_upper_layer_key_frame(const struct VP9_COMP *const cpi); | 106 int vp9_is_upper_layer_key_frame(const struct VP9_COMP *const cpi); |
| 104 | 107 |
| 105 // Get the next source buffer to encode | 108 // Get the next source buffer to encode |
| 106 struct lookahead_entry *vp9_svc_lookahead_pop(struct VP9_COMP *const cpi, | 109 struct lookahead_entry *vp9_svc_lookahead_pop(struct VP9_COMP *const cpi, |
| 107 struct lookahead_ctx *ctx, | 110 struct lookahead_ctx *ctx, |
| 108 int drain); | 111 int drain); |
| 109 | 112 |
| 110 // Start a frame and initialize svc parameters | 113 // Start a frame and initialize svc parameters |
| 111 int vp9_svc_start_frame(struct VP9_COMP *const cpi); | 114 int vp9_svc_start_frame(struct VP9_COMP *const cpi); |
| 112 | 115 |
| 116 int vp9_one_pass_cbr_svc_start_layer(struct VP9_COMP *const cpi); |
| 117 |
| 113 #ifdef __cplusplus | 118 #ifdef __cplusplus |
| 114 } // extern "C" | 119 } // extern "C" |
| 115 #endif | 120 #endif |
| 116 | 121 |
| 117 #endif // VP9_ENCODER_VP9_SVC_LAYERCONTEXT_ | 122 #endif // VP9_ENCODER_VP9_SVC_LAYERCONTEXT_ |
| OLD | NEW |