38 if (width == 176 && height == 144)
41 else if (width == 352 && height == 288)
114 s->
mb_x = index % 11;
118 s->
mb_x += 11 * (index % 2);
140 code = sign ? -val : val;
150 for (i = 0; i < 6; i++)
164 int level,
run, i, j, last_index, last_non_zero, sign, slevel, code;
177 else if (level < 1) {
186 }
else if ((block[0] == 1 || block[0] == -1) &&
197 last_non_zero = i - 1;
198 for (; i <= last_index; i++) {
202 run = i - last_non_zero - 1;
211 if (run == 0 && level < 16)
217 assert(level <= 127);
230 int motion_x,
int motion_y)
233 int mvd, mv_diff_x, mv_diff_y, i, cbp;
245 mvd = motion_x | motion_y;
247 if ((cbp | mvd | s->
dquant) == 0) {
271 assert(h->
mtype > 1);
305 for (i = 0; i < 6; i++)
339 .priv_class = &h261_class,
void ff_init_block_index(MpegEncContext *s)
const uint8_t * y_dc_scale_table
qscale -> y_dc_scale table
static void put_sbits(PutBitContext *pb, int n, int32_t value)
#define FF_MPV_GENERIC_CLASS(name)
void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y)
const uint8_t ff_h261_mba_bits[35]
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)
const uint8_t ff_h261_mba_code[35]
Macro definitions for various function/variable attributes.
const uint8_t ff_h261_cbp_tab[63][2]
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static void h261_encode_gob_header(MpegEncContext *s, int mb_line)
Encode a group of blocks header.
int max_qcoeff
maximum encodable coefficient
int dquant
qscale difference to prev qscale
static void ff_update_block_index(MpegEncContext *s)
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
static void h261_encode_block(H261Context *h, int16_t *block, int n)
Encode an 8x8 block.
av_cold void ff_h261_common_init(void)
static uint8_t * put_bits_ptr(PutBitContext *s)
Return the pointer to the byte where the bitstream writer will put the next bit.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
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
const uint16_t(* table_vlc)[2]
int block_last_index[12]
last non zero coefficient in block
const uint8_t ff_h261_mtype_code[10]
const uint8_t ff_h261_mtype_bits[10]
const uint8_t ff_h261_mv_tab[17][2]
const int ff_h261_mtype_map[10]
Libavcodec external API header.
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)
int ff_mpv_encode_init(AVCodecContext *avctx)
static int get_cbp(MpegEncContext *s, int16_t block[6][64])
static void h261_encode_motion(H261Context *h, int val)
RLTable ff_h261_rl_tcoeff
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
const uint8_t * c_dc_scale_table
qscale -> c_dc_scale table
struct AVCodecContext * avctx
PutBitContext pb
bit output
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
int ff_mpv_encode_end(AVCodecContext *avctx)
static av_cold int init(AVCodecParserContext *s)
static int get_rl_index(const RLTable *rl, int last, int run, int level)
int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
av_cold void ff_h261_encode_init(MpegEncContext *s)
AVPixelFormat
Pixel format.