#include "common.h"#include "dsputil.h"#include "avcodec.h"#include "mpegvideo.h"#include "h261data.h"

Go to the source code of this file.
Definition in file h261.c.
| #define H261_CBP_VLC_BITS 9 |
| #define H261_MBA_VLC_BITS 9 |
| #define H261_MTYPE_VLC_BITS 6 |
| #define H261_MV_VLC_BITS 7 |
Definition at line 35 of file h261.c.
Referenced by decode_mv_component(), and h261_decode_init_vlc().
| #define MBA_STARTCODE 34 |
| #define MBA_STUFFING 33 |
| #define TCOEFF_VLC_BITS 9 |
| static int decode_mv_component | ( | GetBitContext * | gb, | |
| int | v | |||
| ) | [static] |
Definition at line 552 of file h261.c.
References get_bits1(), get_vlc2(), H261_MV_VLC_BITS, mvmap, and VLC::table.
Referenced by h261_decode_mb().

| void ff_h261_encode_init | ( | MpegEncContext * | s | ) |
Definition at line 280 of file h261.c.
References MpegEncContext::c_dc_scale_table, ff_mpeg1_dc_scale_table, h261_rl_tcoeff, init_rl(), MpegEncContext::max_qcoeff, MpegEncContext::min_qcoeff, and MpegEncContext::y_dc_scale_table.

| void ff_h261_encode_mb | ( | MpegEncContext * | s, | |
| DCTELEM | block[6][64], | |||
| int | motion_x, | |||
| int | motion_y | |||
| ) |
Definition at line 199 of file h261.c.
References H261Context::current_mba, H261Context::current_mv_x, H261Context::current_mv_y, MpegEncContext::dquant, ff_set_qscale(), get_cbp(), h261_cbp_tab, h261_encode_block(), h261_encode_motion(), h261_mba_bits, h261_mba_code, h261_mtype_bits, h261_mtype_code, h261_mtype_map, HAS_CBP, IS_16X16, IS_QUANT, MpegEncContext::loop_filter, MpegEncContext::mb_intra, H261Context::mtype, MpegEncContext::pb, H261Context::previous_mba, put_bits(), MpegEncContext::qscale, and MpegEncContext::skip_count.

| void ff_h261_encode_picture_header | ( | MpegEncContext * | s, | |
| int | picture_number | |||
| ) |
Definition at line 95 of file h261.c.
References align_put_bits(), MpegEncContext::avctx, H261Context::current_mba, AVRational::den, ff_h261_get_picture_format(), H261Context::gob_number, MpegEncContext::height, AVRational::num, MpegEncContext::pb, pbBufPtr(), MpegEncContext::picture_number, MpegEncContext::ptr_lastgob, put_bits(), AVCodecContext::time_base, and MpegEncContext::width.

| static int ff_h261_get_picture_format | ( | int | width, | |
| int | height | |||
| ) | [static] |
Definition at line 78 of file h261.c.
Referenced by ff_h261_encode_picture_header(), ff_h261_reorder_mb_index(), and h261_encode_gob_header().
| void ff_h261_loop_filter | ( | MpegEncContext * | s | ) |
Definition at line 59 of file h261.c.
References MpegEncContext::dest, MpegEncContext::dsp, DSPContext::h261_loop_filter, IS_FIL, MpegEncContext::linesize, H261Context::mtype, and MpegEncContext::uvlinesize.
Referenced by mpeg_motion().
| void ff_h261_reorder_mb_index | ( | MpegEncContext * | s | ) |
Definition at line 150 of file h261.c.
References ff_h261_get_picture_format(), ff_init_block_index(), ff_update_block_index(), h261_encode_gob_header(), MpegEncContext::height, MpegEncContext::mb_width, MpegEncContext::mb_x, MpegEncContext::mb_y, and MpegEncContext::width.

| static int ff_h261_resync | ( | H261Context * | h | ) | [static] |
decodes the group of blocks / video packet header.
Definition at line 478 of file h261.c.
References align_get_bits(), MpegEncContext::gb, get_bits_count(), H261Context::gob_start_code_skipped, h261_decode_gob_header(), MpegEncContext::last_resync_gb, H261Context::s, s, show_bits(), GetBitContext::size_in_bits, and skip_bits().
Referenced by h261_decode_frame().

| static int get_cbp | ( | MpegEncContext * | s, | |
| DCTELEM | block[6][64] | |||
| ) | [inline, static] |
Definition at line 188 of file h261.c.
References MpegEncContext::block_last_index.
Referenced by ff_h261_encode_mb().
| 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 906 of file h261.c.
References MpegEncContext::gb, and get_bits_count().
Referenced by decode_frame(), ff_h263_decode_frame(), and h261_decode_frame().

| static int h261_decode_block | ( | H261Context * | h, | |
| DCTELEM * | block, | |||
| int | n, | |||
| int | coded | |||
| ) | [static] |
decodes a macroblock
Definition at line 683 of file h261.c.
References av_log(), AV_LOG_ERROR, MpegEncContext::avctx, MpegEncContext::block_last_index, check, MpegEncContext::gb, get_bits(), get_bits1(), get_sbits(), get_vlc2(), h261_rl_tcoeff, MpegEncContext::intra_scantable, level, MpegEncContext::mb_intra, MpegEncContext::mb_x, MpegEncContext::mb_y, RLTable::n, ScanTable::permutated, run, H261Context::s, s, show_bits(), skip_bits(), VLC::table, RLTable::table_level, RLTable::table_run, TCOEFF_VLC_BITS, and RLTable::vlc.
Referenced by h261_decode_mb().

| static int h261_decode_end | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 1008 of file h261.c.
References MPV_common_end(), AVCodecContext::priv_data, H261Context::s, and s.

| static int h261_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 914 of file h261.c.
References av_log(), AV_LOG_ERROR, avcodec_set_dimensions(), MpegEncContext::avctx, AVDISCARD_ALL, AVDISCARD_NONKEY, AVDISCARD_NONREF, B_TYPE, ParseContext::buffer, AVCodecContext::coded_height, AVCodecContext::coded_width, MpegEncContext::context_initialized, MpegEncContext::current_picture, MpegEncContext::current_picture_ptr, ff_er_frame_start(), ff_find_unused_picture(), ff_h261_resync(), ff_print_debug_info(), AVCodecContext::flags, MpegEncContext::flags, AVCodecContext::flags2, MpegEncContext::flags2, AVCodecContext::frame_number, MpegEncContext::gb, get_consumed_bytes(), H261Context::gob_number, H261Context::gob_start_code_skipped, h261_decode_gob(), h261_decode_picture_header(), MpegEncContext::height, AVCodecContext::hurry_up, I_TYPE, init_get_bits(), MpegEncContext::mb_height, MpegEncContext::mb_x, MpegEncContext::mb_y, MPV_common_end(), MPV_common_init(), MPV_frame_end(), MPV_frame_start(), NULL, MpegEncContext::parse_context, MpegEncContext::pict_type, MpegEncContext::picture, MpegEncContext::picture_number, AVCodecContext::priv_data, H261Context::s, s, AVCodecContext::skip_frame, and MpegEncContext::width.

| static int h261_decode_gob | ( | H261Context * | h | ) | [static] |
Definition at line 823 of file h261.c.
References av_log(), AV_LOG_ERROR, MpegEncContext::avctx, H261Context::current_mba, ff_set_qscale(), h261_decode_mb(), h261_decode_mb_skipped(), MpegEncContext::mb_stride, MpegEncContext::mb_x, MpegEncContext::mb_y, H261Context::mba_diff, MBA_STUFFING, MpegEncContext::qscale, H261Context::s, s, and SLICE_END.
Referenced by h261_decode_frame().

