Mercurial > libavcodec.hg
comparison iff.c @ 11693:3ec57be57312 libavcodec
Remove "bps" parameter to decodeplane8/32(), it's unused.
Patch by Sebastian Vater <cdgs basty googlemail com>.
author | rbultje |
---|---|
date | Sun, 09 May 2010 20:08:13 +0000 |
parents | 5eb6d3cbf257 |
children | 83b49b0997e8 |
comparison
equal
deleted
inserted
replaced
11692:5eb6d3cbf257 | 11693:3ec57be57312 |
---|---|
133 /** | 133 /** |
134 * Decode interleaved plane buffer up to 8bpp | 134 * Decode interleaved plane buffer up to 8bpp |
135 * @param dst Destination buffer | 135 * @param dst Destination buffer |
136 * @param buf Source buffer | 136 * @param buf Source buffer |
137 * @param buf_size | 137 * @param buf_size |
138 * @param bps bits_per_coded_sample (must be <= 8) | |
139 * @param plane plane number to decode as | 138 * @param plane plane number to decode as |
140 */ | 139 */ |
141 static void decodeplane8(uint8_t *dst, const uint8_t *buf, int buf_size, int bps, int plane) | 140 static void decodeplane8(uint8_t *dst, const uint8_t *buf, int buf_size, int plane) |
142 { | 141 { |
143 const uint64_t *lut = plane8_lut[plane]; | 142 const uint64_t *lut = plane8_lut[plane]; |
144 while (buf_size--) { | 143 while (buf_size--) { |
145 uint64_t v = AV_RN64A(dst) | lut[*buf++]; | 144 uint64_t v = AV_RN64A(dst) | lut[*buf++]; |
146 AV_WN64A(dst, v); | 145 AV_WN64A(dst, v); |
151 /** | 150 /** |
152 * Decode interleaved plane buffer up to 24bpp | 151 * Decode interleaved plane buffer up to 24bpp |
153 * @param dst Destination buffer | 152 * @param dst Destination buffer |
154 * @param buf Source buffer | 153 * @param buf Source buffer |
155 * @param buf_size | 154 * @param buf_size |
156 * @param bps bits_per_coded_sample | |
157 * @param plane plane number to decode as | 155 * @param plane plane number to decode as |
158 */ | 156 */ |
159 static void decodeplane32(uint32_t *dst, const uint8_t *const buf, int buf_size, int bps, int plane) | 157 static void decodeplane32(uint32_t *dst, const uint8_t *const buf, int buf_size, int plane) |
160 { | 158 { |
161 GetBitContext gb; | 159 GetBitContext gb; |
162 int i; | 160 int i; |
163 const int b = buf_size * 8; | 161 const int b = buf_size * 8; |
164 init_get_bits(&gb, buf, buf_size * 8); | 162 init_get_bits(&gb, buf, buf_size * 8); |
185 if (avctx->pix_fmt == PIX_FMT_PAL8) { | 183 if (avctx->pix_fmt == PIX_FMT_PAL8) { |
186 for(y = 0; y < avctx->height; y++ ) { | 184 for(y = 0; y < avctx->height; y++ ) { |
187 uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; | 185 uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; |
188 memset(row, 0, avctx->width); | 186 memset(row, 0, avctx->width); |
189 for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) { | 187 for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) { |
190 decodeplane8(row, buf, FFMIN(s->planesize, buf_end - buf), avctx->bits_per_coded_sample, plane); | 188 decodeplane8(row, buf, FFMIN(s->planesize, buf_end - buf), plane); |
191 buf += s->planesize; | 189 buf += s->planesize; |
192 } | 190 } |
193 } | 191 } |
194 } else { // PIX_FMT_BGR32 | 192 } else { // PIX_FMT_BGR32 |
195 for(y = 0; y < avctx->height; y++ ) { | 193 for(y = 0; y < avctx->height; y++ ) { |
196 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; | 194 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; |
197 memset(row, 0, avctx->width << 2); | 195 memset(row, 0, avctx->width << 2); |
198 for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) { | 196 for (plane = 0; plane < avctx->bits_per_coded_sample && buf < buf_end; plane++) { |
199 decodeplane32((uint32_t *) row, buf, FFMIN(s->planesize, buf_end - buf), avctx->bits_per_coded_sample, plane); | 197 decodeplane32((uint32_t *) row, buf, FFMIN(s->planesize, buf_end - buf), plane); |
200 buf += s->planesize; | 198 buf += s->planesize; |
201 } | 199 } |
202 } | 200 } |
203 } | 201 } |
204 | 202 |
241 } else { //noop | 239 } else { //noop |
242 continue; | 240 continue; |
243 } | 241 } |
244 x += length; | 242 x += length; |
245 } | 243 } |
246 decodeplane8(row, s->planebuf, s->planesize, avctx->bits_per_coded_sample, plane); | 244 decodeplane8(row, s->planebuf, s->planesize, plane); |
247 } | 245 } |
248 } | 246 } |
249 } else { //PIX_FMT_BGR32 | 247 } else { //PIX_FMT_BGR32 |
250 for(y = 0; y < avctx->height ; y++ ) { | 248 for(y = 0; y < avctx->height ; y++ ) { |
251 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; | 249 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; |
264 } else { // noop | 262 } else { // noop |
265 continue; | 263 continue; |
266 } | 264 } |
267 x += length; | 265 x += length; |
268 } | 266 } |
269 decodeplane32((uint32_t *) row, s->planebuf, s->planesize, avctx->bits_per_coded_sample, plane); | 267 decodeplane32((uint32_t *) row, s->planebuf, s->planesize, plane); |
270 } | 268 } |
271 } | 269 } |
272 } | 270 } |
273 } else { | 271 } else { |
274 for(y = 0; y < avctx->height ; y++ ) { | 272 for(y = 0; y < avctx->height ; y++ ) { |