comparison vp3.c @ 1627:a80b15c0b9d5 libavcodec

theora alpha3 support (with maintaining backward compatibility, maybe we should remove all backward compatibility codes after final theora release?)
author alex
date Sun, 23 Nov 2003 18:49:53 +0000
parents f74ae637ffa9
children 1c7ded3c2b25
comparison
equal deleted inserted replaced
1626:f74ae637ffa9 1627:a80b15c0b9d5
2763 s->keyframe = !get_bits1(&gb); 2763 s->keyframe = !get_bits1(&gb);
2764 if (s->theora) 2764 if (s->theora)
2765 { 2765 {
2766 s->last_quality_index = s->quality_index; 2766 s->last_quality_index = s->quality_index;
2767 s->quality_index = get_bits(&gb, 6); 2767 s->quality_index = get_bits(&gb, 6);
2768 if ( s->keyframe) 2768 if (s->theora >= 0x030300)
2769 skip_bits1(&gb);
2770 if (s->keyframe)
2769 { 2771 {
2770 if (get_bits1(&gb)) 2772 if (get_bits1(&gb))
2771 av_log(s->avctx, AV_LOG_ERROR, "Theora: warning, unsupported keyframe coding type?!\n"); 2773 av_log(s->avctx, AV_LOG_ERROR, "Theora: warning, unsupported keyframe coding type?!\n");
2772 skip_bits(&gb, 2); /* reserved? */ 2774 skip_bits(&gb, 2); /* reserved? */
2773 } 2775 }
2922 minor = get_bits(&gb, 8); /* version minor */ 2924 minor = get_bits(&gb, 8); /* version minor */
2923 micro = get_bits(&gb, 8); /* version micro */ 2925 micro = get_bits(&gb, 8); /* version micro */
2924 av_log(avctx, AV_LOG_INFO, "Theora bitstream version %d.%d.%d\n", 2926 av_log(avctx, AV_LOG_INFO, "Theora bitstream version %d.%d.%d\n",
2925 major, minor, micro); 2927 major, minor, micro);
2926 2928
2929 /* FIXME: endianess? */
2930 s->theora = (major << 16) | (minor << 8) | micro;
2931
2927 /* 3.3.0 aka alpha3 has the same frame orientation as original vp3 */ 2932 /* 3.3.0 aka alpha3 has the same frame orientation as original vp3 */
2928 /* but previous versions have the image flipped relative to vp3 */ 2933 /* but previous versions have the image flipped relative to vp3 */
2929 if ((major <= 3) && (minor < 3)) 2934 if (s->theora < 0x030300)
2930 { 2935 {
2931 s->flipped_image = 1; 2936 s->flipped_image = 1;
2932 av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n"); 2937 av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
2933 } 2938 }
2934 2939
2944 skip_bits(&gb, 32); /* fps numerator */ 2949 skip_bits(&gb, 32); /* fps numerator */
2945 skip_bits(&gb, 32); /* fps denumerator */ 2950 skip_bits(&gb, 32); /* fps denumerator */
2946 skip_bits(&gb, 24); /* aspect numerator */ 2951 skip_bits(&gb, 24); /* aspect numerator */
2947 skip_bits(&gb, 24); /* aspect denumerator */ 2952 skip_bits(&gb, 24); /* aspect denumerator */
2948 2953
2949 skip_bits(&gb, 5); /* keyframe frequency force */ 2954 if (s->theora < 0x030300)
2955 skip_bits(&gb, 5); /* keyframe frequency force */
2950 skip_bits(&gb, 8); /* colorspace */ 2956 skip_bits(&gb, 8); /* colorspace */
2951 skip_bits(&gb, 24); /* bitrate */ 2957 skip_bits(&gb, 24); /* bitrate */
2952 2958
2953 skip_bits(&gb, 6); /* last(?) quality index */ 2959 skip_bits(&gb, 6); /* last(?) quality index */
2960
2961 if (s->theora >= 0x030300)
2962 {
2963 skip_bits(&gb, 5); /* keyframe frequency force */
2964 skip_bits(&gb, 5); /* spare bits */
2965 }
2954 2966
2955 // align_get_bits(&gb); 2967 // align_get_bits(&gb);
2956 2968
2957 avctx->width = s->width; 2969 avctx->width = s->width;
2958 avctx->height = s->height; 2970 avctx->height = s->height;