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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tskprocess.c

?? JPEG的壓縮算法
?? C
字號(hào):
#include <std.h>
#include <tsk.h>
#include <stdio.h>
#include <csl.h>
#include <csl_cache.h>
#include <csl_dat.h>
#include <chan.h>
#include <scom.h>
#include <utl.h>
#include <ialg.h>

#include "fvid.h"
#include "celljpegenc_ti.h"
#include "celljpegdec_ti.h"
#include "appmain.h"
#include "appThreads.h"
#include "tskProcess.h"
#include "appBiosObjects.h"

IJPEGENC_Params   jpegencParams;
IJPEGDEC_Params   jpegdecParams;


#pragma DATA_SECTION(jpg_img,   ".user_data_ext")
#pragma DATA_ALIGN( jpg_img,   128)
unsigned char jpg_img[128 * 2000];

#pragma DATA_ALIGN(dec_out_y, 128);
#pragma DATA_ALIGN(dec_out_u, 128);
#pragma DATA_ALIGN(dec_out_v, 128);
unsigned char dec_out_y[720 * 576];
unsigned char dec_out_u[360 * 288];
unsigned char dec_out_v[360 * 288];


static Void checkMsg();


ThrProcess thrProcess;

void tskProcessInit()
{
    int chanNum;
    ICELL_Obj  *cell;
    ICC_Handle  inputIcc;
    ICC_Handle  outputIcc;

    /*----------------------------------------------------*/
    /* Call JPEG specific user initialization if any.     */
    /*----------------------------------------------------*/

    JPEGENC_TI_init();
    JPEGDEC_TI_init();

    /*----------------------------------------------------*/
    /* Set up params for all XDAIS algorithms.            */
    /*----------------------------------------------------*/

    jpegencParams = IJPEGENC_PARAMS;
    jpegdecParams = IJPEGDEC_PARAMS;

    for (chanNum = 0; chanNum < PROCESSNUMCHANNELS ; chanNum++)
    {
        /*
         * JPEGENC: create an input and output linear ICC:
         * The address to the ICC's will be set in the thrProcessRun()
         * function via the ICC_setBuf().
         */
        ICELL_Obj   defaultCell = ICELL_DEFAULT;

        cell = &thrProcess.cellListEncode[(chanNum*PROCESSNUMCELLS) + 0];
        *cell                = defaultCell;
        cell->name           = "JPEGENC";
        cell->cellFxns       = &JPEGENC_CELLFXNS;
        cell->algFxns        = (IALG_Fxns *)&JPEGENC_IJPEGENC;
        cell->algParams      = (IALG_Params *)&IJPEGENC_PARAMS;
        cell->scrBucketIndex = THRIOSSCRBUCKET;

        inputIcc  = (ICC_Handle)ICC_linearCreate(NULL, 0);
        UTL_assert( inputIcc != NULL);

        outputIcc = (ICC_Handle)ICC_linearCreate(NULL, 0);
        UTL_assert( outputIcc != NULL);

        // Only one input and one output ICC are needed.
        CHAN_regCell( cell, &inputIcc, 1, &outputIcc, 1 );

        // Setup Encode Parameters
        thrProcess.cellListEncode[(chanNum*PROCESSNUMCELLS) + 0].algParams =
                                                (IALG_Params *)&IJPEGENC_PARAMS;

        UTL_logDebug1("JPEGEncoder registerd Channel Number: %d", chanNum);

        /*
         * JPEGDEC: create an input and output linear ICC:
         * The address to the ICC's will be set in the thrProcessRun()
         * function via the ICC_setBuf().
         */
        cell = &thrProcess.cellListDecode[(chanNum*PROCESSNUMCHANNELS) + 0];
        *cell                = defaultCell;
        cell->name           = "JPEGDEC";
        cell->cellFxns       = &JPEGDEC_CELLFXNS;
        cell->algFxns        = (IALG_Fxns *)&JPEGDEC_IJPEGDEC;
        cell->algParams      = (IALG_Params *)&IJPEGDEC_PARAMS;
        cell->scrBucketIndex = THRIOSSCRBUCKET;

        inputIcc  = (ICC_Handle)ICC_linearCreate(NULL, 0);
        UTL_assert( inputIcc != NULL);

        outputIcc = (ICC_Handle)ICC_linearCreate(NULL, 0);
        UTL_assert( outputIcc != NULL);

        // Only one input and one output ICC are needed.
        CHAN_regCell( cell, &inputIcc, 1, &outputIcc, 1 );

        // Setup Decode Parameters
        thrProcess.cellListDecode[(chanNum*PROCESSNUMCELLS) + 0].algParams =
                                               (IALG_Params *)&IJPEGDEC_PARAMS;

        UTL_logDebug1("JPEGDecoder registerd Channel Number: %d", chanNum);
    }

    memset(dec_out_y, 0x0,  sizeof(dec_out_y));
    memset(dec_out_u, 0x80, sizeof(dec_out_u));
    memset(dec_out_v, 0x80, sizeof(dec_out_v));

    CACHE_clean(CACHE_L2ALL, 0, 0);
    CACHE_clean(CACHE_L2ALL, 0, 0);
}

void tskProcessStart()
{
    int chanNum;
    for( chanNum=0; chanNum < PROCESSNUMCHANNELS; chanNum++ )
    {
        // open the encode channel: this causes the algorithms to be created
        CHAN_open( &thrProcess.chanListEncode[chanNum],
                   &thrProcess.cellListEncode[(chanNum*PROCESSNUMCELLS)],
                   PROCESSNUMCELLS, NULL );

        // open the decode channel: this causes the algorithms to be created
        CHAN_open( &thrProcess.chanListDecode[chanNum],
                   &thrProcess.cellListDecode[(chanNum*PROCESSNUMCELLS)],
                   PROCESSNUMCELLS, NULL );

    }
}


static Void checkMsg()
{
    CtrlMsg rxMsg;
    Int index;
    Int quality;
    ICELL_Handle handle;

    IJPEGENC_Params jpegencParams;
    int cell_no;

    // check message in "mbxProc"
    while( MBX_pend( &mbxProcess, &rxMsg, 0) )
    {
        switch (rxMsg.cmd)
        {
            case MSGFRAMECHANGE:  // frame ratio value changed
            {
                index = rxMsg.arg1;  // get the index number
                UTL_assert( (index >= 0) && (index < PROCESSNUMCHANNELS));
                // update the local value
                if (index < PROCESSNUMCHANNELS)
                    thrProcess.frameRateControl[index] = rxMsg.arg2;

                break;
            }

            case MSGQUALCHANGE: //quality rate value changed
            {
                index = rxMsg.arg1;  // get the index number
                UTL_assert( (index >= 0) && (index < PROCESSNUMCHANNELS));
                if (index < PROCESSNUMCHANNELS)
                {
                    jpegencParams =  IJPEGENC_PARAMS;
                    cell_no = rxMsg.arg2;
                    UTL_assert( (cell_no >= 0) && (cell_no < PROCESSNUMCELLS));

                    quality = rxMsg.arg3;
                    UTL_assert( (quality >= 0) &&
                                 (quality <= 100));

                    jpegencParams.quality = quality;

                    if ((quality > 0) && (quality <= 100))
                    {
                       handle = &(thrProcess.cellListEncode[index]);

                       thrProcess.cellListEncode[cell_no].cellFxns->cellControl
                       (
                           handle,
                          (IALG_Cmd) (IJPEG_SETSTATUS),
                          (IALG_Status*)(&(jpegencParams))
                       );
                    }
               }

               break;
            }

            default:
                break;
        }
    }
}


extern int SystemReady;


