epeg 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (504) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/MANIFEST +5 -0
  4. data/TODO +1 -0
  5. data/epeg/.dockerignore +4 -0
  6. data/epeg/.gitignore +5 -0
  7. data/epeg/CMakeLists.txt +30 -0
  8. data/epeg/Dockerfile +23 -0
  9. data/epeg/Epeg.h +90 -0
  10. data/epeg/README.md +42 -0
  11. data/epeg/epeg_main.c +1642 -0
  12. data/epeg/epeg_private.h +85 -0
  13. data/epeg/example/.gitignore +1 -0
  14. data/epeg/example/CMakeLists.txt +20 -0
  15. data/epeg/example/example.jpg +0 -0
  16. data/epeg/example/rotatetest.c +29 -0
  17. data/epeg/example/scaletest.c +48 -0
  18. data/epeg/vendor/libjpeg-turbo-2.0.4/BUILDING.md +828 -0
  19. data/epeg/vendor/libjpeg-turbo-2.0.4/CMakeLists.txt +1420 -0
  20. data/epeg/vendor/libjpeg-turbo-2.0.4/ChangeLog.md +1494 -0
  21. data/epeg/vendor/libjpeg-turbo-2.0.4/LICENSE.md +132 -0
  22. data/epeg/vendor/libjpeg-turbo-2.0.4/README.ijg +277 -0
  23. data/epeg/vendor/libjpeg-turbo-2.0.4/README.md +356 -0
  24. data/epeg/vendor/libjpeg-turbo-2.0.4/cderror.h +137 -0
  25. data/epeg/vendor/libjpeg-turbo-2.0.4/cdjpeg.c +145 -0
  26. data/epeg/vendor/libjpeg-turbo-2.0.4/cdjpeg.h +157 -0
  27. data/epeg/vendor/libjpeg-turbo-2.0.4/change.log +315 -0
  28. data/epeg/vendor/libjpeg-turbo-2.0.4/cjpeg.1 +354 -0
  29. data/epeg/vendor/libjpeg-turbo-2.0.4/cjpeg.c +695 -0
  30. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/BuildPackages.cmake +182 -0
  31. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/GNUInstallDirs.cmake +416 -0
  32. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/cmake_uninstall.cmake.in +24 -0
  33. data/epeg/vendor/libjpeg-turbo-2.0.4/cmakescripts/testclean.cmake +41 -0
  34. data/epeg/vendor/libjpeg-turbo-2.0.4/cmyk.h +61 -0
  35. data/epeg/vendor/libjpeg-turbo-2.0.4/coderules.txt +78 -0
  36. data/epeg/vendor/libjpeg-turbo-2.0.4/djpeg.1 +296 -0
  37. data/epeg/vendor/libjpeg-turbo-2.0.4/djpeg.c +822 -0
  38. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/annotated.html +104 -0
  39. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/bc_s.png +0 -0
  40. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/bdwn.png +0 -0
  41. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/classes.html +106 -0
  42. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/closed.png +0 -0
  43. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen-extra.css +3 -0
  44. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen.css +1184 -0
  45. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/doxygen.png +0 -0
  46. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/dynsections.js +97 -0
  47. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2blank.png +0 -0
  48. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2cl.png +0 -0
  49. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2doc.png +0 -0
  50. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2folderclosed.png +0 -0
  51. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2folderopen.png +0 -0
  52. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2lastnode.png +0 -0
  53. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2link.png +0 -0
  54. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mlastnode.png +0 -0
  55. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mnode.png +0 -0
  56. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2mo.png +0 -0
  57. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2node.png +0 -0
  58. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2ns.png +0 -0
  59. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2plastnode.png +0 -0
  60. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2pnode.png +0 -0
  61. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2splitbar.png +0 -0
  62. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/ftv2vertline.png +0 -0
  63. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/functions.html +134 -0
  64. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/functions_vars.html +134 -0
  65. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/group___turbo_j_p_e_g.html +2775 -0
  66. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/index.html +90 -0
  67. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/jquery.js +8 -0
  68. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/modules.html +95 -0
  69. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_f.png +0 -0
  70. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_g.png +0 -0
  71. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/nav_h.png +0 -0
  72. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/open.png +0 -0
  73. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_63.html +26 -0
  74. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_63.js +4 -0
  75. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_64.html +26 -0
  76. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_64.js +5 -0
  77. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_68.html +26 -0
  78. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_68.js +4 -0
  79. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6e.html +26 -0
  80. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6e.js +4 -0
  81. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6f.html +26 -0
  82. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_6f.js +5 -0
  83. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_72.html +26 -0
  84. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_72.js +4 -0
  85. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_74.html +26 -0
  86. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_74.js +102 -0
  87. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_77.html +26 -0
  88. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_77.js +4 -0
  89. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_78.html +26 -0
  90. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_78.js +4 -0
  91. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_79.html +26 -0
  92. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/all_79.js +4 -0
  93. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/classes_74.html +26 -0
  94. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/classes_74.js +6 -0
  95. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/close.png +0 -0
  96. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enums_74.html +26 -0
  97. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enums_74.js +8 -0
  98. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enumvalues_74.html +26 -0
  99. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/enumvalues_74.js +37 -0
  100. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/functions_74.html +26 -0
  101. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/functions_74.js +31 -0
  102. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/groups_74.html +26 -0
  103. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/groups_74.js +4 -0
  104. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/mag_sel.png +0 -0
  105. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/nomatches.html +12 -0
  106. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search.css +271 -0
  107. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search.js +809 -0
  108. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_l.png +0 -0
  109. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_m.png +0 -0
  110. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/search_r.png +0 -0
  111. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/typedefs_74.html +26 -0
  112. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/typedefs_74.js +5 -0
  113. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_63.html +26 -0
  114. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_63.js +4 -0
  115. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_64.html +26 -0
  116. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_64.js +5 -0
  117. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_68.html +26 -0
  118. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_68.js +4 -0
  119. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6e.html +26 -0
  120. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6e.js +4 -0
  121. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6f.html +26 -0
  122. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_6f.js +5 -0
  123. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_72.html +26 -0
  124. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_72.js +4 -0
  125. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_74.html +26 -0
  126. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_74.js +10 -0
  127. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_77.html +26 -0
  128. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_77.js +4 -0
  129. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_78.html +26 -0
  130. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_78.js +4 -0
  131. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_79.html +26 -0
  132. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/search/variables_79.js +4 -0
  133. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjregion.html +186 -0
  134. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjscalingfactor.html +148 -0
  135. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/structtjtransform.html +212 -0
  136. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/sync_off.png +0 -0
  137. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/sync_on.png +0 -0
  138. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_a.png +0 -0
  139. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_b.png +0 -0
  140. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_h.png +0 -0
  141. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tab_s.png +0 -0
  142. data/epeg/vendor/libjpeg-turbo-2.0.4/doc/html/tabs.css +60 -0
  143. data/epeg/vendor/libjpeg-turbo-2.0.4/doxygen-extra.css +3 -0
  144. data/epeg/vendor/libjpeg-turbo-2.0.4/doxygen.config +16 -0
  145. data/epeg/vendor/libjpeg-turbo-2.0.4/example.txt +464 -0
  146. data/epeg/vendor/libjpeg-turbo-2.0.4/jaricom.c +157 -0
  147. data/epeg/vendor/libjpeg-turbo-2.0.4/java/CMakeLists.txt +88 -0
  148. data/epeg/vendor/libjpeg-turbo-2.0.4/java/MANIFEST.MF +2 -0
  149. data/epeg/vendor/libjpeg-turbo-2.0.4/java/README +52 -0
  150. data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJBench.java +1021 -0
  151. data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJExample.java +405 -0
  152. data/epeg/vendor/libjpeg-turbo-2.0.4/java/TJUnitTest.java +960 -0
  153. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/allclasses-frame.html +24 -0
  154. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/allclasses-noframe.html +24 -0
  155. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/constant-values.html +532 -0
  156. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/deprecated-list.html +252 -0
  157. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/help-doc.html +210 -0
  158. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/index-all.html +1029 -0
  159. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/index.html +71 -0
  160. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJ.html +1356 -0
  161. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +926 -0
  162. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html +241 -0
  163. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +1255 -0
  164. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJException.html +340 -0
  165. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html +343 -0
  166. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html +751 -0
  167. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html +421 -0
  168. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html +765 -0
  169. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-frame.html +31 -0
  170. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-summary.html +202 -0
  171. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/org/libjpegturbo/turbojpeg/package-tree.html +160 -0
  172. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/overview-tree.html +164 -0
  173. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/package-list +1 -0
  174. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/background.gif +0 -0
  175. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/tab.gif +0 -0
  176. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/titlebar.gif +0 -0
  177. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/resources/titlebar_end.gif +0 -0
  178. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/script.js +30 -0
  179. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/serialized-form.html +176 -0
  180. data/epeg/vendor/libjpeg-turbo-2.0.4/java/doc/stylesheet.css +474 -0
  181. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJ.java +584 -0
  182. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJCompressor.java +677 -0
  183. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJCustomFilter.java +76 -0
  184. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +931 -0
  185. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJException.java +78 -0
  186. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJLoader-unix.java.in +59 -0
  187. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJLoader-win.java.in +35 -0
  188. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java +115 -0
  189. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJTransform.java +227 -0
  190. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/TJTransformer.java +163 -0
  191. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org/libjpegturbo/turbojpeg/YUVImage.java +445 -0
  192. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJ.h +129 -0
  193. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJCompressor.h +101 -0
  194. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJDecompressor.h +101 -0
  195. data/epeg/vendor/libjpeg-turbo-2.0.4/java/org_libjpegturbo_turbojpeg_TJTransformer.h +29 -0
  196. data/epeg/vendor/libjpeg-turbo-2.0.4/jcapimin.c +295 -0
  197. data/epeg/vendor/libjpeg-turbo-2.0.4/jcapistd.c +162 -0
  198. data/epeg/vendor/libjpeg-turbo-2.0.4/jcarith.c +932 -0
  199. data/epeg/vendor/libjpeg-turbo-2.0.4/jccoefct.c +449 -0
  200. data/epeg/vendor/libjpeg-turbo-2.0.4/jccolext.c +144 -0
  201. data/epeg/vendor/libjpeg-turbo-2.0.4/jccolor.c +710 -0
  202. data/epeg/vendor/libjpeg-turbo-2.0.4/jcdctmgr.c +721 -0
  203. data/epeg/vendor/libjpeg-turbo-2.0.4/jchuff.c +1096 -0
  204. data/epeg/vendor/libjpeg-turbo-2.0.4/jchuff.h +42 -0
  205. data/epeg/vendor/libjpeg-turbo-2.0.4/jcicc.c +105 -0
  206. data/epeg/vendor/libjpeg-turbo-2.0.4/jcinit.c +77 -0
  207. data/epeg/vendor/libjpeg-turbo-2.0.4/jcmainct.c +162 -0
  208. data/epeg/vendor/libjpeg-turbo-2.0.4/jcmarker.c +664 -0
  209. data/epeg/vendor/libjpeg-turbo-2.0.4/jcmaster.c +640 -0
  210. data/epeg/vendor/libjpeg-turbo-2.0.4/jcomapi.c +109 -0
  211. data/epeg/vendor/libjpeg-turbo-2.0.4/jconfig.h.in +73 -0
  212. data/epeg/vendor/libjpeg-turbo-2.0.4/jconfig.txt +143 -0
  213. data/epeg/vendor/libjpeg-turbo-2.0.4/jconfigint.h.in +31 -0
  214. data/epeg/vendor/libjpeg-turbo-2.0.4/jcparam.c +541 -0
  215. data/epeg/vendor/libjpeg-turbo-2.0.4/jcphuff.c +1105 -0
  216. data/epeg/vendor/libjpeg-turbo-2.0.4/jcprepct.c +351 -0
  217. data/epeg/vendor/libjpeg-turbo-2.0.4/jcsample.c +539 -0
  218. data/epeg/vendor/libjpeg-turbo-2.0.4/jcstest.c +126 -0
  219. data/epeg/vendor/libjpeg-turbo-2.0.4/jctrans.c +400 -0
  220. data/epeg/vendor/libjpeg-turbo-2.0.4/jdapimin.c +407 -0
  221. data/epeg/vendor/libjpeg-turbo-2.0.4/jdapistd.c +639 -0
  222. data/epeg/vendor/libjpeg-turbo-2.0.4/jdarith.c +773 -0
  223. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatadst-tj.c +203 -0
  224. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatadst.c +293 -0
  225. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatasrc-tj.c +194 -0
  226. data/epeg/vendor/libjpeg-turbo-2.0.4/jdatasrc.c +295 -0
  227. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcoefct.c +692 -0
  228. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcoefct.h +82 -0
  229. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcol565.c +384 -0
  230. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcolext.c +143 -0
  231. data/epeg/vendor/libjpeg-turbo-2.0.4/jdcolor.c +883 -0
  232. data/epeg/vendor/libjpeg-turbo-2.0.4/jdct.h +208 -0
  233. data/epeg/vendor/libjpeg-turbo-2.0.4/jddctmgr.c +352 -0
  234. data/epeg/vendor/libjpeg-turbo-2.0.4/jdhuff.c +831 -0
  235. data/epeg/vendor/libjpeg-turbo-2.0.4/jdhuff.h +238 -0
  236. data/epeg/vendor/libjpeg-turbo-2.0.4/jdicc.c +171 -0
  237. data/epeg/vendor/libjpeg-turbo-2.0.4/jdinput.c +408 -0
  238. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmainct.c +460 -0
  239. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmainct.h +71 -0
  240. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmarker.c +1377 -0
  241. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmaster.c +737 -0
  242. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmaster.h +28 -0
  243. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmerge.c +617 -0
  244. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmrg565.c +354 -0
  245. data/epeg/vendor/libjpeg-turbo-2.0.4/jdmrgext.c +184 -0
  246. data/epeg/vendor/libjpeg-turbo-2.0.4/jdphuff.c +687 -0
  247. data/epeg/vendor/libjpeg-turbo-2.0.4/jdpostct.c +294 -0
  248. data/epeg/vendor/libjpeg-turbo-2.0.4/jdsample.c +518 -0
  249. data/epeg/vendor/libjpeg-turbo-2.0.4/jdsample.h +50 -0
  250. data/epeg/vendor/libjpeg-turbo-2.0.4/jdtrans.c +155 -0
  251. data/epeg/vendor/libjpeg-turbo-2.0.4/jerror.c +251 -0
  252. data/epeg/vendor/libjpeg-turbo-2.0.4/jerror.h +316 -0
  253. data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctflt.c +169 -0
  254. data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctfst.c +227 -0
  255. data/epeg/vendor/libjpeg-turbo-2.0.4/jfdctint.c +288 -0
  256. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctflt.c +240 -0
  257. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctfst.c +371 -0
  258. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctint.c +2627 -0
  259. data/epeg/vendor/libjpeg-turbo-2.0.4/jidctred.c +409 -0
  260. data/epeg/vendor/libjpeg-turbo-2.0.4/jinclude.h +88 -0
  261. data/epeg/vendor/libjpeg-turbo-2.0.4/jmemmgr.c +1179 -0
  262. data/epeg/vendor/libjpeg-turbo-2.0.4/jmemnobs.c +115 -0
  263. data/epeg/vendor/libjpeg-turbo-2.0.4/jmemsys.h +178 -0
  264. data/epeg/vendor/libjpeg-turbo-2.0.4/jmorecfg.h +421 -0
  265. data/epeg/vendor/libjpeg-turbo-2.0.4/jpeg_nbits_table.h +4098 -0
  266. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegcomp.h +31 -0
  267. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegint.h +368 -0
  268. data/epeg/vendor/libjpeg-turbo-2.0.4/jpeglib.h +1132 -0
  269. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegtran.1 +295 -0
  270. data/epeg/vendor/libjpeg-turbo-2.0.4/jpegtran.c +601 -0
  271. data/epeg/vendor/libjpeg-turbo-2.0.4/jquant1.c +859 -0
  272. data/epeg/vendor/libjpeg-turbo-2.0.4/jquant2.c +1285 -0
  273. data/epeg/vendor/libjpeg-turbo-2.0.4/jsimd.h +117 -0
  274. data/epeg/vendor/libjpeg-turbo-2.0.4/jsimd_none.c +418 -0
  275. data/epeg/vendor/libjpeg-turbo-2.0.4/jsimddct.h +70 -0
  276. data/epeg/vendor/libjpeg-turbo-2.0.4/jstdhuff.c +143 -0
  277. data/epeg/vendor/libjpeg-turbo-2.0.4/jutils.c +133 -0
  278. data/epeg/vendor/libjpeg-turbo-2.0.4/jversion.h +52 -0
  279. data/epeg/vendor/libjpeg-turbo-2.0.4/libjpeg.map.in +11 -0
  280. data/epeg/vendor/libjpeg-turbo-2.0.4/libjpeg.txt +3144 -0
  281. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/CMakeLists.txt +1 -0
  282. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5.c +275 -0
  283. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5.h +57 -0
  284. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5cmp.c +59 -0
  285. data/epeg/vendor/libjpeg-turbo-2.0.4/md5/md5hl.c +125 -0
  286. data/epeg/vendor/libjpeg-turbo-2.0.4/rdbmp.c +689 -0
  287. data/epeg/vendor/libjpeg-turbo-2.0.4/rdcolmap.c +254 -0
  288. data/epeg/vendor/libjpeg-turbo-2.0.4/rdgif.c +39 -0
  289. data/epeg/vendor/libjpeg-turbo-2.0.4/rdjpgcom.1 +63 -0
  290. data/epeg/vendor/libjpeg-turbo-2.0.4/rdjpgcom.c +510 -0
  291. data/epeg/vendor/libjpeg-turbo-2.0.4/rdppm.c +766 -0
  292. data/epeg/vendor/libjpeg-turbo-2.0.4/rdrle.c +389 -0
  293. data/epeg/vendor/libjpeg-turbo-2.0.4/rdswitch.c +424 -0
  294. data/epeg/vendor/libjpeg-turbo-2.0.4/rdtarga.c +509 -0
  295. data/epeg/vendor/libjpeg-turbo-2.0.4/release/Distribution.xml.in +24 -0
  296. data/epeg/vendor/libjpeg-turbo-2.0.4/release/License.rtf +20 -0
  297. data/epeg/vendor/libjpeg-turbo-2.0.4/release/ReadMe.txt +5 -0
  298. data/epeg/vendor/libjpeg-turbo-2.0.4/release/Welcome.rtf +17 -0
  299. data/epeg/vendor/libjpeg-turbo-2.0.4/release/deb-control.in +31 -0
  300. data/epeg/vendor/libjpeg-turbo-2.0.4/release/installer.nsi.in +191 -0
  301. data/epeg/vendor/libjpeg-turbo-2.0.4/release/libjpeg.pc.in +10 -0
  302. data/epeg/vendor/libjpeg-turbo-2.0.4/release/libturbojpeg.pc.in +10 -0
  303. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makecygwinpkg.in +66 -0
  304. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makedpkg.in +115 -0
  305. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makemacpkg.in +284 -0
  306. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makerpm.in +30 -0
  307. data/epeg/vendor/libjpeg-turbo-2.0.4/release/makesrpm.in +48 -0
  308. data/epeg/vendor/libjpeg-turbo-2.0.4/release/maketarball.in +51 -0
  309. data/epeg/vendor/libjpeg-turbo-2.0.4/release/rpm.spec.in +221 -0
  310. data/epeg/vendor/libjpeg-turbo-2.0.4/release/uninstall.in +113 -0
  311. data/epeg/vendor/libjpeg-turbo-2.0.4/sharedlib/CMakeLists.txt +99 -0
  312. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/CMakeLists.txt +385 -0
  313. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm/jsimd.c +721 -0
  314. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm/jsimd_neon.S +2878 -0
  315. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm64/jsimd.c +798 -0
  316. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/arm64/jsimd_neon.S +3433 -0
  317. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/gas-preprocessor.in +1 -0
  318. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-avx2.asm +578 -0
  319. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-mmx.asm +476 -0
  320. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolext-sse2.asm +503 -0
  321. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-avx2.asm +121 -0
  322. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-mmx.asm +121 -0
  323. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jccolor-sse2.asm +120 -0
  324. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-avx2.asm +113 -0
  325. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-mmx.asm +113 -0
  326. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgray-sse2.asm +112 -0
  327. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-avx2.asm +457 -0
  328. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-mmx.asm +355 -0
  329. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcgryext-sse2.asm +382 -0
  330. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jchuff-sse2.asm +424 -0
  331. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcphuff-sse2.asm +660 -0
  332. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-avx2.asm +388 -0
  333. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-mmx.asm +324 -0
  334. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jcsample-sse2.asm +351 -0
  335. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-avx2.asm +515 -0
  336. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-mmx.asm +404 -0
  337. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolext-sse2.asm +458 -0
  338. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-avx2.asm +118 -0
  339. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-mmx.asm +117 -0
  340. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdcolor-sse2.asm +117 -0
  341. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-avx2.asm +136 -0
  342. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-mmx.asm +123 -0
  343. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmerge-sse2.asm +135 -0
  344. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-avx2.asm +575 -0
  345. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-mmx.asm +460 -0
  346. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdmrgext-sse2.asm +517 -0
  347. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-avx2.asm +760 -0
  348. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-mmx.asm +731 -0
  349. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jdsample-sse2.asm +724 -0
  350. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctflt-3dn.asm +318 -0
  351. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctflt-sse.asm +369 -0
  352. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctfst-mmx.asm +395 -0
  353. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctfst-sse2.asm +403 -0
  354. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-avx2.asm +331 -0
  355. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-mmx.asm +620 -0
  356. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jfdctint-sse2.asm +633 -0
  357. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-3dn.asm +451 -0
  358. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-sse.asm +571 -0
  359. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctflt-sse2.asm +497 -0
  360. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctfst-mmx.asm +499 -0
  361. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctfst-sse2.asm +501 -0
  362. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-avx2.asm +453 -0
  363. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-mmx.asm +851 -0
  364. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctint-sse2.asm +858 -0
  365. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctred-mmx.asm +704 -0
  366. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jidctred-sse2.asm +592 -0
  367. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-3dn.asm +230 -0
  368. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-mmx.asm +276 -0
  369. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquant-sse.asm +208 -0
  370. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquantf-sse2.asm +168 -0
  371. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquanti-avx2.asm +188 -0
  372. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jquanti-sse2.asm +201 -0
  373. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jsimd.c +1253 -0
  374. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/i386/jsimdcpu.asm +135 -0
  375. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/jsimd.h +1083 -0
  376. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jccolext-mmi.c +483 -0
  377. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jccolor-mmi.c +148 -0
  378. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jcsample-mmi.c +100 -0
  379. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jcsample.h +28 -0
  380. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdcolext-mmi.c +424 -0
  381. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdcolor-mmi.c +139 -0
  382. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jdsample-mmi.c +245 -0
  383. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jfdctint-mmi.c +398 -0
  384. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jidctint-mmi.c +571 -0
  385. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jquanti-mmi.c +130 -0
  386. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jsimd.c +610 -0
  387. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/jsimd_mmi.h +57 -0
  388. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/loongson/loongson-mmintrin.h +1324 -0
  389. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd.c +1123 -0
  390. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd_dspr2.S +4479 -0
  391. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/mips/jsimd_dspr2_asm.h +292 -0
  392. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jcolsamp.inc +135 -0
  393. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jdct.inc +31 -0
  394. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jpeg_nbits_table.inc +4097 -0
  395. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdcfg.inc +93 -0
  396. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdcfg.inc.h +131 -0
  397. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/nasm/jsimdext.inc +479 -0
  398. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jccolext-altivec.c +269 -0
  399. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jccolor-altivec.c +116 -0
  400. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcgray-altivec.c +111 -0
  401. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcgryext-altivec.c +228 -0
  402. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcsample-altivec.c +159 -0
  403. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jcsample.h +28 -0
  404. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdcolext-altivec.c +276 -0
  405. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdcolor-altivec.c +106 -0
  406. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdmerge-altivec.c +130 -0
  407. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdmrgext-altivec.c +329 -0
  408. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jdsample-altivec.c +400 -0
  409. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jfdctfst-altivec.c +154 -0
  410. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jfdctint-altivec.c +258 -0
  411. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jidctfst-altivec.c +255 -0
  412. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jidctint-altivec.c +357 -0
  413. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jquanti-altivec.c +250 -0
  414. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jsimd.c +872 -0
  415. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/powerpc/jsimd_altivec.h +98 -0
  416. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolext-avx2.asm +558 -0
  417. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolext-sse2.asm +483 -0
  418. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolor-avx2.asm +121 -0
  419. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jccolor-sse2.asm +120 -0
  420. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgray-avx2.asm +113 -0
  421. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgray-sse2.asm +112 -0
  422. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgryext-avx2.asm +437 -0
  423. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcgryext-sse2.asm +362 -0
  424. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jchuff-sse2.asm +346 -0
  425. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcphuff-sse2.asm +637 -0
  426. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcsample-avx2.asm +366 -0
  427. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jcsample-sse2.asm +329 -0
  428. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolext-avx2.asm +495 -0
  429. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolext-sse2.asm +438 -0
  430. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolor-avx2.asm +118 -0
  431. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdcolor-sse2.asm +117 -0
  432. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmerge-avx2.asm +136 -0
  433. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmerge-sse2.asm +135 -0
  434. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmrgext-avx2.asm +593 -0
  435. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdmrgext-sse2.asm +535 -0
  436. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdsample-avx2.asm +695 -0
  437. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jdsample-sse2.asm +664 -0
  438. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctflt-sse.asm +355 -0
  439. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctfst-sse2.asm +389 -0
  440. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctint-avx2.asm +320 -0
  441. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jfdctint-sse2.asm +619 -0
  442. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctflt-sse2.asm +481 -0
  443. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctfst-sse2.asm +490 -0
  444. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctint-avx2.asm +417 -0
  445. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctint-sse2.asm +846 -0
  446. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jidctred-sse2.asm +573 -0
  447. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquantf-sse2.asm +154 -0
  448. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquanti-avx2.asm +162 -0
  449. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jquanti-sse2.asm +187 -0
  450. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jsimd.c +1076 -0
  451. data/epeg/vendor/libjpeg-turbo-2.0.4/simd/x86_64/jsimdcpu.asm +86 -0
  452. data/epeg/vendor/libjpeg-turbo-2.0.4/structure.txt +904 -0
  453. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/nightshot_iso_100.bmp +0 -0
  454. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/nightshot_iso_100.txt +25 -0
  455. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test.scan +5 -0
  456. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test1.icc +0 -0
  457. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test1.icc.txt +20 -0
  458. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test2.icc +0 -0
  459. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/test2.icc.txt +20 -0
  460. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testimgari.jpg +0 -0
  461. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testimgint.jpg +0 -0
  462. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig.jpg +0 -0
  463. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig.ppm +4 -0
  464. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/testorig12.jpg +0 -0
  465. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_5674_0098.bmp +0 -0
  466. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_6434_0018a.bmp +0 -0
  467. data/epeg/vendor/libjpeg-turbo-2.0.4/testimages/vgl_6548_0026a.bmp +0 -0
  468. data/epeg/vendor/libjpeg-turbo-2.0.4/tjbench.c +1031 -0
  469. data/epeg/vendor/libjpeg-turbo-2.0.4/tjbenchtest.in +256 -0
  470. data/epeg/vendor/libjpeg-turbo-2.0.4/tjbenchtest.java.in +215 -0
  471. data/epeg/vendor/libjpeg-turbo-2.0.4/tjexample.c +396 -0
  472. data/epeg/vendor/libjpeg-turbo-2.0.4/tjexampletest.in +149 -0
  473. data/epeg/vendor/libjpeg-turbo-2.0.4/tjexampletest.java.in +151 -0
  474. data/epeg/vendor/libjpeg-turbo-2.0.4/tjunittest.c +931 -0
  475. data/epeg/vendor/libjpeg-turbo-2.0.4/tjutil.c +70 -0
  476. data/epeg/vendor/libjpeg-turbo-2.0.4/tjutil.h +47 -0
  477. data/epeg/vendor/libjpeg-turbo-2.0.4/transupp.c +1628 -0
  478. data/epeg/vendor/libjpeg-turbo-2.0.4/transupp.h +210 -0
  479. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-jni.c +1246 -0
  480. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-mapfile +65 -0
  481. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg-mapfile.jni +101 -0
  482. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg.c +2152 -0
  483. data/epeg/vendor/libjpeg-turbo-2.0.4/turbojpeg.h +1744 -0
  484. data/epeg/vendor/libjpeg-turbo-2.0.4/usage.txt +635 -0
  485. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jconfig.h.in +34 -0
  486. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg62-memsrcdst.def +108 -0
  487. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg62.def +106 -0
  488. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg7-memsrcdst.def +110 -0
  489. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg7.def +108 -0
  490. data/epeg/vendor/libjpeg-turbo-2.0.4/win/jpeg8.def +111 -0
  491. data/epeg/vendor/libjpeg-turbo-2.0.4/wizard.txt +212 -0
  492. data/epeg/vendor/libjpeg-turbo-2.0.4/wrbmp.c +558 -0
  493. data/epeg/vendor/libjpeg-turbo-2.0.4/wrgif.c +413 -0
  494. data/epeg/vendor/libjpeg-turbo-2.0.4/wrjpgcom.1 +103 -0
  495. data/epeg/vendor/libjpeg-turbo-2.0.4/wrjpgcom.c +591 -0
  496. data/epeg/vendor/libjpeg-turbo-2.0.4/wrppm.c +365 -0
  497. data/epeg/vendor/libjpeg-turbo-2.0.4/wrrle.c +309 -0
  498. data/epeg/vendor/libjpeg-turbo-2.0.4/wrtarga.c +261 -0
  499. data/epeg.c +131 -0
  500. data/epeg.gemspec +18 -0
  501. data/extconf.rb +80 -0
  502. data/test.jpg +0 -0
  503. data/test.rb +42 -0
  504. metadata +546 -0
@@ -0,0 +1,831 @@
1
+ /*
2
+ * jdhuff.c
3
+ *
4
+ * This file was part of the Independent JPEG Group's software:
5
+ * Copyright (C) 1991-1997, Thomas G. Lane.
6
+ * libjpeg-turbo Modifications:
7
+ * Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
8
+ * For conditions of distribution and use, see the accompanying README.ijg
9
+ * file.
10
+ *
11
+ * This file contains Huffman entropy decoding routines.
12
+ *
13
+ * Much of the complexity here has to do with supporting input suspension.
14
+ * If the data source module demands suspension, we want to be able to back
15
+ * up to the start of the current MCU. To do this, we copy state variables
16
+ * into local working storage, and update them back to the permanent
17
+ * storage only upon successful completion of an MCU.
18
+ *
19
+ * NOTE: All referenced figures are from
20
+ * Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
21
+ */
22
+
23
+ #define JPEG_INTERNALS
24
+ #include "jinclude.h"
25
+ #include "jpeglib.h"
26
+ #include "jdhuff.h" /* Declarations shared with jdphuff.c */
27
+ #include "jpegcomp.h"
28
+ #include "jstdhuff.c"
29
+
30
+
31
+ /*
32
+ * Expanded entropy decoder object for Huffman decoding.
33
+ *
34
+ * The savable_state subrecord contains fields that change within an MCU,
35
+ * but must not be updated permanently until we complete the MCU.
36
+ */
37
+
38
+ typedef struct {
39
+ int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
40
+ } savable_state;
41
+
42
+ /* This macro is to work around compilers with missing or broken
43
+ * structure assignment. You'll need to fix this code if you have
44
+ * such a compiler and you change MAX_COMPS_IN_SCAN.
45
+ */
46
+
47
+ #ifndef NO_STRUCT_ASSIGN
48
+ #define ASSIGN_STATE(dest, src) ((dest) = (src))
49
+ #else
50
+ #if MAX_COMPS_IN_SCAN == 4
51
+ #define ASSIGN_STATE(dest, src) \
52
+ ((dest).last_dc_val[0] = (src).last_dc_val[0], \
53
+ (dest).last_dc_val[1] = (src).last_dc_val[1], \
54
+ (dest).last_dc_val[2] = (src).last_dc_val[2], \
55
+ (dest).last_dc_val[3] = (src).last_dc_val[3])
56
+ #endif
57
+ #endif
58
+
59
+
60
+ typedef struct {
61
+ struct jpeg_entropy_decoder pub; /* public fields */
62
+
63
+ /* These fields are loaded into local variables at start of each MCU.
64
+ * In case of suspension, we exit WITHOUT updating them.
65
+ */
66
+ bitread_perm_state bitstate; /* Bit buffer at start of MCU */
67
+ savable_state saved; /* Other state at start of MCU */
68
+
69
+ /* These fields are NOT loaded into local working state. */
70
+ unsigned int restarts_to_go; /* MCUs left in this restart interval */
71
+
72
+ /* Pointers to derived tables (these workspaces have image lifespan) */
73
+ d_derived_tbl *dc_derived_tbls[NUM_HUFF_TBLS];
74
+ d_derived_tbl *ac_derived_tbls[NUM_HUFF_TBLS];
75
+
76
+ /* Precalculated info set up by start_pass for use in decode_mcu: */
77
+
78
+ /* Pointers to derived tables to be used for each block within an MCU */
79
+ d_derived_tbl *dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
80
+ d_derived_tbl *ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
81
+ /* Whether we care about the DC and AC coefficient values for each block */
82
+ boolean dc_needed[D_MAX_BLOCKS_IN_MCU];
83
+ boolean ac_needed[D_MAX_BLOCKS_IN_MCU];
84
+ } huff_entropy_decoder;
85
+
86
+ typedef huff_entropy_decoder *huff_entropy_ptr;
87
+
88
+
89
+ /*
90
+ * Initialize for a Huffman-compressed scan.
91
+ */
92
+
93
+ METHODDEF(void)
94
+ start_pass_huff_decoder(j_decompress_ptr cinfo)
95
+ {
96
+ huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
97
+ int ci, blkn, dctbl, actbl;
98
+ d_derived_tbl **pdtbl;
99
+ jpeg_component_info *compptr;
100
+
101
+ /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
102
+ * This ought to be an error condition, but we make it a warning because
103
+ * there are some baseline files out there with all zeroes in these bytes.
104
+ */
105
+ if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2 - 1 ||
106
+ cinfo->Ah != 0 || cinfo->Al != 0)
107
+ WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
108
+
109
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
110
+ compptr = cinfo->cur_comp_info[ci];
111
+ dctbl = compptr->dc_tbl_no;
112
+ actbl = compptr->ac_tbl_no;
113
+ /* Compute derived values for Huffman tables */
114
+ /* We may do this more than once for a table, but it's not expensive */
115
+ pdtbl = (d_derived_tbl **)(entropy->dc_derived_tbls) + dctbl;
116
+ jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, pdtbl);
117
+ pdtbl = (d_derived_tbl **)(entropy->ac_derived_tbls) + actbl;
118
+ jpeg_make_d_derived_tbl(cinfo, FALSE, actbl, pdtbl);
119
+ /* Initialize DC predictions to 0 */
120
+ entropy->saved.last_dc_val[ci] = 0;
121
+ }
122
+
123
+ /* Precalculate decoding info for each block in an MCU of this scan */
124
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
125
+ ci = cinfo->MCU_membership[blkn];
126
+ compptr = cinfo->cur_comp_info[ci];
127
+ /* Precalculate which table to use for each block */
128
+ entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
129
+ entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
130
+ /* Decide whether we really care about the coefficient values */
131
+ if (compptr->component_needed) {
132
+ entropy->dc_needed[blkn] = TRUE;
133
+ /* we don't need the ACs if producing a 1/8th-size image */
134
+ entropy->ac_needed[blkn] = (compptr->_DCT_scaled_size > 1);
135
+ } else {
136
+ entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
137
+ }
138
+ }
139
+
140
+ /* Initialize bitread state variables */
141
+ entropy->bitstate.bits_left = 0;
142
+ entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
143
+ entropy->pub.insufficient_data = FALSE;
144
+
145
+ /* Initialize restart counter */
146
+ entropy->restarts_to_go = cinfo->restart_interval;
147
+ }
148
+
149
+
150
+ /*
151
+ * Compute the derived values for a Huffman table.
152
+ * This routine also performs some validation checks on the table.
153
+ *
154
+ * Note this is also used by jdphuff.c.
155
+ */
156
+
157
+ GLOBAL(void)
158
+ jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC, int tblno,
159
+ d_derived_tbl **pdtbl)
160
+ {
161
+ JHUFF_TBL *htbl;
162
+ d_derived_tbl *dtbl;
163
+ int p, i, l, si, numsymbols;
164
+ int lookbits, ctr;
165
+ char huffsize[257];
166
+ unsigned int huffcode[257];
167
+ unsigned int code;
168
+
169
+ /* Note that huffsize[] and huffcode[] are filled in code-length order,
170
+ * paralleling the order of the symbols themselves in htbl->huffval[].
171
+ */
172
+
173
+ /* Find the input Huffman table */
174
+ if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
175
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
176
+ htbl =
177
+ isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
178
+ if (htbl == NULL)
179
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
180
+
181
+ /* Allocate a workspace if we haven't already done so. */
182
+ if (*pdtbl == NULL)
183
+ *pdtbl = (d_derived_tbl *)
184
+ (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
185
+ sizeof(d_derived_tbl));
186
+ dtbl = *pdtbl;
187
+ dtbl->pub = htbl; /* fill in back link */
188
+
189
+ /* Figure C.1: make table of Huffman code length for each symbol */
190
+
191
+ p = 0;
192
+ for (l = 1; l <= 16; l++) {
193
+ i = (int)htbl->bits[l];
194
+ if (i < 0 || p + i > 256) /* protect against table overrun */
195
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
196
+ while (i--)
197
+ huffsize[p++] = (char)l;
198
+ }
199
+ huffsize[p] = 0;
200
+ numsymbols = p;
201
+
202
+ /* Figure C.2: generate the codes themselves */
203
+ /* We also validate that the counts represent a legal Huffman code tree. */
204
+
205
+ code = 0;
206
+ si = huffsize[0];
207
+ p = 0;
208
+ while (huffsize[p]) {
209
+ while (((int)huffsize[p]) == si) {
210
+ huffcode[p++] = code;
211
+ code++;
212
+ }
213
+ /* code is now 1 more than the last code used for codelength si; but
214
+ * it must still fit in si bits, since no code is allowed to be all ones.
215
+ */
216
+ if (((JLONG)code) >= (((JLONG)1) << si))
217
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
218
+ code <<= 1;
219
+ si++;
220
+ }
221
+
222
+ /* Figure F.15: generate decoding tables for bit-sequential decoding */
223
+
224
+ p = 0;
225
+ for (l = 1; l <= 16; l++) {
226
+ if (htbl->bits[l]) {
227
+ /* valoffset[l] = huffval[] index of 1st symbol of code length l,
228
+ * minus the minimum code of length l
229
+ */
230
+ dtbl->valoffset[l] = (JLONG)p - (JLONG)huffcode[p];
231
+ p += htbl->bits[l];
232
+ dtbl->maxcode[l] = huffcode[p - 1]; /* maximum code of length l */
233
+ } else {
234
+ dtbl->maxcode[l] = -1; /* -1 if no codes of this length */
235
+ }
236
+ }
237
+ dtbl->valoffset[17] = 0;
238
+ dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
239
+
240
+ /* Compute lookahead tables to speed up decoding.
241
+ * First we set all the table entries to 0, indicating "too long";
242
+ * then we iterate through the Huffman codes that are short enough and
243
+ * fill in all the entries that correspond to bit sequences starting
244
+ * with that code.
245
+ */
246
+
247
+ for (i = 0; i < (1 << HUFF_LOOKAHEAD); i++)
248
+ dtbl->lookup[i] = (HUFF_LOOKAHEAD + 1) << HUFF_LOOKAHEAD;
249
+
250
+ p = 0;
251
+ for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
252
+ for (i = 1; i <= (int)htbl->bits[l]; i++, p++) {
253
+ /* l = current code's length, p = its index in huffcode[] & huffval[]. */
254
+ /* Generate left-justified code followed by all possible bit sequences */
255
+ lookbits = huffcode[p] << (HUFF_LOOKAHEAD - l);
256
+ for (ctr = 1 << (HUFF_LOOKAHEAD - l); ctr > 0; ctr--) {
257
+ dtbl->lookup[lookbits] = (l << HUFF_LOOKAHEAD) | htbl->huffval[p];
258
+ lookbits++;
259
+ }
260
+ }
261
+ }
262
+
263
+ /* Validate symbols as being reasonable.
264
+ * For AC tables, we make no check, but accept all byte values 0..255.
265
+ * For DC tables, we require the symbols to be in range 0..15.
266
+ * (Tighter bounds could be applied depending on the data depth and mode,
267
+ * but this is sufficient to ensure safe decoding.)
268
+ */
269
+ if (isDC) {
270
+ for (i = 0; i < numsymbols; i++) {
271
+ int sym = htbl->huffval[i];
272
+ if (sym < 0 || sym > 15)
273
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
274
+ }
275
+ }
276
+ }
277
+
278
+
279
+ /*
280
+ * Out-of-line code for bit fetching (shared with jdphuff.c).
281
+ * See jdhuff.h for info about usage.
282
+ * Note: current values of get_buffer and bits_left are passed as parameters,
283
+ * but are returned in the corresponding fields of the state struct.
284
+ *
285
+ * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
286
+ * of get_buffer to be used. (On machines with wider words, an even larger
287
+ * buffer could be used.) However, on some machines 32-bit shifts are
288
+ * quite slow and take time proportional to the number of places shifted.
289
+ * (This is true with most PC compilers, for instance.) In this case it may
290
+ * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the
291
+ * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
292
+ */
293
+
294
+ #ifdef SLOW_SHIFT_32
295
+ #define MIN_GET_BITS 15 /* minimum allowable value */
296
+ #else
297
+ #define MIN_GET_BITS (BIT_BUF_SIZE - 7)
298
+ #endif
299
+
300
+
301
+ GLOBAL(boolean)
302
+ jpeg_fill_bit_buffer(bitread_working_state *state,
303
+ register bit_buf_type get_buffer, register int bits_left,
304
+ int nbits)
305
+ /* Load up the bit buffer to a depth of at least nbits */
306
+ {
307
+ /* Copy heavily used state fields into locals (hopefully registers) */
308
+ register const JOCTET *next_input_byte = state->next_input_byte;
309
+ register size_t bytes_in_buffer = state->bytes_in_buffer;
310
+ j_decompress_ptr cinfo = state->cinfo;
311
+
312
+ /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
313
+ /* (It is assumed that no request will be for more than that many bits.) */
314
+ /* We fail to do so only if we hit a marker or are forced to suspend. */
315
+
316
+ if (cinfo->unread_marker == 0) { /* cannot advance past a marker */
317
+ while (bits_left < MIN_GET_BITS) {
318
+ register int c;
319
+
320
+ /* Attempt to read a byte */
321
+ if (bytes_in_buffer == 0) {
322
+ if (!(*cinfo->src->fill_input_buffer) (cinfo))
323
+ return FALSE;
324
+ next_input_byte = cinfo->src->next_input_byte;
325
+ bytes_in_buffer = cinfo->src->bytes_in_buffer;
326
+ }
327
+ bytes_in_buffer--;
328
+ c = GETJOCTET(*next_input_byte++);
329
+
330
+ /* If it's 0xFF, check and discard stuffed zero byte */
331
+ if (c == 0xFF) {
332
+ /* Loop here to discard any padding FF's on terminating marker,
333
+ * so that we can save a valid unread_marker value. NOTE: we will
334
+ * accept multiple FF's followed by a 0 as meaning a single FF data
335
+ * byte. This data pattern is not valid according to the standard.
336
+ */
337
+ do {
338
+ if (bytes_in_buffer == 0) {
339
+ if (!(*cinfo->src->fill_input_buffer) (cinfo))
340
+ return FALSE;
341
+ next_input_byte = cinfo->src->next_input_byte;
342
+ bytes_in_buffer = cinfo->src->bytes_in_buffer;
343
+ }
344
+ bytes_in_buffer--;
345
+ c = GETJOCTET(*next_input_byte++);
346
+ } while (c == 0xFF);
347
+
348
+ if (c == 0) {
349
+ /* Found FF/00, which represents an FF data byte */
350
+ c = 0xFF;
351
+ } else {
352
+ /* Oops, it's actually a marker indicating end of compressed data.
353
+ * Save the marker code for later use.
354
+ * Fine point: it might appear that we should save the marker into
355
+ * bitread working state, not straight into permanent state. But
356
+ * once we have hit a marker, we cannot need to suspend within the
357
+ * current MCU, because we will read no more bytes from the data
358
+ * source. So it is OK to update permanent state right away.
359
+ */
360
+ cinfo->unread_marker = c;
361
+ /* See if we need to insert some fake zero bits. */
362
+ goto no_more_bytes;
363
+ }
364
+ }
365
+
366
+ /* OK, load c into get_buffer */
367
+ get_buffer = (get_buffer << 8) | c;
368
+ bits_left += 8;
369
+ } /* end while */
370
+ } else {
371
+ no_more_bytes:
372
+ /* We get here if we've read the marker that terminates the compressed
373
+ * data segment. There should be enough bits in the buffer register
374
+ * to satisfy the request; if so, no problem.
375
+ */
376
+ if (nbits > bits_left) {
377
+ /* Uh-oh. Report corrupted data to user and stuff zeroes into
378
+ * the data stream, so that we can produce some kind of image.
379
+ * We use a nonvolatile flag to ensure that only one warning message
380
+ * appears per data segment.
381
+ */
382
+ if (!cinfo->entropy->insufficient_data) {
383
+ WARNMS(cinfo, JWRN_HIT_MARKER);
384
+ cinfo->entropy->insufficient_data = TRUE;
385
+ }
386
+ /* Fill the buffer with zero bits */
387
+ get_buffer <<= MIN_GET_BITS - bits_left;
388
+ bits_left = MIN_GET_BITS;
389
+ }
390
+ }
391
+
392
+ /* Unload the local registers */
393
+ state->next_input_byte = next_input_byte;
394
+ state->bytes_in_buffer = bytes_in_buffer;
395
+ state->get_buffer = get_buffer;
396
+ state->bits_left = bits_left;
397
+
398
+ return TRUE;
399
+ }
400
+
401
+
402
+ /* Macro version of the above, which performs much better but does not
403
+ handle markers. We have to hand off any blocks with markers to the
404
+ slower routines. */
405
+
406
+ #define GET_BYTE { \
407
+ register int c0, c1; \
408
+ c0 = GETJOCTET(*buffer++); \
409
+ c1 = GETJOCTET(*buffer); \
410
+ /* Pre-execute most common case */ \
411
+ get_buffer = (get_buffer << 8) | c0; \
412
+ bits_left += 8; \
413
+ if (c0 == 0xFF) { \
414
+ /* Pre-execute case of FF/00, which represents an FF data byte */ \
415
+ buffer++; \
416
+ if (c1 != 0) { \
417
+ /* Oops, it's actually a marker indicating end of compressed data. */ \
418
+ cinfo->unread_marker = c1; \
419
+ /* Back out pre-execution and fill the buffer with zero bits */ \
420
+ buffer -= 2; \
421
+ get_buffer &= ~0xFF; \
422
+ } \
423
+ } \
424
+ }
425
+
426
+ #if SIZEOF_SIZE_T == 8 || defined(_WIN64)
427
+
428
+ /* Pre-fetch 48 bytes, because the holding register is 64-bit */
429
+ #define FILL_BIT_BUFFER_FAST \
430
+ if (bits_left <= 16) { \
431
+ GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
432
+ }
433
+
434
+ #else
435
+
436
+ /* Pre-fetch 16 bytes, because the holding register is 32-bit */
437
+ #define FILL_BIT_BUFFER_FAST \
438
+ if (bits_left <= 16) { \
439
+ GET_BYTE GET_BYTE \
440
+ }
441
+
442
+ #endif
443
+
444
+
445
+ /*
446
+ * Out-of-line code for Huffman code decoding.
447
+ * See jdhuff.h for info about usage.
448
+ */
449
+
450
+ GLOBAL(int)
451
+ jpeg_huff_decode(bitread_working_state *state,
452
+ register bit_buf_type get_buffer, register int bits_left,
453
+ d_derived_tbl *htbl, int min_bits)
454
+ {
455
+ register int l = min_bits;
456
+ register JLONG code;
457
+
458
+ /* HUFF_DECODE has determined that the code is at least min_bits */
459
+ /* bits long, so fetch that many bits in one swoop. */
460
+
461
+ CHECK_BIT_BUFFER(*state, l, return -1);
462
+ code = GET_BITS(l);
463
+
464
+ /* Collect the rest of the Huffman code one bit at a time. */
465
+ /* This is per Figure F.16. */
466
+
467
+ while (code > htbl->maxcode[l]) {
468
+ code <<= 1;
469
+ CHECK_BIT_BUFFER(*state, 1, return -1);
470
+ code |= GET_BITS(1);
471
+ l++;
472
+ }
473
+
474
+ /* Unload the local registers */
475
+ state->get_buffer = get_buffer;
476
+ state->bits_left = bits_left;
477
+
478
+ /* With garbage input we may reach the sentinel value l = 17. */
479
+
480
+ if (l > 16) {
481
+ WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
482
+ return 0; /* fake a zero as the safest result */
483
+ }
484
+
485
+ return htbl->pub->huffval[(int)(code + htbl->valoffset[l])];
486
+ }
487
+
488
+
489
+ /*
490
+ * Figure F.12: extend sign bit.
491
+ * On some machines, a shift and add will be faster than a table lookup.
492
+ */
493
+
494
+ #define AVOID_TABLES
495
+ #ifdef AVOID_TABLES
496
+
497
+ #define NEG_1 ((unsigned int)-1)
498
+ #define HUFF_EXTEND(x, s) \
499
+ ((x) + ((((x) - (1 << ((s) - 1))) >> 31) & (((NEG_1) << (s)) + 1)))
500
+
501
+ #else
502
+
503
+ #define HUFF_EXTEND(x, s) \
504
+ ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
505
+
506
+ static const int extend_test[16] = { /* entry n is 2**(n-1) */
507
+ 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
508
+ 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000
509
+ };
510
+
511
+ static const int extend_offset[16] = { /* entry n is (-1 << n) + 1 */
512
+ 0, ((-1) << 1) + 1, ((-1) << 2) + 1, ((-1) << 3) + 1, ((-1) << 4) + 1,
513
+ ((-1) << 5) + 1, ((-1) << 6) + 1, ((-1) << 7) + 1, ((-1) << 8) + 1,
514
+ ((-1) << 9) + 1, ((-1) << 10) + 1, ((-1) << 11) + 1, ((-1) << 12) + 1,
515
+ ((-1) << 13) + 1, ((-1) << 14) + 1, ((-1) << 15) + 1
516
+ };
517
+
518
+ #endif /* AVOID_TABLES */
519
+
520
+
521
+ /*
522
+ * Check for a restart marker & resynchronize decoder.
523
+ * Returns FALSE if must suspend.
524
+ */
525
+
526
+ LOCAL(boolean)
527
+ process_restart(j_decompress_ptr cinfo)
528
+ {
529
+ huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
530
+ int ci;
531
+
532
+ /* Throw away any unused bits remaining in bit buffer; */
533
+ /* include any full bytes in next_marker's count of discarded bytes */
534
+ cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
535
+ entropy->bitstate.bits_left = 0;
536
+
537
+ /* Advance past the RSTn marker */
538
+ if (!(*cinfo->marker->read_restart_marker) (cinfo))
539
+ return FALSE;
540
+
541
+ /* Re-initialize DC predictions to 0 */
542
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++)
543
+ entropy->saved.last_dc_val[ci] = 0;
544
+
545
+ /* Reset restart counter */
546
+ entropy->restarts_to_go = cinfo->restart_interval;
547
+
548
+ /* Reset out-of-data flag, unless read_restart_marker left us smack up
549
+ * against a marker. In that case we will end up treating the next data
550
+ * segment as empty, and we can avoid producing bogus output pixels by
551
+ * leaving the flag set.
552
+ */
553
+ if (cinfo->unread_marker == 0)
554
+ entropy->pub.insufficient_data = FALSE;
555
+
556
+ return TRUE;
557
+ }
558
+
559
+
560
+ LOCAL(boolean)
561
+ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
562
+ {
563
+ huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
564
+ BITREAD_STATE_VARS;
565
+ int blkn;
566
+ savable_state state;
567
+ /* Outer loop handles each block in the MCU */
568
+
569
+ /* Load up working state */
570
+ BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
571
+ ASSIGN_STATE(state, entropy->saved);
572
+
573
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
574
+ JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
575
+ d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn];
576
+ d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn];
577
+ register int s, k, r;
578
+
579
+ /* Decode a single block's worth of coefficients */
580
+
581
+ /* Section F.2.2.1: decode the DC coefficient difference */
582
+ HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
583
+ if (s) {
584
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
585
+ r = GET_BITS(s);
586
+ s = HUFF_EXTEND(r, s);
587
+ }
588
+
589
+ if (entropy->dc_needed[blkn]) {
590
+ /* Convert DC difference to actual value, update last_dc_val */
591
+ int ci = cinfo->MCU_membership[blkn];
592
+ /* This is really just
593
+ * s += state.last_dc_val[ci];
594
+ * It is written this way in order to shut up UBSan.
595
+ */
596
+ s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
597
+ state.last_dc_val[ci] = s;
598
+ if (block) {
599
+ /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
600
+ (*block)[0] = (JCOEF)s;
601
+ }
602
+ }
603
+
604
+ if (entropy->ac_needed[blkn] && block) {
605
+
606
+ /* Section F.2.2.2: decode the AC coefficients */
607
+ /* Since zeroes are skipped, output area must be cleared beforehand */
608
+ for (k = 1; k < DCTSIZE2; k++) {
609
+ HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
610
+
611
+ r = s >> 4;
612
+ s &= 15;
613
+
614
+ if (s) {
615
+ k += r;
616
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
617
+ r = GET_BITS(s);
618
+ s = HUFF_EXTEND(r, s);
619
+ /* Output coefficient in natural (dezigzagged) order.
620
+ * Note: the extra entries in jpeg_natural_order[] will save us
621
+ * if k >= DCTSIZE2, which could happen if the data is corrupted.
622
+ */
623
+ (*block)[jpeg_natural_order[k]] = (JCOEF)s;
624
+ } else {
625
+ if (r != 15)
626
+ break;
627
+ k += 15;
628
+ }
629
+ }
630
+
631
+ } else {
632
+
633
+ /* Section F.2.2.2: decode the AC coefficients */
634
+ /* In this path we just discard the values */
635
+ for (k = 1; k < DCTSIZE2; k++) {
636
+ HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
637
+
638
+ r = s >> 4;
639
+ s &= 15;
640
+
641
+ if (s) {
642
+ k += r;
643
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
644
+ DROP_BITS(s);
645
+ } else {
646
+ if (r != 15)
647
+ break;
648
+ k += 15;
649
+ }
650
+ }
651
+ }
652
+ }
653
+
654
+ /* Completed MCU, so update state */
655
+ BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
656
+ ASSIGN_STATE(entropy->saved, state);
657
+ return TRUE;
658
+ }
659
+
660
+
661
+ LOCAL(boolean)
662
+ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
663
+ {
664
+ huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
665
+ BITREAD_STATE_VARS;
666
+ JOCTET *buffer;
667
+ int blkn;
668
+ savable_state state;
669
+ /* Outer loop handles each block in the MCU */
670
+
671
+ /* Load up working state */
672
+ BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
673
+ buffer = (JOCTET *)br_state.next_input_byte;
674
+ ASSIGN_STATE(state, entropy->saved);
675
+
676
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
677
+ JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
678
+ d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn];
679
+ d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn];
680
+ register int s, k, r, l;
681
+
682
+ HUFF_DECODE_FAST(s, l, dctbl);
683
+ if (s) {
684
+ FILL_BIT_BUFFER_FAST
685
+ r = GET_BITS(s);
686
+ s = HUFF_EXTEND(r, s);
687
+ }
688
+
689
+ if (entropy->dc_needed[blkn]) {
690
+ int ci = cinfo->MCU_membership[blkn];
691
+ s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
692
+ state.last_dc_val[ci] = s;
693
+ if (block)
694
+ (*block)[0] = (JCOEF)s;
695
+ }
696
+
697
+ if (entropy->ac_needed[blkn] && block) {
698
+
699
+ for (k = 1; k < DCTSIZE2; k++) {
700
+ HUFF_DECODE_FAST(s, l, actbl);
701
+ r = s >> 4;
702
+ s &= 15;
703
+
704
+ if (s) {
705
+ k += r;
706
+ FILL_BIT_BUFFER_FAST
707
+ r = GET_BITS(s);
708
+ s = HUFF_EXTEND(r, s);
709
+ (*block)[jpeg_natural_order[k]] = (JCOEF)s;
710
+ } else {
711
+ if (r != 15) break;
712
+ k += 15;
713
+ }
714
+ }
715
+
716
+ } else {
717
+
718
+ for (k = 1; k < DCTSIZE2; k++) {
719
+ HUFF_DECODE_FAST(s, l, actbl);
720
+ r = s >> 4;
721
+ s &= 15;
722
+
723
+ if (s) {
724
+ k += r;
725
+ FILL_BIT_BUFFER_FAST
726
+ DROP_BITS(s);
727
+ } else {
728
+ if (r != 15) break;
729
+ k += 15;
730
+ }
731
+ }
732
+ }
733
+ }
734
+
735
+ if (cinfo->unread_marker != 0) {
736
+ cinfo->unread_marker = 0;
737
+ return FALSE;
738
+ }
739
+
740
+ br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);
741
+ br_state.next_input_byte = buffer;
742
+ BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
743
+ ASSIGN_STATE(entropy->saved, state);
744
+ return TRUE;
745
+ }
746
+
747
+
748
+ /*
749
+ * Decode and return one MCU's worth of Huffman-compressed coefficients.
750
+ * The coefficients are reordered from zigzag order into natural array order,
751
+ * but are not dequantized.
752
+ *
753
+ * The i'th block of the MCU is stored into the block pointed to by
754
+ * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
755
+ * (Wholesale zeroing is usually a little faster than retail...)
756
+ *
757
+ * Returns FALSE if data source requested suspension. In that case no
758
+ * changes have been made to permanent state. (Exception: some output
759
+ * coefficients may already have been assigned. This is harmless for
760
+ * this module, since we'll just re-assign them on the next call.)
761
+ */
762
+
763
+ #define BUFSIZE (DCTSIZE2 * 8)
764
+
765
+ METHODDEF(boolean)
766
+ decode_mcu(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
767
+ {
768
+ huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
769
+ int usefast = 1;
770
+
771
+ /* Process restart marker if needed; may have to suspend */
772
+ if (cinfo->restart_interval) {
773
+ if (entropy->restarts_to_go == 0)
774
+ if (!process_restart(cinfo))
775
+ return FALSE;
776
+ usefast = 0;
777
+ }
778
+
779
+ if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU ||
780
+ cinfo->unread_marker != 0)
781
+ usefast = 0;
782
+
783
+ /* If we've run out of data, just leave the MCU set to zeroes.
784
+ * This way, we return uniform gray for the remainder of the segment.
785
+ */
786
+ if (!entropy->pub.insufficient_data) {
787
+
788
+ if (usefast) {
789
+ if (!decode_mcu_fast(cinfo, MCU_data)) goto use_slow;
790
+ } else {
791
+ use_slow:
792
+ if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;
793
+ }
794
+
795
+ }
796
+
797
+ /* Account for restart interval (no-op if not using restarts) */
798
+ entropy->restarts_to_go--;
799
+
800
+ return TRUE;
801
+ }
802
+
803
+
804
+ /*
805
+ * Module initialization routine for Huffman entropy decoding.
806
+ */
807
+
808
+ GLOBAL(void)
809
+ jinit_huff_decoder(j_decompress_ptr cinfo)
810
+ {
811
+ huff_entropy_ptr entropy;
812
+ int i;
813
+
814
+ /* Motion JPEG frames typically do not include the Huffman tables if they
815
+ are the default tables. Thus, if the tables are not set by the time
816
+ the Huffman decoder is initialized (usually within the body of
817
+ jpeg_start_decompress()), we set them to default values. */
818
+ std_huff_tables((j_common_ptr)cinfo);
819
+
820
+ entropy = (huff_entropy_ptr)
821
+ (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
822
+ sizeof(huff_entropy_decoder));
823
+ cinfo->entropy = (struct jpeg_entropy_decoder *)entropy;
824
+ entropy->pub.start_pass = start_pass_huff_decoder;
825
+ entropy->pub.decode_mcu = decode_mcu;
826
+
827
+ /* Mark tables unallocated */
828
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
829
+ entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
830
+ }
831
+ }