| 1 | #ifndef YUV_RGB_H_ |
| 2 | #define YUV_RGB_H_ |
| 3 | |
| 4 | // Copyright 2016 Adrien Descamps |
| 5 | // Distributed under BSD 3-Clause License |
| 6 | |
| 7 | // Provide optimized functions to convert images from 8bits yuv420 to rgb24 format |
| 8 | |
| 9 | // There are a few slightly different variations of the YCbCr color space with different parameters that |
| 10 | // change the conversion matrix. |
| 11 | // The three most common YCbCr color space, defined by BT.601, BT.709 and JPEG standard are implemented here. |
| 12 | // See the respective standards for details |
| 13 | // The matrix values used are derived from http://www.equasys.de/colorconversion.html |
| 14 | |
| 15 | // YUV420 is stored as three separate channels, with U and V (Cb and Cr) subsampled by a 2 factor |
| 16 | // For conversion from yuv to rgb, no interpolation is done, and the same UV value are used for 4 rgb pixels. This |
| 17 | // is suboptimal for image quality, but by far the fastest method. |
| 18 | |
| 19 | // For all methods, width and height should be even, if not, the last row/column of the result image won't be affected. |
| 20 | // For sse methods, if the width if not divisable by 32, the last (width%32) pixels of each line won't be affected. |
| 21 | |
| 22 | /*#include <stdint.h>*/ |
| 23 | |
| 24 | // yuv to rgb, standard c implementation |
| 25 | #include "yuv_rgb_std.h" |
| 26 | |
| 27 | // yuv to rgb, sse2 implementation |
| 28 | #include "yuv_rgb_sse.h" |
| 29 | |
| 30 | // yuv to rgb, lsx implementation |
| 31 | #include "yuv_rgb_lsx.h" |
| 32 | |
| 33 | #endif /* YUV_RGB_H_ */ |
| 34 | |