libavcodec/h261dec.c File Reference

H.261 decoder. More...

#include "libavutil/avassert.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "h263.h"
#include "h261.h"
Include dependency graph for libavcodec/h261dec.c:

Go to the source code of this file.

Macros

#define H261_MBA_VLC_BITS   9
 
#define H261_MTYPE_VLC_BITS   6
 
#define H261_MV_VLC_BITS   7
 
#define H261_CBP_VLC_BITS   9
 
#define TCOEFF_VLC_BITS   9
 
#define MBA_STUFFING   33
 
#define MBA_STARTCODE   34
 

Functions

static av_cold void h261_decode_init_vlc (H261Context *h)
 
static av_cold int h261_decode_init (AVCodecContext *avctx)
 
static int h261_decode_gob_header (H261Context *h)
 Decode the group of blocks header or slice header. More...
 
static int ff_h261_resync (H261Context *h)
 Decode the group of blocks / video packet header. More...
 
static int h261_decode_mb_skipped (H261Context *h, int mba1, int mba2)
 Decode skipped macroblocks. More...
 
static int decode_mv_component (GetBitContext *gb, int v)
 
static int h261_decode_block (H261Context *h, int16_t *block, int n, int coded)
 Decode a macroblock. More...
 
static int h261_decode_mb (H261Context *h)
 
static int h261_decode_picture_header (H261Context *h)
 Decode the H.261 picture header. More...
 
static int h261_decode_gob (H261Context *h)
 
static int get_consumed_bytes (MpegEncContext *s, int buf_size)
 returns the number of bytes consumed for building the current frame More...
 
static int h261_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int h261_decode_end (AVCodecContext *avctx)
 

Variables

static VLC h261_mba_vlc
 
static VLC h261_mtype_vlc
 
static VLC h261_mv_vlc
 
static VLC h261_cbp_vlc
 
static const int mvmap [17]
 
AVCodec ff_h261_decoder
 

Detailed Description

H.261 decoder.

Definition in file libavcodec/h261dec.c.

Macro Definition Documentation

#define H261_CBP_VLC_BITS   9

Definition at line 37 of file libavcodec/h261dec.c.

Referenced by h261_decode_init_vlc(), and h261_decode_mb().

#define H261_MBA_VLC_BITS   9

Definition at line 34 of file libavcodec/h261dec.c.

Referenced by h261_decode_init_vlc(), and h261_decode_mb().

#define H261_MTYPE_VLC_BITS   6

Definition at line 35 of file libavcodec/h261dec.c.

Referenced by h261_decode_init_vlc(), and h261_decode_mb().

#define H261_MV_VLC_BITS   7

Definition at line 36 of file libavcodec/h261dec.c.

Referenced by decode_mv_component(), and h261_decode_init_vlc().

#define MBA_STARTCODE   34

Definition at line 40 of file libavcodec/h261dec.c.

Referenced by h261_decode_mb().

#define MBA_STUFFING   33

Definition at line 39 of file libavcodec/h261dec.c.

Referenced by h261_decode_gob(), and h261_decode_mb().

#define TCOEFF_VLC_BITS   9

Definition at line 38 of file libavcodec/h261dec.c.

Referenced by h261_decode_block().

Function Documentation

static int decode_mv_component ( GetBitContext gb,
int  v 
)
static

Definition at line 229 of file libavcodec/h261dec.c.

Referenced by h261_decode_mb().

static int ff_h261_resync ( H261Context h)
static

Decode the group of blocks / video packet header.

Returns
<0 if no resync found

Definition at line 151 of file libavcodec/h261dec.c.

Referenced by h261_decode_frame().

static int get_consumed_bytes ( MpegEncContext s,
int  buf_size 
)
static

returns the number of bytes consumed for building the current frame

Definition at line 551 of file libavcodec/h261dec.c.

Referenced by h261_decode_frame().

static int h261_decode_block ( H261Context h,
int16_t *  block,
int  n,
int  coded 
)
static

Decode a macroblock.

Returns
<0 if an error occurred

Definition at line 255 of file libavcodec/h261dec.c.

Referenced by h261_decode_mb().

static av_cold int h261_decode_end ( AVCodecContext avctx)
static

Definition at line 653 of file libavcodec/h261dec.c.

static int h261_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 562 of file libavcodec/h261dec.c.

static int h261_decode_gob ( H261Context h)
static

Definition at line 519 of file libavcodec/h261dec.c.

Referenced by h261_decode_frame().

static int h261_decode_gob_header ( H261Context h)
static

Decode the group of blocks header or slice header.

Returns
<0 if an error occurred

Definition at line 97 of file libavcodec/h261dec.c.

Referenced by ff_h261_resync().

static av_cold int h261_decode_init ( AVCodecContext avctx)
static

Definition at line 69 of file libavcodec/h261dec.c.

static av_cold void h261_decode_init_vlc ( H261Context h)
static

Definition at line 47 of file libavcodec/h261dec.c.

Referenced by h261_decode_init().

static int h261_decode_mb ( H261Context h)
static

Definition at line 339 of file libavcodec/h261dec.c.

Referenced by h261_decode_gob().

static int h261_decode_mb_skipped ( H261Context h,
int  mba1,
int  mba2 
)
static

Decode skipped macroblocks.

Returns
0

Definition at line 192 of file libavcodec/h261dec.c.

Referenced by h261_decode_gob().

static int h261_decode_picture_header ( H261Context h)
static

Decode the H.261 picture header.

Returns
<0 if no startcode found

Definition at line 454 of file libavcodec/h261dec.c.

Referenced by h261_decode_frame().

Variable Documentation

AVCodec ff_h261_decoder
Initial value:
= {
.name = "h261",
.priv_data_size = sizeof(H261Context),
.capabilities = CODEC_CAP_DR1,
.max_lowres = 3,
.long_name = NULL_IF_CONFIG_SMALL("H.261"),
}
struct H261Context H261Context
H261Context.
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int h261_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static av_cold int h261_decode_init(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int h261_decode_end(AVCodecContext *avctx)
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868

Definition at line 662 of file libavcodec/h261dec.c.

VLC h261_cbp_vlc
static

Definition at line 45 of file libavcodec/h261dec.c.

VLC h261_mba_vlc
static

Definition at line 42 of file libavcodec/h261dec.c.

VLC h261_mtype_vlc
static

Definition at line 43 of file libavcodec/h261dec.c.

VLC h261_mv_vlc
static

Definition at line 44 of file libavcodec/h261dec.c.

const int mvmap[17]
static
Initial value:
= {
0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16
}

Definition at line 225 of file libavcodec/h261dec.c.

Referenced by decode_mv_component().