changeset 1471:dcb784544ec6 libavcodec

scenechange_threshold
author michaelni
date Tue, 16 Sep 2003 11:25:29 +0000
parents dc1aebe51742
children db00afcbd2ac
files avcodec.h mpegvideo.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Mon Sep 15 22:27:43 2003 +0000
+++ b/avcodec.h	Tue Sep 16 11:25:29 2003 +0000
@@ -15,7 +15,7 @@
 
 #define FFMPEG_VERSION_INT     0x000408
 #define FFMPEG_VERSION         "0.4.8"
-#define LIBAVCODEC_BUILD       4679
+#define LIBAVCODEC_BUILD       4680
 
 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
 #define LIBAVCODEC_VERSION     FFMPEG_VERSION
@@ -1242,6 +1242,14 @@
      * - decoding: set by user, will be converted to upper case by lavc during init
      */
     unsigned int stream_codec_tag;
+
+    /**
+     * scene change detection threshold.
+     * 0 is default, larger means fewer detected scene changes
+     * - encoding: set by user.
+     * - decoding: unused
+     */
+    int scenechange_threshold;
 } AVCodecContext;
 
 
--- a/mpegvideo.c	Mon Sep 15 22:27:43 2003 +0000
+++ b/mpegvideo.c	Tue Sep 16 11:25:29 2003 +0000
@@ -3416,7 +3416,7 @@
     }
     emms_c();
 
-    if(s->scene_change_score > 0 && s->pict_type == P_TYPE){
+    if(s->scene_change_score > s->avctx->scenechange_threshold && s->pict_type == P_TYPE){
         s->pict_type= I_TYPE;
         memset(s->mb_type   , MB_TYPE_INTRA, sizeof(uint8_t)*s->mb_stride*s->mb_height);
 //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);