Lines Matching refs:geo

531 static void vou_adjust_input(struct sh_vou_geometry *geo, v4l2_std_id std)  in vou_adjust_input()  argument
543 v4l_bound_align_image(&geo->in_width, 0, VOU_MAX_IMAGE_WIDTH, 2, in vou_adjust_input()
544 &geo->in_height, 0, img_height_max, 1, 0); in vou_adjust_input()
549 unsigned int found = geo->output.width * vou_scale_h_den[i] / in vou_adjust_input()
556 err = abs(found - geo->in_width); in vou_adjust_input()
566 geo->in_width = best; in vou_adjust_input()
567 geo->scale_idx_h = idx; in vou_adjust_input()
574 unsigned int found = geo->output.height * vou_scale_v_den[i] / in vou_adjust_input()
581 err = abs(found - geo->in_height); in vou_adjust_input()
591 geo->in_height = best; in vou_adjust_input()
592 geo->scale_idx_v = idx; in vou_adjust_input()
599 static void vou_adjust_output(struct sh_vou_geometry *geo, v4l2_std_id std) in vou_adjust_output() argument
601 unsigned int best_err = UINT_MAX, best = geo->in_width, in vou_adjust_output()
618 unsigned int found = geo->in_width * vou_scale_h_num[i] / in vou_adjust_output()
625 err = abs(found - geo->output.width); in vou_adjust_output()
635 geo->output.width = best; in vou_adjust_output()
636 geo->scale_idx_h = idx; in vou_adjust_output()
637 if (geo->output.left + best > width_max) in vou_adjust_output()
638 geo->output.left = width_max - best; in vou_adjust_output()
640 pr_debug("%s(): W %u * %u/%u = %u\n", __func__, geo->in_width, in vou_adjust_output()
648 unsigned int found = geo->in_height * vou_scale_v_num[i] / in vou_adjust_output()
655 err = abs(found - geo->output.height); in vou_adjust_output()
665 geo->output.height = best; in vou_adjust_output()
666 geo->scale_idx_v = idx; in vou_adjust_output()
667 if (geo->output.top + best > height_max) in vou_adjust_output()
668 geo->output.top = height_max - best; in vou_adjust_output()
670 pr_debug("%s(): H %u * %u/%u = %u\n", __func__, geo->in_height, in vou_adjust_output()
681 struct sh_vou_geometry geo; in sh_vou_s_fmt_vid_out() local
717 geo.in_width = pix->width; in sh_vou_s_fmt_vid_out()
718 geo.in_height = pix->height; in sh_vou_s_fmt_vid_out()
719 geo.output = vou_dev->rect; in sh_vou_s_fmt_vid_out()
721 vou_adjust_output(&geo, vou_dev->std); in sh_vou_s_fmt_vid_out()
723 mbfmt.width = geo.output.width; in sh_vou_s_fmt_vid_out()
724 mbfmt.height = geo.output.height; in sh_vou_s_fmt_vid_out()
732 geo.output.width, geo.output.height, mbfmt.width, mbfmt.height); in sh_vou_s_fmt_vid_out()
740 if (mbfmt.width != geo.output.width || in sh_vou_s_fmt_vid_out()
741 mbfmt.height != geo.output.height) { in sh_vou_s_fmt_vid_out()
742 geo.output.width = mbfmt.width; in sh_vou_s_fmt_vid_out()
743 geo.output.height = mbfmt.height; in sh_vou_s_fmt_vid_out()
745 vou_adjust_input(&geo, vou_dev->std); in sh_vou_s_fmt_vid_out()
749 vou_dev->rect = geo.output; in sh_vou_s_fmt_vid_out()
750 pix->width = geo.in_width; in sh_vou_s_fmt_vid_out()
751 pix->height = geo.in_height; in sh_vou_s_fmt_vid_out()
761 geo.scale_idx_h, geo.scale_idx_v); in sh_vou_s_fmt_vid_out()
944 struct sh_vou_geometry geo; in sh_vou_s_crop() local
974 geo.output = *rect; in sh_vou_s_crop()
975 geo.in_width = pix->width; in sh_vou_s_crop()
976 geo.in_height = pix->height; in sh_vou_s_crop()
979 sd_crop.c.width = geo.output.width; in sh_vou_s_crop()
980 sd_crop.c.height = geo.output.height; in sh_vou_s_crop()
987 mbfmt.width = geo.output.width; in sh_vou_s_crop()
988 mbfmt.height = geo.output.height; in sh_vou_s_crop()
1001 geo.output.width = mbfmt.width; in sh_vou_s_crop()
1002 geo.output.height = mbfmt.height; in sh_vou_s_crop()
1008 vou_adjust_input(&geo, vou_dev->std); in sh_vou_s_crop()
1011 vou_dev->rect = geo.output; in sh_vou_s_crop()
1012 pix->width = geo.in_width; in sh_vou_s_crop()
1013 pix->height = geo.in_height; in sh_vou_s_crop()
1016 geo.scale_idx_h, geo.scale_idx_v); in sh_vou_s_crop()