#include "scaler.h"
#include "scaler-regs.h"
-#define COEF(val_l, val_h) ((((val_h) & 0x1FF) << 16) | ((val_l) & 0x1FF))
+#define COEF(val_l, val_h) ((((val_h) & 0x7FF) << 16) | ((val_l) & 0x7FF))
extern int sc_set_blur;
-/* Scaling coefficient value */
+/* Scaling coefficient value for 10bit supporting */
static const __u32 sc_coef_8t_org[7][16][4] = {
- { /* 8:8 or zoom-in */
- {COEF( 0, 0), COEF( 0, 0), COEF(128, 0), COEF( 0, 0)},
- {COEF( 0, 1), COEF( -2, 7), COEF(127, -6), COEF( 2, -1)},
- {COEF( 0, 1), COEF( -5, 16), COEF(125, -12), COEF( 4, -1)},
- {COEF( 0, 2), COEF( -8, 25), COEF(120, -15), COEF( 5, -1)},
- {COEF(-1, 3), COEF(-10, 35), COEF(114, -18), COEF( 6, -1)},
- {COEF(-1, 4), COEF(-13, 46), COEF(107, -20), COEF( 6, -1)},
- {COEF(-1, 5), COEF(-16, 57), COEF( 99, -21), COEF( 7, -2)},
- {COEF(-1, 5), COEF(-18, 68), COEF( 89, -20), COEF( 6, -1)},
- {COEF(-1, 6), COEF(-20, 79), COEF( 79, -20), COEF( 6, -1)},
- {COEF(-1, 6), COEF(-20, 89), COEF( 68, -18), COEF( 5, -1)},
- {COEF(-2, 7), COEF(-21, 99), COEF( 57, -16), COEF( 5, -1)},
- {COEF(-1, 6), COEF(-20, 107), COEF( 46, -13), COEF( 4, -1)},
- {COEF(-1, 6), COEF(-18, 114), COEF( 35, -10), COEF( 3, -1)},
- {COEF(-1, 5), COEF(-15, 120), COEF( 25, -8), COEF( 2, 0)},
- {COEF(-1, 4), COEF(-12, 125), COEF( 16, -5), COEF( 1, 0)},
- {COEF(-1, 2), COEF( -6, 127), COEF( 7, -2), COEF( 1, 0)}
+ { /* 8:8 or Zoom-in */
+ {COEF( 0, 0), COEF( 0, 0), COEF(512, 0), COEF( 0, 0)},
+ {COEF(-1, 2), COEF( -9, 30), COEF(509, -25), COEF( 8, -2)},
+ {COEF(-1, 5), COEF(-19, 64), COEF(499, -46), COEF( 14, -4)},
+ {COEF(-2, 8), COEF(-30, 101), COEF(482, -62), COEF( 20, -5)},
+ {COEF(-3, 12), COEF(-41, 142), COEF(458, -73), COEF( 23, -6)},
+ {COEF(-3, 15), COEF(-53, 185), COEF(429, -80), COEF( 25, -6)},
+ {COEF(-4, 19), COEF(-63, 228), COEF(395, -83), COEF( 26, -6)},
+ {COEF(-5, 21), COEF(-71, 273), COEF(357, -82), COEF( 25, -6)},
+ {COEF(-5, 23), COEF(-78, 316), COEF(316, -78), COEF( 23, -5)},
+ }, { /* 8:7 Zoom-out */
+ {COEF( 0, 12), COEF(-32, 52), COEF(444, 56), COEF(-32, 12)},
+ {COEF(-3, 13), COEF(-39, 82), COEF(445, 29), COEF(-24, 9)},
+ {COEF(-3, 14), COEF(-46, 112), COEF(438, 6), COEF(-16, 7)},
+ {COEF(-3, 15), COEF(-52, 144), COEF(426, -14), COEF( -9, 5)},
+ {COEF(-3, 16), COEF(-58, 177), COEF(410, -30), COEF( -3, 3)},
+ {COEF(-3, 16), COEF(-63, 211), COEF(390, -43), COEF( 2, 2)},
+ {COEF(-2, 16), COEF(-66, 244), COEF(365, -53), COEF( 7, 1)},
+ {COEF(-2, 15), COEF(-66, 277), COEF(338, -60), COEF( 10, 0)},
+ {COEF(-1, 13), COEF(-65, 309), COEF(309, -65), COEF( 13, -1)},
+ }, { /* 8:6 or Zoom-in */
+ {COEF( 0, 8), COEF(-44, 100), COEF(384, 100), COEF(-44, 8)},
+ {COEF( 0, 8), COEF(-47, 123), COEF(382, 77), COEF(-40, 9)},
+ {COEF( 1, 7), COEF(-49, 147), COEF(377, 57), COEF(-36, 8)},
+ {COEF( 2, 5), COEF(-49, 171), COEF(369, 38), COEF(-32, 8)},
+ {COEF( 2, 3), COEF(-48, 196), COEF(358, 20), COEF(-27, 8)},
+ {COEF( 3, 1), COEF(-47, 221), COEF(344, 5), COEF(-22, 7)},
+ {COEF( 3, -2), COEF(-43, 245), COEF(329, -9), COEF(-18, 7)},
+ {COEF( 4, -5), COEF(-37, 268), COEF(310, -20), COEF(-13, 5)},
+ {COEF( 5, -9), COEF(-30, 290), COEF(290, -30), COEF( -9, 5)},
+ }, { /* 8:5 Zoom-out */
+ {COEF( 0, -3), COEF(-31, 130), COEF(320, 130), COEF(-31, -3)},
+ {COEF( 3, -6), COEF(-29, 147), COEF(319, 113), COEF(-32, -3)},
+ {COEF( 3, -8), COEF(-26, 165), COEF(315, 97), COEF(-33, -1)},
+ {COEF( 3, -11), COEF(-22, 182), COEF(311, 81), COEF(-32, 0)},
+ {COEF( 3, -13), COEF(-17, 199), COEF(304, 66), COEF(-31, 1)},
+ {COEF( 3, -16), COEF(-11, 216), COEF(296, 52), COEF(-30, 2)},
+ {COEF( 3, -18), COEF( -3, 232), COEF(286, 38), COEF(-28, 2)},
+ {COEF( 3, -21), COEF( 5, 247), COEF(274, 26), COEF(-25, 3)},
+ {COEF( 3, -23), COEF( 15, 261), COEF(261, 15), COEF(-23, 3)},
+ }, { /* 8:4 Zoom-out */
+ {COEF( 0, -12), COEF( 0, 140), COEF(255, 140), COEF( 0, -11)},
+ {COEF( 0, -13), COEF( 5, 151), COEF(254, 129), COEF( -4, -10)},
+ {COEF(-1, -14), COEF( 10, 163), COEF(253, 117), COEF( -7, -9)},
+ {COEF(-1, -15), COEF( 16, 174), COEF(250, 106), COEF(-10, -8)},
+ {COEF(-1, -16), COEF( 22, 185), COEF(246, 95), COEF(-12, -7)},
+ {COEF(-2, -16), COEF( 29, 195), COEF(241, 85), COEF(-14, -6)},
+ {COEF(-2, -17), COEF( 37, 204), COEF(236, 74), COEF(-15, -5)},
+ {COEF(-3, -17), COEF( 46, 214), COEF(229, 64), COEF(-16, -5)},
+ {COEF(-4, -17), COEF( 55, 222), COEF(222, 55), COEF(-17, -4)},
+ }, { /* 8:3 or Zoom-in */
+ {COEF( 0, -6), COEF( 31, 133), COEF(195, 133), COEF( 31, -5)},
+ {COEF(-3, -4), COEF( 37, 139), COEF(195, 126), COEF( 27, -5)},
+ {COEF(-3, -3), COEF( 41, 146), COEF(194, 119), COEF( 23, -5)},
+ {COEF(-4, -2), COEF( 47, 152), COEF(193, 112), COEF( 19, -5)},
+ {COEF(-4, -2), COEF( 53, 158), COEF(191, 105), COEF( 16, -5)},
+ {COEF(-4, 0), COEF( 59, 163), COEF(189, 98), COEF( 12, -5)},
+ {COEF(-4, 1), COEF( 65, 169), COEF(185, 91), COEF( 10, -5)},
+ {COEF(-4, 3), COEF( 71, 174), COEF(182, 84), COEF( 7, -5)},
+ {COEF(-5, 5), COEF( 78, 178), COEF(178, 78), COEF( 5, -5)},
+ }, { /* 8:2 Zoom-out */
+ {COEF( 0, 10), COEF( 52, 118), COEF(152, 118), COEF( 52, 10)},
+ {COEF( 0, 11), COEF( 56, 122), COEF(152, 114), COEF( 48, 9)},
+ {COEF( 1, 13), COEF( 60, 125), COEF(151, 110), COEF( 45, 7)},
+ {COEF( 1, 15), COEF( 64, 129), COEF(150, 106), COEF( 41, 6)},
+ {COEF( 1, 17), COEF( 68, 132), COEF(149, 102), COEF( 38, 5)},
+ {COEF( 1, 19), COEF( 72, 135), COEF(148, 98), COEF( 35, 4)},
+ {COEF( 1, 21), COEF( 77, 138), COEF(146, 94), COEF( 31, 4)},
+ {COEF( 2, 23), COEF( 81, 140), COEF(145, 89), COEF( 29, 3)},
+ {COEF( 2, 26), COEF( 85, 143), COEF(143, 85), COEF( 26, 2)},
+ }
+};
+
+static const __u32 sc_coef_4t_org[7][16][2] = {
+ { /* 8:8 or Zoom-in */
+ {COEF( 0, 0), COEF(512, 0)},
+ {COEF( -1, 20), COEF(508, -15)},
+ {COEF( -3, 45), COEF(495, -25)},
+ {COEF( -5, 75), COEF(473, -31)},
+ {COEF( -8, 110), COEF(443, -33)},
+ {COEF(-11, 148), COEF(408, -33)},
+ {COEF(-14, 190), COEF(367, -31)},
+ {COEF(-19, 234), COEF(324, -27)},
+ {COEF(-23, 279), COEF(279, -23)},
}, { /* 8:7 Zoom-out */
- {COEF( 0, 3), COEF( -8, 13), COEF(111, 14), COEF( -8, 3)},
- {COEF(-1, 3), COEF(-10, 21), COEF(112, 7), COEF( -6, 2)},
- {COEF(-1, 4), COEF(-12, 28), COEF(110, 1), COEF( -4, 2)},
- {COEF(-1, 4), COEF(-13, 36), COEF(106, -3), COEF( -2, 1)},
- {COEF(-1, 4), COEF(-15, 44), COEF(103, -7), COEF( -1, 1)},
- {COEF(-1, 4), COEF(-16, 53), COEF( 97, -11), COEF( 1, 1)},
- {COEF(-1, 4), COEF(-16, 61), COEF( 91, -13), COEF( 2, 0)},
- {COEF(-1, 4), COEF(-17, 69), COEF( 85, -15), COEF( 3, 0)},
- {COEF( 0, 3), COEF(-16, 77), COEF( 77, -16), COEF( 3, 0)},
- {COEF( 0, 3), COEF(-15, 85), COEF( 69, -17), COEF( 4, -1)},
- {COEF( 0, 2), COEF(-13, 91), COEF( 61, -16), COEF( 4, -1)},
- {COEF( 1, 1), COEF(-11, 97), COEF( 53, -16), COEF( 4, -1)},
- {COEF( 1, -1), COEF( -7, 103), COEF( 44, -15), COEF( 4, -1)},
- {COEF( 1, -2), COEF( -3, 106), COEF( 36, -13), COEF( 4, -1)},
- {COEF( 2, -4), COEF( 1, 110), COEF( 28, -12), COEF( 4, -1)},
- {COEF( 2, -6), COEF( 7, 112), COEF( 21, -10), COEF( 3, -1)}
+ {COEF( 0, 32), COEF(448, 32)},
+ {COEF( -6, 55), COEF(446, 17)},
+ {COEF( -7, 79), COEF(437, 3)},
+ {COEF( -9, 107), COEF(421, -7)},
+ {COEF(-11, 138), COEF(399, -14)},
+ {COEF(-13, 170), COEF(373, -18)},
+ {COEF(-15, 204), COEF(343, -20)},
+ {COEF(-18, 240), COEF(310, -20)},
+ {COEF(-19, 275), COEF(275, -19)},
}, { /* 8:6 Zoom-out */
- {COEF( 0, 2), COEF(-11, 25), COEF( 96, 25), COEF(-11, 2)},
- {COEF( 0, 2), COEF(-12, 31), COEF( 96, 19), COEF(-10, 2)},
- {COEF( 0, 2), COEF(-12, 37), COEF( 94, 14), COEF( -9, 2)},
- {COEF( 0, 1), COEF(-12, 43), COEF( 92, 10), COEF( -8, 2)},
- {COEF( 0, 1), COEF(-12, 49), COEF( 90, 5), COEF( -7, 2)},
- {COEF( 1, 0), COEF(-12, 55), COEF( 86, 1), COEF( -5, 2)},
- {COEF( 1, -1), COEF(-11, 61), COEF( 82, -2), COEF( -4, 2)},
- {COEF( 1, -1), COEF( -9, 67), COEF( 77, -5), COEF( -3, 1)},
- {COEF( 1, -2), COEF( -7, 72), COEF( 72, -7), COEF( -2, 1)},
- {COEF( 1, -3), COEF( -5, 77), COEF( 67, -9), COEF( -1, 1)},
- {COEF( 2, -4), COEF( -2, 82), COEF( 61, -11), COEF( -1, 1)},
- {COEF( 2, -5), COEF( 1, 86), COEF( 55, -12), COEF( 0, 1)},
- {COEF( 2, -7), COEF( 5, 90), COEF( 49, -12), COEF( 1, 0)},
- {COEF( 2, -8), COEF( 10, 92), COEF( 43, -12), COEF( 1, 0)},
- {COEF( 2, -9), COEF( 14, 94), COEF( 37, -12), COEF( 2, 0)},
- {COEF( 2, -10), COEF( 19, 96), COEF( 31, -12), COEF( 2, 0)}
+ {COEF( 0, 61), COEF(390, 61)},
+ {COEF( -7, 83), COEF(390, 46)},
+ {COEF( -8, 106), COEF(383, 31)},
+ {COEF( -8, 130), COEF(371, 19)},
+ {COEF( -9, 156), COEF(356, 9)},
+ {COEF(-10, 183), COEF(337, 2)},
+ {COEF(-10, 210), COEF(315, -3)},
+ {COEF(-10, 238), COEF(291, -7)},
+ {COEF( -9, 265), COEF(265, -9)},
}, { /* 8:5 Zoom-out */
- {COEF( 0, -1), COEF( -8, 33), COEF( 80, 33), COEF( -8, -1)},
- {COEF( 1, -2), COEF( -7, 37), COEF( 80, 28), COEF( -8, -1)},
- {COEF( 1, -2), COEF( -7, 41), COEF( 79, 24), COEF( -8, 0)},
- {COEF( 1, -3), COEF( -6, 46), COEF( 78, 20), COEF( -8, 0)},
- {COEF( 1, -3), COEF( -4, 50), COEF( 76, 16), COEF( -8, 0)},
- {COEF( 1, -4), COEF( -3, 54), COEF( 74, 13), COEF( -7, 0)},
- {COEF( 1, -5), COEF( -1, 58), COEF( 71, 10), COEF( -7, 1)},
- {COEF( 1, -5), COEF( 1, 62), COEF( 68, 6), COEF( -6, 1)},
- {COEF( 1, -6), COEF( 4, 65), COEF( 65, 4), COEF( -6, 1)},
- {COEF( 1, -6), COEF( 6, 68), COEF( 62, 1), COEF( -5, 1)},
- {COEF( 1, -7), COEF( 10, 71), COEF( 58, -1), COEF( -5, 1)},
- {COEF( 0, -7), COEF( 13, 74), COEF( 54, -3), COEF( -4, 1)},
- {COEF( 0, -8), COEF( 16, 76), COEF( 50, -4), COEF( -3, 1)},
- {COEF( 0, -8), COEF( 20, 78), COEF( 46, -6), COEF( -3, 1)},
- {COEF( 0, -8), COEF( 24, 79), COEF( 41, -7), COEF( -2, 1)},
- {COEF(-1, -8), COEF( 28, 80), COEF( 37, -7), COEF( -2, 1)}
+ {COEF( 0, 86), COEF(341, 85)},
+ {COEF( -5, 105), COEF(341, 71)},
+ {COEF( -4, 124), COEF(336, 56)},
+ {COEF( -4, 145), COEF(328, 43)},
+ {COEF( -3, 166), COEF(317, 32)},
+ {COEF( -2, 187), COEF(304, 23)},
+ {COEF( -1, 209), COEF(288, 16)},
+ {COEF( 1, 231), COEF(271, 9)},
+ {COEF( 5, 251), COEF(251, 5)},
}, { /* 8:4 Zoom-out */
- {COEF( 0, -3), COEF( 0, 35), COEF( 64, 35), COEF( 0, -3)},
- {COEF( 0, -3), COEF( 1, 38), COEF( 64, 32), COEF( -1, -3)},
- {COEF( 0, -3), COEF( 2, 41), COEF( 63, 29), COEF( -2, -2)},
- {COEF( 0, -4), COEF( 4, 43), COEF( 63, 27), COEF( -3, -2)},
- {COEF( 0, -4), COEF( 6, 46), COEF( 61, 24), COEF( -3, -2)},
- {COEF( 0, -4), COEF( 7, 49), COEF( 60, 21), COEF( -3, -2)},
- {COEF(-1, -4), COEF( 9, 51), COEF( 59, 19), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 12, 53), COEF( 57, 16), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 14, 55), COEF( 55, 14), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 16, 57), COEF( 53, 12), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 19, 59), COEF( 51, 9), COEF( -4, -1)},
- {COEF(-2, -3), COEF( 21, 60), COEF( 49, 7), COEF( -4, 0)},
- {COEF(-2, -3), COEF( 24, 61), COEF( 46, 6), COEF( -4, 0)},
- {COEF(-2, -3), COEF( 27, 63), COEF( 43, 4), COEF( -4, 0)},
- {COEF(-2, -2), COEF( 29, 63), COEF( 41, 2), COEF( -3, 0)},
- {COEF(-3, -1), COEF( 32, 64), COEF( 38, 1), COEF( -3, 0)}
+ {COEF( 0, 104), COEF(304, 104)},
+ {COEF( 1, 120), COEF(302, 89)},
+ {COEF( 2, 136), COEF(298, 76)},
+ {COEF( 3, 153), COEF(293, 63)},
+ {COEF( 5, 170), COEF(285, 52)},
+ {COEF( 7, 188), COEF(275, 42)},
+ {COEF( 10, 205), COEF(264, 33)},
+ {COEF( 14, 221), COEF(251, 26)},
+ {COEF( 20, 236), COEF(236, 20)},
}, { /* 8:3 Zoom-out */
- {COEF( 0, -1), COEF( 8, 33), COEF( 48, 33), COEF( 8, -1)},
- {COEF(-1, -1), COEF( 9, 35), COEF( 49, 31), COEF( 7, -1)},
- {COEF(-1, -1), COEF( 10, 36), COEF( 49, 30), COEF( 6, -1)},
- {COEF(-1, -1), COEF( 12, 38), COEF( 48, 28), COEF( 5, -1)},
- {COEF(-1, 0), COEF( 13, 39), COEF( 48, 26), COEF( 4, -1)},
- {COEF(-1, 0), COEF( 15, 41), COEF( 47, 24), COEF( 3, -1)},
- {COEF(-1, 0), COEF( 16, 42), COEF( 47, 23), COEF( 2, -1)},
- {COEF(-1, 1), COEF( 18, 43), COEF( 45, 21), COEF( 2, -1)},
- {COEF(-1, 1), COEF( 19, 45), COEF( 45, 19), COEF( 1, -1)},
- {COEF(-1, 2), COEF( 21, 45), COEF( 43, 18), COEF( 1, -1)},
- {COEF(-1, 2), COEF( 23, 47), COEF( 42, 16), COEF( 0, -1)},
- {COEF(-1, 3), COEF( 24, 47), COEF( 41, 15), COEF( 0, -1)},
- {COEF(-1, 4), COEF( 26, 48), COEF( 39, 13), COEF( 0, -1)},
- {COEF(-1, 5), COEF( 28, 48), COEF( 38, 12), COEF( -1, -1)},
- {COEF(-1, 6), COEF( 30, 49), COEF( 36, 10), COEF( -1, -1)},
- {COEF(-1, 7), COEF( 31, 49), COEF( 35, 9), COEF( -1, -1)}
+ {COEF( 0, 118), COEF(276, 118)},
+ {COEF( 7, 129), COEF(273, 103)},
+ {COEF( 9, 143), COEF(270, 90)},
+ {COEF( 11, 157), COEF(266, 78)},
+ {COEF( 14, 171), COEF(260, 67)},
+ {COEF( 17, 185), COEF(253, 57)},
+ {COEF( 21, 199), COEF(244, 48)},
+ {COEF( 27, 211), COEF(234, 40)},
+ {COEF( 33, 223), COEF(223, 33)},
}, { /* 8:2 Zoom-out */
- {COEF( 0, 2), COEF( 13, 30), COEF( 38, 30), COEF( 13, 2)},
- {COEF( 0, 3), COEF( 14, 30), COEF( 38, 29), COEF( 12, 2)},
- {COEF( 0, 3), COEF( 15, 31), COEF( 38, 28), COEF( 11, 2)},
- {COEF( 0, 4), COEF( 16, 32), COEF( 38, 26), COEF( 10, 2)},
- {COEF( 0, 4), COEF( 17, 33), COEF( 37, 26), COEF( 10, 1)},
- {COEF( 0, 5), COEF( 18, 34), COEF( 37, 24), COEF( 9, 1)},
- {COEF( 0, 5), COEF( 19, 34), COEF( 37, 24), COEF( 8, 1)},
- {COEF( 1, 6), COEF( 20, 35), COEF( 36, 22), COEF( 7, 1)},
- {COEF( 1, 6), COEF( 21, 36), COEF( 36, 21), COEF( 6, 1)},
- {COEF( 1, 7), COEF( 22, 36), COEF( 35, 20), COEF( 6, 1)},
- {COEF( 1, 8), COEF( 24, 37), COEF( 34, 19), COEF( 5, 0)},
- {COEF( 1, 9), COEF( 24, 37), COEF( 34, 18), COEF( 5, 0)},
- {COEF( 1, 10), COEF( 26, 37), COEF( 33, 17), COEF( 4, 0)},
- {COEF( 2, 10), COEF( 26, 38), COEF( 32, 16), COEF( 4, 0)},
- {COEF( 2, 11), COEF( 28, 38), COEF( 31, 15), COEF( 3, 0)},
- {COEF( 2, 12), COEF( 29, 38), COEF( 30, 14), COEF( 3, 0)}
- }
-};
-
-static const __u32 sc_coef_4t_org[7][16][2] = {
- { /* 8:8 or zoom-in */
- {COEF( 0, 0), COEF(128, 0)},
- {COEF( 0, 5), COEF(127, -4)},
- {COEF(-1, 11), COEF(124, -6)},
- {COEF(-1, 19), COEF(118, -8)},
- {COEF(-2, 27), COEF(111, -8)},
- {COEF(-3, 37), COEF(102, -8)},
- {COEF(-4, 48), COEF( 92, -8)},
- {COEF(-5, 59), COEF( 81, -7)},
- {COEF(-6, 70), COEF( 70, -6)},
- {COEF(-7, 81), COEF( 59, -5)},
- {COEF(-8, 92), COEF( 48, -4)},
- {COEF(-8, 102), COEF( 37, -3)},
- {COEF(-8, 111), COEF( 27, -2)},
- {COEF(-8, 118), COEF( 19, -1)},
- {COEF(-6, 124), COEF( 11, -1)},
- {COEF(-4, 127), COEF( 5, 0)}
- }, { /* 8:7 Zoom-out */
- {COEF( 0, 8), COEF(112, 8)},
- {COEF(-1, 14), COEF(111, 4)},
- {COEF(-2, 20), COEF(109, 1)},
- {COEF(-2, 27), COEF(105, -2)},
- {COEF(-3, 34), COEF(100, -3)},
- {COEF(-3, 43), COEF( 93, -5)},
- {COEF(-4, 51), COEF( 86, -5)},
- {COEF(-4, 60), COEF( 77, -5)},
- {COEF(-5, 69), COEF( 69, -5)},
- {COEF(-5, 77), COEF( 60, -4)},
- {COEF(-5, 86), COEF( 51, -4)},
- {COEF(-5, 93), COEF( 43, -3)},
- {COEF(-3, 100), COEF( 34, -3)},
- {COEF(-2, 105), COEF( 27, -2)},
- {COEF( 1, 109), COEF( 20, -2)},
- {COEF( 4, 111), COEF( 14, -1)}
- }, { /* 8:6 Zoom-out */
- {COEF( 0, 16), COEF( 96, 16)},
- {COEF(-2, 21), COEF( 97, 12)},
- {COEF(-2, 26), COEF( 96, 8)},
- {COEF(-2, 32), COEF( 93, 5)},
- {COEF(-2, 39), COEF( 89, 2)},
- {COEF(-2, 46), COEF( 84, 0)},
- {COEF(-3, 53), COEF( 79, -1)},
- {COEF(-2, 59), COEF( 73, -2)},
- {COEF(-2, 66), COEF( 66, -2)},
- {COEF(-2, 73), COEF( 59, -2)},
- {COEF(-1, 79), COEF( 53, -3)},
- {COEF( 0, 84), COEF( 46, -2)},
- {COEF( 2, 89), COEF( 39, -2)},
- {COEF( 5, 93), COEF( 32, -2)},
- {COEF( 8, 96), COEF( 26, -2)},
- {COEF(12, 97), COEF( 21, -2)}
- }, { /* 8:5 Zoom-out */
- {COEF( 0, 22), COEF( 84, 22)},
- {COEF(-1, 26), COEF( 85, 18)},
- {COEF(-1, 31), COEF( 84, 14)},
- {COEF(-1, 36), COEF( 82, 11)},
- {COEF(-1, 42), COEF( 79, 8)},
- {COEF(-1, 47), COEF( 76, 6)},
- {COEF( 0, 52), COEF( 72, 4)},
- {COEF( 0, 58), COEF( 68, 2)},
- {COEF( 1, 63), COEF( 63, 1)},
- {COEF( 2, 68), COEF( 58, 0)},
- {COEF( 4, 72), COEF( 52, 0)},
- {COEF( 6, 76), COEF( 47, -1)},
- {COEF( 8, 79), COEF( 42, -1)},
- {COEF(11, 82), COEF( 36, -1)},
- {COEF(14, 84), COEF( 31, -1)},
- {COEF(18, 85), COEF( 26, -1)}
- }, { /* 8:4 Zoom-out */
- {COEF( 0, 26), COEF( 76, 26)},
- {COEF( 0, 30), COEF( 76, 22)},
- {COEF( 0, 34), COEF( 75, 19)},
- {COEF( 1, 38), COEF( 73, 16)},
- {COEF( 1, 43), COEF( 71, 13)},
- {COEF( 2, 47), COEF( 69, 10)},
- {COEF( 3, 51), COEF( 66, 8)},
- {COEF( 4, 55), COEF( 63, 6)},
- {COEF( 5, 59), COEF( 59, 5)},
- {COEF( 6, 63), COEF( 55, 4)},
- {COEF( 8, 66), COEF( 51, 3)},
- {COEF(10, 69), COEF( 47, 2)},
- {COEF(13, 71), COEF( 43, 1)},
- {COEF(16, 73), COEF( 38, 1)},
- {COEF(19, 75), COEF( 34, 0)},
- {COEF(22, 76), COEF( 30, 0)}
- }, { /* 8:3 Zoom-out */
- {COEF( 0, 29), COEF( 70, 29)},
- {COEF( 2, 32), COEF( 68, 26)},
- {COEF( 2, 36), COEF( 67, 23)},
- {COEF( 3, 39), COEF( 66, 20)},
- {COEF( 3, 43), COEF( 65, 17)},
- {COEF( 4, 46), COEF( 63, 15)},
- {COEF( 5, 50), COEF( 61, 12)},
- {COEF( 7, 53), COEF( 58, 10)},
- {COEF( 8, 56), COEF( 56, 8)},
- {COEF(10, 58), COEF( 53, 7)},
- {COEF(12, 61), COEF( 50, 5)},
- {COEF(15, 63), COEF( 46, 4)},
- {COEF(17, 65), COEF( 43, 3)},
- {COEF(20, 66), COEF( 39, 3)},
- {COEF(23, 67), COEF( 36, 2)},
- {COEF(26, 68), COEF( 32, 2)}
- }, { /* 8:2 Zoom-out */
- {COEF( 0, 32), COEF( 64, 32)},
- {COEF( 3, 34), COEF( 63, 28)},
- {COEF( 4, 37), COEF( 62, 25)},
- {COEF( 4, 40), COEF( 62, 22)},
- {COEF( 5, 43), COEF( 61, 19)},
- {COEF( 6, 46), COEF( 59, 17)},
- {COEF( 7, 48), COEF( 58, 15)},
- {COEF( 9, 51), COEF( 55, 13)},
- {COEF(11, 53), COEF( 53, 11)},
- {COEF(13, 55), COEF( 51, 9)},
- {COEF(15, 58), COEF( 48, 7)},
- {COEF(17, 59), COEF( 46, 6)},
- {COEF(19, 61), COEF( 43, 5)},
- {COEF(22, 62), COEF( 40, 4)},
- {COEF(25, 62), COEF( 37, 4)},
- {COEF(28, 63), COEF( 34, 3)}
+ {COEF( 0, 127), COEF(258, 127)},
+ {COEF( 14, 135), COEF(252, 111)},
+ {COEF( 15, 147), COEF(250, 100)},
+ {COEF( 18, 159), COEF(247, 88)},
+ {COEF( 21, 171), COEF(242, 78)},
+ {COEF( 25, 182), COEF(237, 68)},
+ {COEF( 30, 193), COEF(230, 59)},
+ {COEF( 36, 204), COEF(222, 50)},
+ {COEF( 43, 213), COEF(213, 43)},
},
};
static const __u32 sc_coef_8t_blur1[7][16][4] = {
{ /* 8:8 or zoom-in */
- {COEF( 0, -3), COEF( 0, 35), COEF( 64, 35), COEF( 0, -3)},
- {COEF( 0, -3), COEF( 1, 38), COEF( 64, 31), COEF( -1, -2)},
- {COEF( 0, -3), COEF( 2, 41), COEF( 63, 29), COEF( -2, -2)},
- {COEF( 0, -4), COEF( 4, 44), COEF( 62, 26), COEF( -2, -2)},
- {COEF( 0, -4), COEF( 6, 46), COEF( 62, 23), COEF( -3, -2)},
- {COEF( 0, -4), COEF( 7, 49), COEF( 60, 20), COEF( -3, -1)},
- {COEF(-1, -4), COEF( 9, 52), COEF( 59, 18), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 12, 53), COEF( 57, 16), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 14, 56), COEF( 55, 13), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 12, 53), COEF( 57, 16), COEF( -4, -1)},
- {COEF(-1, -4), COEF( 9, 52), COEF( 59, 18), COEF( -4, -1)},
- {COEF( 0, -4), COEF( 7, 49), COEF( 60, 20), COEF( -3, -1)},
- {COEF( 0, -4), COEF( 6, 46), COEF( 62, 23), COEF( -3, -2)},
- {COEF( 0, -4), COEF( 4, 44), COEF( 62, 26), COEF( -2, -2)},
- {COEF( 0, -3), COEF( 2, 41), COEF( 63, 29), COEF( -2, -2)},
- {COEF( 0, -3), COEF( 1, 38), COEF( 64, 31), COEF( -1, -2)}
+ {COEF( 0, -12), COEF( 0, 140), COEF(256, 140), COEF( 0,-12)},
+ {COEF( 0, -12), COEF( 4, 152), COEF(256, 124), COEF( -4, -8)},
+ {COEF( 0, -12), COEF( 8, 164), COEF(252, 116), COEF( -8, -8)},
+ {COEF( 0, -16), COEF( 16, 176), COEF(248, 104), COEF( -8, -8)},
+ {COEF( 0, -16), COEF( 32, 184), COEF(248, 92), COEF(-12, -8)},
+ {COEF( 0, -16), COEF( 28, 196), COEF(240, 80), COEF(-12, -4)},
+ {COEF(-4, -16), COEF( 36, 208), COEF(236, 72), COEF(-16, -4)},
+ {COEF(-4, -16), COEF( 48, 212), COEF(228, 64), COEF(-16, -4)},
+ {COEF(-4, -16), COEF( 56, 224), COEF(220, 52), COEF(-16, -4)},
+ {COEF(-4, -16), COEF( 48, 212), COEF(228, 64), COEF(-16, -4)},
+ {COEF(-4, -16), COEF( 36, 208), COEF(236, 72), COEF(-16, -4)},
+ {COEF( 0, -16), COEF( 28, 196), COEF(240, 80), COEF(-12, -4)},
+ {COEF( 0, -16), COEF( 24, 184), COEF(248, 92), COEF(-12, -8)},
+ {COEF( 0, -16), COEF( 16, 176), COEF(248, 104), COEF( -8, -8)},
+ {COEF( 0, -12), COEF( 8, 164), COEF(252, 116), COEF( -8, -8)},
+ {COEF( 0, -12), COEF( 4, 152), COEF(256, 124), COEF( -4, -8)}
}, { /* 8:7 Zoom-out */
- {COEF(-1, -2), COEF( 4, 35), COEF( 56, 34), COEF( 4, -2)},
- {COEF(-1, -3), COEF( 6, 37), COEF( 56, 32), COEF( 3, -2)},
- {COEF(-1, -3), COEF( 7, 39), COEF( 56, 30), COEF( 2, -2)},
- {COEF(-1, -3), COEF( 8, 42), COEF( 55, 28), COEF( 1, -2)},
- {COEF(-1, -3), COEF( 10, 44), COEF( 54, 26), COEF( 0, -2)},
- {COEF(-1, -2), COEF( 12, 45), COEF( 53, 23), COEF( 0, -2)},
- {COEF(-1, -2), COEF( 14, 47), COEF( 52, 21), COEF( -1, -2)},
- {COEF(-1, -2), COEF( 15, 48), COEF( 51, 19), COEF( -1, -1)},
- {COEF(-1, -2), COEF( 17, 50), COEF( 50, 17), COEF( -2, -1)},
- {COEF(-1, -2), COEF( 15, 48), COEF( 51, 19), COEF( -1, -1)},
- {COEF(-1, -2), COEF( 14, 47), COEF( 52, 21), COEF( -1, -2)},
- {COEF(-1, -2), COEF( 12, 45), COEF( 53, 23), COEF( 0, -2)},
- {COEF(-1, -3), COEF( 10, 44), COEF( 54, 26), COEF( 0, -2)},
- {COEF(-1, -3), COEF( 8, 42), COEF( 55, 28), COEF( 1, -2)},
- {COEF(-1, -3), COEF( 7, 39), COEF( 56, 30), COEF( 2, -2)},
- {COEF(-1, -3), COEF( 6, 37), COEF( 56, 32), COEF( 3, -2)}
+ {COEF(-4, -8), COEF( 16, 140), COEF(224, 136), COEF( 16, -8)},
+ {COEF(-4, -12), COEF( 24, 148), COEF(224, 128), COEF( 12, -8)},
+ {COEF(-4, -12), COEF( 28, 156), COEF(224, 120), COEF( 8, -8)},
+ {COEF(-4, -12), COEF( 32, 164), COEF(220, 112), COEF( 4, -8)},
+ {COEF(-4, -12), COEF( 40, 172), COEF(216, 104), COEF( 0, -8)},
+ {COEF(-4, -8), COEF( 48, 176), COEF(212, 92), COEF( 0, -8)},
+ {COEF(-4, -8), COEF( 56, 188), COEF(208, 84), COEF( -4, -8)},
+ {COEF(-4, -8), COEF( 60, 192), COEF(204, 76), COEF( -4, -4)},
+ {COEF(-4, -8), COEF( 68, 200), COEF(200, 68), COEF( -8, -4)},
+ {COEF(-4, -8), COEF( 60, 192), COEF(204, 76), COEF( -4, -4)},
+ {COEF(-4, -8), COEF( 56, 188), COEF(208, 84), COEF( -4, -8)},
+ {COEF(-4, -8), COEF( 48, 180), COEF(212, 92), COEF( 0, -8)},
+ {COEF(-4, -12), COEF( 40, 176), COEF(216, 104), COEF( 0, -8)},
+ {COEF(-4, -12), COEF( 32, 168), COEF(220, 112), COEF( 4, -8)},
+ {COEF(-4, -12), COEF( 28, 156), COEF(224, 120), COEF( 8, -8)},
+ {COEF(-4, -12), COEF( 24, 148), COEF(224, 128), COEF( 12, -8)}
}, { /* 8:6 Zoom-out */
- {COEF( 0, -1), COEF( 8, 33), COEF( 49, 32), COEF( 8, -1)},
- {COEF(-1, -1), COEF( 9, 35), COEF( 49, 31), COEF( 7, -1)},
- {COEF(-1, -1), COEF( 11, 36), COEF( 49, 29), COEF( 6, -1)},
- {COEF(-1, -1), COEF( 12, 38), COEF( 48, 28), COEF( 5, -1)},
- {COEF(-1, 0), COEF( 12, 40), COEF( 48, 26), COEF( 4, -1)},
- {COEF(-1, 0), COEF( 15, 41), COEF( 47, 24), COEF( 3, -1)},
- {COEF(-1, 0), COEF( 17, 42), COEF( 46, 22), COEF( 3, -1)},
- {COEF(-1, 1), COEF( 18, 43), COEF( 45, 21), COEF( 2, -1)},
- {COEF(-1, 1), COEF( 20, 45), COEF( 44, 19), COEF( 1, -1)},
- {COEF(-1, 1), COEF( 18, 43), COEF( 45, 21), COEF( 2, -1)},
- {COEF(-1, 0), COEF( 17, 42), COEF( 46, 22), COEF( 3, -1)},
- {COEF(-1, 0), COEF( 15, 41), COEF( 47, 24), COEF( 3, -1)},
- {COEF(-1, 0), COEF( 12, 40), COEF( 48, 26), COEF( 4, -1)},
- {COEF(-1, -1), COEF( 12, 38), COEF( 48, 28), COEF( 5, -1)},
- {COEF(-1, -1), COEF( 11, 36), COEF( 49, 29), COEF( 6, -1)},
- {COEF(-1, -1), COEF( 9, 35), COEF( 49, 31), COEF( 7, -1)}
+ {COEF( 0, -4), COEF( 32, 132), COEF(196, 128), COEF( 32, -4)},
+ {COEF(-4, -4), COEF( 36, 140), COEF(196, 124), COEF( 28, -4)},
+ {COEF(-4, -4), COEF( 44, 144), COEF(196, 116), COEF( 24, -4)},
+ {COEF(-4, -4), COEF( 48, 152), COEF(192, 112), COEF( 20, -4)},
+ {COEF(-4, 0), COEF( 48, 160), COEF(192, 104), COEF( 16, -4)},
+ {COEF(-4, 0), COEF( 60, 164), COEF(188, 96), COEF( 12, -4)},
+ {COEF(-4, 0), COEF( 68, 168), COEF(184, 88), COEF( 12, -4)},
+ {COEF(-4, 4), COEF( 72, 172), COEF(180, 84), COEF( 8, -4)},
+ {COEF(-4, 4), COEF( 80, 180), COEF(176, 76), COEF( 4, -4)},
+ {COEF(-4, 4), COEF( 72, 172), COEF(180, 84), COEF( 8, -4)},
+ {COEF(-4, 0), COEF( 68, 168), COEF(184, 88), COEF( 12, -4)},
+ {COEF(-4, 0), COEF( 60, 164), COEF(188, 96), COEF( 12, -4)},
+ {COEF(-4, 0), COEF( 48, 160), COEF(192, 104), COEF( 16, -4)},
+ {COEF(-4, -4), COEF( 48, 152), COEF(192, 112), COEF( 20, -4)},
+ {COEF(-4, -4), COEF( 44, 144), COEF(196, 116), COEF( 24, -4)},
+ {COEF(-4, -4), COEF( 36, 140), COEF(196, 124), COEF( 28, -4)}
}, { /* 8:5 Zoom-out */
- {COEF( 0, 1), COEF( 11, 32), COEF( 42, 30), COEF( 11, 1)},
- {COEF(-1, 1), COEF( 12, 33), COEF( 43, 30), COEF( 10, 0)},
- {COEF(-1, 1), COEF( 13, 34), COEF( 43, 29), COEF( 9, 0)},
- {COEF(-1, 2), COEF( 14, 35), COEF( 43, 27), COEF( 8, 0)},
- {COEF(-1, 2), COEF( 16, 36), COEF( 42, 26), COEF( 7, 0)},
- {COEF(-1, 2), COEF( 17, 37), COEF( 42, 25), COEF( 6, 0)},
- {COEF( 0, 3), COEF( 18, 38), COEF( 41, 23), COEF( 5, 0)},
- {COEF( 0, 3), COEF( 20, 39), COEF( 40, 22), COEF( 4, 0)},
- {COEF( 0, 4), COEF( 21, 39), COEF( 40, 20), COEF( 4, 0)},
- {COEF( 0, 3), COEF( 20, 39), COEF( 40, 22), COEF( 4, 0)},
- {COEF( 0, 3), COEF( 18, 38), COEF( 41, 23), COEF( 5, 0)},
- {COEF(-1, 2), COEF( 17, 37), COEF( 42, 25), COEF( 6, 0)},
- {COEF(-1, 2), COEF( 16, 36), COEF( 42, 26), COEF( 7, 0)},
- {COEF(-1, 2), COEF( 14, 35), COEF( 43, 27), COEF( 8, 0)},
- {COEF(-1, 1), COEF( 13, 34), COEF( 43, 29), COEF( 9, 0)},
- {COEF(-1, 1), COEF( 12, 33), COEF( 43, 30), COEF( 10, 0)}
+ {COEF( 0, 4), COEF( 44, 128), COEF(168, 120), COEF( 44, 4)},
+ {COEF(-4, 4), COEF( 48, 132), COEF(172, 120), COEF( 40, 0)},
+ {COEF(-4, 4), COEF( 52, 136), COEF(172, 116), COEF( 36, 0)},
+ {COEF(-4, 8), COEF( 56, 140), COEF(172, 108), COEF( 32, 0)},
+ {COEF(-4, 8), COEF( 64, 144), COEF(168, 104), COEF( 28, 0)},
+ {COEF(-4, 8), COEF( 68, 148), COEF(168, 100), COEF( 24, 0)},
+ {COEF( 0, 12), COEF( 72, 152), COEF(164, 92), COEF( 20, 0)},
+ {COEF( 0, 12), COEF( 80, 156), COEF(160, 88), COEF( 16, 0)},
+ {COEF( 0, 16), COEF( 84, 156), COEF(160, 80), COEF( 16, 0)},
+ {COEF( 0, 12), COEF( 80, 156), COEF(160, 88), COEF( 16, 0)},
+ {COEF( 0, 12), COEF( 72, 152), COEF(164, 92), COEF( 20, 0)},
+ {COEF(-4, 8), COEF( 68, 148), COEF(168, 100), COEF( 24, 0)},
+ {COEF(-4, 8), COEF( 64, 144), COEF(168, 104), COEF( 28, 0)},
+ {COEF(-4, 8), COEF( 56, 140), COEF(172, 108), COEF( 32, 0)},
+ {COEF(-4, 4), COEF( 52, 136), COEF(172, 116), COEF( 36, 0)},
+ {COEF(-4, 4), COEF( 48, 132), COEF(172, 120), COEF( 40, 0)}
}, { /* 8:4 Zoom-out */
- {COEF( 0, 2), COEF( 13, 30), COEF( 39, 29), COEF( 13, 2)},
- {COEF( 0, 3), COEF( 14, 31), COEF( 38, 28), COEF( 12, 2)},
- {COEF( 0, 3), COEF( 15, 32), COEF( 38, 27), COEF( 11, 2)},
- {COEF( 0, 4), COEF( 16, 33), COEF( 38, 26), COEF( 10, 1)},
- {COEF( 0, 4), COEF( 17, 34), COEF( 37, 26), COEF( 9, 1)},
- {COEF( 0, 6), COEF( 18, 34), COEF( 37, 24), COEF( 8, 1)},
- {COEF( 0, 5), COEF( 19, 35), COEF( 37, 23), COEF( 8, 1)},
- {COEF( 0, 6), COEF( 21, 35), COEF( 36, 22), COEF( 7, 1)},
- {COEF( 1, 6), COEF( 22, 36), COEF( 35, 21), COEF( 6, 1)},
- {COEF( 0, 6), COEF( 21, 35), COEF( 36, 22), COEF( 7, 1)},
- {COEF( 0, 5), COEF( 19, 35), COEF( 37, 23), COEF( 8, 1)},
- {COEF( 0, 6), COEF( 18, 34), COEF( 37, 24), COEF( 8, 1)},
- {COEF( 0, 4), COEF( 17, 34), COEF( 37, 26), COEF( 9, 1)},
- {COEF( 0, 4), COEF( 16, 33), COEF( 38, 26), COEF( 10, 1)},
- {COEF( 0, 3), COEF( 15, 32), COEF( 38, 27), COEF( 11, 2)},
- {COEF( 0, 3), COEF( 14, 31), COEF( 38, 28), COEF( 12, 2)}
+ {COEF( 0, 8), COEF( 52, 120), COEF(156, 116), COEF( 52, 8)},
+ {COEF( 0, 12), COEF( 56, 124), COEF(152, 112), COEF( 48, 8)},
+ {COEF( 0, 12), COEF( 60, 128), COEF(152, 108), COEF( 44, 8)},
+ {COEF( 0, 16), COEF( 64, 132), COEF(152, 104), COEF( 40, 4)},
+ {COEF( 0, 16), COEF( 68, 136), COEF(148, 104), COEF( 36, 4)},
+ {COEF( 0, 24), COEF( 72, 136), COEF(148, 96), COEF( 32, 4)},
+ {COEF( 0, 20), COEF( 76, 140), COEF(148, 92), COEF( 32, 4)},
+ {COEF( 0, 24), COEF( 84, 140), COEF(144, 88), COEF( 28, 4)},
+ {COEF( 4, 24), COEF( 88, 144), COEF(140, 84), COEF( 24, 4)},
+ {COEF( 0, 24), COEF( 84, 140), COEF(144, 88), COEF( 28, 4)},
+ {COEF( 0, 20), COEF( 76, 140), COEF(148, 92), COEF( 32, 4)},
+ {COEF( 0, 24), COEF( 72, 136), COEF(148, 96), COEF( 32, 4)},
+ {COEF( 0, 16), COEF( 68, 136), COEF(148, 104), COEF( 36, 4)},
+ {COEF( 0, 16), COEF( 64, 132), COEF(152, 104), COEF( 40, 4)},
+ {COEF( 0, 12), COEF( 60, 128), COEF(152, 108), COEF( 44, 8)},
+ {COEF( 0, 12), COEF( 56, 124), COEF(152, 112), COEF( 48, 8)}
}, { /* 8:3 Zoom-out */
- {COEF( 0, 4), COEF( 15, 28), COEF( 35, 28), COEF( 14, 4)},
- {COEF( 1, 5), COEF( 16, 29), COEF( 34, 27), COEF( 13, 3)},
- {COEF( 1, 6), COEF( 16, 30), COEF( 34, 26), COEF( 12, 3)},
- {COEF( 1, 6), COEF( 17, 30), COEF( 34, 25), COEF( 12, 3)},
- {COEF( 1, 6), COEF( 18, 31), COEF( 34, 25), COEF( 11, 2)},
- {COEF( 1, 7), COEF( 19, 31), COEF( 34, 24), COEF( 10, 2)},
- {COEF( 2, 7), COEF( 20, 32), COEF( 33, 23), COEF( 9, 2)},
- {COEF( 2, 8), COEF( 21, 32), COEF( 33, 22), COEF( 8, 2)},
- {COEF( 2, 8), COEF( 22, 32), COEF( 33, 22), COEF( 8, 2)},
- {COEF( 2, 8), COEF( 21, 32), COEF( 33, 23), COEF( 8, 2)},
- {COEF( 2, 7), COEF( 20, 32), COEF( 33, 24), COEF( 9, 2)},
- {COEF( 1, 7), COEF( 19, 31), COEF( 34, 18), COEF( 10, 2)},
- {COEF( 1, 6), COEF( 18, 31), COEF( 34, 25), COEF( 11, 2)},
- {COEF( 1, 6), COEF( 17, 30), COEF( 34, 25), COEF( 12, 3)},
- {COEF( 1, 6), COEF( 16, 30), COEF( 34, 26), COEF( 12, 3)},
- {COEF( 1, 5), COEF( 16, 29), COEF( 34, 27), COEF( 13, 3)}
+ {COEF( 0, 16), COEF( 60, 112), COEF(140, 112), COEF( 56, 16)},
+ {COEF( 4, 20), COEF( 64, 116), COEF(136, 108), COEF( 52, 12)},
+ {COEF( 4, 24), COEF( 64, 120), COEF(136, 104), COEF( 48, 12)},
+ {COEF( 4, 24), COEF( 68, 120), COEF(136, 100), COEF( 48, 12)},
+ {COEF( 4, 24), COEF( 72, 124), COEF(136, 100), COEF( 44, 8)},
+ {COEF( 4, 28), COEF( 76, 124), COEF(136, 96), COEF( 40, 8)},
+ {COEF( 8, 28), COEF( 80, 128), COEF(132, 92), COEF( 36, 8)},
+ {COEF( 8, 32), COEF( 84, 128), COEF(132, 88), COEF( 32, 8)},
+ {COEF( 8, 32), COEF( 88, 128), COEF(132, 88), COEF( 32, 8)},
+ {COEF( 8, 32), COEF( 84, 128), COEF(132, 92), COEF( 32, 8)},
+ {COEF( 8, 28), COEF( 80, 128), COEF(132, 96), COEF( 36, 8)},
+ {COEF( 4, 28), COEF( 76, 124), COEF(136, 72), COEF( 40, 8)},
+ {COEF( 4, 24), COEF( 72, 124), COEF(136, 100), COEF( 44, 8)},
+ {COEF( 4, 24), COEF( 68, 120), COEF(136, 100), COEF( 48, 12)},
+ {COEF( 4, 24), COEF( 64, 120), COEF(136, 104), COEF( 48, 12)},
+ {COEF( 4, 20), COEF( 64, 116), COEF(136, 108), COEF( 52, 12)}
}, { /* 8:2 Zoom-out */
- {COEF( 0, 5), COEF( 16, 27), COEF( 33, 27), COEF( 15, 5)},
- {COEF( 2, 6), COEF( 16, 27), COEF( 32, 26), COEF( 14, 5)},
- {COEF( 2, 6), COEF( 17, 28), COEF( 32, 25), COEF( 13, 5)},
- {COEF( 2, 6), COEF( 18, 29), COEF( 32, 25), COEF( 12, 4)},
- {COEF( 2, 7), COEF( 19, 29), COEF( 31, 24), COEF( 12, 4)},
- {COEF( 2, 8), COEF( 20, 30), COEF( 31, 23), COEF( 11, 3)},
- {COEF( 2, 8), COEF( 20, 30), COEF( 31, 23), COEF( 11, 3)},
- {COEF( 2, 9), COEF( 21, 30), COEF( 31, 22), COEF( 10, 3)},
- {COEF( 3, 10), COEF( 22, 31), COEF( 30, 21), COEF( 9, 2)},
- {COEF( 2, 9), COEF( 21, 30), COEF( 31, 22), COEF( 10, 3)},
- {COEF( 2, 8), COEF( 20, 30), COEF( 31, 23), COEF( 11, 3)},
- {COEF( 2, 8), COEF( 20, 30), COEF( 31, 23), COEF( 11, 3)},
- {COEF( 2, 7), COEF( 19, 29), COEF( 31, 24), COEF( 12, 4)},
- {COEF( 2, 6), COEF( 18, 29), COEF( 32, 25), COEF( 12, 4)},
- {COEF( 2, 6), COEF( 17, 28), COEF( 32, 25), COEF( 13, 5)},
- {COEF( 2, 6), COEF( 16, 27), COEF( 32, 26), COEF( 14, 5)}
+ {COEF( 0, 20), COEF( 64, 108), COEF(132, 108), COEF( 60, 20)},
+ {COEF( 8, 24), COEF( 64, 108), COEF(128, 104), COEF( 56, 20)},
+ {COEF( 8, 24), COEF( 68, 112), COEF(128, 100), COEF( 52, 20)},
+ {COEF( 8, 24), COEF( 72, 116), COEF(128, 100), COEF( 48, 16)},
+ {COEF( 8, 28), COEF( 76, 116), COEF(124, 96), COEF( 48, 16)},
+ {COEF( 8, 32), COEF( 80, 120), COEF(124, 92), COEF( 44, 12)},
+ {COEF( 8, 32), COEF( 80, 120), COEF(124, 92), COEF( 44, 12)},
+ {COEF( 8, 36), COEF( 84, 120), COEF(124, 88), COEF( 40, 12)},
+ {COEF(12, 40), COEF( 88, 124), COEF(120, 84), COEF( 36, 8)},
+ {COEF( 8, 36), COEF( 84, 120), COEF(124, 88), COEF( 40, 12)},
+ {COEF( 8, 32), COEF( 80, 120), COEF(124, 92), COEF( 44, 12)},
+ {COEF( 8, 32), COEF( 80, 120), COEF(124, 92), COEF( 44, 12)},
+ {COEF( 8, 28), COEF( 76, 116), COEF(124, 96), COEF( 48, 16)},
+ {COEF( 8, 24), COEF( 72, 116), COEF(128, 100), COEF( 48, 16)},
+ {COEF( 8, 24), COEF( 68, 112), COEF(128, 100), COEF( 52, 20)},
+ {COEF( 8, 24), COEF( 64, 108), COEF(128, 100), COEF( 56, 20)}
}
};
static const __u32 sc_coef_4t_blur1[7][16][2] = {
{ /* 8:8 or zoom-in */
- {COEF( 0, 27), COEF( 76, 25)},
- {COEF( 0, 31), COEF( 76, 21)},
- {COEF( 0, 35), COEF( 75, 18)},
- {COEF( 1, 39), COEF( 73, 15)},
- {COEF( 1, 44), COEF( 71, 12)},
- {COEF( 2, 48), COEF( 69, 9)},
- {COEF( 3, 53), COEF( 65, 7)},
- {COEF( 4, 57), COEF( 61, 6)},
- {COEF( 5, 61), COEF( 58, 4)},
- {COEF( 6, 61), COEF( 57, 4)},
- {COEF( 7, 65), COEF( 53, 3)},
- {COEF( 9, 69), COEF( 48, 2)},
- {COEF(12, 71), COEF( 44, 1)},
- {COEF(15, 73), COEF( 39, 1)},
- {COEF(18, 75), COEF( 35, 0)},
- {COEF(21, 76), COEF( 31, 0)}
+ {COEF( 0, 108), COEF(304, 100)},
+ {COEF( 0, 124), COEF(304, 84)},
+ {COEF( 0, 140), COEF(300, 72)},
+ {COEF( 4, 156), COEF(292, 60)},
+ {COEF( 4, 176), COEF(284, 48)},
+ {COEF( 8, 192), COEF(276, 36)},
+ {COEF( 12, 212), COEF(260, 28)},
+ {COEF( 16, 228), COEF(244, 24)},
+ {COEF( 20, 244), COEF(232, 16)},
+ {COEF( 24, 244), COEF(228, 16)},
+ {COEF( 28, 260), COEF(212, 12)},
+ {COEF( 36, 276), COEF(192, 8)},
+ {COEF( 48, 284), COEF(176, 4)},
+ {COEF( 60, 292), COEF(156, 4)},
+ {COEF( 72, 300), COEF(140, 0)},
+ {COEF( 84, 304), COEF(124, 0)}
}, { /* 8:7 Zoom-out */
- {COEF( 0, 29), COEF( 73, 26)},
- {COEF( 1, 32), COEF( 72, 23)},
- {COEF( 1, 36), COEF( 72, 19)},
- {COEF( 2, 40), COEF( 70, 16)},
- {COEF( 2, 44), COEF( 68, 14)},
- {COEF( 3, 48), COEF( 66, 11)},
- {COEF( 4, 52), COEF( 63, 9)},
- {COEF( 5, 56), COEF( 60, 7)},
- {COEF( 7, 58), COEF( 57, 6)},
- {COEF( 7, 60), COEF( 56, 5)},
- {COEF( 9, 63), COEF( 52, 4)},
- {COEF(11, 66), COEF( 48, 3)},
- {COEF(14, 68), COEF( 44, 2)},
- {COEF(16, 70), COEF( 40, 2)},
- {COEF(19, 72), COEF( 36, 1)},
- {COEF(23, 72), COEF( 32, 1)}
+ {COEF( 0, 116), COEF(292, 104)},
+ {COEF( 4, 128), COEF(288, 92)},
+ {COEF( 4, 144), COEF(288, 76)},
+ {COEF( 8, 160), COEF(280, 64)},
+ {COEF( 8, 176), COEF(272, 56)},
+ {COEF( 12, 192), COEF(264, 44)},
+ {COEF( 16, 208), COEF(252, 36)},
+ {COEF( 20, 224), COEF(240, 28)},
+ {COEF( 28, 232), COEF(228, 24)},
+ {COEF( 28, 240), COEF(224, 20)},
+ {COEF( 36, 252), COEF(208, 16)},
+ {COEF( 44, 264), COEF(192, 12)},
+ {COEF( 56, 272), COEF(176, 8)},
+ {COEF( 64, 280), COEF(160, 8)},
+ {COEF( 76, 288), COEF(144, 4)},
+ {COEF( 92, 288), COEF(128, 4)}
}, { /* 8:6 Zoom-out */
- {COEF( 0, 30), COEF( 69, 29)},
- {COEF( 2, 33), COEF( 69, 24)},
- {COEF( 2, 37), COEF( 68, 21)},
- {COEF( 3, 41), COEF( 66, 18)},
- {COEF( 3, 44), COEF( 65, 16)},
- {COEF( 4, 48), COEF( 63, 13)},
- {COEF( 5, 51), COEF( 61, 11)},
- {COEF( 7, 54), COEF( 58, 9)},
- {COEF( 8, 58), COEF( 55, 7)},
- {COEF( 9, 58), COEF( 54, 7)},
- {COEF(11, 61), COEF( 51, 5)},
- {COEF(13, 63), COEF( 48, 4)},
- {COEF(16, 65), COEF( 44, 3)},
- {COEF(18, 66), COEF( 41, 3)},
- {COEF(21, 68), COEF( 37, 2)},
- {COEF(24, 69), COEF( 33, 2)}
+ {COEF( 0, 120), COEF(276, 116)},
+ {COEF( 8, 132), COEF(276, 96)},
+ {COEF( 8, 148), COEF(272, 84)},
+ {COEF( 12, 164), COEF(264, 72)},
+ {COEF( 12, 176), COEF(260, 64)},
+ {COEF( 16, 192), COEF(252, 52)},
+ {COEF( 20, 204), COEF(244, 44)},
+ {COEF( 28, 216), COEF(232, 36)},
+ {COEF( 32, 232), COEF(220, 28)},
+ {COEF( 36, 232), COEF(216, 28)},
+ {COEF( 44, 244), COEF(204, 20)},
+ {COEF( 52, 252), COEF(192, 16)},
+ {COEF( 64, 260), COEF(176, 12)},
+ {COEF( 72, 264), COEF(164, 12)},
+ {COEF( 84, 272), COEF(148, 8)},
+ {COEF( 96, 276), COEF(132, 8)}
}, { /* 8:5 Zoom-out */
- {COEF( 0, 32), COEF( 66, 30)},
- {COEF( 3, 34), COEF( 66, 25)},
- {COEF( 3, 38), COEF( 65, 22)},
- {COEF( 4, 41), COEF( 64, 19)},
- {COEF( 4, 44), COEF( 63, 17)},
- {COEF( 5, 48), COEF( 61, 14)},
- {COEF( 7, 50), COEF( 59, 12)},
- {COEF( 8, 54), COEF( 56, 10)},
- {COEF(10, 56), COEF( 54, 8)},
- {COEF(10, 56), COEF( 54, 8)},
- {COEF(12, 59), COEF( 50, 7)},
- {COEF(14, 61), COEF( 48, 5)},
- {COEF(17, 63), COEF( 44, 4)},
- {COEF(19, 64), COEF( 41, 4)},
- {COEF(22, 65), COEF( 38, 3)},
- {COEF(25, 66), COEF( 34, 3)}
+ {COEF( 0, 128), COEF(264, 120)},
+ {COEF( 12, 136), COEF(264, 100)},
+ {COEF( 12, 152), COEF(260, 88)},
+ {COEF( 16, 164), COEF(256, 76)},
+ {COEF( 16, 176), COEF(252, 68)},
+ {COEF( 20, 192), COEF(244, 56)},
+ {COEF( 28, 200), COEF(236, 48)},
+ {COEF( 32, 216), COEF(224, 50)},
+ {COEF( 40, 224), COEF(216, 32)},
+ {COEF( 40, 224), COEF(216, 32)},
+ {COEF( 48, 236), COEF(200, 28)},
+ {COEF( 56, 244), COEF(192, 20)},
+ {COEF( 68, 252), COEF(176, 16)},
+ {COEF( 76, 256), COEF(164, 16)},
+ {COEF( 88, 260), COEF(152, 12)},
+ {COEF(100, 264), COEF(136, 12)}
}, { /* 8:4 Zoom-out */
- {COEF( 0, 34), COEF( 64, 30)},
- {COEF( 3, 35), COEF( 64, 26)},
- {COEF( 4, 38), COEF( 63, 23)},
- {COEF( 4, 41), COEF( 62, 21)},
- {COEF( 5, 44), COEF( 61, 18)},
- {COEF( 6, 47), COEF( 60, 15)},
- {COEF( 8, 50), COEF( 57, 13)},
- {COEF( 9, 53), COEF( 55, 11)},
- {COEF(11, 55), COEF( 53, 9)},
- {COEF(13, 50), COEF( 57, 8)},
- {COEF(13, 57), COEF( 50, 8)},
- {COEF(15, 60), COEF( 47, 6)},
- {COEF(18, 61), COEF( 44, 5)},
- {COEF(21, 62), COEF( 41, 4)},
- {COEF(23, 63), COEF( 38, 4)},
- {COEF(26, 64), COEF( 35, 3)}
+ {COEF( 0, 136), COEF(256, 120)},
+ {COEF( 12, 140), COEF(256, 104)},
+ {COEF( 16, 152), COEF(252, 92)},
+ {COEF( 16, 164), COEF(248, 84)},
+ {COEF( 20, 176), COEF(244, 72)},
+ {COEF( 24, 188), COEF(240, 60)},
+ {COEF( 32, 200), COEF(228, 52)},
+ {COEF( 36, 212), COEF(220, 44)},
+ {COEF( 44, 220), COEF(212, 36)},
+ {COEF( 52, 200), COEF(228, 32)},
+ {COEF( 52, 228), COEF(200, 32)},
+ {COEF( 60, 240), COEF(188, 24)},
+ {COEF( 72, 244), COEF(176, 20)},
+ {COEF( 84, 248), COEF(164, 16)},
+ {COEF( 92, 252), COEF(152, 16)},
+ {COEF(104, 256), COEF(140, 12)}
}, { /* 8:3 Zoom-out */
- {COEF( 0, 32), COEF( 62, 32)},
- {COEF( 4, 35), COEF( 62, 27)},
- {COEF( 4, 38), COEF( 61, 25)},
- {COEF( 5, 41), COEF( 60, 22)},
- {COEF( 6, 44), COEF( 59, 19)},
- {COEF( 7, 47), COEF( 58, 16)},
- {COEF( 9, 49), COEF( 56, 14)},
- {COEF(10, 52), COEF( 54, 12)},
- {COEF(12, 54), COEF( 52, 10)},
- {COEF(12, 54), COEF( 52, 10)},
- {COEF(14, 56), COEF( 49, 9)},
- {COEF(16, 58), COEF( 47, 7)},
- {COEF(19, 59), COEF( 44, 6)},
- {COEF(22, 60), COEF( 41, 5)},
- {COEF(25, 61), COEF( 38, 4)},
- {COEF(27, 62), COEF( 35, 4)}
+ {COEF( 0, 128), COEF(248, 128)},
+ {COEF( 16, 140), COEF(248, 108)},
+ {COEF( 16, 152), COEF(244, 100)},
+ {COEF( 20, 164), COEF(240, 88)},
+ {COEF( 24, 176), COEF(236, 76)},
+ {COEF( 28, 188), COEF(232, 64)},
+ {COEF( 36, 196), COEF(224, 56)},
+ {COEF( 40, 208), COEF(216, 48)},
+ {COEF( 48, 216), COEF(208, 40)},
+ {COEF( 48, 216), COEF(208, 40)},
+ {COEF( 56, 224), COEF(196, 36)},
+ {COEF( 64, 232), COEF(188, 28)},
+ {COEF( 76, 236), COEF(176, 24)},
+ {COEF( 88, 240), COEF(164, 20)},
+ {COEF(100, 244), COEF(152, 16)},
+ {COEF(108, 248), COEF(140, 16)}
}, { /* 8:2 Zoom-out */
- {COEF( 2, 33), COEF( 61, 32)},
- {COEF( 5, 36), COEF( 61, 26)},
- {COEF( 5, 38), COEF( 60, 25)},
- {COEF( 6, 41), COEF( 59, 22)},
- {COEF( 7, 44), COEF( 58, 19)},
- {COEF( 8, 46), COEF( 57, 17)},
- {COEF( 9, 49), COEF( 55, 15)},
- {COEF(11, 51), COEF( 53, 13)},
- {COEF(13, 53), COEF( 51, 11)},
- {COEF(13, 53), COEF( 51, 11)},
- {COEF(15, 55), COEF( 49, 9)},
- {COEF(17, 57), COEF( 46, 8)},
- {COEF(19, 58), COEF( 44, 7)},
- {COEF(22, 59), COEF( 41, 6)},
- {COEF(25, 60), COEF( 38, 5)},
- {COEF(26, 61), COEF( 36, 5)}
+ {COEF( 8, 132), COEF(244, 128)},
+ {COEF( 20, 144), COEF(244, 104)},
+ {COEF( 20, 152), COEF(240, 100)},
+ {COEF( 24, 164), COEF(236, 88)},
+ {COEF( 28, 176), COEF(232, 76)},
+ {COEF( 32, 184), COEF(228, 68)},
+ {COEF( 36, 196), COEF(220, 60)},
+ {COEF( 44, 204), COEF(212, 52)},
+ {COEF( 52, 212), COEF(204, 44)},
+ {COEF( 52, 212), COEF(204, 44)},
+ {COEF( 60, 220), COEF(196, 36)},
+ {COEF( 68, 228), COEF(184, 32)},
+ {COEF( 76, 232), COEF(176, 28)},
+ {COEF( 88, 236), COEF(164, 24)},
+ {COEF(100, 240), COEF(152, 20)},
+ {COEF(104, 244), COEF(144, 20)}
},
};
static struct sc_csc_tab sc_y2r = {
/* REC.601 Narrow */
- { 0x254, 0x000, 0x331, 0x254, 0xF38, 0xE60, 0x254, 0x409, 0x000 },
+ { 0x0254, 0x0000, 0x0331, 0x0254, 0xFF37, 0xFE60, 0x0254, 0x0409, 0x0000 },
/* REC.601 Wide */
- { 0x200, 0x000, 0x2BE, 0x200, 0xF54, 0xE9B, 0x200, 0x377, 0x000 },
+ { 0x0200, 0x0000, 0x02BE, 0x0200, 0xFF54, 0xFE9B, 0x0200, 0x0377, 0x0000 },
/* REC.709 Narrow */
- { 0x254, 0x000, 0x396, 0x254, 0xF93, 0xEEF, 0x254, 0x43B, 0x000 },
+ { 0x0254, 0x0000, 0x0396, 0x0254, 0xFF93, 0xFEEF, 0x0254, 0x043A, 0x0000 },
/* REC.709 Wide */
- { 0x200, 0x000, 0x314, 0x200, 0xFA2, 0xF15, 0x200, 0x3A2, 0x000 },
+ { 0x0200, 0x0000, 0x0314, 0x0200, 0xFFA2, 0xFF16, 0x0200, 0x03A1, 0x0000 },
/* BT.2020 Narrow */
- { 0x254, 0x000, 0x36F, 0x254, 0xF9E, 0xEAC, 0x254, 0x461, 0x000 },
+ { 0x0254, 0x0000, 0x035B, 0x0254, 0xFFA0, 0xFEB3, 0x0254, 0x0449, 0x0000 },
/* BT.2020 Wide */
- { 0x200, 0x000, 0x2F3, 0x200, 0xFAC, 0xEDB, 0x200, 0x3C3, 0x000 },
+ { 0x0200, 0x0000, 0x02E2, 0x0200, 0xFFAE, 0xFEE2, 0x0200, 0x03AE, 0x0000 },
};
static struct sc_csc_tab sc_r2y = {
/* REC.601 Narrow */
- { 0x084, 0x102, 0x032, 0xFB4, 0xF6B, 0x0E1, 0x0E1, 0xF44, 0xFDC },
+ { 0x0083, 0x0102, 0x0032, 0xFFB4, 0xFF6B, 0x00E1, 0x00E1, 0xFF44, 0xFFDB },
/* REC.601 Wide */
- { 0x099, 0x12D, 0x03A, 0xFA8, 0xF52, 0x106, 0x106, 0xF25, 0xFD6 },
+ { 0x0099, 0x012D, 0x003A, 0xFFA8, 0xFF53, 0x0106, 0x0106, 0xFF25, 0xFFD5 },
/* REC.709 Narrow */
- { 0x05E, 0x13A, 0x020, 0xFCC, 0xF53, 0x0E1, 0x0E1, 0xF34, 0xFEC },
+ { 0x005D, 0x013A, 0x0020, 0xFFCC, 0xFF53, 0x00E1, 0x00E1, 0xFF34, 0xFFEB },
/* REC.709 Wide */
- { 0x06D, 0x16E, 0x025, 0xFC4, 0xF36, 0x106, 0x106, 0xF12, 0xFE8 },
- /* TODO: BT.2020 Narrow */
- { 0x087, 0x15B, 0x01E, 0xFB9, 0xF47, 0x100, 0x100, 0xF15, 0xFEB },
+ { 0x006D, 0x016E, 0x0025, 0xFFC4, 0xFF36, 0x0106, 0x0106, 0xFF12, 0xFFE8 },
+ /* BT.2020 Narrow */
+ { 0x0074, 0x012A, 0x001A, 0xFFC1, 0xFF5E, 0x00E1, 0x00E1, 0xFF31, 0xFFEE },
/* BT.2020 Wide */
- { 0x087, 0x15B, 0x01E, 0xFB9, 0xF47, 0x100, 0x100, 0xF15, 0xFEB },
+ { 0x0087, 0x015B, 0x001E, 0xFFB7, 0xFF43, 0x0106, 0x0106, 0xFF0F, 0xFFEB },
};
static struct sc_csc_tab *sc_csc_list[] = {
return filter;
}
+static u32 sc_coef_adjust(u32 val)
+{
+ /*
+ * Truncate LSB 2 bit of two 11 bit value like below.
+ * [26:16] -> [24:16], [10:0] -> [8:0]
+ *
+ * If val has 0x01BC0038, for example, it will return 0x006F000E.
+ */
+ return ((val >> 2) & 0x1ff01ff);
+}
+
+#define sc_coef_adj(x, val) (unlikely(x) ? sc_coef_adjust(val) : val)
void sc_hwset_polyphase_hcoef(struct sc_dev *sc,
unsigned int yratio, unsigned int cratio,
unsigned int filter)
unsigned int yfilter = sc_get_scale_filter(yratio);
unsigned int cfilter = sc_get_scale_filter(cratio);
const __u32 (*sc_coef_8t)[16][4] = sc_coef_8t_org;
+ bool bit_adj = !sc->variant->pixfmt_10bit;
if (sc_set_blur || filter == SC_FT_BLUR)
sc_coef_8t = sc_coef_8t_blur1;
BUILD_BUG_ON(ARRAY_SIZE(sc_coef_8t_org[cfilter]) < 9);
for (phase = 0; phase < 9; phase++) {
- __raw_writel(sc_coef_8t[yfilter][phase][3],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[yfilter][phase][3]),
sc->regs + SCALER_YHCOEF + phase * 16);
- __raw_writel(sc_coef_8t[yfilter][phase][2],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[yfilter][phase][2]),
sc->regs + SCALER_YHCOEF + phase * 16 + 4);
- __raw_writel(sc_coef_8t[yfilter][phase][1],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[yfilter][phase][1]),
sc->regs + SCALER_YHCOEF + phase * 16 + 8);
- __raw_writel(sc_coef_8t[yfilter][phase][0],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[yfilter][phase][0]),
sc->regs + SCALER_YHCOEF + phase * 16 + 12);
}
for (phase = 0; phase < 9; phase++) {
- __raw_writel(sc_coef_8t[cfilter][phase][3],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[cfilter][phase][3]),
sc->regs + SCALER_CHCOEF + phase * 16);
- __raw_writel(sc_coef_8t[cfilter][phase][2],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[cfilter][phase][2]),
sc->regs + SCALER_CHCOEF + phase * 16 + 4);
- __raw_writel(sc_coef_8t[cfilter][phase][1],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[cfilter][phase][1]),
sc->regs + SCALER_CHCOEF + phase * 16 + 8);
- __raw_writel(sc_coef_8t[cfilter][phase][0],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_8t[cfilter][phase][0]),
sc->regs + SCALER_CHCOEF + phase * 16 + 12);
}
}
unsigned int yfilter = sc_get_scale_filter(yratio);
unsigned int cfilter = sc_get_scale_filter(cratio);
const __u32 (*sc_coef_4t)[16][2] = sc_coef_4t_org;
+ bool bit_adj = !sc->variant->pixfmt_10bit;
if (sc_set_blur || filter == SC_FT_BLUR)
sc_coef_4t = sc_coef_4t_blur1;
/* reset value of the coefficient registers are the 8:8 table */
for (phase = 0; phase < 9; phase++) {
- __raw_writel(sc_coef_4t[yfilter][phase][1],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[yfilter][phase][1]),
sc->regs + SCALER_YVCOEF + phase * 8);
- __raw_writel(sc_coef_4t[yfilter][phase][0],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[yfilter][phase][0]),
sc->regs + SCALER_YVCOEF + phase * 8 + 4);
}
for (phase = 0; phase < 9; phase++) {
- __raw_writel(sc_coef_4t[cfilter][phase][1],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[cfilter][phase][1]),
sc->regs + SCALER_CVCOEF + phase * 8);
- __raw_writel(sc_coef_4t[cfilter][phase][0],
+ __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[cfilter][phase][0]),
sc->regs + SCALER_CVCOEF + phase * 8 + 4);
}
}