Mercurial > libavcodec.hg
comparison bethsoftvideo.c @ 6224:f3621aff9ff0 libavcodec
const
author | michael |
---|---|
date | Fri, 01 Feb 2008 03:47:32 +0000 |
parents | a2bb53af16d1 |
children | 48759bfbd073 |
comparison
equal
deleted
inserted
replaced
6223:f07ad27251e5 | 6224:f3621aff9ff0 |
---|---|
44 FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; | 44 FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; |
45 avctx->pix_fmt = PIX_FMT_PAL8; | 45 avctx->pix_fmt = PIX_FMT_PAL8; |
46 return 0; | 46 return 0; |
47 } | 47 } |
48 | 48 |
49 static void set_palette(AVFrame * frame, uint8_t * palette_buffer) | 49 static void set_palette(AVFrame * frame, const uint8_t * palette_buffer) |
50 { | 50 { |
51 uint32_t * palette = (uint32_t *)frame->data[1]; | 51 uint32_t * palette = (uint32_t *)frame->data[1]; |
52 int a; | 52 int a; |
53 for(a = 0; a < 256; a++){ | 53 for(a = 0; a < 256; a++){ |
54 palette[a] = AV_RB24(&palette_buffer[a * 3]) * 4; | 54 palette[a] = AV_RB24(&palette_buffer[a * 3]) * 4; |
56 frame->palette_has_changed = 1; | 56 frame->palette_has_changed = 1; |
57 } | 57 } |
58 | 58 |
59 static int bethsoftvid_decode_frame(AVCodecContext *avctx, | 59 static int bethsoftvid_decode_frame(AVCodecContext *avctx, |
60 void *data, int *data_size, | 60 void *data, int *data_size, |
61 uint8_t *buf, int buf_size) | 61 const uint8_t *buf, int buf_size) |
62 { | 62 { |
63 BethsoftvidContext * vid = avctx->priv_data; | 63 BethsoftvidContext * vid = avctx->priv_data; |
64 char block_type; | 64 char block_type; |
65 uint8_t * dst; | 65 uint8_t * dst; |
66 uint8_t * frame_end; | 66 uint8_t * frame_end; |