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.
This commit is contained in:
Martin Pulec
2020-05-18 08:20:34 +02:00
parent 02820d2761
commit a7a59639eb

View File

@@ -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 },
};