History

avfilter/vf_overlay: improve premultiplied alpha overlay for YUV

Paul B Mahol committed 4 years ago

Commit bdf01a91 parent 987d2c11 file · +3 −2Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_overlay.c+3−2
@@ -538,12 +538,13 @@ static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext · 537 unmodified lines
538 if (i && yuv) \538 if (i && yuv) \
539 *d = av_clip((*d * (max - alpha) + *s * alpha) / max + *s - mid, -mid, mid) + mid; \539 *d = av_clip((*d * (max - alpha) + *s * alpha) / max + *s - mid, -mid, mid) + mid; \
540 else \540 else \
541 *d = FFMIN((*d * (max - alpha) + *s * alpha) / max + *s, max); \541 *d = av_clip_uintp2((*d * (max - alpha) + *s * alpha) / max + *s - (16<<(nbits-8)),\
542 nbits);\
542 } else { \543 } else { \
543 if (i && yuv) \544 if (i && yuv) \
544 *d = av_clip(FAST_DIV255((*d - mid) * (max - alpha)) + *s - mid, -mid, mid) + mid; \545 *d = av_clip(FAST_DIV255((*d - mid) * (max - alpha)) + *s - mid, -mid, mid) + mid; \
545 else \546 else \
546 *d = FFMIN(FAST_DIV255(*d * (max - alpha)) + *s, max); \547 *d = av_clip_uint8(FAST_DIV255(*d * (255 - alpha)) + *s - 16); \
547 } \548 } \
548 } \549 } \
549 s++; \550 s++; \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t