comparison vp3.c @ 7967:6ac2c8312a2b libavcodec

Visible width/height fields were added in Theora 3.2
author conrad
date Wed, 01 Oct 2008 14:43:08 +0000
parents 14a49e087126
children 5ed5f94b9a97
comparison
equal deleted inserted replaced
7966:14a49e087126 7967:6ac2c8312a2b
2076 { 2076 {
2077 s->flipped_image = 1; 2077 s->flipped_image = 1;
2078 av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n"); 2078 av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
2079 } 2079 }
2080 2080
2081 s->width = get_bits(gb, 16) << 4; 2081 visible_width = s->width = get_bits(gb, 16) << 4;
2082 s->height = get_bits(gb, 16) << 4; 2082 visible_height = s->height = get_bits(gb, 16) << 4;
2083 2083
2084 if(avcodec_check_dimensions(avctx, s->width, s->height)){ 2084 if(avcodec_check_dimensions(avctx, s->width, s->height)){
2085 av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n", s->width, s->height); 2085 av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n", s->width, s->height);
2086 s->width= s->height= 0; 2086 s->width= s->height= 0;
2087 return -1; 2087 return -1;
2094 skip_bits(gb, 32); /* total number of blocks in a frame */ 2094 skip_bits(gb, 32); /* total number of blocks in a frame */
2095 skip_bits(gb, 4); /* total number of blocks in a frame */ 2095 skip_bits(gb, 4); /* total number of blocks in a frame */
2096 skip_bits(gb, 32); /* total number of macroblocks in a frame */ 2096 skip_bits(gb, 32); /* total number of macroblocks in a frame */
2097 } 2097 }
2098 2098
2099 if (s->theora >= 0x030200) {
2099 visible_width = get_bits_long(gb, 24); 2100 visible_width = get_bits_long(gb, 24);
2100 visible_height = get_bits_long(gb, 24); 2101 visible_height = get_bits_long(gb, 24);
2101 2102
2102 if (s->theora >= 0x030200) {
2103 skip_bits(gb, 8); /* offset x */ 2103 skip_bits(gb, 8); /* offset x */
2104 skip_bits(gb, 8); /* offset y */ 2104 skip_bits(gb, 8); /* offset y */
2105 } 2105 }
2106 2106
2107 skip_bits(gb, 32); /* fps numerator */ 2107 skip_bits(gb, 32); /* fps numerator */