[FFmpeg-cvslog] avfilter/signature: fix integer rounding cast precedence
Jai Luthra
git at videolan.org
Sat Aug 28 11:00:48 EEST 2021
ffmpeg | branch: master | Jai Luthra <me at jailuthra.in> | Fri Aug 20 16:33:28 2021 +0530| [d91542e61830e64365f40bfdc3c32084cfc41165] | committer: Jai Luthra
avfilter/signature: fix integer rounding cast precedence
Co-authored-by: Oscar <oscar_davids at outlook.com>
Signed-off-by: Jai Luthra <me at jailuthra.in>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d91542e61830e64365f40bfdc3c32084cfc41165
---
libavfilter/signature_lookup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c
index 977f898049..86dd0c6675 100644
--- a/libavfilter/signature_lookup.c
+++ b/libavfilter/signature_lookup.c
@@ -244,9 +244,9 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont
if (pairs[i].b[j] != pairs[k].b[l]) {
/* linear regression */
m = (pairs[k].b_pos[l]-pairs[i].b_pos[j]) / (k-i); /* good value between 0.0 - 2.0 */
- framerate = (int) m*30 + 0.5; /* round up to 0 - 60 */
+ framerate = (int) (m*30 + 0.5); /* round up to 0 - 60 */
if (framerate>0 && framerate <= MAX_FRAMERATE) {
- offset = pairs[i].b_pos[j] - ((int) m*i + 0.5); /* only second part has to be rounded up */
+ offset = pairs[i].b_pos[j] - ((int) (m*i + 0.5)); /* only second part has to be rounded up */
if (offset > -HOUGH_MAX_OFFSET && offset < HOUGH_MAX_OFFSET) {
if (pairs[i].dist < pairs[k].dist) {
if (pairs[i].dist < hspace[framerate-1][offset+HOUGH_MAX_OFFSET].dist) {
More information about the ffmpeg-cvslog
mailing list