diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-04-21 12:35:42 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-04-25 23:01:38 +0200 |
commit | 122f86d8598715d47231de25385ae266504741f2 (patch) | |
tree | e6d90b42b16e4bcaa62647cccd40a671975670fa | |
parent | 7c7e161437f2b0c39ebc7de5f0880433a240712b (diff) | |
download | ffmpeg-122f86d8598715d47231de25385ae266504741f2.tar.gz |
avcodec/magicyuv: Simplify check for RGB
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/magicyuv.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 4a5c0be9e0..e106228757 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -521,7 +521,7 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, } const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); av_assert1(desc); - s->decorrelate = !!(desc->flags & AV_PIX_FMT_FLAG_RGB); + int is_rgb = s->decorrelate = !!(desc->flags & AV_PIX_FMT_FLAG_RGB); s->hshift[1] = s->hshift[2] = desc->log2_chroma_w; s->vshift[1] = s->vshift[2] = desc->log2_chroma_h; s->bps = desc->comp[0].depth; @@ -628,14 +628,7 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, s->p = p; avctx->execute2(avctx, s->magy_decode_slice, NULL, NULL, s->nb_slices); - if (avctx->pix_fmt == AV_PIX_FMT_GBRP || - avctx->pix_fmt == AV_PIX_FMT_GBRAP || - avctx->pix_fmt == AV_PIX_FMT_GBRP10 || - avctx->pix_fmt == AV_PIX_FMT_GBRAP10|| - avctx->pix_fmt == AV_PIX_FMT_GBRAP12|| - avctx->pix_fmt == AV_PIX_FMT_GBRAP14|| - avctx->pix_fmt == AV_PIX_FMT_GBRP12|| - avctx->pix_fmt == AV_PIX_FMT_GBRP14) { + if (is_rgb) { FFSWAP(uint8_t*, p->data[0], p->data[1]); FFSWAP(int, p->linesize[0], p->linesize[1]); } else { |