⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zoom.c

📁 一个两碟控制的VCD的代码,两碟之间的转动及连续播放,已大量生产的CODE.
💻 C
📖 第 1 页 / 共 2 页
字号:
{

#ifndef BF43
    if (DISP_frame == 2 && vcx_scn_height == 288
#ifdef PLAY20
                && play_state != PLAY_STILL_STATE
                && play_state != PLAY_WAIT_TIME_STATE
                && !is_slide_show
#endif
	) {
        zoom_y_pos -= VERT_OFFSET;
        Adjust_zoom_XY(zoom_x_pos, zoom_y_pos);
        scale_half();
        Zoom_start();
	return;
    }
#endif

    if ((DISP_frame == 2 && vcx_scn_vscale !=0x10) 
	&& (zoom_y_pos >= 76 && zoom_y_pos - VERT_OFFSET<76)) {
	DO_blank();
        zoom_reset_scale(1);
	pan(zoom_x_pos, zoom_y_pos);
    } else {
        zoom_y_pos -= VERT_OFFSET;
	pan(zoom_x_pos, zoom_y_pos);
    }
}

void zoom_move_down()
{

#ifndef BF43
    if (DISP_frame == 2 && vcx_scn_height == 288
#ifdef PLAY20
                && play_state != PLAY_STILL_STATE
                && play_state != PLAY_WAIT_TIME_STATE
                && !is_slide_show
#endif
	) {
           zoom_y_pos += VERT_OFFSET;
           Adjust_zoom_XY(zoom_x_pos, zoom_y_pos);
           scale_half();
           Zoom_start();
	   return;
    }
#endif

    if ((DISP_frame == 2 && vcx_scn_vscale !=0x10) &&
        (zoom_y_pos < 76 && zoom_y_pos + VERT_OFFSET>=76)) {
	DO_blank();
        zoom_reset_scale(0);
	pan(zoom_x_pos, zoom_y_pos);
    } else {
        zoom_y_pos += VERT_OFFSET;
	pan(zoom_x_pos, zoom_y_pos);
    }
}

zoom_reset_scale(int up)
{
    int x, y;
    x = zoom_x_pos;
    if (up)
    zoom_y_pos -= VERT_OFFSET;
    else
    zoom_y_pos += VERT_OFFSET;
    y = zoom_y_pos;
    zoom_reset();
    zoom_x_pos = x;
    zoom_y_pos = y;
    zoom_level = 1;
}

#ifndef BF43
scale_half()
{
        DISP_Info *curr_dip;
	int i,j;
	extern int scale_mb_from_Y, scale_mb_from_UV,
           scale_mb_to_Y, scale_mb_to_UV,
           scale_mb_del_Y, scale_mb_del_UV,
           scale_line_del_Y, scale_line_del_UV;
	extern int scale_dy_Y, scale_dy_UV,
           scale_zY, scale_zUV;
 
        resetVscale();
        initVscale_Pointer();
        VscaleStart = 1;
        VscaleLastFrame = 0;
        curr_dip = DISP_info + H_VscaleFrame;
        i = zoom_y_pos/scale_dy_Y * 16;
        scale_mb_from_Y = i * curr_dip->wY + curr_dip->startY;
        scale_mb_from_UV = i * curr_dip->wUV +curr_dip->startU;
        curr_dip = DISP_info + H_B1FRAME;
        i=(curr_dip->height==288)?10:8;
        scale_mb_to_Y = curr_dip->startY;
        scale_mb_to_UV = i*scale_dy_Y*curr_dip->wY+curr_dip->startY;
        UV_location = scale_mb_to_UV;
        for (j = 0; j<i; j++) {
            vscale2();
        }
        resetVscale();
}
#endif

#ifdef CUST3
void zoom_center()
{
    if (!zoom_level)
	return;

    get_pic_size();

    /* zoom_level == 1 */
    zoom_x_pos = disp_width >> 2;
    /* zoom_level == 2 */
    zoom_y_pos = disp_height >> 2;
    if (zoom_level > 1) {
	zoom_x_pos += disp_width >> 3;
	zoom_y_pos += disp_height >> 3;
    }
#ifdef CUST71
    DO_blank();
    zoom_reset_scale(0);
#endif
    pan(zoom_x_pos, zoom_y_pos);
}
#endif

#if (!CUST3 || CUST71 || CUSTDVD)
void zoom_out()
{
    if (!zoom_level)
	return;
    zoom_level --;

    get_pic_size();

    if (zoom_level == 1) {
	zoom_x_pos -= disp_width >> 3;
	zoom_y_pos -= disp_height >> 3;
    }
    DO_blank();
    if (!zoom_level) {
	expect_zoom = 0;
        zoom_reset();
        if (vcx_scn_vscale != 0x10 && DISP_frame==2 && FromBtoB) {
             rescaleB();
        }
    }
    else {
        save_width1 = mvd[buscon_dma_width1] ;
        pan(zoom_x_pos, zoom_y_pos);
    }
}
#endif

pan(int x, int y)
{
    Adjust_zoom_XY(x, y);
    Zoom_start();
}

