fft: avoid a signed overflow
As a signed integer, 1<<31 overflows, so force it to unsigned.
Signed-off-by: Alex Converse <alex.converse@gmail.com>
(cherry picked from commit c2d3f56107)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
committed by
Reinhard Tartler
parent
2f62b677cc
commit
2ba86066be
@@ -23,7 +23,7 @@
|
|||||||
#include "libavcodec/dsputil.h"
|
#include "libavcodec/dsputil.h"
|
||||||
#include "fft.h"
|
#include "fft.h"
|
||||||
|
|
||||||
DECLARE_ALIGNED(8, static const int, m1m1)[2] = { 1<<31, 1<<31 };
|
DECLARE_ALIGNED(8, static const unsigned int, m1m1)[2] = { 1U<<31, 1U<<31 };
|
||||||
|
|
||||||
#ifdef EMULATE_3DNOWEXT
|
#ifdef EMULATE_3DNOWEXT
|
||||||
#define PSWAPD(s,d)\
|
#define PSWAPD(s,d)\
|
||||||
@@ -70,7 +70,7 @@ void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input
|
|||||||
in1 = input;
|
in1 = input;
|
||||||
in2 = input + n2 - 1;
|
in2 = input + n2 - 1;
|
||||||
#ifdef EMULATE_3DNOWEXT
|
#ifdef EMULATE_3DNOWEXT
|
||||||
__asm__ volatile("movd %0, %%mm7" ::"r"(1<<31));
|
__asm__ volatile("movd %0, %%mm7" ::"r"(1U<<31));
|
||||||
#endif
|
#endif
|
||||||
for(k = 0; k < n4; k++) {
|
for(k = 0; k < n4; k++) {
|
||||||
// FIXME a single block is faster, but gcc 2.95 and 3.4.x on 32bit can't compile it
|
// FIXME a single block is faster, but gcc 2.95 and 3.4.x on 32bit can't compile it
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
#include "fft.h"
|
#include "fft.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
DECLARE_ASM_CONST(16, int, ff_m1m1m1m1)[4] =
|
DECLARE_ASM_CONST(16, unsigned int, ff_m1m1m1m1)[4] =
|
||||||
{ 1 << 31, 1 << 31, 1 << 31, 1 << 31 };
|
{ 1U << 31, 1U << 31, 1U << 31, 1U << 31 };
|
||||||
|
|
||||||
void ff_fft_dispatch_sse(FFTComplex *z, int nbits);
|
void ff_fft_dispatch_sse(FFTComplex *z, int nbits);
|
||||||
void ff_fft_dispatch_interleave_sse(FFTComplex *z, int nbits);
|
void ff_fft_dispatch_interleave_sse(FFTComplex *z, int nbits);
|
||||||
|
|||||||
Reference in New Issue
Block a user