projects
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9dffdc
)
pgssub: Fix subpicture colorspace and range
author
Jan Ekström
<jeebjp@gmail.com>
Sun, 24 Apr 2016 18:33:45 +0000
(20:33 +0200)
committer
Sean McGovern
<gseanmcg@gmail.com>
Tue, 24 May 2016 22:44:11 +0000
(18:44 -0400)
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.
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
libavcodec/pgssubdec.c
patch
|
blob
|
blame
|
history
diff --git
a/libavcodec/pgssubdec.c
b/libavcodec/pgssubdec.c
index
6217c40
..
37f1096
100644
(file)
--- a/
libavcodec/pgssubdec.c
+++ b/
libavcodec/pgssubdec.c
@@
-351,8
+351,14
@@
static int parse_palette_segment(AVCodecContext *avctx,
cb = bytestream_get_byte(&buf);
alpha = bytestream_get_byte(&buf);
- YUV_TO_RGB1(cb, cr);
- YUV_TO_RGB2(r, g, b, y);
+ /* Default to BT.709 colorspace. In case of <= 576 height use BT.601 */
+ 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);
av_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);