Lines Matching 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()
122 if (f->offset_y && yi->blanking_dmaptr) { in ivtv_yuv_prep_user_dma()
211 static void ivtv_yuv_handle_horizontal(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_horizontal() argument
224 f->tru_w, f->src_w, f->dst_w, f->src_x, f->dst_x); in ivtv_yuv_handle_horizontal()
227 x_cutoff = f->src_w + f->src_x; in ivtv_yuv_handle_horizontal()
230 reg_2834 = f->dst_w; in ivtv_yuv_handle_horizontal()
234 reg_2890 = f->dst_x; in ivtv_yuv_handle_horizontal()
245 if (f->vis_w == 720) { in ivtv_yuv_handle_horizontal()
246 if ((f->tru_x - f->pan_x > -1) && (f->tru_x - f->pan_x <= 40) && (f->dst_w >= 680)) in ivtv_yuv_handle_horizontal()
247 reg_2870 = 10 - (f->tru_x - f->pan_x) / 4; in ivtv_yuv_handle_horizontal()
248 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()
249 reg_2870 = (10 + (f->tru_x - f->pan_x) / 2); in ivtv_yuv_handle_horizontal()
251 if (f->dst_w >= f->src_w) in ivtv_yuv_handle_horizontal()
257 if (f->dst_w < f->src_w) in ivtv_yuv_handle_horizontal()
263 reg_2870_offset = (f->src_x * ((f->dst_w << 21) / f->src_w)) >> 19; in ivtv_yuv_handle_horizontal()
265 if (f->dst_w >= f->src_w) { in ivtv_yuv_handle_horizontal()
267 master_width = (f->src_w * 0x00200000) / (f->dst_w); in ivtv_yuv_handle_horizontal()
268 if (master_width * f->dst_w != f->src_w * 0x00200000) in ivtv_yuv_handle_horizontal()
280 if (f->dst_w > f->src_w) in ivtv_yuv_handle_horizontal()
281 reg_2870_base = ((f->dst_w - f->src_w)<<16) / (f->src_w <<14); in ivtv_yuv_handle_horizontal()
287 } else if (f->dst_w < f->src_w / 2) { in ivtv_yuv_handle_horizontal()
288 master_width = (f->src_w * 0x00080000) / f->dst_w; in ivtv_yuv_handle_horizontal()
289 if (master_width * f->dst_w != f->src_w * 0x00080000) in ivtv_yuv_handle_horizontal()
299 reg_2870 += (5 - (((f->src_w + f->src_w / 2) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
302 master_width = (f->src_w * 0x00100000) / f->dst_w; in ivtv_yuv_handle_horizontal()
303 if (master_width * f->dst_w != f->src_w * 0x00100000) in ivtv_yuv_handle_horizontal()
313 reg_2870 += (5 - (((f->src_w * 3) - 1) / f->dst_w)) << 16; in ivtv_yuv_handle_horizontal()
318 if (f->src_w == f->dst_w) { in ivtv_yuv_handle_horizontal()
323 h_filter = ((f->src_w << 16) / f->dst_w) >> 15; in ivtv_yuv_handle_horizontal()
373 static void ivtv_yuv_handle_vertical(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_handle_vertical() argument
390 f->tru_h, f->src_h, f->dst_h, f->src_y, f->dst_y); in ivtv_yuv_handle_vertical()
394 f->interlaced_y ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
397 f->interlaced_uv ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
401 f->interlaced ? "Interlaced" : "Progressive"); in ivtv_yuv_handle_vertical()
405 if (f->src_y < 8) { in ivtv_yuv_handle_vertical()
406 src_minor_uv = f->src_y; in ivtv_yuv_handle_vertical()
410 src_major_uv = f->src_y - 8; in ivtv_yuv_handle_vertical()
416 if (f->offset_y) in ivtv_yuv_handle_vertical()
419 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
420 reg_2918 = (f->dst_h << 16) | (f->src_h + src_minor_y); in ivtv_yuv_handle_vertical()
422 reg_2918 = (f->dst_h << 16) | ((f->src_h + src_minor_y) << 1); in ivtv_yuv_handle_vertical()
424 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
425 reg_291c = (f->dst_h << 16) | ((f->src_h + src_minor_uv) >> 1); in ivtv_yuv_handle_vertical()
427 reg_291c = (f->dst_h << 16) | (f->src_h + src_minor_uv); in ivtv_yuv_handle_vertical()
429 reg_2964_base = (src_minor_y * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
430 reg_2968_base = (src_minor_uv * ((f->dst_h << 16) / f->src_h)) >> 14; in ivtv_yuv_handle_vertical()
432 if (f->dst_h / 2 >= f->src_h && !f->interlaced_y) { in ivtv_yuv_handle_vertical()
433 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
434 if ((f->src_h * 0x00400000) - (master_height * f->dst_h) >= f->dst_h / 2) in ivtv_yuv_handle_vertical()
443 } else if (f->dst_h >= f->src_h) { in ivtv_yuv_handle_vertical()
444 master_height = (f->src_h * 0x00400000) / f->dst_h; in ivtv_yuv_handle_vertical()
451 if (f->interlaced_y) { in ivtv_yuv_handle_vertical()
457 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
460 } else if (f->dst_h >= f->src_h / 2) { in ivtv_yuv_handle_vertical()
461 master_height = (f->src_h * 0x00200000) / f->dst_h; in ivtv_yuv_handle_vertical()
468 if (f->interlaced_y) { in ivtv_yuv_handle_vertical()
474 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
478 master_height = (f->src_h * 0x00100000) / f->dst_h; in ivtv_yuv_handle_vertical()
491 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
505 if (f->interlaced_y) in ivtv_yuv_handle_vertical()
510 if (f->interlaced_uv) in ivtv_yuv_handle_vertical()
519 if (f->dst_y < 0) in ivtv_yuv_handle_vertical()
520 reg_289c = (reg_289c - ((f->dst_y & ~1)<<15))-(f->dst_y >>1); in ivtv_yuv_handle_vertical()
522 reg_289c = (reg_289c + ((f->dst_y & ~1)<<15))+(f->dst_y >>1); in ivtv_yuv_handle_vertical()
526 reg_2960 = ((src_minor_y + f->src_h + src_major_y) - 1) | in ivtv_yuv_handle_vertical()
527 (((src_minor_uv + f->src_h + src_major_uv - 1) & ~1) << 15); in ivtv_yuv_handle_vertical()
530 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
533 reg_2964 = 2 + ((f->dst_h << 1) / f->src_h); in ivtv_yuv_handle_vertical()
548 if ((reg_2964 != 0x00010001) && (f->dst_h / 2 <= f->src_h)) in ivtv_yuv_handle_vertical()
551 if (!f->interlaced_y) in ivtv_yuv_handle_vertical()
553 if (!f->interlaced_uv) in ivtv_yuv_handle_vertical()
560 if (f->src_h == f->dst_h) { in ivtv_yuv_handle_vertical()
566 v_filter_1 = ((f->src_h << 16) / f->dst_h) >> 15; in ivtv_yuv_handle_vertical()
652 static u32 ivtv_yuv_window_setup(struct ivtv *itv, struct yuv_frame_info *f) in ivtv_yuv_window_setup() argument
660 if (f->src_x < 0) in ivtv_yuv_window_setup()
661 f->src_x = 0; in ivtv_yuv_window_setup()
662 if (f->src_y < 0) in ivtv_yuv_window_setup()
663 f->src_y = 0; in ivtv_yuv_window_setup()
666 if ((osd_crop = f->src_w - 4 * f->dst_w) > 0) { in ivtv_yuv_window_setup()
667 f->src_x += osd_crop / 2; in ivtv_yuv_window_setup()
668 f->src_w = (f->src_w - osd_crop) & ~3; in ivtv_yuv_window_setup()
669 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
670 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
674 if (f->src_h / f->dst_h >= 2) { in ivtv_yuv_window_setup()
677 f->interlaced_y = 1; in ivtv_yuv_window_setup()
679 if ((osd_crop = f->src_h - 4 * f->dst_h) > 0) { in ivtv_yuv_window_setup()
681 f->src_y += osd_crop / 2; in ivtv_yuv_window_setup()
682 f->src_h = (f->src_h - osd_crop) & ~3; in ivtv_yuv_window_setup()
683 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
684 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
689 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
690 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
695 osd_scale = (f->src_h << 16) / f->dst_h; in ivtv_yuv_window_setup()
697 if ((osd_crop = f->pan_y - f->dst_y) > 0) { in ivtv_yuv_window_setup()
699 f->src_y += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
700 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
701 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
702 f->dst_y = 0; in ivtv_yuv_window_setup()
704 f->dst_y -= f->pan_y; in ivtv_yuv_window_setup()
707 if ((osd_crop = f->dst_h + f->dst_y - f->vis_h) > 0) { in ivtv_yuv_window_setup()
709 f->dst_h -= osd_crop; in ivtv_yuv_window_setup()
710 f->src_h -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
713 osd_scale = (f->src_w << 16) / f->dst_w; in ivtv_yuv_window_setup()
715 if ((osd_crop = f->pan_x - f->dst_x) > 0) { in ivtv_yuv_window_setup()
717 f->src_x += (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
718 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
719 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
720 f->dst_x = 0; in ivtv_yuv_window_setup()
722 f->dst_x -= f->pan_x; in ivtv_yuv_window_setup()
725 if ((osd_crop = f->dst_w + f->dst_x - f->vis_w) > 0) { in ivtv_yuv_window_setup()
727 f->dst_w -= osd_crop; in ivtv_yuv_window_setup()
728 f->src_w -= (osd_scale * osd_crop) >> 16; in ivtv_yuv_window_setup()
733 f->dst_x += itv->yuv_info.osd_x_offset; in ivtv_yuv_window_setup()
734 f->dst_y += itv->yuv_info.osd_y_offset; in ivtv_yuv_window_setup()
739 f->dst_w &= ~1; in ivtv_yuv_window_setup()
740 f->dst_x &= ~1; in ivtv_yuv_window_setup()
742 f->src_w += f->src_x & 1; in ivtv_yuv_window_setup()
743 f->src_x &= ~1; in ivtv_yuv_window_setup()
745 f->src_w &= ~1; in ivtv_yuv_window_setup()
746 f->dst_w &= ~1; in ivtv_yuv_window_setup()
748 f->dst_h &= ~1; in ivtv_yuv_window_setup()
749 f->dst_y &= ~1; in ivtv_yuv_window_setup()
751 f->src_h += f->src_y & 1; in ivtv_yuv_window_setup()
752 f->src_y &= ~1; in ivtv_yuv_window_setup()
754 f->src_h &= ~1; in ivtv_yuv_window_setup()
755 f->dst_h &= ~1; in ivtv_yuv_window_setup()
760 if (f->dst_w < f->src_w / 4) { in ivtv_yuv_window_setup()
761 f->src_w &= ~3; in ivtv_yuv_window_setup()
762 f->dst_w = f->src_w / 4; in ivtv_yuv_window_setup()
763 f->dst_w += f->dst_w & 1; in ivtv_yuv_window_setup()
765 if (f->dst_h < f->src_h / 4) { in ivtv_yuv_window_setup()
766 f->src_h &= ~3; in ivtv_yuv_window_setup()
767 f->dst_h = f->src_h / 4; in ivtv_yuv_window_setup()
768 f->dst_h += f->dst_h & 1; in ivtv_yuv_window_setup()
772 if ((int)f->dst_w <= 2 || (int)f->dst_h <= 2 || in ivtv_yuv_window_setup()
773 (int)f->src_w <= 2 || (int)f->src_h <= 2) { in ivtv_yuv_window_setup()
778 if ((of->dst_w != f->dst_w) || (of->src_w != f->src_w) || in ivtv_yuv_window_setup()
779 (of->dst_x != f->dst_x) || (of->src_x != f->src_x) || in ivtv_yuv_window_setup()
780 (of->pan_x != f->pan_x) || (of->vis_w != f->vis_w)) { in ivtv_yuv_window_setup()
784 if ((of->src_h != f->src_h) || (of->dst_h != f->dst_h) || in ivtv_yuv_window_setup()
785 (of->dst_y != f->dst_y) || (of->src_y != f->src_y) || in ivtv_yuv_window_setup()
786 (of->pan_y != f->pan_y) || (of->vis_h != f->vis_h) || in ivtv_yuv_window_setup()
787 (of->lace_mode != f->lace_mode) || in ivtv_yuv_window_setup()
788 (of->interlaced_y != f->interlaced_y) || in ivtv_yuv_window_setup()
789 (of->interlaced_uv != f->interlaced_uv)) { in ivtv_yuv_window_setup()
800 struct yuv_frame_info f; in ivtv_yuv_work_handler() local
805 f = yi->new_frame_info[frame]; in ivtv_yuv_work_handler()
809 f.pan_x = yi->osd_x_pan; in ivtv_yuv_work_handler()
810 f.pan_y = yi->osd_y_pan; in ivtv_yuv_work_handler()
811 f.vis_w = yi->osd_vis_w; in ivtv_yuv_work_handler()
812 f.vis_h = yi->osd_vis_h; in ivtv_yuv_work_handler()
815 f.pan_x = 0; in ivtv_yuv_work_handler()
816 f.pan_y = 0; in ivtv_yuv_work_handler()
817 f.vis_w = 720; in ivtv_yuv_work_handler()
818 f.vis_h = yi->decode_height; in ivtv_yuv_work_handler()
822 if (!(yuv_update = ivtv_yuv_window_setup(itv, &f))) in ivtv_yuv_work_handler()
831 ivtv_yuv_handle_horizontal(itv, &f); in ivtv_yuv_work_handler()
834 ivtv_yuv_handle_vertical(itv, &f); in ivtv_yuv_work_handler()
836 yi->old_frame_info = f; in ivtv_yuv_work_handler()