Skip to content

Repository files navigation

Multi Threaded Image Processing

About

Used for Remote Desktop streaming purposes to acheive 60 FPS and above by sending the changed regions (delta's) that can be represented in a blocks, the block size can be determined by the user.

Algorithm

  1. Split the Screen into Upper and Lower by deviding the height by 2.
  2. Process the Upper and Lower parallel by adding them into a thread pool and wait for them to be finished to sum the results.
  3. The Upper process, contains two different phases for scanning.
    • Scan row by row and add the changed row into the list.
    • Scan each row by a specific block size and add the block into the final list that will be returned back to the main caller.

Recommended Block Sizes

Block SizePixel Size (bytes)Pixel FormatInternet Speed
1204RGBA120 Mbps +
604RGBA80 Mbps
304RGBA60 Mbps
1203RGB100 MBps
603RGB60 Mbps
303RGB50 Mbps

Maximum block size can be up to 200, any more than that it would be redundant.

Usage

privateCodec.Encoderencoder=newCodec.Encoder();privateCodec.Decoderdecoder=newCodec.Decoder();privatevoidDoStream(){PixelFormatBitmapFormat=PixelFormat.Format32bppArgb;MemoryStreamOutStream=newMemoryStream();while(true){encoder.Encode(OutStream,BitmapExtensions.CaptureScreen(BitmapFormat),BitmapFormat);StreamBox.Image=decoder.Decode(OutStream);OutStream.Position=0;OutStream.SetLength(0);}}

About

For fast and efficient Remote Desktop

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages