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

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

?? display.c

?? MPEG2視頻編解碼程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* display.c, X11 接口文件                                                */#ifdef DISPLAY#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(){#ifdef SH_MEM  if (Shmem_Flag)  {    XShmDetach(Display_Ptr, &Shminfo1);    XDestroyImage(Ximage_Ptr);    shmdt(Shminfo1.shmaddr);    if (!progressive_sequence)    {      XShmDetach(Display_Ptr, &Shminfo2);      XDestroyImage(Ximage_Ptr2);      shmdt(Shminfo2.shmaddr);    }  }#endif}static void Display_Image(Ximage_Ptr,Dithered_Image)XImage *Ximage_Ptr;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合分类小说区另类春色亚洲小说欧美| 97久久人人超碰| 国产精品久久久久国产精品日日 | 欧美xxxx老人做受| 欧美性xxxxxxxx| av在线一区二区三区| 国产在线一区二区| 免费高清在线一区| 蜜桃一区二区三区在线| 亚洲国产中文字幕| 亚洲成年人影院| 日韩毛片高清在线播放| 欧美国产成人精品| 国产精品天美传媒| 国产日韩欧美一区二区三区综合| 欧美一区二区三区四区在线观看 | 成人网在线播放| 国产裸体歌舞团一区二区| 乱一区二区av| 激情综合网激情| 久久综合久久99| 在线播放视频一区| 91精品国产欧美一区二区| 欧美一级国产精品| 精品国产乱码久久久久久浪潮| 欧美精品三级日韩久久| 91精品婷婷国产综合久久| 欧美精品久久久久久久多人混战| 欧美精选一区二区| 欧美va亚洲va香蕉在线| 久久综合九色综合97_久久久| 欧美成人bangbros| 国产欧美一区二区三区在线老狼| 欧美国产日本韩| 依依成人综合视频| 日本系列欧美系列| 国内精品久久久久影院一蜜桃| 韩国理伦片一区二区三区在线播放| 韩日精品视频一区| 成人免费视频免费观看| 成a人片亚洲日本久久| 色婷婷亚洲精品| 欧美老年两性高潮| 国产亚洲一区二区在线观看| 中文字幕一区二区三中文字幕| 亚洲欧美怡红院| 日本女优在线视频一区二区| 国内精品视频一区二区三区八戒| 不卡视频在线观看| 欧美日韩一区二区在线观看| 欧美日韩亚洲国产综合| 久久蜜桃一区二区| 亚洲一区日韩精品中文字幕| 久久丁香综合五月国产三级网站| 波多野结衣精品在线| 欧美亚洲动漫制服丝袜| 久久嫩草精品久久久久| 亚洲综合一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 久久精品国产久精国产| 91首页免费视频| 精品国产91乱码一区二区三区| 国产精品短视频| 美国十次综合导航| 不卡视频一二三| 精品美女在线观看| 亚洲图片欧美视频| 91在线精品一区二区| 欧美成人一区二区三区片免费| 国产日产欧美一区| 美国av一区二区| 欧美日韩一区二区三区视频| 国产色产综合产在线视频| 亚州成人在线电影| 91视频国产观看| 国产色综合久久| 美女在线视频一区| 麻豆传媒一区二区三区| 在线观看91视频| 国产精品欧美经典| 精品一二线国产| 51精品国自产在线| 日韩福利视频网| 欧美私模裸体表演在线观看| 亚洲天堂a在线| 国产a级毛片一区| 久久综合狠狠综合久久综合88| 日韩精品一级中文字幕精品视频免费观看 | 欧美日免费三级在线| 亚洲女人的天堂| 9人人澡人人爽人人精品| 久久亚洲捆绑美女| 国产美女精品在线| 久久久久久久性| 成人免费福利片| 国产视频视频一区| 成人午夜免费av| 国产精品亲子伦对白| av午夜一区麻豆| 亚洲成人在线免费| 久久亚洲综合av| 97se亚洲国产综合自在线观| 亚洲自拍偷拍欧美| 欧美xxxx老人做受| av一区二区三区黑人| 午夜精品久久久久久久蜜桃app| 91精品国产91久久久久久一区二区| 精品亚洲成av人在线观看| 久久久久9999亚洲精品| 色香蕉久久蜜桃| 国内精品伊人久久久久av影院 | 亚洲一区二区影院| 日韩欧美一区中文| 成人黄色在线视频| 五月婷婷激情综合网| 精品99一区二区| 欧美日韩一区视频| www.欧美.com| 日本不卡不码高清免费观看| 一区视频在线播放| 欧美一级理论片| av成人动漫在线观看| 日本强好片久久久久久aaa| 国产精品理伦片| 日韩欧美成人激情| 色成年激情久久综合| 国产又粗又猛又爽又黄91精品| 国产精品国产三级国产aⅴ无密码| 在线成人高清不卡| 色一情一乱一乱一91av| 国产精品乡下勾搭老头1| 日韩激情视频在线观看| 亚洲天堂av老司机| 中文字幕免费在线观看视频一区| 51精品秘密在线观看| 欧美少妇xxx| 99综合影院在线| 粉嫩一区二区三区性色av| 另类综合日韩欧美亚洲| 亚洲福利电影网| 亚洲一区二区五区| 亚洲精品伦理在线| 亚洲手机成人高清视频| 精品久久久久久亚洲综合网| 欧美日韩精品久久久| 97国产一区二区| 波多野结衣视频一区| 岛国一区二区在线观看| 国产一区二区三区久久久| 久久精品国产澳门| 蜜臀精品久久久久久蜜臀| 婷婷丁香久久五月婷婷| 亚洲成人一区在线| 天天av天天翘天天综合网色鬼国产| 一区二区三区蜜桃网| 玉足女爽爽91| 亚洲成a人片在线观看中文| 亚洲一区二区三区自拍| 午夜不卡在线视频| 午夜一区二区三区视频| 亚洲福利一区二区| 日韩成人一区二区三区在线观看| 亚洲精品成人天堂一二三| 亚洲精品午夜久久久| 亚洲尤物在线视频观看| 婷婷亚洲久悠悠色悠在线播放| 亚洲成a人片在线不卡一二三区| 天天爽夜夜爽夜夜爽精品视频 | 日韩一区二区麻豆国产| 91精品国产色综合久久不卡电影| 日韩美女主播在线视频一区二区三区| 日韩午夜激情视频| 国产亚洲1区2区3区| 一区二区三区欧美在线观看| 午夜精品福利在线| 国模冰冰炮一区二区| 99久久夜色精品国产网站| 在线免费观看日本一区| 在线综合亚洲欧美在线视频| 久久亚洲一区二区三区四区| 1024成人网| 免费人成黄页网站在线一区二区| 国内精品伊人久久久久av影院| 成人美女在线观看| 欧美精品日韩综合在线| 久久综合九色综合欧美就去吻 | 欧美一区二区观看视频| 日本一区二区电影| 午夜激情综合网| 成人一区二区三区视频在线观看| 色悠悠久久综合| 日韩一区二区在线播放| 中文字幕一区二区三区四区不卡| 午夜精品一区二区三区电影天堂 | 韩国精品免费视频| av电影一区二区| 久久久久久久久久久黄色| 亚洲精品日日夜夜| 国产激情精品久久久第一区二区| 欧美日韩精品三区|