All of lore.kernel.org
 help / color / mirror / Atom feed
* Question regarding optimizing pipeline in Vimc
@ 2018-08-22  3:35 Helen Koike
  2018-08-22  6:49 ` Hans Verkuil
  0 siblings, 1 reply; 5+ messages in thread
From: Helen Koike @ 2018-08-22  3:35 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Guilherme Alcarde Gallo, Lucas Magalhães

Hello,

One of the discussions we had when developing Vimc, was regarding
optimizing image generation.
The ideia was to generate the images directly in the capture instead
of propagating through the pipeline (to make things faster).
But my question is: if this optimization is on, and if there is a
greyscaler filter in the middle of the pipeline, do you expect to see
a grey image with this optimization? Or if we just generate a dummy
image (with the right size format) at the end of the pipeline, would
it be ok? (I am asking because it doesn't sound that simple to
propagate the image transformation made by each entity in the pipe)
Or do you have any other thing in mind?

Thanks
Helen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question regarding optimizing pipeline in Vimc
  2018-08-22  3:35 Question regarding optimizing pipeline in Vimc Helen Koike
@ 2018-08-22  6:49 ` Hans Verkuil
  2018-08-29 11:58   ` Helen Koike
  2018-08-30 23:37   ` Lucas Magalhães
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Verkuil @ 2018-08-22  6:49 UTC (permalink / raw)
  To: Helen Koike, linux-media; +Cc: Guilherme Alcarde Gallo, Lucas Magalhães

On 08/22/2018 05:35 AM, Helen Koike wrote:
> Hello,
> 
> One of the discussions we had when developing Vimc, was regarding
> optimizing image generation.
> The ideia was to generate the images directly in the capture instead
> of propagating through the pipeline (to make things faster).
> But my question is: if this optimization is on, and if there is a
> greyscaler filter in the middle of the pipeline, do you expect to see
> a grey image with this optimization?

Yes.

> Or if we just generate a dummy
> image (with the right size format) at the end of the pipeline, would
> it be ok? (I am asking because it doesn't sound that simple to
> propagate the image transformation made by each entity in the pipe)

No, that would not be OK.

My basic idea was that you use a TPG state structure that contains the
desired output: the sensor starts with e.g. 720p using some bayer pixelformat,
the debayer module replaces the pixelformat with e.g. PIX_FMT_RGB32, a
grayscale filter replaces it with PI_FMT_GREY, and that's what the TPG for the
video device eventually will use to generate the video.

This assumes of course that all the vimc blocks only do operations that can
be handled by the TPG. Depending on what the blocks will do the TPG might need
to be extended if a feature is missing.

Regards,

	Hans

