aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-04 00:30:22 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-20 18:58:38 +0200
commit91fce67691088fca6311fa38f7a56900f028775b (patch)
tree4fc5a2463bdc0f5b3c96ec83c5863f9f04039211
parentd6d14b3a15cbe0c2e8f3a8607f98edfcab56e330 (diff)
downloadffmpeg-91fce67691088fca6311fa38f7a56900f028775b.tar.gz
avcodec/vc1: Combine identical checks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/vc1.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 987e77fcc7..d263c70be7 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -583,21 +583,23 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex
static void rotate_luts(VC1Context *v)
{
-#define ROTATE(DEF, L, N, C, A) do { \
- if (v->s.pict_type == AV_PICTURE_TYPE_BI || v->s.pict_type == AV_PICTURE_TYPE_B) { \
- C = A; \
- } else { \
+ if (v->s.pict_type == AV_PICTURE_TYPE_BI || v->s.pict_type == AV_PICTURE_TYPE_B) {
+ v->curr_use_ic = &v->aux_use_ic;
+ v->curr_luty = v->aux_luty;
+ v->curr_lutuv = v->aux_lutuv;
+ } else {
+#define ROTATE(DEF, L, N, C) do { \
DEF; \
memcpy(&tmp, L , sizeof(tmp)); \
memcpy(L , N , sizeof(tmp)); \
memcpy(N , &tmp, sizeof(tmp)); \
C = N; \
- } \
} while(0)
- ROTATE(int tmp, &v->last_use_ic, &v->next_use_ic, v->curr_use_ic, &v->aux_use_ic);
- ROTATE(uint8_t tmp[2][256], v->last_luty, v->next_luty, v->curr_luty, v->aux_luty);
- ROTATE(uint8_t tmp[2][256], v->last_lutuv, v->next_lutuv, v->curr_lutuv, v->aux_lutuv);
+ ROTATE(int tmp, &v->last_use_ic, &v->next_use_ic, v->curr_use_ic);
+ ROTATE(uint8_t tmp[2][256], v->last_luty, v->next_luty, v->curr_luty);
+ ROTATE(uint8_t tmp[2][256], v->last_lutuv, v->next_lutuv, v->curr_lutuv);
+ }
INIT_LUT(32, 0, v->curr_luty[0], v->curr_lutuv[0], 0);
INIT_LUT(32, 0, v->curr_luty[1], v->curr_lutuv[1], 0);