[FFmpeg-devel] [PATCH 1/2] dnn: add layer pad which is equivalent to tf.pad

Guo, Yejun yejun.guo at intel.com
Sun Jul 28 14:37:45 EEST 2019



> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Pedro Arthur
> Sent: Friday, July 26, 2019 10:36 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 1/2] dnn: add layer pad which is equivalent
> to tf.pad
> 
> Hi,
> 
> Em seg, 1 de jul de 2019 às 05:10, Guo, Yejun <yejun.guo at intel.com>
> escreveu:
> >

> > +    // handle the first dimension
> > +    before_paddings = params->paddings[0][0];
> > +    after_paddings = params->paddings[0][1];
> > +    for (int n = 0; n < before_paddings; n++) {
> > +        float *dst = output + n * new_hwc_stride;
> > +        if (params->mode == LPMP_CONSTANT) {
> > +            for (int i = 0; i < new_hwc_stride; i++) {
> > +                *dst = params->constant_values;
> I suppose it is missing a pointer increase in dst ptr?
> I found this same pattern in all loops below.

thanks, nice catch.

I just checked my unit test for LPMP_CONSTANT and found it happened to test the fourth dimension which does not need the pointer increasing.

will send out a new patch together with unit test improved.


More information about the ffmpeg-devel mailing list