Mercurial > libavcodec.hg
comparison h263dec.c @ 11098:77b3f322dba8 libavcodec
Change xvid/divx/lavc build variables to be consistent to x264_build.
author | michael |
---|---|
date | Mon, 08 Feb 2010 00:43:15 +0000 |
parents | d0657e337f91 |
children | 6a29fa092197 |
comparison
equal
deleted
inserted
replaced
11097:7e5d7873fad9 | 11098:77b3f322dba8 |
---|---|
285 s->padding_bug_score++; | 285 s->padding_bug_score++; |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 if(s->workaround_bugs&FF_BUG_AUTODETECT){ | 289 if(s->workaround_bugs&FF_BUG_AUTODETECT){ |
290 if(s->padding_bug_score > -2 && !s->data_partitioning /*&& (s->divx_version || !s->resync_marker)*/) | 290 if(s->padding_bug_score > -2 && !s->data_partitioning /*&& (s->divx_version>=0 || !s->resync_marker)*/) |
291 s->workaround_bugs |= FF_BUG_NO_PADDING; | 291 s->workaround_bugs |= FF_BUG_NO_PADDING; |
292 else | 292 else |
293 s->workaround_bugs &= ~FF_BUG_NO_PADDING; | 293 s->workaround_bugs &= ~FF_BUG_NO_PADDING; |
294 } | 294 } |
295 | 295 |
423 return -1; | 423 return -1; |
424 } | 424 } |
425 | 425 |
426 avctx->has_b_frames= !s->low_delay; | 426 avctx->has_b_frames= !s->low_delay; |
427 | 427 |
428 if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){ | 428 if(s->xvid_build==-1 && s->divx_version==-1 && s->lavc_build==-1){ |
429 if(s->stream_codec_tag == AV_RL32("XVID") || | 429 if(s->stream_codec_tag == AV_RL32("XVID") || |
430 s->codec_tag == AV_RL32("XVID") || s->codec_tag == AV_RL32("XVIX") || | 430 s->codec_tag == AV_RL32("XVID") || s->codec_tag == AV_RL32("XVIX") || |
431 s->codec_tag == AV_RL32("RMP4")) | 431 s->codec_tag == AV_RL32("RMP4")) |
432 s->xvid_build= -1; | 432 s->xvid_build= 0; |
433 #if 0 | 433 #if 0 |
434 if(s->codec_tag == AV_RL32("DIVX") && s->vo_type==0 && s->vol_control_parameters==1 | 434 if(s->codec_tag == AV_RL32("DIVX") && s->vo_type==0 && s->vol_control_parameters==1 |
435 && s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc | 435 && s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc |
436 s->xvid_build= -1; | 436 s->xvid_build= 0; |
437 #endif | 437 #endif |
438 } | 438 } |
439 | 439 |
440 if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){ | 440 if(s->xvid_build==-1 && s->divx_version==-1 && s->lavc_build==-1){ |
441 if(s->codec_tag == AV_RL32("DIVX") && s->vo_type==0 && s->vol_control_parameters==0) | 441 if(s->codec_tag == AV_RL32("DIVX") && s->vo_type==0 && s->vol_control_parameters==0) |
442 s->divx_version= 400; //divx 4 | 442 s->divx_version= 400; //divx 4 |
443 } | 443 } |
444 | 444 |
445 if(s->xvid_build && s->divx_version){ | 445 if(s->xvid_build>=0 && s->divx_version>=0){ |
446 s->divx_version= | 446 s->divx_version= |
447 s->divx_build= 0; | 447 s->divx_build= -1; |
448 } | 448 } |
449 | 449 |
450 if(s->workaround_bugs&FF_BUG_AUTODETECT){ | 450 if(s->workaround_bugs&FF_BUG_AUTODETECT){ |
451 if(s->codec_tag == AV_RL32("XVIX")) | 451 if(s->codec_tag == AV_RL32("XVIX")) |
452 s->workaround_bugs|= FF_BUG_XVID_ILACE; | 452 s->workaround_bugs|= FF_BUG_XVID_ILACE; |
461 | 461 |
462 if(s->divx_version>502 && s->divx_build<1814){ | 462 if(s->divx_version>502 && s->divx_build<1814){ |
463 s->workaround_bugs|= FF_BUG_QPEL_CHROMA2; | 463 s->workaround_bugs|= FF_BUG_QPEL_CHROMA2; |
464 } | 464 } |
465 | 465 |
466 if(s->xvid_build && s->xvid_build<=3) | 466 if(s->xvid_build<=3U) |
467 s->padding_bug_score= 256*256*256*64; | 467 s->padding_bug_score= 256*256*256*64; |
468 | 468 |
469 if(s->xvid_build && s->xvid_build<=1) | 469 if(s->xvid_build<=1U) |
470 s->workaround_bugs|= FF_BUG_QPEL_CHROMA; | 470 s->workaround_bugs|= FF_BUG_QPEL_CHROMA; |
471 | 471 |
472 if(s->xvid_build && s->xvid_build<=12) | 472 if(s->xvid_build<=12U) |
473 s->workaround_bugs|= FF_BUG_EDGE; | 473 s->workaround_bugs|= FF_BUG_EDGE; |
474 | 474 |
475 if(s->xvid_build && s->xvid_build<=32) | 475 if(s->xvid_build<=32U) |
476 s->workaround_bugs|= FF_BUG_DC_CLIP; | 476 s->workaround_bugs|= FF_BUG_DC_CLIP; |
477 | 477 |
478 #define SET_QPEL_FUNC(postfix1, postfix2) \ | 478 #define SET_QPEL_FUNC(postfix1, postfix2) \ |
479 s->dsp.put_ ## postfix1 = ff_put_ ## postfix2;\ | 479 s->dsp.put_ ## postfix1 = ff_put_ ## postfix2;\ |
480 s->dsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2;\ | 480 s->dsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2;\ |
481 s->dsp.avg_ ## postfix1 = ff_avg_ ## postfix2; | 481 s->dsp.avg_ ## postfix1 = ff_avg_ ## postfix2; |
482 | 482 |
483 if(s->lavc_build && s->lavc_build<4653) | 483 if(s->lavc_build<4653U) |
484 s->workaround_bugs|= FF_BUG_STD_QPEL; | 484 s->workaround_bugs|= FF_BUG_STD_QPEL; |
485 | 485 |
486 if(s->lavc_build && s->lavc_build<4655) | 486 if(s->lavc_build<4655U) |
487 s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE; | 487 s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE; |
488 | 488 |
489 if(s->lavc_build && s->lavc_build<4670){ | 489 if(s->lavc_build<4670U){ |
490 s->workaround_bugs|= FF_BUG_EDGE; | 490 s->workaround_bugs|= FF_BUG_EDGE; |
491 } | 491 } |
492 | 492 |
493 if(s->lavc_build && s->lavc_build<=4712) | 493 if(s->lavc_build<=4712U) |
494 s->workaround_bugs|= FF_BUG_DC_CLIP; | 494 s->workaround_bugs|= FF_BUG_DC_CLIP; |
495 | 495 |
496 if(s->divx_version) | 496 if(s->divx_version>=0) |
497 s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE; | 497 s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE; |
498 //printf("padding_bug_score: %d\n", s->padding_bug_score); | 498 //printf("padding_bug_score: %d\n", s->padding_bug_score); |
499 if(s->divx_version==501 && s->divx_build==20020416) | 499 if(s->divx_version==501 && s->divx_build==20020416) |
500 s->padding_bug_score= 256*256*256*64; | 500 s->padding_bug_score= 256*256*256*64; |
501 | 501 |
502 if(s->divx_version && s->divx_version<500){ | 502 if(s->divx_version<500U){ |
503 s->workaround_bugs|= FF_BUG_EDGE; | 503 s->workaround_bugs|= FF_BUG_EDGE; |
504 } | 504 } |
505 | 505 |
506 if(s->divx_version) | 506 if(s->divx_version>=0) |
507 s->workaround_bugs|= FF_BUG_HPEL_CHROMA; | 507 s->workaround_bugs|= FF_BUG_HPEL_CHROMA; |
508 #if 0 | 508 #if 0 |
509 if(s->divx_version==500) | 509 if(s->divx_version==500) |
510 s->padding_bug_score= 256*256*256*64; | 510 s->padding_bug_score= 256*256*256*64; |
511 | 511 |
512 /* very ugly XVID padding bug detection FIXME/XXX solve this differently | 512 /* very ugly XVID padding bug detection FIXME/XXX solve this differently |
513 * Let us hope this at least works. | 513 * Let us hope this at least works. |
514 */ | 514 */ |
515 if( s->resync_marker==0 && s->data_partitioning==0 && s->divx_version==0 | 515 if( s->resync_marker==0 && s->data_partitioning==0 && s->divx_version==-1 |
516 && s->codec_id==CODEC_ID_MPEG4 && s->vo_type==0) | 516 && s->codec_id==CODEC_ID_MPEG4 && s->vo_type==0) |
517 s->workaround_bugs|= FF_BUG_NO_PADDING; | 517 s->workaround_bugs|= FF_BUG_NO_PADDING; |
518 | 518 |
519 if(s->lavc_build && s->lavc_build<4609) //FIXME not sure about the version num but a 4609 file seems ok | 519 if(s->lavc_build<4609U) //FIXME not sure about the version num but a 4609 file seems ok |
520 s->workaround_bugs|= FF_BUG_NO_PADDING; | 520 s->workaround_bugs|= FF_BUG_NO_PADDING; |
521 #endif | 521 #endif |
522 } | 522 } |
523 | 523 |
524 if(s->workaround_bugs& FF_BUG_STD_QPEL){ | 524 if(s->workaround_bugs& FF_BUG_STD_QPEL){ |
549 fprintf(f, "%d %d %f\n", buf_size, s->qscale, buf_size*(double)s->qscale); | 549 fprintf(f, "%d %d %f\n", buf_size, s->qscale, buf_size*(double)s->qscale); |
550 } | 550 } |
551 #endif | 551 #endif |
552 | 552 |
553 #if HAVE_MMX | 553 #if HAVE_MMX |
554 if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build && avctx->idct_algo == FF_IDCT_AUTO && (mm_flags & FF_MM_MMX)){ | 554 if(s->codec_id == CODEC_ID_MPEG4 && s->xvid_build>=0 && avctx->idct_algo == FF_IDCT_AUTO && (mm_flags & FF_MM_MMX)){ |
555 avctx->idct_algo= FF_IDCT_XVIDMMX; | 555 avctx->idct_algo= FF_IDCT_XVIDMMX; |
556 avctx->coded_width= 0; // force reinit | 556 avctx->coded_width= 0; // force reinit |
557 // dsputil_init(&s->dsp, avctx); | 557 // dsputil_init(&s->dsp, avctx); |
558 s->picture_number=0; | 558 s->picture_number=0; |
559 } | 559 } |
675 startcode_found=1; | 675 startcode_found=1; |
676 break; | 676 break; |
677 } | 677 } |
678 } | 678 } |
679 } | 679 } |
680 if(s->gb.buffer == s->bitstream_buffer && buf_size>7 && s->xvid_build){ //xvid style | 680 if(s->gb.buffer == s->bitstream_buffer && buf_size>7 && s->xvid_build>=0){ //xvid style |
681 startcode_found=1; | 681 startcode_found=1; |
682 current_pos=0; | 682 current_pos=0; |
683 } | 683 } |
684 | 684 |
685 if(startcode_found){ | 685 if(startcode_found){ |