[x264-devel] Re: x264 initialization and threads

Måns Rullgård mru at mru.ath.cx
Thu Jul 15 02:17:41 CEST 2004


Laurent Aimar <fenrir at via.ecp.fr> writes:

> On Thu, Jul 15, 2004, Måns Rullgård wrote:
>> Is there any initialization of global data in x264 that is not thread
>> safe?  If yes, I suggest a separate initialization function to perform
>> these things in order to simplify the locking requirements of
>> applications using x264.
>  There isn't any global data initialization in x264. All global datas
> are constant.

Except the timers.  Not that it matters much, it only gives some
strange values when running several parallel encoders.

>> For the rate control I need a small table of static values to avoid
>> some floating point calculations.  For now I can initialize it the
>> first time an encoder instance is created.  It's not thread safe as
>> such, but double initialization won't do any harm either.
>  Do you really need to compute them at runtime ? Why a constant table
> isn't suitable ?

Sure, I could use a constant table.  I'd just have to take the time to
create it ;-)

>  Else you can compute it per x264_t instance and store it in
> x264_ratecontrol_t.

I don't like the idea of storing multiple copies of constant data.

-- 
Måns Rullgård
mru at mru.ath.cx

-- 
This is the x264-devel mailing-list
If you are in trouble, please contact <postmaster at videolan.org>



More information about the x264-devel mailing list