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

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

?? store.c

?? MPEG2編解碼的源代碼.zip
?? 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++;    }  }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本aⅴ亚洲精品中文乱码| 国产精品亚洲人在线观看| 亚洲欧美日韩国产中文在线| 欧美国产欧美亚州国产日韩mv天天看完整 | 亚洲欧洲在线观看av| 国产亚洲欧美日韩俺去了| 久久久亚洲精品石原莉奈| 精品国产精品一区二区夜夜嗨| 欧美一区2区视频在线观看| 制服丝袜亚洲色图| 日韩欧美一二三区| 欧美变态凌虐bdsm| 久久久久国产免费免费| 久久久久9999亚洲精品| 亚洲国产高清aⅴ视频| 中文字幕亚洲综合久久菠萝蜜| 亚洲欧美在线视频观看| 亚洲视频每日更新| 亚洲国产sm捆绑调教视频| 亚洲va韩国va欧美va| 日韩国产精品久久久| 免费人成精品欧美精品| 韩日av一区二区| 高清在线观看日韩| 99r国产精品| 欧美日韩午夜在线| 欧美一区二区三区在线| 久久亚洲捆绑美女| 国产精品蜜臀在线观看| 亚洲一区二区三区四区中文字幕| 午夜电影一区二区| 久久国产精品第一页| 国产91在线观看丝袜| 色成年激情久久综合| 日韩一区二区在线观看| 久久午夜老司机| 亚洲日本电影在线| 视频一区在线播放| 国产美女娇喘av呻吟久久| 成人动漫视频在线| 欧美欧美欧美欧美| 国产午夜精品一区二区三区四区| 亚洲人精品午夜| 美女一区二区久久| 不卡的av电影| 欧美日韩电影在线播放| 精品国产欧美一区二区| 国产精品久久久久久妇女6080 | 国产91综合一区在线观看| 色综合视频在线观看| 欧美日韩免费观看一区三区| 久久嫩草精品久久久久| 亚洲乱码中文字幕| 久久精品国产77777蜜臀| 成人福利视频在线| 日韩女同互慰一区二区| 综合久久久久久| 麻豆精品新av中文字幕| 91免费国产视频网站| 日韩欧美成人午夜| 亚洲永久免费视频| 国产精品正在播放| 欧美日韩激情一区| 中文字幕一区二区三区在线观看| 日韩国产成人精品| 91亚洲精品一区二区乱码| 日韩精品专区在线影院观看| 夜夜精品浪潮av一区二区三区| 国产精品一区在线| 欧美精品高清视频| 亚洲人成人一区二区在线观看| 国产综合色精品一区二区三区| 一本久道中文字幕精品亚洲嫩| 久久久久久久久97黄色工厂| 天天av天天翘天天综合网| 99国产一区二区三精品乱码| 久久日一线二线三线suv| 首页国产欧美日韩丝袜| 在线观看av一区二区| 国产精品蜜臀av| 国内久久婷婷综合| 欧美一区二区三区四区视频| 亚洲主播在线观看| 91美女福利视频| 久久精品欧美日韩| 精品无码三级在线观看视频| 欧美浪妇xxxx高跟鞋交| 亚洲免费视频成人| 波多野结衣中文字幕一区二区三区 | 成人高清视频免费观看| 2020国产精品| 精品制服美女丁香| 56国语精品自产拍在线观看| 亚洲宅男天堂在线观看无病毒| 91视频在线观看| 中文字幕亚洲不卡| 99vv1com这只有精品| 国产精品每日更新在线播放网址| 国产精一品亚洲二区在线视频| 精品国产乱码久久久久久1区2区| 蜜臀精品一区二区三区在线观看| 欧美日韩视频在线一区二区| 亚洲国产综合人成综合网站| 91福利精品视频| 亚洲综合视频在线| 在线一区二区三区| 亚洲一区二区3| 欧美视频一区二区三区四区 | 精品国产乱码久久久久久浪潮 | 久久国产精品99精品国产| 欧美一区二区视频网站| 丰满白嫩尤物一区二区| 精品久久久久久久久久久久包黑料 | 色琪琪一区二区三区亚洲区| 日本一区二区免费在线观看视频| 激情伊人五月天久久综合| 欧美一级片在线| 蜜臀av国产精品久久久久| 日韩欧美高清dvd碟片| 国内精品伊人久久久久av影院 | 最新国产成人在线观看| 91丝袜国产在线播放| 夜夜嗨av一区二区三区四季av| 欧美日韩视频专区在线播放| 人人狠狠综合久久亚洲| 精品少妇一区二区三区免费观看| 国产精品综合一区二区三区| 国产精品女主播av| 在线欧美日韩精品| 日韩av成人高清| 国产午夜精品美女毛片视频| a级精品国产片在线观看| 亚洲免费av高清| 欧美疯狂做受xxxx富婆| 日韩成人精品在线观看| 欧美精品一区二区三| 成人黄色在线网站| 夜夜爽夜夜爽精品视频| 日韩女优视频免费观看| 国产成人午夜精品影院观看视频| 亚洲欧洲一区二区在线播放| 欧美日本一区二区在线观看| 国内精品视频666| 亚洲欧美日韩中文播放 | 国产欧美日韩麻豆91| 91视频在线看| 久久精品国产第一区二区三区| 国产精品欧美一区二区三区| 99精品欧美一区二区三区综合在线| 欧美日韩国产精品成人| 国产精品白丝在线| 成人国产视频在线观看| 亚洲国产视频一区二区| 26uuu精品一区二区在线观看| 99视频在线观看一区三区| 日韩黄色片在线观看| 国产片一区二区三区| 欧美性感一区二区三区| 国产综合成人久久大片91| eeuss鲁片一区二区三区| 久久综合狠狠综合久久综合88 | 日韩中文字幕一区二区三区| 久久国产婷婷国产香蕉| 欧美色精品在线视频| 亚洲免费观看在线视频| 国产99久久精品| 一区二区三区在线观看网站| 91在线视频观看| 亚洲一卡二卡三卡四卡无卡久久| 在线综合视频播放| 国产精品中文欧美| 亚洲福利国产精品| 精品乱码亚洲一区二区不卡| 成人av片在线观看| 日本视频一区二区三区| 国产精品美女www爽爽爽| 欧美日韩一区二区三区高清| 国产成人av福利| 亚洲一线二线三线久久久| 在线视频国内自拍亚洲视频| 国产精品久久网站| 高清不卡在线观看| 国产精品美女久久久久久久| 91蜜桃视频在线| 国产精品亲子乱子伦xxxx裸| 成人精品在线视频观看| 国产精品理论片在线观看| 粉嫩欧美一区二区三区高清影视| 欧美国产国产综合| jizzjizzjizz欧美| 亚洲精品videosex极品| 色婷婷av一区二区三区大白胸| 国产精品成人免费在线| 精品一区二区三区免费观看| 91麻豆精品国产91久久久久久| 91色porny在线视频| 成人一区二区视频| 国产**成人网毛片九色| 国产成人午夜99999| 国产一区二区三区精品欧美日韩一区二区三区 |