Commit Graph

56 Commits

Author SHA1 Message Date
Larry Bank
8aa56c7ebf Optimized grayscale and binary for SW encoder 2020-02-02 22:20:02 +01:00
Larry Bank
d7e3dc0c7e removed debugging statement 2020-02-02 19:19:17 +01:00
Larry Bank
de919bbd40 optimized vga jpeg encode and removed need for YUV LUT 2020-02-02 19:17:42 +01:00
Larry Bank
d12d033e10 First pass optimization of SW JPEG encoder 2020-02-02 13:59:26 +01:00
Larry Bank
e5eb896889 comment and variable cleanup 2020-01-13 20:40:09 +01:00
Larry Bank
4d6797ae88 Fixed HQQQVGA JPEG issue and added more detailed comments 2020-01-13 10:43:54 +01:00
Larry Bank
614efecfd3 Optimized binary to JPEG 2020-01-07 20:14:47 +01:00
Larry Bank
7eed2c048b sped up JPEG capture with integer math 2020-01-04 12:26:45 +01:00
Larry Bank
86b8b915e0 Optimized JPEG MCU capture (#663) 2020-01-03 21:58:02 +02:00
Kwabena W. Agyeman
7ad61b725e Adds hint system to fb_alloc
With this commit fb_alloc now takes hints to better decide which ram to
give (internal or sdram).

Only fb_alloc_all calls are given any hints right now as some of the
calls need as much ram as possible and will cause failures to happen if
a small amount of fast internal sram is returned.

Anyway, hints can be used to tune where things are placed by fb_alloc.
2019-10-04 21:47:54 -07:00
iabdalkader
bb2ea839f4 Fix long delay when JPEG encoding overflows. 2019-09-27 16:56:28 +02:00
iabdalkader
54b8132949 License update. 2019-09-05 22:17:50 +02:00
Kwabena W. Agyeman
43ca9eb5ff Increase jpeg compression timeout
Necessary for large image resolutions.
2019-09-03 22:29:50 -07:00
iabdalkader
367383d800 Fix H7 JPEG encoder boundaries. 2019-03-22 22:47:55 +02:00
Kwabena W. Agyeman
cbc31da2ec Fix bitmap jpeg compression on H7. 2019-01-27 19:41:05 -05:00
Kwabena W. Agyeman
14f4c53037 Make Color LUTs configurable in imlib_config. 2019-01-27 22:52:48 +02:00
iabdalkader
f264c62de2 Fix JPEG MCU boundaries. 2019-01-06 17:49:20 +02:00
Kwabena W. Agyeman
3233592c07 Support jpeg compressing bitmap images. 2018-06-04 17:32:05 +02:00
iabdalkader
4b5338ad8b JPEG: Fix BAYER bounds. 2018-04-26 01:02:15 +02:00
iabdalkader
b8527178f1 JPEG: Move bayer_to_rgb565 to imlib. 2018-04-26 00:43:46 +02:00
iabdalkader
6cd715bf96 Reduce HW JPEG timeout.
* Avoid getting stuck when there's an overflow (abort seems useless).
2018-04-04 16:06:58 +02:00
iabdalkader
aa53cf2352 Support H7 hardware JPEG encoder. 2018-04-03 22:08:53 +02:00
iabdalkader
d330486758 Add Bayer JPEG support. 2017-03-12 03:32:20 +02:00
iabdalkader
11f5d67669 Cleanup JPEG buffer checks. 2017-01-12 17:31:33 +02:00
iabdalkader
5238d55042 Use JPEG_SUBSAMPLE_1x1 for 60 quality. 2016-08-22 21:16:28 +02:00
iabdalkader
d9c8b1535d Reduce IDE JPEG quality. 2016-08-15 01:11:10 +02:00
iabdalkader
56ef404919 Add realloc arg to JPEG encoder.
* If realloc is set to false, JPEG encoder won't try to realloc JPEG buffer and will fail gracefully.
2016-08-12 22:44:39 +02:00
iabdalkader
1cbcb7e434 Add M7 support 2016-08-12 22:43:50 +02:00
iabdalkader
f7aa217f39 Use scaled DCT. 2016-07-06 21:19:14 +02:00
iabdalkader
b5486fc2a3 Set JPEG chroma subsampling based on quality. 2016-07-03 21:27:44 +02:00
Kwabena W. Agyeman
367e5fdd3d Improved JPEG capabilities.
* Added the ability to control the quality on JPEG functions... However,
due to our JPEG implementation this doesn't seem to help. 90% JPEG
quality images and regular images should be about equal. But, you can
see heavy degredation with 90% still. E.g. text is unreabable. Not
exactly sure why this is happening but it can be fixed later.

* Changed the compress() function to compressed(). Also, it now
compresses using FB_Alloc to prevent realloc issues when compressing.

* Added new compress() function. This function compresses an image in
place and if that image is the frame bufffer then it will update the
frame buffer bpp value to reflect the image was compressed. Users can use
this function to basically finalize the frame buffer and then pass the FB
to functions that need to send image bytes. The benefit of using this
function is that it should allow higher quality JPEGs and let everything
run at a faster speed while connected to the IDE.

I made this function to speed up WiFi. However, I encountered a bug with
the winc.send() method. It appears to zero the bytes it sends. I didn't
debug further except to verify that the image data became zero after
calling send.
2016-04-23 16:37:21 -04:00
Kwabena W. Agyeman
302deb0662 Add file read speed.
File reading is runing ultra fast now. We're getting that SD card speed
the STM32 promised now. The file buffer commands have been updated to
alloc as much available memory to read as much of a file in as possible
now to speed up things. This works really great.

Note however, while the file buffer is active you have to use the file
buffer versions of tell and size. Spent a few hours on tracking down an
error related to not using the buffered versions.
2016-03-08 23:38:13 -05:00
Kwabena W. Agyeman
14dbcbd73c Updated code to use fb_alloc.
All file write functions now use fb_alloc to go much faster. Writes are
re-directed to the extra frame buffer RAM and are grouped until they can
be written in a massive multi-block write to the SD card. We get the
best SD card write speed by doing things this way.

Ideally we'd want to buffer the whole file... but, this is about as good
as we're going to get for now.

Going to fix reading functions to use the same buffer next.
2016-03-07 00:09:04 -05:00
Kwabena W. Agyeman
ac3d1e4373 Add BMP/PNM/JPEG image file loading and saving.
There's not a lot of actual functionality changes from the last commit.
However, switching the basic wrapper library to just long_jump on
failure and moving all the state info to structs required changes to all
the base functions in the last commit. The rest of the changes are to
link in the new functionality and to get the code to compile (usbdbg.c
edits).

Next I'll work on a function which abstracts the problem of opening an
image up and executing a line by line function op on it. I already
worked the code out for that. But, it's not in this commit to keep
things streamlined.
2016-02-25 22:26:56 -05:00
Kwabena W. Agyeman
4df0b5044b Add top level file open function.
Fimrware will now automatically detect the appropriate file type and read
in that file type correctly.

Working on tying on of this stuff togheter next. It's getting a little
bit too complicated to deal with error cases. Need to add error message
function layer.
2016-02-23 21:26:43 -05:00
iabdalkader
04a2e89fd5 Optimize JPEG stack usage 2016-02-18 17:55:45 +02:00
iabdalkader
5deaf38a34 Switch to 2x2 (4:2:0) Chroma Subsampling. 2016-02-14 11:20:04 +02:00
iabdalkader
77239a5891 Support 2x1(4:2:2) Chroma subsampling. 2016-02-14 07:34:43 +02:00
iabdalkader
597b9aeba4 Emit proper JPEG headers for grayscale images. 2016-02-14 01:54:19 +02:00
iabdalkader
ee6192aeba Use a faster BinDCT.
* A slightly faster BinDCT.
* JPEG time: GS:22ms RGB:62ms (tested on color-bar images).
2016-02-13 04:28:26 +02:00
iabdalkader
9685cbb727 Small JPEG optimizations. 2016-02-12 07:08:22 +02:00
iabdalkader
3acb5903a2 Optimize Grayscale JPEG.
* Skip UV tables for Grayscale images.
2016-02-12 04:40:36 +02:00
iabdalkader
dd8fcf0ece Better JPEG scaling. 2016-02-07 03:20:04 +02:00
iabdalkader
d76fa2b558 Remove the JPEG offset buffer.
* Set the address of the DMA transfer to addr + offset to allow JPEG
  Compression of the framebuffer without overwriting image pixels.
* This saves 1KBs of stack and conditionals in jpeg_put_bytes/char.
2016-02-06 17:13:53 +02:00
iabdalkader
14891b1cc8 More JPEG cleanup 2016-02-06 03:53:48 +02:00
iabdalkader
b2480801d1 Small JPEG optimizations. 2016-02-06 00:14:25 +02:00
iabdalkader
7f76f68d82 Fix quantization tables initialization. 2016-02-05 23:55:52 +02:00
iabdalkader
8e60588455 Support in place JPEG compression.
* Modify the JPEG compressor to allow in place compression.
2016-02-04 21:56:48 +02:00
iabdalkader
e9147d4594 Remove extra byte in JPEG image size. 2016-02-04 07:04:20 +02:00
iabdalkader
7fff1dc12b Add Grayscale Support to the JPEG compressor. 2016-02-04 07:03:49 +02:00