History

Merge remote-tracking branch 'qatar/master'

* qatar/master: (26 commits) fate: use diff -b in oneline comparison Add missing version bumps and APIchanges/Changelog entries. lavfi: move buffer management function to a separate file. lavfi: move formats-related functions from default.c to formats.c lavfi: move video-related functions to a separate file. fate: make smjpeg a demux test fate: separate sierra-vmd audio and video tests fate: separate smacker audio and video tests libmp3lame: set supported channel layouts. avconv: automatically insert asyncts when -async is used. avconv: add support for audio filters. lavfi: add asyncts filter. lavfi: add aformat filter lavfi: add an audio buffer sink. lavfi: add an audio buffer source. buffersrc: add av_buffersrc_write_frame(). buffersrc: fix invalid read in uninit if the fifo hasn't been allocated lavfi: rename vsrc_buffer.c to buffersrc.c avfiltergraph: reindent lavfi: add channel layout/sample rate negotiation. ... Conflicts: Changelog doc/APIchanges doc/filters.texi ffmpeg.c ffprobe.c libavcodec/libmp3lame.c libavfilter/Makefile libavfilter/af_aformat.c libavfilter/allfilters.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/avfiltergraph.c libavfilter/buffersrc.c libavfilter/defaults.c libavfilter/formats.c libavfilter/src_buffer.c libavfilter/version.h libavfilter/vf_yadif.c libavfilter/vsrc_buffer.c libavfilter/vsrc_buffer.h libavutil/avutil.h tests/fate/audio.mak tests/fate/demux.mak tests/fate/video.mak

Michael Niedermayer committed 14 years ago

Commit 1cbf7fb2 parents a48abf5 0ff0af752 files · +3304 −1706Browse files

Unified · Split

52 files
  1. Changelog +1 −0
  2. doc/APIchanges +19 −2
  3. doc/ffmpeg.texi +6 −0
  4. doc/filters.texi +79 −0
  5. ffprobe.c +18 −4
  6. libavcodec/libmp3lame.c +4 −7
  7. libavfilter/Makefile +5 −0
  8. libavfilter/af_aconvert.c +8 −7
  9. libavfilter/af_aformat.c +89 −51
  10. libavfilter/af_amerge.c +11 −10
  11. libavfilter/af_aresample.c +37 −0
  12. libavfilter/af_astreamsync.c +4 −3
  13. libavfilter/af_asyncts.c +237 −0
  14. libavfilter/af_earwax.c +8 −3
  15. libavfilter/af_pan.c +7 −6
  16. libavfilter/af_resample.c +11 −0
  17. libavfilter/af_silencedetect.c +10 −3
  18. libavfilter/af_volume.c +10 −3
  19. libavfilter/allfilters.c +9 −1
  20. libavfilter/asrc_aevalsrc.c +1 −1
  21. libavfilter/avcodec.c +0 −71
  22. libavfilter/avfilter.c +20 −354
  23. libavfilter/avfilter.h +17 −15
  24. libavfilter/avfiltergraph.c +286 −50
  25. libavfilter/buffer.c +244 −0
  26. libavfilter/buffersink.c +98 −4
  27. libavfilter/buffersink.h +20 −1
  28. libavfilter/buffersrc.c +403 −0
  29. libavfilter/buffersrc.h +11 −0
  30. libavfilter/defaults.c +3 −137
  31. libavfilter/formats.c +282 −87
  32. libavfilter/formats.h +81 −0
  33. libavfilter/internal.h +5 −0
  34. libavfilter/sink_buffer.c +5 −2
  35. libavfilter/src_buffer.c +4 −6
  36. libavfilter/src_movie.c +4 −1
  37. libavfilter/version.h +4 −1
  38. libavfilter/vf_yadif.c +36 −18
  39. libavfilter/video.c +345 −0
  40. libavutil/avutil.h +1 −1
  41. tests/fate-run.sh +1 −3
  42. tests/fate/audio.mak +6 −0
  43. tests/fate/demux.mak +2 −5
  44. tests/fate/video.mak +5 −2
  45. tests/ref/fate/sierra-vmd +0 −334
  46. tests/ref/fate/sierra-vmd-audio +216 −0
  47. tests/ref/fate/sierra-vmd-video +118 −0
  48. tests/ref/fate/smacker-audio +87 −0
  49. tests/ref/fate/smacker-video +0 −87
  50. tests/ref/fate/smjpeg +0 −425
  51. tests/ref/fate/smjpeg-demux +425 −0
  52. tools/lavfi-showfiltfmts.c +1 −1
Changelog+1−0
@@ -30,6 +30,7 @@ version next: · 29 unmodified lines
30- MicroDVD decoder30- MicroDVD decoder
31- Avid Meridien (AVUI) decoder31- Avid Meridien (AVUI) decoder
32- accept + prefix to -pix_fmt option to disable automatic conversions.32- accept + prefix to -pix_fmt option to disable automatic conversions.
33- audio filters support in libavfilter and avconv
33 34
34 35
35version 0.10:36version 0.10:
doc/APIchanges+19−2
@@ -27,13 +27,30 @@ API changes, most recent first: · 26 unmodified lines
272012-03-26 - a67d9cf - lavfi 2.66.100272012-03-26 - a67d9cf - lavfi 2.66.100
28 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.28 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
29 29
302012-xx-xx - xxxxxxx - lavc 54.13.1302012-05-15 - lavfi 2.17.0
31 Add support for audio filters
32 ac71230/a2cd9be - add video/audio buffer sink in a new installed
33 header buffersink.h
34 720c6b7 - add av_buffersrc_write_frame(), deprecate
35 av_vsrc_buffer_add_frame()
36 ab16504 - add avfilter_copy_buf_props()
37 9453c9e - add extended_data to AVFilterBuffer
38 1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
39
402012-05-09 - lavu 51.30.0 - samplefmt.h
41 142e740 - add av_samples_copy()
42 6d7f617 - add av_samples_set_silence()
43
442012-05-09 - a5117a2 - lavc 54.13.1
31 For audio formats with fixed frame size, the last frame45 For audio formats with fixed frame size, the last frame
32 no longer needs to be padded with silence, libavcodec46 no longer needs to be padded with silence, libavcodec
33 will handle this internally (effectively all encoders47 will handle this internally (effectively all encoders
34 behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).48 behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).
35 49
362012-xx-xx - xxxxxxx - lavr 0.0.1502012-05-07 - 828bd08 - lavc 54.13.0 - avcodec.h
51 Add sample_rate and channel_layout fields to AVFrame.
52
532012-05-01 - 4010d72 - lavr 0.0.1
37 Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.54 Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
38 55
392012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h562012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h
doc/ffmpeg.texi+6−0
@@ -499,6 +499,11 @@ Set the audio codec. This is an alias for @code{-codec:a}. · 498 unmodified lines
499@item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})499@item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
500Set the audio sample format. Use @code{-sample_fmts} to get a list500Set the audio sample format. Use @code{-sample_fmts} to get a list
501of supported sample formats.501of supported sample formats.
502@item -af @var{filter_graph} (@emph{output})
503@var{filter_graph} is a description of the filter graph to apply to
504the input audio.
505Use the option "-filters" to show all the available filters (including
506also sources and sinks). This is an alias for @code{-filter:a}.
502@end table507@end table
503 508
504@section Advanced Audio options:509@section Advanced Audio options:
@@ -781,6 +786,7 @@ Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps · 276 unmodified lines
781the parameter is the maximum samples per second by which the audio is changed.786the parameter is the maximum samples per second by which the audio is changed.
782-async 1 is a special case where only the start of the audio stream is corrected787-async 1 is a special case where only the start of the audio stream is corrected
783without any later correction.788without any later correction.
789This option has been deprecated. Use the @code{asyncts} audio filter instead.
784@item -copyts790@item -copyts
785Copy timestamps from input to output.791Copy timestamps from input to output.
786@item -copytb @var{mode}792@item -copytb @var{mode}
doc/filters.texi+79−0
@@ -211,6 +211,32 @@ amovie=input.mkv:si=5 [a5]; · 210 unmodified lines
211[x3][a5] amerge" -c:a pcm_s16le output.mkv211[x3][a5] amerge" -c:a pcm_s16le output.mkv
212@end example212@end example
213 213
214@section aformat
215
216Convert the input audio to one of the specified formats. The framework will
217negotiate the most appropriate format to minimize conversions.
218
219The filter accepts the following named parameters:
220@table @option
221
222@item sample_fmts
223A comma-separated list of requested sample formats.
224
225@item sample_rates
226A comma-separated list of requested sample rates.
227
228@item channel_layouts
229A comma-separated list of requested channel layouts.
230
231@end table
232
233If a parameter is omitted, all values are allowed.
234
235For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
236@example
237aformat=sample_fmts\=u8\,s16:channel_layouts\=stereo
238@end example
239
214@section anull240@section anull
215 241
216Pass the audio source unchanged to the output.242Pass the audio source unchanged to the output.
@@ -502,6 +528,25 @@ volume=-12dB · 285 unmodified lines
502@end example528@end example
503@end itemize529@end itemize
504 530
531@section asyncts
532Synchronize audio data with timestamps by squeezing/stretching it and/or
533dropping samples/adding silence when needed.
534
535The filter accepts the following named parameters:
536@table @option
537
538@item compensate
539Enable stretching/squeezing the data to make it match the timestamps.
540
541@item min_delta
542Minimum difference between timestamps and audio data (in seconds) to trigger
543adding/dropping samples.
544
545@item max_comp
546Maximum compensation in samples per second.
547
548@end table
549
505@section resample550@section resample
506Convert the audio sample format, sample rate and channel layout. This filter is551Convert the audio sample format, sample rate and channel layout. This filter is
507not meant to be used directly.552not meant to be used directly.
@@ -721,6 +766,33 @@ anullsrc=r=48000:cl=4 · 213 unmodified lines
721anullsrc=r=48000:cl=mono766anullsrc=r=48000:cl=mono
722@end example767@end example
723 768
769@section abuffer
770Buffer audio frames, and make them available to the filter chain.
771
772This source is not intended to be part of user-supplied graph descriptions but
773for insertion by calling programs through the interface defined in
774@file{libavfilter/buffersrc.h}.
775
776It accepts the following named parameters:
777@table @option
778
779@item time_base
780Timebase which will be used for timestamps of submitted frames. It must be
781either a floating-point number or in @var{numerator}/@var{denominator} form.
782
783@item sample_rate
784Audio sample rate.
785
786@item sample_fmt
787Name of the sample format, as returned by @code{av_get_sample_fmt_name()}.
788
789@item channel_layout
790Channel layout of the audio data, in the form that can be accepted by
791@code{av_get_channel_layout()}.
792@end table
793
794All the parameters need to be explicitly defined.
795
724@c man end AUDIO SOURCES796@c man end AUDIO SOURCES
725 797
726@chapter Audio Sinks798@chapter Audio Sinks
@@ -745,6 +817,13 @@ Null audio sink, do absolutely nothing with the input audio. It is · 18 unmodified lines
745mainly useful as a template and to be employed in analysis / debugging817mainly useful as a template and to be employed in analysis / debugging
746tools.818tools.
747 819
820@section abuffersink
821This sink is intended for programmatic use. Frames that arrive on this sink can
822be retrieved by the calling program using the interface defined in
823@file{libavfilter/buffersink.h}.
824
825This filter accepts no parameters.
826
748@c man end AUDIO SINKS827@c man end AUDIO SINKS
749 828
750@chapter Video Filters829@chapter Video Filters
ffprobe.c+18−4
@@ -1549,6 +1549,19 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename) · 1548 unmodified lines
1549 return 0;1549 return 0;
1550}1550}
1551 1551
1552static void close_input_file(AVFormatContext **ctx_ptr)
1553{
1554 int i;
1555 AVFormatContext *fmt_ctx = *ctx_ptr;
1556
1557 /* close decoder for each stream */
1558 for (i = 0; i < fmt_ctx->nb_streams; i++)
1559 if (fmt_ctx->streams[i]->codec->codec_id != CODEC_ID_NONE)
1560 avcodec_close(fmt_ctx->streams[i]->codec);
1561
1562 avformat_close_input(ctx_ptr);
1563}
1564
1552#define PRINT_CHAPTER(name) do { \1565#define PRINT_CHAPTER(name) do { \
1553 if (do_show_ ## name) { \1566 if (do_show_ ## name) { \
1554 writer_print_chapter_header(wctx, #name); \1567 writer_print_chapter_header(wctx, #name); \
@@ -1586,10 +1599,7 @@ static int probe_file(WriterContext *wctx, const char *filename) · 31 unmodified lines
1586 }1599 }
1587 PRINT_CHAPTER(streams);1600 PRINT_CHAPTER(streams);
1588 PRINT_CHAPTER(format);1601 PRINT_CHAPTER(format);
1589 for (i = 0; i < fmt_ctx->nb_streams; i++)1602 close_input_file(&fmt_ctx);
1590 if (fmt_ctx->streams[i]->codec->codec_id != CODEC_ID_NONE)
1591 avcodec_close(fmt_ctx->streams[i]->codec);
1592 avformat_close_input(&fmt_ctx);
1593 av_freep(&nb_streams_frames);1603 av_freep(&nb_streams_frames);
1594 av_freep(&nb_streams_packets);1604 av_freep(&nb_streams_packets);
1595 }1605 }
@@ -1803,6 +1813,10 @@ int main(int argc, char **argv) · 207 unmodified lines
1803 1813
1804end:1814end:
1805 av_freep(&print_format);1815 av_freep(&print_format);
1816
1817 uninit_opts();
1818 av_dict_free(&fmt_entries_to_show);
1819
1806 avformat_network_deinit();1820 avformat_network_deinit();
1807 1821
1808 return ret;1822 return ret;
libavcodec/libmp3lame.c+4−7
@@ -26,6 +26,7 @@ · 25 unmodified lines
26 26
27#include <lame/lame.h>27#include <lame/lame.h>
28 28
29#include "libavutil/audioconvert.h"
29#include "libavutil/intreadwrite.h"30#include "libavutil/intreadwrite.h"
30#include "libavutil/log.h"31#include "libavutil/log.h"
31#include "libavutil/opt.h"32#include "libavutil/opt.h"
@@ -76,13 +77,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx) · 44 unmodified lines
76 if ((s->gfp = lame_init()) == NULL)77 if ((s->gfp = lame_init()) == NULL)
77 return AVERROR(ENOMEM);78 return AVERROR(ENOMEM);
78 79
79 /* channels */80
80 if (avctx->channels > 2) {
81 av_log(avctx, AV_LOG_ERROR,
82 "Invalid number of channels %d, must be <= 2\n", avctx->channels);
83 ret = AVERROR(EINVAL);
84 goto error;
85 }
86 lame_set_num_channels(s->gfp, avctx->channels);81 lame_set_num_channels(s->gfp, avctx->channels);
87 lame_set_mode(s->gfp, avctx->channels > 1 ? JOINT_STEREO : MONO);82 lame_set_mode(s->gfp, avctx->channels > 1 ? JOINT_STEREO : MONO);
88 83
@@ -308,6 +303,8 @@ AVCodec ff_libmp3lame_encoder = { · 219 unmodified lines
308 AV_SAMPLE_FMT_S16,303 AV_SAMPLE_FMT_S16,
309 AV_SAMPLE_FMT_NONE },304 AV_SAMPLE_FMT_NONE },
310 .supported_samplerates = libmp3lame_sample_rates,305 .supported_samplerates = libmp3lame_sample_rates,
306 .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
307 AV_CH_LAYOUT_STEREO },
311 .long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),308 .long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
312 .priv_class = &libmp3lame_class,309 .priv_class = &libmp3lame_class,
313 .defaults = libmp3lame_defaults,310 .defaults = libmp3lame_defaults,
libavfilter/Makefile+5−0
@@ -2,6 +2,7 @@ include $(SUBDIR)../config.mak · 1 unmodified line
2 2
3NAME = avfilter3NAME = avfilter
4FFLIBS = avutil swscale4FFLIBS = avutil swscale
5FFLIBS-$(CONFIG_ASYNCTS_FILTER) += avresample
5FFLIBS-$(CONFIG_RESAMPLE_FILTER) += avresample6FFLIBS-$(CONFIG_RESAMPLE_FILTER) += avresample
6 7
7FFLIBS-$(CONFIG_ACONVERT_FILTER) += swresample8FFLIBS-$(CONFIG_ACONVERT_FILTER) += swresample
@@ -25,6 +26,7 @@ OBJS = allfilters.o \ · 17 unmodified lines
25 audio.o \26 audio.o \
26 avfilter.o \27 avfilter.o \
27 avfiltergraph.o \28 avfiltergraph.o \
29 buffer.o \
28 buffersink.o \30 buffersink.o \
29 defaults.o \31 defaults.o \
30 drawutils.o \32 drawutils.o \
@@ -34,6 +36,8 @@ OBJS = allfilters.o \ · 3 unmodified lines
34 src_buffer.o \36 src_buffer.o \
35 transform.o \37 transform.o \
36 vf_scale.o \38 vf_scale.o \
39 video.o \
40
37 41
38OBJS-$(CONFIG_AVCODEC) += avcodec.o42OBJS-$(CONFIG_AVCODEC) += avcodec.o
39OBJS-$(CONFIG_AVFORMAT) += lavfutils.o43OBJS-$(CONFIG_AVFORMAT) += lavfutils.o
@@ -47,6 +51,7 @@ OBJS-$(CONFIG_ARESAMPLE_FILTER) += af_aresample.o · 7 unmodified lines
47OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o51OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o
48OBJS-$(CONFIG_ASPLIT_FILTER) += af_asplit.o52OBJS-$(CONFIG_ASPLIT_FILTER) += af_asplit.o
49OBJS-$(CONFIG_ASTREAMSYNC_FILTER) += af_astreamsync.o53OBJS-$(CONFIG_ASTREAMSYNC_FILTER) += af_astreamsync.o
54OBJS-$(CONFIG_ASYNCTS_FILTER) += af_asyncts.o
50OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o55OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o
51OBJS-$(CONFIG_PAN_FILTER) += af_pan.o56OBJS-$(CONFIG_PAN_FILTER) += af_pan.o
52OBJS-$(CONFIG_RESAMPLE_FILTER) += af_resample.o57OBJS-$(CONFIG_RESAMPLE_FILTER) += af_resample.o
libavfilter/af_aconvert.c+8−7
@@ -74,6 +74,7 @@ static int query_formats(AVFilterContext *ctx) · 73 unmodified lines
74 AVFilterLink *inlink = ctx->inputs[0];74 AVFilterLink *inlink = ctx->inputs[0];
75 AVFilterLink *outlink = ctx->outputs[0];75 AVFilterLink *outlink = ctx->outputs[0];
76 int out_packing = av_sample_fmt_is_planar(aconvert->out_sample_fmt);76 int out_packing = av_sample_fmt_is_planar(aconvert->out_sample_fmt);
77 AVFilterChannelLayouts *layouts;
77 78
78 avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),79 avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),
79 &inlink->out_formats);80 &inlink->out_formats);
@@ -85,15 +86,15 @@ static int query_formats(AVFilterContext *ctx) · 5 unmodified lines
85 avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),86 avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),
86 &outlink->in_formats);87 &outlink->in_formats);
87 88
88 avfilter_formats_ref(avfilter_make_all_channel_layouts(),89 ff_channel_layouts_ref(ff_all_channel_layouts(),
89 &inlink->out_chlayouts);90 &inlink->out_channel_layouts);
90 if (aconvert->out_chlayout != 0) {91 if (aconvert->out_chlayout != 0) {
91 formats = NULL;92 layouts = NULL;
92 avfilter_add_format(&formats, aconvert->out_chlayout);93 ff_add_channel_layout(&layouts, aconvert->out_chlayout);
93 avfilter_formats_ref(formats, &outlink->in_chlayouts);94 ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts);
94 } else95 } else
95 avfilter_formats_ref(avfilter_make_all_channel_layouts(),96 ff_channel_layouts_ref(ff_all_channel_layouts(),
96 &outlink->in_chlayouts);97 &outlink->in_channel_layouts);
97 98
98 avfilter_formats_ref(avfilter_make_all_packing_formats(),99 avfilter_formats_ref(avfilter_make_all_packing_formats(),
99 &inlink->out_packing);100 &inlink->out_packing);
libavfilter/af_aformat.c+89−51
@@ -25,72 +25,110 @@ · 24 unmodified lines
25 25
26#include "libavutil/audioconvert.h"26#include "libavutil/audioconvert.h"
27#include "libavutil/avstring.h"27#include "libavutil/avstring.h"
28#include "avfilter.h"28#include "libavutil/opt.h"
29
29#include "audio.h"30#include "audio.h"
31#include "avfilter.h"
32#include "formats.h"
30#include "internal.h"33#include "internal.h"
31 34
32typedef struct {35typedef struct AFormatContext {
33 AVFilterFormats *formats, *chlayouts, *packing;36 const AVClass *class;
37
38 AVFilterFormats *formats;
39 AVFilterFormats *sample_rates;
40 AVFilterChannelLayouts *channel_layouts;
41
42 char *formats_str;
43 char *sample_rates_str;
44 char *channel_layouts_str;
34} AFormatContext;45} AFormatContext;
35 46
47#define OFFSET(x) offsetof(AFormatContext, x)
48#define A AV_OPT_FLAG_AUDIO_PARAM
49static const AVOption options[] = {
50 { "sample_fmts", "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags = A },
51 { "sample_rates", "A comma-separated list of sample rates.", OFFSET(sample_rates_str), AV_OPT_TYPE_STRING, .flags = A },
52 { "channel_layouts", "A comma-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A },
53 { NULL },
54};
55
56static const AVClass aformat_class = {
57 .class_name = "aformat filter",
58 .item_name = av_default_item_name,
59 .option = options,
60 .version = LIBAVUTIL_VERSION_INT,
61};
62
63#define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc) \
64do { \
65 char *next, *cur = str; \
66 while (cur) { \
67 type fmt; \
68 next = strchr(cur, ','); \
69 if (next) \
70 *next++ = 0; \
71 \
72 if ((fmt = get_fmt(cur)) == none) { \
73 av_log(ctx, AV_LOG_ERROR, "Error parsing " desc ": %s.\n", cur);\
74 ret = AVERROR(EINVAL); \
75 goto fail; \
76 } \
77 add_to_list(&list, fmt); \
78 \
79 cur = next; \
80 } \
81} while (0)
82
83static int get_sample_rate(const char *samplerate)
84{
85 int ret = strtol(samplerate, NULL, 0);
86 return FFMAX(ret, 0);
87}
88
36static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)89static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
37{90{
38 AFormatContext * const aformat = ctx->priv;91 AFormatContext *s = ctx->priv;
39 char *fmts_str = NULL, *fmt_str, *ptr = NULL;
40 int64_t fmt;
41 int ret;92 int ret;
42 93
43 if (!args)94 if (!args) {
44 goto arg_fail;95 av_log(ctx, AV_LOG_ERROR, "No parameters supplied.\n");
45 96 return AVERROR(EINVAL);
46#define ADD_FORMATS(all_formats, fmt_name, fmt_type, fmts_list) do { \97 }
47 fmts_str = av_get_token(&args, ":"); \
48 if (!fmts_str || !*fmts_str) \
49 goto arg_fail; \
50 if (!strcmp(fmts_str, "all")) { \
51 aformat->fmts_list = all_formats; \
52 } else { \
53 for (fmt_str = fmts_str; \
54 fmt_str = av_strtok(fmt_str, ",", &ptr); fmt_str = NULL) { \
55 if ((ret = ff_parse_##fmt_name((fmt_type *)&fmt, \
56 fmt_str, ctx)) < 0) { \
57 av_freep(&fmts_str); \
58 return ret; \
59 } \
60 avfilter_add_format(&aformat->fmts_list, fmt); \
61 } \
62 } \
63 av_freep(&fmts_str); \
64 if (*args) \
65 args++; \
66} while (0)
67 98
68 ADD_FORMATS(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO), sample_format, int, formats);99 s->class = &aformat_class;
69 ADD_FORMATS(avfilter_make_all_channel_layouts(), channel_layout, int64_t, chlayouts);100 av_opt_set_defaults(s);
70 ADD_FORMATS(avfilter_make_all_packing_formats(), packing_format, int, packing);
71 101
72 return 0;102 if ((ret = av_set_options_string(s, args, "=", ":")) < 0) {
103 av_log(ctx, AV_LOG_ERROR, "Error parsing options string '%s'.\n", args);
104 return ret;
105 }
73 106
74arg_fail:107 PARSE_FORMATS(s->formats_str, enum AVSampleFormat, s->formats,
75 av_log(ctx, AV_LOG_ERROR, "Invalid arguments, they must be of the form "108 avfilter_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample format");
76 "sample_fmts:channel_layouts:packing_fmts\n");109 PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, avfilter_add_format,
77 av_freep(&fmts_str);110 get_sample_rate, 0, "sample rate");
78 return AVERROR(EINVAL);111 PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts,
112 ff_add_channel_layout, av_get_channel_layout, 0,
113 "channel layout");
114
115fail:
116 av_opt_free(s);
117 return ret;
79}118}
80 119
81static int query_formats(AVFilterContext *ctx)120static int query_formats(AVFilterContext *ctx)
82{121{
83 AFormatContext * const aformat = ctx->priv;122 AFormatContext *s = ctx->priv;
84 123
85 avfilter_set_common_sample_formats (ctx, aformat->formats);124 avfilter_set_common_formats(ctx, s->formats ? s->formats :
86 avfilter_set_common_channel_layouts(ctx, aformat->chlayouts);125 avfilter_all_formats(AVMEDIA_TYPE_AUDIO));
87 avfilter_set_common_packing_formats(ctx, aformat->packing);126 ff_set_common_samplerates(ctx, s->sample_rates ? s->sample_rates :
88 return 0;127 ff_all_samplerates());
89}128 ff_set_common_channel_layouts(ctx, s->channel_layouts ? s->channel_layouts :
129 ff_all_channel_layouts());
90 130
91static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)131 return 0;
92{
93 ff_filter_samples(inlink->dst->outputs[0], insamplesref);
94}132}
95 133
96AVFilter avfilter_af_aformat = {134AVFilter avfilter_af_aformat = {
@@ -100,11 +138,11 @@ AVFilter avfilter_af_aformat = { · 3 unmodified lines
100 .query_formats = query_formats,138 .query_formats = query_formats,
101 .priv_size = sizeof(AFormatContext),139 .priv_size = sizeof(AFormatContext),
102 140
103 .inputs = (const AVFilterPad[]) {{ .name = "default",141 .inputs = (AVFilterPad[]) {{ .name = "default",
104 .type = AVMEDIA_TYPE_AUDIO,142 .type = AVMEDIA_TYPE_AUDIO,
105 .filter_samples = filter_samples},143 .filter_samples = ff_null_filter_samples },
106 { .name = NULL}},144 { .name = NULL}},
107 .outputs = (const AVFilterPad[]) {{ .name = "default",145 .outputs = (AVFilterPad[]) {{ .name = "default",
108 .type = AVMEDIA_TYPE_AUDIO},146 .type = AVMEDIA_TYPE_AUDIO},
109 { .name = NULL}},147 { .name = NULL}},
110};148};
libavfilter/af_amerge.c+11−10
@@ -56,17 +56,18 @@ static int query_formats(AVFilterContext *ctx) · 55 unmodified lines
56 int64_t inlayout[2], outlayout;56 int64_t inlayout[2], outlayout;
57 const int packing_fmts[] = { AVFILTER_PACKED, -1 };57 const int packing_fmts[] = { AVFILTER_PACKED, -1 };
58 AVFilterFormats *formats;58 AVFilterFormats *formats;
59 AVFilterChannelLayouts *layouts;
59 int i;60 int i;
60 61
61 for (i = 0; i < 2; i++) {62 for (i = 0; i < 2; i++) {
62 if (!ctx->inputs[i]->in_chlayouts ||63 if (!ctx->inputs[i]->in_channel_layouts ||
63 !ctx->inputs[i]->in_chlayouts->format_count) {64 !ctx->inputs[i]->in_channel_layouts->nb_channel_layouts) {
64 av_log(ctx, AV_LOG_ERROR,65 av_log(ctx, AV_LOG_ERROR,
65 "No channel layout for input %d\n", i + 1);66 "No channel layout for input %d\n", i + 1);
66 return AVERROR(EINVAL);67 return AVERROR(EINVAL);
67 }68 }
68 inlayout[i] = ctx->inputs[i]->in_chlayouts->formats[0];69 inlayout[i] = ctx->inputs[i]->in_channel_layouts->channel_layouts[0];
69 if (ctx->inputs[i]->in_chlayouts->format_count > 1) {70 if (ctx->inputs[i]->in_channel_layouts->nb_channel_layouts > 1) {
70 char buf[256];71 char buf[256];
71 av_get_channel_layout_string(buf, sizeof(buf), 0, inlayout[i]);72 av_get_channel_layout_string(buf, sizeof(buf), 0, inlayout[i]);
72 av_log(ctx, AV_LOG_INFO, "Using \"%s\" for input %d\n", buf, i + 1);73 av_log(ctx, AV_LOG_INFO, "Using \"%s\" for input %d\n", buf, i + 1);
@@ -101,13 +102,13 @@ static int query_formats(AVFilterContext *ctx) · 28 unmodified lines
101 formats = avfilter_make_format_list(packing_fmts);102 formats = avfilter_make_format_list(packing_fmts);
102 avfilter_set_common_packing_formats(ctx, formats);103 avfilter_set_common_packing_formats(ctx, formats);
103 for (i = 0; i < 2; i++) {104 for (i = 0; i < 2; i++) {
104 formats = NULL;105 layouts = NULL;
105 avfilter_add_format(&formats, inlayout[i]);106 ff_add_channel_layout(&layouts, inlayout[i]);
106 avfilter_formats_ref(formats, &ctx->inputs[i]->out_chlayouts);107 ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts);
107 }108 }
108 formats = NULL;109 layouts = NULL;
109 avfilter_add_format(&formats, outlayout);110 ff_add_channel_layout(&layouts, outlayout);
110 avfilter_formats_ref(formats, &ctx->outputs[0]->in_chlayouts);111 ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts);
111 return 0;112 return 0;
112}113}
113 114
libavfilter/af_aresample.c+37−0
@@ -56,6 +56,42 @@ static av_cold void uninit(AVFilterContext *ctx) · 55 unmodified lines
56 swr_free(&aresample->swr);56 swr_free(&aresample->swr);
57}57}
58 58
59static int query_formats(AVFilterContext *ctx)
60{
61 AResampleContext *aresample = ctx->priv;
62
63 AVFilterLink *inlink = ctx->inputs[0];
64 AVFilterLink *outlink = ctx->outputs[0];
65
66 AVFilterFormats *in_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO);
67 AVFilterFormats *out_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO);
68 AVFilterFormats *in_samplerates = ff_all_samplerates();
69 AVFilterFormats *out_samplerates;
70
71
72 AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts();
73 AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts();
74
75 avfilter_formats_ref(in_formats, &inlink->out_formats);
76 avfilter_formats_ref(out_formats, &outlink->in_formats);
77
78 avfilter_formats_ref(in_samplerates, &inlink->out_samplerates);
79
80 ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts);
81 ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);
82
83 if(aresample->out_rate > 0) {
84 int sample_rates[] = { aresample->out_rate, -1 };
85 ff_set_common_samplerates(ctx, avfilter_make_format_list(sample_rates));
86 } else {
87 out_samplerates = ff_all_samplerates();
88 avfilter_formats_ref(out_samplerates, &outlink->in_samplerates);
89 }
90
91 return 0;
92}
93
94
59static int config_output(AVFilterLink *outlink)95static int config_output(AVFilterLink *outlink)
60{96{
61 int ret;97 int ret;
@@ -113,6 +149,7 @@ AVFilter avfilter_af_aresample = { · 51 unmodified lines
113 .description = NULL_IF_CONFIG_SMALL("Resample audio data."),149 .description = NULL_IF_CONFIG_SMALL("Resample audio data."),
114 .init = init,150 .init = init,
115 .uninit = uninit,151 .uninit = uninit,
152 .query_formats = query_formats,
116 .priv_size = sizeof(AResampleContext),153 .priv_size = sizeof(AResampleContext),
117 154
118 .inputs = (const AVFilterPad[]) {{ .name = "default",155 .inputs = (const AVFilterPad[]) {{ .name = "default",
libavfilter/af_astreamsync.c+4−3
@@ -81,6 +81,7 @@ static int query_formats(AVFilterContext *ctx) · 80 unmodified lines
81{81{
82 int i;82 int i;
83 AVFilterFormats *formats;83 AVFilterFormats *formats;
84 AVFilterChannelLayouts *layouts;
84 85
85 for (i = 0; i < 2; i++) {86 for (i = 0; i < 2; i++) {
86 formats = ctx->inputs[i]->in_formats;87 formats = ctx->inputs[i]->in_formats;
@@ -89,9 +90,9 @@ static int query_formats(AVFilterContext *ctx) · 2 unmodified lines
89 formats = ctx->inputs[i]->in_packing;90 formats = ctx->inputs[i]->in_packing;
90 avfilter_formats_ref(formats, &ctx->inputs[i]->out_packing);91 avfilter_formats_ref(formats, &ctx->inputs[i]->out_packing);
91 avfilter_formats_ref(formats, &ctx->outputs[i]->in_packing);92 avfilter_formats_ref(formats, &ctx->outputs[i]->in_packing);
92 formats = ctx->inputs[i]->in_chlayouts;93 layouts = ctx->inputs[i]->in_channel_layouts;
93 avfilter_formats_ref(formats, &ctx->inputs[i]->out_chlayouts);94 ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts);
94 avfilter_formats_ref(formats, &ctx->outputs[i]->in_chlayouts);95 ff_channel_layouts_ref(layouts, &ctx->outputs[i]->in_channel_layouts);
95 }96 }
96 return 0;97 return 0;
97}98}
libavfilter/af_asyncts.c+237−0
@@ -0,0 +1,237 @@
1/*
2 * This file is part of Libav.
3 *
4 * Libav is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * Libav is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with Libav; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "libavresample/avresample.h"
20#include "libavutil/audio_fifo.h"
21#include "libavutil/mathematics.h"
22#include "libavutil/opt.h"
23#include "libavutil/samplefmt.h"
24
25#include "audio.h"
26#include "avfilter.h"
27
28typedef struct ASyncContext {
29 const AVClass *class;
30
31 AVAudioResampleContext *avr;
32 int64_t pts; ///< timestamp in samples of the first sample in fifo
33 int min_delta; ///< pad/trim min threshold in samples
34
35 /* options */
36 int resample;
37 float min_delta_sec;
38 int max_comp;
39} ASyncContext;
40
41#define OFFSET(x) offsetof(ASyncContext, x)
42#define A AV_OPT_FLAG_AUDIO_PARAM
43static const AVOption options[] = {
44 { "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample), AV_OPT_TYPE_INT, { 0 }, 0, 1, A },
45 { "min_delta", "Minimum difference between timestamps and audio data "
46 "(in seconds) to trigger padding/trimmin the data.", OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { 0.1 }, 0, INT_MAX, A },
47 { "max_comp", "Maximum compensation in samples per second.", OFFSET(max_comp), AV_OPT_TYPE_INT, { 500 }, 0, INT_MAX, A },
48 { NULL },
49};
50
51static const AVClass async_class = {
52 .class_name = "asyncts filter",
53 .item_name = av_default_item_name,
54 .option = options,
55 .version = LIBAVUTIL_VERSION_INT,
56};
57
58static int init(AVFilterContext *ctx, const char *args, void *opaque)
59{
60 ASyncContext *s = ctx->priv;
61 int ret;
62
63 s->class = &async_class;
64 av_opt_set_defaults(s);
65
66 if ((ret = av_set_options_string(s, args, "=", ":")) < 0) {
67 av_log(ctx, AV_LOG_ERROR, "Error parsing options string '%s'.\n", args);
68 return ret;
69 }
70 av_opt_free(s);
71
72 s->pts = AV_NOPTS_VALUE;
73
74 return 0;
75}
76
77static void uninit(AVFilterContext *ctx)
78{
79 ASyncContext *s = ctx->priv;
80
81 if (s->avr) {
82 avresample_close(s->avr);
83 avresample_free(&s->avr);
84 }
85}
86
87static int config_props(AVFilterLink *link)
88{
89 ASyncContext *s = link->src->priv;
90 int ret;
91
92 s->min_delta = s->min_delta_sec * link->sample_rate;
93 link->time_base = (AVRational){1, link->sample_rate};
94
95 s->avr = avresample_alloc_context();
96 if (!s->avr)
97 return AVERROR(ENOMEM);
98
99 av_opt_set_int(s->avr, "in_channel_layout", link->channel_layout, 0);
100 av_opt_set_int(s->avr, "out_channel_layout", link->channel_layout, 0);
101 av_opt_set_int(s->avr, "in_sample_fmt", link->format, 0);
102 av_opt_set_int(s->avr, "out_sample_fmt", link->format, 0);
103 av_opt_set_int(s->avr, "in_sample_rate", link->sample_rate, 0);
104 av_opt_set_int(s->avr, "out_sample_rate", link->sample_rate, 0);
105
106 if (s->resample)
107 av_opt_set_int(s->avr, "force_resampling", 1, 0);
108
109 if ((ret = avresample_open(s->avr)) < 0)
110 return ret;
111
112 return 0;
113}
114
115static int request_frame(AVFilterLink *link)
116{
117 AVFilterContext *ctx = link->src;
118 ASyncContext *s = ctx->priv;
119 int ret = avfilter_request_frame(ctx->inputs[0]);
120 int nb_samples;
121
122 /* flush the fifo */
123 if (ret == AVERROR_EOF && (nb_samples = avresample_get_delay(s->avr))) {
124 AVFilterBufferRef *buf = ff_get_audio_buffer(link, AV_PERM_WRITE,
125 nb_samples);
126 if (!buf)
127 return AVERROR(ENOMEM);
128 avresample_convert(s->avr, (void**)buf->extended_data, buf->linesize[0],
129 nb_samples, NULL, 0, 0);
130 buf->pts = s->pts;
131 ff_filter_samples(link, buf);
132 return 0;
133 }
134
135 return ret;
136}
137
138static void write_to_fifo(ASyncContext *s, AVFilterBufferRef *buf)
139{
140 avresample_convert(s->avr, NULL, 0, 0, (void**)buf->extended_data,
141 buf->linesize[0], buf->audio->nb_samples);
142 avfilter_unref_buffer(buf);
143}
144
145/* get amount of data currently buffered, in samples */
146static int64_t get_delay(ASyncContext *s)
147{
148 return avresample_available(s->avr) + avresample_get_delay(s->avr);
149}
150
151static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
152{
153 AVFilterContext *ctx = inlink->dst;
154 ASyncContext *s = ctx->priv;
155 AVFilterLink *outlink = ctx->outputs[0];
156 int nb_channels = av_get_channel_layout_nb_channels(buf->audio->channel_layout);
157 int64_t pts = (buf->pts == AV_NOPTS_VALUE) ? buf->pts :
158 av_rescale_q(buf->pts, inlink->time_base, outlink->time_base);
159 int out_size;
160 int64_t delta;
161
162 /* buffer data until we get the first timestamp */
163 if (s->pts == AV_NOPTS_VALUE) {
164 if (pts != AV_NOPTS_VALUE) {
165 s->pts = pts - get_delay(s);
166 }
167 write_to_fifo(s, buf);
168 return;
169 }
170
171 /* now wait for the next timestamp */
172 if (pts == AV_NOPTS_VALUE) {
173 write_to_fifo(s, buf);
174 return;
175 }
176
177 /* when we have two timestamps, compute how many samples would we have
178 * to add/remove to get proper sync between data and timestamps */
179 delta = pts - s->pts - get_delay(s);
180 out_size = avresample_available(s->avr);
181
182 if (labs(delta) > s->min_delta) {
183 av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\n", delta);
184 out_size += delta;
185 } else if (s->resample) {
186 int comp = av_clip(delta, -s->max_comp, s->max_comp);
187 av_log(ctx, AV_LOG_VERBOSE, "Compensating %d samples per second.\n", comp);
188 avresample_set_compensation(s->avr, delta, inlink->sample_rate);
189 }
190
191 if (out_size > 0) {
192 AVFilterBufferRef *buf_out = ff_get_audio_buffer(outlink, AV_PERM_WRITE,
193 out_size);
194 if (!buf_out)
195 return;
196
197 avresample_read(s->avr, (void**)buf_out->extended_data, out_size);
198 buf_out->pts = s->pts;
199
200 if (delta > 0) {
201 av_samples_set_silence(buf_out->extended_data, out_size - delta,
202 delta, nb_channels, buf->format);
203 }
204 ff_filter_samples(outlink, buf_out);
205 } else {
206 av_log(ctx, AV_LOG_WARNING, "Non-monotonous timestamps, dropping "
207 "whole buffer.\n");
208 }
209
210 /* drain any remaining buffered data */
211 avresample_read(s->avr, NULL, avresample_available(s->avr));
212
213 s->pts = pts - avresample_get_delay(s->avr);
214 avresample_convert(s->avr, NULL, 0, 0, (void**)buf->extended_data,
215 buf->linesize[0], buf->audio->nb_samples);
216 avfilter_unref_buffer(buf);
217}
218
219AVFilter avfilter_af_asyncts = {
220 .name = "asyncts",
221 .description = NULL_IF_CONFIG_SMALL("Sync audio data to timestamps"),
222
223 .init = init,
224 .uninit = uninit,
225
226 .priv_size = sizeof(ASyncContext),
227
228 .inputs = (const AVFilterPad[]) {{ .name = "default",
229 .type = AVMEDIA_TYPE_AUDIO,
230 .filter_samples = filter_samples },
231 { NULL }},
232 .outputs = (const AVFilterPad[]) {{ .name = "default",
233 .type = AVMEDIA_TYPE_AUDIO,
234 .config_props = config_props,
235 .request_frame = request_frame },
236 { NULL }},
237};
libavfilter/af_earwax.c+8−3
@@ -32,6 +32,7 @@ · 31 unmodified lines
32#include "libavutil/audioconvert.h"32#include "libavutil/audioconvert.h"
33#include "avfilter.h"33#include "avfilter.h"
34#include "audio.h"34#include "audio.h"
35#include "formats.h"
35 36
36#define NUMTAPS 6437#define NUMTAPS 64
37 38
@@ -76,15 +77,19 @@ typedef struct { · 38 unmodified lines
76 77
77static int query_formats(AVFilterContext *ctx)78static int query_formats(AVFilterContext *ctx)
78{79{
80 int sample_rates[] = { 44100, -1 };
81
79 AVFilterFormats *formats = NULL;82 AVFilterFormats *formats = NULL;
83 AVFilterChannelLayouts *layout = NULL;
84
80 avfilter_add_format(&formats, AV_SAMPLE_FMT_S16);85 avfilter_add_format(&formats, AV_SAMPLE_FMT_S16);
81 avfilter_set_common_sample_formats(ctx, formats);86 avfilter_set_common_sample_formats(ctx, formats);
82 formats = NULL;87 ff_add_channel_layout(&layout, AV_CH_LAYOUT_STEREO);
83 avfilter_add_format(&formats, AV_CH_LAYOUT_STEREO);88 ff_set_common_channel_layouts(ctx, layout);
84 avfilter_set_common_channel_layouts(ctx, formats);
85 formats = NULL;89 formats = NULL;
86 avfilter_add_format(&formats, AVFILTER_PACKED);90 avfilter_add_format(&formats, AVFILTER_PACKED);
87 avfilter_set_common_packing_formats(ctx, formats);91 avfilter_set_common_packing_formats(ctx, formats);
92 ff_set_common_samplerates(ctx, avfilter_make_format_list(sample_rates));
88 93
89 return 0;94 return 0;
90}95}
libavfilter/af_pan.c+7−6
@@ -33,6 +33,7 @@ · 32 unmodified lines
33#include "libswresample/swresample.h"33#include "libswresample/swresample.h"
34#include "audio.h"34#include "audio.h"
35#include "avfilter.h"35#include "avfilter.h"
36#include "formats.h"
36 37
37#define MAX_CHANNELS 6338#define MAX_CHANNELS 63
38 39
@@ -212,7 +213,7 @@ static int query_formats(AVFilterContext *ctx) · 173 unmodified lines
212 PanContext *pan = ctx->priv;213 PanContext *pan = ctx->priv;
213 AVFilterLink *inlink = ctx->inputs[0];214 AVFilterLink *inlink = ctx->inputs[0];
214 AVFilterLink *outlink = ctx->outputs[0];215 AVFilterLink *outlink = ctx->outputs[0];
215 AVFilterFormats *formats;216 AVFilterChannelLayouts *layouts;
216 217
217 pan->pure_gains = are_gains_pure(pan);218 pan->pure_gains = are_gains_pure(pan);
218 /* libswr supports any sample and packing formats */219 /* libswr supports any sample and packing formats */
@@ -220,13 +221,13 @@ static int query_formats(AVFilterContext *ctx) · 1 unmodified line
220 avfilter_set_common_packing_formats(ctx, avfilter_make_all_packing_formats());221 avfilter_set_common_packing_formats(ctx, avfilter_make_all_packing_formats());
221 222
222 // inlink supports any channel layout223 // inlink supports any channel layout
223 formats = avfilter_make_all_channel_layouts();224 layouts = ff_all_channel_layouts();
224 avfilter_formats_ref(formats, &inlink->out_chlayouts);225 ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts);
225 226
226 // outlink supports only requested output channel layout227 // outlink supports only requested output channel layout
227 formats = NULL;228 layouts = NULL;
228 avfilter_add_format(&formats, pan->out_channel_layout);229 ff_add_channel_layout(&layouts, pan->out_channel_layout);
229 avfilter_formats_ref(formats, &outlink->in_chlayouts);230 ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts);
230 return 0;231 return 0;
231}232}
232 233
libavfilter/af_resample.c+11−0
@@ -31,6 +31,7 @@ · 30 unmodified lines
31 31
32#include "audio.h"32#include "audio.h"
33#include "avfilter.h"33#include "avfilter.h"
34#include "formats.h"
34#include "internal.h"35#include "internal.h"
35 36
36typedef struct ResampleContext {37typedef struct ResampleContext {
@@ -56,10 +57,20 @@ static int query_formats(AVFilterContext *ctx) · 19 unmodified lines
56 57
57 AVFilterFormats *in_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO);58 AVFilterFormats *in_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO);
58 AVFilterFormats *out_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO);59 AVFilterFormats *out_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO);
60 AVFilterFormats *in_samplerates = ff_all_samplerates();
61 AVFilterFormats *out_samplerates = ff_all_samplerates();
62 AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts();
63 AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts();
59 64
60 avfilter_formats_ref(in_formats, &inlink->out_formats);65 avfilter_formats_ref(in_formats, &inlink->out_formats);
61 avfilter_formats_ref(out_formats, &outlink->in_formats);66 avfilter_formats_ref(out_formats, &outlink->in_formats);
62 67
68 avfilter_formats_ref(in_samplerates, &inlink->out_samplerates);
69 avfilter_formats_ref(out_samplerates, &outlink->in_samplerates);
70
71 ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts);
72 ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);
73
63 return 0;74 return 0;
64}75}
65 76
libavfilter/af_silencedetect.c+10−3
@@ -26,6 +26,7 @@ · 25 unmodified lines
26#include "libavutil/opt.h"26#include "libavutil/opt.h"
27#include "libavutil/timestamp.h"27#include "libavutil/timestamp.h"
28#include "audio.h"28#include "audio.h"
29#include "formats.h"
29#include "avfilter.h"30#include "avfilter.h"
30 31
31typedef struct {32typedef struct {
@@ -130,16 +131,17 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 98 unmodified lines
130static int query_formats(AVFilterContext *ctx)131static int query_formats(AVFilterContext *ctx)
131{132{
132 AVFilterFormats *formats = NULL;133 AVFilterFormats *formats = NULL;
134 AVFilterChannelLayouts *layouts = NULL;
133 enum AVSampleFormat sample_fmts[] = {135 enum AVSampleFormat sample_fmts[] = {
134 AV_SAMPLE_FMT_DBL,136 AV_SAMPLE_FMT_DBL,
135 AV_SAMPLE_FMT_NONE137 AV_SAMPLE_FMT_NONE
136 };138 };
137 int packing_fmts[] = { AVFILTER_PACKED, -1 };139 int packing_fmts[] = { AVFILTER_PACKED, -1 };
138 140
139 formats = avfilter_make_all_channel_layouts();141 layouts = ff_all_channel_layouts();
140 if (!formats)142 if (!layouts)
141 return AVERROR(ENOMEM);143 return AVERROR(ENOMEM);
142 avfilter_set_common_channel_layouts(ctx, formats);144 ff_set_common_channel_layouts(ctx, layouts);
143 145
144 formats = avfilter_make_format_list(sample_fmts);146 formats = avfilter_make_format_list(sample_fmts);
145 if (!formats)147 if (!formats)
@@ -151,6 +153,11 @@ static int query_formats(AVFilterContext *ctx) · 5 unmodified lines
151 return AVERROR(ENOMEM);153 return AVERROR(ENOMEM);
152 avfilter_set_common_packing_formats(ctx, formats);154 avfilter_set_common_packing_formats(ctx, formats);
153 155
156 formats = ff_all_samplerates();
157 if (!formats)
158 return AVERROR(ENOMEM);
159 ff_set_common_samplerates(ctx, formats);
160
154 return 0;161 return 0;
155}162}
156 163
libavfilter/af_volume.c+10−3
@@ -28,6 +28,7 @@ · 27 unmodified lines
28#include "libavutil/eval.h"28#include "libavutil/eval.h"
29#include "audio.h"29#include "audio.h"
30#include "avfilter.h"30#include "avfilter.h"
31#include "formats.h"
31 32
32typedef struct {33typedef struct {
33 double volume;34 double volume;
@@ -81,6 +82,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 47 unmodified lines
81static int query_formats(AVFilterContext *ctx)82static int query_formats(AVFilterContext *ctx)
82{83{
83 AVFilterFormats *formats = NULL;84 AVFilterFormats *formats = NULL;
85 AVFilterChannelLayouts *layouts;
84 enum AVSampleFormat sample_fmts[] = {86 enum AVSampleFormat sample_fmts[] = {
85 AV_SAMPLE_FMT_U8,87 AV_SAMPLE_FMT_U8,
86 AV_SAMPLE_FMT_S16,88 AV_SAMPLE_FMT_S16,
@@ -91,10 +93,10 @@ static int query_formats(AVFilterContext *ctx) · 4 unmodified lines
91 };93 };
92 int packing_fmts[] = { AVFILTER_PACKED, -1 };94 int packing_fmts[] = { AVFILTER_PACKED, -1 };
93 95
94 formats = avfilter_make_all_channel_layouts();96 layouts = ff_all_channel_layouts();
95 if (!formats)97 if (!layouts)
96 return AVERROR(ENOMEM);98 return AVERROR(ENOMEM);
97 avfilter_set_common_channel_layouts(ctx, formats);99 ff_set_common_channel_layouts(ctx, layouts);
98 100
99 formats = avfilter_make_format_list(sample_fmts);101 formats = avfilter_make_format_list(sample_fmts);
100 if (!formats)102 if (!formats)
@@ -106,6 +108,11 @@ static int query_formats(AVFilterContext *ctx) · 5 unmodified lines
106 return AVERROR(ENOMEM);108 return AVERROR(ENOMEM);
107 avfilter_set_common_packing_formats(ctx, formats);109 avfilter_set_common_packing_formats(ctx, formats);
108 110
111 formats = ff_all_samplerates();
112 if (!formats)
113 return AVERROR(ENOMEM);
114 ff_set_common_samplerates(ctx, formats);
115
109 return 0;116 return 0;
110}117}
111 118
libavfilter/allfilters.c+9−1
@@ -42,13 +42,13 @@ void avfilter_register_all(void) · 41 unmodified lines
42 REGISTER_FILTER (ASHOWINFO, ashowinfo, af);42 REGISTER_FILTER (ASHOWINFO, ashowinfo, af);
43 REGISTER_FILTER (ASPLIT, asplit, af);43 REGISTER_FILTER (ASPLIT, asplit, af);
44 REGISTER_FILTER (ASTREAMSYNC, astreamsync, af);44 REGISTER_FILTER (ASTREAMSYNC, astreamsync, af);
45 REGISTER_FILTER (ASYNCTS, asyncts, af);
45 REGISTER_FILTER (EARWAX, earwax, af);46 REGISTER_FILTER (EARWAX, earwax, af);
46 REGISTER_FILTER (PAN, pan, af);47 REGISTER_FILTER (PAN, pan, af);
47 REGISTER_FILTER (SILENCEDETECT, silencedetect, af);48 REGISTER_FILTER (SILENCEDETECT, silencedetect, af);
48 REGISTER_FILTER (VOLUME, volume, af);49 REGISTER_FILTER (VOLUME, volume, af);
49 REGISTER_FILTER (RESAMPLE, resample, af);50 REGISTER_FILTER (RESAMPLE, resample, af);
50 51
51 REGISTER_FILTER (ABUFFER, abuffer, asrc);
52 REGISTER_FILTER (AEVALSRC, aevalsrc, asrc);52 REGISTER_FILTER (AEVALSRC, aevalsrc, asrc);
53 REGISTER_FILTER (AMOVIE, amovie, asrc);53 REGISTER_FILTER (AMOVIE, amovie, asrc);
54 REGISTER_FILTER (ANULLSRC, anullsrc, asrc);54 REGISTER_FILTER (ANULLSRC, anullsrc, asrc);
@@ -129,10 +129,18 @@ void avfilter_register_all(void) · 74 unmodified lines
129 extern AVFilter avfilter_vsrc_buffer;129 extern AVFilter avfilter_vsrc_buffer;
130 avfilter_register(&avfilter_vsrc_buffer);130 avfilter_register(&avfilter_vsrc_buffer);
131 }131 }
132 {
133 extern AVFilter avfilter_asrc_abuffer;
134 avfilter_register(&avfilter_asrc_abuffer);
135 }
132 {136 {
133 extern AVFilter avfilter_vsink_buffer;137 extern AVFilter avfilter_vsink_buffer;
134 avfilter_register(&avfilter_vsink_buffer);138 avfilter_register(&avfilter_vsink_buffer);
135 }139 }
140 {
141 extern AVFilter avfilter_asink_abuffer;
142 avfilter_register(&avfilter_asink_abuffer);
143 }
136 {144 {
137 extern AVFilter avfilter_vf_scale;145 extern AVFilter avfilter_vf_scale;
138 avfilter_register(&avfilter_vf_scale);146 avfilter_register(&avfilter_vf_scale);
libavfilter/asrc_aevalsrc.c+1−1
@@ -190,7 +190,7 @@ static int query_formats(AVFilterContext *ctx) · 189 unmodified lines
190 int packing_fmts[] = { AVFILTER_PLANAR, -1 };190 int packing_fmts[] = { AVFILTER_PLANAR, -1 };
191 191
192 avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts));192 avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts));
193 avfilter_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts));193 ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts));
194 avfilter_set_common_packing_formats(ctx, avfilter_make_format_list(packing_fmts));194 avfilter_set_common_packing_formats(ctx, avfilter_make_format_list(packing_fmts));
195 195
196 return 0;196 return 0;
libavfilter/avcodec.c+0−71
@@ -24,77 +24,6 @@ · 23 unmodified lines
24#include "avcodec.h"24#include "avcodec.h"
25#include "libavutil/opt.h"25#include "libavutil/opt.h"
26 26
27int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
28{
29 dst->pts = src->pts;
30 dst->pos = src->pkt_pos;
31 dst->format = src->format;
32
33 switch (dst->type) {
34 case AVMEDIA_TYPE_VIDEO:
35 dst->video->w = src->width;
36 dst->video->h = src->height;
37 dst->video->sample_aspect_ratio = src->sample_aspect_ratio;
38 dst->video->interlaced = src->interlaced_frame;
39 dst->video->top_field_first = src->top_field_first;
40 dst->video->key_frame = src->key_frame;
41 dst->video->pict_type = src->pict_type;
42 break;
43 case AVMEDIA_TYPE_AUDIO:
44 dst->audio->sample_rate = src->sample_rate;
45 dst->audio->channel_layout = src->channel_layout;
46 break;
47 default:
48 return AVERROR(EINVAL);
49 }
50
51 return 0;
52}
53
54int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
55{
56 int planes, nb_channels;
57
58 memcpy(dst->data, src->data, sizeof(dst->data));
59 memcpy(dst->linesize, src->linesize, sizeof(dst->linesize));
60
61 dst->pts = src->pts;
62 dst->format = src->format;
63
64 switch (src->type) {
65 case AVMEDIA_TYPE_VIDEO:
66 dst->width = src->video->w;
67 dst->height = src->video->h;
68 dst->sample_aspect_ratio = src->video->sample_aspect_ratio;
69 dst->interlaced_frame = src->video->interlaced;
70 dst->top_field_first = src->video->top_field_first;
71 dst->key_frame = src->video->key_frame;
72 dst->pict_type = src->video->pict_type;
73 break;
74 case AVMEDIA_TYPE_AUDIO:
75 nb_channels = av_get_channel_layout_nb_channels(src->audio->channel_layout);
76 planes = av_sample_fmt_is_planar(src->format) ? nb_channels : 1;
77
78 if (planes > FF_ARRAY_ELEMS(dst->data)) {
79 dst->extended_data = av_mallocz(planes * sizeof(*dst->extended_data));
80 if (!dst->extended_data)
81 return AVERROR(ENOMEM);
82 memcpy(dst->extended_data, src->extended_data,
83 planes * sizeof(dst->extended_data));
84 } else
85 dst->extended_data = dst->data;
86
87 dst->sample_rate = src->audio->sample_rate;
88 dst->channel_layout = src->audio->channel_layout;
89 dst->nb_samples = src->audio->nb_samples;
90 break;
91 default:
92 return AVERROR(EINVAL);
93 }
94
95 return 0;
96}
97
98AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame,27AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame,
99 int perms)28 int perms)
100{29{
libavfilter/avfilter.c+20−354
@@ -24,11 +24,11 @@ · 23 unmodified lines
24#include "libavutil/pixdesc.h"24#include "libavutil/pixdesc.h"
25#include "libavutil/rational.h"25#include "libavutil/rational.h"
26#include "libavutil/audioconvert.h"26#include "libavutil/audioconvert.h"
27#include "libavutil/imgutils.h"
28#include "libavutil/avassert.h"27#include "libavutil/avassert.h"
29#include "libavutil/avstring.h"28#include "libavutil/avstring.h"
30 29
31#include "avfilter.h"30#include "avfilter.h"
31#include "formats.h"
32#include "internal.h"32#include "internal.h"
33 33
34unsigned avfilter_version(void) {34unsigned avfilter_version(void) {
@@ -47,7 +47,7 @@ const char *avfilter_license(void) · 12 unmodified lines
47 return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;47 return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
48}48}
49 49
50static void command_queue_pop(AVFilterContext *filter)50void ff_command_queue_pop(AVFilterContext *filter)
51{51{
52 AVFilterCommand *c= filter->command_queue;52 AVFilterCommand *c= filter->command_queue;
53 av_freep(&c->arg);53 av_freep(&c->arg);
@@ -56,133 +56,6 @@ static void command_queue_pop(AVFilterContext *filter) · 2 unmodified lines
56 av_free(c);56 av_free(c);
57}57}
58 58
59AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
60{
61 AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
62 if (!ret)
63 return NULL;
64 *ret = *ref;
65 if (ref->type == AVMEDIA_TYPE_VIDEO) {
66 ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps));
67 if (!ret->video) {
68 av_free(ret);
69 return NULL;
70 }
71 *ret->video = *ref->video;
72 ret->extended_data = ret->data;
73 } else if (ref->type == AVMEDIA_TYPE_AUDIO) {
74 ret->audio = av_malloc(sizeof(AVFilterBufferRefAudioProps));
75 if (!ret->audio) {
76 av_free(ret);
77 return NULL;
78 }
79 *ret->audio = *ref->audio;
80
81 if (ref->extended_data && ref->extended_data != ref->data) {
82 int nb_channels = av_get_channel_layout_nb_channels(ref->audio->channel_layout);
83 if (!(ret->extended_data = av_malloc(sizeof(*ret->extended_data) *
84 nb_channels))) {
85 av_freep(&ret->audio);
86 av_freep(&ret);
87 return NULL;
88 }
89 memcpy(ret->extended_data, ref->extended_data,
90 sizeof(*ret->extended_data) * nb_channels);
91 } else
92 ret->extended_data = ret->data;
93 }
94 ret->perms &= pmask;
95 ret->buf->refcount ++;
96 return ret;
97}
98
99static void free_pool(AVFilterPool *pool)
100{
101 int i;
102
103 av_assert0(pool->refcount > 0);
104
105 for (i = 0; i < POOL_SIZE; i++) {
106 if (pool->pic[i]) {
107 AVFilterBufferRef *picref = pool->pic[i];
108 /* free buffer: picrefs stored in the pool are not
109 * supposed to contain a free callback */
110 av_assert0(!picref->buf->refcount);
111 av_freep(&picref->buf->data[0]);
112 av_freep(&picref->buf);
113
114 av_freep(&picref->audio);
115 av_freep(&picref->video);
116 av_freep(&pool->pic[i]);
117 pool->count--;
118 }
119 }
120 pool->draining = 1;
121
122 if (!--pool->refcount) {
123 av_assert0(!pool->count);
124 av_free(pool);
125 }
126}
127
128static void store_in_pool(AVFilterBufferRef *ref)
129{
130 int i;
131 AVFilterPool *pool= ref->buf->priv;
132
133 av_assert0(ref->buf->data[0]);
134 av_assert0(pool->refcount>0);
135
136 if (pool->count == POOL_SIZE) {
137 AVFilterBufferRef *ref1 = pool->pic[0];
138 av_freep(&ref1->video);
139 av_freep(&ref1->audio);
140 av_freep(&ref1->buf->data[0]);
141 av_freep(&ref1->buf);
142 av_free(ref1);
143 memmove(&pool->pic[0], &pool->pic[1], sizeof(void*)*(POOL_SIZE-1));
144 pool->count--;
145 pool->pic[POOL_SIZE-1] = NULL;
146 }
147
148 for (i = 0; i < POOL_SIZE; i++) {
149 if (!pool->pic[i]) {
150 pool->pic[i] = ref;
151 pool->count++;
152 break;
153 }
154 }
155 if (pool->draining) {
156 free_pool(pool);
157 } else
158 --pool->refcount;
159}
160
161void avfilter_unref_buffer(AVFilterBufferRef *ref)
162{
163 if (!ref)
164 return;
165 av_assert0(ref->buf->refcount > 0);
166 if (!(--ref->buf->refcount)) {
167 if (!ref->buf->free) {
168 store_in_pool(ref);
169 return;
170 }
171 ref->buf->free(ref->buf);
172 }
173 if (ref->extended_data != ref->data)
174 av_freep(&ref->extended_data);
175 av_freep(&ref->video);
176 av_freep(&ref->audio);
177 av_free(ref);
178}
179
180void avfilter_unref_bufferp(AVFilterBufferRef **ref)
181{
182 avfilter_unref_buffer(*ref);
183 *ref = NULL;
184}
185
186void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,59void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
187 AVFilterPad **pads, AVFilterLink ***links,60 AVFilterPad **pads, AVFilterLink ***links,
188 AVFilterPad *newpad)61 AVFilterPad *newpad)
@@ -240,7 +113,7 @@ void avfilter_link_free(AVFilterLink **link) · 51 unmodified lines
240 return;113 return;
241 114
242 if ((*link)->pool)115 if ((*link)->pool)
243 free_pool((*link)->pool);116 ff_free_pool((*link)->pool);
244 117
245 av_freep(link);118 av_freep(link);
246}119}
@@ -272,12 +145,15 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, · 25 unmodified lines
272 if (link->out_formats)145 if (link->out_formats)
273 avfilter_formats_changeref(&link->out_formats,146 avfilter_formats_changeref(&link->out_formats,
274 &filt->outputs[filt_dstpad_idx]->out_formats);147 &filt->outputs[filt_dstpad_idx]->out_formats);
275 if (link->out_chlayouts)148 if (link->out_channel_layouts)
276 avfilter_formats_changeref(&link->out_chlayouts,149 ff_channel_layouts_changeref(&link->out_channel_layouts,
277 &filt->outputs[filt_dstpad_idx]->out_chlayouts);150 &filt->outputs[filt_dstpad_idx]->out_channel_layouts);
278 if (link->out_packing)151 if (link->out_packing)
279 avfilter_formats_changeref(&link->out_packing,152 avfilter_formats_changeref(&link->out_packing,
280 &filt->outputs[filt_dstpad_idx]->out_packing);153 &filt->outputs[filt_dstpad_idx]->out_packing);
154 if (link->out_samplerates)
155 avfilter_formats_changeref(&link->out_samplerates,
156 &filt->outputs[filt_dstpad_idx]->out_samplerates);
281 157
282 return 0;158 return 0;
283}159}
@@ -329,6 +205,7 @@ int avfilter_config_links(AVFilterContext *filter) · 45 unmodified lines
329 link->sample_aspect_ratio = inlink ?205 link->sample_aspect_ratio = inlink ?
330 inlink->sample_aspect_ratio : (AVRational){1,1};206 inlink->sample_aspect_ratio : (AVRational){1,1};
331 207
208#if 1
332 if (inlink) {209 if (inlink) {
333 if (!link->w)210 if (!link->w)
334 link->w = inlink->w;211 link->w = inlink->w;
@@ -359,6 +236,7 @@ int avfilter_config_links(AVFilterContext *filter) · 24 unmodified lines
359 link->time_base = (AVRational) {1, link->sample_rate};236 link->time_base = (AVRational) {1, link->sample_rate};
360 }237 }
361 238
239#endif
362 if ((config_link = link->dstpad->config_props))240 if ((config_link = link->dstpad->config_props))
363 if ((ret = config_link(link)) < 0)241 if ((ret = config_link(link)) < 0)
364 return ret;242 return ret;
@@ -370,47 +248,6 @@ int avfilter_config_links(AVFilterContext *filter) · 5 unmodified lines
370 return 0;248 return 0;
371}249}
372 250
373static char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
374{
375 snprintf(buf, buf_size, "%s%s%s%s%s%s",
376 perms & AV_PERM_READ ? "r" : "",
377 perms & AV_PERM_WRITE ? "w" : "",
378 perms & AV_PERM_PRESERVE ? "p" : "",
379 perms & AV_PERM_REUSE ? "u" : "",
380 perms & AV_PERM_REUSE2 ? "U" : "",
381 perms & AV_PERM_NEG_LINESIZES ? "n" : "");
382 return buf;
383}
384
385static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
386{
387 av_unused char buf[16];
388 av_dlog(ctx,
389 "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
390 ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],
391 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
392 ref->pts, ref->pos);
393
394 if (ref->video) {
395 av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
396 ref->video->sample_aspect_ratio.num, ref->video->sample_aspect_ratio.den,
397 ref->video->w, ref->video->h,
398 !ref->video->interlaced ? 'P' : /* Progressive */
399 ref->video->top_field_first ? 'T' : 'B', /* Top / Bottom */
400 ref->video->key_frame,
401 av_get_picture_type_char(ref->video->pict_type));
402 }
403 if (ref->audio) {
404 av_dlog(ctx, " cl:%"PRId64"d n:%d r:%d p:%d",
405 ref->audio->channel_layout,
406 ref->audio->nb_samples,
407 ref->audio->sample_rate,
408 ref->audio->planar);
409 }
410
411 av_dlog(ctx, "]%s", end ? "\n" : "");
412}
413
414void ff_dlog_link(void *ctx, AVFilterLink *link, int end)251void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
415{252{
416 if (link->type == AVMEDIA_TYPE_VIDEO) {253 if (link->type == AVMEDIA_TYPE_VIDEO) {
@@ -435,71 +272,6 @@ void ff_dlog_link(void *ctx, AVFilterLink *link, int end) · 18 unmodified lines
435 }272 }
436}273}
437 274
438AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
439{
440 AVFilterBufferRef *ret = NULL;
441
442 av_unused char buf[16];
443 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
444 av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
445
446 if (link->dstpad->get_video_buffer)
447 ret = link->dstpad->get_video_buffer(link, perms, w, h);
448
449 if (!ret)
450 ret = avfilter_default_get_video_buffer(link, perms, w, h);
451
452 if (ret)
453 ret->type = AVMEDIA_TYPE_VIDEO;
454
455 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
456
457 return ret;
458}
459
460AVFilterBufferRef *
461avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
462 int w, int h, enum PixelFormat format)
463{
464 AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));
465 AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef));
466
467 if (!pic || !picref)
468 goto fail;
469
470 picref->buf = pic;
471 picref->buf->free = ff_avfilter_default_free_buffer;
472 if (!(picref->video = av_mallocz(sizeof(AVFilterBufferRefVideoProps))))
473 goto fail;
474
475 pic->w = picref->video->w = w;
476 pic->h = picref->video->h = h;
477
478 /* make sure the buffer gets read permission or it's useless for output */
479 picref->perms = perms | AV_PERM_READ;
480
481 pic->refcount = 1;
482 picref->type = AVMEDIA_TYPE_VIDEO;
483 pic->format = picref->format = format;
484
485 memcpy(pic->data, data, 4*sizeof(data[0]));
486 memcpy(pic->linesize, linesize, 4*sizeof(linesize[0]));
487 memcpy(picref->data, pic->data, sizeof(picref->data));
488 memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
489
490 pic-> extended_data = pic->data;
491 picref->extended_data = picref->data;
492
493 return picref;
494
495fail:
496 if (picref && picref->video)
497 av_free(picref->video);
498 av_free(picref);
499 av_free(pic);
500 return NULL;
501}
502
503int avfilter_request_frame(AVFilterLink *link)275int avfilter_request_frame(AVFilterLink *link)
504{276{
505 FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1);277 FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1);
@@ -538,107 +310,6 @@ void ff_update_link_current_pts(AVFilterLink *link, int64_t pts) · 32 unmodified lines
538 ff_avfilter_graph_update_heap(link->graph, link);310 ff_avfilter_graph_update_heap(link->graph, link);
539}311}
540 312
541/* XXX: should we do the duplicating of the picture ref here, instead of
542 * forcing the source filter to do it? */
543void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
544{
545 void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
546 AVFilterPad *dst = link->dstpad;
547 int perms = picref->perms;
548 AVFilterCommand *cmd= link->dst->command_queue;
549
550 FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1);
551
552 if (!(start_frame = dst->start_frame))
553 start_frame = avfilter_default_start_frame;
554
555 if (picref->linesize[0] < 0)
556 perms |= AV_PERM_NEG_LINESIZES;
557 /* prepare to copy the picture if it has insufficient permissions */
558 if ((dst->min_perms & perms) != dst->min_perms || dst->rej_perms & perms) {
559 av_log(link->dst, AV_LOG_DEBUG,
560 "frame copy needed (have perms %x, need %x, reject %x)\n",
561 picref->perms,
562 link->dstpad->min_perms, link->dstpad->rej_perms);
563
564 link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
565 link->src_buf = picref;
566 avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
567 }
568 else
569 link->cur_buf = picref;
570
571 while(cmd && cmd->time <= picref->pts * av_q2d(link->time_base)){
572 av_log(link->dst, AV_LOG_DEBUG,
573 "Processing command time:%f command:%s arg:%s\n",
574 cmd->time, cmd->command, cmd->arg);
575 avfilter_process_command(link->dst, cmd->command, cmd->arg, 0, 0, cmd->flags);
576 command_queue_pop(link->dst);
577 cmd= link->dst->command_queue;
578 }
579
580 start_frame(link, link->cur_buf);
581 ff_update_link_current_pts(link, link->cur_buf->pts);
582}
583
584void avfilter_end_frame(AVFilterLink *link)
585{
586 void (*end_frame)(AVFilterLink *);
587
588 if (!(end_frame = link->dstpad->end_frame))
589 end_frame = avfilter_default_end_frame;
590
591 end_frame(link);
592
593 /* unreference the source picture if we're feeding the destination filter
594 * a copied version dues to permission issues */
595 if (link->src_buf) {
596 avfilter_unref_buffer(link->src_buf);
597 link->src_buf = NULL;
598 }
599}
600
601void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
602{
603 uint8_t *src[4], *dst[4];
604 int i, j, vsub;
605 void (*draw_slice)(AVFilterLink *, int, int, int);
606
607 FF_DPRINTF_START(NULL, draw_slice); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
608
609 /* copy the slice if needed for permission reasons */
610 if (link->src_buf) {
611 vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
612
613 for (i = 0; i < 4; i++) {
614 if (link->src_buf->data[i]) {
615 src[i] = link->src_buf-> data[i] +
616 (y >> (i==1 || i==2 ? vsub : 0)) * link->src_buf-> linesize[i];
617 dst[i] = link->cur_buf->data[i] +
618 (y >> (i==1 || i==2 ? vsub : 0)) * link->cur_buf->linesize[i];
619 } else
620 src[i] = dst[i] = NULL;
621 }
622
623 for (i = 0; i < 4; i++) {
624 int planew =
625 av_image_get_linesize(link->format, link->cur_buf->video->w, i);
626
627 if (!src[i]) continue;
628
629 for (j = 0; j < h >> (i==1 || i==2 ? vsub : 0); j++) {
630 memcpy(dst[i], src[i], planew);
631 src[i] += link->src_buf->linesize[i];
632 dst[i] += link->cur_buf->linesize[i];
633 }
634 }
635 }
636
637 if (!(draw_slice = link->dstpad->draw_slice))
638 draw_slice = avfilter_default_draw_slice;
639 draw_slice(link, y, h, slice_dir);
640}
641
642int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags)313int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags)
643{314{
644 if(!strcmp(cmd, "ping")){315 if(!strcmp(cmd, "ping")){
@@ -788,6 +459,10 @@ void avfilter_free(AVFilterContext *filter) · 143 unmodified lines
788 link->src->outputs[link->srcpad - link->src->output_pads] = NULL;459 link->src->outputs[link->srcpad - link->src->output_pads] = NULL;
789 avfilter_formats_unref(&link->in_formats);460 avfilter_formats_unref(&link->in_formats);
790 avfilter_formats_unref(&link->out_formats);461 avfilter_formats_unref(&link->out_formats);
462 avfilter_formats_unref(&link->in_samplerates);
463 avfilter_formats_unref(&link->out_samplerates);
464 ff_channel_layouts_unref(&link->in_channel_layouts);
465 ff_channel_layouts_unref(&link->out_channel_layouts);
791 }466 }
792 avfilter_link_free(&link);467 avfilter_link_free(&link);
793 }468 }
@@ -797,6 +472,10 @@ void avfilter_free(AVFilterContext *filter) · 3 unmodified lines
797 link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL;472 link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL;
798 avfilter_formats_unref(&link->in_formats);473 avfilter_formats_unref(&link->in_formats);
799 avfilter_formats_unref(&link->out_formats);474 avfilter_formats_unref(&link->out_formats);
475 avfilter_formats_unref(&link->in_samplerates);
476 avfilter_formats_unref(&link->out_samplerates);
477 ff_channel_layouts_unref(&link->in_channel_layouts);
478 ff_channel_layouts_unref(&link->out_channel_layouts);
800 }479 }
801 avfilter_link_free(&link);480 avfilter_link_free(&link);
802 }481 }
@@ -808,7 +487,7 @@ void avfilter_free(AVFilterContext *filter) · 5 unmodified lines
808 av_freep(&filter->outputs);487 av_freep(&filter->outputs);
809 av_freep(&filter->priv);488 av_freep(&filter->priv);
810 while(filter->command_queue){489 while(filter->command_queue){
811 command_queue_pop(filter);490 ff_command_queue_pop(filter);
812 }491 }
813 av_free(filter);492 av_free(filter);
814}493}
@@ -821,16 +500,3 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 6 unmodified lines
821 ret = filter->filter->init(filter, args, opaque);500 ret = filter->filter->init(filter, args, opaque);
822 return ret;501 return ret;
823}502}
824
825void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
826{
827 // copy common properties
828 dst->pts = src->pts;
829 dst->pos = src->pos;
830
831 switch (src->type) {
832 case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
833 case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
834 default: break;
835 }
836}
libavfilter/avfilter.h+17−15
@@ -258,8 +258,8 @@ void avfilter_unref_bufferp(AVFilterBufferRef **ref); · 257 unmodified lines
258 * pointer to each of the pointers to itself.258 * pointer to each of the pointers to itself.
259 */259 */
260typedef struct AVFilterFormats {260typedef struct AVFilterFormats {
261 unsigned format_count; ///< number of formats
262 int64_t *formats; ///< list of media formats261 int64_t *formats; ///< list of media formats
262 unsigned format_count; ///< number of formats
263 263
264 unsigned refcount; ///< number of references to this list264 unsigned refcount; ///< number of references to this list
265 struct AVFilterFormats ***refs; ///< references to this list265 struct AVFilterFormats ***refs; ///< references to this list
@@ -274,7 +274,6 @@ typedef struct AVFilterFormats { · 8 unmodified lines
274 * @return the format list, with no existing references274 * @return the format list, with no existing references
275 */275 */
276AVFilterFormats *avfilter_make_format_list(const int *fmts);276AVFilterFormats *avfilter_make_format_list(const int *fmts);
277AVFilterFormats *avfilter_make_format64_list(const int64_t *fmts);
278 277
279/**278/**
280 * Add fmt to the list of media formats contained in *avff.279 * Add fmt to the list of media formats contained in *avff.
@@ -304,11 +303,6 @@ AVFilterFormats *avfilter_make_all_formats(enum AVMediaType type); · 23 unmodified lines
304 */303 */
305extern const int64_t avfilter_all_channel_layouts[];304extern const int64_t avfilter_all_channel_layouts[];
306 305
307/**
308 * Return a list of all channel layouts supported by FFmpeg.
309 */
310AVFilterFormats *avfilter_make_all_channel_layouts(void);
311
312/**306/**
313 * Return a list of all audio packing formats.307 * Return a list of all audio packing formats.
314 */308 */
@@ -521,6 +515,7 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, · 206 unmodified lines
521 * formats/layouts. If there are no links hooked to this filter, the list515 * formats/layouts. If there are no links hooked to this filter, the list
522 * of formats is freed.516 * of formats is freed.
523 */517 */
518void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
524void avfilter_set_common_pixel_formats(AVFilterContext *ctx, AVFilterFormats *formats);519void avfilter_set_common_pixel_formats(AVFilterContext *ctx, AVFilterFormats *formats);
525void avfilter_set_common_sample_formats(AVFilterContext *ctx, AVFilterFormats *formats);520void avfilter_set_common_sample_formats(AVFilterContext *ctx, AVFilterFormats *formats);
526void avfilter_set_common_channel_layouts(AVFilterContext *ctx, AVFilterFormats *formats);521void avfilter_set_common_channel_layouts(AVFilterContext *ctx, AVFilterFormats *formats);
@@ -674,8 +669,6 @@ struct AVFilterLink { · 147 unmodified lines
674 AVFilterFormats *in_formats;669 AVFilterFormats *in_formats;
675 AVFilterFormats *out_formats;670 AVFilterFormats *out_formats;
676 671
677 AVFilterFormats *in_chlayouts;
678 AVFilterFormats *out_chlayouts;
679 AVFilterFormats *in_packing;672 AVFilterFormats *in_packing;
680 AVFilterFormats *out_packing;673 AVFilterFormats *out_packing;
681 674
@@ -713,17 +706,26 @@ struct AVFilterLink { · 31 unmodified lines
713 */706 */
714 int64_t current_pts;707 int64_t current_pts;
715 708
716 /**709 /*****************************************************************
717 * Private fields710 * All fields below this line are not part of the public API. They
718 *711 * may not be used outside of libavfilter and can be changed and
719 * The following fields are for internal use only.712 * removed at will.
720 * Their type, offset, number and semantic can change without notice.713 * New public fields should be added right above.
714 *****************************************************************
721 */715 */
722
723 /**716 /**
724 * Index in the age array.717 * Index in the age array.
725 */718 */
726 int age_index;719 int age_index;
720
721 /**
722 * Lists of channel layouts and sample rates used for automatic
723 * negotiation.
724 */
725 AVFilterFormats *in_samplerates;
726 AVFilterFormats *out_samplerates;
727 struct AVFilterChannelLayouts *in_channel_layouts;
728 struct AVFilterChannelLayouts *out_channel_layouts;
727};729};
728 730
729/**731/**
libavfilter/avfiltergraph.c+286−50
@@ -28,8 +28,10 @@ · 27 unmodified lines
28#include "libavutil/pixdesc.h"28#include "libavutil/pixdesc.h"
29#include "avfilter.h"29#include "avfilter.h"
30#include "avfiltergraph.h"30#include "avfiltergraph.h"
31#include "formats.h"
31#include "internal.h"32#include "internal.h"
32 33
34#include "libavutil/audioconvert.h"
33#include "libavutil/log.h"35#include "libavutil/log.h"
34 36
35static const AVClass filtergraph_class = {37static const AVClass filtergraph_class = {
@@ -198,10 +200,10 @@ static int insert_conv_filter(AVFilterGraph *graph, AVFilterLink *link, · 162 unmodified lines
198 200
199 if (link->type == AVMEDIA_TYPE_AUDIO &&201 if (link->type == AVMEDIA_TYPE_AUDIO &&
200 (((link = filt_ctx-> inputs[0]) &&202 (((link = filt_ctx-> inputs[0]) &&
201 (!avfilter_merge_formats(link->in_chlayouts, link->out_chlayouts) ||203 (!ff_merge_channel_layouts(link->in_channel_layouts, link->out_channel_layouts) ||
202 !avfilter_merge_formats(link->in_packing, link->out_packing))) ||204 !avfilter_merge_formats(link->in_packing, link->out_packing))) ||
203 ((link = filt_ctx->outputs[0]) &&205 ((link = filt_ctx->outputs[0]) &&
204 (!avfilter_merge_formats(link->in_chlayouts, link->out_chlayouts) ||206 (!ff_merge_channel_layouts(link->in_channel_layouts, link->out_channel_layouts) ||
205 !avfilter_merge_formats(link->in_packing, link->out_packing))))207 !avfilter_merge_formats(link->in_packing, link->out_packing))))
206 ) {208 ) {
207 av_log(NULL, AV_LOG_ERROR,209 av_log(NULL, AV_LOG_ERROR,
@@ -217,7 +219,10 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 9 unmodified lines
217{219{
218 int i, j, ret;220 int i, j, ret;
219 char filt_args[128];221 char filt_args[128];
220 AVFilterFormats *formats, *chlayouts, *packing;222 AVFilterFormats *formats, *packing;
223 AVFilterChannelLayouts *chlayouts;
224 AVFilterFormats *samplerates;
225 int scaler_count = 0, resampler_count = 0;
221 226
222 /* ask all the sub-filters for their supported media formats */227 /* ask all the sub-filters for their supported media formats */
223 for (i = 0; i < graph->filter_count; i++) {228 for (i = 0; i < graph->filter_count; i++) {
@@ -233,6 +238,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 9 unmodified lines
233 238
234 for (j = 0; j < filter->input_count; j++) {239 for (j = 0; j < filter->input_count; j++) {
235 AVFilterLink *link = filter->inputs[j];240 AVFilterLink *link = filter->inputs[j];
241#if 0
236 if (!link) continue;242 if (!link) continue;
237 243
238 if (!link->in_formats || !link->out_formats)244 if (!link->in_formats || !link->out_formats)
@@ -248,7 +254,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 9 unmodified lines
248 return ret;254 return ret;
249 }255 }
250 else if (link->type == AVMEDIA_TYPE_AUDIO) {256 else if (link->type == AVMEDIA_TYPE_AUDIO) {
251 if (!link->in_chlayouts || !link->out_chlayouts ||257 if (!link->in_channel_layouts || !link->out_channel_layouts ||
252 !link->in_packing || !link->out_packing)258 !link->in_packing || !link->out_packing)
253 return AVERROR(EINVAL);259 return AVERROR(EINVAL);
254 260
@@ -256,11 +262,100 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 1 unmodified line
256 * three categories, aconvert will use a common format262 * three categories, aconvert will use a common format
257 * whenever possible. */263 * whenever possible. */
258 formats = avfilter_merge_formats(link->in_formats, link->out_formats);264 formats = avfilter_merge_formats(link->in_formats, link->out_formats);
259 chlayouts = avfilter_merge_formats(link->in_chlayouts, link->out_chlayouts);265 chlayouts = ff_merge_channel_layouts(link->in_channel_layouts , link->out_channel_layouts);
266 samplerates = ff_merge_samplerates (link->in_samplerates, link->out_samplerates);
260 packing = avfilter_merge_formats(link->in_packing, link->out_packing);267 packing = avfilter_merge_formats(link->in_packing, link->out_packing);
261 if (!formats || !chlayouts || !packing)268
269 if (!formats || !chlayouts || !packing || !samplerates)
262 if (ret = insert_conv_filter(graph, link, "aconvert", NULL))270 if (ret = insert_conv_filter(graph, link, "aconvert", NULL))
263 return ret;271 return ret;
272#else
273 int convert_needed = 0;
274
275 if (!link)
276 continue;
277
278 if (link->in_formats != link->out_formats &&
279 !avfilter_merge_formats(link->in_formats,
280 link->out_formats))
281 convert_needed = 1;
282 if (link->type == AVMEDIA_TYPE_AUDIO) {
283 if (link->in_channel_layouts != link->out_channel_layouts &&
284 !ff_merge_channel_layouts(link->in_channel_layouts,
285 link->out_channel_layouts))
286 convert_needed = 1;
287 if (link->in_samplerates != link->out_samplerates &&
288 !ff_merge_samplerates(link->in_samplerates,
289 link->out_samplerates))
290 convert_needed = 1;
291 }
292
293 if (convert_needed) {
294 AVFilterContext *convert;
295 AVFilter *filter;
296 AVFilterLink *inlink, *outlink;
297 char scale_args[256];
298 char inst_name[30];
299
300 /* couldn't merge format lists. auto-insert conversion filter */
301 switch (link->type) {
302 case AVMEDIA_TYPE_VIDEO:
303 snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
304 scaler_count++);
305 snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts);
306 if ((ret = avfilter_graph_create_filter(&convert,
307 avfilter_get_by_name("scale"),
308 inst_name, scale_args, NULL,
309 graph)) < 0)
310 return ret;
311 break;
312 case AVMEDIA_TYPE_AUDIO:
313 if (!(filter = avfilter_get_by_name("resample"))) {
314 av_log(log_ctx, AV_LOG_ERROR, "'resample' filter "
315 "not present, cannot convert audio formats.\n");
316 return AVERROR(EINVAL);
317 }
318
319 snprintf(inst_name, sizeof(inst_name), "auto-inserted resampler %d",
320 resampler_count++);
321 if ((ret = avfilter_graph_create_filter(&convert,
322 avfilter_get_by_name("resample"),
323 inst_name, NULL, NULL, graph)) < 0)
324 return ret;
325 break;
326 default:
327 return AVERROR(EINVAL);
328 }
329
330 if ((ret = avfilter_insert_filter(link, convert, 0, 0)) < 0)
331 return ret;
332
333 convert->filter->query_formats(convert);
334 inlink = convert->inputs[0];
335 outlink = convert->outputs[0];
336 if (!avfilter_merge_formats( inlink->in_formats, inlink->out_formats) ||
337 !avfilter_merge_formats(outlink->in_formats, outlink->out_formats))
338 ret |= AVERROR(ENOSYS);
339 if (inlink->type == AVMEDIA_TYPE_AUDIO &&
340 (!ff_merge_samplerates(inlink->in_samplerates,
341 inlink->out_samplerates) ||
342 !ff_merge_channel_layouts(inlink->in_channel_layouts,
343 inlink->out_channel_layouts)))
344 ret |= AVERROR(ENOSYS);
345 if (outlink->type == AVMEDIA_TYPE_AUDIO &&
346 (!ff_merge_samplerates(outlink->in_samplerates,
347 outlink->out_samplerates) ||
348 !ff_merge_channel_layouts(outlink->in_channel_layouts,
349 outlink->out_channel_layouts)))
350 ret |= AVERROR(ENOSYS);
351
352 if (ret < 0) {
353 av_log(log_ctx, AV_LOG_ERROR,
354 "Impossible to convert between the formats supported by the filter "
355 "'%s' and the filter '%s'\n", link->src->name, link->dst->name);
356 return ret;
357 }
358#endif
264 }359 }
265 }360 }
266 }361 }
@@ -268,10 +363,10 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 1 unmodified line
268 return 0;363 return 0;
269}364}
270 365
271static void pick_format(AVFilterLink *link, AVFilterLink *ref)366static int pick_format(AVFilterLink *link, AVFilterLink *ref)
272{367{
273 if (!link || !link->in_formats)368 if (!link || !link->in_formats)
274 return;369 return 0;
275 370
276 if (link->type == AVMEDIA_TYPE_VIDEO) {371 if (link->type == AVMEDIA_TYPE_VIDEO) {
277 if(ref && ref->type == AVMEDIA_TYPE_VIDEO){372 if(ref && ref->type == AVMEDIA_TYPE_VIDEO){
@@ -288,50 +383,83 @@ static void pick_format(AVFilterLink *link, AVFilterLink *ref) · 10 unmodified lines
288 383
289 link->in_formats->format_count = 1;384 link->in_formats->format_count = 1;
290 link->format = link->in_formats->formats[0];385 link->format = link->in_formats->formats[0];
291 avfilter_formats_unref(&link->in_formats);
292 avfilter_formats_unref(&link->out_formats);
293 386
294 if (link->type == AVMEDIA_TYPE_AUDIO) {387 if (link->type == AVMEDIA_TYPE_AUDIO) {
295 link->in_chlayouts->format_count = 1;388 if (!link->in_samplerates->format_count) {
296 link->channel_layout = link->in_chlayouts->formats[0];389 av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for"
297 avfilter_formats_unref(&link->in_chlayouts);390 " the link between filters %s and %s.\n", link->src->name,
298 avfilter_formats_unref(&link->out_chlayouts);391 link->dst->name);
299 392 return AVERROR(EINVAL);
300 link->in_packing->format_count = 1;393 }
301 link->planar = link->in_packing->formats[0] == AVFILTER_PLANAR;394 link->in_samplerates->format_count = 1;
302 avfilter_formats_unref(&link->in_packing);395 link->sample_rate = link->in_samplerates->formats[0];
303 avfilter_formats_unref(&link->out_packing);396
397 if (!link->in_channel_layouts->nb_channel_layouts) {
398 av_log(link->src, AV_LOG_ERROR, "Cannot select channel layout for"
399 "the link between filters %s and %s.\n", link->src->name,
400 link->dst->name);
401 return AVERROR(EINVAL);
402 }
403 link->in_channel_layouts->nb_channel_layouts = 1;
404 link->channel_layout = link->in_channel_layouts->channel_layouts[0];
304 }405 }
406
407 avfilter_formats_unref(&link->in_formats);
408 avfilter_formats_unref(&link->out_formats);
409 avfilter_formats_unref(&link->in_samplerates);
410 avfilter_formats_unref(&link->out_samplerates);
411 ff_channel_layouts_unref(&link->in_channel_layouts);
412 ff_channel_layouts_unref(&link->out_channel_layouts);
413
414 return 0;
305}415}
306 416
417#define REDUCE_FORMATS(fmt_type, list_type, list, var, nb, add_format) \
418do { \
419 for (i = 0; i < filter->input_count; i++) { \
420 AVFilterLink *link = filter->inputs[i]; \
421 fmt_type fmt; \
422 \
423 if (!link->out_ ## list || link->out_ ## list->nb != 1) \
424 continue; \
425 fmt = link->out_ ## list->var[0]; \
426 \
427 for (j = 0; j < filter->output_count; j++) { \
428 AVFilterLink *out_link = filter->outputs[j]; \
429 list_type *fmts; \
430 \
431 if (link->type != out_link->type || \
432 out_link->in_ ## list->nb == 1) \
433 continue; \
434 fmts = out_link->in_ ## list; \
435 \
436 if (!out_link->in_ ## list->nb) { \
437 add_format(&out_link->in_ ##list, fmt); \
438 break; \
439 } \
440 \
441 for (k = 0; k < out_link->in_ ## list->nb; k++) \
442 if (fmts->var[k] == fmt) { \
443 fmts->var[0] = fmt; \
444 fmts->nb = 1; \
445 ret = 1; \
446 break; \
447 } \
448 } \
449 } \
450} while (0)
451
307static int reduce_formats_on_filter(AVFilterContext *filter)452static int reduce_formats_on_filter(AVFilterContext *filter)
308{453{
309 int i, j, k, ret = 0;454 int i, j, k, ret = 0;
310 455
311 for (i = 0; i < filter->input_count; i++) {456 REDUCE_FORMATS(int, AVFilterFormats, formats, formats,
312 AVFilterLink *link = filter->inputs[i];457 format_count, avfilter_add_format);
313 int format = link->out_formats->formats[0];458 REDUCE_FORMATS(int, AVFilterFormats, samplerates, formats,
314 459 format_count, avfilter_add_format);
315 if (link->out_formats->format_count != 1)460 REDUCE_FORMATS(uint64_t, AVFilterChannelLayouts, channel_layouts,
316 continue;461 channel_layouts, nb_channel_layouts, ff_add_channel_layout);
317
318 for (j = 0; j < filter->output_count; j++) {
319 AVFilterLink *out_link = filter->outputs[j];
320 AVFilterFormats *fmts = out_link->in_formats;
321
322 if (link->type != out_link->type ||
323 out_link->in_formats->format_count == 1)
324 continue;
325 462
326 for (k = 0; k < out_link->in_formats->format_count; k++)
327 if (fmts->formats[k] == format) {
328 fmts->formats[0] = format;
329 fmts->format_count = 1;
330 ret = 1;
331 break;
332 }
333 }
334 }
335 return ret;463 return ret;
336}464}
337 465
@@ -347,9 +475,109 @@ static void reduce_formats(AVFilterGraph *graph) · 9 unmodified lines
347 } while (reduced);475 } while (reduced);
348}476}
349 477
350static void pick_formats(AVFilterGraph *graph)478static void swap_samplerates_on_filter(AVFilterContext *filter)
479{
480 AVFilterLink *link = NULL;
481 int sample_rate;
482 int i, j;
483
484 for (i = 0; i < filter->input_count; i++) {
485 link = filter->inputs[i];
486
487 if (link->type == AVMEDIA_TYPE_AUDIO &&
488 link->out_samplerates->format_count == 1)
489 break;
490 }
491 if (i == filter->input_count)
492 return;
493
494 sample_rate = link->out_samplerates->formats[0];
495
496 for (i = 0; i < filter->output_count; i++) {
497 AVFilterLink *outlink = filter->outputs[i];
498 int best_idx, best_diff = INT_MAX;
499
500 if (outlink->type != AVMEDIA_TYPE_AUDIO ||
501 outlink->in_samplerates->format_count < 2)
502 continue;
503
504 for (j = 0; j < outlink->in_samplerates->format_count; j++) {
505 int diff = abs(sample_rate - outlink->in_samplerates->formats[j]);
506
507 if (diff < best_diff) {
508 best_diff = diff;
509 best_idx = j;
510 }
511 }
512 FFSWAP(int, outlink->in_samplerates->formats[0],
513 outlink->in_samplerates->formats[best_idx]);
514 }
515}
516
517static void swap_samplerates(AVFilterGraph *graph)
351{518{
519 int i;
520
521 for (i = 0; i < graph->filter_count; i++)
522 swap_samplerates_on_filter(graph->filters[i]);
523}
524
525static void swap_channel_layouts_on_filter(AVFilterContext *filter)
526{
527 AVFilterLink *link = NULL;
528 uint64_t chlayout;
352 int i, j;529 int i, j;
530
531 for (i = 0; i < filter->input_count; i++) {
532 link = filter->inputs[i];
533
534 if (link->type == AVMEDIA_TYPE_AUDIO &&
535 link->out_channel_layouts->nb_channel_layouts == 1)
536 break;
537 }
538 if (i == filter->input_count)
539 return;
540
541 chlayout = link->out_channel_layouts->channel_layouts[0];
542
543 for (i = 0; i < filter->output_count; i++) {
544 AVFilterLink *outlink = filter->outputs[i];
545 int best_idx, best_score = INT_MIN;
546
547 if (outlink->type != AVMEDIA_TYPE_AUDIO ||
548 outlink->in_channel_layouts->nb_channel_layouts < 2)
549 continue;
550
551 for (j = 0; j < outlink->in_channel_layouts->nb_channel_layouts; j++) {
552 uint64_t out_chlayout = outlink->in_channel_layouts->channel_layouts[j];
553 int matched_channels = av_get_channel_layout_nb_channels(chlayout &
554 out_chlayout);
555 int extra_channels = av_get_channel_layout_nb_channels(out_chlayout &
556 (~chlayout));
557 int score = matched_channels - extra_channels;
558
559 if (score > best_score) {
560 best_score = score;
561 best_idx = j;
562 }
563 }
564 FFSWAP(uint64_t, outlink->in_channel_layouts->channel_layouts[0],
565 outlink->in_channel_layouts->channel_layouts[best_idx]);
566 }
567
568}
569
570static void swap_channel_layouts(AVFilterGraph *graph)
571{
572 int i;
573
574 for (i = 0; i < graph->filter_count; i++)
575 swap_channel_layouts_on_filter(graph->filters[i]);
576}
577
578static int pick_formats(AVFilterGraph *graph)
579{
580 int i, j, ret;
353 int change;581 int change;
354 582
355 do{583 do{
@@ -385,13 +613,15 @@ static void pick_formats(AVFilterGraph *graph) · 29 unmodified lines
385 613
386 for (i = 0; i < graph->filter_count; i++) {614 for (i = 0; i < graph->filter_count; i++) {
387 AVFilterContext *filter = graph->filters[i];615 AVFilterContext *filter = graph->filters[i];
388 if (1) {616
389 for (j = 0; j < filter->input_count; j++)617 for (j = 0; j < filter->input_count; j++)
390 pick_format(filter->inputs[j], NULL);618 if ((ret = pick_format(filter->inputs[j], NULL)) < 0)
391 for (j = 0; j < filter->output_count; j++)619 return ret;
392 pick_format(filter->outputs[j], NULL);620 for (j = 0; j < filter->output_count; j++)
393 }621 if ((ret = pick_format(filter->outputs[j], NULL)) < 0)
622 return ret;
394 }623 }
624 return 0;
395}625}
396 626
397int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)627int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
@@ -407,7 +637,13 @@ int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx) · 9 unmodified lines
407 * of format conversion inside filters */637 * of format conversion inside filters */
408 reduce_formats(graph);638 reduce_formats(graph);
409 639
410 pick_formats(graph);640 /* for audio filters, ensure the best sample rate and channel layout
641 * is selected */
642 swap_samplerates(graph);
643 swap_channel_layouts(graph);
644
645 if ((ret = pick_formats(graph)) < 0)
646 return ret;
411 647
412 return 0;648 return 0;
413}649}
libavfilter/buffer.c+244−0
@@ -0,0 +1,244 @@
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "libavutil/audioconvert.h"
20#include "libavutil/avassert.h"
21#include "libavcodec/avcodec.h"
22
23#include "avfilter.h"
24#include "internal.h"
25#include "avcodec.h"
26
27void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
28{
29 if (ptr->extended_data != ptr->data)
30 av_freep(&ptr->extended_data);
31 av_free(ptr->data[0]);
32 av_free(ptr);
33}
34
35AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
36{
37 AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
38 if (!ret)
39 return NULL;
40 *ret = *ref;
41 if (ref->type == AVMEDIA_TYPE_VIDEO) {
42 ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps));
43 if (!ret->video) {
44 av_free(ret);
45 return NULL;
46 }
47 *ret->video = *ref->video;
48 ret->extended_data = ret->data;
49 } else if (ref->type == AVMEDIA_TYPE_AUDIO) {
50 ret->audio = av_malloc(sizeof(AVFilterBufferRefAudioProps));
51 if (!ret->audio) {
52 av_free(ret);
53 return NULL;
54 }
55 *ret->audio = *ref->audio;
56
57 if (ref->extended_data && ref->extended_data != ref->data) {
58 int nb_channels = av_get_channel_layout_nb_channels(ref->audio->channel_layout);
59 if (!(ret->extended_data = av_malloc(sizeof(*ret->extended_data) *
60 nb_channels))) {
61 av_freep(&ret->audio);
62 av_freep(&ret);
63 return NULL;
64 }
65 memcpy(ret->extended_data, ref->extended_data,
66 sizeof(*ret->extended_data) * nb_channels);
67 } else
68 ret->extended_data = ret->data;
69 }
70 ret->perms &= pmask;
71 ret->buf->refcount ++;
72 return ret;
73}
74
75void ff_free_pool(AVFilterPool *pool)
76{
77 int i;
78
79 av_assert0(pool->refcount > 0);
80
81 for (i = 0; i < POOL_SIZE; i++) {
82 if (pool->pic[i]) {
83 AVFilterBufferRef *picref = pool->pic[i];
84 /* free buffer: picrefs stored in the pool are not
85 * supposed to contain a free callback */
86 av_assert0(!picref->buf->refcount);
87 av_freep(&picref->buf->data[0]);
88 av_freep(&picref->buf);
89
90 av_freep(&picref->audio);
91 av_freep(&picref->video);
92 av_freep(&pool->pic[i]);
93 pool->count--;
94 }
95 }
96 pool->draining = 1;
97
98 if (!--pool->refcount) {
99 av_assert0(!pool->count);
100 av_free(pool);
101 }
102}
103
104static void store_in_pool(AVFilterBufferRef *ref)
105{
106 int i;
107 AVFilterPool *pool= ref->buf->priv;
108
109 av_assert0(ref->buf->data[0]);
110 av_assert0(pool->refcount>0);
111
112 if (pool->count == POOL_SIZE) {
113 AVFilterBufferRef *ref1 = pool->pic[0];
114 av_freep(&ref1->video);
115 av_freep(&ref1->audio);
116 av_freep(&ref1->buf->data[0]);
117 av_freep(&ref1->buf);
118 av_free(ref1);
119 memmove(&pool->pic[0], &pool->pic[1], sizeof(void*)*(POOL_SIZE-1));
120 pool->count--;
121 pool->pic[POOL_SIZE-1] = NULL;
122 }
123
124 for (i = 0; i < POOL_SIZE; i++) {
125 if (!pool->pic[i]) {
126 pool->pic[i] = ref;
127 pool->count++;
128 break;
129 }
130 }
131 if (pool->draining) {
132 ff_free_pool(pool);
133 } else
134 --pool->refcount;
135}
136
137void avfilter_unref_buffer(AVFilterBufferRef *ref)
138{
139 if (!ref)
140 return;
141 av_assert0(ref->buf->refcount > 0);
142 if (!(--ref->buf->refcount)) {
143 if (!ref->buf->free) {
144 store_in_pool(ref);
145 return;
146 }
147 ref->buf->free(ref->buf);
148 }
149 if (ref->extended_data != ref->data)
150 av_freep(&ref->extended_data);
151 av_freep(&ref->video);
152 av_freep(&ref->audio);
153 av_free(ref);
154}
155
156void avfilter_unref_bufferp(AVFilterBufferRef **ref)
157{
158 avfilter_unref_buffer(*ref);
159 *ref = NULL;
160}
161
162int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
163{
164 dst->pts = src->pts;
165 dst->pos = src->pkt_pos;
166 dst->format = src->format;
167
168 switch (dst->type) {
169 case AVMEDIA_TYPE_VIDEO:
170 dst->video->w = src->width;
171 dst->video->h = src->height;
172 dst->video->sample_aspect_ratio = src->sample_aspect_ratio;
173 dst->video->interlaced = src->interlaced_frame;
174 dst->video->top_field_first = src->top_field_first;
175 dst->video->key_frame = src->key_frame;
176 dst->video->pict_type = src->pict_type;
177 break;
178 case AVMEDIA_TYPE_AUDIO:
179 dst->audio->sample_rate = src->sample_rate;
180 dst->audio->channel_layout = src->channel_layout;
181 break;
182 default:
183 return AVERROR(EINVAL);
184 }
185
186 return 0;
187}
188
189int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
190{
191 int planes, nb_channels;
192
193 memcpy(dst->data, src->data, sizeof(dst->data));
194 memcpy(dst->linesize, src->linesize, sizeof(dst->linesize));
195
196 dst->pts = src->pts;
197 dst->format = src->format;
198
199 switch (src->type) {
200 case AVMEDIA_TYPE_VIDEO:
201 dst->width = src->video->w;
202 dst->height = src->video->h;
203 dst->sample_aspect_ratio = src->video->sample_aspect_ratio;
204 dst->interlaced_frame = src->video->interlaced;
205 dst->top_field_first = src->video->top_field_first;
206 dst->key_frame = src->video->key_frame;
207 dst->pict_type = src->video->pict_type;
208 break;
209 case AVMEDIA_TYPE_AUDIO:
210 nb_channels = av_get_channel_layout_nb_channels(src->audio->channel_layout);
211 planes = av_sample_fmt_is_planar(src->format) ? nb_channels : 1;
212
213 if (planes > FF_ARRAY_ELEMS(dst->data)) {
214 dst->extended_data = av_mallocz(planes * sizeof(*dst->extended_data));
215 if (!dst->extended_data)
216 return AVERROR(ENOMEM);
217 memcpy(dst->extended_data, src->extended_data,
218 planes * sizeof(dst->extended_data));
219 } else
220 dst->extended_data = dst->data;
221
222 dst->sample_rate = src->audio->sample_rate;
223 dst->channel_layout = src->audio->channel_layout;
224 dst->nb_samples = src->audio->nb_samples;
225 break;
226 default:
227 return AVERROR(EINVAL);
228 }
229
230 return 0;
231}
232
233void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
234{
235 // copy common properties
236 dst->pts = src->pts;
237 dst->pos = src->pos;
238
239 switch (src->type) {
240 case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
241 case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
242 default: break;
243 }
244}
libavfilter/buffersink.c+98−4
@@ -23,13 +23,20 @@ · 22 unmodified lines
23 * buffer sink23 * buffer sink
24 */24 */
25 25
26#include "libavutil/audio_fifo.h"
27#include "libavutil/audioconvert.h"
26#include "libavutil/fifo.h"28#include "libavutil/fifo.h"
29#include "libavutil/mathematics.h"
27 30
31#include "audio.h"
28#include "avfilter.h"32#include "avfilter.h"
29#include "buffersink.h"33#include "buffersink.h"
30 34
31typedef struct {35typedef struct {
32 AVFifoBuffer *fifo; ///< FIFO buffer of video frame references36 AVFifoBuffer *fifo; ///< FIFO buffer of frame references
37
38 AVAudioFifo *audio_fifo; ///< FIFO for audio samples
39 int64_t next_pts; ///< interpolating audio pts
33} BufferSinkContext;40} BufferSinkContext;
34 41
35#define FIFO_INIT_SIZE 842#define FIFO_INIT_SIZE 8
@@ -44,6 +51,9 @@ static av_cold void uninit(AVFilterContext *ctx) · 8 unmodified lines
44 avfilter_unref_buffer(buf);51 avfilter_unref_buffer(buf);
45 }52 }
46 av_fifo_free(sink->fifo);53 av_fifo_free(sink->fifo);
54
55 if (sink->audio_fifo)
56 av_audio_fifo_free(sink->audio_fifo);
47}57}
48 58
49static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)59static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
@@ -58,9 +68,8 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 8 unmodified lines
58 return 0;68 return 0;
59}69}
60 70
61static void end_frame(AVFilterLink *link)71static void write_buf(AVFilterContext *ctx, AVFilterBufferRef *buf)
62{72{
63 AVFilterContext *ctx = link->dst;
64 BufferSinkContext *sink = ctx->priv;73 BufferSinkContext *sink = ctx->priv;
65 74
66 if (av_fifo_space(sink->fifo) < sizeof(AVFilterBufferRef *) &&75 if (av_fifo_space(sink->fifo) < sizeof(AVFilterBufferRef *) &&
@@ -69,10 +78,20 @@ static void end_frame(AVFilterLink *link) · 2 unmodified lines
69 return;78 return;
70 }79 }
71 80
72 av_fifo_generic_write(sink->fifo, &link->cur_buf, sizeof(link->cur_buf), NULL);81 av_fifo_generic_write(sink->fifo, &buf, sizeof(buf), NULL);
82}
83
84static void end_frame(AVFilterLink *link)
85{
86 write_buf(link->dst, link->cur_buf);
73 link->cur_buf = NULL;87 link->cur_buf = NULL;
74}88}
75 89
90static void filter_samples(AVFilterLink *link, AVFilterBufferRef *buf)
91{
92 write_buf(link->dst, buf);
93}
94
76int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf)95int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf)
77{96{
78 BufferSinkContext *sink = ctx->priv;97 BufferSinkContext *sink = ctx->priv;
@@ -98,6 +117,66 @@ int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf) · 19 unmodified lines
98 return 0;117 return 0;
99}118}
100 119
120static int read_from_fifo(AVFilterContext *ctx, AVFilterBufferRef **pbuf,
121 int nb_samples)
122{
123 BufferSinkContext *s = ctx->priv;
124 AVFilterLink *link = ctx->inputs[0];
125 AVFilterBufferRef *buf;
126
127 if (!(buf = ff_get_audio_buffer(link, AV_PERM_WRITE, nb_samples)))
128 return AVERROR(ENOMEM);
129 av_audio_fifo_read(s->audio_fifo, (void**)buf->extended_data, nb_samples);
130
131 buf->pts = s->next_pts;
132 s->next_pts += av_rescale_q(nb_samples, (AVRational){1, link->sample_rate},
133 link->time_base);
134
135 *pbuf = buf;
136 return 0;
137
138}
139
140int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **pbuf,
141 int nb_samples)
142{
143 BufferSinkContext *s = ctx->priv;
144 AVFilterLink *link = ctx->inputs[0];
145 int ret = 0;
146
147 if (!s->audio_fifo) {
148 int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
149 if (!(s->audio_fifo = av_audio_fifo_alloc(link->format, nb_channels, nb_samples)))
150 return AVERROR(ENOMEM);
151 }
152
153 while (ret >= 0) {
154 AVFilterBufferRef *buf;
155
156 if (av_audio_fifo_size(s->audio_fifo) >= nb_samples)
157 return read_from_fifo(ctx, pbuf, nb_samples);
158
159 ret = av_buffersink_read(ctx, &buf);
160 if (ret == AVERROR_EOF && av_audio_fifo_size(s->audio_fifo))
161 return read_from_fifo(ctx, pbuf, av_audio_fifo_size(s->audio_fifo));
162 else if (ret < 0)
163 return ret;
164
165 if (buf->pts != AV_NOPTS_VALUE) {
166 s->next_pts = buf->pts -
167 av_rescale_q(av_audio_fifo_size(s->audio_fifo),
168 (AVRational){ 1, link->sample_rate },
169 link->time_base);
170 }
171
172 ret = av_audio_fifo_write(s->audio_fifo, (void**)buf->extended_data,
173 buf->audio->nb_samples);
174 avfilter_unref_buffer(buf);
175 }
176
177 return ret;
178}
179
101AVFilter avfilter_vsink_buffer = {180AVFilter avfilter_vsink_buffer = {
102 .name = "buffersink_old",181 .name = "buffersink_old",
103 .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),182 .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
@@ -112,3 +191,18 @@ AVFilter avfilter_vsink_buffer = { · 8 unmodified lines
112 { .name = NULL }},191 { .name = NULL }},
113 .outputs = (AVFilterPad[]) {{ .name = NULL }},192 .outputs = (AVFilterPad[]) {{ .name = NULL }},
114};193};
194
195AVFilter avfilter_asink_abuffer = {
196 .name = "abuffersink_old",
197 .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
198 .priv_size = sizeof(BufferSinkContext),
199 .init = init,
200 .uninit = uninit,
201
202 .inputs = (AVFilterPad[]) {{ .name = "default",
203 .type = AVMEDIA_TYPE_AUDIO,
204 .filter_samples = filter_samples,
205 .min_perms = AV_PERM_READ, },
206 { .name = NULL }},
207 .outputs = (AVFilterPad[]) {{ .name = NULL }},
208};
libavfilter/buffersink.h+20−1
@@ -101,7 +101,7 @@ int av_vsink_buffer_get_video_buffer_ref(AVFilterContext *buffer_sink, · 100 unmodified lines
101/**101/**
102 * Get a buffer with filtered data from sink and put it in buf.102 * Get a buffer with filtered data from sink and put it in buf.
103 *103 *
104 * @param sink pointer to a context of a buffersink AVFilter.104 * @param sink pointer to a context of a buffersink or abuffersink AVFilter.
105 * @param buf pointer to the buffer will be written here if buf is non-NULL. buf105 * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
106 * must be freed by the caller using avfilter_unref_buffer().106 * must be freed by the caller using avfilter_unref_buffer().
107 * Buf may also be NULL to query whether a buffer is ready to be107 * Buf may also be NULL to query whether a buffer is ready to be
@@ -112,4 +112,23 @@ int av_vsink_buffer_get_video_buffer_ref(AVFilterContext *buffer_sink, · 4 unmodified lines
112 */112 */
113int av_buffersink_read(AVFilterContext *sink, AVFilterBufferRef **buf);113int av_buffersink_read(AVFilterContext *sink, AVFilterBufferRef **buf);
114 114
115/**
116 * Same as av_buffersink_read, but with the ability to specify the number of
117 * samples read. This function is less efficient than av_buffersink_read(),
118 * because it copies the data around.
119 *
120 * @param sink pointer to a context of the abuffersink AVFilter.
121 * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
122 * must be freed by the caller using avfilter_unref_buffer(). buf
123 * will contain exactly nb_samples audio samples, except at the end
124 * of stream, when it can contain less than nb_samples.
125 * Buf may also be NULL to query whether a buffer is ready to be
126 * output.
127 *
128 * @warning do not mix this function with av_buffersink_read(). Use only one or
129 * the other with a single sink, not both.
130 */
131int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf,
132 int nb_samples);
133
115#endif /* AVFILTER_BUFFERSINK_H */134#endif /* AVFILTER_BUFFERSINK_H */
libavfilter/buffersrc.c+403−0
@@ -0,0 +1,403 @@
1/*
2 * Copyright (c) 2008 Vitor Sessak
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22 * @file
23 * memory buffer source filter
24 */
25
26#include "audio.h"
27#include "avfilter.h"
28#include "buffersrc.h"
29#include "formats.h"
30#include "vsrc_buffer.h"
31#include "avcodec.h"
32
33#include "libavutil/audioconvert.h"
34#include "libavutil/fifo.h"
35#include "libavutil/imgutils.h"
36#include "libavutil/opt.h"
37#include "libavutil/samplefmt.h"
38
39typedef struct {
40 const AVClass *class;
41 AVFifoBuffer *fifo;
42 AVRational time_base; ///< time_base to set in the output link
43
44 /* video only */
45 int h, w;
46 enum PixelFormat pix_fmt;
47 AVRational pixel_aspect;
48
49 /* audio only */
50 int sample_rate;
51 enum AVSampleFormat sample_fmt;
52 char *sample_fmt_str;
53 uint64_t channel_layout;
54 char *channel_layout_str;
55
56 int eof;
57} BufferSourceContext;
58
59#define CHECK_VIDEO_PARAM_CHANGE(s, c, width, height, format)\
60 if (c->w != width || c->h != height || c->pix_fmt != format) {\
61 av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
62 return AVERROR(EINVAL);\
63 }
64
65#define CHECK_AUDIO_PARAM_CHANGE(s, c, srate, ch_layout, format)\
66 if (c->sample_fmt != format || c->sample_rate != srate ||\
67 c->channel_layout != ch_layout) {\
68 av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
69 return AVERROR(EINVAL);\
70 }
71
72#if FF_API_VSRC_BUFFER_ADD_FRAME
73static int av_vsrc_buffer_add_frame_alt(AVFilterContext *buffer_filter, AVFrame *frame,
74 int64_t pts, AVRational pixel_aspect)
75{
76 int64_t orig_pts = frame->pts;
77 AVRational orig_sar = frame->sample_aspect_ratio;
78 int ret;
79
80 frame->pts = pts;
81 frame->sample_aspect_ratio = pixel_aspect;
82 if ((ret = av_buffersrc_write_frame(buffer_filter, frame)) < 0)
83 return ret;
84 frame->pts = orig_pts;
85 frame->sample_aspect_ratio = orig_sar;
86
87 return 0;
88}
89#endif
90
91int av_buffersrc_write_frame(AVFilterContext *buffer_filter, AVFrame *frame)
92{
93 BufferSourceContext *c = buffer_filter->priv;
94 AVFilterBufferRef *buf;
95 int ret;
96
97 if (!frame) {
98 c->eof = 1;
99 return 0;
100 } else if (c->eof)
101 return AVERROR(EINVAL);
102
103 if (!av_fifo_space(c->fifo) &&
104 (ret = av_fifo_realloc2(c->fifo, av_fifo_size(c->fifo) +
105 sizeof(buf))) < 0)
106 return ret;
107
108 switch (buffer_filter->outputs[0]->type) {
109 case AVMEDIA_TYPE_VIDEO:
110 CHECK_VIDEO_PARAM_CHANGE(buffer_filter, c, frame->width, frame->height,
111 frame->format);
112 buf = avfilter_get_video_buffer(buffer_filter->outputs[0], AV_PERM_WRITE,
113 c->w, c->h);
114 av_image_copy(buf->data, buf->linesize, frame->data, frame->linesize,
115 c->pix_fmt, c->w, c->h);
116 break;
117 case AVMEDIA_TYPE_AUDIO:
118 CHECK_AUDIO_PARAM_CHANGE(buffer_filter, c, frame->sample_rate, frame->channel_layout,
119 frame->format);
120 buf = ff_get_audio_buffer(buffer_filter->outputs[0], AV_PERM_WRITE,
121 frame->nb_samples);
122 av_samples_copy(buf->extended_data, frame->extended_data,
123 0, 0, frame->nb_samples,
124 av_get_channel_layout_nb_channels(frame->channel_layout),
125 frame->format);
126 break;
127 default:
128 return AVERROR(EINVAL);
129 }
130
131 avfilter_copy_frame_props(buf, frame);
132
133 if ((ret = av_fifo_generic_write(c->fifo, &buf, sizeof(buf), NULL)) < 0) {
134 avfilter_unref_buffer(buf);
135 return ret;
136 }
137
138 return 0;
139}
140
141static int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
142{
143 BufferSourceContext *c = s->priv;
144 int ret;
145
146 if (!buf) {
147 c->eof = 1;
148 return 0;
149 } else if (c->eof)
150 return AVERROR(EINVAL);
151
152 if (!av_fifo_space(c->fifo) &&
153 (ret = av_fifo_realloc2(c->fifo, av_fifo_size(c->fifo) +
154 sizeof(buf))) < 0)
155 return ret;
156
157 switch (s->outputs[0]->type) {
158 case AVMEDIA_TYPE_VIDEO:
159 CHECK_VIDEO_PARAM_CHANGE(s, c, buf->video->w, buf->video->h, buf->format);
160 break;
161 case AVMEDIA_TYPE_AUDIO:
162 CHECK_AUDIO_PARAM_CHANGE(s, c, buf->audio->sample_rate, buf->audio->channel_layout,
163 buf->format);
164 break;
165 default:
166 return AVERROR(EINVAL);
167 }
168
169 if ((ret = av_fifo_generic_write(c->fifo, &buf, sizeof(buf), NULL)) < 0)
170 return ret;
171
172 return 0;
173}
174
175static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaque)
176{
177 BufferSourceContext *c = ctx->priv;
178 char pix_fmt_str[128];
179 int n = 0;
180
181 if (!args ||
182 (n = sscanf(args, "%d:%d:%127[^:]:%d:%d:%d:%d", &c->w, &c->h, pix_fmt_str,
183 &c->time_base.num, &c->time_base.den,
184 &c->pixel_aspect.num, &c->pixel_aspect.den)) != 7) {
185 av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but %d found in '%s'\n", n, args);
186 return AVERROR(EINVAL);
187 }
188 if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) {
189 char *tail;
190 c->pix_fmt = strtol(pix_fmt_str, &tail, 10);
191 if (*tail || c->pix_fmt < 0 || c->pix_fmt >= PIX_FMT_NB) {
192 av_log(ctx, AV_LOG_ERROR, "Invalid pixel format string '%s'\n", pix_fmt_str);
193 return AVERROR(EINVAL);
194 }
195 }
196
197 if (!(c->fifo = av_fifo_alloc(sizeof(AVFilterBufferRef*))))
198 return AVERROR(ENOMEM);
199
200 av_log(ctx, AV_LOG_INFO, "w:%d h:%d pixfmt:%s\n", c->w, c->h, av_pix_fmt_descriptors[c->pix_fmt].name);
201 return 0;
202}
203
204#define OFFSET(x) offsetof(BufferSourceContext, x)
205#define A AV_OPT_FLAG_AUDIO_PARAM
206static const AVOption audio_options[] = {
207 { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, A },
208 { "sample_rate", NULL, OFFSET(sample_rate), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, A },
209 { "sample_fmt", NULL, OFFSET(sample_fmt_str), AV_OPT_TYPE_STRING, .flags = A },
210 { "channel_layout", NULL, OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A },
211 { NULL },
212};
213
214static const AVClass abuffer_class = {
215 .class_name = "abuffer source",
216 .item_name = av_default_item_name,
217 .option = audio_options,
218 .version = LIBAVUTIL_VERSION_INT,
219};
220
221static av_cold int init_audio(AVFilterContext *ctx, const char *args, void *opaque)
222{
223 BufferSourceContext *s = ctx->priv;
224 int ret = 0;
225
226 s->class = &abuffer_class;
227 av_opt_set_defaults(s);
228
229 if ((ret = av_set_options_string(s, args, "=", ":")) < 0) {
230 av_log(ctx, AV_LOG_ERROR, "Error parsing options string: %s.\n", args);
231 goto fail;
232 }
233
234 s->sample_fmt = av_get_sample_fmt(s->sample_fmt_str);
235 if (s->sample_fmt == AV_SAMPLE_FMT_NONE) {
236 av_log(ctx, AV_LOG_ERROR, "Invalid sample format %s.\n",
237 s->sample_fmt_str);
238 ret = AVERROR(EINVAL);
239 goto fail;
240 }
241
242 s->channel_layout = av_get_channel_layout(s->channel_layout_str);
243 if (!s->channel_layout) {
244 av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n",
245 s->channel_layout_str);
246 ret = AVERROR(EINVAL);
247 goto fail;
248 }
249
250 if (!(s->fifo = av_fifo_alloc(sizeof(AVFilterBufferRef*)))) {
251 ret = AVERROR(ENOMEM);
252 goto fail;
253 }
254
255 if (!s->time_base.num)
256 s->time_base = (AVRational){1, s->sample_rate};
257
258 av_log(ctx, AV_LOG_VERBOSE, "tb:%d/%d samplefmt:%s samplerate: %d "
259 "ch layout:%s\n", s->time_base.num, s->time_base.den, s->sample_fmt_str,
260 s->sample_rate, s->channel_layout_str);
261
262fail:
263 av_opt_free(s);
264 return ret;
265}
266
267static av_cold void uninit(AVFilterContext *ctx)
268{
269 BufferSourceContext *s = ctx->priv;
270 while (s->fifo && av_fifo_size(s->fifo)) {
271 AVFilterBufferRef *buf;
272 av_fifo_generic_read(s->fifo, &buf, sizeof(buf), NULL);
273 avfilter_unref_buffer(buf);
274 }
275 av_fifo_free(s->fifo);
276 s->fifo = NULL;
277}
278
279static int query_formats(AVFilterContext *ctx)
280{
281 BufferSourceContext *c = ctx->priv;
282 AVFilterChannelLayouts *channel_layouts = NULL;
283 AVFilterFormats *formats = NULL;
284 AVFilterFormats *samplerates = NULL;
285
286 switch (ctx->outputs[0]->type) {
287 case AVMEDIA_TYPE_VIDEO:
288 avfilter_add_format(&formats, c->pix_fmt);
289 avfilter_set_common_formats(ctx, formats);
290 break;
291 case AVMEDIA_TYPE_AUDIO:
292 avfilter_add_format(&formats, c->sample_fmt);
293 avfilter_set_common_formats(ctx, formats);
294
295 avfilter_add_format(&samplerates, c->sample_rate);
296 ff_set_common_samplerates(ctx, samplerates);
297
298 ff_add_channel_layout(&channel_layouts, c->channel_layout);
299 ff_set_common_channel_layouts(ctx, channel_layouts);
300 break;
301 default:
302 return AVERROR(EINVAL);
303 }
304
305 return 0;
306}
307
308static int config_props(AVFilterLink *link)
309{
310 BufferSourceContext *c = link->src->priv;
311
312 switch (link->type) {
313 case AVMEDIA_TYPE_VIDEO:
314 link->w = c->w;
315 link->h = c->h;
316 link->sample_aspect_ratio = c->pixel_aspect;
317 break;
318 case AVMEDIA_TYPE_AUDIO:
319 link->channel_layout = c->channel_layout;
320 link->sample_rate = c->sample_rate;
321 break;
322 default:
323 return AVERROR(EINVAL);
324 }
325
326 link->time_base = c->time_base;
327 return 0;
328}
329
330static int request_frame(AVFilterLink *link)
331{
332 BufferSourceContext *c = link->src->priv;
333 AVFilterBufferRef *buf;
334
335 if (!av_fifo_size(c->fifo)) {
336 if (c->eof)
337 return AVERROR_EOF;
338 return AVERROR(EAGAIN);
339 }
340 av_fifo_generic_read(c->fifo, &buf, sizeof(buf), NULL);
341
342 switch (link->type) {
343 case AVMEDIA_TYPE_VIDEO:
344 avfilter_start_frame(link, avfilter_ref_buffer(buf, ~0));
345 avfilter_draw_slice(link, 0, link->h, 1);
346 avfilter_end_frame(link);
347 break;
348 case AVMEDIA_TYPE_AUDIO:
349 ff_filter_samples(link, avfilter_ref_buffer(buf, ~0));
350 break;
351 default:
352 return AVERROR(EINVAL);
353 }
354
355 avfilter_unref_buffer(buf);
356
357 return 0;
358}
359
360static int poll_frame(AVFilterLink *link)
361{
362 BufferSourceContext *c = link->src->priv;
363 int size = av_fifo_size(c->fifo);
364 if (!size && c->eof)
365 return AVERROR_EOF;
366 return size/sizeof(AVFilterBufferRef*);
367}
368
369AVFilter avfilter_vsrc_buffer = {
370 .name = "buffer",
371 .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them accessible to the filterchain."),
372 .priv_size = sizeof(BufferSourceContext),
373 .query_formats = query_formats,
374
375 .init = init_video,
376 .uninit = uninit,
377
378 .inputs = (AVFilterPad[]) {{ .name = NULL }},
379 .outputs = (AVFilterPad[]) {{ .name = "default",
380 .type = AVMEDIA_TYPE_VIDEO,
381 .request_frame = request_frame,
382 .poll_frame = poll_frame,
383 .config_props = config_props, },
384 { .name = NULL}},
385};
386
387AVFilter avfilter_asrc_abuffer = {
388 .name = "abuffer",
389 .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them accessible to the filterchain."),
390 .priv_size = sizeof(BufferSourceContext),
391 .query_formats = query_formats,
392
393 .init = init_audio,
394 .uninit = uninit,
395
396 .inputs = (AVFilterPad[]) {{ .name = NULL }},
397 .outputs = (AVFilterPad[]) {{ .name = "default",
398 .type = AVMEDIA_TYPE_AUDIO,
399 .request_frame = request_frame,
400 .poll_frame = poll_frame,
401 .config_props = config_props, },
402 { .name = NULL}},
403};
libavfilter/buffersrc.h+11−0
@@ -62,4 +62,15 @@ int av_buffersrc_add_ref(AVFilterContext *buffer_src, · 61 unmodified lines
62 */62 */
63unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);63unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
64 64
65/**
66 * Add a frame to the buffer source.
67 *
68 * @param s an instance of the buffersrc filter.
69 * @param frame frame to be added.
70 *
71 * @warning frame data will be memcpy()ed, which may be a big performance
72 * hit. Use av_buffersrc_buffer() to avoid copying the data.
73 */
74int av_buffersrc_write_frame(AVFilterContext *s, AVFrame *frame);
75
65#endif /* AVFILTER_BUFFERSRC_H */76#endif /* AVFILTER_BUFFERSRC_H */
libavfilter/defaults.c+3−137
@@ -26,111 +26,7 @@ · 25 unmodified lines
26 26
27#include "avfilter.h"27#include "avfilter.h"
28#include "internal.h"28#include "internal.h"
29 29#include "formats.h"
30void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
31{
32 if (ptr->extended_data != ptr->data)
33 av_freep(&ptr->extended_data);
34 av_free(ptr->data[0]);
35 av_free(ptr);
36}
37
38/* TODO: set the buffer's priv member to a context structure for the whole
39 * filter chain. This will allow for a buffer pool instead of the constant
40 * alloc & free cycle currently implemented. */
41AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
42{
43 int linesize[4];
44 uint8_t *data[4];
45 int i;
46 AVFilterBufferRef *picref = NULL;
47 AVFilterPool *pool = link->pool;
48
49 if (pool) {
50 for (i = 0; i < POOL_SIZE; i++) {
51 picref = pool->pic[i];
52 if (picref && picref->buf->format == link->format && picref->buf->w == w && picref->buf->h == h) {
53 AVFilterBuffer *pic = picref->buf;
54 pool->pic[i] = NULL;
55 pool->count--;
56 picref->video->w = w;
57 picref->video->h = h;
58 picref->perms = perms | AV_PERM_READ;
59 picref->format = link->format;
60 pic->refcount = 1;
61 memcpy(picref->data, pic->data, sizeof(picref->data));
62 memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
63 pool->refcount++;
64 return picref;
65 }
66 }
67 } else {
68 pool = link->pool = av_mallocz(sizeof(AVFilterPool));
69 pool->refcount = 1;
70 }
71
72 // align: +2 is needed for swscaler, +16 to be SIMD-friendly
73 if ((i = av_image_alloc(data, linesize, w, h, link->format, 32)) < 0)
74 return NULL;
75
76 picref = avfilter_get_video_buffer_ref_from_arrays(data, linesize,
77 perms, w, h, link->format);
78 if (!picref) {
79 av_free(data[0]);
80 return NULL;
81 }
82 memset(data[0], 128, i);
83
84 picref->buf->priv = pool;
85 picref->buf->free = NULL;
86 pool->refcount++;
87
88 return picref;
89}
90
91void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
92{
93 AVFilterLink *outlink = NULL;
94
95 if (inlink->dst->output_count)
96 outlink = inlink->dst->outputs[0];
97
98 if (outlink) {
99 outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
100 avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
101 avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
102 }
103}
104
105void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
106{
107 AVFilterLink *outlink = NULL;
108
109 if (inlink->dst->output_count)
110 outlink = inlink->dst->outputs[0];
111
112 if (outlink)
113 avfilter_draw_slice(outlink, y, h, slice_dir);
114}
115
116void avfilter_default_end_frame(AVFilterLink *inlink)
117{
118 AVFilterLink *outlink = NULL;
119
120 if (inlink->dst->output_count)
121 outlink = inlink->dst->outputs[0];
122
123 avfilter_unref_buffer(inlink->cur_buf);
124 inlink->cur_buf = NULL;
125
126 if (outlink) {
127 if (outlink->out_buf) {
128 avfilter_unref_buffer(outlink->out_buf);
129 outlink->out_buf = NULL;
130 }
131 avfilter_end_frame(outlink);
132 }
133}
134 30
135static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts,31static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts,
136 enum AVMediaType type, int offin, int offout)32 enum AVMediaType type, int offin, int offout)
@@ -170,8 +66,8 @@ void avfilter_set_common_sample_formats(AVFilterContext *ctx, AVFilterFormats *f · 33 unmodified lines
170void avfilter_set_common_channel_layouts(AVFilterContext *ctx, AVFilterFormats *formats)66void avfilter_set_common_channel_layouts(AVFilterContext *ctx, AVFilterFormats *formats)
171{67{
172 set_common_formats(ctx, formats, AVMEDIA_TYPE_AUDIO,68 set_common_formats(ctx, formats, AVMEDIA_TYPE_AUDIO,
173 offsetof(AVFilterLink, in_chlayouts),69 offsetof(AVFilterLink, in_channel_layouts),
174 offsetof(AVFilterLink, out_chlayouts));70 offsetof(AVFilterLink, out_channel_layouts));
175}71}
176 72
177void avfilter_set_common_packing_formats(AVFilterContext *ctx, AVFilterFormats *formats)73void avfilter_set_common_packing_formats(AVFilterContext *ctx, AVFilterFormats *formats)
@@ -180,33 +76,3 @@ void avfilter_set_common_packing_formats(AVFilterContext *ctx, AVFilterFormats * · 2 unmodified lines
180 offsetof(AVFilterLink, in_packing),76 offsetof(AVFilterLink, in_packing),
181 offsetof(AVFilterLink, out_packing));77 offsetof(AVFilterLink, out_packing));
182}78}
183
184int avfilter_default_query_formats(AVFilterContext *ctx)
185{
186 avfilter_set_common_pixel_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_VIDEO));
187 avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO));
188 avfilter_set_common_channel_layouts(ctx, avfilter_make_all_channel_layouts());
189 avfilter_set_common_packing_formats(ctx, avfilter_make_all_packing_formats());
190
191 return 0;
192}
193
194void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
195{
196 avfilter_start_frame(link->dst->outputs[0], picref);
197}
198
199void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
200{
201 avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
202}
203
204void avfilter_null_end_frame(AVFilterLink *link)
205{
206 avfilter_end_frame(link->dst->outputs[0]);
207}
208
209AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
210{
211 return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
212}
libavfilter/formats.c+282−87
@@ -24,63 +24,138 @@ · 23 unmodified lines
24#include "libavutil/audioconvert.h"24#include "libavutil/audioconvert.h"
25#include "avfilter.h"25#include "avfilter.h"
26#include "internal.h"26#include "internal.h"
27#include "formats.h"
27 28
28/**29/**
29 * Add all refs from a to ret and destroy a.30 * Add all refs from a to ret and destroy a.
30 */31 */
31static void merge_ref(AVFilterFormats *ret, AVFilterFormats *a)32#define MERGE_REF(ret, a, fmts, type, fail) \
32{33do { \
33 int i;34 type ***tmp; \
34 35 int i; \
35 for (i = 0; i < a->refcount; i++) {36 \
36 ret->refs[ret->refcount] = a->refs[i];37 if (!(tmp = av_realloc(ret->refs, \
37 *ret->refs[ret->refcount++] = ret;38 sizeof(*tmp) * (ret->refcount + a->refcount)))) \
38 }39 goto fail; \
40 ret->refs = tmp; \
41 \
42 for (i = 0; i < a->refcount; i ++) { \
43 ret->refs[ret->refcount] = a->refs[i]; \
44 *ret->refs[ret->refcount++] = ret; \
45 } \
46 \
47 av_freep(&a->refs); \
48 av_freep(&a->fmts); \
49 av_freep(&a); \
50} while (0)
39 51
40 av_free(a->refs);52/**
41 av_free(a->formats);53 * Add all formats common for a and b to ret, copy the refs and destroy
42 av_free(a);54 * a and b.
43}55 */
56#define MERGE_FORMATS(ret, a, b, fmts, nb, type, fail) \
57do { \
58 int i, j, k = 0, count = FFMIN(a->nb, b->nb); \
59 \
60 if (!(ret = av_mallocz(sizeof(*ret)))) \
61 goto fail; \
62 \
63 if (count) { \
64 if (!(ret->fmts = av_malloc(sizeof(*ret->fmts) * count))) \
65 goto fail; \
66 for (i = 0; i < a->nb; i++) \
67 for (j = 0; j < b->nb; j++) \
68 if (a->fmts[i] == b->fmts[j]) { \
69 if(k >= FFMIN(a->nb, b->nb)){ \
70 av_log(0, AV_LOG_ERROR, "Duplicate formats in avfilter_merge_formats() detected\n"); \
71 av_free(ret->fmts); \
72 av_free(ret); \
73 return NULL; \
74 } \
75 ret->fmts[k++] = a->fmts[i]; \
76 } \
77 } \
78 ret->nb = k; \
79 /* check that there was at least one common format */ \
80 if (!ret->nb) \
81 goto fail; \
82 \
83 MERGE_REF(ret, a, fmts, type, fail); \
84 MERGE_REF(ret, b, fmts, type, fail); \
85} while (0)
44 86
45AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)87AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
46{88{
47 AVFilterFormats *ret;89 AVFilterFormats *ret = NULL;
48 unsigned i, j, k = 0;
49 90
50 if (a == b)91 if (a == b)
51 return a;92 return a;
52 93
53 ret = av_mallocz(sizeof(*ret));94 MERGE_FORMATS(ret, a, b, formats, format_count, AVFilterFormats, fail);
54 95
55 /* merge list of formats */96 return ret;
56 ret->formats = av_malloc(sizeof(*ret->formats) * FFMIN(a->format_count,97fail:
57 b->format_count));98 if (ret) {
58 for (i = 0; i < a->format_count; i++)99 av_freep(&ret->refs);
59 for (j = 0; j < b->format_count; j++)100 av_freep(&ret->formats);
60 if (a->formats[i] == b->formats[j]){
61 if(k >= FFMIN(a->format_count, b->format_count)){
62 av_log(0, AV_LOG_ERROR, "Duplicate formats in avfilter_merge_formats() detected\n");
63 av_free(ret->formats);
64 av_free(ret);
65 return NULL;
66 }
67 ret->formats[k++] = a->formats[i];
68 }
69
70 ret->format_count = k;
71 /* check that there was at least one common format */
72 if (!ret->format_count) {
73 av_free(ret->formats);
74 av_free(ret);
75 return NULL;
76 }101 }
102 av_freep(&ret);
103 return NULL;
104}
105
106AVFilterFormats *ff_merge_samplerates(AVFilterFormats *a,
107 AVFilterFormats *b)
108{
109 AVFilterFormats *ret = NULL;
77 110
78 ret->refs = av_malloc(sizeof(*ret->refs) * (a->refcount + b->refcount));111 if (a == b) return a;
79 112
80 merge_ref(ret, a);113 if (a->format_count && b->format_count) {
81 merge_ref(ret, b);114 MERGE_FORMATS(ret, a, b, formats, format_count, AVFilterFormats, fail);
115 } else if (a->format_count) {
116 MERGE_REF(a, b, formats, AVFilterFormats, fail);
117 ret = a;
118 } else {
119 MERGE_REF(b, a, formats, AVFilterFormats, fail);
120 ret = b;
121 }
82 122
83 return ret;123 return ret;
124fail:
125 if (ret) {
126 av_freep(&ret->refs);
127 av_freep(&ret->formats);
128 }
129 av_freep(&ret);
130 return NULL;
131}
132
133AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
134 AVFilterChannelLayouts *b)
135{
136 AVFilterChannelLayouts *ret = NULL;
137
138 if (a == b) return a;
139
140 if (a->nb_channel_layouts && b->nb_channel_layouts) {
141 MERGE_FORMATS(ret, a, b, channel_layouts, nb_channel_layouts,
142 AVFilterChannelLayouts, fail);
143 } else if (a->nb_channel_layouts) {
144 MERGE_REF(a, b, channel_layouts, AVFilterChannelLayouts, fail);
145 ret = a;
146 } else {
147 MERGE_REF(b, a, channel_layouts, AVFilterChannelLayouts, fail);
148 ret = b;
149 }
150
151 return ret;
152fail:
153 if (ret) {
154 av_freep(&ret->refs);
155 av_freep(&ret->channel_layouts);
156 }
157 av_freep(&ret);
158 return NULL;
84}159}
85 160
86int ff_fmt_is_in(int fmt, const int *fmts)161int ff_fmt_is_in(int fmt, const int *fmts)
@@ -146,30 +221,40 @@ AVFilterFormats *avfilter_make_format_list(const int *fmts) · 59 unmodified lines
146 return formats;221 return formats;
147}222}
148 223
149AVFilterFormats *avfilter_make_format64_list(const int64_t *fmts)224AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
150{225{
151 MAKE_FORMAT_LIST();226 MAKE_FORMAT_LIST();
152 if (count)227 if (count)
153 memcpy(formats->formats, fmts, sizeof(*formats->formats) * count);228 memcpy(formats->formats, fmts, sizeof(*formats->formats) * count);
154 229
155 return formats;230 return (AVFilterChannelLayouts*)formats;
156}231}
157 232
233#define ADD_FORMAT(f, fmt, type, list, nb) \
234do { \
235 type *fmts; \
236 \
237 if (!(*f) && !(*f = av_mallocz(sizeof(**f)))) \
238 return AVERROR(ENOMEM); \
239 \
240 fmts = av_realloc((*f)->list, \
241 sizeof(*(*f)->list) * ((*f)->nb + 1));\
242 if (!fmts) \
243 return AVERROR(ENOMEM); \
244 \
245 (*f)->list = fmts; \
246 (*f)->list[(*f)->nb++] = fmt; \
247 return 0; \
248} while (0)
249
158int avfilter_add_format(AVFilterFormats **avff, int64_t fmt)250int avfilter_add_format(AVFilterFormats **avff, int64_t fmt)
159{251{
160 int64_t *fmts;252 ADD_FORMAT(avff, fmt, int64_t, formats, format_count);
161 253}
162 if (!(*avff) && !(*avff = av_mallocz(sizeof(**avff))))
163 return AVERROR(ENOMEM);
164
165 fmts = av_realloc((*avff)->formats,
166 sizeof(*(*avff)->formats) * ((*avff)->format_count+1));
167 if (!fmts)
168 return AVERROR(ENOMEM);
169 254
170 (*avff)->formats = fmts;255int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
171 (*avff)->formats[(*avff)->format_count++] = fmt;256{
172 return 0;257 ADD_FORMAT(l, channel_layout, uint64_t, channel_layouts, nb_channel_layouts);
173}258}
174 259
175#if FF_API_OLD_ALL_FORMATS_API260#if FF_API_OLD_ALL_FORMATS_API
@@ -199,10 +284,10 @@ const int64_t avfilter_all_channel_layouts[] = { · 23 unmodified lines
199 -1284 -1
200};285};
201 286
202AVFilterFormats *avfilter_make_all_channel_layouts(void)287// AVFilterFormats *avfilter_make_all_channel_layouts(void)
203{288// {
204 return avfilter_make_format64_list(avfilter_all_channel_layouts);289// return avfilter_make_format64_list(avfilter_all_channel_layouts);
205}290// }
206 291
207AVFilterFormats *avfilter_make_all_packing_formats(void)292AVFilterFormats *avfilter_make_all_packing_formats(void)
208{293{
@@ -215,53 +300,163 @@ AVFilterFormats *avfilter_make_all_packing_formats(void) · 6 unmodified lines
215 return avfilter_make_format_list(packing);300 return avfilter_make_format_list(packing);
216}301}
217 302
218void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)303AVFilterFormats *ff_all_samplerates(void)
219{304{
220 *ref = f;305 AVFilterFormats *ret = av_mallocz(sizeof(*ret));
221 f->refs = av_realloc(f->refs, sizeof(*f->refs) * ++f->refcount);306 return ret;
222 f->refs[f->refcount-1] = ref;
223}307}
224 308
225static int find_ref_index(AVFilterFormats **ref)309AVFilterChannelLayouts *ff_all_channel_layouts(void)
226{310{
227 int i;311 AVFilterChannelLayouts *ret = av_mallocz(sizeof(*ret));
228 for (i = 0; i < (*ref)->refcount; i++)312 return ret;
229 if ((*ref)->refs[i] == ref)
230 return i;
231 return -1;
232}313}
233 314
234void avfilter_formats_unref(AVFilterFormats **ref)315#define FORMATS_REF(f, ref) \
316do { \
317 *ref = f; \
318 f->refs = av_realloc(f->refs, sizeof(*f->refs) * ++f->refcount); \
319 f->refs[f->refcount-1] = ref; \
320} while (0)
321
322void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
323{
324 FORMATS_REF(f, ref);
325}
326
327void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
235{328{
236 int idx;329 FORMATS_REF(f, ref);
330}
237 331
238 if (!*ref)332#define FIND_REF_INDEX(ref, idx) \
239 return;333do { \
334 int i; \
335 for (i = 0; i < (*ref)->refcount; i ++) \
336 if((*ref)->refs[i] == ref) { \
337 idx = i; \
338 break; \
339 } \
340} while (0)
341
342#define FORMATS_UNREF(ref, list) \
343do { \
344 int idx = -1; \
345 \
346 if (!*ref) \
347 return; \
348 \
349 FIND_REF_INDEX(ref, idx); \
350 \
351 if (idx >= 0) \
352 memmove((*ref)->refs + idx, (*ref)->refs + idx + 1, \
353 sizeof(*(*ref)->refs) * ((*ref)->refcount - idx - 1)); \
354 \
355 if(!--(*ref)->refcount) { \
356 av_free((*ref)->list); \
357 av_free((*ref)->refs); \
358 av_free(*ref); \
359 } \
360 *ref = NULL; \
361} while (0)
240 362
241 idx = find_ref_index(ref);363void avfilter_formats_unref(AVFilterFormats **ref)
364{
365 FORMATS_UNREF(ref, formats);
366}
242 367
243 if(idx >= 0)368void ff_channel_layouts_unref(AVFilterChannelLayouts **ref)
244 memmove((*ref)->refs + idx, (*ref)->refs + idx + 1,369{
245 sizeof(*(*ref)->refs) * ((*ref)->refcount - idx - 1));370 FORMATS_UNREF(ref, channel_layouts);
371}
246 372
247 if (!--(*ref)->refcount) {373#define FORMATS_CHANGEREF(oldref, newref) \
248 av_free((*ref)->formats);374do { \
249 av_free((*ref)->refs);375 int idx = -1; \
250 av_free(*ref);376 \
251 }377 FIND_REF_INDEX(oldref, idx); \
252 *ref = NULL;378 \
379 if (idx >= 0) { \
380 (*oldref)->refs[idx] = newref; \
381 *newref = *oldref; \
382 *oldref = NULL; \
383 } \
384} while (0)
385
386void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
387 AVFilterChannelLayouts **newref)
388{
389 FORMATS_CHANGEREF(oldref, newref);
253}390}
254 391
255void avfilter_formats_changeref(AVFilterFormats **oldref,392void avfilter_formats_changeref(AVFilterFormats **oldref,
256 AVFilterFormats **newref)393 AVFilterFormats **newref)
257{394{
258 int idx = find_ref_index(oldref);395 FORMATS_CHANGEREF(oldref, newref);
396}
397
398#define SET_COMMON_FORMATS(ctx, fmts, in_fmts, out_fmts, ref, list) \
399{ \
400 int count = 0, i; \
401 \
402 for (i = 0; i < ctx->input_count; i++) { \
403 if (ctx->inputs[i]) { \
404 ref(fmts, &ctx->inputs[i]->out_fmts); \
405 count++; \
406 } \
407 } \
408 for (i = 0; i < ctx->output_count; i++) { \
409 if (ctx->outputs[i]) { \
410 ref(fmts, &ctx->outputs[i]->in_fmts); \
411 count++; \
412 } \
413 } \
414 \
415 if (!count) { \
416 av_freep(&fmts->list); \
417 av_freep(&fmts->refs); \
418 av_freep(&fmts); \
419 } \
420}
421
422void ff_set_common_channel_layouts(AVFilterContext *ctx,
423 AVFilterChannelLayouts *layouts)
424{
425 SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,
426 ff_channel_layouts_ref, channel_layouts);
427}
428
429void ff_set_common_samplerates(AVFilterContext *ctx,
430 AVFilterFormats *samplerates)
431{
432 SET_COMMON_FORMATS(ctx, samplerates, in_samplerates, out_samplerates,
433 avfilter_formats_ref, formats);
434}
435
436/**
437 * A helper for query_formats() which sets all links to the same list of
438 * formats. If there are no links hooked to this filter, the list of formats is
439 * freed.
440 */
441void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
442{
443 SET_COMMON_FORMATS(ctx, formats, in_formats, out_formats,
444 avfilter_formats_ref, formats);
445}
259 446
260 if (idx >= 0) {447int avfilter_default_query_formats(AVFilterContext *ctx)
261 (*oldref)->refs[idx] = newref;448{
262 *newref = *oldref;449 enum AVMediaType type = ctx->inputs && ctx->inputs [0] ? ctx->inputs [0]->type :
263 *oldref = NULL;450 ctx->outputs && ctx->outputs[0] ? ctx->outputs[0]->type :
451 AVMEDIA_TYPE_VIDEO;
452
453 avfilter_set_common_formats(ctx, avfilter_all_formats(type));
454 if (type == AVMEDIA_TYPE_AUDIO) {
455 ff_set_common_channel_layouts(ctx, ff_all_channel_layouts());
456 ff_set_common_samplerates(ctx, ff_all_samplerates());
264 }457 }
458
459 return 0;
265}460}
266 461
267/* internal functions for parsing audio format arguments */462/* internal functions for parsing audio format arguments */
libavfilter/formats.h+81−0
@@ -0,0 +1,81 @@
1/*
2 * This file is part of FFMpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef AVFILTER_FORMATS_H
20#define AVFILTER_FORMATS_H
21
22#include "avfilter.h"
23
24typedef struct AVFilterChannelLayouts {
25 uint64_t *channel_layouts; ///< list of channel layouts
26 int nb_channel_layouts; ///< number of channel layouts
27
28 unsigned refcount; ///< number of references to this list
29 struct AVFilterChannelLayouts ***refs; ///< references to this list
30} AVFilterChannelLayouts;
31
32/**
33 * Return a channel layouts/samplerates list which contains the intersection of
34 * the layouts/samplerates of a and b. Also, all the references of a, all the
35 * references of b, and a and b themselves will be deallocated.
36 *
37 * If a and b do not share any common elements, neither is modified, and NULL
38 * is returned.
39 */
40AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
41 AVFilterChannelLayouts *b);
42AVFilterFormats *ff_merge_samplerates(AVFilterFormats *a,
43 AVFilterFormats *b);
44
45/**
46 * Construct an empty AVFilterChannelLayouts/AVFilterFormats struct --
47 * representing any channel layout/sample rate.
48 */
49AVFilterChannelLayouts *ff_all_channel_layouts(void);
50AVFilterFormats *ff_all_samplerates(void);
51
52AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);
53
54
55/**
56 * A helper for query_formats() which sets all links to the same list of channel
57 * layouts/sample rates. If there are no links hooked to this filter, the list
58 * is freed.
59 */
60void ff_set_common_channel_layouts(AVFilterContext *ctx,
61 AVFilterChannelLayouts *layouts);
62void ff_set_common_samplerates(AVFilterContext *ctx,
63 AVFilterFormats *samplerates);
64
65int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout);
66
67/**
68 * Add *ref as a new reference to f.
69 */
70void ff_channel_layouts_ref(AVFilterChannelLayouts *f,
71 AVFilterChannelLayouts **ref);
72
73/**
74 * Remove a reference to a channel layouts list.
75 */
76void ff_channel_layouts_unref(AVFilterChannelLayouts **ref);
77
78void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
79 AVFilterChannelLayouts **newref);
80
81#endif // AVFILTER_FORMATS_H
libavfilter/internal.h+5−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
26 26
27#include "avfilter.h"27#include "avfilter.h"
28#include "avfiltergraph.h"28#include "avfiltergraph.h"
29#include "formats.h"
29 30
30#define POOL_SIZE 3231#define POOL_SIZE 32
31typedef struct AVFilterPool {32typedef struct AVFilterPool {
@@ -151,6 +152,10 @@ static inline void ff_null_start_frame_keep_ref(AVFilterLink *inlink, · 119 unmodified lines
151 152
152void ff_update_link_current_pts(AVFilterLink *link, int64_t pts);153void ff_update_link_current_pts(AVFilterLink *link, int64_t pts);
153 154
155void ff_free_pool(AVFilterPool *pool);
156
157void ff_command_queue_pop(AVFilterContext *filter);
158
154#define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)159#define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
155 160
156void ff_dlog_link(void *ctx, AVFilterLink *link, int end);161void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
libavfilter/sink_buffer.c+5−2
@@ -269,19 +269,22 @@ static int asink_query_formats(AVFilterContext *ctx) · 268 unmodified lines
269{269{
270 BufferSinkContext *buf = ctx->priv;270 BufferSinkContext *buf = ctx->priv;
271 AVFilterFormats *formats = NULL;271 AVFilterFormats *formats = NULL;
272 AVFilterChannelLayouts *layouts = NULL;
272 273
273 if (!(formats = avfilter_make_format_list(buf->sample_fmts)))274 if (!(formats = avfilter_make_format_list(buf->sample_fmts)))
274 return AVERROR(ENOMEM);275 return AVERROR(ENOMEM);
275 avfilter_set_common_sample_formats(ctx, formats);276 avfilter_set_common_sample_formats(ctx, formats);
276 277
277 if (!(formats = avfilter_make_format64_list(buf->channel_layouts)))278 if (!(layouts = avfilter_make_format64_list(buf->channel_layouts)))
278 return AVERROR(ENOMEM);279 return AVERROR(ENOMEM);
279 avfilter_set_common_channel_layouts(ctx, formats);280 ff_set_common_channel_layouts(ctx, layouts);
280 281
281 if (!(formats = avfilter_make_format_list(buf->packing_fmts)))282 if (!(formats = avfilter_make_format_list(buf->packing_fmts)))
282 return AVERROR(ENOMEM);283 return AVERROR(ENOMEM);
283 avfilter_set_common_packing_formats(ctx, formats);284 avfilter_set_common_packing_formats(ctx, formats);
284 285
286 ff_set_common_samplerates (ctx, ff_all_samplerates());
287
285 return 0;288 return 0;
286}289}
287 290
libavfilter/src_buffer.c+4−6
@@ -507,14 +507,15 @@ static int query_formats_audio(AVFilterContext *ctx) · 506 unmodified lines
507{507{
508 BufferSourceContext *abuffer = ctx->priv;508 BufferSourceContext *abuffer = ctx->priv;
509 AVFilterFormats *formats;509 AVFilterFormats *formats;
510 AVFilterChannelLayouts *layouts;
510 511
511 formats = NULL;512 formats = NULL;
512 avfilter_add_format(&formats, abuffer->sample_format);513 avfilter_add_format(&formats, abuffer->sample_format);
513 avfilter_set_common_sample_formats(ctx, formats);514 avfilter_set_common_sample_formats(ctx, formats);
514 515
515 formats = NULL;516 layouts = NULL;
516 avfilter_add_format(&formats, abuffer->channel_layout);517 ff_add_channel_layout(&layouts, abuffer->channel_layout);
517 avfilter_set_common_channel_layouts(ctx, formats);518 ff_set_common_channel_layouts(ctx, layouts);
518 519
519 formats = NULL;520 formats = NULL;
520 avfilter_add_format(&formats, abuffer->packing_format);521 avfilter_add_format(&formats, abuffer->packing_format);
@@ -653,8 +654,6 @@ AVFilter avfilter_vsrc_buffer = { · 132 unmodified lines
653 { .name = NULL}},654 { .name = NULL}},
654};655};
655 656
656#if CONFIG_ABUFFER_FILTER
657
658AVFilter avfilter_asrc_abuffer = {657AVFilter avfilter_asrc_abuffer = {
659 .name = "abuffer",658 .name = "abuffer",
660 .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them accessible to the filterchain."),659 .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them accessible to the filterchain."),
@@ -673,4 +672,3 @@ AVFilter avfilter_asrc_abuffer = { · 12 unmodified lines
673 { .name = NULL}},672 { .name = NULL}},
674};673};
675 674
676#endif
libavfilter/src_movie.c+4−1
@@ -38,6 +38,7 @@ · 37 unmodified lines
38#include "audio.h"38#include "audio.h"
39#include "avcodec.h"39#include "avcodec.h"
40#include "avfilter.h"40#include "avfilter.h"
41#include "formats.h"
41 42
42typedef struct {43typedef struct {
43 /* common A/V fields */44 /* common A/V fields */
@@ -370,12 +371,14 @@ static int amovie_query_formats(AVFilterContext *ctx) · 326 unmodified lines
370 371
371 enum AVSampleFormat sample_fmts[] = { c->sample_fmt, -1 };372 enum AVSampleFormat sample_fmts[] = { c->sample_fmt, -1 };
372 int packing_fmts[] = { AVFILTER_PACKED, -1 };373 int packing_fmts[] = { AVFILTER_PACKED, -1 };
374 int sample_rates[] = { c->sample_rate, -1 };
373 int64_t chlayouts[] = { c->channel_layout ? c->channel_layout :375 int64_t chlayouts[] = { c->channel_layout ? c->channel_layout :
374 av_get_default_channel_layout(c->channels), -1 };376 av_get_default_channel_layout(c->channels), -1 };
375 377
376 avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts));378 avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts));
377 avfilter_set_common_packing_formats(ctx, avfilter_make_format_list(packing_fmts));379 avfilter_set_common_packing_formats(ctx, avfilter_make_format_list(packing_fmts));
378 avfilter_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts));380 ff_set_common_samplerates (ctx, avfilter_make_format_list(sample_rates));
381 ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts));
379 382
380 return 0;383 return 0;
381}384}
libavfilter/version.h+4−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "libavutil/avutil.h"29#include "libavutil/avutil.h"
30 30
31#define LIBAVFILTER_VERSION_MAJOR 231#define LIBAVFILTER_VERSION_MAJOR 2
32#define LIBAVFILTER_VERSION_MINOR 7332#define LIBAVFILTER_VERSION_MINOR 74
33#define LIBAVFILTER_VERSION_MICRO 10033#define LIBAVFILTER_VERSION_MICRO 100
34 34
35#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \35#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -50,5 +50,8 @@ · 14 unmodified lines
50#ifndef FF_API_SAMPLERATE6450#ifndef FF_API_SAMPLERATE64
51#define FF_API_SAMPLERATE64 (LIBAVFILTER_VERSION_MAJOR < 3)51#define FF_API_SAMPLERATE64 (LIBAVFILTER_VERSION_MAJOR < 3)
52#endif52#endif
53#ifndef FF_API_VSRC_BUFFER_ADD_FRAME
54#define FF_API_VSRC_BUFFER_ADD_FRAME (LIBAVFILTER_VERSION_MAJOR < 3)
55#endif
53 56
54#endif // AVFILTER_VERSION_H57#endif // AVFILTER_VERSION_H
libavfilter/vf_yadif.c+36−18
@@ -59,6 +59,7 @@ typedef struct { · 58 unmodified lines
59 int w, int prefs, int mrefs, int parity, int mode);59 int w, int prefs, int mrefs, int parity, int mode);
60 60
61 const AVPixFmtDescriptor *csp;61 const AVPixFmtDescriptor *csp;
62 int eof;
62} YADIFContext;63} YADIFContext;
63 64
64#define CHECK(j)\65#define CHECK(j)\
@@ -216,22 +217,11 @@ static void return_frame(AVFilterContext *ctx, int is_second) · 151 unmodified lines
216 filter(ctx, yadif->out, tff ^ !is_second, tff);217 filter(ctx, yadif->out, tff ^ !is_second, tff);
217 218
218 if (is_second) {219 if (is_second) {
219 if (yadif->next->pts != AV_NOPTS_VALUE &&220 int64_t cur_pts = yadif->cur->pts;
220 yadif->cur->pts != AV_NOPTS_VALUE) {221 int64_t next_pts = yadif->next->pts;
221 uint64_t next_pts = yadif->next->pts;222
222 uint64_t cur_pts = yadif->cur->pts;223 if (next_pts != AV_NOPTS_VALUE && cur_pts != AV_NOPTS_VALUE) {
223 uint64_t prev_pts = yadif->prev->pts;224 yadif->out->pts = cur_pts + next_pts;
224
225 uint64_t ft = FFMIN3( cur_pts-prev_pts,
226 next_pts-cur_pts,
227 (next_pts-prev_pts)/2);
228
229 if(next_pts - cur_pts < 2*ft)
230 yadif->out->pts =
231 (next_pts&cur_pts) +
232 ((next_pts^cur_pts)>>1);
233 else
234 yadif->out->pts = cur_pts + ft/2;
235 } else {225 } else {
236 yadif->out->pts = AV_NOPTS_VALUE;226 yadif->out->pts = AV_NOPTS_VALUE;
237 }227 }
@@ -264,6 +254,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 26 unmodified lines
264 yadif->out = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);254 yadif->out = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
265 avfilter_unref_buffer(yadif->prev);255 avfilter_unref_buffer(yadif->prev);
266 yadif->prev = NULL;256 yadif->prev = NULL;
257 if (yadif->out->pts != AV_NOPTS_VALUE)
258 yadif->out->pts *= 2;
267 avfilter_start_frame(ctx->outputs[0], yadif->out);259 avfilter_start_frame(ctx->outputs[0], yadif->out);
268 return;260 return;
269 }261 }
@@ -276,6 +268,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 6 unmodified lines
276 268
277 avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);269 avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
278 yadif->out->video->interlaced = 0;270 yadif->out->video->interlaced = 0;
271 if (yadif->out->pts != AV_NOPTS_VALUE)
272 yadif->out->pts *= 2;
279 avfilter_start_frame(ctx->outputs[0], yadif->out);273 avfilter_start_frame(ctx->outputs[0], yadif->out);
280}274}
281 275
@@ -309,8 +303,21 @@ static int request_frame(AVFilterLink *link) · 27 unmodified lines
309 do {303 do {
310 int ret;304 int ret;
311 305
312 if ((ret = avfilter_request_frame(link->src->inputs[0])))306 if (yadif->eof)
307 return AVERROR_EOF;
308
309 ret = avfilter_request_frame(link->src->inputs[0]);
310
311 if (ret == AVERROR_EOF && yadif->next) {
312 AVFilterBufferRef *next = avfilter_ref_buffer(yadif->next, AV_PERM_READ);
313 next->pts = yadif->next->pts * 2 - yadif->cur->pts;
314
315 start_frame(link->src->inputs[0], next);
316 end_frame(link->src->inputs[0]);
317 yadif->eof = 1;
318 } else if (ret < 0) {
313 return ret;319 return ret;
320 }
314 } while (!yadif->cur);321 } while (!yadif->cur);
315 322
316 return 0;323 return 0;
@@ -411,6 +418,16 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 94 unmodified lines
411 418
412static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }419static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
413 420
421static int config_props(AVFilterLink *link)
422{
423 link->time_base.num = link->src->inputs[0]->time_base.num;
424 link->time_base.den = link->src->inputs[0]->time_base.den * 2;
425 link->w = link->src->inputs[0]->w;
426 link->h = link->src->inputs[0]->h;
427
428 return 0;
429}
430
414AVFilter avfilter_vf_yadif = {431AVFilter avfilter_vf_yadif = {
415 .name = "yadif",432 .name = "yadif",
416 .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),433 .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),
@@ -432,6 +449,7 @@ AVFilter avfilter_vf_yadif = { · 15 unmodified lines
432 .outputs = (const AVFilterPad[]) {{ .name = "default",449 .outputs = (const AVFilterPad[]) {{ .name = "default",
433 .type = AVMEDIA_TYPE_VIDEO,450 .type = AVMEDIA_TYPE_VIDEO,
434 .poll_frame = poll_frame,451 .poll_frame = poll_frame,
435 .request_frame = request_frame, },452 .request_frame = request_frame,
453 .config_props = config_props, },
436 { .name = NULL}},454 { .name = NULL}},
437};455};
libavfilter/video.c+345−0
@@ -0,0 +1,345 @@
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "libavutil/imgutils.h"
20
21#include "avfilter.h"
22#include "internal.h"
23
24static char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
25{
26 snprintf(buf, buf_size, "%s%s%s%s%s%s",
27 perms & AV_PERM_READ ? "r" : "",
28 perms & AV_PERM_WRITE ? "w" : "",
29 perms & AV_PERM_PRESERVE ? "p" : "",
30 perms & AV_PERM_REUSE ? "u" : "",
31 perms & AV_PERM_REUSE2 ? "U" : "",
32 perms & AV_PERM_NEG_LINESIZES ? "n" : "");
33 return buf;
34}
35
36static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
37{
38 av_unused char buf[16];
39 av_dlog(ctx,
40 "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
41 ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],
42 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
43 ref->pts, ref->pos);
44
45 if (ref->video) {
46 av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
47 ref->video->sample_aspect_ratio.num, ref->video->sample_aspect_ratio.den,
48 ref->video->w, ref->video->h,
49 !ref->video->interlaced ? 'P' : /* Progressive */
50 ref->video->top_field_first ? 'T' : 'B', /* Top / Bottom */
51 ref->video->key_frame,
52 av_get_picture_type_char(ref->video->pict_type));
53 }
54 if (ref->audio) {
55 av_dlog(ctx, " cl:%"PRId64"d n:%d r:%d p:%d",
56 ref->audio->channel_layout,
57 ref->audio->nb_samples,
58 ref->audio->sample_rate,
59 ref->audio->planar);
60 }
61
62 av_dlog(ctx, "]%s", end ? "\n" : "");
63}
64
65AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
66{
67 return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
68}
69
70AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
71{
72 int linesize[4];
73 uint8_t *data[4];
74 int i;
75 AVFilterBufferRef *picref = NULL;
76 AVFilterPool *pool = link->pool;
77
78 if (pool) {
79 for (i = 0; i < POOL_SIZE; i++) {
80 picref = pool->pic[i];
81 if (picref && picref->buf->format == link->format && picref->buf->w == w && picref->buf->h == h) {
82 AVFilterBuffer *pic = picref->buf;
83 pool->pic[i] = NULL;
84 pool->count--;
85 picref->video->w = w;
86 picref->video->h = h;
87 picref->perms = perms | AV_PERM_READ;
88 picref->format = link->format;
89 pic->refcount = 1;
90 memcpy(picref->data, pic->data, sizeof(picref->data));
91 memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
92 pool->refcount++;
93 return picref;
94 }
95 }
96 } else {
97 pool = link->pool = av_mallocz(sizeof(AVFilterPool));
98 pool->refcount = 1;
99 }
100
101 // align: +2 is needed for swscaler, +16 to be SIMD-friendly
102 if ((i = av_image_alloc(data, linesize, w, h, link->format, 32)) < 0)
103 return NULL;
104
105 picref = avfilter_get_video_buffer_ref_from_arrays(data, linesize,
106 perms, w, h, link->format);
107 if (!picref) {
108 av_free(data[0]);
109 return NULL;
110 }
111
112 memset(data[0], 128, i);
113
114 picref->buf->priv = pool;
115 picref->buf->free = NULL;
116 pool->refcount++;
117
118 return picref;
119}
120
121AVFilterBufferRef *
122avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
123 int w, int h, enum PixelFormat format)
124{
125 AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));
126 AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef));
127
128 if (!pic || !picref)
129 goto fail;
130
131 picref->buf = pic;
132 picref->buf->free = ff_avfilter_default_free_buffer;
133 if (!(picref->video = av_mallocz(sizeof(AVFilterBufferRefVideoProps))))
134 goto fail;
135
136 pic->w = picref->video->w = w;
137 pic->h = picref->video->h = h;
138
139 /* make sure the buffer gets read permission or it's useless for output */
140 picref->perms = perms | AV_PERM_READ;
141
142 pic->refcount = 1;
143 picref->type = AVMEDIA_TYPE_VIDEO;
144 pic->format = picref->format = format;
145
146 memcpy(pic->data, data, 4*sizeof(data[0]));
147 memcpy(pic->linesize, linesize, 4*sizeof(linesize[0]));
148 memcpy(picref->data, pic->data, sizeof(picref->data));
149 memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
150
151 pic-> extended_data = pic->data;
152 picref->extended_data = picref->data;
153
154 return picref;
155
156fail:
157 if (picref && picref->video)
158 av_free(picref->video);
159 av_free(picref);
160 av_free(pic);
161 return NULL;
162}
163
164AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
165{
166 AVFilterBufferRef *ret = NULL;
167
168 av_unused char buf[16];
169 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
170 av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
171
172 if (link->dstpad->get_video_buffer)
173 ret = link->dstpad->get_video_buffer(link, perms, w, h);
174
175 if (!ret)
176 ret = avfilter_default_get_video_buffer(link, perms, w, h);
177
178 if (ret)
179 ret->type = AVMEDIA_TYPE_VIDEO;
180
181 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
182
183 return ret;
184}
185
186void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
187{
188 avfilter_start_frame(link->dst->outputs[0], picref);
189}
190
191void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
192{
193 AVFilterLink *outlink = NULL;
194
195 if (inlink->dst->output_count)
196 outlink = inlink->dst->outputs[0];
197
198 if (outlink) {
199 outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
200 avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
201 avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
202 }
203}
204
205/* XXX: should we do the duplicating of the picture ref here, instead of
206 * forcing the source filter to do it? */
207void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
208{
209 void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
210 AVFilterPad *dst = link->dstpad;
211 int perms = picref->perms;
212 AVFilterCommand *cmd= link->dst->command_queue;
213
214 FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1);
215
216 if (!(start_frame = dst->start_frame))
217 start_frame = avfilter_default_start_frame;
218
219 if (picref->linesize[0] < 0)
220 perms |= AV_PERM_NEG_LINESIZES;
221 /* prepare to copy the picture if it has insufficient permissions */
222 if ((dst->min_perms & perms) != dst->min_perms || dst->rej_perms & perms) {
223 av_log(link->dst, AV_LOG_DEBUG,
224 "frame copy needed (have perms %x, need %x, reject %x)\n",
225 picref->perms,
226 link->dstpad->min_perms, link->dstpad->rej_perms);
227
228 link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
229 link->src_buf = picref;
230 avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
231 }
232 else
233 link->cur_buf = picref;
234
235 while(cmd && cmd->time <= picref->pts * av_q2d(link->time_base)){
236 av_log(link->dst, AV_LOG_DEBUG,
237 "Processing command time:%f command:%s arg:%s\n",
238 cmd->time, cmd->command, cmd->arg);
239 avfilter_process_command(link->dst, cmd->command, cmd->arg, 0, 0, cmd->flags);
240 ff_command_queue_pop(link->dst);
241 cmd= link->dst->command_queue;
242 }
243
244 start_frame(link, link->cur_buf);
245 ff_update_link_current_pts(link, link->cur_buf->pts);
246}
247
248void avfilter_null_end_frame(AVFilterLink *link)
249{
250 avfilter_end_frame(link->dst->outputs[0]);
251}
252
253void avfilter_default_end_frame(AVFilterLink *inlink)
254{
255 AVFilterLink *outlink = NULL;
256
257 if (inlink->dst->output_count)
258 outlink = inlink->dst->outputs[0];
259
260 avfilter_unref_buffer(inlink->cur_buf);
261 inlink->cur_buf = NULL;
262
263 if (outlink) {
264 if (outlink->out_buf) {
265 avfilter_unref_buffer(outlink->out_buf);
266 outlink->out_buf = NULL;
267 }
268 avfilter_end_frame(outlink);
269 }
270}
271
272void avfilter_end_frame(AVFilterLink *link)
273{
274 void (*end_frame)(AVFilterLink *);
275
276 if (!(end_frame = link->dstpad->end_frame))
277 end_frame = avfilter_default_end_frame;
278
279 end_frame(link);
280
281 /* unreference the source picture if we're feeding the destination filter
282 * a copied version dues to permission issues */
283 if (link->src_buf) {
284 avfilter_unref_buffer(link->src_buf);
285 link->src_buf = NULL;
286 }
287}
288
289void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
290{
291 avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
292}
293
294void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
295{
296 AVFilterLink *outlink = NULL;
297
298 if (inlink->dst->output_count)
299 outlink = inlink->dst->outputs[0];
300
301 if (outlink)
302 avfilter_draw_slice(outlink, y, h, slice_dir);
303}
304
305void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
306{
307 uint8_t *src[4], *dst[4];
308 int i, j, vsub;
309 void (*draw_slice)(AVFilterLink *, int, int, int);
310
311 FF_DPRINTF_START(NULL, draw_slice); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
312
313 /* copy the slice if needed for permission reasons */
314 if (link->src_buf) {
315 vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
316
317 for (i = 0; i < 4; i++) {
318 if (link->src_buf->data[i]) {
319 src[i] = link->src_buf-> data[i] +
320 (y >> (i==1 || i==2 ? vsub : 0)) * link->src_buf-> linesize[i];
321 dst[i] = link->cur_buf->data[i] +
322 (y >> (i==1 || i==2 ? vsub : 0)) * link->cur_buf->linesize[i];
323 } else
324 src[i] = dst[i] = NULL;
325 }
326
327 for (i = 0; i < 4; i++) {
328 int planew =
329 av_image_get_linesize(link->format, link->cur_buf->video->w, i);
330
331 if (!src[i]) continue;
332
333 for (j = 0; j < h >> (i==1 || i==2 ? vsub : 0); j++) {
334 memcpy(dst[i], src[i], planew);
335 src[i] += link->src_buf->linesize[i];
336 dst[i] += link->cur_buf->linesize[i];
337 }
338 }
339 }
340
341 if (!(draw_slice = link->dstpad->draw_slice))
342 draw_slice = avfilter_default_draw_slice;
343 draw_slice(link, y, h, slice_dir);
344}
345
libavutil/avutil.h+1−1
@@ -153,7 +153,7 @@ · 152 unmodified lines
153 */153 */
154 154
155#define LIBAVUTIL_VERSION_MAJOR 51155#define LIBAVUTIL_VERSION_MAJOR 51
156#define LIBAVUTIL_VERSION_MINOR 52156#define LIBAVUTIL_VERSION_MINOR 53
157#define LIBAVUTIL_VERSION_MICRO 100157#define LIBAVUTIL_VERSION_MICRO 100
158 158
159#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \159#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
tests/fate-run.sh+1−3
@@ -61,9 +61,7 @@ stddev(){ · 60 unmodified lines
61}61}
62 62
63oneline(){63oneline(){
64 val=$(cat "$2")64 printf '%s\n' "$1" | diff -u -b - "$2"
65 test x"$val" = x"$1" || { r=$?; printf -- '-%s\n+%s\n' "$ref" "$val"; }
66 return ${r:-0}
67}65}
68 66
69run(){67run(){
tests/fate/audio.mak+6−0
@@ -43,6 +43,12 @@ fate-nellymoser-aref-encode: CMP_SHIFT = -1172 · 42 unmodified lines
43fate-nellymoser-aref-encode: CMP_TARGET = 961743fate-nellymoser-aref-encode: CMP_TARGET = 9617
44fate-nellymoser-aref-encode: SIZE_TOLERANCE = 26844fate-nellymoser-aref-encode: SIZE_TOLERANCE = 268
45 45
46FATE_AUDIO += fate-sierra-vmd-audio
47fate-sierra-vmd-audio: CMD = framecrc -i $(SAMPLES)/vmd/12.vmd -vn
48
49FATE_AUDIO += fate-smacker-audio
50fate-smacker-audio: CMD = framecrc -i $(SAMPLES)/smacker/wetlogo.smk -vn
51
46FATE_AUDIO += fate-ws_snd52FATE_AUDIO += fate-ws_snd
47fate-ws_snd: CMD = md5 -i $(SAMPLES)/vqa/ws_snd.vqa -f s16le53fate-ws_snd: CMD = md5 -i $(SAMPLES)/vqa/ws_snd.vqa -f s16le
48 54
tests/fate/demux.mak+2−5
@@ -58,14 +58,11 @@ fate-qcp-demux: CMD = crc -i $(SAMPLES)/qcp/0036580847.QCP -acodec copy · 57 unmodified lines
58FATE_DEMUX += fate-redcode-demux58FATE_DEMUX += fate-redcode-demux
59fate-redcode-demux: CMD = framecrc -i $(SAMPLES)/r3d/4MB-sample.r3d -vcodec copy -acodec copy59fate-redcode-demux: CMD = framecrc -i $(SAMPLES)/r3d/4MB-sample.r3d -vcodec copy -acodec copy
60 60
61FATE_DEMUX += fate-sierra-vmd
62fate-sierra-vmd: CMD = framecrc -i $(SAMPLES)/vmd/12.vmd -pix_fmt rgb24
63
64FATE_DEMUX += fate-siff61FATE_DEMUX += fate-siff
65fate-siff: CMD = framecrc -i $(SAMPLES)/SIFF/INTRO_B.VB -t 3 -pix_fmt rgb2462fate-siff: CMD = framecrc -i $(SAMPLES)/SIFF/INTRO_B.VB -t 3 -pix_fmt rgb24
66 63
67FATE_DEMUX += fate-smjpeg64FATE_DEMUX += fate-smjpeg-demux
68fate-smjpeg: CMD = framecrc -i $(SAMPLES)/smjpeg/scenwin.mjpg -vcodec copy65fate-smjpeg-demux: CMD = framecrc -i $(SAMPLES)/smjpeg/scenwin.mjpg -c copy
69 66
70FATE_DEMUX += fate-westwood-aud67FATE_DEMUX += fate-westwood-aud
71fate-westwood-aud: CMD = framecrc -i $(SAMPLES)/westwood-aud/excellent.aud -c copy68fate-westwood-aud: CMD = framecrc -i $(SAMPLES)/westwood-aud/excellent.aud -c copy
tests/fate/video.mak+5−2
@@ -176,8 +176,11 @@ fate-rl2: CMD = framecrc -i $(SAMPLES)/rl2/Z4915300.RL2 -pix_fmt rgb24 -an · 175 unmodified lines
176FATE_VIDEO += fate-roqvideo176FATE_VIDEO += fate-roqvideo
177fate-roqvideo: CMD = framecrc -i $(SAMPLES)/idroq/idlogo.roq -an177fate-roqvideo: CMD = framecrc -i $(SAMPLES)/idroq/idlogo.roq -an
178 178
179FATE_VIDEO += fate-smacker179FATA_VIDEO += fate-sierra-vmd-video
180fate-smacker: CMD = framecrc -i $(SAMPLES)/smacker/wetlogo.smk -pix_fmt rgb24180fate-sierra-vmd-video: CMD = framecrc -i $(SAMPLES)/vmd/12.vmd -pix_fmt rgb24 -an
181
182FATA_VIDEO += fate-smacker-video
183fate-smacker-video: CMD = framecrc -i $(SAMPLES)/smacker/wetlogo.smk -pix_fmt rgb24 -an
181 184
182FATE_VIDEO += fate-smc185FATE_VIDEO += fate-smc
183fate-smc: CMD = framecrc -i $(SAMPLES)/smc/cass_schi.qt -pix_fmt rgb24186fate-smc: CMD = framecrc -i $(SAMPLES)/smc/cass_schi.qt -pix_fmt rgb24
tests/ref/fate/sierra-vmd+0−334
@@ -1,334 +0,0 @@
1#tb 0: 1/10
2#tb 1: 1/22050
30, 0, 0, 1, 230400, 0x0224ab01
41, 0, 0, 61740, 123480, 0x3a794c13
50, 1, 1, 1, 230400, 0x449e4d81
60, 2, 2, 1, 230400, 0x3e15e07a
70, 3, 3, 1, 230400, 0xdabe4172
80, 4, 4, 1, 230400, 0x0947b7db
90, 5, 5, 1, 230400, 0x934e243b
100, 6, 6, 1, 230400, 0x6b5c5b6c
110, 7, 7, 1, 230400, 0x4bf7bbb5
120, 8, 8, 1, 230400, 0x423eec8e
130, 9, 9, 1, 230400, 0x63663b5e
140, 10, 10, 1, 230400, 0x9c258a67
150, 11, 11, 1, 230400, 0x1c92b6e0
160, 12, 12, 1, 230400, 0xdd0a0e28
170, 13, 13, 1, 230400, 0x51d64af1
180, 14, 14, 1, 230400, 0x5776ac12
190, 15, 15, 1, 230400, 0x49070132
200, 16, 16, 1, 230400, 0xa59635ab
210, 17, 17, 1, 230400, 0xb1f99504
220, 18, 18, 1, 230400, 0x61fac725
230, 19, 19, 1, 230400, 0xc32c28d5
240, 20, 20, 1, 230400, 0x2b7a91d6
250, 21, 21, 1, 230400, 0x917be717
260, 22, 22, 1, 230400, 0xd3c5a2ff
270, 23, 23, 1, 230400, 0x0678a707
280, 24, 24, 1, 230400, 0x122504e6
290, 25, 25, 1, 230400, 0x76aebdae
300, 26, 26, 1, 230400, 0x81357545
310, 27, 27, 1, 230400, 0x38baeebd
320, 28, 28, 1, 230400, 0x1c5c44d4
331, 61740, 61740, 2205, 4410, 0x109d04e0
340, 29, 29, 1, 230400, 0x60e189cc
351, 63945, 63945, 2205, 4410, 0x224d244f
360, 30, 30, 1, 230400, 0xb1f4381c
371, 66150, 66150, 2205, 4410, 0xbb72413d
380, 31, 31, 1, 230400, 0xb5048fed
391, 68355, 68355, 2205, 4410, 0xaa5f5b86
400, 32, 32, 1, 230400, 0xc947c30e
411, 70560, 70560, 2205, 4410, 0x94e7aea7
420, 33, 33, 1, 230400, 0xe8e31c07
431, 72765, 72765, 2205, 4410, 0xad497ca0
440, 34, 34, 1, 230400, 0x6d49dd02
451, 74970, 74970, 2205, 4410, 0x1de10c9e
460, 35, 35, 1, 230400, 0x293e15d3
471, 77175, 77175, 2205, 4410, 0x9f55efa8
480, 36, 36, 1, 230400, 0x354d792e
491, 79380, 79380, 2205, 4410, 0x220a072a
500, 37, 37, 1, 230400, 0x35468780
511, 81585, 81585, 2205, 4410, 0xa7dafb29
520, 38, 38, 1, 230400, 0x365d3991
531, 83790, 83790, 2205, 4410, 0xd5e29c7a
540, 39, 39, 1, 230400, 0xc9debef2
551, 85995, 85995, 2205, 4410, 0xb8465006
560, 40, 40, 1, 230400, 0x4c4634c2
571, 88200, 88200, 2205, 4410, 0x518669c7
580, 41, 41, 1, 230400, 0x347c2dca
591, 90405, 90405, 2205, 4410, 0xb5b5efca
600, 42, 42, 1, 230400, 0x1efa0aaa
611, 92610, 92610, 2205, 4410, 0x8600015d
620, 43, 43, 1, 230400, 0xa79a0b5a
631, 94815, 94815, 2205, 4410, 0xe2f68fe9
640, 44, 44, 1, 230400, 0xfdb2dcdb
651, 97020, 97020, 2205, 4410, 0x8d3458d9
660, 45, 45, 1, 230400, 0x42dbea33
671, 99225, 99225, 2205, 4410, 0xf1ff4775
680, 46, 46, 1, 230400, 0x2a207e43
691, 101430, 101430, 2205, 4410, 0x830f67c9
700, 47, 47, 1, 230400, 0x86573783
711, 103635, 103635, 2205, 4410, 0x110e0bc1
720, 48, 48, 1, 230400, 0xc3968473
731, 105840, 105840, 2205, 4410, 0x71682f47
740, 49, 49, 1, 230400, 0x8f62a7b4
751, 108045, 108045, 2205, 4410, 0x38119095
760, 50, 50, 1, 230400, 0x5a2e3073
771, 110250, 110250, 2205, 4410, 0xd2494db6
780, 51, 51, 1, 230400, 0xd24f5e2c
791, 112455, 112455, 2205, 4410, 0x8b552509
800, 52, 52, 1, 230400, 0x1df3c67d
811, 114660, 114660, 2205, 4410, 0x71e52909
820, 53, 53, 1, 230400, 0xe4fd884d
831, 116865, 116865, 2205, 4410, 0x9f0a6f4d
841, 119070, 119070, 2205, 4410, 0x901302f2
851, 121275, 121275, 2205, 4410, 0x855d5222
861, 123480, 123480, 2205, 4410, 0x324bb2fe
870, 57, 57, 1, 230400, 0x9a228555
881, 125685, 125685, 2205, 4410, 0xe85f583f
890, 58, 58, 1, 230400, 0x9eba8ed5
901, 127890, 127890, 2205, 4410, 0x2cbc67c4
910, 59, 59, 1, 230400, 0x3d808a3d
921, 130095, 130095, 2205, 4410, 0xc82e6aa1
930, 60, 60, 1, 230400, 0xf57e866d
941, 132300, 132300, 2205, 4410, 0xb9fc423c
950, 61, 61, 1, 230400, 0x85f594f5
961, 134505, 134505, 2205, 4410, 0x6b9b4ef9
970, 62, 62, 1, 230400, 0xb09f99dd
981, 136710, 136710, 2205, 4410, 0x39290f10
990, 63, 63, 1, 230400, 0x2b368475
1001, 138915, 138915, 2205, 4410, 0xad718eb4
1010, 64, 64, 1, 230400, 0xa2417afd
1021, 141120, 141120, 2205, 4410, 0x82f463ac
1030, 65, 65, 1, 230400, 0x590b709d
1041, 143325, 143325, 2205, 4410, 0xfac87cac
1050, 66, 66, 1, 230400, 0x5d617705
1061, 145530, 145530, 2205, 4410, 0x9e8bcca7
1070, 67, 67, 1, 230400, 0xabf981ad
1081, 147735, 147735, 2205, 4410, 0x52f79c99
1090, 68, 68, 1, 230400, 0x5a8590cd
1101, 149940, 149940, 2205, 4410, 0xf2d14de2
1110, 69, 69, 1, 230400, 0x1bff853d
1121, 152145, 152145, 2205, 4410, 0x367f95e1
1130, 70, 70, 1, 230400, 0x71d08055
1141, 154350, 154350, 2205, 4410, 0x8bfac293
1150, 71, 71, 1, 230400, 0x2ebd817d
1161, 156555, 156555, 2205, 4410, 0x01ea5040
1170, 72, 72, 1, 230400, 0x6e838255
1181, 158760, 158760, 2205, 4410, 0x8ff5e212
1190, 73, 73, 1, 230400, 0x043984cd
1201, 160965, 160965, 2205, 4410, 0x93f32824
1210, 74, 74, 1, 230400, 0x7ff18495
1221, 163170, 163170, 2205, 4410, 0x998f90dc
1230, 75, 75, 1, 230400, 0xa43b8385
1241, 165375, 165375, 2205, 4410, 0x65231170
1250, 76, 76, 1, 230400, 0x72b5825d
1261, 167580, 167580, 2205, 4410, 0xc79039a1
1270, 77, 77, 1, 230400, 0x3a178085
1281, 169785, 169785, 2205, 4410, 0x0b0e58bd
1290, 78, 78, 1, 230400, 0x67748245
1301, 171990, 171990, 2205, 4410, 0xc24ab4fa
1310, 79, 79, 1, 230400, 0xeddf81d5
1321, 174195, 174195, 2205, 4410, 0xd3796a8e
1330, 80, 80, 1, 230400, 0x8b088665
1341, 176400, 176400, 2205, 4410, 0xa37f8295
1350, 81, 81, 1, 230400, 0x6c408e15
1361, 178605, 178605, 2205, 4410, 0xb760fed7
1370, 82, 82, 1, 230400, 0x81f196dd
1381, 180810, 180810, 2205, 4410, 0x05495a34
1390, 83, 83, 1, 230400, 0xab9f953d
1401, 183015, 183015, 2205, 4410, 0x6f203437
1410, 84, 84, 1, 230400, 0xa5f69795
1421, 185220, 185220, 2205, 4410, 0x71299402
1430, 85, 85, 1, 230400, 0xa772950d
1441, 187425, 187425, 2205, 4410, 0x72e7b346
1450, 86, 86, 1, 230400, 0x6a5596d5
1461, 189630, 189630, 2205, 4410, 0x879b0dae
1470, 87, 87, 1, 230400, 0x1355958d
1481, 191835, 191835, 2205, 4410, 0x041aa1bd
1490, 88, 88, 1, 230400, 0x4134981d
1501, 194040, 194040, 2205, 4410, 0x18a962e6
1510, 89, 89, 1, 230400, 0x8b929515
1521, 196245, 196245, 2205, 4410, 0x21d20539
1530, 90, 90, 1, 230400, 0x482f95c5
1541, 198450, 198450, 2205, 4410, 0x8f449267
1550, 91, 91, 1, 230400, 0x7a9795d5
1561, 200655, 200655, 2205, 4410, 0xecdc01d6
1570, 92, 92, 1, 230400, 0x21c29abd
1581, 202860, 202860, 2205, 4410, 0x458abd5a
1590, 93, 93, 1, 230400, 0x9ae6a475
1601, 205065, 205065, 2205, 4410, 0xa070ea63
1610, 94, 94, 1, 230400, 0x3734aee5
1621, 207270, 207270, 2205, 4410, 0xc25b26ce
1630, 95, 95, 1, 230400, 0xa0a1b365
1641, 209475, 209475, 2205, 4410, 0x4d9237ca
1650, 96, 96, 1, 230400, 0x2dcab1c5
1661, 211680, 211680, 2205, 4410, 0x748e1801
1670, 97, 97, 1, 230400, 0x9c8b6c44
1681, 213885, 213885, 2205, 4410, 0xc96b69e6
1690, 98, 98, 1, 230400, 0x5da75feb
1701, 216090, 216090, 2205, 4410, 0x6663186c
1710, 99, 99, 1, 230400, 0x4d02f8e3
1721, 218295, 218295, 2205, 4410, 0x7f6d3081
1730, 100, 100, 1, 230400, 0x66824f3a
1741, 220500, 220500, 2205, 4410, 0x1a0343b5
1750, 101, 101, 1, 230400, 0x0c9257e2
1761, 222705, 222705, 2205, 4410, 0xc48e338c
1770, 102, 102, 1, 230400, 0xb2927092
1781, 224910, 224910, 2205, 4410, 0x26fc03c8
1790, 103, 103, 1, 230400, 0xb5dc6e9a
1801, 227115, 227115, 2205, 4410, 0x69be7e2d
1810, 104, 104, 1, 230400, 0x6e567bc6
1821, 229320, 229320, 2205, 4410, 0x69a74da1
1830, 105, 105, 1, 230400, 0xbf9e0f7a
1841, 231525, 231525, 2205, 4410, 0x85bd2ab3
1850, 106, 106, 1, 230400, 0xb16f684a
1861, 233730, 233730, 2205, 4410, 0xeff05426
1870, 107, 107, 1, 230400, 0xf9e55e81
1881, 235935, 235935, 2205, 4410, 0x292829e0
1890, 108, 108, 1, 230400, 0xd8d0bcba
1901, 238140, 238140, 2205, 4410, 0x8f741798
1910, 109, 109, 1, 230400, 0x44720ac0
1921, 240345, 240345, 2205, 4410, 0x6b9337e9
1930, 110, 110, 1, 230400, 0x7d4c2058
1941, 242550, 242550, 2205, 4410, 0xe4e1703f
1951, 244755, 244755, 2205, 4410, 0x043d6c35
1961, 246960, 246960, 2205, 4410, 0x3a8988e7
1970, 113, 113, 1, 230400, 0xb0973eb9
1981, 249165, 249165, 2205, 4410, 0x1fa7d2a9
1990, 114, 114, 1, 230400, 0x405a13ce
2001, 251370, 251370, 2205, 4410, 0xe28799e3
2010, 115, 115, 1, 230400, 0x6422f00a
2021, 253575, 253575, 2205, 4410, 0xc2df4470
2030, 116, 116, 1, 230400, 0x924b6c1e
2041, 255780, 255780, 2205, 4410, 0x694d0cf5
2051, 257985, 257985, 2205, 4410, 0x5aac2dcf
2061, 260190, 260190, 2205, 4410, 0x259fa2db
2071, 262395, 262395, 2205, 4410, 0xd16d6803
2081, 264600, 264600, 2205, 4410, 0xa4b3478a
2091, 266805, 266805, 2205, 4410, 0xdbe0443d
2101, 269010, 269010, 2205, 4410, 0x26c16119
2111, 271215, 271215, 2205, 4410, 0x0c06475c
2121, 273420, 273420, 2205, 4410, 0x6ffaba2d
2131, 275625, 275625, 2205, 4410, 0x5b287192
2141, 277830, 277830, 2205, 4410, 0xf2cf2651
2151, 280035, 280035, 2205, 4410, 0x3857673a
2161, 282240, 282240, 2205, 4410, 0x5b555feb
2171, 284445, 284445, 2205, 4410, 0x93f997af
2181, 286650, 286650, 2205, 4410, 0xb3ba8d35
2191, 288855, 288855, 2205, 4410, 0x66433944
2201, 291060, 291060, 2205, 4410, 0xf0005a5f
2211, 293265, 293265, 2205, 4410, 0xb948541f
2221, 295470, 295470, 2205, 4410, 0xc8f1b16f
2231, 297675, 297675, 2205, 4410, 0x7d4b7506
2241, 299880, 299880, 2205, 4410, 0xac723c55
2251, 302085, 302085, 2205, 4410, 0x2926fab5
2261, 304290, 304290, 2205, 4410, 0x31684995
2271, 306495, 306495, 2205, 4410, 0x35ebfca4
2281, 308700, 308700, 2205, 4410, 0x9cd42c18
2291, 310905, 310905, 2205, 4410, 0xd7ecd7b1
2301, 313110, 313110, 2205, 4410, 0x5e13c602
2311, 315315, 315315, 2205, 4410, 0xe955b5e3
2321, 317520, 317520, 2205, 4410, 0xefad19a1
2330, 145, 145, 1, 230400, 0xcf7809c0
2341, 319725, 319725, 2205, 4410, 0x435950de
2350, 146, 146, 1, 230400, 0x883a3863
2361, 321930, 321930, 2205, 4410, 0x9d624ebe
2370, 147, 147, 1, 230400, 0x6adc9e03
2381, 324135, 324135, 2205, 4410, 0x774a9158
2390, 148, 148, 1, 230400, 0x4f5ab7a8
2401, 326340, 326340, 2205, 4410, 0x8c41e66a
2411, 328545, 328545, 2205, 4410, 0x70112740
2421, 330750, 330750, 2205, 4410, 0x55abc7a2
2431, 332955, 332955, 2205, 4410, 0x0ec3183c
2441, 335160, 335160, 2205, 4410, 0x54609c56
2451, 337365, 337365, 2205, 4410, 0x60d49f92
2461, 339570, 339570, 2205, 4410, 0x5fb061c8
2471, 341775, 341775, 2205, 4410, 0x6e119c98
2481, 343980, 343980, 2205, 4410, 0x3f39fc69
2491, 346185, 346185, 2205, 4410, 0xef466d0e
2501, 348390, 348390, 2205, 4410, 0xf4cb6fe1
2511, 350595, 350595, 2205, 4410, 0xc4434439
2521, 352800, 352800, 2205, 4410, 0xd02329d2
2531, 355005, 355005, 2205, 4410, 0x216cffaf
2541, 357210, 357210, 2205, 4410, 0x7e59e8c1
2551, 359415, 359415, 2205, 4410, 0xc7c3346d
2561, 361620, 361620, 2205, 4410, 0x5b3723af
2571, 363825, 363825, 2205, 4410, 0x76097270
2581, 366030, 366030, 2205, 4410, 0xae39a233
2591, 368235, 368235, 2205, 4410, 0x686a471c
2601, 370440, 370440, 2205, 4410, 0x3af3c5e0
2611, 372645, 372645, 2205, 4410, 0x11ac711e
2621, 374850, 374850, 2205, 4410, 0xcd8da8ce
2631, 377055, 377055, 2205, 4410, 0x21296e3a
2641, 379260, 379260, 2205, 4410, 0x77168188
2651, 381465, 381465, 2205, 4410, 0x5fcf59cd
2661, 383670, 383670, 2205, 4410, 0x390c8717
2671, 385875, 385875, 2205, 4410, 0x3d5d5b3c
2681, 388080, 388080, 2205, 4410, 0x3b8f13d3
2691, 390285, 390285, 2205, 4410, 0x5b002c2f
2701, 392490, 392490, 2205, 4410, 0x9e1d2b08
2711, 394695, 394695, 2205, 4410, 0x69454ebd
2721, 396900, 396900, 2205, 4410, 0x62a54bec
2731, 399105, 399105, 2205, 4410, 0x4d231fdb
2741, 401310, 401310, 2205, 4410, 0x65624ff7
2751, 403515, 403515, 2205, 4410, 0x6fc66932
2761, 405720, 405720, 2205, 4410, 0x23200cf6
2771, 407925, 407925, 2205, 4410, 0xf8033122
2781, 410130, 410130, 2205, 4410, 0x0fce0744
2791, 412335, 412335, 2205, 4410, 0x9302683e
2801, 414540, 414540, 2205, 4410, 0xd2380245
2811, 416745, 416745, 2205, 4410, 0x482e0872
2821, 418950, 418950, 2205, 4410, 0xe98e6461
2831, 421155, 421155, 2205, 4410, 0x1db404e3
2841, 423360, 423360, 2205, 4410, 0x47a26d45
2851, 425565, 425565, 2205, 4410, 0x449a348a
2861, 427770, 427770, 2205, 4410, 0xee874f84
2871, 429975, 429975, 2205, 4410, 0xc4ecf965
2881, 432180, 432180, 2205, 4410, 0xcc450bc8
2891, 434385, 434385, 2205, 4410, 0xb18d044b
2901, 436590, 436590, 2205, 4410, 0x895435e8
2911, 438795, 438795, 2205, 4410, 0x57e7574e
2921, 441000, 441000, 2205, 4410, 0x8041ad3d
2931, 443205, 443205, 2205, 4410, 0x853d1616
2941, 445410, 445410, 2205, 4410, 0xa11bb32b
2951, 447615, 447615, 2205, 4410, 0xe10ea0de
2961, 449820, 449820, 2205, 4410, 0xdf2ee328
2971, 452025, 452025, 2205, 4410, 0xd5a6dcae
2981, 454230, 454230, 2205, 4410, 0xd176c00b
2991, 456435, 456435, 2205, 4410, 0x9cd6bcf3
3001, 458640, 458640, 2205, 4410, 0x2569690a
3011, 460845, 460845, 2205, 4410, 0x6824aa1d
3021, 463050, 463050, 2205, 4410, 0xa9110afa
3031, 465255, 465255, 2205, 4410, 0x115c25be
3041, 467460, 467460, 2205, 4410, 0x1100f085
3051, 469665, 469665, 2205, 4410, 0x00000000
3060, 214, 214, 1, 230400, 0xdc0aab94
3071, 471870, 471870, 2205, 4410, 0x00000000
3081, 474075, 474075, 2205, 4410, 0x00000000
3091, 476280, 476280, 2205, 4410, 0x00000000
3101, 478485, 478485, 2205, 4410, 0x00000000
3111, 480690, 480690, 2205, 4410, 0x00000000
3121, 482895, 482895, 2205, 4410, 0x00000000
3131, 485100, 485100, 2205, 4410, 0x00000000
3141, 487305, 487305, 2205, 4410, 0x00000000
3151, 489510, 489510, 2205, 4410, 0x00000000
3161, 491715, 491715, 2205, 4410, 0x00000000
3171, 493920, 493920, 2205, 4410, 0x00000000
3181, 496125, 496125, 2205, 4410, 0x00000000
3191, 498330, 498330, 2205, 4410, 0x00000000
3201, 500535, 500535, 2205, 4410, 0x00000000
3211, 502740, 502740, 2205, 4410, 0x00000000
3221, 504945, 504945, 2205, 4410, 0x00000000
3231, 507150, 507150, 2205, 4410, 0x00000000
3241, 509355, 509355, 2205, 4410, 0x00000000
3251, 511560, 511560, 2205, 4410, 0x00000000
3261, 513765, 513765, 2205, 4410, 0x00000000
3271, 515970, 515970, 2205, 4410, 0x00000000
3281, 518175, 518175, 2205, 4410, 0x00000000
3291, 520380, 520380, 2205, 4410, 0x00000000
3301, 522585, 522585, 2205, 4410, 0x00000000
3311, 524790, 524790, 2205, 4410, 0x00000000
3321, 526995, 526995, 2205, 4410, 0x00000000
3331, 529200, 529200, 2205, 4410, 0x00000000
3341, 531405, 531405, 2205, 4410, 0x00000000
tests/ref/fate/sierra-vmd-audio+216−0
@@ -0,0 +1,216 @@
1#tb 0: 1/22050
20, 0, 0, 61740, 123480, 0x3a794c13
30, 61740, 61740, 2205, 4410, 0x109d04e0
40, 63945, 63945, 2205, 4410, 0x224d244f
50, 66150, 66150, 2205, 4410, 0xbb72413d
60, 68355, 68355, 2205, 4410, 0xaa5f5b86
70, 70560, 70560, 2205, 4410, 0x94e7aea7
80, 72765, 72765, 2205, 4410, 0xad497ca0
90, 74970, 74970, 2205, 4410, 0x1de10c9e
100, 77175, 77175, 2205, 4410, 0x9f55efa8
110, 79380, 79380, 2205, 4410, 0x220a072a
120, 81585, 81585, 2205, 4410, 0xa7dafb29
130, 83790, 83790, 2205, 4410, 0xd5e29c7a
140, 85995, 85995, 2205, 4410, 0xb8465006
150, 88200, 88200, 2205, 4410, 0x518669c7
160, 90405, 90405, 2205, 4410, 0xb5b5efca
170, 92610, 92610, 2205, 4410, 0x8600015d
180, 94815, 94815, 2205, 4410, 0xe2f68fe9
190, 97020, 97020, 2205, 4410, 0x8d3458d9
200, 99225, 99225, 2205, 4410, 0xf1ff4775
210, 101430, 101430, 2205, 4410, 0x830f67c9
220, 103635, 103635, 2205, 4410, 0x110e0bc1
230, 105840, 105840, 2205, 4410, 0x71682f47
240, 108045, 108045, 2205, 4410, 0x38119095
250, 110250, 110250, 2205, 4410, 0xd2494db6
260, 112455, 112455, 2205, 4410, 0x8b552509
270, 114660, 114660, 2205, 4410, 0x71e52909
280, 116865, 116865, 2205, 4410, 0x9f0a6f4d
290, 119070, 119070, 2205, 4410, 0x901302f2
300, 121275, 121275, 2205, 4410, 0x855d5222
310, 123480, 123480, 2205, 4410, 0x324bb2fe
320, 125685, 125685, 2205, 4410, 0xe85f583f
330, 127890, 127890, 2205, 4410, 0x2cbc67c4
340, 130095, 130095, 2205, 4410, 0xc82e6aa1
350, 132300, 132300, 2205, 4410, 0xb9fc423c
360, 134505, 134505, 2205, 4410, 0x6b9b4ef9
370, 136710, 136710, 2205, 4410, 0x39290f10
380, 138915, 138915, 2205, 4410, 0xad718eb4
390, 141120, 141120, 2205, 4410, 0x82f463ac
400, 143325, 143325, 2205, 4410, 0xfac87cac
410, 145530, 145530, 2205, 4410, 0x9e8bcca7
420, 147735, 147735, 2205, 4410, 0x52f79c99
430, 149940, 149940, 2205, 4410, 0xf2d14de2
440, 152145, 152145, 2205, 4410, 0x367f95e1
450, 154350, 154350, 2205, 4410, 0x8bfac293
460, 156555, 156555, 2205, 4410, 0x01ea5040
470, 158760, 158760, 2205, 4410, 0x8ff5e212
480, 160965, 160965, 2205, 4410, 0x93f32824
490, 163170, 163170, 2205, 4410, 0x998f90dc
500, 165375, 165375, 2205, 4410, 0x65231170
510, 167580, 167580, 2205, 4410, 0xc79039a1
520, 169785, 169785, 2205, 4410, 0x0b0e58bd
530, 171990, 171990, 2205, 4410, 0xc24ab4fa
540, 174195, 174195, 2205, 4410, 0xd3796a8e
550, 176400, 176400, 2205, 4410, 0xa37f8295
560, 178605, 178605, 2205, 4410, 0xb760fed7
570, 180810, 180810, 2205, 4410, 0x05495a34
580, 183015, 183015, 2205, 4410, 0x6f203437
590, 185220, 185220, 2205, 4410, 0x71299402
600, 187425, 187425, 2205, 4410, 0x72e7b346
610, 189630, 189630, 2205, 4410, 0x879b0dae
620, 191835, 191835, 2205, 4410, 0x041aa1bd
630, 194040, 194040, 2205, 4410, 0x18a962e6
640, 196245, 196245, 2205, 4410, 0x21d20539
650, 198450, 198450, 2205, 4410, 0x8f449267
660, 200655, 200655, 2205, 4410, 0xecdc01d6
670, 202860, 202860, 2205, 4410, 0x458abd5a
680, 205065, 205065, 2205, 4410, 0xa070ea63
690, 207270, 207270, 2205, 4410, 0xc25b26ce
700, 209475, 209475, 2205, 4410, 0x4d9237ca
710, 211680, 211680, 2205, 4410, 0x748e1801
720, 213885, 213885, 2205, 4410, 0xc96b69e6
730, 216090, 216090, 2205, 4410, 0x6663186c
740, 218295, 218295, 2205, 4410, 0x7f6d3081
750, 220500, 220500, 2205, 4410, 0x1a0343b5
760, 222705, 222705, 2205, 4410, 0xc48e338c
770, 224910, 224910, 2205, 4410, 0x26fc03c8
780, 227115, 227115, 2205, 4410, 0x69be7e2d
790, 229320, 229320, 2205, 4410, 0x69a74da1
800, 231525, 231525, 2205, 4410, 0x85bd2ab3
810, 233730, 233730, 2205, 4410, 0xeff05426
820, 235935, 235935, 2205, 4410, 0x292829e0
830, 238140, 238140, 2205, 4410, 0x8f741798
840, 240345, 240345, 2205, 4410, 0x6b9337e9
850, 242550, 242550, 2205, 4410, 0xe4e1703f
860, 244755, 244755, 2205, 4410, 0x043d6c35
870, 246960, 246960, 2205, 4410, 0x3a8988e7
880, 249165, 249165, 2205, 4410, 0x1fa7d2a9
890, 251370, 251370, 2205, 4410, 0xe28799e3
900, 253575, 253575, 2205, 4410, 0xc2df4470
910, 255780, 255780, 2205, 4410, 0x694d0cf5
920, 257985, 257985, 2205, 4410, 0x5aac2dcf
930, 260190, 260190, 2205, 4410, 0x259fa2db
940, 262395, 262395, 2205, 4410, 0xd16d6803
950, 264600, 264600, 2205, 4410, 0xa4b3478a
960, 266805, 266805, 2205, 4410, 0xdbe0443d
970, 269010, 269010, 2205, 4410, 0x26c16119
980, 271215, 271215, 2205, 4410, 0x0c06475c
990, 273420, 273420, 2205, 4410, 0x6ffaba2d
1000, 275625, 275625, 2205, 4410, 0x5b287192
1010, 277830, 277830, 2205, 4410, 0xf2cf2651
1020, 280035, 280035, 2205, 4410, 0x3857673a
1030, 282240, 282240, 2205, 4410, 0x5b555feb
1040, 284445, 284445, 2205, 4410, 0x93f997af
1050, 286650, 286650, 2205, 4410, 0xb3ba8d35
1060, 288855, 288855, 2205, 4410, 0x66433944
1070, 291060, 291060, 2205, 4410, 0xf0005a5f
1080, 293265, 293265, 2205, 4410, 0xb948541f
1090, 295470, 295470, 2205, 4410, 0xc8f1b16f
1100, 297675, 297675, 2205, 4410, 0x7d4b7506
1110, 299880, 299880, 2205, 4410, 0xac723c55
1120, 302085, 302085, 2205, 4410, 0x2926fab5
1130, 304290, 304290, 2205, 4410, 0x31684995
1140, 306495, 306495, 2205, 4410, 0x35ebfca4
1150, 308700, 308700, 2205, 4410, 0x9cd42c18
1160, 310905, 310905, 2205, 4410, 0xd7ecd7b1
1170, 313110, 313110, 2205, 4410, 0x5e13c602
1180, 315315, 315315, 2205, 4410, 0xe955b5e3
1190, 317520, 317520, 2205, 4410, 0xefad19a1
1200, 319725, 319725, 2205, 4410, 0x435950de
1210, 321930, 321930, 2205, 4410, 0x9d624ebe
1220, 324135, 324135, 2205, 4410, 0x774a9158
1230, 326340, 326340, 2205, 4410, 0x8c41e66a
1240, 328545, 328545, 2205, 4410, 0x70112740
1250, 330750, 330750, 2205, 4410, 0x55abc7a2
1260, 332955, 332955, 2205, 4410, 0x0ec3183c
1270, 335160, 335160, 2205, 4410, 0x54609c56
1280, 337365, 337365, 2205, 4410, 0x60d49f92
1290, 339570, 339570, 2205, 4410, 0x5fb061c8
1300, 341775, 341775, 2205, 4410, 0x6e119c98
1310, 343980, 343980, 2205, 4410, 0x3f39fc69
1320, 346185, 346185, 2205, 4410, 0xef466d0e
1330, 348390, 348390, 2205, 4410, 0xf4cb6fe1
1340, 350595, 350595, 2205, 4410, 0xc4434439
1350, 352800, 352800, 2205, 4410, 0xd02329d2
1360, 355005, 355005, 2205, 4410, 0x216cffaf
1370, 357210, 357210, 2205, 4410, 0x7e59e8c1
1380, 359415, 359415, 2205, 4410, 0xc7c3346d
1390, 361620, 361620, 2205, 4410, 0x5b3723af
1400, 363825, 363825, 2205, 4410, 0x76097270
1410, 366030, 366030, 2205, 4410, 0xae39a233
1420, 368235, 368235, 2205, 4410, 0x686a471c
1430, 370440, 370440, 2205, 4410, 0x3af3c5e0
1440, 372645, 372645, 2205, 4410, 0x11ac711e
1450, 374850, 374850, 2205, 4410, 0xcd8da8ce
1460, 377055, 377055, 2205, 4410, 0x21296e3a
1470, 379260, 379260, 2205, 4410, 0x77168188
1480, 381465, 381465, 2205, 4410, 0x5fcf59cd
1490, 383670, 383670, 2205, 4410, 0x390c8717
1500, 385875, 385875, 2205, 4410, 0x3d5d5b3c
1510, 388080, 388080, 2205, 4410, 0x3b8f13d3
1520, 390285, 390285, 2205, 4410, 0x5b002c2f
1530, 392490, 392490, 2205, 4410, 0x9e1d2b08
1540, 394695, 394695, 2205, 4410, 0x69454ebd
1550, 396900, 396900, 2205, 4410, 0x62a54bec
1560, 399105, 399105, 2205, 4410, 0x4d231fdb
1570, 401310, 401310, 2205, 4410, 0x65624ff7
1580, 403515, 403515, 2205, 4410, 0x6fc66932
1590, 405720, 405720, 2205, 4410, 0x23200cf6
1600, 407925, 407925, 2205, 4410, 0xf8033122
1610, 410130, 410130, 2205, 4410, 0x0fce0744
1620, 412335, 412335, 2205, 4410, 0x9302683e
1630, 414540, 414540, 2205, 4410, 0xd2380245
1640, 416745, 416745, 2205, 4410, 0x482e0872
1650, 418950, 418950, 2205, 4410, 0xe98e6461
1660, 421155, 421155, 2205, 4410, 0x1db404e3
1670, 423360, 423360, 2205, 4410, 0x47a26d45
1680, 425565, 425565, 2205, 4410, 0x449a348a
1690, 427770, 427770, 2205, 4410, 0xee874f84
1700, 429975, 429975, 2205, 4410, 0xc4ecf965
1710, 432180, 432180, 2205, 4410, 0xcc450bc8
1720, 434385, 434385, 2205, 4410, 0xb18d044b
1730, 436590, 436590, 2205, 4410, 0x895435e8
1740, 438795, 438795, 2205, 4410, 0x57e7574e
1750, 441000, 441000, 2205, 4410, 0x8041ad3d
1760, 443205, 443205, 2205, 4410, 0x853d1616
1770, 445410, 445410, 2205, 4410, 0xa11bb32b
1780, 447615, 447615, 2205, 4410, 0xe10ea0de
1790, 449820, 449820, 2205, 4410, 0xdf2ee328
1800, 452025, 452025, 2205, 4410, 0xd5a6dcae
1810, 454230, 454230, 2205, 4410, 0xd176c00b
1820, 456435, 456435, 2205, 4410, 0x9cd6bcf3
1830, 458640, 458640, 2205, 4410, 0x2569690a
1840, 460845, 460845, 2205, 4410, 0x6824aa1d
1850, 463050, 463050, 2205, 4410, 0xa9110afa
1860, 465255, 465255, 2205, 4410, 0x115c25be
1870, 467460, 467460, 2205, 4410, 0x1100f085
1880, 469665, 469665, 2205, 4410, 0x00000000
1890, 471870, 471870, 2205, 4410, 0x00000000
1900, 474075, 474075, 2205, 4410, 0x00000000
1910, 476280, 476280, 2205, 4410, 0x00000000
1920, 478485, 478485, 2205, 4410, 0x00000000
1930, 480690, 480690, 2205, 4410, 0x00000000
1940, 482895, 482895, 2205, 4410, 0x00000000
1950, 485100, 485100, 2205, 4410, 0x00000000
1960, 487305, 487305, 2205, 4410, 0x00000000
1970, 489510, 489510, 2205, 4410, 0x00000000
1980, 491715, 491715, 2205, 4410, 0x00000000
1990, 493920, 493920, 2205, 4410, 0x00000000
2000, 496125, 496125, 2205, 4410, 0x00000000
2010, 498330, 498330, 2205, 4410, 0x00000000
2020, 500535, 500535, 2205, 4410, 0x00000000
2030, 502740, 502740, 2205, 4410, 0x00000000
2040, 504945, 504945, 2205, 4410, 0x00000000
2050, 507150, 507150, 2205, 4410, 0x00000000
2060, 509355, 509355, 2205, 4410, 0x00000000
2070, 511560, 511560, 2205, 4410, 0x00000000
2080, 513765, 513765, 2205, 4410, 0x00000000
2090, 515970, 515970, 2205, 4410, 0x00000000
2100, 518175, 518175, 2205, 4410, 0x00000000
2110, 520380, 520380, 2205, 4410, 0x00000000
2120, 522585, 522585, 2205, 4410, 0x00000000
2130, 524790, 524790, 2205, 4410, 0x00000000
2140, 526995, 526995, 2205, 4410, 0x00000000
2150, 529200, 529200, 2205, 4410, 0x00000000
2160, 531405, 531405, 2205, 4410, 0x00000000
tests/ref/fate/sierra-vmd-video+118−0
@@ -0,0 +1,118 @@
1#tb 0: 1/10
20, 0, 0, 1, 230400, 0x0224ab01
30, 1, 1, 1, 230400, 0x449e4d81
40, 2, 2, 1, 230400, 0x3e15e07a
50, 3, 3, 1, 230400, 0xdabe4172
60, 4, 4, 1, 230400, 0x0947b7db
70, 5, 5, 1, 230400, 0x934e243b
80, 6, 6, 1, 230400, 0x6b5c5b6c
90, 7, 7, 1, 230400, 0x4bf7bbb5
100, 8, 8, 1, 230400, 0x423eec8e
110, 9, 9, 1, 230400, 0x63663b5e
120, 10, 10, 1, 230400, 0x9c258a67
130, 11, 11, 1, 230400, 0x1c92b6e0
140, 12, 12, 1, 230400, 0xdd0a0e28
150, 13, 13, 1, 230400, 0x51d64af1
160, 14, 14, 1, 230400, 0x5776ac12
170, 15, 15, 1, 230400, 0x49070132
180, 16, 16, 1, 230400, 0xa59635ab
190, 17, 17, 1, 230400, 0xb1f99504
200, 18, 18, 1, 230400, 0x61fac725
210, 19, 19, 1, 230400, 0xc32c28d5
220, 20, 20, 1, 230400, 0x2b7a91d6
230, 21, 21, 1, 230400, 0x917be717
240, 22, 22, 1, 230400, 0xd3c5a2ff
250, 23, 23, 1, 230400, 0x0678a707
260, 24, 24, 1, 230400, 0x122504e6
270, 25, 25, 1, 230400, 0x76aebdae
280, 26, 26, 1, 230400, 0x81357545
290, 27, 27, 1, 230400, 0x38baeebd
300, 28, 28, 1, 230400, 0x1c5c44d4
310, 29, 29, 1, 230400, 0x60e189cc
320, 30, 30, 1, 230400, 0xb1f4381c
330, 31, 31, 1, 230400, 0xb5048fed
340, 32, 32, 1, 230400, 0xc947c30e
350, 33, 33, 1, 230400, 0xe8e31c07
360, 34, 34, 1, 230400, 0x6d49dd02
370, 35, 35, 1, 230400, 0x293e15d3
380, 36, 36, 1, 230400, 0x354d792e
390, 37, 37, 1, 230400, 0x35468780
400, 38, 38, 1, 230400, 0x365d3991
410, 39, 39, 1, 230400, 0xc9debef2
420, 40, 40, 1, 230400, 0x4c4634c2
430, 41, 41, 1, 230400, 0x347c2dca
440, 42, 42, 1, 230400, 0x1efa0aaa
450, 43, 43, 1, 230400, 0xa79a0b5a
460, 44, 44, 1, 230400, 0xfdb2dcdb
470, 45, 45, 1, 230400, 0x42dbea33
480, 46, 46, 1, 230400, 0x2a207e43
490, 47, 47, 1, 230400, 0x86573783
500, 48, 48, 1, 230400, 0xc3968473
510, 49, 49, 1, 230400, 0x8f62a7b4
520, 50, 50, 1, 230400, 0x5a2e3073
530, 51, 51, 1, 230400, 0xd24f5e2c
540, 52, 52, 1, 230400, 0x1df3c67d
550, 53, 53, 1, 230400, 0xe4fd884d
560, 57, 57, 1, 230400, 0x9a228555
570, 58, 58, 1, 230400, 0x9eba8ed5
580, 59, 59, 1, 230400, 0x3d808a3d
590, 60, 60, 1, 230400, 0xf57e866d
600, 61, 61, 1, 230400, 0x85f594f5
610, 62, 62, 1, 230400, 0xb09f99dd
620, 63, 63, 1, 230400, 0x2b368475
630, 64, 64, 1, 230400, 0xa2417afd
640, 65, 65, 1, 230400, 0x590b709d
650, 66, 66, 1, 230400, 0x5d617705
660, 67, 67, 1, 230400, 0xabf981ad
670, 68, 68, 1, 230400, 0x5a8590cd
680, 69, 69, 1, 230400, 0x1bff853d
690, 70, 70, 1, 230400, 0x71d08055
700, 71, 71, 1, 230400, 0x2ebd817d
710, 72, 72, 1, 230400, 0x6e838255
720, 73, 73, 1, 230400, 0x043984cd
730, 74, 74, 1, 230400, 0x7ff18495
740, 75, 75, 1, 230400, 0xa43b8385
750, 76, 76, 1, 230400, 0x72b5825d
760, 77, 77, 1, 230400, 0x3a178085
770, 78, 78, 1, 230400, 0x67748245
780, 79, 79, 1, 230400, 0xeddf81d5
790, 80, 80, 1, 230400, 0x8b088665
800, 81, 81, 1, 230400, 0x6c408e15
810, 82, 82, 1, 230400, 0x81f196dd
820, 83, 83, 1, 230400, 0xab9f953d
830, 84, 84, 1, 230400, 0xa5f69795
840, 85, 85, 1, 230400, 0xa772950d
850, 86, 86, 1, 230400, 0x6a5596d5
860, 87, 87, 1, 230400, 0x1355958d
870, 88, 88, 1, 230400, 0x4134981d
880, 89, 89, 1, 230400, 0x8b929515
890, 90, 90, 1, 230400, 0x482f95c5
900, 91, 91, 1, 230400, 0x7a9795d5
910, 92, 92, 1, 230400, 0x21c29abd
920, 93, 93, 1, 230400, 0x9ae6a475
930, 94, 94, 1, 230400, 0x3734aee5
940, 95, 95, 1, 230400, 0xa0a1b365
950, 96, 96, 1, 230400, 0x2dcab1c5
960, 97, 97, 1, 230400, 0x9c8b6c44
970, 98, 98, 1, 230400, 0x5da75feb
980, 99, 99, 1, 230400, 0x4d02f8e3
990, 100, 100, 1, 230400, 0x66824f3a
1000, 101, 101, 1, 230400, 0x0c9257e2
1010, 102, 102, 1, 230400, 0xb2927092
1020, 103, 103, 1, 230400, 0xb5dc6e9a
1030, 104, 104, 1, 230400, 0x6e567bc6
1040, 105, 105, 1, 230400, 0xbf9e0f7a
1050, 106, 106, 1, 230400, 0xb16f684a
1060, 107, 107, 1, 230400, 0xf9e55e81
1070, 108, 108, 1, 230400, 0xd8d0bcba
1080, 109, 109, 1, 230400, 0x44720ac0
1090, 110, 110, 1, 230400, 0x7d4c2058
1100, 113, 113, 1, 230400, 0xb0973eb9
1110, 114, 114, 1, 230400, 0x405a13ce
1120, 115, 115, 1, 230400, 0x6422f00a
1130, 116, 116, 1, 230400, 0x924b6c1e
1140, 145, 145, 1, 230400, 0xcf7809c0
1150, 146, 146, 1, 230400, 0x883a3863
1160, 147, 147, 1, 230400, 0x6adc9e03
1170, 148, 148, 1, 230400, 0x4f5ab7a8
1180, 214, 214, 1, 230400, 0xdc0aab94
tests/ref/fate/smacker-audio+87−0
@@ -0,0 +1,87 @@
1#tb 0: 1/22050
20, 0, 0, 23620, 47240, 0x9974897c
30, 23620, 23620, 1564, 3128, 0x7e4064b4
40, 25184, 25184, 1564, 3128, 0x80883301
50, 26748, 26748, 1568, 3136, 0x2ad2d341
60, 28316, 28316, 1564, 3128, 0xda8468e3
70, 29880, 29880, 1568, 3136, 0x9d6f6cdf
80, 31448, 31448, 1564, 3128, 0x1aaa64b5
90, 33012, 33012, 1564, 3128, 0x9182728b
100, 34576, 34576, 1568, 3136, 0xfa8e17b3
110, 36144, 36144, 1564, 3128, 0x0dc3c1cf
120, 37708, 37708, 1568, 3136, 0x0109639d
130, 39276, 39276, 1564, 3128, 0x6d8a12d9
140, 40840, 40840, 1564, 3128, 0x4b9a9597
150, 42404, 42404, 1568, 3136, 0x9112710e
160, 43972, 43972, 1564, 3128, 0x8cccf522
170, 45536, 45536, 1564, 3128, 0x6594bbf3
180, 47100, 47100, 1568, 3136, 0xd878a7d5
190, 48668, 48668, 1564, 3128, 0xaa6e3905
200, 50232, 50232, 1568, 3136, 0x2a062e04
210, 51800, 51800, 1564, 3128, 0x84e4006a
220, 53364, 53364, 1564, 3128, 0x85183633
230, 54928, 54928, 1568, 3136, 0xb62d4b02
240, 56496, 56496, 1564, 3128, 0xe209462a
250, 58060, 58060, 1568, 3136, 0x57c4824b
260, 59628, 59628, 1564, 3128, 0x664a9163
270, 61192, 61192, 1564, 3128, 0xb4287874
280, 62756, 62756, 1568, 3136, 0xde626885
290, 64324, 64324, 1564, 3128, 0x919763c2
300, 65888, 65888, 1564, 3128, 0xa4f664e1
310, 67452, 67452, 1568, 3136, 0xa0bab0d4
320, 69020, 69020, 1564, 3128, 0xe938939c
330, 70584, 70584, 1568, 3136, 0x3679bfc7
340, 72152, 72152, 1564, 3128, 0xc96c55c3
350, 73716, 73716, 1564, 3128, 0x119114d6
360, 75280, 75280, 1568, 3136, 0x42f3800f
370, 76848, 76848, 1564, 3128, 0x4250c4ad
380, 78412, 78412, 1568, 3136, 0x5cdd4925
390, 79980, 79980, 1564, 3128, 0xa4c12360
400, 81544, 81544, 1564, 3128, 0x849f48de
410, 83108, 83108, 1568, 3136, 0x6acd8ff9
420, 84676, 84676, 1564, 3128, 0xb2758556
430, 86240, 86240, 1564, 3128, 0x10f2fcb1
440, 87804, 87804, 1568, 3136, 0xf0f02b23
450, 89372, 89372, 1564, 3128, 0x64f759c6
460, 90936, 90936, 1568, 3136, 0x7ec075e3
470, 92504, 92504, 1564, 3128, 0xf981d51e
480, 94068, 94068, 1564, 3128, 0xc622e8b9
490, 95632, 95632, 1568, 3136, 0xf632e2f8
500, 97200, 97200, 1564, 3128, 0xda561864
510, 98764, 98764, 1568, 3136, 0x14d2e888
520, 100332, 100332, 1564, 3128, 0x015bb869
530, 101896, 101896, 1564, 3128, 0xedb1fb62
540, 103460, 103460, 1568, 3136, 0xe0560c41
550, 105028, 105028, 1564, 3128, 0x14773c9a
560, 106592, 106592, 1568, 3136, 0x850f1c82
570, 108160, 108160, 1564, 3128, 0xb0bd5347
580, 109724, 109724, 1564, 3128, 0x8f82edbf
590, 111288, 111288, 1568, 3136, 0x493abee2
600, 112856, 112856, 1564, 3128, 0xf5daff3f
610, 114420, 114420, 1564, 3128, 0x78ad2690
620, 115984, 115984, 1568, 3136, 0x490ebafc
630, 117552, 117552, 1564, 3128, 0x70333fd2
640, 119116, 119116, 1568, 3136, 0x8cb1c350
650, 120684, 120684, 1564, 3128, 0x8bd057cb
660, 122248, 122248, 1564, 3128, 0x161b3dbc
670, 123812, 123812, 1568, 3136, 0xb47fb88a
680, 125380, 125380, 1564, 3128, 0x474b381e
690, 126944, 126944, 1568, 3136, 0x07c519bb
700, 128512, 128512, 1564, 3128, 0x15b916c8
710, 130076, 130076, 1564, 3128, 0x0ed7f6fb
720, 131640, 131640, 1568, 3136, 0x54d6397b
730, 133208, 133208, 1564, 3128, 0x437242bb
740, 134772, 134772, 1564, 3128, 0x38f05c4d
750, 136336, 136336, 1568, 3136, 0x5d000e59
760, 137904, 137904, 1564, 3128, 0xdeab2d04
770, 139468, 139468, 1568, 3136, 0x77de6880
780, 141036, 141036, 1564, 3128, 0xbc87ef25
790, 142600, 142600, 1564, 3128, 0xc1638ade
800, 144164, 144164, 1568, 3136, 0xcfb64a5f
810, 145732, 145732, 1564, 3128, 0x90b1b826
820, 147296, 147296, 1568, 3136, 0x00000000
830, 148864, 148864, 1564, 3128, 0x00000000
840, 150428, 150428, 1564, 3128, 0x00000000
850, 151992, 151992, 1568, 3136, 0x00000000
860, 153560, 153560, 1564, 3128, 0x00000000
870, 155124, 155124, 1428, 2856, 0x00000000
tests/ref/fate/smacker-videorenamed from tests/ref/fate/smacker+0−87
@@ -1,7 +1,5 @@
1#tb 0: 71/10001#tb 0: 71/1000
2#tb 1: 1/22050
30, 0, 0, 1, 192000, 0x8926d7fc20, 0, 0, 1, 192000, 0x8926d7fc
41, 0, 0, 23620, 47240, 0x9974897c
50, 1, 1, 1, 192000, 0x2506d38430, 1, 1, 1, 192000, 0x2506d384
60, 2, 2, 1, 192000, 0x9a8dc93a40, 2, 2, 1, 192000, 0x9a8dc93a
70, 3, 3, 1, 192000, 0x4badb7f250, 3, 3, 1, 192000, 0x4badb7f2
@@ -17,172 +15,87 @@ · 9 unmodified lines
170, 13, 13, 1, 192000, 0x1a3d7971150, 13, 13, 1, 192000, 0x1a3d7971
180, 14, 14, 1, 192000, 0xa1a65bd5160, 14, 14, 1, 192000, 0xa1a65bd5
190, 15, 15, 1, 192000, 0x344957b9170, 15, 15, 1, 192000, 0x344957b9
201, 23620, 23620, 1564, 3128, 0x7e4064b4
210, 16, 16, 1, 192000, 0xe23b5f4e180, 16, 16, 1, 192000, 0xe23b5f4e
221, 25184, 25184, 1564, 3128, 0x80883301
230, 17, 17, 1, 192000, 0xb5c2710b190, 17, 17, 1, 192000, 0xb5c2710b
241, 26748, 26748, 1568, 3136, 0x2ad2d341
250, 18, 18, 1, 192000, 0x7a25938f200, 18, 18, 1, 192000, 0x7a25938f
261, 28316, 28316, 1564, 3128, 0xda8468e3
270, 19, 19, 1, 192000, 0x0a84e4c9210, 19, 19, 1, 192000, 0x0a84e4c9
281, 29880, 29880, 1568, 3136, 0x9d6f6cdf
290, 20, 20, 1, 192000, 0x94209b0d220, 20, 20, 1, 192000, 0x94209b0d
301, 31448, 31448, 1564, 3128, 0x1aaa64b5
310, 21, 21, 1, 192000, 0xf940e51f230, 21, 21, 1, 192000, 0xf940e51f
321, 33012, 33012, 1564, 3128, 0x9182728b
330, 22, 22, 1, 192000, 0xb9fdec42240, 22, 22, 1, 192000, 0xb9fdec42
341, 34576, 34576, 1568, 3136, 0xfa8e17b3
350, 23, 23, 1, 192000, 0x7b04a376250, 23, 23, 1, 192000, 0x7b04a376
361, 36144, 36144, 1564, 3128, 0x0dc3c1cf
370, 24, 24, 1, 192000, 0x5fe0026b260, 24, 24, 1, 192000, 0x5fe0026b
381, 37708, 37708, 1568, 3136, 0x0109639d
390, 25, 25, 1, 192000, 0x775aca39270, 25, 25, 1, 192000, 0x775aca39
401, 39276, 39276, 1564, 3128, 0x6d8a12d9
410, 26, 26, 1, 192000, 0xae14fb32280, 26, 26, 1, 192000, 0xae14fb32
421, 40840, 40840, 1564, 3128, 0x4b9a9597
430, 27, 27, 1, 192000, 0x661106e5290, 27, 27, 1, 192000, 0x661106e5
441, 42404, 42404, 1568, 3136, 0x9112710e
450, 28, 28, 1, 192000, 0xe8658dbf300, 28, 28, 1, 192000, 0xe8658dbf
461, 43972, 43972, 1564, 3128, 0x8cccf522
470, 29, 29, 1, 192000, 0x5359f0f9310, 29, 29, 1, 192000, 0x5359f0f9
481, 45536, 45536, 1564, 3128, 0x6594bbf3
490, 30, 30, 1, 192000, 0xc1ec80f4320, 30, 30, 1, 192000, 0xc1ec80f4
501, 47100, 47100, 1568, 3136, 0xd878a7d5
510, 31, 31, 1, 192000, 0xca53806b330, 31, 31, 1, 192000, 0xca53806b
521, 48668, 48668, 1564, 3128, 0xaa6e3905
530, 32, 32, 1, 192000, 0xf0766b2e340, 32, 32, 1, 192000, 0xf0766b2e
541, 50232, 50232, 1568, 3136, 0x2a062e04
550, 33, 33, 1, 192000, 0x39962da8350, 33, 33, 1, 192000, 0x39962da8
561, 51800, 51800, 1564, 3128, 0x84e4006a
570, 34, 34, 1, 192000, 0x4171c37f360, 34, 34, 1, 192000, 0x4171c37f
581, 53364, 53364, 1564, 3128, 0x85183633
590, 35, 35, 1, 192000, 0x3abf3b46370, 35, 35, 1, 192000, 0x3abf3b46
601, 54928, 54928, 1568, 3136, 0xb62d4b02
610, 36, 36, 1, 192000, 0xecc68313380, 36, 36, 1, 192000, 0xecc68313
621, 56496, 56496, 1564, 3128, 0xe209462a
630, 37, 37, 1, 192000, 0xea339baf390, 37, 37, 1, 192000, 0xea339baf
641, 58060, 58060, 1568, 3136, 0x57c4824b
650, 38, 38, 1, 192000, 0x616b8f16400, 38, 38, 1, 192000, 0x616b8f16
661, 59628, 59628, 1564, 3128, 0x664a9163
670, 39, 39, 1, 192000, 0xf77a8581410, 39, 39, 1, 192000, 0xf77a8581
681, 61192, 61192, 1564, 3128, 0xb4287874
690, 40, 40, 1, 192000, 0xb315678b420, 40, 40, 1, 192000, 0xb315678b
701, 62756, 62756, 1568, 3136, 0xde626885
710, 41, 41, 1, 192000, 0x0a4a5218430, 41, 41, 1, 192000, 0x0a4a5218
721, 64324, 64324, 1564, 3128, 0x919763c2
730, 42, 42, 1, 192000, 0x98802be4440, 42, 42, 1, 192000, 0x98802be4
741, 65888, 65888, 1564, 3128, 0xa4f664e1
750, 43, 43, 1, 192000, 0xa2f0fd94450, 43, 43, 1, 192000, 0xa2f0fd94
761, 67452, 67452, 1568, 3136, 0xa0bab0d4
770, 44, 44, 1, 192000, 0x6671c84f460, 44, 44, 1, 192000, 0x6671c84f
781, 69020, 69020, 1564, 3128, 0xe938939c
790, 45, 45, 1, 192000, 0x38327e31470, 45, 45, 1, 192000, 0x38327e31
801, 70584, 70584, 1568, 3136, 0x3679bfc7
810, 46, 46, 1, 192000, 0xb85d3e08480, 46, 46, 1, 192000, 0xb85d3e08
821, 72152, 72152, 1564, 3128, 0xc96c55c3
830, 47, 47, 1, 192000, 0xdc69eba9490, 47, 47, 1, 192000, 0xdc69eba9
841, 73716, 73716, 1564, 3128, 0x119114d6
850, 48, 48, 1, 192000, 0x8955a0b3500, 48, 48, 1, 192000, 0x8955a0b3
861, 75280, 75280, 1568, 3136, 0x42f3800f
870, 49, 49, 1, 192000, 0x714a548b510, 49, 49, 1, 192000, 0x714a548b
881, 76848, 76848, 1564, 3128, 0x4250c4ad
890, 50, 50, 1, 192000, 0xc0471de9520, 50, 50, 1, 192000, 0xc0471de9
901, 78412, 78412, 1568, 3136, 0x5cdd4925
910, 51, 51, 1, 192000, 0x2e16e039530, 51, 51, 1, 192000, 0x2e16e039
921, 79980, 79980, 1564, 3128, 0xa4c12360
930, 52, 52, 1, 192000, 0x9fa4b033540, 52, 52, 1, 192000, 0x9fa4b033
941, 81544, 81544, 1564, 3128, 0x849f48de
950, 53, 53, 1, 192000, 0x4a0f9402550, 53, 53, 1, 192000, 0x4a0f9402
961, 83108, 83108, 1568, 3136, 0x6acd8ff9
970, 54, 54, 1, 192000, 0x1f3e6843560, 54, 54, 1, 192000, 0x1f3e6843
981, 84676, 84676, 1564, 3128, 0xb2758556
990, 55, 55, 1, 192000, 0x31774850570, 55, 55, 1, 192000, 0x31774850
1001, 86240, 86240, 1564, 3128, 0x10f2fcb1
1010, 56, 56, 1, 192000, 0x9d5336a2580, 56, 56, 1, 192000, 0x9d5336a2
1021, 87804, 87804, 1568, 3136, 0xf0f02b23
1030, 57, 57, 1, 192000, 0xf7de27a2590, 57, 57, 1, 192000, 0xf7de27a2
1041, 89372, 89372, 1564, 3128, 0x64f759c6
1050, 58, 58, 1, 192000, 0x98c717ce600, 58, 58, 1, 192000, 0x98c717ce
1061, 90936, 90936, 1568, 3136, 0x7ec075e3
1070, 59, 59, 1, 192000, 0x615b10b8610, 59, 59, 1, 192000, 0x615b10b8
1081, 92504, 92504, 1564, 3128, 0xf981d51e
1090, 60, 60, 1, 192000, 0xd5bc0e7e620, 60, 60, 1, 192000, 0xd5bc0e7e
1101, 94068, 94068, 1564, 3128, 0xc622e8b9
1110, 61, 61, 1, 192000, 0xd5bc0e7e630, 61, 61, 1, 192000, 0xd5bc0e7e
1121, 95632, 95632, 1568, 3136, 0xf632e2f8
1130, 62, 62, 1, 192000, 0xd5bc0e7e640, 62, 62, 1, 192000, 0xd5bc0e7e
1141, 97200, 97200, 1564, 3128, 0xda561864
1150, 63, 63, 1, 192000, 0xd5bc0e7e650, 63, 63, 1, 192000, 0xd5bc0e7e
1161, 98764, 98764, 1568, 3136, 0x14d2e888
1170, 64, 64, 1, 192000, 0xd5bc0e7e660, 64, 64, 1, 192000, 0xd5bc0e7e
1181, 100332, 100332, 1564, 3128, 0x015bb869
1190, 65, 65, 1, 192000, 0xd5bc0e7e670, 65, 65, 1, 192000, 0xd5bc0e7e
1201, 101896, 101896, 1564, 3128, 0xedb1fb62
1210, 66, 66, 1, 192000, 0xd5bc0e7e680, 66, 66, 1, 192000, 0xd5bc0e7e
1221, 103460, 103460, 1568, 3136, 0xe0560c41
1230, 67, 67, 1, 192000, 0xd5bc0e7e690, 67, 67, 1, 192000, 0xd5bc0e7e
1241, 105028, 105028, 1564, 3128, 0x14773c9a
1250, 68, 68, 1, 192000, 0xd5bc0e7e700, 68, 68, 1, 192000, 0xd5bc0e7e
1261, 106592, 106592, 1568, 3136, 0x850f1c82
1270, 69, 69, 1, 192000, 0xd5bc0e7e710, 69, 69, 1, 192000, 0xd5bc0e7e
1281, 108160, 108160, 1564, 3128, 0xb0bd5347
1290, 70, 70, 1, 192000, 0xd5bc0e7e720, 70, 70, 1, 192000, 0xd5bc0e7e
1301, 109724, 109724, 1564, 3128, 0x8f82edbf
1310, 71, 71, 1, 192000, 0xd5bc0e7e730, 71, 71, 1, 192000, 0xd5bc0e7e
1321, 111288, 111288, 1568, 3136, 0x493abee2
1330, 72, 72, 1, 192000, 0xd5bc0e7e740, 72, 72, 1, 192000, 0xd5bc0e7e
1341, 112856, 112856, 1564, 3128, 0xf5daff3f
1350, 73, 73, 1, 192000, 0xd5bc0e7e750, 73, 73, 1, 192000, 0xd5bc0e7e
1361, 114420, 114420, 1564, 3128, 0x78ad2690
1370, 74, 74, 1, 192000, 0xd5bc0e7e760, 74, 74, 1, 192000, 0xd5bc0e7e
1381, 115984, 115984, 1568, 3136, 0x490ebafc
1390, 75, 75, 1, 192000, 0xd5bc0e7e770, 75, 75, 1, 192000, 0xd5bc0e7e
1401, 117552, 117552, 1564, 3128, 0x70333fd2
1410, 76, 76, 1, 192000, 0xd5bc0e7e780, 76, 76, 1, 192000, 0xd5bc0e7e
1421, 119116, 119116, 1568, 3136, 0x8cb1c350
1430, 77, 77, 1, 192000, 0xd5bc0e7e790, 77, 77, 1, 192000, 0xd5bc0e7e
1441, 120684, 120684, 1564, 3128, 0x8bd057cb
1450, 78, 78, 1, 192000, 0xd5bc0e7e800, 78, 78, 1, 192000, 0xd5bc0e7e
1461, 122248, 122248, 1564, 3128, 0x161b3dbc
1470, 79, 79, 1, 192000, 0xd5bc0e7e810, 79, 79, 1, 192000, 0xd5bc0e7e
1481, 123812, 123812, 1568, 3136, 0xb47fb88a
1490, 80, 80, 1, 192000, 0xd5bc0e7e820, 80, 80, 1, 192000, 0xd5bc0e7e
1501, 125380, 125380, 1564, 3128, 0x474b381e
1510, 81, 81, 1, 192000, 0xd5bc0e7e830, 81, 81, 1, 192000, 0xd5bc0e7e
1521, 126944, 126944, 1568, 3136, 0x07c519bb
1530, 82, 82, 1, 192000, 0xd5bc0e7e840, 82, 82, 1, 192000, 0xd5bc0e7e
1541, 128512, 128512, 1564, 3128, 0x15b916c8
1550, 83, 83, 1, 192000, 0xd5bc0e7e850, 83, 83, 1, 192000, 0xd5bc0e7e
1561, 130076, 130076, 1564, 3128, 0x0ed7f6fb
1570, 84, 84, 1, 192000, 0xd5bc0e7e860, 84, 84, 1, 192000, 0xd5bc0e7e
1581, 131640, 131640, 1568, 3136, 0x54d6397b
1590, 85, 85, 1, 192000, 0xd5bc0e7e870, 85, 85, 1, 192000, 0xd5bc0e7e
1601, 133208, 133208, 1564, 3128, 0x437242bb
1610, 86, 86, 1, 192000, 0xd5bc0e7e880, 86, 86, 1, 192000, 0xd5bc0e7e
1621, 134772, 134772, 1564, 3128, 0x38f05c4d
1630, 87, 87, 1, 192000, 0xd5bc0e7e890, 87, 87, 1, 192000, 0xd5bc0e7e
1641, 136336, 136336, 1568, 3136, 0x5d000e59
1650, 88, 88, 1, 192000, 0xd5bc0e7e900, 88, 88, 1, 192000, 0xd5bc0e7e
1661, 137904, 137904, 1564, 3128, 0xdeab2d04
1670, 89, 89, 1, 192000, 0xd5bc0e7e910, 89, 89, 1, 192000, 0xd5bc0e7e
1681, 139468, 139468, 1568, 3136, 0x77de6880
1690, 90, 90, 1, 192000, 0xd5bc0e7e920, 90, 90, 1, 192000, 0xd5bc0e7e
1701, 141036, 141036, 1564, 3128, 0xbc87ef25
1710, 91, 91, 1, 192000, 0xd5bc0e7e930, 91, 91, 1, 192000, 0xd5bc0e7e
1721, 142600, 142600, 1564, 3128, 0xc1638ade
1730, 92, 92, 1, 192000, 0xd5bc0e7e940, 92, 92, 1, 192000, 0xd5bc0e7e
1741, 144164, 144164, 1568, 3136, 0xcfb64a5f
1750, 93, 93, 1, 192000, 0xd5bc0e7e950, 93, 93, 1, 192000, 0xd5bc0e7e
1761, 145732, 145732, 1564, 3128, 0x90b1b826
1770, 94, 94, 1, 192000, 0xd5bc0e7e960, 94, 94, 1, 192000, 0xd5bc0e7e
1781, 147296, 147296, 1568, 3136, 0x00000000
1790, 95, 95, 1, 192000, 0xd5bc0e7e970, 95, 95, 1, 192000, 0xd5bc0e7e
1801, 148864, 148864, 1564, 3128, 0x00000000
1810, 96, 96, 1, 192000, 0xd5bc0e7e980, 96, 96, 1, 192000, 0xd5bc0e7e
1821, 150428, 150428, 1564, 3128, 0x00000000
1830, 97, 97, 1, 192000, 0xd5bc0e7e990, 97, 97, 1, 192000, 0xd5bc0e7e
1841, 151992, 151992, 1568, 3136, 0x00000000
1850, 98, 98, 1, 192000, 0xd5bc0e7e1000, 98, 98, 1, 192000, 0xd5bc0e7e
1861, 153560, 153560, 1564, 3128, 0x00000000
1870, 99, 99, 1, 192000, 0xd5bc0e7e1010, 99, 99, 1, 192000, 0xd5bc0e7e
1881, 155124, 155124, 1428, 2856, 0x00000000
tests/ref/fate/smjpeg+0−425
@@ -1,425 +0,0 @@
1#tb 0: 1/1000
2#tb 1: 1/22050
30, 0, 0, 0, 734, 0x5a042c2c
41, 0, 0, 512, 1024, 0x00000000
51, 507, 507, 512, 1024, 0x00000000
61, 1014, 1014, 512, 1024, 0xd89a448e
71, 1521, 1521, 512, 1024, 0x695b369c
81, 2029, 2029, 512, 1024, 0xc8ba5707
90, 111, 111, 0, 763, 0xb5893f2f
101, 2558, 2558, 512, 1024, 0xdf241fc6
111, 3065, 3065, 512, 1024, 0x61cf4166
121, 3572, 3572, 512, 1024, 0x97cbc386
131, 4079, 4079, 512, 1024, 0x44899d04
141, 4586, 4586, 512, 1024, 0xa7cbaa62
150, 222, 222, 0, 3023, 0x0f3907d3
161, 5116, 5116, 512, 1024, 0xa7aea60c
171, 5623, 5623, 512, 1024, 0xd7b18a89
181, 6130, 6130, 512, 1024, 0x268e81f6
191, 6637, 6637, 512, 1024, 0x9cf83a2f
201, 7166, 7166, 512, 1024, 0x5559b508
210, 333, 333, 0, 4800, 0x22e6e18a
221, 7673, 7673, 512, 1024, 0xe1b9e71c
231, 8181, 8181, 512, 1024, 0xdcee733e
241, 8688, 8688, 512, 1024, 0xe5918f60
251, 9195, 9195, 512, 1024, 0x29dbd209
261, 9724, 9724, 512, 1024, 0x9bcbcf16
270, 444, 444, 0, 6417, 0x427adde5
281, 10231, 10231, 512, 1024, 0x86f5f458
291, 10738, 10738, 512, 1024, 0xabcbda86
301, 11246, 11246, 512, 1024, 0xc51f77b9
311, 11775, 11775, 512, 1024, 0xf6b3a504
320, 555, 555, 0, 6776, 0x7a74c6ad
331, 12282, 12282, 512, 1024, 0x1af3e40e
341, 12789, 12789, 512, 1024, 0x3866b03b
351, 13296, 13296, 512, 1024, 0xbc005403
361, 13803, 13803, 512, 1024, 0xe9dfcc51
371, 14332, 14332, 512, 1024, 0x83c837cb
380, 666, 666, 0, 6808, 0x1f6eb7c3
391, 14840, 14840, 512, 1024, 0xfa649580
401, 15347, 15347, 512, 1024, 0x519452ea
411, 15854, 15854, 512, 1024, 0xd4978774
421, 16383, 16383, 512, 1024, 0xe2a3b1cd
431, 16890, 16890, 512, 1024, 0x9a9472ad
440, 777, 777, 0, 6726, 0x452087e6
451, 17397, 17397, 512, 1024, 0xa12d4060
461, 17905, 17905, 512, 1024, 0x31fb0646
471, 18412, 18412, 512, 1024, 0xfc44343f
481, 18941, 18941, 512, 1024, 0x0847751a
491, 19448, 19448, 512, 1024, 0x227968a2
500, 888, 888, 0, 6829, 0xee82b109
511, 19955, 19955, 512, 1024, 0x7cce9f1c
521, 20462, 20462, 512, 1024, 0xb8356713
531, 20992, 20992, 512, 1024, 0xb29f6e6f
541, 21499, 21499, 512, 1024, 0x9e1430ab
551, 22006, 22006, 512, 1024, 0x26d85423
560, 999, 999, 0, 7055, 0xf41f1108
571, 22513, 22513, 512, 1024, 0x6496547d
581, 23020, 23020, 512, 1024, 0x316b1a86
591, 23549, 23549, 512, 1024, 0x3cd83afc
601, 24057, 24057, 512, 1024, 0x993ff633
610, 1111, 1111, 0, 6977, 0xf8fe1ede
621, 24564, 24564, 512, 1024, 0x0708d1a2
631, 25071, 25071, 512, 1024, 0xd7230db9
641, 25578, 25578, 512, 1024, 0xbb0779ca
651, 26107, 26107, 512, 1024, 0xc6094e1b
661, 26614, 26614, 512, 1024, 0x15a8b039
670, 1222, 1222, 0, 6942, 0x9ad105c6
681, 27122, 27122, 512, 1024, 0xd6dbe88c
691, 27629, 27629, 512, 1024, 0x7e8d1140
701, 28158, 28158, 512, 1024, 0xef88e525
711, 28665, 28665, 512, 1024, 0x44e21149
721, 29172, 29172, 512, 1024, 0x65b0f5f4
730, 1333, 1333, 0, 6926, 0xe239dad6
741, 29679, 29679, 512, 1024, 0xb955f687
751, 30186, 30186, 512, 1024, 0xc85fba9c
761, 30716, 30716, 512, 1024, 0xf59655ad
771, 31223, 31223, 512, 1024, 0x6de80bf1
781, 31730, 31730, 512, 1024, 0x2dcf6e41
790, 1444, 1444, 0, 6966, 0x81dcfab1
801, 32237, 32237, 512, 1024, 0xd0ddcf8a
811, 32766, 32766, 512, 1024, 0x00135c2d
821, 33273, 33273, 512, 1024, 0x697f8efd
831, 33781, 33781, 512, 1024, 0x7a9bada5
840, 1555, 1555, 0, 6896, 0x31e6cc02
851, 34288, 34288, 512, 1024, 0x0d22783c
861, 34795, 34795, 512, 1024, 0x7726d07d
871, 35324, 35324, 512, 1024, 0xa2f14f67
881, 35831, 35831, 512, 1024, 0x7f51060d
891, 36338, 36338, 512, 1024, 0xc4ec6aea
900, 1666, 1666, 0, 6889, 0x1cc1006e
911, 36846, 36846, 512, 1024, 0x9bb37ca4
921, 37375, 37375, 512, 1024, 0x9b085577
931, 37882, 37882, 512, 1024, 0x8812f8af
941, 38389, 38389, 512, 1024, 0x788f5221
951, 38896, 38896, 512, 1024, 0x3a2ce642
960, 1777, 1777, 0, 6933, 0xc303f87f
971, 39403, 39403, 512, 1024, 0x72415692
981, 39933, 39933, 512, 1024, 0xe3dcc105
991, 40440, 40440, 512, 1024, 0xb26c0599
1001, 40947, 40947, 512, 1024, 0x5c9e55eb
1011, 41454, 41454, 512, 1024, 0x8fe88707
1020, 1888, 1888, 0, 7034, 0xb4970a20
1031, 41983, 41983, 512, 1024, 0xc5d7beb6
1041, 42490, 42490, 512, 1024, 0xe1d3a3b4
1051, 42998, 42998, 512, 1024, 0x012da0c6
1061, 43505, 43505, 512, 1024, 0x8d010922
1071, 44012, 44012, 512, 1024, 0x3366eb0d
1080, 1999, 1999, 0, 6961, 0xf064095d
1091, 44541, 44541, 512, 1024, 0xc9381a27
1101, 45048, 45048, 512, 1024, 0x0774f685
1111, 45555, 45555, 512, 1024, 0xc5cae0a5
1121, 46062, 46062, 512, 1024, 0xa6f4737c
1130, 2111, 2111, 0, 7089, 0x5ba350f9
1141, 46592, 46592, 512, 1024, 0x8fb6d0d1
1151, 47099, 47099, 512, 1024, 0x05f579c2
1161, 47606, 47606, 512, 1024, 0x56905d99
1171, 48113, 48113, 512, 1024, 0x002ee18d
1181, 48620, 48620, 512, 1024, 0xeb37ef51
1190, 2222, 2222, 0, 7078, 0xa83f3e88
1201, 49149, 49149, 512, 1024, 0x38025635
1211, 49657, 49657, 512, 1024, 0x4fe643c8
1221, 50164, 50164, 512, 1024, 0x11d66ab1
1231, 50671, 50671, 512, 1024, 0xcc3051e9
1241, 51178, 51178, 512, 1024, 0xcd93e854
1250, 2333, 2333, 0, 7147, 0xcda66cfc
1261, 51707, 51707, 512, 1024, 0x38f1196d
1271, 52214, 52214, 512, 1024, 0x657a15fc
1281, 52722, 52722, 512, 1024, 0x669ce2a9
1291, 53229, 53229, 512, 1024, 0x95862dda
1301, 53758, 53758, 512, 1024, 0x1726a7b2
1310, 2444, 2444, 0, 7173, 0xb7455859
1321, 54265, 54265, 512, 1024, 0xd6ece2a1
1331, 54772, 54772, 512, 1024, 0x33ab9553
1341, 55279, 55279, 512, 1024, 0xd50c73a6
1351, 55786, 55786, 512, 1024, 0xfe25b63a
1361, 56316, 56316, 512, 1024, 0x7e2959e3
1370, 2555, 2555, 0, 7213, 0x97b89994
1381, 56823, 56823, 512, 1024, 0xa4c07b34
1391, 57330, 57330, 512, 1024, 0xd6d8f15c
1401, 57837, 57837, 512, 1024, 0x1eccddd7
1411, 58366, 58366, 512, 1024, 0x2b69f9cb
1420, 2666, 2666, 0, 7170, 0xca8b2948
1431, 58874, 58874, 512, 1024, 0x667b775f
1441, 59381, 59381, 512, 1024, 0xad3b84e9
1451, 59888, 59888, 512, 1024, 0x4f29fc67
1461, 60395, 60395, 512, 1024, 0x8d611ab7
1471, 60924, 60924, 512, 1024, 0x278966ea
1480, 2777, 2777, 0, 7174, 0xc7cc6bbb
1491, 61431, 61431, 512, 1024, 0xaf33812b
1501, 61938, 61938, 512, 1024, 0xa55f4265
1511, 62446, 62446, 512, 1024, 0x023cb51c
1521, 62975, 62975, 512, 1024, 0x1d1f1005
1531, 63482, 63482, 512, 1024, 0x874cccf7
1540, 2888, 2888, 0, 7235, 0xc2e68d2b
1551, 63989, 63989, 512, 1024, 0xda705428
1561, 64496, 64496, 512, 1024, 0x48d9b440
1571, 65003, 65003, 512, 1024, 0xa14e0712
1581, 65533, 65533, 512, 1024, 0x7efbad1f
1591, 66040, 66040, 512, 1024, 0xdb82c17f
1600, 3000, 3000, 0, 7261, 0x8204a423
1611, 66547, 66547, 512, 1024, 0xcbe87613
1621, 67054, 67054, 512, 1024, 0x3a63df1d
1631, 67583, 67583, 512, 1024, 0xd5636bba
1641, 68090, 68090, 512, 1024, 0x9397af23
1650, 3111, 3111, 0, 7353, 0xacc7e7c0
1661, 68598, 68598, 512, 1024, 0x32a07c98
1671, 69105, 69105, 512, 1024, 0x202ca667
1681, 69612, 69612, 512, 1024, 0xdf969011
1691, 70141, 70141, 512, 1024, 0xc434d238
1701, 70648, 70648, 512, 1024, 0xe9ad7562
1710, 3222, 3222, 0, 7065, 0x45035c5c
1721, 71155, 71155, 512, 1024, 0xb51b6b50
1731, 71662, 71662, 512, 1024, 0xe70aecd3
1741, 72192, 72192, 512, 1024, 0x03c816b2
1751, 72699, 72699, 512, 1024, 0x869fdf25
1761, 73206, 73206, 512, 1024, 0xd40a0a62
1770, 3333, 3333, 0, 7269, 0x72edbb76
1781, 73713, 73713, 512, 1024, 0x5af7dd35
1791, 74220, 74220, 512, 1024, 0x891ffc72
1801, 74750, 74750, 512, 1024, 0x1ff68a08
1811, 75257, 75257, 512, 1024, 0x5a7517a9
1821, 75764, 75764, 512, 1024, 0x0f959f74
1830, 3444, 3444, 0, 7220, 0xb926772f
1841, 76271, 76271, 512, 1024, 0xe92a12a2
1851, 76778, 76778, 512, 1024, 0x38000e55
1861, 77307, 77307, 512, 1024, 0x39fbdd70
1871, 77814, 77814, 512, 1024, 0xca3d9184
1881, 78322, 78322, 512, 1024, 0x66c8995b
1890, 3555, 3555, 0, 7326, 0x0a66c632
1901, 78829, 78829, 512, 1024, 0xac25acea
1911, 79358, 79358, 512, 1024, 0x3cd1046c
1921, 79865, 79865, 512, 1024, 0x6a1df31c
1931, 80372, 80372, 512, 1024, 0x21ca10a1
1940, 3666, 3666, 0, 7225, 0xe39076ab
1951, 80879, 80879, 512, 1024, 0x1aeccedc
1961, 81387, 81387, 512, 1024, 0xddea1335
1971, 81916, 81916, 512, 1024, 0x19f5ca9f
1981, 82423, 82423, 512, 1024, 0x88e95e43
1991, 82930, 82930, 512, 1024, 0x726284fe
2000, 3777, 3777, 0, 7265, 0xe0209036
2011, 83437, 83437, 512, 1024, 0x6b85b40e
2021, 83966, 83966, 512, 1024, 0x111fee2a
2031, 84474, 84474, 512, 1024, 0x3656b588
2041, 84981, 84981, 512, 1024, 0xa5a2b552
2051, 85488, 85488, 512, 1024, 0x38fb2467
2060, 3888, 3888, 0, 7337, 0x7a5dc093
2071, 85995, 85995, 512, 1024, 0xaa919ccc
2081, 86524, 86524, 512, 1024, 0x15993dbc
2091, 87031, 87031, 512, 1024, 0xbe01a7b9
2101, 87538, 87538, 512, 1024, 0xefe93c09
2111, 88046, 88046, 512, 1024, 0x1bb566e5
2120, 4000, 4000, 0, 7246, 0x519a7a3c
2131, 88575, 88575, 512, 1024, 0x15ce6237
2141, 89082, 89082, 512, 1024, 0xa8552e66
2151, 89589, 89589, 512, 1024, 0x9d80187e
2161, 90096, 90096, 512, 1024, 0x5df3fc30
2171, 90603, 90603, 512, 1024, 0x1a312aa5
2180, 4111, 4111, 0, 7266, 0x352c8078
2191, 91133, 91133, 512, 1024, 0x6bb8e302
2201, 91640, 91640, 512, 1024, 0xbd9684bb
2211, 92147, 92147, 512, 1024, 0x78b0b166
2221, 92654, 92654, 512, 1024, 0xd9af5eae
2230, 4222, 4222, 0, 7323, 0xcaf69d7c
2241, 93183, 93183, 512, 1024, 0xdb90fe82
2251, 93690, 93690, 512, 1024, 0x327614e9
2261, 94198, 94198, 512, 1024, 0x1f19b7fe
2271, 94705, 94705, 512, 1024, 0x46c53f96
2281, 95212, 95212, 512, 1024, 0x921b2189
2290, 4333, 4333, 0, 7309, 0x98c1e6f7
2301, 95741, 95741, 512, 1024, 0xa8fbc85a
2311, 96248, 96248, 512, 1024, 0xabfdaaae
2321, 96755, 96755, 512, 1024, 0x6acc7387
2331, 97263, 97263, 512, 1024, 0x0d9c27b5
2341, 97792, 97792, 512, 1024, 0xba4dd809
2350, 4444, 4444, 0, 7121, 0x913d5bd6
2361, 98299, 98299, 512, 1024, 0x2a2ad521
2371, 98806, 98806, 512, 1024, 0x892de38a
2381, 99313, 99313, 512, 1024, 0xdc97a2eb
2391, 99820, 99820, 512, 1024, 0x4f614ca4
2401, 100350, 100350, 512, 1024, 0x9c8a77ea
2410, 4555, 4555, 111, 7088, 0x56302362
2421, 100857, 100857, 512, 1024, 0x2d30e646
2431, 101364, 101364, 512, 1024, 0x74e800a7
2441, 101871, 101871, 512, 1024, 0x1e01fb02
2451, 102378, 102378, 512, 1024, 0x4ed2c1d8
2460, 4666, 4666, 111, 7104, 0xc0d14f78
2471, 102907, 102907, 512, 1024, 0xf2fdbe63
2481, 103414, 103414, 512, 1024, 0x8d6f63a1
2491, 103922, 103922, 512, 1024, 0xded468d9
2501, 104429, 104429, 512, 1024, 0xccad839e
2511, 104958, 104958, 512, 1024, 0xdde7c082
2520, 4777, 4777, 111, 7169, 0xd03c825b
2531, 105465, 105465, 512, 1024, 0x548613c5
2541, 105972, 105972, 512, 1024, 0x383909bd
2551, 106479, 106479, 512, 1024, 0xfd37627b
2561, 106987, 106987, 512, 1024, 0x6d95a481
2571, 107516, 107516, 512, 1024, 0x56aa87fa
2580, 4888, 4888, 111, 7038, 0x1ecc201d
2591, 108023, 108023, 512, 1024, 0x7b67258c
2601, 108530, 108530, 512, 1024, 0x7dd99a92
2611, 109037, 109037, 512, 1024, 0x4a66d102
2621, 109566, 109566, 512, 1024, 0x7b3fce51
2631, 110074, 110074, 512, 1024, 0xbbd968aa
2640, 5000, 5000, 111, 7015, 0x83c94454
2651, 110581, 110581, 512, 1024, 0x8283ec36
2661, 111088, 111088, 512, 1024, 0x3c96493d
2671, 111595, 111595, 512, 1024, 0xfa4f8cf8
2681, 112124, 112124, 512, 1024, 0xe2cf872d
2691, 112631, 112631, 512, 1024, 0x0a9e7aa6
2700, 5111, 5111, 111, 6983, 0x9e51f54d
2711, 113139, 113139, 512, 1024, 0x6e7a0550
2721, 113646, 113646, 512, 1024, 0x3acfea2f
2731, 114175, 114175, 512, 1024, 0x7111d0fa
2741, 114682, 114682, 512, 1024, 0xe9a1eca9
2750, 5222, 5222, 111, 7088, 0x70d33de1
2761, 115189, 115189, 512, 1024, 0x24da6c46
2771, 115696, 115696, 512, 1024, 0x117cff37
2781, 116204, 116204, 512, 1024, 0x0f27cab6
2791, 116733, 116733, 512, 1024, 0x69b6b4e6
2801, 117240, 117240, 512, 1024, 0x1e6cc841
2810, 5333, 5333, 111, 7096, 0x4d0f81b5
2821, 117747, 117747, 512, 1024, 0xb01e2365
2831, 118254, 118254, 512, 1024, 0x14e200d3
2841, 118783, 118783, 512, 1024, 0xd1184c98
2851, 119290, 119290, 512, 1024, 0xef9140e9
2861, 119798, 119798, 512, 1024, 0x4cbb645e
2870, 5444, 5444, 111, 7106, 0xd1a83ddc
2881, 120305, 120305, 512, 1024, 0xe7fe2f06
2891, 120812, 120812, 512, 1024, 0xf8c45028
2901, 121341, 121341, 512, 1024, 0x561358f4
2911, 121848, 121848, 512, 1024, 0xd0129b77
2921, 122355, 122355, 512, 1024, 0xcc636e88
2930, 5555, 5555, 111, 7219, 0x20f47fe4
2941, 122863, 122863, 512, 1024, 0xe9406321
2951, 123392, 123392, 512, 1024, 0x9f16a041
2961, 123899, 123899, 512, 1024, 0x468bf409
2971, 124406, 124406, 512, 1024, 0x3df70f7b
2981, 124913, 124913, 512, 1024, 0xa880b11b
2990, 5666, 5666, 111, 7184, 0x45dc6a0e
3001, 125420, 125420, 512, 1024, 0x3286c489
3011, 125950, 125950, 512, 1024, 0x39fe9ebc
3021, 126457, 126457, 512, 1024, 0xc533d83b
3031, 126964, 126964, 512, 1024, 0x153b195d
3040, 5777, 5777, 111, 7222, 0x488c6499
3051, 127471, 127471, 512, 1024, 0xd84786a1
3061, 127978, 127978, 512, 1024, 0xdc295aaa
3071, 128507, 128507, 512, 1024, 0xfb764d8c
3081, 129015, 129015, 512, 1024, 0xeebc9db9
3091, 129522, 129522, 512, 1024, 0x7ba9403e
3100, 5888, 5888, 111, 7254, 0xbd097ba7
3111, 130029, 130029, 512, 1024, 0x4e5571ec
3121, 130558, 130558, 512, 1024, 0xd965fad4
3131, 131065, 131065, 512, 1024, 0x87e259f2
3141, 131572, 131572, 512, 1024, 0xae7e533b
3151, 132080, 132080, 512, 1024, 0x313cf4d6
3160, 6000, 6000, 111, 7189, 0x46e06d43
3171, 132587, 132587, 512, 1024, 0xe1844c90
3181, 133116, 133116, 512, 1024, 0xbb057b44
3191, 133623, 133623, 512, 1024, 0xa5099687
3201, 134130, 134130, 512, 1024, 0xbff10707
3211, 134637, 134637, 512, 1024, 0x37c4ffc0
3220, 6111, 6111, 111, 7283, 0x19dd7319
3231, 135166, 135166, 512, 1024, 0xf9fb6caa
3241, 135674, 135674, 512, 1024, 0x3b6a3a1f
3251, 136181, 136181, 512, 1024, 0x83431edb
3261, 136688, 136688, 512, 1024, 0x1eb713cf
3271, 137195, 137195, 512, 1024, 0xd7b07a6d
3280, 6222, 6222, 111, 7161, 0x23171d02
3291, 137724, 137724, 512, 1024, 0x81ae3391
3301, 138231, 138231, 512, 1024, 0xf150130a
3311, 138739, 138739, 512, 1024, 0x09678eaa
3321, 139246, 139246, 512, 1024, 0xb94e06f1
3330, 6333, 6333, 111, 6976, 0xcc610c26
3341, 139775, 139775, 512, 1024, 0x67b1dbc9
3351, 140282, 140282, 512, 1024, 0xd6edc235
3361, 140789, 140789, 512, 1024, 0x34e4c499
3371, 141296, 141296, 512, 1024, 0xeefd89c0
3381, 141804, 141804, 512, 1024, 0x38afdaf1
3390, 6444, 6444, 111, 7056, 0x6cd917b0
3401, 142333, 142333, 512, 1024, 0x29a60d76
3411, 142840, 142840, 512, 1024, 0xe28a4372
3421, 143347, 143347, 512, 1024, 0x7089454d
3431, 143854, 143854, 512, 1024, 0x0c01bb7b
3441, 144383, 144383, 512, 1024, 0xbd776a72
3450, 6555, 6555, 111, 6736, 0x02b78951
3461, 144891, 144891, 512, 1024, 0x86776fd0
3471, 145398, 145398, 512, 1024, 0xb37c88f7
3481, 145905, 145905, 512, 1024, 0x5f90aaf8
3491, 146412, 146412, 512, 1024, 0x203d4222
3501, 146941, 146941, 512, 1024, 0x382692a6
3510, 6666, 6666, 111, 6540, 0x767e0854
3521, 147448, 147448, 512, 1024, 0xf37c95fd
3531, 147956, 147956, 512, 1024, 0x6c0b8877
3541, 148463, 148463, 512, 1024, 0x2e54a8b6
3551, 148992, 148992, 512, 1024, 0x7f266488
3560, 6777, 6777, 111, 6170, 0xc84962fb
3571, 149499, 149499, 512, 1024, 0xfbf20f9a
3581, 150006, 150006, 512, 1024, 0xf2985cc0
3591, 150513, 150513, 512, 1024, 0xc7075340
3601, 151020, 151020, 512, 1024, 0xe4585695
3611, 151550, 151550, 512, 1024, 0xbdffa380
3620, 6888, 6888, 111, 6169, 0x27e06c03
3631, 152057, 152057, 512, 1024, 0x2422a8a9
3641, 152564, 152564, 512, 1024, 0x59cbd75f
3651, 153071, 153071, 512, 1024, 0x04ad1a8c
3661, 153578, 153578, 512, 1024, 0x33c09191
3671, 154107, 154107, 512, 1024, 0x55efa6fd
3680, 7000, 7000, 111, 5864, 0xd14db83f
3691, 154615, 154615, 512, 1024, 0xf73d0e5d
3701, 155122, 155122, 512, 1024, 0x6141ebae
3711, 155629, 155629, 512, 1024, 0x7db17a68
3721, 156158, 156158, 512, 1024, 0xa6c690b6
3731, 156665, 156665, 512, 1024, 0xa6fd6725
3740, 7111, 7111, 111, 5375, 0x4a21055d
3751, 157172, 157172, 512, 1024, 0x50a90b9b
3761, 157680, 157680, 512, 1024, 0xef990dc8
3771, 158187, 158187, 512, 1024, 0x75adf6b5
3781, 158716, 158716, 512, 1024, 0x61eac43e
3791, 159223, 159223, 512, 1024, 0x67797a19
3800, 7222, 7222, 111, 5206, 0x95ead3cb
3811, 159730, 159730, 512, 1024, 0xf325277a
3821, 160237, 160237, 512, 1024, 0x18bf254a
3831, 160767, 160767, 512, 1024, 0x2ce6bee3
3841, 161274, 161274, 512, 1024, 0x8d320860
3850, 7333, 7333, 111, 5220, 0xcfdcc37e
3861, 161781, 161781, 512, 1024, 0xc979b6e8
3871, 162288, 162288, 512, 1024, 0xdb644b41
3881, 162795, 162795, 512, 1024, 0xe1b368ba
3891, 163324, 163324, 512, 1024, 0xacc53d15
3901, 163832, 163832, 512, 1024, 0x42ea8c18
3910, 7444, 7444, 111, 4946, 0x2d864a77
3921, 164339, 164339, 512, 1024, 0xe52c99a4
3931, 164846, 164846, 512, 1024, 0xd7db54a6
3941, 165375, 165375, 512, 1024, 0x7f27a7e3
3951, 165882, 165882, 512, 1024, 0xf7ffeaa9
3961, 166389, 166389, 512, 1024, 0x792b6088
3970, 7555, 7555, 111, 4390, 0x2ab9f462
3981, 166896, 166896, 512, 1024, 0x61d99724
3991, 167404, 167404, 512, 1024, 0x5213720e
4001, 167933, 167933, 512, 1024, 0xac09dd30
4011, 168440, 168440, 512, 1024, 0x960bf6bb
4021, 168947, 168947, 512, 1024, 0xc90168e1
4030, 7666, 7666, 111, 4051, 0x1d09592e
4041, 169454, 169454, 512, 1024, 0x43b45768
4051, 169983, 169983, 512, 1024, 0x935d60a1
4061, 170491, 170491, 512, 1024, 0x9a342ef2
4071, 170998, 170998, 512, 1024, 0xc894709f
4080, 7777, 7777, 111, 3680, 0x39bd6a12
4091, 171505, 171505, 512, 1024, 0x59b43b07
4101, 172012, 172012, 512, 1024, 0x36a1a98d
4111, 172541, 172541, 512, 1024, 0x9e1a121c
4121, 173048, 173048, 512, 1024, 0x02208b78
4131, 173556, 173556, 512, 1024, 0xd1d7b274
4140, 7888, 7888, 111, 2910, 0x6337ece9
4151, 174063, 174063, 512, 1024, 0xdacd5096
4161, 174592, 174592, 512, 1024, 0x51b71ead
4171, 175099, 175099, 512, 1024, 0xd009a7ca
4181, 175606, 175606, 512, 1024, 0xb6d5a938
4191, 176113, 176113, 512, 1024, 0xf3d45e47
4200, 8000, 8000, 111, 2153, 0xf4e3bc17
4211, 176620, 176620, 512, 1024, 0xea8e04fc
4221, 177150, 177150, 512, 1024, 0x0b928bd8
4231, 177657, 177657, 512, 1024, 0x0f02caec
4241, 178164, 178164, 512, 1024, 0xe2b137a8
4251, 178671, 178671, 512, 1024, 0xd5f94892
tests/ref/fate/smjpeg-demux+425−0
@@ -0,0 +1,425 @@
1#tb 0: 1/1000
2#tb 1: 1/1000
30, 0, 0, 0, 734, 0x5a042c2c
41, 0, 0, 23, 260, 0x00000000
51, 23, 23, 23, 260, 0x00000000
61, 46, 46, 23, 260, 0xac9e0a9b
71, 69, 69, 23, 260, 0x89256f5b
81, 92, 92, 23, 260, 0x8e646e36
90, 111, 111, 0, 763, 0xb5893f2f
101, 116, 116, 23, 260, 0x3ab972fc
111, 139, 139, 23, 260, 0xaea86bb2
121, 162, 162, 23, 260, 0x2366447a
131, 185, 185, 23, 260, 0x82c14f9c
141, 208, 208, 23, 260, 0xcdcf6fa8
150, 222, 222, 0, 3023, 0x0f3907d3
161, 232, 232, 23, 260, 0xb3ed64bd
171, 255, 255, 23, 260, 0xac304b92
181, 278, 278, 23, 260, 0xc8bc553b
191, 301, 301, 23, 260, 0xd35572b4
201, 325, 325, 23, 260, 0x182f6190
210, 333, 333, 0, 4800, 0x22e6e18a
221, 348, 348, 23, 260, 0xbf9145c0
231, 371, 371, 23, 260, 0x0ec85a7e
241, 394, 394, 23, 260, 0x3684720e
251, 417, 417, 23, 260, 0xe985616a
261, 441, 441, 23, 260, 0x12b147dc
270, 444, 444, 0, 6417, 0x427adde5
281, 464, 464, 23, 260, 0xb8b55dd9
291, 487, 487, 23, 260, 0xfd4a7007
301, 510, 510, 23, 260, 0xfcc05c9a
311, 534, 534, 23, 260, 0x20f74aea
320, 555, 555, 0, 6776, 0x7a74c6ad
331, 557, 557, 23, 260, 0x025359ca
341, 580, 580, 23, 260, 0xace44ba1
351, 603, 603, 23, 260, 0x03506929
361, 626, 626, 23, 260, 0x8a926f17
371, 650, 650, 23, 260, 0x4a7061e7
380, 666, 666, 0, 6808, 0x1f6eb7c3
391, 673, 673, 23, 260, 0xf8b66cc9
401, 696, 696, 23, 260, 0xe8c96dec
411, 719, 719, 23, 260, 0x672a54a6
421, 743, 743, 23, 260, 0xe97b5698
431, 766, 766, 23, 260, 0x377f684d
440, 777, 777, 0, 6726, 0x452087e6
451, 789, 789, 23, 260, 0xe9a66786
461, 812, 812, 23, 260, 0xf8e17080
471, 835, 835, 23, 260, 0x65eb662a
481, 859, 859, 23, 260, 0xd8d361e9
491, 882, 882, 23, 260, 0xb8115a0b
500, 888, 888, 0, 6829, 0xee82b109
511, 905, 905, 23, 260, 0xa5a85461
521, 928, 928, 23, 260, 0xf401663b
531, 952, 952, 23, 260, 0x042f714e
541, 975, 975, 23, 260, 0xdf195820
551, 998, 998, 23, 260, 0x0a67653c
560, 999, 999, 0, 7055, 0xf41f1108
571, 1021, 1021, 23, 260, 0xe9b44d02
581, 1044, 1044, 23, 260, 0xbd4747b9
591, 1068, 1068, 23, 260, 0x3ef66738
601, 1091, 1091, 23, 260, 0x0f4a6e44
610, 1111, 1111, 0, 6977, 0xf8fe1ede
621, 1114, 1114, 23, 260, 0xaa3d6eb6
631, 1137, 1137, 23, 260, 0xb9a46c4a
641, 1160, 1160, 23, 260, 0x4f974c2e
651, 1184, 1184, 23, 260, 0x9e714a00
661, 1207, 1207, 23, 260, 0x601a7152
670, 1222, 1222, 0, 6942, 0x9ad105c6
681, 1230, 1230, 23, 260, 0xaf317064
691, 1253, 1253, 23, 260, 0x163d4829
701, 1277, 1277, 23, 260, 0xc56b4f1a
711, 1300, 1300, 23, 260, 0x7623729c
721, 1323, 1323, 23, 260, 0xa514694f
730, 1333, 1333, 0, 6926, 0xe239dad6
741, 1346, 1346, 23, 260, 0x93ee4ad8
751, 1369, 1369, 23, 260, 0x6d8e573f
761, 1393, 1393, 23, 260, 0x13256d68
771, 1416, 1416, 23, 260, 0x187761a2
781, 1439, 1439, 23, 260, 0x426045e7
790, 1444, 1444, 0, 6966, 0x81dcfab1
801, 1462, 1462, 23, 260, 0x7e7e5891
811, 1486, 1486, 23, 260, 0xd6926dcc
821, 1509, 1509, 23, 260, 0xf0196061
831, 1532, 1532, 23, 260, 0x7cac49a3
840, 1555, 1555, 0, 6896, 0x31e6cc02
851, 1555, 1555, 23, 260, 0x24f4549a
861, 1578, 1578, 23, 260, 0x937f551d
871, 1602, 1602, 23, 260, 0x9bf462c5
881, 1625, 1625, 23, 260, 0xd1e07436
891, 1648, 1648, 23, 260, 0xdab36215
900, 1666, 1666, 0, 6889, 0x1cc1006e
911, 1671, 1671, 23, 260, 0xabc5662b
921, 1695, 1695, 23, 260, 0xa24f6bf1
931, 1718, 1718, 23, 260, 0x39e664b2
941, 1741, 1741, 23, 260, 0xf5dc54ca
951, 1764, 1764, 23, 260, 0xc3b16974
960, 1777, 1777, 0, 6933, 0xc303f87f
971, 1787, 1787, 23, 260, 0x6cf46bca
981, 1811, 1811, 23, 260, 0x7a6b69b9
991, 1834, 1834, 23, 260, 0xc02f69b9
1001, 1857, 1857, 23, 260, 0x7fc764a9
1011, 1880, 1880, 23, 260, 0xd9705b09
1020, 1888, 1888, 0, 7034, 0xb4970a20
1031, 1904, 1904, 23, 260, 0x17b05f49
1041, 1927, 1927, 23, 260, 0x10ad647c
1051, 1950, 1950, 23, 260, 0xf9636d69
1061, 1973, 1973, 23, 260, 0x622b5ad9
1071, 1996, 1996, 23, 260, 0x175b646d
1080, 1999, 1999, 0, 6961, 0xf064095d
1091, 2020, 2020, 23, 260, 0x722b5827
1101, 2043, 2043, 23, 260, 0x83614974
1111, 2066, 2066, 23, 260, 0x80366587
1121, 2089, 2089, 23, 260, 0x050f6bf9
1130, 2111, 2111, 0, 7089, 0x5ba350f9
1141, 2113, 2113, 23, 260, 0x949d6735
1151, 2136, 2136, 23, 260, 0x62cd7184
1161, 2159, 2159, 23, 260, 0x21e45713
1171, 2182, 2182, 23, 260, 0x56314509
1181, 2205, 2205, 23, 260, 0x7a1570d3
1190, 2222, 2222, 0, 7078, 0xa83f3e88
1201, 2229, 2229, 23, 260, 0x205a6ffb
1211, 2252, 2252, 23, 260, 0xead94483
1221, 2275, 2275, 23, 260, 0x93c84f10
1231, 2298, 2298, 23, 260, 0xdf45726f
1241, 2321, 2321, 23, 260, 0x35016f1e
1250, 2333, 2333, 0, 7147, 0xcda66cfc
1261, 2345, 2345, 23, 260, 0xa8114bcd
1271, 2368, 2368, 23, 260, 0x14c45130
1281, 2391, 2391, 23, 260, 0x97b07052
1291, 2414, 2414, 23, 260, 0x039b6c77
1301, 2438, 2438, 23, 260, 0x46f74635
1310, 2444, 2444, 0, 7173, 0xb7455859
1321, 2461, 2461, 23, 260, 0x4116540d
1331, 2484, 2484, 23, 260, 0x26747067
1341, 2507, 2507, 23, 260, 0x37f16485
1351, 2530, 2530, 23, 260, 0x631d4a33
1361, 2554, 2554, 23, 260, 0x14ed598d
1370, 2555, 2555, 0, 7213, 0x97b89994
1381, 2577, 2577, 23, 260, 0x3f9349e7
1391, 2600, 2600, 23, 260, 0x91295757
1401, 2623, 2623, 23, 260, 0x95de72bc
1411, 2647, 2647, 23, 260, 0xc7ee5ddb
1420, 2666, 2666, 0, 7170, 0xca8b2948
1431, 2670, 2670, 23, 260, 0x38e965cd
1441, 2693, 2693, 23, 260, 0xfae169e9
1451, 2716, 2716, 23, 260, 0x9c226143
1461, 2739, 2739, 23, 260, 0x1a804dbe
1471, 2763, 2763, 23, 260, 0x4aeb633c
1480, 2777, 2777, 0, 7174, 0xc7cc6bbb
1491, 2786, 2786, 23, 260, 0xa66e6bbb
1501, 2809, 2809, 23, 260, 0x51d17109
1511, 2832, 2832, 23, 260, 0x2bc86b9b
1521, 2856, 2856, 23, 260, 0xe56e6378
1531, 2879, 2879, 23, 260, 0x95665b47
1540, 2888, 2888, 0, 7235, 0xc2e68d2b
1551, 2902, 2902, 23, 260, 0x1c255fdb
1561, 2925, 2925, 23, 260, 0x3a2456cb
1571, 2948, 2948, 23, 260, 0xe18e7270
1581, 2972, 2972, 23, 260, 0x55b65c60
1591, 2995, 2995, 23, 260, 0x62be6515
1600, 3000, 3000, 0, 7261, 0x8204a423
1611, 3018, 3018, 23, 260, 0xdba25d09
1621, 3041, 3041, 23, 260, 0xd7cc4e40
1631, 3065, 3065, 23, 260, 0x335661be
1641, 3088, 3088, 23, 260, 0xc3286de3
1650, 3111, 3111, 0, 7353, 0xacc7e7c0
1661, 3111, 3111, 23, 260, 0x47e76e35
1671, 3134, 3134, 23, 260, 0x4b716f77
1681, 3157, 3157, 23, 260, 0x0716519e
1691, 3181, 3181, 23, 260, 0x032b4490
1701, 3204, 3204, 23, 260, 0x15f067e8
1710, 3222, 3222, 0, 7065, 0x45035c5c
1721, 3227, 3227, 23, 260, 0x16766ffa
1731, 3250, 3250, 23, 260, 0xc94154ac
1741, 3274, 3274, 23, 260, 0x74764bcd
1751, 3297, 3297, 23, 260, 0x3fad6f8f
1761, 3320, 3320, 23, 260, 0x5fa972a9
1770, 3333, 3333, 0, 7269, 0x72edbb76
1781, 3343, 3343, 23, 260, 0xde2a4b7b
1791, 3366, 3366, 23, 260, 0xd8494408
1801, 3390, 3390, 23, 260, 0x843d71a6
1811, 3413, 3413, 23, 260, 0x87fd6b60
1821, 3436, 3436, 23, 260, 0x1cc04a39
1830, 3444, 3444, 0, 7220, 0xb926772f
1841, 3459, 3459, 23, 260, 0x9ca24d94
1851, 3482, 3482, 23, 260, 0x820a7087
1861, 3506, 3506, 23, 260, 0x631166b2
1871, 3529, 3529, 23, 260, 0x2f20492a
1881, 3552, 3552, 23, 260, 0x932156d0
1890, 3555, 3555, 0, 7326, 0x0a66c632
1901, 3575, 3575, 23, 260, 0xdad54c90
1911, 3599, 3599, 23, 260, 0xcce84fc9
1921, 3622, 3622, 23, 260, 0xba317486
1931, 3645, 3645, 23, 260, 0xf5a4626a
1940, 3666, 3666, 0, 7225, 0xe39076ab
1951, 3668, 3668, 23, 260, 0x324669fd
1961, 3691, 3691, 23, 260, 0xc7d37113
1971, 3715, 3715, 23, 260, 0xc6e0644f
1981, 3738, 3738, 23, 260, 0x1b91522e
1991, 3761, 3761, 23, 260, 0x9b84667d
2000, 3777, 3777, 0, 7265, 0xe0209036
2011, 3784, 3784, 23, 260, 0xed7e66eb
2021, 3808, 3808, 23, 260, 0xaf806d1f
2031, 3831, 3831, 23, 260, 0x13a66941
2041, 3854, 3854, 23, 260, 0x13095a41
2051, 3877, 3877, 23, 260, 0x5ba05491
2060, 3888, 3888, 0, 7337, 0x7a5dc093
2071, 3900, 3900, 23, 260, 0xbf785887
2081, 3924, 3924, 23, 260, 0x21965973
2091, 3947, 3947, 23, 260, 0xd9aa7134
2101, 3970, 3970, 23, 260, 0x3add62bc
2111, 3993, 3993, 23, 260, 0xb9626260
2120, 4000, 4000, 0, 7246, 0x519a7a3c
2131, 4017, 4017, 23, 260, 0x5b08629f
2141, 4040, 4040, 23, 260, 0x43a34659
2151, 4063, 4063, 23, 260, 0x68575bda
2161, 4086, 4086, 23, 260, 0xd98b715a
2171, 4109, 4109, 23, 260, 0x7d816a77
2180, 4111, 4111, 0, 7266, 0x352c8078
2191, 4133, 4133, 23, 260, 0x16af6ff1
2201, 4156, 4156, 23, 260, 0x6d4557a7
2211, 4179, 4179, 23, 260, 0x0743401a
2221, 4202, 4202, 23, 260, 0x410563d8
2230, 4222, 4222, 0, 7323, 0xcaf69d7c
2241, 4226, 4226, 23, 260, 0x561371d1
2251, 4249, 4249, 23, 260, 0x3ef15872
2261, 4272, 4272, 23, 260, 0x1dd04972
2271, 4295, 4295, 23, 260, 0xed226c62
2281, 4318, 4318, 23, 260, 0x20857046
2290, 4333, 4333, 0, 7309, 0x98c1e6f7
2301, 4342, 4342, 23, 260, 0xed7f4724
2311, 4365, 4365, 23, 260, 0x7a7445cf
2321, 4388, 4388, 23, 260, 0x06ad6a93
2331, 4411, 4411, 23, 260, 0xdd1b6c91
2341, 4435, 4435, 23, 260, 0x05b94d27
2350, 4444, 4444, 0, 7121, 0x913d5bd6
2361, 4458, 4458, 23, 260, 0x12cc5062
2371, 4481, 4481, 23, 260, 0x44526d0f
2381, 4504, 4504, 23, 260, 0xf2ac6d95
2391, 4527, 4527, 23, 260, 0x27174b0f
2401, 4551, 4551, 23, 260, 0xcf125efe
2410, 4555, 4555, 111, 7088, 0x56302362
2421, 4574, 4574, 23, 260, 0xb8ce45a1
2431, 4597, 4597, 23, 260, 0x91895627
2441, 4620, 4620, 23, 260, 0x6edb706a
2451, 4643, 4643, 23, 260, 0x4e16674b
2460, 4666, 4666, 111, 7104, 0xc0d14f78
2471, 4667, 4667, 23, 260, 0xa9d66370
2481, 4690, 4690, 23, 260, 0x8f007043
2491, 4713, 4713, 23, 260, 0xdc1a5583
2501, 4736, 4736, 23, 260, 0x2f025511
2511, 4760, 4760, 23, 260, 0x2a4d6ddb
2520, 4777, 4777, 111, 7169, 0xd03c825b
2531, 4783, 4783, 23, 260, 0x54806f14
2541, 4806, 4806, 23, 260, 0xe0ac6d80
2551, 4829, 4829, 23, 260, 0xd9cf6c97
2561, 4852, 4852, 23, 260, 0xba705b6d
2571, 4876, 4876, 23, 260, 0x0be158e0
2580, 4888, 4888, 111, 7038, 0x1ecc201d
2591, 4899, 4899, 23, 260, 0x32b3645d
2601, 4922, 4922, 23, 260, 0x4a0a55b4
2611, 4945, 4945, 23, 260, 0x078b6fd8
2621, 4969, 4969, 23, 260, 0xc2816368
2631, 4992, 4992, 23, 260, 0xbdee5e4d
2640, 5000, 5000, 111, 7015, 0x83c94454
2651, 5015, 5015, 23, 260, 0x475366aa
2661, 5038, 5038, 23, 260, 0x2f9a44b9
2671, 5061, 5061, 23, 260, 0x91745ee5
2681, 5085, 5085, 23, 260, 0xc29b6e16
2691, 5108, 5108, 23, 260, 0x6ebb6b0e
2700, 5111, 5111, 111, 6983, 0x9e51f54d
2711, 5131, 5131, 23, 260, 0x4e7d7043
2721, 5154, 5154, 23, 260, 0x10b45caf
2731, 5178, 5178, 23, 260, 0x1b1e4e54
2741, 5201, 5201, 23, 260, 0xcc7b6443
2750, 5222, 5222, 111, 7088, 0x70d33de1
2761, 5224, 5224, 23, 260, 0x29936fdd
2771, 5247, 5247, 23, 260, 0x395256e3
2781, 5270, 5270, 23, 260, 0x50fb459f
2791, 5294, 5294, 23, 260, 0x0bef64ec
2801, 5317, 5317, 23, 260, 0xadd372dd
2810, 5333, 5333, 111, 7096, 0x4d0f81b5
2821, 5340, 5340, 23, 260, 0xc49e56dc
2831, 5363, 5363, 23, 260, 0x44e749c1
2841, 5387, 5387, 23, 260, 0x030e6c8a
2851, 5410, 5410, 23, 260, 0x82a47261
2861, 5433, 5433, 23, 260, 0xa3764fcc
2870, 5444, 5444, 111, 7106, 0xd1a83ddc
2881, 5456, 5456, 23, 260, 0xb1a1498a
2891, 5479, 5479, 23, 260, 0xbf9c7184
2901, 5503, 5503, 23, 260, 0xa45f6da8
2911, 5526, 5526, 23, 260, 0x9a2e4d51
2921, 5549, 5549, 23, 260, 0xa15c56ed
2930, 5555, 5555, 111, 7219, 0x20f47fe4
2941, 5572, 5572, 23, 260, 0x7029496c
2951, 5596, 5596, 23, 260, 0xf3595213
2961, 5619, 5619, 23, 260, 0x0dab6c5a
2971, 5642, 5642, 23, 260, 0x0e2367da
2981, 5665, 5665, 23, 260, 0xbb56610a
2990, 5666, 5666, 111, 7184, 0x45dc6a0e
3001, 5688, 5688, 23, 260, 0xcc916c92
3011, 5712, 5712, 23, 260, 0x886c5ba9
3021, 5735, 5735, 23, 260, 0x1b255a69
3031, 5758, 5758, 23, 260, 0xb7a66792
3040, 5777, 5777, 111, 7222, 0x488c6499
3051, 5781, 5781, 23, 260, 0x7d946b0e
3061, 5804, 5804, 23, 260, 0x07d16714
3071, 5828, 5828, 23, 260, 0x77ef6755
3081, 5851, 5851, 23, 260, 0xb2fe6849
3091, 5874, 5874, 23, 260, 0x601b5325
3100, 5888, 5888, 111, 7254, 0xbd097ba7
3111, 5897, 5897, 23, 260, 0x309c68d0
3121, 5921, 5921, 23, 260, 0x7bbe5d49
3131, 5944, 5944, 23, 260, 0x77bc6e47
3141, 5967, 5967, 23, 260, 0x3e0a6b0b
3151, 5990, 5990, 23, 260, 0x2ae458c4
3160, 6000, 6000, 111, 7189, 0x46e06d43
3171, 6013, 6013, 23, 260, 0x17576d4f
3181, 6037, 6037, 23, 260, 0x496c4bbd
3191, 6060, 6060, 23, 260, 0x972758a0
3201, 6083, 6083, 23, 260, 0xa9897452
3211, 6106, 6106, 23, 260, 0xf58c6b92
3220, 6111, 6111, 111, 7283, 0x19dd7319
3231, 6130, 6130, 23, 260, 0x8368709a
3241, 6153, 6153, 23, 260, 0x3890643f
3251, 6176, 6176, 23, 260, 0xdcc1472c
3261, 6199, 6199, 23, 260, 0xb601605c
3270, 6222, 6222, 111, 7161, 0x23171d02
3281, 6222, 6222, 23, 260, 0xfafd6e13
3291, 6246, 6246, 23, 260, 0x20a55dbf
3301, 6269, 6269, 23, 260, 0x84a147e6
3311, 6292, 6292, 23, 260, 0xe2c75bfd
3321, 6315, 6315, 23, 260, 0x52f672c4
3330, 6333, 6333, 111, 6976, 0xcc610c26
3341, 6339, 6339, 23, 260, 0x98af579a
3351, 6362, 6362, 23, 260, 0xf2034f37
3361, 6385, 6385, 23, 260, 0x75576856
3371, 6408, 6408, 23, 260, 0x4a796f1b
3381, 6431, 6431, 23, 260, 0x3a7a5612
3390, 6444, 6444, 111, 7056, 0x6cd917b0
3401, 6455, 6455, 23, 260, 0x1c0646bd
3411, 6478, 6478, 23, 260, 0xfccd6e2c
3421, 6501, 6501, 23, 260, 0x2bdd7139
3431, 6524, 6524, 23, 260, 0xadb4519a
3441, 6548, 6548, 23, 260, 0x8ef655b5
3450, 6555, 6555, 111, 6736, 0x02b78951
3461, 6571, 6571, 23, 260, 0x157852f6
3471, 6594, 6594, 23, 260, 0xec3a4aa8
3481, 6617, 6617, 23, 260, 0x5fa77041
3491, 6640, 6640, 23, 260, 0xe862690f
3501, 6664, 6664, 23, 260, 0xad1759ce
3510, 6666, 6666, 111, 6540, 0x767e0854
3521, 6687, 6687, 23, 260, 0x856f6d2e
3531, 6710, 6710, 23, 260, 0x19496938
3541, 6733, 6733, 23, 260, 0xf3135c06
3551, 6757, 6757, 23, 260, 0xbec861ab
3560, 6777, 6777, 111, 6170, 0xc84962fb
3571, 6780, 6780, 23, 260, 0x97486f09
3581, 6803, 6803, 23, 260, 0x2dcb64ed
3591, 6826, 6826, 23, 260, 0xac196fe8
3601, 6849, 6849, 23, 260, 0xa7d460f8
3611, 6873, 6873, 23, 260, 0x02e55631
3620, 6888, 6888, 111, 6169, 0x27e06c03
3631, 6896, 6896, 23, 260, 0x92556737
3641, 6919, 6919, 23, 260, 0x9ab25599
3651, 6942, 6942, 23, 260, 0x48017498
3661, 6965, 6965, 23, 260, 0x3f376d65
3671, 6989, 6989, 23, 260, 0x553750e2
3680, 7000, 7000, 111, 5864, 0xd14db83f
3691, 7012, 7012, 23, 260, 0x430a6cb9
3701, 7035, 7035, 23, 260, 0x0d4f3b7e
3711, 7058, 7058, 23, 260, 0xc5ee5733
3721, 7082, 7082, 23, 260, 0xec33744f
3731, 7105, 7105, 23, 260, 0xb7ca6c50
3740, 7111, 7111, 111, 5375, 0x4a21055d
3751, 7128, 7128, 23, 260, 0xca8e6e09
3761, 7151, 7151, 23, 260, 0xde7b67d9
3771, 7174, 7174, 23, 260, 0x1eeb47c6
3781, 7198, 7198, 23, 260, 0x97e355f6
3791, 7221, 7221, 23, 260, 0x4cb871da
3800, 7222, 7222, 111, 5206, 0x95ead3cb
3811, 7244, 7244, 23, 260, 0xf9d65f42
3821, 7267, 7267, 23, 260, 0x4df447f9
3831, 7291, 7291, 23, 260, 0x6da55c39
3841, 7314, 7314, 23, 260, 0xf8487192
3850, 7333, 7333, 111, 5220, 0xcfdcc37e
3861, 7337, 7337, 23, 260, 0xa5ef5e84
3871, 7360, 7360, 23, 260, 0xc750404d
3881, 7383, 7383, 23, 260, 0xe62d5ba7
3891, 7407, 7407, 23, 260, 0xa362739c
3901, 7430, 7430, 23, 260, 0x784c57f9
3910, 7444, 7444, 111, 4946, 0x2d864a77
3921, 7453, 7453, 23, 260, 0xac224b6f
3931, 7476, 7476, 23, 260, 0x34506907
3941, 7500, 7500, 23, 260, 0x94207121
3951, 7523, 7523, 23, 260, 0x018754e6
3961, 7546, 7546, 23, 260, 0xa5355133
3970, 7555, 7555, 111, 4390, 0x2ab9f462
3981, 7569, 7569, 23, 260, 0x93724dac
3991, 7592, 7592, 23, 260, 0x41e24c4c
4001, 7616, 7616, 23, 260, 0x1b2a7301
4011, 7639, 7639, 23, 260, 0xcce36e61
4021, 7662, 7662, 23, 260, 0xb323585a
4030, 7666, 7666, 111, 4051, 0x1d09592e
4041, 7685, 7685, 23, 260, 0x6f7c624d
4051, 7709, 7709, 23, 260, 0x87b96a4a
4061, 7732, 7732, 23, 260, 0xf567622a
4071, 7755, 7755, 23, 260, 0x52ce5d35
4080, 7777, 7777, 111, 3680, 0x39bd6a12
4091, 7778, 7778, 23, 260, 0x58a46c28
4101, 7801, 7801, 23, 260, 0x8e3e6d9a
4111, 7825, 7825, 23, 260, 0x5ef66906
4121, 7848, 7848, 23, 260, 0x351b5f9f
4131, 7871, 7871, 23, 260, 0x90b9588a
4140, 7888, 7888, 111, 2910, 0x6337ece9
4151, 7894, 7894, 23, 260, 0x34e8615f
4161, 7918, 7918, 23, 260, 0xcef75ab9
4171, 7941, 7941, 23, 260, 0x471f6bc8
4181, 7964, 7964, 23, 260, 0xd4756c62
4191, 7987, 7987, 23, 260, 0x7c554702
4200, 8000, 8000, 111, 2153, 0xf4e3bc17
4211, 8010, 8010, 23, 260, 0x185272f1
4221, 8034, 8034, 23, 260, 0x0c364348
4231, 8057, 8057, 23, 260, 0x24354467
4241, 8080, 8080, 23, 260, 0x837d5472
4251, 8103, 8103, 23, 260, 0xece2344f
tools/lavfi-showfiltfmts.c+1−1
@@ -46,7 +46,7 @@ static void print_formats(AVFilterContext *filter_ctx) · 45 unmodified lines
46 i, filter_ctx->filter->inout##puts[i].name, \46 i, filter_ctx->filter->inout##puts[i].name, \
47 av_get_sample_fmt_name(fmts->formats[j])); \47 av_get_sample_fmt_name(fmts->formats[j])); \
48 \48 \
49 fmts = filter_ctx->inout##puts[i]->outin##_chlayouts; \49 fmts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
50 for (j = 0; j < fmts->format_count; j++) { \50 for (j = 0; j < fmts->format_count; j++) { \
51 char buf[256]; \51 char buf[256]; \
52 av_get_channel_layout_string(buf, sizeof(buf), -1, \52 av_get_channel_layout_string(buf, sizeof(buf), -1, \

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