Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master:
fate: make compare() function compatible with POSIX bc
Update Janne's email address.
APIchanges: Replace Subversion revision numbers by Git hashes.
bytestream: Eliminate one level of pointless macro indirection.
xwd: convert to bytestream2.
vqavideo: port to bytestream2 API
Read preset files with suffix .avpreset
prores: allow user to set fixed quantiser
lavf: remove some disabled code.
lavf: only set average frame rate for video.
lavf: remove a pointless check.
avcodec: add XBM encoder

Conflicts:
Changelog
cmdutils.c
cmdutils.h
doc/APIchanges
libavcodec/Makefile
libavcodec/avcodec.h
libavcodec/version.h
libavcodec/vqavideo.c
libavformat/img2enc.c
libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/03/19 07:12:35
Showing 20 changed files
... ...
@@ -15,6 +15,7 @@ version next:
15 15
 - libutvideo encoder wrapper (--enable-libutvideo)
16 16
 - swapuv filter
17 17
 - bbox filter
18
+- XBM encoder
18 19
 
19 20
 
20 21
 version 0.10:
... ...
@@ -1064,7 +1064,7 @@ FILE *get_preset_file(char *filename, size_t filename_size,
1064 1064
             if (!f && codec_name) {
1065 1065
                 snprintf(filename, filename_size,
1066 1066
                          "%s%s/%s-%s.ffpreset",
1067
-                         base[i],  i != 1 ? "" : "/.ffmpeg", codec_name,
1067
+                         base[i], i != 1 ? "" : "/.ffmpeg", codec_name,
1068 1068
                          preset_name);
1069 1069
                 f = fopen(filename, "r");
1070 1070
             }
... ...
@@ -357,7 +357,7 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
357 357
  * at configuration time or in a "ffpresets" folder along the executable
358 358
  * on win32, in that order. If no such file is found and
359 359
  * codec_name is defined, then search for a file named
360
- * codec_name-preset_name.ffpreset in the above-mentioned directories.
360
+ * codec_name-preset_name.avpreset in the above-mentioned directories.
361 361
  *
362 362
  * @param filename buffer where the name of the found filename is written
363 363
  * @param filename_size size in bytes of the filename buffer
... ...
@@ -605,39 +605,39 @@ API changes, most recent first:
605 605
 2011-01-31 - 910b5b8 - lavfi 1.75.0 - AVFilterLink sample_aspect_ratio
606 606
   Add sample_aspect_ratio field to AVFilterLink.
607 607
 
608
-2011-01-15 - r26374 - lavfi 1.74.0 - AVFilterBufferRefAudioProps
608
+2011-01-15 - a242ac3 - lavfi 1.74.0 - AVFilterBufferRefAudioProps
609 609
   Rename AVFilterBufferRefAudioProps.samples_nb to nb_samples.
610 610
 
611
-2011-01-14 - r26330 - lavf 52.93.0 - av_metadata_copy()
611
+2011-01-14 - 7f88a5b - lavf 52.93.0 - av_metadata_copy()
612 612
   Add av_metadata_copy() in avformat.h.
613 613
 
614
-2011-01-07 - r26262 - lavc 52.107.0 - deprecate reordered_opaque
614
+2011-01-07 - 81c623f - lavc 52.107.0 - deprecate reordered_opaque
615 615
   Deprecate reordered_opaque in favor of pkt_pts/dts.
616 616
 
617
-2011-01-07 - r26261 - lavc 52.106.0 - pkt_dts
617
+2011-01-07 - 1919fea - lavc 52.106.0 - pkt_dts
618 618
   Add pkt_dts to AVFrame, this will in the future allow multithreading decoders
619 619
   to not mess up dts.
620 620
 
621
-2011-01-07 - r26260 - lavc 52.105.0 - pkt_pts
621
+2011-01-07 - 393cbb9 - lavc 52.105.0 - pkt_pts
622 622
   Add pkt_pts to AVFrame.
623 623
 
624
-2011-01-07 - r26259 - lavc 52.104.0 - av_get_profile_name()
624
+2011-01-07 - 060ec0a - lavc 52.104.0 - av_get_profile_name()
625 625
   Add av_get_profile_name to libavcodec/avcodec.h.
626 626
 
627
-2010-12-27 - r26108 - lavfi 1.71.0 - AV_PERM_NEG_LINESIZES
627
+2010-12-27 - 0ccabee - lavfi 1.71.0 - AV_PERM_NEG_LINESIZES
628 628
   Add AV_PERM_NEG_LINESIZES in avfilter.h.
629 629
 
630
-2010-12-27 - r26104 - lavf 52.91.0 - av_find_best_stream()
630
+2010-12-27 - 9128ae0 - lavf 52.91.0 - av_find_best_stream()
631 631
   Add av_find_best_stream to libavformat/avformat.h.
632 632
 
633
-2010-12-27 - r26103 - lavf 52.90.0
633
+2010-12-27 - 107a7e3 - lavf 52.90.0
634 634
   Add AVFMT_NOSTREAMS flag for formats with no streams,
635 635
   like e.g. text metadata.
636 636
 
637
-2010-12-22 - r26073 - lavu 50.36.0 - file.h
637
+2010-12-22 - 0328b9e - lavu 50.36.0 - file.h
638 638
   Add functions av_file_map() and av_file_unmap() in file.h.
639 639
 
640
-2010-12-19 - r26056 - lavu 50.35.0 - error.h
640
+2010-12-19 - 0bc55f5 - lavu 50.35.0 - error.h
641 641
   Add "not found" error codes:
642 642
   AVERROR_DEMUXER_NOT_FOUND
643 643
   AVERROR_MUXER_NOT_FOUND
... ...
@@ -648,28 +648,28 @@ API changes, most recent first:
648 648
   AVERROR_BSF_NOT_FOUND
649 649
   AVERROR_STREAM_NOT_FOUND
650 650
 
651
-2010-12-09 - r25923 - lavcore 0.16.0 - avcore.h
651
+2010-12-09 - c61cdd0 - lavcore 0.16.0 - avcore.h
652 652
   Move AV_NOPTS_VALUE, AV_TIME_BASE, AV_TIME_BASE_Q symbols from
653 653
   avcodec.h to avcore.h.
654 654
 
655
-2010-12-04 - r25886 - lavc 52.98.0 - CODEC_CAP_NEG_LINESIZES
655
+2010-12-04 - 16cfc96 - lavc 52.98.0 - CODEC_CAP_NEG_LINESIZES
656 656
   Add CODEC_CAP_NEG_LINESIZES codec capability flag in avcodec.h.
657 657
 
658
-2010-12-04 - r25879 - lavu 50.34.0 - av_get_pix_fmt_string()
658
+2010-12-04 - bb4afa1 - lavu 50.34.0 - av_get_pix_fmt_string()
659 659
   Deprecate avcodec_pix_fmt_string() in favor of
660 660
   pixdesc.h/av_get_pix_fmt_string().
661 661
 
662
-2010-12-04 - r25878 - lavcore 0.15.0 - av_image_alloc()
662
+2010-12-04 - 4da12e3 - lavcore 0.15.0 - av_image_alloc()
663 663
   Add av_image_alloc() to libavcore/imgutils.h.
664 664
 
665
-2010-12-02 - r25862 - lavfi 1.67.0 - avfilter_graph_create_filter()
665
+2010-12-02 - 037be76 - lavfi 1.67.0 - avfilter_graph_create_filter()
666 666
   Add function avfilter_graph_create_filter() in avfiltergraph.h.
667 667
 
668
-2010-11-25 - r25826 - lavfi 1.65.0 - avfilter_get_video_buffer_ref_from_arrays()
668
+2010-11-25 - 4723bc2 - lavfi 1.65.0 - avfilter_get_video_buffer_ref_from_arrays()
669 669
   Add function avfilter_get_video_buffer_ref_from_arrays() in
670 670
   avfilter.h.
671 671
 
672
-2010-11-21 - r25787 - lavcore 0.14.0 - audioconvert.h
672
+2010-11-21 - 176a615 - lavcore 0.14.0 - audioconvert.h
673 673
   Add a public audio channel API in audioconvert.h, and deprecate the
674 674
   corresponding functions in libavcodec:
675 675
   avcodec_get_channel_name()
... ...
@@ -678,23 +678,23 @@ API changes, most recent first:
678 678
   avcodec_channel_layout_num_channels()
679 679
   and the CH_* macros defined in libavcodec/avcodec.h.
680 680
 
681
-2010-11-21 - r25777 - lavf 52.85.0 - avformat.h
681
+2010-11-21 - 6bfc268 - lavf 52.85.0 - avformat.h
682 682
   Add av_append_packet().
683 683
 
684
-2010-11-21 - r25776 - lavc 52.97.0 - avcodec.h
684
+2010-11-21 - a08d918 - lavc 52.97.0 - avcodec.h
685 685
   Add av_grow_packet().
686 686
 
687
-2010-11-17 - r25761 - lavcore 0.13.0 - parseutils.h
687
+2010-11-17 - 0985e1a - lavcore 0.13.0 - parseutils.h
688 688
   Add av_parse_color() declared in libavcore/parseutils.h.
689 689
 
690
-2010-11-13 - r25745 - lavc 52.95.0 - AVCodecContext
690
+2010-11-13 - cb2c971 - lavc 52.95.0 - AVCodecContext
691 691
   Add AVCodecContext.subtitle_header and AVCodecContext.subtitle_header_size
692 692
   fields.
693 693
 
694
-2010-11-13 - r25740 - lavfi 1.62.0 - avfiltergraph.h
694
+2010-11-13 - 5aaea02 - lavfi 1.62.0 - avfiltergraph.h
695 695
   Make avfiltergraph.h public.
696 696
 
697
-2010-11-13 - r25737 - lavfi 1.61.0 - avfiltergraph.h
697
+2010-11-13 - 4fcbb2a - lavfi 1.61.0 - avfiltergraph.h
698 698
   Remove declarations from avfiltergraph.h for the functions:
699 699
   avfilter_graph_check_validity()
700 700
   avfilter_graph_config_links()
... ...
@@ -702,7 +702,7 @@ API changes, most recent first:
702 702
   which are now internal.
703 703
   Use avfilter_graph_config() instead.
704 704
 
705
-2010-11-08 - r25708 - lavu 50.33.0 - eval.h
705
+2010-11-08 - d2af720 - lavu 50.33.0 - eval.h
706 706
   Deprecate functions:
707 707
   av_parse_and_eval_expr(),
708 708
   av_parse_expr(),
... ...
@@ -714,30 +714,30 @@ API changes, most recent first:
714 714
   av_expr_eval(),
715 715
   av_expr_free().
716 716
 
717
-2010-11-08 - r25707 - lavfi 1.59.0 - avfilter_free()
717
+2010-11-08 - 24de0ed - lavfi 1.59.0 - avfilter_free()
718 718
   Rename avfilter_destroy() to avfilter_free().
719 719
   This change breaks libavfilter API/ABI.
720 720
 
721
-2010-11-07 - r25705 - lavfi 1.58.0 - avfiltergraph.h
721
+2010-11-07 - 1e80a0e - lavfi 1.58.0 - avfiltergraph.h
722 722
   Remove graphparser.h header, move AVFilterInOut and
723 723
   avfilter_graph_parse() declarations to libavfilter/avfiltergraph.h.
724 724
 
725
-2010-11-07 - r25700 - lavfi 1.57.0 - AVFilterInOut
725
+2010-11-07 - 7313132 - lavfi 1.57.0 - AVFilterInOut
726 726
   Rename field AVFilterInOut.filter to AVFilterInOut.filter_ctx.
727 727
   This change breaks libavfilter API.
728 728
 
729
-2010-11-04 - r25674 - lavfi 1.56.0 - avfilter_graph_free()
729
+2010-11-04 - 97dd1e4 - lavfi 1.56.0 - avfilter_graph_free()
730 730
   Rename avfilter_graph_destroy() to avfilter_graph_free().
731 731
   This change breaks libavfilter API/ABI.
732 732
 
733
-2010-11-04 - r25673 - lavfi 1.55.0 - avfilter_graph_alloc()
733
+2010-11-04 - e15aeea - lavfi 1.55.0 - avfilter_graph_alloc()
734 734
   Add avfilter_graph_alloc() to libavfilter/avfiltergraph.h.
735 735
 
736
-2010-11-02 - r25654 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
736
+2010-11-02 - 6f84cd1 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
737 737
   Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and
738 738
   deprecate av_get_bits_per_sample_format().
739 739
 
740
-2010-11-02 - r25653 - lavcore 0.11.0 - samplefmt.h
740
+2010-11-02 - d63e456 - lavcore 0.11.0 - samplefmt.h
741 741
   Add sample format functions in libavcore/samplefmt.h:
742 742
   av_get_sample_fmt_name(),
743 743
   av_get_sample_fmt(),
... ...
@@ -747,149 +747,149 @@ API changes, most recent first:
747 747
   avcodec_get_sample_fmt(),
748 748
   avcodec_sample_fmt_string().
749 749
 
750
-2010-11-02 - r25652 - lavcore 0.10.0 - samplefmt.h
750
+2010-11-02 - 262d1c5 - lavcore 0.10.0 - samplefmt.h
751 751
   Define enum AVSampleFormat in libavcore/samplefmt.h, deprecate enum
752 752
   SampleFormat.
753 753
 
754
-2010-10-16 - r25502 - lavfi 1.52.0 - avfilter_graph_config()
754
+2010-10-16 - 2a24df9 - lavfi 1.52.0 - avfilter_graph_config()
755 755
   Add the function avfilter_graph_config() in avfiltergraph.h.
756 756
 
757
-2010-10-15 - r25493 - lavf 52.83.0 - metadata API
757
+2010-10-15 - 03700d3 - lavf 52.83.0 - metadata API
758 758
   Change demuxers to export metadata in generic format and
759 759
   muxers to accept generic format. Deprecate the public
760 760
   conversion API.
761 761
 
762
-2010-10-10 - r25441 - lavfi 1.49.0 - AVFilterLink.time_base
762
+2010-10-10 - 867ae7a - lavfi 1.49.0 - AVFilterLink.time_base
763 763
   Add time_base field to AVFilterLink.
764 764
 
765
-2010-09-27 - r25236 - lavu 50.31.0 - av_set_options_string()
765
+2010-09-27 - c85eef4 - lavu 50.31.0 - av_set_options_string()
766 766
   Move av_set_options_string() from libavfilter/parseutils.h to
767 767
   libavutil/opt.h.
768 768
 
769
-2010-09-27 - r25227 - lavfi 1.47.0 - AVFilterLink
769
+2010-09-27 - acc0490 - lavfi 1.47.0 - AVFilterLink
770 770
   Make the AVFilterLink fields srcpad and dstpad store the pointers to
771 771
   the source and destination pads, rather than their indexes.
772 772
 
773
-2010-09-27 - r25225 - lavu 50.30.0 - av_get_token()
773
+2010-09-27 - 372e288 - lavu 50.30.0 - av_get_token()
774 774
   Move av_get_token() from libavfilter/parseutils.h to
775 775
   libavutil/avstring.h.
776 776
 
777
-2010-09-26 - r32368 - lsws 0.12.0 - swscale.h
777
+2010-09-26 - 635d4ae - lsws 0.12.0 - swscale.h
778 778
   Add the functions sws_alloc_context() and sws_init_context().
779 779
 
780
-2010-09-26 - r25210 - lavu 50.29.0 - opt.h
780
+2010-09-26 - 6ed0404 - lavu 50.29.0 - opt.h
781 781
   Move libavcodec/opt.h to libavutil/opt.h.
782 782
 
783
-2010-09-24 - r25174 - lavu 50.28.0 - av_log_set_flags()
783
+2010-09-24 - 1c1c80f - lavu 50.28.0 - av_log_set_flags()
784 784
   Default of av_log() changed due to many problems to the old no repeat
785 785
   detection. Read the docs of AV_LOG_SKIP_REPEATED in log.h before
786 786
   enabling it for your app!.
787 787
 
788
-2010-09-24 - r25167 - lavc 52.90.0 - av_opt_show2()
788
+2010-09-24 - f66eb58 - lavc 52.90.0 - av_opt_show2()
789 789
   Deprecate av_opt_show() in favor or av_opt_show2().
790 790
 
791
-2010-09-14 - r25120 - lavu 50.27.0 - av_popcount()
791
+2010-09-14 - bc6f0af - lavu 50.27.0 - av_popcount()
792 792
   Add av_popcount() to libavutil/common.h.
793 793
 
794
-2010-09-08 - r25076 - lavu 50.26.0 - av_get_cpu_flags()
794
+2010-09-08 - c6c98d0 - lavu 50.26.0 - av_get_cpu_flags()
795 795
   Add av_get_cpu_flags().
796 796
 
797
-2010-09-07 - r25067 - lavcore 0.9.0 - av_image_copy()
797
+2010-09-07 - 34017fd - lavcore 0.9.0 - av_image_copy()
798 798
   Add av_image_copy().
799 799
 
800
-2010-09-07 - r25064 - lavcore 0.8.0 - av_image_copy_plane()
800
+2010-09-07 - 9686abb - lavcore 0.8.0 - av_image_copy_plane()
801 801
   Add av_image_copy_plane().
802 802
 
803
-2010-09-07 - r25057 - lavcore 0.7.0 - imgutils.h
803
+2010-09-07 - 9b7269e - lavcore 0.7.0 - imgutils.h
804 804
   Adopt hierarchical scheme for the imgutils.h function names,
805 805
   deprecate the old names.
806 806
 
807
-2010-09-04 - r25040 - lavu 50.25.0 - AV_CPU_FLAG_*
807
+2010-09-04 - 7160bb7 - lavu 50.25.0 - AV_CPU_FLAG_*
808 808
   Deprecate the FF_MM_* flags defined in libavcodec/avcodec.h in favor
809 809
   of the AV_CPU_FLAG_* flags defined in libavutil/cpu.h.
810 810
 
811
-2010-08-26 - r24936 - lavc 52.87.0 - avcodec_get_channel_layout()
811
+2010-08-26 - 5da19b5 - lavc 52.87.0 - avcodec_get_channel_layout()
812 812
   Add avcodec_get_channel_layout() in audioconvert.h.
813 813
 
814
-2010-08-20 - r24851 - lavcore 0.6.0 - av_fill_image_max_pixsteps()
814
+2010-08-20 - e344336 - lavcore 0.6.0 - av_fill_image_max_pixsteps()
815 815
   Rename av_fill_image_max_pixstep() to av_fill_image_max_pixsteps().
816 816
 
817
-2010-08-18 - r24827 - lavcore 0.5.0 - av_fill_image_max_pixstep()
817
+2010-08-18 - a6ddf8b - lavcore 0.5.0 - av_fill_image_max_pixstep()
818 818
   Add av_fill_image_max_pixstep() in imgutils.h.
819 819
 
820
-2010-08-17 - r24814 - lavu 50.24.0 - AV_NE()
820
+2010-08-17 - 4f2d2e4 - lavu 50.24.0 - AV_NE()
821 821
   Add the AV_NE macro.
822 822
 
823
-2010-08-17 - r24811 - lavfi 1.36.0 - audio framework
823
+2010-08-17 - ad2c950 - lavfi 1.36.0 - audio framework
824 824
   Implement AVFilterBufferRefAudioProps struct for audio properties,
825 825
   get_audio_buffer(), filter_samples() functions and related changes.
826 826
 
827
-2010-08-12 - r24787 - lavcore 0.4.0 - av_get_image_linesize()
827
+2010-08-12 - 81c1eca - lavcore 0.4.0 - av_get_image_linesize()
828 828
   Add av_get_image_linesize() in imgutils.h.
829 829
 
830
-2010-08-11 - r24773 - lavfi 1.34.0 - AVFilterBufferRef
830
+2010-08-11 - c1db7bf - lavfi 1.34.0 - AVFilterBufferRef
831 831
   Resize data and linesize arrays in AVFilterBufferRef to 8.
832 832
 
833 833
   This change breaks libavfilter API/ABI.
834 834
 
835
-2010-08-11 - r24768 - lavc 52.85.0 - av_picture_data_copy()
835
+2010-08-11 - 9f08d80 - lavc 52.85.0 - av_picture_data_copy()
836 836
   Add av_picture_data_copy in avcodec.h.
837 837
 
838
-2010-08-11 - r24765 - lavfi 1.33.0 - avfilter_open()
838
+2010-08-11 - 84c0386 - lavfi 1.33.0 - avfilter_open()
839 839
   Change avfilter_open() signature:
840 840
   AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name) ->
