# HG changeset patch # User kostya # Date 1285509410 0 # Node ID db36486a6f89ffdf279f94c3f2c32cf3ae246dc3 # Parent 5915f4f0e172b7c33911791f3b70f6e7701d1d81 Make WMV3 decoder attempt to decode WMVP as well diff -r 5915f4f0e172 -r db36486a6f89 avcodec.h --- a/avcodec.h Sun Sep 26 13:54:35 2010 +0000 +++ b/avcodec.h Sun Sep 26 13:56:50 2010 +0000 @@ -32,7 +32,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MINOR 90 -#define LIBAVCODEC_VERSION_MICRO 0 +#define LIBAVCODEC_VERSION_MICRO 1 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff -r 5915f4f0e172 -r db36486a6f89 vc1.c --- a/vc1.c Sun Sep 26 13:54:35 2010 +0000 +++ b/vc1.c Sun Sep 26 13:56:50 2010 +0000 @@ -315,8 +315,7 @@ return -1; } if (v->res_sprite) { - av_log(avctx, AV_LOG_ERROR, "WMVP is not supported\n"); - return -1; + av_log(avctx, AV_LOG_ERROR, "WMVP is not fully supported\n"); } } @@ -387,7 +386,21 @@ v->quantizer_mode = get_bits(gb, 2); //common v->finterpflag = get_bits1(gb); //common - v->res_rtm_flag = get_bits1(gb); //reserved + + if (v->res_sprite) { + v->s.avctx->width = v->s.avctx->coded_width = get_bits(gb, 11); + v->s.avctx->height = v->s.avctx->coded_height = get_bits(gb, 11); + skip_bits(gb, 5); //frame rate + v->res_x8 = get_bits1(gb); + if (get_bits1(gb)) { // something to do with DC VLC selection + av_log(avctx, AV_LOG_ERROR, "Unsupported sprite feature\n"); + return -1; + } + skip_bits(gb, 3); //slice code + v->res_rtm_flag = 0; + } else { + v->res_rtm_flag = get_bits1(gb); //reserved + } if (!v->res_rtm_flag) { // av_log(avctx, AV_LOG_ERROR, @@ -566,6 +579,9 @@ { int pqindex, lowquant, status; + if(v->res_sprite) { + skip_bits(gb, 2); //not yet deciphered + } if(v->finterpflag) v->interpfrm = get_bits1(gb); skip_bits(gb, 2); //framecnt unused v->rangeredfrm = 0; diff -r 5915f4f0e172 -r db36486a6f89 vc1dec.c --- a/vc1dec.c Sun Sep 26 13:54:35 2010 +0000 +++ b/vc1dec.c Sun Sep 26 13:56:50 2010 +0000 @@ -3240,6 +3240,11 @@ } } + if(v->res_sprite && (s->pict_type!=FF_I_TYPE)){ + av_free(buf2); + return -1; + } + // for hurry_up==5 s->current_picture.pict_type= s->pict_type; s->current_picture.key_frame= s->pict_type == FF_I_TYPE;