[FFmpeg-devel] [PATCH V2 2/2] avfilter/dnn: unify the layer execution function in native mode

Pedro Arthur bygrandao at gmail.com
Fri Oct 4 19:09:08 EEST 2019


Hi,

Em sex, 4 de out de 2019 às 09:59, Guo, Yejun <yejun.guo at intel.com>
escreveu:

>
>
> > -----Original Message-----
> > From: Guo, Yejun
> > Sent: Tuesday, September 24, 2019 1:34 PM
> > To: ffmpeg-devel at ffmpeg.org
> > Cc: Guo, Yejun <yejun.guo at intel.com>
> > Subject: [PATCH V2 2/2] avfilter/dnn: unify the layer execution function
> in native
> > mode
> >
> > with this change, the code will be simpler when more layers supported.
> >
> > Signed-off-by: Guo, Yejun <yejun.guo at intel.com>
> > ---
> >  libavfilter/dnn/dnn_backend_native.c               | 38
> > ++++++++--------------
> >  libavfilter/dnn/dnn_backend_native_layer_conv2d.c  |  4 ++-
> >  libavfilter/dnn/dnn_backend_native_layer_conv2d.h  |  3 +-
> >  .../dnn/dnn_backend_native_layer_depth2space.c     |  5 ++-
> >  .../dnn/dnn_backend_native_layer_depth2space.h     |  3 +-
> >  libavfilter/dnn/dnn_backend_native_layer_maximum.c |  4 ++-
> >  libavfilter/dnn/dnn_backend_native_layer_maximum.h |  3 +-
> >  libavfilter/dnn/dnn_backend_native_layer_pad.c     |  5 +--
> >  libavfilter/dnn/dnn_backend_native_layer_pad.h     |  4 +--
> >  libavfilter/dnn/dnn_backend_native_layers.hxx      |  4 +++
>
I don't think this naming pattern is used in the code base (at least I
could not find anything similar).
Also I think the code would be much more clean without using macros, for
example just define an array containing the function pointers and index it
using the enum type.

rest looks good.

> >  tests/dnn/dnn-layer-conv2d-test.c                  |  4 +--
> >  tests/dnn/dnn-layer-depth2space-test.c             |  4 ++-
> >  tests/dnn/dnn-layer-maximum-test.c                 |  2 +-
> >  tests/dnn/dnn-layer-pad-test.c                     |  6 ++--
> >  14 files changed, 48 insertions(+), 41 deletions(-)
> >  create mode 100644 libavfilter/dnn/dnn_backend_native_layers.hxx
> >
>
> this patch set ask for review, thanks.
>
> I'll add another patch to unify the layer load function after the holiday.
>
> I might have several students help me to support more native layers in c
> code,
> so they can just focus on his own separate dnn_backend_layer_xxx.h/c files.
>
>
> btw, my other patches for vf_dnn_rgb_processing is still in
> https://github.com/guoyejun/ffmpeg/tree/dnn0927
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list