[FFmpeg-devel] [PATCH 2/3] avcodec/utils: Favor allocating a new packet in ff_alloc_packet2()

Paul B Mahol onemda at gmail.com
Tue Aug 4 11:24:35 CEST 2015


Dana 4. 8. 2015. 10:48 osoba "Michael Niedermayer" <michaelni at gmx.at>
napisala je:
>
> From: Michael Niedermayer <michael at niedermayer.cc>
>
> This removes min_size usage by always using the same allocation
> strategy (simply allocating new packet)
>
> This causes huffyuv encoding of matrixbench to drop in speed from
> 16.321 to 16.708sec

Again I see no point in this, there is other stuf to do....

>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/utils.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 5dbd0cf..8f3bffd 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1789,7 +1789,7 @@ int ff_alloc_packet2(AVCodecContext *avctx,
AVPacket *avpkt, int64_t size, int64
>          return AVERROR(EINVAL);
>      }
>
> -    if (avctx && 2*min_size < size) { // FIXME The factor needs to be
finetuned
> +    if (avctx && avpkt->data && avpkt->size < size) {
>          av_assert0(!avpkt->data || avpkt->data !=
avctx->internal->byte_buffer);
>          if (!avpkt->data || avpkt->size < size) {
>              av_fast_padded_malloc(&avctx->internal->byte_buffer,
&avctx->internal->byte_buffer_size, size);
> --
> 1.7.9.5
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list