git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f6e7129
)
replace a few MULL by MULH
author
Michael Niedermayer
<michaelni@gmx.at>
Mon, 21 Aug 2006 12:12:43 +0000
(12:12 +0000)
committer
Michael Niedermayer
<michaelni@gmx.at>
Mon, 21 Aug 2006 12:12:43 +0000
(12:12 +0000)
Originally committed as revision 6039 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/mpegaudiodec.c
patch
|
blob
|
history
diff --git
a/libavcodec/mpegaudiodec.c
b/libavcodec/mpegaudiodec.c
index
abb7b7b
..
d374031
100644
(file)
--- a/
libavcodec/mpegaudiodec.c
+++ b/
libavcodec/mpegaudiodec.c
@@
-943,6
+943,19
@@
static const int icos36[9] = {
FIXR(5.73685662283492756461),
};
FIXR(5.73685662283492756461),
};
+/* 0.5 / cos(pi*(2*i+1)/36) */
+static const int icos36h[9] = {
+ FIXHR(0.50190991877167369479/2),
+ FIXHR(0.51763809020504152469/2), //0
+ FIXHR(0.55168895948124587824/2),
+ FIXHR(0.61038729438072803416/2),
+ FIXHR(0.70710678118654752439/2), //1
+ FIXHR(0.87172339781054900991/2),
+ FIXHR(1.18310079157624925896/4),
+ FIXHR(1.93185165257813657349/4), //2
+// FIXHR(5.73685662283492756461),
+};
+
/* 12 points IMDCT. We compute it "by hand" by factorizing obvious
cases. */
static void imdct12(int *out, int *in)
/* 12 points IMDCT. We compute it "by hand" by factorizing obvious
cases. */
static void imdct12(int *out, int *in)
@@
-959,10
+972,10
@@
static void imdct12(int *out, int *in)
in3 += in1;
in2= MULH(2*in2, C3);
in3 += in1;
in2= MULH(2*in2, C3);
- in3= MULH(
2
*in3, C3);
+ in3= MULH(
4
*in3, C3);
t1 = in0 - in4;
t1 = in0 - in4;
- t2 = MUL
L(in1 - in5, icos36
[4]);
+ t2 = MUL
H(2*(in1 - in5), icos36h
[4]);
out[ 7]=
out[10]= t1 + t2;
out[ 7]=
out[10]= t1 + t2;
@@
-971,19
+984,19
@@
static void imdct12(int *out, int *in)
in0 += in4>>1;
in4 = in0 + in2;
in0 += in4>>1;
in4 = in0 + in2;
- in
1 += in5>>
1;
- in
5 = MULL(in1 + in3, icos36
[1]);
+ in
5 += 2*in
1;
+ in
1 = MULH(in5 + in3, icos36h
[1]);
out[ 8]=
out[ 8]=
- out[ 9]= in4 + in
5
;
+ out[ 9]= in4 + in
1
;
out[ 2]=
out[ 2]=
- out[ 3]= in4 - in
5
;
+ out[ 3]= in4 - in
1
;
in0 -= in2;
in0 -= in2;
- in
1 = MULL(in1 - in3, icos36
[7]);
+ in
5 = MULH(2*(in5 - in3), icos36h
[7]);
out[ 0]=
out[ 0]=
- out[ 5]= in0 - in
1
;
+ out[ 5]= in0 - in
5
;
out[ 6]=
out[ 6]=
- out[11]= in0 + in
1
;
+ out[11]= in0 + in
5
;
}
/* cos(pi*i/18) */
}
/* cos(pi*i/18) */
@@
-1077,7
+1090,7
@@
static void imdct36(int *out, int *buf, int *in, int *win)
t2 = tmp[i + 1];
t3 = tmp[i + 3];
t2 = tmp[i + 1];
t3 = tmp[i + 3];
- s1 = MUL
L(t3 + t2, icos36
[j]);
+ s1 = MUL
H(2*(t3 + t2), icos36h
[j]);
s3 = MULL(t3 - t2, icos36[8 - j]);
t0 = s0 + s1;
s3 = MULL(t3 - t2, icos36[8 - j]);
t0 = s0 + s1;
@@
-1097,7
+1110,7
@@
static void imdct36(int *out, int *buf, int *in, int *win)
}
s0 = tmp[16];
}
s0 = tmp[16];
- s1 = MUL
L(tmp[17], icos36
[4]);
+ s1 = MUL
H(2*tmp[17], icos36h
[4]);
t0 = s0 + s1;
t1 = s0 - s1;
out[(9 + 4)*SBLIMIT] = MULH(t1, win[9 + 4]) + buf[9 + 4];
t0 = s0 + s1;
t1 = s0 - s1;
out[(9 + 4)*SBLIMIT] = MULH(t1, win[9 + 4]) + buf[9 + 4];