diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-03-23 10:42:32 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:58:00 -0400 |
commit | f7fc97adb1efd51609d965ba76d559f7daef4262 (patch) | |
tree | 3a2e5454d77d8163f827a31a41512425097f8cb0 /Documentation/video4linux | |
parent | ab56d5eb58182b0c9e179c33ddd3f3aabb6c798f (diff) |
V4L/DVB: sh_mobile_ceu_camera.c: update documentation to reflect the new cropping
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r-- | Documentation/video4linux/sh_mobile_ceu_camera.txt | 80 |
1 files changed, 31 insertions, 49 deletions
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/video4linux/sh_mobile_ceu_camera.txt index 2ae16349a78d..cb47e723af74 100644 --- a/Documentation/video4linux/sh_mobile_ceu_camera.txt +++ b/Documentation/video4linux/sh_mobile_ceu_camera.txt | |||
@@ -17,18 +17,18 @@ Generic scaling / cropping scheme | |||
17 | -2-- -\ | 17 | -2-- -\ |
18 | | --\ | 18 | | --\ |
19 | | --\ | 19 | | --\ |
20 | +-5-- -\ -- -3-- | 20 | +-5-- . -- -3-- -\ |
21 | | ---\ | 21 | | `... -\ |
22 | | --- -4-- -\ | 22 | | `... -4-- . - -7.. |
23 | | -\ | 23 | | `. |
24 | | - -6-- | 24 | | `. .6-- |
25 | | | 25 | | |
26 | | - -6'- | 26 | | . .6'- |
27 | | -/ | 27 | | .´ |
28 | | --- -4'- -/ | 28 | | ... -4'- .´ |
29 | | ---/ | 29 | | ...´ - -7'. |
30 | +-5'- -/ | 30 | +-5'- .´ -/ |
31 | | -- -3'- | 31 | | -- -3'- -/ |
32 | | --/ | 32 | | --/ |
33 | | --/ | 33 | | --/ |
34 | -2'- -/ | 34 | -2'- -/ |
@@ -36,7 +36,11 @@ Generic scaling / cropping scheme | |||
36 | | | 36 | | |
37 | -1'- | 37 | -1'- |
38 | 38 | ||
39 | Produced by user requests: | 39 | In the above chart minuses and slashes represent "real" data amounts, points and |
40 | accents represent "useful" data, basically, CEU scaled amd cropped output, | ||
41 | mapped back onto the client's source plane. | ||
42 | |||
43 | Such a configuration can be produced by user requests: | ||
40 | 44 | ||
41 | S_CROP(left / top = (5) - (1), width / height = (5') - (5)) | 45 | S_CROP(left / top = (5) - (1), width / height = (5') - (5)) |
42 | S_FMT(width / height = (6') - (6)) | 46 | S_FMT(width / height = (6') - (6)) |
@@ -106,52 +110,30 @@ window: | |||
106 | S_CROP | 110 | S_CROP |
107 | ------ | 111 | ------ |
108 | 112 | ||
109 | If old scale applied to new crop is invalid produce nearest new scale possible | 113 | The API at http://v4l2spec.bytesex.org/spec/x1904.htm says: |
110 | |||
111 | 1. Calculate current combined scales. | ||
112 | |||
113 | scale_comb = (((4') - (4)) / ((6') - (6))) * (((2') - (2)) / ((3') - (3))) | ||
114 | |||
115 | 2. Apply iterative sensor S_CROP for new input window. | ||
116 | |||
117 | 3. If old combined scales applied to new crop produce an impossible user window, | ||
118 | adjust scales to produce nearest possible window. | ||
119 | |||
120 | width_u_out = ((5') - (5)) / scale_comb | ||
121 | 114 | ||
122 | if (width_u_out > max) | 115 | "...specification does not define an origin or units. However by convention |
123 | scale_comb = ((5') - (5)) / max; | 116 | drivers should horizontally count unscaled samples relative to 0H." |
124 | else if (width_u_out < min) | ||
125 | scale_comb = ((5') - (5)) / min; | ||
126 | 117 | ||
127 | 4. Issue G_CROP to retrieve actual input window. | 118 | We choose to follow the advise and interpret cropping units as client input |
119 | pixels. | ||
128 | 120 | ||
129 | 5. Using actual input window and calculated combined scales calculate sensor | 121 | Cropping is performed in the following 6 steps: |
130 | target output window. | ||
131 | |||
132 | width_s_out = ((3') - (3)) = ((2') - (2)) / scale_comb | ||
133 | |||
134 | 6. Apply iterative S_FMT for new sensor target output window. | ||
135 | |||
136 | 7. Issue G_FMT to retrieve the actual sensor output window. | ||
137 | |||
138 | 8. Calculate sensor scales. | ||
139 | |||
140 | scale_s = ((3') - (3)) / ((2') - (2)) | ||
141 | 122 | ||
142 | 9. Calculate sensor output subwindow to be cropped on CEU by applying sensor | 123 | 1. Request exactly user rectangle from the sensor. |
143 | scales to the requested window. | ||
144 | 124 | ||
145 | width_ceu = ((5') - (5)) / scale_s | 125 | 2. If smaller - iterate until a larger one is obtained. Result: sensor cropped |
126 | to 2 : 2', target crop 5 : 5', current output format 6' - 6. | ||
146 | 127 | ||
147 | 10. Use CEU cropping for above calculated window. | 128 | 3. In the previous step the sensor has tried to preserve its output frame as |
129 | good as possible, but it could have changed. Retrieve it again. | ||
148 | 130 | ||
149 | 11. Calculate CEU scales from sensor scales from results of (10) and user window | 131 | 4. Sensor scaled to 3 : 3'. Sensor's scale is (2' - 2) / (3' - 3). Calculate |
150 | from (3) | 132 | intermediate window: 4' - 4 = (5' - 5) * (3' - 3) / (2' - 2) |
151 | 133 | ||
152 | scale_ceu = calc_scale(((5') - (5)), &width_u_out) | 134 | 5. Calculate and apply host scale = (6' - 6) / (4' - 4) |
153 | 135 | ||
154 | 12. Apply CEU scales. | 136 | 6. Calculate and apply host crop: 6 - 7 = (5 - 2) * (6' - 6) / (5' - 5) |
155 | 137 | ||
156 | -- | 138 | -- |
157 | Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 139 | Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> |