home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 July & August / PCWorld_2006-07-08_cd.bin / audio-video / ffdshow / ffdshow-20060513-rev2546.exe / readmeMultiCPU.txt < prev    next >
Text File  |  2006-05-13  |  3KB  |  44 lines

  1. 1. About multithreading of ffdshow video playback
  2.  
  3. The objective of multithreading is to reduce frame drops. This patch reduce frame drops by decording and resizing next frame while video renderer is working on other thread. Resize is processed on multithread when the video renderer is faster than the decoder.
  4. For example upscaling DVD to HDTV with ffdshow and VMR9 renderless mode of media player classic(MPC) give very good quality. But it requires very high CPU power and even current powerfull CPU may drop frames without multithreading. This patch is optimized for such case.
  5. Certain video renderer cannot run on child thread. It includes the default renderer of Windows 2000 or older, the default of Zoom Player(Overlay Mixer, Standard Renderer), "Old Renderer" of MPC, etc. In this case, multithreading around video renderer is avoided and Resize is processed on multithread.
  6.  
  7. 2. Configuration
  8.  
  9. Go to Miscellaneous/Other controls. You will see "Use multiple threads for processing and rendering".
  10. To enable multithreading of Livavcodec, uncheck it.
  11. If your CPU is single core and non hyper-threading, multithreading is avoided. 
  12.  
  13. 3. Overview of implimentation (for developers)   m_csReceiveProtector
  14.  
  15. As for ffdshow.ax, multithreading is implimented by calling the downstream filter on child thread. Modification of TffdshowDecVideo::deliverProcessedSample is the core. If I can help it I'd like to process whole deliverProcessedSample on child thread. For implimentation reasons, deliverProcessedSample is devided. At the begining of deliverProcessedSample we lock CCritSec m_csReceive, we have to unlock it to hand it to child thread. It's unsafe without protection, I implemented CCritSec m_csReceiveProtector for double structure protection. All the process related to TffdshowDecVideo have to lock m_csReceiveProtector before locking m_csReceive. This force my rule on other programers including milan , is not a good manner. Excuse me for lack of technique.
  16.  
  17. 4.Tested environment
  18.  
  19. Upscaling DVD to HDTV could be done without droping frames on the following environment.
  20.  
  21.  ffdshow resize(lanczos) 1904x960, unsharp mask,
  22.  Media player classic, VMR9 Renderless, 2D subtitle,
  23.  SPDIF audio,
  24.  Athlon 64 x2 4400+, Radeon 9600XT+HDTV adapter, WindowsXp sp2
  25.  
  26. 5. Web links
  27.  
  28. ffdshow: http://cutka.szm.sk/ffdshow/ or http://sourceforge.net/projects/ffdshow/
  29. ffmpeg:  http://ffmpeg.org/
  30. mplayer: http://www.mplayerhq.hu/
  31.  
  32. and 
  33. doom9:   http://www.doom9.org/
  34.  
  35. 6. Copying
  36.  
  37. All used sources including multithreading related code and ffdshow itself
  38. are distributed under GPL. See copying.txt
  39.  
  40.  
  41. Implementation of multithreading by Haruhiko Yamagata<h.yamagata@nifty.com>
  42. ffdshow is a software written by Milan Cutka.
  43. Swscaler is a software written by Michael Niedermayer.
  44.