Lines Matching refs:geo
522 static void vou_adjust_input(struct sh_vou_geometry *geo, v4l2_std_id std) in vou_adjust_input() argument
534 v4l_bound_align_image(&geo->in_width, in vou_adjust_input()
536 &geo->in_height, in vou_adjust_input()
542 unsigned int found = geo->output.width * vou_scale_h_den[i] / in vou_adjust_input()
549 err = abs(found - geo->in_width); in vou_adjust_input()
559 geo->in_width = best; in vou_adjust_input()
560 geo->scale_idx_h = idx; in vou_adjust_input()
567 unsigned int found = geo->output.height * vou_scale_v_den[i] / in vou_adjust_input()
574 err = abs(found - geo->in_height); in vou_adjust_input()
584 geo->in_height = best; in vou_adjust_input()
585 geo->scale_idx_v = idx; in vou_adjust_input()
592 static void vou_adjust_output(struct sh_vou_geometry *geo, v4l2_std_id std) in vou_adjust_output() argument
594 unsigned int best_err = UINT_MAX, best = geo->in_width, in vou_adjust_output()
611 unsigned int found = geo->in_width * vou_scale_h_num[i] / in vou_adjust_output()
618 err = abs(found - geo->output.width); in vou_adjust_output()
628 geo->output.width = best; in vou_adjust_output()
629 geo->scale_idx_h = idx_h; in vou_adjust_output()
630 if (geo->output.left + best > width_max) in vou_adjust_output()
631 geo->output.left = width_max - best; in vou_adjust_output()
633 pr_debug("%s(): W %u * %u/%u = %u\n", __func__, geo->in_width, in vou_adjust_output()
641 unsigned int found = geo->in_height * vou_scale_v_num[i] / in vou_adjust_output()
648 err = abs(found - geo->output.height); in vou_adjust_output()
658 geo->output.height = best; in vou_adjust_output()
659 geo->scale_idx_v = idx_v; in vou_adjust_output()
660 if (geo->output.top + best > height_max) in vou_adjust_output()
661 geo->output.top = height_max - best; in vou_adjust_output()
663 pr_debug("%s(): H %u * %u/%u = %u\n", __func__, geo->in_height, in vou_adjust_output()
707 struct sh_vou_geometry geo; in sh_vou_set_fmt_vid_out() local
726 geo.in_width = pix->width; in sh_vou_set_fmt_vid_out()
727 geo.in_height = pix->height; in sh_vou_set_fmt_vid_out()
728 geo.output = vou_dev->rect; in sh_vou_set_fmt_vid_out()
730 vou_adjust_output(&geo, vou_dev->std); in sh_vou_set_fmt_vid_out()
732 mbfmt->width = geo.output.width; in sh_vou_set_fmt_vid_out()
733 mbfmt->height = geo.output.height; in sh_vou_set_fmt_vid_out()
741 geo.output.width, geo.output.height, mbfmt->width, mbfmt->height); in sh_vou_set_fmt_vid_out()
754 if (mbfmt->width != geo.output.width || in sh_vou_set_fmt_vid_out()
755 mbfmt->height != geo.output.height) { in sh_vou_set_fmt_vid_out()
756 geo.output.width = mbfmt->width; in sh_vou_set_fmt_vid_out()
757 geo.output.height = mbfmt->height; in sh_vou_set_fmt_vid_out()
759 vou_adjust_input(&geo, vou_dev->std); in sh_vou_set_fmt_vid_out()
763 vou_dev->rect = geo.output; in sh_vou_set_fmt_vid_out()
764 pix->width = geo.in_width; in sh_vou_set_fmt_vid_out()
765 pix->height = geo.in_height; in sh_vou_set_fmt_vid_out()
775 geo.scale_idx_h, geo.scale_idx_v); in sh_vou_set_fmt_vid_out()
945 struct sh_vou_geometry geo; in sh_vou_s_selection() local
979 geo.output = *rect; in sh_vou_s_selection()
980 geo.in_width = pix->width; in sh_vou_s_selection()
981 geo.in_height = pix->height; in sh_vou_s_selection()
984 sd_crop.c.width = geo.output.width; in sh_vou_s_selection()
985 sd_crop.c.height = geo.output.height; in sh_vou_s_selection()
992 format.format.width = geo.output.width; in sh_vou_s_selection()
993 format.format.height = geo.output.height; in sh_vou_s_selection()
1006 geo.output.width = format.format.width; in sh_vou_s_selection()
1007 geo.output.height = format.format.height; in sh_vou_s_selection()
1013 vou_adjust_input(&geo, vou_dev->std); in sh_vou_s_selection()
1016 vou_dev->rect = geo.output; in sh_vou_s_selection()
1017 pix->width = geo.in_width; in sh_vou_s_selection()
1018 pix->height = geo.in_height; in sh_vou_s_selection()
1021 geo.scale_idx_h, geo.scale_idx_v); in sh_vou_s_selection()