[x264-devel] Re: [patch] split slice nal unit when it exceeds size x

Loren Merritt lorenm at u.washington.edu
Thu May 3 05:31:05 CEST 2007


On Wed, 2 May 2007, Alex Izvorski wrote:

> Lastly, correct me if I'm wrong, but it seems at a glance that all
> slices written will have sh.i_last_mb equal to the last mb of the whole
> frame?  Since the header gets written first and only some time later
> does the termination condition (by size) get met.  I haven't examined an
> output stream in detail to see if that is indeed the case, but it looks
> that way from the source.  If so, for a standards compliant stream the
> order would have to be reversed, write the slice body first (perhaps to
> a temp buffer), then the header, so the header can list the correct last
> mb number.

The slice header as written to the bitstream does not contain the number 
of mbs in the slice. sh.i_last_mb is just for x264's convenience, 
and only needs to be set if you decide the slice areas in advance. 
Instead, CABAC encodes a decision after each mb, "is this the last mb?". 
And CAVLC doesn't write it anywhere, the decoder is just supposed to 
stop parsing when it hits the end of the NALU.

--Loren Merritt

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list