Commit 41fb824
committed
allocate CPU quant data buffer just if needed
In the most eligible scenario, when using restart intervals, the Huffman
coder is run on GPU and the data are used from there without need to
copy to CPU memory. The CPU buffer is using pinned memory , which:
1. occupies needlessly some RAM space (non-swapable, so physically
occupied) - 2 x PIX_COUNT x CHANNELS B
2. the allocation of pinned memory takes some amount of time - for 4K
24-bit picture it is about 5-10 ms (Linux) depending on the HW but when
encoding single large image it can be significant1 parent 498c776 commit 41fb824
4 files changed
Lines changed: 37 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
565 | 580 | | |
566 | 581 | | |
567 | 582 | | |
| |||
853 | 868 | | |
854 | 869 | | |
855 | 870 | | |
856 | | - | |
857 | | - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
858 | 874 | | |
859 | 875 | | |
860 | 876 | | |
861 | | - | |
862 | | - | |
863 | 877 | | |
864 | 878 | | |
865 | 879 | | |
| |||
882 | 896 | | |
883 | 897 | | |
884 | 898 | | |
885 | | - | |
886 | 899 | | |
887 | 900 | | |
888 | 901 | | |
889 | 902 | | |
890 | 903 | | |
891 | 904 | | |
892 | | - | |
893 | 905 | | |
894 | 906 | | |
895 | | - | |
896 | 907 | | |
897 | 908 | | |
898 | 909 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
396 | 405 | | |
397 | 406 | | |
398 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
505 | 510 | | |
506 | 511 | | |
507 | 512 | | |
| |||
0 commit comments