Commit 08acab85 authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add loop filters

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 5590ab45
......@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
version <next>:
- DXVA2-accelerated HEVC Main10 decoding
- fieldhint filter
- loop video filter and aloop audio filter
version 3.0:
......
......@@ -15,6 +15,9 @@ libavutil: 2015-08-28
API changes, most recent first:
2016-xx-xx - lavu 55.18.100
xxxxxxx audio_fifo.h - Add av_audio_fifo_peek_at().
2016-xx-xx - lavu 55.18.0
xxxxxxx buffer.h - Add av_buffer_pool_init2().
xxxxxxx hwcontext.h - Add a new installed header hwcontext.h with a new API
......
......@@ -8185,6 +8185,25 @@ The formula that generates the correction is:
where @var{r_0} is halve of the image diagonal and @var{r_src} and @var{r_tgt} are the
distances from the focal point in the source and target images, respectively.
@section loop, aloop
Loop video frames or audio samples.
Those filters accepts the following options:
@table @option
@item loop
Set the number of loops.
@item size
Set maximal size in number of frames for @code{loop} filter or maximal number
of samples in case of @code{aloop} filter.
@item start
Set first frame of loop for @code{loop} filter or first sample of loop in case
of @code{aloop} filter.
@end table
@anchor{lut3d}
@section lut3d
......
......@@ -38,6 +38,7 @@ OBJS-$(CONFIG_AGATE_FILTER) += af_agate.o
OBJS-$(CONFIG_AINTERLEAVE_FILTER) += f_interleave.o
OBJS-$(CONFIG_ALIMITER_FILTER) += af_alimiter.o
OBJS-$(CONFIG_ALLPASS_FILTER) += af_biquads.o
OBJS-$(CONFIG_ALOOP_FILTER) += f_loop.o
OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o
OBJS-$(CONFIG_AMETADATA_FILTER) += f_metadata.o
OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o
......@@ -181,6 +182,7 @@ OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o
OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o
OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o
OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o
OBJS-$(CONFIG_LOOP_FILTER) += f_loop.o
OBJS-$(CONFIG_LUT3D_FILTER) += vf_lut3d.o
OBJS-$(CONFIG_LUT_FILTER) += vf_lut.o
OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o
......
......@@ -58,6 +58,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(AINTERLEAVE, ainterleave, af);
REGISTER_FILTER(ALIMITER, alimiter, af);
REGISTER_FILTER(ALLPASS, allpass, af);
REGISTER_FILTER(ALOOP, aloop, af);
REGISTER_FILTER(AMERGE, amerge, af);
REGISTER_FILTER(AMETADATA, ametadata, af);
REGISTER_FILTER(AMIX, amix, af);
......@@ -202,6 +203,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(INTERLEAVE, interleave, vf);
REGISTER_FILTER(KERNDEINT, kerndeint, vf);
REGISTER_FILTER(LENSCORRECTION, lenscorrection, vf);
REGISTER_FILTER(LOOP, loop, vf);
REGISTER_FILTER(LUT3D, lut3d, vf);
REGISTER_FILTER(LUT, lut, vf);
REGISTER_FILTER(LUTRGB, lutrgb, vf);
......
This diff is collapsed.
......@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 32
#define LIBAVFILTER_VERSION_MINOR 33
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
......@@ -155,6 +155,30 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples)
return nb_samples;
}
int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset)
{
int i, ret, size;
if (offset < 0 || offset >= af->nb_samples)
return AVERROR(EINVAL);
if (nb_samples < 0)
return AVERROR(EINVAL);
nb_samples = FFMIN(nb_samples, af->nb_samples);
if (!nb_samples)
return 0;
if (offset > af->nb_samples - nb_samples)
return AVERROR(EINVAL);
offset *= af->sample_size;
size = nb_samples * af->sample_size;
for (i = 0; i < af->nb_buffers; i++) {
if ((ret = av_fifo_generic_peek_at(af->buf[i], data[i], offset, size, NULL)) < 0)
return AVERROR_BUG;
}
return nb_samples;
}
int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
{
int i, ret, size;
......
......@@ -110,6 +110,23 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
*/
int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
/**
* Peek data from an AVAudioFifo.
*
* @see enum AVSampleFormat
* The documentation for AVSampleFormat describes the data layout.
*
* @param af AVAudioFifo to read from
* @param data audio data plane pointers
* @param nb_samples number of samples to peek
* @param offset offset from current read position
* @return number of samples actually peek, or negative AVERROR code
* on failure. The number of samples actually peek will not
* be greater than nb_samples, and will only be less than
* nb_samples if av_audio_fifo_size is less than nb_samples.
*/
int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset);
/**
* Read data from an AVAudioFifo.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment