[英]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.