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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? display.c

?? MPEG2編解碼的源代碼.zip
?? 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()

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕欧美三区| 国产人久久人人人人爽| 国产成人精品免费在线| 午夜精品影院在线观看| 国产精品污网站| 欧美一级片在线看| 在线免费av一区| 国产成人av一区二区三区在线观看| 亚洲亚洲精品在线观看| 国产精品嫩草99a| 精品日韩一区二区三区| 欧美日韩精品一区二区天天拍小说| 成人av网站在线观看免费| 久久99日本精品| 日av在线不卡| 亚洲国产婷婷综合在线精品| 国产精品成人在线观看| 久久久久久久电影| 91精品国产综合久久精品图片 | 精品一二三四区| 亚洲gay无套男同| 亚洲视频一区在线| 国产精品伦一区| 中文欧美字幕免费| 久久精品欧美一区二区三区麻豆| 91精品国产乱| 欧美日韩一级二级| 欧美大片在线观看一区二区| 91精品国产综合久久精品app| 日本韩国精品一区二区在线观看| 99精品久久99久久久久| 99riav一区二区三区| 99久久777色| 成人av电影在线播放| 成人激情午夜影院| 成人国产亚洲欧美成人综合网| 国产在线不卡一区| 国产精品1区二区.| 丁香五精品蜜臀久久久久99网站 | 久久精品人人做人人爽人人| 欧美精品一区二区三区视频 | 欧美xxxxxxxx| 精品免费视频.| www国产成人| 日本一区二区三区dvd视频在线| 久久视频一区二区| 国产日韩欧美不卡在线| 欧美激情一区在线| 综合色天天鬼久久鬼色| 日韩毛片视频在线看| 自拍偷拍亚洲综合| 一区二区三区91| 日本免费在线视频不卡一不卡二| 免费人成网站在线观看欧美高清| 久久精品国产成人一区二区三区 | 91在线免费视频观看| 一本久久精品一区二区| 日本乱码高清不卡字幕| 欧美精品自拍偷拍动漫精品| 欧美xxxx老人做受| 国产精品国产精品国产专区不蜜| 亚洲欧洲精品成人久久奇米网| 亚洲精品一二三| 首页国产欧美久久| 国产一区二区视频在线| 成人永久免费视频| 欧美性猛交xxxxxxxx| 欧美一级高清片| 国产精品全国免费观看高清| 亚洲人成在线播放网站岛国 | jizzjizzjizz欧美| 欧美午夜精品电影| 精品国产第一区二区三区观看体验| 国产网红主播福利一区二区| 亚洲精品视频自拍| 免费av网站大全久久| 不卡电影一区二区三区| 欧美日韩一区国产| 亚洲国产成人午夜在线一区| 午夜激情一区二区三区| 91精品国产丝袜白色高跟鞋| 久久综合视频网| 亚洲一卡二卡三卡四卡五卡| 理论电影国产精品| 91福利在线播放| 久久精品人人做人人爽人人| 亚洲成人先锋电影| av亚洲精华国产精华精华| 欧美一区二区视频网站| 亚洲视频网在线直播| 美腿丝袜亚洲一区| 色综合久久久久| 国产亚洲一本大道中文在线| 亚洲大片精品永久免费| 成人免费福利片| 日韩一区二区三区电影| 亚洲午夜免费电影| heyzo一本久久综合| 精品国产乱子伦一区| 亚洲国产三级在线| 91性感美女视频| 国产欧美日韩一区二区三区在线观看| 亚洲成人一区二区| 色老汉一区二区三区| 国产女主播一区| 国内精品免费在线观看| 欧美精品99久久久**| 一区二区三区在线视频观看| 成人免费精品视频| 亚洲精品一区在线观看| 日韩主播视频在线| 欧美色综合天天久久综合精品| 国产精品视频看| 国产综合久久久久影院| 91精品国产黑色紧身裤美女| 亚洲一区二区三区美女| 色噜噜狠狠成人中文综合 | 一区二区欧美在线观看| 成人午夜av电影| 精品国产网站在线观看| 日韩成人av影视| 欧美日韩卡一卡二| 亚洲小说春色综合另类电影| 一本色道**综合亚洲精品蜜桃冫 | 国内精品伊人久久久久av一坑| 欧美精品久久天天躁| 亚洲一区二区三区四区五区中文 | 成人免费高清在线| 欧美激情一二三区| 处破女av一区二区| 国产精品欧美久久久久无广告| 国产91高潮流白浆在线麻豆| 国产农村妇女毛片精品久久麻豆 | 不卡欧美aaaaa| 国产精品美女www爽爽爽| 国产精品资源网站| 中文字幕精品三区| www.色精品| 亚洲乱码一区二区三区在线观看| 91浏览器打开| 一区二区三区 在线观看视频| 在线观看精品一区| 成人av在线资源网站| 自拍偷自拍亚洲精品播放| 99国内精品久久| 亚洲精品国产视频| 欧美日韩电影一区| 美女视频黄免费的久久| 久久综合色天天久久综合图片| 国产精品一卡二| 国产精品久久久久婷婷| 色av成人天堂桃色av| 视频一区在线视频| 久久一区二区三区四区| 国v精品久久久网| 一区二区三区在线视频播放| 91麻豆精品国产91久久久久| 国模一区二区三区白浆| 欧美精彩视频一区二区三区| 99久久久久免费精品国产| 亚洲成人资源网| 2020国产精品久久精品美国| 成人av在线看| 丝袜美腿成人在线| 国产午夜精品久久| 在线精品亚洲一区二区不卡| 日韩黄色在线观看| 国产清纯白嫩初高生在线观看91 | 国产精品对白交换视频| 欧美日韩亚洲综合一区 | 色综合久久久网| 免费成人结看片| 亚洲欧洲成人精品av97| 欧美日产在线观看| 风间由美性色一区二区三区| 亚洲欧美偷拍三级| 日韩天堂在线观看| 91亚洲国产成人精品一区二区三| 日本少妇一区二区| 国产精品高潮呻吟| 日韩一区二区在线看| 99久久国产综合色|国产精品| 五月天久久比比资源色| 亚洲国产成人自拍| 91精品欧美久久久久久动漫| 成人黄色综合网站| 蓝色福利精品导航| 亚洲综合在线第一页| 国产日韩欧美高清| 欧美日本一区二区| 99久久精品国产网站| 久久狠狠亚洲综合| 亚洲综合在线电影| 国产日韩欧美高清在线| 欧美一区二区三区在线电影| 91美女在线视频| 国产91精品一区二区麻豆亚洲| 日韩电影在线免费观看| 亚洲黄色免费网站| 国产精品天美传媒|