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
f56f96d8
Commit
f56f96d8
authored
May 30, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faster float->short conversation
Originally committed as revision 4319 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
e19ca845
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
vorbis.c
libavcodec/vorbis.c
+12
-10
No files found.
libavcodec/vorbis.c
View file @
f56f96d8
...
...
@@ -1188,6 +1188,7 @@ static int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr, uint_fa
}
// Decode the audio packet using the functions above
#define BIAS 384
static
int
vorbis_parse_audio_packet
(
vorbis_context
*
vc
)
{
GetBitContext
*
gb
=&
vc
->
gb
;
...
...
@@ -1337,15 +1338,15 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) {
// -- overlap/add
if
(
previous_window
)
{
for
(
k
=
j
,
i
=
0
;
i
<
vc
->
blocksize_1
/
2
;
++
i
,
k
+=
step
)
{
ret
[
k
]
=
saved
[
i
]
+
buf
[
i
]
*
lwin
[
i
];
ret
[
k
]
=
saved
[
i
]
+
buf
[
i
]
*
lwin
[
i
]
+
BIAS
;
}
retlen
=
vc
->
blocksize_1
/
2
;
}
else
{
for
(
k
=
j
,
i
=
0
;
i
<
vc
->
blocksize_0
/
2
;
++
i
,
k
+=
step
)
{
ret
[
k
]
=
saved
[
i
]
+
buf
[(
vc
->
blocksize_1
-
vc
->
blocksize_0
)
/
4
+
i
]
*
swin
[
i
];
ret
[
k
]
=
saved
[
i
]
+
buf
[(
vc
->
blocksize_1
-
vc
->
blocksize_0
)
/
4
+
i
]
*
swin
[
i
]
+
BIAS
;
}
for
(
i
=
0
;
i
<
(
vc
->
blocksize_1
-
vc
->
blocksize_0
)
/
4
;
++
i
,
k
+=
step
)
{
ret
[
k
]
=
buf
[
vc
->
blocksize_0
/
2
+
(
vc
->
blocksize_1
-
vc
->
blocksize_0
)
/
4
+
i
];
ret
[
k
]
=
buf
[
vc
->
blocksize_0
/
2
+
(
vc
->
blocksize_1
-
vc
->
blocksize_0
)
/
4
+
i
]
+
BIAS
;
}
retlen
=
vc
->
blocksize_0
/
2
+
(
vc
->
blocksize_1
-
vc
->
blocksize_0
)
/
4
;
}
...
...
@@ -1367,10 +1368,10 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) {
}
else
{
// --overlap/add
for
(
k
=
j
,
i
=
0
;
i
<
saved_start
;
++
i
,
k
+=
step
)
{
ret
[
k
]
=
saved
[
i
];
ret
[
k
]
=
saved
[
i
]
+
BIAS
;
}
for
(
i
=
0
;
i
<
vc
->
blocksize_0
/
2
;
++
i
,
k
+=
step
)
{
ret
[
k
]
=
saved
[
saved_start
+
i
]
+
buf
[
i
]
*
swin
[
i
];
ret
[
k
]
=
saved
[
saved_start
+
i
]
+
buf
[
i
]
*
swin
[
i
]
+
BIAS
;
}
retlen
=
saved_start
+
vc
->
blocksize_0
/
2
;
// -- save
...
...
@@ -1420,13 +1421,14 @@ static int vorbis_decode_frame(AVCodecContext *avccontext,
AV_DEBUG
(
"parsed %d bytes %d bits, returned %d samples (*ch*bits)
\n
"
,
get_bits_count
(
gb
)
/
8
,
get_bits_count
(
gb
)
%
8
,
len
);
for
(
i
=
0
;
i
<
len
;
++
i
)
{
int_fast32_t
tmp
;
tmp
=
vc
->
ret
[
i
]
*
32768
;
if
(
tmp
>
32767
)
tmp
=
32767
;
if
(
tmp
<-
32768
)
tmp
=
-
32768
;
int_fast32_t
tmp
=
((
int32_t
*
)
vc
->
ret
)[
i
]
;
if
(
tmp
>
0x43c07fff
)
tmp
=
32767
;
else
if
(
tmp
<
0x43bf8000
)
tmp
=
-
32768
;
((
int16_t
*
)
data
)[
i
]
=
tmp
;
}
*
data_size
=
len
*
2
;
return
buf_size
;
...
...
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