FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
proresdec2.c File Reference

Known FOURCCs: 'apch' (HQ), 'apcn' (SD), 'apcs' (LT), 'acpo' (Proxy), 'ap4h' (4444) More...

#include "avcodec.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "internal.h"
#include "simple_idct.h"
#include "proresdec.h"
#include "proresdata.h"

Go to the source code of this file.

Macros

#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, int16_t *out, int blocks_per_slice)
 
static av_always_inline int decode_ac_coeffs (AVCodecContext *avctx, GetBitContext *gb, int16_t *out, int blocks_per_slice)
 
static int decode_slice_luma (AVCodecContext *avctx, SliceContext *slice, uint16_t *dst, int dst_stride, const uint8_t *buf, unsigned buf_size, const int16_t *qmat)
 
static int decode_slice_chroma (AVCodecContext *avctx, SliceContext *slice, uint16_t *dst, int dst_stride, const uint8_t *buf, unsigned buf_size, const int16_t *qmat, int log2_blocks_per_mb)
 
static void unpack_alpha (GetBitContext *gb, uint16_t *dst, int num_coeffs, const int num_bits)
 
static void decode_slice_alpha (ProresContext *ctx, uint16_t *dst, int dst_stride, const uint8_t *buf, int buf_size, int blocks_per_slice)
 Decode alpha slice plane.
 
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 *got_frame, AVPacket *avpkt)
 
static av_cold int decode_close (AVCodecContext *avctx)
 

Variables

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
 

Detailed Description

Known FOURCCs: 'apch' (HQ), 'apcn' (SD), 'apcs' (LT), 'acpo' (Proxy), 'ap4h' (4444)

Definition in file proresdec2.c.

Macro Definition Documentation

#define LONG_BITSTREAM_READER

Definition at line 29 of file proresdec2.c.

#define DECODE_CODEWORD (   val,
  codebook 
)
Value:
do { \
unsigned int rice_order, exp_order, switch_bits; \
unsigned int q, buf, bits; \
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 248 of file proresdec2.c.

Referenced by decode_ac_coeffs(), and decode_dc_coeffs().

#define TOSIGNED (   x)    (((x) >> 1) ^ (-((x) & 1)))

Definition at line 278 of file proresdec2.c.

Referenced by decode_dc_coeffs().

#define FIRST_DC_CB   0xB8

Definition at line 280 of file proresdec2.c.

Referenced by decode_dc_coeffs().

Function Documentation

static void permute ( uint8_t dst,
const uint8_t src,
const uint8_t  permutation[64] 
)
static

Definition at line 39 of file proresdec2.c.

Referenced by decode_frame_header(), and decode_init().

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 46 of file proresdec2.c.

static int decode_frame_header ( ProresContext ctx,
const uint8_t buf,
const int  data_size,
AVCodecContext avctx 
)
static

Definition at line 65 of file proresdec2.c.

Referenced by decode_frame().

static int decode_picture_header ( AVCodecContext avctx,
const uint8_t buf,
const int  buf_size 
)
static

Definition at line 147 of file proresdec2.c.

Referenced by decode_frame().

static av_always_inline void decode_dc_coeffs ( GetBitContext gb,
int16_t *  out,
int  blocks_per_slice 
)
static

Definition at line 284 of file proresdec2.c.

Referenced by decode_slice_chroma(), and decode_slice_luma().

static av_always_inline int decode_ac_coeffs ( AVCodecContext avctx,
GetBitContext gb,
int16_t *  out,
int  blocks_per_slice 
)
static

Definition at line 314 of file proresdec2.c.

Referenced by decode_slice_chroma(), and decode_slice_luma().

static int decode_slice_luma ( AVCodecContext avctx,
SliceContext slice,
uint16_t *  dst,
int  dst_stride,
const uint8_t buf,
unsigned  buf_size,
const int16_t *  qmat 
)
static

Definition at line 357 of file proresdec2.c.

Referenced by decode_slice_thread().

static int decode_slice_chroma ( AVCodecContext avctx,
SliceContext slice,
uint16_t *  dst,
int  dst_stride,
const uint8_t buf,
unsigned  buf_size,
const int16_t *  qmat,
int  log2_blocks_per_mb 
)
static

Definition at line 390 of file proresdec2.c.

Referenced by decode_slice_thread().

static void unpack_alpha ( GetBitContext gb,
uint16_t *  dst,
int  num_coeffs,
const int  num_bits 
)
static

Definition at line 423 of file proresdec2.c.

Referenced by decode_slice_alpha().

static void decode_slice_alpha ( ProresContext ctx,
uint16_t *  dst,
int  dst_stride,
const uint8_t buf,
int  buf_size,
int  blocks_per_slice 
)
static

Decode alpha slice plane.

Definition at line 471 of file proresdec2.c.

Referenced by decode_slice_thread().

static int decode_slice_thread ( AVCodecContext avctx,
void arg,
int  jobnr,
int  threadnr 
)
static

Definition at line 500 of file proresdec2.c.

Referenced by decode_picture().

static int decode_picture ( AVCodecContext avctx)
static

Definition at line 599 of file proresdec2.c.

Referenced by decode_frame().

static int decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 613 of file proresdec2.c.

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 670 of file proresdec2.c.

Variable Documentation

const uint8_t dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70}
static

Definition at line 282 of file proresdec2.c.

Referenced by decode_dc_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 311 of file proresdec2.c.

Referenced by decode_ac_coeffs().

const uint8_t lev_to_cb[10] = { 0x04, 0x0A, 0x05, 0x06, 0x04, 0x28, 0x28, 0x28, 0x28, 0x4C }
static

Definition at line 312 of file proresdec2.c.

Referenced by decode_ac_coeffs().

AVCodec ff_prores_decoder
Initial value:
= {
.name = "prores",
.long_name = NULL_IF_CONFIG_SMALL("ProRes"),
.priv_data_size = sizeof(ProresContext),
}

Definition at line 679 of file proresdec2.c.