MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Macros | Typedefs | Functions
mg_jpg.c File Reference

Implementation of JPG decoder - according to the specification. More...

#include "decoder.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <setjmp.h>
#include <jpeglib.h>
#include <jerror.h>
#include "glue_memory.h"
#include "mg_ctxt.h"
#include "osd_utils.h"
#include "glue_assert.h"

Macros

#define INPUT_BUF_SIZE   4096 /* choose an efficiently fread'able size */
 
#define GetColourIndex(r, g, b, a)   OSD_FindNearestColourIndex((a << 24) | (r << 16) | (g << 8) | b )
 

Typedefs

typedef struct smyfile myfile_t
 
typedef struct my_error_mgr * my_error_ptr
 
typedef my_source_mgr * my_src_ptr
 

Functions

 init_source (j_decompress_ptr cinfo)
 
 fill_input_buffer (j_decompress_ptr cinfo)
 
 skip_input_data (j_decompress_ptr cinfo, long num_bytes)
 
 term_source (j_decompress_ptr cinfo)
 
 jobs_stdio_src (j_decompress_ptr cinfo, myfile_t *infile)
 
S_IMAGEDEC_DecodeJpg (U8BIT *data, U32BIT len)
 Allocate memory for JPG and decode bitmap. More...
 
void DEC_FreeJpg (S_IMAGE *data)
 Free memory allocated for JPEG bitmap. More...
 

Detailed Description

Implementation of JPG decoder - according to the specification.

Date
18-07-2008
Author
Adam Sturtridge

Function Documentation

S_IMAGE* DEC_DecodeJpg ( U8BIT *  data,
U32BIT  len 
)

Allocate memory for JPG and decode bitmap.

Allocate memory for JPEG and decode bitmap To free "S_IMAGE" memory, DEC_FreeJpg will be called.

Parameters
void* data JPG data. int len Length of data for JPG.
Returns
void * The decoded bitmap.
Warning
Bug:
void DEC_FreeJpg ( S_IMAGE image)

Free memory allocated for JPEG bitmap.

Parameters
dataJPG image
Returns
void