[FFmpeg-devel] [PATCH] hqdn3d libavfilter port

Michael Niedermayer michaelni
Mon Jun 21 04:19:23 CEST 2010


On Sun, Jun 20, 2010 at 06:08:25PM -0700, Baptiste Coudurier wrote:
> Hi,
>
> $subject.
>
> -- 
> Baptiste COUDURIER
> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> FFmpeg maintainer                                  http://www.ffmpeg.org

>  vf_hqdn3d.c |  372 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 372 insertions(+)
> 3c0ccfc28752857252f4d5a56a8ea77df740d24d  hqdn3d_avfilter.patch
[...]
> +static void deNoiseSpacial(unsigned char *Frame,        // mpi->planes[x]
> +                           unsigned char *FrameDest,    // dmpi->planes[x]
> +                           unsigned int *LineAnt,       // vf->priv->Line (width bytes)
> +                           int W, int H, int sStride, int dStride,
> +                           int *Horizontal, int *Vertical)
> +{
> +    long X, Y;
> +    long sLineOffs = 0, dLineOffs = 0;
> +    unsigned int PixelAnt;
> +    unsigned int PixelDst;
> +
> +    /* First pixel has no left nor top neighbor. */
> +    PixelDst = LineAnt[0] = PixelAnt = Frame[0]<<16;
> +    FrameDest[0]= ((PixelDst+0x10007FFF)>>16);
> +
> +    /* First line has no top neighbor, only left. */
> +    for (X = 1; X < W; X++) {
> +        PixelDst = LineAnt[X] = LowPassMul(PixelAnt, Frame[X]<<16, Horizontal);
> +        FrameDest[X]= ((PixelDst+0x10007FFF)>>16);
> +    }
> +
> +    for (Y = 1; Y < H; Y++) {
> +	unsigned int PixelAnt;
> +	sLineOffs += sStride, dLineOffs += dStride;
> +        /* First pixel on each line doesn't have previous pixel */

tabs

[...]
> +static void end_frame(AVFilterLink *link)
> +{
> +    HQDN3DContext *hqdn3d = link->dst->priv;
> +    AVFilterPicRef *outpic = link->dst->outputs[0]->outpic;
> +    AVFilterPicRef *pic = link->cur_pic;
> +    int cw = pic->w >> hqdn3d->hsub;
> +    int ch = pic->h >> hqdn3d->vsub;
> +
> +    deNoise(pic->data[0], outpic->data[0],
> +            hqdn3d->Line, &hqdn3d->Frame[0], pic->w, pic->h,
> +            pic->linesize[0], outpic->linesize[0],
> +            hqdn3d->Coefs[0],
> +            hqdn3d->Coefs[0],
> +            hqdn3d->Coefs[1]);
> +    deNoise(pic->data[1], outpic->data[1],
> +            hqdn3d->Line, &hqdn3d->Frame[1], cw, ch,
> +            pic->linesize[1], outpic->linesize[1],
> +            hqdn3d->Coefs[2],
> +            hqdn3d->Coefs[2],
> +            hqdn3d->Coefs[3]);
> +    deNoise(pic->data[2], outpic->data[2],
> +            hqdn3d->Line, &hqdn3d->Frame[2], cw, ch,
> +            pic->linesize[2], outpic->linesize[2],
> +            hqdn3d->Coefs[2],
> +            hqdn3d->Coefs[2],
> +            hqdn3d->Coefs[3]);

cant the  denoising be done in draw_slice ?
it would be better cache wise ...

anyway, ill leave review of this to bobby/vitor/stefano if they want to
do it?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100621/fd5e2afe/attachment.pgp>



More information about the ffmpeg-devel mailing list