1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

perf(bin_decoder): improve the decoding performance of a8 (#7494)

This commit is contained in:
Benign X 2024-12-24 04:50:26 +08:00 committed by GitHub
parent 0223869773
commit 517b307ae3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -275,6 +275,12 @@ lv_result_t lv_bin_decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
}
}
else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) {
if(cf == LV_COLOR_FORMAT_A8) {
res = LV_RESULT_OK;
use_directly = true;
dsc->decoded = (lv_draw_buf_t *)image;
}
else {
/*Alpha only image will need decoder data to store pointer to decoded image, to free it when decoder closes*/
decoder_data_t * decoder_data = get_decoder_data(dsc);
if(decoder_data == NULL) {
@ -283,6 +289,7 @@ lv_result_t lv_bin_decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
res = decode_alpha_only(decoder, dsc);
}
}
else {
/*In case of uncompressed formats the image stored in the ROM/RAM.
*So simply give its pointer*/