[FFmpeg-devel] [PATCH] webp: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM

Michael Niedermayer michael at niedermayer.cc
Fri Nov 26 20:59:48 EET 2021


On Thu, Nov 25, 2021 at 02:45:26PM -0500, Alex Xu (Hello71) wrote:
> Roughly doubles webp performance for common applications (ffmpeg,
> ffprobe, mpv) due to speeding up avformat_find_stream_info.
> 
> Lossy needs no patches since vp8.c already implements skip_frame.
> Lossless needs hook to understand skip_frame. Also the "image data not
> found" message is fixed, which was already broken with manual
> -skip_frame but would now be exposed in default operation.
> ---
>  libavcodec/webp.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/webp.c b/libavcodec/webp.c
> index d5a81fd527..f24aa979ac 100644
> --- a/libavcodec/webp.c
> +++ b/libavcodec/webp.c
> @@ -1126,6 +1126,9 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
>          h = s->height;
>      }
>  
> +    if (avctx->skip_frame == AVDISCARD_ALL)
> +        return data_size;
> +
>      /* parse transformations */
>      s->nb_transforms = 0;
>      s->reduced_width = s->width;
> @@ -1524,7 +1527,7 @@ exif_end:
>          }
>      }
>  
> -    if (!*got_frame) {
> +    if (!*got_frame && avctx->skip_frame < 0) {
>          av_log(avctx, AV_LOG_ERROR, "image data not found\n");
>          return AVERROR_INVALIDDATA;
>      }

there are more possibilities than AVDISCARD_ALL and NONE
maybe iam missing something but this would probably not show this
error for them even when the error occured

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20211126/ff9e4f45/attachment.sig>


More information about the ffmpeg-devel mailing list