Lines Matching refs:f

44 	struct yuv_frame_info *f = &yi->new_frame_info[frame];  in ivtv_yuv_prep_user_dma()  local
53 y_decode_height = uv_decode_height = f->src_h + f->src_y; in ivtv_yuv_prep_user_dma()
55 if (f->offset_y) in ivtv_yuv_prep_user_dma()
140 if (f->offset_y && yi->blanking_dmaptr) { in ivtv_yuv_prep_user_dma()
229 static void ivtv_yuv_handle_horizontal(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_horizontal() argument
242 f->tru_w, f->src_w, f->dst_w, f->src_x, f->dst_x); in ivtv_yuv_handle_horizontal()
245 x_cutoff = f->src_w + f->src_x; in ivtv_yuv_handle_horizontal()
248 reg_2834 = f->dst_w; in ivtv_yuv_handle_horizontal()
252 reg_2890 = f->dst_x; in ivtv_yuv_handle_horizontal()
263 if (f->vis_w == 720) { in ivtv_yuv_handle_horizontal()
264 if ((f->tru_x - f->pan_x > -1) && (f->tru_x - f->pan_x <= 40) && (f->dst_w >= 680)) in ivtv_yuv_handle_horizontal()
265 reg_2870 = 10 - (f->tru_x - f->pan_x) / 4; in ivtv_yuv_handle_horizontal()
266 else if ((f->tru_x - f->pan_x < 0) && (f->tru_x - f->pan_x >= -20) && (f->dst_w >= 660)) in ivtv_yuv_handle_horizontal()
267 reg_2870 = (10 + (f->tru_x - f->pan_x) / 2); in ivtv_yuv_handle_horizontal()
269 if (f->dst_w >= f->src_w) in ivtv_yuv_handle_horizontal()
275 if (f->dst_w < f->src_w) in ivtv_yuv_handle_horizontal()
281 reg_2870_offset = (f->src_x * ((f->dst_w << 21) / f->src_w)) >> 19; in ivtv_yuv_handle_horizontal()
283 if (f->dst_w >= f->src_w) { in ivtv_yuv_handle_horizontal()
285 master_width = (f->src_w * 0x00200000) / (f->dst_w); in ivtv_yuv_handle_horizontal()
286 if (master_width * f->dst_w != f->src_w * 0x00200000) in ivtv_yuv_handle_horizontal()
298 if (f->dst_w > f->src_w) in ivtv_yuv_handle_horizontal()
299 reg_2870_base = ((f->dst_w - f->src_w)<<16) / (f->src_w <<14); in ivtv_yuv_handle_horizontal()
305 } else if (f->dst_w < f->src_w / 2) { in ivtv_yuv_handle_horizontal()
306 master_width = (f->src_w * 0x00080000) / f->dst_w; in ivtv_yuv_handle_horizontal()
307 if (master_width * f->dst_w != f->src_w * 0x00080000) in ivtv_yuv_handle_horizontal()
317 reg_2870 += (5 - (((f->src_w + f->src_w / 2) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
320 master_width = (f->src_w * 0x00100000) / f->dst_w; in ivtv_yuv_handle_horizontal()
321 if (master_width * f->dst_w != f->src_w * 0x00100000) in ivtv_yuv_handle_horizontal()
331 reg_2870 += (5 - (((f->src_w * 3) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
336 if (f->src_w == f->dst_w) { in ivtv_yuv_handle_horizontal()
341 h_filter = ((f->src_w << 16) / f->dst_w) >> 15; in ivtv_yuv_handle_horizontal()
391 static void ivtv_yuv_handle_vertical(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_vertical() argument
408 f->tru_h, f->src_h, f->dst_h, f->src_y, f->dst_y); in ivtv_yuv_handle_vertical()
412 f->interlaced_y ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
415 f->interlaced_uv ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
419 f->interlaced ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
423 if (f->src_y < 8) { in ivtv_yuv_handle_vertical()
424 src_minor_uv = f->src_y; in ivtv_yuv_handle_vertical()
428 src_major_uv = f->src_y - 8; in ivtv_yuv_handle_vertical()
434 if (f->offset_y) in ivtv_yuv_handle_vertical()
437 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
438 reg_2918 = (f->dst_h << 16) | (f->src_h + src_minor_y); in ivtv_yuv_handle_vertical()
440 reg_2918 = (f->dst_h << 16) | ((f->src_h + src_minor_y) << 1); in ivtv_yuv_handle_vertical()
442 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
443 reg_291c = (f->dst_h << 16) | ((f->src_h + src_minor_uv) >> 1); in ivtv_yuv_handle_vertical()
445 reg_291c = (f->dst_h << 16) | (f->src_h + src_minor_uv); in ivtv_yuv_handle_vertical()
447 reg_2964_base = (src_minor_y * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
448 reg_2968_base = (src_minor_uv * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
450 if (f->dst_h / 2 >= f->src_h && !f->interlaced_y) { in ivtv_yuv_handle_vertical()
451 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
452 if ((f->src_h * 0x00400000) - (master_height * f->dst_h) >= f->dst_h / 2) in ivtv_yuv_handle_vertical()
461 } else if (f->dst_h >= f->src_h) { in ivtv_yuv_handle_vertical()
462 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
469 if (f->interlaced_y) { in ivtv_yuv_handle_vertical()
475 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
478 } else if (f->dst_h >= f->src_h / 2) { in ivtv_yuv_handle_vertical()
479 master_height = (f->src_h * 0x00200000) / f->dst_h; in ivtv_yuv_handle_vertical()
486 if (f->interlaced_y) { in ivtv_yuv_handle_vertical()
492 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
496 master_height = (f->src_h * 0x00100000) / f->dst_h; in ivtv_yuv_handle_vertical()
509 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
523 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
528 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
537 if (f->dst_y < 0) in ivtv_yuv_handle_vertical()
538 reg_289c = (reg_289c - ((f->dst_y & ~1)<<15))-(f->dst_y >>1); in ivtv_yuv_handle_vertical()
540 reg_289c = (reg_289c + ((f->dst_y & ~1)<<15))+(f->dst_y >>1); in ivtv_yuv_handle_vertical()
544 reg_2960 = ((src_minor_y + f->src_h + src_major_y) - 1) | in ivtv_yuv_handle_vertical()
545 (((src_minor_uv + f->src_h + src_major_uv - 1) & ~1) << 15); in ivtv_yuv_handle_vertical()
548 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
551 reg_2964 = 2 + ((f->dst_h << 1) / f->src_h); in ivtv_yuv_handle_vertical()
566 if ((reg_2964 != 0x00010001) && (f->dst_h / 2 <= f->src_h)) in ivtv_yuv_handle_vertical()
569 if (!f->interlaced_y) in ivtv_yuv_handle_vertical()
571 if (!f->interlaced_uv) in ivtv_yuv_handle_vertical()
578 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
584 v_filter_1 = ((f->src_h << 16) / f->dst_h) >> 15; in ivtv_yuv_handle_vertical()
670 static u32 ivtv_yuv_window_setup(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_window_setup() argument
678 if (f->src_x < 0) in ivtv_yuv_window_setup()
679 f->src_x = 0; in ivtv_yuv_window_setup()
680 if (f->src_y < 0) in ivtv_yuv_window_setup()
681 f->src_y = 0; in ivtv_yuv_window_setup()
684 if ((osd_crop = f->src_w - 4 * f->dst_w) > 0) { in ivtv_yuv_window_setup()
685 f->src_x += osd_crop / 2; in ivtv_yuv_window_setup()
686 f->src_w = (f->src_w - osd_crop) & ~3; in ivtv_yuv_window_setup()
687 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
688 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
692 if (f->src_h / f->dst_h >= 2) { in ivtv_yuv_window_setup()
695 f->interlaced_y = 1; in ivtv_yuv_window_setup()
697 if ((osd_crop = f->src_h - 4 * f->dst_h) > 0) { in ivtv_yuv_window_setup()
699 f->src_y += osd_crop / 2; in ivtv_yuv_window_setup()
700 f->src_h = (f->src_h - osd_crop) & ~3; in ivtv_yuv_window_setup()
701 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
702 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
707 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
708 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
713 osd_scale = (f->src_h << 16) / f->dst_h; in ivtv_yuv_window_setup()
715 if ((osd_crop = f->pan_y - f->dst_y) > 0) { in ivtv_yuv_window_setup()
717 f->src_y += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
718 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
719 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
720 f->dst_y = 0; in ivtv_yuv_window_setup()
722 f->dst_y -= f->pan_y; in ivtv_yuv_window_setup()
725 if ((osd_crop = f->dst_h + f->dst_y - f->vis_h) > 0) { in ivtv_yuv_window_setup()
727 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
728 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
731 osd_scale = (f->src_w << 16) / f->dst_w; in ivtv_yuv_window_setup()
733 if ((osd_crop = f->pan_x - f->dst_x) > 0) { in ivtv_yuv_window_setup()
735 f->src_x += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
736 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
737 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
738 f->dst_x = 0; in ivtv_yuv_window_setup()
740 f->dst_x -= f->pan_x; in ivtv_yuv_window_setup()
743 if ((osd_crop = f->dst_w + f->dst_x - f->vis_w) > 0) { in ivtv_yuv_window_setup()
745 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
746 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
751 f->dst_x += itv->yuv_info.osd_x_offset; in ivtv_yuv_window_setup()
752 f->dst_y += itv->yuv_info.osd_y_offset; in ivtv_yuv_window_setup()
757 f->dst_w &= ~1; in ivtv_yuv_window_setup()
758 f->dst_x &= ~1; in ivtv_yuv_window_setup()
760 f->src_w += f->src_x & 1; in ivtv_yuv_window_setup()
761 f->src_x &= ~1; in ivtv_yuv_window_setup()
763 f->src_w &= ~1; in ivtv_yuv_window_setup()
764 f->dst_w &= ~1; in ivtv_yuv_window_setup()
766 f->dst_h &= ~1; in ivtv_yuv_window_setup()
767 f->dst_y &= ~1; in ivtv_yuv_window_setup()
769 f->src_h += f->src_y & 1; in ivtv_yuv_window_setup()
770 f->src_y &= ~1; in ivtv_yuv_window_setup()
772 f->src_h &= ~1; in ivtv_yuv_window_setup()
773 f->dst_h &= ~1; in ivtv_yuv_window_setup()
778 if (f->dst_w < f->src_w / 4) { in ivtv_yuv_window_setup()
779 f->src_w &= ~3; in ivtv_yuv_window_setup()
780 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
781 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
783 if (f->dst_h < f->src_h / 4) { in ivtv_yuv_window_setup()
784 f->src_h &= ~3; in ivtv_yuv_window_setup()
785 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
786 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
790 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
791 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
796 if ((of->dst_w != f->dst_w) || (of->src_w != f->src_w) || in ivtv_yuv_window_setup()
797 (of->dst_x != f->dst_x) || (of->src_x != f->src_x) || in ivtv_yuv_window_setup()
798 (of->pan_x != f->pan_x) || (of->vis_w != f->vis_w)) { in ivtv_yuv_window_setup()
802 if ((of->src_h != f->src_h) || (of->dst_h != f->dst_h) || in ivtv_yuv_window_setup()
803 (of->dst_y != f->dst_y) || (of->src_y != f->src_y) || in ivtv_yuv_window_setup()
804 (of->pan_y != f->pan_y) || (of->vis_h != f->vis_h) || in ivtv_yuv_window_setup()
805 (of->lace_mode != f->lace_mode) || in ivtv_yuv_window_setup()
806 (of->interlaced_y != f->interlaced_y) || in ivtv_yuv_window_setup()
807 (of->interlaced_uv != f->interlaced_uv)) { in ivtv_yuv_window_setup()
818 struct yuv_frame_info f; in ivtv_yuv_work_handler() local
823 f = yi->new_frame_info[frame]; in ivtv_yuv_work_handler()
827 f.pan_x = yi->osd_x_pan; in ivtv_yuv_work_handler()
828 f.pan_y = yi->osd_y_pan; in ivtv_yuv_work_handler()
829 f.vis_w = yi->osd_vis_w; in ivtv_yuv_work_handler()
830 f.vis_h = yi->osd_vis_h; in ivtv_yuv_work_handler()
833 f.pan_x = 0; in ivtv_yuv_work_handler()
834 f.pan_y = 0; in ivtv_yuv_work_handler()
835 f.vis_w = 720; in ivtv_yuv_work_handler()
836 f.vis_h = yi->decode_height; in ivtv_yuv_work_handler()
840 if (!(yuv_update = ivtv_yuv_window_setup(itv, &f))) in ivtv_yuv_work_handler()
849 ivtv_yuv_handle_horizontal(itv, &f); in ivtv_yuv_work_handler()
852 ivtv_yuv_handle_vertical(itv, &f); in ivtv_yuv_work_handler()
854 yi->old_frame_info = f; in ivtv_yuv_work_handler()