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

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

?? display.c

?? H264EncPlayer,H264協議解碼與播放代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/************************************************************************
 *
 *  display.c, X11 interface for tmndecode (H.263 decoder)
 *  Copyright (C) 1995, 1996  Telenor R&D, Norway
 *
 *  Contacts:
 *  Robert Danielsen                  <Robert.Danielsen@nta.no>
 *
 *  Telenor Research and Development  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
 *
 *  Copyright (C) 1997  University of BC, Canada
 *  Modified by: Michael Gallant <mikeg@ee.ubc.ca>
 *               Guy Cote <guyc@ee.ubc.ca>
 *               Berna Erol <bernae@ee.ubc.ca>
 *               
 *  Contacts:
 *  Michael Gallant                   <mikeg@ee.ubc.ca>
 *
 *  UBC Image Processing Laboratory   http://www.ee.ubc.ca/image
 *  2356 Main Mall                    tel.: +1 604 822 4051
 *  Vancouver BC Canada V6T1Z4        fax.: +1 604 822 5949
 *
 ************************************************************************/

/* Disclaimer of Warranty
 * 
 * These software programs are available to the user without any license fee
 * or royalty on an "as is" basis. The University of British Columbia
 * 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 University of British Columbia does not represent or warrant that the
 * programs furnished hereunder are free of infringement of any
 * third-party patents.
 * 
 * Commercial implementations of H.263, 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.
 * 
 */


/* 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 */



#include <stdio.h>
#include <stdlib.h>

#include <X11/Xlib.h>
#include <X11/Xutil.h>

#include "display.h"

