Subject: [Cellar] FFmpeg FFV1 decoder capabilities vs FFV1 specifications

From: Jerome Martinez <[email-masked]>
Date: Thu, 9 Jun 2016 23:11:42 +0200

I am checking FFV1 decoder capabilities, and I have some questions about 
it, especially because FFV1 specifications has no limitations about e.g. 
bit depth, subsampling.

At the end of the email there is list of inputs supported by FFmpeg FFV1 
decoder, from different bit depth, colorspace, chroma presence, alpha 
presence, and chroma subsampling (Horizontal and Vertical).
I tested all theoretical cases; I removed from the list some cases in 
order to have a smaller list:
- less than 8 bits: same as 8 bits
- more than 16 bits: not supported
- subsampling: I removed cases not from real world, not supported
- JPEG 2000 RCT: no subsampling supported (and spec has issues with it, 
see next email)

Questions:
- yuva411p is unsupported; looks like it is not in the list of pix_fmt 
in FFmpeg, despite the existence of yuva444p, yuva422p, yuva420p. Is it 
intended (no one interested in yuva411p in any video format)? Is it 
theoretically possible with FFV1?
- for YCbCr, no support of 11/12/13/14/15 bit depths. Is it 
theoretically possible with FFV1? Is it theoretically feasible in FFmpeg 
without adding new pix_fmt for the one supported in JPEG 2000 RCT? (e.g. 
mapping 14-bit YCbCr planar from FFV1 to FFmpeg gbrp14le pix_fmt)?
- for JPEG 2000 RCT, I understand that 11/13/15/16 bit depths are mapped 
to a 8-bit FFmpeg pix_fmt (e.g. bgr0), so with loss of data (decoding 
then re-encoding is not lossless). Do I understand wrong or is it a bug? 
Is it theoretically possible in FFV1?
- for JPEG 2000 RCT, I understand that 9/10/12/14 bit depths with alpha 
are mapped to a FFmpeg pix_fmt without alpha (e.g. AV_PIX_FMT_GBRP9 for 
9-bit with alpha), so with loss of data (decoding then re-encoding is 
not lossless). Do I understand wrong or is it a bug? Is it theoretically 
possible in FFV1?
- are bit depths more than 16-bit theoretically possible with FFV1?

bit depth | colorspace | chroma presence | alpha presence | H chroma 
subsampling | V chroma subsampling | FFmpeg pix_fmt
  8 bits | YCbCr | No chroma | No alpha |     |     | gray
  8 bits | YCbCr | No chroma |    Alpha |     |     | ya8
  8 bits | YCbCr |    Chroma | No alpha |     |     | yuv444p
  8 bits | YCbCr |    Chroma | No alpha | H/2 |     | yuv422p
  8 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 | yuv420p
  8 bits | YCbCr |    Chroma | No alpha | H/4 |     | yuv411p
  8 bits | YCbCr |    Chroma |    Alpha |     |     | yuva444p
  8 bits | YCbCr |    Chroma |    Alpha | H/2 |     | yuva422p
  8 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 | yuva420p
  8 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
  8 bits |   RCT | No chroma | No alpha |     |     | bgr0
  8 bits |   RCT | No chroma |    Alpha |     |     | bgra
  8 bits |   RCT |    Chroma | No alpha |     |     | bgr0
  8 bits |   RCT |    Chroma |    Alpha |     |     | bgra
  9 bits | YCbCr | No chroma | No alpha |     |     | gray16le
  9 bits | YCbCr | No chroma |    Alpha |     |     |
  9 bits | YCbCr |    Chroma | No alpha |     |     | yuv444p9le
  9 bits | YCbCr |    Chroma | No alpha | H/2 |     | yuv422p9le
  9 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 | yuv420p9le
  9 bits | YCbCr |    Chroma | No alpha | H/4 |     |
  9 bits | YCbCr |    Chroma |    Alpha |     |     | yuva444p9le
  9 bits | YCbCr |    Chroma |    Alpha | H/2 |     | yuva422p9le
  9 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 | yuva420p9le
  9 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
  9 bits |   RCT | No chroma | No alpha |     |     | gbrp9le
  9 bits |   RCT | No chroma |    Alpha |     |     | gbrp9le
  9 bits |   RCT |    Chroma | No alpha |     |     | gbrp9le
  9 bits |   RCT |    Chroma |    Alpha |     |     | gbrp9le
