History

avfilter/palettegen: change cut score from ∑e² to max e²

This is following the results from personal research¹. ¹: https://github.com/ubitux/research/tree/main/color-quantization#results

Clément Bœsch committed 3 years ago

Commit dafd43b1 parent 187f5e73 files · +4 −3Browse files

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

Unified · Split

libavfilter/vf_palettegen.c+2−1
@@ -171,7 +171,8 @@ static void compute_box_stats(PaletteGenContext *s, struct range_box *box) · 170 unmodified lines
171171 if (er2[0] >= er2[1] && er2[0] >= er2[2]) box->major_axis = 0;
172172 if (er2[1] >= er2[0] && er2[1] >= er2[2]) box->major_axis = 1; // prefer green again
173173
174− box->cut_score = er2[0] + er2[1] + er2[2];
174+ /* The box that has the axis with the biggest error amongst all boxes will but cut down */
175+ box->cut_score = FFMAX3(er2[0], er2[1], er2[2]);
175176 }
176177
177178 /**

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