?? cellh264decode.c
字號:
/*
* Copyright 2002 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/*
* ======== cellrotate.c ========
*/
#include <std.h>
#include <stdio.h>
#include <math.h>
#include <csl_dat.h>
#include <algrf.h>
#include <icell.h>
#include <utl.h>
#include "cellH264decode.h"
#include "appResources.h"
#include "appThreads.h"
#include "h264t.h"
#include "appmain.h"
IDEC_Params IDEC_PARAMS = {
sizeof(IDEC_Params),
FALSE // Bool reverseImage
};
static void runH264decode( IDEC_Handle handle, int *inData,
Uint32 **outData);
// v-table for this cell
ICELL_Fxns H264DEC_CELLFXNS = {
NULL, // cellClose
NULL, // cellControl
H264DEC_cellExecute, // cellExecute
NULL // cellOpen
};
/*
* ======== ROTATE_cellExecute ========
*
*/
Bool H264DEC_cellExecute( ICELL_Handle handle, Arg arg )
{
IDEC_Handle rotateHandle = (IDEC_Handle)handle->algHandle;
// activate instance object
ALGRF_activate( handle->algHandle );
#if HAS_DEC
runH264decode(rotateHandle,
(int *)handle->inputIcc[0]->buffer,
(Uint32 **)handle->outputIcc[0]->buffer);
#endif
// deactivate instance object
ALGRF_deactivate( handle->algHandle );
return(TRUE);
}
/*
* ======== runROTATE ========
* Run ROTATE algorithm.
*/
//extern int is_count,time_count[5];
extern H264_t *t_enc, *t_dec;
uint32_t g_ss=0;
//uint8_t recv_data[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//uint8_t recv_data0[16]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
static void runH264decode(IDEC_Handle handle, int* inData,
Uint32 **outData)
{
int32_t len;
uint8_t *pin;
uint32_t num;
pin = (uint8_t*)inData;
memcpy(&len,pin,4);
// printf("dec len is %d, \n",len);
memcpy(&num,pin+4,4);
// memcpy(recv_data,pin+len-16,16);
// memcpy(&num1,pin+len,4);
// printf("dec num is %d\n",num); //wq
if(g_ss!=num)
{
printf("dec g_ss is %d,num is %d\n",g_ss,num); //wq
g_ss = num+1;
}
else
{
g_ss++;
}
if(len>0)
{
// printf(" dec num=%d,len=%d,qp=%d \n",num,len,t_dec->qp_y);
LIGHT = 0x04; //亮燈3
//x printf("begin dec %d\n",len-4);
len = H264_decode3(t_dec, pin+8, len-4, 1,
(Uint32 *)outData[0],(Uint32 *)outData[1],(Uint32 *)outData[2]);
LIGHT = 0x08; //亮燈4
// printf("H264_decode3 end %d\n",len);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -