yuv_rgb.h 1.3 KB

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