From: Anton Mitrofanov Date: Sun, 10 Apr 2016 17:13:59 +0000 (+0300) Subject: Use the correct default B-ref placement with B-pyramid X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fd2c324731c2199e502ded9eff723d29c6eafe0b;p=x264 Use the correct default B-ref placement with B-pyramid Cost analyse functions expects the placement of the B-ref in a sequence of an even number of B-frames to be located towards the beginning while the actual placement was towards the end. Change the placement to be consistent with the analyse expectations, e.g. PbbBbP -> PbBbbP. --- diff --git a/encoder/slicetype.c b/encoder/slicetype.c index d7fcb9d6..32540be3 100644 --- a/encoder/slicetype.c +++ b/encoder/slicetype.c @@ -1928,7 +1928,7 @@ void x264_slicetype_decide( x264_t *h ) /* insert a bref into the sequence */ if( h->param.i_bframe_pyramid && bframes > 1 && !brefs ) { - h->lookahead->next.list[bframes/2]->i_type = X264_TYPE_BREF; + h->lookahead->next.list[(bframes-1)/2]->i_type = X264_TYPE_BREF; brefs++; }