[FFmpeg-devel] [PATCH 1/3] dnn: introduce dnn operand (in c code) to hold operand infos within network
Guo, Yejun
yejun.guo at intel.com
Thu Aug 29 06:11:34 EEST 2019
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Pedro Arthur
> Sent: Tuesday, August 27, 2019 10:24 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 1/3] dnn: introduce dnn operand (in c code)
> to hold operand infos within network
>
> Hi,
>
>
> Em ter, 20 de ago de 2019 às 05:54, Guo, Yejun <yejun.guo at intel.com>
> escreveu:
> >
> > the info can be saved in dnn operand object without regenerating again and
> again,
> > and it is also needed for layer split/merge, and for memory reuse.
> >
> > to make things step by step, this patch just focuses on c code,
> > the change within python script will be added later.
> >
> > Signed-off-by: Guo, Yejun <yejun.guo at intel.com>
> > ---
> > libavfilter/dnn/dnn_backend_native.c | 226
> ++++++++++++-------------
> > libavfilter/dnn/dnn_backend_native.h | 54 +++++-
> > libavfilter/dnn/dnn_backend_native_layer_pad.c | 24 ++-
> > libavfilter/dnn/dnn_backend_native_layer_pad.h | 4 +-
> > tests/dnn/Makefile | 2 +-
> > tests/dnn/dnn-layer-pad-test.c | 60 +++++--
> > 6 files changed, 236 insertions(+), 134 deletions(-)
> >
> > diff --git a/libavfilter/dnn/dnn_backend_native.c
> b/libavfilter/dnn/dnn_backend_native.c
> > index d52abc6..78227a5 100644
> > --- a/libavfilter/dnn/dnn_backend_native.c
> > +++ b/libavfilter/dnn/dnn_backend_native.c
> >
> > +int32_t calculate_operand_data_length(DnnOperand* operand)
> > +{
> > + //av_assert0(operand->data_type == DNN_FLOAT);
> Please remove the whole commented line or uncomment the assert if it
> is relevant.
thanks, I'll remove it and add comments.
>
> > + return operand->dims[0] * operand->dims[1] * operand->dims[2] *
> operand->dims[3] * sizeof(float);
> > +}
> > +
> > +
> > + /**
> > + * to avoid possible memory leak, do not use char *name
> > + */
> > + char name[512];
> 512 bytes seems a bit too large for a name, but if you think it is
> really necessary I'm ok with it.
>
good point, I'll change to 128.
More information about the ffmpeg-devel
mailing list