> Or do you have any other thing in mind?
> 
> Thanks
> Helen
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question regarding optimizing pipeline in Vimc
  2018-08-22  6:49 ` Hans Verkuil
@ 2018-08-29 11:58   ` Helen Koike
  2018-08-30 23:37   ` Lucas Magalhães
  1 sibling, 0 replies; 5+ messages in thread
From: Helen Koike @ 2018-08-29 11:58 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: Guilherme Alcarde Gallo, Lucas Magalhães



On 8/22/18 3:49 AM, Hans Verkuil wrote:
> On 08/22/2018 05:35 AM, Helen Koike wrote:
>> Hello,
>>
>> One of the discussions we had when developing Vimc, was regarding
>> optimizing image generation.
>> The ideia was to generate the images directly in the capture instead
>> of propagating through the pipeline (to make things faster).
>> But my question is: if this optimization is on, and if there is a
>> greyscaler filter in the middle of the pipeline, do you expect to see
>> a grey image with this optimization?
> 
> Yes.
> 
>> Or if we just generate a dummy
>> image (with the right size format) at the end of the pipeline, would
>> it be ok? (I am asking because it doesn't sound that simple to
>> propagate the image transformation made by each entity in the pipe)
> 
> No, that would not be OK.
> 
> My basic idea was that you use a TPG state structure that contains the
> desired output: the sensor starts with e.g. 720p using some bayer pixelformat,
> the debayer module replaces the pixelformat with e.g. PIX_FMT_RGB32, a
> grayscale filter replaces it with PI_FMT_GREY, and that's what the TPG for the
> video device eventually will use to generate the video.
> 
> This assumes of course that all the vimc blocks only do operations that can
> be handled by the TPG. Depending on what the blocks will do the TPG might need
> to be extended if a feature is missing.
> 
> Regards,
> 
> 	Hans
> 
>> Or do you have any other thing in mind?
>>
>> Thanks
>> Helen
>>
> 

Thanks Hans,

We'll be working on that soon.

Helen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question regarding optimizing pipeline in Vimc
  2018-08-22  6:49 ` Hans Verkuil
  2018-08-29 11:58   ` Helen Koike
@ 2018-08-30 23:37   ` Lucas Magalhães
  2018-08-31  9:57     ` Hans Verkuil
  1 sibling, 1 reply; 5+ messages in thread
From: Lucas Magalhães @ 2018-08-30 23:37 UTC (permalink / raw)
  To: hverkuil; +Cc: Helen Koike, linux-media, gagallo7

On Wed, Aug 22, 2018 at 3:49 AM Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> My basic idea was that you use a TPG state structure that contains the
> desired output: the sensor starts with e.g. 720p using some bayer pixelformat,
> the debayer module replaces the pixelformat with e.g. PIX_FMT_RGB32, a
> grayscale filter replaces it with PI_FMT_GREY, and that's what the TPG for the
> video device eventually will use to generate the video.
>
> This assumes of course that all the vimc blocks only do operations that can
> be handled by the TPG. Depending on what the blocks will do the TPG might need
> to be extended if a feature is missing.
>
Hi Hans,

I start to work on this task but I have another question. I understand that the
final image should have the correct format as if the frame was passing through
the whole topology. But the operations itself doesn't needed to be done on each
entity. For example, a scaled image will have deformations that will not be
present if it is generated on the end of the pipeline with the final size.
You just need the format, size and properties to be correct, do I got it right?

Thanks Lucas.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question regarding optimizing pipeline in Vimc
  2018-08-30 23:37   ` Lucas Magalhães
@ 2018-08-31  9:57     ` Hans Verkuil
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2018-08-31  9:57 UTC (permalink / raw)
  To: Lucas Magalhães; +Cc: Helen Koike, linux-media, gagallo7

On 08/31/2018 01:37 AM, Lucas Magalhães wrote:
> On Wed, Aug 22, 2018 at 3:49 AM Hans Verkuil <hverkuil@xs4all.nl> wrote:
>>
>> My basic idea was that you use a TPG state structure that contains the
>> desired output: the sensor starts with e.g. 720p using some bayer pixelformat,
>> the debayer module replaces the pixelformat with e.g. PIX_FMT_RGB32, a
>> grayscale filter replaces it with PI_FMT_GREY, and that's what the TPG for the
>> video device eventually will use to generate the video.
>>
>> This assumes of course that all the vimc blocks only do operations that can
>> be handled by the TPG. Depending on what the blocks will do the TPG might need
>> to be extended if a feature is missing.
>>
> Hi Hans,
> 
> I start to work on this task but I have another question. I understand that the
> final image should have the correct format as if the frame was passing through
> the whole topology. But the operations itself doesn't needed to be done on each
> entity. For example, a scaled image will have deformations that will not be
> present if it is generated on the end of the pipeline with the final size.
> You just need the format, size and properties to be correct, do I got it right?

Yes. Although this example is unfortunate since the TPG can actually scale:
with tpg_reset_source you define the width/height of the 'source', and with
tpg_s_crop_compose you can define the crop and compose rectangles, which in
turn translates to scaling. The TPG has a poor man's scaler, so if you scale
up by a factor of 2, you will in fact see those deformations.

But if you have a complex pipeline with e.g. two scalers with additional
processing in between, then that cannot be modeled accurately with the TPG.
So be it. There is a balance between accuracy and performance, and I think
this is a decent compromise.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-31 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22  3:35 Question regarding optimizing pipeline in Vimc Helen Koike
2018-08-22  6:49 ` Hans Verkuil
2018-08-29 11:58   ` Helen Koike
2018-08-30 23:37   ` Lucas Magalhães
2018-08-31  9:57     ` Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.