/* function : de_calc_ovl_coord(unsigned int frame_coord, unsigned int scale_step, int gsu_sel) description : calculate overlay coordinate parameters : frame_coord <frame buffer coordinate> scale_step <vsu/gsu horizontal/vertical scale step> gsu_sel <is gsu or not: 0-is vsu, others-is gsu> return : layer_coord <layer coordinate>  */
int de_calc_ovl_coord(unsigned int frame_coord, unsigned int scale_step, int gsu_sel)
/* function : de_calc_ovl_coord(unsigned int frame_coord, unsigned int scale_step, int gsu_sel) description : calculate overlay coordinate parameters : frame_coord <frame buffer coordinate> scale_step <vsu/gsu horizontal/vertical scale step> gsu_sel <is gsu or not: 0-is vsu, others-is gsu> return : layer_coord <layer coordinate>  */
int de_calc_ovl_coord(unsigned int frame_coord, unsigned int scale_step, int gsu_sel)
{
    int shift, half, layer_coord;
    shift = (gsu_sel == 0) ?
        VSU_PHASE_FRAC_BITWIDTH : GSU_PHASE_FRAC_BITWIDTH;
    half = (1 << (shift - 1));
    layer_coord = (frame_coord * scale_step + half) >> shift;
    DE_INF("half_shift_xy=<%x,%d,%d>\n", half, shift, layer_coord);
    return layer_coord;
}