Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
4a2ef394
Commit
4a2ef394
authored
Jul 23, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosmetics: Add '0' to float constants ending in '.'.
parent
6c145ecf
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
32 deletions
+32
-32
aac_tablegen.h
libavcodec/aac_tablegen.h
+1
-1
aacdec.c
libavcodec/aacdec.c
+2
-2
aacps_tablegen.h
libavcodec/aacps_tablegen.h
+1
-1
acelp_vectors.c
libavcodec/acelp_vectors.c
+2
-2
qcelpdec.c
libavcodec/qcelpdec.c
+3
-3
ra288.c
libavcodec/ra288.c
+3
-3
sipr.c
libavcodec/sipr.c
+1
-1
twinvq.c
libavcodec/twinvq.c
+14
-14
vorbisenc.c
libavcodec/vorbisenc.c
+4
-4
swfenc.c
libavformat/swfenc.c
+1
-1
No files found.
libavcodec/aac_tablegen.h
View file @
4a2ef394
...
...
@@ -35,7 +35,7 @@ void ff_aac_tableinit(void)
{
int
i
;
for
(
i
=
0
;
i
<
428
;
i
++
)
ff_aac_pow2sf_tab
[
i
]
=
pow
(
2
,
(
i
-
POW_SF2_ZERO
)
/
4
.);
ff_aac_pow2sf_tab
[
i
]
=
pow
(
2
,
(
i
-
POW_SF2_ZERO
)
/
4
.
0
);
}
#endif
/* CONFIG_HARDCODED_TABLES */
...
...
libavcodec/aacdec.c
View file @
4a2ef394
...
...
@@ -1172,7 +1172,7 @@ static int decode_scalefactors(AACContext *ac, float sf[120], GetBitContext *gb,
int
run_end
=
band_type_run_end
[
idx
];
if
(
band_type
[
idx
]
==
ZERO_BT
)
{
for
(;
i
<
run_end
;
i
++
,
idx
++
)
sf
[
idx
]
=
0
.;
sf
[
idx
]
=
0
.
0
;
}
else
if
((
band_type
[
idx
]
==
INTENSITY_BT
)
||
(
band_type
[
idx
]
==
INTENSITY_BT2
))
{
for
(;
i
<
run_end
;
i
++
,
idx
++
)
{
...
...
@@ -1916,7 +1916,7 @@ static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
int
idx
=
0
;
int
cge
=
1
;
int
gain
=
0
;
float
gain_cache
=
1
.;
float
gain_cache
=
1
.
0
;
if
(
c
)
{
cge
=
coup
->
coupling_point
==
AFTER_IMDCT
?
1
:
get_bits1
(
gb
);
gain
=
cge
?
get_vlc2
(
gb
,
vlc_scalefactors
.
table
,
7
,
3
)
-
60
:
0
;
...
...
libavcodec/aacps_tablegen.h
View file @
4a2ef394
...
...
@@ -192,7 +192,7 @@ static void ps_tableinit(void)
for
(
k
=
0
;
k
<
NR_ALLPASS_BANDS34
;
k
++
)
{
double
f_center
,
theta
;
if
(
k
<
FF_ARRAY_ELEMS
(
f_center_34
))
f_center
=
f_center_34
[
k
]
/
24
.;
f_center
=
f_center_34
[
k
]
/
24
.
0
;
else
f_center
=
k
-
26
.
5
f
;
for
(
m
=
0
;
m
<
PS_AP_LINKS
;
m
++
)
{
...
...
libavcodec/acelp_vectors.c
View file @
4a2ef394
...
...
@@ -94,10 +94,10 @@ const float ff_b60_sinc[61] = {
0
.
898529
,
0
.
865051
,
0
.
769257
,
0
.
624054
,
0
.
448639
,
0
.
265289
,
0
.
0959167
,
-
0
.
04125
98
,
-
0
.
134338
,
-
0
.
178986
,
-
0
.
178528
,
-
0
.
142609
,
-
0
.
0849304
,
-
0
.
020507
8
,
0
.
036
9568
,
0
.
0773
926
,
0
.
0955200
,
0
.
0912781
,
0
.
06
89392
,
0
.
0357056
,
0
.
,
-
0
.
03054
81
,
-
0
.
0504150
,
-
0
.
057006
8
,
0
.
06
89392
,
0
.
0357056
,
0
.
0
,
-
0
.
03054
81
,
-
0
.
0504150
,
-
0
.
057006
8
,
-
0
.
050
8423
,
-
0
.
0350037
,
-
0
.
0141602
,
0
.
006652
83
,
0
.
0230713
,
0
.
03234
86
,
0
.
03353
88
,
0
.
0275
879
,
0
.
0167
847
,
0
.
00411
987
,
-
0
.
007476
81
,
-
0
.
0156
860
,
-
0
.
01
93481
,
-
0
.
01
83716
,
-
0
.
0137634
,
-
0
.
00704
956
,
0
.
,
0
.
005
82886
,
-
0
.
01
93481
,
-
0
.
01
83716
,
-
0
.
0137634
,
-
0
.
00704
956
,
0
.
0
,
0
.
005
82886
,
0
.
00
939941
,
0
.
0103760
,
0
.
00
903320
,
0
.
0060424
8
,
0
.
0023
8037
,
-
0
.
0010
9863
,
-
0
.
00366211
,
-
0
.
004
97437
,
-
0
.
00503540
,
-
0
.
00402
832
,
-
0
.
002410
89
,
-
0
.
00057
9834
,
0
.
00103760
,
0
.
0022277
8
,
0
.
00277710
,
0
.
00271606
,
0
.
00213623
,
0
.
00115
967
,
...
...
libavcodec/qcelpdec.c
View file @
4a2ef394
...
...
@@ -94,7 +94,7 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx)
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLT
;
for
(
i
=
0
;
i
<
10
;
i
++
)
q
->
prev_lspf
[
i
]
=
(
i
+
1
)
/
11
.;
q
->
prev_lspf
[
i
]
=
(
i
+
1
)
/
11
.
0
;
return
0
;
}
...
...
@@ -162,7 +162,7 @@ static int decode_lspf(QCELPContext *q, float *lspf)
}
else
{
q
->
octave_count
=
0
;
tmp_lspf
=
0
.;
tmp_lspf
=
0
.
0
;
for
(
i
=
0
;
i
<
5
;
i
++
)
{
lspf
[
2
*
i
+
0
]
=
tmp_lspf
+=
qcelp_lspvq
[
i
][
q
->
frame
.
lspv
[
i
]][
0
]
*
0
.
0001
;
lspf
[
2
*
i
+
1
]
=
tmp_lspf
+=
qcelp_lspvq
[
i
][
q
->
frame
.
lspv
[
i
]][
1
]
*
0
.
0001
;
...
...
@@ -434,7 +434,7 @@ static const float *do_pitchfilter(float memory[303], const float v_in[160],
v_lag
=
memory
+
143
+
40
*
i
-
lag
[
i
];
for
(
v_len
=
v_in
+
40
;
v_in
<
v_len
;
v_in
++
)
{
if
(
pfrac
[
i
])
{
// If it is a fractional lag...
for
(
j
=
0
,
*
v_out
=
0
.;
j
<
4
;
j
++
)
for
(
j
=
0
,
*
v_out
=
0
.
0
;
j
<
4
;
j
++
)
*
v_out
+=
qcelp_hammsinc_table
[
j
]
*
(
v_lag
[
j
-
4
]
+
v_lag
[
3
-
j
]);
}
else
*
v_out
=
*
v_lag
;
...
...
libavcodec/ra288.c
View file @
4a2ef394
...
...
@@ -90,7 +90,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
memmove
(
ractx
->
sp_hist
+
70
,
ractx
->
sp_hist
+
75
,
36
*
sizeof
(
*
block
));
/* block 46 of G.728 spec */
sum
=
32
.;
sum
=
32
.
0
;
for
(
i
=
0
;
i
<
10
;
i
++
)
sum
-=
gain_block
[
9
-
i
]
*
ractx
->
gain_lpc
[
i
];
...
...
@@ -104,7 +104,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
for
(
i
=
0
;
i
<
5
;
i
++
)
buffer
[
i
]
=
codetable
[
cb_coef
][
i
]
*
sumsum
;
sum
=
avpriv_scalarproduct_float_c
(
buffer
,
buffer
,
5
)
*
((
1
<<
24
)
/
5
.);
sum
=
avpriv_scalarproduct_float_c
(
buffer
,
buffer
,
5
)
*
((
1
<<
24
)
/
5
.
0
);
sum
=
FFMAX
(
sum
,
1
);
...
...
@@ -150,7 +150,7 @@ static void do_hybrid_window(RA288Context *ractx,
}
/* Multiply by the white noise correcting factor (WNCF). */
*
out
*=
257
.
/
256
.
;
*
out
*=
257
.
0
/
256
.
0
;
}
/**
...
...
libavcodec/sipr.c
View file @
4a2ef394
...
...
@@ -240,7 +240,7 @@ static void eval_ir(const float *Az, int pitch_lag, float *freq,
float
tmp1
[
SUBFR_SIZE
+
1
],
tmp2
[
LP_FILTER_ORDER
+
1
];
int
i
;
tmp1
[
0
]
=
1
.;
tmp1
[
0
]
=
1
.
0
;
for
(
i
=
0
;
i
<
LP_FILTER_ORDER
;
i
++
)
{
tmp1
[
i
+
1
]
=
Az
[
i
]
*
ff_pow_0_55
[
i
];
tmp2
[
i
]
=
Az
[
i
]
*
ff_pow_0_7
[
i
];
...
...
libavcodec/twinvq.c
View file @
4a2ef394
...
...
@@ -423,12 +423,12 @@ static inline float mulawinv(float y, float clip, float mu)
* {
* static float test; // Ugh, force gcc to do the division first...
*
* test = a / 400.;
* test = a / 400.
0
;
* return b * test + 0.5;
* }
* @endcode
*
* @note if this function is replaced by just ROUNDED_DIV(a * b, 400.), the
* @note if this function is replaced by just ROUNDED_DIV(a * b, 400.
0
), the
* stddev between the original file (before encoding with Yamaha encoder) and
* the decoded output increases, which leads one to believe that the encoder
* expects exactly this broken calculation.
...
...
@@ -516,12 +516,12 @@ static void dec_gain(TwinContext *tctx, GetBitContext *gb, enum FrameType ftype,
if
(
ftype
==
FT_LONG
)
{
for
(
i
=
0
;
i
<
tctx
->
avctx
->
channels
;
i
++
)
out
[
i
]
=
(
1
.
/
(
1
<<
13
))
*
out
[
i
]
=
(
1
.
0
/
(
1
<<
13
))
*
mulawinv
(
step
*
0
.
5
+
step
*
get_bits
(
gb
,
GAIN_BITS
),
AMP_MAX
,
MULAW_MU
);
}
else
{
for
(
i
=
0
;
i
<
tctx
->
avctx
->
channels
;
i
++
)
{
float
val
=
(
1
.
/
(
1
<<
23
))
*
float
val
=
(
1
.
0
/
(
1
<<
23
))
*
mulawinv
(
step
*
0
.
5
+
step
*
get_bits
(
gb
,
GAIN_BITS
),
AMP_MAX
,
MULAW_MU
);
...
...
@@ -582,7 +582,7 @@ static void decode_lsp(TwinContext *tctx, int lpc_idx1, uint8_t *lpc_idx2,
rearrange_lsp
(
mtab
->
n_lsp
,
lsp
,
0
.
0001
);
for
(
i
=
0
;
i
<
mtab
->
n_lsp
;
i
++
)
{
float
tmp1
=
1
.
-
cb3
[
lpc_hist_idx
*
mtab
->
n_lsp
+
i
];
float
tmp1
=
1
.
0
-
cb3
[
lpc_hist_idx
*
mtab
->
n_lsp
+
i
];
float
tmp2
=
hist
[
i
]
*
cb3
[
lpc_hist_idx
*
mtab
->
n_lsp
+
i
];
hist
[
i
]
=
lsp
[
i
];
lsp
[
i
]
=
lsp
[
i
]
*
tmp1
+
tmp2
;
...
...
@@ -713,13 +713,13 @@ static void dec_bark_env(TwinContext *tctx, const uint8_t *in, int use_hist,
for
(
i
=
0
;
i
<
fw_cb_len
;
i
++
)
for
(
j
=
0
;
j
<
bark_n_coef
;
j
++
,
idx
++
)
{
float
tmp2
=
mtab
->
fmode
[
ftype
].
bark_cb
[
fw_cb_len
*
in
[
j
]
+
i
]
*
(
1
.
/
4096
);
float
st
=
use_hist
?
(
1
.
-
val
)
*
tmp2
+
val
*
hist
[
idx
]
+
1
.
:
tmp2
+
1
.;
(
1
.
0
/
4096
);
float
st
=
use_hist
?
(
1
.
0
-
val
)
*
tmp2
+
val
*
hist
[
idx
]
+
1
.
0
:
tmp2
+
1
.
0
;
hist
[
idx
]
=
tmp2
;
if
(
st
<
-
1
.)
st
=
1
.;
if
(
st
<
-
1
.
0
)
st
=
1
.
0
;
memset_float
(
out
,
st
*
gain
,
mtab
->
fmode
[
ftype
].
bark_tab
[
idx
]);
out
+=
mtab
->
fmode
[
ftype
].
bark_tab
[
idx
];
...
...
@@ -789,12 +789,12 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb,
}
if
(
ftype
==
FT_LONG
)
{
float
pgain_step
=
25000
.
/
((
1
<<
mtab
->
pgain_bit
)
-
1
);
float
pgain_step
=
25000
.
0
/
((
1
<<
mtab
->
pgain_bit
)
-
1
);
int
p_coef
=
get_bits
(
gb
,
tctx
->
mtab
->
ppc_period_bit
);
int
g_coef
=
get_bits
(
gb
,
tctx
->
mtab
->
pgain_bit
);
float
v
=
1
.
/
8192
*
float
v
=
1
.
0
/
8192
*
mulawinv
(
pgain_step
*
g_coef
+
pgain_step
/
2
,
25000
.,
PGAIN_MU
);
25000
.
0
,
PGAIN_MU
);
decode_ppc
(
tctx
,
p_coef
,
ppc_shape
+
i
*
mtab
->
ppc_shape_len
,
v
,
chunk
);
...
...
@@ -883,7 +883,7 @@ static av_cold int init_mdct_win(TwinContext *tctx)
int
size_s
=
mtab
->
size
/
mtab
->
fmode
[
FT_SHORT
].
sub
;
int
size_m
=
mtab
->
size
/
mtab
->
fmode
[
FT_MEDIUM
].
sub
;
int
channels
=
tctx
->
avctx
->
channels
;
float
norm
=
channels
==
1
?
2
.
:
1
.
;
float
norm
=
channels
==
1
?
2
.
0
:
1
.
0
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
bsize
=
tctx
->
mtab
->
size
/
tctx
->
mtab
->
fmode
[
i
].
sub
;
...
...
libavcodec/vorbisenc.c
View file @
4a2ef394
...
...
@@ -189,7 +189,7 @@ static int ready_codebook(vorbis_enc_codebook *cb)
cb
->
pow2
[
i
]
+=
cb
->
dimensions
[
i
*
cb
->
ndimensions
+
j
]
*
cb
->
dimensions
[
i
*
cb
->
ndimensions
+
j
];
div
*=
vals
;
}
cb
->
pow2
[
i
]
/=
2
.;
cb
->
pow2
[
i
]
/=
2
.
0
;
}
}
return
0
;
...
...
@@ -728,7 +728,7 @@ static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,
{
int
range
=
255
/
fc
->
multiplier
+
1
;
int
i
;
float
tot_average
=
0
.;
float
tot_average
=
0
.
0
;
float
averages
[
MAX_FLOOR_VALUES
];
for
(
i
=
0
;
i
<
fc
->
values
;
i
++
)
{
averages
[
i
]
=
get_floor_average
(
fc
,
coeffs
,
i
);
...
...
@@ -881,7 +881,7 @@ static int residue_encode(vorbis_enc_context *venc, vorbis_enc_residue *rc,
assert
(
rc
->
type
==
2
);
assert
(
real_ch
==
2
);
for
(
p
=
0
;
p
<
partitions
;
p
++
)
{
float
max1
=
0
.
,
max2
=
0
.
;
float
max1
=
0
.
0
,
max2
=
0
.
0
;
int
s
=
rc
->
begin
+
p
*
psize
;
for
(
k
=
s
;
k
<
s
+
psize
;
k
+=
2
)
{
max1
=
FFMAX
(
max1
,
fabs
(
coeffs
[
k
/
real_ch
]));
...
...
@@ -968,7 +968,7 @@ static int apply_window_and_mdct(vorbis_enc_context *venc,
int
i
,
channel
;
const
float
*
win
=
venc
->
win
[
0
];
int
window_len
=
1
<<
(
venc
->
log2_blocksize
[
0
]
-
1
);
float
n
=
(
float
)(
1
<<
venc
->
log2_blocksize
[
0
])
/
4
.;
float
n
=
(
float
)(
1
<<
venc
->
log2_blocksize
[
0
])
/
4
.
0
;
// FIXME use dsp
if
(
!
venc
->
have_saved
&&
!
samples
)
...
...
libavformat/swfenc.c
View file @
4a2ef394
...
...
@@ -229,7 +229,7 @@ static int swf_write_header(AVFormatContext *s)
}
if
(
!
swf
->
audio_enc
)
swf
->
samples_per_frame
=
(
44100
.
*
rate_base
)
/
rate
;
swf
->
samples_per_frame
=
(
44100
.
0
*
rate_base
)
/
rate
;
else
swf
->
samples_per_frame
=
(
swf
->
audio_enc
->
sample_rate
*
rate_base
)
/
rate
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment