1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

scenechange_threshold

Originally committed as revision 2281 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2003-09-16 11:25:29 +00:00
parent dd6ee74e4c
commit 05fbd0a2b0
2 changed files with 10 additions and 2 deletions

View File

@ -15,7 +15,7 @@ extern "C" {
#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 @@ typedef struct AVCodecContext {
* - 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;

View File

@ -3416,7 +3416,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
}
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);