Changeset 5633 for pjproject/trunk/third_party/yuv/include/libyuv/convert.h
- Timestamp:
- Jul 28, 2017 2:51:44 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/third_party/yuv/include/libyuv/convert.h
r5358 r5633 9 9 */ 10 10 11 #ifndef INCLUDE_LIBYUV_CONVERT_H_ // NOLINT11 #ifndef INCLUDE_LIBYUV_CONVERT_H_ 12 12 #define INCLUDE_LIBYUV_CONVERT_H_ 13 13 … … 15 15 16 16 #include "libyuv/rotate.h" // For enum RotationMode. 17 18 // TODO(fbarchard): fix WebRTC source to include following libyuv headers: 19 #include "libyuv/convert_argb.h" // For WebRTC I420ToARGB. b/620 20 #include "libyuv/convert_from.h" // For WebRTC ConvertFromI420. b/620 21 #include "libyuv/planar_functions.h" // For WebRTC I420Rect, CopyPlane. b/618 17 22 18 23 #ifdef __cplusplus … … 23 28 // Convert I444 to I420. 24 29 LIBYUV_API 25 int I444ToI420(const uint8* src_y, int src_stride_y, 26 const uint8* src_u, int src_stride_u, 27 const uint8* src_v, int src_stride_v, 28 uint8* dst_y, int dst_stride_y, 29 uint8* dst_u, int dst_stride_u, 30 uint8* dst_v, int dst_stride_v, 31 int width, int height); 30 int I444ToI420(const uint8* src_y, 31 int src_stride_y, 32 const uint8* src_u, 33 int src_stride_u, 34 const uint8* src_v, 35 int src_stride_v, 36 uint8* dst_y, 37 int dst_stride_y, 38 uint8* dst_u, 39 int dst_stride_u, 40 uint8* dst_v, 41 int dst_stride_v, 42 int width, 43 int height); 32 44 33 45 // Convert I422 to I420. 34 46 LIBYUV_API 35 int I422ToI420(const uint8* src_y, int src_stride_y, 36 const uint8* src_u, int src_stride_u, 37 const uint8* src_v, int src_stride_v, 38 uint8* dst_y, int dst_stride_y, 39 uint8* dst_u, int dst_stride_u, 40 uint8* dst_v, int dst_stride_v, 41 int width, int height); 42 43 // Convert I411 to I420. 44 LIBYUV_API 45 int I411ToI420(const uint8* src_y, int src_stride_y, 46 const uint8* src_u, int src_stride_u, 47 const uint8* src_v, int src_stride_v, 48 uint8* dst_y, int dst_stride_y, 49 uint8* dst_u, int dst_stride_u, 50 uint8* dst_v, int dst_stride_v, 51 int width, int height); 47 int I422ToI420(const uint8* src_y, 48 int src_stride_y, 49 const uint8* src_u, 50 int src_stride_u, 51 const uint8* src_v, 52 int src_stride_v, 53 uint8* dst_y, 54 int dst_stride_y, 55 uint8* dst_u, 56 int dst_stride_u, 57 uint8* dst_v, 58 int dst_stride_v, 59 int width, 60 int height); 52 61 53 62 // Copy I420 to I420. 54 63 #define I420ToI420 I420Copy 55 64 LIBYUV_API 56 int I420Copy(const uint8* src_y, int src_stride_y, 57 const uint8* src_u, int src_stride_u, 58 const uint8* src_v, int src_stride_v, 59 uint8* dst_y, int dst_stride_y, 60 uint8* dst_u, int dst_stride_u, 61 uint8* dst_v, int dst_stride_v, 62 int width, int height); 65 int I420Copy(const uint8* src_y, 66 int src_stride_y, 67 const uint8* src_u, 68 int src_stride_u, 69 const uint8* src_v, 70 int src_stride_v, 71 uint8* dst_y, 72 int dst_stride_y, 73 uint8* dst_u, 74 int dst_stride_u, 75 uint8* dst_v, 76 int dst_stride_v, 77 int width, 78 int height); 63 79 64 80 // Convert I400 (grey) to I420. 65 81 LIBYUV_API 66 int I400ToI420(const uint8* src_y, int src_stride_y, 67 uint8* dst_y, int dst_stride_y, 68 uint8* dst_u, int dst_stride_u, 69 uint8* dst_v, int dst_stride_v, 70 int width, int height); 82 int I400ToI420(const uint8* src_y, 83 int src_stride_y, 84 uint8* dst_y, 85 int dst_stride_y, 86 uint8* dst_u, 87 int dst_stride_u, 88 uint8* dst_v, 89 int dst_stride_v, 90 int width, 91 int height); 71 92 72 93 #define J400ToJ420 I400ToI420 … … 74 95 // Convert NV12 to I420. 75 96 LIBYUV_API 76 int NV12ToI420(const uint8* src_y, int src_stride_y, 77 const uint8* src_uv, int src_stride_uv, 78 uint8* dst_y, int dst_stride_y, 79 uint8* dst_u, int dst_stride_u, 80 uint8* dst_v, int dst_stride_v, 81 int width, int height); 97 int NV12ToI420(const uint8* src_y, 98 int src_stride_y, 99 const uint8* src_uv, 100 int src_stride_uv, 101 uint8* dst_y, 102 int dst_stride_y, 103 uint8* dst_u, 104 int dst_stride_u, 105 uint8* dst_v, 106 int dst_stride_v, 107 int width, 108 int height); 82 109 83 110 // Convert NV21 to I420. 84 111 LIBYUV_API 85 int NV21ToI420(const uint8* src_y, int src_stride_y, 86 const uint8* src_vu, int src_stride_vu, 87 uint8* dst_y, int dst_stride_y, 88 uint8* dst_u, int dst_stride_u, 89 uint8* dst_v, int dst_stride_v, 90 int width, int height); 112 int NV21ToI420(const uint8* src_y, 113 int src_stride_y, 114 const uint8* src_vu, 115 int src_stride_vu, 116 uint8* dst_y, 117 int dst_stride_y, 118 uint8* dst_u, 119 int dst_stride_u, 120 uint8* dst_v, 121 int dst_stride_v, 122 int width, 123 int height); 91 124 92 125 // Convert YUY2 to I420. 93 126 LIBYUV_API 94 int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2, 95 uint8* dst_y, int dst_stride_y, 96 uint8* dst_u, int dst_stride_u, 97 uint8* dst_v, int dst_stride_v, 98 int width, int height); 127 int YUY2ToI420(const uint8* src_yuy2, 128 int src_stride_yuy2, 129 uint8* dst_y, 130 int dst_stride_y, 131 uint8* dst_u, 132 int dst_stride_u, 133 uint8* dst_v, 134 int dst_stride_v, 135 int width, 136 int height); 99 137 100 138 // Convert UYVY to I420. 101 139 LIBYUV_API 102 int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy, 103 uint8* dst_y, int dst_stride_y, 104 uint8* dst_u, int dst_stride_u, 105 uint8* dst_v, int dst_stride_v, 106 int width, int height); 140 int UYVYToI420(const uint8* src_uyvy, 141 int src_stride_uyvy, 142 uint8* dst_y, 143 int dst_stride_y, 144 uint8* dst_u, 145 int dst_stride_u, 146 uint8* dst_v, 147 int dst_stride_v, 148 int width, 149 int height); 107 150 108 151 // Convert M420 to I420. 109 152 LIBYUV_API 110 int M420ToI420(const uint8* src_m420, int src_stride_m420, 111 uint8* dst_y, int dst_stride_y, 112 uint8* dst_u, int dst_stride_u, 113 uint8* dst_v, int dst_stride_v, 114 int width, int height); 153 int M420ToI420(const uint8* src_m420, 154 int src_stride_m420, 155 uint8* dst_y, 156 int dst_stride_y, 157 uint8* dst_u, 158 int dst_stride_u, 159 uint8* dst_v, 160 int dst_stride_v, 161 int width, 162 int height); 163 164 // Convert Android420 to I420. 165 LIBYUV_API 166 int Android420ToI420(const uint8* src_y, 167 int src_stride_y, 168 const uint8* src_u, 169 int src_stride_u, 170 const uint8* src_v, 171 int src_stride_v, 172 int pixel_stride_uv, 173 uint8* dst_y, 174 int dst_stride_y, 175 uint8* dst_u, 176 int dst_stride_u, 177 uint8* dst_v, 178 int dst_stride_v, 179 int width, 180 int height); 115 181 116 182 // ARGB little endian (bgra in memory) to I420. 117 183 LIBYUV_API 118 int ARGBToI420(const uint8* src_frame, int src_stride_frame, 119 uint8* dst_y, int dst_stride_y, 120 uint8* dst_u, int dst_stride_u, 121 uint8* dst_v, int dst_stride_v, 122 int width, int height); 184 int ARGBToI420(const uint8* src_frame, 185 int src_stride_frame, 186 uint8* dst_y, 187 int dst_stride_y, 188 uint8* dst_u, 189 int dst_stride_u, 190 uint8* dst_v, 191 int dst_stride_v, 192 int width, 193 int height); 123 194 124 195 // BGRA little endian (argb in memory) to I420. 125 196 LIBYUV_API 126 int BGRAToI420(const uint8* src_frame, int src_stride_frame, 127 uint8* dst_y, int dst_stride_y, 128 uint8* dst_u, int dst_stride_u, 129 uint8* dst_v, int dst_stride_v, 130 int width, int height); 197 int BGRAToI420(const uint8* src_frame, 198 int src_stride_frame, 199 uint8* dst_y, 200 int dst_stride_y, 201 uint8* dst_u, 202 int dst_stride_u, 203 uint8* dst_v, 204 int dst_stride_v, 205 int width, 206 int height); 131 207 132 208 // ABGR little endian (rgba in memory) to I420. 133 209 LIBYUV_API 134 int ABGRToI420(const uint8* src_frame, int src_stride_frame, 135 uint8* dst_y, int dst_stride_y, 136 uint8* dst_u, int dst_stride_u, 137 uint8* dst_v, int dst_stride_v, 138 int width, int height); 210 int ABGRToI420(const uint8* src_frame, 211 int src_stride_frame, 212 uint8* dst_y, 213 int dst_stride_y, 214 uint8* dst_u, 215 int dst_stride_u, 216 uint8* dst_v, 217 int dst_stride_v, 218 int width, 219 int height); 139 220 140 221 // RGBA little endian (abgr in memory) to I420. 141 222 LIBYUV_API 142 int RGBAToI420(const uint8* src_frame, int src_stride_frame, 143 uint8* dst_y, int dst_stride_y, 144 uint8* dst_u, int dst_stride_u, 145 uint8* dst_v, int dst_stride_v, 146 int width, int height); 223 int RGBAToI420(const uint8* src_frame, 224 int src_stride_frame, 225 uint8* dst_y, 226 int dst_stride_y, 227 uint8* dst_u, 228 int dst_stride_u, 229 uint8* dst_v, 230 int dst_stride_v, 231 int width, 232 int height); 147 233 148 234 // RGB little endian (bgr in memory) to I420. 149 235 LIBYUV_API 150 int RGB24ToI420(const uint8* src_frame, int src_stride_frame, 151 uint8* dst_y, int dst_stride_y, 152 uint8* dst_u, int dst_stride_u, 153 uint8* dst_v, int dst_stride_v, 154 int width, int height); 236 int RGB24ToI420(const uint8* src_frame, 237 int src_stride_frame, 238 uint8* dst_y, 239 int dst_stride_y, 240 uint8* dst_u, 241 int dst_stride_u, 242 uint8* dst_v, 243 int dst_stride_v, 244 int width, 245 int height); 155 246 156 247 // RGB big endian (rgb in memory) to I420. 157 248 LIBYUV_API 158 int RAWToI420(const uint8* src_frame, int src_stride_frame, 159 uint8* dst_y, int dst_stride_y, 160 uint8* dst_u, int dst_stride_u, 161 uint8* dst_v, int dst_stride_v, 162 int width, int height); 249 int RAWToI420(const uint8* src_frame, 250 int src_stride_frame, 251 uint8* dst_y, 252 int dst_stride_y, 253 uint8* dst_u, 254 int dst_stride_u, 255 uint8* dst_v, 256 int dst_stride_v, 257 int width, 258 int height); 163 259 164 260 // RGB16 (RGBP fourcc) little endian to I420. 165 261 LIBYUV_API 166 int RGB565ToI420(const uint8* src_frame, int src_stride_frame, 167 uint8* dst_y, int dst_stride_y, 168 uint8* dst_u, int dst_stride_u, 169 uint8* dst_v, int dst_stride_v, 170 int width, int height); 262 int RGB565ToI420(const uint8* src_frame, 263 int src_stride_frame, 264 uint8* dst_y, 265 int dst_stride_y, 266 uint8* dst_u, 267 int dst_stride_u, 268 uint8* dst_v, 269 int dst_stride_v, 270 int width, 271 int height); 171 272 172 273 // RGB15 (RGBO fourcc) little endian to I420. 173 274 LIBYUV_API 174 int ARGB1555ToI420(const uint8* src_frame, int src_stride_frame, 175 uint8* dst_y, int dst_stride_y, 176 uint8* dst_u, int dst_stride_u, 177 uint8* dst_v, int dst_stride_v, 178 int width, int height); 275 int ARGB1555ToI420(const uint8* src_frame, 276 int src_stride_frame, 277 uint8* dst_y, 278 int dst_stride_y, 279 uint8* dst_u, 280 int dst_stride_u, 281 uint8* dst_v, 282 int dst_stride_v, 283 int width, 284 int height); 179 285 180 286 // RGB12 (R444 fourcc) little endian to I420. 181 287 LIBYUV_API 182 int ARGB4444ToI420(const uint8* src_frame, int src_stride_frame, 183 uint8* dst_y, int dst_stride_y, 184 uint8* dst_u, int dst_stride_u, 185 uint8* dst_v, int dst_stride_v, 186 int width, int height); 288 int ARGB4444ToI420(const uint8* src_frame, 289 int src_stride_frame, 290 uint8* dst_y, 291 int dst_stride_y, 292 uint8* dst_u, 293 int dst_stride_u, 294 uint8* dst_v, 295 int dst_stride_v, 296 int width, 297 int height); 187 298 188 299 #ifdef HAVE_JPEG … … 190 301 // dst_width/height for clipping determine final size. 191 302 LIBYUV_API 192 int MJPGToI420(const uint8* sample, size_t sample_size, 193 uint8* dst_y, int dst_stride_y, 194 uint8* dst_u, int dst_stride_u, 195 uint8* dst_v, int dst_stride_v, 196 int src_width, int src_height, 197 int dst_width, int dst_height); 303 int MJPGToI420(const uint8* sample, 304 size_t sample_size, 305 uint8* dst_y, 306 int dst_stride_y, 307 uint8* dst_u, 308 int dst_stride_u, 309 uint8* dst_v, 310 int dst_stride_v, 311 int src_width, 312 int src_height, 313 int dst_width, 314 int dst_height); 198 315 199 316 // Query size of MJPG in pixels. 200 317 LIBYUV_API 201 int MJPGSize(const uint8* sample, size_t sample_size, 202 int* width, int* height); 318 int MJPGSize(const uint8* sample, size_t sample_size, int* width, int* height); 203 319 #endif 204 320 … … 226 342 // Returns 0 for successful; -1 for invalid parameter. Non-zero for failure. 227 343 LIBYUV_API 228 int ConvertToI420(const uint8* src_frame, size_t src_size, 229 uint8* dst_y, int dst_stride_y, 230 uint8* dst_u, int dst_stride_u, 231 uint8* dst_v, int dst_stride_v, 232 int crop_x, int crop_y, 233 int src_width, int src_height, 234 int crop_width, int crop_height, 344 int ConvertToI420(const uint8* src_frame, 345 size_t src_size, 346 uint8* dst_y, 347 int dst_stride_y, 348 uint8* dst_u, 349 int dst_stride_u, 350 uint8* dst_v, 351 int dst_stride_v, 352 int crop_x, 353 int crop_y, 354 int src_width, 355 int src_height, 356 int crop_width, 357 int crop_height, 235 358 enum RotationMode rotation, 236 359 uint32 format); … … 241 364 #endif 242 365 243 #endif // INCLUDE_LIBYUV_CONVERT_H_ NOLINT366 #endif // INCLUDE_LIBYUV_CONVERT_H_
Note: See TracChangeset
for help on using the changeset viewer.