Hello @MSale.1
I am not sure if I can help you in this topic but here are my suggestions
> Each JPEG stream is divided into packets, which have programmable size
What does JPEG Stream means? is it JPEG frame or what exactly?
What packets mean? Minimum Code Unit (MCU) or what?
JPEG codec can decode a JPEG stream as defined in the ISO/IEC 10918-1 specification.
Once the JPEG header generated, the incoming MCUs are encoded, and the resulting data stream sent to the output FIFO. Number of MCUs to be encoded or decoded is configured in JPEG_CONFR2
> how many packet can be received between every HSYNC, one packet or more?
This figure in the reference manual illustrates the dispatching of data. DCMI_HSYNC signal act like blanking signals.

> how this packets can have programmable size and which register responsible for this?
I guess the JPEG header contains information about the image size, resolution, and other parameters. By parsing the header, you can determine the actual size of the image and allocate memory for the frame buffer accordingly...