Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -538,12 +538,13 @@ static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext · 537 unmodified lines | ||
| 538 | 538 | if (i && yuv) \ |
| 539 | 539 | *d = av_clip((*d * (max - alpha) + *s * alpha) / max + *s - mid, -mid, mid) + mid; \ |
| 540 | 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 | 543 | } else { \ |
| 543 | 544 | if (i && yuv) \ |
| 544 | 545 | *d = av_clip(FAST_DIV255((*d - mid) * (max - alpha)) + *s - mid, -mid, mid) + mid; \ |
| 545 | 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 | 550 | s++; \ |