Go to the documentation of this file.
20 #ifndef AVCODEC_H263ENC_H
21 #define AVCODEC_H263ENC_H
39 int x,
int y,
int f_code)
47 int motion_x,
int motion_y){
51 int best_cbpy_score = INT_MAX;
52 int best_cbpc_score = INT_MAX;
53 int cbpc = (-1), cbpy = (-1);
57 for (
int i = 0;
i < 4;
i++) {
59 if (
i & 1) score +=
s->coded_score[5];
60 if (
i & 2) score +=
s->coded_score[4];
62 if (score < best_cbpc_score) {
63 best_cbpc_score = score;
68 for (
int i = 0;
i < 16;
i++) {
70 if (
i & 1) score +=
s->coded_score[3];
71 if (
i & 2) score +=
s->coded_score[2];
72 if (
i & 4) score +=
s->coded_score[1];
73 if (
i & 8) score +=
s->coded_score[0];
75 if (score < best_cbpy_score) {
76 best_cbpy_score = score;
80 cbp = cbpc + 4 * cbpy;
81 if (!(motion_x | motion_y |
s->dquant) &&
s->c.mv_type ==
MV_TYPE_16X16) {
82 if (best_cbpy_score + best_cbpc_score + 2 * lambda >= 0)
86 for (
int i = 0;
i < 6;
i++) {
87 if (
s->c.block_last_index[
i] >= 0 && !((cbp >> (5 -
i)) & 1)) {
88 s->c.block_last_index[
i] = -1;
89 s->c.bdsp.clear_block(
s->c.block[
i]);
94 for (
int i = 0;
i < 6;
i++) {
95 if (
s->c.block_last_index[
i] >= 0)
#define MV_TYPE_16X16
1 vector for the whole mb
void ff_clean_h263_qscales(MPVEncContext *s)
void ff_h263_encode_init(MPVMainEncContext *m)
static double val(void *priv, double ch)
#define FF_MPV_FLAG_CBP_RD
void ff_h263_encode_gob_header(MPVEncContext *s, int mb_line)
void ff_h263_encode_mba(MPVEncContext *s)
static int get_p_cbp(MPVEncContext *const s, int16_t block[6][64], int motion_x, int motion_y)
const uint8_t(* ff_h263_get_mv_penalty(void))[MAX_DMV *2+1]
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
const uint8_t ff_h263_inter_MCBPC_bits[28]
#define i(width, name, range_min, range_max)
void ff_h263_update_mb(MPVEncContext *s)
static void ff_h263_encode_motion_vector(MPVEncContext *s, int x, int y, int f_code)
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)