简体   繁体   English

为什么PNG压缩比Android上的JPEG慢得多?

[英]Why PNG compression is that much slower than JPEG on Android?

I've been toying with Android Bitmaps a bit and found out, that PNG compression takes much more time than even highest quality JPEG one. 我一直在玩Android Bitmaps并发现,PNG压缩比最高质量的JPEG压缩花费的时间要多得多。 Much much more. 更多。 On my device it can be roughly up to 10 seconds against 1. 在我的设备上,它与1相差大约10秒。

AFAIK, PNG is basically filtered strings of pixels compressed with deflate. AFAIK,PNG基本上是用压缩压缩的像素滤波字符串。 Well, finding the best filter for each string might be time consuming task, but there can be compromise established between speed and compression effectiveness. 好吧,为每个字符串找到最佳过滤器可能是一项耗时的任务,但在速度和压缩效率之间可能存在折衷。 It shouldn't be that slower than JPEG. 它不应该比JPEG慢。 How come it is? 怎么回事?

Maybe it's the other way around. 也许这是相反的方式。 Is there some ultra-fast JPEG implementation on Android? Android上有一些超快的JPEG实现吗?

UPDATE: I realy just do things like 更新:我真的只是做的事情

mBitmap.compress(CompressFormat.JPEG, 100, stream);

and

mBitmap.compress(CompressFormat.PNG, 100, stream);

I've tested my project on emulator with much bigger pictures and though PNG compression was little slower, there was no drastic difference in performance. 我已经在模拟器上用更大的图片测试了我的项目,尽管PNG压缩速度稍慢,但性能没有太大差异。 Therefore it should be due to the hardware acceleration, as told by BitBank in the comment. 因此,它应该是由于BitBank在评论中所说的硬件加速。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么android webview比原生android浏览器慢得多? - Why android webview is much slower than the native android browser? 为什么Android模拟器比Windows虚拟机慢得多? - Why are Android emulators much slower than a Windows virtual machine? Android opengl真的比canvas慢得多吗? - Is Android opengl really that much slower than canvas? Android:当计算量增加时,为什么整数计算比浮点计算要慢得多? - Android: Why is integer computation much slower than float computation when the amount of computation increases? 为什么我的原生C ++代码比Android上的Java运行速度慢得多? - Why is my native C++ code running so much slower than Java on Android? jQuery Mobile-为什么Android上的滚动视图/滚动比iOS慢得多? - Jquery Mobile - why is scrollview/scrolling on Android so much slower than on iOS? Android相机jpeg文件的大小比iPhone大得多? - android camera jpeg file size much larger than iphone? 渲染脚本渲染比Android上的OpenGL渲染要慢得多 - Render script rendering is much slower than OpenGL rendering on Android glTexImage2D在Android 4.2.2上比4.2.0慢得多 - glTexImage2D much slower on Android 4.2.2 than 4.2.0 Android SQLite比HTML5 WebSql慢得多 - Android SQLite much slower than HTML5 WebSql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM