* qatar/master: fix hardcoded tables compililation caused by missing math constants lavf: Make codec_tag arrays constant twinvq: give massive struct a name. lavf, lavu: version bumps and APIchanges for av_gettime() move lavfi/audio: don't set cur_buf in ff_filter_samples(). lavfi/fifo: add audio version of the fifo filter. fifo: fix parenthesis placement. lavfi: rename vf_fifo.c -> fifo.c lavc: remove stats_in from AVCodecContext options table. Conflicts: doc/APIchanges libavfilter/Makefile libavfilter/allfilters.c libavfilter/audio.c libavfilter/fifo.c libavformat/version.h libavutil/avutil.h
Unified · Split
| @@ -1903,7 +1903,7 @@ AS_O='-o $@' · 1902 unmodified lines | ||
| 1903 | 1903 | CC_O='-o $@' |
| 1904 | 1904 | CXX_O='-o $@' |
| 1905 | 1905 | |
| 1906 | −host_cflags='-D_ISOC99_SOURCE -O3 -g' | |
| 1906 | +host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g' | |
| 1907 | 1907 | host_libs='-lm' |
| 1908 | 1908 | |
| 1909 | 1909 | target_path='$(CURDIR)' |
| @@ -38,6 +38,9 @@ API changes, most recent first: · 37 unmodified lines | ||
| 38 | 38 | 2012-03-26 - a67d9cf - lavfi 2.66.100 |
| 39 | 39 | Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions. |
| 40 | 40 | |
| 41 | +2012-06-20 - ae0a301 - lavu 51.33.0 | |
| 42 | + Move av_gettime() to libavutil, add libavutil/time.h | |
| 43 | + | |
| 41 | 44 | 2012-xx-xx - xxxxxxx - lavr 0.0.3 |
| 42 | 45 | Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing. |
| 43 | 46 | |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #ifndef AACPS_TABLEGEN_H |
| 24 | 24 | #define AACPS_TABLEGEN_H |
| 25 | 25 | |
| 26 | +#include <math.h> | |
| 26 | 27 | #include <stdint.h> |
| 27 | 28 | |
| 28 | 29 | #if CONFIG_HARDCODED_TABLES |
| @@ -24,9 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | #include <string.h> |
| 25 | 25 | #include <math.h> |
| 26 | 26 | |
| 27 | −#ifndef M_PI | |
| 28 | −#define M_PI 3.14159265358979323846 | |
| 29 | −#endif | |
| 30 | 27 | #define BITS 16 |
| 31 | 28 | #define FLOATFMT "%.18e" |
| 32 | 29 | #define FIXEDFMT "%6d" |
| @@ -167,7 +167,6 @@ static const AVOption options[]={ · 166 unmodified lines | ||
| 167 | 167 | {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, |
| 168 | 168 | {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, |
| 169 | 169 | {"stats_out", NULL, OFFSET(stats_out), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, |
| 170 | −{"stats_in", NULL, OFFSET(stats_in), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, | |
| 171 | 170 | {"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E}, |
| 172 | 171 | {"rc_qmod_amp", "experimental quantizer modulation", OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E}, |
| 173 | 172 | {"rc_qmod_freq", "experimental quantizer modulation", OFFSET(rc_qmod_freq), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, |
| @@ -26,9 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | #define SINETABLE(size) \ |
| 27 | 27 | float ff_sine_##size[size] |
| 28 | 28 | #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) |
| 29 | −#ifndef M_PI | |
| 30 | −#define M_PI 3.14159265358979323846 | |
| 31 | −#endif | |
| 32 | 29 | #include "sinewin_tablegen.h" |
| 33 | 30 | #include "tableprint.h" |
| 34 | 31 | |
| @@ -135,7 +135,7 @@ static const uint16_t bark_tab_s44_128[] = { · 134 unmodified lines | ||
| 135 | 135 | * |
| 136 | 136 | * without risking a segfault on malformed files. |
| 137 | 137 | */ |
| 138 | −static const struct { | |
| 138 | +static const struct twinvq_data { | |
| 139 | 139 | float lsp08[504]; |
| 140 | 140 | int16_t fcb08l[640]; |
| 141 | 141 | int16_t fcb08m[320]; |
| @@ -47,6 +47,7 @@ OBJS-$(CONFIG_AVFORMAT) += lavfutils.o · 46 unmodified lines | ||
| 47 | 47 | OBJS-$(CONFIG_SWSCALE) += lswsutils.o |
| 48 | 48 | |
| 49 | 49 | OBJS-$(CONFIG_ACONVERT_FILTER) += af_aconvert.o |
| 50 | +OBJS-$(CONFIG_AFIFO_FILTER) += fifo.o | |
| 50 | 51 | OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o |
| 51 | 52 | OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o |
| 52 | 53 | OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o |
| @@ -87,7 +88,7 @@ OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o · 34 unmodified lines | ||
| 87 | 88 | OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o |
| 88 | 89 | OBJS-$(CONFIG_FADE_FILTER) += vf_fade.o |
| 89 | 90 | OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o |
| 90 | −OBJS-$(CONFIG_FIFO_FILTER) += vf_fifo.o | |
| 91 | +OBJS-$(CONFIG_FIFO_FILTER) += fifo.o | |
| 91 | 92 | OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o |
| 92 | 93 | OBJS-$(CONFIG_FPS_FILTER) += vf_fps.o |
| 93 | 94 | OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o |
| @@ -35,6 +35,7 @@ void avfilter_register_all(void) · 34 unmodified lines | ||
| 35 | 35 | initialized = 1; |
| 36 | 36 | |
| 37 | 37 | REGISTER_FILTER (ACONVERT, aconvert, af); |
| 38 | + REGISTER_FILTER (AFIFO, afifo, af); | |
| 38 | 39 | REGISTER_FILTER (AFORMAT, aformat, af); |
| 39 | 40 | REGISTER_FILTER (AMERGE, amerge, af); |
| 40 | 41 | REGISTER_FILTER (AMIX, amix, af); |
| @@ -181,6 +181,7 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 180 unmodified lines | ||
| 181 | 181 | void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *); |
| 182 | 182 | AVFilterPad *dst = link->dstpad; |
| 183 | 183 | int64_t pts; |
| 184 | + AVFilterBufferRef *buf_out; | |
| 184 | 185 | |
| 185 | 186 | FF_TPRINTF_START(NULL, filter_samples); ff_tlog_link(NULL, link, 1); |
| 186 | 187 | |
| @@ -194,22 +195,23 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 7 unmodified lines | ||
| 194 | 195 | "Copying audio data in avfilter (have perms %x, need %x, reject %x)\n", |
| 195 | 196 | samplesref->perms, link->dstpad->min_perms, link->dstpad->rej_perms); |
| 196 | 197 | |
| 197 | − link->cur_buf = ff_default_get_audio_buffer(link, dst->min_perms, | |
| 198 | − samplesref->audio->nb_samples); | |
| 199 | − link->cur_buf->pts = samplesref->pts; | |
| 200 | − link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate; | |
| 198 | + buf_out = ff_default_get_audio_buffer(link, dst->min_perms, | |
| 199 | + samplesref->audio->nb_samples); | |
| 200 | + buf_out->pts = samplesref->pts; | |
| 201 | + buf_out->audio->sample_rate = samplesref->audio->sample_rate; | |
| 201 | 202 | |
| 202 | 203 | /* Copy actual data into new samples buffer */ |
| 203 | − av_samples_copy(link->cur_buf->extended_data, samplesref->extended_data, | |
| 204 | + av_samples_copy(buf_out->extended_data, samplesref->extended_data, | |
| 204 | 205 | 0, 0, samplesref->audio->nb_samples, |
| 205 | 206 | av_get_channel_layout_nb_channels(link->channel_layout), |
| 206 | 207 | link->format); |
| 207 | 208 | |
| 208 | 209 | avfilter_unref_buffer(samplesref); |
| 209 | 210 | } else |
| 210 | − link->cur_buf = samplesref; | |
| 211 | + buf_out = samplesref; | |
| 211 | 212 | |
| 212 | − pts = link->cur_buf->pts; | |
| 213 | − filter_samples(link, link->cur_buf); | |
| 213 | + link->cur_buf = buf_out; | |
| 214 | + pts = buf_out->pts; | |
| 215 | + filter_samples(link, buf_out); | |
| 214 | 216 | ff_update_link_current_pts(link, pts); |
| 215 | 217 | } |
| @@ -20,21 +20,22 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * @file |
| 23 | − * FIFO buffering video filter | |
| 23 | + * FIFO buffering filter | |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | +#include "audio.h" | |
| 26 | 27 | #include "avfilter.h" |
| 27 | 28 | #include "internal.h" |
| 28 | 29 | #include "video.h" |
| 29 | 30 | |
| 30 | −typedef struct BufPic { | |
| 31 | − AVFilterBufferRef *picref; | |
| 32 | − struct BufPic *next; | |
| 33 | −} BufPic; | |
| 31 | +typedef struct Buf { | |
| 32 | + AVFilterBufferRef *buf; | |
| 33 | + struct Buf *next; | |
| 34 | +} Buf; | |
| 34 | 35 | |
| 35 | 36 | typedef struct { |
| 36 | − BufPic root; | |
| 37 | − BufPic *last; ///< last buffered picture | |
| 37 | + Buf root; | |
| 38 | + Buf *last; ///< last buffered frame | |
| 38 | 39 | } FifoContext; |
| 39 | 40 | |
| 40 | 41 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) |
| @@ -49,22 +50,22 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 8 unmodified lines | ||
| 49 | 50 | static av_cold void uninit(AVFilterContext *ctx) |
| 50 | 51 | { |
| 51 | 52 | FifoContext *fifo = ctx->priv; |
| 52 | − BufPic *pic, *tmp; | |
| 53 | + Buf *buf, *tmp; | |
| 53 | 54 | |
| 54 | − for (pic = fifo->root.next; pic; pic = tmp) { | |
| 55 | − tmp = pic->next; | |
| 56 | − avfilter_unref_buffer(pic->picref); | |
| 57 | − av_free(pic); | |
| 55 | + for (buf = fifo->root.next; buf; buf = tmp) { | |
| 56 | + tmp = buf->next; | |
| 57 | + avfilter_unref_buffer(buf->buf); | |
| 58 | + av_free(buf); | |
| 58 | 59 | } |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | −static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) | |
| 62 | +static void add_to_queue(AVFilterLink *inlink, AVFilterBufferRef *buf) | |
| 62 | 63 | { |
| 63 | 64 | FifoContext *fifo = inlink->dst->priv; |
| 64 | 65 | |
| 65 | − fifo->last->next = av_mallocz(sizeof(BufPic)); | |
| 66 | + fifo->last->next = av_mallocz(sizeof(Buf)); | |
| 66 | 67 | fifo->last = fifo->last->next; |
| 67 | − fifo->last->picref = picref; | |
| 68 | + fifo->last->buf = buf; | |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | static void end_frame(AVFilterLink *inlink) { } |
| @@ -74,19 +75,28 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } · 3 unmodified lines | ||
| 74 | 75 | static int request_frame(AVFilterLink *outlink) |
| 75 | 76 | { |
| 76 | 77 | FifoContext *fifo = outlink->src->priv; |
| 77 | − BufPic *tmp; | |
| 78 | + Buf *tmp; | |
| 78 | 79 | int ret; |
| 79 | 80 | |
| 80 | 81 | if (!fifo->root.next) { |
| 81 | − if ((ret = avfilter_request_frame(outlink->src->inputs[0])) < 0) | |
| 82 | + if ((ret = ff_request_frame(outlink->src->inputs[0])) < 0) | |
| 82 | 83 | return ret; |
| 83 | 84 | } |
| 84 | 85 | |
| 85 | 86 | /* by doing this, we give ownership of the reference to the next filter, |
| 86 | 87 | * so we don't have to worry about dereferencing it ourselves. */ |
| 87 | − ff_start_frame(outlink, fifo->root.next->picref); | |
| 88 | − ff_draw_slice (outlink, 0, outlink->h, 1); | |
| 89 | − ff_end_frame (outlink); | |
| 88 | + switch (outlink->type) { | |
| 89 | + case AVMEDIA_TYPE_VIDEO: | |
| 90 | + ff_start_frame(outlink, fifo->root.next->buf); | |
| 91 | + ff_draw_slice (outlink, 0, outlink->h, 1); | |
| 92 | + ff_end_frame (outlink); | |
| 93 | + break; | |
| 94 | + case AVMEDIA_TYPE_AUDIO: | |
| 95 | + ff_filter_samples(outlink, fifo->root.next->buf); | |
| 96 | + break; | |
| 97 | + default: | |
| 98 | + return AVERROR(EINVAL); | |
| 99 | + } | |
| 90 | 100 | |
| 91 | 101 | if (fifo->last == fifo->root.next) |
| 92 | 102 | fifo->last = &fifo->root; |
| @@ -109,7 +119,7 @@ AVFilter avfilter_vf_fifo = { · 16 unmodified lines | ||
| 109 | 119 | .inputs = (const AVFilterPad[]) {{ .name = "default", |
| 110 | 120 | .type = AVMEDIA_TYPE_VIDEO, |
| 111 | 121 | .get_video_buffer= ff_null_get_video_buffer, |
| 112 | − .start_frame = start_frame, | |
| 122 | + .start_frame = add_to_queue, | |
| 113 | 123 | .draw_slice = draw_slice, |
| 114 | 124 | .end_frame = end_frame, |
| 115 | 125 | .rej_perms = AV_PERM_REUSE2, }, |
| @@ -119,3 +129,24 @@ AVFilter avfilter_vf_fifo = { · 3 unmodified lines | ||
| 119 | 129 | .request_frame = request_frame, }, |
| 120 | 130 | { .name = NULL}}, |
| 121 | 131 | }; |
| 132 | + | |
| 133 | +AVFilter avfilter_af_afifo = { | |
| 134 | + .name = "afifo", | |
| 135 | + .description = NULL_IF_CONFIG_SMALL("Buffer input frames and send them when they are requested."), | |
| 136 | + | |
| 137 | + .init = init, | |
| 138 | + .uninit = uninit, | |
| 139 | + | |
| 140 | + .priv_size = sizeof(FifoContext), | |
| 141 | + | |
| 142 | + .inputs = (AVFilterPad[]) {{ .name = "default", | |
| 143 | + .type = AVMEDIA_TYPE_AUDIO, | |
| 144 | + .get_audio_buffer = ff_null_get_audio_buffer, | |
| 145 | + .filter_samples = add_to_queue, | |
| 146 | + .rej_perms = AV_PERM_REUSE2, }, | |
| 147 | + { .name = NULL}}, | |
| 148 | + .outputs = (AVFilterPad[]) {{ .name = "default", | |
| 149 | + .type = AVMEDIA_TYPE_AUDIO, | |
| 150 | + .request_frame = request_frame, }, | |
| 151 | + { .name = NULL}}, | |
| 152 | +}; | |
| @@ -410,5 +410,5 @@ AVInputFormat ff_caf_demuxer = { · 409 unmodified lines | ||
| 410 | 410 | .read_header = read_header, |
| 411 | 411 | .read_packet = read_packet, |
| 412 | 412 | .read_seek = read_seek, |
| 413 | − .codec_tag = (const AVCodecTag*[]){ ff_codec_caf_tags, 0 }, | |
| 413 | + .codec_tag = (const AVCodecTag* const []){ ff_codec_caf_tags, 0 }, | |
| 414 | 414 | }; |
| @@ -87,5 +87,5 @@ AVInputFormat ff_ivf_demuxer = { · 86 unmodified lines | ||
| 87 | 87 | .read_header = read_header, |
| 88 | 88 | .read_packet = read_packet, |
| 89 | 89 | .flags = AVFMT_GENERIC_INDEX, |
| 90 | − .codec_tag = (const AVCodecTag*[]){ ff_codec_bmp_tags, 0 }, | |
| 90 | + .codec_tag = (const AVCodecTag* const []){ ff_codec_bmp_tags, 0 }, | |
| 91 | 91 | }; |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include "libavutil/avutil.h" |
| 31 | 31 | |
| 32 | 32 | #define LIBAVFORMAT_VERSION_MAJOR 54 |
| 33 | −#define LIBAVFORMAT_VERSION_MINOR 10 | |
| 33 | +#define LIBAVFORMAT_VERSION_MINOR 11 | |
| 34 | 34 | #define LIBAVFORMAT_VERSION_MICRO 100 |
| 35 | 35 | |
| 36 | 36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |
| @@ -153,7 +153,7 @@ · 152 unmodified lines | ||
| 153 | 153 | */ |
| 154 | 154 | |
| 155 | 155 | #define LIBAVUTIL_VERSION_MAJOR 51 |
| 156 | −#define LIBAVUTIL_VERSION_MINOR 59 | |
| 156 | +#define LIBAVUTIL_VERSION_MINOR 60 | |
| 157 | 157 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 158 | 158 | |
| 159 | 159 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |