Chromium Code Reviews| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 | 78 |
| 79 // TODO(mikhal): Add unit test for these two functions and determine location. | 79 // TODO(mikhal): Add unit test for these two functions and determine location. |
| 80 // Print VideoFrame to file | 80 // Print VideoFrame to file |
| 81 // Input: | 81 // Input: |
| 82 // - frame : Reference to video frame. | 82 // - frame : Reference to video frame. |
| 83 // - file : pointer to file object. It is assumed that the file is | 83 // - file : pointer to file object. It is assumed that the file is |
| 84 // already open for writing. | 84 // already open for writing. |
| 85 // Return value: 0 if OK, < 0 otherwise. | 85 // Return value: 0 if OK, < 0 otherwise. |
| 86 int PrintVideoFrame(const VideoFrame& frame, FILE* file); | 86 int PrintVideoFrame(const VideoFrame& frame, FILE* file); |
| 87 | 87 |
| 88 // Extract buffer from VideoFrame (consecutive planes, no stride) | 88 // Extract buffer from VideoFrame or VideoFrameBuffer (consecutive |
| 89 // planes, no stride) | |
| 89 // Input: | 90 // Input: |
| 90 // - frame : Reference to video frame. | 91 // - frame : Reference to video frame. |
| 91 // - size : pointer to the size of the allocated buffer. If size is | 92 // - size : pointer to the size of the allocated buffer. If size is |
| 92 // insufficient, an error will be returned. | 93 // insufficient, an error will be returned. |
| 93 // - buffer : Pointer to buffer | 94 // - buffer : Pointer to buffer |
| 94 // Return value: length of buffer if OK, < 0 otherwise. | 95 // Return value: length of buffer if OK, < 0 otherwise. |
| 96 int ExtractBuffer(const rtc::scoped_refptr<VideoFrameBuffer>& input_frame, | |
|
pbos-webrtc
2016/05/31 14:14:01
const VideoFrameBuffer& src
| |
| 97 size_t size, | |
| 98 uint8_t* buffer); | |
| 95 int ExtractBuffer(const VideoFrame& input_frame, size_t size, uint8_t* buffer); | 99 int ExtractBuffer(const VideoFrame& input_frame, size_t size, uint8_t* buffer); |
| 96 // Convert To I420 | 100 // Convert To I420 |
| 97 // Input: | 101 // Input: |
| 98 // - src_video_type : Type of input video. | 102 // - src_video_type : Type of input video. |
| 99 // - src_frame : Pointer to a source frame. | 103 // - src_frame : Pointer to a source frame. |
| 100 // - crop_x/crop_y : Starting positions for cropping (0 for no crop). | 104 // - crop_x/crop_y : Starting positions for cropping (0 for no crop). |
| 101 // - src_width : src width in pixels. | 105 // - src_width : src width in pixels. |
| 102 // - src_height : src height in pixels. | 106 // - src_height : src height in pixels. |
| 103 // - sample_size : Required only for the parsing of MJPG (set to 0 else). | 107 // - sample_size : Required only for the parsing of MJPG (set to 0 else). |
| 104 // - rotate : Rotation mode of output image. | 108 // - rotate : Rotation mode of output image. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 | 153 |
| 150 // Compute PSNR for an I420 frame (all planes). | 154 // Compute PSNR for an I420 frame (all planes). |
| 151 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. | 155 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. |
| 152 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 156 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
| 153 // Compute SSIM for an I420 frame (all planes). | 157 // Compute SSIM for an I420 frame (all planes). |
| 154 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 158 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
| 155 | 159 |
| 156 } // namespace webrtc | 160 } // namespace webrtc |
| 157 | 161 |
| 158 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ | 162 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ |
| OLD | NEW |