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

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

?? store.c

?? MPEG2解編碼程序源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* store.c, picture output routines                                         */

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

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

#include "config.h"
#include "global.h"

/* private prototypes */
static void store_one _ANSI_ARGS_((char *outname, unsigned char *src[],
  int offset, int incr, int height));
static void store_yuv _ANSI_ARGS_((char *outname, unsigned char *src[],
  int offset, int incr, int height));
static void store_sif _ANSI_ARGS_((char *outname, unsigned char *src[],
  int offset, int incr, int height));
static void store_ppm_tga _ANSI_ARGS_((char *outname, unsigned char *src[],
  int offset, int incr, int height, int tgaflag));
static void store_yuv1 _ANSI_ARGS_((char *name, unsigned char *src,
  int offset, int incr, int width, int height));
static void putbyte _ANSI_ARGS_((int c));
static void putword _ANSI_ARGS_((int w));
static void conv422to444 _ANSI_ARGS_((unsigned char *src, unsigned char *dst));
static void conv420to422 _ANSI_ARGS_((unsigned char *src, unsigned char *dst));

#define OBFRSIZE 4096
static unsigned char obfr[OBFRSIZE];
static unsigned char *optr;
static int outfile;

/*
 * store a picture as either one frame or two fields
 */
void Write_Frame(src,frame)
unsigned char *src[];
int frame;
{
  char outname[FILENAME_LENGTH];

  if (progressive_sequence || progressive_frame || Frame_Store_Flag)
  {
    /* progressive */
    sprintf(outname,Output_Picture_Filename,frame,'f');
    store_one(outname,src,0,Coded_Picture_Width,vertical_size);
  }
  else
  {
    /* interlaced */
    sprintf(outname,Output_Picture_Filename,frame,'a');
    store_one(outname,src,0,Coded_Picture_Width<<1,vertical_size>>1);

    sprintf(outname,Output_Picture_Filename,frame,'b');
    store_one(outname,src,
      Coded_Picture_Width,Coded_Picture_Width<<1,vertical_size>>1);
  }
}

/*
 * store one frame or one field
 */
static void store_one(outname,src,offset,incr,height)
char *outname;
unsigned char *src[];
int offset, incr, height;
{
  switch (Output_Type)
  {
  case T_YUV:
    store_yuv(outname,src,offset,incr,height);
    break;
  case T_SIF:
    store_sif(outname,src,offset,incr,height);
    break;
  case T_TGA:
    store_ppm_tga(outname,src,offset,incr,height,1);
    break;
  case T_PPM:
    store_ppm_tga(outname,src,offset,incr,height,0);
    break;
#ifdef DISPLAY
  case T_X11:
    dither(src);
    break;
#endif
  default:
    break;
  }
}

/* separate headerless files for y, u and v */
static void store_yuv(outname,src,offset,incr,height)
char *outname;
unsigned char *src[];
int offset,incr,height;
{
  int hsize;
  char tmpname[FILENAME_LENGTH];

  hsize = horizontal_size;

  sprintf(tmpname,"%s.Y",outname);
  store_yuv1(tmpname,src[0],offset,incr,hsize,height);

  if (chroma_format!=CHROMA444)
  {
    offset>>=1; incr>>=1; hsize>>=1;
  }

  if (chroma_format==CHROMA420)
  {
    height>>=1;
  }

  sprintf(tmpname,"%s.U",outname);
  store_yuv1(tmpname,src[1],offset,incr,hsize,height);

  sprintf(tmpname,"%s.V",outname);
  store_yuv1(tmpname,src[2],offset,incr,hsize,height);
}

/* auxiliary routine */
static void store_yuv1(name,src,offset,incr,width,height)
char *name;
unsigned char *src;
int offset,incr,width,height;
{
  int i, j;
  unsigned char *p;

  if (!Quiet_Flag)
    fprintf(stderr,"saving %s\n",name);

  if ((outfile = open(name,O_CREAT|O_TRUNC|O_WRONLY|O_BINARY,0666))==-1)
  {
    sprintf(Error_Text,"Couldn't create %s\n",name);
    Error(Error_Text);
  }

  optr=obfr;

  for (i=0; i<height; i++)
  {
    p = src + offset + incr*i;
    for (j=0; j<width; j++)
      putbyte(*p++);
  }

  if (optr!=obfr)
    write(outfile,obfr,optr-obfr);

  close(outfile);
}

/*
 * store as headerless file in U,Y,V,Y format
 */
static void store_sif (outname,src,offset,incr,height)
char *outname;
unsigned char *src[];
int offset, incr, height;
{
  int i,j;
  unsigned char *py, *pu, *pv;
  static unsigned char *u422, *v422;

  if (chroma_format==CHROMA444)
    Error("4:4:4 not supported for SIF format");

  if (chroma_format==CHROMA422)
  {
    u422 = src[1];
    v422 = src[2];
  }
  else
  {
    if (!u422)
    {
      if (!(u422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
                                           *Coded_Picture_Height)))
        Error("malloc failed");
      if (!(v422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
                                           *Coded_Picture_Height)))
        Error("malloc failed");
    }
  
    conv420to422(src[1],u422);
    conv420to422(src[2],v422);
  }

  strcat(outname,".SIF");

  if (!Quiet_Flag)
    fprintf(stderr,"saving %s\n",outname);

  if ((outfile = open(outname,O_CREAT|O_TRUNC|O_WRONLY|O_BINARY,0666))==-1)
  {
    sprintf(Error_Text,"Couldn't create %s\n",outname);
    Error(Error_Text);
  }

  optr = obfr;

  for (i=0; i<height; i++)
  {
    py = src[0] + offset + incr*i;
    pu = u422 + (offset>>1) + (incr>>1)*i;
    pv = v422 + (offset>>1) + (incr>>1)*i;

    for (j=0; j<horizontal_size; j+=2)
    {
      putbyte(*pu++);
      putbyte(*py++);
      putbyte(*pv++);
      putbyte(*py++);
    }
  }

  if (optr!=obfr)
    write(outfile,obfr,optr-obfr);

  close(outfile);
}

/*
 * store as PPM (PBMPLUS) or uncompressed Truevision TGA ('Targa') file
 */
