⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 threads.txt

📁 linux下编译已经通过
💻 TXT
字号:
Old threading method: slice-basedapplication calls x264x264 runs B-adapt and ratecontrol (serial)split frame into several slices, and spawn a thread for each slicewait until all threads are donedeblock and hpel filter (serial)return to applicationIn x264cli, there is one additional thread to decode the input.New threading method: frame-basedapplication calls x264x264 runs B-adapt and ratecontrol (serial to the application, but parallel to the other x264 threads)spawn a thread for this framethread runs encode in 1 slice, deblock, hpel filtermeanwhile x264 waits for the oldest thread to finishreturn to application, but the rest of the threads continue running in the backgroundNo additional threads are needed to decode the input, unless decoding+B-adapt is slower than slice+deblock+hpel, in which case an additional input thread would allow decoding in parallel to B-adapt.Penalties for slice-based threading:Each slice adds some bitrate (or equivalently reduces quality), for a variety of reasons: the slice header costs some bits, cabac contexts are reset, mvs and intra samples can't be predicted across the slice boundary.In CBR mode, we have to allocate bits between slices before encoding them, which may lead to uneven quality.Some parts of the encoder are serial, so it doesn't scale well with lots of cpus.Penalties for frame-base threading:To allow encoding of multiple frames in parallel, we have to ensure that any given macroblock uses motion vectors only from pieces of the reference frames that have been encoded already. This is usually not noticeable, but can matter for very fast upward motion.We have to commit to one frame type before starting on the frame. Thus scenecut detection must run during the lowres pre-motion-estimation along with B-adapt, which makes it faster but less accurate than re-encoding the whole frame.Ratecontrol gets delayed feedback, since it has to plan frame N before frame N-1 finishes.Benchmarks:cpu: 4x woodcrest 3GHzcontent: 480px264 -B1000 -b2 -m1 -Anonethreads  speed           psnr       old   new      old    new1:   1.000x 1.000x   0.000  0.0002:   1.168x 1.413x  -0.038 -0.0073:   1.208x 1.814x  -0.064 -0.0054:   1.293x 2.329x  -0.095 -0.0065:          2.526x         -0.0076:          2.658x         -0.0017:          2.723x         -0.0188:          2.712x         -0.019x264 -B1000 -b2 -m5threads  speed           psnr          old   new      old    new1:   1.000x 1.000x   0.000  0.0002:   1.319x 1.517x  -0.036 -0.0063:   1.466x 2.013x  -0.068 -0.0054:   1.578x 2.741x  -0.101 -0.0045:          3.022x         -0.0156:          3.221x         -0.0147:          3.331x         -0.0208:          3.425x         -0.025x264 -B1000 -b2 -m6 -r3 -8 --b-rdothreads  speed           psnr          old   new      old    new1:   1.000x 1.000x   0.000  0.0002:   1.531x 1.707x  -0.032 -0.0063:   1.866x 2.277x  -0.061 -0.0054:   2.097x 3.204x  -0.088 -0.0065:          3.468x         -0.0136:          3.629x         -0.0107:          3.716x         -0.0148:          3.745x         -0.018

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -