> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-boun...@ffmpeg.org> On Behalf Of Nicolas
> George
> Sent: 2021年3月1日 21:57
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V3 3/3] libavfilter: add filter dnn_detect
> for object detection
> 
> Andreas Rheinhardt (12021-03-01):
> > > thanks for the info, this struct is expected to be in side_data in
> > > the future, I'll add 'bboxes[1]' in it, and allocate sizeof(*header) + 
> > > (nb_bbox
> - 1) * sizeof(*bbox).
> >
> > Notice that in this case it is undefined behaviour to access any of
> > the boxes outside of BoundingBoxHeader (i.e. when using
> > header->bboxes[i], the compiler is allowed to infer that i == 0 as all
> > other cases would be undefined behaviour).
> 
> Are you sure about it? Can you quote the standard?
> 
> Anyway, even if this is true, we can work around it with an extra pointer or a
> cast, possibly wrapped in a macro. Saving a few dynamic allocation is well
> worth the unusual code; 

Hi, glad to hear there's a good solution, could you share a bit of code as an 
example,
it would be nice if I could refine my code better when possible, thanks.

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to