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
8a4c3f52
Commit
8a4c3f52
authored
Apr 03, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add adpcm dat4 decoder
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
7d49abdf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
1 deletion
+29
-1
Changelog
Changelog
+1
-0
Makefile
libavcodec/Makefile
+1
-0
adpcm.c
libavcodec/adpcm.c
+16
-0
allcodecs.c
libavcodec/allcodecs.c
+1
-0
avcodec.h
libavcodec/avcodec.h
+1
-0
codec_desc.c
libavcodec/codec_desc.c
+7
-0
utils.c
libavcodec/utils.c
+1
-0
version.h
libavcodec/version.h
+1
-1
No files found.
Changelog
View file @
8a4c3f52
...
...
@@ -18,6 +18,7 @@ version <next>:
- coreimage filter (GPU based image filtering on OSX)
- libdcadec removed
- bitstream filter for extracting DTS core
- ADPCM IMA DAT4 decoder
version 3.0:
- Common Encryption (CENC) MP4 encoding and decoding support
...
...
libavcodec/Makefile
View file @
8a4c3f52
...
...
@@ -695,6 +695,7 @@ OBJS-$(CONFIG_ADPCM_G726_ENCODER) += g726.o
OBJS-$(CONFIG_ADPCM_G726LE_DECODER)
+=
g726.o
OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_APC_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DAT4_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER)
+=
adpcm.o
adpcm_data.o
...
...
libavcodec/adpcm.c
View file @
8a4c3f52
...
...
@@ -110,6 +110,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
case
AV_CODEC_ID_ADPCM_PSX
:
max_channels
=
8
;
break
;
case
AV_CODEC_ID_ADPCM_IMA_DAT4
:
case
AV_CODEC_ID_ADPCM_THP
:
case
AV_CODEC_ID_ADPCM_THP_LE
:
max_channels
=
14
;
...
...
@@ -144,6 +145,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
switch
(
avctx
->
codec
->
id
)
{
case
AV_CODEC_ID_ADPCM_AICA
:
case
AV_CODEC_ID_ADPCM_IMA_DAT4
:
case
AV_CODEC_ID_ADPCM_IMA_QT
:
case
AV_CODEC_ID_ADPCM_IMA_WAV
:
case
AV_CODEC_ID_ADPCM_4XM
:
...
...
@@ -533,6 +535,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
header_size
=
0
;
switch
(
avctx
->
codec
->
id
)
{
case
AV_CODEC_ID_ADPCM_4XM
:
case
AV_CODEC_ID_ADPCM_IMA_DAT4
:
case
AV_CODEC_ID_ADPCM_IMA_ISS
:
header_size
=
4
*
ch
;
break
;
case
AV_CODEC_ID_ADPCM_IMA_AMV
:
header_size
=
8
;
break
;
case
AV_CODEC_ID_ADPCM_IMA_SMJPEG
:
header_size
=
4
*
ch
;
break
;
...
...
@@ -984,6 +987,18 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
st
],
v2
,
3
);
}
break
;
case
AV_CODEC_ID_ADPCM_IMA_DAT4
:
for
(
channel
=
0
;
channel
<
avctx
->
channels
;
channel
++
)
{
cs
=
&
c
->
status
[
channel
];
samples
=
samples_p
[
channel
];
bytestream2_skip
(
&
gb
,
4
);
for
(
n
=
0
;
n
<
nb_samples
;
n
+=
2
)
{
int
v
=
bytestream2_get_byteu
(
&
gb
);
*
samples
++
=
adpcm_ima_expand_nibble
(
cs
,
v
>>
4
,
3
);
*
samples
++
=
adpcm_ima_expand_nibble
(
cs
,
v
&
0x0F
,
3
);
}
}
break
;
case
AV_CODEC_ID_ADPCM_IMA_APC
:
while
(
bytestream2_get_bytes_left
(
&
gb
)
>
0
)
{
int
v
=
bytestream2_get_byteu
(
&
gb
);
...
...
@@ -1670,6 +1685,7 @@ ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R3, sample_fmts_s16p, adpcm_ea_r3,
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_EA_XAS
,
sample_fmts_s16p
,
adpcm_ea_xas
,
"ADPCM Electronic Arts XAS"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_IMA_AMV
,
sample_fmts_s16
,
adpcm_ima_amv
,
"ADPCM IMA AMV"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_IMA_APC
,
sample_fmts_s16
,
adpcm_ima_apc
,
"ADPCM IMA CRYO APC"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_IMA_DAT4
,
sample_fmts_s16
,
adpcm_ima_dat4
,
"ADPCM IMA Eurocom DAT4"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_IMA_DK3
,
sample_fmts_s16
,
adpcm_ima_dk3
,
"ADPCM IMA Duck DK3"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_IMA_DK4
,
sample_fmts_s16
,
adpcm_ima_dk4
,
"ADPCM IMA Duck DK4"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_IMA_EA_EACS
,
sample_fmts_s16
,
adpcm_ima_ea_eacs
,
"ADPCM IMA Electronic Arts EACS"
);
...
...
libavcodec/allcodecs.c
View file @
8a4c3f52
...
...
@@ -515,6 +515,7 @@ void avcodec_register_all(void)
REGISTER_DECODER
(
ADPCM_G726LE
,
adpcm_g726le
);
REGISTER_DECODER
(
ADPCM_IMA_AMV
,
adpcm_ima_amv
);
REGISTER_DECODER
(
ADPCM_IMA_APC
,
adpcm_ima_apc
);
REGISTER_DECODER
(
ADPCM_IMA_DAT4
,
adpcm_ima_dat4
);
REGISTER_DECODER
(
ADPCM_IMA_DK3
,
adpcm_ima_dk3
);
REGISTER_DECODER
(
ADPCM_IMA_DK4
,
adpcm_ima_dk4
);
REGISTER_DECODER
(
ADPCM_IMA_EA_EACS
,
adpcm_ima_ea_eacs
);
...
...
libavcodec/avcodec.h
View file @
8a4c3f52
...
...
@@ -397,6 +397,7 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_THP_LE
,
AV_CODEC_ID_ADPCM_PSX
,
AV_CODEC_ID_ADPCM_AICA
,
AV_CODEC_ID_ADPCM_IMA_DAT4
,
/* AMR */
AV_CODEC_ID_AMR_NB
=
0x12000
,
...
...
libavcodec/codec_desc.c
View file @
8a4c3f52
...
...
@@ -2022,6 +2022,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ADPCM Yamaha AICA"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
},
{
.
id
=
AV_CODEC_ID_ADPCM_IMA_DAT4
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
name
=
"adpcm_ima_dat4"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ADPCM IMA Eurocom DAT4"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
},
/* AMR */
{
...
...
libavcodec/utils.c
View file @
8a4c3f52
...
...
@@ -3239,6 +3239,7 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
case
AV_CODEC_ID_ADPCM_DTK
:
return
frame_bytes
/
(
16
*
ch
)
*
28
;
case
AV_CODEC_ID_ADPCM_4XM
:
case
AV_CODEC_ID_ADPCM_IMA_DAT4
:
case
AV_CODEC_ID_ADPCM_IMA_ISS
:
return
(
frame_bytes
-
4
*
ch
)
*
2
/
ch
;
case
AV_CODEC_ID_ADPCM_IMA_SMJPEG
:
...
...
libavcodec/version.h
View file @
8a4c3f52
...
...
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 3
3
#define LIBAVCODEC_VERSION_MINOR 3
4
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
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