Merge branch 'refactor/jpeg_decoder_example' into 'master'

feat(jpeg): simplify decoder example and add pytest coverage

See merge request espressif/esp-idf!49733
This commit is contained in:
morris
2026-07-01 16:27:50 +08:00
20 changed files with 448 additions and 484 deletions
@@ -97,7 +97,9 @@ esp_err_t jpeg_decoder_get_info(const uint8_t *bit_stream, uint32_t stream_size,
* returned through the `out_size` pointer.
*
* @note 1.Please make sure that the content of `bit_stream` pointer cannot be modified until this function returns.
* 2.Please note that the output size of image is always the multiple of 16 depends on protocol of JPEG.
* 2.For JPEGs encoded with YUV420 or YUV422 sampling, the decoded output dimensions can be padded
* to 16-pixel boundaries by the JPEG block layout. Make sure `decode_outbuf` is large enough for
* that padded output size, not only for the visible width and height.
*
* @param[in] decoder_engine Handle of the JPEG decoder instance to use for processing.
* @param[in] decode_cfg Config structure of decoder.
@@ -9,8 +9,8 @@ set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/test_apps/components")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(jpeg_test)
target_add_binary_data(jpeg_test.elf "${IDF_PATH}/examples/peripherals/jpeg/jpeg_decode/resources/esp720.jpg" BINARY)
target_add_binary_data(jpeg_test.elf "${IDF_PATH}/examples/peripherals/jpeg/jpeg_decode/resources/esp1080.jpg" BINARY)
target_add_binary_data(jpeg_test.elf "resources/esp720.jpg" BINARY)
target_add_binary_data(jpeg_test.elf "resources/esp1080.jpg" BINARY)
target_add_binary_data(jpeg_test.elf "resources/no_huff.jpg" BINARY)
target_add_binary_data(jpeg_test.elf "resources/esp480.rgb" BINARY)
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB