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

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

?? subspic.c

?? 基于mpeg視頻編碼設計的視頻壓縮算法
?? 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在线视频播放地址| 精品入口麻豆88视频| 一区二区三区**美女毛片| 精品在线一区二区三区| 欧美三级韩国三级日本一级| 欧美国产精品一区二区三区| 久久精品国产在热久久| 91福利国产精品| 国产日产欧美一区二区三区| 日本美女一区二区| 欧美色图天堂网| 国产精品拍天天在线| 激情成人综合网| 在线播放一区二区三区| 亚洲综合成人在线| 99国产精品久久久久久久久久久| 国产亚洲欧美一区在线观看| 老鸭窝一区二区久久精品| 欧美怡红院视频| 亚洲人精品一区| 99热99精品| 中文乱码免费一区二区| 国产精品一区二区久激情瑜伽| 欧美一区二区三区视频免费| 亚洲午夜久久久久久久久电影网| 91小视频免费观看| 中文字幕不卡一区| 岛国一区二区在线观看| 欧美国产精品一区| 丁香婷婷综合网| 欧美va亚洲va在线观看蝴蝶网| 亚洲成人综合在线| 欧美色网一区二区| 亚洲一区二区综合| 精品视频1区2区| 亚洲午夜三级在线| 欧美性大战久久久久久久| 亚洲啪啪综合av一区二区三区| 成人av高清在线| 亚洲视频综合在线| 色综合中文字幕国产| 亚洲国产精品高清| 国产69精品久久99不卡| 欧美国产精品一区| eeuss鲁片一区二区三区在线观看| 国产精品久久久久久久久快鸭 | 国产欧美一区二区精品性| 精品中文字幕一区二区| 久久蜜桃一区二区| 国产91清纯白嫩初高中在线观看| 国产日韩精品一区| 欧美精品一区二区三区在线播放| 久久99最新地址| 久久久亚洲午夜电影| 久久av资源网| 精品国产乱码久久久久久浪潮| 九九精品一区二区| 日本一区二区三区免费乱视频| 成人涩涩免费视频| 亚洲精品中文字幕乱码三区 | 久久99精品久久久久婷婷| 精品国产免费一区二区三区四区| 国产精品影视天天线| 亚洲视频资源在线| 欧美日韩免费观看一区二区三区| 日韩av午夜在线观看| 久久亚区不卡日本| 福利一区在线观看| 亚洲欧美欧美一区二区三区| 精品视频一区 二区 三区| 青娱乐精品视频| 国产日韩精品视频一区| 99riav一区二区三区| 午夜在线电影亚洲一区| 日韩免费视频一区| 成人短视频下载| 亚洲成av人影院在线观看网| 国产69精品一区二区亚洲孕妇| 欧美视频一区二区| 午夜精品福利一区二区蜜股av | 国产精品天干天干在线综合| 91在线免费视频观看| 午夜精品视频在线观看| 亚洲精品一线二线三线无人区| 成人小视频在线| 视频一区二区中文字幕| 国产婷婷色一区二区三区在线| 色伊人久久综合中文字幕| 麻豆精品新av中文字幕| 欧美激情一区二区三区蜜桃视频 | 麻豆精品一二三| 国产精品国产三级国产普通话三级| 欧美亚男人的天堂| 国产激情一区二区三区桃花岛亚洲| 亚洲日本免费电影| 精品成人一区二区| 欧美伊人久久久久久午夜久久久久| 国产真实乱偷精品视频免| 亚洲欧洲精品成人久久奇米网| 欧美日韩在线播| 国产成人精品免费网站| 午夜精品一区二区三区三上悠亚| 国产日韩欧美制服另类| 欧美视频精品在线观看| 国产91丝袜在线播放0| 日本va欧美va瓶| 亚洲另类色综合网站| 久久久久久免费毛片精品| 欧美午夜在线一二页| 成人高清免费观看| 免费成人在线影院| 一区二区不卡在线播放 | 欧美刺激午夜性久久久久久久 | 久久99蜜桃精品| 亚洲福利电影网| 国产精品乱码一区二三区小蝌蚪| 欧美一级片免费看| 在线欧美一区二区| 成人黄色在线视频| 国内精品自线一区二区三区视频| 午夜成人在线视频| 亚洲精品网站在线观看| 国产欧美日韩亚州综合| 欧美精品一二三| 色综合天天综合网天天狠天天| 精品一区二区三区免费播放 | 日本一区二区免费在线| 日韩一区二区三区四区| 欧美三级电影网站| 色婷婷综合久色| 成人av在线网站| 丰满少妇久久久久久久| 国内精品国产成人国产三级粉色| 爽爽淫人综合网网站| 亚洲一区二区三区自拍| 日韩毛片精品高清免费| 欧美国产精品专区| 久久综合狠狠综合久久激情 | 成人av电影免费观看| 国产成人精品影视| 国产精品一区专区| 国产一区亚洲一区| 韩国av一区二区三区在线观看| 欧美a一区二区| 日本va欧美va欧美va精品| 日韩中文字幕亚洲一区二区va在线 | bt欧美亚洲午夜电影天堂| 国产成人精品免费看| 国产一区二区精品久久| 久久99热这里只有精品| 久色婷婷小香蕉久久| 蜜臀av一区二区在线观看| 免费欧美日韩国产三级电影| 丝袜亚洲另类欧美| 视频一区在线播放| 蜜桃视频一区二区| 精品一区二区三区免费毛片爱| 精品一区二区综合| 国产自产视频一区二区三区| 国产自产2019最新不卡| 国产一区二三区好的| 久久黄色级2电影| 奇米精品一区二区三区在线观看| 亚洲午夜激情网站| 亚洲影院理伦片| 午夜精品久久久久久久蜜桃app| 亚洲成av人影院在线观看网| 亚洲18女电影在线观看| 偷拍与自拍一区| 免费观看在线综合色| 久久99热99| 丁香天五香天堂综合| 99国产精品久久久久久久久久久| 在线一区二区三区四区五区| 91蜜桃网址入口| 色屁屁一区二区| 欧美日韩视频不卡| 欧美一级二级三级蜜桃| 精品粉嫩超白一线天av| 国产精品久久夜| 亚洲最新在线观看| 婷婷中文字幕一区三区| 久久99深爱久久99精品| 成人av在线一区二区| 欧美四级电影在线观看| 日韩一级大片在线| 欧美国产精品久久| 一区二区激情小说| 久久精品免费观看| 国产69精品久久777的优势| 日本久久电影网| 欧美大胆人体bbbb| 亚洲色图制服丝袜| 老司机午夜精品| 91免费在线看| 日韩精品中文字幕在线不卡尤物 |