static void store_ppm_tga(outname,src,offset,incr,height,tgaflag)
char *outname;
unsigned char *src[];
int offset, incr, height;
int tgaflag;
{
  int i, j;
  int y, u, v, r, g, b;
  int crv, cbu, cgu, cgv;
  unsigned char *py, *pu, *pv;
  static unsigned char tga24[14] = {0,0,2,0,0,0,0, 0,0,0,0,0,24,32};
  char header[FILENAME_LENGTH];
  static unsigned char *u422, *v422, *u444, *v444;

  if (chroma_format==CHROMA444)
  {
    u444 = src[1];
    v444 = src[2];
  }
  else
  {
    if (!u444)
    {
      if (chroma_format==CHROMA420)
      {
        if (!(u422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
                                             *Coded_Picture_Height)))
          Error("malloc failed");
        if (!(v422 = (unsigned char *)malloc((Coded_Picture_Width>>1)
                                             *Coded_Picture_Height)))
          Error("malloc failed");
      }

      if (!(u444 = (unsigned char *)malloc(Coded_Picture_Width
                                           *Coded_Picture_Height)))
        Error("malloc failed");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频黄免费的久久| 91免费版在线看| 欧美剧情片在线观看| 国产精品嫩草影院com| 国产91精品在线观看| 精品国产污网站| 久久99日本精品| 中文字幕高清不卡| 国产成人免费xxxxxxxx| 国产无一区二区| 国产在线视频一区二区| 欧美日韩美少妇| 日韩va亚洲va欧美va久久| 欧美一区二区久久| 九九国产精品视频| 国产清纯在线一区二区www| 国产精品夜夜爽| 中文字幕欧美区| 99re这里只有精品首页| 性做久久久久久| 91精品午夜视频| 国内精品在线播放| 国产精品视频一区二区三区不卡| 91美女精品福利| 天天影视涩香欲综合网| 欧美电影免费观看高清完整版在| 国产麻豆91精品| 日韩精品一二区| 日韩欧美专区在线| 丰满少妇久久久久久久| 久久青草欧美一区二区三区| voyeur盗摄精品| 亚洲欧美偷拍卡通变态| 国产精品12区| 亚洲美女视频一区| 欧美一卡在线观看| 国模冰冰炮一区二区| 一区二区三区精品视频| 日韩三级视频在线看| 成人永久看片免费视频天堂| 亚洲综合男人的天堂| 国产偷国产偷精品高清尤物| 91麻豆成人久久精品二区三区| 性久久久久久久久久久久| 久久久综合精品| 欧美喷潮久久久xxxxx| 国产黄色精品视频| 亚洲国产精品一区二区www在线| 91精品国产乱码| 91捆绑美女网站| 卡一卡二国产精品| 亚洲一区二区三区四区不卡| 精品国免费一区二区三区| 欧美三级电影网| k8久久久一区二区三区| 亚洲免费色视频| 26uuu亚洲| 日韩亚洲欧美高清| 欧美亚州韩日在线看免费版国语版| 亚洲香肠在线观看| 精品嫩草影院久久| 成人一级视频在线观看| 日韩精品一二三区| 亚洲韩国精品一区| 久久久www成人免费毛片麻豆 | 国产精品欧美久久久久无广告 | 欧美精品1区2区| 午夜视频一区在线观看| 中文字幕精品—区二区四季| 一区二区理论电影在线观看| 欧美日本一区二区在线观看| 成人app在线观看| 亚洲中国最大av网站| 国产女人水真多18毛片18精品视频 | 日本中文字幕一区二区视频 | 欧美国产在线观看| 日韩精品在线一区| 制服丝袜国产精品| 欧美综合天天夜夜久久| 国产一区三区三区| 久久狠狠亚洲综合| 日本欧美韩国一区三区| 亚洲成a人片在线观看中文| 国产女人aaa级久久久级| 精品粉嫩超白一线天av| 日韩一区二区三区观看| 欧美三级视频在线观看| 一区二区视频在线| 一区二区三区国产精品| 亚洲另类春色校园小说| 国产精品美女www爽爽爽| 欧美成人a∨高清免费观看| 一本色道久久综合精品竹菊| 91免费看`日韩一区二区| 91麻豆自制传媒国产之光| 成人黄色av电影| 不卡一区二区中文字幕| 床上的激情91.| av电影在线观看不卡| 不卡一区二区三区四区| 岛国一区二区三区| 成人高清在线视频| 色av综合在线| 欧美精品自拍偷拍动漫精品| 久久亚洲综合色| 国产精品少妇自拍| 一区二区三区精品| 日韩中文欧美在线| 国产aⅴ综合色| 99re视频这里只有精品| 欧美性生活影院| 欧美性猛片aaaaaaa做受| 日韩欧美亚洲一区二区| 国产欧美一区二区精品性色超碰| 日韩一区在线免费观看| 国产精品国产自产拍高清av王其| 亚洲自拍偷拍网站| 欧美a级理论片| 国产不卡在线一区| 欧美日韩亚洲国产综合| 精品三级av在线| 欧美高清一级片在线观看| 亚洲欧美日韩在线播放| 日韩电影在线一区| 美女一区二区视频| 99久久伊人网影院| 欧美日韩夫妻久久| 日韩一区二区高清| 伊人婷婷欧美激情| 日本亚洲视频在线| 成人毛片视频在线观看| 欧美影视一区在线| 日韩精品在线网站| 亚洲免费观看在线观看| 日韩国产欧美三级| 色综合天天综合| 欧美成人精品1314www| 一区在线中文字幕| 蜜臂av日日欢夜夜爽一区| 99热99精品| 精品久久久久久无| 亚洲欧洲日产国产综合网| 国产在线看一区| 欧美在线高清视频| 久久精品亚洲精品国产欧美kt∨| 亚洲猫色日本管| 精品在线免费观看| 在线观看av不卡| 久久久久久免费毛片精品| 日本不卡中文字幕| 在线日韩一区二区| 国产欧美精品一区二区色综合朱莉| 五月天亚洲精品| av一区二区三区黑人| 精品999久久久| 亚洲国产美国国产综合一区二区| 国产盗摄女厕一区二区三区| 欧美精品v国产精品v日韩精品| 亚洲欧洲一区二区在线播放| 国产一区二区在线观看免费 | 免费一区二区视频| 色婷婷狠狠综合| 国产欧美一区二区精品性| 日本不卡一二三区黄网| 欧美日韩精品一二三区| 亚洲男女一区二区三区| 在线免费视频一区二区| 国产精品久久久久久妇女6080| 国产99久久久国产精品| 精品美女在线观看| 国产精品一线二线三线精华| 精品国内片67194| 国产精品亚洲第一区在线暖暖韩国| 日韩午夜激情视频| 精品一区二区三区免费| 日韩欧美精品在线| 久久www免费人成看片高清| 欧美特级限制片免费在线观看| 亚洲影院免费观看| 99久久国产综合精品色伊| 成人欧美一区二区三区在线播放| 日本丰满少妇一区二区三区| 中文字幕欧美一| 91福利在线观看| 亚洲国产成人porn| 日韩精品最新网址| 精品一区精品二区高清| 日本一区二区久久| eeuss鲁片一区二区三区在线看| 中文字幕欧美国产| 在线观看一区二区视频| 亚洲超碰精品一区二区| 欧美群妇大交群的观看方式| 午夜精品久久久久久久久久久| 欧美男男青年gay1069videost| 日韩一区精品字幕| 日韩欧美一卡二卡| 国产综合久久久久久久久久久久| 久久久噜噜噜久久中文字幕色伊伊| 激情综合色综合久久|