Discussion of third-party/unofficial Firefox/Thunderbird/SeaMonkey builds.
9 posts • Page 1 of 1
I would like to create a build (Win 7 x64) of Firefox that support JPEG with arithmetic compression. I added the defines in libjpeg-turbo and changed ABI to 80 and also added the 3 source files to the makefile, it compiles fine, but still no difference when I load a JPEG with arithmetic compression I still get the same error message "The image "xy.jpg" cannot be displayed because it contains errors" (it always gets the correct resolution).
I also tried to to replace with latest version (1.3.0) of libjpeg-turbo, again no difference.
I assume that mozilla somewhere before it calls libjpeg analyzes the JPEG and creates an error because it assumes arithmetic coding is not supported. Any ideas how to enable it?
Ok, that´s what I have done, in media/libjpeg/makefile.in:
changed in media/libjpeg/jconfig.h:
added in media/libjpeg/jmorecfg.h:
I also added #error in the parts of the code that get´s only compiled if it´s without arithmetic support, since it compiled without any errors I expect that the macros work.
I also tried libjpeg-turbo 1.3.0, but no difference. Any ideas?
It seems the process is right.
Maybe you can reply to https://bugzilla.mozilla.org/show_bug.cgi?id=680385
Found the problem, unfortunately no solution:
The arithmetic decoder in libjpeg does not support suspension. That´s how I understood it: Firefox calls libjpeg to decode everything it can with the available data (libjpeg request data via callback function). Problem is that the arithmetic decoder needs all data and cannot be suspended. In case firefox tells libjpeg no data, arithmetic decoder fails.
Small images with arithmetic coding - saved locally - work.
Basically the problem is libjpeg. The question is now, why is libjpeg calling the arithmetic decoder without checking if all data is available? Is it a bug introduced by me, a bug in libjpeg, or a difficult to implement feature? Any other ideas?
Note: libjpeg and libjpeg-turbo do not differ in that aspect, the arithmetic decoder is the same
The answer is: It´s a not that easy to implement feature in libjpeg. I created a internal buffer for the entropy data in the arithmetic decoder that restores all data to the state before the function was called, while at the same time keeping the input data that was read.
Sequential arithmetic works, progressive arithmetic images not yet correctly (only first layer is fine). After I finish that, what should I do to get that into Firefox?
Is this problem still exist? Maybe it is better to create a ticket about it in the jpeg-turbo bug tracker?
BTW, tickets about arithmetic JPEG support in the Mozilla, Chromium and Microsoft's trackers:
https://bugs.chromium.org/p/chromium/is ... ?id=669501
https://wpdev.uservoice.com/forums/2578 ... eg-which-s
As jpeg-turbo supports arithmetic coded JPEGs, and jpeg-turbo is used by the Firefox and Chrome, maybe they will decide to enable it some day.
9 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests