亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品国产一区二区精华| 日韩网站在线看片你懂的| 久久疯狂做爰流白浆xx| 亚洲一二三区在线观看| 一级中文字幕一区二区| 亚洲色图在线视频| 亚洲欧美电影院| 亚洲综合偷拍欧美一区色| 亚洲精品福利视频网站| 亚洲国产精品久久人人爱蜜臀 | 日本伊人精品一区二区三区观看方式| 亚洲男人的天堂在线aⅴ视频| 亚洲美女免费在线| 亚洲一区二区三区在线| 日韩精品91亚洲二区在线观看| 天天综合色天天综合| 捆绑调教一区二区三区| 精品一区二区日韩| 成人禁用看黄a在线| 色天天综合色天天久久| 欧美精品日韩综合在线| 欧美mv日韩mv国产网站| 国产精品毛片a∨一区二区三区| 国产精品水嫩水嫩| 亚洲成人av电影| 国内精品伊人久久久久影院对白| 国产传媒欧美日韩成人| 91免费视频大全| 91精品国产91久久久久久最新毛片| 91精品国产欧美一区二区18| 国产亚洲一区二区三区在线观看| 国产精品第五页| 日韩精品亚洲一区二区三区免费| 国产在线播放一区三区四| 91在线一区二区三区| 9191久久久久久久久久久| 久久麻豆一区二区| 亚洲乱码国产乱码精品精小说| 亚洲国产综合91精品麻豆| 国产精一品亚洲二区在线视频| 一本大道久久a久久综合| 91精品国产一区二区| 国产精品色在线观看| 美日韩一区二区| 99久久国产综合色|国产精品| 欧美精品精品一区| 亚洲色图欧美激情| 成熟亚洲日本毛茸茸凸凹| 欧美猛男超大videosgay| 国产精品色眯眯| 麻豆国产精品视频| 欧美日韩在线电影| 中文字幕在线观看一区二区| 麻豆精品在线观看| 欧美视频精品在线观看| 中文字幕一区二区三区在线不卡| 韩国精品一区二区| 在线成人免费视频| 一区二区欧美精品| 99国产精品久久久久久久久久| 精品区一区二区| 偷拍日韩校园综合在线| 色视频欧美一区二区三区| 亚洲国产精品99久久久久久久久 | 日韩视频在线永久播放| 一区二区免费在线播放| 99在线精品免费| 日本一区二区综合亚洲| 国产在线一区二区综合免费视频| 欧美一级高清片| 日韩黄色在线观看| 51精品久久久久久久蜜臀| 亚洲va欧美va人人爽| 欧美日韩精品是欧美日韩精品| 亚洲综合色区另类av| 色菇凉天天综合网| 午夜一区二区三区在线观看| 91高清视频在线| 亚洲一区二区在线视频| 911精品产国品一二三产区 | 日韩午夜在线影院| 奇米888四色在线精品| 91精品免费观看| 免费的成人av| 久久精品网站免费观看| 成人爽a毛片一区二区免费| 亚洲国产精品激情在线观看| 成人手机电影网| 亚洲精品成人少妇| 337p亚洲精品色噜噜| 激情综合色综合久久综合| 精品国产123| 99久久精品久久久久久清纯| 一区二区成人在线| 日韩欧美国产系列| 国产一区二区主播在线| 中日韩av电影| 欧美色倩网站大全免费| 日韩综合在线视频| 久久日一线二线三线suv| 91视频国产观看| 免费美女久久99| 中文字幕精品在线不卡| 色婷婷综合五月| 韩国三级在线一区| 亚洲综合久久av| 精品福利视频一区二区三区| 97精品视频在线观看自产线路二| 亚洲成人av福利| 中文字幕精品在线不卡| 欧美喷水一区二区| 成熟亚洲日本毛茸茸凸凹| 婷婷一区二区三区| 欧美激情中文不卡| 欧美日本在线视频| 成人小视频在线| 免费成人av在线播放| 亚洲免费看黄网站| 欧美精品一区二区三区蜜桃| 色94色欧美sute亚洲线路一ni| 蜜臀av一区二区| 亚洲免费视频成人| 97国产一区二区| 亚洲激情综合网| 久久综合五月天婷婷伊人| 在线观看免费一区| 韩国av一区二区三区在线观看| 亚洲精品少妇30p| 欧美激情一区在线| 精品少妇一区二区三区| 日本久久一区二区三区| 懂色av中文一区二区三区| 日本不卡123| 香港成人在线视频| 伊人婷婷欧美激情| 国产精品午夜免费| 国产三级精品三级在线专区| 日韩欧美国产午夜精品| 欧美精品视频www在线观看| 91美女在线观看| 国产91精品免费| 黑人精品欧美一区二区蜜桃 | 制服丝袜在线91| 欧美三级蜜桃2在线观看| 91视视频在线直接观看在线看网页在线看| 久久精品国产99国产| 日韩高清不卡一区二区| 亚洲成av人片一区二区梦乃| 亚洲综合免费观看高清完整版在线| 国产精品久久99| 国产精品久久久久四虎| 国产免费观看久久| 国产精品理伦片| 国产精品福利一区二区| 亚洲国产电影在线观看| 国产精品乱人伦中文| 中文字幕av一区二区三区| 国产精品色哟哟网站| 中文字幕一区在线| 一区二区三区四区在线| 一区二区三区影院| 五月综合激情日本mⅴ| 日韩影院精彩在线| 男女性色大片免费观看一区二区| 美女一区二区在线观看| 国产剧情在线观看一区二区| 国产精品自产自拍| 97精品久久久午夜一区二区三区| 91亚洲精品一区二区乱码| 色88888久久久久久影院按摩| 欧美日韩国产欧美日美国产精品| 欧美精品欧美精品系列| 久久亚区不卡日本| 中文字幕一区二区三| 亚洲sss视频在线视频| 麻豆成人久久精品二区三区小说| 国产精品一区不卡| 91黄色在线观看| 在线播放欧美女士性生活| 欧美sm美女调教| 亚洲视频一区二区免费在线观看| 亚洲国产精品久久久男人的天堂| 久久国产剧场电影| 99国产精品一区| 日韩一二三区不卡| 久久精品亚洲国产奇米99| 亚洲精品视频一区| 国产尤物一区二区| 色妹子一区二区| 精品成人免费观看| 一区二区三区在线免费观看| 麻豆精品视频在线观看视频| aaa欧美大片| 精品女同一区二区| 一区二区高清免费观看影视大全| 精品一区二区三区久久| 欧美三级资源在线| 国产日韩精品一区| 蜜臀久久99精品久久久画质超高清| 成人精品国产福利|