cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
miner_tom
Adventurer
Adventurer
584 Views
Registered: ‎10-04-2018

How to "sprite" small image over main image for movement?

Jump to solution

I just need to be pointed in a helpful general direction.

I have a zynq development board, zcu104. I also have vivado, SDK and Petalinux installed.

In this case I used the term "sprite" in the sense where gaming libraries might use it, where two image buffers are involved, where one is storing a main image and is overwritten, at the video frame rate, by another image buffer which has a smaller image in it. The smaller image is written to the storage buffer at different positions, and when this buffer is written to the display buffer, movement is simulated.

Any idea of how to write this in Petalinux?

I have looked over the "xilinx video series" at this forum but nothing comes close to supplying the need.

I suppose that petalinux code can be written to act as device drivers to control LogiCore IP products such as "Video on screen display" and others, through the axi framework. 

An easier way to explain what I need to do is simple animation but nothing as complex as gaming. 

Not sure how to proceed.

Thank You

 

0 Kudos
1 Solution

Accepted Solutions
watari
Teacher
Teacher
450 Views
Registered: ‎06-16-2013

Hi @miner_tom 

 

Got it.

I almost agree your opinion.

But I misunderstood what you want to do.

So, would you refer mixer IP to achive it ?

Also, these URLs are helpful for you. Would you refer them ?

 

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Video-Series-32-Visualizing-the-Video-Mixer-example-design-using/ba-p/1026338

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Video-Series-33-Visualizing-the-Video-Mixer-example-design-using/ba-p/1027119

 

Best regards,

View solution in original post

5 Replies
dgisselq
Scholar
Scholar
575 Views
Registered: ‎05-21-2015

@miner_tom,

The first rule of where/how to proceed is that the sprite never makes it onto the image buffer.  It gets added to the image stream.

Let's imagine therefore that you have a video stream of pixels and sync signals.  This would include start (or end) of frame signals, start (or end) of line signals, and so forth.  You can add line numbers and column numbers (y and x positions) to this stream.  Now, if (row_number >= sprite_row) and (row_number <= sprite_row+ sprite_height) and so forth for column, then the outgoing pixel should equal the appropriate sprite pixel.

By keeping the result out of memory, you don't have to fight the MIG controller for access to bandwidth with the CPU.

Dan

miner_tom
Adventurer
Adventurer
550 Views
Registered: ‎10-04-2018

Dan, thank you for your reply. 

Yes, you are correct, your suggestion is one way that the image movement or "sprite" can be accomplished. FYI, 35 years ago I was involved in the design of image processing systems (yes, they existed back then) where functions like you describe were literally done in hardware. I remember generating a cursor by displaying an overlay buffer to one of the bits of the video DAC. But I am attempting to manipulate Xilinx IP in order to do this in a zynq device.

If I can press you for a bit more information..

If I had access to the video image buffer, call it, for example, the HDMI input, whatever the source (camera, image file, etc.) I would need access to the sync generator, creating the horizontal and vertical control signals as well as some kind of timing in order to overwrite the main image with the smaller image at the proper time. I need to know how to overwrite the buffer (probably kept in DDR) at the proper place with the proper data.

 

Thank You

Tom

 

0 Kudos
watari
Teacher
Teacher
464 Views
Registered: ‎06-16-2013

Hi @miner_tom 

 

Who draw it as "sprite" on this buffer ?

Also, do you want to implement "sprite" as NES ?

 

If yes, I suggest you to refer OSD IP.

 

Best regards,

miner_tom
Adventurer
Adventurer
454 Views
Registered: ‎10-04-2018

watari,

Thank you for the reply.

What I am trying to accomplish is nothing so sophisticated as NES Graphics.

What I mention as a "sprite" could be just some small shape that I wish to animate across the display. Could also be a simple polygon.

If using the OSD IP, I expect, in a very general sense, I could overwrite some section of the video display buffer (assuming that the video is in fact put into DDR) with the desired sprite or object. This involves knowing exactly where, in memory, the video buffer is, and having access pointers to write over the memory at the correct place and time.

Do you agree with the above logic?

Regards

Tom

 

0 Kudos
watari
Teacher
Teacher
451 Views
Registered: ‎06-16-2013

Hi @miner_tom 

 

Got it.

I almost agree your opinion.

But I misunderstood what you want to do.

So, would you refer mixer IP to achive it ?

Also, these URLs are helpful for you. Would you refer them ?

 

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Video-Series-32-Visualizing-the-Video-Mixer-example-design-using/ba-p/1026338

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Video-Series-33-Visualizing-the-Video-Mixer-example-design-using/ba-p/1027119

 

Best regards,

View solution in original post