GithubHelp home page GithubHelp logo

myiapoole / dfjpegturbo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kean/dfjpegturbo

0.0 0.0 0.0 2.16 MB

Objective-C libjpeg-turbo wrapper

License: Other

Ruby 0.38% C 89.46% Objective-C 10.16%

dfjpegturbo's Introduction

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.

dfjpegturbo's People

Contributors

kean avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.