doterax / guetzli-cuda-opencl

Perceptual JPEG encoder, optimized with CUDA&OpenCL, full JPEG format support.
Apache License 2.0
34 stars 4 forks source link

ultra high-resolution files #1

Closed magicdoublem closed 3 years ago

magicdoublem commented 3 years ago

I recognized this in the official version a long time ago too, but since you're probably the only one who is currently working on this code and it never made much sense to fix this in the CPU-version (encoding such pics takes ages with that), I'll bring it up here.

There is an internal limitation that makes guetzli crash with very high-resolution files. I do not know where exactly that limit is, but narrowed it down to 4040 x 3030 being processed and 4050 x 3038 not being processed.

Happens with the original version too (i just can go drink a coffee when I start this) and shouldn't be an issue of available RAM or GPU-RAM.

doterax commented 3 years ago

Can you provide me a file that didn't work for you?

I have tested this case yesterday and found that the only limitation is GPU RAM. And I was surprised that recompression of huge files 7000x7000 works well: 2 minutes and 40 seconds.

So. If you have such image file, attach it to this issue please. And I will analyze it.

magicdoublem commented 3 years ago

That's interesting, I did a bit more testing and I think it really is just an issue of not having enough GPU-mem available. I'm on a 6GB RTX2060 and trying to squeeze down 50 and 100mpx files might be too much for it, I underestimated the numbers. :)

I can go higher than mentioned before if I free up mem.

And in regards to my experiences with the original build, my tests back then were with an x86-version, not x64 which they initially didn't provide. Didn't care much for more testing back in the day, due to the encoding times.

Problem solved, it's not a bug. Thanks for your effort.

BTW, is there a chance to easily slap tiff-reading support on?

doterax commented 3 years ago

my tests back then were with an x86-version

I think this is explanation. I decided to drop supporting x86, because guetzli eats a lot of memory. So x86 is useless for me.

BTW, is there a chance to easily slap tiff-reading support on?

Create please a new issue and I will try to support tiff.

magicdoublem commented 3 years ago

Yes, you're totally right, x86 doesn't make sense for this anymore.

Interestingly I can encode files with OpenCL where with CUDA it won't even start. Even though it spits out CL_MEM_OBJECT_ALLOCATION_FAILURE(s) in the end, there is also a readable jpg, which I guess is not fully optimized somehow.

Just tested 10000*7500 and yes, this guetzli-encoding can be very interesting for such files...