本文介绍了为什么PNG COM pression是比JPEG Android上慢得多?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在玩弄Android的位图了一下,发现了,那巴COM pression花费甚至比最高质量的JPEG一大部分的时间。更多。在我的设备也可以是大致10秒对1。

AFAIK,PNG基本上过滤像素COM pressed采用deflate的字符串。好了,找到最好的过滤器,每串可能是耗时的任务,但可以有速度和COM pression效益之间建立平衡。它不应该是比JPEG要慢。它怎么会是?

也许是周围的其他方法。是否有关于Android的一些超快速JPEG实现?

更新:我真的只是做这样的事情

  mBitmap.com preSS(比较pressFormat.JPEG,100,流);
 

  mBitmap.com preSS(比较pressFormat.PNG,100,流);
 

解决方案

我测试过我的模拟器项目,更大的图片,虽然PNG COM pression是有点慢,但在性能上没有差异剧烈。因此它应该是由于硬件加速,如在评论告诉BitBank

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. Much much more. On my device it can be roughly up to 10 seconds against 1.

AFAIK, PNG is basically filtered strings of pixels compressed with deflate. 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. How come it is?

Maybe it's the other way around. Is there some ultra-fast JPEG implementation on Android?

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. Therefore it should be due to the hardware acceleration, as told by BitBank in the comment.

这篇关于为什么PNG COM pression是比JPEG Android上慢得多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 04:45