类 GolombEncoder

    • 构造器详细资料

      • GolombEncoder

        public GolombEncoder()
    • 方法详细资料

      • encode

        public Bits encode​(int n,
                           int m)
        encode n to binary bits based on argument m
        参数:
        n - the value to encode
        m - m, like 5
        返回:
        the length of encoded bits
      • encodeToTruncatedBinary

        public static Bits encodeToTruncatedBinary​(int x,
                                                   int n)
      • encodeToBinary

        public static Bits encodeToBinary​(int x,
                                          int len)
      • decode

        public int decode​(Bits bits,
                          int m)
        decode binary bits to n
        参数:
        bits - encoded binary bits
        m - m, like 5
        返回:
        decoded value
      • decodeTruncatedBinary

        public static int decodeTruncatedBinary​(Bits bits,
                                                int m)
      • encodeToBinary

        public static int encodeToBinary​(Bits bits)