1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libjpeg/mozilla.diff Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,123 @@ 1.4 +diff -up8 jchuff.c jchuff.c 1.5 +--- jchuff.c 2012-12-30 21:42:18 -0500 1.6 ++++ jchuff.c 2013-02-16 19:37:01 -0500 1.7 +@@ -17,18 +17,20 @@ 1.8 + */ 1.9 + 1.10 + #define JPEG_INTERNALS 1.11 + #include "jinclude.h" 1.12 + #include "jpeglib.h" 1.13 + #include "jchuff.h" /* Declarations shared with jcphuff.c */ 1.14 + #include <limits.h> 1.15 + 1.16 +-static unsigned char jpeg_nbits_table[65536]; 1.17 +-static int jpeg_nbits_table_init = 0; 1.18 ++static const unsigned char jpeg_nbits_table[65536] = { 1.19 ++/* Number i needs jpeg_nbits_table[i] bits to be represented. */ 1.20 ++#include "jpeg_nbits_table.h" 1.21 ++}; 1.22 + 1.23 + #ifndef min 1.24 + #define min(a,b) ((a)<(b)?(a):(b)) 1.25 + #endif 1.26 + 1.27 + 1.28 + /* Expanded entropy encoder object for Huffman encoding. 1.29 + * 1.30 +@@ -266,25 +268,16 @@ jpeg_make_c_derived_tbl (j_compress_ptr 1.31 + 1.32 + for (p = 0; p < lastp; p++) { 1.33 + i = htbl->huffval[p]; 1.34 + if (i < 0 || i > maxsymbol || dtbl->ehufsi[i]) 1.35 + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); 1.36 + dtbl->ehufco[i] = huffcode[p]; 1.37 + dtbl->ehufsi[i] = huffsize[p]; 1.38 + } 1.39 +- 1.40 +- if(!jpeg_nbits_table_init) { 1.41 +- for(i = 0; i < 65536; i++) { 1.42 +- int nbits = 0, temp = i; 1.43 +- while (temp) {temp >>= 1; nbits++;} 1.44 +- jpeg_nbits_table[i] = nbits; 1.45 +- } 1.46 +- jpeg_nbits_table_init = 1; 1.47 +- } 1.48 + } 1.49 + 1.50 + 1.51 + /* Outputting bytes to the file */ 1.52 + 1.53 + /* Emit a byte, taking 'action' if must suspend. */ 1.54 + #define emit_byte(state,val,action) \ 1.55 + { *(state)->next_output_byte++ = (JOCTET) (val); \ 1.56 +diff -up8 jmorecfg.h jmorecfg.h 1.57 +--- jmorecfg.h 2013-01-06 12:59:42 -0500 1.58 ++++ jmorecfg.h 2013-02-16 19:37:01 -0500 1.59 +@@ -7,16 +7,17 @@ 1.60 + * Copyright (C) 2009, 2011, D. R. Commander. 1.61 + * For conditions of distribution and use, see the accompanying README file. 1.62 + * 1.63 + * This file contains additional configuration options that customize the 1.64 + * JPEG software for special applications or support machine-dependent 1.65 + * optimizations. Most users will not need to touch this file. 1.66 + */ 1.67 + 1.68 ++#include <stdint.h> 1.69 + 1.70 + /* 1.71 + * Define BITS_IN_JSAMPLE as either 1.72 + * 8 for 8-bit sample values (the usual setting) 1.73 + * 12 for 12-bit sample values 1.74 + * Only 8 and 12 are legal data precisions for lossy JPEG according to the 1.75 + * JPEG standard, and the IJG code does not support anything else! 1.76 + * We do not support run-time selection of data precision, sorry. 1.77 +@@ -128,45 +129,29 @@ typedef char JOCTET; 1.78 + * They must be at least as wide as specified; but making them too big 1.79 + * won't cost a huge amount of memory, so we don't provide special 1.80 + * extraction code like we did for JSAMPLE. (In other words, these 1.81 + * typedefs live at a different point on the speed/space tradeoff curve.) 1.82 + */ 1.83 + 1.84 + /* UINT8 must hold at least the values 0..255. */ 1.85 + 1.86 +-#ifdef HAVE_UNSIGNED_CHAR 1.87 +-typedef unsigned char UINT8; 1.88 +-#else /* not HAVE_UNSIGNED_CHAR */ 1.89 +-#ifdef __CHAR_UNSIGNED__ 1.90 +-typedef char UINT8; 1.91 +-#else /* not __CHAR_UNSIGNED__ */ 1.92 +-typedef short UINT8; 1.93 +-#endif /* __CHAR_UNSIGNED__ */ 1.94 +-#endif /* HAVE_UNSIGNED_CHAR */ 1.95 ++typedef uint8_t UINT8; 1.96 + 1.97 + /* UINT16 must hold at least the values 0..65535. */ 1.98 + 1.99 +-#ifdef HAVE_UNSIGNED_SHORT 1.100 +-typedef unsigned short UINT16; 1.101 +-#else /* not HAVE_UNSIGNED_SHORT */ 1.102 +-typedef unsigned int UINT16; 1.103 +-#endif /* HAVE_UNSIGNED_SHORT */ 1.104 ++typedef uint16_t UINT16; 1.105 + 1.106 + /* INT16 must hold at least the values -32768..32767. */ 1.107 + 1.108 +-#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ 1.109 +-typedef short INT16; 1.110 +-#endif 1.111 ++typedef int16_t INT16; 1.112 + 1.113 + /* INT32 must hold at least signed 32-bit values. */ 1.114 + 1.115 +-#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ 1.116 +-typedef long INT32; 1.117 +-#endif 1.118 ++typedef int32_t INT32; 1.119 + 1.120 + /* Datatype used for image dimensions. The JPEG standard only supports 1.121 + * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore 1.122 + * "unsigned int" is sufficient on all machines. However, if you need to 1.123 + * handle larger images and you don't mind deviating from the spec, you 1.124 + * can change this datatype. 1.125 + */ 1.126 +