Page 1 of 1

vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 25 Dec 2008 17:28
by rafalm23
Hello,
Newest version of ffmpeg/libavcodec x264 decoder has support for multithreaded decoding, how can i enable it in vlc 0.9.8a?

Thank You,
R.M.

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 26 Dec 2008 14:42
by Jean-Baptiste Kempf
No, newest version of libavcodec isn't multithreaded.

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 28 Dec 2008 20:23
by rafalm23
No, newest version of libavcodec isn't multithreaded.
fmpeg/libavcodec/h264.c:

static void free_tables(H264Context *h){
[...]
for(i = 0; i < h->s.avctx->thread_count; i++) {
[...]
}
}

static int frame_start(H264Context *h){
{
[...]
for(i = 0; i < s->avctx->thread_count; i++)
[...]
}

"as the title says, thanks to Andreas Öman libavcodec now can make use of dual core processors when decoding h.264"
http://svn.mplayerhq.hu/ffmpeg/trunk/li ... e&view=log

"Fix problem with multithreaded decoding, introduced by r11214.
Patch by Reinhard Nissl: rnissl gmx de"

http://svn.mplayerhq.hu/ffmpeg/trunk/li ... e&view=log

http://img228.imageshack.us/img228/1434 ... efeae3.png

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 28 Dec 2008 20:45
by Rémi Denis-Courmont
VLC does not support this at the moment.

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 28 Dec 2008 20:50
by rafalm23
VLC does not support this at the moment.
i' m added to function decode_init:

static av_cold int decode_init(AVCodecContext *avctx){
avctx->thread_count = 2;
[...]
}

but this dosn't work

maybe you know? where to add "avctx->thread_count = 2" ? (for fast support multithreaded x264 vlc decoding)?

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 30 Dec 2008 17:26
by Jean-Baptiste Kempf
Isn't that only for slice-based decoding?

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 02 Jan 2009 15:02
by rafalm23
Isn't that only for slice-based decoding?
yes :(

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 02 Jan 2009 16:09
by Jean-Baptiste Kempf
Well, x264 doesn't encode in slices, so I am not sure this is very usefull.

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 03 Jan 2009 10:01
by rafalm23
I would like to implement 2-threaded single-slice ffh264 decoding, but I need basic information "how to"

h264.c:

static int decode_slice(struct AVCodecContext *avctx, void *arg)
{
[...]

s->mb_y = 20; //this is my - when i set this video have atrifacts (next field is based on previous?)
for(;;){
[...]

}

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 03 Jan 2009 17:51
by rafalm23
Hello,
I added to function decoded_slice(...) mb_y = 20 before for(;;)

oryginal: http://img393.imageshack.us/img393/7206/screenav5.png
with mb_y=20: http://img371.imageshack.us/img371/3759 ... mbyqs1.png
should be: http://img387.imageshack.us/img387/8664 ... dbeci7.png

ok, i know, i must increment variable (pointer to compressed data), but
i can't find it, can you help me?

regards,
R.M.

Re: vlc 0.9.8a - how can i enable multithreaded decoding x264

Posted: 03 Jan 2009 18:34
by Jean-Baptiste Kempf
Ask on vlc-devel mailing list!