This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] vivid-tpg: add hor/vert downsampling support to tpg_gen_text
Author:  Hans Verkuil <[email protected]>
Date:    Sat Mar 7 14:23:16 2015 -0300

This will just skip lines/pixels since color fidelity is not quite
as important here as it is with the test patterns themselves.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/vivid/vivid-tpg.c |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=3e14e7a82c1efdd15253a67cf5dccb84b1e9b7f1

diff --git a/drivers/media/platform/vivid/vivid-tpg.c 
b/drivers/media/platform/vivid/vivid-tpg.c
index 5b3930c..f4f0b74 100644
--- a/drivers/media/platform/vivid/vivid-tpg.c
+++ b/drivers/media/platform/vivid/vivid-tpg.c
@@ -1183,24 +1183,37 @@ void tpg_gen_text(struct tpg_data *tpg, u8 
*basep[TPG_MAX_PLANES][2],
                div = 2;
 
        for (p = 0; p < tpg->planes; p++) {
-               /* Print stream time */
+               unsigned vdiv = tpg->vdownsampling[p];
+               unsigned hdiv = tpg->hdownsampling[p];
+
+               /* Print text */
 #define PRINTSTR(PIXTYPE) do { \
        PIXTYPE fg;     \
        PIXTYPE bg;     \
        memcpy(&fg, tpg->textfg[p], sizeof(PIXTYPE));   \
        memcpy(&bg, tpg->textbg[p], sizeof(PIXTYPE));   \
        \
-       for (line = first; line < 16; line += step) {   \
+       for (line = first; line < 16; line += vdiv * step) {    \
                int l = tpg->vflip ? 15 - line : line; \
-               PIXTYPE *pos = (PIXTYPE *)(basep[p][line & 1] + \
-                              ((y * step + l) / div) * tpg->bytesperline[p] + \
-                              x * sizeof(PIXTYPE));    \
+               PIXTYPE *pos = (PIXTYPE *)(basep[p][(line / vdiv) & 1] + \
+                              ((y * step + l) / (vdiv * div)) * 
tpg->bytesperline[p] + \
+                              (x / hdiv) * sizeof(PIXTYPE));   \
                unsigned s;     \
        \
                for (s = 0; s < len; s++) {     \
                        u8 chr = font8x16[text[s] * 16 + line]; \
        \
-                       if (tpg->hflip) { \
+                       if (hdiv == 2 && tpg->hflip) { \
+                               pos[3] = (chr & (0x01 << 6) ? fg : bg); \
+                               pos[2] = (chr & (0x01 << 4) ? fg : bg); \
+                               pos[1] = (chr & (0x01 << 2) ? fg : bg); \
+                               pos[0] = (chr & (0x01 << 0) ? fg : bg); \
+                       } else if (hdiv == 2) { \
+                               pos[0] = (chr & (0x01 << 7) ? fg : bg); \
+                               pos[1] = (chr & (0x01 << 5) ? fg : bg); \
+                               pos[2] = (chr & (0x01 << 3) ? fg : bg); \
+                               pos[3] = (chr & (0x01 << 1) ? fg : bg); \
+                       } else if (tpg->hflip) { \
                                pos[7] = (chr & (0x01 << 7) ? fg : bg); \
                                pos[6] = (chr & (0x01 << 6) ? fg : bg); \
                                pos[5] = (chr & (0x01 << 5) ? fg : bg); \
@@ -1220,7 +1233,7 @@ void tpg_gen_text(struct tpg_data *tpg, u8 
*basep[TPG_MAX_PLANES][2],
                                pos[7] = (chr & (0x01 << 0) ? fg : bg); \
                        } \
        \
-                       pos += tpg->hflip ? -8 : 8;     \
+                       pos += (tpg->hflip ? -8 : 8) / hdiv;    \
                }       \
        }       \
 } while (0)

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to