From a7a59639eb6287c152d43e5e376e30a035dc0652 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 18 May 2020 08:20:34 +0200 Subject: [PATCH] GPUJPEG dec.: fixed preferences when RGBA is not handled natively There was a penalty of 50 when using old GPUJPEG that didn't support RGBA directly. However it was incorrectly added when there actually was the support. --- src/video_decompress/gpujpeg.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/video_decompress/gpujpeg.c b/src/video_decompress/gpujpeg.c index d01823cb6..4727505bc 100644 --- a/src/video_decompress/gpujpeg.c +++ b/src/video_decompress/gpujpeg.c @@ -319,34 +319,33 @@ static const struct decode_from_to *gpujpeg_decompress_get_decoders() { { JPEG, VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, 50 }, #endif { JPEG, RGB, RGB, 300 }, - { JPEG, RGB, RGBA, 300 + GJ_RGBA_SUPP * 50 }, // 300 when GJ support RGBA natively, - // 350 when using CPU conversion + { JPEG, RGB, RGBA, 300 + (1 - GJ_RGBA_SUPP) * 50 }, // 300 when GJ support RGBA natively, + // 350 when using CPU conversion { JPEG, UYVY, UYVY, 300 }, { JPEG, I420, I420, 300 }, { JPEG, I420, UYVY, 500 }, { JPEG, RGB, UYVY, 700 }, { JPEG, UYVY, RGB, 700 }, - { JPEG, UYVY, RGBA, 700 + GJ_RGBA_SUPP * 50}, + { JPEG, UYVY, RGBA, 700 + (1 - GJ_RGBA_SUPP) * 50}, { JPEG, VIDEO_CODEC_NONE, RGB, 900 }, { JPEG, VIDEO_CODEC_NONE, UYVY, 900 }, - { JPEG, VIDEO_CODEC_NONE, RGBA, 900 + GJ_RGBA_SUPP * 50}, + { JPEG, VIDEO_CODEC_NONE, RGBA, 900 + (1 - GJ_RGBA_SUPP) * 50}, #if LIBGPUJPEG_API_VERSION > 6 // decoding from FFmpeg MJPG has lower priority than libavcodec // decoder because those files doesn't has much independent // segments (1 per MCU row -> 68 for HD) -> lavd may be better { MJPG, VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, 90 }, { MJPG, RGB, RGB, 600 }, - { MJPG, RGB, RGBA, 600 + GJ_RGBA_SUPP * 50 }, // 300 when GJ support RGBA natively, - // 350 when using CPU conversion + { MJPG, RGB, RGBA, 600 + (1 - GJ_RGBA_SUPP) * 50 }, { MJPG, UYVY, UYVY, 600 }, { MJPG, I420, I420, 600 }, { MJPG, I420, UYVY, 700 }, { MJPG, RGB, UYVY, 800 }, { MJPG, UYVY, RGB, 800 }, - { MJPG, UYVY, RGBA, 800 + GJ_RGBA_SUPP * 50}, + { MJPG, UYVY, RGBA, 800 + (1 - GJ_RGBA_SUPP) * 50}, { MJPG, VIDEO_CODEC_NONE, RGB, 920 }, { MJPG, VIDEO_CODEC_NONE, UYVY, 920 }, - { MJPG, VIDEO_CODEC_NONE, RGBA, 920 + GJ_RGBA_SUPP * 50}, + { MJPG, VIDEO_CODEC_NONE, RGBA, 920 + (1 - GJ_RGBA_SUPP) * 50}, #endif { VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, VIDEO_CODEC_NONE, 0 }, };