Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Introduction of New VNC codec

Any features you would like to see in UltraVNC? Propose it here
Post Reply
Hitachi Systems & Ser
Posts: 1
Joined: 2007-02-01 04:09

Introduction of New VNC codec

Post by Hitachi Systems & Ser »

Dear VNC developer.


Introduction of
"ZYWRLE":Enhanced VNC codec for Motion picture


1. Introduction
The lossy codec based on Wavelet transform is frequently
used in compression of natural image, motion picture and
audio stream.
But it isn't almost used in Remote Desktop protocol like
VNC because classical lossless run-length codec like ZRLE
has high performance in peculiar image which has big mono
color region like desktop image. The lack of lossy codec
cause low performance of motion picture in VNC.
We introduce new codec "ZYWRLE(ZLib YUV Wavelet Run Length
Encoding)" which applied wavelet transform partially and
is based on ZRLE. In this new codec, network traffic reduced
to 15%-50% traffic of ZRLE when we play motion picture.


2. Highlight of Evalution of ZYWRLE

Result of ZYWRLE for motion picture
+-------+-------------------+------------------+------------------+
|quality| Raw tile(Mbytes) | Total(Mbytes) |Raw tile|PSNR(RGB)|
| | Out | Raw |rate | Comp.| Raw |rate| rate(%)| (dB) |
+-------+------+------+-----+------+------+----+--------+---------+
| ZRLE |125.8 |125.8 |100 |117.1 |392.2 |29.8| 32.1 | INF. |
| Hi | 53.85|167.58| 32.1| 52.10|370.96|14.0| 45.1 | 28.025 |
| Mid | 31.83|264.05| 12.1| 20.56|378.50| 5.4| 69.7 | 23.980 |
+-------+------+------+-----+------+------+----+--------+---------+

* Comp. rate of ZRLE(about 30%) goes to 15%(Hi-quality)/5%(Mid-quality)!


3. Reference Implementation(C source code/patch for VNC Servers)
* Core Codec of ZYWRLE
http://mobile.hitachi-system.co.jp/publ ... template.c
* Patch for Ultr@VNC V1.0.2
http://mobile.hitachi-system.co.jp/publ ... E-diff.txt
* Patch for LibVNCServer 0.8.2
http://mobile.hitachi-system.co.jp/publ ... E-diff.txt

I think that Any VNC server can be applied ZYWRLE easlilly using one of these patch.


4. License of ZYWRLE
Though ZYWRLE is our intellectual property and was developed for
our micro-VNC, We Hitachi Systems & Services, Ltd. decided make it
open source. You can use it with no fee for commercial and/or
non-commercial purpose. The above reference implementation are released
under our BSD-like license. More detail, see top of zywrletemplate.c.


5. More detail
See our ZYWRLE page(http://mobile.hitachi-system.co.jp/publications/ZYWRLE/)

We are glad if your VNC server supports ZYWRLE.

Thank you.

---
Noriaki Yamazaki
Administrator of micro-VNC

Research & Developement center
Hitachi Systems & Services, Ltd.
Arnie_75
20
20
Posts: 47
Joined: 2006-03-29 14:50

Re: Introduction of New VNC codec

Post by Arnie_75 »

This sounds good to me as I am no expert.
What do the developers of UltraVNC say about this? Is this faster than UltraVNC with tight compression? Does it work with UltraVNC at all?
UltraSam
Admin & Developer
Admin & Developer
Posts: 462
Joined: 2004-04-26 20:55
Contact:

Re: Introduction of New VNC codec

Post by UltraSam »

Thank you very much for this patch and new encoder that seems good !

I've already seen your post with the UltraVNC patch on another mailing list ;)

We plan to apply this encoder patch to UltraVNC and give it a try.
If it performs well it will be presumably used in some of our default settings (Medium, modem, slow...)

Thanks again
UltraSam
Arnie_75
20
20
Posts: 47
Joined: 2006-03-29 14:50

Re: Introduction of New VNC codec

Post by Arnie_75 »

UltraSam wrote: I've already seen your post with the UltraVNC patch on another mailing list ;)
Me too :)
roytam1
20
20
Posts: 47
Joined: 2006-05-16 08:49
Contact:

Re: Introduction of New VNC codec

Post by roytam1 »

I got a question about the patch:

Code: Select all

diff -rcN -x winvnc___Win32_Http -x Release -x Debug -x *.plg -x *.dsw -x *.ncb -x *.opt -x buildtime.h ../UltraVNC-102-Src\UltraVNC/vncviewer/ClientConnection.h UltraVNC/vncviewer/ClientConnection.h
*** ../UltraVNC-102-Src\UltraVNC/vncviewer/ClientConnection.h	Wed Aug 02 11:54:02 2006
--- UltraVNC/vncviewer/ClientConnection.h	Wed Aug 02 12:57:22 2006
***************
*** 546,561 ****
  	rdr::FdInStream* fis;
  	rdr::ZlibInStream* zis;
  	void zrleDecode(int x, int y, int w, int h);
! 	void zrleDecode8(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U8* buf);
! 	void zrleDecode16(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U16* buf);
! 	void zrleDecode24A(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U32* buf);
! 	void zrleDecode24B(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U32* buf);
! 	void zrleDecode32(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U32* buf);
  	//UltraFast
  	void ConvertAll(int width, int height, int xx, int yy,int bytes_per_pixel,BYTE* source,BYTE* dest,int framebufferWidth);
  	void SolidColor(int width, int height, int xx, int yy,int bytes_per_pixel,BYTE* source,BYTE* dest,int framebufferWidth);
