Mercurial > libavcodec.hg
comparison mpeg12.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 | 0a898394092a |
children | 90c99bda19f5 |
comparison
equal
deleted
inserted
replaced
9002:eb98d61af310 | 9003:b595a8a59967 |
---|---|
306 } | 306 } |
307 | 307 |
308 if (s->codec_id == CODEC_ID_MPEG2VIDEO) { | 308 if (s->codec_id == CODEC_ID_MPEG2VIDEO) { |
309 if(s->flags2 & CODEC_FLAG2_FAST){ | 309 if(s->flags2 & CODEC_FLAG2_FAST){ |
310 for(i=0;i<6;i++) { | 310 for(i=0;i<6;i++) { |
311 mpeg2_fast_decode_block_intra(s, s->pblocks[i], i); | 311 mpeg2_fast_decode_block_intra(s, *s->pblocks[i], i); |
312 } | 312 } |
313 }else{ | 313 }else{ |
314 for(i=0;i<mb_block_count;i++) { | 314 for(i=0;i<mb_block_count;i++) { |
315 if (mpeg2_decode_block_intra(s, s->pblocks[i], i) < 0) | 315 if (mpeg2_decode_block_intra(s, *s->pblocks[i], i) < 0) |
316 return -1; | 316 return -1; |
317 } | 317 } |
318 } | 318 } |
319 } else { | 319 } else { |
320 for(i=0;i<6;i++) { | 320 for(i=0;i<6;i++) { |
321 if (ff_mpeg1_decode_block_intra(s, s->pblocks[i], i) < 0) | 321 if (ff_mpeg1_decode_block_intra(s, *s->pblocks[i], i) < 0) |
322 return -1; | 322 return -1; |
323 } | 323 } |
324 } | 324 } |
325 } else { | 325 } else { |
326 if (mb_type & MB_TYPE_ZERO_MV){ | 326 if (mb_type & MB_TYPE_ZERO_MV){ |
518 | 518 |
519 if (s->codec_id == CODEC_ID_MPEG2VIDEO) { | 519 if (s->codec_id == CODEC_ID_MPEG2VIDEO) { |
520 if(s->flags2 & CODEC_FLAG2_FAST){ | 520 if(s->flags2 & CODEC_FLAG2_FAST){ |
521 for(i=0;i<6;i++) { | 521 for(i=0;i<6;i++) { |
522 if(cbp & 32) { | 522 if(cbp & 32) { |
523 mpeg2_fast_decode_block_non_intra(s, s->pblocks[i], i); | 523 mpeg2_fast_decode_block_non_intra(s, *s->pblocks[i], i); |
524 } else { | 524 } else { |
525 s->block_last_index[i] = -1; | 525 s->block_last_index[i] = -1; |
526 } | 526 } |
527 cbp+=cbp; | 527 cbp+=cbp; |
528 } | 528 } |
529 }else{ | 529 }else{ |
530 cbp<<= 12-mb_block_count; | 530 cbp<<= 12-mb_block_count; |
531 | 531 |
532 for(i=0;i<mb_block_count;i++) { | 532 for(i=0;i<mb_block_count;i++) { |
533 if ( cbp & (1<<11) ) { | 533 if ( cbp & (1<<11) ) { |
534 if (mpeg2_decode_block_non_intra(s, s->pblocks[i], i) < 0) | 534 if (mpeg2_decode_block_non_intra(s, *s->pblocks[i], i) < 0) |
535 return -1; | 535 return -1; |
536 } else { | 536 } else { |
537 s->block_last_index[i] = -1; | 537 s->block_last_index[i] = -1; |
538 } | 538 } |
539 cbp+=cbp; | 539 cbp+=cbp; |
541 } | 541 } |
542 } else { | 542 } else { |
543 if(s->flags2 & CODEC_FLAG2_FAST){ | 543 if(s->flags2 & CODEC_FLAG2_FAST){ |
544 for(i=0;i<6;i++) { | 544 for(i=0;i<6;i++) { |
545 if (cbp & 32) { | 545 if (cbp & 32) { |
546 mpeg1_fast_decode_block_inter(s, s->pblocks[i], i); | 546 mpeg1_fast_decode_block_inter(s, *s->pblocks[i], i); |
547 } else { | 547 } else { |
548 s->block_last_index[i] = -1; | 548 s->block_last_index[i] = -1; |
549 } | 549 } |
550 cbp+=cbp; | 550 cbp+=cbp; |
551 } | 551 } |
552 }else{ | 552 }else{ |
553 for(i=0;i<6;i++) { | 553 for(i=0;i<6;i++) { |
554 if (cbp & 32) { | 554 if (cbp & 32) { |
555 if (mpeg1_decode_block_inter(s, s->pblocks[i], i) < 0) | 555 if (mpeg1_decode_block_inter(s, *s->pblocks[i], i) < 0) |
556 return -1; | 556 return -1; |
557 } else { | 557 } else { |
558 s->block_last_index[i] = -1; | 558 s->block_last_index[i] = -1; |
559 } | 559 } |
560 cbp+=cbp; | 560 cbp+=cbp; |
1593 break; | 1593 break; |
1594 } | 1594 } |
1595 } | 1595 } |
1596 | 1596 |
1597 static void exchange_uv(MpegEncContext *s){ | 1597 static void exchange_uv(MpegEncContext *s){ |
1598 short * tmp = s->pblocks[4]; | 1598 DCTELEM (*tmp)[64]; |
1599 | |
1600 tmp = s->pblocks[4]; | |
1599 s->pblocks[4] = s->pblocks[5]; | 1601 s->pblocks[4] = s->pblocks[5]; |
1600 s->pblocks[5] = tmp; | 1602 s->pblocks[5] = tmp; |
1601 } | 1603 } |
1602 | 1604 |
1603 static int mpeg_field_start(MpegEncContext *s){ | 1605 static int mpeg_field_start(MpegEncContext *s){ |