History

avfilter/signature: fix integer rounding cast precedence

Jai Luthra committed 5 years ago

Commit d91542e1 parent 9dd410c1 file · +2 −2Browse files

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

Unified · Split

libavfilter/signature_lookup.c+2−2
@@ -244,9 +244,9 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont · 243 unmodified lines
244244 if (pairs[i].b[j] != pairs[k].b[l]) {
245245 /* linear regression */
246246 m = (pairs[k].b_pos[l]-pairs[i].b_pos[j]) / (k-i); /* good value between 0.0 - 2.0 */
247− framerate = (int) m*30 + 0.5; /* round up to 0 - 60 */
247+ framerate = (int) (m*30 + 0.5); /* round up to 0 - 60 */
248248 if (framerate>0 && framerate <= MAX_FRAMERATE) {
249− offset = pairs[i].b_pos[j] - ((int) m*i + 0.5); /* only second part has to be rounded up */
249+ offset = pairs[i].b_pos[j] - ((int) (m*i + 0.5)); /* only second part has to be rounded up */
250250 if (offset > -HOUGH_MAX_OFFSET && offset < HOUGH_MAX_OFFSET) {
251251 if (pairs[i].dist < pairs[k].dist) {
252252 if (pairs[i].dist < hspace[framerate-1][offset+HOUGH_MAX_OFFSET].dist) {

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