841 841
   int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
842 842
 
843 843
   This change breaks libavfilter API/ABI.
844 844
 
845
-2010-08-11 - r24763 - lavfi 1.32.0 - AVFilterBufferRef
845
+2010-08-11 - cc80caf - lavfi 1.32.0 - AVFilterBufferRef
846 846
   Add a type field to AVFilterBufferRef, and move video specific
847 847
   properties to AVFilterBufferRefVideoProps.
848 848
 
849 849
   This change breaks libavfilter API/ABI.
850 850
 
851
-2010-08-07 - r24732 - lavfi 1.31.0 - AVFilterLink
851
+2010-08-07 - 5d4890d - lavfi 1.31.0 - AVFilterLink
852 852
   Rename AVFilterLink fields:
853 853
   AVFilterLink.srcpic    ->  AVFilterLink.src_buf
854 854
   AVFilterLink.cur_pic   ->  AVFilterLink.cur_buf
855 855
   AVFilterLink.outpic    ->  AVFilterLink.out_buf
856 856
 
857
-2010-08-07 - r24731 - lavfi 1.30.0
857
+2010-08-07 - 7fce481 - lavfi 1.30.0
858 858
   Rename functions and fields:
859 859
   avfilter_(un)ref_pic       -> avfilter_(un)ref_buffer
860 860
   avfilter_copy_picref_props -> avfilter_copy_buffer_ref_props
861 861
   AVFilterBufferRef.pic      -> AVFilterBufferRef.buffer
862 862
 
863
-2010-08-07 - r24730 - lavfi 1.29.0 - AVFilterBufferRef
863
+2010-08-07 - ecc8dad - lavfi 1.29.0 - AVFilterBufferRef
864 864
   Rename AVFilterPicRef to AVFilterBufferRef.
865 865
 
866
-2010-08-07 - r24728 - lavfi 1.28.0 - AVFilterBuffer
866
+2010-08-07 - d54e094 - lavfi 1.28.0 - AVFilterBuffer
867 867
   Move format field from AVFilterBuffer to AVFilterPicRef.
868 868
 
869
-2010-08-06 - r24709 - lavcore 0.3.0 - av_check_image_size()
869
+2010-08-06 - bf176f5 - lavcore 0.3.0 - av_check_image_size()
870 870
   Deprecate avcodec_check_dimensions() in favor of the function
871 871
   av_check_image_size() defined in libavcore/imgutils.h.
872 872
 
873
-2010-07-30 - r24592 - lavfi 1.27.0 - AVFilterBuffer
873
+2010-07-30 - 56b5e9d - lavfi 1.27.0 - AVFilterBuffer
874 874
   Increase size of the arrays AVFilterBuffer.data and
875 875
   AVFilterBuffer.linesize from 4 to 8.
876 876
 
877 877
   This change breaks libavfilter ABI.
878 878
 
879
-2010-07-29 - r24583 - lavcore 0.2.0 - imgutils.h
879
+2010-07-29 - e7bd48a - lavcore 0.2.0 - imgutils.h
880 880
   Add functions av_fill_image_linesizes() and
881 881
   av_fill_image_pointers(), declared in libavcore/imgutils.h.
882 882
 
883
-2010-07-27 - r24518 - lavcore 0.1.0 - parseutils.h
883
+2010-07-27 - 126b638 - lavcore 0.1.0 - parseutils.h
884 884
   Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate()
885 885
   defined in libavcodec in favor of the newly added functions
886 886
   av_parse_video_size() and av_parse_video_rate() declared in
887 887
   libavcore/parseutils.h.
888 888
 
889
-2010-07-23 - r24439 - lavu 50.23.0 - mathematics.h
889
+2010-07-23 - 4485247 - lavu 50.23.0 - mathematics.h
890 890
   Add the M_PHI constant definition.
891 891
 
