Commit Graph

246 Commits

Author SHA1 Message Date
akallabeth
f346793970 Refactored encoder functions to return changed areas 2021-03-01 11:52:07 +01:00
akallabeth
50acf72615 Refactored H264 encoding/decoding
Use YUV primitives now for all H264 operations
2021-03-01 11:52:07 +01:00
akallabeth
3b7af0293e Fixed primitiveYUV unit test. 2021-02-25 14:18:01 +01:00
akallabeth
6c6e31217d Ignore alpha channel during color conversion.
Most GFX graphics do not carry alpha data. Keep the original
alpha value unless specified otherwise.
2021-02-25 14:18:01 +01:00
akallabeth
43311130a2 Fixed CodeQL warnings 2021-02-19 11:19:49 +01:00
Martin Fleisz
d3530a16d5 primitives: Respect alpha values in YUV444 SSE pixel routine 2021-01-12 09:16:08 +01:00
Armin Novak
b6f3922152 Fixed primitives test 2020-09-07 11:48:06 +02:00
Armin Novak
816e792e3f Fixed unit tests run under memory sanitizer 2020-09-07 10:42:28 +02:00
akallabeth
ae5a30438e Fixed undefined behaviour 2020-05-20 15:10:07 +02:00
akallabeth
a139caf73a Fixed undefined behaviour in primitives shift 2020-05-20 15:10:07 +02:00
Armin Novak
ebf44f80eb Fixed format string warnings. 2020-04-11 09:43:01 +02:00
Armin Novak
66352741f2 Added fallbacks for primitives auto detection.
When using primitives auto detection it was possible that no
primitive implementation was chosen at all.
This now skips broken implementations and falls back to generic
primitives if no other implementation does work.
2020-03-02 11:40:35 +01:00
Armin Novak
ea25900f4c Fixed #5855: YCoCg to RGB conversion color order 2020-01-22 17:28:22 +01:00
Armin Novak
61d2e84fdc Fixed inverted color formats in YCoCgRToRGB_8u_AC4R 2020-01-14 17:45:20 +01:00
Martin Fleisz
71feb974ac
Merge pull request #5739 from akallabeth/improve_function_hiding
Improve function hiding
2019-12-02 11:31:35 +01:00
Armin Novak
7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
David Fort
22f954970a primitives: use host pointers for openCL
Using host pointers may skip the need for copying buffers.
2019-11-29 11:59:09 +01:00
Armin Novak
3aa6047b3a Updated primitive function const correctness. 2019-11-22 13:21:39 +01:00
Armin Novak
e347c7b3de Added YUV444 kernel 2019-11-22 13:21:39 +01:00
Armin Novak
b3a3a6b9c2 Fixed intialization of opencl primitives and warnings. 2019-11-22 13:21:39 +01:00
David Fort
6123920a2e opencl: inline the openCL program in the source code 2019-11-22 13:21:39 +01:00
Armin Novak
00e9efd189 Fixed init code. 2019-11-22 13:21:39 +01:00
Armin Novak
733c70cd25 Fixed primitives cleanup code. 2019-11-22 13:21:39 +01:00
Armin Novak
0a3721587a Cleaned up primitives code. 2019-11-22 13:21:39 +01:00
David Fort
5f0943f0fe primitives: add openCL support
This patch adds the basic infrastructure to have openCL acceleration.
For now only YUV2RGB is implemented but other operations could be
implemented.
The primitives have been massively reworked so that we have an autodetect
mode that will pick the best implementation automatically by performing a
benchmark.

