History

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

Michael Niedermayer committed 14 years ago

Commit bae053f2 parents 7f4c5ab a56fba520 files · +464 −392Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t