comparison h263.c @ 333:8aa87f1dfc52 libavcodec

divx 5.01 support
author michaelni
date Mon, 22 Apr 2002 12:45:22 +0000
parents 853e1eb30468
children e7e9d9901523
comparison
equal deleted inserted replaced
332:207cc56d18f8 333:8aa87f1dfc52
2562 startcode = state; 2562 startcode = state;
2563 break; 2563 break;
2564 } 2564 }
2565 state = ((state << 8) | v) & 0xffffff; 2565 state = ((state << 8) | v) & 0xffffff;
2566 if( get_bits_count(&s->gb) > s->gb.size*8-32){ 2566 if( get_bits_count(&s->gb) > s->gb.size*8-32){
2567 printf("no VOP startcode found\n"); 2567 if(s->gb.size>50){
2568 return -1; 2568 printf("no VOP startcode found, frame size was=%d\n", s->gb.size);
2569 return -1;
2570 }else{
2571 printf("frame skip\n");
2572 return FRAME_SKIPED;
2573 }
2569 } 2574 }
2570 } 2575 }
2571 //printf("startcode %X %d\n", startcode, get_bits_count(&s->gb)); 2576 //printf("startcode %X %d\n", startcode, get_bits_count(&s->gb));
2572 if (startcode == 0x120) { // Video Object Layer 2577 if (startcode == 0x120) { // Video Object Layer
2573 int width, height, vo_ver_id; 2578 int width, height, vo_ver_id;
2761 if(buf[i]==0) break; 2766 if(buf[i]==0) break;
2762 skip_bits(&s->gb, 8); 2767 skip_bits(&s->gb, 8);
2763 } 2768 }
2764 buf[255]=0; 2769 buf[255]=0;
2765 e=sscanf(buf, "DivX%dBuild%d", &ver, &build); 2770 e=sscanf(buf, "DivX%dBuild%d", &ver, &build);
2771 if(e!=2)
2772 e=sscanf(buf, "DivX%db%d", &ver, &build);
2766 if(e==2){ 2773 if(e==2){
2767 s->divx_version= ver; 2774 s->divx_version= ver;
2768 s->divx_build= build; 2775 s->divx_build= build;
2769 if(s->picture_number==0){ 2776 if(s->picture_number==0){
2770 printf("This file was encoded with DivX%d Build%d\n", ver, build); 2777 printf("This file was encoded with DivX%d Build%d\n", ver, build);
2771 if(ver==500 && build==413){ //most likely all version are indeed totally buggy but i dunno for sure ... 2778 if(ver==500 && build==413){
2772 printf("WARNING: this version of DivX is not MPEG4 compatible, trying to workaround these bugs...\n"); 2779 printf("WARNING: this version of DivX is not MPEG4 compatible, trying to workaround these bugs...\n");
2780 #if 0
2773 }else{ 2781 }else{
2774 printf("hmm, i havnt seen that version of divx yet, lets assume they fixed these bugs ...\n" 2782 printf("hmm, i havnt seen that version of divx yet, lets assume they fixed these bugs ...\n"
2775 "using mpeg4 decoder, if it fails contact the developers (of ffmpeg)\n"); 2783 "using mpeg4 decoder, if it fails contact the developers (of ffmpeg)\n");
2784 #endif
2776 } 2785 }
2777 } 2786 }
2778 } 2787 }
2779 //printf("User Data: %s\n", buf); 2788 //printf("User Data: %s\n", buf);
2780 goto redo; 2789 goto redo;
2885 skip_bits1(&s->gb); // vop shape coding type 2894 skip_bits1(&s->gb); // vop shape coding type
2886 } 2895 }
2887 } 2896 }
2888 } 2897 }
2889 s->picture_number++; // better than pic number==0 allways ;) 2898 s->picture_number++; // better than pic number==0 allways ;)
2899 //printf("done\n");
2890 return 0; 2900 return 0;
2891 } 2901 }
2892 2902
2893 /* don't understand why they choose a different header ! */ 2903 /* don't understand why they choose a different header ! */
2894 int intel_h263_decode_picture_header(MpegEncContext *s) 2904 int intel_h263_decode_picture_header(MpegEncContext *s)