public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Need VIDIOC_CROPCAP clarification
@ 2008-05-26 21:26 Hans Verkuil
  2008-05-27  1:16 ` Andy Walls
  0 siblings, 1 reply; 15+ messages in thread
From: Hans Verkuil @ 2008-05-26 21:26 UTC (permalink / raw)
  To: v4l; +Cc: Michael Schimek

Hi all,

How should the pixelaspect field of the v4l2_cropcap struct be filled? 
Looking at existing drivers it can be anything from 0/0, 1/1, 54/59 for 
PAL/SECAM and 11/10 for NTSC or the horizontal number of samples/the 
horizontal number of pixels.

However, it is my understanding that the last one as used in bttv is the 
correct interpretation. Meaning that if the horizontal unit used for 
cropping is equal to a pixel (this is the case for most drivers), then 
pixelaspect should be 1/1. If the horizontal unit is different from a 
pixel, then it should be:

(total number of horizontal units) / (horizontal pixels)

So given a crop coordinate X, the corresponding coordinate in pixels 
would be:

X * pixelaspect.denominator / pixelaspect.numerator

This is what bttv does and I'm pretty sure that's when this ioctl was 
introduced.

Assuming this is correct, then the Spec needs to be fixed in several 
places (and drivers too, for that matter):

- all references to the term 'pixel aspect' are incorrect: it has 
nothing to do with the pixel aspect, it is about the ratio between the 
horizontal sampling frequency and the 'pixel frequency'.

- the description of 'bounds' is wrong: "Width and height are defined in 
pixels, the driver writer is free to choose origin and units of the 
coordinate system in the analog domain." This is contradictory: the 
width units are up to the driver so the unit for the width is not 
necessarily a pixel. The way the cropping is setup implies that the 
height and Y coordinates are ALWAYS in line (aka pixel) units. It 
cannot be anything else since that's the way analog video works. You 
can't sample the height of half a line.

- pixelaspect: has nothing to do with the pixel aspect. So the 
references to PAL/SECAM and NTSC are irrelevant.

Comments?

	Hans

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

end of thread, other threads:[~2008-06-11 20:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-26 21:26 Need VIDIOC_CROPCAP clarification Hans Verkuil
2008-05-27  1:16 ` Andy Walls
2008-05-27  6:53   ` Hans Verkuil
2008-05-27  7:00     ` Hans Verkuil
2008-05-27 23:14       ` Andy Walls
2008-06-06 22:29       ` Michael Schimek
2008-06-07  1:33         ` Daniel Glöckner
2008-06-08 12:27           ` Michael Schimek
2008-06-08 16:55             ` Daniel Glöckner
2008-06-07  2:28         ` Andy Walls
2008-06-08 12:27           ` Michael Schimek
2008-06-11 18:49         ` Hans Verkuil
2008-06-11 20:15           ` Daniel Glöckner
2008-05-27 23:24     ` Andy Walls
2008-05-28  2:19       ` Daniel Glöckner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox