FileOnQ / Imaging.Heif

A C#/.NET wrapper around libheif for decoding and processing high efficiency image formats (heif, heic).
GNU Lesser General Public License v3.0
15 stars 4 forks source link

Removes x265 Dependency #85

Closed SkyeHoefling closed 2 years ago

SkyeHoefling commented 2 years ago

Fixes: #84

Description

x265 is a GPL dependency of libheif and is only used for image encoding. Right now FileOnQ.Imaging.Heif is only interested in decoding. Removing this library ensures that this repository is compliant for LGPL licensing.

Merge Checklist

github-actions[bot] commented 2 years ago

Benchmark Comparison - .NET Framework 4.8

Benchmarking comparison between this Pull Request and the comitted values at benchmarks/results

thumbnail

 No differences found between the benchmark results with threshold 10%.

primary

 summary:
better: 4, geomean: 1.167
total diff: 4

No Slower results for the provided threshold = 10% and noise filter = 0.3ns.

| Faster                                                             | base/diff | Base Median (ns) | Diff Median (ns) | Modality|
| ------------------------------------------------------------------ | ---------:| ----------------:| ----------------:| --------:|
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_Write    |      1.24 |    2982269900.00 |    2414506700.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToSpan   |      1.18 |    2829898300.00 |    2404908200.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToArray  |      1.14 |    2743673900.00 |    2414024000.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.PrimaryImage.PrimaryImage_ToStream |      1.12 |    2766976750.00 |    2460210600.00 |         |

No file given

Benchmark Results - .NET Framework 4.8

thumbnail

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5), VM=Hyper-V Intel Xeon Platinum 8171M CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores [Host] : .NET Framework 4.8 (4.8.4420.0), X64 RyuJIT Job-GHSIOX : .NET Framework 4.8 (4.8.4420.0), X64 RyuJIT Runtime=.NET Framework 4.8 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |------------------- |---------:|---------:|---------:|------------------------:|-------------------:|----------:| | Thumbnail_Write | 60.83 ms | 1.210 ms | 2.055 ms | 5,123,891 B | - | 74,504 B | | Thumbnail_ToArray | 60.25 ms | 1.204 ms | 2.171 ms | 5,123,563 B | - | 74,504 B | | Thumbnail_ToSpan | 58.11 ms | 1.138 ms | 1.169 ms | 5,123,579 B | - | - | | Thumbnail_ToStream | 59.44 ms | 1.177 ms | 1.934 ms | 5,123,307 B | - | 140,816 B |

primary

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5), VM=Hyper-V Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores [Host] : .NET Framework 4.8 (4.8.4420.0), X64 RyuJIT Job-GHSIOX : .NET Framework 4.8 (4.8.4420.0), X64 RyuJIT Runtime=.NET Framework 4.8 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |---------------------- |--------:|---------:|---------:|------------------------:|-------------------:|------------:| | PrimaryImage_Write | 2.413 s | 0.0153 s | 0.0144 s | 222,029,134 B | - | 1,951,112 B | | PrimaryImage_ToArray | 2.414 s | 0.0040 s | 0.0038 s | 222,028,646 B | - | 1,951,112 B | | PrimaryImage_ToSpan | 2.405 s | 0.0048 s | 0.0045 s | 222,028,870 B | - | - | | PrimaryImage_ToStream | 2.460 s | 0.0047 s | 0.0044 s | 222,028,822 B | - | 3,894,032 B |

Benchmark Comparison - .NET 5

Benchmarking comparison between this Pull Request and the comitted values at benchmarks/results

thumbnail

 summary:
better: 4, geomean: 1.204
total diff: 4

No Slower results for the provided threshold = 10% and noise filter = 0.3ns.

| Faster                                                       | base/diff | Base Median (ns) | Diff Median (ns) | Modality|
| ------------------------------------------------------------ | ---------:| ----------------:| ----------------:| --------:|
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_Write    |      1.21 |      59536600.00 |      49083900.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToArray  |      1.21 |      58728450.00 |      48571300.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToStream |      1.20 |      58199200.00 |      48329400.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToSpan   |      1.19 |      57887100.00 |      48716150.00 |         |

No file given

primary

 No differences found between the benchmark results with threshold 10%.

Benchmark Results - .NET 5

