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