[FFmpeg-devel] [PATCH 4/4] Export Theora colorspace info if present
Michael Niedermayer
michaelni
Tue Feb 9 23:03:06 CET 2010
On Tue, Feb 09, 2010 at 02:57:17PM -0500, David Conrad wrote:
> ---
> libavcodec/vp3.c | 13 +++++++++++--
> 1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
> index fedc8e9..a715160 100644
> --- a/libavcodec/vp3.c
> +++ b/libavcodec/vp3.c
> @@ -2107,7 +2107,7 @@ static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
> static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
> {
> Vp3DecodeContext *s = avctx->priv_data;
> - int visible_width, visible_height;
> + int visible_width, visible_height, colorspace;
>
> s->theora = get_bits_long(gb, 24);
> av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);
> @@ -2144,7 +2144,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
>
> if (s->theora < 0x030200)
> skip_bits(gb, 5); /* keyframe frequency force */
> - skip_bits(gb, 8); /* colorspace */
> + colorspace = get_bits(gb, 8);
> skip_bits(gb, 24); /* bitrate */
>
> skip_bits(gb, 6); /* quality hint */
> @@ -2164,6 +2164,15 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
> else
> avcodec_set_dimensions(avctx, s->width, s->height);
>
> + if (colorspace == 1)
> + avctx->color_primaries == AVCOL_PRI_BT470M;
> + else if (colorspace == 2)
please use {} here as they simplify future patches and dont add any
more LOC
except that ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- 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/20100209/73b9dedd/attachment.pgp>
More information about the ffmpeg-devel
mailing list