@@ -18,32 +18,34 @@ you can display file [NEWS.md](NEWS.md).
1818
1919Table of contents
2020-----------------
21+
2122- [ Authors] ( #authors )
2223- [ Features] ( #features )
2324- [ Overview] ( #overview )
2425- [ Performance] ( #performance )
25- * [ Encoding] ( #encoding )
26- * [ Decoding] ( #decoding )
26+ - [ Encoding] ( #encoding )
27+ - [ Decoding] ( #decoding )
2728- [ Quality] ( #quality )
2829- [ Compile] ( #compile )
2930- [ Usage] ( #usage )
30- * [ libgpujpeg library] ( #libgpujpeg-library )
31- + [ Encoding] ( #encoding-1 )
32- + [ Decoding] ( #decoding-1 )
33- * [ GPUJPEG console application] ( #gpujpeg-console-application )
31+ - [ libgpujpeg library] ( #libgpujpeg-library )
32+ - [ Encoding] ( #encoding-1 )
33+ - [ Decoding] ( #decoding-1 )
34+ - [ GPUJPEG console application] ( #gpujpeg-console-application )
3435- [ Requirements] ( #requirements )
3536- [ License] ( #license )
3637- [ References] ( #references )
3738
3839Authors
3940-------
40- - Martin Srom, CESNET z.s.p.o
41- - Jan Brothánek
42- - Petr Holub
43- - Martin Jirman
44- - Jiri Matela
45- - Martin Pulec
46- - Lukáš Ručka
41+
42+ - Martin Srom, CESNET z.s.p.o
43+ - Jan Brothánek
44+ - Petr Holub
45+ - Martin Jirman
46+ - Jiri Matela
47+ - Martin Pulec
48+ - Lukáš Ručka
4749
4850Features
4951--------
@@ -59,7 +61,7 @@ eg. limited range **YCbCr BT.709** or **RGB**, **Exif** also supported
5961- support for _ color transformations_ and coding RGB JPEG
6062- Decoder can decompress JPEG codestreams that can be generated by encoder. If scan
6163 contains restart flags, decoder can use parallelism for fast decoding.
62- - _ command-line_ tool with support for encoding/decoding ** raw** images
64+ - _ command-line_ tool with support for encoding/decoding ** raw** images
6365as well as ** BMP** , ** TGA** , ** PNM/PAM** or ** Y4M** (** PNG** and ** GIF** also
6466available for convenience)
6567
@@ -76,22 +78,24 @@ Encoding/Decoding of JPEG codestream is divided into following phases:
7678 5) Formatting codestream 5) Postprocessing
7779
7880and they are implemented on CPU or/and GPU as follows:
79- - CPU:
80- - Input data loading
81- - Parsing codestream
82- - Huffman encoder/decoder (when restart flags are disabled)
83- - Output data formatting
84- - GPU:
85- - Preprocessing/Postprocessing (color component parsing,
86- color transformation RGB <-> YCbCr)
87- - Forward/Inverse DCT (discrete cosine transform)
88- - De/Quantization
89- - Huffman encoder/decoder (when restart flags are enabled)
81+
82+ - CPU:
83+ - Input data loading
84+ - Parsing codestream
85+ - Huffman encoder/decoder (when restart flags are disabled)
86+ - Output data formatting
87+ - GPU:
88+ - Preprocessing/Postprocessing (color component parsing,
89+ color transformation RGB <-> YCbCr)
90+ - Forward/Inverse DCT (discrete cosine transform)
91+ - De/Quantization
92+ - Huffman encoder/decoder (when restart flags are enabled)
9093
9194Performance
9295-----------
9396
94- Source 16K (DCI) image ([ description] [ 8 ] , [ download] [ 9 ] ) was cropped to _ 15360x8640+0+0_ (1920x1080
97+ Source 16K (DCI) image ([ description] [ 8 ] , [ download] [ 9 ] ) was cropped to
98+ _ 15360x8640+0+0_ (1920x1080
9599multiplied by 8 in both dimensions) and for lower resolutions downscaled.
96100Encoding was done with default values with input in RGB (quality ** 75** ,
97101** non-interleaved** , rst 24-36, average from 99 measurements excluding first
@@ -113,7 +117,8 @@ mean value is taken -->
113117| GTX 1060M | 1.36 ms | 4.55 ms | 17.34 ms | _ (low mem)_ |
114118| GTX 580 | 2.38 ms | 8.68 ms | _ (low mem)_ | _ (low mem)_ |
115119| AMD Radeon RX 7600 [ ZLUDA] | 0.88 ms | 3.16 ms | 13.09 ms | 50.52 ms |
116- <!-- | NVS 4200M | 14.48 ms | 56.26 ms | _(low mem)_ | _(low mem)_ |-->
120+
121+ <!-- | NVS 4200M | 14.48 ms | 56.26 ms | _(low mem)_ | _(low mem)_ |-->
117122
118123** Note:** First iteration is slower because the initialization takes place and
119124lasts about _ 28.6 ms_ for 8K (_ 87.1 ms_ for 16K) with RTX 3080 (but the
@@ -129,14 +134,17 @@ Further measurements were performed on _RTX 3080_ only:
129134| duration 8K (ms, w/o PCIe xfers) | 2.13| 2.14| 2.18| 2.24| 2.23| 2.25| 2.28| 2.33| 2.50| 5.01|
130135
131136<!-- Additional notes (applies also for decode):
132- 1. device needs to be set to maximum performance, otherwise powermanagement influences esp. PCIe transmits
133- 2. stream formatter is starting to be a significant performance factor, eg. 0.82 ms for 8K Q=75 (contained in last line)
134- 3. measurements were done without -DCMAKE_BUILD_TYPE=Release, should be measured with -->
137+ 1. device needs to be set to maximum performance, otherwise
138+ powermanagement influences esp. PCIe transmits
139+ 2. stream formatter is starting to be a significant performance factor,
140+ eg. 0.82 ms for 8K Q=75 (contained in last line)
141+ 3. measurements were done without -DCMAKE_BUILD_TYPE=Release, should
142+ be measured with -->
135143
136144### Decoding
137145
138- Decoded images were those encoded in previous section, averaging has been done similarly by
139- taking 99 samples excluding the first one. Command used:
146+ Decoded images were those encoded in previous section, averaging has been
147+ done similarly by taking 99 samples excluding the first one. Command used:
140148
141149 gpujpegtool -v mediavision_frame_<res>.jpg output.pnm -n 100
142150
@@ -148,7 +156,8 @@ taking 99 samples excluding the first one. Command used:
148156| GTX 1060M | 1.68 ms | 4.81 ms | 17.56 ms | _ (low mem)_ |
149157| GTX 580 | 2.61 ms | 7.96 ms | _ (low mem)_ | _ (low mem)_ |
150158| AMD Radeon RX 7600 [ ZLUDA] | 1.00 ms | 3.02 ms | 11.25 ms | 45.06 ms |
151- <!-- | NVS 4200M | 12.46 ms | 46.98 ms | _(low mem)_ | _(low mem)_ |-->
159+
160+ <!-- | NVS 4200M | 12.46 ms | 46.98 ms | _(low mem)_ | _(low mem)_ |-->
152161
153162** Note** : _ (low mem)_ above means that the card didn't have sufficient memory to
154163encode or decode the picture.
@@ -163,7 +172,8 @@ Following measurements were performed on _RTX 3080_ only:
163172| duration 8K (ms, w/o PCIe xfers) | 2.14| 2.18| 2.21| 2.24| 2.27| 2.29| 2.34| 2.42| 2.71| 7.27|
164173
165174Quality
166- -----------
175+ -------
176+
167177Following tables summarizes encoding quality and file size using NVIDIA
168178GTX 580 for non-interleaved and non-subsampled stream with different quality
169179settings (PSNR and encoded size values are averages of encoding several
@@ -182,10 +192,11 @@ images, each of them multiple times):
182192| 90 | 42.83 dB | 2441.40 kB | 39.84 dB | 768.40 kB |
183193| 100 | 47.09 dB | 7798.70 kB | 47.21 dB | 2499.60 kB |
184194
185- < b >< sup >1,2</ sup ></ b > sizes 4096x2160 and 1920x1080
195+ ** ¹ ** , ** ² ** sizes 4096x2160 and 1920x1080
186196
187197Compile
188198-------
199+
189200To build console application check [ Requirements] ( #requirements ) and go
190201to ` gpujpeg ` directory (where [ README.md] ( README.md ) and [ COPYING] ( COPYING )
191202files are placed) and run ` cmake ` command:
@@ -204,6 +215,7 @@ Usage
204215-----
205216
206217### libgpujpeg library
218+
207219To build _ libgpujpeg_ library check [ Compile] ( #compile ) .
208220
209221To use library in your project you have to include library to your
@@ -225,6 +237,7 @@ If not called, default CUDA device will be used.
225237For simple library code examples you look into subdirectory [ examples] ( examples ) .
226238
227239#### Encoding
240+
228241For encoding by libgpujpeg library you have to declare two structures
229242and set proper values to them. The first is definition of encoding/decoding
230243parameters, and the second is structure with parameters of input image:
@@ -300,8 +313,9 @@ the encoder.
300313 gpujpeg_encoder_destroy(encoder);
301314
302315#### Decoding
316+
303317To create the decoder you have to call:
304-
318+
305319 struct gpujpeg_decoder* decoder = gpujpeg_decoder_create(0);
306320 if ( decoder == NULL )
307321 return -1;
@@ -328,7 +342,7 @@ a file):
328342 if ( gpujpeg_image_load_from_file("input_image.jpg", &image,
329343 &image_size) != 0 )
330344 return -1;
331-
345+
332346 struct gpujpeg_decoder_output decoder_output;
333347 gpujpeg_decoder_output_set_default(&decoder_output);
334348 int dec_rc = gpujpeg_decoder_decode(decoder, image, image_size,
@@ -344,10 +358,11 @@ Then you can process the decoded image, eg. save the raw data to a file:
344358 return -1;
345359
346360You can continue decoding more images. When done, perform the cleanup:
347-
361+
348362 gpujpeg_decoder_destroy(decoder);
349363
350364### GPUJPEG console application
365+
351366The console application gpujpeg uses _ libgpujpeg_ library to demonstrate
352367it's functions. To build console application check [ Compile] ( #compile ) .
353368
@@ -426,6 +441,7 @@ command:
426441
427442Requirements
428443------------
444+
429445To be able to build and run libgpujpeg ** library** and gpujpeg ** console
430446application** you need:
431447
@@ -435,12 +451,14 @@ application** you need:
435451 NVIDIA drivers _ or_ AMD with [ ZLUDA] ( https://github.com/vosen/ZLUDA )
436452 (see [ ZLUDA.md] ( ZLUDA.md ) )
4374534 . _ optional_ ** OpenGL** support:
438- - _ GLEW_ , _ OpenGL_ (usually present in Windows, may need headers installation in Linux)
454+ - _ GLEW_ , _ OpenGL_ (usually present in Windows, may need headers
455+ installation in Linux)
439456 - _ GLFW_ or _ GLX_ (Linux only) for context creation
440457 - _ GLUT_ for OpenGL tests
441458
442459License
443460-------
461+
444462- See file [ COPYING] ( COPYING ) .
445463- This software contains source code provided by NVIDIA Corporation.
446464- This software source code is based on SiGenGPU \[ [ 3] \] .
@@ -452,6 +470,7 @@ License
452470
453471References
454472----------
473+
455474[ 1 ] : http://www.w3.org/Graphics/JPEG/itu-t81.pdf
456475[ 2 ] : http://www.ijg.org/
457476[ 3 ] : https://github.com/silicongenome/SiGenGPU
0 commit comments