OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC 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 * WEBRTC VP8 wrapper interface | 10 * WEBRTC VP8 wrapper interface |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 bool only_predicting_from_key_frame); | 86 bool only_predicting_from_key_frame); |
87 | 87 |
88 int GetEncodedPartitions(const VideoFrame& input_image, | 88 int GetEncodedPartitions(const VideoFrame& input_image, |
89 bool only_predicting_from_key_frame); | 89 bool only_predicting_from_key_frame); |
90 | 90 |
91 // Set the stream state for stream |stream_idx|. | 91 // Set the stream state for stream |stream_idx|. |
92 void SetStreamState(bool send_stream, int stream_idx); | 92 void SetStreamState(bool send_stream, int stream_idx); |
93 | 93 |
94 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size); | 94 uint32_t MaxIntraTarget(uint32_t optimal_buffer_size); |
95 | 95 |
| 96 const bool use_gf_boost_; |
| 97 |
96 EncodedImageCallback* encoded_complete_callback_; | 98 EncodedImageCallback* encoded_complete_callback_; |
97 VideoCodec codec_; | 99 VideoCodec codec_; |
98 bool inited_; | 100 bool inited_; |
99 int64_t timestamp_; | 101 int64_t timestamp_; |
100 bool feedback_mode_; | |
101 int qp_max_; | 102 int qp_max_; |
102 int cpu_speed_default_; | 103 int cpu_speed_default_; |
103 int number_of_cores_; | 104 int number_of_cores_; |
104 uint32_t rc_max_intra_target_; | 105 uint32_t rc_max_intra_target_; |
105 int token_partitions_; | |
106 ReferencePictureSelection rps_; | 106 ReferencePictureSelection rps_; |
107 std::vector<TemporalLayers*> temporal_layers_; | 107 std::vector<TemporalLayers*> temporal_layers_; |
108 bool down_scale_requested_; | |
109 uint32_t down_scale_bitrate_; | |
110 const bool use_gf_boost_; | |
111 std::vector<uint16_t> picture_id_; | 108 std::vector<uint16_t> picture_id_; |
112 std::vector<int> last_key_frame_picture_id_; | 109 std::vector<int> last_key_frame_picture_id_; |
113 std::vector<bool> key_frame_request_; | 110 std::vector<bool> key_frame_request_; |
114 std::vector<bool> send_stream_; | 111 std::vector<bool> send_stream_; |
115 std::vector<int> cpu_speed_; | 112 std::vector<int> cpu_speed_; |
116 std::vector<vpx_image_t> raw_images_; | 113 std::vector<vpx_image_t> raw_images_; |
117 std::vector<EncodedImage> encoded_images_; | 114 std::vector<EncodedImage> encoded_images_; |
118 std::vector<vpx_codec_ctx_t> encoders_; | 115 std::vector<vpx_codec_ctx_t> encoders_; |
119 std::vector<vpx_codec_enc_cfg_t> configurations_; | 116 std::vector<vpx_codec_enc_cfg_t> configurations_; |
120 std::vector<vpx_rational_t> downsampling_factors_; | 117 std::vector<vpx_rational_t> downsampling_factors_; |
121 }; // end of VP8EncoderImpl class | 118 }; |
122 | 119 |
123 class VP8DecoderImpl : public VP8Decoder { | 120 class VP8DecoderImpl : public VP8Decoder { |
124 public: | 121 public: |
125 VP8DecoderImpl(); | 122 VP8DecoderImpl(); |
126 | 123 |
127 virtual ~VP8DecoderImpl(); | 124 virtual ~VP8DecoderImpl(); |
128 | 125 |
129 int InitDecode(const VideoCodec* inst, int number_of_cores) override; | 126 int InitDecode(const VideoCodec* inst, int number_of_cores) override; |
130 | 127 |
131 int Decode(const EncodedImage& input_image, | 128 int Decode(const EncodedImage& input_image, |
132 bool missing_frames, | 129 bool missing_frames, |
133 const RTPFragmentationHeader* fragmentation, | 130 const RTPFragmentationHeader* fragmentation, |
134 const CodecSpecificInfo* codec_specific_info, | 131 const CodecSpecificInfo* codec_specific_info, |
135 int64_t /*render_time_ms*/) override; | 132 int64_t /*render_time_ms*/) override; |
136 | 133 |
137 int RegisterDecodeCompleteCallback(DecodedImageCallback* callback) override; | 134 int RegisterDecodeCompleteCallback(DecodedImageCallback* callback) override; |
138 int Release() override; | 135 int Release() override; |
139 | 136 |
140 const char* ImplementationName() const override; | 137 const char* ImplementationName() const override; |
141 | 138 |
142 private: | 139 private: |
143 // Copy reference image from this _decoder to the _decoder in copyTo. Set | |
144 // which frame type to copy in _refFrame->frame_type before the call to | |
145 // this function. | |
146 int CopyReference(VP8DecoderImpl* copy); | |
147 | |
148 int DecodePartitions(const EncodedImage& input_image, | |
149 const RTPFragmentationHeader* fragmentation); | |
150 | |
151 int ReturnFrame(const vpx_image_t* img, | 140 int ReturnFrame(const vpx_image_t* img, |
152 uint32_t timeStamp, | 141 uint32_t timeStamp, |
153 int64_t ntp_time_ms, | 142 int64_t ntp_time_ms, |
154 int qp); | 143 int qp); |
155 | 144 |
| 145 const bool use_postproc_arm_; |
| 146 |
156 I420BufferPool buffer_pool_; | 147 I420BufferPool buffer_pool_; |
157 DecodedImageCallback* decode_complete_callback_; | 148 DecodedImageCallback* decode_complete_callback_; |
158 bool inited_; | 149 bool inited_; |
159 bool feedback_mode_; | |
160 vpx_codec_ctx_t* decoder_; | 150 vpx_codec_ctx_t* decoder_; |
161 VideoCodec codec_; | |
162 int image_format_; | |
163 vpx_ref_frame_t* ref_frame_; | |
164 int propagation_cnt_; | 151 int propagation_cnt_; |
165 int last_frame_width_; | 152 int last_frame_width_; |
166 int last_frame_height_; | 153 int last_frame_height_; |
167 bool key_frame_required_; | 154 bool key_frame_required_; |
168 const bool use_postproc_arm_; | 155 }; |
169 }; // end of VP8DecoderImpl class | |
170 } // namespace webrtc | 156 } // namespace webrtc |
171 | 157 |
172 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_VP8_IMPL_H_ | 158 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_VP8_IMPL_H_ |
OLD | NEW |