-//TODO:avoid block copy by modifying s->block pointer
- memcpy(&render->data_blocks[(render->next_free_data_block_num++)*64],
- block[i],sizeof(short)*8*8);
+//copy blocks only if the codec doesn't support pblocks reordering
+ if(s->avctx->xvmc_acceleration == 1){
+ memcpy(&render->data_blocks[(render->next_free_data_block_num)*64],
+ s->pblocks[i],sizeof(short)*8*8);
+ }else{
+/* if(s->pblocks[i] != &render->data_blocks[
+ (render->next_free_data_block_num)*64]){
+ printf("ERROR mb(%d,%d) s->pblocks[i]=%p data_block[]=%p\n",
+ s->mb_x,s->mb_y, s->pblocks[i],
+ &render->data_blocks[(render->next_free_data_block_num)*64]);
+ }*/
+ }
+ render->next_free_data_block_num++;