Lines Matching refs: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()
123 if (f->offset_y && yi->blanking_dmaptr) { in ivtv_yuv_prep_user_dma()
212 static void ivtv_yuv_handle_horizontal(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_horizontal() argument
225 f->tru_w, f->src_w, f->dst_w, f->src_x, f->dst_x); in ivtv_yuv_handle_horizontal()
228 x_cutoff = f->src_w + f->src_x; in ivtv_yuv_handle_horizontal()
231 reg_2834 = f->dst_w; in ivtv_yuv_handle_horizontal()
235 reg_2890 = f->dst_x; in ivtv_yuv_handle_horizontal()
246 if (f->vis_w == 720) { in ivtv_yuv_handle_horizontal()
247 if ((f->tru_x - f->pan_x > -1) && (f->tru_x - f->pan_x <= 40) && (f->dst_w >= 680)) in ivtv_yuv_handle_horizontal()
248 reg_2870 = 10 - (f->tru_x - f->pan_x) / 4; in ivtv_yuv_handle_horizontal()
249 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()
250 reg_2870 = (10 + (f->tru_x - f->pan_x) / 2); in ivtv_yuv_handle_horizontal()
252 if (f->dst_w >= f->src_w) in ivtv_yuv_handle_horizontal()
258 if (f->dst_w < f->src_w) in ivtv_yuv_handle_horizontal()
264 reg_2870_offset = (f->src_x * ((f->dst_w << 21) / f->src_w)) >> 19; in ivtv_yuv_handle_horizontal()
266 if (f->dst_w >= f->src_w) { in ivtv_yuv_handle_horizontal()
268 master_width = (f->src_w * 0x00200000) / (f->dst_w); in ivtv_yuv_handle_horizontal()
269 if (master_width * f->dst_w != f->src_w * 0x00200000) in ivtv_yuv_handle_horizontal()
281 if (f->dst_w > f->src_w) in ivtv_yuv_handle_horizontal()
282 reg_2870_base = ((f->dst_w - f->src_w)<<16) / (f->src_w <<14); in ivtv_yuv_handle_horizontal()
288 } else if (f->dst_w < f->src_w / 2) { in ivtv_yuv_handle_horizontal()
289 master_width = (f->src_w * 0x00080000) / f->dst_w; in ivtv_yuv_handle_horizontal()
290 if (master_width * f->dst_w != f->src_w * 0x00080000) in ivtv_yuv_handle_horizontal()
300 reg_2870 += (5 - (((f->src_w + f->src_w / 2) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
303 master_width = (f->src_w * 0x00100000) / f->dst_w; in ivtv_yuv_handle_horizontal()
304 if (master_width * f->dst_w != f->src_w * 0x00100000) in ivtv_yuv_handle_horizontal()
314 reg_2870 += (5 - (((f->src_w * 3) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
319 if (f->src_w == f->dst_w) { in ivtv_yuv_handle_horizontal()
324 h_filter = ((f->src_w << 16) / f->dst_w) >> 15; in ivtv_yuv_handle_horizontal()
374 static void ivtv_yuv_handle_vertical(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_vertical() argument
391 f->tru_h, f->src_h, f->dst_h, f->src_y, f->dst_y); in ivtv_yuv_handle_vertical()
395 f->interlaced_y ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
398 f->interlaced_uv ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
402 f->interlaced ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
406 if (f->src_y < 8) { in ivtv_yuv_handle_vertical()
407 src_minor_uv = f->src_y; in ivtv_yuv_handle_vertical()
411 src_major_uv = f->src_y - 8; in ivtv_yuv_handle_vertical()
417 if (f->offset_y) in ivtv_yuv_handle_vertical()
420 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
421 reg_2918 = (f->dst_h << 16) | (f->src_h + src_minor_y); in ivtv_yuv_handle_vertical()
423 reg_2918 = (f->dst_h << 16) | ((f->src_h + src_minor_y) << 1); in ivtv_yuv_handle_vertical()
425 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
426 reg_291c = (f->dst_h << 16) | ((f->src_h + src_minor_uv) >> 1); in ivtv_yuv_handle_vertical()
428 reg_291c = (f->dst_h << 16) | (f->src_h + src_minor_uv); in ivtv_yuv_handle_vertical()
430 reg_2964_base = (src_minor_y * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
431 reg_2968_base = (src_minor_uv * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
433 if (f->dst_h / 2 >= f->src_h && !f->interlaced_y) { in ivtv_yuv_handle_vertical()
434 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
435 if ((f->src_h * 0x00400000) - (master_height * f->dst_h) >= f->dst_h / 2) in ivtv_yuv_handle_vertical()
444 } else if (f->dst_h >= f->src_h) { in ivtv_yuv_handle_vertical()
445 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
452 if (f->interlaced_y) { in ivtv_yuv_handle_vertical()
458 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
461 } else if (f->dst_h >= f->src_h / 2) { in ivtv_yuv_handle_vertical()
462 master_height = (f->src_h * 0x00200000) / 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()
479 master_height = (f->src_h * 0x00100000) / f->dst_h; in ivtv_yuv_handle_vertical()
492 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
506 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
511 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
520 if (f->dst_y < 0) in ivtv_yuv_handle_vertical()
521 reg_289c = (reg_289c - ((f->dst_y & ~1)<<15))-(f->dst_y >>1); in ivtv_yuv_handle_vertical()
523 reg_289c = (reg_289c + ((f->dst_y & ~1)<<15))+(f->dst_y >>1); in ivtv_yuv_handle_vertical()
527 reg_2960 = ((src_minor_y + f->src_h + src_major_y) - 1) | in ivtv_yuv_handle_vertical()
528 (((src_minor_uv + f->src_h + src_major_uv - 1) & ~1) << 15); in ivtv_yuv_handle_vertical()
531 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
534 reg_2964 = 2 + ((f->dst_h << 1) / f->src_h); in ivtv_yuv_handle_vertical()
549 if ((reg_2964 != 0x00010001) && (f->dst_h / 2 <= f->src_h)) in ivtv_yuv_handle_vertical()
552 if (!f->interlaced_y) in ivtv_yuv_handle_vertical()
554 if (!f->interlaced_uv) in ivtv_yuv_handle_vertical()
561 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
567 v_filter_1 = ((f->src_h << 16) / f->dst_h) >> 15; in ivtv_yuv_handle_vertical()
653 static u32 ivtv_yuv_window_setup(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_window_setup() argument
661 if (f->src_x < 0) in ivtv_yuv_window_setup()
662 f->src_x = 0; in ivtv_yuv_window_setup()
663 if (f->src_y < 0) in ivtv_yuv_window_setup()
664 f->src_y = 0; in ivtv_yuv_window_setup()
667 if ((osd_crop = f->src_w - 4 * f->dst_w) > 0) { in ivtv_yuv_window_setup()
668 f->src_x += osd_crop / 2; in ivtv_yuv_window_setup()
669 f->src_w = (f->src_w - osd_crop) & ~3; in ivtv_yuv_window_setup()
670 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
671 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
675 if (f->src_h / f->dst_h >= 2) { in ivtv_yuv_window_setup()
678 f->interlaced_y = 1; in ivtv_yuv_window_setup()
680 if ((osd_crop = f->src_h - 4 * f->dst_h) > 0) { in ivtv_yuv_window_setup()
682 f->src_y += osd_crop / 2; in ivtv_yuv_window_setup()
683 f->src_h = (f->src_h - osd_crop) & ~3; in ivtv_yuv_window_setup()
684 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
685 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
690 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
691 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
696 osd_scale = (f->src_h << 16) / f->dst_h; in ivtv_yuv_window_setup()
698 if ((osd_crop = f->pan_y - f->dst_y) > 0) { in ivtv_yuv_window_setup()
700 f->src_y += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
701 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
702 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
703 f->dst_y = 0; in ivtv_yuv_window_setup()
705 f->dst_y -= f->pan_y; in ivtv_yuv_window_setup()
708 if ((osd_crop = f->dst_h + f->dst_y - f->vis_h) > 0) { in ivtv_yuv_window_setup()
710 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
711 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
714 osd_scale = (f->src_w << 16) / f->dst_w; in ivtv_yuv_window_setup()
716 if ((osd_crop = f->pan_x - f->dst_x) > 0) { in ivtv_yuv_window_setup()
718 f->src_x += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
719 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
720 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
721 f->dst_x = 0; in ivtv_yuv_window_setup()
723 f->dst_x -= f->pan_x; in ivtv_yuv_window_setup()
726 if ((osd_crop = f->dst_w + f->dst_x - f->vis_w) > 0) { in ivtv_yuv_window_setup()
728 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
729 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
734 f->dst_x += itv->yuv_info.osd_x_offset; in ivtv_yuv_window_setup()
735 f->dst_y += itv->yuv_info.osd_y_offset; in ivtv_yuv_window_setup()
740 f->dst_w &= ~1; in ivtv_yuv_window_setup()
741 f->dst_x &= ~1; in ivtv_yuv_window_setup()
743 f->src_w += f->src_x & 1; in ivtv_yuv_window_setup()
744 f->src_x &= ~1; in ivtv_yuv_window_setup()
746 f->src_w &= ~1; in ivtv_yuv_window_setup()
747 f->dst_w &= ~1; in ivtv_yuv_window_setup()
749 f->dst_h &= ~1; in ivtv_yuv_window_setup()
750 f->dst_y &= ~1; in ivtv_yuv_window_setup()
752 f->src_h += f->src_y & 1; in ivtv_yuv_window_setup()
753 f->src_y &= ~1; in ivtv_yuv_window_setup()
755 f->src_h &= ~1; in ivtv_yuv_window_setup()
756 f->dst_h &= ~1; in ivtv_yuv_window_setup()
761 if (f->dst_w < f->src_w / 4) { in ivtv_yuv_window_setup()
762 f->src_w &= ~3; in ivtv_yuv_window_setup()
763 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
764 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
766 if (f->dst_h < f->src_h / 4) { in ivtv_yuv_window_setup()
767 f->src_h &= ~3; in ivtv_yuv_window_setup()
768 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
769 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
773 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
774 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
779 if ((of->dst_w != f->dst_w) || (of->src_w != f->src_w) || in ivtv_yuv_window_setup()
780 (of->dst_x != f->dst_x) || (of->src_x != f->src_x) || in ivtv_yuv_window_setup()
781 (of->pan_x != f->pan_x) || (of->vis_w != f->vis_w)) { in ivtv_yuv_window_setup()
785 if ((of->src_h != f->src_h) || (of->dst_h != f->dst_h) || in ivtv_yuv_window_setup()
786 (of->dst_y != f->dst_y) || (of->src_y != f->src_y) || in ivtv_yuv_window_setup()
787 (of->pan_y != f->pan_y) || (of->vis_h != f->vis_h) || in ivtv_yuv_window_setup()
788 (of->lace_mode != f->lace_mode) || in ivtv_yuv_window_setup()
789 (of->interlaced_y != f->interlaced_y) || in ivtv_yuv_window_setup()
790 (of->interlaced_uv != f->interlaced_uv)) { in ivtv_yuv_window_setup()
801 struct yuv_frame_info f; in ivtv_yuv_work_handler() local
806 f = yi->new_frame_info[frame]; in ivtv_yuv_work_handler()
810 f.pan_x = yi->osd_x_pan; in ivtv_yuv_work_handler()
811 f.pan_y = yi->osd_y_pan; in ivtv_yuv_work_handler()
812 f.vis_w = yi->osd_vis_w; in ivtv_yuv_work_handler()
813 f.vis_h = yi->osd_vis_h; in ivtv_yuv_work_handler()
816 f.pan_x = 0; in ivtv_yuv_work_handler()
817 f.pan_y = 0; in ivtv_yuv_work_handler()
818 f.vis_w = 720; in ivtv_yuv_work_handler()
819 f.vis_h = yi->decode_height; in ivtv_yuv_work_handler()
823 if (!(yuv_update = ivtv_yuv_window_setup(itv, &f))) in ivtv_yuv_work_handler()
832 ivtv_yuv_handle_horizontal(itv, &f); in ivtv_yuv_work_handler()
835 ivtv_yuv_handle_vertical(itv, &f); in ivtv_yuv_work_handler()
837 yi->old_frame_info = f; in ivtv_yuv_work_handler()