Lines Matching refs:try_crop
169 struct v4l2_rect try_crop; in omap_vout_new_crop() local
173 try_crop = *new_crop; in omap_vout_new_crop()
176 if (try_crop.left < 0) { in omap_vout_new_crop()
177 try_crop.width += try_crop.left; in omap_vout_new_crop()
178 try_crop.left = 0; in omap_vout_new_crop()
180 if (try_crop.top < 0) { in omap_vout_new_crop()
181 try_crop.height += try_crop.top; in omap_vout_new_crop()
182 try_crop.top = 0; in omap_vout_new_crop()
184 try_crop.width = (try_crop.width < pix->width) ? in omap_vout_new_crop()
185 try_crop.width : pix->width; in omap_vout_new_crop()
186 try_crop.height = (try_crop.height < pix->height) ? in omap_vout_new_crop()
187 try_crop.height : pix->height; in omap_vout_new_crop()
188 if (try_crop.left + try_crop.width > pix->width) in omap_vout_new_crop()
189 try_crop.width = pix->width - try_crop.left; in omap_vout_new_crop()
190 if (try_crop.top + try_crop.height > pix->height) in omap_vout_new_crop()
191 try_crop.height = pix->height - try_crop.top; in omap_vout_new_crop()
193 try_crop.width &= ~1; in omap_vout_new_crop()
194 try_crop.height &= ~1; in omap_vout_new_crop()
196 if (try_crop.width <= 0 || try_crop.height <= 0) in omap_vout_new_crop()
200 if (try_crop.height != win->w.height) { in omap_vout_new_crop()
204 if (try_crop.width > 768) in omap_vout_new_crop()
205 try_crop.width = 768; in omap_vout_new_crop()
209 vresize = (1024 * try_crop.height) / win->w.height; in omap_vout_new_crop()
215 win->w.height = ((1024 * try_crop.height) / vresize) & ~1; in omap_vout_new_crop()
224 if (try_crop.height == 0) in omap_vout_new_crop()
225 try_crop.height = 2; in omap_vout_new_crop()
228 hresize = (1024 * try_crop.width) / win->w.width; in omap_vout_new_crop()
234 win->w.width = ((1024 * try_crop.width) / hresize) & ~1; in omap_vout_new_crop()
243 if (try_crop.width == 0) in omap_vout_new_crop()
244 try_crop.width = 2; in omap_vout_new_crop()
247 if ((try_crop.height/win->w.height) >= 2) in omap_vout_new_crop()
248 try_crop.height = win->w.height * 2; in omap_vout_new_crop()
250 if ((try_crop.width/win->w.width) >= 2) in omap_vout_new_crop()
251 try_crop.width = win->w.width * 2; in omap_vout_new_crop()
253 if (try_crop.width > 768) { in omap_vout_new_crop()
258 if (try_crop.height != win->w.height) in omap_vout_new_crop()
259 try_crop.width = 768; in omap_vout_new_crop()
262 if ((try_crop.height/win->w.height) >= 4) in omap_vout_new_crop()
263 try_crop.height = win->w.height * 4; in omap_vout_new_crop()
265 if ((try_crop.width/win->w.width) >= 4) in omap_vout_new_crop()
266 try_crop.width = win->w.width * 4; in omap_vout_new_crop()
269 *crop = try_crop; in omap_vout_new_crop()