[2/3] v4l2-utils gtf: use round instead of roundown for v_lines_rnd
diff mbox

Message ID 1434446272-21256-3-git-send-email-prladdha@cisco.com
State New
Headers show

Commit Message

Prashant Laddha June 16, 2015, 9:17 a.m. UTC
GTF standards document specifies to use round() for v_lines_rnd
calculations. This change will affect only if image height is odd.

Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
---
 utils/v4l2-ctl/v4l2-ctl-modes.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

diff --git a/utils/v4l2-ctl/v4l2-ctl-modes.cpp b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
index ef528c0..d65cd75 100644
--- a/utils/v4l2-ctl/v4l2-ctl-modes.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-modes.cpp
@@ -410,7 +410,7 @@  bool calc_gtf_modeline(int image_width, int image_height,
 
 	if (interlaced) {
 		interlace = 1;
-		v_lines_rnd = v_lines / 2;
+		v_lines_rnd = (v_lines + 1) / 2;
 		v_refresh = v_refresh * 2;
 	} else {
 		interlace = 0;