Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

overlapping overlay

nyryder
Beginner
659 Views
I am trying to emulate the hardware overlay in software. I have one primary surface with destination color key and an overlay surface, which goes on to the overlay shadow location in the primary buffer. One problem i see is that the arbitary windows overlapping on the shadow location. I think to solve this problem,
i can copy the shadow location (that includes the overlapping window) from the primary surface to a temproary buffer, and apply compostion with the overlay surface. The steps are the following,

Apply the compare function (like ippiCompare) on colorkey and make all color key entiries of alpha channel to be zero transparent and non color key (overlapping windows) to have a full transparent. This is my mask.

Then the overlay surface and mask can be merged through composition. when doing the composition if the mask pixels has an full transparent alpha channel it needs to take the mask pixel value other wise it needs to take pixel from the overlay buffer.

The output can be copied back to the primary surface to have the hardware overlay effect.

My question is that when i looked in the ipp image processing functions, i did not find suitable functions to acheive my goal.
Can you point to me proper functions?.

0 Kudos
8 Replies
Ying_H_Intel
Employee
659 Views
Quoting - nyryder
I am trying to emulate the hardware overlay in software. I have one primary surface with destination color key and an overlay surface, which goes on to the overlay shadow location in the primary buffer. One problem i see is that the arbitary windows overlapping on the shadow location. I think to solve this problem,
i can copy the shadow location (that includes the overlapping window) from the primary surface to a temproary buffer, and apply compostion with the overlay surface. The steps are the following,

Apply the compare function (like ippiCompare) on colorkey and make all color key entiries of alpha channel to be zero transparent and non color key (overlapping windows) to have a full transparent. This is my mask.

Then the overlay surface and mask can be merged through composition. when doing the composition if the mask pixels has an full transparent alpha channel it needs to take the mask pixel value other wise it needs to take pixel from the overlay buffer.

The output can be copied back to the primary surface to have the hardware overlay effect.

My question is that when i looked in the ipp image processing functions, i did not find suitable functions to acheive my goal.
Can you point to me proper functions?.


Hi,

IPP copy with image like a matrix in memory. Could you provide a small test case (a matrix or copy aimage) to show what you hope to preform?

Regards,
Ying
0 Kudos
nyryder
Beginner
659 Views
Thanks for your reply. I have attached a BMP file. That shows the problem that i explained. The overlay is usualy done in the hardware. I am trying to do that in the software. The overlay is used in video rendering(VLC). It is a seperate surface/memory location from the primary surface/memory. The primary contains only the color key. The GPU, look for the chroma key, and replace the chroma key from the pixels in the overlay buffer.
Assume the overlay buffer is in RGB format. It is easy to do if there is no overlapping on the color key location(note pad in my example), but if there is an overlapping, then i am thinking to do that by composition. I know the overlay location (shadow) in the primary buffer and its width and height.
Copy the shadow into a buffer and a compare function that compares each pixel for the color key. If it is not a color key then it would update the alpha channel with a predefined value, othrewise not. It is my Mask.
Once a video is rendered in overlay buffer, i can copy the video data and do the composition with the MASK.
If the MASK alpha channel is == PREDEFINED value then it takes the pixel from the mask otherwise it takes from the video buffer.
(This could be more complicated if i do it in YUV). I can optimize it further with only on ROI instead of whole screen.
I am looking for IPP functions to acheive my goal.

0 Kudos
nyryder
Beginner
659 Views
Quoting - nyryder
I am trying to emulate the hardware overlay in software. I have one primary surface with destination color key and an overlay surface, which goes on to the overlay shadow location in the primary buffer. One problem i see is that the arbitary windows overlapping on the shadow location. I think to solve this problem,
i can copy the shadow location (that includes the overlapping window) from the primary surface to a temproary buffer, and apply compostion with the overlay surface. The steps are the following,

Apply the compare function (like ippiCompare) on colorkey and make all color key entiries of alpha channel to be zero transparent and non color key (overlapping windows) to have a full transparent. This is my mask.

Then the overlay surface and mask can be merged through composition. when doing the composition if the mask pixels has an full transparent alpha channel it needs to take the mask pixel value other wise it needs to take pixel from the overlay buffer.

The output can be copied back to the primary surface to have the hardware overlay effect.

My question is that when i looked in the ipp image processing functions, i did not find suitable functions to acheive my goal.
Can you point to me proper functions?.

Hi Ying, Vladmir,
Is my question clear?.
0 Kudos
Vladimir_Dudnik
Employee
659 Views
Hi,

did you noticed ippiAlphaComp function family? These functions allow you to do blending of two images.

Regards,
Vladimir
0 Kudos
dchris
Beginner
659 Views
Hi,

did you noticed ippiAlphaComp function family? These functions allow you to do blending of two images.

Regards,
Vladimir


Is there a function that performs similarly but on YUV images?
0 Kudos
Vladimir_Dudnik
Employee
659 Views
Do you need any special processing for YUV images when you blend them? Or your question is about support of sub-sampled images, like 4:2:4 or 4:2:0?

Regards,
Vladimir

0 Kudos
dchris
Beginner
659 Views
Do you need any special processing for YUV images when you blend them? Or your question is about support of sub-sampled images, like 4:2:4 or 4:2:0?

Regards,
Vladimir



I am looking for blending of sub-sampled imaged.
0 Kudos
Vladimir_Dudnik
Employee
659 Views
yeah, that's something what missed in our offering. Could you please specify what particular YUV formats you are interested in? Although I would not commit on implementing this in the nearest release but at least we will know exactly what our customers are looking for?

Regards,
Vladimir
0 Kudos
Reply