libavcodec/proresenc.c File Reference

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

#include "avcodec.h"
#include "put_bits.h"
#include "bytestream.h"
#include "dsputil.h"

Go to the source code of this file.

Data Structures

struct  ProresContext

Defines

#define DEFAULT_SLICE_MB_WIDTH   8
#define FF_PROFILE_PRORES_PROXY   0
#define FF_PROFILE_PRORES_LT   1
#define FF_PROFILE_PRORES_STANDARD   2
#define FF_PROFILE_PRORES_HQ   3
#define QSCALE(qmat, ind, val)   ((val) / (qmat[ind]))
#define TO_GOLOMB(val)   ((val << 1) ^ (val >> 31))
#define DIFF_SIGN(val, sign)   ((val >> 31) ^ sign)
#define IS_NEGATIVE(val)   (((val >> 31) ^ -1) + 1)
#define TO_GOLOMB2(val, sign)   (val==0 ? 0 : (val << 1) + sign)
#define FIRST_DC_CB   0xB8

Functions

static void encode_codeword (PutBitContext *pb, int val, int codebook)
static av_always_inline int get_level (int val)
static void encode_dc_coeffs (PutBitContext *pb, DCTELEM *in, int blocks_per_slice, int *qmat)
static void encode_ac_coeffs (AVCodecContext *avctx, PutBitContext *pb, DCTELEM *in, int blocks_per_slice, int *qmat)
static void get (uint8_t *pixels, int stride, DCTELEM *block)
static void fdct_get (uint8_t *pixels, int stride, DCTELEM *block)
static int encode_slice_plane (AVCodecContext *avctx, int mb_count, uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size, int *qmat, int chroma)
static av_always_inline unsigned encode_slice_data (AVCodecContext *avctx, uint8_t *dest_y, uint8_t *dest_u, uint8_t *dest_v, int luma_stride, int chroma_stride, unsigned mb_count, uint8_t *buf, unsigned data_size, unsigned *y_data_size, unsigned *u_data_size, unsigned *v_data_size, int qp)
static void subimage_with_fill (uint16_t *src, unsigned x, unsigned y, unsigned stride, unsigned width, unsigned height, uint16_t *dst, unsigned dst_width, unsigned dst_height)
static int encode_slice (AVCodecContext *avctx, AVFrame *pic, int mb_x, int mb_y, unsigned mb_count, uint8_t *buf, unsigned data_size, int unsafe, int *qp)
static int prores_encode_picture (AVCodecContext *avctx, AVFrame *pic, uint8_t *buf, const int buf_size)
static int prores_encode_frame (AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
static void scale_mat (const uint8_t *src, int *dst, int scale)
static av_cold int prores_encode_init (AVCodecContext *avctx)
static av_cold int prores_encode_close (AVCodecContext *avctx)

Variables

static const AVProfile profiles []
static const int qp_start_table [4] = { 4, 1, 1, 1 }
static const int qp_end_table [4] = { 8, 9, 6, 6 }
static const int bitrate_table [5] = { 1000, 2100, 3500, 5400 }
static const uint8_t progressive_scan [64]
static const uint8_t QMAT_LUMA [4][64]
static const uint8_t QMAT_CHROMA [4][64]
static const uint8_t dc_codebook [7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70}
static const uint8_t run_to_cb [16]
static const uint8_t lev_to_cb [10]
AVCodec ff_prores_encoder


Detailed Description

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

Definition in file proresenc.c.


Define Documentation

#define DEFAULT_SLICE_MB_WIDTH   8

Definition at line 33 of file proresenc.c.

Referenced by encode_slice_plane(), prores_encode_init(), and prores_encode_picture().

#define DIFF_SIGN ( val,
sign   )     ((val >> 31) ^ sign)

Definition at line 186 of file proresenc.c.

Referenced by encode_dc_coeffs().

#define FF_PROFILE_PRORES_HQ   3

Definition at line 38 of file proresenc.c.

Referenced by prores_encode_init().

#define FF_PROFILE_PRORES_LT   1

Definition at line 36 of file proresenc.c.

#define FF_PROFILE_PRORES_PROXY   0

Definition at line 35 of file proresenc.c.

Referenced by prores_encode_init().

#define FF_PROFILE_PRORES_STANDARD   2

Definition at line 37 of file proresenc.c.

Referenced by prores_encode_init().

#define FIRST_DC_CB   0xB8

Definition at line 196 of file proresenc.c.

#define IS_NEGATIVE ( val   )     (((val >> 31) ^ -1) + 1)

Definition at line 187 of file proresenc.c.

Referenced by encode_ac_coeffs().

#define QSCALE ( qmat,
ind,
val   )     ((val) / (qmat[ind]))

Definition at line 184 of file proresenc.c.

Referenced by encode_ac_coeffs(), and encode_dc_coeffs().

#define TO_GOLOMB ( val   )     ((val << 1) ^ (val >> 31))

Definition at line 185 of file proresenc.c.

Referenced by encode_dc_coeffs().

#define TO_GOLOMB2 ( val,
sign   )     (val==0 ? 0 : (val << 1) + sign)

Definition at line 188 of file proresenc.c.

Referenced by encode_dc_coeffs().


Function Documentation