| static int h261_decode_gob_header | ( | H261Context * | h | ) | [static] |
decodes the group of blocks header or slice header.
Definition at line 428 of file h261.c.
References H261Context::current_mba, MpegEncContext::gb, get_bits(), get_bits1(), H261Context::gob_number, H261Context::gob_start_code_skipped, MpegEncContext::mb_height, H261Context::mba_diff, MpegEncContext::qscale, H261Context::s, s, show_bits(), and skip_bits().
Referenced by ff_h261_resync().

| static int h261_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 399 of file h261.c.
References MpegEncContext::avctx, AVCodecContext::codec, MpegEncContext::codec_id, AVCodecContext::coded_height, AVCodecContext::coded_width, FMT_H261, H261Context::gob_start_code_skipped, h261_decode_init_vlc(), MpegEncContext::height, AVCodec::id, MpegEncContext::low_delay, MPV_decode_defaults(), MpegEncContext::out_format, AVCodecContext::pix_fmt, PIX_FMT_YUV420P, AVCodecContext::priv_data, H261Context::s, s, and MpegEncContext::width.

| static void h261_decode_init_vlc | ( | H261Context * | h | ) | [static] |
Definition at line 377 of file h261.c.
References h261_cbp_tab, H261_CBP_VLC_BITS, h261_mba_bits, h261_mba_code, H261_MBA_VLC_BITS, h261_mtype_bits, h261_mtype_code, H261_MTYPE_VLC_BITS, h261_mv_tab, H261_MV_VLC_BITS, h261_rl_tcoeff, init_rl(), init_vlc(), and init_vlc_rl().
Referenced by h261_decode_init().

| static int h261_decode_mb | ( | H261Context * | h | ) | [static] |
Definition at line 571 of file h261.c.
References av_log(), AV_LOG_ERROR, MpegEncContext::avctx, MpegEncContext::block, MpegEncContext::block_last_index, DSPContext::clear_blocks, H261Context::current_mba, H261Context::current_mv_x, H261Context::current_mv_y, MpegEncContext::current_picture, decode_mv_component(), MpegEncContext::dsp, ff_init_block_index(), ff_set_qscale(), ff_update_block_index(), MpegEncContext::gb, get_bits(), get_bits_count(), get_vlc2(), H261Context::gob_number, H261Context::gob_start_code_skipped, H261_CBP_VLC_BITS, h261_decode_block(), H261_MBA_VLC_BITS, h261_mtype_map, H261_MTYPE_VLC_BITS, HAS_CBP, IS_16X16, IS_INTRA4x4, IS_QUANT, MpegEncContext::mb_intra, MpegEncContext::mb_stride, MB_TYPE_16x16, MB_TYPE_INTRA, MB_TYPE_L0, MpegEncContext::mb_x, MpegEncContext::mb_y, H261Context::mba_diff, MBA_STARTCODE, MBA_STUFFING, MPV_decode_mb(), H261Context::mtype, MpegEncContext::mv, MpegEncContext::mv_dir, MV_DIR_FORWARD, MpegEncContext::mv_type, MV_TYPE_16X16, H261Context::s, s, GetBitContext::size_in_bits, SLICE_END, SLICE_ERROR, SLICE_OK, and VLC::table.
Referenced by h261_decode_gob().

| static int h261_decode_mb_skipped | ( | H261Context * | h, | |
| int | mba1, | |||
| int | mba2 | |||
| ) | [static] |
decodes skipped macroblocks
Definition at line 519 of file h261.c.
References MpegEncContext::block, MpegEncContext::block_last_index, MpegEncContext::current_picture, ff_init_block_index(), ff_update_block_index(), H261Context::gob_number, MpegEncContext::mb_intra, MpegEncContext::mb_skipped, MpegEncContext::mb_stride, MB_TYPE_16x16, MB_TYPE_H261_FIL, MB_TYPE_L0, MB_TYPE_SKIP, MpegEncContext::mb_x, MpegEncContext::mb_y, MPV_decode_mb(), H261Context::mtype, MpegEncContext::mv, MpegEncContext::mv_dir, MV_DIR_FORWARD, MpegEncContext::mv_type, MV_TYPE_16X16, H261Context::s, and s.
Referenced by h261_decode_gob().

