jcomapi.c File Reference

#include "jinclude.h"
#include "jpeglib.h"

Go to the source code of this file.

Defines

#define JPEG_INTERNALS

Functions

 jpeg_abort (j_common_ptr cinfo)
 jpeg_alloc_huff_table (j_common_ptr cinfo)
 jpeg_alloc_quant_table (j_common_ptr cinfo)
 jpeg_destroy (j_common_ptr cinfo)


Define Documentation

#define JPEG_INTERNALS

Definition at line 12 of file jcomapi.c.


Function Documentation

jpeg_abort ( j_common_ptr  cinfo  ) 

Definition at line 29 of file jcomapi.c.

References CSTATE_START, DSTATE_START, JPOOL_NUMPOOLS, and JPOOL_PERMANENT.

Referenced by jpeg_abort_compress(), jpeg_abort_decompress(), jpeg_finish_compress(), jpeg_finish_decompress(), and jpeg_read_header().

00030 {
00031   int pool;
00032 
00033   /* Do nothing if called on a not-initialized or destroyed JPEG object. */
00034   if (cinfo->mem == NULL)
00035     return;
00036 
00037   /* Releasing pools in reverse order might help avoid fragmentation
00038    * with some (brain-damaged) malloc libraries.
00039    */
00040   for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
00041     (*cinfo->mem->free_pool) (cinfo, pool);
00042   }
00043 
00044   /* Reset overall state for possible reuse of object */
00045   if (cinfo->is_decompressor) {
00046     cinfo->global_state = DSTATE_START;
00047     /* Try to keep application from accessing now-deleted marker list.
00048      * A bit kludgy to do it here, but this is the most central place.
00049      */
00050     ((j_decompress_ptr) cinfo)->marker_list = NULL;
00051   } else {
00052     cinfo->global_state = CSTATE_START;
00053   }
00054 }

jpeg_alloc_huff_table ( j_common_ptr  cinfo  ) 

Definition at line 98 of file jcomapi.c.

References FALSE, JPOOL_PERMANENT, JHUFF_TBL::sent_table, and SIZEOF.

Referenced by add_huff_table(), finish_pass_gather(), and get_dht().

00099 {
00100   JHUFF_TBL *tbl;
00101 
00102   tbl = (JHUFF_TBL *)
00103     (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
00104   tbl->sent_table = FALSE;  /* make sure this is false in any new table */
00105   return tbl;
00106 }

jpeg_alloc_quant_table ( j_common_ptr  cinfo  ) 

Definition at line 86 of file jcomapi.c.

References FALSE, JPOOL_PERMANENT, JQUANT_TBL::sent_table, and SIZEOF.

Referenced by get_dqt(), jpeg_add_quant_table(), and jpeg_copy_critical_parameters().

00087 {
00088   JQUANT_TBL *tbl;
00089 
00090   tbl = (JQUANT_TBL *)
00091     (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
00092   tbl->sent_table = FALSE;  /* make sure this is false in any new table */
00093   return tbl;
00094 }

jpeg_destroy ( j_common_ptr  cinfo  ) 

Definition at line 69 of file jcomapi.c.

Referenced by error_exit(), jpeg_destroy_compress(), and jpeg_destroy_decompress().

00070 {
00071   /* We need only tell the memory manager to release everything. */
00072   /* NB: mem pointer is NULL if memory mgr failed to initialize. */
00073   if (cinfo->mem != NULL)
00074     (*cinfo->mem->self_destruct) (cinfo);
00075   cinfo->mem = NULL;        /* be safe if jpeg_destroy is called twice */
00076   cinfo->global_state = 0;  /* mark it destroyed */
00077 }


Generated on Fri Feb 19 02:31:02 2010 for AVR32 - IJG JPEG Decoder Example by  doxygen 1.5.5