summaryrefslogtreecommitdiff
path: root/libavcodec/snowenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-09 23:43:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-09 23:52:36 +0200
commitb62297805b5fd7c67ada8d913b3b10ee86dcb569 (patch)
tree483900160ae856e1b899f32c8ec1056c57e6c2a0 /libavcodec/snowenc.c
parentcf31e2df08e39082241c8e2e10eaacb115c69a6c (diff)
avcodec/snowenc: add intra_penalty AVOption
This allows favoring intra or inter blocks by a user specified amount. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/snowenc.c')
-rw-r--r--libavcodec/snowenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index ea5e544c4f..db8ab769d6 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -912,7 +912,7 @@ static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int
block->type &= ~BLOCK_INTRA;
}
- rd= get_block_rd(s, mb_x, mb_y, 0, obmc_edged);
+ rd= get_block_rd(s, mb_x, mb_y, 0, obmc_edged) + s->intra_penalty * !!intra;
//FIXME chroma
if(rd < *best_rd){
@@ -1877,6 +1877,7 @@ static const AVOption options[] = {
FF_MPV_COMMON_OPTS
{ "memc_only", "Only do ME/MC (I frames -> ref, P frame -> ME+MC).", OFFSET(memc_only), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
{ "no_bitstream", "Skip final bitstream writeout.", OFFSET(no_bitstream), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { "intra_penalty", "Penalty for intra blocks in block decission", OFFSET(intra_penalty), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ NULL },
};