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
05adf49c
Commit
05adf49c
authored
Apr 13, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant &.
Originally committed as revision 12795 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
54a0b6e5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
adpcm.c
libavcodec/adpcm.c
+19
-19
No files found.
libavcodec/adpcm.c
View file @
05adf49c
...
@@ -862,7 +862,7 @@ static void xa_decode(short *out, const unsigned char *in,
...
@@ -862,7 +862,7 @@ static void xa_decode(short *out, const unsigned char *in,
#define DK3_GET_NEXT_NIBBLE() \
#define DK3_GET_NEXT_NIBBLE() \
if (decode_top_nibble_next) \
if (decode_top_nibble_next) \
{ \
{ \
nibble =
(last_byte >> 4) & 0x0F
; \
nibble =
last_byte >> 4
; \
decode_top_nibble_next = 0; \
decode_top_nibble_next = 0; \
} \
} \
else \
else \
...
@@ -950,7 +950,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -950,7 +950,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
for
(
m
=
32
;
n
>
0
&&
m
>
0
;
n
--
,
m
--
)
{
/* in QuickTime, IMA is encoded by chuncks of 34 bytes (=64 samples) */
for
(
m
=
32
;
n
>
0
&&
m
>
0
;
n
--
,
m
--
)
{
/* in QuickTime, IMA is encoded by chuncks of 34 bytes (=64 samples) */
*
samples
=
adpcm_ima_expand_nibble
(
cs
,
src
[
0
]
&
0x0F
,
3
);
*
samples
=
adpcm_ima_expand_nibble
(
cs
,
src
[
0
]
&
0x0F
,
3
);
samples
+=
avctx
->
channels
;
samples
+=
avctx
->
channels
;
*
samples
=
adpcm_ima_expand_nibble
(
cs
,
(
src
[
0
]
>>
4
)
&
0x0F
,
3
);
*
samples
=
adpcm_ima_expand_nibble
(
cs
,
src
[
0
]
>>
4
,
3
);
samples
+=
avctx
->
channels
;
samples
+=
avctx
->
channels
;
src
++
;
src
++
;
}
}
...
@@ -1053,7 +1053,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1053,7 +1053,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
*
samples
++
=
c
->
status
[
0
].
sample2
;
*
samples
++
=
c
->
status
[
0
].
sample2
;
if
(
st
)
*
samples
++
=
c
->
status
[
1
].
sample2
;
if
(
st
)
*
samples
++
=
c
->
status
[
1
].
sample2
;
for
(;
n
>
0
;
n
--
)
{
for
(;
n
>
0
;
n
--
)
{
*
samples
++
=
adpcm_ms_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
);
*
samples
++
=
adpcm_ms_expand_nibble
(
&
c
->
status
[
0
],
src
[
0
]
>>
4
);
*
samples
++
=
adpcm_ms_expand_nibble
(
&
c
->
status
[
st
],
src
[
0
]
&
0x0F
);
*
samples
++
=
adpcm_ms_expand_nibble
(
&
c
->
status
[
st
],
src
[
0
]
&
0x0F
);
src
++
;
src
++
;
}
}
...
@@ -1076,7 +1076,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1076,7 +1076,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
/* take care of the top nibble (always left or mono channel) */
/* take care of the top nibble (always left or mono channel) */
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
,
3
);
src
[
0
]
>>
4
,
3
);
/* take care of the bottom nibble, which is right sample for
/* take care of the bottom nibble, which is right sample for
* stereo, or another mono sample */
* stereo, or another mono sample */
...
@@ -1141,12 +1141,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1141,12 +1141,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
if
(
st
)
{
if
(
st
)
{
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
,
3
);
src
[
0
]
>>
4
,
3
);
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
1
],
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
1
],
src
[
0
]
&
0x0F
,
3
);
src
[
0
]
&
0x0F
,
3
);
}
else
{
}
else
{
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
,
3
);
src
[
0
]
>>
4
,
3
);
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
src
[
0
]
&
0x0F
,
3
);
src
[
0
]
&
0x0F
,
3
);
}
}
...
@@ -1204,13 +1204,13 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1204,13 +1204,13 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
src
+=
2
;
src
+=
2
;
for
(
count1
=
0
;
count1
<
samples_in_chunk
/
28
;
count1
++
)
{
for
(
count1
=
0
;
count1
<
samples_in_chunk
/
28
;
count1
++
)
{
coeff1l
=
ea_adpcm_table
[
(
*
src
>>
4
)
&
0x0F
];
coeff1l
=
ea_adpcm_table
[
*
src
>>
4
];
coeff2l
=
ea_adpcm_table
[(
(
*
src
>>
4
)
&
0x0F
)
+
4
];
coeff2l
=
ea_adpcm_table
[(
*
src
>>
4
)
+
4
];
coeff1r
=
ea_adpcm_table
[
*
src
&
0x0F
];
coeff1r
=
ea_adpcm_table
[
*
src
&
0x0F
];
coeff2r
=
ea_adpcm_table
[(
*
src
&
0x0F
)
+
4
];
coeff2r
=
ea_adpcm_table
[(
*
src
&
0x0F
)
+
4
];
src
++
;
src
++
;
shift_left
=
((
*
src
>>
4
)
&
0x0F
)
+
8
;
shift_left
=
(
*
src
>>
4
)
+
8
;
shift_right
=
(
*
src
&
0x0F
)
+
8
;
shift_right
=
(
*
src
&
0x0F
)
+
8
;
src
++
;
src
++
;
...
@@ -1283,8 +1283,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1283,8 +1283,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
samplesC
+=
avctx
->
channels
;
samplesC
+=
avctx
->
channels
;
}
}
}
else
{
}
else
{
coeff1
=
ea_adpcm_table
[
(
*
srcC
>>
4
)
&
0x0F
];
coeff1
=
ea_adpcm_table
[
*
srcC
>>
4
];
coeff2
=
ea_adpcm_table
[(
(
*
srcC
>>
4
)
&
0x0F
)
+
4
];
coeff2
=
ea_adpcm_table
[(
*
srcC
>>
4
)
+
4
];
shift
=
(
*
srcC
++
&
0x0F
)
+
8
;
shift
=
(
*
srcC
++
&
0x0F
)
+
8
;
for
(
count2
=
0
;
count2
<
28
;
count2
++
)
{
for
(
count2
=
0
;
count2
<
28
;
count2
++
)
{
...
@@ -1357,7 +1357,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1357,7 +1357,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
while
(
src
<
buf
+
buf_size
)
{
while
(
src
<
buf
+
buf_size
)
{
char
hi
,
lo
;
char
hi
,
lo
;
lo
=
*
src
&
0x0F
;
lo
=
*
src
&
0x0F
;
hi
=
(
*
src
>>
4
)
&
0x0F
;
hi
=
*
src
>>
4
;
if
(
avctx
->
codec
->
id
==
CODEC_ID_ADPCM_IMA_AMV
)
if
(
avctx
->
codec
->
id
==
CODEC_ID_ADPCM_IMA_AMV
)
FFSWAP
(
char
,
hi
,
lo
);
FFSWAP
(
char
,
hi
,
lo
);
...
@@ -1373,12 +1373,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1373,12 +1373,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
while
(
src
<
buf
+
buf_size
)
{
while
(
src
<
buf
+
buf_size
)
{
if
(
st
)
{
if
(
st
)
{
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
);
src
[
0
]
>>
4
);
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
1
],
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
1
],
src
[
0
]
&
0x0F
);
src
[
0
]
&
0x0F
);
}
else
{
}
else
{
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
);
src
[
0
]
>>
4
);
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_ct_expand_nibble
(
&
c
->
status
[
0
],
src
[
0
]
&
0x0F
);
src
[
0
]
&
0x0F
);
}
}
...
@@ -1398,7 +1398,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1398,7 +1398,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
if
(
avctx
->
codec
->
id
==
CODEC_ID_ADPCM_SBPRO_4
)
{
if
(
avctx
->
codec
->
id
==
CODEC_ID_ADPCM_SBPRO_4
)
{
while
(
src
<
buf
+
buf_size
)
{
while
(
src
<
buf
+
buf_size
)
{
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
,
4
,
0
);
src
[
0
]
>>
4
,
4
,
0
);
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
st
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
st
],
src
[
0
]
&
0x0F
,
4
,
0
);
src
[
0
]
&
0x0F
,
4
,
0
);
src
++
;
src
++
;
...
@@ -1406,7 +1406,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1406,7 +1406,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
else
if
(
avctx
->
codec
->
id
==
CODEC_ID_ADPCM_SBPRO_3
)
{
}
else
if
(
avctx
->
codec
->
id
==
CODEC_ID_ADPCM_SBPRO_3
)
{
while
(
src
<
buf
+
buf_size
&&
samples
+
2
<
samples_end
)
{
while
(
src
<
buf
+
buf_size
&&
samples
+
2
<
samples_end
)
{
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
5
)
&
0x07
,
3
,
0
);
src
[
0
]
>>
5
,
3
,
0
);
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
2
)
&
0x07
,
3
,
0
);
(
src
[
0
]
>>
2
)
&
0x07
,
3
,
0
);
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
...
@@ -1416,7 +1416,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1416,7 +1416,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
else
{
}
else
{
while
(
src
<
buf
+
buf_size
&&
samples
+
3
<
samples_end
)
{
while
(
src
<
buf
+
buf_size
&&
samples
+
3
<
samples_end
)
{
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
6
)
&
0x03
,
2
,
2
);
src
[
0
]
>>
6
,
2
,
2
);
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
st
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
st
],
(
src
[
0
]
>>
4
)
&
0x03
,
2
,
2
);
(
src
[
0
]
>>
4
)
&
0x03
,
2
,
2
);
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_sbpro_expand_nibble
(
&
c
->
status
[
0
],
...
@@ -1494,12 +1494,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
...
@@ -1494,12 +1494,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
0
],
src
[
0
]
&
0x0F
);
src
[
0
]
&
0x0F
);
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
1
],
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
1
],
(
src
[
0
]
>>
4
)
&
0x0F
);
src
[
0
]
>>
4
);
}
else
{
}
else
{
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
0
],
src
[
0
]
&
0x0F
);
src
[
0
]
&
0x0F
);
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
0
],
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
0
],
(
src
[
0
]
>>
4
)
&
0x0F
);
src
[
0
]
>>
4
);
}
}
src
++
;
src
++
;
}
}
...
...
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