⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.c

📁 基于ti c55x序列dsp的jpeg算法中的哈夫解码的实现
💻 C
字号:
#include <stdio.h>  
#include <imagelib.h>
#include"vld.h" // type definiton and Huffman table setup
huff_t infor; // hold VLD decoding status
int Workspace[700]; //JPEG VLD working Space
int input[64]; // input binary stream for VLD
int output[64]; // Decoded 8x8 data block				   
int lastdc=0; // The DC of previous block.

void main()
{ int i;
 
InitDehufVars(hufvar, Workspace); // JPEG vld varibles initialization.
makevldtab(); // Setup VLD table

for(i=0;i<64;i++) // input and outout intialization.
{ 
 input[i]=0;
 output[i]=0;
}

input[0]=0xE808; // setup input
input[1]=0xFEFE;
input[2]=0xAFFB;
input[3]=0xBFFE;
input[4]=0xB680;
 
infor.bit_ptr=16;
infor.buf_ptr=0; 
//jpegdechuff(input,lastdc,output,0,hufvar,&infor);
IMG_jpeg_vld(input,&lastdc,output,0,hufvar,&infor);
//Output should be
//  32 1  0 0 0 0 -2 0
//  -1 0  0 0 0 0  0 0
//   0 3 -4 0 0 0  0 0
//  23 0  0 0 0 0  0 0
//   0 0  0 0 0 0  0 0
 //  0 0  0 0 0 0  0 0
for(i=0;i<64;i++) // input and outout intialization.
{ 
 input[i]=0;
 output[i]=0;
}

input[0]=0xFA06; // setup input
input[1]=0xBF9F;
input[2]=0x37FD;
input[3]=0xDFFF;
input[4]=0x4200;
infor.bit_ptr=16;
infor.buf_ptr=0; 
lastdc=0;
IMG_jpeg_vld(input,&lastdc,output,1,hufvar,&infor);
//Output should be
//  32 1  0 0 0 0 -2 0
//  -1 0  0 0 0 0  0 0
//   0 3 -4 0 0 0  0 0
//  23 0  0 0 0 0  0 0
//   0 0  0 0 0 0  0 0
 //  0 0  0 0 0 0  0 0
}	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -