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

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

?? dstr_2d.c

?? DM642多媒體原版程序代碼,用于圖象,語音算法.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ======================================================================== */
/*  DMA Stream abstractions for Imaging.                                    */
/*                                                                          */
/*  These streams tie a large "external" buffer with a small "internal"     */
/*  buffer, and provide a generalized interface for streaming data to/from  */
/*  the external buffer from/to the internal buffer.                        */
/* ======================================================================== */
#define MYDAT_2D1D   0
#define MYDAT_1D2D   1

#include "dstr_2d.h"   
#include "csl_dat.h"
#include "csl_irq.h"

/*#define DSTR_DEBUG*/

#ifdef DSTR_DEBUG
# include <stdio.h>
# define dprintf(x) printf x ; fflush(stdout)
#else
# define dprintf(x) 
#endif

/* ======================================================================== */
/*  DSTR_OPEN    -- Initialize a new DMA Stream object.                     */
/* ======================================================================== */

int dstr_open
(
    dstr_t         *dstr,       /* DMA Stream structure.                    */
    void           *x_data,     /* "External" data buffer.                  */
    int             x_size,     /* Size of external data buffer.            */
    void           *i_data,     /* "Internal" data buffer.                  */
    unsigned short  i_size,     /* Size of internal data buffer.            */
    unsigned short  quantum,    /* Size of a single transfer (get or put)   */
    unsigned short  multiple,   /* Number of lines to fetch                 */
    unsigned short  stride,     /* Stride amount to increment ext. memory   */
    unsigned short  w_size,     /* Window size.  Set to 1 for double buf.   */     
    dstr_dir_t      dir         /* Direction (Input or Output)              */
)
{
  
    
    /* -------------------------------------------------------------------- */
    /*  Sanity check all of the arguments.   We might consider providing    */
    /*  a range of error codes here, rather than just -1, but for now,      */
    /*  this will do.                                                       */
    /* -------------------------------------------------------------------- */
    if (!dstr || !x_data || !i_data || !quantum || !i_size || !multiple)     
                                                                return -1;
    if (dir == DSTR_OUTPUT && w_size != 1)                      return -2;
    if ((2 * w_size * quantum * multiple) > i_size || w_size < 1)
    {
      dprintf(("i_size:%d, exp_size:%d \n",
              i_size, (2 * w_size * quantum * multiple)));            
      return -3;
    }

    /* -------------------------------------------------------------------- */
    /*  Poke all the appropriate values into the structure.                 */
    /*  Make sure our external and internal sizes are rounded to multiples  */
    /*  of our transfer quantum.                                            */
    /* -------------------------------------------------------------------- */
    dstr->x_data   = (char *) x_data;
    dstr->x_size   = x_size - (x_size % (stride * multiple));
    
    dstr->i_data   = (char *) i_data;
    dstr->i_size   = (2 * quantum * multiple * w_size); 
    
    dstr->i_ofs    = 0;
    dstr->quantum  = quantum;
    dstr->multiple = multiple;  
    
    dstr->w_size   = (w_size * multiple *quantum); 
    dstr->stride   = stride;
    dstr->x_ofs    = 0; 
       
  
    /* -------------------------------------------------------------------- */
    /*  If this is an external-to-internal transfer, start off the initial  */
    /*  transfers to pipe up the stream.                                    */
    /* -------------------------------------------------------------------- */
    if (dir == DSTR_INPUT)
    {
        
        unsigned id; 
                        
        dprintf(("PREFETCH: ACTIVE = %d\n", dstr->x_ofs)); 
        
        id = DAT_copy2d( DAT_2D1D,
                         (void*) (dstr->x_data), 
                         (void*) (dstr->i_data),
                         dstr->quantum,
                         w_size * multiple,
                         dstr->stride);

        dstr->x_ofs   += (dstr->stride  * multiple * w_size);
        dstr->i_ofs   += (dstr->quantum * multiple * w_size);
        dstr->xfer_id = id;
    }
    else
    /* -------------------------------------------------------------------- */
    /*  If this is an internal-to-external transfer, start our x_ofs at -1  */
    /*  to indicate that this stream has not yet been written to.           */
    /* -------------------------------------------------------------------- */
    {
        dstr->x_ofs = -1;
    }

    return 0;
} 

/* ======================================================================== */
/*  DSTR_GET     -- Get the next buffer from a stream.                      */
/* ======================================================================== */
void * dstr_get(dstr_t *dstr)
{
    unsigned    id;
    char        *ready, *active;
    int         do_copy = 0;

    /* -------------------------------------------------------------------- */
    /*  Remember the pointer to the currently ready buffer, and generate    */
    /*  a pointer to the new active buffer.                                 */
    /*                                                                      */
    /*  The ready buffer is always 'w_size' quanta behind the active        */
    /*  buffer, modulo the total buffer size.  The conditional handles      */
    /*  the one wraparound case.  The input offset marches from 'w_size -   */
    /*  quantum' thru 'i_size - quantum'.                                   */
    /*                                                                      */
    /*  We also decide whether an extra 'copy' transfer is issued here,     */
    /*  based on the current value of i_ofs relative to the window size.    */
    /* -------------------------------------------------------------------- */
    active  = dstr->i_data + dstr->i_ofs;
    do_copy = dstr->i_ofs >= (dstr->w_size + dstr->quantum);

    if (dstr->i_ofs >= dstr->w_size)
        ready = dstr->i_data + dstr->i_ofs - dstr->w_size;  /* Normal       */
    else
        ready = dstr->i_data + dstr->w_size;                /* Wraparound   */

    /* -------------------------------------------------------------------- */
    /*  Update our input offset for the next transfer, and handle its       */
    /*  wraparound case as well.                                            */
    /* -------------------------------------------------------------------- */
    dstr->i_ofs  += dstr->quantum;
    if (dstr->i_ofs >= dstr->i_size)
        dstr->i_ofs = dstr->w_size - dstr->quantum;

    dprintf(("ACTIVE: %3d  READY: %3d  COPY: %d  W_SIZE: %d\n", 
             active - i_data, ready - i_data, do_copy, w_size));

    /* -------------------------------------------------------------------- */
    /*  Fire off a new transfer for the next buffer.                        */
    /* -------------------------------------------------------------------- */
    if (dstr->x_ofs < dstr->x_size)
    {   
        
        id = DAT_copy((void *) (dstr->x_data + dstr->x_ofs), 
                      (void *) (active),
                      dstr->quantum);
    }

    /* -------------------------------------------------------------------- */
    /*  Handle extra copy for sliding window.   We replace the previous     */
    /*  "ready" line with a copy of the new "active" line.   In the case    */
    /*  where we do this extra copy, we block on the extra copy only.       */
    /* -------------------------------------------------------------------- */
    if (do_copy)
    { 
        
        id = DAT_copy((void *) (active), 
                      (void *) (ready - dstr->quantum), 
                      dstr->quantum);
    }

    /* -------------------------------------------------------------------- */
    /*  Actually wait the ready buffer, to be sure it's truly ready.        */
    /* -------------------------------------------------------------------- */
    DAT_wait(dstr->xfer_id);

    /* -------------------------------------------------------------------- */
    /*  Remember the new transfer ID, and update our external data pointer. */
    /* -------------------------------------------------------------------- */
    dstr->xfer_id = id;
    dstr->x_ofs  += dstr->stride;

    /* -------------------------------------------------------------------- */
    /*  Return the pointer to the ready buffer.  We're done.                */
    /* -------------------------------------------------------------------- */
    return (void*) ready;
}

