Mercurial > libavcodec.hg
comparison mpegvideo_xvmc.c @ 8870:c5112df7f8b8 libavcodec
cosmetics: grammar/spelling/wording fixes in comments
author | diego |
---|---|
date | Sat, 14 Feb 2009 19:33:09 +0000 |
parents | 0c1463d800fe |
children | 199e9809eb5a |
comparison
equal
deleted
inserted
replaced
8869:0c1463d800fe | 8870:c5112df7f8b8 |
---|---|
68 assert(avctx); | 68 assert(avctx); |
69 | 69 |
70 render = (struct xvmc_render_state*)s->current_picture.data[2]; | 70 render = (struct xvmc_render_state*)s->current_picture.data[2]; |
71 assert(render); | 71 assert(render); |
72 if (!render || render->magic != AV_XVMC_RENDER_MAGIC) | 72 if (!render || render->magic != AV_XVMC_RENDER_MAGIC) |
73 return -1; // make sure that this is render packet | 73 return -1; // make sure that this is a render packet |
74 | 74 |
75 render->picture_structure = s->picture_structure; | 75 render->picture_structure = s->picture_structure; |
76 render->flags = s->first_field ? 0 : XVMC_SECOND_FIELD; | 76 render->flags = s->first_field ? 0 : XVMC_SECOND_FIELD; |
77 | 77 |
78 // make sure that all data is drawn by XVMC_end_frame | 78 // make sure that all data is drawn by XVMC_end_frame |
143 | 143 |
144 // Do I need to export quant when I could not perform postprocessing? | 144 // Do I need to export quant when I could not perform postprocessing? |
145 // Anyway, it doesn't hurt. | 145 // Anyway, it doesn't hurt. |
146 s->current_picture.qscale_table[mb_xy] = s->qscale; | 146 s->current_picture.qscale_table[mb_xy] = s->qscale; |
147 | 147 |
148 // START OF XVMC specific code | 148 // start of XVMC-specific code |
149 render = (struct xvmc_render_state*)s->current_picture.data[2]; | 149 render = (struct xvmc_render_state*)s->current_picture.data[2]; |
150 assert(render); | 150 assert(render); |
151 assert(render->magic==AV_XVMC_RENDER_MAGIC); | 151 assert(render->magic==AV_XVMC_RENDER_MAGIC); |
152 assert(render->mv_blocks); | 152 assert(render->mv_blocks); |
153 | 153 |
228 mv_block->motion_vertical_field_select |= s->field_select[1][0]<<1; | 228 mv_block->motion_vertical_field_select |= s->field_select[1][0]<<1; |
229 mv_block->motion_vertical_field_select |= s->field_select[0][1]<<2; | 229 mv_block->motion_vertical_field_select |= s->field_select[0][1]<<2; |
230 mv_block->motion_vertical_field_select |= s->field_select[1][1]<<3; | 230 mv_block->motion_vertical_field_select |= s->field_select[1][1]<<3; |
231 } | 231 } |
232 } // !intra | 232 } // !intra |
233 // time to handle data blocks; | 233 // time to handle data blocks |
234 mv_block->index = render->next_free_data_block_num; | 234 mv_block->index = render->next_free_data_block_num; |
235 | 235 |
236 blocks_per_mb = 6; | 236 blocks_per_mb = 6; |
237 if (s->chroma_format >= 2) { | 237 if (s->chroma_format >= 2) { |
238 blocks_per_mb = 4 + (1 << s->chroma_format); | 238 blocks_per_mb = 4 + (1 << s->chroma_format); |
245 if (s->block_last_index[i] >= 0) | 245 if (s->block_last_index[i] >= 0) |
246 cbp++; | 246 cbp++; |
247 } | 247 } |
248 | 248 |
249 if (s->flags & CODEC_FLAG_GRAY) { | 249 if (s->flags & CODEC_FLAG_GRAY) { |
250 if (s->mb_intra) { // intra frames are always full chroma block | 250 if (s->mb_intra) { // intra frames are always full chroma blocks |
251 for (i = 4; i < blocks_per_mb; i++) { | 251 for (i = 4; i < blocks_per_mb; i++) { |
252 memset(s->pblocks[i],0,sizeof(short)*8*8); // so we need to clear them | 252 memset(s->pblocks[i],0,sizeof(short)*8*8); // so we need to clear them |
253 if (!render->unsigned_intra) | 253 if (!render->unsigned_intra) |
254 s->pblocks[i][0] = 1 << 10; | 254 s->pblocks[i][0] = 1 << 10; |
255 } | 255 } |
267 // I do not have unsigned_intra MOCO to test, hope it is OK. | 267 // I do not have unsigned_intra MOCO to test, hope it is OK. |
268 if (s->mb_intra && (render->idct || (!render->idct && !render->unsigned_intra))) | 268 if (s->mb_intra && (render->idct || (!render->idct && !render->unsigned_intra))) |
269 s->pblocks[i][0] -= 1 << 10; | 269 s->pblocks[i][0] -= 1 << 10; |
270 if (!render->idct) { | 270 if (!render->idct) { |
271 s->dsp.idct(s->pblocks[i]); | 271 s->dsp.idct(s->pblocks[i]); |
272 /* It is unclear if MC hardware requires pixel diff values to be in | 272 /* It is unclear if MC hardware requires pixel diff values to be |
273 * range [-255;255]. TODO cliping if such hardware is ever found. | 273 * in the range [-255;255]. TODO: Clipping if such hardware is |
274 * As of now it would only be unnecessery slowdown. */ | 274 * ever found. As of now it would only be an unnecessary |
275 * slowdown. */ | |
275 } | 276 } |
276 // copy blocks only if the codec doesn't support pblocks reordering | 277 // copy blocks only if the codec doesn't support pblocks reordering |
277 if (s->avctx->xvmc_acceleration == 1) { | 278 if (s->avctx->xvmc_acceleration == 1) { |
278 memcpy(&render->data_blocks[render->next_free_data_block_num*64], | 279 memcpy(&render->data_blocks[render->next_free_data_block_num*64], |
279 s->pblocks[i],sizeof(short)*8*8); | 280 s->pblocks[i],sizeof(short)*8*8); |