libavfilter/signature_lookup: fix jaccard distance
Actually, the jaccard distance is defined as D = 1 - intersect / union. Additionally, the distance value is compared against a constant that must be between 0 and 1, which is not the case here. Both facts together has led to the fact, that the function always returned a matching course signature. To leave the constant intact and to avoid floating point computation, this commit multiplies with 1 << 16 making the constant effectively 9000 / (1<<16) =~ 0.14. Reported-by:Sachin Tilloo <sachin.tilloo@gmail.com> Reviewed-by:
Sachin Tilloo <sachin.tilloo@gmail.com> Tested-by:
Sachin Tilloo <sachin.tilloo@gmail.com> Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
Showing
Please register or sign in to comment