| 407 | } |
| 408 | |
| 409 | static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) |
| 410 | { |
| 411 | v->res_rtm_flag = 1; |
| 412 | v->level = get_bits(gb, 3); |
| 413 | if(v->level >= 5) |
| 414 | { |
| 415 | av_log(v->s.avctx, AV_LOG_ERROR, "Reserved LEVEL %i\n",v->level); |
| 416 | } |
| 417 | v->chromaformat = get_bits(gb, 2); |
| 418 | if (v->chromaformat != 1) |
| 419 | { |
| 420 | av_log(v->s.avctx, AV_LOG_ERROR, |
| 421 | "Only 4:2:0 chroma format supported\n"); |
| 422 | return -1; |
| 423 | } |
| 424 | |
| 425 | // (fps-2)/4 (->30) |
| 426 | v->frmrtq_postproc = get_bits(gb, 3); //common |
| 427 | // (bitrate-32kbps)/64kbps |
| 428 | v->bitrtq_postproc = get_bits(gb, 5); //common |
| 429 | v->postprocflag = get_bits1(gb); //common |
| 430 | |
| 431 | v->s.avctx->coded_width = (get_bits(gb, 12) + 1) << 1; |
| 432 | v->s.avctx->coded_height = (get_bits(gb, 12) + 1) << 1; |
| 433 | v->s.avctx->width = v->s.avctx->coded_width; |
| 434 | v->s.avctx->height = v->s.avctx->coded_height; |
| 435 | v->broadcast = get_bits1(gb); |
| 436 | v->interlace = get_bits1(gb); |
| 437 | v->tfcntrflag = get_bits1(gb); |
| 438 | v->finterpflag = get_bits1(gb); |
| 439 | skip_bits1(gb); // reserved |
| 440 | |
| 441 | v->s.h_edge_pos = v->s.avctx->coded_width; |
| 442 | v->s.v_edge_pos = v->s.avctx->coded_height; |
| 443 | |
| 444 | av_log(v->s.avctx, AV_LOG_DEBUG, |
| 445 | "Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n" |
| 446 | "LoopFilter=%i, ChromaFormat=%i, Pulldown=%i, Interlace: %i\n" |
| 447 | "TFCTRflag=%i, FINTERPflag=%i\n", |
| 448 | v->level, v->frmrtq_postproc, v->bitrtq_postproc, |
| 449 | v->s.loop_filter, v->chromaformat, v->broadcast, v->interlace, |
| 450 | v->tfcntrflag, v->finterpflag |
| 451 | ); |
| 452 | |
| 453 | v->psf = get_bits1(gb); |
| 454 | if(v->psf) { //PsF, 6.1.13 |
| 455 | av_log(v->s.avctx, AV_LOG_ERROR, "Progressive Segmented Frame mode: not supported (yet)\n"); |
| 456 | return -1; |
| 457 | } |
| 458 | v->s.max_b_frames = v->s.avctx->max_b_frames = 7; |
| 459 | if(get_bits1(gb)) { //Display Info - decoding is not affected by it |
| 460 | int w, h, ar = 0; |
| 461 | av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n"); |
| 462 | v->s.avctx->width = w = get_bits(gb, 14) + 1; |
| 463 | v->s.avctx->height = h = get_bits(gb, 14) + 1; |
| 464 | av_log(v->s.avctx, AV_LOG_DEBUG, "Display dimensions: %ix%i\n", w, h); |
| 465 | if(get_bits1(gb)) |
| 466 | ar = get_bits(gb, 4); |
no test coverage detected