diff options
author | Diego Biurrun <diego@biurrun.de> | 2013-03-26 18:17:57 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-03-27 14:21:45 +0100 |
commit | 1db6a080bddd14fed6b29140ecd2e21e42b1c022 (patch) | |
tree | d1f7181ddc9bc8413828bc3fa9a30c6f96a09aa7 /libavcodec/dca_parser.c | |
parent | b2472539297742c15b4d0a3977b5751170a2c1ae (diff) | |
download | ffmpeg-1db6a080bddd14fed6b29140ecd2e21e42b1c022.tar.gz |
dca: Move ff_dca_convert_bitstream() to the DCA common code
This makes the DCA parser and decoder independent.
Diffstat (limited to 'libavcodec/dca_parser.c')
-rw-r--r-- | libavcodec/dca_parser.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c index ab235cf480..4a3d8125bf 100644 --- a/libavcodec/dca_parser.c +++ b/libavcodec/dca_parser.c @@ -24,9 +24,7 @@ #include "parser.h" #include "dca.h" -#include "dca_parser.h" #include "get_bits.h" -#include "put_bits.h" typedef struct DCAParseContext { ParseContext pc; @@ -103,41 +101,6 @@ static av_cold int dca_parse_init(AVCodecParserContext * s) return 0; } -int ff_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, - int max_size) -{ - uint32_t mrk; - int i, tmp; - const uint16_t *ssrc = (const uint16_t *) src; - uint16_t *sdst = (uint16_t *) dst; - PutBitContext pb; - - if ((unsigned) src_size > (unsigned) max_size) - src_size = max_size; - - mrk = AV_RB32(src); - switch (mrk) { - case DCA_MARKER_RAW_BE: - memcpy(dst, src, src_size); - return src_size; - case DCA_MARKER_RAW_LE: - for (i = 0; i < (src_size + 1) >> 1; i++) - *sdst++ = av_bswap16(*ssrc++); - return src_size; - case DCA_MARKER_14B_BE: - case DCA_MARKER_14B_LE: - init_put_bits(&pb, dst, max_size); - for (i = 0; i < (src_size + 1) >> 1; i++, src += 2) { - tmp = ((mrk == DCA_MARKER_14B_BE) ? AV_RB16(src) : AV_RL16(src)) & 0x3FFF; - put_bits(&pb, 14, tmp); - } - flush_put_bits(&pb); - return (put_bits_count(&pb) + 7) >> 3; - default: - return AVERROR_INVALIDDATA; - } -} - static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration, int *sample_rate) { |