roqvideoenc.c File Reference


Detailed Description

Id RoQ encoder by Vitor.

Based on the Switchblade3 library and the Switchblade3 FFmpeg glue by Eric Lasota.

Definition in file roqvideoenc.c.

Go to the source code of this file.

Classes

struct  subcel_evaluation_t
struct  cel_evaluation_t
struct  roq_codebooks_t
struct  roq_tempdata_t
 Temporary vars. More...
struct  CodingSpool

Functions

static void unpack_roq_cell (roq_cell *cell, uint8_t u[4 *3])
static void unpack_roq_qcell (uint8_t cb2[], roq_qcell *qcell, uint8_t u[4 *4 *3])
static void enlarge_roq_mb4 (uint8_t base[3 *16], uint8_t u[3 *64])
static int square (int x)
static int eval_sse (uint8_t *a, uint8_t *b, int count)
static int block_sse (uint8_t **buf1, uint8_t **buf2, int x1, int y1, int x2, int y2, int *stride1, int *stride2, int size)
static int eval_motion_dist (RoqContext *enc, int x, int y, motion_vect vect, int size)
static int squared_diff_macroblock (uint8_t a[], uint8_t b[], int size)
 Returns distortion between two macroblocks.
static void create_cel_evals (RoqContext *enc, roq_tempdata_t *tempData)
 Initializes cel evaluators and sets their source coordinates.
static void get_frame_mb (AVFrame *frame, int x, int y, uint8_t mb[], int dim)
 Get macroblocks from parts of the image.
static int index_mb (uint8_t cluster[], uint8_t cb[], int numCB, int *outIndex, int dim)
 Find the codebook with the lowest distortion from an image.
static void motion_search (RoqContext *enc, int blocksize)
static void gather_data_for_subcel (subcel_evaluation_t *subcel, int x, int y, RoqContext *enc, roq_tempdata_t *tempData)
 Gets distortion for all options available to a subcel.
static void gather_data_for_cel (cel_evaluation_t *cel, RoqContext *enc, roq_tempdata_t *tempData)
 Gets distortion for all options available to a cel.
static void remap_codebooks (RoqContext *enc, roq_tempdata_t *tempData)
static void write_codebooks (RoqContext *enc, roq_tempdata_t *tempData)
 Write codebook chunk.
static uint8_t motion_arg (motion_vect mot)
static void write_typecode (CodingSpool *s, uint8_t type)
static void reconstruct_and_encode_image (RoqContext *enc, roq_tempdata_t *tempData, int w, int h, int numBlocks)
static void frame_block_to_cell (uint8_t *block, uint8_t **data, int top, int left, int *stride)
 Create a single YUV cell from a 2x2 section of the image.
static void create_clusters (AVFrame *frame, int w, int h, uint8_t *yuvClusters)
 Creates YUV clusters for the entire image.
