Mercurial > libavcodec.hg
comparison mpeg12.c @ 8342:e76576f38ade libavcodec
Switch xvmc over to a CONFIG_ option.
author | diego |
---|---|
date | Mon, 15 Dec 2008 22:22:51 +0000 |
parents | cf4d575b1982 |
children | 35f1b87d908f |
comparison
equal
deleted
inserted
replaced
8341:750453ac8c90 | 8342:e76576f38ade |
---|---|
301 | 301 |
302 skip_bits1(&s->gb); /* marker */ | 302 skip_bits1(&s->gb); /* marker */ |
303 }else | 303 }else |
304 memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */ | 304 memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */ |
305 s->mb_intra = 1; | 305 s->mb_intra = 1; |
306 #ifdef HAVE_XVMC | 306 #ifdef CONFIG_XVMC |
307 //if 1, we memcpy blocks in xvmcvideo | 307 //if 1, we memcpy blocks in xvmcvideo |
308 if(s->avctx->xvmc_acceleration > 1){ | 308 if(s->avctx->xvmc_acceleration > 1){ |
309 XVMC_pack_pblocks(s,-1);//inter are always full blocks | 309 XVMC_pack_pblocks(s,-1);//inter are always full blocks |
310 if(s->swap_uv){ | 310 if(s->swap_uv){ |
311 exchange_uv(s); | 311 exchange_uv(s); |
514 if (cbp <= 0){ | 514 if (cbp <= 0){ |
515 av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y); | 515 av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y); |
516 return -1; | 516 return -1; |
517 } | 517 } |
518 | 518 |
519 #ifdef HAVE_XVMC | 519 #ifdef CONFIG_XVMC |
520 //if 1, we memcpy blocks in xvmcvideo | 520 //if 1, we memcpy blocks in xvmcvideo |
521 if(s->avctx->xvmc_acceleration > 1){ | 521 if(s->avctx->xvmc_acceleration > 1){ |
522 XVMC_pack_pblocks(s,cbp); | 522 XVMC_pack_pblocks(s,cbp); |
523 if(s->swap_uv){ | 523 if(s->swap_uv){ |
524 exchange_uv(s); | 524 exchange_uv(s); |
1637 if(s->picture_structure == PICT_BOTTOM_FIELD){ | 1637 if(s->picture_structure == PICT_BOTTOM_FIELD){ |
1638 s->current_picture.data[i] += s->current_picture_ptr->linesize[i]; | 1638 s->current_picture.data[i] += s->current_picture_ptr->linesize[i]; |
1639 } | 1639 } |
1640 } | 1640 } |
1641 } | 1641 } |
1642 #ifdef HAVE_XVMC | 1642 #ifdef CONFIG_XVMC |
1643 // MPV_frame_start will call this function too, | 1643 // MPV_frame_start will call this function too, |
1644 // but we need to call it on every field | 1644 // but we need to call it on every field |
1645 if(s->avctx->xvmc_acceleration) | 1645 if(s->avctx->xvmc_acceleration) |
1646 XVMC_field_start(s,avctx); | 1646 XVMC_field_start(s,avctx); |
1647 #endif | 1647 #endif |
1728 s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :""); | 1728 s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :""); |
1729 } | 1729 } |
1730 } | 1730 } |
1731 | 1731 |
1732 for(;;) { | 1732 for(;;) { |
1733 #ifdef HAVE_XVMC | 1733 #ifdef CONFIG_XVMC |
1734 //If 1, we memcpy blocks in xvmcvideo. | 1734 //If 1, we memcpy blocks in xvmcvideo. |
1735 if(s->avctx->xvmc_acceleration > 1) | 1735 if(s->avctx->xvmc_acceleration > 1) |
1736 XVMC_init_block(s);//set s->block | 1736 XVMC_init_block(s);//set s->block |
1737 #endif | 1737 #endif |
1738 | 1738 |
1910 MpegEncContext *s = &s1->mpeg_enc_ctx; | 1910 MpegEncContext *s = &s1->mpeg_enc_ctx; |
1911 | 1911 |
1912 if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr) | 1912 if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr) |
1913 return 0; | 1913 return 0; |
1914 | 1914 |
1915 #ifdef HAVE_XVMC | 1915 #ifdef CONFIG_XVMC |
1916 if(s->avctx->xvmc_acceleration) | 1916 if(s->avctx->xvmc_acceleration) |
1917 XVMC_field_end(s); | 1917 XVMC_field_end(s); |
1918 #endif | 1918 #endif |
1919 /* end of slice reached */ | 1919 /* end of slice reached */ |
1920 if (/*s->mb_y<<field_pic == s->mb_height &&*/ !s->first_field) { | 1920 if (/*s->mb_y<<field_pic == s->mb_height &&*/ !s->first_field) { |
2470 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY, | 2470 CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY, |
2471 .flush= ff_mpeg_flush, | 2471 .flush= ff_mpeg_flush, |
2472 .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"), | 2472 .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"), |
2473 }; | 2473 }; |
2474 | 2474 |
2475 #ifdef HAVE_XVMC | 2475 #ifdef CONFIG_XVMC |
2476 static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){ | 2476 static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){ |
2477 Mpeg1Context *s; | 2477 Mpeg1Context *s; |
2478 | 2478 |
2479 if( avctx->thread_count > 1) | 2479 if( avctx->thread_count > 1) |
2480 return -1; | 2480 return -1; |