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

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

?? display.c

?? 視頻的h263解碼
?? C
字號(hào):
/************************************************************************ * *  display.c, X11 interface for tmndecode (H.263 decoder) *  Copyright (C) 1996  Telenor R&D, Norway *        Karl Olav Lillevold <Karl.Lillevold@nta.no> * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *  Karl Olav Lillevold               <Karl.Lillevold@nta.no> *  Telenor Research and Development *  P.O.Box 83                        tel.:   +47 63 84 84 00 *  N-2007 Kjeller, Norway            fax.:   +47 63 81 00 76 * *  Robert Danielsen                  e-mail: Robert.Danielsen@nta.no *  Telenor Research and Development  www:    http://www.nta.no/brukere/DVC/ *  P.O.Box 83                        tel.:   +47 63 84 84 00 *  N-2007 Kjeller, Norway            fax.:   +47 63 81 00 76 *   ************************************************************************//* * based on mpeg2decode, (C) 1994, MPEG Software Simulation Group * and mpeg2play, (C) 1994 Stefan Eckart *                         <stefan@lis.e-technik.tu-muenchen.de> * */ /* the Xlib interface is closely modeled after  * mpeg_play 2.0 by the Berkeley Plateau Research Group  */#ifdef DISPLAY#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#include "config.h"#include "tmndec.h"#include "global.h"/* private prototypes */static void display_image _ANSI_ARGS_((XImage *ximage, unsigned char *dithered_image));/* display related data */unsigned long wpixel[3];static unsigned char *dithered_image;/* X11 related variables */static Display *display;static Window window;static GC gc;static int dpy_depth;XImage *ximage;unsigned char pixel[256];#ifdef SH_MEM#include <sys/ipc.h>#include <sys/shm.h>#include <X11/extensions/XShm.h>extern int XShmQueryExtension _ANSI_ARGS_((Display *dpy));extern int XShmGetEventBase _ANSI_ARGS_((Display *dpy));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);}static void DeInstallXErrorHandler(){  XSetErrorHandler(NULL);  XFlush(display);}#endif/* connect to server, create and map window, * allocate colors and (shared) memory */void init_display(name)char *name;{  int crv, cbu, cgu, cgv;  int y, u, v, r, g, b;  int i;  char dummy;  int screen;  Visual *visual;  int dpy_class;  Colormap cmap;  int private;  XColor xcolor;  unsigned int fg, bg;  char *hello = "H.263 Display";  XSizeHints hint;  XEvent xev;  XSetWindowAttributes xswa;  unsigned long tmp_pixel;  unsigned int mask;  display = XOpenDisplay(name);  if (display == NULL)    error("Can not open display\n");  screen = DefaultScreen(display);  visual = DefaultVisual (display, screen);  dpy_depth = DefaultDepth (display, screen);  dpy_class = visual->class;  if (!((dpy_class == TrueColor && dpy_depth == 32)        || (dpy_class == TrueColor && dpy_depth == 24)        || (dpy_class == TrueColor && dpy_depth == 16)        || (dpy_class == PseudoColor && dpy_depth == 8)))    error ("requires 8 bit PseudoColor or 16/24/32 bit TrueColor display\n");  if (dpy_class == TrueColor && dpy_depth == 32)    printf("TrueColor : 32 bit colordepth\n");  if (dpy_class == TrueColor && dpy_depth == 24)    printf("TrueColor : 24 bit colordepth\n");  if (dpy_class == TrueColor && dpy_depth == 16)    printf("TrueColor : 16 bit colordepth\n");  if (dpy_class == PseudoColor && dpy_depth == 8)    printf("PseudoColor : 8 bit colordepth, 4x4 ordered dither\n");  /* width and height of the display window */  if (expand) {    hint.min_width = hint.max_width = hint.width = 2*horizontal_size;    hint.min_height = hint.max_height = hint.height = 2*vertical_size;  }  else {    hint.min_width = hint.max_width = hint.width = horizontal_size;    hint.min_height = hint.max_height = hint.height = vertical_size;  }  hint.flags = PSize | PMinSize | PMaxSize;  /* Get some colors */  bg = WhitePixel (display, screen);  fg = BlackPixel (display, screen);  /* Make the window */  mask = CWBackPixel | CWBorderPixel;  if (dpy_depth == 32 || dpy_depth == 24 || dpy_depth == 16) {    mask |= CWColormap;    xswa.colormap = XCreateColormap (display, DefaultRootWindow (display),             visual, AllocNone);  }  xswa.background_pixel = bg;  xswa.border_pixel = fg;  window = XCreateWindow (display, DefaultRootWindow (display),          hint.x, hint.y, hint.width, hint.height,          1, dpy_depth, InputOutput, visual, mask, &xswa);  XSelectInput(display, window, StructureNotifyMask);  /* Tell other applications about this window */  XSetStandardProperties (display, window, hello, hello, None, NULL, 0, &hint);  /* Map window. */  XMapWindow(display, window);  /* Wait for map. */  do  {    XNextEvent(display, &xev);  }  while (xev.type != MapNotify || xev.xmap.event != window);  XSelectInput(display, window, NoEventMask);  /* allocate colors */  gc = DefaultGC(display, screen);  if (dpy_depth == 8) {    XWindowAttributes xwa;    cmap = DefaultColormap(display, screen);    private = 0;    /* matrix coefficients */    crv = convmat[matrix_coefficients][0];    cbu = convmat[matrix_coefficients][1];    cgu = convmat[matrix_coefficients][2];    cgv = convmat[matrix_coefficients][3];    /* 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     * yyyy=0001 and yyyy=1111, this leaves 48 colors for other applications     *     * the allocated colors correspond to the following Y, U and V values:     * Y:   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=32; i<240; i++) {      /* color space conversion */      y = 16*((i>>4)&15) + 8;      u = 32*((i>>2)&3)  - 48;      v = 32*(i&3)       - 48;      y = 76309 * (y - 16); /* (255/219)*65536 */            r = clp[(y + crv*v + 32768)>>16];      g = clp[(y - cgu*u -cgv*v + 32768)>>16];      b = clp[(y + cbu*u + 32786)>>16];      /* X11 colors are 16 bit */      xcolor.red   = r << 8;      xcolor.green = g << 8;      xcolor.blue  = b << 8;      if (XAllocColor(display, 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)          fprintf(stderr, "Using private colormap (%d colors were "          "available).\n", i-32);        /* Free colors. */        while (--i >= 32)        {          tmp_pixel = pixel[i]; /* because XFreeColors expects unsigned long */          XFreeColors(display, cmap, &tmp_pixel, 1, 0);        }        /* i is now 31, this restarts the outer loop */        /* create private colormap */        XGetWindowAttributes(display, window, &xwa);        cmap = XCreateColormap(display, window, xwa.visual, AllocNone);        XSetWindowColormap(display, window, cmap);      }    }  }#ifdef SH_MEM  if (XShmQueryExtension(display))    shmem_flag = 1;  else  {    shmem_flag = 0;    if (!quiet)      fprintf(stderr, "Shared memory not supported\nReverting to normal "              "Xlib\n");  }  if (shmem_flag)    CompletionType = XShmGetEventBase(display) + ShmCompletion;  InstallXErrorHandler();  if (shmem_flag)  {    if (expand)      ximage = XShmCreateImage(display, visual, dpy_depth, ZPixmap, NULL,               &shminfo1,               2*coded_picture_width, 2*coded_picture_height);    else      ximage = XShmCreateImage(display, visual, dpy_depth, ZPixmap, NULL,               &shminfo1,               coded_picture_width, coded_picture_height);        /* If no go, then revert to normal Xlib calls. */    if (ximage==NULL)    {      if (ximage!=NULL)        XDestroyImage(ximage);      if (!quiet)        fprintf(stderr, "Shared memory error, disabling (Ximage error)\n");      goto shmemerror;    }    /* Success here, continue. */    shminfo1.shmid = shmget(IPC_PRIVATE,                             ximage->bytes_per_line * ximage->height,                            IPC_CREAT | 0777);    if (shminfo1.shmid<0)    {      XDestroyImage(ximage);      if (!quiet)        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))    {      XDestroyImage(ximage);      if (shminfo1.shmaddr!=((char *) -1))        shmdt(shminfo1.shmaddr);      if (!quiet)      {        fprintf(stderr, "Shared memory error, disabling (address error)\n");      }      goto shmemerror;    }    ximage->data = shminfo1.shmaddr;    dithered_image = (unsigned char *)ximage->data;    shminfo1.readOnly = False;    XShmAttach(display, &shminfo1);    XSync(display, False);    if (gXErrorFlag)    {      /* Ultimate failure here. */      XDestroyImage(ximage);      shmdt(shminfo1.shmaddr);      if (!quiet)        fprintf(stderr, "Shared memory error, disabling.\n");      gXErrorFlag = 0;      goto shmemerror;    }    else    {      shmctl(shminfo1.shmid, IPC_RMID, 0);    }    if (!quiet)    {      fprintf(stderr, "Sharing memory.\n");    }  }  else  {shmemerror:    shmem_flag = 0;#endif    if (expand) {      ximage = XCreateImage(display,visual,dpy_depth,ZPixmap,0,&dummy,            2*coded_picture_width,2*coded_picture_height,8,0);      if (!(dithered_image =            (unsigned char *)malloc(coded_picture_width*coded_picture_height*            (dpy_depth > 8 ? sizeof (int)*4 :              sizeof (unsigned char))*4)))        error("malloc failed");    }    else {      ximage = XCreateImage(display,visual,dpy_depth,ZPixmap,0,&dummy,            coded_picture_width,coded_picture_height,8,0);      if (!(dithered_image =            (unsigned char *)malloc(coded_picture_width*coded_picture_height*            (dpy_depth > 8 ? sizeof (int) :              sizeof (unsigned char)))))        error("malloc failed");    }#ifdef SH_MEM  }  DeInstallXErrorHandler();#endif  if (dpy_depth == 32 || dpy_depth == 24 || dpy_depth == 16) {    XWindowAttributes xwa;    XGetWindowAttributes(display, window, &xwa);    wpixel[0] = xwa.visual->red_mask;    wpixel[1] = xwa.visual->green_mask;    wpixel[2] = xwa.visual->blue_mask;    /* If the colors in 16/24/32-bit mode are wrong, try this instead       of the above three lines */    /*    wpixel[2] = xwa.visual->red_mask;    wpixel[1] = xwa.visual->green_mask;    wpixel[0] = xwa.visual->blue_mask;    */    InitColorDither(dpy_depth == 24 || dpy_depth == 32);  }  else {    ord4x4_dither_init ();  }}void exit_display()//此函數(shù)用來(lái)在結(jié)束解碼進(jìn)程時(shí)釋放原來(lái)占用的空間{#ifdef SH_MEM  if (shmem_flag)  {    XShmDetach(display, &shminfo1);    XDestroyImage(ximage);//用來(lái)釋放數(shù)據(jù)    shmdt(shminfo1.shmaddr);//將該進(jìn)程中的shmid無(wú)效化,釋放原來(lái)共享的內(nèi)存段  }#endif}static void display_image(ximage,dithered_image)XImage *ximage;unsigned char *dithered_image;{  int t = 1; /* Always work in native bit and byte order. This tells Xlib to    reverse bit and byte order if necessary when crossing a    network. Frankly, this part of XImages is somewhat    underdocumented, so this may not be exactly correct.  */  if (*(char *)&t == 1) {    ximage->byte_order = LSBFirst;    ximage->bitmap_bit_order = LSBFirst;  }  else {    ximage->byte_order = MSBFirst;    ximage->bitmap_bit_order = MSBFirst;  }      /* display dithered image */#ifdef SH_MEM  if (shmem_flag)  {    XShmPutImage(display, window, gc, ximage,                  0, 0, 0, 0, ximage->width, ximage->height, True);    XFlush(display);          while (1)    {      XEvent xev;              XNextEvent(display, &xev);      if (xev.type == CompletionType)        break;    }  }  else #endif  {    ximage->data = (char *) dithered_image;     XPutImage(display, window, gc, ximage, 0, 0, 0, 0, ximage->width, ximage->height);  }}void dither(src)unsigned char *src[];{  if (dpy_depth == 24 || dpy_depth == 32) {    if (ximage->bits_per_pixel == 24)      ConvertYUVtoRGB(src[0],src[1],src[2], dithered_image,		      coded_picture_width,		      coded_picture_height);    else      Color32DitherImage(src, dithered_image);  }    else if (dpy_depth == 16) {    Color16DitherImage(src, dithered_image);  }  else {    ord4x4_dither_frame (src, dithered_image);  }  display_image (ximage, dithered_image);}#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕色av一区二区三区| 精品亚洲国产成人av制服丝袜| 久久久国产精品不卡| 精品久久久久久综合日本欧美| 制服丝袜中文字幕亚洲| 欧美肥大bbwbbw高潮| 7777精品伊人久久久大香线蕉完整版 | 在线区一区二视频| 色综合久久久久| 91久久精品日日躁夜夜躁欧美| 99re在线精品| 91美女在线视频| 欧亚洲嫩模精品一区三区| 欧美体内she精高潮| 欧美欧美欧美欧美| 日韩一级高清毛片| wwwwxxxxx欧美| 国产精品伦理一区二区| 亚洲欧美国产三级| 亚洲国产中文字幕在线视频综合| 亚洲第一二三四区| 蜜桃av噜噜一区| 国产福利91精品一区| 97久久超碰国产精品电影| 在线观看av一区| 日韩一区二区电影在线| 国产午夜亚洲精品理论片色戒 | 亚洲福利电影网| 免费人成在线不卡| 国产在线精品一区二区夜色| 成人高清免费观看| 欧美无砖砖区免费| 日韩视频一区二区在线观看| 久久久亚洲国产美女国产盗摄| 国产欧美一区二区在线| 日韩毛片高清在线播放| 亚洲图片一区二区| 国产一区二区三区香蕉| 色综合久久综合网| 日韩你懂的在线播放| 中文字幕亚洲电影| 丝袜诱惑制服诱惑色一区在线观看 | 国内久久精品视频| 色综合一个色综合亚洲| 欧美电影免费提供在线观看| 国产精品毛片久久久久久| 亚洲一区二区三区美女| 国产综合久久久久影院| 色屁屁一区二区| 精品久久久网站| 一区二区三区免费网站| 久久国产精品第一页| 97国产一区二区| 日韩亚洲欧美在线| 亚洲精品自拍动漫在线| 国内精品伊人久久久久av影院 | 99国内精品久久| 69av一区二区三区| 国产精品久久久久影院| 日日摸夜夜添夜夜添国产精品| 国产成人精品一区二区三区网站观看| 在线观看亚洲成人| 欧美激情艳妇裸体舞| 日韩av不卡一区二区| 91视频在线观看| 精品成人a区在线观看| 亚洲一区二区三区中文字幕| 国产99久久久国产精品潘金 | √…a在线天堂一区| 久草这里只有精品视频| 在线看日韩精品电影| 久久久www成人免费毛片麻豆 | 婷婷国产在线综合| www.性欧美| 久久久精品国产免大香伊| 视频一区视频二区在线观看| www.日韩大片| 欧美激情综合网| 欧美aaaaaa午夜精品| 91久久国产综合久久| 亚洲欧美综合另类在线卡通| 精品一区二区在线观看| 欧美日韩久久一区| 亚洲综合无码一区二区| 成人小视频在线观看| 精品久久久久久无| 麻豆免费精品视频| 欧美另类videos死尸| 亚洲国产精品久久久久秋霞影院| av毛片久久久久**hd| 国产精品毛片久久久久久久| 国内精品视频一区二区三区八戒| 91精品中文字幕一区二区三区| 亚洲精品乱码久久久久久| aaa亚洲精品| 中文字幕免费不卡在线| 国产一区中文字幕| 久久久国产精品午夜一区ai换脸| 精品一区二区三区视频| 日韩视频免费观看高清完整版 | 久久久精品人体av艺术| 激情综合色播五月| 精品国产乱子伦一区| 久久国产精品72免费观看| 91精品国产色综合久久不卡蜜臀 | 国产精品美女视频| 国产成人自拍网| 久久久亚洲午夜电影| 国产成人免费9x9x人网站视频| 久久蜜桃av一区二区天堂| 国产在线精品国自产拍免费| 久久女同性恋中文字幕| 国产精品亚洲视频| 国产精品视频线看| 成人黄色国产精品网站大全在线免费观看 | av电影天堂一区二区在线| 中文字幕av资源一区| 99久久99久久久精品齐齐| 亚洲欧美激情在线| 欧洲激情一区二区| 日本中文一区二区三区| 日韩一区二区三区四区五区六区| 日本美女一区二区三区| 精品欧美黑人一区二区三区| 国产乱理伦片在线观看夜一区 | 国产99精品在线观看| 国产精品久久久久久久久免费相片| jlzzjlzz欧美大全| 夜夜精品视频一区二区| 欧美日韩不卡一区| 狠狠v欧美v日韩v亚洲ⅴ| 欧美国产激情二区三区 | 国产精品伦理在线| 欧美在线一区二区| 久久成人18免费观看| 欧美极品xxx| 欧美网站一区二区| 久久av资源站| 国产精品成人一区二区艾草 | 久久精品欧美日韩精品| 97久久久精品综合88久久| 午夜精品久久一牛影视| 精品欧美一区二区三区精品久久| 国产露脸91国语对白| 亚洲综合免费观看高清完整版在线| 欧美一区二区视频观看视频 | 久久夜色精品国产欧美乱极品| 高清日韩电视剧大全免费| 亚洲最大色网站| 精品国产伦一区二区三区观看方式 | 精品少妇一区二区三区在线视频| 成人黄色综合网站| 日韩电影免费在线观看网站| 中文字幕不卡的av| 337p亚洲精品色噜噜| 不卡的av在线播放| 青娱乐精品视频在线| 亚洲图片欧美激情| 欧美精品久久久久久久多人混战| 国产激情视频一区二区三区欧美| 亚洲国产人成综合网站| 精品国产三级a在线观看| 91美女蜜桃在线| 国内一区二区视频| 午夜欧美在线一二页| 中文字幕中文字幕中文字幕亚洲无线 | 欧美视频一区二| 成人综合日日夜夜| 日本不卡123| 一区二区不卡在线播放| 中文字幕乱码日本亚洲一区二区| 在线播放91灌醉迷j高跟美女| 丁香激情综合五月| 麻豆精品久久久| 亚洲国产美女搞黄色| 国产精品区一区二区三区| 精品精品欲导航| 欧美精品免费视频| 在线观看精品一区| 成人av网在线| 国模一区二区三区白浆| 日本网站在线观看一区二区三区| 18涩涩午夜精品.www| 久久先锋影音av鲁色资源网| 欧美日韩高清在线| 色88888久久久久久影院野外| 成人激情动漫在线观看| 国产在线麻豆精品观看| 麻豆91精品91久久久的内涵| 亚洲成人午夜影院| 一区二区欧美精品| 亚洲精品中文字幕在线观看| 中文字幕在线不卡一区二区三区 | 天天综合天天做天天综合| 自拍偷拍亚洲综合| 国产精品久久久久永久免费观看| 国产天堂亚洲国产碰碰| 精品国产123| 26uuu欧美日本| 欧美大片在线观看一区|