Adjust_zoom_XY(int x, int y)
{
    get_pic_size();
 
    if (x < 0) x = 0;
    if (y < 0) y = 0;
 
    {
        int width  = disp_width >> 1;
        int height = disp_height >> 1;
     
        if (zoom_level == 2) {
            width  = (width * 3) >> 1;
            height = (height * 3) >> 1;
        }
     
        if (x > width) x = width;
        if (y > height) y = height;
    }
 
    /* zoom_x_pos needs to think of compressed picture or not(3/4), so we
       must make sure each picture begin at boundary of dword */
#if 0
    zoom_x_pos = x / 12 * 12;
#else
    zoom_x_pos = x ;
#endif
    zoom_y_pos = y & 0xfffffffe;
}


void Buscon_zoom(DISP_Info *dip)
{
    int y_start, u_start, v_start;
    int full_height;
    int wY, wUV, zY, zUV;

    wY  = dip->wY;
    wUV = dip->wUV;
    y_start = dip->startY + zoom_y_offset;
    u_start = dip->startU + zoom_uv_offset;
    v_start = u_start + wUV;
    zY  = dip->zY;
    zUV = dip->zUV;
    full_height = dip->height > 288;
    if (zoom_level == 1) {
#ifdef BF43
	if (zUV < 0) zUV = 0;
	if (zY < 0) {
	  mvd[buscon_dma_deltas_ysc] = 0x200 - (wUV+1); /* y_wordsize = uv_wordsize*2-1 */
	  zY = 0;
	}
	else
#else
	if (!old_bane && mineomine) {
	    wY = 82;
	    wUV = 41;
	}
#endif
	mvd[buscon_dma_deltas_ysc] = 0x200 - ((wY + 1) >> 1);
	{
	    
	    mvd[buscon_dma_deltas_usc] = 0x200 - ((wUV + 1) >> 1);
	    mvd[buscon_dma_deltas_vsc] = 0x200 - ((wUV + 1) >> 1);
	}
	if (full_height) {
	    buscon_quick_BF(ysc, y_start, BDMA_WIDTH2, zY);
	    buscon_quick_BF(usc, u_start, BDMA_WIDTH1|BDMA_INC2, zUV);
	    buscon_quick_BF(vsc, v_start, BDMA_WIDTH1|BDMA_INC2, zUV);
	}
	else {
#ifndef BF43
        if (UV_location!=-1){
            buscon_quick_BF(ysc, Y_zoom_start, BDMA_USEDX, zY);
        }
	else
#endif
	    buscon_quick_BF(ysc, y_start, BDMA_WIDTH1 | BDMA_INC2, zY);
	    buscon_quick_BF(usc, U_zoom_start, BDMA_USEDX, zUV);
	    buscon_quick_BF(vsc, V_zoom_start, BDMA_USEDX, zUV);
	}
    }
    else  {  /* zoom_level == 2 */
	mvd[buscon_dma_deltas_ysc] = 0x200 - ((wY + 3) >> 2);
	mvd[buscon_dma_deltas_usc] = 0x200 - ((wUV + 3) >> 2);
	mvd[buscon_dma_deltas_vsc] = 0x200 - ((wUV + 3) >> 2);
	
	buscon_quick_BF(ysc, y_start, BDMA_WIDTH2|BDMA_INC2, zY);
	buscon_quick_BF(usc, U_zoom_start, BDMA_USEDX, zUV);
	buscon_quick_BF(vsc, V_zoom_start, BDMA_USEDX, zUV);
	
    }
}

/*
 * Get picture width and height
 */
void get_pic_size()
{
    DISP_Info *dip;
    extern int DISP_frame;
    
    dip = DISP_info + DISP_frame;
    if (dip->zY)
	disp_width = ((dip->wY << 2) / 3 ) << 2; 
    else
	disp_width = dip->wY << 2; 
    disp_height = dip->height;
}

DO_blank()
{
    done_blank = 0;
    do_blank ++;       /* Display a tiny screen to blank screen   */
    /*
     * We'll wait here for up to 1/60th of a second until the
     * screen is blanked out. During this period of time, I want to
     * continue my communication with DSA and the external
     * microprocessor
     */
    do {
#if (!MVD_BOARD && !PLAYONLY)
    receive_dsa();
#endif
    } while(!done_blank);
    do_blank --;       /* Don't need to blank screen any more */
}

#ifdef PLAY20
void set_zoom()
{
    if (!zoom_level) {
        zoom_in();
#ifdef CUST3
#if (CUST71 || CUSTDVD)
#ifdef CUST_BILINGUAL
    OUTOSD(FUNCTION_REGION, MSG_zoom_in, MSG_c_zoom_in, 0);
#else
	OUTOSD(FUNCTION_REGION, MSG_zoom_in, MSG_zoom_in, 0);
#endif
#else
	OUTOSD(FUNCTION_REGION, MSG_e_zoomin, MSG_c_zoom, 0);
#endif	/* CUST71 */
#endif	/* CUST3 */
    } else if (zoom_level == 1 &&
	       play_state != PLAY_STILL_STATE &&
	       vcx_user_video_stream == 0xe2) {
        /* Only for high-resulotion, we have two level zoom */
        zoom_in();
    } else  {
        zoom_reset();
#ifdef CUST3
    	OSD_clear_region(FUNCTION_REGION);
#endif
    }
#ifdef CUST3
    current_key = NO_KEY;
#endif
}
#else
/* For playonly machine */
void set_zoom()
{
}
#endif	/* else of PLAY20 */

#endif	/* ZOOM */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -