Giter VIP home page Giter VIP logo

rapid-qoi's Introduction

rapid-qoi

crates docs actions MIT/Apache loc

Fast implementation of QOI format. Reference implementation is here 'https://github.com/phoboslab/qoi'

rapid-qoi is

  • no std

  • no unsafe

  • tiny

  • fast to build (0.8 sec clean build on i9)

  • one of the most efficient implementations of QOI encoder and decoder.

    # Grand total for qoi benchmark suite
    # https://qoiformat.org/benchmark/qoi_benchmark_suite.tar
    
              decode ms   encode ms   decode mpps   encode mpps
    ## Intel i9
    qoi:          2.009       2.706        231.01        171.52
    rapid_qoi:    1.404       2.520        330.72        184.23
    
    ## Apple M1
    qoi:          1.676       2.088        277.01        222.26
    rapid_qoi:    1.100       1.836        421.99        252.77
    

    See benches for full reports.
    Run cargo run --release -p bench -- [iterations] [path]

License

Licensed under either of

at your option.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

rapid-qoi's People

Contributors

starwort avatar wx257osn2 avatar zakarumych avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

wx257osn2

rapid-qoi's Issues

Possible edge case in decoder when very first OP is QOI_OP_RUN

There's an edge-case that currently is handled differently by various decoders. At a first glance it looks like this decoder may not be spec-conformant. The spec is not clearly worded in this case, but I have decided to interpret it in a particular way now. Sorry about that!

Please see the original issue here phoboslab/qoi#258 for the details.

The encoder outputs incorrect qoi with some inputs

According to below script, the encoder of rapid-qoi outputs incorrect data with some inputs:

#!/bin/bash

QOICONV_REF=./qoi/qoiconv
QOICONV_TARGET=./rapid-qoi/target/release/qoiconv
IMAGES=./qoi/images

rm -f /tmp/{ref,target}.{qoi,png}

result=0
find ${IMAGES} | grep -E '.png$' | while read x; do
  ${QOICONV_REF} "${x}" /tmp/ref.qoi
  ${QOICONV_TARGET} "${x}" /tmp/target.qoi 2>/dev/null
  ret=$?
  if [ ${ret} -ne 0 ]; then
    echo ${x} : encode failed by target encoder. skip...
    rm /tmp/ref.qoi
    continue
  fi
  ${QOICONV_REF} /tmp/ref.qoi /tmp/ref.png
  ${QOICONV_REF} /tmp/target.qoi /tmp/target.png >/dev/null
  ret=$?
  if [ ${ret} -ne 0 ]; then
    echo ${x} : decode failed by reference decoder
    rm /tmp/ref.{qoi,png} /tmp/target.qoi
    result=1
    continue
  fi
  diff /tmp/ref.png /tmp/target.png > /dev/null
  ret=$?
  if [ ${ret} -ne 0 ]; then
    echo ${x} : encode by target encoder is not correct
    result=1
  fi
  rm /tmp/{ref,target}.{qoi,png}
done

exit ${result}
./qoi/images/photo_wikipedia/034.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Severed_screenshot_05.png : encode by target encoder is not correct
./qoi/images/screenshot_game/TowerFall_Flight.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Mapperkmud.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Severed_screenshot_04.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Towdie_Screenshot.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Htdamg_affinity.png : encode failed by target encoder. skip...
./qoi/images/screenshot_game/3dbrick2.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Nidhogg_video_game_screenshot_2.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Triplane_Turmoil_screenshot.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Cibele_video_game_screenshot_2.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Noctis_Screenshot.png : encode by target encoder is not correct
./qoi/images/screenshot_game/TowerFall_Thornwood.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Job_Simulator_screenshot_-_Auto_01.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Frogatto.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Blek_screenshot_collection_2.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Kye.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Bankai.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Ballerburg.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Heartlight.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Sega-Mega-Drive-regional-lockout-error.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Core_War_PMars_Screenshot.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Flinthook_screenshot_-_Pax_square_5.png : encode by target encoder is not correct
./qoi/images/screenshot_game/TowerFall_Backfire.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Blek_screenshot_collection_3.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Ai_dungeon_with_a_custom_setting.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Openciv-0.95.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Gang_Garrison_2.png : encode by target encoder is not correct
./qoi/images/screenshot_game/This_Is_the_Police_-_Screenshot_09.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Neverball_Kursauswahl.png : encode by target encoder is not correct
./qoi/images/screenshot_game/The_Bub%27s_Brothers.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Smiler_in_Arrowe_Land.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Wc4source.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Blek_screenshot_collection_4.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Flinthook_screenshot_-_Pax_square_3.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Maelstrom_screenshot.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Volcano.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Hedgeweap.png : encode by target encoder is not correct
./qoi/images/screenshot_game/StationSnapshot2.png : encode by target encoder is not correct
./qoi/images/screenshot_game/TowerFall_Sacred_Ground.png : encode by target encoder is not correct
./qoi/images/screenshot_game/OXO_emulated_portion.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Dr._Langeskov,_The_Tiger,_and_The_Terribly_Cursed_Emerald_Screenshot_6.png : encode by target encoder is not correct
./qoi/images/screenshot_game/A7xpg-continue.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Threes_development_process_art_mockup_21.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Temporal_game_screenshot.png : encode by target encoder is not correct
./qoi/images/screenshot_game/Netrek-client-cow.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02bk.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_conbuild01c.png : encode by target encoder is not correct
./qoi/images/textures_pk/+0mod_button1.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_tilewall1e2.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_wall4k.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01g.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_screen1g.png : encode by target encoder is not correct
./qoi/images/textures_pk/SW_Window01a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chinwall2l.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_screene.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02ag.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01c.png : encode by target encoder is not correct
./qoi/images/textures_pk/mis_wall2b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_containr2a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_containr1a.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_screen1h.png : encode by target encoder is not correct
./qoi/images/textures_pk/{pkf_auttrees1a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02ac.png : encode by target encoder is not correct
./qoi/images/textures_pk/SW_Gate01.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_wall4h.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chinwall2g.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_gwall02a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall04m.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_labvent1b.png : encode by target encoder is not correct
./qoi/images/textures_pk/scroll_modwater.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_wall4g.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_wall4o.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01e.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02bc.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_wall5c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chmud1.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chinflw1b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_tilewall1g.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall07k.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_tilewall1c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02ae.png : encode by target encoder is not correct
./qoi/images/textures_pk/+amod_button1.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_containr2c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01j.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_containr3c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chrooft1c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_tilewall1f2.png : encode by target encoder is not correct
./qoi/images/textures_pk/SW_Gate03.png : encode by target encoder is not correct
./qoi/images/textures_pk/gow_wallceiling1.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_shopwall1e.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_food1c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chinwall2h.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02bf.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall07i.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall07j.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_containr1c.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_vtrim01a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02bd.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_tilewall1b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_gwall03a.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_vtrim01b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_light2b.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_metfloor2c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01d.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall02ad.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chrock1.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_vent1a.png : encode by target encoder is not correct
./qoi/images/textures_pk/{SW_Tree02.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01i.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_labvent1a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_tilewall1e.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chinwall2c.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall03f.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_vent1b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall07b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pk_chinflw1a.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_screenh.png : encode by target encoder is not correct
./qoi/images/textures_pk/mis_wall2a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_tilewall1g2.png : encode by target encoder is not correct
./qoi/images/textures_pk/SW_Wall01b.png : encode by target encoder is not correct
./qoi/images/textures_pk/SW_Wall02b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_gwall03b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_trim06.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_wall5b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_creds.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_labcab1b.png : encode by target encoder is not correct
./qoi/images/textures_pk/mod_door3.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_containr3a.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall01f.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_wall07d.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkw_gwall02b.png : encode by target encoder is not correct
./qoi/images/textures_pk/pkf_door1b.png : encode by target encoder is not correct
./qoi/images/photo_tecnick/RGB_OR_1200x1200_046.png : encode by target encoder is not correct
./qoi/images/photo_tecnick/RGB_OR_1200x1200_003.png : encode by target encoder is not correct
./qoi/images/photo_tecnick/RGB_OR_1200x1200_001.png : encode by target encoder is not correct
./qoi/images/photo_tecnick/RGB_OR_1200x1200_034.png : encode by target encoder is not correct

Exampels or tutorial

I am very new to rust and would like to use this lib to encode Vec to qoi Images.
I tried to find out how it worked with the benches files, but clear examples like here would be very nice. (You might wonder why I don't this lib, because it doesn't work/My Image viewer can't open their *.qoi Images).
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.