diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-16 15:19:11 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-16 15:20:46 +0400 |
commit | 9270a2b374eae02c3588ff9a36af298d19f006c8 (patch) | |
tree | bce36468c80d453d10fbe2385711b7a5b2c8ce41 /libavformat/rmdec.c | |
parent | 36b3b2376dd99e035f5acc389f8c506647146e14 (diff) | |
parent | 4c995fafd861f537360b3717901cdbed6a6844e7 (diff) |
Merge commit '4c995fafd861f537360b3717901cdbed6a6844e7'
* commit '4c995fafd861f537360b3717901cdbed6a6844e7':
configure: simplify get_version() function
build: support asan and tsan toolchain shortcuts
rmdec: Move SIPR code shared with Matroska demuxer to a separate file
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r-- | libavformat/rmdec.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index a69017dc09..07ecd32ab3 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -25,6 +25,7 @@ #include "avformat.h" #include "internal.h" #include "riff.h" +#include "rmsipr.h" #include "rm.h" #define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r') ///< interleaving for Cooker/Atrac @@ -59,21 +60,6 @@ typedef struct { int audio_pkt_cnt; ///< Output packet counter } RMDemuxContext; -static const unsigned char sipr_swaps[38][2] = { - { 0, 63 }, { 1, 22 }, { 2, 44 }, { 3, 90 }, - { 5, 81 }, { 7, 31 }, { 8, 86 }, { 9, 58 }, - { 10, 36 }, { 12, 68 }, { 13, 39 }, { 14, 73 }, - { 15, 53 }, { 16, 69 }, { 17, 57 }, { 19, 88 }, - { 20, 34 }, { 21, 71 }, { 24, 46 }, { 25, 94 }, - { 26, 54 }, { 28, 75 }, { 29, 50 }, { 32, 70 }, - { 33, 92 }, { 35, 74 }, { 38, 85 }, { 40, 56 }, - { 42, 87 }, { 43, 65 }, { 45, 59 }, { 48, 79 }, - { 49, 93 }, { 51, 89 }, { 55, 95 }, { 61, 76 }, - { 67, 83 }, { 77, 80 } -}; - -const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 }; - static inline void get_strl(AVIOContext *pb, char *buf, int buf_size, int len) { int i; @@ -750,32 +736,6 @@ rm_ac3_swap_bytes (AVStream *st, AVPacket *pkt) } } -/** - * Perform 4-bit block reordering for SIPR data. - * @todo This can be optimized, e.g. use memcpy() if data blocks are aligned - */ -void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize) -{ - int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket - - for (n = 0; n < 38; n++) { - int j; - int i = bs * sipr_swaps[n][0]; - int o = bs * sipr_swaps[n][1]; - - /* swap 4bit-nibbles of block 'i' with 'o' */ - for (j = 0; j < bs; j++, i++, o++) { - int x = (buf[i >> 1] >> (4 * (i & 1))) & 0xF, - y = (buf[o >> 1] >> (4 * (o & 1))) & 0xF; - - buf[o >> 1] = (x << (4 * (o & 1))) | - (buf[o >> 1] & (0xF << (4 * !(o & 1)))); - buf[i >> 1] = (y << (4 * (i & 1))) | - (buf[i >> 1] & (0xF << (4 * !(i & 1)))); - } - } -} - int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *ast, int len, AVPacket *pkt, |