enum s5p_tv_vp_err s5p_vp_init_poly_filter_coef( enum s5p_vp_poly_coeff poly_coeff, signed char ch0, signed char ch1, signed char ch2, signed char ch3) { return s5p_vp_set_poly_filter_coef(poly_coeff, ch0, ch1, ch2, ch3); }
static void s5p_vp_set_poly_filter_coef_default(u32 h_ratio, u32 v_ratio) { enum s5p_vp_filter_h_pp e_h_filter; enum s5p_vp_filter_v_pp e_v_filter; u8 *poly_flt_coeff; int i, j; VPPRINTK("%d, %d\n\r", h_ratio, v_ratio); /* * For the real interlace mode, the vertical ratio should be * used after divided by 2. Because in the interlace mode, all * the VP output is used for SDOUT display and it should be the * same as one field of the progressive mode. Therefore the same * filter coefficients should be used for the same the final * output video. When half of the interlace V_RATIO is same as * the progressive V_RATIO, the final output video scale is same. */ if (h_ratio <= (0x1 << 16)) /* 720->720 or zoom in */ e_h_filter = VP_PP_H_NORMAL; else if (h_ratio <= (0x9 << 13)) /* 720->640 */ e_h_filter = VP_PP_H_8_9; else if (h_ratio <= (0x1 << 17)) /* 2->1 */ e_h_filter = VP_PP_H_1_2; else if (h_ratio <= (0x3 << 16)) /* 2->1 */ e_h_filter = VP_PP_H_1_3; else e_h_filter = VP_PP_H_1_4; /* 4->1 */ /* Vertical Y 4tap */ if (v_ratio <= (0x1 << 16)) /* 720->720 or zoom in*/ e_v_filter = VP_PP_V_NORMAL; else if (v_ratio <= (0x5 << 14)) /* 4->3*/ e_v_filter = VP_PP_V_3_4; else if (v_ratio <= (0x3 << 15)) /*6->5*/ e_v_filter = VP_PP_V_5_6; else if (v_ratio <= (0x1 << 17)) /* 2->1*/ e_v_filter = VP_PP_V_1_2; else if (v_ratio <= (0x3 << 16)) /* 3->1*/ e_v_filter = VP_PP_V_1_3; else e_v_filter = VP_PP_V_1_4; poly_flt_coeff = (u8 *)(g_s_vp8tap_coef_y_h + e_h_filter * 16 * 8); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { s5p_vp_set_poly_filter_coef( VP_POLY8_Y0_LL + (i*4) + j, *(poly_flt_coeff + 4*j*8 + (7 - i)), *(poly_flt_coeff + (4*j + 1)*8 + (7 - i)), *(poly_flt_coeff + (4*j + 2)*8 + (7 - i)), *(poly_flt_coeff + (4*j + 3)*8 + (7 - i))); } } poly_flt_coeff = (u8 *)(g_s_vp4tap_coef_c_h + e_h_filter * 16 * 4); for (i = 0; i < 2; i++) { for (j = 0; j < 4; j++) { s5p_vp_set_poly_filter_coef( VP_POLY4_C0_LL + (i*4) + j, *(poly_flt_coeff + 4*j*4 + (3 - i)), *(poly_flt_coeff + (4*j + 1)*4 + (3 - i)), *(poly_flt_coeff + (4*j + 2)*4 + (3 - i)), *(poly_flt_coeff + (4*j + 3)*4 + (3 - i))); } } poly_flt_coeff = (u8 *)(g_s_vp4tap_coef_y_v + e_v_filter * 16 * 4); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { s5p_vp_set_poly_filter_coef( VP_POLY4_Y0_LL + (i*4) + j, *(poly_flt_coeff + 4*j*4 + (3 - i)), *(poly_flt_coeff + (4*j + 1)*4 + (3 - i)), *(poly_flt_coeff + (4*j + 2)*4 + (3 - i)), *(poly_flt_coeff + (4*j + 3)*4 + (3 - i))); } } VPPRINTK("%d, %d\n\r", e_h_filter, e_v_filter); }