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@gmail.com>2021-03-26 08:22:24 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-01 15:06:02 +0300
commit9eadd616b7ec31f9a6b691ff3faa2c6c3716335f (patch)
treeca1f72c1048d89300cf4ee1e0dbecb2801c089ca /libavfilter/af_hdcd.c
parent659a925939011338cac1ab3c21d58d4b077fc926 (diff)
avfilter/af_hdcd: Fix undefined shifts
Affected the filter-hdcd-* FATE tests. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavfilter/af_hdcd.c')
-rw-r--r--libavfilter/af_hdcd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/af_hdcd.c b/libavfilter/af_hdcd.c
index 251d03229a..978f63599b 100644
--- a/libavfilter/af_hdcd.c
+++ b/libavfilter/af_hdcd.c
@@ -1053,7 +1053,7 @@ static int hdcd_integrate(HDCDContext *ctx, hdcd_state *states, int channels, in
for (j = result - 1; j >= 0; j--) {
for (i = 0; i < channels; i++)
- bits[i] |= (*(samples++) & 1) << j;
+ bits[i] |= (*(samples++) & 1U) << j;
samples += stride - channels;
}
@@ -1210,7 +1210,7 @@ static int hdcd_analyze(int32_t *samples, int count, int stride, int gain, int t
int32_t *samples_end = samples + stride * count;
for (i = 0; i < count; i++) {
- samples[i * stride] <<= 15;
+ samples[i * stride] *= 1 << 15;
if (mode == HDCD_ANA_PE) {
int pel = (samples[i * stride] >> 16) & 1;
int32_t sample = samples[i * stride];
@@ -1284,13 +1284,13 @@ static int hdcd_envelope(int32_t *samples, int count, int stride, int vbits, int
av_assert0(asample <= max_asample);
sample = sample >= 0 ? peaktab[asample] : -peaktab[asample];
} else
- sample <<= shft;
+ sample *= (1 << shft);
samples[i * stride] = sample;
}
} else {
for (i = 0; i < count; i++)
- samples[i * stride] <<= shft;
+ samples[i * stride] *= (1 << shft);
}
if (gain <= target_gain) {