Sponsored-by: Rangee Gmbh(http://www.rangee.com)
2019-11-22 13:21:39 +01:00
Armin Novak
6afa413669 Modified primitives function pointer to take const pointer to const data 2019-11-14 10:46:24 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
ca4a1d19a5 Silenced some unused parameter warnings. 2019-05-08 12:21:31 +02:00
Armin Novak
0bacb30608 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
2a582ed197 Fixed NULL dereferences and uninitialized values 2019-01-30 16:11:10 +01:00
Armin Novak
98bc4358e0 Fixed padding of general_yCbCrToRGB_16s8u_P3AC4R* functions. 2018-11-28 11:05:45 +01:00
Armin Novak
62c1696d4c Removed use of unchecked sprintf 2018-08-27 14:34:42 +02:00
Armin Novak
6d3beabd54 Removed unused variables in tests. 2018-08-24 13:40:36 +02:00
Mike Gilbert
9460f4292b primitives: ensure primitives_get() returns a populated struct
Fixes: https://github.com/FreeRDP/FreeRDP/issues/4658
2018-05-16 17:08:15 -04:00
Armin Novak
b5668e35b0 Fixed format string mismatch. 2018-04-05 10:49:24 +02:00
Armin Novak
2bda3a30b0 Fixed integer to float type cast. 2018-04-04 10:45:07 +02:00
Armin Novak
b0fe199060 Fixed intrinsic integer overflow.
Adding 128 in 8bit is not possible due to range [-128,127].
Instead subtract -128, that should eliminate the overflow.
2018-04-04 10:43:31 +02:00
Armin Novak
e0d112d548 Removed all calls to WLog_Init and WLog_Uninit
Since the calls are no longer required remove their usage.
2018-04-03 13:06:41 +02:00
Armin Novak
1a902c249c Fix PROFILER_* macros
Add the semicolon to the macro to allow clean
undefinition if the profiler is not used.
This used to break VisualC compilers.
2018-02-15 11:30:38 +01:00
Armin Novak
1d99696db2 Fixed AVC444 YUV conversion matrix 2018-02-07 11:23:33 +01:00
Armin Novak
53cdd95de0 Refactored RGB to AVC444v2 2018-02-07 10:48:43 +01:00
Armin Novak
eb8e9cb410 Added SSSE3 UV average to AVC444v1 2018-02-07 10:48:43 +01:00
Armin Novak
46159c4cab Added UV average to AVC444v1 2018-02-07 10:48:43 +01:00
Armin Novak
c82610c304 Deactiveate optimized primitives if no implementation compiled. 2018-01-30 14:53:53 +01:00
Armin Novak
8f7bc7990f Added SSE optimized RGB to AVC444 frame split and test. 2018-01-30 11:17:16 +01:00
Armin Novak
ce10e22b86 Added optimized C function for specific color format. 2018-01-30 11:17:15 +01:00
Armin Novak
f27ee2e3ab Split optimized YUV implementations to separate files. 2018-01-30 11:17:15 +01:00
David Fort
5e48664695 primitives: use INIT_ONCE instead of static booleans
This may prevent some race conditions
2018-01-29 00:25:20 +01:00
Martin Haimberger
94a58bd18d YUV conversation: fixed luma frame creation
in the conversation function general_RGBToAVC444YUVv2_ANY
2018-01-12 00:16:45 -08:00
Armin Novak
23e1afb44a Added new and optimized YUV primitives.
* RGBToAVC444YUVv2: Split a RGB frame in luma and/or chroma v2 YUV420 frames
* RGBX specific versions of RGBToAVC444YUV and RGBToYUV420_8u_P3AC4R
2018-01-10 14:46:18 +01:00
Armin Novak
e4766c656e Fixed missing initialization warnings. 2017-12-21 11:04:32 +01:00
Armin Novak
57958cb178 Fixed #3810: Renamed color functions 2017-11-24 13:21:43 +01:00
Norbert Federa
eea2f306d3 primitives/yuv: fix endianess issue 2017-10-19 11:55:13 +02:00
Bernhard Miklautz
52fbfb7b12 fix clang warnings, directly include wtypes.h (#4097)
* build: clang use -Wno-unused-command-line-argument

With clang 5.0 builds are quite noisy otherwise.

* Directly include wtypes.h

Directly include winpr/wtypes.h where _fseeki64 or _ftelli64 is used.

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: parentheses-equality

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: tautological-compare

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning:
incompatible pointer types passing 'size_t *' (aka 'unsigned
long *') to parameter of type 'UINT32 *' (aka 'unsigned int *')
[-Wincompatible-pointer-types]
2017-08-29 09:09:38 +02:00
Armin Novak
b51a103b70 Fixed uninitialized values. 2017-07-20 09:35:41 +02:00
Armin Novak
8b9e3fa51e Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
Norbert Federa
36b8f54c5e Fixed a few compiler warnings 2017-07-10 17:52:05 +02:00
Armin Novak
f1a296a32e Fixed AVC444v2 NEON chroma decoder. 2017-04-18 15:08:44 +02:00
Armin Novak
06d4e9ac73 Fixed SSE AVC444v2 chroma decoder. 2017-04-18 15:03:38 +02:00
Armin Novak
a2167d5417 Added surface width and heigth for YUV combine. 2017-04-18 14:12:40 +02:00
Armin Novak
fcd2d820af Added SSE AVC444v2 2017-04-13 13:09:16 +02:00
Armin Novak
1a0f56baa7 Fixed AVC444 NEON, added AVC444v2. 2017-04-12 14:39:32 +02:00
Armin Novak
0c15455d8f Upaded YUV tests. 2017-04-11 11:40:04 +02:00
Armin Novak
b0d3cfda4d Added AVC444v2 client support. 2017-04-11 11:29:14 +02:00
Armin Novak
4f6beb0815 Fixed NEON YUV to RGB conversion issues. 2017-04-05 12:20:29 +02:00
Armin Novak
ed0024d11b Fixed AVC420 SSE implementation and test. 2017-03-28 17:42:35 +02:00
Armin Novak
09d43a66f4 Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
Armin Novak
f0b61eb4b9 Fixed index for YUV filter in NEON path. 2017-03-02 17:56:23 +01:00
akallabeth
65b51a6ca3 Merge pull request #3798 from mfleisz/vc10_comp_fix
primitives: Fix compilation with VS 2010
2017-02-22 12:47:52 +01:00
Armin Novak
6366868222 Fixed argument check of sse2_RGBToRGB_16s8u_P3AC4R 2017-02-22 10:59:18 +01:00
Martin Fleisz
966dbdf236 primitives: Fix compilation with VS 2010 2017-02-22 10:21:01 +01:00
Armin Novak
4c7d01374c Fixed warings #3784 2017-02-20 13:30:16 +01:00
Ilya Shipitsin
33f38da6b6 resolve trivial issues found by cppcheck
[libfreerdp/primitives/prim_add_opt.c:43]: (error) Uninitialized variable: shifts
[libfreerdp/primitives/prim_andor_opt.c:42]: (error) Uninitialized variable: shifts
[libfreerdp/primitives/prim_andor_opt.c:44]: (error) Uninitialized variable: shifts
[libfreerdp/primitives/prim_shift_opt.c:42]: (error) Uninitialized variable: shifts
[libfreerdp/primitives/prim_shift_opt.c:45]: (error) Uninitialized variable: shifts
[libfreerdp/primitives/prim_shift_opt.c:48]: (error) Uninitialized variable: shifts
[libfreerdp/primitives/prim_shift_opt.c:51]: (error) Uninitialized variable: shifts
2017-02-17 18:36:03 +05:00
Norbert Federa
a50242c636 primitives: SSSE3 RGB to AVC444YUV converter
------------------------------+---------+----------+-----------+-------
RGB TO AVC444YUV 1080p 32bit  |   COUNT |    TOTAL |       AVG |    IPS
CPU: 3.1 GHz Core i5-2400     |         |          |           |
------------------------------+---------+----------+-----------+-------
general_RGBToAVC444YUV_ANY    |     500 | 13.0164s | 0.026033s |     38
general_RGBToAVC444YUV_BGRX   |     500 |  3.9584s | 0.007917s |    126
ssse3_RGBToAVC444YUV_BGRX     |     500 |  0.7694s | 0.001539s |    650
2017-02-16 17:48:23 +01:00
Norbert Federa
13a60ae138 primitives: added RGB to AVC444YUV converter 2017-02-16 17:03:40 +01:00
Armin Novak
c50e5ba57e Fixed warnings. 2017-02-16 14:34:43 +01:00
Armin Novak
c04918d6c2 Added value comparison for all YCbCr functions. 2017-02-16 14:00:25 +01:00
Armin Novak
4891ae62b1 Reduced test runtime. 2017-02-16 13:52:27 +01:00
Armin Novak
198bc6d9e1 Fixed compiler warnings. 2017-02-16 13:17:49 +01:00
Armin Novak
4d03a9aa6f Improved YCoCgToRGB tests. 2017-02-16 12:16:58 +01:00
Armin Novak
799afe0cca Fixed YUV test result print. 2017-02-16 12:16:58 +01:00
Armin Novak
dda6b14402 Fixed SSE yCbCrToRGB_16s8u_P3AC4R, improved tests. 2017-02-16 12:16:58 +01:00
Armin Novak
ee3a3a787b Fixed SSE checks and RGBToRGB_16s8u_P3AC4R 2017-02-16 09:57:13 +01:00
Armin Novak
1b78c45eca Fixed alignment checks for SSE yCbCrToRGB 2017-02-15 12:39:57 +01:00
Armin Novak
dce3604bcf Refined alignment checks for SSSE3 YUV444ToRGB 2017-02-15 12:08:32 +01:00
Armin Novak
e44158ee29 Reordered SSSE3 YUV444ToRGB 2017-02-14 16:02:12 +01:00
Armin Novak
2463575083 Print profiler header and footer. 2017-02-14 16:02:11 +01:00
Armin Novak
f324b0ef9c Use aligned malloc/free for GFX surfaces/buffers 2017-02-14 16:02:11 +01:00
Armin Novak
9dba98598f SSSE3 YUV444ToRGB process 16 pixel per loop. 2017-02-14 16:02:11 +01:00
Armin Novak
4f705b99ec Fixed primitives sign test buffer size. 2017-02-13 16:09:57 +01:00
Armin Novak
e60cc9bdd9 NEON optimized YCoCg conversion. 2017-02-13 16:09:28 +01:00
Armin Novak
a791ab0b17 Added NEON and SSSE3 YCbCr conversion functions. 2017-02-13 16:08:37 +01:00
Armin Novak
b1e3bab8ef Added NEON and SSSE3 YUV conversion optimisations. 2017-02-13 16:00:12 +01:00
Armin Novak
57db52237c Fixed AVC444 luma/chroma checks. 2017-02-10 08:31:32 +01:00
Norbert Federa
490473d26f primitives: RGB to YUV420 (non SIMD) optimizations
- added a dedicated non-simd encoder for BGR[AX] source formats
- simplified the generic RgbToYuv420 encoder and fixed the crash
  with odd dimensions
2017-02-06 15:48:52 +01:00
Norbert Federa
cb5dfd831f primitives: added SSSE3 rgb to yuv420 encoder
Currently supported source pixel formats are:
- PIXEL_FORMAT_BGRA32
- PIXEL_FORMAT_BGRX32

Support for PIXEL_FORMAT_RGB[XA]32 can simply be added if
required (see the comment in prim_YUV_opt.c).

On my old 3.1 GHz Core i5-2400 the new SSSE3 function can convert
over 900 1080p BGRX frames per second.

The current non-optimized C version (which supports all pixel formats)
can't do more than 40 yuv conversions per second on this cpu.

---------------------------+---------+-------------+-----------+-------
RGB TO YUV420 1080p 32bit  |   COUNT |       TOTAL |       AVG |    FPS
---------------------------+---------+-------------+-----------+-------
general_RGBToYUV420        |     500 |    13.1776s | 0.026355s |     38
ssse3_RGBToYUV420          |     500 |     0.5320s | 0.001064s |    940

Also fixed an error in TestPrimitivesYUV which generated resolutions
with height or width set to zero
2017-02-03 13:56:50 +01:00
Armin Novak
16de1bca2b Removed unused profiler. 2017-01-31 14:18:28 +01:00
Armin Novak
dbfbd5b086 Fixed argument order of yCbCrToRGB_16s8u_P3AC4R 2017-01-31 10:49:59 +01:00
Armin Novak
c4122d342c Added performance profiler to YUV test. 2017-01-31 10:31:34 +01:00
Armin Novak
d7426d4516 Reverted RGB2V 2017-01-31 10:04:00 +01:00