static void encode_ac_coeffs ( AVCodecContext avctx,
PutBitContext pb,
DCTELEM in,
int  blocks_per_slice,
int *  qmat 
) [static]

Definition at line 231 of file proresenc.c.

Referenced by encode_slice_plane().

static void encode_codeword ( PutBitContext pb,
int  val,
int  codebook 
) [static]

Definition at line 153 of file proresenc.c.

Referenced by encode_ac_coeffs(), and encode_dc_coeffs().

static void encode_dc_coeffs ( PutBitContext pb,
DCTELEM in,
int  blocks_per_slice,
int *  qmat 
) [static]

Definition at line 200 of file proresenc.c.

Referenced by encode_slice_plane().

static int encode_slice ( AVCodecContext avctx,
AVFrame pic,
int  mb_x,
int  mb_y,
unsigned  mb_count,
uint8_t *  buf,
unsigned  data_size,
int  unsafe,
int *  qp 
) [static]

Definition at line 369 of file proresenc.c.

Referenced by prores_encode_picture().

static av_always_inline unsigned encode_slice_data ( AVCodecContext avctx,
uint8_t *  dest_y,
uint8_t *  dest_u,
uint8_t *  dest_v,
int  luma_stride,
int  chroma_stride,
unsigned  mb_count,
uint8_t *  buf,
unsigned  data_size,
unsigned *  y_data_size,
unsigned *  u_data_size,
unsigned *  v_data_size,
int  qp 
) [static]

Definition at line 314 of file proresenc.c.

Referenced by encode_slice().

static int encode_slice_plane ( AVCodecContext avctx,
int  mb_count,
uint8_t *  src,
int  src_stride,
uint8_t *  buf,
unsigned  buf_size,
int *  qmat,
int  chroma 
) [static]

Definition at line 283 of file proresenc.c.

Referenced by encode_slice_data().

static void fdct_get ( uint8_t *  pixels,
int  stride,
DCTELEM block 
) [static]

Definition at line 277 of file proresenc.c.

Referenced by encode_slice_plane().

static void get ( uint8_t *  pixels,
int  stride,
DCTELEM block 
) [static]

Definition at line 262 of file proresenc.c.

static av_always_inline int get_level ( int  val  )  [static]

Definition at line 190 of file proresenc.c.

Referenced by encode_ac_coeffs(), and encode_dc_coeffs().

static av_cold int prores_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 578 of file proresenc.c.

static int prores_encode_frame ( AVCodecContext avctx,
unsigned char *  buf,
int  buf_size,
void *  data 
) [static]

Definition at line 487 of file proresenc.c.

static av_cold int prores_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 526 of file proresenc.c.

static int prores_encode_picture ( AVCodecContext avctx,
AVFrame pic,
uint8_t *  buf,
const int  buf_size 
) [static]

Definition at line 439 of file proresenc.c.

Referenced by prores_encode_frame().

static void scale_mat ( const uint8_t *  src,
int *  dst,
int  scale 
) [static]

Definition at line 519 of file proresenc.c.

Referenced by prores_encode_init().

static void subimage_with_fill ( uint16_t *  src,
unsigned  x,
unsigned  y,
unsigned  stride,
unsigned  width,
unsigned  height,
uint16_t *  dst,
unsigned  dst_width,
unsigned  dst_height 
) [static]

Definition at line 339 of file proresenc.c.

Referenced by encode_slice().


Variable Documentation

const int bitrate_table[5] = { 1000, 2100, 3500, 5400 } [static]

Definition at line 50 of file proresenc.c.

Referenced by encode_slice().

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

Definition at line 198 of file proresenc.c.

Initial value:

 {
    .name           = "prores",
    .type           = AVMEDIA_TYPE_VIDEO,
    .id             = CODEC_ID_PRORES,
    .priv_data_size = sizeof(ProresContext),
    .init           = prores_encode_init,
    .close          = prores_encode_close,
    .encode         = prores_encode_frame,
    .pix_fmts       = (const enum PixelFormat[]){PIX_FMT_YUV422P10, PIX_FMT_NONE},
    .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes"),
    .profiles       = profiles
}

Definition at line 587 of file proresenc.c.

const uint8_t lev_to_cb[10] [static]

Initial value:

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

Definition at line 228 of file proresenc.c.

const AVProfile profiles[] [static]

Initial value:

Definition at line 40 of file proresenc.c.

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 52 of file proresenc.c.

const uint8_t QMAT_CHROMA[4][64] [static]

Definition at line 103 of file proresenc.c.

Referenced by prores_encode_frame(), and prores_encode_init().

const uint8_t QMAT_LUMA[4][64] [static]

Definition at line 63 of file proresenc.c.

Referenced by prores_encode_frame(), and prores_encode_init().

const int qp_end_table[4] = { 8, 9, 6, 6 } [static]

Definition at line 49 of file proresenc.c.

Referenced by encode_slice().

const int qp_start_table[4] = { 4, 1, 1, 1 } [static]

Definition at line 48 of file proresenc.c.

Referenced by encode_slice(), and prores_encode_picture().

const uint8_t run_to_cb[16] [static]

Initial value:

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

Definition at line 226 of file proresenc.c.


Generated on Wed Feb 15 19:22:11 2012 for FFmpeg by  doxygen 1.5.8