Mercurial > libavcodec.hg
comparison pngdec.c @ 6394:1a9af4a496f2 libavcodec
remove a memcpy
author | lorenm |
---|---|
date | Mon, 25 Feb 2008 05:46:53 +0000 |
parents | 0a403ade8c81 |
children | 49dcfab1bda3 |
comparison
equal
deleted
inserted
replaced
6393:eaa18f140fb7 | 6394:1a9af4a496f2 |
---|---|
260 ptr = s->image_buf + s->image_linesize * s->y; | 260 ptr = s->image_buf + s->image_linesize * s->y; |
261 /* need to swap bytes correctly for RGB_ALPHA */ | 261 /* need to swap bytes correctly for RGB_ALPHA */ |
262 if (s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { | 262 if (s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { |
263 png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1, | 263 png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1, |
264 s->last_row, s->row_size, s->bpp); | 264 s->last_row, s->row_size, s->bpp); |
265 memcpy(s->last_row, s->tmp_row, s->row_size); | |
266 convert_to_rgb32(ptr, s->tmp_row, s->width); | 265 convert_to_rgb32(ptr, s->tmp_row, s->width); |
266 FFSWAP(uint8_t*, s->last_row, s->tmp_row); | |
267 } else { | 267 } else { |
268 /* in normal case, we avoid one copy */ | 268 /* in normal case, we avoid one copy */ |
269 if (s->y == 0) | 269 if (s->y == 0) |
270 last_row = s->last_row; | 270 last_row = s->last_row; |
271 else | 271 else |
287 wait for the next one */ | 287 wait for the next one */ |
288 if (got_line) | 288 if (got_line) |
289 break; | 289 break; |
290 png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1, | 290 png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1, |
291 s->last_row, s->pass_row_size, s->bpp); | 291 s->last_row, s->pass_row_size, s->bpp); |
292 memcpy(s->last_row, s->tmp_row, s->pass_row_size); | 292 FFSWAP(uint8_t*, s->last_row, s->tmp_row); |
293 got_line = 1; | 293 got_line = 1; |
294 } | 294 } |
295 if ((png_pass_dsp_ymask[s->pass] << (s->y & 7)) & 0x80) { | 295 if ((png_pass_dsp_ymask[s->pass] << (s->y & 7)) & 0x80) { |
296 /* NOTE: RGB32 is handled directly in png_put_interlaced_row */ | 296 /* NOTE: RGB32 is handled directly in png_put_interlaced_row */ |
297 png_put_interlaced_row(ptr, s->width, s->bits_per_pixel, s->pass, | 297 png_put_interlaced_row(ptr, s->width, s->bits_per_pixel, s->pass, |