PCM signed 16-bit big-endian planar decoder
authorPaul B Mahol <onemda@gmail.com>
Tue, 23 Jun 2015 12:48:07 +0000 (13:48 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 24 Jun 2015 13:45:00 +0000 (14:45 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
doc/general.texi
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/avcodec.h
libavcodec/codec_desc.c
libavcodec/pcm.c
libavcodec/utils.c
libavcodec/version.h
libavformat/nut.c

index 2f3ea33..0beffad 100644 (file)
@@ -880,6 +880,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
     @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
 @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
index 7b9f215..dcdd428 100644 (file)
@@ -496,6 +496,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_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
 OBJS-$(CONFIG_PCM_S16LE_DECODER)          += pcm.o
 OBJS-$(CONFIG_PCM_S16LE_ENCODER)          += pcm.o
 OBJS-$(CONFIG_PCM_S16LE_PLANAR_DECODER)   += pcm.o
index 82dbd5b..33e6646 100644 (file)
@@ -384,6 +384,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_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);
     REGISTER_ENCDEC (PCM_S16LE,         pcm_s16le);
     REGISTER_DECODER(PCM_S16LE_PLANAR,  pcm_s16le_planar);
     REGISTER_ENCDEC (PCM_S24BE,         pcm_s24be);
index 42e2fcf..7191e8b 100644 (file)
@@ -331,6 +331,7 @@ enum AVCodecID {
     AV_CODEC_ID_PCM_S8_PLANAR,
     AV_CODEC_ID_PCM_S24LE_PLANAR,
     AV_CODEC_ID_PCM_S32LE_PLANAR,
     AV_CODEC_ID_PCM_S8_PLANAR,
     AV_CODEC_ID_PCM_S24LE_PLANAR,
     AV_CODEC_ID_PCM_S32LE_PLANAR,
+    AV_CODEC_ID_PCM_S16BE_PLANAR,
 
     /* various ADPCM codecs */
     AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
 
     /* various ADPCM codecs */
     AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
index a9a0b4f..0919a89 100644 (file)
@@ -1491,6 +1491,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .props     = AV_CODEC_PROP_LOSSY,
     },
     {
         .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",
         .id        = AV_CODEC_ID_PCM_S16LE_PLANAR,
         .type      = AVMEDIA_TYPE_AUDIO,
         .name      = "pcm_s16le_planar",
index e06712e..a87aafc 100644 (file)
@@ -347,6 +347,9 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
             samples += 2;
         }
         break;
             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;
     case AV_CODEC_ID_PCM_S16LE_PLANAR:
         DECODE_PLANAR(16, le16, src, samples, n, 0, 0);
         break;
@@ -506,6 +509,7 @@ PCM_DECODER(PCM_LXF,          AV_SAMPLE_FMT_S32P, pcm_lxf,          "PCM signed
 PCM_CODEC  (PCM_MULAW,        AV_SAMPLE_FMT_S16, pcm_mulaw,        "PCM 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_CODEC  (PCM_MULAW,        AV_SAMPLE_FMT_S16, pcm_mulaw,        "PCM 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 16-bit little-endian planar");
 PCM_CODEC  (PCM_S24BE,        AV_SAMPLE_FMT_S32, pcm_s24be,        "PCM signed 24-bit big-endian");
 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 16-bit little-endian planar");
 PCM_CODEC  (PCM_S24BE,        AV_SAMPLE_FMT_S32, pcm_s24be,        "PCM signed 24-bit big-endian");
index c9ae19b..a144392 100644 (file)
@@ -2134,6 +2134,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_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:
     case AV_CODEC_ID_PCM_S16LE:
     case AV_CODEC_ID_PCM_S16LE_PLANAR:
     case AV_CODEC_ID_PCM_U16BE:
index 52df2f6..f043b3f 100644 (file)
@@ -29,7 +29,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 56
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR 28
+#define LIBAVCODEC_VERSION_MINOR 29
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
index 43ae8a0..828d9ca 100644 (file)
@@ -149,6 +149,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_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) },
     { 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) },