Package com.nr.lna

Examples of com.nr.lna.Arithcode.messageinit()


//    for (i=0;i<NCHAR;i++) System.out.printf(nfreq[i] << "  ";
//    System.out.printf(endl;

    // Test codeone
    Arithcode arith = new Arithcode (nfreq,NCHAR,256);
    arith.messageinit();
    lcd.val=0;
    byte[] code = new byte[N];
    for (i=0;i<N;i++) arith.codeone(c[i],code,lcd);
    arith.codeone(NCHAR,code,lcd);    // EOM character
//    System.out.println("Number of bytes used: %f\n", lcd);
View Full Code Here


    arith.codeone(NCHAR,code,lcd);    // EOM character
//    System.out.println("Number of bytes used: %f\n", lcd);
//    System.out.println("Compression ratio: %f\n", double(N*3)/8/lcd); // Normally 3 bits each for 5 characters

    // Recover the text
    arith.messageinit();
    lcd.val=0;
    char[] d=new char[N];
    i=0;
    while ((d[i]=(char)arith.decodeone(code,lcd)) != NCHAR) {
      System.out.printf("%x  %x\n", (int)c[i] ,(int)d[i]);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.