| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. | 127 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. |
| 128 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 128 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
| 129 double I420PSNR(const VideoFrameBuffer& ref_buffer, | 129 double I420PSNR(const VideoFrameBuffer& ref_buffer, |
| 130 const VideoFrameBuffer& test_buffer); | 130 const VideoFrameBuffer& test_buffer); |
| 131 | 131 |
| 132 // Compute SSIM for an I420 frame (all planes). | 132 // Compute SSIM for an I420 frame (all planes). |
| 133 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 133 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
| 134 double I420SSIM(const VideoFrameBuffer& ref_buffer, | 134 double I420SSIM(const VideoFrameBuffer& ref_buffer, |
| 135 const VideoFrameBuffer& test_buffer); | 135 const VideoFrameBuffer& test_buffer); |
| 136 | 136 |
| 137 // Helper function for scaling NV12 to NV12. |
| 138 void NV12Scale(std::vector<uint8_t>* tmp_buffer, |
| 139 const uint8_t* src_y, int src_stride_y, |
| 140 const uint8_t* src_uv, int src_stride_uv, |
| 141 int src_width, int src_height, |
| 142 uint8_t* dst_y, int dst_stride_y, |
| 143 uint8_t* dst_uv, int dst_stride_uv, |
| 144 int dst_width, int dst_height); |
| 145 |
| 137 // Helper class for directly converting and scaling NV12 to I420. The Y-plane | 146 // Helper class for directly converting and scaling NV12 to I420. The Y-plane |
| 138 // will be scaled directly to the I420 destination, which makes this faster | 147 // will be scaled directly to the I420 destination, which makes this faster |
| 139 // than separate NV12->I420 + I420->I420 scaling. | 148 // than separate NV12->I420 + I420->I420 scaling. |
| 140 class NV12ToI420Scaler { | 149 class NV12ToI420Scaler { |
| 141 public: | 150 public: |
| 142 void NV12ToI420Scale(const uint8_t* src_y, int src_stride_y, | 151 void NV12ToI420Scale(const uint8_t* src_y, int src_stride_y, |
| 143 const uint8_t* src_uv, int src_stride_uv, | 152 const uint8_t* src_uv, int src_stride_uv, |
| 144 int src_width, int src_height, | 153 int src_width, int src_height, |
| 145 uint8_t* dst_y, int dst_stride_y, | 154 uint8_t* dst_y, int dst_stride_y, |
| 146 uint8_t* dst_u, int dst_stride_u, | 155 uint8_t* dst_u, int dst_stride_u, |
| 147 uint8_t* dst_v, int dst_stride_v, | 156 uint8_t* dst_v, int dst_stride_v, |
| 148 int dst_width, int dst_height); | 157 int dst_width, int dst_height); |
| 149 private: | 158 private: |
| 150 std::vector<uint8_t> tmp_uv_planes_; | 159 std::vector<uint8_t> tmp_uv_planes_; |
| 151 }; | 160 }; |
| 152 | 161 |
| 153 } // namespace webrtc | 162 } // namespace webrtc |
| 154 | 163 |
| 155 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ | 164 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ |
| OLD | NEW |