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:
parent
0e81d62c53
commit
f50d0b16e0
@ -51,7 +51,6 @@ struct mp_draw_sub_cache
|
|||||||
|
|
||||||
#define ACCURATE
|
#define ACCURATE
|
||||||
#define CONDITIONAL
|
#define CONDITIONAL
|
||||||
#define CONDITIONAL2
|
|
||||||
|
|
||||||
static void blend_const16_alpha(uint8_t *dst,
|
static void blend_const16_alpha(uint8_t *dst,
|
||||||
ssize_t dstRowStride,
|
ssize_t dstRowStride,
|
||||||
@ -75,12 +74,6 @@ static void blend_const16_alpha(uint8_t *dst,
|
|||||||
#ifdef CONDITIONAL
|
#ifdef CONDITIONAL
|
||||||
if (!srcap)
|
if (!srcap)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
#ifdef CONDITIONAL2
|
|
||||||
if (srcap == 255 && srcamul == 255) {
|
|
||||||
dstr[j] = srcp;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
uint16_t dstp = dstr[j];
|
uint16_t dstp = dstr[j];
|
||||||
srcap *= srcamul; // now 0..65025
|
srcap *= srcamul; // now 0..65025
|
||||||
@ -113,12 +106,6 @@ static void blend_src16_alpha(uint8_t *dst,
|
|||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
uint16_t srcp = srcr[j];
|
uint16_t srcp = srcr[j];
|
||||||
#ifdef CONDITIONAL2
|
|
||||||
if (srcap == 255) {
|
|
||||||
dstr[j] = srcp;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
uint16_t dstp = dstr[j];
|
uint16_t dstp = dstr[j];
|
||||||
uint16_t outp =
|
uint16_t outp =
|
||||||
(srcp * srcap + dstp * (255 - srcap) + 127) / 255;
|
(srcp * srcap + dstp * (255 - srcap) + 127) / 255;
|
||||||
@ -149,12 +136,6 @@ static void blend_const8_alpha(uint8_t *dst,
|
|||||||
#ifdef CONDITIONAL
|
#ifdef CONDITIONAL
|
||||||
if (!srcap)
|
if (!srcap)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
#ifdef CONDITIONAL2
|
|
||||||
if (srcap == 255 && srcamul == 255) {
|
|
||||||
dstr[j] = srcp;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
uint8_t dstp = dstr[j];
|
uint8_t dstp = dstr[j];
|
||||||
#ifdef ACCURATE
|
#ifdef ACCURATE
|
||||||
@ -194,12 +175,6 @@ static void blend_src8_alpha(uint8_t *dst,
|
|||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
uint8_t srcp = srcr[j];
|
uint8_t srcp = srcr[j];
|
||||||
#ifdef CONDITIONAL2
|
|
||||||
if (srcap == 255) {
|
|
||||||
dstr[j] = srcp;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
uint8_t dstp = dstr[j];
|
uint8_t dstp = dstr[j];
|
||||||
#ifdef ACCURATE
|
#ifdef ACCURATE
|
||||||
uint8_t outp =
|
uint8_t outp =
|
||||||
|
Loading…
Reference in New Issue
Block a user