From 295ab2af6ef556c37633fc2004ec6b434dcc0113 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 21 Dec 2010 21:18:58 +0000 Subject: [PATCH] =?UTF-8?q?Change=20FIX15()=20back=20to=20clipping=20to=20?= =?UTF-8?q?-32767..32767.=20This=20avoids=20a=2016-bit=20overflow=20in=20m?= =?UTF-8?q?dct512()=20due=20to=20a=20-32768=20value=20in=20costab.=20Refer?= =?UTF-8?q?ences=20updated=20for=20acodec-ac3,=20lavf-rm,=20and=20seek-ac3?= =?UTF-8?q?=5Frm=20tests.=20Thanks=20to=20M=C3=A5ns=20Rullg=C3=A5rd=20for?= =?UTF-8?q?=20finding=20the=20bug.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 26071 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ac3enc.c | 2 +- tests/ref/acodec/ac3 | 2 +- tests/ref/lavf/rm | 2 +- tests/ref/seek/ac3_rm | 12 +++++------- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 15a2c07438..200fff4878 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -44,7 +44,7 @@ #define SCALE_FLOAT(a, bits) lrintf((a) * (float)(1 << (bits))) /** Scale a float value by 2^15, convert to an integer, and clip to int16_t range. */ -#define FIX15(a) av_clip_int16(SCALE_FLOAT(a, 15)) +#define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767) /** diff --git a/tests/ref/acodec/ac3 b/tests/ref/acodec/ac3 index 32f47e0f5a..3a673fca0f 100644 --- a/tests/ref/acodec/ac3 +++ b/tests/ref/acodec/ac3 @@ -1,2 +1,2 @@ -464093173530736050e338caf152044c *./tests/data/acodec/ac3.rm +8ea1ce311247d27dc653f274ed7104cd *./tests/data/acodec/ac3.rm 98751 ./tests/data/acodec/ac3.rm diff --git a/tests/ref/lavf/rm b/tests/ref/lavf/rm index 9791715e67..bdb16e8e2e 100644 --- a/tests/ref/lavf/rm +++ b/tests/ref/lavf/rm @@ -1,2 +1,2 @@ -5da8e3db393189708f097cbdddea98f4 *./tests/data/lavf/lavf.rm +03427369521c9ebc2a5408a0e2a163bf *./tests/data/lavf/lavf.rm 346706 ./tests/data/lavf/lavf.rm diff --git a/tests/ref/seek/ac3_rm b/tests/ref/seek/ac3_rm index d7d79591cb..86a0f757ed 100644 --- a/tests/ref/seek/ac3_rm +++ b/tests/ref/seek/ac3_rm @@ -3,25 +3,23 @@ ret: 0 st:-1 flags:0 ts:-1.000000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 ret: 0 st:-1 flags:1 ts: 1.894167 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 -ret: 0 st: 0 flags:0 ts: 0.788000 -ret: 0 st: 0 flags:1 dts: 2.159000 pts: 2.159000 pos: 35567 size: 556 +ret:-1 st: 0 flags:0 ts: 0.788000 ret: 0 st: 0 flags:1 ts:-0.317000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 -ret:-1 st:-1 flags:0 ts: 2.576668 +ret: 0 st:-1 flags:0 ts: 2.576668 +ret: 0 st: 0 flags:1 dts: 2.960000 pts: 2.960000 pos: 48659 size: 558 ret:-1 st:-1 flags:1 ts: 1.470835 ret:-1 st: 0 flags:0 ts: 0.365000 ret: 0 st: 0 flags:1 ts:-0.741000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 ret: 0 st:-1 flags:0 ts: 2.153336 ret: 0 st: 0 flags:1 dts: 2.960000 pts: 2.960000 pos: 48659 size: 558 -ret: 0 st:-1 flags:1 ts: 1.047503 -ret: 0 st: 0 flags:1 dts: 1.044000 pts: 1.044000 pos: 17349 size: 558 +ret:-1 st:-1 flags:1 ts: 1.047503 ret: 0 st: 0 flags:0 ts:-0.058000 ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 ret: 0 st: 0 flags:1 ts: 2.836000 ret: 0 st: 0 flags:1 dts: 2.333000 pts: 2.333000 pos: 38413 size: 556 -ret: 0 st:-1 flags:0 ts: 1.730004 -ret: 0 st: 0 flags:1 dts: 1.776000 pts: 1.776000 pos: 29303 size: 558 +ret:-1 st:-1 flags:0 ts: 1.730004 ret: 0 st:-1 flags:1 ts: 0.624171 ret: 0 st: 0 flags:1 dts: 0.417000 pts: 0.417000 pos: 7103 size: 556 ret: 0 st: 0 flags:0 ts:-0.482000