mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
change(jpeg): Clean up some mess code in jpeg encoder
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
| Supported Targets | ESP32-P4 |
|
||||
| ----------------- | -------- |
|
||||
|
||||
jpeg_decoder can be used to generate '*.rgb' file which to be used for this test.
|
||||
|
||||
@@ -68,12 +68,12 @@ TEST_CASE("JPEG encode performance test for 480*640 RGB->YUV picture", "[jpeg]")
|
||||
|
||||
uint32_t jpg_size_480p = 0;
|
||||
|
||||
size_t bit_stream_length = (size_t)image_esp480_rgb_end - (size_t)image_esp480_rgb_start;
|
||||
size_t rgb_file_size = (size_t)image_esp480_rgb_end - (size_t)image_esp480_rgb_start;
|
||||
|
||||
size_t tx_buffer_size = 0;
|
||||
uint8_t *raw_buf_480p = (uint8_t*)jpeg_alloc_encoder_mem(bit_stream_length, &tx_mem_cfg, &tx_buffer_size);
|
||||
uint8_t *raw_buf_480p = (uint8_t*)jpeg_alloc_encoder_mem(rgb_file_size, &tx_mem_cfg, &tx_buffer_size);
|
||||
// Copy bit stream to psram
|
||||
memcpy(raw_buf_480p, image_esp480_rgb_start, bit_stream_length);
|
||||
memcpy(raw_buf_480p, image_esp480_rgb_start, rgb_file_size);
|
||||
TEST_ESP_OK(jpeg_new_encoder_engine(&encode_eng_cfg, &jpeg_handle));
|
||||
|
||||
ccomp_timer_start();
|
||||
@@ -81,7 +81,7 @@ TEST_CASE("JPEG encode performance test for 480*640 RGB->YUV picture", "[jpeg]")
|
||||
// Decode picture for 50 times, and get the average
|
||||
uint8_t cnt = 50;
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
TEST_ESP_OK(jpeg_encoder_process(jpeg_handle, &enc_config, raw_buf_480p, bit_stream_length, jpg_buf_480p, rx_buffer_size, &jpg_size_480p));
|
||||
TEST_ESP_OK(jpeg_encoder_process(jpeg_handle, &enc_config, raw_buf_480p, rgb_file_size, jpg_buf_480p, rx_buffer_size, &jpg_size_480p));
|
||||
}
|
||||
int64_t encode_time = ccomp_timer_stop();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user