History

avfilter/vf_paletteuse: do not use in dithering transparent palette

Paul B Mahol committed 5 years ago

Commit 79934cc1 parent 6d09de91 file · +7 −3Browse files

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

Unified · Split

libavfilter/vf_paletteuse.c+7−3
@@ -380,9 +380,13 @@ static av_always_inline int get_dst_color_err(PaletteUseContext *s, · 379 unmodified lines
380380 if (dstx < 0)
381381 return dstx;
382382 dstc = s->palette[dstx];
383− *er = (int)r - (int)(dstc >> 16 & 0xff);
384− *eg = (int)g - (int)(dstc >> 8 & 0xff);
385− *eb = (int)b - (int)(dstc & 0xff);
383+ if (dstx == s->transparency_index) {
384+ *er = *eg = *eb = 0;
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+ }
386390 return dstx;
387391 }
388392

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