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 | 10 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 static_cast<int>(image.height()) != last_encoder_frame_height_) { | 328 static_cast<int>(image.height()) != last_encoder_frame_height_) { |
329 ++num_spatial_resizes_; | 329 ++num_spatial_resizes_; |
330 last_encoder_frame_width_ = image.width(); | 330 last_encoder_frame_width_ = image.width(); |
331 last_encoder_frame_height_ = image.height(); | 331 last_encoder_frame_height_ = image.height(); |
332 } | 332 } |
333 // Check if codec size is different from native/original size, and if so, | 333 // Check if codec size is different from native/original size, and if so, |
334 // upsample back to original size: needed for PSNR and SSIM computations. | 334 // upsample back to original size: needed for PSNR and SSIM computations. |
335 if (image.width() != config_.codec_settings->width || | 335 if (image.width() != config_.codec_settings->width || |
336 image.height() != config_.codec_settings->height) { | 336 image.height() != config_.codec_settings->height) { |
337 rtc::scoped_refptr<I420Buffer> up_image( | 337 rtc::scoped_refptr<I420Buffer> up_image( |
338 new rtc::RefCountedObject<I420Buffer>(config_.codec_settings->width, | 338 I420Buffer::Create(config_.codec_settings->width, |
339 config_.codec_settings->height)); | 339 config_.codec_settings->height)); |
340 | 340 |
341 // Should be the same aspect ratio, no cropping needed. | 341 // Should be the same aspect ratio, no cropping needed. |
342 up_image->ScaleFrom(image.video_frame_buffer()); | 342 up_image->ScaleFrom(image.video_frame_buffer()); |
343 | 343 |
344 // TODO(mikhal): Extracting the buffer for now - need to update test. | 344 // TODO(mikhal): Extracting the buffer for now - need to update test. |
345 size_t length = | 345 size_t length = |
346 CalcBufferSize(kI420, up_image->width(), up_image->height()); | 346 CalcBufferSize(kI420, up_image->width(), up_image->height()); |
347 std::unique_ptr<uint8_t[]> image_buffer(new uint8_t[length]); | 347 std::unique_ptr<uint8_t[]> image_buffer(new uint8_t[length]); |
348 int extracted_length = ExtractBuffer(up_image, length, image_buffer.get()); | 348 int extracted_length = ExtractBuffer(up_image, length, image_buffer.get()); |
349 assert(extracted_length > 0); | 349 assert(extracted_length > 0); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 } | 423 } |
424 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded( | 424 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded( |
425 VideoFrame& image) { | 425 VideoFrame& image) { |
426 // Forward to parent class. | 426 // Forward to parent class. |
427 video_processor_->FrameDecoded(image); | 427 video_processor_->FrameDecoded(image); |
428 return 0; | 428 return 0; |
429 } | 429 } |
430 | 430 |
431 } // namespace test | 431 } // namespace test |
432 } // namespace webrtc | 432 } // namespace webrtc |
OLD | NEW |