[FFmpeg-devel] [PATCH 2/2] Export fullrange flag and color information for h.264

Michael Niedermayer michaelni
Tue Jan 5 01:52:59 CET 2010


On Mon, Jan 04, 2010 at 07:12:10PM -0500, David Conrad wrote:
> ---
>  libavcodec/h264.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index 898c176..5f2311c 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -7069,11 +7069,11 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){
>  
>      if(get_bits1(&s->gb)){      /* video_signal_type_present_flag */
>          get_bits(&s->gb, 3);    /* video_format */
> -        get_bits1(&s->gb);      /* video_full_range_flag */
> +        s->color_range = get_bits1(&s->gb)+1; /* video_full_range_flag */
>          if(get_bits1(&s->gb)){  /* colour_description_present_flag */
> -            get_bits(&s->gb, 8); /* colour_primaries */
> -            get_bits(&s->gb, 8); /* transfer_characteristics */
> -            get_bits(&s->gb, 8); /* matrix_coefficients */
> +            s->avctx->color_primaries = get_bits(&s->gb, 8); /* colour_primaries */
> +            s->avctx->color_trc = get_bits(&s->gb, 8); /* transfer_characteristics */
> +            s->avctx->colorspace = get_bits(&s->gb, 8); /* matrix_coefficients */
>          }

missing validity checks, vertical alignment and i think this uses them from
an arbitrary sps while it should use the actually used sps

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100105/ce1fa615/attachment.pgp>



More information about the ffmpeg-devel mailing list