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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // - src_frame : Pointer to a source frame. | 87 // - src_frame : Pointer to a source frame. |
88 // - 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). |
89 // - src_width : src width in pixels. | 89 // - src_width : src width in pixels. |
90 // - src_height : src height in pixels. | 90 // - src_height : src height in pixels. |
91 // - 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). |
92 // - rotate : Rotation mode of output image. | 92 // - rotate : Rotation mode of output image. |
93 // Output: | 93 // Output: |
94 // - dst_frame : Reference to a destination frame. | 94 // - dst_frame : Reference to a destination frame. |
95 // Return value: 0 if OK, < 0 otherwise. | 95 // Return value: 0 if OK, < 0 otherwise. |
96 | 96 |
97 // TODO(nisse): Deprecated, see | |
98 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5921. | |
99 int ConvertToI420(VideoType src_video_type, | 97 int ConvertToI420(VideoType src_video_type, |
100 const uint8_t* src_frame, | 98 const uint8_t* src_frame, |
101 int crop_x, | 99 int crop_x, |
102 int crop_y, | 100 int crop_y, |
103 int src_width, | 101 int src_width, |
104 int src_height, | 102 int src_height, |
105 size_t sample_size, | 103 size_t sample_size, |
106 VideoRotation rotation, | 104 VideoRotation rotation, |
107 VideoFrame* dst_frame); | 105 VideoFrame* dst_frame); |
108 | 106 |
109 // Convert From I420 | 107 // Convert From I420 |
110 // Input: | 108 // Input: |
111 // - src_frame : Reference to a source frame. | 109 // - src_frame : Reference to a source frame. |
112 // - dst_video_type : Type of output video. | 110 // - dst_video_type : Type of output video. |
113 // - dst_sample_size : Required only for the parsing of MJPG. | 111 // - dst_sample_size : Required only for the parsing of MJPG. |
114 // - dst_frame : Pointer to a destination frame. | 112 // - dst_frame : Pointer to a destination frame. |
115 // Return value: 0 if OK, < 0 otherwise. | 113 // Return value: 0 if OK, < 0 otherwise. |
116 // It is assumed that source and destination have equal height. | 114 // It is assumed that source and destination have equal height. |
117 int ConvertFromI420(const VideoFrame& src_frame, | 115 int ConvertFromI420(const VideoFrame& src_frame, |
118 VideoType dst_video_type, | 116 VideoType dst_video_type, |
119 int dst_sample_size, | 117 int dst_sample_size, |
120 uint8_t* dst_frame); | 118 uint8_t* dst_frame); |
121 | 119 |
122 // Compute PSNR for an I420 frame (all planes). | 120 // Compute PSNR for an I420 frame (all planes). |
123 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. | 121 // Returns the PSNR in decibel, to a maximum of kInfinitePSNR. |
124 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 122 double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
125 double I420PSNR(const VideoFrameBuffer& ref_buffer, | |
126 const VideoFrameBuffer& test_buffer); | |
127 | |
128 // Compute SSIM for an I420 frame (all planes). | 123 // Compute SSIM for an I420 frame (all planes). |
129 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); | 124 double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame); |
130 double I420SSIM(const VideoFrameBuffer& ref_buffer, | |
131 const VideoFrameBuffer& test_buffer); | |
132 | 125 |
133 } // namespace webrtc | 126 } // namespace webrtc |
134 | 127 |
135 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ | 128 #endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ |
OLD | NEW |