亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? display.c

?? mpeg2編解標準源
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* display.c, X11 interface                                                 *//* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. *//* * Disclaimer of Warranty * * These software programs are available to the user without any license fee or * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims * any and all warranties, whether express, implied, or statuary, including any * implied warranties or merchantability or of fitness for a particular * purpose.  In no event shall the copyright-holder be liable for any * incidental, punitive, or consequential damages of any kind whatsoever * arising from the use of these programs. * * This disclaimer of warranty extends to the user of these programs and user's * customers, employees, agents, transferees, successors, and assigns. * * The MPEG Software Simulation Group does not represent or warrant that the * programs furnished hereunder are free of infringement of any third-party * patents. * * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware, * are subject to royalty fees to patent holders.  Many of these patents are * general enough such that they are unavoidable regardless of implementation * design. * */#ifdef DISPLAY /* the Xlib interface is closely modeled after  * mpeg_play 2.0 by the Berkeley Plateau Research Group  */#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#include "config.h"#include "global.h"/* private prototypes */static void Display_Image _ANSI_ARGS_((XImage *Ximage_Ptr, unsigned char *Dithered_Image));static void Dither_Frame _ANSI_ARGS_((unsigned char *src[]));static void Dither_Top_Field _ANSI_ARGS_((unsigned char *src[], unsigned char *dst));static void Dither_Bottom_Field _ANSI_ARGS_((unsigned char *src[], unsigned char *dst));static void Dither_Top_Field420 _ANSI_ARGS_((unsigned char *src[],                                      unsigned char *dst));static void Dither_Bottom_Field420 _ANSI_ARGS_((unsigned char *src[],                                      unsigned char *dst));/* local data */static unsigned char *Dithered_Image, *Dithered_Image2;static unsigned char Y_Table[256+16];static unsigned char Cb_Table[128+16];static unsigned char Cr_Table[128+16];/* X11 related variables */static Display *Display_Ptr;static Window Window_Instance;static GC GC_Instance;static XImage *Ximage_Ptr, *Ximage_Ptr2;static unsigned char Pixel[256];#ifdef SH_MEM#include <sys/ipc.h>#include <sys/shm.h>#include <X11/extensions/XShm.h>static int HandleXError _ANSI_ARGS_((Display *dpy, XErrorEvent *event));static void InstallXErrorHandler _ANSI_ARGS_((void));static void DeInstallXErrorHandler _ANSI_ARGS_((void));static int Shmem_Flag;static XShmSegmentInfo Shminfo1, Shminfo2;static int gXErrorFlag;static int CompletionType = -1;static int HandleXError(Dpy, Event)Display *Dpy;XErrorEvent *Event;{  gXErrorFlag = 1;  return 0;}static void InstallXErrorHandler(){  XSetErrorHandler(HandleXError);  XFlush(Display_Ptr);}static void DeInstallXErrorHandler(){  XSetErrorHandler(NULL);  XFlush(Display_Ptr);}#endif/* connect to server, create and map window, * allocate colors and (shared) memory */void Initialize_Display_Process(name)char *name;{  int crv, cbu, cgu, cgv;  int Y, Cb, Cr, R, G, B;  int i;  char dummy;  int screen;  Colormap cmap;  int private;  XColor xcolor;  unsigned int fg, bg;  char *hello = "MPEG-2 Display";  XSizeHints hint;  XVisualInfo vinfo;  XEvent xev;  unsigned long tmp_pixel;  XWindowAttributes xwa;  Display_Ptr = XOpenDisplay(name);  if (Display_Ptr == NULL)    Error("Can not open display\n");  screen = DefaultScreen(Display_Ptr);  hint.x = 200;  hint.y = 200;  hint.width = horizontal_size;  hint.height = vertical_size;  hint.flags = PPosition | PSize;  /* Get some colors */  bg = WhitePixel (Display_Ptr, screen);  fg = BlackPixel (Display_Ptr, screen);  /* Make the window */  if (!XMatchVisualInfo(Display_Ptr, screen, 8, PseudoColor, &vinfo))  {    if (!XMatchVisualInfo(Display_Ptr, screen, 8, GrayScale, &vinfo))      Error("requires 8 bit display\n");  }  Window_Instance = XCreateSimpleWindow (Display_Ptr, DefaultRootWindow (Display_Ptr),             hint.x, hint.y, hint.width, hint.height, 4, fg, bg);  XSelectInput(Display_Ptr, Window_Instance, StructureNotifyMask);  /* Tell other applications about this window */  XSetStandardProperties (Display_Ptr, Window_Instance, hello, hello, None, NULL, 0, &hint);  /* Map window. */  XMapWindow(Display_Ptr, Window_Instance);  /* Wait for map. */  do  {    XNextEvent(Display_Ptr, &xev);  }  while (xev.type != MapNotify || xev.xmap.event != Window_Instance);  XSelectInput(Display_Ptr, Window_Instance, NoEventMask);  /* matrix coefficients */  crv = Inverse_Table_6_9[matrix_coefficients][0];  cbu = Inverse_Table_6_9[matrix_coefficients][1];  cgu = Inverse_Table_6_9[matrix_coefficients][2];  cgv = Inverse_Table_6_9[matrix_coefficients][3];  /* allocate colors */  GC_Instance = DefaultGC(Display_Ptr, screen);  cmap = DefaultColormap(Display_Ptr, screen);  private = 0;  /* color allocation:   * i is the (internal) 8 bit color number, it consists of separate   * bit fields for Y, U and V: i = (yyyyuuvv), we don't use yyyy=0000   * and yyyy=1111, this leaves 32 colors for other applications   *   * the allocated colors correspond to the following Y, U and V values:   * Y:   24, 40, 56, 72, 88, 104, 120, 136, 152, 168, 184, 200, 216, 232   * U,V: -48, -16, 16, 48   *   * U and V values span only about half the color space; this gives   * usually much better quality, although highly saturated colors can   * not be displayed properly   *   * translation to R,G,B is implicitly done by the color look-up table   */  for (i=16; i<240; i++)  {    /* color space conversion */    Y  = 16*((i>>4)&15) + 8;    Cb = 32*((i>>2)&3)  - 48;    Cr = 32*(i&3)       - 48;    Y = 76309 * (Y - 16); /* (255/219)*65536 */    R = Clip[(Y + crv*Cr + 32768)>>16];    G = Clip[(Y - cgu*Cb - cgv*Cr + 32768)>>16];    B = Clip[(Y + cbu*Cb + 32786)>>16];    /* X11 colors are 16 bit */    xcolor.red   = R << 8;    xcolor.green = G << 8;    xcolor.blue  = B << 8;    if (XAllocColor(Display_Ptr, cmap, &xcolor) != 0)      Pixel[i] = xcolor.pixel;    else    {      /* allocation failed, have to use a private colormap */      if (private)        Error("Couldn't allocate private colormap");      private = 1;      if (!Quiet_Flag)        fprintf(stderr, "Using private colormap (%d colors were available).\n",          i-16);      /* Free colors. */      while (--i >= 16)      {        tmp_pixel = Pixel[i]; /* because XFreeColors expects unsigned long */        XFreeColors(Display_Ptr, cmap, &tmp_pixel, 1, 0);      }      /* i is now 15, this restarts the outer loop */      /* create private colormap */      XGetWindowAttributes(Display_Ptr, Window_Instance, &xwa);      cmap = XCreateColormap(Display_Ptr, Window_Instance, xwa.visual, AllocNone);      XSetWindowColormap(Display_Ptr, Window_Instance, cmap);    }  }#ifdef SH_MEM  if (XShmQueryExtension(Display_Ptr))    Shmem_Flag = 1;  else  {    Shmem_Flag = 0;    if (!Quiet_Flag)      fprintf(stderr, "Shared memory not supported\nReverting to normal Xlib\n");  }  if (Shmem_Flag)    CompletionType = XShmGetEventBase(Display_Ptr) + ShmCompletion;  InstallXErrorHandler();  if (Shmem_Flag)  {    Ximage_Ptr = XShmCreateImage(Display_Ptr, None, 8, ZPixmap, NULL,                             &Shminfo1,                             Coded_Picture_Width, Coded_Picture_Height);    if (!progressive_sequence)      Ximage_Ptr2 = XShmCreateImage(Display_Ptr, None, 8, ZPixmap, NULL,                                &Shminfo2,                                Coded_Picture_Width, Coded_Picture_Height);    /* If no go, then revert to normal Xlib calls. */    if (Ximage_Ptr==NULL || (!progressive_sequence && Ximage_Ptr2==NULL))    {      if (Ximage_Ptr!=NULL)        XDestroyImage(Ximage_Ptr);      if (!progressive_sequence && Ximage_Ptr2!=NULL)        XDestroyImage(Ximage_Ptr2);      if (!Quiet_Flag)        fprintf(stderr, "Shared memory error, disabling (Ximage error)\n");      goto shmemerror;    }    /* Success here, continue. */    Shminfo1.shmid = shmget(IPC_PRIVATE,                             Ximage_Ptr->bytes_per_line * Ximage_Ptr->height,                            IPC_CREAT | 0777);    if (!progressive_sequence)      Shminfo2.shmid = shmget(IPC_PRIVATE,                               Ximage_Ptr2->bytes_per_line * Ximage_Ptr2->height,                              IPC_CREAT | 0777);    if (Shminfo1.shmid<0 || (!progressive_sequence && Shminfo2.shmid<0))    {      XDestroyImage(Ximage_Ptr);      if (!progressive_sequence)        XDestroyImage(Ximage_Ptr2);      if (!Quiet_Flag)        fprintf(stderr, "Shared memory error, disabling (seg id error)\n");      goto shmemerror;    }    Shminfo1.shmaddr = (char *) shmat(Shminfo1.shmid, 0, 0);    Shminfo2.shmaddr = (char *) shmat(Shminfo2.shmid, 0, 0);    if (Shminfo1.shmaddr==((char *) -1) ||        (!progressive_sequence && Shminfo2.shmaddr==((char *) -1)))    {      XDestroyImage(Ximage_Ptr);      if (Shminfo1.shmaddr!=((char *) -1))        shmdt(Shminfo1.shmaddr);      if (!progressive_sequence)      {        XDestroyImage(Ximage_Ptr2);        if (Shminfo2.shmaddr!=((char *) -1))          shmdt(Shminfo2.shmaddr);      }      if (!Quiet_Flag)      {        fprintf(stderr, "Shared memory error, disabling (address error)\n");      }      goto shmemerror;    }    Ximage_Ptr->data = Shminfo1.shmaddr;    Dithered_Image = (unsigned char *)Ximage_Ptr->data;    Shminfo1.readOnly = False;    XShmAttach(Display_Ptr, &Shminfo1);    if (!progressive_sequence)    {      Ximage_Ptr2->data = Shminfo2.shmaddr;      Dithered_Image2 = (unsigned char *)Ximage_Ptr2->data;      Shminfo2.readOnly = False;      XShmAttach(Display_Ptr, &Shminfo2);    }    XSync(Display_Ptr, False);    if (gXErrorFlag)    {      /* Ultimate failure here. */      XDestroyImage(Ximage_Ptr);      shmdt(Shminfo1.shmaddr);      if (!progressive_sequence)      {        XDestroyImage(Ximage_Ptr2);        shmdt(Shminfo2.shmaddr);      }      if (!Quiet_Flag)        fprintf(stderr, "Shared memory error, disabling.\n");      gXErrorFlag = 0;      goto shmemerror;    }    else    {      shmctl(Shminfo1.shmid, IPC_RMID, 0);      if (!progressive_sequence)        shmctl(Shminfo2.shmid, IPC_RMID, 0);    }    if (!Quiet_Flag)    {      fprintf(stderr, "Sharing memory.\n");    }  }  else  {shmemerror:    Shmem_Flag = 0;#endif    Ximage_Ptr = XCreateImage(Display_Ptr,None,8,ZPixmap,0,&dummy,                          Coded_Picture_Width,Coded_Picture_Height,8,0);    if (!(Dithered_Image = (unsigned char *)malloc(Coded_Picture_Width*                                                   Coded_Picture_Height)))      Error("malloc failed");    if (!progressive_sequence)    {      Ximage_Ptr2 = XCreateImage(Display_Ptr,None,8,ZPixmap,0,&dummy,                             Coded_Picture_Width,Coded_Picture_Height,8,0);      if (!(Dithered_Image2 = (unsigned char *)malloc(Coded_Picture_Width*                                                      Coded_Picture_Height)))        Error("malloc failed");    }#ifdef SH_MEM  }  DeInstallXErrorHandler();#endif}void Terminate_Display_Process()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区女| 精品成a人在线观看| 91精品国产入口在线| 久久色中文字幕| 亚洲不卡在线观看| 粉嫩在线一区二区三区视频| 欧洲生活片亚洲生活在线观看| 精品久久人人做人人爰| 国产精品久久综合| 青青国产91久久久久久| 欧美性猛片aaaaaaa做受| 国产欧美精品一区二区色综合| 视频一区在线播放| 色综合久久88色综合天天| 中文字幕av资源一区| 国产在线播放一区三区四| 欧美亚一区二区| 亚洲少妇30p| av在线一区二区| 中文字幕的久久| 国产91精品久久久久久久网曝门| 欧美高清视频一二三区 | 懂色av一区二区三区蜜臀| 91精品国产欧美一区二区18| 亚洲一区视频在线观看视频| 成人av午夜影院| 国产精品久久久久久久久免费桃花| 国产一区日韩二区欧美三区| 日韩欧美国产精品一区| 日本美女一区二区三区| 欧美三级日韩在线| 亚洲一区二三区| 欧美午夜理伦三级在线观看| 亚洲一区在线观看免费| 欧美视频在线不卡| 日韩成人精品在线观看| 56国语精品自产拍在线观看| 天堂一区二区在线| 欧美精品黑人性xxxx| 日韩国产欧美在线播放| 欧美一区二区三区在线观看| 日韩vs国产vs欧美| 日韩女同互慰一区二区| 国产一区二区免费视频| 久久精品视频在线免费观看| 国产成人丝袜美腿| 中文字幕日韩精品一区| 91精彩视频在线| 日韩综合在线视频| 精品国产一区二区三区久久久蜜月 | 国产精品免费免费| 99精品国产99久久久久久白柏| 亚洲欧美一区二区三区孕妇| 色婷婷亚洲综合| 日韩av一级片| 久久久久国产精品麻豆ai换脸 | 欧美亚洲精品一区| 美女尤物国产一区| 国产精品国产三级国产三级人妇| 91丨porny丨中文| 亚洲成人激情av| 精品人伦一区二区色婷婷| 成人综合婷婷国产精品久久蜜臀| 国产精品精品国产色婷婷| 91精品福利视频| 美国精品在线观看| 自拍偷自拍亚洲精品播放| 欧美精品在线视频| 懂色av中文一区二区三区| 亚洲国产毛片aaaaa无费看| 欧美成人一区二区三区在线观看| 成人看片黄a免费看在线| 亚洲一区二区三区中文字幕在线| 欧美二区乱c少妇| 国产99久久久国产精品潘金网站| 亚洲国产wwwccc36天堂| 久久色在线视频| 九九热在线视频观看这里只有精品| 一区在线观看免费| 欧美va亚洲va香蕉在线| 色菇凉天天综合网| 国产二区国产一区在线观看| 一区二区三区在线视频免费观看 | 亚洲欧美影音先锋| 91精品国产色综合久久ai换脸 | 一区二区三区成人| 久久久久国产成人精品亚洲午夜 | 99久久99久久免费精品蜜臀| 免费精品视频最新在线| 一区二区三区av电影| 国产亚洲短视频| 日韩欧美国产小视频| 在线观看不卡视频| 成人激情免费视频| 九一久久久久久| 天天色综合天天| 欧美亚男人的天堂| 成人国产精品免费观看动漫| 蓝色福利精品导航| 青青国产91久久久久久| 亚洲资源中文字幕| 亚洲精品视频在线看| 国产欧美一区视频| 久久精品一区二区| 精品日韩成人av| 欧美成人性战久久| 欧美精品在线视频| 欧美精品99久久久**| 欧美日韩情趣电影| 欧美日韩一区二区三区免费看| 91免费精品国自产拍在线不卡| 国产高清亚洲一区| 国产一区 二区| 国产成人午夜视频| 成人在线视频一区二区| 成人午夜电影网站| 成人爽a毛片一区二区免费| 国产风韵犹存在线视精品| 国产成人精品一区二区三区网站观看| 狠狠色狠狠色合久久伊人| 黄色日韩网站视频| 国产伦精品一区二区三区免费| 国内精品伊人久久久久av一坑| 国产精品夜夜嗨| 成人综合婷婷国产精品久久| 99精品一区二区| 在线看日韩精品电影| 欧美日韩国产中文| 欧美一三区三区四区免费在线看| 日韩精品一区二区三区三区免费| ww亚洲ww在线观看国产| 国产女同性恋一区二区| 亚洲人吸女人奶水| 天堂蜜桃91精品| 久久精品999| 成人免费av资源| 欧美日韩免费一区二区三区| 欧美电影免费观看高清完整版在 | 一区二区三区四区不卡在线 | 日韩精品一区二区三区在线播放| 26uuu国产在线精品一区二区| 中文字幕久久午夜不卡| 亚洲在线视频网站| 国产在线一区二区综合免费视频| 精品一区二区三区在线视频| 不卡一区二区三区四区| 欧美午夜视频网站| 久久久一区二区三区捆绑**| 亚洲欧美在线另类| 蜜桃久久久久久久| 99精品久久久久久| 欧美精品aⅴ在线视频| 中文一区在线播放| 免费在线观看日韩欧美| 成人av在线网| 67194成人在线观看| 欧美激情一二三区| 日本欧美一区二区三区| 成人精品视频.| 91麻豆精品国产91久久久久久久久| 日本一区二区三区在线不卡| 日韩高清不卡一区二区| 成人黄动漫网站免费app| 欧美一卡2卡3卡4卡| 亚洲欧美经典视频| 国产精品一区二区免费不卡| 欧美日本韩国一区二区三区视频| 国产日韩欧美不卡| 日本美女一区二区三区视频| 色综合激情五月| 欧美激情一区二区三区蜜桃视频| 日本网站在线观看一区二区三区| www.欧美日韩国产在线| 精品国产精品网麻豆系列| 亚洲大片精品永久免费| av在线不卡免费看| 久久久久久久网| 日本欧美肥老太交大片| 欧美三日本三级三级在线播放| 国产精品丝袜黑色高跟| 国产一区中文字幕| 欧美一二三四区在线| 亚洲国产wwwccc36天堂| 色成人在线视频| 亚洲人成人一区二区在线观看| 国产精品一区二区不卡| 欧美成人一区二区三区| 蜜桃一区二区三区在线| 欧美一区二区日韩一区二区| 亚洲欧美精品午睡沙发| 99久久精品一区| 国产精品美女一区二区三区| 福利一区二区在线观看| 欧美tk—视频vk| 国内精品久久久久影院薰衣草| 欧美一级xxx| 极品美女销魂一区二区三区| 日韩一区二区在线观看视频播放| 日本不卡不码高清免费观看| 7777精品伊人久久久大香线蕉超级流畅 |