void tskProcess()
{
    int i;
    ScomMessage *pMsgBuf;
    void *inBuf[3];
    void *outBuf[3];
    int  jpg_size;
    int framenum=0;
    CHAN_Handle chanHandle;
    SCOM_Handle fromInputtoProc,fromProctoInput;
    SCOM_Handle fromOuttoProc,fromProctoOut;

    fromInputtoProc = SCOM_open("INTOPROC");
    fromProctoInput = SCOM_open("PROCTOIN");
    fromProctoOut   = SCOM_open("PROCTOOUT");
    fromOuttoProc   = SCOM_open("OUTTOPROC");

    while(1)
    {
        checkMsg();

        framenum++;

        for(i=0; i<PROCESSNUMCHANNELS; i++)
        {
            // Get Input Buffer
            pMsgBuf = SCOM_getMsg(fromInputtoProc, SYS_FOREVER);

            // If we're skipping this frame, just give the SCOM msg
            // back to the input function and continue the for loop.
            if( thrProcess.frameRateControl[i] != 0 &&
                (framenum % thrProcess.frameRateControl[i]) )
            {
                // Tell the capture routine we're done
                SCOM_putMsg(fromProctoInput,pMsgBuf);
                continue;
            }

            //
            // Handle Encode Channel
            //
            chanHandle = &thrProcess.chanListEncode[i];
            chanHandle->state = CHAN_ACTIVE;

            // Channel Input
            inBuf[0] = pMsgBuf->bufY;
            inBuf[1] = pMsgBuf->bufU;
            inBuf[2] = pMsgBuf->bufV;
            ICC_setBuf( chanHandle->cellSet[0].inputIcc[0],
                        inBuf, sizeof(void *) * 3 );

            // Channel Output
            outBuf[0] = &jpg_size;
            outBuf[1] = jpg_img;
            ICC_setBuf( chanHandle->cellSet[0].outputIcc[0],
                        outBuf, sizeof(void *) * 2 );

            // Execute Channel
            CHAN_execute( chanHandle, framenum );

            // Tell the capture routine we're done
            SCOM_putMsg( fromProctoInput, pMsgBuf );

            //
            // Handle Decode Channel
            //
            chanHandle = &thrProcess.chanListDecode[i];
            chanHandle->state = CHAN_ACTIVE;

            inBuf[0] = &jpg_size;
            inBuf[1] = jpg_img;
            ICC_setBuf( chanHandle->cellSet[0].inputIcc[0],
                        inBuf, sizeof(void *) * 2 );

            outBuf[0] = (void *)dec_out_y;
            outBuf[1] = (void *)dec_out_u;
            outBuf[2] = (void *)dec_out_v;
            ICC_setBuf( chanHandle->cellSet[0].outputIcc[0],
                        outBuf, sizeof(void *) * 3 );

            // Execute Channel
            CHAN_execute( chanHandle, framenum );

            // Send the buffer to the display task
            pMsgBuf = SCOM_getMsg(fromOuttoProc, SYS_FOREVER);

            pMsgBuf->bufY = (void *)dec_out_y;
            pMsgBuf->bufU = (void *)dec_out_u;
            pMsgBuf->bufV = (void *)dec_out_v;
            SCOM_putMsg(fromProctoOut,pMsgBuf);
        }
    }
}




