Lines Matching +full:2 +full:f

32 	struct yuv_frame_info *f = &yi->new_frame_info[frame];  in ivtv_yuv_prep_user_dma()  local
40 y_decode_height = uv_decode_height = f->src_h + f->src_y; in ivtv_yuv_prep_user_dma()
42 if (f->offset_y) in ivtv_yuv_prep_user_dma()
128 if (f->offset_y && yi->blanking_dmaptr) { in ivtv_yuv_prep_user_dma()
217 static void ivtv_yuv_handle_horizontal(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_horizontal() argument
230 f->tru_w, f->src_w, f->dst_w, f->src_x, f->dst_x); in ivtv_yuv_handle_horizontal()
233 x_cutoff = f->src_w + f->src_x; in ivtv_yuv_handle_horizontal()
236 reg_2834 = f->dst_w; in ivtv_yuv_handle_horizontal()
240 reg_2890 = f->dst_x; in ivtv_yuv_handle_horizontal()
251 if (f->vis_w == 720) { in ivtv_yuv_handle_horizontal()
252 if ((f->tru_x - f->pan_x > -1) && (f->tru_x - f->pan_x <= 40) && (f->dst_w >= 680)) in ivtv_yuv_handle_horizontal()
253 reg_2870 = 10 - (f->tru_x - f->pan_x) / 4; in ivtv_yuv_handle_horizontal()
254 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()
255 reg_2870 = (10 + (f->tru_x - f->pan_x) / 2); in ivtv_yuv_handle_horizontal()
257 if (f->dst_w >= f->src_w) in ivtv_yuv_handle_horizontal()
263 if (f->dst_w < f->src_w) in ivtv_yuv_handle_horizontal()
269 reg_2870_offset = (f->src_x * ((f->dst_w << 21) / f->src_w)) >> 19; in ivtv_yuv_handle_horizontal()
271 if (f->dst_w >= f->src_w) { in ivtv_yuv_handle_horizontal()
273 master_width = (f->src_w * 0x00200000) / (f->dst_w); in ivtv_yuv_handle_horizontal()
274 if (master_width * f->dst_w != f->src_w * 0x00200000) in ivtv_yuv_handle_horizontal()
278 reg_283c = master_width >> 2; in ivtv_yuv_handle_horizontal()
279 reg_2844 = master_width >> 2; in ivtv_yuv_handle_horizontal()
286 if (f->dst_w > f->src_w) in ivtv_yuv_handle_horizontal()
287 reg_2870_base = ((f->dst_w - f->src_w)<<16) / (f->src_w <<14); in ivtv_yuv_handle_horizontal()
291 …reg_2870 += (((reg_2870_offset << 14) & 0xFFFF0000) | reg_2870_offset >> 2) + (reg_2870_base << 17… in ivtv_yuv_handle_horizontal()
293 } else if (f->dst_w < f->src_w / 2) { in ivtv_yuv_handle_horizontal()
294 master_width = (f->src_w * 0x00080000) / f->dst_w; in ivtv_yuv_handle_horizontal()
295 if (master_width * f->dst_w != f->src_w * 0x00080000) in ivtv_yuv_handle_horizontal()
299 reg_283c = master_width >> 2; in ivtv_yuv_handle_horizontal()
305 reg_2870 += (5 - (((f->src_w + f->src_w / 2) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
308 master_width = (f->src_w * 0x00100000) / f->dst_w; in ivtv_yuv_handle_horizontal()
309 if (master_width * f->dst_w != f->src_w * 0x00100000) in ivtv_yuv_handle_horizontal()
313 reg_283c = master_width >> 2; in ivtv_yuv_handle_horizontal()
319 reg_2870 += (5 - (((f->src_w * 3) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
324 if (f->src_w == f->dst_w) { in ivtv_yuv_handle_horizontal()
329 h_filter = ((f->src_w << 16) / f->dst_w) >> 15; in ivtv_yuv_handle_horizontal()
379 static void ivtv_yuv_handle_vertical(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_vertical() argument
396 f->tru_h, f->src_h, f->dst_h, f->src_y, f->dst_y); in ivtv_yuv_handle_vertical()
400 f->interlaced_y ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
403 f->interlaced_uv ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
407 f->interlaced ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
411 if (f->src_y < 8) { in ivtv_yuv_handle_vertical()
412 src_minor_uv = f->src_y; in ivtv_yuv_handle_vertical()
416 src_major_uv = f->src_y - 8; in ivtv_yuv_handle_vertical()
422 if (f->offset_y) in ivtv_yuv_handle_vertical()
425 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
426 reg_2918 = (f->dst_h << 16) | (f->src_h + src_minor_y); in ivtv_yuv_handle_vertical()
428 reg_2918 = (f->dst_h << 16) | ((f->src_h + src_minor_y) << 1); in ivtv_yuv_handle_vertical()
430 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
431 reg_291c = (f->dst_h << 16) | ((f->src_h + src_minor_uv) >> 1); in ivtv_yuv_handle_vertical()
433 reg_291c = (f->dst_h << 16) | (f->src_h + src_minor_uv); in ivtv_yuv_handle_vertical()
435 reg_2964_base = (src_minor_y * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
436 reg_2968_base = (src_minor_uv * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
438 if (f->dst_h / 2 >= f->src_h && !f->interlaced_y) { in ivtv_yuv_handle_vertical()
439 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
440 if ((f->src_h * 0x00400000) - (master_height * f->dst_h) >= f->dst_h / 2) in ivtv_yuv_handle_vertical()
442 reg_2920 = master_height >> 2; in ivtv_yuv_handle_vertical()
449 } else if (f->dst_h >= f->src_h) { in ivtv_yuv_handle_vertical()
450 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
452 reg_2920 = master_height >> 2; in ivtv_yuv_handle_vertical()
453 reg_2928 = master_height >> 2; in ivtv_yuv_handle_vertical()
457 if (f->interlaced_y) { in ivtv_yuv_handle_vertical()
461 reg_2964_base >>= 2; in ivtv_yuv_handle_vertical()
463 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
466 } else if (f->dst_h >= f->src_h / 2) { in ivtv_yuv_handle_vertical()
467 master_height = (f->src_h * 0x00200000) / f->dst_h; in ivtv_yuv_handle_vertical()
469 reg_2920 = master_height >> 2; in ivtv_yuv_handle_vertical()
470 reg_2928 = master_height >> 2; in ivtv_yuv_handle_vertical()
474 if (f->interlaced_y) { in ivtv_yuv_handle_vertical()
475 reg_2964_base >>= 2; in ivtv_yuv_handle_vertical()
480 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
482 reg_2968_base >>= 2; in ivtv_yuv_handle_vertical()
484 master_height = (f->src_h * 0x00100000) / f->dst_h; in ivtv_yuv_handle_vertical()
486 reg_2920 = master_height >> 2; in ivtv_yuv_handle_vertical()
487 reg_2928 = master_height >> 2; in ivtv_yuv_handle_vertical()
491 reg_2968_base >>= 2; in ivtv_yuv_handle_vertical()
497 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
511 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
516 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
525 if (f->dst_y < 0) in ivtv_yuv_handle_vertical()
526 reg_289c = (reg_289c - ((f->dst_y & ~1)<<15))-(f->dst_y >>1); in ivtv_yuv_handle_vertical()
528 reg_289c = (reg_289c + ((f->dst_y & ~1)<<15))+(f->dst_y >>1); in ivtv_yuv_handle_vertical()
532 reg_2960 = ((src_minor_y + f->src_h + src_major_y) - 1) | in ivtv_yuv_handle_vertical()
533 (((src_minor_uv + f->src_h + src_major_uv - 1) & ~1) << 15); in ivtv_yuv_handle_vertical()
536 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
539 reg_2964 = 2 + ((f->dst_h << 1) / f->src_h); in ivtv_yuv_handle_vertical()
554 if ((reg_2964 != 0x00010001) && (f->dst_h / 2 <= f->src_h)) in ivtv_yuv_handle_vertical()
555 reg_2964 = (reg_2964 & 0xFFFF0000) + ((reg_2964 & 0x0000FFFF) / 2); in ivtv_yuv_handle_vertical()
557 if (!f->interlaced_y) in ivtv_yuv_handle_vertical()
559 if (!f->interlaced_uv) in ivtv_yuv_handle_vertical()
566 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
572 v_filter_1 = ((f->src_h << 16) / f->dst_h) >> 15; in ivtv_yuv_handle_vertical()
650 /* Only update filter 2 if we really need to */ in ivtv_yuv_handle_vertical()
658 static u32 ivtv_yuv_window_setup(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_window_setup() argument
666 if (f->src_x < 0) in ivtv_yuv_window_setup()
667 f->src_x = 0; in ivtv_yuv_window_setup()
668 if (f->src_y < 0) in ivtv_yuv_window_setup()
669 f->src_y = 0; in ivtv_yuv_window_setup()
672 if ((osd_crop = f->src_w - 4 * f->dst_w) > 0) { in ivtv_yuv_window_setup()
673 f->src_x += osd_crop / 2; in ivtv_yuv_window_setup()
674 f->src_w = (f->src_w - osd_crop) & ~3; in ivtv_yuv_window_setup()
675 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
676 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
680 if (f->src_h / f->dst_h >= 2) { in ivtv_yuv_window_setup()
683 f->interlaced_y = 1; in ivtv_yuv_window_setup()
685 if ((osd_crop = f->src_h - 4 * f->dst_h) > 0) { in ivtv_yuv_window_setup()
687 f->src_y += osd_crop / 2; in ivtv_yuv_window_setup()
688 f->src_h = (f->src_h - osd_crop) & ~3; in ivtv_yuv_window_setup()
689 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
690 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
695 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
696 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
701 osd_scale = (f->src_h << 16) / f->dst_h; in ivtv_yuv_window_setup()
703 if ((osd_crop = f->pan_y - f->dst_y) > 0) { in ivtv_yuv_window_setup()
705 f->src_y += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
706 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
707 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
708 f->dst_y = 0; in ivtv_yuv_window_setup()
710 f->dst_y -= f->pan_y; in ivtv_yuv_window_setup()
713 if ((osd_crop = f->dst_h + f->dst_y - f->vis_h) > 0) { in ivtv_yuv_window_setup()
715 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
716 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
719 osd_scale = (f->src_w << 16) / f->dst_w; in ivtv_yuv_window_setup()
721 if ((osd_crop = f->pan_x - f->dst_x) > 0) { in ivtv_yuv_window_setup()
723 f->src_x += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
724 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
725 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
726 f->dst_x = 0; in ivtv_yuv_window_setup()
728 f->dst_x -= f->pan_x; in ivtv_yuv_window_setup()
731 if ((osd_crop = f->dst_w + f->dst_x - f->vis_w) > 0) { in ivtv_yuv_window_setup()
733 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
734 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
739 f->dst_x += itv->yuv_info.osd_x_offset; in ivtv_yuv_window_setup()
740 f->dst_y += itv->yuv_info.osd_y_offset; in ivtv_yuv_window_setup()
745 f->dst_w &= ~1; in ivtv_yuv_window_setup()
746 f->dst_x &= ~1; in ivtv_yuv_window_setup()
748 f->src_w += f->src_x & 1; in ivtv_yuv_window_setup()
749 f->src_x &= ~1; in ivtv_yuv_window_setup()
751 f->src_w &= ~1; in ivtv_yuv_window_setup()
752 f->dst_w &= ~1; in ivtv_yuv_window_setup()
754 f->dst_h &= ~1; in ivtv_yuv_window_setup()
755 f->dst_y &= ~1; in ivtv_yuv_window_setup()
757 f->src_h += f->src_y & 1; in ivtv_yuv_window_setup()
758 f->src_y &= ~1; in ivtv_yuv_window_setup()
760 f->src_h &= ~1; in ivtv_yuv_window_setup()
761 f->dst_h &= ~1; in ivtv_yuv_window_setup()
766 if (f->dst_w < f->src_w / 4) { in ivtv_yuv_window_setup()
767 f->src_w &= ~3; in ivtv_yuv_window_setup()
768 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
769 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
771 if (f->dst_h < f->src_h / 4) { in ivtv_yuv_window_setup()
772 f->src_h &= ~3; in ivtv_yuv_window_setup()
773 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
774 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
778 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
779 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
784 if ((of->dst_w != f->dst_w) || (of->src_w != f->src_w) || in ivtv_yuv_window_setup()
785 (of->dst_x != f->dst_x) || (of->src_x != f->src_x) || in ivtv_yuv_window_setup()
786 (of->pan_x != f->pan_x) || (of->vis_w != f->vis_w)) { in ivtv_yuv_window_setup()
790 if ((of->src_h != f->src_h) || (of->dst_h != f->dst_h) || in ivtv_yuv_window_setup()
791 (of->dst_y != f->dst_y) || (of->src_y != f->src_y) || in ivtv_yuv_window_setup()
792 (of->pan_y != f->pan_y) || (of->vis_h != f->vis_h) || in ivtv_yuv_window_setup()
793 (of->lace_mode != f->lace_mode) || in ivtv_yuv_window_setup()
794 (of->interlaced_y != f->interlaced_y) || in ivtv_yuv_window_setup()
795 (of->interlaced_uv != f->interlaced_uv)) { in ivtv_yuv_window_setup()
806 struct yuv_frame_info f; in ivtv_yuv_work_handler() local
811 f = yi->new_frame_info[frame]; in ivtv_yuv_work_handler()
815 f.pan_x = yi->osd_x_pan; in ivtv_yuv_work_handler()
816 f.pan_y = yi->osd_y_pan; in ivtv_yuv_work_handler()
817 f.vis_w = yi->osd_vis_w; in ivtv_yuv_work_handler()
818 f.vis_h = yi->osd_vis_h; in ivtv_yuv_work_handler()
821 f.pan_x = 0; in ivtv_yuv_work_handler()
822 f.pan_y = 0; in ivtv_yuv_work_handler()
823 f.vis_w = 720; in ivtv_yuv_work_handler()
824 f.vis_h = yi->decode_height; in ivtv_yuv_work_handler()
828 if (!(yuv_update = ivtv_yuv_window_setup(itv, &f))) in ivtv_yuv_work_handler()
837 ivtv_yuv_handle_horizontal(itv, &f); in ivtv_yuv_work_handler()
840 ivtv_yuv_handle_vertical(itv, &f); in ivtv_yuv_work_handler()
842 yi->old_frame_info = f; in ivtv_yuv_work_handler()
899 /* Bit 2 of reg 2878 indicates current decoder output format in ivtv_yuv_init()
1015 if (nf->tru_h < 1021 && (nf->dst_h >= nf->src_h / 2)) in ivtv_yuv_setup_frame()
1030 if (nf->tru_h < 1021 && (nf->dst_h >= nf->src_h / 2)) in ivtv_yuv_setup_frame()