]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/kmvc: Avoid branch when swapping pointers
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 22 Mar 2021 01:40:20 +0000 (02:40 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 24 Mar 2021 23:32:47 +0000 (00:32 +0100)
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/kmvc.c

index dd1ae05f2dbae7e6be79ff7e194eff9c7e8ac382..56c1977254158614c22e272541465ffd08207539 100644 (file)
@@ -345,13 +345,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
     }
 
     /* flip buffers */
-    if (ctx->cur == ctx->frm0) {
-        ctx->cur = ctx->frm1;
-        ctx->prev = ctx->frm0;
-    } else {
-        ctx->cur = ctx->frm0;
-        ctx->prev = ctx->frm1;
-    }
+    FFSWAP(uint8_t *, ctx->cur, ctx->prev);
 
     *got_frame = 1;