Mercurial > libavcodec.hg
comparison nuv.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 |
---|---|
70 return 0; | 70 return 0; |
71 } | 71 } |
72 | 72 |
73 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, | 73 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, |
74 uint8_t *buf, int buf_size) { | 74 uint8_t *buf, int buf_size) { |
75 NuvContext *c = (NuvContext *)avctx->priv_data; | 75 NuvContext *c = avctx->priv_data; |
76 AVFrame *picture = data; | 76 AVFrame *picture = data; |
77 int orig_size = buf_size; | 77 int orig_size = buf_size; |
78 enum {NUV_UNCOMPRESSED = '0', NUV_RTJPEG = '1', | 78 enum {NUV_UNCOMPRESSED = '0', NUV_RTJPEG = '1', |
79 NUV_RTJPEG_IN_LZO = '2', NUV_LZO = '3', | 79 NUV_RTJPEG_IN_LZO = '2', NUV_LZO = '3', |
80 NUV_BLACK = 'N', NUV_COPY_LAST = 'L'} comptype; | 80 NUV_BLACK = 'N', NUV_COPY_LAST = 'L'} comptype; |
168 *data_size = sizeof(AVFrame); | 168 *data_size = sizeof(AVFrame); |
169 return orig_size; | 169 return orig_size; |
170 } | 170 } |
171 | 171 |
172 static int decode_init(AVCodecContext *avctx) { | 172 static int decode_init(AVCodecContext *avctx) { |
173 NuvContext *c = (NuvContext *)avctx->priv_data; | 173 NuvContext *c = avctx->priv_data; |
174 avctx->width = (avctx->width + 1) & ~1; | 174 avctx->width = (avctx->width + 1) & ~1; |
175 avctx->height = (avctx->height + 1) & ~1; | 175 avctx->height = (avctx->height + 1) & ~1; |
176 if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) { | 176 if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) { |
177 return 1; | 177 return 1; |
178 } | 178 } |
192 rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); | 192 rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); |
193 return 0; | 193 return 0; |
194 } | 194 } |
195 | 195 |
196 static int decode_end(AVCodecContext *avctx) { | 196 static int decode_end(AVCodecContext *avctx) { |
197 NuvContext *c = (NuvContext *)avctx->priv_data; | 197 NuvContext *c = avctx->priv_data; |
198 av_freep(&c->decomp_buf); | 198 av_freep(&c->decomp_buf); |
199 if (c->pic.data[0]) | 199 if (c->pic.data[0]) |
200 avctx->release_buffer(avctx, &c->pic); | 200 avctx->release_buffer(avctx, &c->pic); |
201 return 0; | 201 return 0; |
202 } | 202 } |