> -----Original Message----- > From: Guo, Yejun > Sent: Tuesday, February 18, 2020 10:35 AM > To: Guo, Yejun <[email protected]> > Subject: RE: [FFmpeg-devel] [PATCH 1/3] avutil/frame: add use_last_roi > > > > From: Ronald S. Bultje [mailto:[email protected]] > Sent: Friday, February 14, 2020 11:02 PM > To: FFmpeg development discussions and patches <[email protected]> > Cc: Guo, Yejun <[email protected]> > 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 <[email protected]> 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. _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
