68#define OFFSET(x) offsetof(DejudderContext, x)
69#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
72 {
"cycle",
"set the length of the cycle to use for dejuddering",
99 s->ringbuff =
av_calloc(
s->cycle + 2,
sizeof(*
s->ringbuff));
108 s->start_count =
s->cycle + 2;
133 if (
s->start_count) {
135 s->new_pts = next_pts * 2 *
s->cycle;
137 if (next_pts < judbuff[
s->i2]) {
138 offset = next_pts + judbuff[
s->i3] - judbuff[
s->i4] - judbuff[
s->i1];
139 for (k = 0; k <
s->cycle + 2; k++)
142 s->new_pts += (
s->cycle - 1) * (judbuff[
s->i3] - judbuff[
s->i1])
143 + (
s->cycle + 1) * (next_pts - judbuff[
s->i4]);
146 judbuff[
s->i2] = next_pts;
150 s->i4 = (
s->i4 + 1) % (
s->cycle + 2);
154 for (k = 0; k <
s->cycle + 2; k++)
178 .p.name =
"dejudder",
180 .p.priv_class= &dejudder_class,
const FFFilter ff_vf_dejudder
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_VERBOSE
Detailed information.
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
static AVRational av_make_q(int num, int den)
Create an AVRational.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
static FilterLink * ff_filter_link(AVFilterLink *link)
#define AVFILTER_DEFINE_CLASS(fname)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
Describe the class of an AVClass context structure.
AVFilterLink ** inputs
array of pointers to input links
A link between two filters.
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
static AVFormatContext * ctx
static av_cold void dejudder_uninit(AVFilterContext *ctx)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static const AVOption dejudder_options[]
static av_cold int dejudder_init(AVFilterContext *ctx)
static const AVFilterPad dejudder_inputs[]
static int config_out_props(AVFilterLink *outlink)
static const AVFilterPad dejudder_outputs[]