summaryrefslogtreecommitdiff
path: root/libavcodec/pcm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-01 13:00:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-01 13:00:08 +0200
commitcb4d05e7f25684fd09b5a81bf5d5ca98ecfec6ca (patch)
treeeab53df81a61f27ee2474366d01cb88233557ba0 /libavcodec/pcm.c
parentd7f917c37af24eec2720231db03ab41469550855 (diff)
parenta42e3a6700547e4e49445bda81d3a89ec3e081a9 (diff)
Merge commit 'a42e3a6700547e4e49445bda81d3a89ec3e081a9'
* commit 'a42e3a6700547e4e49445bda81d3a89ec3e081a9': pcm_dvd: consolidate pieces from pcm.c and mpeg.c Conflicts: libavcodec/pcm.c libavcodec/version.h libavformat/mpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r--libavcodec/pcm.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 2f256dec98..b868fed77d 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -298,18 +298,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
/* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */
samples_per_block = 1;
- if (avctx->codec_id == AV_CODEC_ID_PCM_DVD) {
- if (avctx->bits_per_coded_sample != 20 &&
- avctx->bits_per_coded_sample != 24) {
- av_log(avctx, AV_LOG_ERROR,
- "PCM DVD unsupported sample depth %i\n",
- avctx->bits_per_coded_sample);
- return AVERROR(EINVAL);
- }
- /* 2 samples are interleaved per block in PCM_DVD */
- samples_per_block = 2;
- sample_size = avctx->bits_per_coded_sample * 2 / 8;
- } else if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) {
+ if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) {
/* we process 40-bit blocks per channel for LXF */
samples_per_block = 2;
sample_size = 5;
@@ -470,37 +459,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
samples += 2;
}
break;
- case AV_CODEC_ID_PCM_DVD:
- {
- const uint8_t *src8;
- dst_int32_t = (int32_t *)frame->data[0];
- n /= avctx->channels;
- switch (avctx->bits_per_coded_sample) {
- case 20:
- while (n--) {
- c = avctx->channels;
- src8 = src + 4 * c;
- while (c--) {
- *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8 & 0xf0) << 8);
- *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++ & 0x0f) << 12);
- }
- src = src8;
- }
- break;
- case 24:
- while (n--) {
- c = avctx->channels;
- src8 = src + 4 * c;
- while (c--) {
- *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
- *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
- }
- src = src8;
- }
- break;
- }
- break;
- }
case AV_CODEC_ID_PCM_LXF:
{
int i;
@@ -583,7 +541,6 @@ AVCodec ff_ ## name_ ## _decoder = { \
/* Note: Do not forget to add new entries to the Makefile as well. */
PCM_CODEC (PCM_ALAW, AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law / G.711 A-law");
-PCM_DECODER(PCM_DVD, AV_SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
PCM_CODEC (PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
PCM_CODEC (PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
PCM_CODEC (PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");