Skip to content

Commit edf6929

Browse files
committed
Update the readme about the AVIF encoding part
1 parent cf9ac22 commit edf6929

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

README.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ This is a [SDWebImage](https://github.com/rs/SDWebImage) coder plugin to add [AV
1212

1313
This AVIF coder plugin currently support AVIF still image **decoding**. Including alpha channel, as well as 10bit/12bit HDR images.
1414

15-
The AVIF encoding is not currently support, because the software-based encoding speed is really slow. Need to wait for better enc implementation.
15+
The AVIF encoding is also supported now. Which always encode as 8-bit depth images.
1616

17-
Note: AVIF image spec is still in evolve. And the current AVIF codec is a simple implementation.
17+
Note: AVIF image spec is still in evolve. And the current upstream AVIF codec is a simple implementation. The encoding time may be long for large images.
1818

1919
Since AVIF is AV1-based inside HEIF image container. In the future, this repo may moved to existing HEIF coder plugin [SDWebImageHEIFCoder](https://github.com/SDWebImage/SDWebImageHEIFCoder) instead.
2020

@@ -35,17 +35,7 @@ it, simply add the following line to your Podfile:
3535
pod 'SDWebImageAVIFCoder'
3636
```
3737

38-
Note: Current `libaom` dependency via CocoaPods, use the pre-built static library for each architecutre.
39-
40-
The reason of this it's that we want to use SIMD/SSE/AVX2 CPU instruction optimization for each platforms. However libaom does not using dynamic CPU detection for Apple's platforms. We need the upstream to support it.
41-
42-
At the same time, CocoaPods does not allow you to write a framework contains so much of architecture detection (for example, iPhone Simulator is x86_x64, however, iPhone is ARM, they should use different assembly files). So we use the pre-built one instead.
43-
44-
If you're using `use_frameworks!` in Podfile, you can check it with static framework instead.
45-
46-
```
47-
pod 'SDWebImageAVIFCoder', :modular_headers => true
48-
```
38+
Note: From version 0.2.0, the dependency libavif and libaom use the portable C implementation to works on Apple platforms. If you need the pre-built library with SIMD/AVX and assembly optimization, try the 0.1.0 version.
4939

5040
#### Carthage
5141

@@ -55,10 +45,6 @@ SDWebImageAVIFCoder is available through [Carthage](https://github.com/Carthage/
5545
github "SDWebImage/SDWebImageAVIFCoder"
5646
```
5747

58-
Note: Carthage dependency of `libaom` using the C implementation codec, instead of original SIMD/SSE/AVX accelerated and assembly implementation, because it need extra dependency (CMake && NASM build tool).
59-
60-
The C implementation make it possible to cross-platform in tvOS/watchOS as well. But if you're care about performance, try CocoaPods instead.
61-
6248
## Usage
6349

6450
To use AVIF coder, you should firstly add the `SDImageAVIFCoder.sharedCoder` to the coders manager. Then you can call the View Category method to start load AVIF images.

SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ - (nullable CGImageRef)sd_createAVIFImageWithData:(nonnull NSData *)data CF_RETU
164164
return imageRef;
165165
}
166166

167-
// The AVIF encoding seems too slow at the current time
167+
// The AVIF encoding seems slow at the current time, but at least works
168168
- (BOOL)canEncodeToFormat:(SDImageFormat)format {
169169
return format == SDImageFormatAVIF;
170170
}

0 commit comments

Comments
 (0)