Mercurial > libavcodec.hg
comparison vmdav.c @ 4827:b3ee9a1526b0 libavcodec
Get rid of unnecessary pointer casts.
patch by Nicholas Tung, ntung ntung com
author | diego |
---|---|
date | Sun, 08 Apr 2007 20:24:16 +0000 |
parents | 66ef3690d108 |
children | f99e40a7155b |
comparison
equal
deleted
inserted
replaced
4826:9ca9a53a848b | 4827:b3ee9a1526b0 |
---|---|
316 } | 316 } |
317 } | 317 } |
318 | 318 |
319 static int vmdvideo_decode_init(AVCodecContext *avctx) | 319 static int vmdvideo_decode_init(AVCodecContext *avctx) |
320 { | 320 { |
321 VmdVideoContext *s = (VmdVideoContext *)avctx->priv_data; | 321 VmdVideoContext *s = avctx->priv_data; |
322 int i; | 322 int i; |
323 unsigned int *palette32; | 323 unsigned int *palette32; |
324 int palette_index = 0; | 324 int palette_index = 0; |
325 unsigned char r, g, b; | 325 unsigned char r, g, b; |
326 unsigned char *vmd_header; | 326 unsigned char *vmd_header; |
360 | 360 |
361 static int vmdvideo_decode_frame(AVCodecContext *avctx, | 361 static int vmdvideo_decode_frame(AVCodecContext *avctx, |
362 void *data, int *data_size, | 362 void *data, int *data_size, |
363 uint8_t *buf, int buf_size) | 363 uint8_t *buf, int buf_size) |
364 { | 364 { |
365 VmdVideoContext *s = (VmdVideoContext *)avctx->priv_data; | 365 VmdVideoContext *s = avctx->priv_data; |
366 | 366 |
367 s->buf = buf; | 367 s->buf = buf; |
368 s->size = buf_size; | 368 s->size = buf_size; |
369 | 369 |
370 if (buf_size < 16) | 370 if (buf_size < 16) |
394 return buf_size; | 394 return buf_size; |
395 } | 395 } |
396 | 396 |
397 static int vmdvideo_decode_end(AVCodecContext *avctx) | 397 static int vmdvideo_decode_end(AVCodecContext *avctx) |
398 { | 398 { |
399 VmdVideoContext *s = (VmdVideoContext *)avctx->priv_data; | 399 VmdVideoContext *s = avctx->priv_data; |
400 | 400 |
401 if (s->prev_frame.data[0]) | 401 if (s->prev_frame.data[0]) |
402 avctx->release_buffer(avctx, &s->prev_frame); | 402 avctx->release_buffer(avctx, &s->prev_frame); |
403 av_free(s->unpack_buffer); | 403 av_free(s->unpack_buffer); |
404 | 404 |
434 0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000 | 434 0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000 |
435 }; | 435 }; |
436 | 436 |
437 static int vmdaudio_decode_init(AVCodecContext *avctx) | 437 static int vmdaudio_decode_init(AVCodecContext *avctx) |
438 { | 438 { |
439 VmdAudioContext *s = (VmdAudioContext *)avctx->priv_data; | 439 VmdAudioContext *s = avctx->priv_data; |
440 | 440 |
441 s->avctx = avctx; | 441 s->avctx = avctx; |
442 s->channels = avctx->channels; | 442 s->channels = avctx->channels; |
443 s->bits = avctx->bits_per_sample; | 443 s->bits = avctx->bits_per_sample; |
444 s->block_align = avctx->block_align; | 444 s->block_align = avctx->block_align; |
515 | 515 |
516 static int vmdaudio_decode_frame(AVCodecContext *avctx, | 516 static int vmdaudio_decode_frame(AVCodecContext *avctx, |
517 void *data, int *data_size, | 517 void *data, int *data_size, |
518 uint8_t *buf, int buf_size) | 518 uint8_t *buf, int buf_size) |
519 { | 519 { |
520 VmdAudioContext *s = (VmdAudioContext *)avctx->priv_data; | 520 VmdAudioContext *s = avctx->priv_data; |
521 unsigned char *output_samples = (unsigned char *)data; | 521 unsigned char *output_samples = (unsigned char *)data; |
522 | 522 |
523 /* point to the start of the encoded data */ | 523 /* point to the start of the encoded data */ |
524 unsigned char *p = buf + 16; | 524 unsigned char *p = buf + 16; |
525 | 525 |