892
-2010-07-22 - r24424 - lavfi 1.26.0 - media format generalization
892
+2010-07-22 - bdab614 - lavfi 1.26.0 - media format generalization
893 893
   Add a type field to AVFilterLink.
894 894
 
895 895
   Change the field types:
... ...
@@ -909,235 +909,235 @@ API changes, most recent first:
909 909
 
910 910
   This change breaks libavfilter API/ABI.
911 911
 
912
-2010-07-21 - r24393 - lavcore 0.0.0
912
+2010-07-21 - aac6ca6 - lavcore 0.0.0
913 913
   Add libavcore.
914 914
 
915
-2010-07-17 - r24291 - lavfi 1.25.0 - AVFilterBuffer
915
+2010-07-17 - b5c582f - lavfi 1.25.0 - AVFilterBuffer
916 916
   Remove w and h fields from AVFilterBuffer.
917 917
 
918
-2010-07-17 - r24284 - lavfi 1.24.0 - AVFilterBuffer
918
+2010-07-17 - f0d77b2 - lavfi 1.24.0 - AVFilterBuffer
919 919
   Rename AVFilterPic to AVFilterBuffer.
920 920
 
921
-2010-07-17 - r24278 - lavf 52.74.0 - url_fskip()
921
+2010-07-17 - 57fe80f - lavf 52.74.0 - url_fskip()
922 922
   Make url_fskip() return an int error code instead of void.
923 923
 
924
-2010-07-11 - r24199 - lavc 52.83.0
924
+2010-07-11 - 23940f1 - lavc 52.83.0
925 925
   Add AVCodecContext.lpc_type and AVCodecContext.lpc_passes fields.
926 926
   Add AVLPCType enum.
927 927
   Deprecate AVCodecContext.use_lpc.
928 928
 
929
-2010-07-11 - r24185 - lavc 52.82.0 - avsubtitle_free()
929
+2010-07-11 - e1d7c88 - lavc 52.82.0 - avsubtitle_free()
930 930
   Add a function for free the contents of a AVSubtitle generated by
931 931
   avcodec_decode_subtitle.
932 932
 
933
-2010-07-11 - r24174 - lavu 50.22.0 - bswap.h and intreadwrite.h
933
+2010-07-11 - b91d08f - lavu 50.22.0 - bswap.h and intreadwrite.h
934 934
   Make the bswap.h and intreadwrite.h API public.
935 935
 
936
-2010-07-08 - r24101 - lavu 50.21.0 - pixdesc.h
936
+2010-07-08 - ce1cd1c - lavu 50.21.0 - pixdesc.h
937 937
   Rename read/write_line() to av_read/write_image_line().
938 938
 
939
-2010-07-07 - r24091 - lavfi 1.21.0 - avfilter_copy_picref_props()
939
+2010-07-07 - 4d508e4 - lavfi 1.21.0 - avfilter_copy_picref_props()
940 940
   Add avfilter_copy_picref_props().
941 941
 
942
-2010-07-03 - r24021 - lavc 52.79.0
942
+2010-07-03 - 2d525ef - lavc 52.79.0
943 943
   Add FF_COMPLIANCE_UNOFFICIAL and change all instances of
944 944
   FF_COMPLIANCE_INOFFICIAL to use FF_COMPLIANCE_UNOFFICIAL.
945 945
 
946
-2010-07-02 - r23985 - lavu 50.20.0 - lfg.h
946
+2010-07-02 - 89eec74 - lavu 50.20.0 - lfg.h
947 947
   Export av_lfg_init(), av_lfg_get(), av_mlfg_get(), and av_bmg_get() through
948 948
   lfg.h.
949 949
 
950
-2010-06-28 - r23835 - lavfi 1.20.1 - av_parse_color()
950
+2010-06-28 - a52e2c3 - lavfi 1.20.1 - av_parse_color()
951 951
   Extend av_parse_color() syntax, make it accept an alpha value specifier and
952 952
   set the alpha value to 255 by default.
953 953
 
954
-2010-06-22 - r23706 - lavf 52.71.0 - URLProtocol.priv_data_size, priv_data_class
954
+2010-06-22 - 735cf6b - lavf 52.71.0 - URLProtocol.priv_data_size, priv_data_class
955 955
   Add priv_data_size and priv_data_class to URLProtocol.
956 956
 
957
-2010-06-22 - r23704 - lavf 52.70.0 - url_alloc(), url_connect()
957
+2010-06-22 - ffbb289 - lavf 52.70.0 - url_alloc(), url_connect()
958 958
   Add url_alloc() and url_connect().
959 959
 
960
-2010-06-22 - r23702 - lavf 52.69.0 - av_register_protocol2()
960
+2010-06-22 - 9b07a2d - lavf 52.69.0 - av_register_protocol2()
961 961
   Add av_register_protocol2(), deprecating av_register_protocol().
962 962
 
963
-2010-06-09 - r23551 - lavu 50.19.0 - av_compare_mod()
963
+2010-06-09 - 65db058 - lavu 50.19.0 - av_compare_mod()
964 964
   Add av_compare_mod() to libavutil/mathematics.h.
965 965
 
966
-2010-06-05 - r23485 - lavu 50.18.0 - eval API
966
+2010-06-05 - 0b99215 - lavu 50.18.0 - eval API
967 967
   Make the eval API public.
968 968
 
969
-2010-06-04 - r23461 - lavu 50.17.0 - AV_BASE64_SIZE
969
+2010-06-04 - 31878fc - lavu 50.17.0 - AV_BASE64_SIZE
970 970
   Add AV_BASE64_SIZE() macro.
971 971
 
972
-2010-06-02 - r23421 - lavc 52.73.0 - av_get_codec_tag_string()
972
+2010-06-02 - 7e566bb - lavc 52.73.0 - av_get_codec_tag_string()
973 973
   Add av_get_codec_tag_string().
974 974
 
975
-2010-06-01 - r31301 - lsws 0.11.0 - convertPalette API
975
+2010-06-01 - 2b99142 - lsws 0.11.0 - convertPalette API
976 976
   Add sws_convertPalette8ToPacked32() and sws_convertPalette8ToPacked24().
977 977
 
978
-2010-05-26 - r23334 - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL
978
+2010-05-26 - 93ebfee - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL
979 979
   Add CODEC_CAP_EXPERIMENTAL flag.
980 980
   NOTE: this was backported to 0.6
981 981
 
982
-2010-05-23 - r23255 - lavu 50.16.0 - av_get_random_seed()
982
+2010-05-23 - 9977863 - lavu 50.16.0 - av_get_random_seed()
983 983
   Add av_get_random_seed().
984 984
 
985
-2010-05-18 - r23161 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT
985
+2010-05-18 - 796ac23 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT
986 986
   Add AVFMT_FLAG_RTP_HINT as possible value for AVFormatContext.flags.
987 987
   NOTE: this was backported to 0.6
988 988
 
989
-2010-05-09 - r23066 - lavfi 1.20.0 - AVFilterPicRef
989
+2010-05-09 - b6bc205 - lavfi 1.20.0 - AVFilterPicRef
990 990
   Add interlaced and top_field_first fields to AVFilterPicRef.
991 991
 
992 992
 ------------------------------8<-------------------------------------
993 993
                    0.6 branch was cut here
994 994
 ----------------------------->8--------------------------------------
995 995
 
996
-2010-05-01 - r23002 - lavf 52.62.0 - probe function
996
+2010-05-01 - 8e2ee18 - lavf 52.62.0 - probe function
997 997
   Add av_probe_input_format2 to API, it allows ignoring probe
998 998
   results below given score and returns the actual probe score.
999 999
 
1000
-2010-04-01 - r22806 - lavf 52.61.0 - metadata API
1000
+2010-04-01 - 3dd6180 - lavf 52.61.0 - metadata API
1001 1001
   Add a flag for av_metadata_set2() to disable overwriting of
1002 1002
   existing tags.
1003 1003
 
1004
-2010-04-01 - r22753 - lavc 52.66.0
1004
+2010-04-01 - 0fb49b5 - lavc 52.66.0
1005 1005
   Add avcodec_get_edge_width().
1006 1006
 
1007
-2010-03-31 - r22750 - lavc 52.65.0
1007
+2010-03-31 - d103218 - lavc 52.65.0
1008 1008
   Add avcodec_copy_context().
1009 1009
 
1010
-2010-03-31 - r22748 - lavf 52.60.0 - av_match_ext()
1010
+2010-03-31 - 1a70d12 - lavf 52.60.0 - av_match_ext()
1011 1011
   Make av_match_ext() public.
1012 1012
 
1013
-2010-03-31 - r22736 - lavu 50.14.0 - AVMediaType
1013
+2010-03-31 - 1149150 - lavu 50.14.0 - AVMediaType
1014 1014
   Move AVMediaType enum from libavcodec to libavutil.
1015 1015
 
1016
-2010-03-31 - r22735 - lavc 52.64.0 - AVMediaType
1016
+2010-03-31 - 72415b2 - lavc 52.64.0 - AVMediaType
1017 1017
   Define AVMediaType enum, and use it instead of enum CodecType, which
1018 1018
   is deprecated and will be dropped at the next major bump.
1019 1019
 
1020
-2010-03-25 - r22684 - lavu 50.13.0 - av_strerror()
1020
+2010-03-25 - 8795823 - lavu 50.13.0 - av_strerror()
1021 1021
   Implement av_strerror().
1022 1022
 
1023
-2010-03-23 - r22649 - lavc 52.60.0 - av_dct_init()
1023
+2010-03-23 - e1484eb - lavc 52.60.0 - av_dct_init()
1024 1024
   Support DCT-I and DST-I.
1025 1025
 
1026
-2010-03-15 - r22540 - lavf 52.56.0 - AVFormatContext.start_time_realtime
1026
+2010-03-15 - b8819c8 - lavf 52.56.0 - AVFormatContext.start_time_realtime
1027 1027
   Add AVFormatContext.start_time_realtime field.
1028 1028
 
1029
-2010-03-13 - r22506 - lavfi 1.18.0 - AVFilterPicRef.pos
1029
+2010-03-13 - 5bb5c1d - lavfi 1.18.0 - AVFilterPicRef.pos
1030 1030
   Add AVFilterPicRef.pos field.
1031 1031
 
1032
-2010-03-13 - r22501 - lavu 50.12.0 - error.h
1032
+2010-03-13 - 60c144f - lavu 50.12.0 - error.h
1033 1033
   Move error code definitions from libavcodec/avcodec.h to
1034 1034
   the new public header libavutil/error.h.
1035 1035
 
1036
-2010-03-07 - r22291 - lavc 52.56.0 - avfft.h
1036
+2010-03-07 - c709483 - lavc 52.56.0 - avfft.h
1037 1037
   Add public FFT interface.
1038 1038
 
1039
-2010-03-06 - r22251 - lavu 50.11.0 - av_stristr()
1039
+2010-03-06 - ac6ef86 - lavu 50.11.0 - av_stristr()
1040 1040
   Add av_stristr().
1041 1041
 
1042
-2010-03-03 - r22174 - lavu 50.10.0 - av_tree_enumerate()
1042
+2010-03-03 - 4b83fc0 - lavu 50.10.0 - av_tree_enumerate()
1043 1043
   Add av_tree_enumerate().
1044 1044
 
1045
-2010-02-07 - r21673 - lavu 50.9.0 - av_compare_ts()
1045
+2010-02-07 - b687c1a - lavu 50.9.0 - av_compare_ts()
1046 1046
   Add av_compare_ts().
1047 1047
 
1048
-2010-02-05 - r30513 - lsws 0.10.0 - sws_getCoefficients()
1048
+2010-02-05 - 3f3dc76 - lsws 0.10.0 - sws_getCoefficients()
1049 1049
   Add sws_getCoefficients().
1050 1050
 
1051
-2010-02-01 - r21587 - lavf 52.50.0 - metadata API
1051
+2010-02-01 - ca76a11 - lavf 52.50.0 - metadata API
1052 1052
   Add a list of generic tag names, change 'author' -> 'artist',
1053 1053
   'year' -> 'date'.
1054 1054
 
1055
-2010-01-30 - r21545 - lavu 50.8.0 - av_get_pix_fmt()
1055
+2010-01-30 - 80a07f6 - lavu 50.8.0 - av_get_pix_fmt()
1056 1056
   Add av_get_pix_fmt().
