[FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

Michael Niedermayer michaelni at gmx.at
Mon Dec 15 15:12:05 CET 2014


On Mon, Dec 15, 2014 at 06:20:36PM +0530, arwa arif wrote:
> Updated the patch. There was a comment in the original filter that
> mul_thrmat is faster in c. So, should mul_thrmat_mmx be included or not?

i dont know that code, where was that comment ?

you could benchamrk it though by enclosing the code in
START_TIMER / STOP_TIMER("some text")
and comparing their speed


[...]
> +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> +{
> +    AVFilterContext *ctx = inlink->dst;
> +    FSPPContext *fspp = ctx->priv;
> +    AVFilterLink *outlink = ctx->outputs[0];
> +    AVFrame *out = in;
> +
> +    int qp_stride = 0;
> +    uint8_t *qp_table = NULL;
> +
> +    /* if we are not in a constant user quantizer mode and we don't want to use
> +     * the quantizers from the B-frames (B-frames often have a higher QP), we
> +     * need to save the qp table from the last non B-frame; this is what the
> +     * following code block does */
> +    if (!fspp->qp) {
> +        qp_table = av_frame_get_qp_table(in, &qp_stride, &fspp->qscale_type);
> +
> +        if (qp_table && !fspp->use_bframe_qp && in->pict_type != AV_PICTURE_TYPE_B) {
> +            int w, h;
> +
> +            /* if the qp stride is not set, it means the QP are only defined on
> +             * a line basis */
> +            if (!qp_stride) {
> +                w = FF_CEIL_RSHIFT(inlink->w, 4);
> +                h = 1;
> +            } else {
> +                w = FF_CEIL_RSHIFT(qp_stride, 4);
> +                h = FF_CEIL_RSHIFT(inlink->h, 4);
> +            }

> +            av_assert0(w * h <= fspp->non_b_qp_alloc_size);

this assert fails with a simple
./ffplay matrixbench_mpeg2.mpg  -vf fspp

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141215/910f502a/attachment.asc>


More information about the ffmpeg-devel mailing list