comparison mpegvideo_xvmc.c @ 8836:4c175e9d492e libavcodec

whitespace cosmetics: another round of formatting consistency fixes
author diego
date Sat, 14 Feb 2009 16:22:11 +0000
parents 8c11ebbca9b3
children 867767165fa8
comparison
equal deleted inserted replaced
8835:8c11ebbca9b3 8836:4c175e9d492e
43 assert(render != NULL); 43 assert(render != NULL);
44 if ((render == NULL) || (render->magic != MP_XVMC_RENDER_MAGIC)) { 44 if ((render == NULL) || (render->magic != MP_XVMC_RENDER_MAGIC)) {
45 assert(0); 45 assert(0);
46 return;//make sure that this is a render packet 46 return;//make sure that this is a render packet
47 } 47 }
48 s->block =(DCTELEM *)(render->data_blocks+(render->next_free_data_block_num)*64); 48 s->block = (DCTELEM *)(render->data_blocks+(render->next_free_data_block_num)*64);
49 } 49 }
50 50
51 void XVMC_pack_pblocks(MpegEncContext *s, int cbp) 51 void XVMC_pack_pblocks(MpegEncContext *s, int cbp)
52 { 52 {
53 int i,j; 53 int i,j;
77 assert(render != NULL); 77 assert(render != NULL);
78 if ((render == NULL) || (render->magic != MP_XVMC_RENDER_MAGIC)) 78 if ((render == NULL) || (render->magic != MP_XVMC_RENDER_MAGIC))
79 return -1;//make sure that this is render packet 79 return -1;//make sure that this is render packet
80 80
81 render->picture_structure = s->picture_structure; 81 render->picture_structure = s->picture_structure;
82 render->flags = (s->first_field)? 0: XVMC_SECOND_FIELD; 82 render->flags = (s->first_field) ? 0 : XVMC_SECOND_FIELD;
83 83
84 //make sure that all data is drawn by XVMC_end_frame 84 //make sure that all data is drawn by XVMC_end_frame
85 assert(render->filled_mv_blocks_num==0); 85 assert(render->filled_mv_blocks_num == 0);
86 86
87 render->p_future_surface = NULL; 87 render->p_future_surface = NULL;
88 render->p_past_surface = NULL; 88 render->p_past_surface = NULL;
89 89
90 switch(s->pict_type){ 90 switch(s->pict_type){
171 mv_block->macroblock_type = XVMC_MB_TYPE_INTRA;//no MC, all done 171 mv_block->macroblock_type = XVMC_MB_TYPE_INTRA;//no MC, all done
172 }else{ 172 }else{
173 mv_block->macroblock_type = XVMC_MB_TYPE_PATTERN; 173 mv_block->macroblock_type = XVMC_MB_TYPE_PATTERN;
174 174
175 if (s->mv_dir & MV_DIR_FORWARD) { 175 if (s->mv_dir & MV_DIR_FORWARD) {
176 mv_block->macroblock_type|= XVMC_MB_TYPE_MOTION_FORWARD; 176 mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_FORWARD;
177 //pmv[n][dir][xy]=mv[dir][n][xy] 177 //pmv[n][dir][xy]=mv[dir][n][xy]
178 mv_block->PMV[0][0][0] = s->mv[0][0][0]; 178 mv_block->PMV[0][0][0] = s->mv[0][0][0];
179 mv_block->PMV[0][0][1] = s->mv[0][0][1]; 179 mv_block->PMV[0][0][1] = s->mv[0][0][1];
180 mv_block->PMV[1][0][0] = s->mv[0][1][0]; 180 mv_block->PMV[1][0][0] = s->mv[0][1][0];
181 mv_block->PMV[1][0][1] = s->mv[0][1][1]; 181 mv_block->PMV[1][0][1] = s->mv[0][1][1];
182 } 182 }
183 if (s->mv_dir & MV_DIR_BACKWARD) { 183 if (s->mv_dir & MV_DIR_BACKWARD) {
184 mv_block->macroblock_type|=XVMC_MB_TYPE_MOTION_BACKWARD; 184 mv_block->macroblock_type |= XVMC_MB_TYPE_MOTION_BACKWARD;
185 mv_block->PMV[0][1][0] = s->mv[1][0][0]; 185 mv_block->PMV[0][1][0] = s->mv[1][0][0];
186 mv_block->PMV[0][1][1] = s->mv[1][0][1]; 186 mv_block->PMV[0][1][1] = s->mv[1][0][1];
187 mv_block->PMV[1][1][0] = s->mv[1][1][0]; 187 mv_block->PMV[1][1][0] = s->mv[1][1][0];
188 mv_block->PMV[1][1][1] = s->mv[1][1][1]; 188 mv_block->PMV[1][1][1] = s->mv[1][1][1];
189 } 189 }
252 } 252 }
253 253
254 // calculate cbp 254 // calculate cbp
255 cbp = 0; 255 cbp = 0;
256 for (i = 0; i < blocks_per_mb; i++) { 256 for (i = 0; i < blocks_per_mb; i++) {
257 cbp+= cbp; 257 cbp += cbp;
258 if (s->block_last_index[i] >= 0) 258 if (s->block_last_index[i] >= 0)
259 cbp++; 259 cbp++;
260 } 260 }
261 261
262 if (s->flags & CODEC_FLAG_GRAY) { 262 if (s->flags & CODEC_FLAG_GRAY) {