10 bits | YCbCr | No chroma | No alpha |     |     | gray16le
10 bits | YCbCr | No chroma |    Alpha |     |     |
10 bits | YCbCr |    Chroma | No alpha |     |     | yuv444p10le
10 bits | YCbCr |    Chroma | No alpha | H/2 |     | yuv422p10le
10 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 | yuv420p10le
10 bits | YCbCr |    Chroma | No alpha | H/4 |     |
10 bits | YCbCr |    Chroma |    Alpha |     |     | yuva444p10le
10 bits | YCbCr |    Chroma |    Alpha | H/2 |     | yuva422p10le
10 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 | yuva420p10le
10 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
10 bits |   RCT | No chroma | No alpha |     |     | gbrp10le
10 bits |   RCT | No chroma |    Alpha |     |     | gbrp10le
10 bits |   RCT |    Chroma | No alpha |     |     | gbrp10le
10 bits |   RCT |    Chroma |    Alpha |     |     | gbrp10le
11 bits | YCbCr | No chroma | No alpha |     |     | gray16le
11 bits | YCbCr | No chroma |    Alpha |     |     |
11 bits | YCbCr |    Chroma | No alpha |     |     |
11 bits | YCbCr |    Chroma | No alpha | H/2 |     |
11 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 |
11 bits | YCbCr |    Chroma | No alpha | H/4 |     |
11 bits | YCbCr |    Chroma |    Alpha |     |     |
11 bits | YCbCr |    Chroma |    Alpha | H/2 |     |
11 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 |
11 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
11 bits |   RCT | No chroma | No alpha |     |     | bgr0
11 bits |   RCT | No chroma |    Alpha |     |     | bgra
11 bits |   RCT |    Chroma | No alpha |     |     | bgr0
11 bits |   RCT |    Chroma |    Alpha |     |     | bgra
12 bits | YCbCr | No chroma | No alpha |     |     | gray16le
12 bits | YCbCr | No chroma |    Alpha |     |     |
12 bits | YCbCr |    Chroma | No alpha |     |     |
12 bits | YCbCr |    Chroma | No alpha | H/2 |     |
12 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 |
12 bits | YCbCr |    Chroma | No alpha | H/4 |     |
12 bits | YCbCr |    Chroma |    Alpha |     |     |
12 bits | YCbCr |    Chroma |    Alpha | H/2 |     |
12 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 |
12 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
12 bits |   RCT | No chroma | No alpha |     |     | gbrp12le
12 bits |   RCT | No chroma |    Alpha |     |     | gbrp12le
12 bits |   RCT |    Chroma | No alpha |     |     | gbrp12le
12 bits |   RCT |    Chroma |    Alpha |     |     | gbrp12le
13 bits | YCbCr | No chroma | No alpha |     |     | gray16le
13 bits | YCbCr | No chroma |    Alpha |     |     |
13 bits | YCbCr |    Chroma | No alpha |     |     |
13 bits | YCbCr |    Chroma | No alpha | H/2 |     |
13 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 |
13 bits | YCbCr |    Chroma | No alpha | H/4 |     |
13 bits | YCbCr |    Chroma |    Alpha |     |     |
13 bits | YCbCr |    Chroma |    Alpha | H/2 |     |
13 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 |
13 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
13 bits |   RCT | No chroma | No alpha |     |     | bgr0
13 bits |   RCT | No chroma |    Alpha |     |     | bgra
13 bits |   RCT |    Chroma | No alpha |     |     | bgr0
13 bits |   RCT |    Chroma |    Alpha |     |     | bgra
14 bits | YCbCr | No chroma | No alpha |     |     | gray16le
14 bits | YCbCr | No chroma |    Alpha |     |     |
14 bits | YCbCr |    Chroma | No alpha |     |     |
14 bits | YCbCr |    Chroma | No alpha | H/2 |     |
14 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 |
14 bits | YCbCr |    Chroma | No alpha | H/4 |     |
14 bits | YCbCr |    Chroma |    Alpha |     |     |
14 bits | YCbCr |    Chroma |    Alpha | H/2 |     |
14 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 |
14 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
14 bits |   RCT | No chroma | No alpha |     |     | gbrp14le
14 bits |   RCT | No chroma |    Alpha |     |     | gbrp14le
14 bits |   RCT |    Chroma | No alpha |     |     | gbrp14le
14 bits |   RCT |    Chroma |    Alpha |     |     | gbrp14le
15 bits | YCbCr | No chroma | No alpha |     |     | gray16le
15 bits | YCbCr | No chroma |    Alpha |     |     |
15 bits | YCbCr |    Chroma | No alpha |     |     |
15 bits | YCbCr |    Chroma | No alpha | H/2 |     |
15 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 |
15 bits | YCbCr |    Chroma | No alpha | H/4 |     |
15 bits | YCbCr |    Chroma |    Alpha |     |     |
15 bits | YCbCr |    Chroma |    Alpha | H/2 |     |
15 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 |
15 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
15 bits |   RCT | No chroma | No alpha |     |     | bgr0
15 bits |   RCT | No chroma |    Alpha |     |     | bgra
15 bits |   RCT |    Chroma | No alpha |     |     | bgr0
15 bits |   RCT |    Chroma |    Alpha |     |     | bgra
16 bits | YCbCr | No chroma | No alpha |     |     | gray16le
16 bits | YCbCr | No chroma |    Alpha |     |     |
16 bits | YCbCr |    Chroma | No alpha |     |     | yuv444p16le
16 bits | YCbCr |    Chroma | No alpha | H/2 |     | yuv422p16le
16 bits | YCbCr |    Chroma | No alpha | H/2 | V/2 | yuv420p16le
16 bits | YCbCr |    Chroma | No alpha | H/4 |     |
16 bits | YCbCr |    Chroma |    Alpha |     |     | yuva444p16le
16 bits | YCbCr |    Chroma |    Alpha | H/2 |     | yuva422p16le
16 bits | YCbCr |    Chroma |    Alpha | H/2 | V/2 | yuva420p16le
16 bits | YCbCr |    Chroma |    Alpha | H/4 |     |
16 bits |   RCT | No chroma | No alpha |     |     | bgr0
16 bits |   RCT | No chroma |    Alpha |     |     | bgra
16 bits |   RCT |    Chroma | No alpha |     |     | bgr0
16 bits |   RCT |    Chroma |    Alpha |     |     | bgra

