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

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

?? store.c

?? mpeg2編解標準源
?? C
字號:
/* 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 4096static 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");      if (!(v444 = (unsigned char *)malloc(Coded_Picture_Width                                           *Coded_Picture_Height)))        Error("malloc failed");    }    if (chroma_format==CHROMA420)    {      conv420to422(src[1],u422);      conv420to422(src[2],v422);      conv422to444(u422,u444);      conv422to444(v422,v444);    }    else    {      conv422to444(src[1],u444);      conv422to444(src[2],v444);    }  }  strcat(outname,tgaflag ? ".tga" : ".ppm");  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;  if (tgaflag)  {    /* TGA header */    for (i=0; i<12; i++)      putbyte(tga24[i]);    putword(horizontal_size); putword(height);    putbyte(tga24[12]); putbyte(tga24[13]);  }  else  {    /* PPM header */    sprintf(header,"P6\n%d %d\n255\n",horizontal_size,height);    for (i=0; header[i]!=0; i++)      putbyte(header[i]);  }  /* 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];    for (i=0; i<height; i++)  {    py = src[0] + offset + incr*i;    pu = u444 + offset + incr*i;    pv = v444 + offset + incr*i;    for (j=0; j<horizontal_size; j++)    {      u = *pu++ - 128;      v = *pv++ - 128;      y = 76309 * (*py++ - 16); /* (255/219)*65536 */      r = Clip[(y + crv*v + 32768)>>16];      g = Clip[(y - cgu*u - cgv*v + 32768)>>16];      b = Clip[(y + cbu*u + 32786)>>16];      if (tgaflag)      {        putbyte(b); putbyte(g); putbyte(r);      }      else      {        putbyte(r); putbyte(g); putbyte(b);      }    }  }  if (optr!=obfr)    write(outfile,obfr,optr-obfr);  close(outfile);}static void putbyte(c)int c;{  *optr++ = c;  if (optr == obfr+OBFRSIZE)  {    write(outfile,obfr,OBFRSIZE);    optr = obfr;  }}static void putword(w)int w;{  putbyte(w); putbyte(w>>8);}/* horizontal 1:2 interpolation filter */static void conv422to444(src,dst)unsigned char *src,*dst;{  int i, i2, w, j, im3, im2, im1, ip1, ip2, ip3;  w = Coded_Picture_Width>>1;  if (base.MPEG2_Flag)  {    for (j=0; j<Coded_Picture_Height; j++)    {      for (i=0; i<w; i++)      {        i2 = i<<1;        im2 = (i<2) ? 0 : i-2;        im1 = (i<1) ? 0 : i-1;        ip1 = (i<w-1) ? i+1 : w-1;        ip2 = (i<w-2) ? i+2 : w-1;        ip3 = (i<w-3) ? i+3 : w-1;        /* FIR filter coefficients (*256): 21 0 -52 0 159 256 159 0 -52 0 21 */        /* even samples (0 0 256 0 0) */        dst[i2] = src[i];        /* odd samples (21 -52 159 159 -52 21) */        dst[i2+1] = Clip[(int)(21*(src[im2]+src[ip3])                        -52*(src[im1]+src[ip2])                        +159*(src[i]+src[ip1])+128)>>8];      }      src+= w;      dst+= Coded_Picture_Width;    }  }  else  {    for (j=0; j<Coded_Picture_Height; j++)    {      for (i=0; i<w; i++)      {        i2 = i<<1;        im3 = (i<3) ? 0 : i-3;        im2 = (i<2) ? 0 : i-2;        im1 = (i<1) ? 0 : i-1;        ip1 = (i<w-1) ? i+1 : w-1;        ip2 = (i<w-2) ? i+2 : w-1;        ip3 = (i<w-3) ? i+3 : w-1;        /* FIR filter coefficients (*256): 5 -21 70 228 -37 11 */        dst[i2] =   Clip[(int)(  5*src[im3]                         -21*src[im2]                         +70*src[im1]                        +228*src[i]                         -37*src[ip1]                         +11*src[ip2]+128)>>8];       dst[i2+1] = Clip[(int)(  5*src[ip3]                         -21*src[ip2]                         +70*src[ip1]                        +228*src[i]                         -37*src[im1]                         +11*src[im2]+128)>>8];      }      src+= w;      dst+= Coded_Picture_Width;    }  }}/* vertical 1:2 interpolation filter */static void conv420to422(src,dst)unsigned char *src,*dst;{  int w, h, i, j, j2;  int jm6, jm5, jm4, jm3, jm2, jm1, jp1, jp2, jp3, jp4, jp5, jp6, jp7;  w = Coded_Picture_Width>>1;  h = Coded_Picture_Height>>1;  if (progressive_frame)  {    /* intra frame */    for (i=0; i<w; i++)    {      for (j=0; j<h; j++)      {        j2 = j<<1;        jm3 = (j<3) ? 0 : j-3;        jm2 = (j<2) ? 0 : j-2;        jm1 = (j<1) ? 0 : j-1;        jp1 = (j<h-1) ? j+1 : h-1;        jp2 = (j<h-2) ? j+2 : h-1;        jp3 = (j<h-3) ? j+3 : h-1;        /* FIR filter coefficients (*256): 5 -21 70 228 -37 11 */        /* New FIR filter coefficients (*256): 3 -16 67 227 -32 7 */        dst[w*j2] =     Clip[(int)(  3*src[w*jm3]                             -16*src[w*jm2]                             +67*src[w*jm1]                            +227*src[w*j]                             -32*src[w*jp1]                             +7*src[w*jp2]+128)>>8];        dst[w*(j2+1)] = Clip[(int)(  3*src[w*jp3]                             -16*src[w*jp2]                             +67*src[w*jp1]                            +227*src[w*j]                             -32*src[w*jm1]                             +7*src[w*jm2]+128)>>8];      }      src++;      dst++;    }  }  else  {    /* intra field */    for (i=0; i<w; i++)    {      for (j=0; j<h; j+=2)      {        j2 = j<<1;        /* top field */        jm6 = (j<6) ? 0 : j-6;        jm4 = (j<4) ? 0 : j-4;        jm2 = (j<2) ? 0 : j-2;        jp2 = (j<h-2) ? j+2 : h-2;        jp4 = (j<h-4) ? j+4 : h-2;        jp6 = (j<h-6) ? j+6 : h-2;        /* Polyphase FIR filter coefficients (*256): 2 -10 35 242 -18 5 */        /* New polyphase FIR filter coefficients (*256): 1 -7 30 248 -21 5 */        dst[w*j2] = Clip[(int)(  1*src[w*jm6]                         -7*src[w*jm4]                         +30*src[w*jm2]                        +248*src[w*j]                         -21*src[w*jp2]                          +5*src[w*jp4]+128)>>8];        /* Polyphase FIR filter coefficients (*256): 11 -38 192 113 -30 8 */        /* New polyphase FIR filter coefficients (*256):7 -35 194 110 -24 4 */        dst[w*(j2+2)] = Clip[(int)( 7*src[w*jm4]                             -35*src[w*jm2]                            +194*src[w*j]                            +110*src[w*jp2]                             -24*src[w*jp4]                              +4*src[w*jp6]+128)>>8];        /* bottom field */        jm5 = (j<5) ? 1 : j-5;        jm3 = (j<3) ? 1 : j-3;        jm1 = (j<1) ? 1 : j-1;        jp1 = (j<h-1) ? j+1 : h-1;        jp3 = (j<h-3) ? j+3 : h-1;        jp5 = (j<h-5) ? j+5 : h-1;        jp7 = (j<h-7) ? j+7 : h-1;        /* Polyphase FIR filter coefficients (*256): 11 -38 192 113 -30 8 */        /* New polyphase FIR filter coefficients (*256):7 -35 194 110 -24 4 */        dst[w*(j2+1)] = Clip[(int)( 7*src[w*jp5]                             -35*src[w*jp3]                            +194*src[w*jp1]                            +110*src[w*jm1]                             -24*src[w*jm3]                              +4*src[w*jm5]+128)>>8];        dst[w*(j2+3)] = Clip[(int)(  1*src[w*jp7]                             -7*src[w*jp5]                             +30*src[w*jp3]                            +248*src[w*jp1]                             -21*src[w*jm1]                              +5*src[w*jm3]+128)>>8];      }      src++;      dst++;    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av电影| 久久精品欧美日韩精品| 日韩精品一区二区在线| 国产女人aaa级久久久级| 午夜精品一区二区三区免费视频 | 欧美伊人久久久久久久久影院 | 肉色丝袜一区二区| 9久草视频在线视频精品| 91精品国产手机| 亚洲国产日韩一区二区| 成人ar影院免费观看视频| 日韩欧美综合在线| 亚洲电影激情视频网站| 91麻豆免费观看| 国产欧美综合在线观看第十页| 天堂成人国产精品一区| 日本二三区不卡| 国产精品私人影院| 国产精品性做久久久久久| 欧美一区二区三区电影| 污片在线观看一区二区| 色拍拍在线精品视频8848| 国产精品情趣视频| 国产91对白在线观看九色| 2023国产一二三区日本精品2022| 日本欧洲一区二区| 8v天堂国产在线一区二区| 亚洲第一会所有码转帖| 欧美日韩国产首页| 日本免费在线视频不卡一不卡二| 欧美日韩精品高清| 日精品一区二区| 日韩视频免费直播| 精品影院一区二区久久久| 日韩欧美国产小视频| 蜜臀va亚洲va欧美va天堂| 日韩欧美www| 国产一区二区剧情av在线| 久久久久9999亚洲精品| 国产suv一区二区三区88区| 国产欧美日韩另类一区| 99精品国产99久久久久久白柏| 国产日产欧美一区| 91丨九色丨黑人外教| 亚洲与欧洲av电影| 欧美一区二区视频在线观看2022| 另类欧美日韩国产在线| 久久久精品2019中文字幕之3| 国产一区二区在线看| 国产欧美一区二区精品忘忧草 | 美女精品自拍一二三四| 欧美成人午夜电影| 成人精品高清在线| 亚洲精品你懂的| 91精品国产免费| 夫妻av一区二区| 亚洲激情欧美激情| 日韩美女视频一区二区在线观看| 国产激情一区二区三区桃花岛亚洲| 国产亚洲一区二区三区在线观看 | 欧美日产在线观看| 久久精品国产秦先生| 国产欧美日韩综合精品一区二区| 91玉足脚交白嫩脚丫在线播放| 亚洲国产精品一区二区久久恐怖片 | 亚洲成av人影院| 精品国产a毛片| 91视频免费看| 狠狠色狠狠色综合系列| 亚洲品质自拍视频网站| 日韩欧美国产午夜精品| 91色婷婷久久久久合中文| 免费一级片91| 亚洲精品你懂的| 久久五月婷婷丁香社区| 欧美羞羞免费网站| 国产精品自拍av| 亚洲成人自拍一区| 国产精品色一区二区三区| 欧美日本在线观看| av电影在线观看不卡| 男男gaygay亚洲| 亚洲精品视频在线看| 国产亚洲欧美一级| 欧美疯狂性受xxxxx喷水图片| 丁香激情综合国产| 美女视频黄a大片欧美| 亚洲综合图片区| 国产精品拍天天在线| 91精品国产入口| 欧美性xxxxx极品少妇| 成人小视频免费观看| 美国毛片一区二区三区| 夜夜嗨av一区二区三区四季av| 国产日韩精品一区二区三区 | 99国产一区二区三精品乱码| 狠狠色丁香久久婷婷综合_中| 五月婷婷欧美视频| 亚洲永久精品大片| 1024成人网| 国产精品亲子伦对白| 国产欧美日韩视频在线观看| 欧美本精品男人aⅴ天堂| 欧美色国产精品| 欧亚洲嫩模精品一区三区| 91网上在线视频| 91视频在线观看| 91看片淫黄大片一级在线观看| 国产激情一区二区三区四区| 久久99精品久久久久| 美女性感视频久久| 美女高潮久久久| 麻豆精品在线播放| 久久99国内精品| 国产一二精品视频| 国产精品一区二区在线播放| 国内精品视频666| 国产在线精品免费| 国产米奇在线777精品观看| 国产毛片精品国产一区二区三区| 精品无人码麻豆乱码1区2区| 精久久久久久久久久久| 国产精品性做久久久久久| 丁香六月综合激情| 一本大道久久精品懂色aⅴ| 欧洲一区在线电影| 欧美无砖专区一中文字| 欧美日韩成人一区| 精品国产一区二区三区av性色| 久久久久久久久免费| 中文字幕高清一区| 亚洲综合在线免费观看| 亚洲v中文字幕| 极品少妇一区二区三区精品视频 | 国产一区二区三区精品视频| 国产成人欧美日韩在线电影| 国产91清纯白嫩初高中在线观看 | 337p亚洲精品色噜噜噜| 欧美精品一区二区三区在线 | 成人免费视频免费观看| 91黄色小视频| 91精品国产综合久久婷婷香蕉 | 午夜视频一区在线观看| 久久激情五月婷婷| 国产sm精品调教视频网站| 色网站国产精品| 91精品国产色综合久久不卡蜜臀| 精品国精品国产| 综合亚洲深深色噜噜狠狠网站| 亚洲综合在线五月| 国内精品视频一区二区三区八戒| jiyouzz国产精品久久| 欧美视频中文一区二区三区在线观看| 91麻豆精品国产自产在线观看一区 | 国产毛片精品视频| 色婷婷综合中文久久一本| 欧美一区二区三区日韩| 欧美经典三级视频一区二区三区| 亚洲日本丝袜连裤袜办公室| 美女视频黄a大片欧美| 99久久精品免费看国产 | 欧美性猛交xxxxxx富婆| 欧美v国产在线一区二区三区| 中文字幕一区av| 狠狠狠色丁香婷婷综合激情| 欧美中文字幕亚洲一区二区va在线 | 欧美日韩免费观看一区二区三区| 久久综合九色综合欧美就去吻| 亚洲精品一二三区| 国产精品一二一区| 91精品国产综合久久久久久| 国产精品妹子av| 精品一区二区国语对白| 欧美日韩一区视频| 亚洲精品中文字幕乱码三区| 国产精品亚洲成人| 欧美电影免费观看高清完整版在线观看 | 色一情一伦一子一伦一区| 精品99一区二区三区| 午夜精品久久久久久久 | 日韩亚洲欧美一区二区三区| 亚洲欧美日韩国产成人精品影院 | 欧美精选一区二区| 亚洲男帅同性gay1069| 懂色一区二区三区免费观看| 欧美大胆人体bbbb| 日韩高清电影一区| 欧美色视频一区| 夜夜嗨av一区二区三区网页 | 亚洲色图都市小说| www.亚洲在线| 国产精品看片你懂得| 国产一区二区三区精品视频| 精品精品欲导航| 看片的网站亚洲| 欧美二区三区91| 无吗不卡中文字幕| 538在线一区二区精品国产| 亚洲不卡在线观看| 欧美一区2区视频在线观看|