Go to the documentation of this file.
20 #ifndef AVCODEC_H263ENC_H
21 #define AVCODEC_H263ENC_H
32 int motion_x,
int motion_y);
41 int x,
int y,
int f_code)
49 int motion_x,
int motion_y){
53 int best_cbpy_score = INT_MAX;
54 int best_cbpc_score = INT_MAX;
55 int cbpc = (-1), cbpy = (-1);
59 for (
int i = 0;
i < 4;
i++) {
61 if (
i & 1) score +=
s->coded_score[5];
62 if (
i & 2) score +=
s->coded_score[4];
64 if (score < best_cbpc_score) {
65 best_cbpc_score = score;
70 for (
int i = 0;
i < 16;
i++) {
72 if (
i & 1) score +=
s->coded_score[3];
73 if (
i & 2) score +=
s->coded_score[2];
74 if (
i & 4) score +=
s->coded_score[1];
75 if (
i & 8) score +=
s->coded_score[0];
77 if (score < best_cbpy_score) {
78 best_cbpy_score = score;
82 cbp = cbpc + 4 * cbpy;
83 if (!(motion_x | motion_y |
s->dquant) &&
s->mv_type ==
MV_TYPE_16X16) {
84 if (best_cbpy_score + best_cbpc_score + 2 * lambda >= 0)
88 for (
int i = 0;
i < 6;
i++) {
89 if (
s->block_last_index[
i] >= 0 && !((cbp >> (5 -
i)) & 1)) {
90 s->block_last_index[
i] = -1;
91 s->bdsp.clear_block(
s->block[
i]);
96 for (
int i = 0;
i < 6;
i++) {
97 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)
static int get_p_cbp(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y)
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)
void ff_h263_encode_init(MpegEncContext *s)
void ff_h263_encode_gob_header(MpegEncContext *s, int mb_line)
Encode a group of blocks header.
void ff_h263_encode_picture_header(MpegEncContext *s)
void ff_h263_update_mb(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)