---

From: Michael Niedermayer <[email-masked]>
Date: Sat, 11 Jun 2016 22:36:30 +0200

On Thu, Jun 09, 2016 at 11:11:42PM +0200, Jerome Martinez wrote:
> I am checking FFV1 decoder capabilities, and I have some questions
> about it, especially because FFV1 specifications has no limitations
> about e.g. bit depth, subsampling.
> 
> At the end of the email there is list of inputs supported by FFmpeg
> FFV1 decoder, from different bit depth, colorspace, chroma presence,
> alpha presence, and chroma subsampling (Horizontal and Vertical).
> I tested all theoretical cases; I removed from the list some cases
> in order to have a smaller list:
> - JPEG 2000 RCT: no subsampling supported (and spec has issues with
> it, see next email)
> 
> Questions:
> - yuva411p is unsupported; looks like it is not in the list of
> pix_fmt in FFmpeg, despite the existence of yuva444p, yuva422p,
> yuva420p. Is it intended (no one interested in yuva411p in any video
> format)? Is it theoretically possible with FFV1?

i see nothing special on yuva411p, so it shoud be fine

> theoretically possible with FFV1? Is it theoretically feasible in

i dont see why it wouldnt work

> FFmpeg without adding new pix_fmt for the one supported in JPEG 2000
> RCT? (e.g. mapping 14-bit YCbCr planar from FFV1 to FFmpeg gbrp14le
> pix_fmt)?

i dont understand the question

> - for JPEG 2000 RCT, I understand that 11/13/15/16 bit depths are
> mapped to a 8-bit FFmpeg pix_fmt (e.g. bgr0), so with loss of data
> (decoding then re-encoding is not lossless). Do I understand wrong
> or is it a bug? Is it theoretically possible in FFV1?

sounds like a bug / implementation limitation

> - for JPEG 2000 RCT, I understand that 9/10/12/14 bit depths with
> alpha are mapped to a FFmpeg pix_fmt without alpha (e.g.
> AV_PIX_FMT_GBRP9 for 9-bit with alpha), so with loss of data
> (decoding then re-encoding is not lossless). Do I understand wrong
> or is it a bug? Is it theoretically possible in FFV1?

sounds like a bug / implementation limitation

> - are bit depths more than 16-bit theoretically possible with FFV1?

i think so

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates