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
af3f793f
Commit
af3f793f
authored
Oct 28, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add ADPCM AICA decoder
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
e99321a3
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
33 additions
and
1 deletion
+33
-1
Changelog
Changelog
+1
-0
general.texi
doc/general.texi
+1
-0
Makefile
libavcodec/Makefile
+1
-0
adpcm.c
libavcodec/adpcm.c
+18
-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
genh.c
libavformat/genh.c
+1
-0
No files found.
Changelog
View file @
af3f793f
...
...
@@ -28,6 +28,7 @@ version <next>:
- SDX2 DPCM decoder
- vibrato filter
- innoHeim/Rsupport Screen Capture Codec decoder
- ADPCM AICA decoder
version 2.8:
...
...
doc/general.texi
View file @
af3f793f
...
...
@@ -887,6 +887,7 @@ following image formats are supported:
@tab encoding supported through external library libfaac and libvo-aacenc
@item AC-3 @tab IX @tab IX
@item ADPCM 4X Movie @tab @tab X
@item APDCM Yamaha AICA @tab @tab X
@item ADPCM CDROM XA @tab @tab X
@item ADPCM Creative Technology @tab @tab X
@tab 16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
...
...
libavcodec/Makefile
View file @
af3f793f
...
...
@@ -662,6 +662,7 @@ OBJS-$(CONFIG_ADPCM_4XM_DECODER) += adpcm.o adpcm_data.o
OBJS-$(CONFIG_ADPCM_ADX_DECODER)
+=
adxdec.o
adx.o
OBJS-$(CONFIG_ADPCM_ADX_ENCODER)
+=
adxenc.o
adx.o
OBJS-$(CONFIG_ADPCM_AFC_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_AICA_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_CT_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_DTK_DECODER)
+=
adpcm.o
adpcm_data.o
OBJS-$(CONFIG_ADPCM_EA_DECODER)
+=
adpcm.o
adpcm_data.o
...
...
libavcodec/adpcm.c
View file @
af3f793f
...
...
@@ -143,6 +143,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_QT
:
case
AV_CODEC_ID_ADPCM_IMA_WAV
:
case
AV_CODEC_ID_ADPCM_4XM
:
...
...
@@ -521,6 +522,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
case
AV_CODEC_ID_ADPCM_IMA_OKI
:
case
AV_CODEC_ID_ADPCM_IMA_WS
:
case
AV_CODEC_ID_ADPCM_YAMAHA
:
case
AV_CODEC_ID_ADPCM_AICA
:
nb_samples
=
buf_size
*
2
/
ch
;
break
;
}
...
...
@@ -1380,6 +1382,21 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
st
],
v
>>
4
);
}
break
;
case
AV_CODEC_ID_ADPCM_AICA
:
if
(
!
c
->
has_status
)
{
for
(
channel
=
0
;
channel
<
avctx
->
channels
;
channel
++
)
c
->
status
[
channel
].
step
=
0
;
c
->
has_status
=
1
;
}
for
(
channel
=
0
;
channel
<
avctx
->
channels
;
channel
++
)
{
samples
=
samples_p
[
channel
];
for
(
n
=
nb_samples
>>
1
;
n
>
0
;
n
--
)
{
int
v
=
bytestream2_get_byteu
(
&
gb
);
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
channel
],
v
&
0x0F
);
*
samples
++
=
adpcm_yamaha_expand_nibble
(
&
c
->
status
[
channel
],
v
>>
4
);
}
}
break
;
case
AV_CODEC_ID_ADPCM_AFC
:
{
int
samples_per_block
;
...
...
@@ -1642,6 +1659,7 @@ AVCodec ff_ ## name_ ## _decoder = { \
/* Note: Do not forget to add new entries to the Makefile as well. */
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_4XM
,
sample_fmts_s16p
,
adpcm_4xm
,
"ADPCM 4X Movie"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_AFC
,
sample_fmts_s16p
,
adpcm_afc
,
"ADPCM Nintendo Gamecube AFC"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_AICA
,
sample_fmts_s16p
,
adpcm_aica
,
"ADPCM Yamaha AICA"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_CT
,
sample_fmts_s16
,
adpcm_ct
,
"ADPCM Creative Technology"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_DTK
,
sample_fmts_s16p
,
adpcm_dtk
,
"ADPCM Nintendo Gamecube DTK"
);
ADPCM_DECODER
(
AV_CODEC_ID_ADPCM_EA
,
sample_fmts_s16
,
adpcm_ea
,
"ADPCM Electronic Arts"
);
...
...
libavcodec/allcodecs.c
View file @
af3f793f
...
...
@@ -488,6 +488,7 @@ void avcodec_register_all(void)
REGISTER_DECODER
(
ADPCM_4XM
,
adpcm_4xm
);
REGISTER_ENCDEC
(
ADPCM_ADX
,
adpcm_adx
);
REGISTER_DECODER
(
ADPCM_AFC
,
adpcm_afc
);
REGISTER_DECODER
(
ADPCM_AICA
,
adpcm_aica
);
REGISTER_DECODER
(
ADPCM_CT
,
adpcm_ct
);
REGISTER_DECODER
(
ADPCM_DTK
,
adpcm_dtk
);
REGISTER_DECODER
(
ADPCM_EA
,
adpcm_ea
);
...
...
libavcodec/avcodec.h
View file @
af3f793f
...
...
@@ -396,6 +396,7 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_G726LE
,
AV_CODEC_ID_ADPCM_THP_LE
,
AV_CODEC_ID_ADPCM_PSX
,
AV_CODEC_ID_ADPCM_AICA
,
/* AMR */
AV_CODEC_ID_AMR_NB
=
0x12000
,
...
...
libavcodec/codec_desc.c
View file @
af3f793f
...
...
@@ -1999,6 +1999,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ADPCM Playstation"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
},
{
.
id
=
AV_CODEC_ID_ADPCM_AICA
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
name
=
"adpcm_aica"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"ADPCM Yamaha AICA"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
},
/* AMR */
{
...
...
libavcodec/utils.c
View file @
af3f793f
...
...
@@ -2901,6 +2901,7 @@ int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
case
AV_CODEC_ID_ADPCM_IMA_WS
:
case
AV_CODEC_ID_ADPCM_G722
:
case
AV_CODEC_ID_ADPCM_YAMAHA
:
case
AV_CODEC_ID_ADPCM_AICA
:
return
4
;
case
AV_CODEC_ID_DSD_LSBF
:
case
AV_CODEC_ID_DSD_MSBF
:
...
...
libavcodec/version.h
View file @
af3f793f
...
...
@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 1
2
#define LIBAVCODEC_VERSION_MINOR 1
3
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
libavformat/genh.c
View file @
af3f793f
...
...
@@ -90,6 +90,7 @@ static int genh_read_header(AVFormatContext *s)
return
ret
;
AV_WL16
(
st
->
codec
->
extradata
,
3
);
st
->
codec
->
codec_id
=
AV_CODEC_ID_ADPCM_IMA_WS
;
break
;
case
10
:
st
->
codec
->
codec_id
=
AV_CODEC_ID_ADPCM_AICA
;
break
;
case
12
:
st
->
codec
->
codec_id
=
AV_CODEC_ID_ADPCM_THP
;
break
;
case
13
:
st
->
codec
->
codec_id
=
AV_CODEC_ID_PCM_U8
;
break
;
case
17
:
st
->
codec
->
codec_id
=
AV_CODEC_ID_ADPCM_IMA_QT
;
break
;
...
...
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