[FFmpeg-devel] [PATCH] hqdn3d libavfilter port
Baptiste Coudurier
baptiste.coudurier
Sun Sep 26 01:30:50 CEST 2010
Hi Michael,
On 6/20/10 7:19 PM, Michael Niedermayer wrote:
> 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
Yes.
> [...]
>> +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?
Is the port ok for svn in this state ?
--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
More information about the ffmpeg-devel
mailing list