Revision 90e8a9c3
libavcodec/xan.c | ||
---|---|---|
358 | 358 |
} |
359 | 359 |
} |
360 | 360 |
|
361 |
static void xan_wc4_decode_frame(XanContext *s) { |
|
362 |
} |
|
363 |
|
|
364 | 361 |
#if RUNTIME_GAMMA |
365 | 362 |
static inline unsigned mul(unsigned a, unsigned b) |
366 | 363 |
{ |
... | ... | |
515 | 512 |
if (!s->frame_size) |
516 | 513 |
s->frame_size = s->current_frame.linesize[0] * s->avctx->height; |
517 | 514 |
|
518 |
if (avctx->codec->id == CODEC_ID_XAN_WC3) { |
|
519 |
memcpy(s->current_frame.data[1], s->palettes + s->cur_palette * AVPALETTE_COUNT, AVPALETTE_SIZE); |
|
520 |
} else { |
|
521 |
AVPaletteControl *palette_control = avctx->palctrl; |
|
522 |
palette_control->palette_changed = 0; |
|
523 |
memcpy(s->current_frame.data[1], palette_control->palette, |
|
524 |
AVPALETTE_SIZE); |
|
525 |
s->current_frame.palette_has_changed = 1; |
|
526 |
} |
|
515 |
memcpy(s->current_frame.data[1], s->palettes + s->cur_palette * AVPALETTE_COUNT, AVPALETTE_SIZE); |
|
527 | 516 |
|
528 | 517 |
s->buf = buf; |
529 | 518 |
s->size = buf_size; |
530 | 519 |
|
531 |
if (avctx->codec->id == CODEC_ID_XAN_WC3) |
|
532 |
xan_wc3_decode_frame(s); |
|
533 |
else if (avctx->codec->id == CODEC_ID_XAN_WC4) |
|
534 |
xan_wc4_decode_frame(s); |
|
520 |
xan_wc3_decode_frame(s); |
|
535 | 521 |
|
536 | 522 |
/* release the last frame if it is allocated */ |
537 | 523 |
if (s->last_frame.data[0]) |
... | ... | |
577 | 563 |
.long_name = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"), |
578 | 564 |
}; |
579 | 565 |
|
580 |
/* |
|
581 |
AVCodec ff_xan_wc4_decoder = { |
|
582 |
"xan_wc4", |
|
583 |
AVMEDIA_TYPE_VIDEO, |
|
584 |
CODEC_ID_XAN_WC4, |
|
585 |
sizeof(XanContext), |
|
586 |
xan_decode_init, |
|
587 |
NULL, |
|
588 |
xan_decode_end, |
|
589 |
xan_decode_frame, |
|
590 |
CODEC_CAP_DR1, |
|
591 |
.long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"), |
|
592 |
}; |
|
593 |
*/ |
Also available in: Unified diff