hevc_ps: Use AV_PIX_FMT_YUVJ420P if YUV 4:2:0 8-bit full scale
authorYusuke Nakamura <muken.the.vfrmaniac@gmail.com>
Sun, 3 Nov 2013 18:47:31 +0000 (18:47 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 4 Nov 2013 15:19:53 +0000 (16:19 +0100)
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavcodec/hevc_ps.c

index 9c0d0ee..402c16f 100644 (file)
@@ -449,6 +449,8 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
         vui->video_format                    = get_bits(gb, 3);
         vui->video_full_range_flag           = get_bits1(gb);
         vui->colour_description_present_flag = get_bits1(gb);
+        if (vui->video_full_range_flag && sps->pix_fmt == AV_PIX_FMT_YUV420P)
+            sps->pix_fmt = AV_PIX_FMT_YUVJ420P;
         if (vui->colour_description_present_flag) {
             vui->colour_primaries        = get_bits(gb, 8);
             vui->transfer_characteristic = get_bits(gb, 8);