comparison mpegvideo.c @ 320:cda7d0857baf libavcodec

- ME setting moved to AVCodecContext/MpegEncContext, no longer a global. - EPZS ME algo used by default. - HQ flag activated for ffmpeg. - Cosmetics ...
author pulento
date Sun, 14 Apr 2002 18:57:51 +0000
parents 40d8092e2ff0
children 2b00e171b1d4
comparison
equal deleted inserted replaced
319:3ef1cc75d5f5 320:cda7d0857baf
311 s->intra_only = 1; 311 s->intra_only = 1;
312 s->gop_size = 12; 312 s->gop_size = 12;
313 } else { 313 } else {
314 s->intra_only = 0; 314 s->intra_only = 0;
315 } 315 }
316 s->full_search = motion_estimation_method; 316
317 317 /* ME algorithm */
318 s->me_method = avctx->me_method;
319 /* Fixed QSCALE */
318 s->fixed_qscale = (avctx->flags & CODEC_FLAG_QSCALE); 320 s->fixed_qscale = (avctx->flags & CODEC_FLAG_QSCALE);
319 321
320 switch(avctx->codec->id) { 322 switch(avctx->codec->id) {
321 case CODEC_ID_MPEG1VIDEO: 323 case CODEC_ID_MPEG1VIDEO:
322 s->out_format = FMT_MPEG1; 324 s->out_format = FMT_MPEG1;
411 h263_encode_init(s); 413 h263_encode_init(s);
412 else if (s->out_format == FMT_MPEG1) 414 else if (s->out_format == FMT_MPEG1)
413 mpeg1_encode_init(s); 415 mpeg1_encode_init(s);
414 416
415 /* dont use mv_penalty table for crap MV as it would be confused */ 417 /* dont use mv_penalty table for crap MV as it would be confused */
416 if(s->full_search<4) s->mv_penalty= default_mv_penalty; 418 if (s->me_method < 0) s->mv_penalty = default_mv_penalty;
417 419
418 s->encoding = 1; 420 s->encoding = 1;
419 421
420 /* init */ 422 /* init */
421 if (MPV_common_init(s) < 0) 423 if (MPV_common_init(s) < 0)
1342 memset(s->mb_type , MB_TYPE_INTRA, sizeof(UINT8)*s->mb_width*s->mb_height); 1344 memset(s->mb_type , MB_TYPE_INTRA, sizeof(UINT8)*s->mb_width*s->mb_height);
1343 //printf("Scene change detected, encoding as I Frame\n"); 1345 //printf("Scene change detected, encoding as I Frame\n");
1344 } 1346 }
1345 1347
1346 /* find best f_code for ME which do unlimited searches */ 1348 /* find best f_code for ME which do unlimited searches */
1347 if(s->pict_type==P_TYPE && s->full_search>3){ 1349 if(s->pict_type == P_TYPE && s->me_method >= 0){
1348 int mv_num[8]; 1350 int mv_num[8];
1349 int i; 1351 int i;
1350 int loose=0; 1352 int loose=0;
1351 UINT8 * fcode_tab= s->fcode_tab; 1353 UINT8 * fcode_tab= s->fcode_tab;
1352 1354