comparison mpegvideo.c @ 9003:b595a8a59967 libavcodec

Change the type of pblocks from pointers to short array into pointers to array of 64 DCTELEM, similarly to other block fields. This also get rid of some casts and fixes a warning.
author iive
date Sun, 22 Feb 2009 09:02:06 +0000
parents a24c04956930
children 043574c5c153
comparison
equal deleted inserted replaced
9002:eb98d61af310 9003:b595a8a59967
299 } 299 }
300 CHECKED_ALLOCZ(s->blocks, 64*12*2 * sizeof(DCTELEM)) 300 CHECKED_ALLOCZ(s->blocks, 64*12*2 * sizeof(DCTELEM))
301 s->block= s->blocks[0]; 301 s->block= s->blocks[0];
302 302
303 for(i=0;i<12;i++){ 303 for(i=0;i<12;i++){
304 s->pblocks[i] = (short *)(&s->block[i]); 304 s->pblocks[i] = &s->block[i];
305 } 305 }
306 return 0; 306 return 0;
307 fail: 307 fail:
308 return -1; //free() through MPV_common_end() 308 return -1; //free() through MPV_common_end()
309 } 309 }
355 //START_TIMER 355 //START_TIMER
356 backup_duplicate_context(&bak, dst); 356 backup_duplicate_context(&bak, dst);
357 memcpy(dst, src, sizeof(MpegEncContext)); 357 memcpy(dst, src, sizeof(MpegEncContext));
358 backup_duplicate_context(dst, &bak); 358 backup_duplicate_context(dst, &bak);
359 for(i=0;i<12;i++){ 359 for(i=0;i<12;i++){
360 dst->pblocks[i] = (short *)(&dst->block[i]); 360 dst->pblocks[i] = &dst->block[i];
361 } 361 }
362 //STOP_TIMER("update_duplicate_context") //about 10k cycles / 0.01 sec for 1000frames on 1ghz with 2 threads 362 //STOP_TIMER("update_duplicate_context") //about 10k cycles / 0.01 sec for 1000frames on 1ghz with 2 threads
363 } 363 }
364 364
365 /** 365 /**