aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pcm.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-08-17 19:46:21 +0200
committerPaul B Mahol <onemda@gmail.com>2016-08-18 15:30:05 +0200
commitfc600eff630faebda980b7d6fcf02569ebd3bb11 (patch)
treeb063be79da4efc0e58272b550cc41b9655ebaa23 /libavcodec/pcm.c
parent9876d8fc6d2b77d5aa31a4b748241b9ebb797167 (diff)
downloadffmpeg-fc600eff630faebda980b7d6fcf02569ebd3bb11.tar.gz
avcodec: add 64-bit signed pcm codec
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r--libavcodec/pcm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 9a13602543..2e8e8e73a6 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -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");