[x264-devel] How to comprehend the multi-thread procedure for the stream structure “IPPP”?

alexander tian tian.alexandertian at gmail.com
Thu May 17 03:45:53 CEST 2007


Hi, everyone:

The x264 use the frame-level parallelism now. It could be easily
comprehended by the stream structure "IPBBPBB". Such as below figure:

0(I)----3(P)----6(P)------------9(P)-------------12(P)

                     |                  |                  |

                     |----1(B)        |----4(B)        |----7(B)

                     |                  |                  |

                     |----2(B)        |----5(B)        |----8(B)

But how does the x264 perform the multi-thread for the steam structure
"IPPPP"? I encode one file to the structure "IPPPP". The encoding speed is
about 31.65fps for multi-thread. At the same time it is 16.29fps for
single-thread with same parameters.

The result indicates that the multi-thread is very faster than the
sing-thread for the structure "IPPPP". I print the poc of each reference
frame for every thread. I use only 1 reference frame. The test data as
below:


x264 [info]: I poc= 0 no refpoc0 no refpoc1 thread=33ee8h

x264 [info]: P poc= 2 refpoc0= 0 no refpoc1 thread=34190h

x264 [info]: P poc= 4 refpoc0= 2 no refpoc1 thread=34300h

x264 [info]: P poc= 6 refpoc0= 4 no refpoc1 thread=33ee8h

x264 [info]: P poc= 8 refpoc0= 6 no refpoc1 thread=34190h

x264 [info]: P poc=10 refpoc0= 8 no refpoc1 thread=34300h

x264 [info]: P poc=12 refpoc0=10 no refpoc1 thread=33ee8h

x264 [info]: P poc=14 refpoc0=12 no refpoc1 thread=34190h

x264 [info]: P poc=16 refpoc0=14 no refpoc1 thread=34300h

x264 [info]: P poc=18 refpoc0=16 no refpoc1 thread=33ee8h

x264 [info]: P poc=20 refpoc0=18 no refpoc1 thread=34190h

x264 [info]: P poc=22 refpoc0=20 no refpoc1 thread=34300h

x264 [info]: I poc= 0 no refpoc0 no refpoc1 thread=33ee8h

x264 [info]: P poc= 2 refpoc0= 0 no refpoc1 thread=34190h

x264 [info]: P poc= 4 refpoc0= 2 no refpoc1 thread=34300h

x264 [info]: P poc= 6 refpoc0= 4 no refpoc1 thread=33ee8h

x264 [info]: P poc= 8 refpoc0= 6 no refpoc1 thread=34190h

x264 [info]: P poc=10 refpoc0= 8 no refpoc1 thread=34300h

x264 [info]: P poc=12 refpoc0=10 no refpoc1 thread=33ee8h

x264 [info]: P poc=14 refpoc0=12 no refpoc1 thread=34190h


I think it is difficult to perform frame-level parallelism for the structure
"IPPPPP" because every P slice needs the previous frame as reference. So the
current frame could begin to encode after the previous frame finish encode
and decode. But this is single-thread flow.

What's wrong with me? How does the x264 perform the multi-thread for the
structure "IPPPPPP"?

Any advice is welcome. Thanks in advance.

Best wishes,

Alexander tian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/x264-devel/attachments/20070517/df1a82d6/attachment.htm 


More information about the x264-devel mailing list