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 double framerate; | 25 double framerate; |
26 int avg_frame_size; | 26 int avg_frame_size; |
27 TWO_PASS twopass; | 27 TWO_PASS twopass; |
28 struct vpx_fixed_buf rc_twopass_stats_in; | 28 vpx_fixed_buf_t rc_twopass_stats_in; |
29 unsigned int current_video_frame_in_layer; | 29 unsigned int current_video_frame_in_layer; |
30 int is_key_frame; | 30 int is_key_frame; |
| 31 int frames_from_key_frame; |
| 32 FRAME_TYPE last_frame_type; |
31 vpx_svc_parameters_t svc_params_received; | 33 vpx_svc_parameters_t svc_params_received; |
32 struct lookahead_entry *alt_ref_source; | 34 struct lookahead_entry *alt_ref_source; |
33 int alt_ref_idx; | 35 int alt_ref_idx; |
34 int gold_ref_idx; | 36 int gold_ref_idx; |
35 int has_alt_frame; | 37 int has_alt_frame; |
36 size_t layer_size; | 38 size_t layer_size; |
37 } LAYER_CONTEXT; | 39 } LAYER_CONTEXT; |
38 | 40 |
39 typedef struct { | 41 typedef struct { |
40 int spatial_layer_id; | 42 int spatial_layer_id; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // to be encoded, to the cpi struct. | 75 // to be encoded, to the cpi struct. |
74 void vp9_restore_layer_context(struct VP9_COMP *const cpi); | 76 void vp9_restore_layer_context(struct VP9_COMP *const cpi); |
75 | 77 |
76 // Save the layer context after encoding the frame. | 78 // Save the layer context after encoding the frame. |
77 void vp9_save_layer_context(struct VP9_COMP *const cpi); | 79 void vp9_save_layer_context(struct VP9_COMP *const cpi); |
78 | 80 |
79 // Initialize second pass rc for spatial svc. | 81 // Initialize second pass rc for spatial svc. |
80 void vp9_init_second_pass_spatial_svc(struct VP9_COMP *cpi); | 82 void vp9_init_second_pass_spatial_svc(struct VP9_COMP *cpi); |
81 | 83 |
82 // Increment number of video frames in layer | 84 // Increment number of video frames in layer |
83 void vp9_inc_frame_in_layer(SVC *svc); | 85 void vp9_inc_frame_in_layer(struct VP9_COMP *const cpi); |
84 | 86 |
85 // Check if current layer is key frame in spatial upper layer | 87 // Check if current layer is key frame in spatial upper layer |
86 int vp9_is_upper_layer_key_frame(const struct VP9_COMP *const cpi); | 88 int vp9_is_upper_layer_key_frame(const struct VP9_COMP *const cpi); |
87 | 89 |
88 // Copy the source image, flags and svc parameters into a new framebuffer | 90 // Copy the source image, flags and svc parameters into a new framebuffer |
89 // with the expected stride/border | 91 // with the expected stride/border |
90 int vp9_svc_lookahead_push(const struct VP9_COMP *const cpi, | 92 int vp9_svc_lookahead_push(const struct VP9_COMP *const cpi, |
91 struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src, | 93 struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src, |
92 int64_t ts_start, int64_t ts_end, | 94 int64_t ts_start, int64_t ts_end, |
93 unsigned int flags); | 95 unsigned int flags); |
94 | 96 |
95 // Get the next source buffer to encode | 97 // Get the next source buffer to encode |
96 struct lookahead_entry *vp9_svc_lookahead_pop(struct VP9_COMP *const cpi, | 98 struct lookahead_entry *vp9_svc_lookahead_pop(struct VP9_COMP *const cpi, |
97 struct lookahead_ctx *ctx, | 99 struct lookahead_ctx *ctx, |
98 int drain); | 100 int drain); |
99 | 101 |
100 // Get a future source buffer to encode | 102 // Get a future source buffer to encode |
101 struct lookahead_entry *vp9_svc_lookahead_peek(struct VP9_COMP *const cpi, | 103 struct lookahead_entry *vp9_svc_lookahead_peek(struct VP9_COMP *const cpi, |
102 struct lookahead_ctx *ctx, | 104 struct lookahead_ctx *ctx, |
103 int index, int copy_params); | 105 int index, int copy_params); |
104 | 106 |
105 #ifdef __cplusplus | 107 #ifdef __cplusplus |
106 } // extern "C" | 108 } // extern "C" |
107 #endif | 109 #endif |
108 | 110 |
109 #endif // VP9_ENCODER_VP9_SVC_LAYERCONTEXT_ | 111 #endif // VP9_ENCODER_VP9_SVC_LAYERCONTEXT_ |
OLD | NEW |