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

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

?? subspic.c

?? MPEG2編解碼的源代碼.zip
?? 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一区二区三区免费野_久草精品视频
综合电影一区二区三区| 综合激情成人伊人| 亚洲视频精选在线| 老鸭窝一区二区久久精品| 丁香六月久久综合狠狠色| 色欧美88888久久久久久影院| 91.xcao| 国产日韩欧美激情| 婷婷中文字幕一区三区| 国产91精品精华液一区二区三区 | 午夜电影网一区| 国产永久精品大片wwwapp| 欧美日韩中文一区| 中文字幕中文在线不卡住| 激情国产一区二区| 欧美一级片免费看| 亚洲成av人**亚洲成av**| 91性感美女视频| 中文字幕乱码日本亚洲一区二区| 日韩中文欧美在线| 欧洲av在线精品| 亚洲国产精品t66y| 国产激情一区二区三区| 欧美一区二区视频在线观看2022| 亚洲欧美视频在线观看| 国产成人在线色| 精品福利在线导航| 日韩av电影免费观看高清完整版 | 精品无人码麻豆乱码1区2区| 日本精品免费观看高清观看| 国产精品美女久久久久aⅴ国产馆| 国产一区二区在线影院| 精品粉嫩超白一线天av| 久久国产婷婷国产香蕉| 日韩免费电影一区| 国产在线精品国自产拍免费| 欧美精品一区在线观看| 国产精品系列在线播放| 久久精品欧美一区二区三区不卡 | 欧美三级蜜桃2在线观看| 亚洲精品中文字幕乱码三区| 91免费观看视频| 亚洲综合男人的天堂| 欧美日韩亚洲综合一区| 丝袜亚洲另类欧美综合| 91精品国产综合久久福利软件| 日本欧美加勒比视频| 亚洲精品一线二线三线| 国产一区二区视频在线播放| 国产日韩精品一区二区浪潮av| 成人午夜在线播放| 一级日本不卡的影视| 欧美色图免费看| 日韩中文字幕区一区有砖一区 | 老司机精品视频在线| 91精品国产福利在线观看| 麻豆freexxxx性91精品| 国产日产欧美一区二区三区| 91在线视频免费观看| 性久久久久久久久| 精品99久久久久久| 成人av资源站| 午夜精品久久久久久久蜜桃app| 日韩免费一区二区三区在线播放| 国产成人一区在线| 亚洲乱码中文字幕综合| 日韩欧美国产一二三区| 岛国精品一区二区| 天天综合网 天天综合色| 久久久久久久综合色一本| 99精品偷自拍| 久久精品国产网站| 亚洲综合色区另类av| 久久久久久99精品| 欧美色综合影院| 国产成人一级电影| 日韩av在线发布| 亚洲美女少妇撒尿| 国产欧美综合在线观看第十页 | 久久久久久久久久久久久女国产乱| 不卡av电影在线播放| 日本成人在线一区| 亚洲精品中文在线观看| 久久综合九色综合久久久精品综合 | 久久精品国产精品青草| 亚洲蜜臀av乱码久久精品蜜桃| 欧美电视剧免费观看| 欧美体内she精视频| 成人性生交大合| 国内精品在线播放| 日本成人中文字幕| 天天综合天天做天天综合| 亚洲视频免费看| 欧美国产精品专区| 久久综合色播五月| 日韩欧美在线网站| 欧美福利视频一区| 欧美性猛交一区二区三区精品| 丰满岳乱妇一区二区三区 | 亚洲高清免费视频| 亚洲免费色视频| 亚洲色图.com| 中文字幕一区二区视频| 国产女人aaa级久久久级 | 欧美一区二区三区四区久久| www.日韩av| 成人aaaa免费全部观看| 国产精品18久久久久久久久久久久| 免费观看在线综合| 免费观看30秒视频久久| 天天综合色天天| 午夜精品久久久久久久99水蜜桃| 一区二区三区在线视频观看| 国产精品不卡一区| 中国av一区二区三区| 国产精品久久777777| 亚洲国产精品国自产拍av| 中文字幕欧美日本乱码一线二线| 国产亚洲女人久久久久毛片| 久久久久久黄色| 国产精品久久久久久妇女6080| 中文字幕欧美国产| 亚洲青青青在线视频| 一区二区三区四区av| 亚洲国产欧美在线| 日韩精品成人一区二区在线| 免费成人在线视频观看| 国产综合色在线视频区| 国产精品亚洲一区二区三区妖精| 国产乱码字幕精品高清av| 粉嫩嫩av羞羞动漫久久久| 国产999精品久久久久久| 成人白浆超碰人人人人| 色视频成人在线观看免| 欧美日韩亚洲综合| 久久综合九色综合欧美98| 国产精品美女www爽爽爽| 亚洲女厕所小便bbb| 三级一区在线视频先锋| 国产一级精品在线| 色综合色狠狠天天综合色| 777欧美精品| 久久久91精品国产一区二区精品| 国产精品福利av| 日韩精品成人一区二区在线| 国产一区在线观看视频| 91浏览器打开| 日韩一级片网站| 中文字幕制服丝袜一区二区三区 | 国产一区二区免费视频| 99久久综合国产精品| 欧美日韩国产免费一区二区 | 日韩成人一级大片| 国产成人免费在线观看| 色婷婷av一区二区三区软件| 欧美大片一区二区三区| 国产精品久久久久久久久动漫| 日韩高清在线电影| 国产91精品一区二区麻豆亚洲| 欧美日韩你懂的| 国产日韩欧美a| 免费成人美女在线观看.| 不卡视频免费播放| 日韩欧美一级在线播放| 亚洲最新视频在线播放| 国产一区二区美女| 欧美日韩专区在线| 国产精品拍天天在线| 免费在线观看精品| 在线观看91视频| 国产精品伦理一区二区| 日韩黄色免费电影| 欧美在线视频日韩| 国产精品久久二区二区| 国产一区二区三区| 日韩欧美色综合网站| 一区二区三区精品视频在线| 国产suv一区二区三区88区| 欧美一区二区免费视频| 一区二区在线看| 成人h动漫精品一区二区| 久久午夜色播影院免费高清| 日本亚洲欧美天堂免费| 欧美午夜精品一区| 一区二区三区日韩欧美精品| av在线综合网| 国产精品久久久久久久久免费相片 | 亚洲.国产.中文慕字在线| 色综合久久中文字幕| 国产精品久久久久久久久图文区 | 国产精品污污网站在线观看| 看电视剧不卡顿的网站| 欧美一级高清片在线观看| 亚洲a一区二区| 777奇米四色成人影色区| 日韩制服丝袜av| 日韩一区二区电影| 免费在线观看成人| 精品国产免费久久| 黑人巨大精品欧美黑白配亚洲|