Mercurial > libavcodec.hg
comparison mpegvideo.c @ 1580:628bf341e099 libavcodec
XvMC speedup by removing one memcpy and doing MB packing
author | iive |
---|---|
date | Mon, 27 Oct 2003 23:22:43 +0000 |
parents | 039cb2296de2 |
children | 3d1d0490e5a6 |
comparison
equal
deleted
inserted
replaced
1579:039cb2296de2 | 1580:628bf341e099 |
---|---|
54 #endif //CONFIG_ENCODERS | 54 #endif //CONFIG_ENCODERS |
55 | 55 |
56 #ifdef HAVE_XVMC | 56 #ifdef HAVE_XVMC |
57 extern int XVMC_field_start(MpegEncContext*s, AVCodecContext *avctx); | 57 extern int XVMC_field_start(MpegEncContext*s, AVCodecContext *avctx); |
58 extern void XVMC_field_end(MpegEncContext *s); | 58 extern void XVMC_field_end(MpegEncContext *s); |
59 extern void XVMC_decode_mb(MpegEncContext *s, DCTELEM block[6][64]); | 59 extern void XVMC_decode_mb(MpegEncContext *s); |
60 #endif | 60 #endif |
61 | 61 |
62 void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w)= draw_edges_c; | 62 void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w)= draw_edges_c; |
63 | 63 |
64 | 64 |
516 CHECKED_ALLOCZ(s->mbskip_table, mb_array_size+2); | 516 CHECKED_ALLOCZ(s->mbskip_table, mb_array_size+2); |
517 //Note the +1 is for a quicker mpeg4 slice_end detection | 517 //Note the +1 is for a quicker mpeg4 slice_end detection |
518 CHECKED_ALLOCZ(s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE); | 518 CHECKED_ALLOCZ(s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE); |
519 | 519 |
520 s->block= s->blocks[0]; | 520 s->block= s->blocks[0]; |
521 | |
522 for(i=0;i<12;i++){ | |
523 s->pblocks[i] = (short *)(&s->block[i]); | |
524 } | |
521 | 525 |
522 s->parse_context.state= -1; | 526 s->parse_context.state= -1; |
523 | 527 |
524 s->context_initialized = 1; | 528 s->context_initialized = 1; |
525 return 0; | 529 return 0; |
2483 { | 2487 { |
2484 int mb_x, mb_y; | 2488 int mb_x, mb_y; |
2485 const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; | 2489 const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; |
2486 #ifdef HAVE_XVMC | 2490 #ifdef HAVE_XVMC |
2487 if(s->avctx->xvmc_acceleration){ | 2491 if(s->avctx->xvmc_acceleration){ |
2488 XVMC_decode_mb(s,block); | 2492 XVMC_decode_mb(s);//xvmc uses pblocks |
2489 return; | 2493 return; |
2490 } | 2494 } |
2491 #endif | 2495 #endif |
2492 | 2496 |
2493 mb_x = s->mb_x; | 2497 mb_x = s->mb_x; |