#include <limits.h>
#include "dsputil.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "h263data.h"
#include "mpeg4data.h"
#include "mathops.h"
Go to the source code of this file.
Defines | |
#define | INTRA_MCBPC_VLC_BITS 6 |
#define | INTER_MCBPC_VLC_BITS 7 |
#define | CBPY_VLC_BITS 6 |
#define | MV_VLC_BITS 9 |
#define | DC_VLC_BITS 9 |
#define | SPRITE_TRAJ_VLC_BITS 6 |
#define | MB_TYPE_B_VLC_BITS 4 |
#define | TEX_VLC_BITS 9 |
#define | H263_MBTYPE_B_VLC_BITS 6 |
#define | CBPC_B_VLC_BITS 3 |
#define | IS_3IV1 0 |
#define | tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0])) |
#define | tab_bias (tab_size/2) |
Functions | |
static void | h263_encode_block (MpegEncContext *s, DCTELEM *block, int n) |
static void | h263p_encode_umotion (MpegEncContext *s, int val) |
static void | mpeg4_encode_block (MpegEncContext *s, DCTELEM *block, int n, int dc, uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb) |
static int | mpeg4_get_block_length (MpegEncContext *s, DCTELEM *block, int n, int intra_dc, uint8_t *scan_table) |
static int | h263_decode_motion (MpegEncContext *s, int pred, int fcode) |
static int | h263p_decode_umotion (MpegEncContext *s, int pred) |
static int | h263_decode_block (MpegEncContext *s, DCTELEM *block, int n, int coded) |
static int | mpeg4_decode_dc (MpegEncContext *s, int n, int *dir_ptr) |
decodes the dc value. | |
static int | mpeg4_decode_block (MpegEncContext *s, DCTELEM *block, int n, int coded, int intra, int rvlc) |
decodes a block. | |
static int | h263_pred_dc (MpegEncContext *s, int n, int16_t **dc_val_ptr) |
static void | mpeg4_encode_visual_object_header (MpegEncContext *s) |
static void | mpeg4_encode_vol_header (MpegEncContext *s, int vo_number, int vol_number) |
static void | mpeg4_decode_sprite_trajectory (MpegEncContext *s, GetBitContext *gb) |
static int | ff_mpeg4_pred_dc (MpegEncContext *s, int n, int level, int *dir_ptr, int encoding) |
predicts the dc. | |
int | h263_get_picture_format (int width, int height) |
static void | show_pict_info (MpegEncContext *s) |
void | ff_mpeg4_init_direct_mv (MpegEncContext *s) |
static void | ff_mpeg4_set_one_direct_mv (MpegEncContext *s, int mx, int my, int i) |
int | ff_mpeg4_set_direct_mv (MpegEncContext *s, int mx, int my) |
void | ff_h263_update_motion_val (MpegEncContext *s) |
void | ff_h263_loop_filter (MpegEncContext *s) |
static void | h263_pred_acdc (MpegEncContext *s, DCTELEM *block, int n) |
int16_t * | h263_pred_motion (MpegEncContext *s, int block, int dir, int *px, int *py) |
void | mpeg4_pred_ac (MpegEncContext *s, DCTELEM *block, int n, int dir) |
predicts the ac. | |
void | h263_decode_init_vlc (MpegEncContext *s) |
int | ff_h263_get_gob_height (MpegEncContext *s) |
Get the GOB height based on picture height. | |
int | ff_h263_decode_mba (MpegEncContext *s) |
void | ff_h263_encode_mba (MpegEncContext *s) |
static int | h263_decode_gob_header (MpegEncContext *s) |
decodes the group of blocks header or slice header. | |
static void | memsetw (short *tab, int val, int n) |
int | ff_mpeg4_get_video_packet_prefix_length (MpegEncContext *s) |
static int | mpeg4_is_resync (MpegEncContext *s) |
check if the next stuff is a resync marker or the end. | |
static int | mpeg4_decode_video_packet_header (MpegEncContext *s) |
decodes the next video packet. | |
void | ff_mpeg4_clean_buffers (MpegEncContext *s) |
const uint8_t * | ff_h263_find_resync_marker (const uint8_t *restrict p, const uint8_t *restrict end) |
finds the next resync_marker | |
int | ff_h263_resync (MpegEncContext *s) |
decodes the group of blocks / video packet header. | |
static int | get_amv (MpegEncContext *s, int n) |
gets the average motion vector for a GMC MB. | |
static int | mpeg4_decode_partition_a (MpegEncContext *s) |
decodes first partition. | |
static int | mpeg4_decode_partition_b (MpegEncContext *s, int mb_count) |
decode second partition. | |
int | ff_mpeg4_decode_partitions (MpegEncContext *s) |
decodes the first & second partition | |
static int | mpeg4_decode_partitioned_mb (MpegEncContext *s, DCTELEM block[6][64]) |
decode partition C of one MB. | |
static void | preview_obmc (MpegEncContext *s) |
read the next MVs for OBMC. | |
static void | h263_decode_dquant (MpegEncContext *s) |
int | ff_h263_decode_mb (MpegEncContext *s, DCTELEM block[6][64]) |
int | ff_mpeg4_decode_mb (MpegEncContext *s, DCTELEM block[6][64]) |
int | h263_decode_picture_header (MpegEncContext *s) |
static int | mpeg4_decode_gop_header (MpegEncContext *s, GetBitContext *gb) |
static int | decode_vol_header (MpegEncContext *s, GetBitContext *gb) |
static int | decode_user_data (MpegEncContext *s, GetBitContext *gb) |
decodes the user data stuff in the header. | |
static int | decode_vop_header (MpegEncContext *s, GetBitContext *gb) |
int | ff_mpeg4_decode_picture_header (MpegEncContext *s, GetBitContext *gb) |
decode mpeg4 headers | |
int | intel_h263_decode_picture_header (MpegEncContext *s) |
int | flv_h263_decode_picture_header (MpegEncContext *s) |
Variables | |
static uint8_t | static_rl_table_store [5][2][2 *MAX_RUN+MAX_LEVEL+3] |
static VLC | intra_MCBPC_vlc |
static VLC | inter_MCBPC_vlc |
static VLC | cbpy_vlc |
static VLC | mv_vlc |
static VLC | dc_lum |
static VLC | dc_chrom |
static VLC | sprite_trajectory |
static VLC | mb_type_b_vlc |
static VLC | h263_mbtype_b_vlc |
static VLC | cbpc_b_vlc |
Definition in file h263.c.
#define CBPC_B_VLC_BITS 3 |
Definition at line 56 of file h263.c.
Referenced by ff_h263_decode_mb(), and h263_decode_init_vlc().
#define CBPY_VLC_BITS 6 |
Definition at line 49 of file h263.c.
Referenced by ff_h263_decode_mb(), ff_mpeg4_decode_mb(), ff_msmpeg4_decode_init(), h263_decode_init_vlc(), mpeg4_decode_partition_b(), msmpeg4v12_decode_mb(), and preview_obmc().
#define DC_VLC_BITS 9 |
Definition at line 51 of file h263.c.
Referenced by decode_dc(), ff_mpeg12_init_vlcs(), ff_msmpeg4_decode_init(), h263_decode_init_vlc(), mpeg4_decode_dc(), msmpeg4_decode_dc(), rv10_decode_init(), rv_decode_dc(), vc1_decode_i_block(), vc1_decode_i_block_adv(), vc1_decode_intra_block(), and x8_get_dc_rlf().
#define H263_MBTYPE_B_VLC_BITS 6 |
Definition at line 55 of file h263.c.
Referenced by ff_h263_decode_mb(), and h263_decode_init_vlc().
#define INTER_MCBPC_VLC_BITS 7 |
Definition at line 48 of file h263.c.
Referenced by ff_h263_decode_mb(), ff_mpeg4_decode_mb(), h263_decode_init_vlc(), mpeg4_decode_partition_a(), and preview_obmc().
#define INTRA_MCBPC_VLC_BITS 6 |
Definition at line 47 of file h263.c.
Referenced by ff_h263_decode_mb(), ff_mpeg4_decode_mb(), h263_decode_init_vlc(), and mpeg4_decode_partition_a().
#define IS_3IV1 0 |
Definition at line 118 of file h263.c.
Referenced by decode_vop_header(), ff_mpeg4_pred_dc(), mpeg4_decode_block(), and mpeg4_decode_dc().
#define MB_TYPE_B_VLC_BITS 4 |
Definition at line 53 of file h263.c.
Referenced by ff_mpeg4_decode_mb(), and h263_decode_init_vlc().
#define MV_VLC_BITS 9 |
Definition at line 50 of file h263.c.
Referenced by ff_mpeg12_init_vlcs(), ff_msmpeg4_decode_init(), ff_msmpeg4_decode_motion(), h263_decode_init_vlc(), h263_decode_motion(), and mpeg_decode_motion().
#define SPRITE_TRAJ_VLC_BITS 6 |
Definition at line 52 of file h263.c.
Referenced by h263_decode_init_vlc(), and mpeg4_decode_sprite_trajectory().
#define tab_bias (tab_size/2) |
Definition at line 590 of file h263.c.
Referenced by ff_mpeg4_init_direct_mv(), and ff_mpeg4_set_one_direct_mv().
#define tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0])) |
Definition at line 589 of file h263.c.
Referenced by ff_mpeg4_init_direct_mv(), and ff_mpeg4_set_one_direct_mv().
static int decode_user_data | ( | MpegEncContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
decodes the user data stuff in the header.
Also initializes divx/xvid/lavc_version/build.
Definition at line 5806 of file h263.c.
Referenced by ff_mpeg4_decode_picture_header().
static int decode_vol_header | ( | MpegEncContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
static int decode_vop_header | ( | MpegEncContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
int ff_h263_decode_mb | ( | MpegEncContext * | s, | |
DCTELEM | block[6][64] | |||
) |
Definition at line 3908 of file h263.c.
Referenced by ff_h263_decode_init(), and rv10_decode_packet().
int ff_h263_decode_mba | ( | MpegEncContext * | s | ) |
Definition at line 2964 of file h263.c.
Referenced by h263_decode_gob_header(), h263_decode_picture_header(), and rv20_decode_picture_header().
void ff_h263_encode_mba | ( | MpegEncContext * | s | ) |
const uint8_t* ff_h263_find_resync_marker | ( | const uint8_t *restrict | p, | |
const uint8_t *restrict | end | |||
) |
finds the next resync_marker
p | pointer to buffer to scan | |
end | pointer to the end of the buffer |
end
if none was found Definition at line 3301 of file h263.c.
Referenced by decode_slice().
int ff_h263_get_gob_height | ( | MpegEncContext * | s | ) |
Get the GOB height based on picture height.
Definition at line 2955 of file h263.c.
Referenced by encode_thread(), and ff_h263_decode_frame().
void ff_h263_loop_filter | ( | MpegEncContext * | s | ) |
Definition at line 1464 of file h263.c.
Referenced by decode_slice(), encode_thread(), and rv10_decode_packet().
int ff_h263_resync | ( | MpegEncContext * | s | ) |
decodes the group of blocks / video packet header.
Definition at line 3320 of file h263.c.
Referenced by ff_h263_decode_frame().
void ff_h263_update_motion_val | ( | MpegEncContext * | s | ) |
Definition at line 686 of file h263.c.
Referenced by decode_slice(), encode_thread(), and rv10_decode_packet().
void ff_mpeg4_clean_buffers | ( | MpegEncContext * | s | ) |
int ff_mpeg4_decode_mb | ( | MpegEncContext * | s, | |
DCTELEM | block[6][64] | |||
) |
Definition at line 4174 of file h263.c.
Referenced by decode_vop_header(), and ff_h263_decode_init().
int ff_mpeg4_decode_partitions | ( | MpegEncContext * | s | ) |
decodes the first & second partition
Definition at line 3664 of file h263.c.
Referenced by decode_slice().
int ff_mpeg4_decode_picture_header | ( | MpegEncContext * | s, | |
GetBitContext * | gb | |||
) |
decode mpeg4 headers
Definition at line 6080 of file h263.c.
Referenced by av_mpeg4_decode_header(), and ff_h263_decode_frame().
int ff_mpeg4_get_video_packet_prefix_length | ( | MpegEncContext * | s | ) |
Definition at line 3094 of file h263.c.
Referenced by mpeg4_decode_video_packet_header(), and mpeg4_is_resync().
void ff_mpeg4_init_direct_mv | ( | MpegEncContext * | s | ) |
Definition at line 592 of file h263.c.
Referenced by decode_vop_header(), and rv20_decode_picture_header().
static int ff_mpeg4_pred_dc | ( | MpegEncContext * | s, | |
int | n, | |||
int | level, | |||
int * | dir_ptr, | |||
int | encoding | |||
) | [inline, static] |
predicts the dc.
encoding quantized level -> quantized diff decoding quantized diff -> quantized level
n | block index (0-3 are luma, 4-5 are chroma) | |
dir_ptr | pointer to an integer where the prediction direction will be stored |
Definition at line 2522 of file h263.c.
Referenced by mpeg4_decode_block(), and mpeg4_decode_dc().
int ff_mpeg4_set_direct_mv | ( | MpegEncContext * | s, | |
int | mx, | |||
int | my | |||
) |
Definition at line 635 of file h263.c.
Referenced by encode_thread(), ff_h263_decode_mb(), and ff_mpeg4_decode_mb().
static void ff_mpeg4_set_one_direct_mv | ( | MpegEncContext * | s, | |
int | mx, | |||
int | my, | |||
int | i | |||
) | [inline, static] |
int flv_h263_decode_picture_header | ( | MpegEncContext * | s | ) |
static int get_amv | ( | MpegEncContext * | s, | |
int | n | |||
) | [inline, static] |
gets the average motion vector for a GMC MB.
n | either 0 for the x component or 1 for y |
Definition at line 3367 of file h263.c.
Referenced by ff_mpeg4_decode_mb(), and mpeg4_decode_partition_a().
static int h263_decode_block | ( | MpegEncContext * | s, | |
DCTELEM * | block, | |||
int | n, | |||
int | coded | |||
) | [static] |
static void h263_decode_dquant | ( | MpegEncContext * | s | ) | [static] |
static int h263_decode_gob_header | ( | MpegEncContext * | s | ) | [static] |
decodes the group of blocks header or slice header.
Definition at line 2993 of file h263.c.
Referenced by ff_h263_resync().
void h263_decode_init_vlc | ( | MpegEncContext * | s | ) |
Definition at line 2902 of file h263.c.
Referenced by ff_h263_decode_init(), and rv10_decode_init().
static int h263_decode_motion | ( | MpegEncContext * | s, | |
int | pred, | |||
int | fcode | |||
) | [static] |
Definition at line 4504 of file h263.c.
Referenced by ff_h263_decode_mb(), ff_mpeg4_decode_mb(), mpeg4_decode_partition_a(), and preview_obmc().
int h263_decode_picture_header | ( | MpegEncContext * | s | ) |
static void h263_encode_block | ( | MpegEncContext * | s, | |
DCTELEM * | block, | |||
int | n | |||
) | [static] |
int h263_get_picture_format | ( | int | width, | |
int | height | |||
) |
static void h263_pred_acdc | ( | MpegEncContext * | s, | |
DCTELEM * | block, | |||
int | n | |||
) | [static] |
static int h263_pred_dc | ( | MpegEncContext * | s, | |
int | n, | |||
int16_t ** | dc_val_ptr | |||
) | [static] |
int16_t* h263_pred_motion | ( | MpegEncContext * | s, | |
int | block, | |||
int | dir, | |||
int * | px, | |||
int * | py | |||
) |
Definition at line 1685 of file h263.c.
Referenced by ff_h263_decode_mb(), ff_mpeg4_decode_mb(), ff_wmv2_encode_mb(), mpeg4_decode_partition_a(), msmpeg4v12_decode_mb(), msmpeg4v34_decode_mb(), preview_obmc(), and svq1_encode_plane().
static int h263p_decode_umotion | ( | MpegEncContext * | s, | |
int | pred | |||
) | [static] |
static void h263p_encode_umotion | ( | MpegEncContext * | s, | |
int | val | |||
) | [static] |
int intel_h263_decode_picture_header | ( | MpegEncContext * | s | ) |
static void memsetw | ( | short * | tab, | |
int | val, | |||
int | n | |||
) | [inline, static] |
static int mpeg4_decode_block | ( | MpegEncContext * | s, | |
DCTELEM * | block, | |||
int | n, | |||
int | coded, | |||
int | intra, | |||
int | rvlc | |||
) | [inline, static] |
decodes a block.
Definition at line 4748 of file h263.c.
Referenced by ff_mpeg4_decode_mb(), and mpeg4_decode_partitioned_mb().
static int mpeg4_decode_dc | ( | MpegEncContext * | s, | |
int | n, | |||
int * | dir_ptr | |||
) | [inline, static] |
decodes the dc value.
n | block index (0-3 are luma, 4-5 are chroma) | |
dir_ptr | the prediction direction will be stored here |
Definition at line 4703 of file h263.c.
Referenced by mpeg4_decode_block(), mpeg4_decode_partition_a(), and mpeg4_decode_partition_b().
static int mpeg4_decode_gop_header | ( | MpegEncContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
static int mpeg4_decode_partition_a | ( | MpegEncContext * | s | ) | [static] |
decodes first partition.
Definition at line 3412 of file h263.c.
Referenced by ff_mpeg4_decode_partitions().
static int mpeg4_decode_partition_b | ( | MpegEncContext * | s, | |
int | mb_count | |||
) | [static] |
decode second partition.
Definition at line 3577 of file h263.c.
Referenced by ff_mpeg4_decode_partitions().
static int mpeg4_decode_partitioned_mb | ( | MpegEncContext * | s, | |
DCTELEM | block[6][64] | |||
) | [static] |
decode partition C of one MB.
Definition at line 3717 of file h263.c.
Referenced by decode_vop_header().
static void mpeg4_decode_sprite_trajectory | ( | MpegEncContext * | s, | |
GetBitContext * | gb | |||
) | [static] |
Definition at line 5267 of file h263.c.
Referenced by decode_vop_header(), and mpeg4_decode_video_packet_header().
static int mpeg4_decode_video_packet_header | ( | MpegEncContext * | s | ) | [static] |
decodes the next video packet.
Definition at line 3175 of file h263.c.
Referenced by ff_h263_resync().
static void mpeg4_encode_block | ( | MpegEncContext * | s, | |
DCTELEM * | block, | |||
int | n, | |||
int | dc, | |||
uint8_t * | scan_table, | |||
PutBitContext * | dc_pb, | |||
PutBitContext * | ac_pb | |||
) | [inline, static] |
static void mpeg4_encode_visual_object_header | ( | MpegEncContext * | s | ) | [static] |
static void mpeg4_encode_vol_header | ( | MpegEncContext * | s, | |
int | vo_number, | |||
int | vol_number | |||
) | [static] |
static int mpeg4_get_block_length | ( | MpegEncContext * | s, | |
DCTELEM * | block, | |||
int | n, | |||
int | intra_dc, | |||
uint8_t * | scan_table | |||
) | [static] |
static int mpeg4_is_resync | ( | MpegEncContext * | s | ) | [inline, static] |
check if the next stuff is a resync marker or the end.
Definition at line 3128 of file h263.c.
Referenced by ff_mpeg4_decode_mb(), and mpeg4_decode_partitioned_mb().
void mpeg4_pred_ac | ( | MpegEncContext * | s, | |
DCTELEM * | block, | |||
int | n, | |||
int | dir | |||
) |
predicts the ac.
n | block index (0-3 are luma, 4-5 are chroma) | |
dir | the ac prediction direction |
Definition at line 2599 of file h263.c.
Referenced by ff_msmpeg4_decode_block(), and mpeg4_decode_block().
static void preview_obmc | ( | MpegEncContext * | s | ) | [static] |
read the next MVs for OBMC.
yes this is a ugly hack, feel free to send a patch :)
Definition at line 3803 of file h263.c.
Referenced by ff_h263_decode_mb().
static void show_pict_info | ( | MpegEncContext * | s | ) | [static] |
Definition at line 140 of file h263.c.
Referenced by h263_decode_picture_header(), and intel_h263_decode_picture_header().
VLC cbpc_b_vlc [static] |
VLC h263_mbtype_b_vlc [static] |
VLC inter_MCBPC_vlc [static] |
VLC intra_MCBPC_vlc [static] |
VLC mb_type_b_vlc [static] |
VLC sprite_trajectory [static] |
uint8_t static_rl_table_store[5][2][2 *MAX_RUN+MAX_LEVEL+3] [static] |
Definition at line 113 of file h263.c.
Referenced by ff_msmpeg4_decode_init(), and h263_decode_init_vlc().