--- 546,566 ----
  	rdr::FdInStream* fis;
  	rdr::ZlibInStream* zis;
  	void zrleDecode(int x, int y, int w, int h);
! 	void zrleDecode8NE(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U8* buf);
! 	void zrleDecode15LE(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U16* buf);
! 	void zrleDecode16LE(int x, int y, int w, int h, rdr::InStream* is,
! 		rdr::ZlibInStream* zis, rdr::U16* buf);
! 	void zrleDecode24ALE(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U32* buf);
! 	void zrleDecode24BLE(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U32* buf);
! 	void zrleDecode32LE(int x, int y, int w, int h, rdr::InStream* is,
  		rdr::ZlibInStream* zis, rdr::U32* buf);
+ 	long zywrle;
+ 	long zywrle_level;
+ 	long zywrleBuf[rfbZRLETileWidth*rfbZRLETileHeight];

Code: Select all

diff -rcN -x winvnc___Win32_Http -x Release -x Debug -x *.plg -x *.dsw -x *.ncb -x *.opt -x buildtime.h ../UltraVNC-102-Src\UltraVNC/rfb/zrleDecode.h UltraVNC/rfb/zrleDecode.h
*** ../UltraVNC-102-Src\UltraVNC/rfb/zrleDecode.h	Wed Aug 02 11:53:59 2006
--- UltraVNC/rfb/zrleDecode.h	Tue Jul 25 10:53:00 2006
***************
*** 228,233 ****
--- 265,277 ----
  
  #ifndef FAVOUR_FILL_RECT
        //fprintf(stderr,"copying data to screen %dx%d at %d,%d\n",tw,th,tx,ty);
+ draw:
+ #if BPP!=8
+       if( zywrle_level & 0x80 ){
+ 	    zywrle_level &= 0x7F;
+ 		ZYWRLE_SYNTHESIZE( buf, buf, tw, th, tw, zywrle_level, zywrleBuf );
+ 	  }
+ #endif
        IMAGE_RECT(tx,ty,tw,th,buf);
  #endif
      }
the 7th parameter in ZYWRLE_SYNTHESIZE(*) is "int*" but you pass "long".
roytam1
20
20
Posts: 47
Joined: 2006-05-16 08:49
Contact:

Re: Introduction of New VNC codec

Post by roytam1 »

continuing last post, I made patches for this patch:
from:

Code: Select all

+ 	long zywrle;

+ 	long zywrle_level;

+ 	long zywrleBuf[rfbZRLETileWidth*rfbZRLETileHeight];
to:

Code: Select all

+ 	int zywrle;

+ 	int zywrle_level;

+ 	int zywrleBuf[rfbZRLETileWidth*rfbZRLETileHeight];
from:

Code: Select all

*** ../UltraVNC-102-Src\UltraVNC/vncviewer/ClientConnection.cpp	Wed Aug 02 11:54:02 2006
--- UltraVNC/vncviewer/ClientConnection.cpp	Wed Aug 02 13:02:39 2006
***************
*** 3676,3681 ****
--- 3684,3691 ----
  			ReadSolidRect(&surh);
  			break;
  		case rfbEncodingZRLE:
+ 			zywrle = 0;
+ 		case rfbEncodingZYWRLE:
  			SaveArea(cacherect);
  			zrleDecode(surh.r.x, surh.r.y, surh.r.w, surh.r.h);
  			EncodingStatusWindow=rfbEncodingZRLE;
to:

Code: Select all

*** ../UltraVNC-102-Src\UltraVNC/vncviewer/ClientConnection.cpp	Wed Aug 02 11:54:02 2006
--- UltraVNC/vncviewer/ClientConnection.cpp	Wed Aug 02 13:02:39 2006
***************
*** 3676,3681 ****
--- 3684,3691 ----
  			ReadSolidRect(&surh);
  			break;
  		case rfbEncodingZRLE:
+ 			zywrle = 0;
+ 		case rfbEncodingZYWRLE:
  			SaveArea(cacherect);
  			zrleDecode(surh.r.x, surh.r.y, surh.r.w, surh.r.h);
! 			EncodingStatusWindow=zywrle ? rfbEncodingZYWRLE : rfbEncodingZRLE;
roytam1
20
20
Posts: 47
Joined: 2006-05-16 08:49
Contact:

Re: Introduction of New VNC codec

Post by roytam1 »

I updated my binary with ZYWRLE codec support.
Enjoy! :wink:

P.S.: the JPEG copression quality controls ZYWRLE's quality too.
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Introduction of New VNC codec

Post by redge »

not yet available to official release of UltraVNC ? Why
there made the change open source, why not applyed to official release ?
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Introduction of New VNC codec

Post by redge »

February 2007 this code was added but not added to official build UltraVNC 1.0.4, why ?
This an so great effort for decrease bandwith requiremeent made from external developers but not added since...

Developper of UltraVNC staff don't need to lost time, "just" add the ready code, isn't ?
roytam1 wrote:
for UltraVNC:
my ICL build of UltraVNC have ZYWRLE support!
This codec is low bandwith requirement as JPEG and fast as ZRLE!
quoted source from blog http://rt87.byethost14.com/
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
UltraSam
Admin & Developer
Admin & Developer
Posts: 462
Joined: 2004-04-26 20:55
Contact:

Re: Introduction of New VNC codec

Post by UltraSam »

Yep, you are right...
Looked at the code but not integrated it yet.
Will try to do it asap.
UltraSam
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Introduction of New VNC codec

Post by redge »

thank you a lot for the good news, now waiting ;-)
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Introduction of New VNC codec

Post by redge »

codec ZYWRLE integrated to UltraVNC 1.0.4 :-)
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
Post Reply