69 #define OFFSET(x) offsetof(DejudderContext, x)
70 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
73 {
"cycle",
"set the length of the cycle to use for dejuddering",
107 s->start_count =
s->cycle + 2;
132 if (
s->start_count) {
134 s->new_pts = next_pts * 2 *
s->cycle;
136 if (next_pts < judbuff[
s->i2]) {
137 offset = next_pts + judbuff[
s->i3] - judbuff[
s->i4] - judbuff[
s->i1];
138 for (k = 0; k <
s->cycle + 2; k++)
141 s->new_pts += (
s->cycle - 1) * (judbuff[
s->i3] - judbuff[
s->i1])
142 + (
s->cycle + 1) * (next_pts - judbuff[
s->i4]);
145 judbuff[
s->i2] = next_pts;
149 s->i4 = (
s->i4 + 1) % (
s->cycle + 2);
153 for (k = 0; k <
s->cycle + 2; k++)
182 .priv_class = &dejudder_class,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
static av_cold int init(AVCodecContext *avctx)
static av_cold int uninit(AVCodecContext *avctx)
#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.
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
#define AV_NOPTS_VALUE
Undefined timestamp value.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static av_cold void dejudder_uninit(AVFilterContext *ctx)
AVFILTER_DEFINE_CLASS(dejudder)
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[]
static const uint8_t offset[127][2]