1057 1057
 
1058
-2010-01-21 - r30381 - lsws 0.9.0 - sws_scale()
1058
+2010-01-21 - 01cc47d - lsws 0.9.0 - sws_scale()
1059 1059
   Change constness attributes of sws_scale() parameters.
1060 1060
 
1061
-2010-01-10 - r21121 - lavfi 1.15.0 - avfilter_graph_config_links()
1061
+2010-01-10 - 3fb8e77 - lavfi 1.15.0 - avfilter_graph_config_links()
1062 1062
   Add a log_ctx parameter to avfilter_graph_config_links().
1063 1063
 
1064
-2010-01-07 - r30236 - lsws 0.8.0 - sws_isSupported{In,Out}put()
1064
+2010-01-07 - 8e9767f - lsws 0.8.0 - sws_isSupported{In,Out}put()
1065 1065
   Add sws_isSupportedInput() and sws_isSupportedOutput() functions.
1066 1066
 
1067
-2010-01-06 - r21035 - lavfi 1.14.0 - avfilter_add_colorspace()
1067
+2010-01-06 - c1d662f - lavfi 1.14.0 - avfilter_add_colorspace()
1068 1068
   Change the avfilter_add_colorspace() signature, make it accept an
1069 1069
   (AVFilterFormats **) rather than an (AVFilterFormats *) as before.
1070 1070
 
1071
-2010-01-03 - r21007 - lavfi 1.13.0 - avfilter_add_colorspace()
1071
+2010-01-03 - 4fd1f18 - lavfi 1.13.0 - avfilter_add_colorspace()
1072 1072
   Add avfilter_add_colorspace().
1073 1073
 
1074
-2010-01-02 - r20998 - lavf 52.46.0 - av_match_ext()
1074
+2010-01-02 - 8eb631f - lavf 52.46.0 - av_match_ext()
1075 1075
   Add av_match_ext(), it should be used in place of match_ext().
1076 1076
 
1077
-2010-01-01 - r20991 - lavf 52.45.0 - av_guess_format()
1077
+2010-01-01 - a1f547b - lavf 52.45.0 - av_guess_format()
1078 1078
   Add av_guess_format(), it should be used in place of guess_format().
1079 1079
 
1080
-2009-12-13 - r20834 - lavf 52.43.0 - metadata API
1080
+2009-12-13 - a181981 - lavf 52.43.0 - metadata API
1081 1081
   Add av_metadata_set2(), AV_METADATA_DONT_STRDUP_KEY and
1082 1082
   AV_METADATA_DONT_STRDUP_VAL.
1083 1083
 
1084
-2009-12-13 - r20829 - lavu 50.7.0 - avstring.h API
1084
+2009-12-13 - 277c733 - lavu 50.7.0 - avstring.h API
1085 1085
   Add av_d2str().
1086 1086
 
1087
-2009-12-13 - r20826 - lavc 52.42.0 - AVStream
1087
+2009-12-13 - 02b398e - lavc 52.42.0 - AVStream
1088 1088
   Add avg_frame_rate.
1089 1089
 
1090
-2009-12-12 - r20808 - lavu 50.6.0 - av_bmg_next()
1090
+2009-12-12 - 3ba69a1 - lavu 50.6.0 - av_bmg_next()
1091 1091
   Introduce the av_bmg_next() function.
1092 1092
 
1093
-2009-12-05 - r20734 - lavfi 1.12.0 - avfilter_draw_slice()
1093
+2009-12-05 - a13a543 - lavfi 1.12.0 - avfilter_draw_slice()
1094 1094
   Add a slice_dir parameter to avfilter_draw_slice().
1095 1095
 
1096
-2009-11-26 - r20611 - lavfi 1.11.0 - AVFilter
1096
+2009-11-26 - 4cc3f6a - lavfi 1.11.0 - AVFilter
1097 1097
   Remove the next field from AVFilter, this is not anymore required.
1098 1098
 
1099
-2009-11-25 - r20607 - lavfi 1.10.0 - avfilter_next()
1099
+2009-11-25 - 1433c4a - lavfi 1.10.0 - avfilter_next()
1100 1100
   Introduce the avfilter_next() function.
1101 1101
 
1102
-2009-11-25 - r20605 - lavfi 1.9.0 - avfilter_register()
1102
+2009-11-25 - 86a60fa - lavfi 1.9.0 - avfilter_register()
1103 1103
   Change the signature of avfilter_register() to make it return an
1104 1104
   int. This is required since now the registration operation may fail.
1105 1105
 
1106
-2009-11-25 - r20603 - lavu 50.5.0 - pixdesc.h API
1106
+2009-11-25 - 74a0059 - lavu 50.5.0 - pixdesc.h API
1107 1107
   Make the pixdesc.h API public.
1108 1108
 
1109
-2009-10-27 - r20385 - lavfi 1.5.0 - AVFilter.next
1109
+2009-10-27 - 243110f - lavfi 1.5.0 - AVFilter.next
1110 1110
   Add a next field to AVFilter, this is used for simplifying the
1111 1111
   registration and management of the registered filters.
1112 1112
 
1113
-2009-10-23 - r20356 - lavfi 1.4.1 - AVFilter.description
1113
+2009-10-23 - cccd292 - lavfi 1.4.1 - AVFilter.description
1114 1114
   Add a description field to AVFilter.
1115 1115
 
1116
-2009-10-19 - r20302 - lavfi 1.3.0 - avfilter_make_format_list()
1116
+2009-10-19 - 6b5dc05 - lavfi 1.3.0 - avfilter_make_format_list()
1117 1117
   Change the interface of avfilter_make_format_list() from
1118 1118
   avfilter_make_format_list(int n, ...) to
1119 1119
   avfilter_make_format_list(enum PixelFormat *pix_fmts).
1120 1120
 
1121
-2009-10-18 - r20272 - lavfi 1.0.0 - avfilter_get_video_buffer()
1121
+2009-10-18 - 0eb4ff9 - lavfi 1.0.0 - avfilter_get_video_buffer()
1122 1122
   Make avfilter_get_video_buffer() recursive and add the w and h
1123 1123
   parameters to it.
1124 1124
 
1125
-2009-10-07 - r20189 - lavfi 0.5.1 - AVFilterPic
1125
+2009-10-07 - 46c40e4 - lavfi 0.5.1 - AVFilterPic
1126 1126
   Add w and h fields to AVFilterPic.
1127 1127
 
1128
-2009-06-22 - r19250 - lavf 52.34.1 - AVFormatContext.packet_size
1128
+2009-06-22 - 92400be - lavf 52.34.1 - AVFormatContext.packet_size
1129 1129
   This is now an unsigned int instead of a signed int.
1130 1130
 
1131
-2009-06-19 - r19222 - lavc 52.32.0 - AVSubtitle.pts
1131
+2009-06-19 - a4276ba - lavc 52.32.0 - AVSubtitle.pts
1132 1132
   Add a pts field to AVSubtitle which gives the subtitle packet pts
1133 1133
   in AV_TIME_BASE. Some subtitle de-/encoders (e.g. XSUB) will
1134 1134
   not work right without this.
1135 1135
 
1136
-2009-06-03 - r19078 - lavc 52.30.2 - AV_PKT_FLAG_KEY
1136
+2009-06-03 - 8f3f2e0 - lavc 52.30.2 - AV_PKT_FLAG_KEY
1137 1137
   PKT_FLAG_KEY has been deprecated and will be dropped at the next
1138 1138
   major version. Use AV_PKT_FLAG_KEY instead.
1139 1139
 
1140
-2009-06-01 - r19025 - lavc 52.30.0 - av_lockmgr_register()
1140
+2009-06-01 - f988ce6 - lavc 52.30.0 - av_lockmgr_register()
1141 1141
   av_lockmgr_register() can be used to register a callback function
1142 1142
   that lavc (and in the future, libraries that depend on lavc) can use
1143 1143
   to implement mutexes. The application should provide a callback function
... ...
@@ -1145,27 +1145,27 @@ API changes, most recent first:
1145 1145
   When the lock manager is registered, FFmpeg is guaranteed to behave
1146 1146
   correctly in a multi-threaded application.
1147 1147
 
1148
-2009-04-30 - r18719 - lavc 52.28.0 - av_free_packet()
1148
+2009-04-30 - ce1d9c8 - lavc 52.28.0 - av_free_packet()
1149 1149
   av_free_packet() is no longer an inline function. It is now exported.
1150 1150
 
1151
-2009-04-11 - r18431 - lavc 52.25.0 - deprecate av_destruct_packet_nofree()
1151
+2009-04-11 - 80d403f - lavc 52.25.0 - deprecate av_destruct_packet_nofree()
1152 1152
   Please use NULL instead. This has been supported since r16506
1153 1153
   (lavf > 52.23.1, lavc > 52.10.0).
1154 1154
 
1155
-2009-04-07 - r18351 - lavc 52.23.0 - avcodec_decode_video/audio/subtitle
1155
+2009-04-07 - 7a00bba - lavc 52.23.0 - avcodec_decode_video/audio/subtitle
1156 1156
   The old decoding functions are deprecated, all new code should use the
1157 1157
   new functions avcodec_decode_video2(), avcodec_decode_audio3() and
1158 1158
   avcodec_decode_subtitle2(). These new functions take an AVPacket *pkt
1159 1159
   argument instead of a const uint8_t *buf / int buf_size pair.
1160 1160
 
1161
-2009-04-03 - r18321 - lavu 50.3.0 - av_fifo_space()
1161
+2009-04-03 - 7b09db3 - lavu 50.3.0 - av_fifo_space()
1162 1162
   Introduce the av_fifo_space() function.
1163 1163
 
1164
-2009-04-02 - r18317 - lavc 52.23.0 - AVPacket
1164
+2009-04-02 - fabd246 - lavc 52.23.0 - AVPacket
1165 1165
   Move AVPacket declaration from libavformat/avformat.h to
1166 1166
   libavcodec/avcodec.h.
1167 1167
 
1168
-2009-03-22 - r18163 - lavu 50.2.0 - RGB32 pixel formats
1168
+2009-03-22 - 6e08ca9 - lavu 50.2.0 - RGB32 pixel formats
1169 1169
   Convert the pixel formats PIX_FMT_ARGB, PIX_FMT_RGBA, PIX_FMT_ABGR,
1170 1170
   PIX_FMT_BGRA, which were defined as macros, into enum PixelFormat values.
1171 1171
   Conversely PIX_FMT_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32 and
... ...
@@ -1174,17 +1174,17 @@ API changes, most recent first:
1174 1174
   Re-sort the enum PixelFormat list accordingly.
1175 1175
   This change breaks API/ABI backward compatibility.
1176 1176
 
1177
-2009-03-22 - r18133 - lavu 50.1.0 - PIX_FMT_RGB5X5 endian variants
1177
+2009-03-22 - f82674e - lavu 50.1.0 - PIX_FMT_RGB5X5 endian variants
1178 1178
   Add the enum PixelFormat values:
1179 1179
   PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,
1180 1180
   PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, PIX_FMT_BGR555BE, PIX_FMT_BGR555LE.
1181 1181
 
1182
-2009-03-21 - r18116 - lavu 50.0.0  - av_random*
1182
+2009-03-21 - ee6624e - lavu 50.0.0  - av_random*
1183 1183
   The Mersenne Twister PRNG implemented through the av_random* functions
1184 1184
   was removed. Use the lagged Fibonacci PRNG through the av_lfg* functions
1185 1185
   instead.
1186 1186
 
1187
-2009-03-08 - r17869 - lavu 50.0.0  - AVFifoBuffer
1187
+2009-03-08 - 41dd680 - lavu 50.0.0  - AVFifoBuffer
1188 1188
   av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped
1189 1189
   and replaced by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write
1190 1190
   and av_fifo_realloc2.
... ...
@@ -1193,7 +1193,7 @@ API changes, most recent first:
1193 1193
   The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by
1194 1194
   applications, they may not use sizeof() or directly access members.
1195 1195
 
1196
-2009-03-01 - r17682 - lavf 52.31.0 - Generic metadata API
1196
+2009-03-01 - ec26457 - lavf 52.31.0 - Generic metadata API
1197 1197
   Introduce a new metadata API (see av_metadata_get() and friends).
1198 1198
   The old API is now deprecated and should not be used anymore. This especially
1199 1199
   includes the following structure fields:
... ...
@@ -401,6 +401,8 @@ following image formats are supported:
401 401
     @tab YUV, JPEG and some extension is not supported yet.
402 402
 @item Truevision Targa  @tab X @tab X
403 403
     @tab Targa (.TGA) image format
404
+@item XBM  @tab X @tab
405
+    @tab X BitMap image format
404 406
 @item XWD  @tab X @tab X
405 407
     @tab X Window Dump image format
406 408
 @end multitable
... ...
@@ -482,6 +482,7 @@ OBJS-$(CONFIG_XAN_DPCM_DECODER)        += dpcm.o
482 482
 OBJS-$(CONFIG_XAN_WC3_DECODER)         += xan.o
483 483
 OBJS-$(CONFIG_XAN_WC4_DECODER)         += xxan.o
484 484
 OBJS-$(CONFIG_XBIN_DECODER)            += bintext.o cga_data.o
485
+OBJS-$(CONFIG_XBM_ENCODER)             += xbmenc.o
485 486
 OBJS-$(CONFIG_XL_DECODER)              += xl.o
486 487
 OBJS-$(CONFIG_XSUB_DECODER)            += xsubdec.o
487 488
 OBJS-$(CONFIG_XSUB_ENCODER)            += xsubenc.o
... ...
@@ -5,7 +5,7 @@
5 5
  *
6 6
  * AAC LATM decoder
7 7
  * Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
8
- * Copyright (c) 2010      Janne Grunau <janne-ffmpeg@jannau.net>
8
+ * Copyright (c) 2010      Janne Grunau <janne-libav@jannau.net>
9 9
  *
10 10
  * This file is part of FFmpeg.
11 11
  *
... ...
@@ -249,6 +249,7 @@ void avcodec_register_all(void)
249 249
     REGISTER_DECODER (WNV1, wnv1);
250 250
     REGISTER_DECODER (XAN_WC3, xan_wc3);
251 251
     REGISTER_DECODER (XAN_WC4, xan_wc4);
252
+    REGISTER_ENCODER (XBM, xbm);
252 253
     REGISTER_DECODER (XL, xl);
253 254
     REGISTER_ENCDEC  (XWD, xwd);
254 255
     REGISTER_ENCDEC  (Y41P, y41p);
... ...
@@ -247,6 +247,7 @@ enum CodecID {
247 247
     CODEC_ID_V410,
248 248
     CODEC_ID_XWD,
249 249
     CODEC_ID_CDXL,
250
+    CODEC_ID_XBM,
250 251
     CODEC_ID_Y41P       = MKBETAG('Y','4','1','P'),
251 252
     CODEC_ID_ESCAPE130  = MKBETAG('E','1','3','0'),
252 253
     CODEC_ID_AVRP       = MKBETAG('A','V','R','P'),
... ...
@@ -23,6 +23,7 @@
23 23
 #ifndef AVCODEC_BYTESTREAM_H
24 24
 #define AVCODEC_BYTESTREAM_H
25 25
 
26
+#include <stdint.h>
26 27
 #include <string.h>
27 28
 
28 29
 #include "libavutil/common.h"
... ...
@@ -37,7 +38,7 @@ typedef struct {
37 37
     int eof;
38 38
 } PutByteContext;
39 39
 
40
-#define DEF_T(type, name, bytes, read, write)                                  \
40
+#define DEF(type, name, bytes, read, write)                                  \
41 41
 static av_always_inline type bytestream_get_ ## name(const uint8_t **b)        \
42 42
 {                                                                              \
43 43
     (*b) += bytes;                                                             \
... ...
@@ -80,24 +81,15 @@ static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g)      \
80 80
     return read(g->buffer);                                                    \
81 81
 }
82 82
 
83
-#define DEF(name, bytes, read, write)                                          \
84
-    DEF_T(unsigned int, name, bytes, read, write)
85
-#define DEF64(name, bytes, read, write)                                        \
86
-    DEF_T(uint64_t, name, bytes, read, write)
87
-
88
-DEF64(le64, 8, AV_RL64, AV_WL64)
89
-DEF  (le32, 4, AV_RL32, AV_WL32)
90
-DEF  (le24, 3, AV_RL24, AV_WL24)
91
-DEF  (le16, 2, AV_RL16, AV_WL16)
92
-DEF64(be64, 8, AV_RB64, AV_WB64)
93
-DEF  (be32, 4, AV_RB32, AV_WB32)
94
-DEF  (be24, 3, AV_RB24, AV_WB24)
95
-DEF  (be16, 2, AV_RB16, AV_WB16)
96
-DEF  (byte, 1, AV_RB8 , AV_WB8 )
97
-
98
-#undef DEF
99
-#undef DEF64
100
-#undef DEF_T
83
+DEF(uint64_t,     le64, 8, AV_RL64, AV_WL64)
84
+DEF(unsigned int, le32, 4, AV_RL32, AV_WL32)
85
+DEF(unsigned int, le24, 3, AV_RL24, AV_WL24)
86
+DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
87
+DEF(uint64_t,     be64, 8, AV_RB64, AV_WB64)
88
+DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
89
+DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
90
+DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
91
+DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
101 92
 
102 93
 #if HAVE_BIGENDIAN
103 94
 #   define bytestream2_get_ne16  bytestream2_get_be16
