Commit 12b896e4 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (4983): Force temporal filter to 0 when scaling to prevent ghosting.

Change the code to unconditionally turn off the temporal filter when scaling.
If the window is not full screen the filter will introduce a nasty ghosting
effect.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent b331def2
...@@ -742,7 +742,6 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, ...@@ -742,7 +742,6 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func,
if (old == NULL || old->width != new->width || old->height != new->height || if (old == NULL || old->width != new->width || old->height != new->height ||
old->video_encoding != new->video_encoding) { old->video_encoding != new->video_encoding) {
int is_scaling;
u16 w = new->width; u16 w = new->width;
u16 h = new->height; u16 h = new->height;
...@@ -752,20 +751,18 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, ...@@ -752,20 +751,18 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func,
} }
err = cx2341x_api(priv, func, CX2341X_ENC_SET_FRAME_SIZE, 2, h, w); err = cx2341x_api(priv, func, CX2341X_ENC_SET_FRAME_SIZE, 2, h, w);
if (err) return err; if (err) return err;
}
if (new->width != 720 || new->height != (new->is_50hz ? 576 : 480)) {
/* Adjust temporal filter if necessary. The problem with the temporal /* Adjust temporal filter if necessary. The problem with the temporal
filter is that it works well with full resolution capturing, but filter is that it works well with full resolution capturing, but
not when the capture window is scaled (the filter introduces not when the capture window is scaled (the filter introduces
a ghosting effect). So if the capture window changed, and there is a ghosting effect). So if the capture window is scaled, then
no updated filter value, then the filter is set depending on whether force the filter to 0.
the new window is full resolution or not.
For full resolution a setting of 8 really improves the video For full resolution the filter really improves the video
quality, especially if the original video quality is suboptimal. */ quality, especially if the original video quality is suboptimal. */
is_scaling = new->width != 720 || new->height != (new->is_50hz ? 576 : 480); temporal = 0;
if (old && old->video_temporal_filter == temporal) {
temporal = is_scaling ? 0 : 8;
}
} }
if (old == NULL || old->stream_type != new->stream_type) { if (old == NULL || old->stream_type != new->stream_type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment