mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
yuv2rgb: Document the color space coefficients
Based on the original documentation found in mpeg2dec (1995). Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
parent
acd37069ae
commit
ff8c2c4103
@ -35,6 +35,17 @@
|
||||
#include "swscale_internal.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
|
||||
/* Color space conversion coefficients for YCbCr -> RGB mapping.
|
||||
*
|
||||
* Entries are {crv, cbu, cgu, cgv}
|
||||
*
|
||||
* crv = (255 / 224) * 65536 * (1 - cr) / 0.5
|
||||
* cbu = (255 / 224) * 65536 * (1 - cb) / 0.5
|
||||
* cgu = (255 / 224) * 65536 * (cb / cg) * (1 - cb) / 0.5
|
||||
* cgv = (255 / 224) * 65536 * (cr / cg) * (1 - cr) / 0.5
|
||||
*
|
||||
* where Y = cr * R + cg * G + cb * B and cr + cg + cb = 1.
|
||||
*/
|
||||
const int32_t ff_yuv2rgb_coeffs[8][4] = {
|
||||
{ 117504, 138453, 13954, 34903 }, /* no sequence_display_extension */
|
||||
{ 117504, 138453, 13954, 34903 }, /* ITU-R Rec. 709 (1990) */
|
||||
|
Loading…
Reference in New Issue
Block a user