FFmpeg
Enumerations | Functions
mjpegenc_common.c File Reference
#include <stdint.h>
#include <string.h>
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "idctdsp.h"
#include "jpegtables.h"
#include "put_bits.h"
#include "mjpegenc.h"
#include "mjpegenc_common.h"
#include "mjpeg.h"
#include "version.h"

Go to the source code of this file.

Enumerations

enum  { ICC_HDR_SIZE = 16, ICC_CHUNK_SIZE = UINT16_MAX - ICC_HDR_SIZE, ICC_MAX_CHUNKS = UINT8_MAX }
 

Functions

static int put_huffman_table (PutBitContext *p, int table_class, int table_id, const uint8_t *bits_table, const uint8_t *value_table)
 
static void jpeg_table_header (AVCodecContext *avctx, PutBitContext *p, MJpegContext *m, const uint8_t intra_matrix_permutation[64], uint16_t luma_intra_matrix[64], uint16_t chroma_intra_matrix[64], int hsample[3], int use_slices, int matrices_differ)
 
int ff_mjpeg_add_icc_profile_size (AVCodecContext *avctx, const AVFrame *frame, size_t *max_pkt_size)
 
static void jpeg_put_comments (AVCodecContext *avctx, PutBitContext *p, const AVFrame *frame)
 
void ff_mjpeg_init_hvsample (AVCodecContext *avctx, int hsample[4], int vsample[4])
 
void ff_mjpeg_encode_picture_header (AVCodecContext *avctx, PutBitContext *pb, const AVFrame *frame, struct MJpegContext *m, const uint8_t intra_matrix_permutation[64], int pred, uint16_t luma_intra_matrix[64], uint16_t chroma_intra_matrix[64], int use_slices)
 
void ff_mjpeg_escape_FF (PutBitContext *pb, int start)
 
void ff_mjpeg_build_huffman_codes (uint8_t *huff_size, uint16_t *huff_code, const uint8_t *bits_table, const uint8_t *val_table)
 
void ff_mjpeg_encode_picture_trailer (PutBitContext *pb, int header_bits)
 
void ff_mjpeg_encode_dc (PutBitContext *pb, int val, uint8_t *huff_size, uint16_t *huff_code)
 
int ff_mjpeg_encode_check_pix_fmt (AVCodecContext *avctx)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ICC_HDR_SIZE 
ICC_CHUNK_SIZE 
ICC_MAX_CHUNKS 

Definition at line 131 of file mjpegenc_common.c.

Function Documentation

◆ put_huffman_table()

static int put_huffman_table ( PutBitContext p,
int  table_class,
int  table_id,
const uint8_t *  bits_table,
const uint8_t *  value_table 
)
static

Definition at line 39 of file mjpegenc_common.c.

Referenced by jpeg_table_header().

◆ jpeg_table_header()

static void jpeg_table_header ( AVCodecContext avctx,
PutBitContext p,
MJpegContext m,
const uint8_t  intra_matrix_permutation[64],
uint16_t  luma_intra_matrix[64],
uint16_t  chroma_intra_matrix[64],
int  hsample[3],
int  use_slices,
int  matrices_differ 
)
static

Definition at line 58 of file mjpegenc_common.c.

Referenced by ff_mjpeg_encode_picture_header().

◆ ff_mjpeg_add_icc_profile_size()

int ff_mjpeg_add_icc_profile_size ( AVCodecContext avctx,
const AVFrame frame,
size_t *  max_pkt_size 
)

Definition at line 137 of file mjpegenc_common.c.

Referenced by ff_mpv_encode_picture(), and ljpeg_encode_frame().

◆ jpeg_put_comments()

static void jpeg_put_comments ( AVCodecContext avctx,
PutBitContext p,
const AVFrame frame 
)
static

Definition at line 162 of file mjpegenc_common.c.

Referenced by ff_mjpeg_encode_picture_header().

◆ ff_mjpeg_init_hvsample()

void ff_mjpeg_init_hvsample ( AVCodecContext avctx,
int  hsample[4],
int  vsample[4] 
)

Definition at line 249 of file mjpegenc_common.c.

Referenced by ff_mjpeg_encode_picture_header(), and ljpeg_encode_init().

◆ ff_mjpeg_encode_picture_header()

void ff_mjpeg_encode_picture_header ( AVCodecContext avctx,
PutBitContext pb,
const AVFrame frame,
struct MJpegContext m,
const uint8_t  intra_matrix_permutation[64],
int  pred,
uint16_t  luma_intra_matrix[64],
uint16_t  chroma_intra_matrix[64],
int  use_slices 
)

Definition at line 275 of file mjpegenc_common.c.

Referenced by ljpeg_encode_frame(), and mjpeg_encode_picture_header().

◆ ff_mjpeg_escape_FF()

void ff_mjpeg_escape_FF ( PutBitContext pb,
int  start 
)

Definition at line 384 of file mjpegenc_common.c.

Referenced by ff_mjpeg_encode_stuffing(), and ljpeg_encode_frame().

◆ ff_mjpeg_build_huffman_codes()

void ff_mjpeg_build_huffman_codes ( uint8_t *  huff_size,
uint16_t *  huff_code,
const uint8_t *  bits_table,
const uint8_t *  val_table 
)

Definition at line 440 of file mjpegenc_common.c.

Referenced by ff_mjpeg_encode_init(), and ljpeg_encode_init().

◆ ff_mjpeg_encode_picture_trailer()

void ff_mjpeg_encode_picture_trailer ( PutBitContext pb,
int  header_bits 
)

Definition at line 460 of file mjpegenc_common.c.

Referenced by ff_mpv_encode_picture(), and ljpeg_encode_frame().

◆ ff_mjpeg_encode_dc()

void ff_mjpeg_encode_dc ( PutBitContext pb,
int  val,
uint8_t *  huff_size,
uint16_t *  huff_code 
)

Definition at line 467 of file mjpegenc_common.c.

Referenced by encode_block(), ljpeg_encode_bgr(), and ljpeg_encode_yuv_mb().

◆ ff_mjpeg_encode_check_pix_fmt()

int ff_mjpeg_encode_check_pix_fmt ( AVCodecContext avctx)

Definition at line 489 of file mjpegenc_common.c.

Referenced by ff_mjpeg_encode_init(), and ljpeg_encode_init().