?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一二三四在线观看| 国产亚洲欧洲997久久综合| 亚洲一区二区视频在线观看| 色婷婷精品大在线视频| 亚洲高清免费一级二级三级| 制服丝袜国产精品| 麻豆精品国产91久久久久久| 26uuu国产电影一区二区| 国产精品综合在线视频| 亚洲色大成网站www久久九九| 色狠狠色狠狠综合| 五月婷婷综合在线| 久久综合资源网| www.日韩在线| 天天色图综合网| 欧美精品一区在线观看| 99精品久久99久久久久| 亚洲第一电影网| 久久夜色精品一区| 99re这里都是精品| 免费成人av在线播放| 久久久午夜精品| 欧美影院精品一区| 久久国产精品99久久人人澡| 欧美国产精品一区二区三区| 在线观看视频一区二区| 国内外成人在线| 一区二区三区成人| 欧美不卡123| 91高清视频在线| 精品一区二区免费在线观看| 最近中文字幕一区二区三区| 日韩视频在线你懂得| 99久久久免费精品国产一区二区 | 久久综合中文字幕| 色婷婷久久99综合精品jk白丝| 美国一区二区三区在线播放| 17c精品麻豆一区二区免费| 欧美日韩国产一级二级| 成人高清免费观看| 看片的网站亚洲| 亚洲一区二区免费视频| 中文字幕高清不卡| 日韩三级精品电影久久久| 99久久国产综合精品女不卡| 精品一区二区精品| 亚洲风情在线资源站| 国产精品成人一区二区三区夜夜夜 | 欧美激情一区二区三区四区| 91精品蜜臀在线一区尤物| 92精品国产成人观看免费| 国产一区二区视频在线播放| 五月激情丁香一区二区三区| 亚洲婷婷国产精品电影人久久| 日韩欧美国产麻豆| 欧美日韩成人在线| 色八戒一区二区三区| 成人三级在线视频| 麻豆国产精品官网| 午夜精品久久久久久久99水蜜桃| 亚洲视频1区2区| 国产精品五月天| 久久久不卡影院| 精品欧美一区二区三区精品久久 | 欧美日本在线播放| 欧美优质美女网站| 在线观看精品一区| 色婷婷综合视频在线观看| 高潮精品一区videoshd| 国产精品白丝av| 国产一区在线看| 国产精品中文有码| 国产高清精品久久久久| 国产精品99久久久久久似苏梦涵 | 欧美国产日韩一二三区| 精品成人私密视频| 精品乱人伦一区二区三区| 日韩精品资源二区在线| 91精品在线免费观看| 91 com成人网| 日韩精品一区二区三区视频在线观看 | 久久久久久亚洲综合影院红桃| 日韩欧美在线网站| 精品99999| 国产欧美一区二区精品秋霞影院| 久久精品一区二区三区av| 国产欧美日韩激情| 亚洲视频一区在线| 亚洲线精品一区二区三区| 亚洲电影一区二区| 麻豆精品新av中文字幕| 国产一区在线观看麻豆| 成人av影视在线观看| 欧洲中文字幕精品| 日韩一区二区中文字幕| 久久综合狠狠综合久久激情| 欧美高清在线一区二区| 亚洲乱码国产乱码精品精可以看| 亚洲一区二区视频| 美女精品自拍一二三四| 从欧美一区二区三区| 99re6这里只有精品视频在线观看| 91亚洲精品乱码久久久久久蜜桃| 欧美日韩中字一区| 精品区一区二区| 中文字幕日韩av资源站| 亚洲国产精品久久人人爱| 精品中文字幕一区二区小辣椒| 成人午夜电影久久影院| 欧洲生活片亚洲生活在线观看| 欧美一区二区精美| 国产精品久久久久影院亚瑟| 亚洲曰韩产成在线| 国内一区二区在线| 色网综合在线观看| 久久综合精品国产一区二区三区| 亚洲人成在线观看一区二区| 日av在线不卡| 91丨porny丨国产入口| 欧美一区二区三区播放老司机| 国产嫩草影院久久久久| 丝袜美腿一区二区三区| 99久久精品免费观看| 欧美电视剧免费全集观看| 亚洲人成网站色在线观看| 经典三级在线一区| 日本高清免费不卡视频| 久久影音资源网| 午夜天堂影视香蕉久久| 99久久国产综合色|国产精品| 日韩欧美第一区| 一区二区三区色| 粉嫩欧美一区二区三区高清影视| 在线成人小视频| 亚洲黄色片在线观看| 成人午夜免费视频| 欧美不卡一区二区三区| 丝袜亚洲另类欧美| 日本乱人伦aⅴ精品| 国产精品毛片a∨一区二区三区| 美女网站在线免费欧美精品| 欧美日韩精品电影| 亚洲女同女同女同女同女同69| 国内外成人在线| 日韩一级大片在线| 亚洲成人高清在线| 在线看日韩精品电影| 亚洲欧洲日韩在线| 成人性生交大片免费看在线播放| 日韩精品一区二区三区视频播放 | 91一区二区三区在线观看| 久久精品欧美一区二区三区不卡| 男女性色大片免费观看一区二区| 91网站在线观看视频| 国产精品九色蝌蚪自拍| 高清久久久久久| 国产欧美中文在线| 国产高清不卡二三区| 久久久精品免费网站| 久久精工是国产品牌吗| 欧美一级二级三级乱码| 日本特黄久久久高潮| 91精品国产综合久久精品app| 一区二区三区高清| 欧美在线|欧美| 亚洲午夜视频在线| 欧美日韩国产首页| 五月天网站亚洲| 欧美视频自拍偷拍| 偷拍与自拍一区| 日韩一区二区三区电影在线观看| 天天色天天操综合| 日韩欧美一区在线观看| 精品一区二区在线视频| 久久久一区二区| 成人18视频在线播放| 一区二区三区在线免费视频| 色综合久久66| 午夜欧美电影在线观看| 日韩一区二区三区av| 国产在线不卡一区| 欧美国产日产图区| 日本道免费精品一区二区三区| 亚洲精品久久7777| 欧美精品丝袜中出| 久久99精品久久只有精品| 国产日韩一级二级三级| 91视频观看免费| 日韩成人免费电影| 国产午夜精品一区二区三区嫩草 | 亚洲v日本v欧美v久久精品| 欧美精品 国产精品| 久久99热狠狠色一区二区| 国产亲近乱来精品视频| 在线精品视频一区二区| 麻豆传媒一区二区三区| 国产精品不卡一区| 欧美日韩dvd在线观看| 国产精品一级二级三级| 一区二区三区不卡视频 |