diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-08-30 18:52:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 11:30:34 -0400 |
commit | 66440ccbf2f4077ce59c9692a2c7288201ea0171 (patch) | |
tree | 55f8be86a1387813b6891e0801dde63071e4d7a2 /drivers/media | |
parent | 4fcd7d8f7b6ce0a0adb3edd6d6edcbf2fd05a02b (diff) |
V4L/DVB (4565): Fix scaling calculus
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/saa7115.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 08a324f9a48d..987f540bc161 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1053,7 +1053,7 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) | |||
1053 | int VSCY; | 1053 | int VSCY; |
1054 | int res; | 1054 | int res; |
1055 | int is_50hz = state->std & V4L2_STD_625_50; | 1055 | int is_50hz = state->std & V4L2_STD_625_50; |
1056 | int Vsrc = is_50hz ? 576 : 480; | 1056 | int Vsrc = is_50hz ? 576 : 480+16; |
1057 | 1057 | ||
1058 | v4l_dbg(1, debug, client, "decoder set size to %ix%i\n",width,height); | 1058 | v4l_dbg(1, debug, client, "decoder set size to %ix%i\n",width,height); |
1059 | 1059 | ||
@@ -1082,22 +1082,14 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) | |||
1082 | saa711x_write(client, R_CD_B_HORIZ_OUTPUT_WINDOW_LENGTH_MSB, | 1082 | saa711x_write(client, R_CD_B_HORIZ_OUTPUT_WINDOW_LENGTH_MSB, |
1083 | (u8) ((width >> 8) & 0xff)); | 1083 | (u8) ((width >> 8) & 0xff)); |
1084 | 1084 | ||
1085 | if (height == Vsrc) { | 1085 | /* Vertical Scaling uses height/2 */ |
1086 | /*FIXME: This code seems weird, however, this is how it is | 1086 | res=height/2; |
1087 | working right now. | ||
1088 | */ | ||
1089 | res=height/2; | ||
1090 | if (!is_50hz) | ||
1091 | res+=8; | ||
1092 | } else | ||
1093 | res=height; | ||
1094 | 1087 | ||
1095 | /* height */ | 1088 | /* height */ |
1096 | saa711x_write(client, R_CE_B_VERT_OUTPUT_WINDOW_LENGTH, | 1089 | saa711x_write(client, R_CE_B_VERT_OUTPUT_WINDOW_LENGTH, |
1097 | (u8) (res & 0xff)); | 1090 | (u8) (res & 0xff)); |
1098 | saa711x_write(client, R_CF_B_VERT_OUTPUT_WINDOW_LENGTH_MSB, | 1091 | saa711x_write(client, R_CF_B_VERT_OUTPUT_WINDOW_LENGTH_MSB, |
1099 | (u8) (res & 0xff)); | 1092 | (u8) ((res >> 8) & 0xff)); |
1100 | |||
1101 | 1093 | ||
1102 | /* Scaling settings */ | 1094 | /* Scaling settings */ |
1103 | /* Hprescaler is floor(inres/outres) */ | 1095 | /* Hprescaler is floor(inres/outres) */ |