summaryrefslogtreecommitdiff
path: root/libavcodec/pcm.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-11-18 18:50:57 +0000
committerPaul B Mahol <onemda@gmail.com>2012-11-20 11:36:28 +0000
commitda8242e2d6f85d95239082efd0e5e2345e685a2c (patch)
tree1c22ade8d08a190630129f427aca0081b4c73424 /libavcodec/pcm.c
parenta5e382ad7ffd8be810f3a614c4c447a1cd1936f2 (diff)
8svx: move pcm_s8_planar decoder to pcm.c
Removes limitation of max 2 channels for pcm_s8_planar decoder by moving it to more natural place. AV_CODEC_ID_8SVX_RAW is not used by anything anymore and is going to be removed. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r--libavcodec/pcm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index d91113d781..36385f7e99 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -376,6 +376,15 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
for (; n > 0; n--)
*samples++ = *src++ + 128;
break;
+ case AV_CODEC_ID_PCM_S8_PLANAR:
+ n /= avctx->channels;
+ for (c = 0; c < avctx->channels; c++) {
+ int i;
+ samples = s->frame.extended_data[c];
+ for (i = n; i > 0; i--)
+ *samples++ = *src++ + 128;
+ }
+ break;
#if HAVE_BIGENDIAN
case AV_CODEC_ID_PCM_F64LE:
DECODE(64, le64, src, samples, n, 0, 0)
@@ -548,6 +557,7 @@ PCM_CODEC (PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit f
PCM_DECODER(PCM_LXF, AV_SAMPLE_FMT_S32P,pcm_lxf, "PCM signed 20-bit little-endian planar");
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_DECODER(PCM_S8_PLANAR, AV_SAMPLE_FMT_U8P, pcm_s8_planar, "PCM signed 8-bit planar");
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");