diff mbox series

[FFmpeg-devel,3/3] avcodec/kmvc: Avoid branch when swapping pointers

Message ID 20210322020634.701593-3-andreas.rheinhardt@gmail.com
State Accepted
Commit 7439267eebed3a2616ccf448476d1c8c66caeaed
Headers show
Series [FFmpeg-devel,1/3] avcodec/kmvc: Prefer in-band palette
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt March 22, 2021, 2:06 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/kmvc.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index dd1ae05f2d..56c1977254 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -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;