How are we to use the color space encoder parameter? On the surface, it seems like it would just put a label in the bitstream, but then I notice if you set it to sRGB, write_bitdepth_colorspace_sampling() expects you use use profile 1, or 3, presumably with 4:4:4 sampling. Is it also expected to be RGB instead of YUV?
The YUV types are indeed just labels. The sRGB one is special as you point out, and the answer to each of the above questions is yes.In FFmpeg, we have assumed that the plane ordering of RGB input is GBR (i.e. "similar to" YCbCr), which is identical to how this (RGB colorspace substitution) works for other modern codecs. See also https://bugs.chromium.org/p/webm/issues/detail?id=1001
On Wednesday, November 11, 2015 at 3:37:27 AM UTC-8, rbultje wrote:The YUV types are indeed just labels. The sRGB one is special as you point out, and the answer to each of the above questions is yes.In FFmpeg, we have assumed that the plane ordering of RGB input is GBR (i.e. "similar to" YCbCr), which is identical to how this (RGB colorspace substitution) works for other modern codecs. See also https://bugs.chromium.org/p/webm/issues/detail?id=1001Aha, thanks for the info. So I guess the next question is: for sRGB color space, would you expect VPX_CR_FULL_RANGE to always be used? The comments for vpx_color_range_t seem to imply this.
For the RGB order, shouldn't we be looking to img->fmt? The type vpx_img_fmt_t has some RGB types, but none are GBR.
Are any browsers playing back RGB yet? Do any support VPX_CR_FULL_RANGE for YUV?
I don't think these mean the same thing. The encoder interface may certainly support multiple input formats, which are possibly converted before being handed to the encoder (or maybe it just gives an error). However, the codec internally only supports a small subset of image formats as listed in vpx_img_fmt_t. Don't forget nobody has ever encoded RGB content with vpxenc, so I'd really restrict myself to vpxdec or ffmpeg (with either the libvpx-vp9 or internal decoder). ffmpeg (with either decoder as backend) supports sRGB and returns it to the user with AV_PIX_FMT_GBRP (planar GBR).
I am not aware of any efforts to use RGB internally in the codec or
provide automatic conversion. What's the benefit of doing such
conversions? Within the codec my understanding is that separating
chroma and luma from the Y plane is very beneficial for motion search
in particular.