[libav-devel] [PATCH] hevc_ps: Use AV_PIX_FMT_YUVJ420P if YUV 4:2:0 8-bit full scale.

wm4 nfxjfg at googlemail.com
Mon Nov 4 20:57:11 CET 2013


On Mon, 4 Nov 2013 11:55:02 +0100
Vittorio Giovara <vittorio.giovara at gmail.com> wrote:

> On Sun, Nov 3, 2013 at 8:47 PM, Yusuke Nakamura
> <muken.the.vfrmaniac at gmail.com> wrote:
> > ---
> >  libavcodec/hevc_ps.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> > index 15f73be..a51784d 100644
> > --- a/libavcodec/hevc_ps.c
> > +++ b/libavcodec/hevc_ps.c
> > @@ -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);
> 
> This looks fine, can you just add a FIXME comment that you're doing
> this for swscale compatibility?

libswscale can handle ranges just fine, and doesn't require you to use
the J formats.


More information about the libav-devel mailing list