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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // TODO(mikhal): Add unit test for these two functions and determine location. | 63 // TODO(mikhal): Add unit test for these two functions and determine location. |
64 // Print VideoFrame to file | 64 // Print VideoFrame to file |
65 // Input: | 65 // Input: |
66 // - frame : Reference to video frame. | 66 // - frame : Reference to video frame. |
67 // - file : pointer to file object. It is assumed that the file is | 67 // - file : pointer to file object. It is assumed that the file is |
68 // already open for writing. | 68 // already open for writing. |
69 // Return value: 0 if OK, < 0 otherwise. | 69 // Return value: 0 if OK, < 0 otherwise. |
70 int PrintVideoFrame(const VideoFrame& frame, FILE* file); | 70 int PrintVideoFrame(const VideoFrame& frame, FILE* file); |
71 | 71 |
72 // Extract buffer from VideoFrame (consecutive planes, no stride) | 72 // Extract buffer from VideoFrame or VideoFrameBuffer (consecutive |
| 73 // planes, no stride) |
73 // Input: | 74 // Input: |
74 // - frame : Reference to video frame. | 75 // - frame : Reference to video frame. |
75 // - size : pointer to the size of the allocated buffer. If size is | 76 // - size : pointer to the size of the allocated buffer. If size is |
76 // insufficient, an error will be returned. | 77 // insufficient, an error will be returned. |
77 // - buffer : Pointer to buffer | 78 // - buffer : Pointer to buffer |
78 // Return value: length of buffer if OK, < 0 otherwise. | 79 // Return value: length of buffer if OK, < 0 otherwise. |
| 80 int ExtractBuffer(const rtc::scoped_refptr<VideoFrameBuffer>& input_frame, |
| 81 size_t size, |
| 82 uint8_t* buffer); |
79 int ExtractBuffer(const VideoFrame& input_frame, size_t size, uint8_t* buffer); | 83 int ExtractBuffer(const VideoFrame& input_frame, size_t size, uint8_t* buffer); |
80 // Convert To I420 | 84 // Convert To I420 |
81 // Input: | 85 // Input: |
82 // - src_video_type : Type of input video. | 86 // - src_video_type : Type of input video. |
83 // - src_frame : Pointer to a source frame. | 87 // - src_frame : Pointer to a source frame. |
84 // - crop_x/crop_y : Starting positions for cropping (0 for no crop). | 88 // - crop_x/crop_y : Starting positions for cropping (0 for no crop). |
85 // - src_width : src width in pixels. | 89 // - src_width : src width in pixels. |
86 // - src_height : src height in pixels. | 90 // - src_height : src height in pixels. |
87 // - sample_size : Required only for the parsing of MJPG (set to 0 else). | 91 // - sample_size : Required only for the parsing of MJPG (set to 0 else). |
88 // - rotate : Rotation mode of output image. | 92 // - rotate : Rotation mode of output image. |
(...skipping 26 matching lines...) Expand all Loading... |
115 | 119 |
116 // Compute PSNR for an I420 frame (all planes). | 120 // Compute PSNR for an I420 frame (all planes). |
117 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. | 121 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. |
118 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 122 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
119 // Compute SSIM for an I420 frame (all planes). | 123 // Compute SSIM for an I420 frame (all planes). |
120 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 124 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
121 | 125 |
122 } // namespace webrtc | 126 } // namespace webrtc |
123 | 127 |
124 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ | 128 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ |
OLD | NEW |