├── .gitignore ├── HeicTest.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── HeicTest.xcscheme ├── HeicTest ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── LargePhoto.imageset │ │ ├── Contents.json │ │ └── DSCF1649.jpg │ └── Star_Citizen.imageset │ │ ├── Contents.json │ │ └── Star_Citizen.jpg ├── Base.lproj │ └── LaunchScreen.storyboard ├── HeicTest-Bridging-Header.h ├── ImageCodecBenchmarker.swift ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /HeicTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 78913865219D61B700DD3F05 /* ImageCodecBenchmarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78913864219D61B700DD3F05 /* ImageCodecBenchmarker.swift */; }; 11 | BF4AE0F5212FE55F00251C9D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BF4AE0F4212FE55F00251C9D /* AppDelegate.m */; }; 12 | BF4AE0F8212FE55F00251C9D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF4AE0F7212FE55F00251C9D /* ViewController.m */; }; 13 | BF4AE0FD212FE56000251C9D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BF4AE0FC212FE56000251C9D /* Assets.xcassets */; }; 14 | BF4AE100212FE56000251C9D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF4AE0FE212FE56000251C9D /* LaunchScreen.storyboard */; }; 15 | BF4AE103212FE56000251C9D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BF4AE102212FE56000251C9D /* main.m */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 78913863219D61B700DD3F05 /* HeicTest-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HeicTest-Bridging-Header.h"; sourceTree = ""; }; 20 | 78913864219D61B700DD3F05 /* ImageCodecBenchmarker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCodecBenchmarker.swift; sourceTree = ""; }; 21 | BF4AE0F0212FE55F00251C9D /* HeicTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HeicTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | BF4AE0F3212FE55F00251C9D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | BF4AE0F4212FE55F00251C9D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | BF4AE0F6212FE55F00251C9D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 25 | BF4AE0F7212FE55F00251C9D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 26 | BF4AE0FC212FE56000251C9D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | BF4AE0FF212FE56000251C9D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | BF4AE101212FE56000251C9D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | BF4AE102212FE56000251C9D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | /* End PBXFileReference section */ 31 | 32 | /* Begin PBXFrameworksBuildPhase section */ 33 | BF4AE0ED212FE55F00251C9D /* Frameworks */ = { 34 | isa = PBXFrameworksBuildPhase; 35 | buildActionMask = 2147483647; 36 | files = ( 37 | ); 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXFrameworksBuildPhase section */ 41 | 42 | /* Begin PBXGroup section */ 43 | BF4AE0E7212FE55F00251C9D = { 44 | isa = PBXGroup; 45 | children = ( 46 | BF4AE0F2212FE55F00251C9D /* HeicTest */, 47 | BF4AE0F1212FE55F00251C9D /* Products */, 48 | ); 49 | sourceTree = ""; 50 | }; 51 | BF4AE0F1212FE55F00251C9D /* Products */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | BF4AE0F0212FE55F00251C9D /* HeicTest.app */, 55 | ); 56 | name = Products; 57 | sourceTree = ""; 58 | }; 59 | BF4AE0F2212FE55F00251C9D /* HeicTest */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | BF4AE0F3212FE55F00251C9D /* AppDelegate.h */, 63 | BF4AE0F4212FE55F00251C9D /* AppDelegate.m */, 64 | BF4AE0F6212FE55F00251C9D /* ViewController.h */, 65 | BF4AE0F7212FE55F00251C9D /* ViewController.m */, 66 | BF4AE0FC212FE56000251C9D /* Assets.xcassets */, 67 | BF4AE0FE212FE56000251C9D /* LaunchScreen.storyboard */, 68 | BF4AE101212FE56000251C9D /* Info.plist */, 69 | BF4AE102212FE56000251C9D /* main.m */, 70 | 78913864219D61B700DD3F05 /* ImageCodecBenchmarker.swift */, 71 | 78913863219D61B700DD3F05 /* HeicTest-Bridging-Header.h */, 72 | ); 73 | path = HeicTest; 74 | sourceTree = ""; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | BF4AE0EF212FE55F00251C9D /* HeicTest */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = BF4AE106212FE56000251C9D /* Build configuration list for PBXNativeTarget "HeicTest" */; 82 | buildPhases = ( 83 | BF4AE0EC212FE55F00251C9D /* Sources */, 84 | BF4AE0ED212FE55F00251C9D /* Frameworks */, 85 | BF4AE0EE212FE55F00251C9D /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = HeicTest; 92 | productName = HeicTest; 93 | productReference = BF4AE0F0212FE55F00251C9D /* HeicTest.app */; 94 | productType = "com.apple.product-type.application"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | BF4AE0E8212FE55F00251C9D /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastUpgradeCheck = 1000; 103 | ORGANIZATIONNAME = "PSPDFKit GmbH"; 104 | TargetAttributes = { 105 | BF4AE0EF212FE55F00251C9D = { 106 | CreatedOnToolsVersion = 10.0; 107 | LastSwiftMigration = 1010; 108 | }; 109 | }; 110 | }; 111 | buildConfigurationList = BF4AE0EB212FE55F00251C9D /* Build configuration list for PBXProject "HeicTest" */; 112 | compatibilityVersion = "Xcode 9.3"; 113 | developmentRegion = en; 114 | hasScannedForEncodings = 0; 115 | knownRegions = ( 116 | en, 117 | Base, 118 | ); 119 | mainGroup = BF4AE0E7212FE55F00251C9D; 120 | productRefGroup = BF4AE0F1212FE55F00251C9D /* Products */; 121 | projectDirPath = ""; 122 | projectRoot = ""; 123 | targets = ( 124 | BF4AE0EF212FE55F00251C9D /* HeicTest */, 125 | ); 126 | }; 127 | /* End PBXProject section */ 128 | 129 | /* Begin PBXResourcesBuildPhase section */ 130 | BF4AE0EE212FE55F00251C9D /* Resources */ = { 131 | isa = PBXResourcesBuildPhase; 132 | buildActionMask = 2147483647; 133 | files = ( 134 | BF4AE100212FE56000251C9D /* LaunchScreen.storyboard in Resources */, 135 | BF4AE0FD212FE56000251C9D /* Assets.xcassets in Resources */, 136 | ); 137 | runOnlyForDeploymentPostprocessing = 0; 138 | }; 139 | /* End PBXResourcesBuildPhase section */ 140 | 141 | /* Begin PBXSourcesBuildPhase section */ 142 | BF4AE0EC212FE55F00251C9D /* Sources */ = { 143 | isa = PBXSourcesBuildPhase; 144 | buildActionMask = 2147483647; 145 | files = ( 146 | BF4AE0F8212FE55F00251C9D /* ViewController.m in Sources */, 147 | 78913865219D61B700DD3F05 /* ImageCodecBenchmarker.swift in Sources */, 148 | BF4AE103212FE56000251C9D /* main.m in Sources */, 149 | BF4AE0F5212FE55F00251C9D /* AppDelegate.m in Sources */, 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | /* End PBXSourcesBuildPhase section */ 154 | 155 | /* Begin PBXVariantGroup section */ 156 | BF4AE0FE212FE56000251C9D /* LaunchScreen.storyboard */ = { 157 | isa = PBXVariantGroup; 158 | children = ( 159 | BF4AE0FF212FE56000251C9D /* Base */, 160 | ); 161 | name = LaunchScreen.storyboard; 162 | sourceTree = ""; 163 | }; 164 | /* End PBXVariantGroup section */ 165 | 166 | /* Begin XCBuildConfiguration section */ 167 | BF4AE104212FE56000251C9D /* Debug */ = { 168 | isa = XCBuildConfiguration; 169 | buildSettings = { 170 | ALWAYS_SEARCH_USER_PATHS = NO; 171 | CLANG_ANALYZER_NONNULL = YES; 172 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 173 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 174 | CLANG_CXX_LIBRARY = "libc++"; 175 | CLANG_ENABLE_MODULES = YES; 176 | CLANG_ENABLE_OBJC_ARC = YES; 177 | CLANG_ENABLE_OBJC_WEAK = YES; 178 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 179 | CLANG_WARN_BOOL_CONVERSION = YES; 180 | CLANG_WARN_COMMA = YES; 181 | CLANG_WARN_CONSTANT_CONVERSION = YES; 182 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 183 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 184 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 185 | CLANG_WARN_EMPTY_BODY = YES; 186 | CLANG_WARN_ENUM_CONVERSION = YES; 187 | CLANG_WARN_INFINITE_RECURSION = YES; 188 | CLANG_WARN_INT_CONVERSION = YES; 189 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 190 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 191 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 192 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 193 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 194 | CLANG_WARN_STRICT_PROTOTYPES = YES; 195 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 196 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 197 | CLANG_WARN_UNREACHABLE_CODE = YES; 198 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 199 | CODE_SIGN_IDENTITY = "iPhone Developer"; 200 | COPY_PHASE_STRIP = NO; 201 | DEBUG_INFORMATION_FORMAT = dwarf; 202 | ENABLE_STRICT_OBJC_MSGSEND = YES; 203 | ENABLE_TESTABILITY = YES; 204 | GCC_C_LANGUAGE_STANDARD = gnu11; 205 | GCC_DYNAMIC_NO_PIC = NO; 206 | GCC_NO_COMMON_BLOCKS = YES; 207 | GCC_OPTIMIZATION_LEVEL = 0; 208 | GCC_PREPROCESSOR_DEFINITIONS = ( 209 | "DEBUG=1", 210 | "$(inherited)", 211 | ); 212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 214 | GCC_WARN_UNDECLARED_SELECTOR = YES; 215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 216 | GCC_WARN_UNUSED_FUNCTION = YES; 217 | GCC_WARN_UNUSED_VARIABLE = YES; 218 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 219 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 220 | MTL_FAST_MATH = YES; 221 | ONLY_ACTIVE_ARCH = YES; 222 | SDKROOT = iphoneos; 223 | }; 224 | name = Debug; 225 | }; 226 | BF4AE105212FE56000251C9D /* Release */ = { 227 | isa = XCBuildConfiguration; 228 | buildSettings = { 229 | ALWAYS_SEARCH_USER_PATHS = NO; 230 | CLANG_ANALYZER_NONNULL = YES; 231 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 232 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 233 | CLANG_CXX_LIBRARY = "libc++"; 234 | CLANG_ENABLE_MODULES = YES; 235 | CLANG_ENABLE_OBJC_ARC = YES; 236 | CLANG_ENABLE_OBJC_WEAK = YES; 237 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 238 | CLANG_WARN_BOOL_CONVERSION = YES; 239 | CLANG_WARN_COMMA = YES; 240 | CLANG_WARN_CONSTANT_CONVERSION = YES; 241 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 242 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 243 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 244 | CLANG_WARN_EMPTY_BODY = YES; 245 | CLANG_WARN_ENUM_CONVERSION = YES; 246 | CLANG_WARN_INFINITE_RECURSION = YES; 247 | CLANG_WARN_INT_CONVERSION = YES; 248 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 249 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 250 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 251 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 252 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 253 | CLANG_WARN_STRICT_PROTOTYPES = YES; 254 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 255 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 256 | CLANG_WARN_UNREACHABLE_CODE = YES; 257 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 258 | CODE_SIGN_IDENTITY = "iPhone Developer"; 259 | COPY_PHASE_STRIP = NO; 260 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 261 | ENABLE_NS_ASSERTIONS = NO; 262 | ENABLE_STRICT_OBJC_MSGSEND = YES; 263 | GCC_C_LANGUAGE_STANDARD = gnu11; 264 | GCC_NO_COMMON_BLOCKS = YES; 265 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 266 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 267 | GCC_WARN_UNDECLARED_SELECTOR = YES; 268 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 269 | GCC_WARN_UNUSED_FUNCTION = YES; 270 | GCC_WARN_UNUSED_VARIABLE = YES; 271 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 272 | MTL_ENABLE_DEBUG_INFO = NO; 273 | MTL_FAST_MATH = YES; 274 | SDKROOT = iphoneos; 275 | VALIDATE_PRODUCT = YES; 276 | }; 277 | name = Release; 278 | }; 279 | BF4AE107212FE56000251C9D /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 283 | CLANG_ENABLE_MODULES = YES; 284 | CODE_SIGN_STYLE = Automatic; 285 | DEVELOPMENT_TEAM = 4YCRL5LW7Q; 286 | INFOPLIST_FILE = HeicTest/Info.plist; 287 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 288 | LD_RUNPATH_SEARCH_PATHS = ( 289 | "$(inherited)", 290 | "@executable_path/Frameworks", 291 | ); 292 | PRODUCT_BUNDLE_IDENTIFIER = com.pspdfkit.HeicTest; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | SWIFT_OBJC_BRIDGING_HEADER = "HeicTest/HeicTest-Bridging-Header.h"; 295 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 296 | SWIFT_VERSION = 4.2; 297 | TARGETED_DEVICE_FAMILY = "1,2"; 298 | }; 299 | name = Debug; 300 | }; 301 | BF4AE108212FE56000251C9D /* Release */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | CLANG_ENABLE_MODULES = YES; 306 | CODE_SIGN_STYLE = Automatic; 307 | DEVELOPMENT_TEAM = 4YCRL5LW7Q; 308 | INFOPLIST_FILE = HeicTest/Info.plist; 309 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 310 | LD_RUNPATH_SEARCH_PATHS = ( 311 | "$(inherited)", 312 | "@executable_path/Frameworks", 313 | ); 314 | PRODUCT_BUNDLE_IDENTIFIER = com.pspdfkit.HeicTest; 315 | PRODUCT_NAME = "$(TARGET_NAME)"; 316 | SWIFT_OBJC_BRIDGING_HEADER = "HeicTest/HeicTest-Bridging-Header.h"; 317 | SWIFT_VERSION = 4.2; 318 | TARGETED_DEVICE_FAMILY = "1,2"; 319 | }; 320 | name = Release; 321 | }; 322 | /* End XCBuildConfiguration section */ 323 | 324 | /* Begin XCConfigurationList section */ 325 | BF4AE0EB212FE55F00251C9D /* Build configuration list for PBXProject "HeicTest" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | BF4AE104212FE56000251C9D /* Debug */, 329 | BF4AE105212FE56000251C9D /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | BF4AE106212FE56000251C9D /* Build configuration list for PBXNativeTarget "HeicTest" */ = { 335 | isa = XCConfigurationList; 336 | buildConfigurations = ( 337 | BF4AE107212FE56000251C9D /* Debug */, 338 | BF4AE108212FE56000251C9D /* Release */, 339 | ); 340 | defaultConfigurationIsVisible = 0; 341 | defaultConfigurationName = Release; 342 | }; 343 | /* End XCConfigurationList section */ 344 | }; 345 | rootObject = BF4AE0E8212FE55F00251C9D /* Project object */; 346 | } 347 | -------------------------------------------------------------------------------- /HeicTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HeicTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HeicTest.xcodeproj/xcshareddata/xcschemes/HeicTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /HeicTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HeicTest 4 | // 5 | // Created by Aditya Krishnadevan on 15/11/2018. 6 | // Copyright © 2018 PSPDFKit GmbH. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /HeicTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HeicTest 4 | // 5 | // Created by Aditya Krishnadevan on 15/11/2018. 6 | // Copyright © 2018 PSPDFKit GmbH. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | #import "HeicTest-Swift.h" 12 | 13 | @interface AppDelegate () 14 | @property (nonatomic, strong) UIViewController *vc; 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; 21 | self.vc = [[ViewController alloc] init]; 22 | //self.vc = [[HEICBenchmarkVC alloc] init]; 23 | self.vc.view.backgroundColor = UIColor.yellowColor; 24 | self.window.rootViewController = self.vc; 25 | return YES; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /HeicTest/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /HeicTest/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /HeicTest/Assets.xcassets/LargePhoto.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "DSCF1649.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HeicTest/Assets.xcassets/LargePhoto.imageset/DSCF1649.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSPDFKit-labs/HEIC-Benchmark/da2f40143d4579bed74a748569d483f04e192052/HeicTest/Assets.xcassets/LargePhoto.imageset/DSCF1649.jpg -------------------------------------------------------------------------------- /HeicTest/Assets.xcassets/Star_Citizen.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Star_Citizen.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HeicTest/Assets.xcassets/Star_Citizen.imageset/Star_Citizen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PSPDFKit-labs/HEIC-Benchmark/da2f40143d4579bed74a748569d483f04e192052/HeicTest/Assets.xcassets/Star_Citizen.imageset/Star_Citizen.jpg -------------------------------------------------------------------------------- /HeicTest/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HeicTest/HeicTest-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /HeicTest/ImageCodecBenchmarker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HEICBenchmarkVC.swift 3 | // HeicTest 4 | // 5 | // Created by Peter Steinberger on 15.11.18. 6 | // Based on https://gist.github.com/valvoline/428cdd5a409cd7c7946a93d76bacc330 by Costantino Pistagna, sofapps 7 | // Copyright © 2018 PSPDFKit GmbH. All rights reserved. 8 | // 9 | 10 | import Foundation 11 | 12 | import UIKit 13 | import AVFoundation 14 | 15 | extension Data { 16 | static func UImageHEICRepr(image: UIImage, quality: CGFloat) -> Data { 17 | let imageData = NSMutableData() 18 | if let destination = CGImageDestinationCreateWithData(imageData as CFMutableData, AVFileType.heic as CFString, 1, nil) { 19 | let options = [kCGImageDestinationLossyCompressionQuality:quality] 20 | CGImageDestinationAddImage(destination, image.cgImage!, options as CFDictionary) 21 | CGImageDestinationFinalize(destination) 22 | } 23 | return imageData as Data 24 | } 25 | 26 | static func UImageJPEGRepr(image: UIImage, quality: CGFloat) -> Data { 27 | let imageData = NSMutableData() 28 | if let destination = CGImageDestinationCreateWithData(imageData as CFMutableData, AVFileType.jpg as CFString, 1, nil) { 29 | let options = [kCGImageDestinationLossyCompressionQuality:quality] 30 | CGImageDestinationAddImage(destination, image.cgImage!, options as CFDictionary) 31 | CGImageDestinationFinalize(destination) 32 | } 33 | return imageData as Data 34 | } 35 | } 36 | 37 | class ImageCodecBenchmarker: NSObject { 38 | 39 | private class func measureAndLogTimeToRunBlockNamed(_ title: String, iterations: Int = 100, operation: () -> ()) { 40 | let startTime = CFAbsoluteTimeGetCurrent() 41 | for _ in 0 ..< iterations { 42 | autoreleasepool { 43 | operation() 44 | } 45 | 46 | } 47 | let timeElapsed = CFAbsoluteTimeGetCurrent() - startTime 48 | 49 | NSLog("\(title) took %.3f seconds to complete.", timeElapsed) 50 | } 51 | 52 | @objc class func runEncodingBenchmark() { 53 | let anImage = UIImage(named: "Star_Citizen")! 54 | 55 | measureAndLogTimeToRunBlockNamed("Encoding JPEG 1.0") { 56 | let _ = Data.UImageJPEGRepr(image: anImage, quality: 1.0) 57 | } 58 | 59 | measureAndLogTimeToRunBlockNamed("Encoding JPEG 0.9") { 60 | let _ = Data.UImageJPEGRepr(image: anImage, quality: 0.9) 61 | } 62 | 63 | measureAndLogTimeToRunBlockNamed("Encoding HEIC 1.0") { 64 | let _ = Data.UImageHEICRepr(image: anImage, quality: 1.0) 65 | } 66 | 67 | measureAndLogTimeToRunBlockNamed("Encoding HEIC 0.9") { 68 | let _ = Data.UImageHEICRepr(image: anImage, quality: 0.9) 69 | } 70 | } 71 | 72 | @objc class func runDecodingBenchmark() { 73 | 74 | let anImage = UIImage(named: "Star_Citizen")! 75 | let heicImage = Data.UImageHEICRepr(image: anImage, quality: 1.0) 76 | 77 | let jpgImage = Data.UImageJPEGRepr(image: anImage, quality: 1.0) 78 | 79 | measureAndLogTimeToRunBlockNamed("Decoding JPEG 1.0") { 80 | let decodedImage = UIImage(data: jpgImage)! 81 | UIGraphicsBeginImageContextWithOptions(decodedImage.size, false, 1.0) 82 | decodedImage.draw(at: CGPoint.zero) 83 | UIGraphicsGetImageFromCurrentImageContext() 84 | UIGraphicsEndImageContext() 85 | } 86 | 87 | let jpgImage90 = Data.UImageJPEGRepr(image: anImage, quality: 0.9) 88 | measureAndLogTimeToRunBlockNamed("Decoding JPEG 0.9") { 89 | let decodedImage = UIImage(data: jpgImage90)! 90 | UIGraphicsBeginImageContextWithOptions(decodedImage.size, false, 1.0) 91 | decodedImage.draw(at: CGPoint.zero) 92 | UIGraphicsGetImageFromCurrentImageContext() 93 | UIGraphicsEndImageContext() 94 | } 95 | 96 | measureAndLogTimeToRunBlockNamed("Decoding HEIC 1.0") { 97 | let decodedImage = UIImage(data: heicImage)! 98 | UIGraphicsBeginImageContextWithOptions(decodedImage.size, false, 1.0) 99 | decodedImage.draw(at: CGPoint.zero) 100 | UIGraphicsGetImageFromCurrentImageContext() 101 | UIGraphicsEndImageContext() 102 | } 103 | 104 | let heicImage90 = Data.UImageHEICRepr(image: anImage, quality: 0.9) 105 | measureAndLogTimeToRunBlockNamed("Decoding HEIC 0.9") { 106 | let decodedImage = UIImage(data: heicImage90)! 107 | UIGraphicsBeginImageContextWithOptions(decodedImage.size, false, 1.0) 108 | decodedImage.draw(at: CGPoint.zero) 109 | UIGraphicsGetImageFromCurrentImageContext() 110 | UIGraphicsEndImageContext() 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /HeicTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /HeicTest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // HeicTest 4 | // 5 | // Created by Aditya Krishnadevan on 15/11/2018. 6 | // Copyright © 2018 PSPDFKit GmbH. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /HeicTest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // HeicTest 4 | // 5 | // Created by Aditya Krishnadevan on 15/11/2018. 6 | // Copyright © 2018 PSPDFKit GmbH. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "HeicTest-Swift.h" 11 | 12 | @import MobileCoreServices; 13 | @import AVFoundation; 14 | 15 | #define let const __auto_type 16 | #define var __auto_type 17 | 18 | @interface ViewController () 19 | 20 | @end 21 | 22 | @implementation ViewController 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | 27 | // let jpeg = [self writeImageWithType:kUTTypeJPEG fileName:@"image100.jpg" quality:1.0]; 28 | // let jpeg90 = [self writeImageWithType:kUTTypeJPEG fileName:@"image90.jpg" quality:0.9]; 29 | // let heif = [self writeImageWithType:(__bridge CFStringRef)AVFileTypeHEIC fileName:@"image100.heic" quality:1.0]; 30 | // let heif90 = [self writeImageWithType:(__bridge CFStringRef)AVFileTypeHEIC fileName:@"image90.heic" quality:0.9]; 31 | // 32 | // let fm = NSFileManager.defaultManager; 33 | // 34 | // for (NSString *path in @[jpeg, jpeg90, heif, heif90]) { 35 | // NSLog(@"File size for %@ is %.4f.", path.lastPathComponent, ([fm attributesOfItemAtPath:path error:nil].fileSize / (1024.0 * 1024.0))); 36 | // } 37 | 38 | 39 | [self testJPEGEncodingWithQuality:1.0]; 40 | [self testJPEGEncodingWithQuality:0.9]; 41 | 42 | [self testHEIFEncodingWithQuality:1.0]; 43 | [self testHEIFEncodingWithQuality:0.9]; 44 | 45 | [self testJPEGDecodingWithQuality:1.0]; 46 | [self testJPEGDecodingWithQuality:0.9]; 47 | 48 | [self testHEIFDecodingWithQuality:1.0]; 49 | [self testHEIFDecodingWithQuality:0.9]; 50 | 51 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 52 | NSLog(@"Performing third party benchmark..."); 53 | 54 | [ImageCodecBenchmarker runEncodingBenchmark]; 55 | [ImageCodecBenchmarker runDecodingBenchmark]; 56 | }); 57 | } 58 | 59 | - (void)testJPEGDecodingWithQuality:(CGFloat)quality { 60 | let jpegImagePath = [self writeImageWithType:kUTTypeJPEG fileName:@"image.jpg" quality:quality]; 61 | let time = CACurrentMediaTime(); 62 | for (int i = 0; i < 100; i++) { 63 | @autoreleasepool { 64 | let image = [UIImage imageWithContentsOfFile:jpegImagePath]; 65 | UIGraphicsBeginImageContextWithOptions(image.size, NO, 1.0); 66 | [image drawAtPoint:CGPointZero]; 67 | (void)UIGraphicsGetImageFromCurrentImageContext(); 68 | UIGraphicsEndImageContext(); 69 | } 70 | } 71 | NSLog(@"Decoding JPEG %.2f took %.3fs", quality, CACurrentMediaTime() - time); 72 | } 73 | 74 | - (void)testHEIFDecodingWithQuality:(CGFloat)quality { 75 | let heicImagePath = [self writeImageWithType:(__bridge CFStringRef)AVFileTypeHEIC fileName:@"image.heic" quality:quality]; 76 | let time = CACurrentMediaTime(); 77 | for (int i = 0; i < 100; i++) { 78 | @autoreleasepool { 79 | let image = [UIImage imageWithContentsOfFile:heicImagePath]; 80 | UIGraphicsBeginImageContextWithOptions(image.size, NO, 1.0); 81 | [image drawAtPoint:CGPointZero]; 82 | (void)UIGraphicsGetImageFromCurrentImageContext(); 83 | UIGraphicsEndImageContext(); 84 | } 85 | } 86 | NSLog(@"Decoding HEIC %.2f took %.3fs", quality, CACurrentMediaTime() - time); 87 | } 88 | 89 | 90 | - (void)testJPEGEncodingWithQuality:(CGFloat)quality { 91 | let image = [UIImage imageNamed:@"Star_Citizen"]; 92 | 93 | let time = CACurrentMediaTime(); 94 | for (int i = 0; i < 100; i++) { 95 | @autoreleasepool { 96 | let mutableImageData = [NSMutableData new]; 97 | 98 | let destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)mutableImageData, kUTTypeJPEG, 1, NULL); 99 | CGImageDestinationAddImage(destination, image.CGImage, (__bridge CFDictionaryRef)@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @(quality)}); 100 | CGImageDestinationFinalize(destination); 101 | } 102 | } 103 | NSLog(@"Encoding JPEG %.2f took %.3fs", quality, CACurrentMediaTime() - time); 104 | } 105 | 106 | - (void)testHEIFEncodingWithQuality:(CGFloat)quality { 107 | let image = [UIImage imageNamed:@"Star_Citizen"]; 108 | let time = CACurrentMediaTime(); 109 | for (int i = 0; i < 100; i++) { 110 | @autoreleasepool { 111 | let mutableImageData = [NSMutableData new]; 112 | 113 | let destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)mutableImageData, (__bridge CFStringRef)AVFileTypeHEIC, 1, NULL); 114 | CGImageDestinationAddImage(destination, image.CGImage, (__bridge CFDictionaryRef)@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @(quality)}); 115 | CGImageDestinationFinalize(destination); 116 | } 117 | } 118 | NSLog(@"Encoding HEIC %.2f took %.3fs", quality, CACurrentMediaTime() - time); 119 | } 120 | 121 | - (NSString *)writeImageWithType:(CFStringRef)type fileName:(NSString *)fileName quality:(CGFloat)quality { 122 | let image = [UIImage imageNamed:@"Star_Citizen"]; 123 | 124 | let mutableImageData = [NSMutableData new]; 125 | 126 | let destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)mutableImageData, type, 1, NULL); 127 | CGImageDestinationAddImage(destination, image.CGImage, (__bridge CFDictionaryRef)@{(__bridge NSString *)kCGImageDestinationLossyCompressionQuality: @(quality)}); 128 | CGImageDestinationFinalize(destination); 129 | 130 | let docsDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; 131 | let path = [docsDir stringByAppendingPathComponent:fileName]; 132 | [mutableImageData writeToFile:path atomically:NO]; 133 | 134 | return path; 135 | } 136 | 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /HeicTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HeicTest 4 | // 5 | // Created by Aditya Krishnadevan on 15/11/2018. 6 | // Copyright © 2018 PSPDFKit GmbH. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 PSPDFKit GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | 24 | Notice: The image asset is from Star Citizen and not part of the MIT license. 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is the open source benchmark for https://pspdfkit.com/blog/2018/ios-heic-performance/ 2 | 3 | [![](https://pspdfkit.com/images/blog/2018/ios-heic-performance/article-header-2a327dfe.png)](https://pspdfkit.com/blog/2018/ios-heic-performance/) 4 | 5 | This benchmark includes both our own code, and benchmarking code from Costantino Pistagna ("third party benchmark"). 6 | 7 | ## Results 8 | 9 | ### iPad Pro 11' (2018 Model, A12X chip) 10 | 11 | ``` 12 | Encoding JPEG 1.00 took 8.064s 13 | Encoding JPEG 0.90 took 4.345s 14 | Encoding HEIC 1.00 took 10.326s 15 | Encoding HEIC 0.90 took 9.896s 16 | Decoding JPEG 1.00 took 2.397s 17 | Decoding JPEG 0.90 took 2.084s 18 | Decoding HEIC 1.00 took 12.990s 19 | Decoding HEIC 0.90 took 12. 20 | 21 | Performing third party benchmark... 22 | Encoding HEIC 1.0 took 10.279 seconds to complete. 23 | Encoding HEIC 0.9 took 9.934 seconds to complete. 24 | Encoding JPEG 1.0 took 8.118 seconds to complete. 25 | Encoding JPEG 0.9 took 4.432 seconds to complete. 26 | Decoding HEIC 1.0 took 13.060 seconds to complete. 27 | Decoding JPEG 1.0 took 2.155 seconds to complete. 28 | Decoding HEIC 0.9 took 12.127 seconds to complete. 29 | Decoding JPEG 0.9 took 1.983 seconds to complete. 30 | ``` 31 | 32 | ### iPhone XS Max (2018 Model, A12 chip) 33 | 34 | ``` 35 | Encoding JPEG 1.00 took 8.848s 36 | Encoding JPEG 0.90 took 4.802s 37 | Encoding HEIC 1.00 took 9.117s 38 | Encoding HEIC 0.90 took 8.823s 39 | Decoding JPEG 1.00 took 2.263s 40 | Decoding JPEG 0.90 took 1.962s 41 | Decoding HEIC 1.00 took 11.612s 42 | Decoding HEIC 0.90 took 10.263s 43 | 44 | Performing third party benchmark... 45 | Encoding HEIC 1.0 took 9.497 seconds to complete. 46 | Encoding HEIC 0.9 took 9.035 seconds to complete. 47 | Encoding JPEG 1.0 took 8.521 seconds to complete. 48 | Encoding JPEG 0.9 took 4.385 seconds to complete. 49 | Decoding HEIC 1.0 took 11.537 seconds to complete. 50 | Decoding JPEG 1.0 took 2.212 seconds to complete. 51 | Decoding HEIC 0.9 took 11.493 seconds to complete. 52 | Decoding JPEG 0.9 took 1.985 seconds to complete. 53 | ``` 54 | 55 | ### Benchmark Considerations 56 | 57 | Comparing 0.9 of one compression algorithm with 0.9 of another is comparing apples and oranges. You want to pick _some_ numbers A and B at which the output has a comparable quality look. E.g. 0.9 for Apple’s JPEG might be equivalent to 0.8 for their HEIF. - [Daniel Eggert](https://twitter.com/danielboedewadt/status/1062862148500512768) 58 | 59 | ### License 60 | 61 | MIT, see LICENSE file. 62 | 63 | ### Special Thanks 64 | 65 | Costantino Pistagna, sofapps for https://gist.github.com/valvoline/428cdd5a409cd7c7946a93d76bacc330 66 | 67 | --------------------------------------------------------------------------------