39 #define BITSTREAM_READER_LE
43 #define SMKTREE_BITS 9
44 #define SMK_NODE 0x80000000
80 1, 2, 3, 4, 5, 6, 7, 8,
81 9, 10, 11, 12, 13, 14, 15, 16,
82 17, 18, 19, 20, 21, 22, 23, 24,
83 25, 26, 27, 28, 29, 30, 31, 32,
84 33, 34, 35, 36, 37, 38, 39, 40,
85 41, 42, 43, 44, 45, 46, 47, 48,
86 49, 50, 51, 52, 53, 54, 55, 56,
87 57, 58, 59, 128, 256, 512, 1024, 2048 };
144 if (i1 < 0 || i2 < 0)
150 }
else if(val == ctx->
escapes[1]) {
153 }
else if(val == ctx->
escapes[2]) {
184 VLC vlc[2] = { { 0 } };
189 if(size >= UINT_MAX>>4){
222 tmp1.
lengths,
sizeof(
int),
sizeof(
int),
243 tmp2.
lengths,
sizeof(
int),
sizeof(
int),
260 last[0] = last[1] = last[2] = -1;
271 huff.
length = ((size + 3) >> 2) + 4;
312 int mmap_size, mclr_size, full_size, type_size,
ret;
374 recode[last[0]] = recode[last[1]] = recode[last[2]] = 0;
379 register int *
table = recode;
384 table += (*table) & (~SMK_NODE);
389 if(v != recode[last[0]]) {
390 recode[last[2]] = recode[last[1]];
391 recode[last[1]] = recode[last[0]];
405 int blocks,
blk, bw, bh;
410 if (avpkt->
size <= 769)
417 pal = (uint32_t*)smk->
pic->
data[1];
419 flags = bytestream2_get_byteu(&gb2);
427 for(i = 0; i < 256; i++)
428 *pal++ = 0xFFU << 24 | bytestream2_get_be24u(&gb2);
438 bw = avctx->
width >> 2;
442 while(blk < blocks) {
450 while(run-- && blk < blocks){
455 out = smk->
pic->
data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
458 for(i = 0; i < 4; i++) {
459 if(map & 1) out[0] = hi;
else out[0] = lo;
460 if(map & 2) out[1] = hi;
else out[1] = lo;
461 if(map & 4) out[2] = hi;
else out[2] = lo;
462 if(map & 8) out[3] = hi;
else out[3] = lo;
475 while(run-- && blk < blocks){
476 out = smk->
pic->
data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
479 for(i = 0; i < 4; i++) {
489 out[0] = out[1] = pix & 0xFF;
490 out[2] = out[3] = pix >> 8;
492 out[0] = out[1] = pix & 0xFF;
493 out[2] = out[3] = pix >> 8;
496 out[0] = out[1] = pix & 0xFF;
497 out[2] = out[3] = pix >> 8;
499 out[0] = out[1] = pix & 0xFF;
500 out[2] = out[3] = pix >> 8;
503 for(i = 0; i < 2; i++) {
520 while(run-- && blk < blocks)
525 while(run-- && blk < blocks){
527 out = smk->
pic->
data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
528 col = mode * 0x01010101;
529 for(i = 0; i < 4; i++) {
530 *((uint32_t*)out) = col;
621 int *got_frame_ptr,
AVPacket *avpkt)
625 int buf_size = avpkt->
size;
628 VLC vlc[4] = { { 0 } };
635 int pred[2] = {0, 0};
644 if (unp_size > (1
U<<24)) {
659 if (stereo ^ (avctx->
channels != 1)) {
672 samples = (int16_t *)frame->
data[0];
673 samples8 = frame->
data[0];
676 for(i = 0; i < (1 << (bits + stereo)); i++) {
683 if (!h[i].bits || !h[i].lengths || !h[i].values) {
693 if(h[i].current > 1) {
695 h[i].lengths,
sizeof(
int),
sizeof(
int),
696 h[i].bits,
sizeof(uint32_t),
sizeof(uint32_t),
INIT_VLC_LE);
706 for(i = stereo; i >= 0; i--)
708 for(i = 0; i <= stereo; i++)
709 *samples++ = pred[i];
710 for(; i < unp_size / 2; i++) {
731 val |= h[3].
values[res] << 8;
733 *samples++ = pred[1];
752 val |= h[1].
values[res] << 8;
754 *samples++ = pred[0];
758 for(i = stereo; i >= 0; i--)
760 for(i = 0; i <= stereo; i++)
761 *samples8++ = pred[i];
762 for(; i < unp_size; i++) {
775 *samples8++ = pred[1];
786 *samples8++ = pred[0];
795 for(i = 0; i < 4; i++) {