Blender  V3.3
Functions | Variables
avi_mjpeg.c File Reference
#include <stdlib.h>
#include <string.h>
#include "AVI_avi.h"
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
#include "IMB_imbuf.h"
#include <jerror.h>
#include <jpeglib.h>
#include "avi_mjpeg.h"

Go to the source code of this file.

Functions

static void jpegmemdestmgr_build (j_compress_ptr cinfo, unsigned char *buffer, size_t bufsize)
 
static void jpegmemsrcmgr_build (j_decompress_ptr dinfo, const unsigned char *buffer, size_t bufsize)
 
static void add_huff_table (j_decompress_ptr dinfo, JHUFF_TBL **htblptr, const UINT8 *bits, const size_t bits_size, const UINT8 *val, const size_t val_size)
 
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, size_t bufsize)
 
static void Compress_JPEG (int quality, unsigned char *outbuffer, const unsigned char *inBuffer, int width, int height, size_t 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)
 
voidavi_converter_from_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, const size_t *size)
 
voidavi_converter_to_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, size_t *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 skip_count)
 
static void jpegmemsrcmgr_term_source (j_decompress_ptr dinfo)
 

Variables

static size_t numbytes
 

Detailed Description

This is external code. Converts between AVI and MPEG/JPEG.

Definition in file avi_mjpeg.c.

Function Documentation

◆ add_huff_table()

static void add_huff_table ( j_decompress_ptr  dinfo,
JHUFF_TBL **  htblptr,
const UINT8 *  bits,
const size_t  bits_size,
const UINT8 *  val,
const size_t  val_size 
)
static

Definition at line 32 of file avi_mjpeg.c.

References min_zz(), and NULL.

Referenced by std_huff_tables().

◆ avi_converter_from_mjpeg()

void* avi_converter_from_mjpeg ( AviMovie movie,
int  stream,
unsigned char *  buffer,
const size_t *  size 
)

◆ avi_converter_to_mjpeg()

void* avi_converter_to_mjpeg ( AviMovie movie,
int  stream,
unsigned char *  buffer,
size_t *  size 
)

◆ Compress_JPEG()

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

Definition at line 275 of file avi_mjpeg.c.

References height, jpegmemdestmgr_build(), width, and y.

Referenced by avi_converter_to_mjpeg().

◆ Decode_JPEG()

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

Definition at line 218 of file avi_mjpeg.c.

References height, jpegmemsrcmgr_build(), NULL, numbytes, std_huff_tables(), void, width, and y.

Referenced by avi_converter_from_mjpeg().

◆ deinterlace()

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

Definition at line 356 of file avi_mjpeg.c.

References from, height, and width.

Referenced by avi_converter_to_mjpeg().

◆ interlace()

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

Definition at line 342 of file avi_mjpeg.c.

References from, height, and width.

Referenced by avi_converter_from_mjpeg().

◆ jpegmemdestmgr_build()

static void jpegmemdestmgr_build ( j_compress_ptr  cinfo,
unsigned char *  buffer,
size_t  bufsize 
)
static

◆ jpegmemdestmgr_empty_output_buffer()

static boolean jpegmemdestmgr_empty_output_buffer ( j_compress_ptr  cinfo)
static

Definition at line 478 of file avi_mjpeg.c.

References void.

Referenced by jpegmemdestmgr_build().

◆ jpegmemdestmgr_init_destination()

static void jpegmemdestmgr_init_destination ( j_compress_ptr  cinfo)
static

Definition at line 473 of file avi_mjpeg.c.

References void.

Referenced by jpegmemdestmgr_build().

◆ jpegmemdestmgr_term_destination()

static void jpegmemdestmgr_term_destination ( j_compress_ptr  cinfo)
static

Definition at line 484 of file avi_mjpeg.c.

References MEM_freeN, and numbytes.

Referenced by jpegmemdestmgr_build().

◆ jpegmemsrcmgr_build()

static void jpegmemsrcmgr_build ( j_decompress_ptr  dinfo,
const unsigned char *  buffer,
size_t  bufsize 
)
static

◆ jpegmemsrcmgr_fill_input_buffer()

static boolean jpegmemsrcmgr_fill_input_buffer ( j_decompress_ptr  dinfo)
static

Definition at line 512 of file avi_mjpeg.c.

Referenced by jpegmemsrcmgr_build().

◆ jpegmemsrcmgr_init_source()

static void jpegmemsrcmgr_init_source ( j_decompress_ptr  dinfo)
static

Definition at line 507 of file avi_mjpeg.c.

References void.

Referenced by jpegmemsrcmgr_build().

◆ jpegmemsrcmgr_skip_input_data()

static void jpegmemsrcmgr_skip_input_data ( j_decompress_ptr  dinfo,
long  skip_count 
)
static

Definition at line 528 of file avi_mjpeg.c.

Referenced by jpegmemsrcmgr_build().

◆ jpegmemsrcmgr_term_source()

static void jpegmemsrcmgr_term_source ( j_decompress_ptr  dinfo)
static

Definition at line 538 of file avi_mjpeg.c.

References MEM_freeN, and numbytes.

Referenced by jpegmemsrcmgr_build().

◆ std_huff_tables()

static void std_huff_tables ( j_decompress_ptr  dinfo)
static

Definition at line 53 of file avi_mjpeg.c.

References add_huff_table().

Referenced by Decode_JPEG().

Variable Documentation

◆ numbytes

size_t numbytes
static