Revision 1ab0406d
libavformat/rm.h | ||
---|---|---|
91 | 91 |
int ff_rm_retrieve_cache (AVFormatContext *s, ByteIOContext *pb, |
92 | 92 |
AVStream *st, RMStream *rst, AVPacket *pkt); |
93 | 93 |
|
94 |
/** |
|
95 |
* Perform 4-bit block reordering for SIPR data. |
|
96 |
* |
|
97 |
* @param buf SIPR data |
|
98 |
*/ |
|
99 |
void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize); |
|
100 |
|
|
94 | 101 |
#endif /* AVFORMAT_RM_H */ |
libavformat/rmdec.c | ||
---|---|---|
696 | 696 |
* Perform 4-bit block reordering for SIPR data. |
697 | 697 |
* @todo This can be optimized, e.g. use memcpy() if data blocks are aligned |
698 | 698 |
*/ |
699 |
static void |
|
700 |
rm_reorder_sipr_data (RMStream *ast) |
|
699 |
void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize) |
|
701 | 700 |
{ |
702 |
int n, bs = ast->sub_packet_h * ast->audio_framesize * 2 / 96; // nibbles per subpacket
|
|
701 |
int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket
|
|
703 | 702 |
|
704 | 703 |
for (n = 0; n < 38; n++) { |
705 | 704 |
int j; |
706 | 705 |
int i = bs * sipr_swaps[n][0]; |
707 | 706 |
int o = bs * sipr_swaps[n][1]; |
708 |
uint8_t *buf = ast->pkt.data; |
|
709 | 707 |
|
710 | 708 |
/* swap 4bit-nibbles of block 'i' with 'o' */ |
711 | 709 |
for (j = 0; j < bs; j++, i++, o++) { |
... | ... | |
766 | 764 |
if (++(ast->sub_packet_cnt) < h) |
767 | 765 |
return -1; |
768 | 766 |
if (st->codec->codec_id == CODEC_ID_SIPR) |
769 |
rm_reorder_sipr_data(ast);
|
|
767 |
ff_rm_reorder_sipr_data(ast->pkt.data, h, w);
|
|
770 | 768 |
|
771 | 769 |
ast->sub_packet_cnt = 0; |
772 | 770 |
rm->audio_stream_num = st->index; |
Also available in: Unified diff