42 if (width == 176 && height == 144)
45 else if (width == 352 && height == 288)
116 s->
mb_x = index % 11 ; index /= 11;
117 s->
mb_y = index % 3 ; index /= 3;
118 s->
mb_x+= 11*(index % 2); index /= 2;
139 code = sign ? -val : val;
150 for (i = 0; i < 6; i++) {
158 int motion_x,
int motion_y)
161 int mvd, mv_diff_x, mv_diff_y, i, cbp;
173 mvd = motion_x | motion_y;
175 if((cbp | mvd | s->
dquant ) == 0) {
197 assert(h->
mtype > 1);
260 int level,
run, i, j, last_index, last_non_zero, sign, slevel, code;
273 else if (level < 1) {
282 }
else if((block[0]==1 || block[0] == -1) && (s->
block_last_index[n] > -1)){
292 last_non_zero = i - 1;
293 for (; i <= last_index; i++) {
297 run = i - last_non_zero - 1;
305 if(run==0 && level < 16)
311 assert(level <= 127);
static const uint8_t h261_mba_code[35]
void ff_init_block_index(MpegEncContext *s)
struct H261Context H261Context
H261Context.
const uint8_t * y_dc_scale_table
qscale -> y_dc_scale table
static void put_sbits(PutBitContext *pb, int n, int32_t value)
int MPV_encode_init(AVCodecContext *avctx)
void ff_init_rl(RLTable *rl, uint8_t static_store[2][2 *MAX_RUN+MAX_LEVEL+3])
void avpriv_align_put_bits(PutBitContext *s)
Pad the bitstream with zeros up to the next byte boundary.
int min_qcoeff
minimum encodable coefficient
void ff_h261_encode_picture_header(MpegEncContext *s, int picture_number)
static const uint8_t h261_mba_bits[35]
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static const uint8_t h261_mtype_code[10]
static RLTable h261_rl_tcoeff
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static void h261_encode_gob_header(MpegEncContext *s, int mb_line)
Encode a group of blocks header.
int max_qcoeff
maximum encodable coefficient
void ff_h261_encode_init(MpegEncContext *s)
int dquant
qscale difference to prev qscale
static void ff_update_block_index(MpegEncContext *s)
static int init(AVCodecParserContext *s)
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
static uint8_t * put_bits_ptr(PutBitContext *s)
Return the pointer to the byte where the bitstream writer will put the next bit.
static void h261_encode_block(H261Context *h, DCTELEM *block, int n)
Encode an 8x8 block.
int MPV_encode_end(AVCodecContext *avctx)
static const int h261_mtype_map[10]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
const char * name
Name of the codec implementation.
static const uint8_t h261_mv_tab[17][2]
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
int n
number of entries of table_vlc minus 1
uint8_t ff_h261_rl_table_store[2][2 *MAX_RUN+MAX_LEVEL+3]
const uint16_t(* table_vlc)[2]
static const uint8_t h261_cbp_tab[63][2]
int block_last_index[12]
last non zero coefficient in block
static void close(AVCodecParserContext *s)
void ff_h261_reorder_mb_index(MpegEncContext *s)
ScanTable intra_scantable
int height
picture size. must be a multiple of 16
const uint8_t ff_mpeg1_dc_scale_table[128]
int ff_h261_get_picture_format(int width, int height)
static void h261_encode_motion(H261Context *h, int val)
const uint8_t * c_dc_scale_table
qscale -> c_dc_scale table
struct AVCodecContext * avctx
PutBitContext pb
bit output
static int get_rl_index(const RLTable *rl, int last, int run, int level)
void ff_h261_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y)
static int get_cbp(MpegEncContext *s, DCTELEM block[6][64])
static const uint8_t h261_mtype_bits[10]