FFmpeg
|
#include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/lfg.h"
#include "libavutil/opt.h"
#include "roqvideo.h"
#include "bytestream.h"
#include "elbg.h"
#include "encode.h"
#include "internal.h"
#include "mathops.h"
Go to the source code of this file.
Data Structures | |
struct | RoqCodebooks |
struct | RoqTempData |
Temporary vars. More... | |
struct | SubcelEvaluation |
struct | CelEvaluation |
struct | RoqEncContext |
struct | CodingSpool |
Macros | |
#define | CHROMA_BIAS 1 |
#define | MAX_CBS_4x4 256 |
Maximum number of generated 4x4 codebooks. More... | |
#define | MAX_CBS_2x2 256 |
Maximum number of 2x2 codebooks. More... | |
#define | ROQ_LAMBDA_SCALE ((uint64_t) FF_LAMBDA_SCALE) |
#define | EVAL_MOTION(MOTION) |
#define | OFFSET(x) offsetof(RoqEncContext, x) |
#define | VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
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 (const uint8_t *a, const uint8_t *b, int count) |
static int | block_sse (uint8_t *const *buf1, uint8_t *const *buf2, int x1, int y1, int x2, int y2, const int *stride1, const int *stride2, int size) |
static int | eval_motion_dist (RoqEncContext *enc, int x, int y, motion_vect vect, int size) |
static int | squared_diff_macroblock (uint8_t a[], uint8_t b[], int size) |
static int | create_cel_evals (RoqEncContext *enc) |
Initialize cel evaluators and set their source coordinates. More... | |
static void | get_frame_mb (const AVFrame *frame, int x, int y, uint8_t mb[], int dim) |
Get macroblocks from parts of the image. More... | |
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. More... | |
static void | motion_search (RoqEncContext *enc, int blocksize) |
static void | gather_data_for_subcel (SubcelEvaluation *subcel, int x, int y, RoqEncContext *enc) |
Get distortion for all options available to a subcel. More... | |
static void | gather_data_for_cel (CelEvaluation *cel, RoqEncContext *enc) |
Get distortion for all options available to a cel. More... | |
static void | remap_codebooks (RoqEncContext *enc) |
static void | write_codebooks (RoqEncContext *enc) |
Write codebook chunk. More... | |
static uint8_t | motion_arg (motion_vect mot) |
static void | write_typecode (CodingSpool *s, uint8_t type) |
static void | reconstruct_and_encode_image (RoqEncContext *enc, int w, int h, int numBlocks) |
static void | frame_block_to_cell (int *block, uint8_t *const *data, int top, int left, const int *stride) |
Create a single YUV cell from a 2x2 section of the image. More... | |
static void | create_clusters (const AVFrame *frame, int w, int h, int *points) |
Create YUV clusters for the entire image. More... | |
static int | generate_codebook (RoqEncContext *enc, int *points, int inputCount, roq_cell *results, int size, int cbsize) |
static int | generate_new_codebooks (RoqEncContext *enc) |
static int | roq_encode_video (RoqEncContext *enc) |
static av_cold int | roq_encode_end (AVCodecContext *avctx) |
static av_cold int | roq_encode_init (AVCodecContext *avctx) |
static void | roq_write_video_info_chunk (RoqEncContext *enc) |
static int | roq_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) |
Variables | |
static const AVOption | options [] |
static const AVClass | roq_class |
const AVCodec | ff_roq_encoder |
id RoQ encoder by Vitor. Based on the Switchblade3 library and the Switchblade3 FFmpeg glue by Eric Lasota.
Definition in file roqvideoenc.c.
#define CHROMA_BIAS 1 |
Definition at line 69 of file roqvideoenc.c.
#define MAX_CBS_4x4 256 |
Maximum number of generated 4x4 codebooks.
Can't be 256 to workaround a Quake 3 bug.
Definition at line 75 of file roqvideoenc.c.
#define MAX_CBS_2x2 256 |
Maximum number of 2x2 codebooks.
Definition at line 77 of file roqvideoenc.c.
#define ROQ_LAMBDA_SCALE ((uint64_t) FF_LAMBDA_SCALE) |
Definition at line 80 of file roqvideoenc.c.
#define EVAL_MOTION | ( | MOTION | ) |
Definition at line 328 of file roqvideoenc.c.
#define OFFSET | ( | x | ) | offsetof(RoqEncContext, x) |
Definition at line 1106 of file roqvideoenc.c.
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Definition at line 1107 of file roqvideoenc.c.
|
static |
Definition at line 163 of file roqvideoenc.c.
Referenced by generate_new_codebooks().
|
static |
Definition at line 170 of file roqvideoenc.c.
Referenced by generate_new_codebooks().
|
static |
Definition at line 185 of file roqvideoenc.c.
Referenced by generate_new_codebooks().
Definition at line 195 of file roqvideoenc.c.
Referenced by dpcm_decode_init(), eval_sse(), fixed_sqrt(), iterative_me(), mc_dir_part(), mc_part(), mc_part_std(), and mc_part_weighted().
Definition at line 200 of file roqvideoenc.c.
Referenced by block_sse(), and squared_diff_macroblock().
|
static |
Definition at line 212 of file roqvideoenc.c.
Referenced by eval_motion_dist(), gather_data_for_cel(), and gather_data_for_subcel().
|
static |
Definition at line 228 of file roqvideoenc.c.
Referenced by gather_data_for_cel(), gather_data_for_subcel(), and motion_search().
Definition at line 256 of file roqvideoenc.c.
Referenced by gather_data_for_subcel(), and index_mb().
|
static |
Initialize cel evaluators and set their source coordinates.
Definition at line 273 of file roqvideoenc.c.
Referenced by roq_encode_init().
Get macroblocks from parts of the image.
Definition at line 295 of file roqvideoenc.c.
Referenced by gather_data_for_cel(), and gather_data_for_subcel().
Find the codebook with the lowest distortion from an image.
Definition at line 310 of file roqvideoenc.c.
Referenced by gather_data_for_cel(), gather_data_for_subcel(), and generate_new_codebooks().
|
static |
Definition at line 338 of file roqvideoenc.c.
Referenced by roq_encode_video().
|
static |
Get distortion for all options available to a subcel.
Definition at line 430 of file roqvideoenc.c.
Referenced by gather_data_for_cel().
|
static |
Get distortion for all options available to a cel.
Definition at line 496 of file roqvideoenc.c.
Referenced by roq_encode_video().
|
static |
Definition at line 571 of file roqvideoenc.c.
Referenced by roq_encode_video().
|
static |
Write codebook chunk.
Definition at line 605 of file roqvideoenc.c.
Referenced by roq_encode_video().
|
inlinestatic |
Definition at line 631 of file roqvideoenc.c.
Referenced by reconstruct_and_encode_image().
|
static |
Definition at line 647 of file roqvideoenc.c.
Referenced by reconstruct_and_encode_image().
|
static |
Definition at line 661 of file roqvideoenc.c.
Referenced by roq_encode_video().
|
inlinestatic |
Create a single YUV cell from a 2x2 section of the image.
Definition at line 781 of file roqvideoenc.c.
Referenced by create_clusters().
Create YUV clusters for the entire image.
Definition at line 802 of file roqvideoenc.c.
Referenced by generate_new_codebooks().
|
static |
Definition at line 816 of file roqvideoenc.c.
Referenced by generate_new_codebooks().
|
static |
Definition at line 844 of file roqvideoenc.c.
Referenced by roq_encode_video().
|
static |
Definition at line 890 of file roqvideoenc.c.
Referenced by roq_encode_frame().
|
static |
Definition at line 949 of file roqvideoenc.c.
|
static |
Definition at line 968 of file roqvideoenc.c.
|
static |
Definition at line 1028 of file roqvideoenc.c.
Referenced by roq_encode_frame().
|
static |
Definition at line 1053 of file roqvideoenc.c.
|
static |
Definition at line 1108 of file roqvideoenc.c.
|
static |
Definition at line 1113 of file roqvideoenc.c.
const AVCodec ff_roq_encoder |
Definition at line 1120 of file roqvideoenc.c.