Originally committed as revision 1469 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2003-01-18 01:37:42 +00:00
parent e51d4defe0
commit 1d0eab1dcc
4 changed files with 10 additions and 8 deletions

View File

@ -1894,10 +1894,11 @@ static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int
run++;
}
i= scantable[last];
assert(level);
level= temp[i] + 64;
assert(level - 64);
if((level&(~127)) == 0){
bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
}else

View File

@ -1,7 +1,7 @@
/*
* Motion estimation
* Copyright (c) 2000,2001 Fabrice Bellard.
* Copyright (c) 2002 Michael Niedermayer
* Copyright (c) 2002-2003 Michael Niedermayer
*
*
* This library is free software; you can redistribute it and/or
@ -313,6 +313,7 @@ static inline int get_penalty_factor(MpegEncContext *s, int type){
case FF_CMP_DCT:
case FF_CMP_SATD:
case FF_CMP_SSE:
case FF_CMP_PSNR:
return s->qscale*8;
case FF_CMP_BIT:
return 1;
@ -1030,7 +1031,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
}
#endif
}else{
s->scene_change_score+= 20;
s->scene_change_score+= s->qscale;
mb_type|= MB_TYPE_INTRA;
mx = 0;
my = 0;

View File

@ -160,7 +160,7 @@ static int RENAME(hpel_motion_search)(MpegEncContext * s,
if(s->avctx->me_cmp != s->avctx->me_sub_cmp){
CMP_HPEL(dmin, 0, 0, mx, my, size);
if(mx || my)
if(mx || my || size>0)
dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
}
@ -290,7 +290,7 @@ static int RENAME(qpel_motion_search)(MpegEncContext * s,
if(s->avctx->me_cmp != s->avctx->me_sub_cmp){
CMP_QPEL(dmin, 0, 0, mx, my, size);
if(mx || my)
if(mx || my || size>0)
dmin += (mv_penalty[4*mx - pred_x] + mv_penalty[4*my - pred_y])*penalty_factor;
}

View File

@ -2592,7 +2592,7 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
s->block_last_index[4]=
s->block_last_index[5]= 0;
s->block[4][0]=
s->block[5][0]= 128;
s->block[5][0]= (1024 + s->c_dc_scale/2)/ s->c_dc_scale;
}
#ifdef CONFIG_ENCODERS