亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久尤物电影视频在线观看| 国产不卡视频一区二区三区| 在线国产亚洲欧美| 日韩一区二区免费电影| 亚洲欧美欧美一区二区三区| 韩国v欧美v日本v亚洲v| 欧美一级在线免费| 亚洲综合久久av| 99精品欧美一区二区蜜桃免费| 日韩欧美国产高清| 男女激情视频一区| 在线亚洲一区二区| 中文字幕一区二区三区不卡在线| 精品一区二区av| 欧美不卡123| 久久99精品网久久| 精品国产一区二区三区忘忧草| 洋洋av久久久久久久一区| 欧美在线一区二区| 亚洲一级片在线观看| 欧美午夜精品理论片a级按摩| 亚洲视频资源在线| 欧美视频一区二区三区在线观看 | 日韩理论在线观看| 91女厕偷拍女厕偷拍高清| 国产欧美一区二区精品仙草咪| 国产麻豆欧美日韩一区| 亚洲国产精品99久久久久久久久| 欧美另类videos死尸| 亚洲第一狼人社区| 欧美一区永久视频免费观看| 黄页网站大全一区二区| 自拍偷拍国产精品| 在线播放一区二区三区| 午夜视频在线观看一区二区三区| 在线综合+亚洲+欧美中文字幕| 午夜精品免费在线观看| 欧美变态tickle挠乳网站| 成人午夜av在线| 亚洲成人精品在线观看| 欧美成人a视频| 成人午夜av影视| 五月激情综合婷婷| 久久九九久久九九| 欧美日韩在线电影| 国产精品亚洲专一区二区三区| 久久久久97国产精华液好用吗| 播五月开心婷婷综合| 亚洲精品欧美在线| 久久这里只精品最新地址| 欧美亚洲一区二区在线观看| 国产精品自在欧美一区| 亚洲乱码国产乱码精品精的特点| 在线不卡的av| 在线观看www91| 成人av资源在线| 在线日韩一区二区| 成人三级伦理片| 久久精品国产亚洲a| 亚洲一区在线看| 成人欧美一区二区三区1314| 欧美精品一区在线观看| 欧美精品九九99久久| 91麻豆自制传媒国产之光| 国产精品资源站在线| 日韩电影网1区2区| 一区二区成人在线视频| 一区二区日韩av| 亚洲韩国精品一区| 视频在线在亚洲| 日本不卡中文字幕| 久久99精品久久久久婷婷| 久久成人免费网站| 国产精品91一区二区| 成人av资源站| 在线国产电影不卡| 91精品久久久久久久久99蜜臂| 日韩一区二区免费视频| 26uuu欧美| 中文字幕日韩一区| 亚洲成人免费av| 国产一区二三区好的| 成人av网站免费| 欧美日韩一二三| 久久日韩精品一区二区五区| 国产精品不卡视频| 日韩一区欧美二区| 国产黄色91视频| 欧美自拍偷拍午夜视频| 欧美一级xxx| 亚洲视频电影在线| 青青草97国产精品免费观看无弹窗版| 6080国产精品一区二区| 久久精品一区二区三区四区| 亚洲美腿欧美偷拍| 久久精品免费观看| 成人激情开心网| 欧美一级理论性理论a| 亚洲欧美国产毛片在线| 久久精品免费观看| 91成人免费网站| 欧美国产激情二区三区| 日韩成人午夜精品| 欧洲国内综合视频| 欧美激情一区二区三区不卡| 婷婷激情综合网| 91免费在线视频观看| 亚洲国产激情av| 久久69国产一区二区蜜臀| 欧洲精品视频在线观看| 国产精品久久久久久久久搜平片| 蜜乳av一区二区三区| 欧美性猛交xxxx黑人交| 亚洲国产成人自拍| 精彩视频一区二区| 日韩一区二区在线观看| 亚洲午夜久久久久久久久电影院| 成人一区二区三区中文字幕| 久久这里只有精品首页| 韩国精品免费视频| 欧美精品一区二区在线播放| 麻豆国产精品777777在线| 91精品国产欧美一区二区18| 亚洲成人福利片| 欧美日韩国产高清一区二区| 亚洲综合小说图片| 欧美色图12p| 一级精品视频在线观看宜春院| 色狠狠桃花综合| 亚洲大片免费看| 91精品国产综合久久精品| 日本v片在线高清不卡在线观看| 欧美老肥妇做.爰bbww视频| 91久久精品日日躁夜夜躁欧美| 一区二区三区四区在线免费观看 | 国模套图日韩精品一区二区| 精品国产1区二区| 国产a级毛片一区| 亚洲品质自拍视频| 欧洲在线/亚洲| 久久疯狂做爰流白浆xx| 中文子幕无线码一区tr| 色悠悠久久综合| 欧美aaa在线| 国产精品久久影院| 欧美一个色资源| 99久久99精品久久久久久| 午夜国产不卡在线观看视频| 久久一留热品黄| 色94色欧美sute亚洲线路二| 蜜臂av日日欢夜夜爽一区| 国产精品超碰97尤物18| 91精品黄色片免费大全| 丁香亚洲综合激情啪啪综合| 一区二区视频免费在线观看| 欧美一级黄色片| 欧美在线你懂得| 99久久精品情趣| 老司机免费视频一区二区 | 久久精品国产精品亚洲红杏| 国产精品女主播av| 欧美一级片在线观看| 97久久精品人人做人人爽50路| 午夜欧美视频在线观看| 国产欧美日韩中文久久| 91麻豆精品国产无毒不卡在线观看 | 91精品麻豆日日躁夜夜躁| 成人18视频在线播放| 人人精品人人爱| 亚洲免费观看高清完整| 中文成人综合网| 精品久久久久99| 91精品免费观看| 欧美日韩国产免费| 日本电影亚洲天堂一区| 91视频com| 91亚洲精品久久久蜜桃| 成人免费高清在线观看| 成人手机在线视频| 春色校园综合激情亚洲| 国产成人自拍网| 成人动漫中文字幕| 99精品久久免费看蜜臀剧情介绍| av在线一区二区三区| 成人免费视频app| av不卡在线播放| 欧美中文一区二区三区| 欧美在线视频日韩| 91精品国产色综合久久不卡电影| 欧美剧在线免费观看网站| 欧美高清激情brazzers| 91精品国产全国免费观看| 日韩精品在线一区二区| 久久综合精品国产一区二区三区| 久久网站热最新地址| 综合久久国产九一剧情麻豆| 亚洲午夜在线电影| 蜜桃av一区二区在线观看 | 五月婷婷综合在线| 国产一区二区日韩精品|