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

📄 rsencoder.java

📁 用java写的RS算法的交织器
💻 JAVA
字号:
package cmmb.dsp.common;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class RSEncoder {
	public RSEncoder() {
		System.loadLibrary("RSEncodeDLL"); // 载入系统动态库
	}

	public native byte[] encodeRS(byte[] data);

	public static void main(String[] args) throws IOException

	{
		int INFORROWSNUM = 207;
		int FECROWSNUM = 48;
		int LINESNUM = 3;
		FileInputStream fileInput = new FileInputStream(
				"E:\\data.txt");
		byte[] data = new byte[INFORROWSNUM * LINESNUM];
		fileInput.read(data);

		Interlacer interlacer = new Interlacer(data, LINESNUM);
		byte[] inforRegionData = new byte[INFORROWSNUM * LINESNUM];
		inforRegionData = interlacer.inforRegionCreater();
		byte[][] fecRegion = new byte[LINESNUM][FECROWSNUM];
		byte[] inData = new byte[INFORROWSNUM];
		byte[] outData = new byte[FECROWSNUM];
		RSEncoder encoder = new RSEncoder();
		for (int i = 0; i < LINESNUM; i++) {
			for (int j = 0; j < INFORROWSNUM; j++) {
				inData[j] = inforRegionData[i * INFORROWSNUM + j];
			}
			outData = encoder.encodeRS(inData);
			for (int index = 0; index < FECROWSNUM; index++) {
				fecRegion[i][index] = outData[index];
			}
		}
		FileOutputStream fileOut5 = new FileOutputStream("E:\\fec.txt");
		fileOut5.write(interlacer.fecRegionCreater(fecRegion));

	}

}

⌨️ 快捷键说明

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