mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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
This commit is contained in:
parent
187f5e7f90
commit
dafd43b78d
@ -171,7 +171,8 @@ static void compute_box_stats(PaletteGenContext *s, struct range_box *box)
|
|||||||
if (er2[0] >= er2[1] && er2[0] >= er2[2]) box->major_axis = 0;
|
if (er2[0] >= er2[1] && er2[0] >= er2[2]) box->major_axis = 0;
|
||||||
if (er2[1] >= er2[0] && er2[1] >= er2[2]) box->major_axis = 1; // prefer green again
|
if (er2[1] >= er2[0] && er2[1] >= er2[2]) box->major_axis = 1; // prefer green again
|
||||||
|
|
||||||
box->cut_score = er2[0] + er2[1] + er2[2];
|
/* The box that has the axis with the biggest error amongst all boxes will but cut down */
|
||||||
|
box->cut_score = FFMAX3(er2[0], er2[1], er2[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
#codec_id 0: rawvideo
|
#codec_id 0: rawvideo
|
||||||
#dimensions 0: 16x16
|
#dimensions 0: 16x16
|
||||||
#sar 0: 1/1
|
#sar 0: 1/1
|
||||||
0, 0, 0, 1, 1024, 0x394ee723
|
0, 0, 0, 1, 1024, 0x21c6e6c4
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
#codec_id 0: rawvideo
|
#codec_id 0: rawvideo
|
||||||
#dimensions 0: 16x16
|
#dimensions 0: 16x16
|
||||||
#sar 0: 1/1
|
#sar 0: 1/1
|
||||||
0, 0, 0, 1, 1024, 0xc54d773d
|
0, 0, 0, 1, 1024, 0x630d76b1
|
||||||
|
Loading…
Reference in New Issue
Block a user