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
af3c8f82
Commit
af3c8f82
authored
May 08, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcmenc:Optimize adpcm_ima_qt_compress_sample()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
35d3d44a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
adpcm.c
libavcodec/adpcm.c
+18
-15
No files found.
libavcodec/adpcm.c
View file @
af3c8f82
...
@@ -274,24 +274,27 @@ static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c, sho
...
@@ -274,24 +274,27 @@ static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c, sho
static
inline
unsigned
char
adpcm_ima_qt_compress_sample
(
ADPCMChannelStatus
*
c
,
short
sample
)
static
inline
unsigned
char
adpcm_ima_qt_compress_sample
(
ADPCMChannelStatus
*
c
,
short
sample
)
{
{
int
delta
=
sample
-
c
->
prev_sample
;
int
delta
=
sample
-
c
->
prev_sample
;
int
mask
,
step
=
step_table
[
c
->
step_index
];
int
diff
,
step
=
step_table
[
c
->
step_index
];
int
diff
=
step
>>
3
;
int
nibble
=
8
*
(
delta
<
0
);
int
nibble
=
0
;
if
(
delta
<
0
)
{
delta
=
abs
(
delta
);
nibble
=
8
;
diff
=
delta
+
(
step
>>
3
);
delta
=
-
delta
;
}
for
(
mask
=
4
;
mask
;)
{
if
(
delta
>=
step
)
{
if
(
delta
>=
step
)
{
nibble
|=
mask
;
nibble
|=
4
;
delta
-=
step
;
delta
-=
step
;
diff
+=
step
;
}
}
step
>>=
1
;
step
>>=
1
;
mask
>>=
1
;
if
(
delta
>=
step
)
{
nibble
|=
2
;
delta
-=
step
;
}
step
>>=
1
;
if
(
delta
>=
step
)
{
nibble
|=
1
;
delta
-=
step
;
}
}
diff
-=
delta
;
if
(
nibble
&
8
)
if
(
nibble
&
8
)
c
->
prev_sample
-=
diff
;
c
->
prev_sample
-=
diff
;
...
...
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