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
fc600eff
Commit
fc600eff
authored
Aug 17, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add 64-bit signed pcm codec
parent
9876d8fc
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
40 additions
and
5 deletions
+40
-5
Makefile
libavcodec/Makefile
+4
-0
allcodecs.c
libavcodec/allcodecs.c
+2
-0
avcodec.h
libavcodec/avcodec.h
+3
-3
codec_desc.c
libavcodec/codec_desc.c
+14
-0
pcm.c
libavcodec/pcm.c
+10
-1
utils.c
libavcodec/utils.c
+3
-0
version.h
libavcodec/version.h
+1
-1
riff.c
libavformat/riff.c
+1
-0
utils.c
libavformat/utils.c
+2
-0
No files found.
libavcodec/Makefile
View file @
fc600eff
...
...
@@ -689,6 +689,10 @@ OBJS-$(CONFIG_PCM_S32LE_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_S32LE_ENCODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_S32LE_PLANAR_DECODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_S32LE_PLANAR_ENCODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_S64BE_DECODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_S64BE_ENCODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_S64LE_DECODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_S64LE_ENCODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_U8_DECODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_U8_ENCODER)
+=
pcm.o
OBJS-$(CONFIG_PCM_U16BE_DECODER)
+=
pcm.o
...
...
libavcodec/allcodecs.c
View file @
fc600eff
...
...
@@ -487,6 +487,8 @@ void avcodec_register_all(void)
REGISTER_ENCDEC
(
PCM_S32BE
,
pcm_s32be
);
REGISTER_ENCDEC
(
PCM_S32LE
,
pcm_s32le
);
REGISTER_ENCDEC
(
PCM_S32LE_PLANAR
,
pcm_s32le_planar
);
REGISTER_ENCDEC
(
PCM_S64BE
,
pcm_s64be
);
REGISTER_ENCDEC
(
PCM_S64LE
,
pcm_s64le
);
REGISTER_ENCDEC
(
PCM_U8
,
pcm_u8
);
REGISTER_ENCDEC
(
PCM_U16BE
,
pcm_u16be
);
REGISTER_ENCDEC
(
PCM_U16LE
,
pcm_u16le
);
...
...
libavcodec/avcodec.h
View file @
fc600eff
...
...
@@ -445,9 +445,9 @@ enum AVCodecID {
AV_CODEC_ID_PCM_S24LE_PLANAR
,
AV_CODEC_ID_PCM_S32LE_PLANAR
,
AV_CODEC_ID_PCM_S16BE_PLANAR
,
/* new PCM "codecs" should be added right below this line starting with
* an explicit value of for example 0x10800
*/
AV_CODEC_ID_PCM_S64LE
=
0x10800
,
AV_CODEC_ID_PCM_S64BE
,
/* various ADPCM codecs */
AV_CODEC_ID_ADPCM_IMA_QT
=
0x11000
,
...
...
libavcodec/codec_desc.c
View file @
fc600eff
...
...
@@ -1636,6 +1636,20 @@ static const AVCodecDescriptor codec_descriptors[] = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"PCM signed 32-bit big-endian"
),
.
props
=
AV_CODEC_PROP_LOSSLESS
,
},
{
.
id
=
AV_CODEC_ID_PCM_S64LE
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
name
=
"pcm_s64le"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"PCM signed 64-bit little-endian"
),
.
props
=
AV_CODEC_PROP_LOSSLESS
,
},
{
.
id
=
AV_CODEC_ID_PCM_S64BE
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
name
=
"pcm_s64be"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"PCM signed 64-bit big-endian"
),
.
props
=
AV_CODEC_PROP_LOSSLESS
,
},
{
.
id
=
AV_CODEC_ID_PCM_U32LE
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
...
...
libavcodec/pcm.c
View file @
fc600eff
...
...
@@ -145,6 +145,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
ENCODE_PLANAR
(
uint8_t
,
byte
,
dst
,
n
,
0
,
-
128
)
break
;
#if HAVE_BIGENDIAN
case
AV_CODEC_ID_PCM_S64LE
:
case
AV_CODEC_ID_PCM_F64LE
:
ENCODE
(
int64_t
,
le64
,
samples
,
dst
,
n
,
0
,
0
)
break
;
...
...
@@ -163,9 +164,11 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
break
;
case
AV_CODEC_ID_PCM_F64BE
:
case
AV_CODEC_ID_PCM_F32BE
:
case
AV_CODEC_ID_PCM_S64BE
:
case
AV_CODEC_ID_PCM_S32BE
:
case
AV_CODEC_ID_PCM_S16BE
:
#else
case
AV_CODEC_ID_PCM_S64BE
:
case
AV_CODEC_ID_PCM_F64BE
:
ENCODE
(
int64_t
,
be64
,
samples
,
dst
,
n
,
0
,
0
)
break
;
...
...
@@ -181,6 +184,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
break
;
case
AV_CODEC_ID_PCM_F64LE
:
case
AV_CODEC_ID_PCM_F32LE
:
case
AV_CODEC_ID_PCM_S64LE
:
case
AV_CODEC_ID_PCM_S32LE
:
case
AV_CODEC_ID_PCM_S16LE
:
#endif
/* HAVE_BIGENDIAN */
...
...
@@ -390,6 +394,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
}
break
;
#if HAVE_BIGENDIAN
case
AV_CODEC_ID_PCM_S64LE
:
case
AV_CODEC_ID_PCM_F64LE
:
DECODE
(
64
,
le64
,
src
,
samples
,
n
,
0
,
0
)
break
;
...
...
@@ -408,9 +413,11 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
break
;
case
AV_CODEC_ID_PCM_F64BE
:
case
AV_CODEC_ID_PCM_F32BE
:
case
AV_CODEC_ID_PCM_S64BE
:
case
AV_CODEC_ID_PCM_S32BE
:
case
AV_CODEC_ID_PCM_S16BE
:
#else
case
AV_CODEC_ID_PCM_S64BE
:
case
AV_CODEC_ID_PCM_F64BE
:
DECODE
(
64
,
be64
,
src
,
samples
,
n
,
0
,
0
)
break
;
...
...
@@ -426,6 +433,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
break
;
case
AV_CODEC_ID_PCM_F64LE
:
case
AV_CODEC_ID_PCM_F32LE
:
case
AV_CODEC_ID_PCM_S64LE
:
case
AV_CODEC_ID_PCM_S32LE
:
case
AV_CODEC_ID_PCM_S16LE
:
#endif
/* HAVE_BIGENDIAN */
...
...
@@ -568,4 +576,5 @@ PCM_CODEC (PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned
PCM_CODEC
(
PCM_U32BE
,
AV_SAMPLE_FMT_S32
,
pcm_u32be
,
"PCM unsigned 32-bit big-endian"
);
PCM_CODEC
(
PCM_U32LE
,
AV_SAMPLE_FMT_S32
,
pcm_u32le
,
"PCM unsigned 32-bit little-endian"
);
PCM_DECODER
(
PCM_ZORK
,
AV_SAMPLE_FMT_U8
,
pcm_zork
,
"PCM Zork"
);
PCM_CODEC
(
PCM_S64BE
,
AV_SAMPLE_FMT_S64
,
pcm_s64be
,
"PCM signed 64-bit big-endian"
);
PCM_CODEC
(
PCM_S64LE
,
AV_SAMPLE_FMT_S64
,
pcm_s64le
,
"PCM signed 64-bit little-endian"
);
libavcodec/utils.c
View file @
fc600eff
...
...
@@ -3419,6 +3419,8 @@ int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
return
32
;
case
AV_CODEC_ID_PCM_F64BE
:
case
AV_CODEC_ID_PCM_F64LE
:
case
AV_CODEC_ID_PCM_S64BE
:
case
AV_CODEC_ID_PCM_S64LE
:
return
64
;
default
:
return
0
;
...
...
@@ -3436,6 +3438,7 @@ enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be)
[
AV_SAMPLE_FMT_U8P
]
=
{
AV_CODEC_ID_PCM_U8
,
AV_CODEC_ID_PCM_U8
},
[
AV_SAMPLE_FMT_S16P
]
=
{
AV_CODEC_ID_PCM_S16LE
,
AV_CODEC_ID_PCM_S16BE
},
[
AV_SAMPLE_FMT_S32P
]
=
{
AV_CODEC_ID_PCM_S32LE
,
AV_CODEC_ID_PCM_S32BE
},
[
AV_SAMPLE_FMT_S64P
]
=
{
AV_CODEC_ID_PCM_S64LE
,
AV_CODEC_ID_PCM_S64BE
},
[
AV_SAMPLE_FMT_FLTP
]
=
{
AV_CODEC_ID_PCM_F32LE
,
AV_CODEC_ID_PCM_F32BE
},
[
AV_SAMPLE_FMT_DBLP
]
=
{
AV_CODEC_ID_PCM_F64LE
,
AV_CODEC_ID_PCM_F64BE
},
};
...
...
libavcodec/version.h
View file @
fc600eff
...
...
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 5
3
#define LIBAVCODEC_VERSION_MINOR 5
4
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
libavformat/riff.c
View file @
fc600eff
...
...
@@ -436,6 +436,7 @@ const AVCodecTag ff_codec_wav_tags[] = {
{
AV_CODEC_ID_PCM_U8
,
0x0001
},
{
AV_CODEC_ID_PCM_S24LE
,
0x0001
},
{
AV_CODEC_ID_PCM_S32LE
,
0x0001
},
{
AV_CODEC_ID_PCM_S64LE
,
0x0001
},
{
AV_CODEC_ID_ADPCM_MS
,
0x0002
},
{
AV_CODEC_ID_PCM_F32LE
,
0x0003
},
/* must come after f32le in this list */
...
...
libavformat/utils.c
View file @
fc600eff
...
...
@@ -2991,6 +2991,8 @@ enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags)
return
be
?
AV_CODEC_ID_PCM_S24BE
:
AV_CODEC_ID_PCM_S24LE
;
case
4
:
return
be
?
AV_CODEC_ID_PCM_S32BE
:
AV_CODEC_ID_PCM_S32LE
;
case
8
:
return
be
?
AV_CODEC_ID_PCM_S64BE
:
AV_CODEC_ID_PCM_S64LE
;
default
:
return
AV_CODEC_ID_NONE
;
}
...
...
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