aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2007-03-16 06:44:42 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-27 14:44:48 -0400
commit9e0df402e695e638dfee94a6e05fca48b15404e6 (patch)
treeb4f91692f6c13fdf2b6a788cecc59aa05393730b /drivers
parent59fc7f52898fb35eb053bc7b54430d81629b5966 (diff)
V4L/DVB (5438): Fix ivtv yuv threshold handling
Modifies automatic mode selection for yuv playback. Behaviour is now that source video with a vertical resolution below that of the currently set broadcast mode will be treated as progressive. Video with a vertical resolution greater or equal to the current broadcast mode (up to 576 lines) will be treated as interlaced. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h1
-rw-r--r--drivers/media/video/ivtv/ivtv-yuv.c9
3 files changed, 7 insertions, 5 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 8b5597ff3cd7..45b9328a538f 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -116,7 +116,7 @@ static int dec_yuv_buffers = IVTV_DEFAULT_DEC_YUV_BUFFERS;
116static int dec_vbi_buffers = IVTV_DEFAULT_DEC_VBI_BUFFERS; 116static int dec_vbi_buffers = IVTV_DEFAULT_DEC_VBI_BUFFERS;
117 117
118static int ivtv_yuv_mode = 0; 118static int ivtv_yuv_mode = 0;
119static int ivtv_yuv_threshold=480; 119static int ivtv_yuv_threshold=-1;
120static int ivtv_pci_latency = 1; 120static int ivtv_pci_latency = 1;
121 121
122int ivtv_debug = 0; 122int ivtv_debug = 0;
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index ce28923a5c9c..9a412d6c6d06 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -606,7 +606,6 @@ struct yuv_playback_info
606 606
607 int lace_mode; 607 int lace_mode;
608 int lace_threshold; 608 int lace_threshold;
609 int lace_threshold_last;
610 int lace_sync_field; 609 int lace_sync_field;
611 610
612 atomic_t next_dma_frame; 611 atomic_t next_dma_frame;
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c
index 286a0d7e7208..bcea09542e5a 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.c
+++ b/drivers/media/video/ivtv/ivtv-yuv.c
@@ -613,16 +613,19 @@ static void ivtv_yuv_handle_vertical(struct ivtv *itv, struct yuv_frame_info *wi
613 } 613 }
614 614
615 itv->yuv_info.frame_interlaced_last = itv->yuv_info.frame_interlaced; 615 itv->yuv_info.frame_interlaced_last = itv->yuv_info.frame_interlaced;
616 itv->yuv_info.lace_threshold_last = itv->yuv_info.lace_threshold;
617} 616}
618 617
619/* Modify the supplied coordinate information to fit the visible osd area */ 618/* Modify the supplied coordinate information to fit the visible osd area */
620static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct yuv_frame_info *window) 619static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct yuv_frame_info *window)
621{ 620{
622 int osd_crop; 621 int osd_crop, lace_threshold;
623 u32 osd_scale; 622 u32 osd_scale;
624 u32 yuv_update = 0; 623 u32 yuv_update = 0;
625 624
625 lace_threshold = itv->yuv_info.lace_threshold;
626 if (lace_threshold < 0)
627 lace_threshold = itv->yuv_info.decode_height - 1;
628
626 /* Work out the lace settings */ 629 /* Work out the lace settings */
627 switch (itv->yuv_info.lace_mode) { 630 switch (itv->yuv_info.lace_mode) {
628 case IVTV_YUV_MODE_PROGRESSIVE: /* Progressive mode */ 631 case IVTV_YUV_MODE_PROGRESSIVE: /* Progressive mode */
@@ -639,7 +642,7 @@ static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct yuv_frame_info *windo
639 break; 642 break;
640 643
641 case IVTV_YUV_MODE_AUTO: 644 case IVTV_YUV_MODE_AUTO:
642 if (window->tru_h <= itv->yuv_info.lace_threshold || window->tru_h > 576 || window->tru_w > 720){ 645 if (window->tru_h <= lace_threshold || window->tru_h > 576 || window->tru_w > 720){
643 itv->yuv_info.frame_interlaced = 0; 646 itv->yuv_info.frame_interlaced = 0;
644 if ((window->tru_h < 512) || 647 if ((window->tru_h < 512) ||
645 (window->tru_h > 576 && window->tru_h < 1021) || 648 (window->tru_h > 576 && window->tru_h < 1021) ||