libavcodec/proresdec_lgpl.c File Reference

This is a decoder for Apple ProRes 422 SD/HQ/LT/Proxy and ProRes 4444. More...

#include <stdint.h>
#include "libavutil/intmath.h"
#include "avcodec.h"
#include "proresdsp.h"
#include "get_bits.h"

Go to the source code of this file.

Data Structures

struct  ProresThreadData
struct  ProresContext

Defines

#define LONG_BITSTREAM_READER
#define LSB2SIGN(x)   (-((x) & 1))
#define TOSIGNED(x)   (((x) >> 1) ^ LSB2SIGN(x))
#define FIRST_DC_CB   0xB8
#define FRAME_ID   MKBETAG('i', 'c', 'p', 'f')
#define MOVE_DATA_PTR(nbytes)   buf += (nbytes); buf_size -= (nbytes)

Functions

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 (ProresContext *ctx, const uint8_t *buf, const int data_size, AVCodecContext *avctx)
static int decode_vlc_codeword (GetBitContext *gb, uint8_t codebook)
 Read an unsigned rice/exp golomb codeword.
static void decode_dc_coeffs (GetBitContext *gb, DCTELEM *out, int nblocks)
 Decode DC coefficients for all blocks in a slice.
static void decode_ac_coeffs (GetBitContext *gb, DCTELEM *out, int blocks_per_slice, int plane_size_factor, const uint8_t *scan)
 Decode AC coefficients for all blocks in a slice.
static void decode_slice_plane (ProresContext *ctx, ProresThreadData *td, const uint8_t *buf, int data_size, uint16_t *out_ptr, int linesize, int mbs_per_slice, int blocks_per_mb, int plane_size_factor, const int16_t *qmat)
 Decode a slice plane (luma or chroma).
static int decode_slice (AVCodecContext *avctx, void *tdata)
static int decode_picture (ProresContext *ctx, int pic_num, 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 uint8_t dc_codebook [4]
static uint8_t ac_codebook [7]
static uint8_t run_to_cb_index [16]
 Lookup tables for adaptive switching between codebooks according with previous run/level value.
static uint8_t lev_to_cb_index [10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 }
AVCodec ff_prores_lgpl_decoder


Detailed Description

This is a decoder for Apple ProRes 422 SD/HQ/LT/Proxy and ProRes 4444.

It is used for storing and editing high definition video data in Apple's Final Cut Pro.

See also:
http://wiki.multimedia.cx/index.php?title=Apple_ProRes

Definition in file proresdec_lgpl.c.


Define Documentation

#define FIRST_DC_CB   0xB8

Definition at line 354 of file proresdec_lgpl.c.

#define FRAME_ID   MKBETAG('i', 'c', 'p', 'f')

Definition at line 631 of file proresdec_lgpl.c.

Referenced by decode_frame().

#define LONG_BITSTREAM_READER

Definition at line 31 of file proresdec_lgpl.c.

#define LSB2SIGN (  )     (-((x) & 1))

Definition at line 351 of file proresdec_lgpl.c.

#define MOVE_DATA_PTR ( nbytes   )     buf += (nbytes); buf_size -= (nbytes)

Definition at line 632 of file proresdec_lgpl.c.

Referenced by decode_frame().

#define TOSIGNED (  )     (((x) >> 1) ^ LSB2SIGN(x))

Definition at line 352 of file proresdec_lgpl.c.


Function Documentation

static void decode_ac_coeffs ( GetBitContext gb,
DCTELEM out,
int  blocks_per_slice,
int  plane_size_factor,
const uint8_t *  scan 
) [inline, static]

Decode AC coefficients for all blocks in a slice.

Definition at line 415 of file proresdec_lgpl.c.

static av_cold int decode_close ( AVCodecContext avctx  )  [static]

Definition at line 683 of file proresdec_lgpl.c.

static void decode_dc_coeffs ( GetBitContext gb,
DCTELEM out,
int  nblocks 
) [inline, static]

Decode DC coefficients for all blocks in a slice.

Definition at line 367 of file proresdec_lgpl.c.

static int decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
AVPacket avpkt 
) [static]

Definition at line 634 of file proresdec_lgpl.c.

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

Definition at line 125 of file proresdec_lgpl.c.

static av_cold int decode_init ( AVCodecContext avctx  )  [static]

Definition at line 101 of file proresdec_lgpl.c.

static int decode_picture ( ProresContext ctx,
int  pic_num,
AVCodecContext avctx 
) [static]

Definition at line 600 of file proresdec_lgpl.c.

static int decode_picture_header ( ProresContext ctx,
const uint8_t *  buf,
const int  data_size,
AVCodecContext avctx 
) [static]

Definition at line 231 of file proresdec_lgpl.c.

static int decode_slice ( AVCodecContext avctx,
void *  tdata 
) [static]

Definition at line 502 of file proresdec_lgpl.c.

static void decode_slice_plane ( ProresContext ctx,
ProresThreadData td,
const uint8_t *  buf,
int  data_size,
uint16_t *  out_ptr,
int  linesize,
int  mbs_per_slice,
int  blocks_per_mb,
int  plane_size_factor,
const int16_t qmat 
) [static]

Decode a slice plane (luma or chroma).

Definition at line 460 of file proresdec_lgpl.c.

Referenced by decode_slice().

static int decode_vlc_codeword ( GetBitContext gb,
uint8_t  codebook 
) [inline, static]

Read an unsigned rice/exp golomb codeword.

Definition at line 313 of file proresdec_lgpl.c.

Referenced by decode_ac_coeffs(), and decode_dc_coeffs().


Variable Documentation

uint8_t ac_codebook[7] [static]

Initial value:

 {
    0x04, 
    0x28, 
    0x4C, 
    0x05, 
    0x29, 
    0x06, 
    0x0A, 
}

Definition at line 392 of file proresdec_lgpl.c.

Referenced by decode_ac_coeffs().

uint8_t dc_codebook[4] [static]

Initial value:

 {
    0x04, 
    0x28, 
    0x4D, 
    0x70  
}

Definition at line 356 of file proresdec_lgpl.c.

Initial value:

 {
    .name           = "prores_lgpl",
    .type           = AVMEDIA_TYPE_VIDEO,
    .id             = CODEC_ID_PRORES,
    .priv_data_size = sizeof(ProresContext),
    .init           = decode_init,
    .close          = decode_close,
    .decode         = decode_frame,
    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
    .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)")
}

Definition at line 696 of file proresdec_lgpl.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 89 of file proresdec_lgpl.c.

uint8_t lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 } [static]

Definition at line 409 of file proresdec_lgpl.c.

Referenced by decode_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 78 of file proresdec_lgpl.c.

uint8_t run_to_cb_index[16] [static]

Initial value:

    { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 }
Lookup tables for adaptive switching between codebooks according with previous run/level value.

Definition at line 406 of file proresdec_lgpl.c.

Referenced by decode_ac_coeffs().


Generated on Fri Oct 26 02:46:09 2012 for FFmpeg by  doxygen 1.5.8