287 |
287 |
}
|
288 |
288 |
|
289 |
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 |
291 |
s->workaround_bugs |= FF_BUG_NO_PADDING;
|
292 |
292 |
else
|
293 |
293 |
s->workaround_bugs &= ~FF_BUG_NO_PADDING;
|
... | ... | |
425 |
425 |
|
426 |
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 |
429 |
if(s->stream_codec_tag == AV_RL32("XVID") ||
|
430 |
430 |
s->codec_tag == AV_RL32("XVID") || s->codec_tag == AV_RL32("XVIX") ||
|
431 |
431 |
s->codec_tag == AV_RL32("RMP4"))
|
432 |
|
s->xvid_build= -1;
|
|
432 |
s->xvid_build= 0;
|
433 |
433 |
#if 0
|
434 |
434 |
if(s->codec_tag == AV_RL32("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
|
435 |
435 |
&& s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc
|
436 |
|
s->xvid_build= -1;
|
|
436 |
s->xvid_build= 0;
|
437 |
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 |
441 |
if(s->codec_tag == AV_RL32("DIVX") && s->vo_type==0 && s->vol_control_parameters==0)
|
442 |
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 |
446 |
s->divx_version=
|
447 |
|
s->divx_build= 0;
|
|
447 |
s->divx_build= -1;
|
448 |
448 |
}
|
449 |
449 |
|
450 |
450 |
if(s->workaround_bugs&FF_BUG_AUTODETECT){
|
... | ... | |
463 |
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 |
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 |
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 |
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 |
476 |
s->workaround_bugs|= FF_BUG_DC_CLIP;
|
477 |
477 |
|
478 |
478 |
#define SET_QPEL_FUNC(postfix1, postfix2) \
|
... | ... | |
480 |
480 |
s->dsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2;\
|
481 |
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 |
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 |
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 |
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 |
494 |
s->workaround_bugs|= FF_BUG_DC_CLIP;
|
495 |
495 |
|
496 |
|
if(s->divx_version)
|
|
496 |
if(s->divx_version>=0)
|
497 |
497 |
s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE;
|
498 |
498 |
//printf("padding_bug_score: %d\n", s->padding_bug_score);
|
499 |
499 |
if(s->divx_version==501 && s->divx_build==20020416)
|
500 |
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 |
503 |
s->workaround_bugs|= FF_BUG_EDGE;
|
504 |
504 |
}
|
505 |
505 |
|
506 |
|
if(s->divx_version)
|
|
506 |
if(s->divx_version>=0)
|
507 |
507 |
s->workaround_bugs|= FF_BUG_HPEL_CHROMA;
|
508 |
508 |
#if 0
|
509 |
509 |
if(s->divx_version==500)
|
... | ... | |
512 |
512 |
/* very ugly XVID padding bug detection FIXME/XXX solve this differently
|
513 |
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 |
516 |
&& s->codec_id==CODEC_ID_MPEG4 && s->vo_type==0)
|
517 |
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 |
520 |
s->workaround_bugs|= FF_BUG_NO_PADDING;
|
521 |
521 |
#endif
|
522 |
522 |
}
|
... | ... | |
551 |
551 |
#endif
|
552 |
552 |
|
553 |
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 |
555 |
avctx->idct_algo= FF_IDCT_XVIDMMX;
|
556 |
556 |
avctx->coded_width= 0; // force reinit
|
557 |
557 |
// dsputil_init(&s->dsp, avctx);
|
... | ... | |
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 |
681 |
startcode_found=1;
|
682 |
682 |
current_pos=0;
|
683 |
683 |
}
|