Go to the documentation of this file.
28 #ifndef AVCODEC_MPEGVIDEO_H
29 #define AVCODEC_MPEGVIDEO_H
43 #define MAX_THREADS 32
168 #define MV_DIR_FORWARD 1
169 #define MV_DIR_BACKWARD 2
172 #define MV_TYPE_16X16 0
173 #define MV_TYPE_8X8 1
174 #define MV_TYPE_16X8 2
175 #define MV_TYPE_FIELD 3
176 #define MV_TYPE_DMV 4
325 const uint8_t *src_scantable);
329 uint8_t *dest_y, uint8_t *dest_cb,
330 uint8_t *dest_cr,
int dir,
331 uint8_t *
const *ref_picture,
336 int lowres,
int chroma_x_shift)
338 const int bytes_per_pixel = 1 + (bits_per_raw_sample > 8);
339 const int block_size = (8 * bytes_per_pixel) >>
lowres;
341 s->block_index[0]+=2;
342 s->block_index[1]+=2;
343 s->block_index[2]+=2;
344 s->block_index[3]+=2;
347 s->dest[0]+= 2*block_size;
348 s->dest[1] += (2 >> chroma_x_shift) * block_size;
349 s->dest[2] += (2 >> chroma_x_shift) * block_size;
int codec_tag
internal codec_tag upper case converted from avctx codec_tag
int first_field
is 1 for the first field of a field picture 0 otherwise
BufferPoolContext buffer_pools
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])
int v_edge_pos
horizontal / vertical position of the right/bottom edge (pixel replication)
int16_t * dc_val
used for H.263 AIC/MPEG-4 DC prediction and ER
MPVWorkPicture next_pic
copy of the next picture structure.
uint16_t intra_matrix[64]
matrix transmitted in the bitstream
struct Mpeg12SliceContext * mpeg12_contexts[MAX_THREADS]
int chroma_qscale
chroma QP
enum AVPictureType pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
uint16_t pb_field_time
like above, just for interlaced
int mb_skipped
MUST BE SET only during DECODING.
int h263_aic
Advanced INTRA Coding (AIC)
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
const uint8_t * chroma_qscale_table
qscale -> chroma_qscale (H.263)
int64_t time
time of current frame
uint8_t * mbskip_table
used to avoid copy if macroblock skipped (for black regions for example) and used for B-frame encodin...
uint16_t pp_time
time distance between the last 2 p,s,i frames
struct MPVEncContext * enc_contexts[MAX_THREADS]
void ff_init_scantable(const uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
ptrdiff_t uvlinesize
line size, for chroma in bytes, may be different from width
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
void ff_mpv_idct_init(MpegEncContext *s)
int time_base
time in seconds of last I,P,S Frame
H264ChromaContext h264chroma
int slice_context_count
number of used thread_contexts
MPVWorkPicture cur_pic
copy of the current picture structure.
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
unsigned slice_ctx_size
If set, ff_mpv_common_init() will allocate slice contexts of this size.
int resync_mb_y
y position of last resync marker
void ff_mpv_common_defaults(MpegEncContext *s)
Set the given MpegEncContext to common defaults (same for encoding and decoding).
uint8_t * coded_block_base
const uint8_t * y_dc_scale_table
qscale -> y_dc_scale table
int mb_num
number of MBs of a picture
struct AVRefStructPool * picture_pool
Pool for MPVPictures.
int start_mb_y
start mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
const uint8_t * c_dc_scale_table
qscale -> c_dc_scale table
AVRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
const uint8_t * scantable
uint8_t * mbintra_table
used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
int16_t(*[2][2] p_field_mv_table)[2]
MV table (2MV per MB) interlaced P-frame encoding.
uint8_t * pred_dir_table
used to store pred_dir for partitioned decoding
int * mb_index2xy
mb_index -> mb_x + mb_y*mb_stride
uint16_t inter_matrix[64]
Describe the class of an AVClass context structure.
int16_t direct_scale_mv[2][64]
precomputed to avoid divisions in ff_mpeg4_set_direct_mv
void ff_mpv_common_end(MpegEncContext *s)
uint16_t pb_time
time distance between the last b and p,s,i frame
int encoding
true if we are encoding (vs decoding)
int16_t(* ac_val)[16]
used for H.263 AIC, MPEG-4 AC prediction
void(* dct_unquantize_intra)(const MPVContext *s, int16_t *block, int n, int qscale)
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
Average and put pixel Widths can be 16, 8, 4 or 2.
void(* qpel_mc_func)(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
int concealment_motion_vectors
AVCodecID
Identify the syntax and semantics of the bitstream.
struct MpegEncContext * thread_context[MAX_THREADS]
ScanTable intra_scantable
int ff_mpv_init_duplicate_contexts(MpegEncContext *s)
Initialize an MpegEncContext's thread contexts.
int quarter_sample
1->qpel, 0->half pel ME/MC
MPVWorkPicture last_pic
copy of the previous picture structure.
#define DECLARE_ALIGNED(n, t, v)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static void ff_update_block_index(MpegEncContext *s, int bits_per_raw_sample, int lowres, int chroma_x_shift)
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11
struct AVCodecContext * avctx
int workaround_bugs
workaround bugs in encoders which cannot be detected automatically
int16_t(* ac_val_base)[16]
int ff_mpv_init_context_frame(MpegEncContext *s)
Initialize and allocates MpegEncContext fields dependent on the resolution.
int16_t(* p_field_mv_table_base)[2]
void(* dct_unquantize_inter)(const MPVContext *s, int16_t *block, int n, int qscale)
int ff_mpv_common_init(MpegEncContext *s)
init common structure for both encoder and decoder.
void ff_init_block_index(MpegEncContext *s)
uint16_t chroma_intra_matrix[64]
int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src)
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
void ff_clean_intra_table_entries(MpegEncContext *s)
Clean dc, ac for the current non-intra MB.
int block_last_index[12]
last non zero coefficient in block
int no_rounding
apply no rounding to motion compensation (MPEG-4, msmpeg4, ...) for B-frames rounding mode is always ...
int h263_pred
use MPEG-4/H.263 ac/dc predictions
main external API structure.
int last_mv[2][2][2]
last MV, used for MV prediction in MPEG-1 & B-frame MPEG-4
@ MSMP4_VC1
for VC1 (image), WMV3 (image) and MSS2.
int end_mb_y
end mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
int height
picture size. must be a multiple of 16
uint8_t * cbp_table
used to store cbp, ac_pred for partitioned decoding
int block_index[6]
index to current MB in block based arrays with edges
int obmc
overlapped block motion compensation
enum MpegEncContext::@220 msmpeg4_version
The exact code depends on how similar the blocks are and how related they are to the block
void ff_mpv_free_context_frame(MpegEncContext *s)
Frees and resets MpegEncContext fields depending on the resolution as well as the slice thread contex...
uint16_t chroma_inter_matrix[64]
enum OutputFormat out_format
output format
int low_delay
no reordering needed / has no B-frames
int resync_mb_x
x position of last resync marker
uint8_t * coded_block
used for coded block pattern prediction (msmpeg4v3, wmv1)
ptrdiff_t linesize
line size, in bytes, may be different from width
ScanTable inter_scantable
if inter == intra then intra should be used to reduce the cache usage
int first_slice_line
used in MPEG-4 too to handle resync markers
int mb_height
number of MBs horizontally & vertically