aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-08-22 19:41:06 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-08-22 19:41:06 +0000
commit1fb4890b5195db4de31733a234abb946f9399f3e (patch)
treee7f8052f50224fe83f3160d1e2047469f12562c4 /libavcodec/mpegvideo.c
parent90cee0c351f43a37b626c08d8262eaa3237f4de9 (diff)
downloadffmpeg-1fb4890b5195db4de31733a234abb946f9399f3e.tar.gz
better scene change detection
Originally committed as revision 858 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index e352b1516a..9352b96303 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1978,6 +1978,8 @@ static void encode_picture(MpegEncContext *s, int picture_number)
if (s->h263_pred && !s->h263_msmpeg4)
ff_set_mpeg4_time(s, s->picture_number);
+ s->scene_change_score=0;
+
/* Estimate motion for every MB */
if(s->pict_type != I_TYPE){
for(mb_y=0; mb_y < s->mb_height; mb_y++) {
@@ -2009,8 +2011,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
memset(s->p_mv_table , 0, sizeof(INT16)*(s->mb_width+2)*(s->mb_height+2)*2);
memset(s->mb_type , MB_TYPE_INTRA, sizeof(UINT8)*s->mb_width*s->mb_height);
}
-
- if(s->mb_var_sum < s->mc_mb_var_sum && s->pict_type == P_TYPE){ //FIXME subtract MV bits
+ if(s->scene_change_score > 0 && s->pict_type == P_TYPE){
s->pict_type= I_TYPE;
memset(s->mb_type , MB_TYPE_INTRA, sizeof(UINT8)*s->mb_width*s->mb_height);
if(s->max_b_frames==0){