• This repository has been archived on 03/May/2021
  • Stars
    star
    33
  • Rank 783,877 (Top 16 %)
  • Language
    C
  • License
    Other
  • Created almost 11 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Objective-C libjpeg-turbo wrapper

DFJPEGTurbo (Deprecated)

Objective-C libjpeg-turbo wrapper (JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems). DFJPEGTurbo uses libjpeg-turbo version 1.4.1, which now includes arm64 support.

Requirements

  • iOS 6.0

Examples

Decompressing JPEG

NSData *jpegData;
UIImage *image = [DFJPEGTurboImageDecoder imageWithData:data];

Decompressing JPEG with one of the libjpeg-turbo scale factors

NSData *jpegData;
// Scale must be implemented by libjpeg-turbo which supports only several scaling factors (1/1, 1/2, 1/4 etc).
DFJPEGScale scale = DFJPEGScaleMake(1, 2); // 0.5 scale
UIImage *image = [DFJPEGTurboImageDecoder imageWithData:jpegData orientation:UIImageOrientationDown scale:scale];

Benchmark (Baseline JPEG)

Benchmark on older ARM-based systems (iPhone 4S, iPhone 5C) shows that libjpeg-turbo provides a very noticable performance boost over native CGContextDrawImage. However, libjpeg-turbo underperforms on newer systems (iPhone 6). For benchmark implementation see Demo/DFJPEGTurboBenchmark in a project folder.

iPhone 6 (Apple A8)

Input Image CGContextDrawImage libjpeg-turbo
1024x768, 0.3 compression quality 10.51 ms 9.75 ms
1024x768, 0.5 compression quality 10.56 ms 10.15 ms
1024x768, 0.7 compression quality 10.14 ms 11.61 ms
1024x768, 0.9 compression quality 10.13 ms 12.44 ms
2048x1536, 0.3 compression quality 41.60 ms 36.98 ms
2048x1536, 0.5 compression quality 33.46 ms 40.56 ms
2048x1536, 0.7 compression quality 33.85 ms 45.53 ms
2048x1536, 0.9 compression quality 34.79 ms 52.60 ms

iPhone 5C (Apple A6)

Input Image CGContextDrawImage DFJPEGTurbo
1024x768, 0.3 compression quality 42.47 ms 22.26 ms
1024x768, 0.5 compression quality 40.75 ms 23.28 ms
1024x768, 0.7 compression quality 40.51 ms 26.11 ms
1024x768, 0.9 compression quality 39.82 ms 29.77 ms
2048x1536, 0.3 compression quality 130.72 ms 81.95 ms
2048x1536, 0.5 compression quality 129.83 ms 86.50 ms
2048x1536, 0.7 compression quality 130.42 ms 98.17 ms
2048x1536, 0.9 compression quality 130.03 ms 106.18 ms

Installation using CocoaPods

To install DFJPEGTurbo add a dependency in your Podfile.

pod 'DFJPEGTurbo'

Contacts

License

DFJPEGTurbo is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

Nuke

Image loading system
Swift
8,112
star
2

Pulse

Network logger for Apple platforms
Swift
6,307
star
3

DFImageManager

Image loading, processing, caching and preheating
Objective-C
1,180
star
4

Get

Web API client built using async/await
Swift
941
star
5

Preheat

Automates prefetching of content in UITableView and UICollectionView
Swift
629
star
6

PulsePro

A macOS app for viewing logs from Pulse
Swift
482
star
7

Align

Intuitive and powerful Auto Layout library
Swift
350
star
8

Future

Streamlined Future<Value, Error> implementation
Swift
317
star
9

FetchImage

Makes it easy to download images using Nuke and display them in SwiftUI apps
Swift
212
star
10

Regex

Open source regex engine
Swift
211
star
11

Arranged

Open source replacement of UIStackView for iOS 8 (100% layouts supported)
Swift
208
star
12

VPN

Sample custom VPN client/server in Swift
Swift
182
star
13

Formatting

Swift
179
star
14

DFCache

Composite LRU cache with fast metadata using UNIX extended file attributes
Objective-C
162
star
15

RxNuke

RxSwift extensions for Nuke
Swift
148
star
16

CreateAPI

Delightful code generator for OpenAPI specs
Swift
142
star
17

SwiftSQL

Swift API for SQLite
Swift
131
star
18

ThreeColumnNavigation

A minimal example of three-column navigation for iPad and macOS using SwiftUI
Swift
127
star
19

Stacks

A micro UIStackView convenience API inspired by SwiftUI
Swift
73
star
20

Nuke-FLAnimatedImage-Plugin

FLAnimatedImage plugin for Nuke
Swift
53
star
21

RxUI

Auto-binding for RxSwift inspired by SwiftUI
Swift
45
star
22

Nuke-Alamofire-Plugin

Alamofire plugin for Nuke
Swift
40
star
23

NukeDemo

Nuke Demo
Swift
34
star
24

ImagePublisher

Combine publishers for Nuke
Swift
25
star
25

NukeUI

Lazy image loading for Apple platforms: SwiftUI, UIKit, AppKit
Swift
19
star
26

articles

Articles for kean.github.io
19
star
27

URLQueryEncoder

URL query encoder with support for all OpenAPI serialization options
Swift
17
star
28

NukeBuilder

A fun and convenient way to use Nuke
Swift
14
star
29

ScrollViewPrefetcher

Prefetching for SwiftUI
Swift
14
star
30

PulseLogHandler

SwiftLog Extension for Pulse
Swift
12
star
31

HTTPHeaders

Parsing Simple HTTP Headers
Swift
11
star
32

OctoKit

GitHub API client built with Fuse
Swift
8
star
33

PulseApps

Base Pulse macOS and iOS apps and a few demo projects
Swift
7
star
34

kean

1
star