summaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2019-10-23 21:12:32 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-24 19:45:17 +0200
commit531fbce0b281be2450bbf0230c2de539230a7d84 (patch)
treee3877cf6dc62207f045d0144bd610b92471c1221 /libavcodec/mpegvideo_enc.c
parent3d5d0301c3d8b0c550db78730e9cfc017d6db5fb (diff)
downloadffmpeg-streaming-531fbce0b281be2450bbf0230c2de539230a7d84.zip
ffmpeg-streaming-531fbce0b281be2450bbf0230c2de539230a7d84.tar.gz
mpegvideo_enc: add intra_penalty option for p frames
This option allows more control over the use of intra macroblocks in predictive frames. By using '-intra_penalty max', intra macroblocks are never used in predictive frames. It is useful for glitch artists to generate input material. This option allows them to split and merge two video files while maintaining fluid motion from the second video without having intra macroblocks restoring chunks of the first video. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index f12e603..96f5b4a 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -3761,14 +3761,14 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->f_code= FFMAX3(s->f_code, a, b);
}
- ff_fix_long_p_mvs(s);
- ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, 0);
+ ff_fix_long_p_mvs(s, s->intra_penalty ? CANDIDATE_MB_TYPE_INTER : CANDIDATE_MB_TYPE_INTRA);
+ ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, !!s->intra_penalty);
if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
int j;
for(i=0; i<2; i++){
for(j=0; j<2; j++)
ff_fix_long_mvs(s, s->p_field_select_table[i], j,
- s->p_field_mv_table[i][j], s->f_code, CANDIDATE_MB_TYPE_INTER_I, 0);
+ s->p_field_mv_table[i][j], s->f_code, CANDIDATE_MB_TYPE_INTER_I, !!s->intra_penalty);
}
}
}
OpenPOWER on IntegriCloud