Message ID | 20210820105407.683299-1-me@jailuthra.in |
---|---|
State | Accepted |
Commit | d91542e61830e64365f40bfdc3c32084cfc41165 |
Headers | show |
Series | [FFmpeg-devel] avfilter/signature: fix integer rounding cast precedence | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
On Fri, Aug 20, 2021, at 4:24 PM, Jai Luthra wrote: > Co-authored-by: Oscar <oscar_davids@outlook.com> > Signed-off-by: Jai Luthra <me@jailuthra.in> > --- > 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) { > -- > 2.32.0 > Will push in 24h, if no objections.
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) {
Co-authored-by: Oscar <oscar_davids@outlook.com> Signed-off-by: Jai Luthra <me@jailuthra.in> --- libavfilter/signature_lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)