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

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

?? subspic.c

?? mpeg2編解標準源
?? C
字號:
/* #define DEBUG *//* subspic.c, Frame buffer substitution 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 Read_Frame _ANSI_ARGS_((char *filename,   unsigned char *frame_buffer[], int framenum));static void Copy_Frame _ANSI_ARGS_((unsigned char *src, unsigned char *dst,   int width, int height, int parity, int incr));static int Read_Components _ANSI_ARGS_ ((char *filename,   unsigned char *frame[3], int framenum));static int Read_Component _ANSI_ARGS_ ((char *fname, unsigned char *frame,   int width, int height));static int Extract_Components _ANSI_ARGS_ ((char *filename,  unsigned char *frame[3], int framenum));/* substitute frame buffer routine */void Substitute_Frame_Buffer (bitstream_framenum, sequence_framenum)int bitstream_framenum;int sequence_framenum;{  /* static tracking variables */  static int previous_temporal_reference;  static int previous_bitstream_framenum;  static int previous_anchor_temporal_reference;  static int previous_anchor_bitstream_framenum;  static int previous_picture_coding_type;  static int bgate;    /* local temporary variables */  int substitute_display_framenum;#ifdef DEBUG  printf("SUB: seq fn(%d) bitfn(%d) tempref(%d) picstr(%d) type(%d)\n",     sequence_framenum, bitstream_framenum, temporal_reference,     picture_structure, picture_coding_type);#endif  /* we don't substitute at the first picture of a sequence */  if((sequence_framenum!=0)||(Second_Field))  {    /* only at the start of the frame */    if ((picture_structure==FRAME_PICTURE)||(!Second_Field))    {      if(picture_coding_type==P_TYPE)      {        /* the most recently decoded reference frame needs substituting */        substitute_display_framenum = bitstream_framenum - 1;                Read_Frame(Substitute_Picture_Filename, forward_reference_frame,           substitute_display_framenum);      }      /* only the first B frame in a consequitve set of B pictures         loads a substitute backward_reference_frame since all subsequent         B frames predict from the same reference pictures */      else if((picture_coding_type==B_TYPE)&&(bgate!=1))      {        substitute_display_framenum =           (previous_temporal_reference - temporal_reference)             + bitstream_framenum - 1;        Read_Frame(Substitute_Picture_Filename, backward_reference_frame,           substitute_display_framenum);      }    } /* P fields can predict from the two most recently decoded fields, even         from the first field of the same frame being decoded */    else if(Second_Field && (picture_coding_type==P_TYPE))    {      /* our favourite case: the IP field picture pair */      if((previous_picture_coding_type==I_TYPE)&&(picture_coding_type==P_TYPE))      {        substitute_display_framenum = bitstream_framenum;      }      else /* our more generic P field picture pair */      {        substitute_display_framenum =           (temporal_reference - previous_anchor_temporal_reference)             + bitstream_framenum - 1;      }      Read_Frame(Substitute_Picture_Filename, current_frame, substitute_display_framenum);    }#ifdef DEBUG    else if((picture_coding_type!=B_TYPE)||(picture_coding_type!=D_TYPE))    {      printf("NO SUBS FOR THIS PICTURE\n");    }#endif  }  /* set b gate so we don't redundantly load next time around */  if(picture_coding_type==B_TYPE)    bgate = 1;  else    bgate = 0;  /* update general tracking variables */  if((picture_structure==FRAME_PICTURE)||(!Second_Field))  {    previous_temporal_reference  = temporal_reference;    previous_bitstream_framenum  = bitstream_framenum;  }    /* update reference frame tracking variables */  if((picture_coding_type!=B_TYPE) &&     ((picture_structure==FRAME_PICTURE)||Second_Field))  {    previous_anchor_temporal_reference  = temporal_reference;    previous_anchor_bitstream_framenum  = bitstream_framenum;  }  previous_picture_coding_type = picture_coding_type;}/* Note: fields are only read to serve as the same-frame reference for    a second field */static void Read_Frame(fname,frame,framenum)char *fname;unsigned char *frame[];int framenum;{  int parity;  int rerr = 0;  int field_mode;  if(framenum<0)    printf("ERROR: framenum (%d) is less than zero\n", framenum);  if(Big_Picture_Flag)    rerr = Extract_Components(fname, substitute_frame, framenum);  else    rerr = Read_Components(fname, substitute_frame, framenum);  if(rerr!=0)  {    printf("was unable to substitute frame\n");  }  /* now copy to the appropriate buffer */  /* first field (which we are attempting to substitute) must be     of opposite field parity to the current one */  if((Second_Field)&&(picture_coding_type==P_TYPE))  {    parity      = (picture_structure==TOP_FIELD ? 1:0);          field_mode  = (picture_structure==FRAME_PICTURE ? 0:1);  }  else  {    /* Like frame structued pictures, B pictures only substitute an entire frame        since both fields always predict from the same frame (with respect        to forward/backwards directions) */    parity = 0;    field_mode = 0;  }  Copy_Frame(substitute_frame[0], frame[0], Coded_Picture_Width,     Coded_Picture_Height, parity, field_mode);    Copy_Frame(substitute_frame[1], frame[1], Chroma_Width, Chroma_Height,     parity, field_mode);    Copy_Frame(substitute_frame[2], frame[2], Chroma_Width, Chroma_Height,    parity, field_mode);#ifdef VERBOSE  if(Verbose_Flag > NO_LAYER)    printf("substituted %s %d\n",      (field_mode ? (parity?"bottom field":"bottom field"):"frame"), framenum);#endif}static int Read_Components(filename, frame, framenum) char *filename;unsigned char *frame[3];int framenum;{  int err = 0;  char outname[FILENAME_LENGTH];  char name[FILENAME_LENGTH];  sprintf(outname,filename,framenum);  sprintf(name,"%s.Y",outname);  err += Read_Component(name, frame[0], Coded_Picture_Width,     Coded_Picture_Height);  sprintf(name,"%s.U",outname);  err += Read_Component(name, frame[1], Chroma_Width, Chroma_Height);  sprintf(name,"%s.V",outname);  err += Read_Component(name, frame[2], Chroma_Width, Chroma_Height);  return(err);}static int Read_Component(Filename, Frame, Width, Height)char *Filename;unsigned char *Frame;int Width;int Height;{  int Size;  int Bytes_Read;  int Infile;  Size = Width*Height;#ifdef DEBUG  printf("SUBS: reading %s\n", filename);#endif  if(!(Infile=open(Filename,O_RDONLY|O_BINARY))<0)  {    printf("ERROR: unable to open reference filename (%s)\n", Filename);	return(-1);  }  Bytes_Read = read(Infile, Frame, Size);    if(Bytes_Read!=Size)  {    printf("was able to read only %d bytes of %d of file %s\n",      Bytes_Read, Size, Filename);  }   close(Infile);   return(0);}/* optimization: do not open the big file each time. Open once at start   of decoder, and close at the very last frame *//* Note: "big" files were used in E-mail exchanges almost exclusively by the    MPEG Committee's syntax validation and conformance ad-hoc groups from    the year 1993 until 1995 */static int Extract_Components(filename, frame, framenum) char *filename;unsigned char *frame[3];int framenum;{/*  int err = 0; */  FILE *fd;  int line;  int size, offset;  if (!(fd = fopen(filename,"rb")))  {    sprintf(Error_Text,"Couldn't open %s\n",filename);    return(-1);  }  /* compute size of each frame (in bytes) */  size = (Coded_Picture_Width*Coded_Picture_Height);  if(chroma_format==CHROMA444)    size = (size * 3);  else if(chroma_format==CHROMA422)    size = (size * 2);  else if(chroma_format==CHROMA420)    size = ((size*3)>>1);  else    printf("ERROR: chroma_format (%d) not recognized\n", chroma_format);  /* compute distance into "big" file */  offset = size*framenum;#ifdef DEBUG  printf("EXTRACTING: frame(%d) offset(%d), size (%d) from %s\n",     framenum, offset, size, filename);#endif  /* seek to location in big file where desired frame begins */  /* note: this offset cannot exceed a few billion bytes due to the */  /*       obvious limitations of 32-bit integers */  fseek(fd, offset, 0);  /* Y  */  for (line=0; line<Coded_Picture_Height; line++)  {    fread(frame[0]+(line*Coded_Picture_Width),1,Coded_Picture_Width,fd);  }  /* Cb */  for (line=0; line<Chroma_Height; line++)  {    fread(frame[1]+(line*Chroma_Width),1,Chroma_Width,fd);  }  /* Cr */  for (line=0; line<Chroma_Height; line++)  {    fread(frame[2]+(line*Chroma_Width),1,Chroma_Width,fd);  }  fclose(fd);  return(0);}static void Copy_Frame(src, dst, width, height, parity, field_mode)unsigned char *src;unsigned char *dst;int width;int height;int parity;        /* field parity (top or bottom) to overwrite */int field_mode;    /* 0 = frame, 1 = field                      */{  int row, col;  int s, d;  int incr;  s = d = 0;#ifdef DEBUG  printf("COPYING (w=%d, h=%d, parity=%d, field_mode=%d)\n",    width,height,parity,field_mode);#endif /* DEBUG */  if(field_mode)  {    incr = 2;    if(parity==0)      s += width;  }  else  {    incr = 1;  }  for(row=0; row<height; row+=incr)   {    for(col=0; col<width; col++)    {      dst[d+col] = src[s+col];    }        d += (width*incr);    s += (width*incr);  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品成人一区二区| 美女视频黄久久| 亚洲午夜一区二区| 国内精品视频一区二区三区八戒| 91亚洲精品乱码久久久久久蜜桃| 欧美一区二区三区在线观看视频| 亚洲国产电影在线观看| 麻豆成人久久精品二区三区红| 99国产精品久久| 国产日韩欧美高清| 免费观看一级欧美片| 91看片淫黄大片一级| 国产欧美精品在线观看| 蜜臂av日日欢夜夜爽一区| 日本道精品一区二区三区| 久久久精品人体av艺术| 喷水一区二区三区| 欧美日韩高清一区| 一区二区三区四区视频精品免费| 国产xxx精品视频大全| 精品少妇一区二区三区日产乱码| 亚洲成人在线网站| 一本色道久久综合狠狠躁的推荐| 国产精品久久久久久久久免费丝袜 | 成人免费毛片app| 精品久久久久久久久久久久包黑料 | 另类综合日韩欧美亚洲| 欧美日韩视频第一区| 亚洲免费观看高清完整版在线 | 国产露脸91国语对白| 日韩欧美一区二区免费| 免费久久精品视频| 欧美va亚洲va香蕉在线| 久色婷婷小香蕉久久| 亚洲精品一区二区精华| 国产精品中文字幕欧美| 久久网这里都是精品| 国产一区二区中文字幕| 国产午夜精品久久久久久免费视 | 日本强好片久久久久久aaa| 91精品国产综合久久国产大片| 亚洲一区二区影院| 欧美一区二视频| 精品一区二区三区在线播放| 精品99一区二区| 国产成人精品www牛牛影视| 国产精品美女久久久久av爽李琼 | 国产九九视频一区二区三区| 国产三级精品三级| 91原创在线视频| 亚洲第一福利视频在线| 91精品国产综合久久蜜臀| 黄一区二区三区| 中文字幕一区三区| 色偷偷成人一区二区三区91| 亚洲综合在线第一页| 欧美一区二区三区四区高清| 国内精品写真在线观看| 亚洲精品免费看| 日韩精品一区二区三区在线| 播五月开心婷婷综合| 三级成人在线视频| 国产视频一区二区在线观看| 99r精品视频| 免费成人美女在线观看.| 欧美激情一区二区三区在线| 欧美性猛交xxxx乱大交退制版 | 五月天久久比比资源色| 久久亚洲欧美国产精品乐播| 成人av网站免费| 婷婷成人综合网| 日本一区二区成人在线| 欧美精品三级在线观看| www.欧美日韩| 看片网站欧美日韩| 亚洲伦理在线精品| 久久综合色之久久综合| 欧美亚洲免费在线一区| 国产精品99久| 日韩高清不卡一区| 日韩理论片在线| 久久奇米777| 337p亚洲精品色噜噜噜| 91香蕉视频mp4| 国产成人亚洲综合a∨猫咪| 日日夜夜精品视频免费| 亚洲三级在线免费| 国产丝袜欧美中文另类| 91精品国产一区二区三区香蕉| 91香蕉视频在线| 懂色av一区二区夜夜嗨| 国产美女主播视频一区| 日日夜夜精品视频天天综合网| 一区二区三区日韩欧美精品| 国产欧美日本一区二区三区| 精品国产凹凸成av人网站| 欧美美女直播网站| 91成人免费在线| 97精品超碰一区二区三区| 国产成人精品亚洲777人妖| 免费观看在线色综合| 三级精品在线观看| 日韩精品一级中文字幕精品视频免费观看| 亚洲欧美一区二区久久| 亚洲色图视频网站| 国产精品的网站| 国产精品国产自产拍在线| 国产欧美日韩激情| 国产精品久久精品日日| 国产精品美女久久福利网站| 国产精品网站在线| 国产精品国产三级国产aⅴ中文| 欧美videos中文字幕| 3d成人h动漫网站入口| 在线播放一区二区三区| 欧美肥大bbwbbw高潮| 91精品国产综合久久久蜜臀粉嫩 | 91精品视频网| 欧美一级夜夜爽| 欧美精品一区男女天堂| 久久人人爽人人爽| 国产精品全国免费观看高清| 国产精品天美传媒| 亚洲欧美日韩系列| 午夜精品久久久久影视| 美女网站视频久久| 狠狠色丁香婷婷综合久久片| 国产精品99久久久久久似苏梦涵| 国产成人av在线影院| 99国产精品一区| 欧美日韩一区高清| 久久综合久久鬼色中文字| 欧美激情综合网| 亚洲欧美一区二区三区孕妇| 亚洲成人精品在线观看| 久久av中文字幕片| 国产伦精品一区二区三区视频青涩| 狠狠色丁香久久婷婷综合丁香| 成人av在线网| 欧美精品成人一区二区三区四区| 日韩精品一区二区三区蜜臀| 欧美国产精品中文字幕| 亚洲综合网站在线观看| 精品一区二区精品| 99久久精品国产网站| 日韩丝袜美女视频| 国产欧美日韩在线| 一区二区三区日韩欧美| 国内精品伊人久久久久av影院| 91网站视频在线观看| 日韩精品在线看片z| 亚洲女性喷水在线观看一区| 日韩电影在线免费看| thepron国产精品| 宅男噜噜噜66一区二区66| 国产欧美精品一区| 亚洲国产成人av好男人在线观看| 久久66热re国产| 欧美日韩精品免费| 综合中文字幕亚洲| 激情综合色综合久久| 在线视频欧美区| 国产日产欧美一区二区视频| 亚洲成人动漫在线观看| 成人av资源网站| 精品国产1区二区| 一区二区日韩av| 成人一区二区三区中文字幕| 777午夜精品免费视频| 亚洲视频每日更新| 韩国女主播一区二区三区| 欧美日韩一区精品| 亚洲私人黄色宅男| 国产91对白在线观看九色| 日韩欧美中文字幕精品| 性感美女极品91精品| 91小视频免费观看| 亚洲国产成人一区二区三区| 精东粉嫩av免费一区二区三区| 欧美日韩三级一区二区| 国产精品国产三级国产普通话99| 国产老肥熟一区二区三区| 91精品欧美综合在线观看最新 | 中文字幕中文字幕一区| 麻豆视频观看网址久久| 91福利在线导航| 亚洲乱码国产乱码精品精小说| 丰满放荡岳乱妇91ww| 久久综合五月天婷婷伊人| 日本怡春院一区二区| 欧美日韩免费观看一区二区三区| 综合色中文字幕| av电影一区二区| 国产精品久久久爽爽爽麻豆色哟哟| 国产麻豆精品95视频| 久久久久久免费| 国产精品亚洲成人| 日本一区二区视频在线| 国产91精品免费| 国产日韩在线不卡|