static void generate_codebook (RoqContext *enc, roq_tempdata_t *tempdata, int *points, int inputCount, roq_cell *results, int size, int cbsize)
static void generate_new_codebooks (RoqContext *enc, roq_tempdata_t *tempData)
static void roq_encode_video (RoqContext *enc)
static int roq_encode_init (AVCodecContext *avctx)
static void roq_write_video_info_chunk (RoqContext *enc)
static int roq_encode_frame (AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
static int roq_encode_end (AVCodecContext *avctx)

Variables

AVCodec roq_encoder


Function Documentation

static void unpack_roq_cell ( roq_cell cell,
uint8_t  u[4 *3] 
) [static]

Definition at line 78 of file roqvideoenc.c.

Referenced by generate_new_codebooks().

static void unpack_roq_qcell ( uint8_t  cb2[],
roq_qcell qcell,
uint8_t  u[4 *4 *3] 
) [static]

Definition at line 85 of file roqvideoenc.c.

Referenced by generate_new_codebooks().

static void enlarge_roq_mb4 ( uint8_t  base[3 *16],
uint8_t  u[3 *64] 
) [static]

Definition at line 100 of file roqvideoenc.c.

Referenced by generate_new_codebooks().

static int square ( int  x  )  [inline, static]

Definition at line 110 of file roqvideoenc.c.

Referenced by dpcm_decode_init(), eval_sse(), and iterative_me().

static int eval_sse ( uint8_t *  a,
uint8_t *  b,
int  count 
) [inline, static]

Definition at line 115 of file roqvideoenc.c.

Referenced by block_sse(), and squared_diff_macroblock().

static int block_sse ( uint8_t **  buf1,
uint8_t **  buf2,
int  x1,
int  y1,
int  x2,
int  y2,
int *  stride1,
int *  stride2,
int  size 
) [static]

static int eval_motion_dist ( RoqContext enc,
int  x,
int  y,
motion_vect  vect,
int  size 
) [static]

Definition at line 143 of file roqvideoenc.c.

Referenced by gather_data_for_cel(), gather_data_for_subcel(), and motion_search().

static int squared_diff_macroblock ( uint8_t  a[],
uint8_t  b[],
int  size 
) [inline, static]

Returns distortion between two macroblocks.

Definition at line 170 of file roqvideoenc.c.

Referenced by gather_data_for_subcel(), and index_mb().

static void create_cel_evals ( RoqContext enc,
roq_tempdata_t tempData 
) [static]

Initializes cel evaluators and sets their source coordinates.

Definition at line 245 of file roqvideoenc.c.

Referenced by roq_encode_video().

static void get_frame_mb ( AVFrame frame,
int  x,
int  y,
uint8_t  mb[],
int  dim 
) [static]

Get macroblocks from parts of the image.

Definition at line 263 of file roqvideoenc.c.

Referenced by gather_data_for_cel(), and gather_data_for_subcel().

static int index_mb ( uint8_t  cluster[],
uint8_t  cb[],
int  numCB,
int *  outIndex,
int  dim 
) [static]

Find the codebook with the lowest distortion from an image.

Definition at line 278 of file roqvideoenc.c.

Referenced by gather_data_for_cel(), gather_data_for_subcel(), and generate_new_codebooks().

static void motion_search ( RoqContext enc,
int  blocksize 
) [static]

Definition at line 306 of file roqvideoenc.c.

Referenced by roq_encode_video().

static void gather_data_for_subcel ( subcel_evaluation_t subcel,
int  x,
int  y,
RoqContext enc,
roq_tempdata_t tempData 
) [static]

Gets distortion for all options available to a subcel.

Definition at line 398 of file roqvideoenc.c.

Referenced by gather_data_for_cel().

static void gather_data_for_cel ( cel_evaluation_t cel,
RoqContext enc,
roq_tempdata_t tempData 
) [static]

Gets distortion for all options available to a cel.

Definition at line 462 of file roqvideoenc.c.

Referenced by roq_encode_video().

static void remap_codebooks ( RoqContext enc,
roq_tempdata_t tempData 
) [static]

Definition at line 536 of file roqvideoenc.c.

Referenced by roq_encode_video().

static void write_codebooks ( RoqContext enc,
roq_tempdata_t tempData 
) [static]

Write codebook chunk.

Definition at line 568 of file roqvideoenc.c.

Referenced by roq_encode_video().

static uint8_t motion_arg ( motion_vect  mot  )  [inline, static]

Definition at line 592 of file roqvideoenc.c.

Referenced by reconstruct_and_encode_image().

static void write_typecode ( CodingSpool s,
uint8_t  type 
) [static]

Definition at line 609 of file roqvideoenc.c.

Referenced by reconstruct_and_encode_image().

static void reconstruct_and_encode_image ( RoqContext enc,
roq_tempdata_t tempData,
int  w,
int  h,
int  numBlocks 
) [static]

Definition at line 623 of file roqvideoenc.c.

Referenced by roq_encode_video().

static void frame_block_to_cell ( uint8_t *  block,
uint8_t **  data,
int  top,
int  left,
int *  stride 
) [inline, static]

Create a single YUV cell from a 2x2 section of the image.

Definition at line 757 of file roqvideoenc.c.

Referenced by create_clusters().

static void create_clusters ( AVFrame frame,
int  w,
int  h,
uint8_t *  yuvClusters 
) [static]

Creates YUV clusters for the entire image.

Definition at line 778 of file roqvideoenc.c.

Referenced by generate_new_codebooks().

static void generate_codebook ( RoqContext enc,
roq_tempdata_t tempdata,
int *  points,
int  inputCount,
roq_cell results,
int  size,
int  cbsize 
) [static]

Definition at line 792 of file roqvideoenc.c.

Referenced by generate_new_codebooks().

static void generate_new_codebooks ( RoqContext enc,
roq_tempdata_t tempData 
) [static]

Definition at line 827 of file roqvideoenc.c.

Referenced by roq_encode_video().

static void roq_encode_video ( RoqContext enc  )  [static]

Definition at line 881 of file roqvideoenc.c.

Referenced by roq_encode_frame().

static int roq_encode_init ( AVCodecContext avctx  )  [static]

Definition at line 925 of file roqvideoenc.c.

static void roq_write_video_info_chunk ( RoqContext enc  )  [static]

Definition at line 970 of file roqvideoenc.c.

Referenced by roq_encode_frame().

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

Definition at line 995 of file roqvideoenc.c.

static int roq_encode_end ( AVCodecContext avctx  )  [static]

Definition at line 1043 of file roqvideoenc.c.


Variable Documentation

Initial value:

{
    "roqvideo",
    CODEC_TYPE_VIDEO,
    CODEC_ID_ROQ,
    sizeof(RoqContext),
    roq_encode_init,
    roq_encode_frame,
    roq_encode_end,
    .supported_framerates = (AVRational[]){{30,1}, {0,0}},
    .pix_fmts = (enum PixelFormat[]){PIX_FMT_YUV444P, -1},
}

Definition at line 1058 of file roqvideoenc.c.


Generated on Sat Dec 18 05:15:55 2010 for MythTV by  doxygen 1.5.5