[FFmpeg-devel] [PATCH 09/39] lavc/ffv1: move run_index to the per-slice context

Michael Niedermayer michael at niedermayer.cc
Thu Jul 18 01:49:41 EEST 2024


On Tue, Jul 16, 2024 at 07:11:24PM +0200, Anton Khirnov wrote:
> ---
>  libavcodec/ffv1.h             |  3 ++-
>  libavcodec/ffv1dec.c          |  6 +++---
>  libavcodec/ffv1dec_template.c | 16 ++++++++--------
>  libavcodec/ffv1enc.c          |  6 +++---
>  libavcodec/ffv1enc_template.c | 16 ++++++++--------
>  5 files changed, 24 insertions(+), 23 deletions(-)

more complex code

> @@ -140,13 +140,13 @@ static int decode_plane(FFV1Context *s, FFV1SliceContext *sc,
>          sample[0][w]  = sample[0][w - 1];
>  
>          if (s->avctx->bits_per_raw_sample <= 8) {
> -            int ret = decode_line(s, w, sample, plane_index, 8);
> +            int ret = decode_line(s, sc, w, sample, plane_index, 8);
>              if (ret < 0)
>                  return ret;
>              for (x = 0; x < w; x++)
>                  src[x*pixel_stride + stride * y] = sample[1][x];
>          } else {
> -            int ret = decode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample);
> +            int ret = decode_line(s, sc, w, sample, plane_index, s->avctx->bits_per_raw_sample);
>              if (ret < 0)
>                  return ret;
>              if (s->packed_at_lsb) {

The need for passing an additional pointer around

seems to me a net negative

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/20240718/707c0541/attachment.sig>


More information about the ffmpeg-devel mailing list