diff options
Diffstat (limited to 'drivers/media/video/cx2341x.c')
-rw-r--r-- | drivers/media/video/cx2341x.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/media/video/cx2341x.c b/drivers/media/video/cx2341x.c index 657e0b969145..2f5ca71e0261 100644 --- a/drivers/media/video/cx2341x.c +++ b/drivers/media/video/cx2341x.c | |||
@@ -742,7 +742,6 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, | |||
742 | 742 | ||
743 | if (old == NULL || old->width != new->width || old->height != new->height || | 743 | if (old == NULL || old->width != new->width || old->height != new->height || |
744 | old->video_encoding != new->video_encoding) { | 744 | old->video_encoding != new->video_encoding) { |
745 | int is_scaling; | ||
746 | u16 w = new->width; | 745 | u16 w = new->width; |
747 | u16 h = new->height; | 746 | u16 h = new->height; |
748 | 747 | ||
@@ -752,20 +751,18 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, | |||
752 | } | 751 | } |
753 | err = cx2341x_api(priv, func, CX2341X_ENC_SET_FRAME_SIZE, 2, h, w); | 752 | err = cx2341x_api(priv, func, CX2341X_ENC_SET_FRAME_SIZE, 2, h, w); |
754 | if (err) return err; | 753 | if (err) return err; |
754 | } | ||
755 | 755 | ||
756 | if (new->width != 720 || new->height != (new->is_50hz ? 576 : 480)) { | ||
756 | /* Adjust temporal filter if necessary. The problem with the temporal | 757 | /* Adjust temporal filter if necessary. The problem with the temporal |
757 | filter is that it works well with full resolution capturing, but | 758 | filter is that it works well with full resolution capturing, but |
758 | not when the capture window is scaled (the filter introduces | 759 | not when the capture window is scaled (the filter introduces |
759 | a ghosting effect). So if the capture window changed, and there is | 760 | a ghosting effect). So if the capture window is scaled, then |
760 | no updated filter value, then the filter is set depending on whether | 761 | force the filter to 0. |
761 | the new window is full resolution or not. | ||
762 | 762 | ||
763 | For full resolution a setting of 8 really improves the video | 763 | For full resolution the filter really improves the video |
764 | quality, especially if the original video quality is suboptimal. */ | 764 | quality, especially if the original video quality is suboptimal. */ |
765 | is_scaling = new->width != 720 || new->height != (new->is_50hz ? 576 : 480); | 765 | temporal = 0; |
766 | if (old && old->video_temporal_filter == temporal) { | ||
767 | temporal = is_scaling ? 0 : 8; | ||
768 | } | ||
769 | } | 766 | } |
770 | 767 | ||
771 | if (old == NULL || old->stream_type != new->stream_type) { | 768 | if (old == NULL || old->stream_type != new->stream_type) { |
@@ -866,6 +863,7 @@ invalid: | |||
866 | void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix) | 863 | void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix) |
867 | { | 864 | { |
868 | int is_mpeg1 = p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1; | 865 | int is_mpeg1 = p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1; |
866 | int temporal = p->video_temporal_filter; | ||
869 | 867 | ||
870 | /* Stream */ | 868 | /* Stream */ |
871 | printk(KERN_INFO "%s: Stream: %s\n", | 869 | printk(KERN_INFO "%s: Stream: %s\n", |
@@ -922,10 +920,13 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix) | |||
922 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE), | 920 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE), |
923 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE), | 921 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE), |
924 | p->video_spatial_filter); | 922 | p->video_spatial_filter); |
923 | if (p->width != 720 || p->height != (p->is_50hz ? 576 : 480)) { | ||
924 | temporal = 0; | ||
925 | } | ||
925 | printk(KERN_INFO "%s: Temporal Filter: %s, %d\n", | 926 | printk(KERN_INFO "%s: Temporal Filter: %s, %d\n", |
926 | prefix, | 927 | prefix, |
927 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE), | 928 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE), |
928 | p->video_temporal_filter); | 929 | temporal); |
929 | printk(KERN_INFO "%s: Median Filter: %s, Luma [%d, %d], Chroma [%d, %d]\n", | 930 | printk(KERN_INFO "%s: Median Filter: %s, Luma [%d, %d], Chroma [%d, %d]\n", |
930 | prefix, | 931 | prefix, |
931 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE), | 932 | cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE), |