Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase performance of YCbCr and RGBA encoding #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evanoberholster
Copy link

Increase performance of YCbCr and RGBA encoding.

  • Reduced allocations due to using Image.Image interface on known Image types.

Benchmarks encoding a 500px YCbCr Image.

Benchmark/AVIF-12         	       2	 579077742 ns/op	    1528 B/op	     139 allocs/op

Compare Old and New implementation

name        old time/op    new time/op    delta
AVIF-12     591ms ± 1%     588ms ± 3%   -0.57%  (p=0.002 n=17+19)

name        old alloc/op   new alloc/op   delta
AVIF-12     536kB ± 0%       2kB ± 0%  -99.71%  (p=0.000 n=16+20)

name        old allocs/op  new allocs/op  delta
AVIF-12      167k ± 0%        0k ± 0%  -99.92%  (p=0.000 n=20+20)

@Kagami
Copy link
Owner

Kagami commented Jul 4, 2022

1st and 3rd cases seem to be the same?
Also, I don't particularly like that the whole loop is duplicated...

For best performance both decoding and colorformat conversion should be done with SIMD and passed as raw bytes to the AV1 encoding library. Though AVIF encoding is so slow and it doesn't matter that much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants