]> git.sesse.net Git - x264/commitdiff
Use the correct default B-ref placement with B-pyramid
authorAnton Mitrofanov <BugMaster@narod.ru>
Sun, 10 Apr 2016 17:13:59 +0000 (20:13 +0300)
committerHenrik Gramner <henrik@gramner.com>
Mon, 11 Apr 2016 14:58:22 +0000 (16:58 +0200)
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.

encoder/slicetype.c

index d7fcb9d644c7bec744ad00c3a2c9bd2414cb64ad..32540be351e8abe4f192cd1e214e838c45a02fbc 100644 (file)
@@ -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++;
     }