thumbnail

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon Platinum 8272CL CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Job-VOBYMY : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Runtime=.NET 5.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Median | Allocated native memory | Native memory leak | Allocated | |------------------- |---------:|---------:|---------:|---------:|------------------------:|-------------------:|----------:| | Thumbnail_Write | 49.11 ms | 0.396 ms | 0.351 ms | 49.08 ms | 5,124,185 B | 32 B | 288 B | | Thumbnail_ToArray | 49.31 ms | 0.872 ms | 2.055 ms | 48.57 ms | 5,123,853 B | - | 66,408 B | | Thumbnail_ToSpan | 48.96 ms | 0.754 ms | 1.057 ms | 48.72 ms | 5,123,597 B | - | 120 B | | Thumbnail_ToStream | 48.20 ms | 0.327 ms | 0.306 ms | 48.33 ms | 5,123,597 B | - | 66,472 B |

primary

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon CPU E5-2673 v4 2.30GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Job-LJJWSJ : .NET 5.0.8 (5.0.821.31504), X64 RyuJIT Runtime=.NET 5.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |---------------------- |--------:|---------:|---------:|------------------------:|-------------------:|------------:| | PrimaryImage_Write | 3.032 s | 0.0362 s | 0.0302 s | 222,029,156 B | - | 256 B | | PrimaryImage_ToArray | 3.006 s | 0.0380 s | 0.0355 s | 222,028,680 B | - | 1,943,056 B | | PrimaryImage_ToSpan | 3.072 s | 0.0387 s | 0.0362 s | 222,028,984 B | - | 88 B | | PrimaryImage_ToStream | 3.064 s | 0.0514 s | 0.0481 s | 222,028,616 B | - | 1,943,120 B |

Benchmark Comparison - .NET 6

Benchmarking comparison between this Pull Request and the comitted values at benchmarks/results

thumbnail

 summary:
worse: 4, geomean: 1.196
total diff: 4

| Slower                                                       | diff/base | Base Median (ns) | Diff Median (ns) | Modality|
| ------------------------------------------------------------ | ---------:| ----------------:| ----------------:| --------:|
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToArray  |      1.21 |      47222300.00 |      57110200.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_Write    |      1.20 |      48024300.00 |      57711800.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToSpan   |      1.19 |      47550100.00 |      56539400.00 |         |
| FileOnQ.Imaging.Heif.Benchmarks.Thumbnail.Thumbnail_ToStream |      1.19 |      47692700.00 |      56544300.00 |         |

No Faster results for the provided threshold = 10% and noise filter = 0.3ns.

No file given

primary

 No differences found between the benchmark results with threshold 10%.

Benchmark Results - .NET 6

thumbnail

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon Platinum 8171M CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Job-TSOKVS : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Runtime=.NET 6.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |------------------- |---------:|---------:|---------:|------------------------:|-------------------:|----------:| | Thumbnail_Write | 57.89 ms | 0.749 ms | 0.664 ms | 5,124,409 B | - | 832 B | | Thumbnail_ToArray | 57.36 ms | 0.917 ms | 0.858 ms | 5,123,869 B | - | 66,552 B | | Thumbnail_ToSpan | 56.37 ms | 0.909 ms | 0.710 ms | 5,123,869 B | - | 600 B | | Thumbnail_ToStream | 56.60 ms | 0.969 ms | 0.906 ms | 5,123,597 B | - | 66,952 B |

primary

``` ini BenchmarkDotNet=v0.13.1, OS=Windows 10.0.17763.2458 (1809/October2018Update/Redstone5) Intel Xeon Platinum 8171M CPU 2.60GHz, 1 CPU, 2 logical and 2 physical cores .NET SDK=6.0.101 [Host] : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Job-QFCYVP : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT Runtime=.NET 6.0 InvocationCount=1 LaunchCount=1 UnrollFactor=1 ``` | Method | Mean | Error | StdDev | Allocated native memory | Native memory leak | Allocated | |---------------------- |--------:|---------:|---------:|------------------------:|-------------------:|------------:| | PrimaryImage_Write | 2.922 s | 0.0198 s | 0.0176 s | 222,029,604 B | - | 848 B | | PrimaryImage_ToArray | 2.917 s | 0.0149 s | 0.0139 s | 222,028,952 B | - | 1,943,536 B | | PrimaryImage_ToSpan | 2.923 s | 0.0544 s | 0.0509 s | 222,028,936 B | - | 616 B | | PrimaryImage_ToStream | 2.960 s | 0.0226 s | 0.0211 s | 222,029,176 B | - | 1,943,600 B |