Go to the documentation of this file.
28 #ifndef AVCODEC_MPEGVIDEO_H
29 #define AVCODEC_MPEGVIDEO_H
42 #define MAX_THREADS 32
188 #define MV_DIR_FORWARD 1
189 #define MV_DIR_BACKWARD 2
192 #define MV_TYPE_16X16 0
193 #define MV_TYPE_8X8 1
194 #define MV_TYPE_16X8 2
195 #define MV_TYPE_FIELD 3
196 #define MV_TYPE_DMV 4
325 #define SLICE_ERROR -1
327 #define SLICE_NOEND -3
380 const uint8_t *src_scantable);
384 uint8_t *dest_y, uint8_t *dest_cb,
385 uint8_t *dest_cr,
int dir,
386 uint8_t *
const *ref_picture,
393 const int bytes_per_pixel = 1 + (bits_per_raw_sample > 8);
394 const int block_size = (8 * bytes_per_pixel) >>
lowres;
396 s->block_index[0]+=2;
397 s->block_index[1]+=2;
398 s->block_index[2]+=2;
399 s->block_index[3]+=2;
402 s->dest[0]+= 2*block_size;
H264ChromaContext h264chroma
int mb_skipped
MUST BE SET only during DECODING.
int h263_flv
use flv H.263 header
int data_partitioning
data partitioning flag from header
void ff_mpv_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t *const *ref_picture, const op_pixels_func(*pix_op)[4], const qpel_mc_func(*qpix_op)[16])
const struct MpegEncContext * parent
int b_code
backward MV resolution for B-frames (MPEG-4)
uint16_t pp_time
time distance between the last 2 p,s,i frames
int block_index[6]
index to current MB in block based arrays with edges
int slice_height
in macroblocks
int partitioned_frame
is current frame partitioned
int mb_num
number of MBs of a picture
int16_t(* ac_val_base)[16]
int workaround_bugs
workaround bugs in encoders which cannot be detected automatically
int last_dc[3]
last DC values for MPEG-1
int chroma_qscale
chroma QP
int16_t(*[3] ac_val)[16]
used for MPEG-4 AC prediction, all 3 arrays must be continuous
int unrestricted_mv
mv can point outside of the coded picture
struct AVCodecContext * avctx
struct MPVEncContext * enc_contexts[MAX_THREADS]
int mb_num_left
number of MBs left in this video packet (for partitioned Slices only)
int height
picture size. must be a multiple of 16
GetBitContext last_resync_gb
used to search for the next resync marker
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
enum OutputFormat out_format
output format
int time_base
time in seconds of last I,P,S Frame
ScanTable intra_scantable
int mb_height
number of MBs horizontally & vertically
uint8_t permutated_intra_v_scantable[64]
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int h263_pred
use MPEG-4/H.263 ac/dc predictions
uint8_t * mbintra_table
used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
int padding_bug_score
used to detect the VERY common padding bug in MPEG-4
void ff_init_scantable(const uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
ptrdiff_t linesize
line size, in bytes, may be different from width
int umvplus
== H.263+ && unrestricted_mv
void ff_mpv_idct_init(MpegEncContext *s)
unsigned slice_ctx_size
If set, ff_mpv_common_init() will allocate slice contexts of this size.
int pb_frame
PB-frame mode (0 = none, 1 = base, 2 = improved)
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
uint8_t * coded_block
used for coded block pattern prediction (msmpeg4v3, wmv1)
enum MpegEncContext::@190 msmpeg4_version
void ff_mpv_common_defaults(MpegEncContext *s)
Set the given MpegEncContext to common defaults (same for encoding and decoding).
int16_t(* p_field_mv_table_base)[2]
AVRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
const uint8_t * scantable
MPVWorkPicture cur_pic
copy of the current picture structure.
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11
int low_delay
no reordering needed / has no B-frames
struct AVRefStructPool * picture_pool
Pool for MPVPictures.
Describe the class of an AVClass context structure.
void ff_mpv_common_end(MpegEncContext *s)
int h263_long_vectors
use horrible H.263v1 long vector mode
int f_code
forward MV resolution
MPVWorkPicture next_pic
copy of the next picture structure.
int h263_aic
Advanced INTRA Coding (AIC)
const uint8_t * y_dc_scale_table
qscale -> y_dc_scale table
uint16_t inter_matrix[64]
int(* decode_mb)(struct MpegEncContext *s, int16_t block[12][64])
int concealment_motion_vectors
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
int slice_context_count
number of used thread_contexts
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
uint16_t pb_time
time distance between the last b and p,s,i frame
void(* qpel_mc_func)(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
int16_t(* blocks)[12][64]
AVCodecID
Identify the syntax and semantics of the bitstream.
uint16_t pb_field_time
like above, just for interlaced
uint8_t * coded_block_base
int ff_mpv_init_duplicate_contexts(MpegEncContext *s)
Initialize an MpegEncContext's thread contexts.
const uint8_t * chroma_qscale_table
qscale -> chroma_qscale (H.263)
int first_slice_line
used in MPEG-4 too to handle resync markers
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
uint16_t intra_matrix[64]
matrix transmitted in the bitstream
static void ff_update_block_index(MpegEncContext *s, int bits_per_raw_sample, int lowres, int chroma_x_shift)
int v_edge_pos
horizontal / vertical position of the right/bottom edge (pixel replication)
int encoding
true if we are encoding (vs decoding)
uint8_t * mbskip_table
used to avoid copy if macroblock skipped (for black regions for example) and used for B-frame encodin...
int16_t * dc_val[3]
used for MPEG-4 DC prediction, all 3 arrays must be continuous
int quarter_sample
1->qpel, 0->half pel ME/MC
int ff_mpv_init_context_frame(MpegEncContext *s)
Initialize and allocates MpegEncContext fields dependent on the resolution.
BufferPoolContext buffer_pools
int ff_mpv_common_init(MpegEncContext *s)
init common structure for both encoder and decoder.
void ff_init_block_index(MpegEncContext *s)
int block_last_index[12]
last non zero coefficient in block
int last_mv[2][2][2]
last MV, used for MV prediction in MPEG-1 & B-frame MPEG-4
ptrdiff_t uvlinesize
line size, for chroma in bytes, may be different from width
uint16_t chroma_inter_matrix[64]
int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src)
int obmc
overlapped block motion compensation
@ MSMP4_VC1
for VC1 (image), WMV3 (image) and MSS2.
struct MpegEncContext * thread_context[MAX_THREADS]
MPVWorkPicture last_pic
copy of the previous picture structure.
uint8_t permutated_intra_h_scantable[64]
void(* dct_unquantize_inter)(struct MpegEncContext *s, int16_t *block, int n, int qscale)
int h263_slice_structured
void ff_clean_intra_table_entries(MpegEncContext *s)
Clean dc, ac for the current non-intra MB.
int rv10_version
RV10 version: 0 or 3.
int16_t(*[2][2] p_field_mv_table)[2]
MV table (2MV per MB) interlaced P-frame encoding.
int16_t(* block)[64]
points to one of the following blocks
main external API structure.
int rv10_first_dc_coded[3]
int64_t time
time of current frame
uint8_t * pred_dir_table
used to store pred_dir for partitioned decoding
void(* dct_unquantize_intra)(struct MpegEncContext *s, int16_t *block, int n, int qscale)
int resync_mb_x
x position of last resync marker
int no_rounding
apply no rounding to motion compensation (MPEG-4, msmpeg4, ...) for B-frames rounding mode is always ...
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
ScanTable inter_scantable
if inter == intra then intra should be used to reduce the cache usage
uint8_t * cbp_table
used to store cbp, ac_pred for partitioned decoding
int first_field
is 1 for the first field of a field picture 0 otherwise
void ff_mpv_free_context_frame(MpegEncContext *s)
Frees and resets MpegEncContext fields depending on the resolution as well as the slice thread contex...
int resync_mb_y
y position of last resync marker
int end_mb_y
end mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
int * mb_index2xy
mb_index -> mb_x + mb_y*mb_stride
int h263_plus
H.263+ headers.
int start_mb_y
start mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
int16_t direct_scale_mv[2][64]
precomputed to avoid divisions in ff_mpeg4_set_direct_mv
const uint8_t * c_dc_scale_table
qscale -> c_dc_scale table
const struct MPVMainEncContext * encparent
int alt_inter_vlc
alternative inter vlc
uint16_t chroma_intra_matrix[64]
int codec_tag
internal codec_tag upper case converted from avctx codec_tag