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

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

?? refbuf.c

?? 網絡MPEG4IP流媒體開發源代碼
?? C
字號:
/************************************************************************* COPYRIGHT AND WARRANTY INFORMATION** Copyright 2001, International Telecommunications Union, Geneva** DISCLAIMER OF WARRANTY** These software programs are available to the user without any* license fee or royalty on an "as is" basis. The ITU disclaims* any and all warranties, whether express, implied, or* statutory, including any implied warranties of merchantability* or of fitness for a particular purpose.  In no event shall the* contributor or the ITU 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 ITU does not represent or warrant that the programs furnished* hereunder are free of infringement of any third-party patents.* Commercial implementations of ITU-T Recommendations, including* shareware, may be subject to royalty fees to patent holders.* Information regarding the ITU-T patent policy is available from* the ITU Web site at http://www.itu.int.** THIS IS NOT A GRANT OF PATENT RIGHTS - SEE THE ITU-T PATENT POLICY.*************************************************************************//*! ************************************************************************ * \file refbuf.c * * \brief *    Declarations of teh reference frame buffer types and functions ************************************************************************ */#define HACK#include <stdio.h>#include <stdlib.h>#include <memory.h>#include <assert.h>#include "refbuf.h"#define CACHELINESIZE 32#ifdef HACK/*! ************************************************************************ * \brief *    Reference buffer write routines ************************************************************************ */void PutPel_14 (pel_t **Pic, int y, int x, pel_t val){  Pic [IMG_PAD_SIZE*4+y][IMG_PAD_SIZE*4+x] = val;}void PutPel_11 (pel_t *Pic, int y, int x, pel_t val){  Pic [y*img->width+x] = val;}/*! ************************************************************************ * \brief *    Reference buffer read, Full pel ************************************************************************ */pel_t FastPelY_11 (pel_t *Pic, int y, int x){  return Pic [y*img->width+x];}pel_t *FastLine16Y_11 (pel_t *Pic, int y, int x){  return &Pic [y*img->width+x];}pel_t UMVPelY_11 (pel_t *Pic, int y, int x){  if (x < 0)  {    if (y < 0)      return Pic [0];    if (y >= img->height)      return Pic [(img->height-1) * img->width];    return Pic [y*img->width];  }  if (x >= img->width)  {    if (y < 0)      return Pic [img->width-1];    if (y >= img->height)      return Pic [img->height * img->width -1];    return Pic [(y+1)*img->width -1 ];  }  if (y < 0)    // note: corner pixels were already processed    return Pic [x];  if (y >= img->height)    return Pic [(img->height-1)*img->width+x];  return Pic [y*img->width+x];}/*! ************************************************************************ * \note *    The following function is NOT reentrant!  Use a buffer *    provided by the caller to change that (but it costs a memcpy()... ************************************************************************ */static pel_t line[16];#if 0pel_t *UMVLine16Y_11 (pel_t *Pic, int y, int x){  int i;  for (i=0; i<16; i++)    line[i] = UMVPelY_11 (Pic, y, x+i);  return line;}#elsepel_t *UMVLine16Y_11 (pel_t *Pic, int y, int x){  int i, maxx;  pel_t *Picy;  Picy = &Pic [max(0,min(img->height-1,y)) * img->width];  if (x < 0) {                    // Left edge ?    maxx = min(0,x+16);    for (i = x; i < maxx; i++)      line[i-x] = Picy [0];       // Replicate left edge pixel    maxx = x+16;    for (i = 0; i < maxx; i++)    // Copy non-edge pixels      line[i-x] = Picy [i];  }  else if (x > img->width-16)  {  // Right edge ?    maxx = img->width;    for (i = x; i < maxx; i++)      line[i-x] = Picy [i];       // Copy non-edge pixels    maxx = x+16;    for (i = max(img->width,x); i < maxx; i++)      line[i-x] = Picy [img->width-1];  // Replicate right edge pixel  }  else                            // No edge    return &Picy [x];  return line;}#endif/*! ************************************************************************ * \brief *    Reference buffer read, 1/2 pel ************************************************************************ */pel_t FastPelY_12 (pel_t **Pic, int y, int x){  return Pic [IMG_PAD_SIZE*4+(y<<1)][IMG_PAD_SIZE*4+(x<<1)];}pel_t UMVPelY_12 (pel_t **Pic, int y, int x){  return UMVPelY_14 (Pic, y*2, x*2);}/*! ************************************************************************ * \brief *    Reference buffer, 1/4 pel ************************************************************************ */pel_t UMVPelY_14 (pel_t **Pic, int y, int x){  int width4  = ((img->width+2*IMG_PAD_SIZE-1)<<2);  int height4 = ((img->height+2*IMG_PAD_SIZE-1)<<2);  x = x + IMG_PAD_SIZE*4;  y = y + IMG_PAD_SIZE*4;  if (x < 0)  {    if (y < 0)      return Pic [y&3][x&3];    if (y > height4)      return Pic [height4+(y&3)][x&3];    return Pic [y][x&3];  }  if (x > width4)  {    if (y < 0)      return Pic [y&3][width4+(x&3)];    if (y > height4)      return Pic [height4+(y&3)][width4+(x&3)];    return Pic [y][width4+(x&3)];  }  if (y < 0)    // note: corner pixels were already processed    return Pic [y&3][x];  if (y > height4)    return Pic [height4+(y&3)][x];  return Pic [y][x];}pel_t FastPelY_14 (pel_t **Pic, int y, int x){  return Pic [IMG_PAD_SIZE*4+y][IMG_PAD_SIZE*4+x];}/*! ************************************************************************ * \brief *    Reference buffer, 1/8th pel ************************************************************************ */pel_t UMVPelY_18 (pel_t **Pic, int y, int x){  byte out;  int yfloor, xfloor, xq, yq;  /* Maximum values (padding included) */  int maxx8 = (img->width +2*IMG_PAD_SIZE-2)*8;  int maxy8 = (img->height+2*IMG_PAD_SIZE-2)*8;  /* Compensate for frame padding */  x = x + IMG_PAD_SIZE*8;  y = y + IMG_PAD_SIZE*8;  if (x < 0)    x = x&7;  else if (x > maxx8)    x = maxx8 + (x&7);  if (y < 0)    y = y&7;  else if (y > maxy8)    y = maxy8 + (y&7);  xfloor = x>>1;  yfloor = y>>1;  if( (x&1) && (y&1) )  {    xq = x&7;     yq = y&7;    // I & IV QUARTER    if ((xq<4 && yq<4) || (xq>=4 && yq>=4)){      if (xq==3 && yq==3){        out=(Pic[yfloor-1][xfloor-1] + 3*Pic[yfloor+1][xfloor+1] + 2) / 4;      }      else if (xq==5 && yq==5){        out=(3*Pic[yfloor][xfloor] + Pic[yfloor+2][xfloor+2] + 2) / 4;      }      else if ((xq==3 && yq==1) || (xq==7 && yq==5)){        out=(3*Pic[yfloor][xfloor+1] + Pic[yfloor+2][xfloor-1] + 2) / 4;      }      else if ((xq==1 && yq==3) || (xq==5 && yq==7)){        out=(3*Pic[yfloor+1][xfloor] + Pic[yfloor-1][xfloor+2] + 2) / 4;      }      else {        out=(Pic[yfloor+1][xfloor] + Pic[yfloor][xfloor+1]) / 2;      }    }     // II & III QUARTER    else{      if (xq==5 && yq==3){        out=(3*Pic[yfloor+1][xfloor] + Pic[yfloor-1][xfloor+2] + 2) / 4;      }      else if (xq==3 && yq==5){        out=(3*Pic[yfloor][xfloor+1]+Pic[yfloor+2][xfloor-1] + 2) / 4;      }      else if ((xq==1 && yq==5) || (xq==5 && yq==1)){        out=(3*Pic[yfloor][xfloor]+Pic[yfloor+2][xfloor+2] + 2) / 4;      }      else if ((xq==3 && yq==7) || (xq==7 && yq==3)){        out=(3*Pic[yfloor+1][xfloor+1]+Pic[yfloor-1][xfloor-1] + 2) / 4;      }      else{        out=( Pic[yfloor][xfloor] + Pic[yfloor+1][xfloor+1] ) / 2;      }    }  }  else if (x&1)  {    out=( Pic[yfloor  ][xfloor  ] + Pic[yfloor  ][xfloor+1] ) / 2;  }  else if (y&1)  {    out=( Pic[yfloor  ][xfloor  ] + Pic[yfloor+1][xfloor  ] ) / 2;  }  else    out=  Pic[yfloor  ][xfloor  ];  return(out);}pel_t FastPelY_18 (pel_t **Pic, int y, int x){  byte out;  int yfloor, xfloor, xq, yq;  /* Compensate for frame padding */  x = x + IMG_PAD_SIZE*8;  y = y + IMG_PAD_SIZE*8;  xfloor = x>>1;  yfloor = y>>1;  if( (x&1) && (y&1) )  {    xq = x&7;     yq = y&7;    // I & IV QUARTER    if ((xq<4 && yq<4) || (xq>=4 && yq>=4)){      if (xq==3 && yq==3){        out=(Pic[yfloor-1][xfloor-1] + 3*Pic[yfloor+1][xfloor+1] + 2) / 4;      }      else if (xq==5 && yq==5){        out=(3*Pic[yfloor][xfloor] + Pic[yfloor+2][xfloor+2] + 2) / 4;      }      else if ((xq==3 && yq==1) || (xq==7 && yq==5)){        out=(3*Pic[yfloor][xfloor+1] + Pic[yfloor+2][xfloor-1] + 2) / 4;      }      else if ((xq==1 && yq==3) || (xq==5 && yq==7)){        out=(3*Pic[yfloor+1][xfloor] + Pic[yfloor-1][xfloor+2] + 2) / 4;      }      else {        out=(Pic[yfloor+1][xfloor] + Pic[yfloor][xfloor+1]) / 2;      }    }     // II & III QUARTER    else{      if (xq==5 && yq==3){        out=(3*Pic[yfloor+1][xfloor] + Pic[yfloor-1][xfloor+2] + 2) / 4;      }      else if (xq==3 && yq==5){        out=(3*Pic[yfloor][xfloor+1]+Pic[yfloor+2][xfloor-1] + 2) / 4;      }      else if ((xq==1 && yq==5) || (xq==5 && yq==1)){        out=(3*Pic[yfloor][xfloor]+Pic[yfloor+2][xfloor+2] + 2) / 4;      }      else if ((xq==3 && yq==7) || (xq==7 && yq==3)){        out=(3*Pic[yfloor+1][xfloor+1]+Pic[yfloor-1][xfloor-1] + 2) / 4;      }      else{        out=( Pic[yfloor][xfloor] + Pic[yfloor+1][xfloor+1] ) / 2;      }    }  }  else if (x&1)  {    out=( Pic[yfloor  ][xfloor  ] + Pic[yfloor  ][xfloor+1] ) / 2;  }  else if (y&1)  {    out=( Pic[yfloor  ][xfloor  ] + Pic[yfloor+1][xfloor  ] ) / 2;  }  else    out=  Pic[yfloor  ][xfloor  ];  return(out);}void InitRefbuf (){  int width  = img->width;  int height = img->height;  int num_frames = img->buf_cycle;  int i;  if (NULL == (Refbuf11_P = malloc ((width * height + 4711) * sizeof (pel_t))))    no_mem_exit ("InitRefbuf: Refbuf11_P");  if (NULL == (Refbuf11 = malloc (num_frames * sizeof (pel_t *))))    no_mem_exit ("InitRefbuf: Refbuf11");  for (i=0; i<num_frames; i++)    if (NULL == (Refbuf11[i] = malloc ((width * height + 4711) * sizeof (pel_t))))      no_mem_exit ("InitRefbuf: Refbuf11");}/*! ************************************************************************ * \brief *    Substitutes function oneforthpix_2. It should be worked *    out how this copy procedure can be avoided. ************************************************************************ */void copy2mref(){  int j, uv;  img->frame_cycle=img->number % img->buf_cycle;  /*GH img->no_multpred used insteadof MAX_MULT_PRED                                                    frame buffer size = img->no_multpred+1*/  // Luma  for (j=0; j < (img->height+2*IMG_PAD_SIZE)*4; j++)    memcpy(mref[img->frame_cycle][j],mref_P[j], (img->width+2*IMG_PAD_SIZE)*4);  //  Chroma:  for (uv=0; uv < 2; uv++)    for (j=0; j < img->height_cr; j++)        memcpy(mcef[img->frame_cycle][uv][j],mcef_P[uv][j],img->width_cr);  // Full pel represnetation for MV search  memcpy (Refbuf11[img->frame_cycle], Refbuf11_P, (img->width*img->height));}#endif#ifndef HACK// Alloc and free for reference buffersrefpic_t *AllocRefPic (int Id,            int NumCols,            int NumRows,            int MaxMotionVectorX,   // MV Size may be used to allocate additional            int MaxMotionVectorY)   // memory around boundaries fro UMV search{  refpic_t *pic;  int xs, ys;  if (NULL == (pic = malloc (sizeof (refpic_t))))    no_mem_exit("AllocRefPic: pic");  if (NumCols %2 != 0)    error ("AllocRefPic: Number of columns must be divisible by two, exiting",600);  if (NumRows %2 != 0)    error ("AllocRefPic: Number of rows must be divisible by two, exiting",600);  pic->Id = Id;  xs = NumCols + MaxMotionVectorX + MaxMotionVectorX;  if (xs % (CACHELINESIZE/sizeof (pel_t)) != 0)    xs = ((xs / (CACHELINESIZE/sizeof (pel_t)))+1) * (CACHELINESIZE/sizeof (pel_t));  ys = NumRows + MaxMotionVectorY + MaxMotionVectorY;  pic->x_ysize = xs * 4;  pic->y_ysize = (NumRows + MaxMotionVectorY + MaxMotionVectorY) * 4;  pic->x_yfirst = MaxMotionVectorX * 4;  pic->x_ylast  = (NumCols + MaxMotionVectorX) * 4;  pic->y_yfirst = MaxMotionVectorY * 4;  pic->x_ylast  = (NumRows + MaxMotionVectorY) * 4;  pic->x_uvsize = xs/2;  pic->y_uvsize = ys/2;  pic->x_uvfirst  = MaxMotionVectorX/2;  pic->x_uvlast = (NumCols + MaxMotionVectorX)/2;  pic->y_uvfirst  = MaxMotionVectorY/2;  pic->y_uvlast = (NumRows + MaxMotionVectorY)/2;  if (NULL == (pic->y = malloc (16 * sizeof (pel_t)* xs * ys)))    no_mem_exit ("AllocRefPic: pic->y");  if (NULL == (pic->u = malloc (sizeof (pel_t) * (xs/2) * (ys/2))))    no_mem_exit ("AllocRefPic: pic->u");  if (NULL == (pic->v = malloc (sizeof (pel_t) * (xs/2) * (ys/2))))    no_mem_exit ("AllocRefPic: pic->v");  return pic;}int FreeRefPic (refpic_t *Pic){  if (Pic == NULL)    return 0;  if (Pic->y != NULL)    free (Pic->y);  if (Pic->u != NULL)    free (Pic->u);  if (Pic->v != NULL)    free (Pic->v);  free (Pic);  return (0);}// Access functions for full pel (1/1 pel)pel_t PelY_11 (refpic_t *Pic, int x, int y){  register int pos;  pos = x<<2+Pic->x_yfirst;   // Y Structures are 1/4 pel, hence *4  pos += (Pic->x_ysize * (Pic->y_yfirst + y<<2));  return Pic->y[pos];}pel_t PelU_11 (refpic_t *Pic, int x, int y){  register int pos;  pos = x+Pic->x_uvfirst;   // UV Structures are 1/1 pel  pos += Pic->x_uvsize * (Pic->y_uvfirst + y);  return Pic->u[pos];}pel_t PelV_11 (refpic_t *Pic, int x, int y){  register int pos;  pos = x+Pic->x_uvfirst;   // UV Structures are 1/1 pel  pos += Pic->x_uvsize * (Pic->y_uvfirst + y);  return Pic->v[pos];}pel_t *MBLineY_11 (refpic_t *Pic, int x, int y){  error ("MBLineY_11: net yet implemented.", 600);}// Access functions for half pel (1/2 pel)pel_t PelY_12 (refpic_t *Pic, int x, int y){  register int pos;  pos = (x<<1+Pic->x_yfirst);   // Structures are 1/4 pel, hence *4  pos += (Pic->x_ysize * (Pic->y_yfirst + y<<1));  return (Pic->v[pos]);};// Access functions for quater pel (1/4 pel)pel_t PelY_14 (refpic_t *Pic, int x, int y){  return (Pic->y[ (Pic->y_yfirst+y)*Pic->x_ysize  + x + Pic->x_yfirst]);}// Access functions for one-eigths pel (1/8 pel)pel_t PelY_18 (refpic_t *Pic, int x, int y){  error ("PelY_18: No 1/8th pel support yet", 600);}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
热久久国产精品| 亚洲靠逼com| 国产精品一品二品| 亚洲精品一区二区在线观看| 久久精品99久久久| 久久蜜桃香蕉精品一区二区三区| 国产一区二区电影| 国产精品久久久久一区二区三区| 97se亚洲国产综合在线| 亚洲h精品动漫在线观看| 欧美久久久久中文字幕| 久久成人免费日本黄色| 国产欧美日本一区视频| 欧美亚洲综合色| 麻豆传媒一区二区三区| 国产精品三级av在线播放| 色婷婷久久综合| 紧缚奴在线一区二区三区| 国产精品天干天干在线综合| 色综合中文字幕| 蜜桃传媒麻豆第一区在线观看| 久久精品这里都是精品| 在线精品视频免费播放| 久久精品99国产国产精| 亚洲欧美日韩中文播放| 日韩欧美视频一区| 91极品美女在线| 久久er精品视频| 伊人色综合久久天天人手人婷| 欧美人与禽zozo性伦| 国产在线精品一区在线观看麻豆| 中文字幕亚洲精品在线观看 | 久久久久九九视频| 色综合久久久久综合体桃花网| 日韩av电影免费观看高清完整版| 国产精品美女久久久久高潮| 欧美情侣在线播放| www.成人网.com| 热久久免费视频| 亚洲美女区一区| 国产视频不卡一区| 日韩限制级电影在线观看| 99久久免费精品高清特色大片| 美日韩一区二区三区| 亚洲猫色日本管| 国产精品欧美一区喷水| 欧美成人欧美edvon| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国内偷窥港台综合视频在线播放| 午夜精品久久久久久| 国产精品国产三级国产aⅴ无密码| 国产精品一区二区视频| 日韩午夜av电影| 午夜视频在线观看一区二区三区| 一区二区三区四区中文字幕| 久久蜜桃av一区二区天堂| 日韩二区三区在线观看| 亚洲精品高清在线| 亚洲欧洲日产国码二区| 久久亚洲免费视频| 日韩欧美色综合网站| 欧美欧美午夜aⅴ在线观看| 91丨国产丨九色丨pron| 成人av动漫网站| 成人涩涩免费视频| 精品在线视频一区| 精品无码三级在线观看视频 | 日本精品裸体写真集在线观看| 高清不卡在线观看av| 国产精品综合av一区二区国产馆| 久久se这里有精品| 久久精品国产网站| 久久精品国产亚洲高清剧情介绍| 五月婷婷欧美视频| 日韩综合在线视频| 亚洲国产wwwccc36天堂| 亚洲成人综合视频| 午夜精品久久久久| 日本va欧美va欧美va精品| 午夜精品福利一区二区蜜股av| 一区二区欧美视频| 亚洲一区中文日韩| 午夜视频在线观看一区二区| 性感美女极品91精品| 亚洲超碰97人人做人人爱| 亚洲成av人片在线| 久久99在线观看| 国产mv日韩mv欧美| 成人av网站在线观看| 99精品视频中文字幕| www.日韩在线| 色视频成人在线观看免| 欧美日韩精品欧美日韩精品一综合| 欧美美女视频在线观看| 日韩欧美一级二级| 中文字幕免费观看一区| 亚洲欧洲美洲综合色网| 亚洲一区二区三区四区五区中文| 亚洲18影院在线观看| 久久精品国产久精国产| 高清成人在线观看| 欧美亚洲国产一区二区三区| 日韩欧美国产小视频| 中文字幕欧美日韩一区| 亚洲最大成人网4388xx| 蜜臀va亚洲va欧美va天堂| 国产精品99久久久| 在线免费亚洲电影| 欧美videossexotv100| 中文字幕色av一区二区三区| 亚洲va国产天堂va久久en| 国产精品自拍一区| 91久久一区二区| 久久夜色精品一区| 亚洲综合图片区| 激情久久五月天| 欧美午夜精品一区二区三区| 欧美xxxx老人做受| 亚洲精品videosex极品| 极品美女销魂一区二区三区免费| 99久久伊人久久99| 日韩欧美不卡在线观看视频| 国产精品国产a| 麻豆91免费看| 在线视频欧美精品| 欧美激情一二三区| 日本va欧美va瓶| 色诱视频网站一区| 国产日韩影视精品| 日韩高清不卡一区二区三区| 91在线国产福利| 国产亚洲一区二区三区| 日韩高清电影一区| 欧洲av一区二区嗯嗯嗯啊| 久久九九99视频| 精品一区在线看| 欧美日韩国产在线观看| 自拍偷自拍亚洲精品播放| 国产精品一区专区| 91精品国产综合久久蜜臀| 亚洲黄色av一区| 成人高清免费观看| 久久久www成人免费毛片麻豆| 天天影视色香欲综合网老头| 91视频91自| 国产精品色一区二区三区| 经典三级一区二区| 日韩免费观看高清完整版在线观看| 伊人色综合久久天天人手人婷| 国产成人99久久亚洲综合精品| 日韩欧美一区二区久久婷婷| 亚洲大尺度视频在线观看| 色爱区综合激月婷婷| 欧美国产精品一区二区三区| 国产一区二区三区在线观看免费视频| 7799精品视频| 丝袜美腿亚洲色图| 欧美日韩一本到| 亚洲va中文字幕| 777亚洲妇女| 免费看黄色91| 欧美一区二区三区在| 日本伊人精品一区二区三区观看方式| 精品国产一二三| 国产精品资源在线| 久久久国产精品午夜一区ai换脸| 国产在线精品不卡| 久久久精品蜜桃| 国产成人鲁色资源国产91色综| 久久久精品影视| 岛国av在线一区| 国产精品国产三级国产aⅴ入口| 成人黄色av电影| 自拍偷拍国产精品| 在线一区二区三区四区| 亚洲高清免费在线| 欧美一区二区三区免费| 激情六月婷婷综合| 国产婷婷一区二区| 成人黄色免费短视频| 亚洲精品自拍动漫在线| 欧美日韩国产精选| 免费久久精品视频| 欧美国产日产图区| 欧美性受xxxx黑人xyx性爽| 日韩av一区二| 久久精品免费在线观看| 91免费观看在线| 亚洲国产一二三| 精品国产网站在线观看| 成人夜色视频网站在线观看| 亚洲三级在线观看| 日韩一区二区三区在线视频| 国产精品一线二线三线精华| 亚洲日本va在线观看| 欧美日本一区二区在线观看| 久久疯狂做爰流白浆xx| 国产精品美女久久久久久久久久久 | 亚洲欧洲日产国码二区| 欧美日韩二区三区|