diff mbox series

[FFmpeg-devel,03/39] lavc/ffv1dec: simplify slice index calculation

Message ID 20240716171155.31838-3-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/39] tests/fate/vcodec: add vsynth tests for FFV1 version 2 | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov July 16, 2024, 5:11 p.m. UTC
---
 libavcodec/ffv1dec.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Michael Niedermayer July 24, 2024, 6:24 p.m. UTC | #1
On Tue, Jul 16, 2024 at 07:11:18PM +0200, Anton Khirnov wrote:
> ---
>  libavcodec/ffv1dec.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

ok

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 5c515e97b6..7066146477 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -259,10 +259,7 @@  static int decode_slice(AVCodecContext *c, void *arg)
     int width, height, x, y, ret;
     const int ps      = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step;
     AVFrame * const p = f->cur;
-    int si;
-
-    for( si=0; fs != f->slice_context[si]; si ++)
-        ;
+    const int      si = (FFV1Context**)arg - f->slice_context;
 
     if (f->fsrc && !(p->flags & AV_FRAME_FLAG_KEY) && f->last_picture.f)
         ff_progress_frame_await(&f->last_picture, si);