资源简介
基于FEC的rs视频编码方法,用于测试RS视频编码的效率。此程序完成了基于RS的视频编码方法,完成了各项功能检测,并突出了采用RS编码后的效果。
代码片段和文件信息
// Version 0.01
/*
* This is FEC-based streaming test system. It is (C) Copyright 2007
* by Xingjun Zhang. You may modify and use this program as long as
* you send modifications to Dr.Zhang.
*
* This is the server part
* (1) get footage data;
* (2) RS-encoding ...
* (3) send the data to client...
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “rs.h“
#include “packet.h“
#define PKT_LETH 168
#define NUM_RS_K 5
#define SET_S 840
#define NUM_RS_SYMBOL 448
#define LETH_SYMBOL 3
#define MASK0 7
#define MASK1L2 3
#define MASK1U1 128
#define MASK2L1 1
#define MASK2U2 192
#define MASK3 224
#define MASK3_SHIFT_R 5
#define MASK4 112
#define MASK4_SHIFT_R 4
#define MASK5 56
#define MASK5_SHIFT_R 3
#define MASK6 28
#define MASK6_SHIFT_R 2
#define MASK7 14
#define MASK7_SHIFT_R 1
#define MASK_R_0_3L2 3
#define MASK_R_0_3L2_SHIFT 6
#define MASK_7 7
#define MASK_R_0_QT2_SHIFT 3
#define MASK_R_1_3L1 1
#define MASK_R_1_3L1_SHIFT 7
#define MASK_R_1_QT2_SHIFT 4
#define MASK_R_1_QT1_SHIFT 1
#define MASK_R_1_QT 4
#define MASK_R_1_QT_SHIFT 2
#define MASK_R_2_QT2_SHIFT 5
#define MASK_R_2_QT1_SHIFT 2
#define MASK_R_2_QTU2 6
#define MASK_R_2_QTU2_SHIFT 1
int main(int argcchar **argv)
{
//test
//int tmpt = 0;
// original footage file & received footage file
FILE *footage_in*footage_out;
// a set of rs-coding information packets
u_char packet1[PKT_LETH]packet2[PKT_LETH]packet3[PKT_LETH]packet4[PKT_LETH]packet5[PKT_LETH];
int set_num; //the set number of RS information in footage
int reminder; //after main loop process the reminder data
int qt rm; //quotient and reminder for bytes to bits
int qt_r rm_r; //quotient and reminder for bits to bytes
int l; //main loop times
long int f_size; //footage size
int ij; //NUM_RS_SYMBOL
struct timespec tr;
int ret;
struct PKT *pPkt;
struct PKT vdp;
int pktLen;
int server;
unsigned short int port;
struct sockaddr_in local;
struct sockaddr_in client;
long int sent_p = 0;
// Generated parity data
u_char parity1[NUM_RS_SYMBOL]parity2[NUM_RS_SYMBOL]parity_pkt1[PKT_LETH]parity_pkt2[PKT_LETH];
if((footage_in=fopen(“paris.ts““rb“)) == NULL)
{
printf(“Cannot open paris.ts!“);
exit(0);
}
if((footage_out = fopen( “paris_out.ts“ “wb“ )) == NULL)
{
printf(“Cannot open paris_out.ts!“);
exit(0);
}
//Denerat
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4974480 2009-05-14 19:12 paris.ts
文件 0 2009-05-14 19:12 paris_out.ts
文件 4761691 2009-05-14 19:12 paris-mpeg4.ts
文件 15287 2009-05-14 19:12 rs.h
文件 15544 2009-05-14 19:12 sender
文件 20731 2009-05-14 19:12 sender.c
文件 774 2009-05-14 19:12 packet.h
----------- --------- ---------- ----- ----
9788507 7
- 上一篇:软件开发中常用的图标
- 下一篇:ITC打印插件
评论
共有 条评论