[FFmpeg-devel] [PATCH] avfilter: port pullup filter from libmpcodecs

Paul B Mahol onemda at gmail.com
Tue Sep 17 18:56:04 CEST 2013


On 9/17/13, Paul B Mahol <onemda at gmail.com> wrote:
> On 9/17/13, Stefano Sabatini <stefasab at gmail.com> wrote:
>> On date Monday 2013-09-16 14:14:33 +0000, Paul B Mahol encoded:
>>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>>> ---
>>>  LICENSE                          |   1 +
>>>  configure                        |   1 +
>>>  doc/filters.texi                 |  53 +++
>>>  libavfilter/Makefile             |   1 +
>>>  libavfilter/allfilters.c         |   1 +
>>>  libavfilter/vf_pullup.c          | 746
>>> +++++++++++++++++++++++++++++++++++++++
>>>  libavfilter/vf_pullup.h          |  71 ++++
>>>  libavfilter/x86/Makefile         |   1 +
>>>  libavfilter/x86/vf_pullup_init.c | 221 ++++++++++++
>>>  9 files changed, 1096 insertions(+)
>>>  create mode 100644 libavfilter/vf_pullup.c
>>>  create mode 100644 libavfilter/vf_pullup.h
>>>  create mode 100644 libavfilter/x86/vf_pullup_init.c
>> [...]
>>> +#define OFFSET(x) offsetof(PullupContext, x)
>>> +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
>>> +
>>> +static const AVOption pullup_options[] = {
>>
>>> +    { "jl", "junk left",  OFFSET(junk_left),  AV_OPT_TYPE_INT,
>>> {.i64=1},
>>> 0, INT_MAX, FLAGS },
>>> +    { "jr", "junk right", OFFSET(junk_right), AV_OPT_TYPE_INT,
>>> {.i64=1},
>>> 0, INT_MAX, FLAGS },
>>> +    { "jt", "junk top",   OFFSET(junk_top),   AV_OPT_TYPE_INT,
>>> {.i64=4},
>>> 0, INT_MAX, FLAGS },
>>> +    { "jd", "junk down",  OFFSET(junk_down),  AV_OPT_TYPE_INT,
>>> {.i64=4},
>>> 0, INT_MAX, FLAGS },
>>
>> set junk * size ?
>>
>>> +    { "sb", "strict breaks", OFFSET(strict_breaks), AV_OPT_TYPE_INT,
>>> {.i64=0},-1, 1, FLAGS },
>>
>> set strict breaks
>>
>>> +    { "mp", "metric plane",  OFFSET(metric_plane),  AV_OPT_TYPE_INT,
>>> {.i64=0}, 0, 2, FLAGS, "mp" },
>>
>> set metric plane
>>
>>> +    { "y", "luma",        0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS,
>>> "mp" },
>>> +    { "u", "chroma blue", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS,
>>> "mp" },
>>> +    { "v", "chroma red",  0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS,
>>> "mp" },
>>> +    { NULL }
>>> +};
>>> +
>>> +AVFILTER_DEFINE_CLASS(pullup);
>>> +
>>> +static int query_formats(AVFilterContext *ctx)
>>> +{
>>> +    static const enum AVPixelFormat pix_fmts[] = {
>>> +        AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
>>> +        AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
>>> +        AV_PIX_FMT_YUV444P,  AV_PIX_FMT_YUV440P,
>>> +        AV_PIX_FMT_YUV422P,  AV_PIX_FMT_YUV420P,
>>> +        AV_PIX_FMT_YUV411P,  AV_PIX_FMT_YUV410P,
>>> +        AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_GRAY8,
>>> +        AV_PIX_FMT_NONE
>>> +    };
>>> +    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
>>> +    return 0;
>>> +}
>>> +
>>
>>> +#define ABS(a) (((a) ^ ((a) >> 31)) - ((a) >> 31))
>>
>> Note: is this different/faster than FFABS?
>
> It produces different output.

Also C version and MMX version gives different output,
same as mp=pullup, so I would say its compatible.


More information about the ffmpeg-devel mailing list