comparison vp3.c @ 11471:623074220038 libavcodec

vp3: Use memset to clear the fragment array
author conrad
date Sat, 13 Mar 2010 05:56:08 +0000
parents 8ef47a02b516
children 258d773b8feb
comparison
equal deleted inserted replaced
11470:8ef47a02b516 11471:623074220038
281 s->superblock_fragments[j++] = -1; 281 s->superblock_fragments[j++] = -1;
282 } 282 }
283 } 283 }
284 284
285 return 0; /* successful path out */ 285 return 0; /* successful path out */
286 }
287
288 /*
289 * This function wipes out all of the fragment data.
290 */
291 static void init_frame(Vp3DecodeContext *s, GetBitContext *gb)
292 {
293 int i;
294
295 /* zero out all of the fragment information */
296 for (i = 0; i < s->fragment_count; i++) {
297 s->all_fragments[i].motion_x = 0;
298 s->all_fragments[i].motion_y = 0;
299 s->all_fragments[i].dc = 0;
300 s->all_fragments[i].qpi = 0;
301 }
302 } 286 }
303 287
304 /* 288 /*
305 * This function sets up the dequantization tables used for a particular 289 * This function sets up the dequantization tables used for a particular
306 * frame. 290 * frame.
1769 } 1753 }
1770 1754
1771 s->current_frame.qscale_table= s->qscale_table; //FIXME allocate individual tables per AVFrame 1755 s->current_frame.qscale_table= s->qscale_table; //FIXME allocate individual tables per AVFrame
1772 s->current_frame.qstride= 0; 1756 s->current_frame.qstride= 0;
1773 1757
1774 init_frame(s, &gb); 1758 memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment));
1775 1759
1776 if (unpack_superblocks(s, &gb)){ 1760 if (unpack_superblocks(s, &gb)){
1777 av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n"); 1761 av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
1778 goto error; 1762 goto error;
1779 } 1763 }