/* ======================================================================== */
/*  DSTR_PUT     -- Write out the next buffer in a double-buffer.           */
/* ======================================================================== */
void *dstr_put(dstr_t *dstr)
{
    unsigned id;
    char *ready;
    
    /* -------------------------------------------------------------------- */
    /*  If x_ofs < 0, then we haven't started yet.  Return the initial      */
    /*  buffer pointer for the user to start writing data.                  */
    /* -------------------------------------------------------------------- */
    if (dstr->x_ofs < 0)
    {
        dstr->x_ofs = 0;
        dstr->i_ofs = 0;        
        
        id = DAT_copy((void *) (dstr->i_data + dstr->i_ofs),
                      (void *) (dstr->x_data + dstr->x_ofs),
                      1); 
        
        dstr->xfer_id = id;
        return (void *) dstr->i_data;
    }

    /* -------------------------------------------------------------------- */
    /*  Otherwise, fire off the copy for the dirty buffer.                  */
    /* -------------------------------------------------------------------- */
    if (dstr->x_ofs < dstr->x_size)
    {   
                
        id = DAT_copy((void *) (dstr->i_data + dstr->i_ofs),
                      (void *) (dstr->x_data + dstr->x_ofs),
                      dstr->quantum); 
    }

    /* -------------------------------------------------------------------- */
    /*  Generate the pointer to the newly ready buffer, and move our        */
    /*  output's data pointer.                                              */
    /* -------------------------------------------------------------------- */
    dstr->x_ofs += dstr->stride;
    dstr->i_ofs ^= dstr->quantum;
    ready        = dstr->i_data + dstr->i_ofs;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
热久久一区二区| 欧美aa在线视频| 国产精品久久久久影院亚瑟| www一区二区| 国产亚洲精品aa午夜观看| 精品久久久久久久久久久久久久久久久| 欧美视频三区在线播放| 欧美日韩电影在线播放| 日韩美女天天操| 久久久不卡网国产精品一区| 国产精品久久久久影院亚瑟| 亚洲精品中文在线影院| 亚洲chinese男男1069| 日本在线不卡视频| 国产一区二区三区美女| voyeur盗摄精品| 欧美色老头old∨ideo| 日韩丝袜情趣美女图片| 国产精品免费aⅴ片在线观看| 亚洲男人的天堂一区二区| 婷婷夜色潮精品综合在线| 精品在线播放免费| 色呦呦一区二区三区| 欧美午夜电影一区| 亚洲精品在线免费播放| 亚洲欧美另类久久久精品2019| 丝袜脚交一区二区| 国产成人亚洲精品青草天美 | 欧美日韩高清影院| 精品欧美乱码久久久久久1区2区 | 色综合天天综合网天天狠天天| 欧美色综合久久| 久久久一区二区三区| 中文字幕日本不卡| 日本欧美加勒比视频| 国产福利精品导航| 4438x亚洲最大成人网| 日本一区二区三区四区| 日本伊人色综合网| 色综合色狠狠综合色| 精品国产一区二区精华| 亚洲狠狠丁香婷婷综合久久久| 精品系列免费在线观看| 欧美在线观看视频一区二区| 久久女同性恋中文字幕| 午夜一区二区三区在线观看| www.成人网.com| 久久精品人人做| 蜜臀av一级做a爰片久久| 91蝌蚪porny九色| 国产蜜臀97一区二区三区| 青青草成人在线观看| 波多野结衣中文一区| 日韩一区二区三| 亚洲一区二区三区小说| 99精品国产91久久久久久| 欧美精品一区二区高清在线观看 | 国产欧美一区二区三区网站| 美女脱光内衣内裤视频久久影院| 99视频精品全部免费在线| 欧美激情一区二区三区全黄| 国内外成人在线| 日韩女优毛片在线| 青青草国产成人99久久| 欧美一级黄色大片| 久久国产精品99久久久久久老狼| 欧美体内she精视频| 亚洲一二三区不卡| 欧美三区在线观看| 午夜精品一区二区三区免费视频 | 欧美激情综合五月色丁香| 美腿丝袜在线亚洲一区| 欧美精品色一区二区三区| 亚洲福中文字幕伊人影院| 欧美性猛交xxxxxxxx| 亚洲第一激情av| 欧美日韩国产首页| 日韩精品每日更新| 欧美白人最猛性xxxxx69交| 日本不卡视频一二三区| 欧美tickle裸体挠脚心vk| 精品中文av资源站在线观看| 精品少妇一区二区三区日产乱码| 久久69国产一区二区蜜臀 | 99精品一区二区| 亚洲欧美偷拍三级| 欧美日韩黄视频| 久久精品国产久精国产| 久久久久久久久久久久久女国产乱| 国产一区二区女| 亚洲视频一区在线| 911精品国产一区二区在线| 免费视频一区二区| 亚洲国产经典视频| 在线精品国精品国产尤物884a| 婷婷六月综合亚洲| 国产欧美日韩精品一区| 色婷婷综合久久久久中文一区二区 | 天天综合天天做天天综合| 日韩欧美不卡在线观看视频| 国产夫妻精品视频| 亚洲色图.com| 欧美成人精精品一区二区频| 99久久99久久免费精品蜜臀| 日韩黄色在线观看| 国产欧美精品日韩区二区麻豆天美| 91浏览器在线视频| 久久69国产一区二区蜜臀| 亚洲你懂的在线视频| 欧美成人精品3d动漫h| 成人av网址在线观看| 日本不卡免费在线视频| 中文字幕五月欧美| 亚洲精品一区二区在线观看| 91香蕉视频污| 国产一区在线看| 亚洲444eee在线观看| 中文字幕不卡的av| 精品国产在天天线2019| 欧美在线一二三四区| 国产一二精品视频| 视频一区视频二区在线观看| 亚洲天堂免费在线观看视频| 久久久久久久久免费| 91精品国产一区二区| 色哟哟在线观看一区二区三区| 国内精品伊人久久久久av一坑| 亚洲电影一级片| 亚洲视频在线一区| 国产精品久久久久永久免费观看 | 亚洲国产成人午夜在线一区| 欧美一区二区三区在线| 欧美羞羞免费网站| 在线一区二区三区做爰视频网站| 国产成人亚洲综合色影视| 久久99久久精品| 青青草国产成人99久久| 日韩精品电影在线观看| 亚洲综合激情另类小说区| 亚洲日本欧美天堂| 中文字幕在线一区二区三区| 国产肉丝袜一区二区| 久久一夜天堂av一区二区三区| 91精品综合久久久久久| 在线观看一区不卡| 在线视频国内一区二区| 日本丶国产丶欧美色综合| 99精品视频中文字幕| 91麻豆精东视频| 欧美专区在线观看一区| 欧美性受xxxx黑人xyx性爽| 欧美三级资源在线| 欧美老肥妇做.爰bbww视频| 精品视频全国免费看| 884aa四虎影成人精品一区| 欧美福利视频一区| 日韩一区二区在线看| 精品国产一区二区三区不卡| 欧美精品一区男女天堂| 欧美经典一区二区| 亚洲欧美在线观看| 亚洲午夜一区二区| 日韩成人精品在线| 激情综合一区二区三区| 高清不卡一区二区| 91同城在线观看| 欧美精品亚洲一区二区在线播放| 91精品国产日韩91久久久久久| 欧美大片在线观看| 国产日本欧美一区二区| 亚洲欧美在线另类| 日韩成人伦理电影在线观看| 国产美女精品人人做人人爽| www.久久精品| 在线电影一区二区三区| 欧美哺乳videos| 亚洲三级在线免费观看| 日本中文字幕一区二区有限公司| 国产乱理伦片在线观看夜一区| 91在线码无精品| 日韩一区二区三区视频| 国产日韩欧美综合在线| 亚洲综合成人在线视频| 精品一区二区免费| 91丨porny丨户外露出| 7777精品久久久大香线蕉| 日本一区二区三区四区在线视频| 亚洲狠狠爱一区二区三区| 国产一区二区三区电影在线观看| 色视频欧美一区二区三区| 精品欧美黑人一区二区三区| 亚洲精品国产第一综合99久久 | 亚洲大型综合色站| 九九**精品视频免费播放| 91老师国产黑色丝袜在线| 欧美zozozo| 视频一区视频二区在线观看| 97精品国产97久久久久久久久久久久| 6080国产精品一区二区| 亚洲少妇30p|