[FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi

mypopy at gmail.com mypopy at gmail.com
Tue Feb 18 07:37:31 EET 2020


On Tue, Feb 18, 2020 at 11:06 AM Guo, Yejun <yejun.guo at intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Guo, Yejun
> > Sent: Tuesday, February 18, 2020 10:35 AM
> > To: Guo, Yejun <yejun.guo at intel.com>
> > Subject: RE: [FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi
> >
> >
> >
> > From: Ronald S. Bultje [mailto:rsbultje at gmail.com]
> > Sent: Friday, February 14, 2020 11:02 PM
> > To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> > Cc: Guo, Yejun <yejun.guo at intel.com>
> > Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi
> >
> > Hi,
> >
> >> On Thu, Feb 13, 2020 at 10:41 PM Guo, Yejun <yejun.guo at intel.com> wrote:
> >> For some cases, the regions of interest do not change, it is not
> >> convenient to always prepare the roi data for every frame.
> >
> > Since side-data is refcounted, can't you just keep the "last" one in memory and
> > refcount it? That way, if you wanted to know if it's the same, you can compare
> > pointers, or if you want to access the ROI data directly, you can do that, but it
> > doesn't require a copy.
> >
> > Ronald
>
> Thanks Ronald, yes, the application developers can 'cache' the last 'AVBufferRef *' of
> the roi side-data, so they don't need to prepare the same side-data for every frame, just
> pass 'AVBufferRef*' to side-data. So, we don't need to add use_last_roi in AVFrame.
>
> The only difference is that we need to re-calculate rois for encoders within ffmpeg, we
> can optimize it with your method if it is found to be a bottle neck.
I don't think re-calculate rois per frame is a true bottle neck, but
have a method to avoid unnecessary re-calculate is better.


More information about the ffmpeg-devel mailing list