FFmpeg
Data Structures | Macros | Functions | Variables
h261dec.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "mpeg_er.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpegvideodec.h"
#include "h261.h"

Go to the source code of this file.

Data Structures

struct  H261DecContext
 

Macros

#define H261_MBA_VLC_BITS   8
 
#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_static (void)
 
static av_cold int h261_decode_init (AVCodecContext *avctx)
 
static void h261_init_dest (MpegEncContext *s)
 
static int h261_decode_gob_header (H261DecContext *h)
 Decode the group of blocks header or slice header. More...
 
static int h261_resync (H261DecContext *h)
 Decode the group of blocks / video packet header. More...
 
static int h261_decode_mb_skipped (H261DecContext *h, int mba1, int mba2)
 Decode skipped macroblocks. More...
 
static int decode_mv_component (GetBitContext *gb, int v)
 
static int h261_decode_block (H261DecContext *h, int16_t *block, int n, int coded)
 Decode a macroblock. More...
 
static int h261_decode_mb (H261DecContext *h)
 
static int h261_decode_picture_header (H261DecContext *h)
 Decode the H.261 picture header. More...
 
static int h261_decode_gob (H261DecContext *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, AVFrame *pict, 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]
 
const FFCodec ff_h261_decoder
 

Detailed Description

H.261 decoder.

Definition in file h261dec.c.

Macro Definition Documentation

◆ H261_MBA_VLC_BITS

#define H261_MBA_VLC_BITS   8

Definition at line 39 of file h261dec.c.

◆ H261_MTYPE_VLC_BITS

#define H261_MTYPE_VLC_BITS   6

Definition at line 40 of file h261dec.c.

◆ H261_MV_VLC_BITS

#define H261_MV_VLC_BITS   7

Definition at line 41 of file h261dec.c.

◆ H261_CBP_VLC_BITS

#define H261_CBP_VLC_BITS   9

Definition at line 42 of file h261dec.c.

◆ TCOEFF_VLC_BITS

#define TCOEFF_VLC_BITS   9

Definition at line 43 of file h261dec.c.

◆ MBA_STUFFING

#define MBA_STUFFING   33

Definition at line 44 of file h261dec.c.

◆ MBA_STARTCODE

#define MBA_STARTCODE   34

Definition at line 45 of file h261dec.c.

Function Documentation

◆ h261_decode_init_static()

static av_cold void h261_decode_init_static ( void  )
static

Definition at line 65 of file h261dec.c.

Referenced by h261_decode_init().

◆ h261_decode_init()

static av_cold int h261_decode_init ( AVCodecContext avctx)
static

Definition at line 82 of file h261dec.c.

◆ h261_init_dest()

static void h261_init_dest ( MpegEncContext s)
inlinestatic

Definition at line 103 of file h261dec.c.

Referenced by h261_decode_mb(), and h261_decode_mb_skipped().

◆ h261_decode_gob_header()

static int h261_decode_gob_header ( H261DecContext h)
static

Decode the group of blocks header or slice header.

Returns
<0 if an error occurred

Definition at line 116 of file h261dec.c.

Referenced by h261_resync().

◆ h261_resync()

static int h261_resync ( H261DecContext h)
static

Decode the group of blocks / video packet header.

Returns
<0 if no resync found

Definition at line 170 of file h261dec.c.

Referenced by h261_decode_frame().

◆ h261_decode_mb_skipped()

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

Decode skipped macroblocks.

Returns
0

Definition at line 211 of file h261dec.c.

Referenced by h261_decode_gob().

◆ decode_mv_component()

static int decode_mv_component ( GetBitContext gb,
int  v 
)
static

Definition at line 254 of file h261dec.c.

Referenced by h261_decode_mb().

◆ h261_decode_block()

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

Decode a macroblock.

Returns
<0 if an error occurred

Definition at line 280 of file h261dec.c.

Referenced by h261_decode_mb().

◆ h261_decode_mb()

static int h261_decode_mb ( H261DecContext h)
static

Definition at line 372 of file h261dec.c.

Referenced by h261_decode_gob().

◆ h261_decode_picture_header()

static int h261_decode_picture_header ( H261DecContext h)
static

Decode the H.261 picture header.

Returns
<0 if no startcode found

Definition at line 496 of file h261dec.c.

Referenced by h261_decode_frame().

◆ h261_decode_gob()

static int h261_decode_gob ( H261DecContext h)
static

Definition at line 551 of file h261dec.c.

Referenced by h261_decode_frame().

◆ get_consumed_bytes()

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 583 of file h261dec.c.

Referenced by h261_decode_frame().

◆ h261_decode_frame()

static int h261_decode_frame ( AVCodecContext avctx,
AVFrame pict,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 594 of file h261dec.c.

◆ h261_decode_end()

static av_cold int h261_decode_end ( AVCodecContext avctx)
static

Definition at line 664 of file h261dec.c.

Variable Documentation

◆ h261_mba_vlc

VLC h261_mba_vlc
static

Definition at line 47 of file h261dec.c.

Referenced by h261_decode_init_static(), and h261_decode_mb().

◆ h261_mtype_vlc

VLC h261_mtype_vlc
static

Definition at line 48 of file h261dec.c.

Referenced by h261_decode_init_static(), and h261_decode_mb().

◆ h261_mv_vlc

VLC h261_mv_vlc
static

Definition at line 49 of file h261dec.c.

Referenced by decode_mv_component(), and h261_decode_init_static().

◆ h261_cbp_vlc

VLC h261_cbp_vlc
static

Definition at line 50 of file h261dec.c.

Referenced by h261_decode_init_static(), and h261_decode_mb().

◆ mvmap

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 250 of file h261dec.c.

Referenced by decode_mv_component().

◆ ff_h261_decoder

const FFCodec ff_h261_decoder
Initial value:
= {
.p.name = "h261",
CODEC_LONG_NAME("H.261"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(H261DecContext),
.close = h261_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.p.max_lowres = 3,
}

Definition at line 673 of file h261dec.c.

AV_CODEC_ID_H261
@ AV_CODEC_ID_H261
Definition: codec_id.h:55
h261_decode_init
static av_cold int h261_decode_init(AVCodecContext *avctx)
Definition: h261dec.c:82
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
h261_decode_end
static av_cold int h261_decode_end(AVCodecContext *avctx)
Definition: h261dec.c:664
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
h261_decode_frame
static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt)
Definition: h261dec.c:594
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
H261DecContext
Definition: h261dec.c:52