[x264-devel] Re: encoding with lots of small slices

Loren Merritt lorenm at u.washington.edu
Wed Aug 2 07:04:31 CEST 2006


On Tue, 1 Aug 2006, Michael Roitzsch wrote:

> The second and third patch are the same as in my previous mail.

I think the intra condition is not quite right: I_PRED_16x16_P needs the 
topleft pixel. Though the difference would probably not be easily visible.

> The fourth patch is the new one: It fixes an issue with P-frames. I found 
> this fix mostly by trial and error and I am not really sure what it does, let 
> alone whether it is correct. But the outcome is that x264 happily encodes 
> files with arbitrarily high slice counts per frame. I would really appreciate 
> some comments from the x264 team members on this.

Attached is the right way to fix what I assume is the same problem 
that your patch addresses. (untested)

--Loren Merritt
-------------- next part --------------
Index: encoder/analyse.c
===================================================================
--- encoder/analyse.c	(revision 544)
+++ encoder/analyse.c	(working copy)
@@ -228,7 +228,7 @@
         h->mb.mv_max_fpel[0] = CLIP_FMV( 16*( h->sps->i_mb_width - h->mb.i_mb_x - 1 ) + 8 );
         h->mb.mv_min_spel[0] = 4*( h->mb.mv_min_fpel[0] - 16 );
         h->mb.mv_max_spel[0] = 4*( h->mb.mv_max_fpel[0] + 16 );
-        if( h->mb.i_mb_x == 0)
+        if( !(h->mb.i_neighbour & MB_LEFT) )
         {
             h->mb.mv_min[1] = 4*( -16*h->mb.i_mb_y - 24 );
             h->mb.mv_max[1] = 4*( 16*( h->sps->i_mb_height - h->mb.i_mb_y - 1 ) + 24 );


More information about the x264-devel mailing list