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

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

?? subspic.c

?? 視頻壓縮標準MPEG2的視頻解碼的參考C代碼
?? 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一区二区三区免费野_久草精品视频
欧美r级在线观看| 精品一区二区成人精品| 精品裸体舞一区二区三区| 成人黄页毛片网站| 日韩欧美亚洲一区二区| 欧洲国内综合视频| 成人免费看的视频| 粉嫩久久99精品久久久久久夜| 国产亚洲欧洲997久久综合 | 欧美国产精品久久| 日韩欧美专区在线| 日韩精品一区二区三区蜜臀| 7777精品伊人久久久大香线蕉的 | 欧美日韩国产影片| 欧美丝袜丝交足nylons图片| 91极品视觉盛宴| 91国偷自产一区二区三区成为亚洲经典| 国产精品一二三四| 国产91精品免费| 成人sese在线| 91美女片黄在线| 色婷婷综合中文久久一本| 91免费版pro下载短视频| 色视频成人在线观看免| 亚洲黄色尤物视频| 一区二区三区加勒比av| 亚洲图片欧美一区| 午夜久久久久久久久久一区二区| 亚洲欧洲日产国码二区| 一区二区三区中文字幕电影| 亚洲精品国产无天堂网2021| 亚洲大尺度视频在线观看| 免费成人在线观看| 国产精品一区二区三区99| 粉嫩av一区二区三区在线播放| 成人涩涩免费视频| 日本伦理一区二区| 欧美成人综合网站| 18成人在线观看| 亚洲一区二区高清| 日韩1区2区日韩1区2区| 精品久久人人做人人爽| 国产视频一区二区在线| 亚洲欧洲精品天堂一级| 亚洲va欧美va天堂v国产综合| 日本免费在线视频不卡一不卡二| 经典三级视频一区| 色一情一伦一子一伦一区| 91精品麻豆日日躁夜夜躁| 欧美一区午夜精品| 国产精品伦理在线| 美女被吸乳得到大胸91| 99精品国产91久久久久久| 欧美日韩一区不卡| 国产精品久久久久婷婷二区次| 亚洲影视在线观看| 国产精品99久久不卡二区| 欧美影视一区二区三区| 久久精品视频在线免费观看| 亚洲一区二区三区不卡国产欧美| 国产一区二区中文字幕| 蜜臀va亚洲va欧美va天堂| 欧美电影免费观看高清完整版| 日韩影院在线观看| 久久国内精品自在自线400部| 亚洲午夜成aⅴ人片| 理论电影国产精品| 欧亚洲嫩模精品一区三区| 中文字幕成人av| 久久99在线观看| 欧美精品黑人性xxxx| 国产免费成人在线视频| 美女网站一区二区| 欧美日韩mp4| 亚洲二区在线观看| 日韩毛片精品高清免费| 国产一区二区三区免费在线观看| 欧美日韩亚州综合| 久久久99精品免费观看不卡| 免费在线视频一区| 麻豆精品一区二区综合av| 欧美二区三区91| 免费三级欧美电影| 精品乱人伦小说| 国产激情精品久久久第一区二区| 国产婷婷色一区二区三区在线| 成人综合在线网站| 亚洲精品ww久久久久久p站| 欧美日韩中文一区| 久久精品国产999大香线蕉| 国产一区在线精品| 中文字幕一区二区三区精华液| 91在线观看美女| 日韩和欧美一区二区三区| 日韩欧美亚洲国产另类 | 欧美va亚洲va在线观看蝴蝶网| 久久99国产精品久久| 国产精品免费久久久久| 色噜噜狠狠一区二区三区果冻| 日韩电影免费在线观看网站| 欧美一二区视频| 欧美激情中文字幕一区二区| 99精品久久久久久| 午夜日韩在线电影| 国产婷婷精品av在线| 91免费看视频| 蜜臀99久久精品久久久久久软件| 久久久久国产精品麻豆ai换脸| 国产一区二区三区在线观看免费 | 91久久人澡人人添人人爽欧美 | 裸体在线国模精品偷拍| 中文字幕一区二区三区乱码在线 | 欧美日韩精品欧美日韩精品一| 国产揄拍国内精品对白| 亚洲乱码中文字幕| 欧美专区日韩专区| 国产一区二区三区黄视频| 中文字幕人成不卡一区| 欧美影院一区二区| 处破女av一区二区| 美女国产一区二区| 亚洲午夜国产一区99re久久| 国产精品美女久久久久久2018| 欧美高清激情brazzers| 97se亚洲国产综合自在线不卡| 久久精品免费观看| 污片在线观看一区二区| 亚洲欧美在线aaa| 久久久精品影视| 91 com成人网| 色综合久久66| www.欧美日韩国产在线| 国产一区二区三区高清播放| 婷婷久久综合九色综合伊人色| 亚洲欧美日韩国产中文在线| 欧美国产成人精品| 久久久国产午夜精品| 91精品国产欧美一区二区| 91久久香蕉国产日韩欧美9色| www.欧美色图| 成人午夜在线免费| 国产高清在线精品| 国产精品996| 国产精品一区不卡| 国产在线播放一区二区三区| 激情成人综合网| 久久久噜噜噜久噜久久综合| 欧美三级电影一区| 欧美日韩免费一区二区三区视频| 日本伦理一区二区| 欧美三级在线播放| 精品视频一区 二区 三区| 91美女在线视频| 欧洲精品一区二区三区在线观看| 亚洲色欲色欲www在线观看| 7777精品伊人久久久大香线蕉| 欧美日韩在线不卡| 欧美日韩免费电影| 欧美一区二区三区在线观看| 欧美日韩精品电影| 欧美精品国产精品| 日韩三级在线免费观看| 日韩午夜中文字幕| 久久精品一区二区三区av| 国产午夜精品久久久久久免费视| 精品福利二区三区| 久久久精品免费观看| 中文字幕一区三区| 亚洲人成网站精品片在线观看| 国产免费久久精品| 1024成人网| 亚洲国产成人精品视频| 日韩av不卡在线观看| 九九精品一区二区| 国产精品一区二区在线播放| 国产成人在线观看免费网站| 国产原创一区二区| 97超碰欧美中文字幕| 在线亚洲+欧美+日本专区| 欧美丰满嫩嫩电影| 国产亚洲欧美日韩俺去了| 国产精品美女久久久久久久久久久 | 国产三级一区二区| 亚洲欧美韩国综合色| 亚洲韩国精品一区| 国产剧情一区在线| 日韩精品中文字幕在线一区| 国产日产亚洲精品系列| 亚洲影视在线播放| 狠狠色狠狠色综合系列| www.在线成人| 精品国产一区二区三区不卡| 亚洲精品免费看| 国产一区91精品张津瑜| 欧美四级电影在线观看| 久久久亚洲综合| 亚洲综合成人在线| 日本不卡123| 欧美伊人精品成人久久综合97| 精品国产乱码91久久久久久网站|