Mercurial > libavcodec.hg
comparison mpeg12.c @ 1821:1adbe0ab09fc libavcodec
use get_format
author | iive |
---|---|
date | Thu, 19 Feb 2004 00:30:33 +0000 |
parents | 45a7f6690782 |
children | fcbf31baa1af |
comparison
equal
deleted
inserted
replaced
1820:98dbb5c7f8cc | 1821:1adbe0ab09fc |
---|---|
78 extern int XVMC_field_end(MpegEncContext *s); | 78 extern int XVMC_field_end(MpegEncContext *s); |
79 extern void XVMC_pack_pblocks(MpegEncContext *s,int cbp); | 79 extern void XVMC_pack_pblocks(MpegEncContext *s,int cbp); |
80 extern void XVMC_init_block(MpegEncContext *s);//set s->block | 80 extern void XVMC_init_block(MpegEncContext *s);//set s->block |
81 #endif | 81 #endif |
82 | 82 |
83 const enum PixelFormat pixfmt_yuv_420[]= {PIX_FMT_YUV420P,-1}; | |
84 const enum PixelFormat pixfmt_yuv_422[]= {PIX_FMT_YUV422P,-1}; | |
85 const enum PixelFormat pixfmt_yuv_444[]= {PIX_FMT_YUV444P,-1}; | |
86 const enum PixelFormat pixfmt_xvmc_mpg2_420[] = { | |
87 PIX_FMT_XVMC_MPEG2_IDCT, | |
88 PIX_FMT_XVMC_MPEG2_MC, | |
89 -1}; | |
83 #ifdef CONFIG_ENCODERS | 90 #ifdef CONFIG_ENCODERS |
84 static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL; | 91 static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL; |
85 static uint8_t fcode_tab[MAX_MV*2+1]; | 92 static uint8_t fcode_tab[MAX_MV*2+1]; |
86 | 93 |
87 static uint32_t uni_mpeg1_ac_vlc_bits[64*64*2]; | 94 static uint32_t uni_mpeg1_ac_vlc_bits[64*64*2]; |
2352 MPEG1_FRAME_RATE_BASE, //FIXME store in allready reduced form | 2359 MPEG1_FRAME_RATE_BASE, //FIXME store in allready reduced form |
2353 1<<30 | 2360 1<<30 |
2354 ); | 2361 ); |
2355 avctx->bit_rate = s->bit_rate; | 2362 avctx->bit_rate = s->bit_rate; |
2356 | 2363 |
2357 //get_format() or set_video(width,height,aspect,pix_fmt); | 2364 if(avctx->xvmc_acceleration){ |
2358 //until then pix_fmt may be changed right after codec init | 2365 avctx->pix_fmt = avctx->get_format(avctx,pixfmt_xvmc_mpg2_420); |
2366 }else{ | |
2367 avctx->pix_fmt = avctx->get_format(avctx,pixfmt_yuv_420); | |
2368 } | |
2369 | |
2359 if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT ) | 2370 if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT ) |
2360 if( avctx->idct_algo == FF_IDCT_AUTO ) | 2371 if( avctx->idct_algo == FF_IDCT_AUTO ) |
2361 avctx->idct_algo = FF_IDCT_SIMPLE; | 2372 avctx->idct_algo = FF_IDCT_SIMPLE; |
2362 | 2373 |
2363 if (MPV_common_init(s) < 0) | 2374 if (MPV_common_init(s) < 0) |
2456 s->width = avctx->width; | 2467 s->width = avctx->width; |
2457 s->height = avctx->height; | 2468 s->height = avctx->height; |
2458 avctx->has_b_frames= 0; //true? | 2469 avctx->has_b_frames= 0; //true? |
2459 s->low_delay= 1; | 2470 s->low_delay= 1; |
2460 | 2471 |
2461 //get_format() or set_video(width,height,aspect,pix_fmt); | 2472 if(avctx->xvmc_acceleration){ |
2462 //until then pix_fmt may be changed right after codec init | 2473 avctx->pix_fmt = avctx->get_format(avctx,pixfmt_xvmc_mpg2_420); |
2474 }else{ | |
2475 avctx->pix_fmt = avctx->get_format(avctx,pixfmt_yuv_420); | |
2476 } | |
2477 | |
2463 if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT ) | 2478 if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT ) |
2464 if( avctx->idct_algo == FF_IDCT_AUTO ) | 2479 if( avctx->idct_algo == FF_IDCT_AUTO ) |
2465 avctx->idct_algo = FF_IDCT_SIMPLE; | 2480 avctx->idct_algo = FF_IDCT_SIMPLE; |
2466 | 2481 |
2467 if (MPV_common_init(s) < 0) | 2482 if (MPV_common_init(s) < 0) |