Skip to content

Commit 125b16b

Browse files
committed
Apply stronger penalty when luma is distorted
1 parent b972de9 commit 125b16b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Quantize.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ static inline void QuantCluster_Train(struct QuantCluster_t *Dst, const struct B
1515
struct BGRAf_t Dist = BGRAf_Sub(Data, &Dst->Centroid);
1616

1717
float DistW = BGRAf_Len2(&Dist);
18+
DistW *= 1.0f + fabsf(Dist.b); //! <- Further penalize distortion by luma distortion
1819
float TrainW = 0.001f + DistW; //! <- This will help outliers pop out more often (must not be 0.0!)
1920
struct BGRAf_t TrainData = BGRAf_Muli( Data, TrainW);
2021
struct BGRAf_t DistData = BGRAf_Muli(&Dist, DistW);

0 commit comments

Comments
 (0)