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

arwa arif arwaarif1994 at gmail.com
Thu Dec 18 07:36:04 CET 2014


>
> AVFILTER_DEFINE_CLASS(fspp)


Why do we need this? Is it not defined already?


> > +static int config_input(AVFilterLink *inlink)
> > +{
> > +
> > +    AVFilterContext *ctx = inlink->dst;
> > +    FSPPContext *fspp = ctx->priv;
> > +    const int h = FFALIGN(inlink->h + 16, 16);
> > +    const AVPixFmtDescriptor *desc =
> av_pix_fmt_desc_get(inlink->format);
> > +
> > +    fspp->hsub = desc->log2_chroma_w;
> > +    fspp->vsub = desc->log2_chroma_h;
> > +
> > +    fspp->temp_stride = FFALIGN(inlink->w + 16, 16);
>
> > +    fspp->temp = av_malloc_array(fspp->temp_stride, h *
> sizeof(*fspp->temp));
> > +    fspp->src  = av_malloc_array(fspp->temp_stride, h *
> sizeof(*fspp->src));
>
> missing null checks
>

NULL checks are done here :-


>
> > +
> > +    if (!fspp->temp || !fspp->src)
> > +        return AVERROR(ENOMEM);

> +
> > +    if (ARCH_X86)
> > +        ff_fspp_init_x86(fspp);
> > +
> > +    else {
> > +        fspp->store_slice  = store_slice_c;
> > +        fspp->store_slice2 = store_slice2_c;
> > +        fspp->mul_thrmat   = mul_thrmat_c;
> > +        fspp->column_fidct = column_fidct_c;
> > +        fspp->row_idct     = row_idct_c;
> > +        fspp->row_fdct     = row_fdct_c;
> > +    }
> > +
>
>
> +typedef struct fsppContext {
>
> typedef struct {
>
> > +    uint64_t threshold_mtx_noq[8 * 2];
> > +    uint64_t threshold_mtx[8 * 2];        //used in both C & MMX (&
> later SSE2) versions
> > +
> > +    int log2_count;
> > +    int hsub;
> > +    int vsub;
> > +    int temp_stride;
> > +    int qp;
> > +    int qscale_type;
> > +    int prev_q;
> > +    uint8_t *src;
> > +    int16_t *temp;
> > +    int bframes;
> > +    uint8_t *non_b_qp_table;
> > +    int non_b_qp_alloc_size;
> > +    int use_bframe_qp;
> > +
> > +    void (*store_slice)(uint8_t *dst, int16_t *src,
> > +                     int dst_stride, int src_stride,
> > +                     int width, int height, int log2_scale);
> > +
> > +    void (*store_slice2)(uint8_t *dst, int16_t *src,
> > +                     int dst_stride, int src_stride,
> > +                     int width, int height, int log2_scale);
> > +
> > +    void (*mul_thrmat)(struct fsppContext *fspp, int q);
>

This function uses a pointer to the struct, so can't remove that.


> > +
> > +    void (*column_fidct)(int16_t* thr_adr, int16_t *data,
> > +                     int16_t *output, int cnt);
> > +
> > +    void (*row_idct)(int16_t* workspace, int16_t* output_adr,
> > +                     int output_stride, int cnt);
> > +
> > +    void (*row_fdct)(int16_t *data, const uint8_t *pixels,
> > +                     int line_size, int cnt);
> > +
> > +} FSPPContext;
> > +


I checked the filter ouputs by using :-  ffmpeg -f lavfi -i testsrc,mp=fspp
-t 5 -f md5 ../out_old.
They are coming out to be same.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavfi-port-mp-uspp-to-a-native-libavfilter-filter.patch
Type: text/x-patch
Size: 91571 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141218/6e3b86c9/attachment.bin>


More information about the ffmpeg-devel mailing list