[x264-devel] Re: Size of a NAL-unit

Loren Merritt lorenm at u.washington.edu
Tue Nov 29 07:13:38 CET 2005


On Mon, 28 Nov 2005, Davy De Winter wrote:

> we're trying to implement a x264-based RTP-streamer. The main problem we are 
> facing is the hughe size of the NAL-unit (more than 65K bytes) which causes a 
> lot of fragmented IP-packets leading in error-prone network to a large 
> loss-multiplier. Is it possible to change the maximum size of a NAL-unit, or 
> can someone give some advice how and if the source can be (easily?) adapted 
> to change the maximum NAL-unit size?

It is not currently supported, but should be simple enough to add:

In x264_slice_write(), after each macroblock, check whether bs_pos() is 
near the limit. If you predict that the next macroblock will exceed the 
limit (prediction method depends on how strict the limit is), then:
finish the slice (i.e. break out of the mb loop),
update h->sh.i_first_mb to the mb you stopped at,
increment h->out.i_nal,
initialize the type and bitstream pointer of the new nalu,
and call x264_slice_write() again.

Issues:
To make this compatible with multithreading, more logic is needed to 
merge the lists of nalus from different threads.
X264_NAL_MAX must be large enough.

--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