Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 1 | /* Copyright 2015 Pierre Ossman <ossman@cendio.se> for Cendio AB |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 2 | * Copyright (C) 2015 D. R. Commander. All Rights Reserved. |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 3 | * |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 4 | * This is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 8 | * |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 9 | * This software is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 13 | * |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this software; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 17 | * USA. |
| 18 | */ |
| 19 | |
| 20 | /* |
| 21 | * This program reads files produced by TightVNC's/TurboVNC's |
| 22 | * fbs-dump, which in turn takes files from rfbproxy. It is |
| 23 | * basically a dump of the RFB protocol from the server side after |
| 24 | * the ServerInit message. Mostly this consists of FramebufferUpdate |
| 25 | * message using the HexTile encoding. Screen size and pixel format |
| 26 | * are not encoded in the file and must be specified by the user. |
| 27 | */ |
| 28 | |
| 29 | #include <stdio.h> |
| 30 | #include <stdlib.h> |
| 31 | #include <math.h> |
| 32 | |
| 33 | #include <rdr/Exception.h> |
| 34 | #include <rdr/OutStream.h> |
| 35 | #include <rdr/FileInStream.h> |
| 36 | |
| 37 | #include <rfb/PixelFormat.h> |
| 38 | |
| 39 | #include <rfb/CConnection.h> |
| 40 | #include <rfb/CMsgReader.h> |
| 41 | #include <rfb/Decoder.h> |
| 42 | #include <rfb/UpdateTracker.h> |
| 43 | |
| 44 | #include <rfb/EncodeManager.h> |
| 45 | #include <rfb/SConnection.h> |
| 46 | #include <rfb/SMsgWriter.h> |
| 47 | |
| 48 | #include "util.h" |
| 49 | |
| 50 | static rfb::IntParameter width("width", "Frame buffer width", 0); |
| 51 | static rfb::IntParameter height("height", "Frame buffer height", 0); |
DRC | 4631a76 | 2015-02-21 11:57:27 -0600 | [diff] [blame] | 52 | static rfb::IntParameter count("count", "Number of benchmark iterations", 9); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 53 | |
| 54 | static rfb::StringParameter format("format", "Pixel format (e.g. bgr888)", ""); |
| 55 | |
DRC | 2a172c9 | 2015-02-25 14:18:07 -0600 | [diff] [blame] | 56 | static rfb::BoolParameter translate("translate", |
| 57 | "Translate 8-bit and 16-bit datasets into 24-bit", |
| 58 | true); |
| 59 | |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 60 | // The frame buffer (and output) is always this format |
| 61 | static const rfb::PixelFormat fbPF(32, 24, false, true, 255, 255, 255, 0, 8, 16); |
| 62 | |
| 63 | // Encodings to use |
| 64 | static const rdr::S32 encodings[] = { |
| 65 | rfb::encodingTight, rfb::encodingCopyRect, rfb::encodingRRE, |
| 66 | rfb::encodingHextile, rfb::encodingZRLE, rfb::pseudoEncodingLastRect, |
DRC | 562eb71 | 2015-02-21 12:01:47 -0600 | [diff] [blame] | 67 | rfb::pseudoEncodingQualityLevel0 + 8, |
| 68 | rfb::pseudoEncodingCompressLevel0 + 2}; |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 69 | |
| 70 | class DummyOutStream : public rdr::OutStream { |
| 71 | public: |
| 72 | DummyOutStream(); |
| 73 | |
| 74 | virtual int length(); |
| 75 | virtual void flush(); |
| 76 | |
| 77 | private: |
| 78 | virtual int overrun(int itemSize, int nItems); |
| 79 | |
| 80 | int offset; |
| 81 | rdr::U8 buf[131072]; |
| 82 | }; |
| 83 | |
| 84 | class CConn : public rfb::CConnection { |
| 85 | public: |
| 86 | CConn(const char *filename); |
| 87 | ~CConn(); |
| 88 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 89 | void getStats(double& ratio, unsigned long long& bytes, |
| 90 | unsigned long long& rawEquivalent); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 91 | |
| 92 | virtual void setDesktopSize(int w, int h); |
| 93 | virtual void setCursor(int, int, const rfb::Point&, void*, void*); |
| 94 | virtual void framebufferUpdateStart(); |
| 95 | virtual void framebufferUpdateEnd(); |
| 96 | virtual void dataRect(const rfb::Rect&, int); |
| 97 | virtual void setColourMapEntries(int, int, rdr::U16*); |
| 98 | virtual void bell(); |
| 99 | virtual void serverCutText(const char*, rdr::U32); |
| 100 | |
| 101 | public: |
| 102 | double decodeTime; |
| 103 | double encodeTime; |
| 104 | |
| 105 | protected: |
| 106 | rdr::FileInStream *in; |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 107 | rfb::Decoder *decoders[rfb::encodingMax + 1]; |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 108 | rfb::ManagedPixelBuffer pb; |
| 109 | rfb::SimpleUpdateTracker updates; |
| 110 | class SConn *sc; |
| 111 | }; |
| 112 | |
| 113 | class Manager : public rfb::EncodeManager { |
| 114 | public: |
| 115 | Manager(class rfb::SConnection *conn); |
| 116 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 117 | void getStats(double&, unsigned long long&, unsigned long long&); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 118 | }; |
| 119 | |
| 120 | class SConn : public rfb::SConnection { |
| 121 | public: |
| 122 | SConn(); |
| 123 | ~SConn(); |
| 124 | |
| 125 | void writeUpdate(const rfb::UpdateInfo& ui, const rfb::PixelBuffer* pb); |
| 126 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 127 | void getStats(double&, unsigned long long&, unsigned long long&); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 128 | |
| 129 | virtual void setAccessRights(AccessRights ar); |
| 130 | |
| 131 | virtual void setDesktopSize(int fb_width, int fb_height, |
| 132 | const rfb::ScreenSet& layout); |
| 133 | |
| 134 | protected: |
| 135 | DummyOutStream *out; |
| 136 | Manager *manager; |
| 137 | }; |
| 138 | |
| 139 | DummyOutStream::DummyOutStream() |
| 140 | { |
| 141 | offset = 0; |
| 142 | ptr = buf; |
| 143 | end = buf + sizeof(buf); |
| 144 | } |
| 145 | |
| 146 | int DummyOutStream::length() |
| 147 | { |
| 148 | flush(); |
| 149 | return offset; |
| 150 | } |
| 151 | |
| 152 | void DummyOutStream::flush() |
| 153 | { |
| 154 | offset += ptr - buf; |
| 155 | ptr = buf; |
| 156 | } |
| 157 | |
| 158 | int DummyOutStream::overrun(int itemSize, int nItems) |
| 159 | { |
| 160 | flush(); |
| 161 | } |
| 162 | |
| 163 | CConn::CConn(const char *filename) |
| 164 | { |
| 165 | int i; |
| 166 | |
| 167 | decodeTime = 0.0; |
| 168 | encodeTime = 0.0; |
| 169 | |
| 170 | in = new rdr::FileInStream(filename); |
| 171 | setStreams(in, NULL); |
| 172 | |
| 173 | memset(decoders, 0, sizeof(decoders)); |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 174 | for (i = 0; i < rfb::encodingMax; i++) { |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 175 | if (!rfb::Decoder::supported(i)) |
| 176 | continue; |
| 177 | |
| 178 | decoders[i] = rfb::Decoder::createDecoder(i, this); |
| 179 | } |
| 180 | |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 181 | // Need to skip the initial handshake and ServerInit |
| 182 | setState(RFBSTATE_NORMAL); |
| 183 | // That also means that the reader and writer weren't setup |
| 184 | setReader(new rfb::CMsgReader(this, in)); |
| 185 | // Nor the frame buffer size and format |
| 186 | setDesktopSize(width, height); |
| 187 | rfb::PixelFormat pf; |
| 188 | pf.parse(format); |
| 189 | setPixelFormat(pf); |
| 190 | |
DRC | 2a172c9 | 2015-02-25 14:18:07 -0600 | [diff] [blame] | 191 | pb.setPF((bool)translate ? fbPF : pf); |
| 192 | |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 193 | sc = new SConn(); |
| 194 | sc->cp.setPF(pb.getPF()); |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 195 | sc->setEncodings(sizeof(encodings) / sizeof(*encodings), encodings); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | CConn::~CConn() |
| 199 | { |
| 200 | int i; |
| 201 | |
| 202 | delete sc; |
| 203 | |
| 204 | delete in; |
| 205 | |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 206 | for (i = 0; i < rfb::encodingMax; i++) |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 207 | delete decoders[i]; |
| 208 | } |
| 209 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 210 | void CConn::getStats(double& ratio, unsigned long long& bytes, |
| 211 | unsigned long long& rawEquivalent) |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 212 | { |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 213 | sc->getStats(ratio, bytes, rawEquivalent); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | void CConn::setDesktopSize(int w, int h) |
| 217 | { |
| 218 | CConnection::setDesktopSize(w, h); |
| 219 | |
| 220 | pb.setSize(cp.width, cp.height); |
| 221 | } |
| 222 | |
| 223 | void CConn::setCursor(int, int, const rfb::Point&, void*, void*) |
| 224 | { |
| 225 | } |
| 226 | |
| 227 | void CConn::framebufferUpdateStart() |
| 228 | { |
| 229 | updates.clear(); |
| 230 | } |
| 231 | |
| 232 | void CConn::framebufferUpdateEnd() |
| 233 | { |
| 234 | rfb::UpdateInfo ui; |
| 235 | rfb::Region clip(pb.getRect()); |
| 236 | |
| 237 | updates.getUpdateInfo(&ui, clip); |
| 238 | |
| 239 | startCpuCounter(); |
| 240 | sc->writeUpdate(ui, &pb); |
| 241 | endCpuCounter(); |
| 242 | |
| 243 | encodeTime += getCpuCounter(); |
| 244 | } |
| 245 | |
| 246 | void CConn::dataRect(const rfb::Rect &r, int encoding) |
| 247 | { |
| 248 | if (!decoders[encoding]) |
| 249 | throw rdr::Exception("Unknown encoding"); |
| 250 | |
| 251 | startCpuCounter(); |
| 252 | decoders[encoding]->readRect(r, &pb); |
| 253 | endCpuCounter(); |
| 254 | |
| 255 | decodeTime += getCpuCounter(); |
| 256 | |
| 257 | if (encoding != rfb::encodingCopyRect) // FIXME |
| 258 | updates.add_changed(rfb::Region(r)); |
| 259 | } |
| 260 | |
| 261 | void CConn::setColourMapEntries(int, int, rdr::U16*) |
| 262 | { |
| 263 | } |
| 264 | |
| 265 | void CConn::bell() |
| 266 | { |
| 267 | } |
| 268 | |
| 269 | void CConn::serverCutText(const char*, rdr::U32) |
| 270 | { |
| 271 | } |
| 272 | |
| 273 | Manager::Manager(class rfb::SConnection *conn) : |
| 274 | EncodeManager(conn) |
| 275 | { |
| 276 | } |
| 277 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 278 | void Manager::getStats(double& ratio, unsigned long long& encodedBytes, |
| 279 | unsigned long long& rawEquivalent) |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 280 | { |
| 281 | StatsVector::iterator iter; |
| 282 | unsigned long long bytes, equivalent; |
| 283 | |
| 284 | bytes = equivalent = 0; |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 285 | for (iter = stats.begin(); iter != stats.end(); ++iter) { |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 286 | StatsVector::value_type::iterator iter2; |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 287 | for (iter2 = iter->begin(); iter2 != iter->end(); ++iter2) { |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 288 | bytes += iter2->bytes; |
| 289 | equivalent += iter2->equivalent; |
| 290 | } |
| 291 | } |
| 292 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 293 | ratio = (double)equivalent / bytes; |
| 294 | encodedBytes = bytes; |
| 295 | rawEquivalent = equivalent; |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | SConn::SConn() |
| 299 | { |
| 300 | out = new DummyOutStream; |
| 301 | setStreams(NULL, out); |
| 302 | |
| 303 | setWriter(new rfb::SMsgWriter(&cp, out)); |
| 304 | |
| 305 | manager = new Manager(this); |
| 306 | } |
| 307 | |
| 308 | SConn::~SConn() |
| 309 | { |
| 310 | delete manager; |
| 311 | delete out; |
| 312 | } |
| 313 | |
| 314 | void SConn::writeUpdate(const rfb::UpdateInfo& ui, const rfb::PixelBuffer* pb) |
| 315 | { |
| 316 | manager->writeUpdate(ui, pb, NULL); |
| 317 | } |
| 318 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 319 | void SConn::getStats(double& ratio, unsigned long long& bytes, |
| 320 | unsigned long long& rawEquivalent) |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 321 | { |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 322 | manager->getStats(ratio, bytes, rawEquivalent); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | void SConn::setAccessRights(AccessRights ar) |
| 326 | { |
| 327 | } |
| 328 | |
| 329 | void SConn::setDesktopSize(int fb_width, int fb_height, |
| 330 | const rfb::ScreenSet& layout) |
| 331 | { |
| 332 | } |
| 333 | |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 334 | static double runTest(const char *fn, double& ratio, unsigned long long& bytes, |
| 335 | unsigned long long& rawEquivalent) |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 336 | { |
| 337 | CConn *cc; |
| 338 | double time; |
| 339 | |
| 340 | cc = new CConn(fn); |
| 341 | |
| 342 | try { |
| 343 | while (true) |
| 344 | cc->processMsg(); |
| 345 | } catch (rdr::EndOfStream e) { |
| 346 | } catch (rdr::Exception e) { |
| 347 | fprintf(stderr, "Failed to run rfb file: %s\n", e.str()); |
| 348 | exit(1); |
| 349 | } |
| 350 | |
| 351 | time = cc->encodeTime; |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 352 | cc->getStats(ratio, bytes, rawEquivalent); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 353 | |
| 354 | delete cc; |
| 355 | |
| 356 | return time; |
| 357 | } |
| 358 | |
| 359 | static void sort(double *array, int count) |
| 360 | { |
| 361 | bool sorted; |
| 362 | int i; |
| 363 | do { |
| 364 | sorted = true; |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 365 | for (i = 1; i < count; i++) { |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 366 | if (array[i-1] > array[i]) { |
| 367 | double d; |
| 368 | d = array[i]; |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 369 | array[i] = array[i - 1]; |
| 370 | array[i - 1] = d; |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 371 | sorted = false; |
| 372 | } |
| 373 | } |
| 374 | } while (!sorted); |
| 375 | } |
| 376 | |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 377 | static void usage(const char *argv0) |
| 378 | { |
| 379 | fprintf(stderr, "Syntax: %s [options] <rfb file>\n", argv0); |
| 380 | fprintf(stderr, "Options:\n"); |
| 381 | rfb::Configuration::listParams(79, 14); |
| 382 | exit(1); |
| 383 | } |
| 384 | |
| 385 | int main(int argc, char **argv) |
| 386 | { |
| 387 | int i; |
| 388 | |
| 389 | const char *fn; |
| 390 | |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 391 | fn = NULL; |
| 392 | for (i = 1; i < argc; i++) { |
| 393 | if (rfb::Configuration::setParam(argv[i])) |
| 394 | continue; |
| 395 | |
| 396 | if (argv[i][0] == '-') { |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 397 | if (i + 1 < argc) { |
| 398 | if (rfb::Configuration::setParam(&argv[i][1], argv[i + 1])) { |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 399 | i++; |
| 400 | continue; |
| 401 | } |
| 402 | } |
| 403 | usage(argv[0]); |
| 404 | } |
| 405 | |
| 406 | if (fn != NULL) |
| 407 | usage(argv[0]); |
| 408 | |
| 409 | fn = argv[i]; |
| 410 | } |
| 411 | |
DRC | 4631a76 | 2015-02-21 11:57:27 -0600 | [diff] [blame] | 412 | int runCount = count; |
| 413 | double times[runCount], dev[runCount]; |
| 414 | double median, meddev, ratio; |
| 415 | unsigned long long bytes, equivalent; |
| 416 | |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 417 | if (fn == NULL) { |
| 418 | fprintf(stderr, "No file specified!\n\n"); |
| 419 | usage(argv[0]); |
| 420 | } |
| 421 | |
| 422 | if (!format.hasBeenSet()) { |
| 423 | fprintf(stderr, "Pixel format not specified!\n\n"); |
| 424 | usage(argv[0]); |
| 425 | } |
| 426 | |
| 427 | if (!width.hasBeenSet() || !height.hasBeenSet()) { |
| 428 | fprintf(stderr, "Frame buffer size not specified!\n\n"); |
| 429 | usage(argv[0]); |
| 430 | } |
| 431 | |
| 432 | // Warmup |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 433 | runTest(fn, ratio, bytes, equivalent); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 434 | |
| 435 | // Multiple runs to get a good average |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 436 | for (i = 0; i < runCount; i++) |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 437 | times[i] = runTest(fn, ratio, bytes, equivalent); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 438 | |
| 439 | // Calculate median and median deviation |
| 440 | sort(times, runCount); |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 441 | median = times[runCount / 2]; |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 442 | |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 443 | for (i = 0; i < runCount; i++) |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 444 | dev[i] = fabs((times[i] - median) / median) * 100; |
| 445 | |
| 446 | sort(dev, runCount); |
DRC | b4c4a38 | 2015-02-21 11:28:37 -0600 | [diff] [blame] | 447 | meddev = dev[runCount / 2]; |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 448 | |
DRC | e46dda6 | 2015-02-25 14:08:34 -0600 | [diff] [blame] | 449 | printf("CPU time: %g s (+/- %g %%)\n", median, meddev); |
DRC | 77be929 | 2015-02-21 11:44:26 -0600 | [diff] [blame] | 450 | printf("Encoded bytes: %lld\n", bytes); |
| 451 | printf("Raw equivalent bytes: %lld\n", equivalent); |
Pierre Ossman | 8738e8a | 2015-02-11 13:49:04 +0100 | [diff] [blame] | 452 | printf("Ratio: %g\n", ratio); |
| 453 | |
| 454 | return 0; |
| 455 | } |