Commit 66440ccb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (4565): Fix scaling calculus

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 4fcd7d8f
...@@ -1053,7 +1053,7 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) ...@@ -1053,7 +1053,7 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height)
int VSCY; int VSCY;
int res; int res;
int is_50hz = state->std & V4L2_STD_625_50; int is_50hz = state->std & V4L2_STD_625_50;
int Vsrc = is_50hz ? 576 : 480; int Vsrc = is_50hz ? 576 : 480+16;
v4l_dbg(1, debug, client, "decoder set size to %ix%i\n",width,height); v4l_dbg(1, debug, client, "decoder set size to %ix%i\n",width,height);
...@@ -1082,22 +1082,14 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) ...@@ -1082,22 +1082,14 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height)
saa711x_write(client, R_CD_B_HORIZ_OUTPUT_WINDOW_LENGTH_MSB, saa711x_write(client, R_CD_B_HORIZ_OUTPUT_WINDOW_LENGTH_MSB,
(u8) ((width >> 8) & 0xff)); (u8) ((width >> 8) & 0xff));
if (height == Vsrc) { /* Vertical Scaling uses height/2 */
/*FIXME: This code seems weird, however, this is how it is
working right now.
*/
res=height/2; res=height/2;
if (!is_50hz)
res+=8;
} else
res=height;
/* height */ /* height */
saa711x_write(client, R_CE_B_VERT_OUTPUT_WINDOW_LENGTH, saa711x_write(client, R_CE_B_VERT_OUTPUT_WINDOW_LENGTH,
(u8) (res & 0xff)); (u8) (res & 0xff));
saa711x_write(client, R_CF_B_VERT_OUTPUT_WINDOW_LENGTH_MSB, saa711x_write(client, R_CF_B_VERT_OUTPUT_WINDOW_LENGTH_MSB,
(u8) (res & 0xff)); (u8) ((res >> 8) & 0xff));
/* Scaling settings */ /* Scaling settings */
/* Hprescaler is floor(inres/outres) */ /* Hprescaler is floor(inres/outres) */
......
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