#include "avcodec.h"
#include "get_bits.h"
#include "simple_idct.h"
#include "proresdec.h"
Go to the source code of this file.
Defines | |
#define | LONG_BITSTREAM_READER |
#define | DECODE_CODEWORD(val, codebook) |
#define | TOSIGNED(x) (((x) >> 1) ^ (-((x) & 1))) |
#define | FIRST_DC_CB 0xB8 |
Functions | |
static void | permute (uint8_t *dst, const uint8_t *src, const uint8_t permutation[64]) |
static av_cold int | decode_init (AVCodecContext *avctx) |
static int | decode_frame_header (ProresContext *ctx, const uint8_t *buf, const int data_size, AVCodecContext *avctx) |
static int | decode_picture_header (AVCodecContext *avctx, const uint8_t *buf, const int buf_size) |
static av_always_inline void | decode_dc_coeffs (GetBitContext *gb, DCTELEM *out, int blocks_per_slice) |
static av_always_inline void | decode_ac_coeffs (AVCodecContext *avctx, GetBitContext *gb, DCTELEM *out, int blocks_per_slice) |
static void | decode_slice_luma (AVCodecContext *avctx, SliceContext *slice, uint8_t *dst, int dst_stride, const uint8_t *buf, unsigned buf_size, const int16_t *qmat) |
static void | decode_slice_chroma (AVCodecContext *avctx, SliceContext *slice, uint8_t *dst, int dst_stride, const uint8_t *buf, unsigned buf_size, const int16_t *qmat, int log2_blocks_per_mb) |
static int | decode_slice_thread (AVCodecContext *avctx, void *arg, int jobnr, int threadnr) |
static int | decode_picture (AVCodecContext *avctx) |
static int | decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
static av_cold int | decode_close (AVCodecContext *avctx) |
Variables | |
static const uint8_t | progressive_scan [64] |
static const uint8_t | interlaced_scan [64] |
static const uint8_t | dc_codebook [7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70} |
static const uint8_t | run_to_cb [16] = { 0x06, 0x06, 0x05, 0x05, 0x04, 0x29, 0x29, 0x29, 0x29, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x4C } |
static const uint8_t | lev_to_cb [10] = { 0x04, 0x0A, 0x05, 0x06, 0x04, 0x28, 0x28, 0x28, 0x28, 0x4C } |
AVCodec | ff_prores_decoder |
Definition in file proresdec2.c.
#define DECODE_CODEWORD | ( | val, | |||
codebook | ) |
Value:
do { \ unsigned int rice_order, exp_order, switch_bits; \ unsigned int q, buf, bits; \ \ UPDATE_CACHE(re, gb); \ buf = GET_CACHE(re, gb); \ \ /* number of bits to switch between rice and exp golomb */ \ switch_bits = codebook & 3; \ rice_order = codebook >> 5; \ exp_order = (codebook >> 2) & 7; \ \ q = 31 - av_log2(buf); \ \ if (q > switch_bits) { /* exp golomb */ \ bits = exp_order - switch_bits + (q<<1); \ val = SHOW_UBITS(re, gb, bits) - (1 << exp_order) + \ ((switch_bits + 1) << rice_order); \ SKIP_BITS(re, gb, bits); \ } else if (rice_order) { \ SKIP_BITS(re, gb, q+1); \ val = (q << rice_order) + SHOW_UBITS(re, gb, rice_order); \ SKIP_BITS(re, gb, rice_order); \ } else { \ val = q; \ SKIP_BITS(re, gb, q+1); \ } \ } while (0)
Definition at line 252 of file proresdec2.c.
Referenced by decode_ac_coeffs(), and decode_dc_coeffs().
#define FIRST_DC_CB 0xB8 |
Definition at line 284 of file proresdec2.c.
Referenced by decode_dc_coeffs(), and encode_dc_coeffs().
#define LONG_BITSTREAM_READER |
Definition at line 29 of file proresdec2.c.
#define TOSIGNED | ( | x | ) | (((x) >> 1) ^ (-((x) & 1))) |
static av_always_inline void decode_ac_coeffs | ( | AVCodecContext * | avctx, | |
GetBitContext * | gb, | |||
DCTELEM * | out, | |||
int | blocks_per_slice | |||
) | [static] |
Definition at line 318 of file proresdec2.c.
Referenced by decode_slice_chroma(), decode_slice_luma(), and decode_slice_plane().
static av_cold int decode_close | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 572 of file proresdec2.c.
static av_always_inline void decode_dc_coeffs | ( | GetBitContext * | gb, | |
DCTELEM * | out, | |||
int | blocks_per_slice | |||
) | [static] |
Definition at line 288 of file proresdec2.c.
Referenced by decode_slice_chroma(), decode_slice_luma(), and decode_slice_plane().
static int decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
AVPacket * | avpkt | |||
) | [static] |
Definition at line 514 of file proresdec2.c.
static int decode_frame_header | ( | ProresContext * | ctx, | |
const uint8_t * | buf, | |||
const int | data_size, | |||
AVCodecContext * | avctx | |||
) | [static] |
static av_cold int decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 65 of file proresdec2.c.
static int decode_picture | ( | AVCodecContext * | avctx | ) | [static] |
static int decode_picture_header | ( | AVCodecContext * | avctx, | |
const uint8_t * | buf, | |||
const int | buf_size | |||
) | [static] |
static void decode_slice_chroma | ( | AVCodecContext * | avctx, | |
SliceContext * | slice, | |||
uint8_t * | dst, | |||
int | dst_stride, | |||
const uint8_t * | buf, | |||
unsigned | buf_size, | |||
const int16_t * | qmat, | |||
int | log2_blocks_per_mb | |||
) | [static] |
static void decode_slice_luma | ( | AVCodecContext * | avctx, | |
SliceContext * | slice, | |||
uint8_t * | dst, | |||
int | dst_stride, | |||
const uint8_t * | buf, | |||
unsigned | buf_size, | |||
const int16_t * | qmat | |||
) | [static] |
static int decode_slice_thread | ( | AVCodecContext * | avctx, | |
void * | arg, | |||
int | jobnr, | |||
int | threadnr | |||
) | [static] |
static void permute | ( | uint8_t * | dst, | |
const uint8_t * | src, | |||
const uint8_t | permutation[64] | |||
) | [static] |
Definition at line 36 of file proresdec2.c.
const uint8_t dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70} [static] |
Definition at line 286 of file proresdec2.c.
Referenced by decode_dc_coeffs(), and encode_dc_coeffs().
Initial value:
{ .name = "prores", .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_PRORES, .priv_data_size = sizeof(ProresContext), .init = decode_init, .close = decode_close, .decode = decode_frame, .long_name = NULL_IF_CONFIG_SMALL("ProRes"), .capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS, }
Definition at line 584 of file proresdec2.c.
const uint8_t interlaced_scan[64] [static] |
Initial value:
{ 0, 8, 1, 9, 16, 24, 17, 25, 2, 10, 3, 11, 18, 26, 19, 27, 32, 40, 33, 34, 41, 48, 56, 49, 42, 35, 43, 50, 57, 58, 51, 59, 4, 12, 5, 6, 13, 20, 28, 21, 14, 7, 15, 22, 29, 36, 44, 37, 30, 23, 31, 38, 45, 52, 60, 53, 46, 39, 47, 54, 61, 62, 55, 63, }
Definition at line 54 of file proresdec2.c.
Referenced by decode_frame_header(), and decode_init().
const uint8_t lev_to_cb[10] = { 0x04, 0x0A, 0x05, 0x06, 0x04, 0x28, 0x28, 0x28, 0x28, 0x4C } [static] |
Definition at line 316 of file proresdec2.c.
Referenced by decode_ac_coeffs(), and encode_ac_coeffs().
const uint8_t progressive_scan[64] [static] |
Initial value:
{ 0, 1, 8, 9, 2, 3, 10, 11, 16, 17, 24, 25, 18, 19, 26, 27, 4, 5, 12, 20, 13, 6, 7, 14, 21, 28, 29, 22, 15, 23, 30, 31, 32, 33, 40, 48, 41, 34, 35, 42, 49, 56, 57, 50, 43, 36, 37, 44, 51, 58, 59, 52, 45, 38, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 }
Definition at line 43 of file proresdec2.c.
Referenced by decode_frame_header(), decode_init(), and encode_ac_coeffs().
const uint8_t run_to_cb[16] = { 0x06, 0x06, 0x05, 0x05, 0x04, 0x29, 0x29, 0x29, 0x29, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x4C } [static] |
Definition at line 315 of file proresdec2.c.
Referenced by decode_ac_coeffs(), and encode_ac_coeffs().