Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -380,9 +380,13 @@ static av_always_inline int get_dst_color_err(PaletteUseContext *s, · 379 unmodified lines | |||
| 380 | if (dstx < 0) | 380 | if (dstx < 0) |
| 381 | return dstx; | 381 | return dstx; |
| 382 | dstc = s->palette[dstx]; | 382 | dstc = s->palette[dstx]; |
| 383 | *er = (int)r - (int)(dstc >> 16 & 0xff); | 383 | if (dstx == s->transparency_index) { |
| 384 | *eg = (int)g - (int)(dstc >> 8 & 0xff); | 384 | *er = *eg = *eb = 0; |
| 385 | *eb = (int)b - (int)(dstc & 0xff); | 385 | } else { |
| 386 | *er = (int)r - (int)(dstc >> 16 & 0xff); | ||
| 387 | *eg = (int)g - (int)(dstc >> 8 & 0xff); | ||
| 388 | *eb = (int)b - (int)(dstc & 0xff); | ||
| 389 | } | ||
| 386 | return dstx; | 390 | return dstx; |
| 387 | } | 391 | } |
| 388 | 392 | ||