#include <assert.h>
#include "avcodec.h"
#include "dsputil.h"
#include "mjpeg.h"
#include "mjpegdec.h"
#include "jpeglsdec.h"
Go to the source code of this file.
Defines | |
#define | REFINE_BIT(j) |
#define | ZERO_RUN |
Functions | |
static int | build_vlc (VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table, int nb_codes, int use_static, int is_ac) |
static void | build_basic_mjpeg_vlc (MJpegDecodeContext *s) |
av_cold int | ff_mjpeg_decode_init (AVCodecContext *avctx) |
int | ff_mjpeg_decode_dqt (MJpegDecodeContext *s) |
int | ff_mjpeg_decode_dht (MJpegDecodeContext *s) |
int | ff_mjpeg_decode_sof (MJpegDecodeContext *s) |
static int | mjpeg_decode_dc (MJpegDecodeContext *s, int dc_index) |
static int | decode_block (MJpegDecodeContext *s, DCTELEM *block, int component, int dc_index, int ac_index, int16_t *quant_matrix) |
static int | decode_dc_progressive (MJpegDecodeContext *s, DCTELEM *block, int component, int dc_index, int16_t *quant_matrix, int Al) |
static int | decode_block_progressive (MJpegDecodeContext *s, DCTELEM *block, uint8_t *last_nnz, int ac_index, int16_t *quant_matrix, int ss, int se, int Al, int *EOBRUN) |
static int | decode_block_refinement (MJpegDecodeContext *s, DCTELEM *block, uint8_t *last_nnz, int ac_index, int16_t *quant_matrix, int ss, int se, int Al, int *EOBRUN) |
static int | ljpeg_decode_rgb_scan (MJpegDecodeContext *s, int predictor, int point_transform) |
static int | ljpeg_decode_yuv_scan (MJpegDecodeContext *s, int predictor, int point_transform) |
static int | mjpeg_decode_scan (MJpegDecodeContext *s, int nb_components, int Ah, int Al) |
static int | mjpeg_decode_scan_progressive_ac (MJpegDecodeContext *s, int ss, int se, int Ah, int Al) |
int | ff_mjpeg_decode_sos (MJpegDecodeContext *s) |
static int | mjpeg_decode_dri (MJpegDecodeContext *s) |
static int | mjpeg_decode_app (MJpegDecodeContext *s) |
static int | mjpeg_decode_com (MJpegDecodeContext *s) |
static int | find_marker (const uint8_t **pbuf_ptr, const uint8_t *buf_end) |
int | ff_mjpeg_decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
av_cold int | ff_mjpeg_decode_end (AVCodecContext *avctx) |
Variables | |
AVCodec | mjpeg_decoder |
AVCodec | thp_decoder |
Definition in file mjpegdec.c.
#define REFINE_BIT | ( | j | ) |
Value:
{\ UPDATE_CACHE(re, &s->gb);\ sign = block[j]>>15;\ block[j] += SHOW_UBITS(re, &s->gb, 1) * ((quant_matrix[j]^sign)-sign) << Al;\ LAST_SKIP_BITS(re, &s->gb, 1);\ }
Definition at line 528 of file mjpegdec.c.
Referenced by decode_block_refinement().
#define ZERO_RUN |
Value:
for(;;i++) {\ if(i > last) {\ i += run;\ if(i > se) {\ av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i);\ return -1;\ }\ break;\ }\ j = s->scantable.permutated[i];\ if(block[j])\ REFINE_BIT(j)\ else if(run-- == 0)\ break;\ }
Definition at line 535 of file mjpegdec.c.
Referenced by decode_block_refinement().
static void build_basic_mjpeg_vlc | ( | MJpegDecodeContext * | s | ) | [static] |
static int build_vlc | ( | VLC * | vlc, | |
const uint8_t * | bits_table, | |||
const uint8_t * | val_table, | |||
int | nb_codes, | |||
int | use_static, | |||
int | is_ac | |||
) | [static] |
Definition at line 43 of file mjpegdec.c.
Referenced by build_basic_mjpeg_vlc(), and ff_mjpeg_decode_dht().
static int decode_block | ( | MJpegDecodeContext * | s, | |
DCTELEM * | block, | |||
int | component, | |||
int | dc_index, | |||
int | ac_index, | |||
int16_t * | quant_matrix | |||
) | [static] |
Definition at line 392 of file mjpegdec.c.
static int decode_block_progressive | ( | MJpegDecodeContext * | s, | |
DCTELEM * | block, | |||
uint8_t * | last_nnz, | |||
int | ac_index, | |||
int16_t * | quant_matrix, | |||
int | ss, | |||
int | se, | |||
int | Al, | |||
int * | EOBRUN | |||
) | [static] |
static int decode_block_refinement | ( | MJpegDecodeContext * | s, | |
DCTELEM * | block, | |||
uint8_t * | last_nnz, | |||
int | ac_index, | |||
int16_t * | quant_matrix, | |||
int | ss, | |||
int | se, | |||
int | Al, | |||
int * | EOBRUN | |||
) | [static] |
static int decode_dc_progressive | ( | MJpegDecodeContext * | s, | |
DCTELEM * | block, | |||
int | component, | |||
int | dc_index, | |||
int16_t * | quant_matrix, | |||
int | Al | |||
) | [static] |
int ff_mjpeg_decode_dht | ( | MJpegDecodeContext * | s | ) |
Definition at line 151 of file mjpegdec.c.
Referenced by ff_mjpeg_decode_frame(), ff_mjpeg_decode_init(), and mjpegb_decode_frame().
int ff_mjpeg_decode_dqt | ( | MJpegDecodeContext * | s | ) |
Definition at line 116 of file mjpegdec.c.
Referenced by ff_mjpeg_decode_frame(), and mjpegb_decode_frame().
av_cold int ff_mjpeg_decode_end | ( | AVCodecContext * | avctx | ) |
Definition at line 1517 of file mjpegdec.c.
int ff_mjpeg_decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
AVPacket * | avpkt | |||
) |
av_cold int ff_mjpeg_decode_init | ( | AVCodecContext * | avctx | ) |
Definition at line 76 of file mjpegdec.c.
int ff_mjpeg_decode_sof | ( | MJpegDecodeContext * | s | ) |
Definition at line 197 of file mjpegdec.c.
Referenced by ff_mjpeg_decode_frame(), and mjpegb_decode_frame().
int ff_mjpeg_decode_sos | ( | MJpegDecodeContext * | s | ) |
Definition at line 899 of file mjpegdec.c.
Referenced by ff_mjpeg_decode_frame(), and mjpegb_decode_frame().
static int find_marker | ( | const uint8_t ** | pbuf_ptr, | |
const uint8_t * | buf_end | |||
) | [static] |
static int ljpeg_decode_rgb_scan | ( | MJpegDecodeContext * | s, | |
int | predictor, | |||
int | point_transform | |||
) | [static] |
static int ljpeg_decode_yuv_scan | ( | MJpegDecodeContext * | s, | |
int | predictor, | |||
int | point_transform | |||
) | [static] |
static int mjpeg_decode_app | ( | MJpegDecodeContext * | s | ) | [static] |
static int mjpeg_decode_com | ( | MJpegDecodeContext * | s | ) | [static] |
static int mjpeg_decode_dc | ( | MJpegDecodeContext * | s, | |
int | dc_index | |||
) | [inline, static] |
Definition at line 374 of file mjpegdec.c.
Referenced by decode_block(), decode_dc_progressive(), ljpeg_decode_rgb_scan(), and ljpeg_decode_yuv_scan().
static int mjpeg_decode_dri | ( | MJpegDecodeContext * | s | ) | [static] |
static int mjpeg_decode_scan | ( | MJpegDecodeContext * | s, | |
int | nb_components, | |||
int | Ah, | |||
int | Al | |||
) | [static] |
Definition at line 769 of file mjpegdec.c.
Referenced by ff_mjpeg_decode_sos(), and sp5x_decode_frame().
static int mjpeg_decode_scan_progressive_ac | ( | MJpegDecodeContext * | s, | |
int | ss, | |||
int | se, | |||
int | Ah, | |||
int | Al | |||
) | [static] |
Initial value:
{ "mjpeg", AVMEDIA_TYPE_VIDEO, CODEC_ID_MJPEG, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, NULL, ff_mjpeg_decode_end, ff_mjpeg_decode_frame, CODEC_CAP_DR1, NULL, .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), }
Definition at line 1541 of file mjpegdec.c.
Initial value:
{ "thp", AVMEDIA_TYPE_VIDEO, CODEC_ID_THP, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, NULL, ff_mjpeg_decode_end, ff_mjpeg_decode_frame, CODEC_CAP_DR1, NULL, .long_name = NULL_IF_CONFIG_SMALL("Nintendo Gamecube THP video"), }
Definition at line 1555 of file mjpegdec.c.