Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-11-06 19:17:39 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-11-09 19:39:00 +0300
commita7ccfdc0d7c9d5726654fd5efff459ac872165f1 (patch)
tree3d9c7b2a90a8942c60be728cbfccad1be85b97bb
parentcf57147da1e8d93d51288dc40ae1bcd11bbc4a0b (diff)
avfilter/vf_hqdn3d: Fix left-shift of negative numbers
Affected filter-hqdn3d and filter-hqdn3d-sample FATE-tests. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/vf_hqdn3d.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
index ce2b9a2974..c796ea9ab4 100644
--- a/libavfilter/vf_hqdn3d.c
+++ b/libavfilter/vf_hqdn3d.c
@@ -180,7 +180,7 @@ static void precalc_coefs(double dist25, int depth, int16_t *ct)
gamma = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001);
for (i = -(256<<LUT_BITS); i < 256<<LUT_BITS; i++) {
- double f = ((i<<(9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; // midpoint of the bin
+ double f = (i * (1 << (9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; // midpoint of the bin
simil = FFMAX(0, 1.0 - fabs(f) / 255.0);
C = pow(simil, gamma) * 256.0 * f;
ct[(256<<LUT_BITS)+i] = lrint(C);