Commit 2225b3ba authored by alex's avatar alex

theora alpha3 support (with maintaining backward compatibility, maybe we...

theora alpha3 support (with maintaining backward compatibility, maybe we should remove all backward compatibility codes after final theora release?)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2527 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e873c29e
...@@ -2765,7 +2765,9 @@ static int vp3_decode_frame(AVCodecContext *avctx, ...@@ -2765,7 +2765,9 @@ static int vp3_decode_frame(AVCodecContext *avctx,
{ {
s->last_quality_index = s->quality_index; s->last_quality_index = s->quality_index;
s->quality_index = get_bits(&gb, 6); s->quality_index = get_bits(&gb, 6);
if ( s->keyframe) if (s->theora >= 0x030300)
skip_bits1(&gb);
if (s->keyframe)
{ {
if (get_bits1(&gb)) if (get_bits1(&gb))
av_log(s->avctx, AV_LOG_ERROR, "Theora: warning, unsupported keyframe coding type?!\n"); av_log(s->avctx, AV_LOG_ERROR, "Theora: warning, unsupported keyframe coding type?!\n");
...@@ -2924,9 +2926,12 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext gb) ...@@ -2924,9 +2926,12 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext gb)
av_log(avctx, AV_LOG_INFO, "Theora bitstream version %d.%d.%d\n", av_log(avctx, AV_LOG_INFO, "Theora bitstream version %d.%d.%d\n",
major, minor, micro); major, minor, micro);
/* FIXME: endianess? */
s->theora = (major << 16) | (minor << 8) | micro;
/* 3.3.0 aka alpha3 has the same frame orientation as original vp3 */ /* 3.3.0 aka alpha3 has the same frame orientation as original vp3 */
/* but previous versions have the image flipped relative to vp3 */ /* but previous versions have the image flipped relative to vp3 */
if ((major <= 3) && (minor < 3)) if (s->theora < 0x030300)
{ {
s->flipped_image = 1; s->flipped_image = 1;
av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n"); av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
...@@ -2946,12 +2951,19 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext gb) ...@@ -2946,12 +2951,19 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext gb)
skip_bits(&gb, 24); /* aspect numerator */ skip_bits(&gb, 24); /* aspect numerator */
skip_bits(&gb, 24); /* aspect denumerator */ skip_bits(&gb, 24); /* aspect denumerator */
skip_bits(&gb, 5); /* keyframe frequency force */ if (s->theora < 0x030300)
skip_bits(&gb, 5); /* keyframe frequency force */
skip_bits(&gb, 8); /* colorspace */ skip_bits(&gb, 8); /* colorspace */
skip_bits(&gb, 24); /* bitrate */ skip_bits(&gb, 24); /* bitrate */
skip_bits(&gb, 6); /* last(?) quality index */ skip_bits(&gb, 6); /* last(?) quality index */
if (s->theora >= 0x030300)
{
skip_bits(&gb, 5); /* keyframe frequency force */
skip_bits(&gb, 5); /* spare bits */
}
// align_get_bits(&gb); // align_get_bits(&gb);
avctx->width = s->width; avctx->width = s->width;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment