Blender V2.61 - r43446
Defines | Functions | Variables

mjpeg.c File Reference

#include "AVI_avi.h"
#include <stdlib.h>
#include <string.h>
#include "jpeglib.h"
#include "jerror.h"
#include "MEM_guardedalloc.h"
#include "mjpeg.h"

Go to the source code of this file.

Defines

#define PADUP(num, amt)   ((num+(amt-1))&~(amt-1))

Functions

static void jpegmemdestmgr_build (j_compress_ptr cinfo, unsigned char *buffer, int bufsize)
static void jpegmemsrcmgr_build (j_decompress_ptr dinfo, unsigned char *buffer, int bufsize)
static void add_huff_table (j_decompress_ptr dinfo, JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
static void std_huff_tables (j_decompress_ptr dinfo)
static int Decode_JPEG (unsigned char *inBuffer, unsigned char *outBuffer, unsigned int width, unsigned int height, int bufsize)
static void Compress_JPEG (int quality, unsigned char *outbuffer, unsigned char *inBuffer, int width, int height, int bufsize)
static void interlace (unsigned char *to, unsigned char *from, int width, int height)
static void deinterlace (int odd, unsigned char *to, unsigned char *from, int width, int height)
static int check_and_decode_jpeg (unsigned char *inbuf, unsigned char *outbuf, int width, int height, int bufsize)
static void check_and_compress_jpeg (int quality, unsigned char *outbuf, unsigned char *inbuf, int width, int height, int bufsize)
void * avi_converter_from_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size)
void * avi_converter_to_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size)
static void jpegmemdestmgr_init_destination (j_compress_ptr cinfo)
static boolean jpegmemdestmgr_empty_output_buffer (j_compress_ptr cinfo)
static void jpegmemdestmgr_term_destination (j_compress_ptr cinfo)
static void jpegmemsrcmgr_init_source (j_decompress_ptr dinfo)
static boolean jpegmemsrcmgr_fill_input_buffer (j_decompress_ptr dinfo)
static void jpegmemsrcmgr_skip_input_data (j_decompress_ptr dinfo, long skipcnt)
static void jpegmemsrcmgr_term_source (j_decompress_ptr dinfo)

Variables

static int numbytes

Detailed Description

Definition in file mjpeg.c.


Define Documentation

#define PADUP (   num,
  amt 
)    ((num+(amt-1))&~(amt-1))

Definition at line 46 of file mjpeg.c.

Referenced by check_and_compress_jpeg(), and check_and_decode_jpeg().


Function Documentation

static void add_huff_table ( j_decompress_ptr  dinfo,
JHUFF_TBL **  htblptr,
const UINT8 *  bits,
const UINT8 *  val 
) [static]

Definition at line 53 of file mjpeg.c.

References FALSE, and NULL.

Referenced by std_huff_tables().

void* avi_converter_from_mjpeg ( AviMovie movie,
int  stream,
unsigned char *  buffer,
int *  size 
)
void* avi_converter_to_mjpeg ( AviMovie movie,
int  stream,
unsigned char *  buffer,
int *  size 
)
static void check_and_compress_jpeg ( int  quality,
unsigned char *  outbuf,
unsigned char *  inbuf,
int  width,
int  height,
int  bufsize 
) [static]

Definition at line 309 of file mjpeg.c.

References Compress_JPEG(), i, MEM_freeN(), MEM_mallocN(), and PADUP.

Referenced by avi_converter_to_mjpeg().

static int check_and_decode_jpeg ( unsigned char *  inbuf,
unsigned char *  outbuf,
int  width,
int  height,
int  bufsize 
) [static]

Definition at line 286 of file mjpeg.c.

References Decode_JPEG(), i, MEM_freeN(), MEM_mallocN(), and PADUP.

Referenced by avi_converter_from_mjpeg().

static void Compress_JPEG ( int  quality,
unsigned char *  outbuffer,
unsigned char *  inBuffer,
int  width,
int  height,
int  bufsize 
) [static]

Definition at line 200 of file mjpeg.c.

References FALSE, i, jpegmemdestmgr_build(), and TRUE.

Referenced by check_and_compress_jpeg().

static int Decode_JPEG ( unsigned char *  inBuffer,
unsigned char *  outBuffer,
unsigned int  width,
unsigned int  height,
int  bufsize 
) [static]

Definition at line 147 of file mjpeg.c.

References jpegmemsrcmgr_build(), NULL, numbytes, std_huff_tables(), and TRUE.

Referenced by check_and_decode_jpeg().

static void deinterlace ( int  odd,
unsigned char *  to,
unsigned char *  from,
int  width,
int  height 
) [static]

Definition at line 274 of file mjpeg.c.

References i.

Referenced by avi_converter_to_mjpeg().

static void interlace ( unsigned char *  to,
unsigned char *  from,
int  width,
int  height 
) [static]

Definition at line 262 of file mjpeg.c.

References i.

Referenced by avi_converter_from_mjpeg(), and pluginapi_force_ref().

static void jpegmemdestmgr_build ( j_compress_ptr  cinfo,
unsigned char *  buffer,
int  bufsize 
) [static]
static boolean jpegmemdestmgr_empty_output_buffer ( j_compress_ptr  cinfo) [static]

Definition at line 398 of file mjpeg.c.

References TRUE.

Referenced by jpegmemdestmgr_build().

static void jpegmemdestmgr_init_destination ( j_compress_ptr  cinfo) [static]

Definition at line 393 of file mjpeg.c.

Referenced by jpegmemdestmgr_build().

static void jpegmemdestmgr_term_destination ( j_compress_ptr  cinfo) [static]

Definition at line 404 of file mjpeg.c.

References MEM_freeN(), and numbytes.

Referenced by jpegmemdestmgr_build().

static void jpegmemsrcmgr_build ( j_decompress_ptr  dinfo,
unsigned char *  buffer,
int  bufsize 
) [static]
static boolean jpegmemsrcmgr_fill_input_buffer ( j_decompress_ptr  dinfo) [static]

Definition at line 432 of file mjpeg.c.

References TRUE.

Referenced by jpegmemsrcmgr_build().

static void jpegmemsrcmgr_init_source ( j_decompress_ptr  dinfo) [static]

Definition at line 427 of file mjpeg.c.

Referenced by jpegmemsrcmgr_build().

static void jpegmemsrcmgr_skip_input_data ( j_decompress_ptr  dinfo,
long  skipcnt 
) [static]

Definition at line 448 of file mjpeg.c.

Referenced by jpegmemsrcmgr_build().

static void jpegmemsrcmgr_term_source ( j_decompress_ptr  dinfo) [static]

Definition at line 457 of file mjpeg.c.

References MEM_freeN(), and numbytes.

Referenced by jpegmemsrcmgr_build().

static void std_huff_tables ( j_decompress_ptr  dinfo) [static]

Definition at line 68 of file mjpeg.c.

References add_huff_table().

Referenced by Decode_JPEG().


Variable Documentation

int numbytes [static]