#ifdef USE_DISPLAY
/* 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;

int expand = 0;
int quiet = 1;
int horizontal_size = 176;
int vertical_size = 144;
int coded_picture_width = 176;
int coded_picture_height = 144;
int ref_coded_picture_width = 176, ref_coded_picture_height = 144;
int chrom_width = 88, chrom_height = 72;//, blk_cnt;
int ref_chrom_width = 88, ref_chrom_height = 72;
int matrix_coefficients = 5;
unsigned char * clp = NULL;
unsigned char * clp1 = NULL;
int convmat[8][4]
=
{
  {117504, 138453, 13954, 34903}, /* no sequence_display_extension */
  {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */
  {104597, 132201, 25675, 53279}, /* unspecified */
  {104597, 132201, 25675, 53279}, /* reserved */
  {104448, 132798, 24759, 53109}, /* FCC */
  {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */
  {104597, 132201, 25675, 53279}, /* SMPTE 170M */
  {117579, 136230, 16907, 35559}/* SMPTE 240M (1987) */
}  ;


/* X11 related variables */
static Display *display;
static Window window;
static GC gc;
static int dpy_depth;

XImage *ximage;

unsigned char pixel[256];
#define SH_MEM
#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 (char *name, int width, int height)
{
  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;
  XSizeHints hint;
  XEvent xev;
  XSetWindowAttributes xswa;
  unsigned long tmp_pixel;
  unsigned int mask;
  char *hello = "H.264 Display";
  horizontal_size = width;
  vertical_size = height;
  coded_picture_width = width;
  coded_picture_height = height;
  ref_coded_picture_width = width;
  ref_coded_picture_height = height;
  chrom_width = (width >> 1);
  chrom_height = (height >> 1);
  ref_chrom_width = (width >> 1);
  ref_chrom_height = (height >> 1);
  
  display = XOpenDisplay (name);

  if (display == NULL)
    perror ("Can not open display\n");
  init_dither_tab();
  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)))
    perror ("requires 8 bit PseudoColor or 16/24/32 bit TrueColor display\n");

  if (dpy_class == TrueColor && dpy_depth == 32)
    perror("TrueColor : 32 bit colordepth\n");
  if (dpy_class == TrueColor && dpy_depth == 24)
    perror ("TrueColor : 24 bit colordepth\n");
  if (dpy_class == TrueColor && dpy_depth == 16)
    perror ("TrueColor : 16 bit colordepth\n");
  if (dpy_class == PseudoColor && dpy_depth == 8)
    perror ("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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
毛片av一区二区| 成人黄色片在线观看| 国产一区三区三区| 99r国产精品| 欧美精品一区二区三区在线播放| 欧美激情一区不卡| 久久激五月天综合精品| 欧洲精品一区二区| 中文字幕在线观看一区二区| 日本亚洲一区二区| 在线亚洲精品福利网址导航| 久久综合色之久久综合| 日本免费在线视频不卡一不卡二| 色猫猫国产区一区二在线视频| 欧美α欧美αv大片| 亚洲gay无套男同| a4yy欧美一区二区三区| 欧美国产日韩亚洲一区| 九色|91porny| 欧美一二三在线| 日韩精品一二区| 欧美乱妇15p| 亚洲成a人v欧美综合天堂| 99久久99久久久精品齐齐| 久久久亚洲午夜电影| 国产在线精品视频| 精品日韩成人av| 奇米精品一区二区三区在线观看| 欧美人牲a欧美精品| 亚洲综合色区另类av| 91在线精品一区二区| 国产精品久久影院| 不卡一区二区在线| 日本一区二区在线不卡| 国产一区日韩二区欧美三区| 精品捆绑美女sm三区| 久草在线在线精品观看| 精品第一国产综合精品aⅴ| 久久99久久99精品免视看婷婷| 欧美一区二区二区| 极品少妇xxxx精品少妇偷拍 | 亚洲成人久久影院| 在线观看亚洲a| 亚洲一区二区三区中文字幕 | 国产一区91精品张津瑜| 久久久久高清精品| 成人一级视频在线观看| 一区二区中文视频| 欧洲精品在线观看| 久久国产尿小便嘘嘘| 久久综合久久久久88| 成人免费精品视频| 亚洲蜜臀av乱码久久精品蜜桃| 色婷婷国产精品久久包臀| 午夜精品福利视频网站| 欧美一区二区三区视频免费播放| 麻豆国产精品777777在线| 久久久精品天堂| 91麻豆国产福利在线观看| 亚洲一二三四区不卡| 日韩欧美国产一二三区| 国产suv精品一区二区883| 一区二区三区四区不卡视频| 欧美一级高清片| 成人aa视频在线观看| 性久久久久久久| 欧美极品美女视频| 欧美人牲a欧美精品| 国产乱理伦片在线观看夜一区| 亚洲精品国产a久久久久久| 日韩一级完整毛片| 色综合久久66| 国内成+人亚洲+欧美+综合在线| 亚洲视频 欧洲视频| 欧美一区二区三区四区视频| www.日韩在线| 麻豆91精品91久久久的内涵| 亚洲成人自拍网| 国产成人亚洲综合a∨婷婷图片| 欧美日韩的一区二区| 国产精品主播直播| 亚洲成人精品一区二区| 欧美激情资源网| 91精品国产综合久久精品app| 国产精品18久久久久久久久久久久| 一区二区三区欧美日| 精品日韩在线观看| 欧美日韩aaaaa| 91影院在线免费观看| 国产精品1区二区.| 免费观看在线色综合| 亚洲第一福利视频在线| 最新欧美精品一区二区三区| 久久综合九色综合欧美就去吻 | 亚洲国产精品高清| 日韩欧美中文字幕制服| 91在线视频网址| 处破女av一区二区| 国产激情一区二区三区四区 | 国产91丝袜在线观看| 蜜臀久久99精品久久久久久9| 一区二区三区在线免费| 国产精品三级av| 国产性天天综合网| 欧美成人女星排名| 欧美美女一区二区| 欧美日韩精品电影| 欧美日韩精品一区视频| 欧美日韩美少妇| 欧美午夜精品理论片a级按摩| 色94色欧美sute亚洲13| 色综合久久99| 亚洲精品免费电影| 在线这里只有精品| 亚洲午夜久久久久久久久久久| 国产三级精品三级| 久久综合九色综合久久久精品综合| 3atv一区二区三区| 日韩三级免费观看| 欧美va亚洲va国产综合| 欧美r级在线观看| 久久久91精品国产一区二区三区| 久久久久久久电影| 亚洲国产成人自拍| 亚洲天堂久久久久久久| 亚洲精选一二三| 婷婷综合久久一区二区三区| 视频一区二区中文字幕| 日产国产欧美视频一区精品| 另类欧美日韩国产在线| 韩国精品免费视频| yourporn久久国产精品| 在线观看亚洲成人| 欧美大胆一级视频| 国产欧美日韩亚州综合| 亚洲精品国产一区二区三区四区在线| 亚洲综合999| 狂野欧美性猛交blacked| 国产成人综合亚洲网站| 色噜噜夜夜夜综合网| 日韩精品中文字幕一区二区三区| 26uuu国产电影一区二区| 国产精品久久午夜| 午夜国产不卡在线观看视频| 麻豆91精品视频| 91丨porny丨中文| 91麻豆精品国产91久久久使用方法 | 欧美日韩国产片| ww亚洲ww在线观看国产| 亚洲免费资源在线播放| 日本免费在线视频不卡一不卡二| 国产麻豆日韩欧美久久| 色综合久久综合网欧美综合网| 欧美一区二区视频在线观看| 欧美国产欧美综合| 天堂蜜桃一区二区三区| 从欧美一区二区三区| 欧美精品久久久久久久久老牛影院| 欧美精品一区二区三区高清aⅴ| 国产精品美女www爽爽爽| 日韩国产成人精品| 91在线观看地址| 久久亚洲精品小早川怜子| 夜夜亚洲天天久久| 国产不卡视频在线播放| 欧美二区乱c少妇| 综合久久国产九一剧情麻豆| 免费高清在线一区| 欧美亚洲愉拍一区二区| 国产欧美一区二区三区在线老狼| 亚洲第一福利一区| 91色porny蝌蚪| 久久久精品日韩欧美| 奇米影视在线99精品| 在线观看视频91| 欧美激情综合网| 精品亚洲欧美一区| 欧美一级久久久| 一区二区三国产精华液| 成人免费视频免费观看| 精品国产免费人成电影在线观看四季| 亚洲成在人线免费| 欧美性视频一区二区三区| 欧美高清在线精品一区| 国产精品自拍在线| 久久综合五月天婷婷伊人| 日本不卡视频一二三区| 欧美日本一区二区三区四区| 亚洲午夜视频在线| 欧美性xxxxx极品少妇| 一区二区三区久久| 在线观看一区日韩| 亚洲一区二区视频| 欧美吞精做爰啪啪高潮| 亚洲一级二级三级在线免费观看| 97久久超碰国产精品电影| 国产精品久久夜| 一本久久综合亚洲鲁鲁五月天| 亚洲丝袜精品丝袜在线| 色综合久久综合|