Beast B-ultrasound image frame storage, read/write, and storage control
The video images of animal B-ultrasound need to be collected in real-time and reconstructed on the display after processing. The storage of animal B-ultrasound images must continuously write data, and at the same time, data must be continuously read from the storage and sent to the backend for processing and display. In addition, to meet this requirement, two equally sized frame memories can be set up in the acquisition system and managed through a ping-pong read-write mechanism. To ensure that only one frame memory is in a write state at any time, a write mutex is set, while only one frame memory is in a read state, a read mutex is set. At the beginning of the animal B-ultrasound system, one frame is stored in a waiting write state, and the other is in a waiting read state. After starting to work, both frames are in a process of alternating between read and write states. The conversion process is the same, but the states of the two frames are staggered, which ensures that data can be continuously written to and read from the frame memory. The workflow of this mechanism is as follows:
(1) The animal B-ultrasound has not started the image acquisition process, and the frame storage A is in a waiting write state, obtaining a write mutex lock; Frame storage B is in a waiting read state, obtaining a read mutex lock.
(2) The frame memory write controller of the animal B-ultrasound system receives a detection start signal and determines that acquisition has begun. It sets the frame memory A write signal WE2-A to be valid, and the frame memory A starts writing the current frame data. At the same time, the frame memory read controller sets the frame memory B read signal 0E2-B to be valid, and the frame memory B starts reading the stored data.
(3) At the end of one frame of the animal B-ultrasound image, the writing of frame A is completed, the write mutex lock is released, and the reading of frame B is completed, the read mutex lock is released.
(4) Waiting for another frame to start, frame storage A obtains a read mutex lock; Frame storage B obtains a write mutex lock.
(5) Starting from another frame, the write controller sets the frame memory B write signal WE2-B to be valid, and the frame memory B starts writing data. The read controller sets the frame memory A read signal OE2-A to be valid, and the frame memory A starts reading data.
link: https://www.bxlimage.com/nw/334.html
tags: Beast B-ultrasound