... ...
@@ -184,6 +184,7 @@ typedef struct ProresContext {
184 184
     int num_slices;
185 185
     int num_planes;
186 186
     int bits_per_mb;
187
+    int force_quant;
187 188
 
188 189
     char *vendor;
189 190
     int quant_sel;
... ...
@@ -397,7 +398,9 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
397 397
     int plane_factor, is_chroma;
398 398
     uint16_t *qmat;
399 399
 
400
-    if (quant < MAX_STORED_Q) {
400
+    if (ctx->force_quant) {
401
+        qmat = ctx->quants[0];
402
+    } else if (quant < MAX_STORED_Q) {
401 403
         qmat = ctx->quants[quant];
402 404
     } else {
403 405
         qmat = ctx->custom_q;
... ...
@@ -750,21 +753,23 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
750 750
     // slices
751 751
     for (y = 0; y < ctx->mb_height; y++) {
752 752
         mbs_per_slice = ctx->mbs_per_slice;
753
-        for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
754
-            while (ctx->mb_width - x < mbs_per_slice)
755
-                mbs_per_slice >>= 1;
756
-            q = find_slice_quant(avctx, pic, (mb + 1) * TRELLIS_WIDTH, x, y,
757
-                                 mbs_per_slice);
758
-        }
753
+        if (!ctx->force_quant) {
754
+            for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
755
+                while (ctx->mb_width - x < mbs_per_slice)
756
+                    mbs_per_slice >>= 1;
757
+                q = find_slice_quant(avctx, pic, (mb + 1) * TRELLIS_WIDTH, x, y,
758
+                                     mbs_per_slice);
759
+            }
759 760
 
760
-        for (x = ctx->slices_width - 1; x >= 0; x--) {
761
-            ctx->slice_q[x] = ctx->nodes[q].quant;
762
-            q = ctx->nodes[q].prev_node;
761
+            for (x = ctx->slices_width - 1; x >= 0; x--) {
762
+                ctx->slice_q[x] = ctx->nodes[q].quant;
763
+                q = ctx->nodes[q].prev_node;
764
+            }
763 765
         }
764 766
 
765 767
         mbs_per_slice = ctx->mbs_per_slice;
766 768
         for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
767
-            q = ctx->slice_q[mb];
769
+            q = ctx->force_quant ? ctx->force_quant : ctx->slice_q[mb];
768 770
 
769 771
             while (ctx->mb_width - x < mbs_per_slice)
770 772
                 mbs_per_slice >>= 1;
... ...
@@ -859,27 +864,66 @@ static av_cold int encode_init(AVCodecContext *avctx)
859 859
         return AVERROR_INVALIDDATA;
860 860
     }
861 861
 
862
-    if (!ctx->bits_per_mb) {
863
-        for (i = 0; i < NUM_MB_LIMITS - 1; i++)
864
-            if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height)
865
-                break;
866
-        ctx->bits_per_mb   = ctx->profile_info->br_tab[i];
867
-    } else if (ctx->bits_per_mb < 128) {
868
-        av_log(avctx, AV_LOG_ERROR, "too few bits per MB, please set at least 128\n");
869
-        return AVERROR_INVALIDDATA;
862
+    ctx->force_quant = avctx->global_quality / FF_QP2LAMBDA;
863
+    if (!ctx->force_quant) {
864
+        if (!ctx->bits_per_mb) {
865
+            for (i = 0; i < NUM_MB_LIMITS - 1; i++)
866
+                if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height)
867
+                    break;
868
+            ctx->bits_per_mb   = ctx->profile_info->br_tab[i];
869
+        } else if (ctx->bits_per_mb < 128) {
870
+            av_log(avctx, AV_LOG_ERROR, "too few bits per MB, please set at least 128\n");
871
+            return AVERROR_INVALIDDATA;
872
+        }
873
+
874
+        min_quant = ctx->profile_info->min_quant;
875
+        max_quant = ctx->profile_info->max_quant;
876
+        for (i = min_quant; i < MAX_STORED_Q; i++) {
877
+            for (j = 0; j < 64; j++)
878
+                ctx->quants[i][j] = ctx->quant_mat[j] * i;
879
+        }
880
+
881
+        ctx->nodes = av_malloc((ctx->slices_width + 1) * TRELLIS_WIDTH
882
+                               * sizeof(*ctx->nodes));
883
+        if (!ctx->nodes) {
884
+            encode_close(avctx);
885
+            return AVERROR(ENOMEM);
886
+        }
887
+        for (i = min_quant; i < max_quant + 2; i++) {
888
+            ctx->nodes[i].prev_node = -1;
889
+            ctx->nodes[i].bits      = 0;
890
+            ctx->nodes[i].score     = 0;
891
+        }
892
+
893
+        ctx->slice_q = av_malloc(ctx->slices_width * sizeof(*ctx->slice_q));
894
+        if (!ctx->slice_q) {
895
+            encode_close(avctx);
896
+            return AVERROR(ENOMEM);
897
+        }
898
+    } else {
899
+        int ls = 0;
900
+
901
+        if (ctx->force_quant > 64) {
902
+            av_log(avctx, AV_LOG_ERROR, "too large quantiser, maximum is 64\n");
903
+            return AVERROR_INVALIDDATA;
904
+        }
905
+
906
+        for (j = 0; j < 64; j++) {
907
+            ctx->quants[0][j] = ctx->quant_mat[j] * ctx->force_quant;
908
+            ls += av_log2((1 << 11)  / ctx->quants[0][j]) * 2 + 1;
909
+        }
910
+
911
+        ctx->bits_per_mb = ls * 8;
912
+        if (ctx->chroma_factor == CFACTOR_Y444)
913
+            ctx->bits_per_mb += ls * 4;
914
+        if (ctx->num_planes == 4)
915
+            ctx->bits_per_mb += ls * 4;
870 916
     }
871 917
 
872 918
     ctx->frame_size = ctx->num_slices * (2 + 2 * ctx->num_planes
873 919
                                          + (2 * mps * ctx->bits_per_mb) / 8)
874 920
                       + 200;
875 921
 
876
-    min_quant = ctx->profile_info->min_quant;
877
-    max_quant = ctx->profile_info->max_quant;
878
-    for (i = min_quant; i < MAX_STORED_Q; i++) {
879
-        for (j = 0; j < 64; j++)
880
-            ctx->quants[i][j] = ctx->quant_mat[j] * i;
881
-    }
882
-
883 922
     avctx->codec_tag   = ctx->profile_info->tag;
884 923
 
885 924
     av_log(avctx, AV_LOG_DEBUG, "profile %d, %d slices, %d bits per MB\n",
... ...
@@ -887,24 +931,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
887 887
     av_log(avctx, AV_LOG_DEBUG, "estimated frame size %d\n",
888 888
            ctx->frame_size);
889 889
 
890
-    ctx->nodes = av_malloc((ctx->slices_width + 1) * TRELLIS_WIDTH
891
-                           * sizeof(*ctx->nodes));
892
-    if (!ctx->nodes) {
893
-        encode_close(avctx);
894
-        return AVERROR(ENOMEM);
895
-    }
896
-    for (i = min_quant; i < max_quant + 2; i++) {
897
-        ctx->nodes[i].prev_node = -1;
898
-        ctx->nodes[i].bits      = 0;
899
-        ctx->nodes[i].score     = 0;
900
-    }
901
-
902
-    ctx->slice_q = av_malloc(ctx->slices_width * sizeof(*ctx->slice_q));
903
-    if (!ctx->slice_q) {
904
-        encode_close(avctx);
905
-        return AVERROR(ENOMEM);
906
-    }
907
-
908 890
     return 0;
909 891
 }
910 892
 
... ...
@@ -21,7 +21,7 @@
21 21
 #define AVCODEC_VERSION_H
22 22
 
23 23
 #define LIBAVCODEC_VERSION_MAJOR 54
24
-#define LIBAVCODEC_VERSION_MINOR  10
24
+#define LIBAVCODEC_VERSION_MINOR  11
25 25
 #define LIBAVCODEC_VERSION_MICRO 100
26 26
 
27 27
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
... ...
@@ -70,10 +70,10 @@
70 70
 #include "libavutil/intreadwrite.h"
71 71
 #include "libavutil/imgutils.h"
72 72
 #include "avcodec.h"
73
+#include "bytestream.h"
73 74
 
74 75
 #define PALETTE_COUNT 256
75 76
 #define VQA_HEADER_SIZE 0x2A
76
-#define CHUNK_PREAMBLE_SIZE 8
77 77
 
78 78
 /* allocate the maximum vector space, regardless of the file version:
79 79
  * (0xFF00 codebook vectors + 0x100 solid pixel vectors) * (4x4 pixels/block) */
... ...
@@ -94,9 +94,7 @@ typedef struct VqaContext {
94 94
 
95 95
     AVCodecContext *avctx;
96 96
     AVFrame frame;
97
-
98
-    const unsigned char *buf;
99
-    int size;
97
+    GetByteContext gb;
100 98
 
101 99
     uint32_t palette[PALETTE_COUNT];
102 100
 
... ...
@@ -123,7 +121,6 @@ typedef struct VqaContext {
123 123
 static av_cold int vqa_decode_init(AVCodecContext *avctx)
124 124
 {
125 125
     VqaContext *s = avctx->priv_data;
126
-    unsigned char *vqa_header;
127 126
     int i, j, codebook_index;
128 127
 
129 128
     s->avctx = avctx;
... ...
@@ -136,21 +133,20 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
136 136
     }
137 137
 
138 138
     /* load up the VQA parameters from the header */
139
-    vqa_header = (unsigned char *)s->avctx->extradata;
140
-    s->vqa_version = vqa_header[0];
139
+    s->vqa_version = s->avctx->extradata[0];
141 140
     if (s->vqa_version < 1 || s->vqa_version > 3) {
142 141
         av_log(s->avctx, AV_LOG_ERROR, "  VQA video: unsupported version %d\n", s->vqa_version);
143 142
         return -1;
144 143
     }
145
-    s->width = AV_RL16(&vqa_header[6]);
146
-    s->height = AV_RL16(&vqa_header[8]);
144
+    s->width = AV_RL16(&s->avctx->extradata[6]);
145
+    s->height = AV_RL16(&s->avctx->extradata[8]);
147 146
     if(av_image_check_size(s->width, s->height, 0, avctx)){
148 147
         s->width= s->height= 0;
149 148
         return -1;
150 149
     }
151
-    s->vector_width = vqa_header[10];
152
-    s->vector_height = vqa_header[11];
153
-    s->partial_count = s->partial_countdown = vqa_header[13];
150
+    s->vector_width = s->avctx->extradata[10];
151
+    s->vector_height = s->avctx->extradata[11];
152
+    s->partial_count = s->partial_countdown = s->avctx->extradata[13];
154 153
 
155 154
     /* the vector dimensions have to meet very stringent requirements */
156 155
     if ((s->vector_width != 4) ||
... ...
@@ -205,90 +201,88 @@ fail:
205 205
         av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: next op would overflow dest_index\n"); \
206 206
         av_log(NULL, AV_LOG_ERROR, "  VQA video: current dest_index = %d, count = %d, dest_size = %d\n", \
207 207
             dest_index, count, dest_size); \
208
-        return; \
208
+        return AVERROR_INVALIDDATA; \
209
+    }
210
+
211
+#define CHECK_COPY(idx) \
212
+    if (idx < 0 || idx + count > dest_size) { \
213
+        av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: next op would overflow dest_index\n"); \
214
+        av_log(NULL, AV_LOG_ERROR, "  VQA video: current src_pos = %d, count = %d, dest_size = %d\n", \
215
+            src_pos, count, dest_size); \
216
+        return AVERROR_INVALIDDATA; \
209 217
     }
210 218
 
211
-static void decode_format80(const unsigned char *src, int src_size,
219
+
220
+static int decode_format80(GetByteContext *gb, int src_size,
212 221
     unsigned char *dest, int dest_size, int check_size) {
213 222
 
214
-    int src_index = 0;
215 223
     int dest_index = 0;
216
-    int count;
224
+    int count, opcode, start;
217 225
     int src_pos;
218 226
     unsigned char color;
219 227
     int i;
220 228
 
221
-    while (src_index < src_size) {
222
-
223
-        av_dlog(NULL, "      opcode %02X: ", src[src_index]);
229
+    start = bytestream2_tell(gb);
230
+    while (bytestream2_tell(gb) - start < src_size) {
231
+        opcode = bytestream2_get_byte(gb);
232
+        av_dlog(NULL, "      opcode %02X: ", opcode);
224 233
 
225 234
         /* 0x80 means that frame is finished */
226
-        if (src[src_index] == 0x80)
227
-            return;
235
+        if (opcode == 0x80)
236
+            return 0;
228 237
 
229 238
         if (dest_index >= dest_size) {
230 239
             av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: dest_index (%d) exceeded dest_size (%d)\n",
231 240
                 dest_index, dest_size);
232
-            return;
241
+            return AVERROR_INVALIDDATA;
233 242
         }
234 243
 
235
-        if (src[src_index] == 0xFF) {
244
+        if (opcode == 0xFF) {
236 245
 
237
-            src_index++;
238
-            count = AV_RL16(&src[src_index]);
239
-            src_index += 2;
240
-            src_pos = AV_RL16(&src[src_index]);
241
-            src_index += 2;
246
+            count   = bytestream2_get_le16(gb);
247
+            src_pos = bytestream2_get_le16(gb);
242 248
             av_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
243 249
             CHECK_COUNT();
244
-            if (src_pos + count > dest_size)
245
-                return;
250
+            CHECK_COPY(src_pos);
246 251
             for (i = 0; i < count; i++)
247 252
                 dest[dest_index + i] = dest[src_pos + i];
248 253
             dest_index += count;
249 254
 
250
-        } else if (src[src_index] == 0xFE) {
255
+        } else if (opcode == 0xFE) {
251 256
 
252
-            src_index++;
253
-            count = AV_RL16(&src[src_index]);
254
-            src_index += 2;
255
-            color = src[src_index++];
257
+            count = bytestream2_get_le16(gb);
258
+            color = bytestream2_get_byte(gb);
256 259
             av_dlog(NULL, "(2) set %X bytes to %02X\n", count, color);
257 260
             CHECK_COUNT();
258 261
             memset(&dest[dest_index], color, count);
259 262
             dest_index += count;
260 263
 
261
-        } else if ((src[src_index] & 0xC0) == 0xC0) {
264
+        } else if ((opcode & 0xC0) == 0xC0) {
262 265
 
263
-            count = (src[src_index++] & 0x3F) + 3;
264
-            src_pos = AV_RL16(&src[src_index]);
265
-            src_index += 2;
266
+            count = (opcode & 0x3F) + 3;
267
+            src_pos = bytestream2_get_le16(gb);
266 268
             av_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
267 269
             CHECK_COUNT();
268
-            if (src_pos + count > dest_size)
269
-                return;
270
+            CHECK_COPY(src_pos);
270 271
             for (i = 0; i < count; i++)
271 272
                 dest[dest_index + i] = dest[src_pos + i];
272 273
             dest_index += count;
273 274
 
274
-        } else if (src[src_index] > 0x80) {
275
+        } else if (opcode > 0x80) {
275 276
 
276
-            count = src[src_index++] & 0x3F;
277
+            count = opcode & 0x3F;
277 278
             av_dlog(NULL, "(4) copy %X bytes from source to dest\n", count);
278 279
             CHECK_COUNT();
279
-            memcpy(&dest[dest_index], &src[src_index], count);
280
-            src_index += count;
280
+            bytestream2_get_buffer(gb, &dest[dest_index], count);
281 281
             dest_index += count;
282 282
 
283 283
         } else {
284 284
 
285
-            count = ((src[src_index] & 0x70) >> 4) + 3;
286
-            src_pos = AV_RB16(&src[src_index]) & 0x0FFF;
287
-            src_index += 2;
285
+            count = ((opcode & 0x70) >> 4) + 3;
286
+            src_pos = bytestream2_get_byte(gb) | ((opcode & 0x0F) << 8);
288 287
             av_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
289 288
             CHECK_COUNT();
290
-            if (dest_index < src_pos)
291
-                return;
289
+            CHECK_COPY(dest_index - src_pos);
292 290
             for (i = 0; i < count; i++)
293 291
                 dest[dest_index + i] = dest[dest_index - src_pos + i];
294 292
             dest_index += count;
... ...
@@ -303,9 +297,11 @@ static void decode_format80(const unsigned char *src, int src_size,
303 303
         if (dest_index < dest_size)
304 304
             av_log(NULL, AV_LOG_ERROR, "  VQA video: decode_format80 problem: decode finished with dest_index (%d) < dest_size (%d)\n",
305 305
                 dest_index, dest_size);
306
+
307
+    return 0; // let's display what we decoded anyway
306 308
 }
307 309
 
308
-static void vqa_decode_chunk(VqaContext *s)
310
+static int vqa_decode_chunk(VqaContext *s)
309 311
 {
310 312
     unsigned int chunk_type;
311 313
     unsigned int chunk_size;
... ...
@@ -314,6 +310,7 @@ static void vqa_decode_chunk(VqaContext *s)
314 314
     int i;
315 315
     unsigned char r, g, b;
316 316
     int index_shift;
317
+    int res;
317 318
 
318 319
     int cbf0_chunk = -1;
319 320
     int cbfz_chunk = -1;
... ...
@@ -333,17 +330,11 @@ static void vqa_decode_chunk(VqaContext *s)
333 333
     int hibytes = s->decode_buffer_size / 2;
334 334
 
335 335
     /* first, traverse through the frame and find the subchunks */
336
-    while (index + CHUNK_PREAMBLE_SIZE <= s->size) {
337
-        unsigned next_index;
336
+    while (bytestream2_get_bytes_left(&s->gb) >= 8) {
338 337
 
339
-        chunk_type = AV_RB32(&s->buf[index]);
340
-        chunk_size = AV_RB32(&s->buf[index + 4]);
341
-        byte_skip = chunk_size & 0x01;
342
-        next_index = index + CHUNK_PREAMBLE_SIZE + chunk_size + byte_skip;
343
-        if (next_index > s->size) {
344
-            av_log(s->avctx, AV_LOG_ERROR, "Dropping incomplete chunk\n");
345
-            break;
346
-        }
338
+        chunk_type = bytestream2_get_be32u(&s->gb);
339
+        index      = bytestream2_tell(&s->gb);
340
+        chunk_size = bytestream2_get_be32u(&s->gb);
347 341
 
348 342
         switch (chunk_type) {
349 343
 
... ...
@@ -384,7 +375,9 @@ static void vqa_decode_chunk(VqaContext *s)
384 384
             chunk_type);
385 385
             break;
386 386
         }
387
-        index = next_index;
387
+
388
+        byte_skip = chunk_size & 0x01;
389
+        bytestream2_skip(&s->gb, chunk_size + byte_skip);
388 390
     }
389 391
 
390 392
     /* next, deal with the palette */
... ...
@@ -392,7 +385,7 @@ static void vqa_decode_chunk(VqaContext *s)
392 392
 
393 393
         /* a chunk should not have both chunk types */
394 394
         av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found both CPL0 and CPLZ chunks\n");
395
-        return;
395
+        return AVERROR_INVALIDDATA;
396 396
     }
397 397
 
398 398
     /* decompress the palette chunk */
... ...
@@ -405,19 +398,19 @@ static void vqa_decode_chunk(VqaContext *s)
405 405
     /* convert the RGB palette into the machine's endian format */
406 406
     if (cpl0_chunk != -1) {
407 407
 
408
-        chunk_size = AV_RB32(&s->buf[cpl0_chunk + 4]);
408
+        bytestream2_seek(&s->gb, cpl0_chunk, SEEK_SET);
409
+        chunk_size = bytestream2_get_be32(&s->gb);
409 410
         /* sanity check the palette size */
410 411
         if (chunk_size / 3 > 256) {
411 412
             av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found a palette chunk with %d colors\n",
412 413
                 chunk_size / 3);
413
-            return;
414
+            return AVERROR_INVALIDDATA;
414 415
         }
415
-        cpl0_chunk += CHUNK_PREAMBLE_SIZE;
416 416
         for (i = 0; i < chunk_size / 3; i++) {
417 417
             /* scale by 4 to transform 6-bit palette -> 8-bit */
418
-            r = s->buf[cpl0_chunk++] * 4;
419
-            g = s->buf[cpl0_chunk++] * 4;
420
-            b = s->buf[cpl0_chunk++] * 4;
418
+            r = bytestream2_get_byteu(&s->gb) * 4;
419
+            g = bytestream2_get_byteu(&s->gb) * 4;
420
+            b = bytestream2_get_byteu(&s->gb) * 4;
421 421
             s->palette[i] = 0xFF << 24 | r << 16 | g << 8 | b;
422 422
             s->palette[i] |= s->palette[i] >> 6 & 0x30303;
423 423
         }
... ...
@@ -428,31 +421,32 @@ static void vqa_decode_chunk(VqaContext *s)
428 428
 
429 429
         /* a chunk should not have both chunk types */
430 430
         av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found both CBF0 and CBFZ chunks\n");
431
-        return;
431
+        return AVERROR_INVALIDDATA;
432 432
     }
433 433
 
434 434
     /* decompress the full codebook chunk */
435 435
     if (cbfz_chunk != -1) {
436 436
 
437
-        chunk_size = AV_RB32(&s->buf[cbfz_chunk + 4]);
438
-        cbfz_chunk += CHUNK_PREAMBLE_SIZE;
439
-        decode_format80(&s->buf[cbfz_chunk], chunk_size,
440
-            s->codebook, s->codebook_size, 0);
437
+        bytestream2_seek(&s->gb, cbfz_chunk, SEEK_SET);
438
+        chunk_size = bytestream2_get_be32(&s->gb);
439
+        if ((res = decode_format80(&s->gb, chunk_size, s->codebook,
440
+                                   s->codebook_size, 0)) < 0)
441
+            return res;
441 442
     }
442 443
 
443 444
     /* copy a full codebook */
444 445
     if (cbf0_chunk != -1) {
445 446
 
446
-        chunk_size = AV_RB32(&s->buf[cbf0_chunk + 4]);
447
+        bytestream2_seek(&s->gb, cbf0_chunk, SEEK_SET);
448
+        chunk_size = bytestream2_get_be32(&s->gb);
447 449
         /* sanity check the full codebook size */
448 450
         if (chunk_size > MAX_CODEBOOK_SIZE) {
449 451
             av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: CBF0 chunk too large (0x%X bytes)\n",
450 452
                 chunk_size);
451
-            return;
453
+            return AVERROR_INVALIDDATA;
452 454
         }
453
-        cbf0_chunk += CHUNK_PREAMBLE_SIZE;
454 455
 
455
-        memcpy(s->codebook, &s->buf[cbf0_chunk], chunk_size);
456
+        bytestream2_get_buffer(&s->gb, s->codebook, chunk_size);
456 457
     }
457 458
 
458 459
     /* decode the frame */
... ...
@@ -460,13 +454,14 @@ static void vqa_decode_chunk(VqaContext *s)
460 460
 
461 461
         /* something is wrong if there is no VPTZ chunk */
462 462
         av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: no VPTZ chunk found\n");
463
-        return;
463
+        return AVERROR_INVALIDDATA;
464 464
     }
465 465
 
466
-    chunk_size = AV_RB32(&s->buf[vptz_chunk + 4]);
467
-    vptz_chunk += CHUNK_PREAMBLE_SIZE;
468
-    decode_format80(&s->buf[vptz_chunk], chunk_size,
469
-        s->decode_buffer, s->decode_buffer_size, 1);
466
+    bytestream2_seek(&s->gb, vptz_chunk, SEEK_SET);
467
+    chunk_size = bytestream2_get_be32(&s->gb);
468
+    if ((res = decode_format80(&s->gb, chunk_size,
469
+                               s->decode_buffer, s->decode_buffer_size, 1)) < 0)
470
+        return res;
470 471
 
471 472
     /* render the final PAL8 frame */
472 473
     if (s->vector_height == 4)
... ...
@@ -530,17 +525,17 @@ static void vqa_decode_chunk(VqaContext *s)
530 530
     if ((cbp0_chunk != -1) && (cbpz_chunk != -1)) {
531 531
         /* a chunk should not have both chunk types */
532 532
         av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: found both CBP0 and CBPZ chunks\n");
533
-        return;
533
+        return AVERROR_INVALIDDATA;
534 534
     }
535 535
 
536 536
     if (cbp0_chunk != -1) {
537 537
 
538
-        chunk_size = AV_RB32(&s->buf[cbp0_chunk + 4]);
539
-        cbp0_chunk += CHUNK_PREAMBLE_SIZE;
538
+        bytestream2_seek(&s->gb, cbp0_chunk, SEEK_SET);
539
+        chunk_size = bytestream2_get_be32(&s->gb);
540 540
 
541 541
         /* accumulate partial codebook */
542
-        memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
543
-            &s->buf[cbp0_chunk], chunk_size);
542
+        bytestream2_get_buffer(&s->gb, &s->next_codebook_buffer[s->next_codebook_buffer_index],
543
+                               chunk_size);
544 544
         s->next_codebook_buffer_index += chunk_size;
545 545
 
546 546
         s->partial_countdown--;
... ...
@@ -558,39 +553,39 @@ static void vqa_decode_chunk(VqaContext *s)
558 558
 
559 559
     if (cbpz_chunk != -1) {
560 560
 
561
-        chunk_size = AV_RB32(&s->buf[cbpz_chunk + 4]);
562
-        cbpz_chunk += CHUNK_PREAMBLE_SIZE;
561
+        bytestream2_seek(&s->gb, cbpz_chunk, SEEK_SET);
562
+        chunk_size = bytestream2_get_be32(&s->gb);
563 563
 
564 564
         /* accumulate partial codebook */
565
-        memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
566
-            &s->buf[cbpz_chunk], chunk_size);
565
+        bytestream2_get_buffer(&s->gb, &s->next_codebook_buffer[s->next_codebook_buffer_index],
566
+                               chunk_size);
567 567
         s->next_codebook_buffer_index += chunk_size;
568 568
 
569 569
         s->partial_countdown--;
570 570
         if (s->partial_countdown == 0) {
571
+            GetByteContext gb;
571 572
 
573
+            bytestream2_init(&gb, s->next_codebook_buffer, s->next_codebook_buffer_index);
572 574
             /* decompress codebook */
573
-            decode_format80(s->next_codebook_buffer,
574
-                s->next_codebook_buffer_index,
575
-                s->codebook, s->codebook_size, 0);
575
+            if ((res = decode_format80(&gb, s->next_codebook_buffer_index,
576
+                                       s->codebook, s->codebook_size, 0)) < 0)
577
+                return res;
576 578
 
577 579
             /* reset accounting */
578 580
             s->next_codebook_buffer_index = 0;
579 581
             s->partial_countdown = s->partial_count;
580 582
         }
581 583
     }
584
+
585
+    return 0;
582 586
 }
583 587
 
584 588
 static int vqa_decode_frame(AVCodecContext *avctx,
585 589
                             void *data, int *data_size,
586 590
                             AVPacket *avpkt)
587 591
 {
588
-    const uint8_t *buf = avpkt->data;
589
-    int buf_size = avpkt->size;
590 592
     VqaContext *s = avctx->priv_data;
591
-
592
-    s->buf = buf;
593
-    s->size = buf_size;
593
+    int res;
594 594
 
595 595
     if (s->frame.data[0])
596 596
         avctx->release_buffer(avctx, &s->frame);
... ...
@@ -600,7 +595,9 @@ static int vqa_decode_frame(AVCodecContext *avctx,
600 600
         return -1;
601 601
     }
602 602
 
603
-    vqa_decode_chunk(s);
603
+    bytestream2_init(&s->gb, avpkt->data, avpkt->size);
604
+    if ((res = vqa_decode_chunk(s)) < 0)
605
+        return res;
604 606
 
605 607
     /* make the palette available on the way out */
606 608
     memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4);
... ...
@@ -610,7 +607,7 @@ static int vqa_decode_frame(AVCodecContext *avctx,
610 610
     *(AVFrame*)data = s->frame;
611 611
 
612 612
     /* report that the buffer was completely consumed */
613
-    return buf_size;
613
+    return avpkt->size;
614 614
 }
615 615
 
616 616
 static av_cold int vqa_decode_end(AVCodecContext *avctx)
617 617
new file mode 100644
... ...
@@ -0,0 +1,86 @@
0
+/*
1
+ * XBM image format
2
+ *
3
+ * Copyright (c) 2012 Paul B Mahol
4
+ *
5
+ * This file is part of Libav.
6
+ *
7
+ * Libav is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * Libav is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with Libav; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+#include "avcodec.h"
23
+#include "internal.h"
24
+
25
+static av_cold int xbm_encode_init(AVCodecContext *avctx)
26
+{
27
+    avctx->coded_frame = avcodec_alloc_frame();
28
+    if (!avctx->coded_frame)
29
+        return AVERROR(ENOMEM);
30
+    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
31
+
32
+    return 0;
33
+}
34
+
35
+static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
36
+                            const AVFrame *p, int *got_packet)
37
+{
38
+    int i, j, ret, size, linesize;
39
+    uint8_t *ptr, *buf;
40
+
41
+    linesize = (avctx->width + 7) / 8;
42
+    size     = avctx->height * (linesize * 7 + 2) + 110;
43
+    if ((ret = ff_alloc_packet(pkt, size)) < 0) {
44
+        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
45
+        return ret;
46
+    }
47
+
48
+    buf = pkt->data;
49
+    ptr = p->data[0];
50
+
51
+    buf += snprintf(buf, 32, "#define image_width %u\n", avctx->width);
52
+    buf += snprintf(buf, 33, "#define image_height %u\n", avctx->height);
53
+    buf += snprintf(buf, 40, "static unsigned char image_bits[] = {\n");
54
+    for (i = 0; i < avctx->height; i++) {
55
+        for (j = 0; j < linesize; j++)
56
+            buf += snprintf(buf, 7, " 0x%02X,", av_reverse[*ptr++]);
57
+        ptr += p->linesize[0] - linesize;
58
+        buf += snprintf(buf, 2, "\n");
59
+    }
60
+    buf += snprintf(buf, 5, " };\n");
61
+
62
+    pkt->size   = buf - pkt->data;
63
+    pkt->flags |= AV_PKT_FLAG_KEY;
64
+    *got_packet = 1;
65
+    return 0;
66
+}
67
+
68
+static av_cold int xbm_encode_close(AVCodecContext *avctx)
69
+{
70
+    av_freep(&avctx->coded_frame);
71
+
72
+    return 0;
73
+}
74
+
75
+AVCodec ff_xbm_encoder = {
76
+    .name         = "xbm",
77
+    .type         = AVMEDIA_TYPE_VIDEO,
78
+    .id           = CODEC_ID_XBM,
79
+    .init         = xbm_encode_init,
80
+    .encode2      = xbm_encode_frame,
81
+    .close        = xbm_encode_close,
82
+    .pix_fmts     = (const enum PixelFormat[]) { PIX_FMT_MONOWHITE,
83
+                                                 PIX_FMT_NONE },
84
+    .long_name    = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
85
+};
... ...
@@ -45,43 +45,43 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
45 45
     uint32_t pixformat, pixdepth, bunit, bitorder, bpad;
46 46
     uint32_t rgb[3];
47 47
     uint8_t *ptr;
48
+    GetByteContext gb;
48 49
 
49 50
     if (buf_size < XWD_HEADER_SIZE)
50 51
         return AVERROR_INVALIDDATA;
51 52
 
52
-    header_size = bytestream_get_be32(&buf);
53
-    if (buf_size < header_size)
54
-        return AVERROR_INVALIDDATA;
53
+    bytestream2_init(&gb, buf, buf_size);
54
+    header_size = bytestream2_get_be32u(&gb);
55 55
 
56
-    version = bytestream_get_be32(&buf);
56
+    version = bytestream2_get_be32u(&gb);
57 57
     if (version != XWD_VERSION) {
58 58
         av_log(avctx, AV_LOG_ERROR, "unsupported version\n");
59 59
         return AVERROR_INVALIDDATA;
60 60
     }
61 61
 
62
-    if (header_size < XWD_HEADER_SIZE) {
62
+    if (buf_size < header_size || header_size < XWD_HEADER_SIZE) {
63 63
         av_log(avctx, AV_LOG_ERROR, "invalid header size\n");
64 64
         return AVERROR_INVALIDDATA;
65 65
     }
66 66
 
67
-    pixformat     = bytestream_get_be32(&buf);
68
-    pixdepth      = bytestream_get_be32(&buf);
69
-    avctx->width  = bytestream_get_be32(&buf);
70
-    avctx->height = bytestream_get_be32(&buf);
71
-    xoffset       = bytestream_get_be32(&buf);
72
-    be            = bytestream_get_be32(&buf);
73
-    bunit         = bytestream_get_be32(&buf);
74
-    bitorder      = bytestream_get_be32(&buf);
75
-    bpad          = bytestream_get_be32(&buf);
76
-    bpp           = bytestream_get_be32(&buf);
77
-    lsize         = bytestream_get_be32(&buf);
78
-    vclass        = bytestream_get_be32(&buf);
79
-    rgb[0]        = bytestream_get_be32(&buf);
80
-    rgb[1]        = bytestream_get_be32(&buf);
81
-    rgb[2]        = bytestream_get_be32(&buf);
82
-    buf          += 8;
83
-    ncolors       = bytestream_get_be32(&buf);
84
-    buf          += header_size - (XWD_HEADER_SIZE - 20);
67
+    pixformat     = bytestream2_get_be32u(&gb);
68
+    pixdepth      = bytestream2_get_be32u(&gb);
69
+    avctx->width  = bytestream2_get_be32u(&gb);
70
+    avctx->height = bytestream2_get_be32u(&gb);
71
+    xoffset       = bytestream2_get_be32u(&gb);
72
+    be            = bytestream2_get_be32u(&gb);
73
+    bunit         = bytestream2_get_be32u(&gb);
74
+    bitorder      = bytestream2_get_be32u(&gb);
75
+    bpad          = bytestream2_get_be32u(&gb);
76
+    bpp           = bytestream2_get_be32u(&gb);
77
+    lsize         = bytestream2_get_be32u(&gb);
78
+    vclass        = bytestream2_get_be32u(&gb);
79
+    rgb[0]        = bytestream2_get_be32u(&gb);
80
+    rgb[1]        = bytestream2_get_be32u(&gb);
81
+    rgb[2]        = bytestream2_get_be32u(&gb);
82
+    bytestream2_skipu(&gb, 8);
83
+    ncolors       = bytestream2_get_be32u(&gb);
84
+    bytestream2_skipu(&gb, header_size - (XWD_HEADER_SIZE - 20));
85 85
 
86 86
     av_log(avctx, AV_LOG_DEBUG, "pixformat %d, pixdepth %d, bunit %d, bitorder %d, bpad %d\n",
87 87
            pixformat, pixdepth, bunit, bitorder, bpad);
... ...
@@ -143,7 +143,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
143 143
         return AVERROR_INVALIDDATA;
144 144
     }
145 145
 
146
-    if (buf_size < header_size + ncolors * XWD_CMAP_SIZE + avctx->height * lsize) {
146
+    if (bytestream2_get_bytes_left(&gb) < ncolors * XWD_CMAP_SIZE + avctx->height * lsize) {
147 147
         av_log(avctx, AV_LOG_ERROR, "input buffer too small\n");
148 148
         return AVERROR_INVALIDDATA;
149 149
     }
... ...
@@ -192,7 +192,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
192 192
             else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)
193 193
                 avctx->pix_fmt = be ? PIX_FMT_ABGR : PIX_FMT_RGBA;
194 194
         }
195
-        buf += ncolors * XWD_CMAP_SIZE;
195
+        bytestream2_skipu(&gb, ncolors * XWD_CMAP_SIZE);
196 196
         break;
197 197
     default:
198 198
         av_log(avctx, AV_LOG_ERROR, "invalid visual class\n");
... ...
@@ -222,11 +222,13 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
222 222
 
223 223
         for (i = 0; i < ncolors; i++) {
224 224
 
225
-            buf   += 4;  // skip colormap entry number
226
-            red    = *buf; buf += 2;
227
-            green  = *buf; buf += 2;
228
-            blue   = *buf; buf += 2;
229
-            buf   += 2;  // skip bitmask flag and padding
225
+            bytestream2_skipu(&gb, 4); // skip colormap entry number
226
+            red    = bytestream2_get_byteu(&gb);
227
+            bytestream2_skipu(&gb, 1);
228
+            green  = bytestream2_get_byteu(&gb);
229
+            bytestream2_skipu(&gb, 1);
230
+            blue   = bytestream2_get_byteu(&gb);
231
+            bytestream2_skipu(&gb, 3); // skip bitmask flag and padding
230 232
 
231 233
             dst[i] = red << 16 | green << 8 | blue;
232 234
         }
... ...
@@ -234,8 +236,8 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
234 234
 
235 235
     ptr = p->data[0];
236 236
     for (i = 0; i < avctx->height; i++) {
237
-        bytestream_get_buffer(&buf, ptr, rsize);
238
-        buf += lsize - rsize;
237
+        bytestream2_get_bufferu(&gb, ptr, rsize);
238
+        bytestream2_skipu(&gb, lsize - rsize);
239 239
         ptr += p->linesize[0];
240 240
     }
241 241
 
... ...
@@ -71,6 +71,7 @@ static const IdStrMap img_tags[] = {
71 71
     { CODEC_ID_JPEG2000  , "jpc"},
72 72
     { CODEC_ID_DPX       , "dpx"},
73 73
     { CODEC_ID_PICTOR    , "pic"},
74
+    { CODEC_ID_XBM       , "xbm"},
74 75
     { CODEC_ID_XWD       , "xwd"},
75 76
     { CODEC_ID_NONE      , NULL}
76 77
 };
... ...
@@ -153,7 +153,7 @@ AVOutputFormat ff_image2_muxer = {
153 153
     .long_name      = NULL_IF_CONFIG_SMALL("image2 sequence"),
154 154
     .extensions     = "bmp,dpx,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
155 155
                       "ppm,sgi,tga,tif,tiff,jp2,j2c,xwd,sun,ras,rs,im1,im8,im24,"
156
-                      "sunras",
156
+                      "sunras,xbm",
157 157
     .priv_data_size = sizeof(VideoMuxData),
158 158
     .video_codec    = CODEC_ID_MJPEG,
159 159
     .write_header   = write_header,
... ...
@@ -1749,14 +1749,6 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
1749 1749
 
1750 1750
 static int seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, int flags){
1751 1751
     int64_t pos_min, pos_max;
1752
-#if 0
1753
-    AVStream *st;
1754
-
1755
-    if (stream_index < 0)
1756
-        return -1;
1757
-
1758
-    st= s->streams[stream_index];
1759
-#endif
1760 1752
 
1761 1753
     pos_min = s->data_offset;
1762 1754
     pos_max = avio_size(s->pb) - 1;
... ...
@@ -1766,9 +1758,6 @@ static int seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, in
1766 1766
 
1767 1767
     avio_seek(s->pb, pos, SEEK_SET);
1768 1768
 
1769
-#if 0
1770
-    av_update_cur_dts(s, st, ts);
1771
-#endif
1772 1769
     return 0;
1773 1770
 }
1774 1771
 
... ...
@@ -2593,10 +2582,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
2593 2593
     }
2594 2594
     for(i=0;i<ic->nb_streams;i++) {
2595 2595
         st = ic->streams[i];
2596
-        if (st->codec_info_nb_frames>2 && !st->avg_frame_rate.num && st->info->codec_info_duration)
2597
-            av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
2598
-                     (st->codec_info_nb_frames-2)*(int64_t)st->time_base.den,
2599
-                      st->info->codec_info_duration*(int64_t)st->time_base.num, 60000);
2600 2596
         if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
2601 2597
             if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample){
2602 2598
                 uint32_t tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
... ...
@@ -2604,6 +2589,10 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
2604 2604
                     st->codec->codec_tag= tag;
2605 2605
             }
2606 2606
 
2607
+            if (st->codec_info_nb_frames>2 && !st->avg_frame_rate.num && st->info->codec_info_duration)
2608
+                av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
2609
+                          (st->codec_info_nb_frames-2)*(int64_t)st->time_base.den,
2610
+                          st->info->codec_info_duration*(int64_t)st->time_base.num, 60000);
2607 2611
             // the check for tb_unreliable() is not completely correct, since this is not about handling
2608 2612
             // a unreliable/inexact time base, but a time base that is finer than necessary, as e.g.
2609 2613
             // ipmovie.c produces.
... ...
@@ -2674,31 +2663,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
2674 2674
 
2675 2675
     compute_chapters_end(ic);
2676 2676
 
2677
-#if 0
2678
-    /* correct DTS for B-frame streams with no timestamps */
2679
-    for(i=0;i<ic->nb_streams;i++) {
2680
-        st = ic->streams[i];
2681
-        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
2682
-            if(b-frames){
2683
-                ppktl = &ic->packet_buffer;
2684
-                while(ppkt1){
2685
-                    if(ppkt1->stream_index != i)
2686
-                        continue;
2687
-                    if(ppkt1->pkt->dts < 0)
2688
-                        break;
2689
-                    if(ppkt1->pkt->pts != AV_NOPTS_VALUE)
2690
-                        break;
2691
-                    ppkt1->pkt->dts -= delta;
2692
-                    ppkt1= ppkt1->next;
2693
-                }
2694
-                if(ppkt1)
2695
-                    continue;
2696
-                st->cur_dts -= delta;
2697
-            }
2698
-        }
2699
-    }
2700
-#endif
2701
-
2702 2677
  find_stream_info_err:
2703 2678
     for (i=0; i < ic->nb_streams; i++) {
2704 2679
         if (ic->streams[i]->codec)
... ...
@@ -31,8 +31,7 @@ repfile="${outdir}/${test}.rep"
31 31
 # $1=value1, $2=value2, $3=threshold
32 32
 # prints 0 if absolute difference between value1 and value2 is <= threshold
33 33
 compare(){
34
-    v=$(echo "scale=2; if ($1 >= $2) { $1 - $2 } else { $2 - $1 }" | bc)
35
-    echo "if ($v <= $3) { 0 } else { 1 }" | bc
34
+    echo "scale=2; v = $1 - $2; if (v < 0) v = -v; if (v > $3) r = 1; r" | bc
36 35
 }
37 36
 
38 37
 do_tiny_psnr(){
... ...
@@ -70,7 +70,6 @@
70 70
 1,      53654,      53654,     1470,     2940, 0xac8bb6c8
71 71
 0,         37,         37,        1,   192000, 0xb58c1566
72 72
 1,      55124,      55124,     1470,     2940, 0xa503c73b
73
-0,         38,         38,        1,   192000, 0xb58c1566
74 73
 1,      56594,      56594,     1470,     2940, 0x7cd588a3
75 74
 1,      58064,      58064,     1470,     2940, 0xa6974b04
76 75
 1,      59534,      59534,     1470,     2940, 0xbf448241