[FFmpeg-cvslog] lavc/ffv1dec: simplify slice index calculation

Anton Khirnov git at videolan.org
Thu Aug 1 11:16:34 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Jul  3 13:24:23 2024 +0200| [e1fa107fd1ac22f3f34c2bc5367a7055da784499] | committer: Anton Khirnov

lavc/ffv1dec: simplify slice index calculation

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1fa107fd1ac22f3f34c2bc5367a7055da784499
---

 libavcodec/ffv1dec.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

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);



More information about the ffmpeg-cvslog mailing list