IO-Compress-Brotli

 view release on metacpan or  search on metacpan

bin/bro-perl  view on Meta::CPAN

            my $decoded = read_binary( $ifh );
            my $encoded = bro( $decoded, $QUALITY, $WINDOW );
            $total_size += bytes::length( $decoded );
            write_file( $ofh, $encoded );
        }
    }
}

if( $VERBOSE ) {
    my $elapsed = tv_interval ( $t0 );
    say "Ran $REPEAT iterations in a total of $elapsed seconds";
    say sprintf(
        "Brotli %s speed: %.6f MB/s",
        ( $DECOMPRESS ? "decompression" : "compression" ),
        $total_size / 1024 / 1024 / $elapsed
    );
}

brotli/c/enc/backward_references_hq.c  view on Meta::CPAN

              ZopfliCostModelGetCommandCost(model, cmdcode);
          if (cost < nodes[pos + l].u.cost) {
            UpdateZopfliNode(nodes, pos, start, l, l, backward, j + 1, cost);
            result = BROTLI_MAX(size_t, result, l);
          }
          best_len = l;
        }
      }
    }

    /* At higher iterations look only for new last distance matches, since
       looking only for new command start positions with the same distances
       does not help much. */
    if (k >= 2) continue;

    {
      /* Loop through all possible copy lengths at this position. */
      size_t len = min_len;
      for (j = 0; j < num_matches; ++j) {
        BackwardMatch match = matches[j];
        size_t dist = match.distance;

brotli/c/enc/encode.c  view on Meta::CPAN

      if (BROTLI_IS_OOM(m)) goto oom;
      BrotliInitZopfliNodes(nodes, block_size + 1);
      StitchToPreviousBlockH10(hasher, block_size, block_start,
                               input_buffer, mask);
      path_size = BrotliZopfliComputeShortestPath(m,
          block_size, block_start, input_buffer, mask, &params,
          max_backward_limit, dist_cache, hasher, nodes);
      if (BROTLI_IS_OOM(m)) goto oom;
      /* We allocate a command buffer in the first iteration of this loop that
         will be likely big enough for the whole metablock, so that for most
         inputs we will not have to reallocate in later iterations. We do the
         allocation here and not before the loop, because if the input is small,
         this will be allocated after the Zopfli cost model is freed, so this
         will not increase peak memory usage.
         TODO: If the first allocation is too small, increase command
         buffer size exponentially. */
      new_cmd_alloc_size = BROTLI_MAX(size_t, expected_num_commands,
                                      num_commands + path_size + 1);
      if (cmd_alloc_size != new_cmd_alloc_size) {
        Command* new_commands = BROTLI_ALLOC(m, Command, new_cmd_alloc_size);
        if (BROTLI_IS_OOM(m)) goto oom;

brotli/tests/testdata/lcet10.txt  view on Meta::CPAN

     volumes have been scanned, or about 300,000 images.

     * The resulting digital files are stored and used to produce
     hard-copy replacements for the originals and additional prints on
     demand; although the initial costs are high, scanning technology
     offers an affordable means for reformatting brittle material.

     * A technician in production mode can scan 300 pages per hour when
     performing single-sheet scanning, which is a necessity when working
     with truly brittle paper; this figure is expected to increase
     significantly with subsequent iterations of the software from Xerox;
     a three-month time-and-cost study of scanning found that the average
     300-page book would take about an hour and forty minutes to scan
     (this figure included the time for setup, which involves keying in
     primary bibliographic data, going into quality control mode to
     define page size, establishing front-to-back registration, and
     scanning sample pages to identify a default range of settings for
     the entire book--functions not dissimilar to those performed by
     filmers or those preparing a book for photocopy).

     * The final step in the scanning process involved rescans, which



( run in 0.784 second using v1.01-cache-2.11-cpan-71847e10f99 )