aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-11-15 16:17:55 +0000
committerPaul B Mahol <onemda@gmail.com>2012-11-17 19:30:08 +0000
commit9ba41ae63e079198ef4a9e83b5fa147e20966bdb (patch)
tree2557e93ebacd42d141872eaf128b5b804f7b1399
parent37e2a9783fd07558e2ce49b7cf2f617bf500f512 (diff)
downloadffmpeg-9ba41ae63e079198ef4a9e83b5fa147e20966bdb.tar.gz
PCM signed 16-bit big-endian planar decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--doc/general.texi1
-rw-r--r--libavcodec/Makefile1
-rw-r--r--libavcodec/allcodecs.c1
-rw-r--r--libavcodec/avcodec.h1
-rw-r--r--libavcodec/codec_desc.c7
-rw-r--r--libavcodec/pcm.c4
-rw-r--r--libavcodec/utils.c1
-rw-r--r--libavcodec/version.h2
-rw-r--r--libavformat/nut.c1
9 files changed, 18 insertions, 1 deletions
diff --git a/doc/general.texi b/doc/general.texi
index be8a63485a..e743c5d168 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -826,6 +826,7 @@ following image formats are supported:
@tab supported through external library libopus
@item PCM A-law @tab X @tab X
@item PCM mu-law @tab X @tab X
+@item PCM signed 16-bit big-endian planar @tab @tab X
@item PCM signed 16-bit little-endian planar @tab @tab X
@item PCM signed 24-bit little-endian planar @tab @tab X
@item PCM signed 32-bit little-endian planar @tab @tab X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c7724e8e12..7b3462e3c2 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -524,6 +524,7 @@ OBJS-$(CONFIG_PCM_S8_ENCODER) += pcm.o
OBJS-$(CONFIG_PCM_S8_PLANAR_DECODER) += 8svx.o
OBJS-$(CONFIG_PCM_S16BE_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_S16BE_ENCODER) += pcm.o
+OBJS-$(CONFIG_PCM_S16BE_PLANAR_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_S16LE_DECODER) += pcm.o
OBJS-$(CONFIG_PCM_S16LE_ENCODER) += pcm.o
OBJS-$(CONFIG_PCM_S16LE_PLANAR_DECODER) += pcm.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index efefbfdc12..e47ff5b73b 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -358,6 +358,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (PCM_S8, pcm_s8);
REGISTER_DECODER (PCM_S8_PLANAR, pcm_s8_planar);
REGISTER_ENCDEC (PCM_S16BE, pcm_s16be);
+ REGISTER_DECODER (PCM_S16BE_PLANAR, pcm_s16be_planar);
REGISTER_ENCDEC (PCM_S16LE, pcm_s16le);
REGISTER_DECODER (PCM_S16LE_PLANAR, pcm_s16le_planar);
REGISTER_ENCDEC (PCM_S24BE, pcm_s24be);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index a59e7f8fa5..511cfc665d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -317,6 +317,7 @@ enum AVCodecID {
AV_CODEC_ID_PCM_S8_PLANAR,
AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'),
AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'),
+ AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16),
/* various ADPCM codecs */
AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 0d1f740adc..2cb24167b9 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1448,6 +1448,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSY,
},
{
+ .id = AV_CODEC_ID_PCM_S16BE_PLANAR,
+ .type = AVMEDIA_TYPE_AUDIO,
+ .name = "pcm_s16be_planar",
+ .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16-bit big-endian planar"),
+ .props = AV_CODEC_PROP_LOSSLESS,
+ },
+ {
.id = AV_CODEC_ID_PCM_S16LE_PLANAR,
.type = AVMEDIA_TYPE_AUDIO,
.name = "pcm_s16le_planar",
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index f024775aa9..9661ed5a14 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -356,6 +356,9 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
samples += 2;
}
break;
+ case AV_CODEC_ID_PCM_S16BE_PLANAR:
+ DECODE_PLANAR(16, be16, src, samples, n, 0, 0);
+ break;
case AV_CODEC_ID_PCM_S16LE_PLANAR:
DECODE_PLANAR(16, le16, src, samples, n, 0, 0);
break;
@@ -548,6 +551,7 @@ PCM_DECODER(PCM_LXF, AV_SAMPLE_FMT_S32P,pcm_lxf, "PCM signed 2
PCM_CODEC (PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law / G.711 mu-law");
PCM_CODEC (PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit");
PCM_CODEC (PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
+PCM_DECODER(PCM_S16BE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16be_planar, "PCM signed 16-bit big-endian planar");
PCM_CODEC (PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
PCM_DECODER(PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16le_planar, "PCM signed 16-bit little-endian planar");
PCM_CODEC (PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index bce5a09265..a4df3f3548 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2311,6 +2311,7 @@ int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
case AV_CODEC_ID_PCM_ZORK:
return 8;
case AV_CODEC_ID_PCM_S16BE:
+ case AV_CODEC_ID_PCM_S16BE_PLANAR:
case AV_CODEC_ID_PCM_S16LE:
case AV_CODEC_ID_PCM_S16LE_PLANAR:
case AV_CODEC_ID_PCM_U16BE:
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 006e8f16c5..4a658d8285 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR 72
+#define LIBAVCODEC_VERSION_MINOR 73
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavformat/nut.c b/libavformat/nut.c
index 7a400f8fa0..927b3d0f36 100644
--- a/libavformat/nut.c
+++ b/libavformat/nut.c
@@ -167,6 +167,7 @@ const AVCodecTag ff_nut_audio_tags[] = {
{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
{ AV_CODEC_ID_PCM_U8, MKTAG('P', 'U', 'D', 8 ) },
+ { AV_CODEC_ID_PCM_S16BE_PLANAR, MKTAG(16 , 'P', 'S', 'P') },
{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) },
{ AV_CODEC_ID_PCM_S24LE_PLANAR, MKTAG('P', 'S', 'P', 24 ) },
{ AV_CODEC_ID_PCM_S32LE_PLANAR, MKTAG('P', 'S', 'P', 32 ) },