FFmpeg
|
#include "config_components.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/thread.h"
#include "codec_internal.h"
#include "error_resilience.h"
#include "hwconfig.h"
#include "idctdsp.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpegvideodata.h"
#include "mpegvideodec.h"
#include "mpeg4video.h"
#include "mpeg4videodata.h"
#include "mpeg4videodec.h"
#include "mpeg4videodefs.h"
#include "h263.h"
#include "h263data.h"
#include "h263dec.h"
#include "internal.h"
#include "profiles.h"
#include "qpeldsp.h"
#include "threadprogress.h"
#include "xvididct.h"
#include "unary.h"
Go to the source code of this file.
Macros | |
#define | UNCHECKED_BITSTREAM_READER 1 |
#define | SPRITE_TRAJ_VLC_BITS 6 |
#define | DC_VLC_BITS 9 |
#define | MB_TYPE_B_VLC_BITS 4 |
#define | STUDIO_INTRA_BITS 9 |
#define | SET_QPEL_FUNC(postfix1, postfix2) |
Functions | |
static void | gmc1_motion (MpegEncContext *s, const Mpeg4DecContext *ctx, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture) |
static void | gmc_motion (MpegEncContext *s, const Mpeg4DecContext *ctx, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture) |
void | ff_mpeg4_mcsel_motion (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t *const *ref_picture) |
void | ff_mpeg4_decode_studio (MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int block_size, int uvlinesize, int dct_linesize, int dct_offset) |
void | ff_mpeg4_pred_ac (MpegEncContext *s, int16_t *block, int n, int dir) |
Predict the ac. More... | |
static int | mpeg4_is_resync (Mpeg4DecContext *ctx) |
check if the next stuff is a resync marker or the end. More... | |
static int | mpeg4_decode_sprite_trajectory (Mpeg4DecContext *ctx, GetBitContext *gb) |
static int | decode_new_pred (Mpeg4DecContext *ctx, GetBitContext *gb) |
int | ff_mpeg4_decode_video_packet_header (Mpeg4DecContext *ctx) |
Decode the next video packet. More... | |
static void | reset_studio_dc_predictors (MpegEncContext *s) |
int | ff_mpeg4_decode_studio_slice_header (Mpeg4DecContext *ctx) |
Decode the next video packet. More... | |
static int | get_amv (Mpeg4DecContext *ctx, int n) |
Get the average motion vector for a GMC MB. More... | |
static int | mpeg4_decode_dc (MpegEncContext *s, int n, int *dir_ptr) |
Decode the dc value. More... | |
static int | mpeg4_decode_partition_a (Mpeg4DecContext *ctx) |
Decode first partition. More... | |
static int | mpeg4_decode_partition_b (MpegEncContext *s, int mb_count) |
decode second partition. More... | |
int | ff_mpeg4_decode_partitions (Mpeg4DecContext *ctx) |
Decode the first and second partition. More... | |
static int | mpeg4_decode_block (Mpeg4DecContext *ctx, int16_t *block, int n, int coded, int intra, int use_intra_dc_vlc, int rvlc) |
Decode a block. More... | |
static int | mpeg4_decode_partitioned_mb (MpegEncContext *s, int16_t block[6][64]) |
decode partition C of one MB. More... | |
static int | mpeg4_decode_mb (MpegEncContext *s, int16_t block[6][64]) |
static void | next_start_code_studio (GetBitContext *gb) |
static int | mpeg4_decode_studio_block (MpegEncContext *s, int32_t block[64], int n) |
static int | mpeg4_decode_dpcm_macroblock (MpegEncContext *s, int16_t macroblock[256], int n) |
static int | mpeg4_decode_studio_mb (MpegEncContext *s, int16_t block_[12][64]) |
static int | mpeg4_decode_gop_header (MpegEncContext *s, GetBitContext *gb) |
static int | mpeg4_decode_profile_level (MpegEncContext *s, GetBitContext *gb, int *profile, int *level) |
static int | mpeg4_decode_visual_object (MpegEncContext *s, GetBitContext *gb) |
static void | mpeg4_load_default_matrices (MpegEncContext *s) |
static int | read_quant_matrix_ext (MpegEncContext *s, GetBitContext *gb) |
static void | extension_and_user_data (MpegEncContext *s, GetBitContext *gb, int id) |
static int | decode_studio_vol_header (Mpeg4DecContext *ctx, GetBitContext *gb) |
static int | decode_vol_header (Mpeg4DecContext *ctx, GetBitContext *gb) |
static int | decode_user_data (Mpeg4DecContext *ctx, GetBitContext *gb) |
Decode the user data stuff in the header. More... | |
int | ff_mpeg4_workaround_bugs (AVCodecContext *avctx) |
static int | decode_vop_header (Mpeg4DecContext *ctx, GetBitContext *gb, int parse_only) |
static void | decode_smpte_tc (Mpeg4DecContext *ctx, GetBitContext *gb) |
static int | decode_studio_vop_header (Mpeg4DecContext *ctx, GetBitContext *gb) |
Decode the next studio vop header. More... | |
static int | decode_studiovisualobject (Mpeg4DecContext *ctx, GetBitContext *gb) |
int | ff_mpeg4_decode_picture_header (Mpeg4DecContext *ctx, GetBitContext *gb, int header, int parse_only) |
Decode MPEG-4 headers. More... | |
int | ff_mpeg4_frame_end (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Variables | |
static VLCElem | dc_lum [512] |
static VLCElem | dc_chrom [512] |
static VLCElem | sprite_trajectory [128] |
static VLCElem | mb_type_b_vlc [16] |
static const VLCElem * | studio_intra_tab [12] |
static VLCElem | studio_luma_dc [528] |
static VLCElem | studio_chroma_dc [528] |
static const uint8_t | mpeg4_block_count [4] = { 0, 6, 8, 12 } |
static const int16_t | mb_type_b_map [4] |
static const uint8_t | ac_state_tab [22][2] |
#define UNCHECKED_BITSTREAM_READER 1 |
Definition at line 23 of file mpeg4videodec.c.
#define SPRITE_TRAJ_VLC_BITS 6 |
Definition at line 56 of file mpeg4videodec.c.
#define DC_VLC_BITS 9 |
Definition at line 57 of file mpeg4videodec.c.
#define MB_TYPE_B_VLC_BITS 4 |
Definition at line 58 of file mpeg4videodec.c.
#define STUDIO_INTRA_BITS 9 |
Definition at line 59 of file mpeg4videodec.c.
#define SET_QPEL_FUNC | ( | postfix1, | |
postfix2 | |||
) |
|
static |
Definition at line 77 of file mpeg4videodec.c.
Referenced by ff_mpeg4_mcsel_motion().
|
static |
Definition at line 174 of file mpeg4videodec.c.
Referenced by ff_mpeg4_mcsel_motion().
void ff_mpeg4_mcsel_motion | ( | MpegEncContext * | s, |
uint8_t * | dest_y, | ||
uint8_t * | dest_cb, | ||
uint8_t * | dest_cr, | ||
uint8_t *const * | ref_picture | ||
) |
Definition at line 232 of file mpeg4videodec.c.
Referenced by mpv_motion_internal().
void ff_mpeg4_decode_studio | ( | MpegEncContext * | s, |
uint8_t * | dest_y, | ||
uint8_t * | dest_cb, | ||
uint8_t * | dest_cr, | ||
int | block_size, | ||
int | uvlinesize, | ||
int | dct_linesize, | ||
int | dct_offset | ||
) |
Definition at line 247 of file mpeg4videodec.c.
Referenced by mpv_reconstruct_mb_internal().
void ff_mpeg4_pred_ac | ( | MpegEncContext * | s, |
int16_t * | block, | ||
int | n, | ||
int | dir | ||
) |
Predict the ac.
n | block index (0-3 are luma, 4-5 are chroma) |
dir | the ac prediction direction |
Definition at line 315 of file mpeg4videodec.c.
Referenced by ff_msmpeg4_decode_block(), and mpeg4_decode_block().
|
inlinestatic |
check if the next stuff is a resync marker or the end.
Definition at line 370 of file mpeg4videodec.c.
Referenced by mpeg4_decode_mb(), and mpeg4_decode_partitioned_mb().
|
static |
Definition at line 424 of file mpeg4videodec.c.
Referenced by decode_vop_header(), and ff_mpeg4_decode_video_packet_header().
|
static |
Definition at line 679 of file mpeg4videodec.c.
Referenced by decode_vop_header(), and ff_mpeg4_decode_video_packet_header().
int ff_mpeg4_decode_video_packet_header | ( | Mpeg4DecContext * | ctx | ) |
Decode the next video packet.
Definition at line 695 of file mpeg4videodec.c.
Referenced by ff_h263_resync().
|
static |
Definition at line 782 of file mpeg4videodec.c.
Referenced by decode_studio_vop_header(), and ff_mpeg4_decode_studio_slice_header().
int ff_mpeg4_decode_studio_slice_header | ( | Mpeg4DecContext * | ctx | ) |
Decode the next video packet.
Definition at line 794 of file mpeg4videodec.c.
Referenced by decode_slice().
|
inlinestatic |
Get the average motion vector for a GMC MB.
n | either 0 for the x component or 1 for y |
Definition at line 836 of file mpeg4videodec.c.
Referenced by mpeg4_decode_mb(), and mpeg4_decode_partition_a().
|
inlinestatic |
Decode 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 889 of file mpeg4videodec.c.
Referenced by mpeg4_decode_block(), mpeg4_decode_partition_a(), and mpeg4_decode_partition_b().
|
static |
Decode first partition.
Definition at line 936 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_partitions().
|
static |
decode second partition.
Definition at line 1130 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_partitions().
int ff_mpeg4_decode_partitions | ( | Mpeg4DecContext * | ctx | ) |
Decode the first and second partition.
Definition at line 1223 of file mpeg4videodec.c.
Referenced by decode_slice().
|
inlinestatic |
Decode a block.
Definition at line 1288 of file mpeg4videodec.c.
Referenced by mpeg4_decode_mb(), and mpeg4_decode_partitioned_mb().
|
static |
decode partition C of one MB.
Definition at line 1560 of file mpeg4videodec.c.
Referenced by decode_vop_header().
|
static |
Definition at line 1650 of file mpeg4videodec.c.
Referenced by decode_vop_header().
|
static |
Definition at line 2030 of file mpeg4videodec.c.
Referenced by decode_studio_vol_header(), decode_studio_vop_header(), decode_studiovisualobject(), ff_mpeg4_decode_picture_header(), mpeg4_decode_studio_mb(), and read_quant_matrix_ext().
|
static |
Definition at line 2066 of file mpeg4videodec.c.
Referenced by mpeg4_decode_studio_mb().
|
static |
Definition at line 2181 of file mpeg4videodec.c.
Referenced by mpeg4_decode_studio_mb().
|
static |
Definition at line 2264 of file mpeg4videodec.c.
Referenced by decode_studio_vop_header().
|
static |
Definition at line 2312 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
|
static |
Definition at line 2334 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
|
static |
Definition at line 2348 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
|
static |
Definition at line 2380 of file mpeg4videodec.c.
Referenced by decode_studio_vop_header(), and decode_vol_header().
|
static |
Definition at line 2397 of file mpeg4videodec.c.
Referenced by extension_and_user_data().
|
static |
Definition at line 2446 of file mpeg4videodec.c.
Referenced by decode_studio_vol_header(), decode_studio_vop_header(), decode_studiovisualobject(), and ff_mpeg4_decode_picture_header().
|
static |
Definition at line 2463 of file mpeg4videodec.c.
Referenced by decode_vol_header().
|
static |
Definition at line 2549 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
|
static |
Decode the user data stuff in the header.
Also initializes divx/xvid/lavc_version/build.
Definition at line 2921 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
int ff_mpeg4_workaround_bugs | ( | AVCodecContext * | avctx | ) |
Definition at line 2978 of file mpeg4videodec.c.
Referenced by ff_h263_decode_frame().
|
static |
Definition at line 3095 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
|
static |
Definition at line 3373 of file mpeg4videodec.c.
Referenced by decode_studio_vop_header().
|
static |
Decode the next studio vop header.
Definition at line 3392 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
|
static |
Definition at line 3438 of file mpeg4videodec.c.
Referenced by ff_mpeg4_decode_picture_header().
int ff_mpeg4_decode_picture_header | ( | Mpeg4DecContext * | ctx, |
GetBitContext * | gb, | ||
int | header, | ||
int | parse_only | ||
) |
Decode MPEG-4 headers.
header | If set the absence of a VOP is not treated as error; otherwise, it is treated as such. |
parse_only | If set, things only relevant to a decoder may be skipped; furthermore, the VLC tables may be uninitialized. |
Definition at line 3466 of file mpeg4videodec.c.
Referenced by ff_h263_decode_frame(), and mpeg4_decode_header().
int ff_mpeg4_frame_end | ( | AVCodecContext * | avctx, |
const uint8_t * | buf, | ||
int | buf_size | ||
) |
Definition at line 3624 of file mpeg4videodec.c.
Referenced by ff_h263_decode_frame().
|
static |
Definition at line 61 of file mpeg4videodec.c.
Referenced by mpeg4_decode_dc().
|
static |
Definition at line 61 of file mpeg4videodec.c.
Referenced by mpeg4_decode_dc().
|
static |
Definition at line 62 of file mpeg4videodec.c.
Referenced by mpeg4_decode_sprite_trajectory().
|
static |
Definition at line 63 of file mpeg4videodec.c.
Referenced by mpeg4_decode_mb().
|
static |
Definition at line 64 of file mpeg4videodec.c.
Referenced by mpeg4_decode_studio_block().
|
static |
Definition at line 65 of file mpeg4videodec.c.
Referenced by mpeg4_decode_studio_block().
|
static |
Definition at line 66 of file mpeg4videodec.c.
Referenced by mpeg4_decode_studio_block().
|
static |
Definition at line 68 of file mpeg4videodec.c.
Referenced by mpeg4_decode_studio_mb().
|
static |
Definition at line 70 of file mpeg4videodec.c.
|
static |
Definition at line 2040 of file mpeg4videodec.c.
Referenced by mpeg4_decode_studio_block().