Go to the documentation of this file.
20 #ifndef AVCODEC_H263ENC_H
21 #define AVCODEC_H263ENC_H
32 int motion_x,
int motion_y);
43 int bit_size,
code, sign;
48 bit_size = f_code - 1;
61 int x,
int y,
int f_code)
75 int motion_x,
int motion_y){
79 int best_cbpy_score = INT_MAX;
80 int best_cbpc_score = INT_MAX;
81 int cbpc = (-1), cbpy = (-1);
85 for (
int i = 0;
i < 4;
i++) {
87 if (
i & 1) score +=
s->coded_score[5];
88 if (
i & 2) score +=
s->coded_score[4];
90 if (score < best_cbpc_score) {
91 best_cbpc_score = score;
96 for (
int i = 0;
i < 16;
i++) {
98 if (
i & 1) score +=
s->coded_score[3];
99 if (
i & 2) score +=
s->coded_score[2];
100 if (
i & 4) score +=
s->coded_score[1];
101 if (
i & 8) score +=
s->coded_score[0];
103 if (score < best_cbpy_score) {
104 best_cbpy_score = score;
108 cbp = cbpc + 4 * cbpy;
109 if (!(motion_x | motion_y |
s->dquant) &&
s->mv_type ==
MV_TYPE_16X16) {
110 if (best_cbpy_score + best_cbpc_score + 2 * lambda >= 0)
114 for (
int i = 0;
i < 6;
i++) {
115 if (
s->block_last_index[
i] >= 0 && !((cbp >> (5 -
i)) & 1)) {
116 s->block_last_index[
i] = -1;
117 s->bdsp.clear_block(
s->block[
i]);
122 for (
int i = 0;
i < 6;
i++) {
123 if (
s->block_last_index[
i] >= 0)
#define MV_TYPE_16X16
1 vector for the whole mb
void ff_h263_encode_mba(MpegEncContext *s)
static double val(void *priv, double ch)
#define FF_MPV_FLAG_CBP_RD
static void ff_h263_encode_motion_vector(MpegEncContext *s, int x, int y, int f_code)
#define AV_CODEC_FLAG2_NO_OUTPUT
Skip bitstream encoding.
static int get_p_cbp(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y)
static void skip_put_bits(PutBitContext *s, int n)
Skip the given number of bits.
static int h263_get_motion_length(int val, int f_code)
void ff_init_qscale_tab(MpegEncContext *s)
init s->current_picture.qscale_table from s->lambda_table
void ff_clean_h263_qscales(MpegEncContext *s)
modify qscale so that encoding is actually possible in H.263 (limit difference to -2....
const uint8_t ff_h263_cbpy_tab[16][2]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
void ff_h263_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y)
const uint8_t ff_h263_inter_MCBPC_bits[28]
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
void ff_h263_encode_init(MpegEncContext *s)
void ff_h263_encode_gob_header(MpegEncContext *s, int mb_line)
Encode a group of blocks header.
const uint8_t ff_mvtab[33][2]
static av_const int sign_extend(int val, unsigned bits)
void ff_h263_encode_picture_header(MpegEncContext *s)
The exact code depends on how similar the blocks are and how related they are to the block
void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code)