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

📄 vpp.c

📁 代码有点长,需细心阅读,仅供影音视听类产品的开发人员参考
💻 C
📖 第 1 页 / 共 2 页
字号:
    regs0->gpio_sel |= 0x80; //Set Pin49 to GPIO8.
    GPIO_M_SET(8,1);
    GPIO_E_SET(8,1);
    GPIO_O_SET(8,1);         //set GPIO8 to High. 
#endif
////#endif
#endif
	
#if 0
    UINT32  v_filter_mode;
    UINT16  h_filter_mode;

    int     zoomX;
    int     zoomY;
    int     zoomX_start;
    int     zoomY_start;
    int     zoomX_pic_start;
    int     zoomY_pic_start;
    int     zoomX_size;
    int     zoomY_size;
    int     total;
    int     decode_type;
#endif
    /*
     ** Decide expansion factor zoomX zoomY
     **
     ** if (vpp_zoom)
     **   use vpp_zoom to scale it
     ** else
     **   use decision rule to do it
     */
    zoomX = 1;
    zoomY = 1;

    if(vpp_zoom)
    {
        //if (width<=360)
        //#if 1 //old
        //  if (vpp_zoom ==1)
        //      zoomX = zoomY = 2;
        //  else
        //      zoomX = zoomY = (vpp_zoom<4) ? (vpp_zoom+1) : 4;
        //#endif
        //  zoomX = zoomY =  vpp_zoom;
        //else
        zoomX = zoomY = (vpp_zoom < 4) ? vpp_zoom : 4;
    }
#if 0
    else if(IsVPPAutoExpansion())
    {
        if(height <= 72)
            zoomY = ZOOM_Y_x8;
        else if(height <= 144)
            zoomY = ZOOM_Y_x4;
        else if(height <= 288)
            zoomY = ZOOM_Y_x2;
        else
            zoomY = ZOOM_Y_x1;

        if(width <= 90)
            zoomX = ZOOM_X_x8;
        else if(width <= 180)
            zoomX = ZOOM_X_x4;
        else if(width <= 360)
            zoomX = ZOOM_X_x2;
        else if(width <= 480)
            zoomX = ZOOM_X_x3_2;                                        /*--*/
        else
            zoomX = ZOOM_X_x1;

        if(IsVPPKeepAspectRatio())
        {
            if(zoomX == ZOOM_X_x3_2)
                zoomY = ZOOM_Y_x1;
            else
            {
                if(zoomY > zoomX)
                    zoomY = zoomX;
                else
                    zoomX = zoomY;
            }
        }
    }
#endif
    //psprintf(linebuf,"zoomX:%x zoomY:%x\n",zoomX,zoomY);
    //epp_write_slow(linebuf);

    /*
     ** Decide display start (default: from TV pixel 0 line 0)
     */
    zoomX_start = 0;
    zoomY_start = 0;
    if(IsVPPKeepCentered())
    {
        zoomX_start = (TV_WIDTH - width) >> 1;
        zoomY_start = (TV_HEIGHT - height) >> 1;
    }

    if(zoomX == ZOOM_X_x2)
        zoomX_start >>= 1;
    else if(zoomX == ZOOM_X_x4)
        zoomX_start >>= 2;
    else if(zoomX == ZOOM_X_x8)
        zoomX_start >>= 3;

    if(zoomY == ZOOM_Y_x2)
        zoomY_start >>= 1;
    else if(zoomY == ZOOM_Y_x4)
        zoomY_start >>= 2;
    else if(zoomY == ZOOM_Y_x8)
        zoomY_start >>= 3;
    //psprintf(linebuf,"ZX_start:%04dZY_start:%04d\n",zoomX_start,zoom//Y_start);
    //epp_write_slow(linebuf);

    /*
     ** decide display offset (default: from PIC pixel 0 line 0)
     */
    zoomX_pic_start = 0;
    zoomY_pic_start = 0;
    if(vpp_zoom)
    {
        zoomX_pic_start = vpp_zoom_x;
        zoomY_pic_start = vpp_zoom_y;
    }
    if(zoomX_pic_start < 0)
        zoomX_pic_start = 0;
    if(zoomX_pic_start >= width)
        zoomX_pic_start = width - 1;
    if(zoomY_pic_start < 0)
        zoomY_pic_start = 0;
    if(zoomY_pic_start >= height)
        zoomY_pic_start = height - 1;
    //psprintf(linebuf,"zoomX_pic_start:%x zoomY_pic_start:%x\n",zoomX_pic_start,zoomY_pic_start);
    //epp_write(linebuf);
    /*
     ** Decide display end (for a picture).
     ** We have to check if the VPP request if larger than the display
     */
    zoomX_size = width - zoomX_pic_start;
    zoomY_size = height - zoomY_pic_start;

    total = TV_WIDTH;
    if(zoomX == ZOOM_X_x2)
        total >>= 1;
    else if(zoomX == ZOOM_X_x4)
        total >>= 2;
    else if(zoomX == ZOOM_X_x8)
        total >>= 3;
    if(zoomX_size > total)
        zoomX_size = total;

    total = 576;
    //total = 288;
    if(zoomY == ZOOM_Y_x2)
        total >>= 1;
    else if(zoomY == ZOOM_Y_x4)
        total >>= 2;
    else if(zoomY == ZOOM_Y_x8)
        total >>= 3;
    if(zoomY_size > total)
        zoomY_size = total;

    //psprintf(linebuf,"mode_display:%x \n",mode_display);
    //epp_write(linebuf);
    //psprintf(linebuf,"zoomX_size :%x zoomY_size:%x \n",zoomX_size,zoomY_size);
    //epp_write(linebuf);

    //psprintf(linebuf, "set_vpp(%x,%x), PAL %x ZOOM %x\n",
    //width, height, IsAVDDisplayPAL(), vpp_zoom);
    //epp_write(linebuf);

    //{
    //#define   DECODE_TYPE_PAL     0
    //#define   DECODE_TYPE_NTSC    1

    //int decode_type;

    if(height > 480)
        decode_type = DECODE_TYPE_PAL;
    else if(height > 288)
        decode_type = DECODE_TYPE_NTSC;
    else if(height > 240)
        decode_type = DECODE_TYPE_PAL;
    else
        decode_type = DECODE_TYPE_NTSC;
    //}

    if(width > 352)
    {
#if CONFIG==CONFIG_COMBO_SVCD
        if(cd_type_loaded == CDSVCD)
        {
            switch (vpp_zoom)
            {
                case 0:
                case 1:
                    if(IsAVDDisplayPAL())
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_1_000 : VINT_1_200;
                    else
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_0_833 : VINT_1_000;
                    //width=width/2;height=height/2;
                    break;
                case 2:
                    if(IsAVDDisplayPAL())
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_2_000 : VINT_2_400;
                    else
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_1_667 : VINT_2_000;
                    //width=width/2;height=height/2;
                    break;
                case 3:
                    if(IsAVDDisplayPAL())
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_3_000 : VINT_3_600;
                    else
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_2_400 : VINT_3_000;
                    //width=width/2;height=height/2;
                    break;
                case 4:
                    if(IsAVDDisplayPAL())
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_4_000 : VINT_4_800;
                    else
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_3_333 : VINT_4_000;
                    //width=width/2;height=height/2;
                    break;
                default:
                    if(IsAVDDisplayPAL())
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_1_000 : VINT_1_200;
                    else
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_0_833 : VINT_1_000;
                    //width=width/2;height=height/2;
                    break;
            }                                                   //end case
        }
        else                                                //NOT SVCD
#endif
        {
            switch (vpp_zoom)
            {
                case 0:
                    //v_filter_mode  = VINT_1_000;
                    //if ((width==704)&(IsAVDDisplayPAL()))  v_filter_mode  = VINT_1_200;
                    //break;
                case 1:
                    if(IsAVDDisplayPAL())
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_1_000 : VINT_1_200;
                    else
                        v_filter_mode =
                            (decode_type == DECODE_TYPE_PAL) ? VINT_0_833 : VINT_1_000;
                    break;
                case 2:
                    v_filter_mode = VINT_2_000;
#ifdef SUPPORT_JPG_ZOOM_ON
                    if((Gmem.gmp3.gifsFunc == FS_FUNC_JPEG) &&
                         !(Gmem.gmp3.gifsSlide || Gmem.gmp3.gifsStatic))
#endif
                        if((width == 704) & (IsAVDDisplayPAL()))
                            v_filter_mode = VINT_2_400;
                    //width=width/2;height=height/2;
                    break;
                case 3:
                    v_filter_mode = VINT_3_000;
                    if((width == 704) & (IsAVDDisplayPAL()))
                        v_filter_mode = VINT_3_600;
                    break;
                case 4:
                    v_filter_mode = VINT_4_000;
#ifdef SUPPORT_JPG_ZOOM_ON
                    if((Gmem.gmp3.gifsFunc == FS_FUNC_JPEG) &&
                         !(Gmem.gmp3.gifsSlide || Gmem.gmp3.gifsStatic))
#endif
                        if((width == 704) & (IsAVDDisplayPAL()))
                            v_filter_mode = VINT_4_800;
                    //width=width/4;height=height/4;
                    break;
                default:
                    v_filter_mode = VINT_1_000;
                    if((width == 704) & (IsAVDDisplayPAL()))
                        v_filter_mode = VINT_1_200;
                    break;
            }
        }

        switch (vpp_zoom)
        {
            case 0:
                #if CONFIG == CONFIG_COMBO_SVCD
                if((cd_type_loaded == CDSVCD) && (width == 480))
                    h_filter_mode = HEXP_1_500;
                else
                #endif
                    h_filter_mode = HEXP_1_000;
                break;
            case 1:
                #if CONFIG == CONFIG_COMBO_SVCD
                if((cd_type_loaded == CDSVCD) && (width == 480))
                    h_filter_mode = HEXP_1_500;
                else
                #endif
                    h_filter_mode = HEXP_1_000;
                break;
            case 2:
                #if CONFIG == CONFIG_COMBO_SVCD
                if((cd_type_loaded == CDSVCD) && (width == 480))
                    h_filter_mode = HEXP_3_000;
                else
                #endif
                    h_filter_mode = CIF_ENABLE;
                //width=width/2;height=height/2;
                break;
            case 3:
                #if CONFIG == CONFIG_COMBO_SVCD
                if((cd_type_loaded == CDSVCD) && (width == 480))
                    h_filter_mode = HEXP_4_500;
                else
                #endif
                    h_filter_mode = HEXP_3_000;
                //width=width/2;height=height/2;
                break;
            case 4:
                #if CONFIG == CONFIG_COMBO_SVCD
                if((cd_type_loaded == CDSVCD) && (width == 480))
                    h_filter_mode = HEXP_6_000;
                else
                #endif
                    h_filter_mode = HEXP_2_000 + CIF_ENABLE;
                //width=width/4;height=height/4;
                break;
            default:
                #if CONFIG == CONFIG_COMBO_SVCD
                if((cd_type_loaded == CDSVCD) && (width == 480))
                    h_filter_mode = HEXP_1_500;
                else
                #endif
                    h_filter_mode = HEXP_1_000;
                break;
        }
    }
    else
    {                                                           // VCD OKO
        #if CONFIG == CONFIG_COMBO_SVCD
        if(cd_type_loaded == CDSVCD)    //bondy 2002/3/18
        {
            switch (vpp_zoom)
            {
                case 0:
                case 1:
                    if(height < 480)
                    {
                        if(show_logo == 1)
                        {
                        // for SVCD show logo
                        if(IsAVDDisplayPAL())
                            v_filter_mode = VINT_2_000; //(decode_type==DECODE_TYPE_PAL) ? VINT_2_000; : VINT_2_400;
                        else
                            v_filter_mode = VINT_1_667; //(decode_type==DECODE_TYPE_PAL) ? VINT_1_667; : VINT_2_000;
                    }
                    else
                    {
                            //JJDing 2003/3/10 09:52

⌨️ 快捷键说明

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