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

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

?? display.c

?? mpeg2 decoder filter過濾服務端
?? 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一区二区三区免费野_久草精品视频
国产不卡视频在线观看| 亚洲一线二线三线久久久| 另类综合日韩欧美亚洲| 日韩一级片网站| 久热成人在线视频| 中文字幕精品一区二区精品绿巨人 | 高清不卡一区二区| 1000部国产精品成人观看| 欧美在线观看视频一区二区| 日日摸夜夜添夜夜添国产精品| 日韩网站在线看片你懂的| 国产乱人伦精品一区二区在线观看| 中文字幕久久午夜不卡| 色先锋资源久久综合| 天堂久久一区二区三区| 2017欧美狠狠色| 91一区二区三区在线观看| 午夜精品久久一牛影视| 精品国产一区二区三区不卡 | 亚洲国产高清在线| 91麻豆成人久久精品二区三区| 亚洲一区二区三区在线播放| 欧美一级夜夜爽| 成人国产在线观看| 亚洲国产精品人人做人人爽| 337p日本欧洲亚洲大胆色噜噜| 91精品国产手机| 国产乱人伦精品一区二区在线观看 | 欧美中文字幕久久| 久久国产精品一区二区| 亚洲视频免费在线观看| 欧美一级高清片| 99精品黄色片免费大全| 毛片av中文字幕一区二区| 亚洲婷婷在线视频| 精品国产免费一区二区三区四区| aaa亚洲精品| 奇米在线7777在线精品| 国产精品国产三级国产普通话三级| 欧美亚洲禁片免费| 高清beeg欧美| 日本亚洲天堂网| 亚洲摸摸操操av| 国产亚洲欧美日韩日本| 欧美精品视频www在线观看 | 激情综合五月婷婷| 亚洲一区二区三区自拍| 国产午夜精品一区二区三区视频 | 亚洲精品免费在线播放| 久久久天堂av| 91麻豆精品国产91久久久久久| 91视频精品在这里| 国产成人在线免费| 精久久久久久久久久久| 五月婷婷另类国产| 亚洲一区二区三区四区在线| 国产精品美女久久久久久久久| 精品日韩成人av| 欧美精品三级在线观看| 欧美探花视频资源| 日本韩国一区二区三区| 99国产麻豆精品| 北条麻妃国产九九精品视频| 国产成人在线视频免费播放| 欧美天堂亚洲电影院在线播放| 成人深夜福利app| 国产大陆a不卡| 国产精品一卡二卡在线观看| 美女网站在线免费欧美精品| 秋霞午夜鲁丝一区二区老狼| 午夜欧美在线一二页| 亚洲va韩国va欧美va| 一区二区不卡在线播放| 亚洲永久免费视频| 一区二区三国产精华液| 亚洲精品第1页| 一区二区三区在线视频播放| 亚洲人成伊人成综合网小说| 国产精品高清亚洲| 亚洲欧美韩国综合色| 亚洲日本一区二区三区| 亚洲日本在线天堂| 亚洲成人综合视频| 日本成人在线不卡视频| 日本美女视频一区二区| 激情另类小说区图片区视频区| 久久99国产乱子伦精品免费| 久久草av在线| 国产电影精品久久禁18| 成人av在线网站| 色综合天天狠狠| 欧美图区在线视频| 欧美一级艳片视频免费观看| 精品乱码亚洲一区二区不卡| 国产视频一区在线播放| 国产精品视频yy9299一区| 国产精品久久看| 亚洲国产乱码最新视频| 久久成人久久爱| 国产高清精品久久久久| 99久久久精品免费观看国产蜜| 91久久久免费一区二区| 日韩一区二区三区在线| 久久久99久久| 一区二区视频在线看| 日韩高清不卡一区二区三区| 久久er99精品| 91碰在线视频| 欧美一级免费大片| 日本一区二区免费在线观看视频 | 亚洲黄色片在线观看| 偷拍与自拍一区| 国产一区免费电影| 色综合天天综合狠狠| 制服视频三区第一页精品| 国产亚洲短视频| 亚洲一区影音先锋| 国产一区二区三区在线观看免费 | 麻豆精品国产传媒mv男同| 丁香激情综合国产| 欧美女孩性生活视频| 欧美国产精品v| 午夜精品一区二区三区免费视频| 国产一区在线精品| 欧美午夜精品久久久久久超碰| 日韩欧美www| 一区二区三区国产豹纹内裤在线| 久久精品国产一区二区三区免费看| 成人午夜免费视频| 日韩一区二区免费在线观看| 日韩一区有码在线| 韩国成人精品a∨在线观看| 色8久久精品久久久久久蜜| 久久伊99综合婷婷久久伊| 一片黄亚洲嫩模| 成人免费高清在线观看| 日韩一区二区在线观看视频播放| 亚洲视频免费看| 国产超碰在线一区| 日韩视频免费观看高清完整版| 亚洲色图欧洲色图| 成人免费看片app下载| 精品国产一区二区三区忘忧草| 亚洲午夜私人影院| 99精品热视频| 国产精品素人一区二区| 久久99精品网久久| 91精品婷婷国产综合久久性色| 亚洲免费资源在线播放| 成人久久久精品乱码一区二区三区| 日韩欧美卡一卡二| 日本欧美一区二区三区乱码| 欧美性猛交一区二区三区精品| 国产精品久久久久aaaa| 国产一区福利在线| 精品人伦一区二区色婷婷| 日韩avvvv在线播放| 中文字幕一区二区三区在线不卡| 久久国产麻豆精品| 日韩美女视频在线| 老司机精品视频一区二区三区| 在线观看一区二区视频| 一区二区三区蜜桃网| 91碰在线视频| 伊人色综合久久天天| 91浏览器打开| 一区二区三区av电影| 在线视频国内一区二区| 亚洲综合在线电影| 欧美三级在线视频| 亚洲成人自拍一区| 777午夜精品视频在线播放| 视频在线观看91| 欧美刺激脚交jootjob| 精品无人码麻豆乱码1区2区| 久久久www成人免费无遮挡大片| 精东粉嫩av免费一区二区三区| 精品裸体舞一区二区三区| 国产一区二区三区在线观看精品| 久久久噜噜噜久噜久久综合| 国产成人超碰人人澡人人澡| 欧美经典一区二区三区| 成人精品视频一区| 亚洲精品中文在线| 欧美日本一区二区三区| 久久精品国产色蜜蜜麻豆| 久久久久97国产精华液好用吗| 粉嫩绯色av一区二区在线观看| 国产精品剧情在线亚洲| 在线观看日韩精品| 美女网站在线免费欧美精品| 久久精品视频一区| 91麻豆国产福利精品| 天堂资源在线中文精品| 欧美精品一区二区三区蜜臀| 国产91在线观看丝袜| 亚洲自拍都市欧美小说| 欧美一区日本一区韩国一区| 国产剧情一区二区三区| 亚洲综合色视频|