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){
215 tmp1.
lengths,
sizeof(
int),
sizeof(
int),
233 tmp2.
lengths,
sizeof(
int),
sizeof(
int),
249 last[0] = last[1] = last[2] = -1;
260 huff.
length = ((size + 3) >> 2) + 4;
297 int mmap_size, mclr_size, full_size, type_size,
ret;
351 recode[last[0]] = recode[last[1]] = recode[last[2]] = 0;
356 register int *
table = recode;
361 table += (*table) & (~SMK_NODE);
366 if(v != recode[last[0]]) {
367 recode[last[2]] = recode[last[1]];
368 recode[last[1]] = recode[last[0]];
382 int blocks,
blk, bw, bh;
387 if (avpkt->
size <= 769)
394 pal = (uint32_t*)smk->
pic.
data[1];
396 flags = bytestream2_get_byteu(&gb2);
404 for(i = 0; i < 256; i++)
405 *pal++ = 0xFFU << 24 | bytestream2_get_be24u(&gb2);
414 bw = avctx->
width >> 2;
419 while(blk < blocks) {
427 while(run-- && blk < blocks){
432 out = smk->
pic.
data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
435 for(i = 0; i < 4; i++) {
436 if(map & 1) out[0] = hi;
else out[0] = lo;
437 if(map & 2) out[1] = hi;
else out[1] = lo;
438 if(map & 4) out[2] = hi;
else out[2] = lo;
439 if(map & 8) out[3] = hi;
else out[3] = lo;
452 while(run-- && blk < blocks){
453 out = smk->
pic.
data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
456 for(i = 0; i < 4; i++) {
466 out[0] = out[1] = pix & 0xFF;
467 out[2] = out[3] = pix >> 8;
469 out[0] = out[1] = pix & 0xFF;
470 out[2] = out[3] = pix >> 8;
473 out[0] = out[1] = pix & 0xFF;
474 out[2] = out[3] = pix >> 8;
476 out[0] = out[1] = pix & 0xFF;
477 out[2] = out[3] = pix >> 8;
481 for(i = 0; i < 2; i++) {
498 while(run-- && blk < blocks)
503 while(run-- && blk < blocks){
505 out = smk->
pic.
data[0] + (blk / bw) * (stride * 4) + (blk % bw) * 4;
506 col = mode * 0x01010101;
507 for(i = 0; i < 4; i++) {
508 *((uint32_t*)out) = col;
595 int *got_frame_ptr,
AVPacket *avpkt)
599 int buf_size = avpkt->
size;
602 VLC vlc[4] = { { 0 } };
609 int pred[2] = {0, 0};
618 if (unp_size > (1
U<<24)) {
632 if (stereo ^ (avctx->
channels != 1)) {
645 samples = (int16_t *)frame->
data[0];
646 samples8 = frame->
data[0];
649 for(i = 0; i < (1 << (bits + stereo)); i++) {
658 for (; i >= 0; i--) {
668 if(h[i].current > 1) {
670 h[i].lengths,
sizeof(
int),
sizeof(
int),
671 h[i].bits,
sizeof(uint32_t),
sizeof(uint32_t),
INIT_VLC_LE);
680 for(i = stereo; i >= 0; i--)
682 for(i = 0; i <= stereo; i++)
683 *samples++ = pred[i];
684 for(; i < unp_size / 2; i++) {
707 *samples++ = pred[1];
728 *samples++ = pred[0];
732 for(i = stereo; i >= 0; i--)
734 for(i = 0; i <= stereo; i++)
735 *samples8++ = pred[i];
736 for(; i < unp_size; i++) {
749 *samples8++ = pred[1];
760 *samples8++ = pred[0];
765 for(i = 0; i < 4; i++) {