[x264-devel] Re: parallising the encoder

champ yen champ.yen at gmail.com
Mon Apr 18 16:25:06 CEST 2005


On 4/18/05, Tom Jacobs <T.R.Jacobs at lboro.ac.uk> wrote:
> thanks for all the info everyone, much appreciated.
> the rest of this is probably just aimed at champ yen since it is his code i
> am 'playing' with.
In fact, I'm a little amazed...^^b

> i am modifing it so that instead of using pthreads i can run it on my SoC
> multi-processor simulator. the main loop that i need to thread is the one
> containing slice_encode_thread. i am guessing that the use of
> thread_data[i] was because of only being able to pass one argument with
> pthread_create.
> of these are h i_nal_type i_slice_type i_nal_ref_idc i_global_qp going to be
> the same value for all the threads? 
Yes.

> with only the slice number, i, being
> different?
In my implement, it is so.
In slice_write, each thread has it's on macroblock structure and
bitstream output.
Some information are shared.

> so far i have got this kind of arrangemt as i have undone the loop for a
> 2slice encode:
> if (processor ==0) {
>  thread_data[0].h = h;
>  thread_data[0].i_nal_type = i_nal_type;
>  thread_data[0].i_slice_type = i_slice_type;
>  thread_data[0].i_slice_id = 0;
>  thread_data[0].i_nal_ref_idc = i_nal_ref_idc;
>  thread_data[0].i_global_qp = i_global_qp;
>  rc = slice_encode_thread(&thread_data[0]);
> }
> 
> if (processor==1) {
>  thread_data[1].h = h;
>  thread_data[1].i_nal_type = i_nal_type;
>  thread_data[1].i_slice_type = i_slice_type;
>  thread_data[1].i_slice_id = 1;
>  thread_data[1].i_nal_ref_idc = i_nal_ref_idc;
>  thread_data[1].i_global_qp = i_global_qp;
>  rc = slice_encode_thread(&thread_data[1]);
> }
> is this how the threaded program should work?  all processor executing
> slice_encode_thread at the sametime.
Is "processor" used to identify the CPU to run the thread?
Hmmm.....Yes, it may work.

> thanks for your help
> Tom
If you could found any other parallel possibility for more performance gain.
Please inform me, I'm glad to improve the implementation.
Any suggestion is appreciated.

best regards
champ yen

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