Opened 3 years ago

Closed 5 months ago

Last modified 5 months ago

#2382 closed enhancement (fixed)

Support for Rec. 2020

Reported by: kangstarr Owned by:
Priority: wish Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by richardpl)

UltraHD TV will be supporting Rec. 2020 so support in ffmpeg will need to be there.
http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-I!!PDF-E.pdf

UltraHD 4K and 8K (not to be confused with Film 4K/8K) will be supporting Rec. 2020.

Important key factors are:

Rec. 2020 defines the display resolution, frame rate, chroma subsampling, color depth and color space.
Below is a quick reference to Rec. 2020 UHDTV (taken from wikipedia: http://en.wikipedia.org/wiki/Rec._2020)

Rec. 2020 can reproduce colors that can not be shown with the Rec. 709 (HDTV) color space. In coverage of the CIE 1931 color space the Rec. 2020 color space covers 75.8%, digital cinema covers 53.6%, the Adobe RGB color space covers 52.1%, and Rec. 709 covers 35.9%

Resolutions
Rec. 2020 defines two resolutions:
4K (3840 * 2160)

  • Roughly equivalent to 4K cinema
  • 4 times the pixel resolution of 1080p.

8K (7680 * 4320)

  • Roughly equivalent to IMAX film
  • 16 times the pixel resolution of 1080p

Frame Rates
Rec. 2020 specifies the following frame rates: 120p, 60p, 59.94p, 50p, 30p, 29.97p, 25p, 24p, 23.976p (Note that only progressive formats are allowed. Interlaced video is a thing of the past).

Color Depth
Rec. 2020 defines a color depth of either 10-bits or 12-bits.

  • 10-bits per component Rec. 2020 uses video levels where the black level is defined as code 64 and the nominal peak is defined as code 940. Codes 0-3 and 1,020-1,023 are used for the timing reference. Codes 4 through 63 provide video data below the black level while codes 941 through 1,019 provide video data above the nominal peak.
  • 12-bits per component Rec. 2020 uses video levels where the black level is defined as code 256 and the nominal peak is defined as code 3760. Codes 0-15 and 4,080-4,095 are used for the timing reference. Codes 16 through 255 provide video data below the black level while codes 3,761 through 4,079 provide video data above the nominal peak.

Transfer Characteristics
Rec. 2020 defines the non-linear transfer function that can be used for gamma correction. 10-bits per component Rec. 2020 uses the same formula that is used by Rec. 709. 12-bits per component Rec. 2020 makes a single change in the formula in that the minimum point on a 0 to 1 light intensity range where the non-linear transfer function begins is raised from 0.018 to 0.0181. Both Rec. 2020 and Rec. 709 use Illuminant D65 for the white point.

Luma coefficients
Rec. 2020 specifies that if a luma (Y') signal is made that it uses the R'G'B' coefficients 0.2627, 0.6780, and 0.0593.

Change History (11)

comment:1 follow-up: Changed 3 years ago by cehoyos

  • Keywords Rec. 2020 BT.2020 removed
  • Priority changed from normal to wish

Could you clarify what about "Rec. 2020" is not supported by FFmpeg?
And please provide a sample.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 3 years ago by kangstarr

Replying to cehoyos:

Could you clarify what about "Rec. 2020" is not supported by FFmpeg?
And please provide a sample.

The same way Rec. 709 defines a color space which essentially puts boundaries on the color gamut, Rec. 2020 does the same thing but the gamut is much wider than Rec. 720.

The ability to convert between Rec. 2020 and Rec. 709 / Rec. 601 is needed. The same way ffmpeg currently supports converting from Rec. 709 to Rec. 601.

Also, ensuring that UltraHD TV resolutions (in 4K and 8K) are supported throughout all video filters is needed.

Last edited 3 years ago by kangstarr (previous) (diff)

comment:3 Changed 3 years ago by compn

we need 4k and 8k samples to make sure our filters, scalers and decoders can handle that as well. although i think we've tested with 4k png samples, it would be nice to have real world tests.

comment:4 in reply to: ↑ 2 Changed 3 years ago by cehoyos

Replying to kangstarr:

Also, ensuring that UltraHD TV resolutions (in 4K and 8K) are supported throughout all video filters is needed.

Could you elaborate? Do you have any indication that there is a filter failing for 4k or 8k?

comment:5 follow-up: Changed 3 years ago by kierank

FFmpeg doesn't support Rec. 2020 so by definition it cannot process UHDTV formats correctly (apart from when staying in YUV)

comment:6 in reply to: ↑ 5 Changed 3 years ago by cehoyos

Replying to kierank:

FFmpeg doesn't support Rec. 2020 so by definition it cannot process UHDTV formats correctly (apart from when staying in YUV)

It supports UHDTV RGB (and gray) fine here or do I misunderstand?

comment:7 Changed 3 years ago by _theman

The Rec.2020 standard defines new RGB<-->YUV matrix coefficients, RGB<-->R'G'B' transfer coefficients, and primaries. Support for these need to be implemented in SWScale to enable conversion between the Rec.2020 standard and the previous Rec.601 and Rec.709 standards. Additionally, Rec.2020 uses a 10-bit working precision (64-940 range) for the data format.

The important operations that need to be supported are:

  • 10-bit end-to-end operation for transcoding and filtering.
  • Color conversion (CMS) from Rec.2020 to sRGB/Rec.709 gamut. This implies support for:
  • * Gamut and gamma conversion through color management (CMS).
  • * New RGB/YUV matrices for RGB-->YUV conversion.
Version 0, edited 3 years ago by _theman (next)

comment:8 Changed 7 months ago by richardpl

  • Description modified (diff)

Supported by zscale filter.

comment:9 Changed 5 months ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

Supported by colorspace filter.

comment:10 Changed 5 months ago by cehoyos

Isn't it also necessary to fix this in libswscale?

comment:11 Changed 5 months ago by richardpl

We will need another trac server to handle all swscale bugs.

Note: See TracTickets for help on using tickets.