Commit 885a9d60 authored by Jan Ekström's avatar Jan Ekström Committed by Luca Barbato

pgssub: Fix subpicture colorspace and range

Widen the values from limited to full range and use BT.709 where it
should be used according to the video resolution:

SD is BT.601, HD is BT.709

Default to BT.709 due to most observed HDMV content being HD.
parent 1f77e634
...@@ -351,8 +351,14 @@ static int parse_palette_segment(AVCodecContext *avctx, ...@@ -351,8 +351,14 @@ static int parse_palette_segment(AVCodecContext *avctx,
cb = bytestream_get_byte(&buf); cb = bytestream_get_byte(&buf);
alpha = bytestream_get_byte(&buf); alpha = bytestream_get_byte(&buf);
YUV_TO_RGB1(cb, cr); /* Default to BT.709 colorspace. In case of <= 576 height use BT.601 */
YUV_TO_RGB2(r, g, b, y); if (avctx->height <= 0 || avctx->height > 576) {
YUV_TO_RGB1_CCIR_BT709(cb, cr);
} else {
YUV_TO_RGB1_CCIR(cb, cr);
}
YUV_TO_RGB2_CCIR(r, g, b, y);
ff_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha); ff_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment