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
1515 - libutvideo encoder wrapper (--enable-libutvideo)
1616 - swapuv filter
1717 - bbox filter
18+- XBM encoder
1819
1920
2021 version 0.10:
cmdutils.c+1−1
@@ -1064,7 +1064,7 @@ FILE *get_preset_file(char *filename, size_t filename_size, · 1063 unmodified lines
10641064 if (!f && codec_name) {
10651065 snprintf(filename, filename_size,
10661066 "%s%s/%s-%s.ffpreset",
1067− base[i], i != 1 ? "" : "/.ffmpeg", codec_name,
1067+ base[i], i != 1 ? "" : "/.ffmpeg", codec_name,
10681068 preset_name);
10691069 f = fopen(filename, "r");
10701070 }
cmdutils.h+1−1
@@ -357,7 +357,7 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size); · 356 unmodified lines
357357 * at configuration time or in a "ffpresets" folder along the executable
358358 * on win32, in that order. If no such file is found and
359359 * 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.
361361 *
362362 * @param filename buffer where the name of the found filename is written
363363 * @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
605605 2011-01-31 - 910b5b8 - lavfi 1.75.0 - AVFilterLink sample_aspect_ratio
606606 Add sample_aspect_ratio field to AVFilterLink.
607607
608−2011-01-15 - r26374 - lavfi 1.74.0 - AVFilterBufferRefAudioProps
608+2011-01-15 - a242ac3 - lavfi 1.74.0 - AVFilterBufferRefAudioProps
609609 Rename AVFilterBufferRefAudioProps.samples_nb to nb_samples.
610610
611−2011-01-14 - r26330 - lavf 52.93.0 - av_metadata_copy()
611+2011-01-14 - 7f88a5b - lavf 52.93.0 - av_metadata_copy()
612612 Add av_metadata_copy() in avformat.h.
613613
614−2011-01-07 - r26262 - lavc 52.107.0 - deprecate reordered_opaque
614+2011-01-07 - 81c623f - lavc 52.107.0 - deprecate reordered_opaque
615615 Deprecate reordered_opaque in favor of pkt_pts/dts.
616616
617−2011-01-07 - r26261 - lavc 52.106.0 - pkt_dts
617+2011-01-07 - 1919fea - lavc 52.106.0 - pkt_dts
618618 Add pkt_dts to AVFrame, this will in the future allow multithreading decoders
619619 to not mess up dts.
620620
621−2011-01-07 - r26260 - lavc 52.105.0 - pkt_pts
621+2011-01-07 - 393cbb9 - lavc 52.105.0 - pkt_pts
622622 Add pkt_pts to AVFrame.
623623
624−2011-01-07 - r26259 - lavc 52.104.0 - av_get_profile_name()
624+2011-01-07 - 060ec0a - lavc 52.104.0 - av_get_profile_name()
625625 Add av_get_profile_name to libavcodec/avcodec.h.
626626
627−2010-12-27 - r26108 - lavfi 1.71.0 - AV_PERM_NEG_LINESIZES
627+2010-12-27 - 0ccabee - lavfi 1.71.0 - AV_PERM_NEG_LINESIZES
628628 Add AV_PERM_NEG_LINESIZES in avfilter.h.
629629
630−2010-12-27 - r26104 - lavf 52.91.0 - av_find_best_stream()
630+2010-12-27 - 9128ae0 - lavf 52.91.0 - av_find_best_stream()
631631 Add av_find_best_stream to libavformat/avformat.h.
632632
633−2010-12-27 - r26103 - lavf 52.90.0
633+2010-12-27 - 107a7e3 - lavf 52.90.0
634634 Add AVFMT_NOSTREAMS flag for formats with no streams,
635635 like e.g. text metadata.
636636
637−2010-12-22 - r26073 - lavu 50.36.0 - file.h
637+2010-12-22 - 0328b9e - lavu 50.36.0 - file.h
638638 Add functions av_file_map() and av_file_unmap() in file.h.
639639
640−2010-12-19 - r26056 - lavu 50.35.0 - error.h
640+2010-12-19 - 0bc55f5 - lavu 50.35.0 - error.h
641641 Add "not found" error codes:
642642 AVERROR_DEMUXER_NOT_FOUND
643643 AVERROR_MUXER_NOT_FOUND
@@ -648,28 +648,28 @@ API changes, most recent first: · 4 unmodified lines
648648 AVERROR_BSF_NOT_FOUND
649649 AVERROR_STREAM_NOT_FOUND
650650
651−2010-12-09 - r25923 - lavcore 0.16.0 - avcore.h
651+2010-12-09 - c61cdd0 - lavcore 0.16.0 - avcore.h
652652 Move AV_NOPTS_VALUE, AV_TIME_BASE, AV_TIME_BASE_Q symbols from
653653 avcodec.h to avcore.h.
654654
655−2010-12-04 - r25886 - lavc 52.98.0 - CODEC_CAP_NEG_LINESIZES
655+2010-12-04 - 16cfc96 - lavc 52.98.0 - CODEC_CAP_NEG_LINESIZES
656656 Add CODEC_CAP_NEG_LINESIZES codec capability flag in avcodec.h.
657657
658−2010-12-04 - r25879 - lavu 50.34.0 - av_get_pix_fmt_string()
658+2010-12-04 - bb4afa1 - lavu 50.34.0 - av_get_pix_fmt_string()
659659 Deprecate avcodec_pix_fmt_string() in favor of
660660 pixdesc.h/av_get_pix_fmt_string().
661661
662−2010-12-04 - r25878 - lavcore 0.15.0 - av_image_alloc()
662+2010-12-04 - 4da12e3 - lavcore 0.15.0 - av_image_alloc()
663663 Add av_image_alloc() to libavcore/imgutils.h.
664664
665−2010-12-02 - r25862 - lavfi 1.67.0 - avfilter_graph_create_filter()
665+2010-12-02 - 037be76 - lavfi 1.67.0 - avfilter_graph_create_filter()
666666 Add function avfilter_graph_create_filter() in avfiltergraph.h.
667667
668−2010-11-25 - r25826 - lavfi 1.65.0 - avfilter_get_video_buffer_ref_from_arrays()
668+2010-11-25 - 4723bc2 - lavfi 1.65.0 - avfilter_get_video_buffer_ref_from_arrays()
669669 Add function avfilter_get_video_buffer_ref_from_arrays() in
670670 avfilter.h.
671671
672−2010-11-21 - r25787 - lavcore 0.14.0 - audioconvert.h
672+2010-11-21 - 176a615 - lavcore 0.14.0 - audioconvert.h
673673 Add a public audio channel API in audioconvert.h, and deprecate the
674674 corresponding functions in libavcodec:
675675 avcodec_get_channel_name()
@@ -678,23 +678,23 @@ API changes, most recent first: · 2 unmodified lines
678678 avcodec_channel_layout_num_channels()
679679 and the CH_* macros defined in libavcodec/avcodec.h.
680680
681−2010-11-21 - r25777 - lavf 52.85.0 - avformat.h
681+2010-11-21 - 6bfc268 - lavf 52.85.0 - avformat.h
682682 Add av_append_packet().
683683
684−2010-11-21 - r25776 - lavc 52.97.0 - avcodec.h
684+2010-11-21 - a08d918 - lavc 52.97.0 - avcodec.h
685685 Add av_grow_packet().
686686
687−2010-11-17 - r25761 - lavcore 0.13.0 - parseutils.h
687+2010-11-17 - 0985e1a - lavcore 0.13.0 - parseutils.h
688688 Add av_parse_color() declared in libavcore/parseutils.h.
689689
690−2010-11-13 - r25745 - lavc 52.95.0 - AVCodecContext
690+2010-11-13 - cb2c971 - lavc 52.95.0 - AVCodecContext
691691 Add AVCodecContext.subtitle_header and AVCodecContext.subtitle_header_size
692692 fields.
693693
694−2010-11-13 - r25740 - lavfi 1.62.0 - avfiltergraph.h
694+2010-11-13 - 5aaea02 - lavfi 1.62.0 - avfiltergraph.h
695695 Make avfiltergraph.h public.
696696
697−2010-11-13 - r25737 - lavfi 1.61.0 - avfiltergraph.h
697+2010-11-13 - 4fcbb2a - lavfi 1.61.0 - avfiltergraph.h
698698 Remove declarations from avfiltergraph.h for the functions:
699699 avfilter_graph_check_validity()
700700 avfilter_graph_config_links()
@@ -702,7 +702,7 @@ API changes, most recent first: · 1 unmodified line
702702 which are now internal.
703703 Use avfilter_graph_config() instead.
704704
705−2010-11-08 - r25708 - lavu 50.33.0 - eval.h
705+2010-11-08 - d2af720 - lavu 50.33.0 - eval.h
706706 Deprecate functions:
707707 av_parse_and_eval_expr(),
708708 av_parse_expr(),
@@ -714,30 +714,30 @@ API changes, most recent first: · 5 unmodified lines
714714 av_expr_eval(),
715715 av_expr_free().
716716
717−2010-11-08 - r25707 - lavfi 1.59.0 - avfilter_free()
717+2010-11-08 - 24de0ed - lavfi 1.59.0 - avfilter_free()
718718 Rename avfilter_destroy() to avfilter_free().
719719 This change breaks libavfilter API/ABI.
720720
721−2010-11-07 - r25705 - lavfi 1.58.0 - avfiltergraph.h
721+2010-11-07 - 1e80a0e - lavfi 1.58.0 - avfiltergraph.h
722722 Remove graphparser.h header, move AVFilterInOut and
723723 avfilter_graph_parse() declarations to libavfilter/avfiltergraph.h.
724724
725−2010-11-07 - r25700 - lavfi 1.57.0 - AVFilterInOut
725+2010-11-07 - 7313132 - lavfi 1.57.0 - AVFilterInOut
726726 Rename field AVFilterInOut.filter to AVFilterInOut.filter_ctx.
727727 This change breaks libavfilter API.
728728
729−2010-11-04 - r25674 - lavfi 1.56.0 - avfilter_graph_free()
729+2010-11-04 - 97dd1e4 - lavfi 1.56.0 - avfilter_graph_free()
730730 Rename avfilter_graph_destroy() to avfilter_graph_free().
731731 This change breaks libavfilter API/ABI.
732732
733−2010-11-04 - r25673 - lavfi 1.55.0 - avfilter_graph_alloc()
733+2010-11-04 - e15aeea - lavfi 1.55.0 - avfilter_graph_alloc()
734734 Add avfilter_graph_alloc() to libavfilter/avfiltergraph.h.
735735
736−2010-11-02 - r25654 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
736+2010-11-02 - 6f84cd1 - lavcore 0.12.0 - av_get_bits_per_sample_fmt()
737737 Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and
738738 deprecate av_get_bits_per_sample_format().
739739
740−2010-11-02 - r25653 - lavcore 0.11.0 - samplefmt.h
740+2010-11-02 - d63e456 - lavcore 0.11.0 - samplefmt.h
741741 Add sample format functions in libavcore/samplefmt.h:
742742 av_get_sample_fmt_name(),
743743 av_get_sample_fmt(),
@@ -747,149 +747,149 @@ API changes, most recent first: · 3 unmodified lines
747747 avcodec_get_sample_fmt(),
748748 avcodec_sample_fmt_string().
749749
750−2010-11-02 - r25652 - lavcore 0.10.0 - samplefmt.h
750+2010-11-02 - 262d1c5 - lavcore 0.10.0 - samplefmt.h
751751 Define enum AVSampleFormat in libavcore/samplefmt.h, deprecate enum
752752 SampleFormat.
753753
754−2010-10-16 - r25502 - lavfi 1.52.0 - avfilter_graph_config()
754+2010-10-16 - 2a24df9 - lavfi 1.52.0 - avfilter_graph_config()
755755 Add the function avfilter_graph_config() in avfiltergraph.h.
756756
757−2010-10-15 - r25493 - lavf 52.83.0 - metadata API
757+2010-10-15 - 03700d3 - lavf 52.83.0 - metadata API
758758 Change demuxers to export metadata in generic format and
759759 muxers to accept generic format. Deprecate the public
760760 conversion API.
761761
762−2010-10-10 - r25441 - lavfi 1.49.0 - AVFilterLink.time_base
762+2010-10-10 - 867ae7a - lavfi 1.49.0 - AVFilterLink.time_base
763763 Add time_base field to AVFilterLink.
764764
765−2010-09-27 - r25236 - lavu 50.31.0 - av_set_options_string()
765+2010-09-27 - c85eef4 - lavu 50.31.0 - av_set_options_string()
766766 Move av_set_options_string() from libavfilter/parseutils.h to
767767 libavutil/opt.h.
768768
769−2010-09-27 - r25227 - lavfi 1.47.0 - AVFilterLink
769+2010-09-27 - acc0490 - lavfi 1.47.0 - AVFilterLink
770770 Make the AVFilterLink fields srcpad and dstpad store the pointers to
771771 the source and destination pads, rather than their indexes.
772772
773−2010-09-27 - r25225 - lavu 50.30.0 - av_get_token()
773+2010-09-27 - 372e288 - lavu 50.30.0 - av_get_token()
774774 Move av_get_token() from libavfilter/parseutils.h to
775775 libavutil/avstring.h.
776776
777−2010-09-26 - r32368 - lsws 0.12.0 - swscale.h
777+2010-09-26 - 635d4ae - lsws 0.12.0 - swscale.h
778778 Add the functions sws_alloc_context() and sws_init_context().
779779
780−2010-09-26 - r25210 - lavu 50.29.0 - opt.h
780+2010-09-26 - 6ed0404 - lavu 50.29.0 - opt.h
781781 Move libavcodec/opt.h to libavutil/opt.h.
782782
783−2010-09-24 - r25174 - lavu 50.28.0 - av_log_set_flags()
783+2010-09-24 - 1c1c80f - lavu 50.28.0 - av_log_set_flags()
784784 Default of av_log() changed due to many problems to the old no repeat
785785 detection. Read the docs of AV_LOG_SKIP_REPEATED in log.h before
786786 enabling it for your app!.
787787
788−2010-09-24 - r25167 - lavc 52.90.0 - av_opt_show2()
788+2010-09-24 - f66eb58 - lavc 52.90.0 - av_opt_show2()
789789 Deprecate av_opt_show() in favor or av_opt_show2().
790790
791−2010-09-14 - r25120 - lavu 50.27.0 - av_popcount()
791+2010-09-14 - bc6f0af - lavu 50.27.0 - av_popcount()
792792 Add av_popcount() to libavutil/common.h.
793793
794−2010-09-08 - r25076 - lavu 50.26.0 - av_get_cpu_flags()
794+2010-09-08 - c6c98d0 - lavu 50.26.0 - av_get_cpu_flags()
795795 Add av_get_cpu_flags().
796796
797−2010-09-07 - r25067 - lavcore 0.9.0 - av_image_copy()
797+2010-09-07 - 34017fd - lavcore 0.9.0 - av_image_copy()
798798 Add av_image_copy().
799799
800−2010-09-07 - r25064 - lavcore 0.8.0 - av_image_copy_plane()
800+2010-09-07 - 9686abb - lavcore 0.8.0 - av_image_copy_plane()
801801 Add av_image_copy_plane().
802802
803−2010-09-07 - r25057 - lavcore 0.7.0 - imgutils.h
803+2010-09-07 - 9b7269e - lavcore 0.7.0 - imgutils.h
804804 Adopt hierarchical scheme for the imgutils.h function names,
805805 deprecate the old names.
806806
807−2010-09-04 - r25040 - lavu 50.25.0 - AV_CPU_FLAG_*
807+2010-09-04 - 7160bb7 - lavu 50.25.0 - AV_CPU_FLAG_*
808808 Deprecate the FF_MM_* flags defined in libavcodec/avcodec.h in favor
809809 of the AV_CPU_FLAG_* flags defined in libavutil/cpu.h.
810810
811−2010-08-26 - r24936 - lavc 52.87.0 - avcodec_get_channel_layout()
811+2010-08-26 - 5da19b5 - lavc 52.87.0 - avcodec_get_channel_layout()
812812 Add avcodec_get_channel_layout() in audioconvert.h.
813813
814−2010-08-20 - r24851 - lavcore 0.6.0 - av_fill_image_max_pixsteps()
814+2010-08-20 - e344336 - lavcore 0.6.0 - av_fill_image_max_pixsteps()
815815 Rename av_fill_image_max_pixstep() to av_fill_image_max_pixsteps().
816816
817−2010-08-18 - r24827 - lavcore 0.5.0 - av_fill_image_max_pixstep()
817+2010-08-18 - a6ddf8b - lavcore 0.5.0 - av_fill_image_max_pixstep()
818818 Add av_fill_image_max_pixstep() in imgutils.h.
819819
820−2010-08-17 - r24814 - lavu 50.24.0 - AV_NE()
820+2010-08-17 - 4f2d2e4 - lavu 50.24.0 - AV_NE()
821821 Add the AV_NE macro.
822822
823−2010-08-17 - r24811 - lavfi 1.36.0 - audio framework
823+2010-08-17 - ad2c950 - lavfi 1.36.0 - audio framework
824824 Implement AVFilterBufferRefAudioProps struct for audio properties,
825825 get_audio_buffer(), filter_samples() functions and related changes.
826826
827−2010-08-12 - r24787 - lavcore 0.4.0 - av_get_image_linesize()
827+2010-08-12 - 81c1eca - lavcore 0.4.0 - av_get_image_linesize()
828828 Add av_get_image_linesize() in imgutils.h.
829829
830−2010-08-11 - r24773 - lavfi 1.34.0 - AVFilterBufferRef
830+2010-08-11 - c1db7bf - lavfi 1.34.0 - AVFilterBufferRef
831831 Resize data and linesize arrays in AVFilterBufferRef to 8.
832832
833833 This change breaks libavfilter API/ABI.
834834
835−2010-08-11 - r24768 - lavc 52.85.0 - av_picture_data_copy()
835+2010-08-11 - 9f08d80 - lavc 52.85.0 - av_picture_data_copy()
836836 Add av_picture_data_copy in avcodec.h.
837837
838−2010-08-11 - r24765 - lavfi 1.33.0 - avfilter_open()
838+2010-08-11 - 84c0386 - lavfi 1.33.0 - avfilter_open()
839839 Change avfilter_open() signature:
840840 AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name) ->
841841 int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
842842
843843 This change breaks libavfilter API/ABI.
844844
845−2010-08-11 - r24763 - lavfi 1.32.0 - AVFilterBufferRef
845+2010-08-11 - cc80caf - lavfi 1.32.0 - AVFilterBufferRef
846846 Add a type field to AVFilterBufferRef, and move video specific
847847 properties to AVFilterBufferRefVideoProps.
848848
849849 This change breaks libavfilter API/ABI.
850850
851−2010-08-07 - r24732 - lavfi 1.31.0 - AVFilterLink
851+2010-08-07 - 5d4890d - lavfi 1.31.0 - AVFilterLink
852852 Rename AVFilterLink fields:
853853 AVFilterLink.srcpic -> AVFilterLink.src_buf
854854 AVFilterLink.cur_pic -> AVFilterLink.cur_buf
855855 AVFilterLink.outpic -> AVFilterLink.out_buf
856856
857−2010-08-07 - r24731 - lavfi 1.30.0
857+2010-08-07 - 7fce481 - lavfi 1.30.0
858858 Rename functions and fields:
859859 avfilter_(un)ref_pic -> avfilter_(un)ref_buffer
860860 avfilter_copy_picref_props -> avfilter_copy_buffer_ref_props
861861 AVFilterBufferRef.pic -> AVFilterBufferRef.buffer
862862
863−2010-08-07 - r24730 - lavfi 1.29.0 - AVFilterBufferRef
863+2010-08-07 - ecc8dad - lavfi 1.29.0 - AVFilterBufferRef
864864 Rename AVFilterPicRef to AVFilterBufferRef.
865865
866−2010-08-07 - r24728 - lavfi 1.28.0 - AVFilterBuffer
866+2010-08-07 - d54e094 - lavfi 1.28.0 - AVFilterBuffer
867867 Move format field from AVFilterBuffer to AVFilterPicRef.
868868
869−2010-08-06 - r24709 - lavcore 0.3.0 - av_check_image_size()
869+2010-08-06 - bf176f5 - lavcore 0.3.0 - av_check_image_size()
870870 Deprecate avcodec_check_dimensions() in favor of the function
871871 av_check_image_size() defined in libavcore/imgutils.h.
872872
873−2010-07-30 - r24592 - lavfi 1.27.0 - AVFilterBuffer
873+2010-07-30 - 56b5e9d - lavfi 1.27.0 - AVFilterBuffer
874874 Increase size of the arrays AVFilterBuffer.data and
875875 AVFilterBuffer.linesize from 4 to 8.
876876
877877 This change breaks libavfilter ABI.
878878
879−2010-07-29 - r24583 - lavcore 0.2.0 - imgutils.h
879+2010-07-29 - e7bd48a - lavcore 0.2.0 - imgutils.h
880880 Add functions av_fill_image_linesizes() and
881881 av_fill_image_pointers(), declared in libavcore/imgutils.h.
882882
883−2010-07-27 - r24518 - lavcore 0.1.0 - parseutils.h
883+2010-07-27 - 126b638 - lavcore 0.1.0 - parseutils.h
884884 Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate()
885885 defined in libavcodec in favor of the newly added functions
886886 av_parse_video_size() and av_parse_video_rate() declared in
887887 libavcore/parseutils.h.
888888
889−2010-07-23 - r24439 - lavu 50.23.0 - mathematics.h
889+2010-07-23 - 4485247 - lavu 50.23.0 - mathematics.h
890890 Add the M_PHI constant definition.
891891
892−2010-07-22 - r24424 - lavfi 1.26.0 - media format generalization
892+2010-07-22 - bdab614 - lavfi 1.26.0 - media format generalization
893893 Add a type field to AVFilterLink.
894894
895895 Change the field types:
@@ -909,235 +909,235 @@ API changes, most recent first: · 13 unmodified lines
909909
910910 This change breaks libavfilter API/ABI.
911911
912−2010-07-21 - r24393 - lavcore 0.0.0
912+2010-07-21 - aac6ca6 - lavcore 0.0.0
913913 Add libavcore.
914914
915−2010-07-17 - r24291 - lavfi 1.25.0 - AVFilterBuffer
915+2010-07-17 - b5c582f - lavfi 1.25.0 - AVFilterBuffer
916916 Remove w and h fields from AVFilterBuffer.
917917
918−2010-07-17 - r24284 - lavfi 1.24.0 - AVFilterBuffer
918+2010-07-17 - f0d77b2 - lavfi 1.24.0 - AVFilterBuffer
919919 Rename AVFilterPic to AVFilterBuffer.
920920
921−2010-07-17 - r24278 - lavf 52.74.0 - url_fskip()
921+2010-07-17 - 57fe80f - lavf 52.74.0 - url_fskip()
922922 Make url_fskip() return an int error code instead of void.
923923
924−2010-07-11 - r24199 - lavc 52.83.0
924+2010-07-11 - 23940f1 - lavc 52.83.0
925925 Add AVCodecContext.lpc_type and AVCodecContext.lpc_passes fields.
926926 Add AVLPCType enum.
927927 Deprecate AVCodecContext.use_lpc.
928928
929−2010-07-11 - r24185 - lavc 52.82.0 - avsubtitle_free()
929+2010-07-11 - e1d7c88 - lavc 52.82.0 - avsubtitle_free()
930930 Add a function for free the contents of a AVSubtitle generated by
931931 avcodec_decode_subtitle.
932932
933−2010-07-11 - r24174 - lavu 50.22.0 - bswap.h and intreadwrite.h
933+2010-07-11 - b91d08f - lavu 50.22.0 - bswap.h and intreadwrite.h
934934 Make the bswap.h and intreadwrite.h API public.
935935
936−2010-07-08 - r24101 - lavu 50.21.0 - pixdesc.h
936+2010-07-08 - ce1cd1c - lavu 50.21.0 - pixdesc.h
937937 Rename read/write_line() to av_read/write_image_line().
938938
939−2010-07-07 - r24091 - lavfi 1.21.0 - avfilter_copy_picref_props()
939+2010-07-07 - 4d508e4 - lavfi 1.21.0 - avfilter_copy_picref_props()
940940 Add avfilter_copy_picref_props().
941941
942−2010-07-03 - r24021 - lavc 52.79.0
942+2010-07-03 - 2d525ef - lavc 52.79.0
943943 Add FF_COMPLIANCE_UNOFFICIAL and change all instances of
944944 FF_COMPLIANCE_INOFFICIAL to use FF_COMPLIANCE_UNOFFICIAL.
945945
946−2010-07-02 - r23985 - lavu 50.20.0 - lfg.h
946+2010-07-02 - 89eec74 - lavu 50.20.0 - lfg.h
947947 Export av_lfg_init(), av_lfg_get(), av_mlfg_get(), and av_bmg_get() through
948948 lfg.h.
949949
950−2010-06-28 - r23835 - lavfi 1.20.1 - av_parse_color()
950+2010-06-28 - a52e2c3 - lavfi 1.20.1 - av_parse_color()
951951 Extend av_parse_color() syntax, make it accept an alpha value specifier and
952952 set the alpha value to 255 by default.
953953
954−2010-06-22 - r23706 - lavf 52.71.0 - URLProtocol.priv_data_size, priv_data_class
954+2010-06-22 - 735cf6b - lavf 52.71.0 - URLProtocol.priv_data_size, priv_data_class
955955 Add priv_data_size and priv_data_class to URLProtocol.
956956
957−2010-06-22 - r23704 - lavf 52.70.0 - url_alloc(), url_connect()
957+2010-06-22 - ffbb289 - lavf 52.70.0 - url_alloc(), url_connect()
958958 Add url_alloc() and url_connect().
959959
960−2010-06-22 - r23702 - lavf 52.69.0 - av_register_protocol2()
960+2010-06-22 - 9b07a2d - lavf 52.69.0 - av_register_protocol2()
961961 Add av_register_protocol2(), deprecating av_register_protocol().
962962
963−2010-06-09 - r23551 - lavu 50.19.0 - av_compare_mod()
963+2010-06-09 - 65db058 - lavu 50.19.0 - av_compare_mod()
964964 Add av_compare_mod() to libavutil/mathematics.h.
965965
966−2010-06-05 - r23485 - lavu 50.18.0 - eval API
966+2010-06-05 - 0b99215 - lavu 50.18.0 - eval API
967967 Make the eval API public.
968968
969−2010-06-04 - r23461 - lavu 50.17.0 - AV_BASE64_SIZE
969+2010-06-04 - 31878fc - lavu 50.17.0 - AV_BASE64_SIZE
970970 Add AV_BASE64_SIZE() macro.
971971
972−2010-06-02 - r23421 - lavc 52.73.0 - av_get_codec_tag_string()
972+2010-06-02 - 7e566bb - lavc 52.73.0 - av_get_codec_tag_string()
973973 Add av_get_codec_tag_string().
974974
975−2010-06-01 - r31301 - lsws 0.11.0 - convertPalette API
975+2010-06-01 - 2b99142 - lsws 0.11.0 - convertPalette API
976976 Add sws_convertPalette8ToPacked32() and sws_convertPalette8ToPacked24().
977977
978−2010-05-26 - r23334 - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL
978+2010-05-26 - 93ebfee - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL
979979 Add CODEC_CAP_EXPERIMENTAL flag.
980980 NOTE: this was backported to 0.6
981981
982−2010-05-23 - r23255 - lavu 50.16.0 - av_get_random_seed()
982+2010-05-23 - 9977863 - lavu 50.16.0 - av_get_random_seed()
983983 Add av_get_random_seed().
984984
985−2010-05-18 - r23161 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT
985+2010-05-18 - 796ac23 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT
986986 Add AVFMT_FLAG_RTP_HINT as possible value for AVFormatContext.flags.
987987 NOTE: this was backported to 0.6
988988
989−2010-05-09 - r23066 - lavfi 1.20.0 - AVFilterPicRef
989+2010-05-09 - b6bc205 - lavfi 1.20.0 - AVFilterPicRef
990990 Add interlaced and top_field_first fields to AVFilterPicRef.
991991
992992 ------------------------------8<-------------------------------------
993993 0.6 branch was cut here
994994 ----------------------------->8--------------------------------------
995995
996−2010-05-01 - r23002 - lavf 52.62.0 - probe function
996+2010-05-01 - 8e2ee18 - lavf 52.62.0 - probe function
997997 Add av_probe_input_format2 to API, it allows ignoring probe
998998 results below given score and returns the actual probe score.
999999
1000−2010-04-01 - r22806 - lavf 52.61.0 - metadata API
1000+2010-04-01 - 3dd6180 - lavf 52.61.0 - metadata API
10011001 Add a flag for av_metadata_set2() to disable overwriting of
10021002 existing tags.
10031003
1004−2010-04-01 - r22753 - lavc 52.66.0
1004+2010-04-01 - 0fb49b5 - lavc 52.66.0
10051005 Add avcodec_get_edge_width().
10061006
1007−2010-03-31 - r22750 - lavc 52.65.0
1007+2010-03-31 - d103218 - lavc 52.65.0
10081008 Add avcodec_copy_context().
10091009
1010−2010-03-31 - r22748 - lavf 52.60.0 - av_match_ext()
1010+2010-03-31 - 1a70d12 - lavf 52.60.0 - av_match_ext()
10111011 Make av_match_ext() public.
10121012
1013−2010-03-31 - r22736 - lavu 50.14.0 - AVMediaType
1013+2010-03-31 - 1149150 - lavu 50.14.0 - AVMediaType
10141014 Move AVMediaType enum from libavcodec to libavutil.
10151015
1016−2010-03-31 - r22735 - lavc 52.64.0 - AVMediaType
1016+2010-03-31 - 72415b2 - lavc 52.64.0 - AVMediaType
10171017 Define AVMediaType enum, and use it instead of enum CodecType, which
10181018 is deprecated and will be dropped at the next major bump.
10191019
1020−2010-03-25 - r22684 - lavu 50.13.0 - av_strerror()
1020+2010-03-25 - 8795823 - lavu 50.13.0 - av_strerror()
10211021 Implement av_strerror().
10221022
1023−2010-03-23 - r22649 - lavc 52.60.0 - av_dct_init()
1023+2010-03-23 - e1484eb - lavc 52.60.0 - av_dct_init()
10241024 Support DCT-I and DST-I.
10251025
1026−2010-03-15 - r22540 - lavf 52.56.0 - AVFormatContext.start_time_realtime
1026+2010-03-15 - b8819c8 - lavf 52.56.0 - AVFormatContext.start_time_realtime
10271027 Add AVFormatContext.start_time_realtime field.
10281028
1029−2010-03-13 - r22506 - lavfi 1.18.0 - AVFilterPicRef.pos
1029+2010-03-13 - 5bb5c1d - lavfi 1.18.0 - AVFilterPicRef.pos
10301030 Add AVFilterPicRef.pos field.
10311031
1032−2010-03-13 - r22501 - lavu 50.12.0 - error.h
1032+2010-03-13 - 60c144f - lavu 50.12.0 - error.h
10331033 Move error code definitions from libavcodec/avcodec.h to
10341034 the new public header libavutil/error.h.
10351035
1036−2010-03-07 - r22291 - lavc 52.56.0 - avfft.h
1036+2010-03-07 - c709483 - lavc 52.56.0 - avfft.h
10371037 Add public FFT interface.
10381038
1039−2010-03-06 - r22251 - lavu 50.11.0 - av_stristr()
1039+2010-03-06 - ac6ef86 - lavu 50.11.0 - av_stristr()
10401040 Add av_stristr().
10411041
1042−2010-03-03 - r22174 - lavu 50.10.0 - av_tree_enumerate()
1042+2010-03-03 - 4b83fc0 - lavu 50.10.0 - av_tree_enumerate()
10431043 Add av_tree_enumerate().
10441044
1045−2010-02-07 - r21673 - lavu 50.9.0 - av_compare_ts()
1045+2010-02-07 - b687c1a - lavu 50.9.0 - av_compare_ts()
10461046 Add av_compare_ts().
10471047
1048−2010-02-05 - r30513 - lsws 0.10.0 - sws_getCoefficients()
1048+2010-02-05 - 3f3dc76 - lsws 0.10.0 - sws_getCoefficients()
10491049 Add sws_getCoefficients().
10501050
1051−2010-02-01 - r21587 - lavf 52.50.0 - metadata API
1051+2010-02-01 - ca76a11 - lavf 52.50.0 - metadata API
10521052 Add a list of generic tag names, change 'author' -> 'artist',
10531053 'year' -> 'date'.
10541054
1055−2010-01-30 - r21545 - lavu 50.8.0 - av_get_pix_fmt()
1055+2010-01-30 - 80a07f6 - lavu 50.8.0 - av_get_pix_fmt()
10561056 Add av_get_pix_fmt().
10571057
1058−2010-01-21 - r30381 - lsws 0.9.0 - sws_scale()
1058+2010-01-21 - 01cc47d - lsws 0.9.0 - sws_scale()
10591059 Change constness attributes of sws_scale() parameters.
10601060
1061−2010-01-10 - r21121 - lavfi 1.15.0 - avfilter_graph_config_links()
1061+2010-01-10 - 3fb8e77 - lavfi 1.15.0 - avfilter_graph_config_links()
10621062 Add a log_ctx parameter to avfilter_graph_config_links().
10631063
1064−2010-01-07 - r30236 - lsws 0.8.0 - sws_isSupported{In,Out}put()
1064+2010-01-07 - 8e9767f - lsws 0.8.0 - sws_isSupported{In,Out}put()
10651065 Add sws_isSupportedInput() and sws_isSupportedOutput() functions.
10661066
1067−2010-01-06 - r21035 - lavfi 1.14.0 - avfilter_add_colorspace()
1067+2010-01-06 - c1d662f - lavfi 1.14.0 - avfilter_add_colorspace()
10681068 Change the avfilter_add_colorspace() signature, make it accept an
10691069 (AVFilterFormats **) rather than an (AVFilterFormats *) as before.
10701070
1071−2010-01-03 - r21007 - lavfi 1.13.0 - avfilter_add_colorspace()
1071+2010-01-03 - 4fd1f18 - lavfi 1.13.0 - avfilter_add_colorspace()
10721072 Add avfilter_add_colorspace().
10731073
1074−2010-01-02 - r20998 - lavf 52.46.0 - av_match_ext()
1074+2010-01-02 - 8eb631f - lavf 52.46.0 - av_match_ext()
10751075 Add av_match_ext(), it should be used in place of match_ext().
10761076
1077−2010-01-01 - r20991 - lavf 52.45.0 - av_guess_format()
1077+2010-01-01 - a1f547b - lavf 52.45.0 - av_guess_format()
10781078 Add av_guess_format(), it should be used in place of guess_format().
10791079
1080−2009-12-13 - r20834 - lavf 52.43.0 - metadata API
1080+2009-12-13 - a181981 - lavf 52.43.0 - metadata API
10811081 Add av_metadata_set2(), AV_METADATA_DONT_STRDUP_KEY and
10821082 AV_METADATA_DONT_STRDUP_VAL.
10831083
1084−2009-12-13 - r20829 - lavu 50.7.0 - avstring.h API
1084+2009-12-13 - 277c733 - lavu 50.7.0 - avstring.h API
10851085 Add av_d2str().
10861086
1087−2009-12-13 - r20826 - lavc 52.42.0 - AVStream
1087+2009-12-13 - 02b398e - lavc 52.42.0 - AVStream
10881088 Add avg_frame_rate.
10891089
1090−2009-12-12 - r20808 - lavu 50.6.0 - av_bmg_next()
1090+2009-12-12 - 3ba69a1 - lavu 50.6.0 - av_bmg_next()
10911091 Introduce the av_bmg_next() function.
10921092
1093−2009-12-05 - r20734 - lavfi 1.12.0 - avfilter_draw_slice()
1093+2009-12-05 - a13a543 - lavfi 1.12.0 - avfilter_draw_slice()
10941094 Add a slice_dir parameter to avfilter_draw_slice().
10951095
1096−2009-11-26 - r20611 - lavfi 1.11.0 - AVFilter
1096+2009-11-26 - 4cc3f6a - lavfi 1.11.0 - AVFilter
10971097 Remove the next field from AVFilter, this is not anymore required.
10981098
1099−2009-11-25 - r20607 - lavfi 1.10.0 - avfilter_next()
1099+2009-11-25 - 1433c4a - lavfi 1.10.0 - avfilter_next()
11001100 Introduce the avfilter_next() function.
11011101
1102−2009-11-25 - r20605 - lavfi 1.9.0 - avfilter_register()
1102+2009-11-25 - 86a60fa - lavfi 1.9.0 - avfilter_register()
11031103 Change the signature of avfilter_register() to make it return an
11041104 int. This is required since now the registration operation may fail.
11051105
1106−2009-11-25 - r20603 - lavu 50.5.0 - pixdesc.h API
1106+2009-11-25 - 74a0059 - lavu 50.5.0 - pixdesc.h API
11071107 Make the pixdesc.h API public.
11081108
1109−2009-10-27 - r20385 - lavfi 1.5.0 - AVFilter.next
1109+2009-10-27 - 243110f - lavfi 1.5.0 - AVFilter.next
11101110 Add a next field to AVFilter, this is used for simplifying the
11111111 registration and management of the registered filters.
11121112
1113−2009-10-23 - r20356 - lavfi 1.4.1 - AVFilter.description
1113+2009-10-23 - cccd292 - lavfi 1.4.1 - AVFilter.description
11141114 Add a description field to AVFilter.
11151115
1116−2009-10-19 - r20302 - lavfi 1.3.0 - avfilter_make_format_list()
1116+2009-10-19 - 6b5dc05 - lavfi 1.3.0 - avfilter_make_format_list()
11171117 Change the interface of avfilter_make_format_list() from
11181118 avfilter_make_format_list(int n, ...) to
11191119 avfilter_make_format_list(enum PixelFormat *pix_fmts).
11201120
1121−2009-10-18 - r20272 - lavfi 1.0.0 - avfilter_get_video_buffer()
1121+2009-10-18 - 0eb4ff9 - lavfi 1.0.0 - avfilter_get_video_buffer()
11221122 Make avfilter_get_video_buffer() recursive and add the w and h
11231123 parameters to it.
11241124
1125−2009-10-07 - r20189 - lavfi 0.5.1 - AVFilterPic
1125+2009-10-07 - 46c40e4 - lavfi 0.5.1 - AVFilterPic
11261126 Add w and h fields to AVFilterPic.
11271127
1128−2009-06-22 - r19250 - lavf 52.34.1 - AVFormatContext.packet_size
1128+2009-06-22 - 92400be - lavf 52.34.1 - AVFormatContext.packet_size
11291129 This is now an unsigned int instead of a signed int.
11301130
1131−2009-06-19 - r19222 - lavc 52.32.0 - AVSubtitle.pts
1131+2009-06-19 - a4276ba - lavc 52.32.0 - AVSubtitle.pts
11321132 Add a pts field to AVSubtitle which gives the subtitle packet pts
11331133 in AV_TIME_BASE. Some subtitle de-/encoders (e.g. XSUB) will
11341134 not work right without this.
11351135
1136−2009-06-03 - r19078 - lavc 52.30.2 - AV_PKT_FLAG_KEY
1136+2009-06-03 - 8f3f2e0 - lavc 52.30.2 - AV_PKT_FLAG_KEY
11371137 PKT_FLAG_KEY has been deprecated and will be dropped at the next
11381138 major version. Use AV_PKT_FLAG_KEY instead.
11391139
1140−2009-06-01 - r19025 - lavc 52.30.0 - av_lockmgr_register()
1140+2009-06-01 - f988ce6 - lavc 52.30.0 - av_lockmgr_register()
11411141 av_lockmgr_register() can be used to register a callback function
11421142 that lavc (and in the future, libraries that depend on lavc) can use
11431143 to implement mutexes. The application should provide a callback function
@@ -1145,27 +1145,27 @@ API changes, most recent first: · 1 unmodified line
11451145 When the lock manager is registered, FFmpeg is guaranteed to behave
11461146 correctly in a multi-threaded application.
11471147
1148−2009-04-30 - r18719 - lavc 52.28.0 - av_free_packet()
1148+2009-04-30 - ce1d9c8 - lavc 52.28.0 - av_free_packet()
11491149 av_free_packet() is no longer an inline function. It is now exported.
11501150
1151−2009-04-11 - r18431 - lavc 52.25.0 - deprecate av_destruct_packet_nofree()
1151+2009-04-11 - 80d403f - lavc 52.25.0 - deprecate av_destruct_packet_nofree()
11521152 Please use NULL instead. This has been supported since r16506
11531153 (lavf > 52.23.1, lavc > 52.10.0).
11541154
1155−2009-04-07 - r18351 - lavc 52.23.0 - avcodec_decode_video/audio/subtitle
1155+2009-04-07 - 7a00bba - lavc 52.23.0 - avcodec_decode_video/audio/subtitle
11561156 The old decoding functions are deprecated, all new code should use the
11571157 new functions avcodec_decode_video2(), avcodec_decode_audio3() and
11581158 avcodec_decode_subtitle2(). These new functions take an AVPacket *pkt
11591159 argument instead of a const uint8_t *buf / int buf_size pair.
11601160
1161−2009-04-03 - r18321 - lavu 50.3.0 - av_fifo_space()
1161+2009-04-03 - 7b09db3 - lavu 50.3.0 - av_fifo_space()
11621162 Introduce the av_fifo_space() function.
11631163
1164−2009-04-02 - r18317 - lavc 52.23.0 - AVPacket
1164+2009-04-02 - fabd246 - lavc 52.23.0 - AVPacket
11651165 Move AVPacket declaration from libavformat/avformat.h to
11661166 libavcodec/avcodec.h.
11671167
1168−2009-03-22 - r18163 - lavu 50.2.0 - RGB32 pixel formats
1168+2009-03-22 - 6e08ca9 - lavu 50.2.0 - RGB32 pixel formats
11691169 Convert the pixel formats PIX_FMT_ARGB, PIX_FMT_RGBA, PIX_FMT_ABGR,
11701170 PIX_FMT_BGRA, which were defined as macros, into enum PixelFormat values.
11711171 Conversely PIX_FMT_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32 and
@@ -1174,17 +1174,17 @@ API changes, most recent first: · 2 unmodified lines
11741174 Re-sort the enum PixelFormat list accordingly.
11751175 This change breaks API/ABI backward compatibility.
11761176
1177−2009-03-22 - r18133 - lavu 50.1.0 - PIX_FMT_RGB5X5 endian variants
1177+2009-03-22 - f82674e - lavu 50.1.0 - PIX_FMT_RGB5X5 endian variants
11781178 Add the enum PixelFormat values:
11791179 PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,
11801180 PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, PIX_FMT_BGR555BE, PIX_FMT_BGR555LE.
11811181
1182−2009-03-21 - r18116 - lavu 50.0.0 - av_random*
1182+2009-03-21 - ee6624e - lavu 50.0.0 - av_random*
11831183 The Mersenne Twister PRNG implemented through the av_random* functions
11841184 was removed. Use the lagged Fibonacci PRNG through the av_lfg* functions
11851185 instead.
11861186
1187−2009-03-08 - r17869 - lavu 50.0.0 - AVFifoBuffer
1187+2009-03-08 - 41dd680 - lavu 50.0.0 - AVFifoBuffer
11881188 av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped
11891189 and replaced by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write
11901190 and av_fifo_realloc2.
@@ -1193,7 +1193,7 @@ API changes, most recent first: · 2 unmodified lines
11931193 The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by
11941194 applications, they may not use sizeof() or directly access members.
11951195
1196−2009-03-01 - r17682 - lavf 52.31.0 - Generic metadata API
1196+2009-03-01 - ec26457 - lavf 52.31.0 - Generic metadata API
11971197 Introduce a new metadata API (see av_metadata_get() and friends).
11981198 The old API is now deprecated and should not be used anymore. This especially
11991199 includes the following structure fields:
doc/general.texi+2−0
@@ -401,6 +401,8 @@ following image formats are supported: · 400 unmodified lines
401401 @tab YUV, JPEG and some extension is not supported yet.
402402 @item Truevision Targa @tab X @tab X
403403 @tab Targa (.TGA) image format
404+@item XBM @tab X @tab
405+ @tab X BitMap image format
404406 @item XWD @tab X @tab X
405407 @tab X Window Dump image format
406408 @end multitable
libavcodec/Makefile+1−0
@@ -482,6 +482,7 @@ OBJS-$(CONFIG_XAN_DPCM_DECODER) += dpcm.o · 481 unmodified lines
482482 OBJS-$(CONFIG_XAN_WC3_DECODER) += xan.o
483483 OBJS-$(CONFIG_XAN_WC4_DECODER) += xxan.o
484484 OBJS-$(CONFIG_XBIN_DECODER) += bintext.o cga_data.o
485+OBJS-$(CONFIG_XBM_ENCODER) += xbmenc.o
485486 OBJS-$(CONFIG_XL_DECODER) += xl.o
486487 OBJS-$(CONFIG_XSUB_DECODER) += xsubdec.o
487488 OBJS-$(CONFIG_XSUB_ENCODER) += xsubenc.o
libavcodec/aacdec.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 *
66 * AAC LATM decoder
77 * 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>
99 *
1010 * This file is part of FFmpeg.
1111 *
libavcodec/allcodecs.c+1−0
@@ -249,6 +249,7 @@ void avcodec_register_all(void) · 248 unmodified lines
249249 REGISTER_DECODER (WNV1, wnv1);
250250 REGISTER_DECODER (XAN_WC3, xan_wc3);
251251 REGISTER_DECODER (XAN_WC4, xan_wc4);
252+ REGISTER_ENCODER (XBM, xbm);
252253 REGISTER_DECODER (XL, xl);
253254 REGISTER_ENCDEC (XWD, xwd);
254255 REGISTER_ENCDEC (Y41P, y41p);
libavcodec/avcodec.h+1−0
@@ -247,6 +247,7 @@ enum CodecID { · 246 unmodified lines
247247 CODEC_ID_V410,
248248 CODEC_ID_XWD,
249249 CODEC_ID_CDXL,
250+ CODEC_ID_XBM,
250251 CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
251252 CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
252253 CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
libavcodec/bytestream.h+11−19
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #ifndef AVCODEC_BYTESTREAM_H
2424 #define AVCODEC_BYTESTREAM_H
2525
26+#include <stdint.h>
2627 #include <string.h>
2728
2829 #include "libavutil/common.h"
@@ -37,7 +38,7 @@ typedef struct { · 8 unmodified lines
3738 int eof;
3839 } PutByteContext;
3940
40−#define DEF_T(type, name, bytes, read, write) \
41+#define DEF(type, name, bytes, read, write) \
4142 static av_always_inline type bytestream_get_ ## name(const uint8_t **b) \
4243 { \
4344 (*b) += bytes; \
@@ -80,24 +81,15 @@ static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ · 36 unmodified lines
8081 return read(g->buffer); \
8182 }
8283
83−#define DEF(name, bytes, read, write) \
84− DEF_T(unsigned int, name, bytes, read, write)
85−#define DEF64(name, bytes, read, write) \
86− DEF_T(uint64_t, name, bytes, read, write)
87−
88−DEF64(le64, 8, AV_RL64, AV_WL64)
89−DEF (le32, 4, AV_RL32, AV_WL32)
90−DEF (le24, 3, AV_RL24, AV_WL24)
91−DEF (le16, 2, AV_RL16, AV_WL16)
92−DEF64(be64, 8, AV_RB64, AV_WB64)
93−DEF (be32, 4, AV_RB32, AV_WB32)
94−DEF (be24, 3, AV_RB24, AV_WB24)
95−DEF (be16, 2, AV_RB16, AV_WB16)
96−DEF (byte, 1, AV_RB8 , AV_WB8 )
97−
98−#undef DEF
99−#undef DEF64
100−#undef DEF_T
84+DEF(uint64_t, le64, 8, AV_RL64, AV_WL64)
85+DEF(unsigned int, le32, 4, AV_RL32, AV_WL32)
86+DEF(unsigned int, le24, 3, AV_RL24, AV_WL24)
87+DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
88+DEF(uint64_t, be64, 8, AV_RB64, AV_WB64)
89+DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
90+DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
91+DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
92+DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
10193
10294 #if HAVE_BIGENDIAN
10395 # define bytestream2_get_ne16 bytestream2_get_be16
libavcodec/proresenc_kostya.c+70−44
@@ -184,6 +184,7 @@ typedef struct ProresContext { · 183 unmodified lines
184184 int num_slices;
185185 int num_planes;
186186 int bits_per_mb;
187+ int force_quant;
187188
188189 char *vendor;
189190 int quant_sel;
@@ -397,7 +398,9 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, · 207 unmodified lines
397398 int plane_factor, is_chroma;
398399 uint16_t *qmat;
399400
400− if (quant < MAX_STORED_Q) {
401+ if (ctx->force_quant) {
402+ qmat = ctx->quants[0];
403+ } else if (quant < MAX_STORED_Q) {
401404 qmat = ctx->quants[quant];
402405 } else {
403406 qmat = ctx->custom_q;
@@ -750,21 +753,23 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 346 unmodified lines
750753 // slices
751754 for (y = 0; y < ctx->mb_height; y++) {
752755 mbs_per_slice = ctx->mbs_per_slice;
753− for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
754− while (ctx->mb_width - x < mbs_per_slice)
755− mbs_per_slice >>= 1;
756− q = find_slice_quant(avctx, pic, (mb + 1) * TRELLIS_WIDTH, x, y,
757− mbs_per_slice);
758− }
756+ if (!ctx->force_quant) {
757+ for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
758+ while (ctx->mb_width - x < mbs_per_slice)
759+ mbs_per_slice >>= 1;
760+ q = find_slice_quant(avctx, pic, (mb + 1) * TRELLIS_WIDTH, x, y,
761+ mbs_per_slice);
762+ }
759763
760− for (x = ctx->slices_width - 1; x >= 0; x--) {
761− ctx->slice_q[x] = ctx->nodes[q].quant;
762− q = ctx->nodes[q].prev_node;
764+ for (x = ctx->slices_width - 1; x >= 0; x--) {
765+ ctx->slice_q[x] = ctx->nodes[q].quant;
766+ q = ctx->nodes[q].prev_node;
767+ }
763768 }
764769
765770 mbs_per_slice = ctx->mbs_per_slice;
766771 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];
768773
769774 while (ctx->mb_width - x < mbs_per_slice)
770775 mbs_per_slice >>= 1;
@@ -859,27 +864,66 @@ static av_cold int encode_init(AVCodecContext *avctx) · 88 unmodified lines
859864 return AVERROR_INVALIDDATA;
860865 }
861866
862− if (!ctx->bits_per_mb) {
863− for (i = 0; i < NUM_MB_LIMITS - 1; i++)
864− if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height)
865− break;
866− ctx->bits_per_mb = ctx->profile_info->br_tab[i];
867− } else if (ctx->bits_per_mb < 128) {
868− av_log(avctx, AV_LOG_ERROR, "too few bits per MB, please set at least 128\n");
869− return AVERROR_INVALIDDATA;
867+ ctx->force_quant = avctx->global_quality / FF_QP2LAMBDA;
868+ if (!ctx->force_quant) {
869+ if (!ctx->bits_per_mb) {
870+ for (i = 0; i < NUM_MB_LIMITS - 1; i++)
871+ if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height)
872+ break;
873+ ctx->bits_per_mb = ctx->profile_info->br_tab[i];
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;
870921 }
871922
872923 ctx->frame_size = ctx->num_slices * (2 + 2 * ctx->num_planes
873924 + (2 * mps * ctx->bits_per_mb) / 8)
874925 + 200;
875926
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−
883927 avctx->codec_tag = ctx->profile_info->tag;
884928
885929 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
887931 av_log(avctx, AV_LOG_DEBUG, "estimated frame size %d\n",
888932 ctx->frame_size);
889933
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−
908934 return 0;
909935 }
910936
libavcodec/version.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #define AVCODEC_VERSION_H
2222
2323 #define LIBAVCODEC_VERSION_MAJOR 54
24−#define LIBAVCODEC_VERSION_MINOR 10
24+#define LIBAVCODEC_VERSION_MINOR 11
2525 #define LIBAVCODEC_VERSION_MICRO 100
2626
2727 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavcodec/vqavideo.c+99−102
@@ -70,10 +70,10 @@ · 69 unmodified lines
7070 #include "libavutil/intreadwrite.h"
7171 #include "libavutil/imgutils.h"
7272 #include "avcodec.h"
73+#include "bytestream.h"
7374
7475 #define PALETTE_COUNT 256
7576 #define VQA_HEADER_SIZE 0x2A
76−#define CHUNK_PREAMBLE_SIZE 8
7777
7878 /* allocate the maximum vector space, regardless of the file version:
7979 * (0xFF00 codebook vectors + 0x100 solid pixel vectors) * (4x4 pixels/block) */
@@ -94,9 +94,7 @@ typedef struct VqaContext { · 14 unmodified lines
9494
9595 AVCodecContext *avctx;
9696 AVFrame frame;
97−
98− const unsigned char *buf;
99− int size;
97+ GetByteContext gb;
10098
10199 uint32_t palette[PALETTE_COUNT];
102100
@@ -123,7 +121,6 @@ typedef struct VqaContext { · 20 unmodified lines
123121 static av_cold int vqa_decode_init(AVCodecContext *avctx)
124122 {
125123 VqaContext *s = avctx->priv_data;
126− unsigned char *vqa_header;
127124 int i, j, codebook_index;
128125
129126 s->avctx = avctx;
@@ -136,21 +133,20 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx) · 6 unmodified lines
136133 }
137134
138135 /* load up the VQA parameters from the header */
139− vqa_header = (unsigned char *)s->avctx->extradata;
140− s->vqa_version = vqa_header[0];
136+ s->vqa_version = s->avctx->extradata[0];
141137 if (s->vqa_version < 1 || s->vqa_version > 3) {
142138 av_log(s->avctx, AV_LOG_ERROR, " VQA video: unsupported version %d\n", s->vqa_version);
143139 return -1;
144140 }
145− s->width = AV_RL16(&vqa_header[6]);
146− s->height = AV_RL16(&vqa_header[8]);
141+ s->width = AV_RL16(&s->avctx->extradata[6]);
142+ s->height = AV_RL16(&s->avctx->extradata[8]);
147143 if(av_image_check_size(s->width, s->height, 0, avctx)){
148144 s->width= s->height= 0;
149145 return -1;
150146 }
151− s->vector_width = vqa_header[10];
152− s->vector_height = vqa_header[11];
153− s->partial_count = s->partial_countdown = vqa_header[13];
147+ s->vector_width = s->avctx->extradata[10];
148+ s->vector_height = s->avctx->extradata[11];
149+ s->partial_count = s->partial_countdown = s->avctx->extradata[13];
154150
155151 /* the vector dimensions have to meet very stringent requirements */
156152 if ((s->vector_width != 4) ||
@@ -205,90 +201,88 @@ fail: · 48 unmodified lines
205201 av_log(NULL, AV_LOG_ERROR, " VQA video: decode_format80 problem: next op would overflow dest_index\n"); \
206202 av_log(NULL, AV_LOG_ERROR, " VQA video: current dest_index = %d, count = %d, dest_size = %d\n", \
207203 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; \
209213 }
210214
211−static void decode_format80(const unsigned char *src, int src_size,
215+
216+static int decode_format80(GetByteContext *gb, int src_size,
212217 unsigned char *dest, int dest_size, int check_size) {
213218
214− int src_index = 0;
215219 int dest_index = 0;
216− int count;
220+ int count, opcode, start;
217221 int src_pos;
218222 unsigned char color;
219223 int i;
220224
221− while (src_index < src_size) {
222−
223− av_dlog(NULL, " opcode %02X: ", src[src_index]);
225+ start = bytestream2_tell(gb);
226+ while (bytestream2_tell(gb) - start < src_size) {
227+ opcode = bytestream2_get_byte(gb);
228+ av_dlog(NULL, " opcode %02X: ", opcode);
224229
225230 /* 0x80 means that frame is finished */
226− if (src[src_index] == 0x80)
227− return;
231+ if (opcode == 0x80)
232+ return 0;
228233
229234 if (dest_index >= dest_size) {
230235 av_log(NULL, AV_LOG_ERROR, " VQA video: decode_format80 problem: dest_index (%d) exceeded dest_size (%d)\n",
231236 dest_index, dest_size);
232− return;
237+ return AVERROR_INVALIDDATA;
233238 }
234239
235− if (src[src_index] == 0xFF) {
240+ if (opcode == 0xFF) {
236241
237− src_index++;
238− count = AV_RL16(&src[src_index]);
239− src_index += 2;
240− src_pos = AV_RL16(&src[src_index]);
241− src_index += 2;
242+ count = bytestream2_get_le16(gb);
243+ src_pos = bytestream2_get_le16(gb);
242244 av_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
243245 CHECK_COUNT();
244− if (src_pos + count > dest_size)
245− return;
246+ CHECK_COPY(src_pos);
246247 for (i = 0; i < count; i++)
247248 dest[dest_index + i] = dest[src_pos + i];
248249 dest_index += count;
249250
250− } else if (src[src_index] == 0xFE) {
251+ } else if (opcode == 0xFE) {
251252
252− src_index++;
253− count = AV_RL16(&src[src_index]);
254− src_index += 2;
255− color = src[src_index++];
253+ count = bytestream2_get_le16(gb);
254+ color = bytestream2_get_byte(gb);
256255 av_dlog(NULL, "(2) set %X bytes to %02X\n", count, color);
257256 CHECK_COUNT();
258257 memset(&dest[dest_index], color, count);
259258 dest_index += count;
260259
261− } else if ((src[src_index] & 0xC0) == 0xC0) {
260+ } else if ((opcode & 0xC0) == 0xC0) {
262261
263− count = (src[src_index++] & 0x3F) + 3;
264− src_pos = AV_RL16(&src[src_index]);
265− src_index += 2;
262+ count = (opcode & 0x3F) + 3;
263+ src_pos = bytestream2_get_le16(gb);
266264 av_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
267265 CHECK_COUNT();
268− if (src_pos + count > dest_size)
269− return;
266+ CHECK_COPY(src_pos);
270267 for (i = 0; i < count; i++)
271268 dest[dest_index + i] = dest[src_pos + i];
272269 dest_index += count;
273270
274− } else if (src[src_index] > 0x80) {
271+ } else if (opcode > 0x80) {
275272
276− count = src[src_index++] & 0x3F;
273+ count = opcode & 0x3F;
277274 av_dlog(NULL, "(4) copy %X bytes from source to dest\n", count);
278275 CHECK_COUNT();
279− memcpy(&dest[dest_index], &src[src_index], count);
280− src_index += count;
276+ bytestream2_get_buffer(gb, &dest[dest_index], count);
281277 dest_index += count;
282278
283279 } else {
284280
285− count = ((src[src_index] & 0x70) >> 4) + 3;
286− src_pos = AV_RB16(&src[src_index]) & 0x0FFF;
287− src_index += 2;
281+ count = ((opcode & 0x70) >> 4) + 3;
282+ src_pos = bytestream2_get_byte(gb) | ((opcode & 0x0F) << 8);
288283 av_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
289284 CHECK_COUNT();
290− if (dest_index < src_pos)
291− return;
285+ CHECK_COPY(dest_index - src_pos);
292286 for (i = 0; i < count; i++)
293287 dest[dest_index + i] = dest[dest_index - src_pos + i];
294288 dest_index += count;
@@ -303,9 +297,11 @@ static void decode_format80(const unsigned char *src, int src_size, · 8 unmodified lines
303297 if (dest_index < dest_size)
304298 av_log(NULL, AV_LOG_ERROR, " VQA video: decode_format80 problem: decode finished with dest_index (%d) < dest_size (%d)\n",
305299 dest_index, dest_size);
300+
301+ return 0; // let's display what we decoded anyway
306302 }
307303
308−static void vqa_decode_chunk(VqaContext *s)
304+static int vqa_decode_chunk(VqaContext *s)
309305 {
310306 unsigned int chunk_type;
311307 unsigned int chunk_size;
@@ -314,6 +310,7 @@ static void vqa_decode_chunk(VqaContext *s) · 2 unmodified lines
314310 int i;
315311 unsigned char r, g, b;
316312 int index_shift;
313+ int res;
317314
318315 int cbf0_chunk = -1;
319316 int cbfz_chunk = -1;
@@ -333,17 +330,11 @@ static void vqa_decode_chunk(VqaContext *s) · 13 unmodified lines
333330 int hibytes = s->decode_buffer_size / 2;
334331
335332 /* first, traverse through the frame and find the subchunks */
336− while (index + CHUNK_PREAMBLE_SIZE <= s->size) {
337− unsigned next_index;
333+ while (bytestream2_get_bytes_left(&s->gb) >= 8) {
338334
339− chunk_type = AV_RB32(&s->buf[index]);
340− chunk_size = AV_RB32(&s->buf[index + 4]);
341− byte_skip = chunk_size & 0x01;
342− next_index = index + CHUNK_PREAMBLE_SIZE + chunk_size + byte_skip;
343− if (next_index > s->size) {
344− av_log(s->avctx, AV_LOG_ERROR, "Dropping incomplete chunk\n");
345− break;
346− }
335+ chunk_type = bytestream2_get_be32u(&s->gb);
336+ index = bytestream2_tell(&s->gb);
337+ chunk_size = bytestream2_get_be32u(&s->gb);
347338
348339 switch (chunk_type) {
349340
@@ -384,7 +375,9 @@ static void vqa_decode_chunk(VqaContext *s) · 34 unmodified lines
384375 chunk_type);
385376 break;
386377 }
387− index = next_index;
378+
379+ byte_skip = chunk_size & 0x01;
380+ bytestream2_skip(&s->gb, chunk_size + byte_skip);
388381 }
389382
390383 /* next, deal with the palette */
@@ -392,7 +385,7 @@ static void vqa_decode_chunk(VqaContext *s) · 1 unmodified line
392385
393386 /* a chunk should not have both chunk types */
394387 av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found both CPL0 and CPLZ chunks\n");
395− return;
388+ return AVERROR_INVALIDDATA;
396389 }
397390
398391 /* decompress the palette chunk */
@@ -405,19 +398,19 @@ static void vqa_decode_chunk(VqaContext *s) · 6 unmodified lines
405398 /* convert the RGB palette into the machine's endian format */
406399 if (cpl0_chunk != -1) {
407400
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);
409403 /* sanity check the palette size */
410404 if (chunk_size / 3 > 256) {
411405 av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found a palette chunk with %d colors\n",
412406 chunk_size / 3);
413− return;
407+ return AVERROR_INVALIDDATA;
414408 }
415− cpl0_chunk += CHUNK_PREAMBLE_SIZE;
416409 for (i = 0; i < chunk_size / 3; i++) {
417410 /* scale by 4 to transform 6-bit palette -> 8-bit */
418− r = s->buf[cpl0_chunk++] * 4;
419− g = s->buf[cpl0_chunk++] * 4;
420− b = s->buf[cpl0_chunk++] * 4;
411+ r = bytestream2_get_byteu(&s->gb) * 4;
412+ g = bytestream2_get_byteu(&s->gb) * 4;
413+ b = bytestream2_get_byteu(&s->gb) * 4;
421414 s->palette[i] = 0xFF << 24 | r << 16 | g << 8 | b;
422415 s->palette[i] |= s->palette[i] >> 6 & 0x30303;
423416 }
@@ -428,31 +421,32 @@ static void vqa_decode_chunk(VqaContext *s) · 4 unmodified lines
428421
429422 /* a chunk should not have both chunk types */
430423 av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found both CBF0 and CBFZ chunks\n");
431− return;
424+ return AVERROR_INVALIDDATA;
432425 }
433426
434427 /* decompress the full codebook chunk */
435428 if (cbfz_chunk != -1) {
436429
437− chunk_size = AV_RB32(&s->buf[cbfz_chunk + 4]);
438− cbfz_chunk += CHUNK_PREAMBLE_SIZE;
439− decode_format80(&s->buf[cbfz_chunk], chunk_size,
440− s->codebook, s->codebook_size, 0);
430+ bytestream2_seek(&s->gb, cbfz_chunk, SEEK_SET);
431+ chunk_size = bytestream2_get_be32(&s->gb);
432+ if ((res = decode_format80(&s->gb, chunk_size, s->codebook,
433+ s->codebook_size, 0)) < 0)
434+ return res;
441435 }
442436
443437 /* copy a full codebook */
444438 if (cbf0_chunk != -1) {
445439
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);
447442 /* sanity check the full codebook size */
448443 if (chunk_size > MAX_CODEBOOK_SIZE) {
449444 av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: CBF0 chunk too large (0x%X bytes)\n",
450445 chunk_size);
451− return;
446+ return AVERROR_INVALIDDATA;
452447 }
453− cbf0_chunk += CHUNK_PREAMBLE_SIZE;
454448
455− memcpy(s->codebook, &s->buf[cbf0_chunk], chunk_size);
449+ bytestream2_get_buffer(&s->gb, s->codebook, chunk_size);
456450 }
457451
458452 /* decode the frame */
@@ -460,13 +454,14 @@ static void vqa_decode_chunk(VqaContext *s) · 1 unmodified line
460454
461455 /* something is wrong if there is no VPTZ chunk */
462456 av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: no VPTZ chunk found\n");
463− return;
457+ return AVERROR_INVALIDDATA;
464458 }
465459
466− chunk_size = AV_RB32(&s->buf[vptz_chunk + 4]);
467− vptz_chunk += CHUNK_PREAMBLE_SIZE;
468− decode_format80(&s->buf[vptz_chunk], chunk_size,
469− s->decode_buffer, s->decode_buffer_size, 1);
460+ bytestream2_seek(&s->gb, vptz_chunk, SEEK_SET);
461+ chunk_size = bytestream2_get_be32(&s->gb);
462+ if ((res = decode_format80(&s->gb, chunk_size,
463+ s->decode_buffer, s->decode_buffer_size, 1)) < 0)
464+ return res;
470465
471466 /* render the final PAL8 frame */
472467 if (s->vector_height == 4)
@@ -530,17 +525,17 @@ static void vqa_decode_chunk(VqaContext *s) · 57 unmodified lines
530525 if ((cbp0_chunk != -1) && (cbpz_chunk != -1)) {
531526 /* a chunk should not have both chunk types */
532527 av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found both CBP0 and CBPZ chunks\n");
533− return;
528+ return AVERROR_INVALIDDATA;
534529 }
535530
536531 if (cbp0_chunk != -1) {
537532
538− chunk_size = AV_RB32(&s->buf[cbp0_chunk + 4]);
539− cbp0_chunk += CHUNK_PREAMBLE_SIZE;
533+ bytestream2_seek(&s->gb, cbp0_chunk, SEEK_SET);
534+ chunk_size = bytestream2_get_be32(&s->gb);
540535
541536 /* accumulate partial codebook */
542− memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
543− &s->buf[cbp0_chunk], chunk_size);
537+ bytestream2_get_buffer(&s->gb, &s->next_codebook_buffer[s->next_codebook_buffer_index],
538+ chunk_size);
544539 s->next_codebook_buffer_index += chunk_size;
545540
546541 s->partial_countdown--;
@@ -558,39 +553,39 @@ static void vqa_decode_chunk(VqaContext *s) · 11 unmodified lines
558553
559554 if (cbpz_chunk != -1) {
560555
561− chunk_size = AV_RB32(&s->buf[cbpz_chunk + 4]);
562− cbpz_chunk += CHUNK_PREAMBLE_SIZE;
556+ bytestream2_seek(&s->gb, cbpz_chunk, SEEK_SET);
557+ chunk_size = bytestream2_get_be32(&s->gb);
563558
564559 /* accumulate partial codebook */
565− memcpy(&s->next_codebook_buffer[s->next_codebook_buffer_index],
566− &s->buf[cbpz_chunk], chunk_size);
560+ bytestream2_get_buffer(&s->gb, &s->next_codebook_buffer[s->next_codebook_buffer_index],
561+ chunk_size);
567562 s->next_codebook_buffer_index += chunk_size;
568563
569564 s->partial_countdown--;
570565 if (s->partial_countdown == 0) {
566+ GetByteContext gb;
571567
568+ bytestream2_init(&gb, s->next_codebook_buffer, s->next_codebook_buffer_index);
572569 /* decompress codebook */
573− decode_format80(s->next_codebook_buffer,
574− s->next_codebook_buffer_index,
575− s->codebook, s->codebook_size, 0);
570+ if ((res = decode_format80(&gb, s->next_codebook_buffer_index,
571+ s->codebook, s->codebook_size, 0)) < 0)
572+ return res;
576573
577574 /* reset accounting */
578575 s->next_codebook_buffer_index = 0;
579576 s->partial_countdown = s->partial_count;
580577 }
581578 }
579+
580+ return 0;
582581 }
583582
584583 static int vqa_decode_frame(AVCodecContext *avctx,
585584 void *data, int *data_size,
586585 AVPacket *avpkt)
587586 {
588− const uint8_t *buf = avpkt->data;
589− int buf_size = avpkt->size;
590587 VqaContext *s = avctx->priv_data;
591−
592− s->buf = buf;
593− s->size = buf_size;
588+ int res;
594589
595590 if (s->frame.data[0])
596591 avctx->release_buffer(avctx, &s->frame);
@@ -600,7 +595,9 @@ static int vqa_decode_frame(AVCodecContext *avctx, · 3 unmodified lines
600595 return -1;
601596 }
602597
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;
604601
605602 /* make the palette available on the way out */
606603 memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4);
@@ -610,7 +607,7 @@ static int vqa_decode_frame(AVCodecContext *avctx, · 3 unmodified lines
610607 *(AVFrame*)data = s->frame;
611608
612609 /* report that the buffer was completely consumed */
613− return buf_size;
610+ return avpkt->size;
614611 }
615612
616613 static 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+
26+static 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+
36+static 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+
69+static av_cold int xbm_encode_close(AVCodecContext *avctx)
70+{
71+ av_freep(&avctx->coded_frame);
72+
73+ return 0;
74+}
75+
76+AVCodec 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
4545 uint32_t pixformat, pixdepth, bunit, bitorder, bpad;
4646 uint32_t rgb[3];
4747 uint8_t *ptr;
48+ GetByteContext gb;
4849
4950 if (buf_size < XWD_HEADER_SIZE)
5051 return AVERROR_INVALIDDATA;
5152
52− header_size = bytestream_get_be32(&buf);
53− if (buf_size < header_size)
54− return AVERROR_INVALIDDATA;
53+ bytestream2_init(&gb, buf, buf_size);
54+ header_size = bytestream2_get_be32u(&gb);
5555
56− version = bytestream_get_be32(&buf);
56+ version = bytestream2_get_be32u(&gb);
5757 if (version != XWD_VERSION) {
5858 av_log(avctx, AV_LOG_ERROR, "unsupported version\n");
5959 return AVERROR_INVALIDDATA;
6060 }
6161
62− if (header_size < XWD_HEADER_SIZE) {
62+ if (buf_size < header_size || header_size < XWD_HEADER_SIZE) {
6363 av_log(avctx, AV_LOG_ERROR, "invalid header size\n");
6464 return AVERROR_INVALIDDATA;
6565 }
6666
67− pixformat = bytestream_get_be32(&buf);
68− pixdepth = bytestream_get_be32(&buf);
69− avctx->width = bytestream_get_be32(&buf);
70− avctx->height = bytestream_get_be32(&buf);
71− xoffset = bytestream_get_be32(&buf);
72− be = bytestream_get_be32(&buf);
73− bunit = bytestream_get_be32(&buf);
74− bitorder = bytestream_get_be32(&buf);
75− bpad = bytestream_get_be32(&buf);
76− bpp = bytestream_get_be32(&buf);
77− lsize = bytestream_get_be32(&buf);
78− vclass = bytestream_get_be32(&buf);
79− rgb[0] = bytestream_get_be32(&buf);
80− rgb[1] = bytestream_get_be32(&buf);
81− rgb[2] = bytestream_get_be32(&buf);
82− buf += 8;
83− ncolors = bytestream_get_be32(&buf);
84− buf += header_size - (XWD_HEADER_SIZE - 20);
67+ pixformat = bytestream2_get_be32u(&gb);
68+ pixdepth = bytestream2_get_be32u(&gb);
69+ avctx->width = bytestream2_get_be32u(&gb);
70+ avctx->height = bytestream2_get_be32u(&gb);
71+ xoffset = bytestream2_get_be32u(&gb);
72+ be = bytestream2_get_be32u(&gb);
73+ bunit = bytestream2_get_be32u(&gb);
74+ bitorder = bytestream2_get_be32u(&gb);
75+ bpad = bytestream2_get_be32u(&gb);
76+ bpp = bytestream2_get_be32u(&gb);
77+ lsize = bytestream2_get_be32u(&gb);
78+ vclass = bytestream2_get_be32u(&gb);
79+ rgb[0] = bytestream2_get_be32u(&gb);
80+ rgb[1] = bytestream2_get_be32u(&gb);
81+ rgb[2] = bytestream2_get_be32u(&gb);
82+ bytestream2_skipu(&gb, 8);
83+ ncolors = bytestream2_get_be32u(&gb);
84+ bytestream2_skipu(&gb, header_size - (XWD_HEADER_SIZE - 20));
8585
8686 av_log(avctx, AV_LOG_DEBUG, "pixformat %d, pixdepth %d, bunit %d, bitorder %d, bpad %d\n",
8787 pixformat, pixdepth, bunit, bitorder, bpad);
@@ -143,7 +143,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, · 55 unmodified lines
143143 return AVERROR_INVALIDDATA;
144144 }
145145
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) {
147147 av_log(avctx, AV_LOG_ERROR, "input buffer too small\n");
148148 return AVERROR_INVALIDDATA;
149149 }
@@ -192,7 +192,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, · 42 unmodified lines
192192 else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)
193193 avctx->pix_fmt = be ? PIX_FMT_ABGR : PIX_FMT_RGBA;
194194 }
195− buf += ncolors * XWD_CMAP_SIZE;
195+ bytestream2_skipu(&gb, ncolors * XWD_CMAP_SIZE);
196196 break;
197197 default:
198198 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
222222
223223 for (i = 0; i < ncolors; i++) {
224224
225− buf += 4; // skip colormap entry number
226− red = *buf; buf += 2;
227− green = *buf; buf += 2;
228− blue = *buf; buf += 2;
229− buf += 2; // skip bitmask flag and padding
225+ bytestream2_skipu(&gb, 4); // skip colormap entry number
226+ red = bytestream2_get_byteu(&gb);
227+ bytestream2_skipu(&gb, 1);
228+ green = bytestream2_get_byteu(&gb);
229+ bytestream2_skipu(&gb, 1);
230+ blue = bytestream2_get_byteu(&gb);
231+ bytestream2_skipu(&gb, 3); // skip bitmask flag and padding
230232
231233 dst[i] = red << 16 | green << 8 | blue;
232234 }
@@ -234,8 +236,8 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, · 1 unmodified line
234236
235237 ptr = p->data[0];
236238 for (i = 0; i < avctx->height; i++) {
237− bytestream_get_buffer(&buf, ptr, rsize);
238− buf += lsize - rsize;
239+ bytestream2_get_bufferu(&gb, ptr, rsize);
240+ bytestream2_skipu(&gb, lsize - rsize);
239241 ptr += p->linesize[0];
240242 }
241243
libavformat/img2.c+1−0
@@ -71,6 +71,7 @@ static const IdStrMap img_tags[] = { · 70 unmodified lines
7171 { CODEC_ID_JPEG2000 , "jpc"},
7272 { CODEC_ID_DPX , "dpx"},
7373 { CODEC_ID_PICTOR , "pic"},
74+ { CODEC_ID_XBM , "xbm"},
7475 { CODEC_ID_XWD , "xwd"},
7576 { CODEC_ID_NONE , NULL}
7677 };
libavformat/img2enc.c+1−1
@@ -153,7 +153,7 @@ AVOutputFormat ff_image2_muxer = { · 152 unmodified lines
153153 .long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
154154 .extensions = "bmp,dpx,jls,jpeg,jpg,ljpg,pam,pbm,pcx,pgm,pgmyuv,png,"
155155 "ppm,sgi,tga,tif,tiff,jp2,j2c,xwd,sun,ras,rs,im1,im8,im24,"
156− "sunras",
156+ "sunras,xbm",
157157 .priv_data_size = sizeof(VideoMuxData),
158158 .video_codec = CODEC_ID_MJPEG,
159159 .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
17491749
17501750 static int seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, int flags){
17511751 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
17601752
17611753 pos_min = s->data_offset;
17621754 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
17661758
17671759 avio_seek(s->pb, pos, SEEK_SET);
17681760
1769−#if 0
1770− av_update_cur_dts(s, st, ts);
1771−#endif
17721761 return 0;
17731762 }
17741763
@@ -2593,10 +2582,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 818 unmodified lines
25932582 }
25942583 for(i=0;i<ic->nb_streams;i++) {
25952584 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);
26002585 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
26012586 if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample){
26022587 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
26042589 st->codec->codec_tag= tag;
26052590 }
26062591
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);
26072596 // the check for tb_unreliable() is not completely correct, since this is not about handling
26082597 // a unreliable/inexact time base, but a time base that is finer than necessary, as e.g.
26092598 // ipmovie.c produces.
@@ -2674,31 +2663,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 64 unmodified lines
26742663
26752664 compute_chapters_end(ic);
26762665
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−
27022666 find_stream_info_err:
27032667 for (i=0; i < ic->nb_streams; i++) {
27042668 if (ic->streams[i]->codec)
tests/fate-run.sh+1−2
@@ -31,8 +31,7 @@ repfile="${outdir}/${test}.rep" · 30 unmodified lines
3131 # $1=value1, $2=value2, $3=threshold
3232 # prints 0 if absolute difference between value1 and value2 is <= threshold
3333 compare(){
34− v=$(echo "scale=2; if ($1 >= $2) { $1 - $2 } else { $2 - $1 }" | bc)
35− echo "if ($v <= $3) { 0 } else { 1 }" | bc
34+ echo "scale=2; v = $1 - $2; if (v < 0) v = -v; if (v > $3) r = 1; r" | bc
3635 }
3736
3837 do_tiny_psnr(){
tests/ref/fate/vqa-cc+0−1
@@ -70,7 +70,6 @@ · 69 unmodified lines
7070 1, 53654, 53654, 1470, 2940, 0xac8bb6c8
7171 0, 37, 37, 1, 192000, 0xb58c1566
7272 1, 55124, 55124, 1470, 2940, 0xa503c73b
73−0, 38, 38, 1, 192000, 0xb58c1566
7473 1, 56594, 56594, 1470, 2940, 0x7cd588a3
7574 1, 58064, 58064, 1470, 2940, 0xa6974b04
7675 1, 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