Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 876216 - Update libjpeg-turbo to version 1.3.0. r=jlebar
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed Jun 6, 2013
1 parent f2c01db commit b4872ac
Show file tree
Hide file tree
Showing 42 changed files with 3,012 additions and 389 deletions.
4 changes: 4 additions & 0 deletions media/libjpeg/MOZCHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ To upgrade to a new revision of libjpeg-turbo, do the following:

$ hg addremove

== June 4, 2013 (libjpeg-turbo v1.3.0 r988 2013-05-25) ==

* Updated to v1.3.0 release.

== December 12, 2012 ==

* Replace the runtime computed jpeg_nbits_table with constants in
Expand Down
36 changes: 14 additions & 22 deletions media/libjpeg/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
libjpeg-turbo note: This file contains portions of the libjpeg v6b and v8
README files, with additional wordsmithing by The libjpeg-turbo Project.
It is included only for reference, as some parts of it may not apply to
libjpeg-turbo. Please see README-turbo.txt for information specific to
libjpeg-turbo.
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
to include only information relevant to libjpeg-turbo, to wordsmith certain
sections, and to remove impolitic language that existed in the libjpeg v8
README. It is included only for reference. Please see README-turbo.txt for
information specific to libjpeg-turbo.


The Independent JPEG Group's JPEG software
Expand All @@ -17,7 +17,8 @@ Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
and other members of the Independent JPEG Group.

IJG is not affiliated with the official ISO JPEG standards committee.
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
(also known as JPEG, together with ITU-T SG16).


DOCUMENTATION ROADMAP
Expand Down Expand Up @@ -45,7 +46,6 @@ Programmer and internal documentation:
libjpeg.txt How to use the JPEG library in your own programs.
example.c Sample code for calling the JPEG library.
structure.txt Overview of the JPEG library's internal structure.
filelist.txt Road map of IJG files.
coderules.txt Coding style rules --- please read if you contribute code.

Please read at least the files install.txt and usage.txt. Some information
Expand Down Expand Up @@ -129,7 +129,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.

This software is copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding.
This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.

Permission is hereby granted to use, copy, modify, and distribute this
Expand Down Expand Up @@ -160,15 +160,6 @@ commercial products, provided that all warranty or liability claims are
assumed by the product vendor.


ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
ansi2knr.c is NOT covered by the above copyright and conditions, but instead
by the usual distribution terms of the Free Software Foundation; principally,
that you must include source code if you redistribute it. (See the file
ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
of any program generated from the IJG code, this does not limit you more than
the foregoing paragraphs do.

The Unix configuration script "configure" was produced with GNU Autoconf.
It is copyright by the Free Software Foundation but is freely distributable.
The same holds for its supporting scripts (config.guess, config.sub,
Expand Down Expand Up @@ -274,11 +265,12 @@ with body
FILE FORMAT WARS
================

The ISO JPEG standards committee actually promotes different formats like
"JPEG 2000" or "JPEG XR", which are incompatible with original DCT-based
JPEG. IJG therefore does not support these formats (see REFERENCES). Indeed,
one of the original reasons for developing this free software was to help
force convergence on common, interoperable format standards for JPEG files.
The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
with ITU-T SG16) currently promotes different formats containing the name
"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does
not support these formats (see REFERENCES). Indeed, one of the original
reasons for developing this free software was to help force convergence on
common, interoperable format standards for JPEG files.
Don't use an incompatible file format!
(In any case, our decoder will remain capable of reading existing JPEG
image files indefinitely.)
Expand Down
336 changes: 225 additions & 111 deletions media/libjpeg/README-turbo.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions media/libjpeg/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define VERSION "1.2.1"
#define BUILD "2012-06-30"
#define VERSION "1.3.0"
#define BUILD "2013-05-25"
#define PACKAGE_NAME "libjpeg-turbo"

/* Need to use Mozilla-specific function inlining. */
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jccolext.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* jccolext.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* Modifications:
* Copyright (C) 2009-2012, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains input colorspace conversion routines.
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jccolor.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* jccolor.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1996, Thomas G. Lane.
* Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009-2012, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains input colorspace conversion routines.
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jcdctmgr.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* jcdctmgr.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modifications:
* Copyright (C) 1999-2006, MIYASAKA Masaru.
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011 D. R. Commander
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains the forward-DCT management logic.
Expand Down
5 changes: 2 additions & 3 deletions media/libjpeg/jchuff.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* jchuff.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modifications:
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains Huffman entropy encoding routines.
Expand Down Expand Up @@ -291,8 +292,6 @@ dump_buffer (working_state * state)
{
struct jpeg_destination_mgr * dest = state->cinfo->dest;

dest->free_in_buffer = state->free_in_buffer;

if (! (*dest->empty_output_buffer) (state->cinfo))
return FALSE;
/* After a successful buffer dump, must reset buffer pointers */
Expand Down
2 changes: 1 addition & 1 deletion media/libjpeg/jcmainct.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ process_data_buffer_main (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
{
my_main_ptr main = (my_main_ptr) cinfo->main;
my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
int ci;
jpeg_component_info *compptr;
boolean writing = (main_ptr->pass_mode != JBUF_CRANK_DEST);
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jcmarker.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* jcmarker.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modifications:
* Copyright (C) 2010, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains routines to write JPEG datastream markers.
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jcmaster.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* jcmaster.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2010 by Guido Vollbeding.
* Modifications:
* Copyright (C) 2010, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains master control logic for the JPEG compressor.
Expand Down
5 changes: 4 additions & 1 deletion media/libjpeg/jconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#define JPEG_LIB_VERSION 62

/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 1.2.0
#define LIBJPEG_TURBO_VERSION 1.3.0

/* Support in-memory source/destination managers */
/* #undef MEM_SRCDST_SUPPORTED */

/* Compiler supports function prototypes. */
#define HAVE_PROTOTYPES 1
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jcparam.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* jcparam.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2008 by Guido Vollbeding.
* Modifications:
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains optional default-setting code for the JPEG compressor.
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jdapistd.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* jdapistd.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modifications:
* Copyright (C) 2010, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains application interface code for the decompression half
Expand Down
22 changes: 12 additions & 10 deletions media/libjpeg/jdatadst.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/*
* jdatadst.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* Modified 2009-2012 by Guido Vollbeding.
* Modifications:
* Copyright (C) 2013, D. R. Commander.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains compression data destination routines for the case of
Expand Down Expand Up @@ -40,7 +42,7 @@ typedef my_destination_mgr * my_dest_ptr;
#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */


#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
/* Expanded data destination object for memory output */

typedef struct {
Expand Down Expand Up @@ -76,7 +78,7 @@ init_destination (j_compress_ptr cinfo)
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
}

#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(void)
init_mem_destination (j_compress_ptr cinfo)
{
Expand Down Expand Up @@ -123,7 +125,7 @@ empty_output_buffer (j_compress_ptr cinfo)
return TRUE;
}

#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(boolean)
empty_mem_output_buffer (j_compress_ptr cinfo)
{
Expand All @@ -133,7 +135,7 @@ empty_mem_output_buffer (j_compress_ptr cinfo)

/* Try to allocate new buffer with double size */
nextsize = dest->bufsize * 2;
nextbuffer = malloc(nextsize);
nextbuffer = (JOCTET *) malloc(nextsize);

if (nextbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
Expand Down Expand Up @@ -182,14 +184,14 @@ term_destination (j_compress_ptr cinfo)
ERREXIT(cinfo, JERR_FILE_WRITE);
}

#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(void)
term_mem_destination (j_compress_ptr cinfo)
{
my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;

*dest->outbuffer = dest->buffer;
*dest->outsize = dest->bufsize - dest->pub.free_in_buffer;
*dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer);
}
#endif

Expand Down Expand Up @@ -225,7 +227,7 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
}


#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
/*
* Prepare for output to a memory buffer.
* The caller may supply an own initial buffer with appropriate size.
Expand Down Expand Up @@ -265,7 +267,7 @@ jpeg_mem_dest (j_compress_ptr cinfo,

if (*outbuffer == NULL || *outsize == 0) {
/* Allocate initial buffer */
dest->newbuffer = *outbuffer = malloc(OUTPUT_BUF_SIZE);
dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);
if (dest->newbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
*outsize = OUTPUT_BUF_SIZE;
Expand Down
19 changes: 11 additions & 8 deletions media/libjpeg/jdatasrc.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/*
* jdatasrc.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* Modified 2009-2011 by Guido Vollbeding.
* Modifications:
* Copyright (C) 2013, D. R. Commander.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains decompression data source routines for the case of
Expand Down Expand Up @@ -53,7 +55,7 @@ init_source (j_decompress_ptr cinfo)
src->start_of_file = TRUE;
}

#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(void)
init_mem_source (j_decompress_ptr cinfo)
{
Expand Down Expand Up @@ -120,20 +122,21 @@ fill_input_buffer (j_decompress_ptr cinfo)
return TRUE;
}

#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
METHODDEF(boolean)
fill_mem_input_buffer (j_decompress_ptr cinfo)
{
static JOCTET mybuffer[4];
static const JOCTET mybuffer[4] = {
(JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0
};

/* The whole JPEG data is expected to reside in the supplied memory
* buffer, so any request for more data beyond the given buffer size
* is treated as an error.
*/
WARNMS(cinfo, JWRN_JPEG_EOF);

/* Insert a fake EOI marker */
mybuffer[0] = (JOCTET) 0xFF;
mybuffer[1] = (JOCTET) JPEG_EOI;

cinfo->src->next_input_byte = mybuffer;
cinfo->src->bytes_in_buffer = 2;
Expand Down Expand Up @@ -243,7 +246,7 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
}


#if JPEG_LIB_VERSION >= 80
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
/*
* Prepare for input from a supplied memory buffer.
* The buffer must contain the whole JPEG data.
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jdcoefct.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* jdcoefct.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modifications:
* Copyright (C) 2010, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains the coefficient buffer controller for decompression.
Expand Down
3 changes: 2 additions & 1 deletion media/libjpeg/jdcolext.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* jdcolext.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modifications:
* Copyright (C) 2009, 2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains output colorspace conversion routines.
Expand Down
Loading

0 comments on commit b4872ac

Please sign in to comment.