| int h261_decode_picture_header | ( | H261Context * | h | ) |
decodes the H261 picture header.
Definition at line 765 of file h261.c.
References av_log(), AV_LOG_ERROR, MpegEncContext::avctx, MpegEncContext::gb, get_bits(), get_bits1(), get_bits_count(), H261Context::gob_number, MpegEncContext::height, MpegEncContext::mb_height, MpegEncContext::mb_num, MpegEncContext::mb_width, P_TYPE, MpegEncContext::pict_type, MpegEncContext::picture_number, H261Context::s, s, GetBitContext::size_in_bits, skip_bits(), skip_bits1(), and MpegEncContext::width.
Referenced by h261_decode_frame().

| static void h261_encode_block | ( | H261Context * | h, | |
| DCTELEM * | block, | |||
| int | n | |||
| ) | [static] |
encodes a 8x8 block.
| block | the 8x8 block | |
| n | block index (0-3 are luma, 4-5 are chroma) |
Definition at line 300 of file h261.c.
References MpegEncContext::block_last_index, get_rl_index(), h261_rl_tcoeff, MpegEncContext::intra_scantable, level, MpegEncContext::mb_intra, RLTable::n, MpegEncContext::pb, ScanTable::permutated, put_bits(), run, H261Context::s, s, and RLTable::table_vlc.
Referenced by ff_h261_encode_mb().

| static void h261_encode_gob_header | ( | MpegEncContext * | s, | |
| int | mb_line | |||
| ) | [static] |
Encodes a group of blocks header.
Definition at line 132 of file h261.c.
References H261Context::current_mba, H261Context::current_mv_x, H261Context::current_mv_y, ff_h261_get_picture_format(), H261Context::gob_number, MpegEncContext::height, MpegEncContext::pb, H261Context::previous_mba, put_bits(), MpegEncContext::qscale, and MpegEncContext::width.
Referenced by ff_h261_reorder_mb_index().

| static void h261_encode_motion | ( | H261Context * | h, | |
| int | val | |||
| ) | [static] |
Definition at line 169 of file h261.c.
References h261_mv_tab, MpegEncContext::pb, put_bits(), H261Context::s, and s.
Referenced by ff_h261_encode_mb().

| static int h261_find_frame_end | ( | ParseContext * | pc, | |
| AVCodecContext * | avctx, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 849 of file h261.c.
References END_NOT_FOUND, ParseContext::frame_start_found, and ParseContext::state.
Referenced by h261_parse().
| static int h261_parse | ( | AVCodecParserContext * | s, | |
| AVCodecContext * | avctx, | |||
| uint8_t ** | poutbuf, | |||
| int * | poutbuf_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 884 of file h261.c.
References ff_combine_frame(), h261_find_frame_end(), NULL, and AVCodecParserContext::priv_data.

| void init_vlc_rl | ( | RLTable * | rl, | |
| int | use_static | |||
| ) |
Definition at line 2865 of file h263.c.
Referenced by ff_msmpeg4_decode_init(), h261_decode_init_vlc(), and h263_decode_init_vlc().
VLC h261_cbp_vlc [static] |
Initial value:
{
"h261",
CODEC_TYPE_VIDEO,
CODEC_ID_H261,
sizeof(H261Context),
h261_decode_init,
NULL,
h261_decode_end,
h261_decode_frame,
CODEC_CAP_DR1,
}
Definition at line 1029 of file h261.c.
Referenced by avcodec_register_all().
VLC h261_mba_vlc [static] |
VLC h261_mtype_vlc [static] |
VLC h261_mv_vlc [static] |
Initial value:
{
{ CODEC_ID_H261 },
sizeof(ParseContext),
NULL,
h261_parse,
ff_parse_close,
}
Definition at line 1041 of file h261.c.
Referenced by avcodec_register_all().
1.5.5