diff options
Diffstat (limited to 'src/demuxers/demux_real.c')
-rw-r--r-- | src/demuxers/demux_real.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index f0724a992..cb67c36fa 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -55,6 +55,8 @@ #include "demux.h" #include "bswap.h" +#include "real_common.h" + #define FOURCC_TAG BE_FOURCC #define RMF_TAG FOURCC_TAG('.', 'R', 'M', 'F') #define PROP_TAG FOURCC_TAG('P', 'R', 'O', 'P') @@ -174,13 +176,6 @@ typedef struct { demux_class_t demux_class; } demux_real_class_t; -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}}; - static void real_parse_index(demux_real_t *this) { off_t next_index_chunk = this->index_start; @@ -1453,30 +1448,8 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) { this->status = DEMUX_FINISHED; return this->status; } - if (spc == sph - 1) { - int n; - int bs = sph * w * 2 / 96; /* nibbles per subpacket */ - /* Perform reordering */ - for(n=0; n < 38; n++) { - int j; - int i = bs * sipr_swaps[n][0]; - int o = bs * sipr_swaps[n][1]; - /* swap nibbles of block 'i' with 'o' TODO: optimize */ - for(j = 0;j < bs; j++) { - int x = (i & 1) ? (buffer[i >> 1] >> 4) : (buffer[i >> 1] & 0x0F); - int y = (o & 1) ? (buffer[o >> 1] >> 4) : (buffer[o >> 1] & 0x0F); - if(o & 1) - buffer[o >> 1] = (buffer[o >> 1] & 0x0F) | (x << 4); - else - buffer[o >> 1] = (buffer[o >> 1] & 0xF0) | x; - if(i & 1) - buffer[i >> 1] = (buffer[i >> 1] & 0x0F) | (y << 4); - else - buffer[i >> 1] = (buffer[i >> 1] & 0xF0) | y; - ++i; ++o; - } - } - } + if (spc == sph - 1) + demux_real_sipro_swap (buffer, sph * w * 2 / 96); break; } if(++this->audio_stream->sub_packet_cnt == sph) { |