[FFmpeg-devel] [PATCH v12 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper
Li, Zhong
zhong.li at intel.com
Fri May 10 08:35:02 EEST 2019
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> Of Sun, Jing A
> Sent: Friday, May 10, 2019 1:30 PM
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v12 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper
>
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> Of Li, Zhong
> Sent: Friday, May 10, 2019 1:23 PM
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v12 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper
>
> >The better solution should be: use av_malloc and just memset the padding
> bytes.
>
> The memset inside av_mallocv sets the whole buffer of the size
> "avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE" to zero.
That is low efficiency and slow as James mentioned. You don't need to set the whole buffer to be zero, only padding bytes needed.
>
> avctx->extradata_size = header_ptr->nFilledLen;
> avctx->extradata = av_mallocz(avctx->extradata_size +
> AV_INPUT_BUFFER_PADDING_SIZE);
>
> -Jing
More information about the ffmpeg-devel
mailing list