[FFmpeg-devel] [PATCH] swscale: add bt2020 yuv2rgb coefficients.
Michael Niedermayer
michael at niedermayer.cc
Thu Mar 31 20:46:44 CEST 2016
On Thu, Mar 31, 2016 at 02:29:12PM -0400, Ronald S. Bultje wrote:
> Also fix the bt709 ones. They seem derived from incorrect values
> cr=0.2125 (should be cr=0.2126) and cb=0.0721 (should be cb=0.0722).
> ---
> libswscale/swscale.h | 1 +
> libswscale/yuv2rgb.c | 13 ++++++++-----
> 2 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/libswscale/swscale.h b/libswscale/swscale.h
> index da9dd2e..6b8b926 100644
> --- a/libswscale/swscale.h
> +++ b/libswscale/swscale.h
> @@ -91,6 +91,7 @@ const char *swscale_license(void);
> #define SWS_CS_SMPTE170M 5
> #define SWS_CS_SMPTE240M 7
> #define SWS_CS_DEFAULT 5
> +#define SWS_CS_BT2020 9
>
> /**
> * Return a pointer to yuv<->rgb coefficients for the given colorspace
> diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
> index 62abb7d..1fe5abe 100644
> --- a/libswscale/yuv2rgb.c
> +++ b/libswscale/yuv2rgb.c
> @@ -46,20 +46,23 @@
> *
> * 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) */
> +const int32_t ff_yuv2rgb_coeffs[11][4] = {
missing update to libswscale/swscale_internal.h
libswscale/yuv2rgb.c:49:15: error: conflicting types for ‘ff_yuv2rgb_coeffs’
libswscale/swscale_internal.h:869:22: note: previous declaration of ‘ff_yuv2rgb_coeffs’ was here
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160331/d509a1d2/attachment.sig>
More information about the ffmpeg-devel
mailing list