35 #define H261_MBA_VLC_BITS 9
36 #define H261_MTYPE_VLC_BITS 6
37 #define H261_MV_VLC_BITS 7
38 #define H261_CBP_VLC_BITS 9
39 #define TCOEFF_VLC_BITS 9
40 #define MBA_STUFFING 33
41 #define MBA_STARTCODE 34
176 for(;left>15+1+4+5; left-=8){
204 for(i=mba1; i<mba2; i++){
237 mv_diff =
mvmap[mv_diff];
244 else if(v >= 16) v-= 32;
346 for (i = 0; i < 6; i++) {
353 for (i = 0; i < 6; i++)
384 if((level&0x7F) == 0){
402 block[0] = ( check & 0x1 ) ? -1 : 1;
451 uint32_t startcode= 0;
454 startcode = ((startcode << 1) |
get_bits(&s->
gb, 1)) & 0x000FFFFF;
456 if(startcode == 0x10)
460 if (startcode != 0x10){
545 if(pos+10>buf_size) pos=buf_size;
551 void *
data,
int *got_frame,
555 int buf_size = avpkt->
size;
562 av_dlog(avctx,
"bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
static const uint8_t h261_mba_code[35]
const struct AVCodec * codec
discard all frames except keyframes
void ff_init_block_index(MpegEncContext *s)
struct H261Context H261Context
H261Context.
uint8_t ff_h261_rl_table_store[2][2 *MAX_RUN+MAX_LEVEL+3]
#define H261_CBP_VLC_BITS
This structure describes decoded (raw) audio or video data.
static int get_consumed_bytes(MpegEncContext *s, int buf_size)
returns the number of bytes consumed for building the current frame
int coded_width
Bitstream width / height, may be different from width/height.
#define H261_MBA_VLC_BITS
av_cold int ff_MPV_common_init(MpegEncContext *s)
init common structure for both encoder and decoder.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void align_get_bits(GetBitContext *s)
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
void ff_init_rl(RLTable *rl, uint8_t static_store[2][2 *MAX_RUN+MAX_LEVEL+3])
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
const int8_t * table_level
int mb_num
number of MBs of a picture
static int get_sbits(GetBitContext *s, int n)
static VLC h261_mtype_vlc
static const uint8_t h261_mba_bits[35]
static int h261_decode_picture_header(H261Context *h)
Decode the H.261 picture header.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
enum AVDiscard skip_frame
static const uint8_t h261_mtype_code[10]
static RLTable h261_rl_tcoeff
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)
enum OutputFormat out_format
output format
static int h261_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
int64_t pts
presentation timestamp in time_base units (time when frame should be shown to user) If AV_NOPTS_VALUE...
Picture current_picture
copy of the current picture structure.
GetBitContext last_resync_gb
used to search for the next resync marker
static int get_bits_count(const GetBitContext *s)
static int ff_h261_resync(H261Context *h)
Decode the group of blocks / video packet header.
int flags2
AVCodecContext.flags2.
int mb_height
number of MBs horizontally & vertically
void ff_MPV_frame_end(MpegEncContext *s)
static av_cold void h261_decode_init_vlc(H261Context *h)
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 int get_bits_left(GetBitContext *gb)
static av_cold int h261_decode_init(AVCodecContext *avctx)
int mb_skipped
MUST BE SET only during DECODING.
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. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static const uint8_t h261_mv_tab[17][2]
int low_delay
no reordering needed / has no b-frames
VLC vlc
decoding only deprecated FIXME remove
#define INIT_VLC_RL(rl, static_size)
struct AVRational AVRational
rational number numerator/denominator
int n
number of entries of table_vlc minus 1
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
static int h261_decode_block(H261Context *h, DCTELEM *block, int n, int coded)
Decode a macroblock.
Picture * current_picture_ptr
pointer to the current picture
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
static const int mvmap[17]
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
static const uint8_t h261_cbp_tab[63][2]
int block_last_index[12]
last non zero coefficient in block
static av_cold int h261_decode_end(AVCodecContext *avctx)
int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
generic function for encode/decode called after coding/decoding the header and before a frame is code...
static int h261_decode_gob_header(H261Context *h)
Decode the group of blocks header or slice header.
uint32_t * mb_type
macroblock type table mb_type_base + mb_width + 2
#define MV_TYPE_16X16
1 vector for the whole mb
main external API structure.
static void close(AVCodecParserContext *s)
ScanTable intra_scantable
int height
picture size. must be a multiple of 16
#define SLICE_END
end marker found
Picture * picture
main picture buffer
static int h261_decode_gob(H261Context *h)
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
#define FF_ARRAY_ELEMS(a)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
void ff_er_frame_start(MpegEncContext *s)
DSPContext dsp
pointers for accelerated dsp functions
#define H261_MTYPE_VLC_BITS
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
DCTELEM(* block)[64]
points to one of the following blocks
int gob_start_code_skipped
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
void(* clear_blocks)(DCTELEM *blocks)
struct AVCodecContext * avctx
discard all non reference
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
static int h261_decode_mb(H261Context *h)
static int decode_mv_component(GetBitContext *gb, int v)
void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64])
void ff_MPV_common_end(MpegEncContext *s)
void ff_print_debug_info(MpegEncContext *s, AVFrame *pict)
Print debugging info for the given picture.
ParseContext parse_context
VLC_TYPE(* table)[2]
code, bits
static int h261_decode_mb_skipped(H261Context *h, int mba1, int mba2)
Decode skipped macroblocks.
int key_frame
1 -> keyframe, 0-> not
int frame_number
Frame counter, set by libavcodec.
int flags
AVCodecContext.flags (HQ, MV4, ...)
int ff_find_unused_picture(MpegEncContext *s, int shared)
This structure stores compressed data.
static const uint8_t h261_mtype_bits[10]
void ff_MPV_decode_defaults(MpegEncContext *s)
Set the given MpegEncContext to defaults for decoding.
#define check(x, y, S, v)