1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

draw_bmp: remove CONDITIONAL2 code

This was sometimes slower, sometimes slightly faster. Remove it.
This commit is contained in:
wm4 2012-10-24 23:12:26 +02:00
parent 0e81d62c53
commit f50d0b16e0

View File

@ -51,7 +51,6 @@ struct mp_draw_sub_cache
#define ACCURATE
#define CONDITIONAL
#define CONDITIONAL2
static void blend_const16_alpha(uint8_t *dst,
ssize_t dstRowStride,
@ -75,12 +74,6 @@ static void blend_const16_alpha(uint8_t *dst,
#ifdef CONDITIONAL
if (!srcap)
continue;
#endif
#ifdef CONDITIONAL2
if (srcap == 255 && srcamul == 255) {
dstr[j] = srcp;
continue;
}
#endif
uint16_t dstp = dstr[j];
srcap *= srcamul; // now 0..65025
@ -113,12 +106,6 @@ static void blend_src16_alpha(uint8_t *dst,
continue;
#endif
uint16_t srcp = srcr[j];
#ifdef CONDITIONAL2
if (srcap == 255) {
dstr[j] = srcp;
continue;
}
#endif
uint16_t dstp = dstr[j];
uint16_t outp =
(srcp * srcap + dstp * (255 - srcap) + 127) / 255;
@ -149,12 +136,6 @@ static void blend_const8_alpha(uint8_t *dst,
#ifdef CONDITIONAL
if (!srcap)
continue;
#endif
#ifdef CONDITIONAL2
if (srcap == 255 && srcamul == 255) {
dstr[j] = srcp;
continue;
}
#endif
uint8_t dstp = dstr[j];
#ifdef ACCURATE
@ -194,12 +175,6 @@ static void blend_src8_alpha(uint8_t *dst,
continue;
#endif
uint8_t srcp = srcr[j];
#ifdef CONDITIONAL2
if (srcap == 255) {
dstr[j] = srcp;
continue;
}
#endif
uint8_t dstp = dstr[j];
#ifdef ACCURATE
uint8_t outp =