FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mpeg4videodec.h
Go to the documentation of this file.
1 /*
2  * MPEG-4 decoder internal header.
3  * Copyright (c) 2000,2001 Fabrice Bellard
4  * Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef AVCODEC_MPEG4VIDEODEC_H
24 #define AVCODEC_MPEG4VIDEODEC_H
25 
26 #include <stdint.h>
27 
28 #include "get_bits.h"
29 #include "h263dec.h"
30 #include "mpegvideo.h"
31 #include "mpeg4videodsp.h"
32 
33 #include "libavutil/mem_internal.h"
34 
35 typedef struct Mpeg4DecContext {
37 
38  int f_code; ///< forward MV resolution
39  int b_code; ///< backward MV resolution for B-frames
40 
41  /// number of bits to represent the fractional part of time
43  int shape;
49  int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY]
50  int sprite_delta[2][2]; ///< sprite_delta [isY][isMVY]
51  /// sprite trajectory points
52  uint16_t sprite_traj[4][2];
53  /// sprite shift [isChroma]
54  int sprite_shift[2];
55 
57  // reversible vlc
58  int rvlc;
59  /// could this stream contain resync markers
61  /// time distance of first I -> B, used for interlaced B-frames
62  int t_frame;
63 
64  int new_pred;
67 
69 
70  /// QP above which the ac VLC should be used for intra dc
72 
73  /* bug workarounds */
78  /// Divx 5.01 puts several frames in a single one, this is used to reorder them
80 
81  int vo_type;
82 
83  /// flag for having shown the warning about invalid Divx B-frames
85  /** does the stream contain the low_delay flag,
86  * used to work around buggy encoders. */
91 
92  int rgb;
93 
95 
97  int16_t *block, int n, int qscale);
99  int16_t *block, int n, int qscale);
101  int16_t *block, int n, int qscale);
102 
103  union {
105  int16_t dpcm_macroblock[3][256];
106  };
107  // 0 = DCT, 1 = DPCM top to bottom scan, -1 = DPCM bottom to top scan
111 
113  int header, int parse_only);
114 void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb,
115  uint8_t *dest_cr, int block_size, int uvlinesize,
116  int dct_linesize, int dct_offset);
118  uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
119  uint8_t *const *ref_picture);
124 void ff_mpeg4_pred_ac(H263DecContext *const h, int16_t *block, int n,
125  int dir);
126 int ff_mpeg4_frame_end(AVCodecContext *avctx, const AVPacket *pkt);
127 
128 
129 #endif
Mpeg4DecContext::sprite_warping_accuracy
int sprite_warping_accuracy
Definition: mpeg4videodec.h:46
Mpeg4DecContext::mdsp
Mpeg4VideoDSPContext mdsp
Definition: mpeg4videodec.h:94
ff_mpeg4_frame_end
int ff_mpeg4_frame_end(AVCodecContext *avctx, const AVPacket *pkt)
Definition: mpeg4videodec.c:3774
Mpeg4DecContext::h
H263DecContext h
Definition: mpeg4videodec.h:36
Mpeg4DecContext::dct_unquantize_mpeg2_inter
void(* dct_unquantize_mpeg2_inter)(MpegEncContext *s, int16_t *block, int n, int qscale)
Definition: mpeg4videodec.h:96
Mpeg4DecContext::vol_sprite_usage
int vol_sprite_usage
Definition: mpeg4videodec.h:44
mem_internal.h
Mpeg4DecContext::showed_packed_warning
int showed_packed_warning
flag for having shown the warning about invalid Divx B-frames
Definition: mpeg4videodec.h:84
Mpeg4DecContext::rvlc
int rvlc
Definition: mpeg4videodec.h:58
Mpeg4VideoDSPContext
Definition: mpeg4videodsp.h:28
Mpeg4DecContext::new_pred
int new_pred
Definition: mpeg4videodec.h:64
mpegvideo.h
Mpeg4DecContext::b_code
int b_code
backward MV resolution for B-frames
Definition: mpeg4videodec.h:39
Mpeg4DecContext::dct_unquantize_mpeg2_intra
void(* dct_unquantize_mpeg2_intra)(MpegEncContext *s, int16_t *block, int n, int qscale)
Definition: mpeg4videodec.h:98
GetBitContext
Definition: get_bits.h:109
ff_mpeg4_decode_video_packet_header
int ff_mpeg4_decode_video_packet_header(H263DecContext *const h)
Decode the next video packet.
Definition: mpeg4videodec.c:708
Mpeg4DecContext::dpcm_direction
int dpcm_direction
Definition: mpeg4videodec.h:108
Mpeg4DecContext::sprite_brightness_change
int sprite_brightness_change
Definition: mpeg4videodec.h:45
pkt
AVPacket * pkt
Definition: movenc.c:60
h263dec.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
ff_mpeg4_workaround_bugs
void ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
Definition: mpeg4videodec.c:3097
Mpeg4DecContext::cplx_estimation_trash_b
int cplx_estimation_trash_b
Definition: mpeg4videodec.h:90
ctx
AVFormatContext * ctx
Definition: movenc.c:49
get_bits.h
Mpeg4DecContext::bitstream_buffer
AVBufferRef * bitstream_buffer
Divx 5.01 puts several frames in a single one, this is used to reorder them.
Definition: mpeg4videodec.h:79
Mpeg4DecContext::sprite_offset
int sprite_offset[2][2]
sprite offset[isChroma][isMVY]
Definition: mpeg4videodec.h:49
Mpeg4DecContext::dct_precision
int dct_precision
Definition: mpeg4videodec.h:109
Mpeg4DecContext::rgb
int rgb
Definition: mpeg4videodec.h:92
Mpeg4DecContext::shape
int shape
Definition: mpeg4videodec.h:43
Mpeg4DecContext::mpeg_quant
int mpeg_quant
Definition: mpeg4videodec.h:56
Mpeg4DecContext::cplx_estimation_trash_i
int cplx_estimation_trash_i
Definition: mpeg4videodec.h:88
Mpeg4DecContext
Definition: mpeg4videodec.h:35
Mpeg4DecContext::scalability
int scalability
Definition: mpeg4videodec.h:66
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: mpeg4videodec.c:245
Mpeg4DecContext::sprite_delta
int sprite_delta[2][2]
sprite_delta [isY][isMVY]
Definition: mpeg4videodec.h:50
Mpeg4DecContext::t_frame
int t_frame
time distance of first I -> B, used for interlaced B-frames
Definition: mpeg4videodec.h:62
Mpeg4DecContext::divx_version
int divx_version
Definition: mpeg4videodec.h:74
ff_mpeg4_decode_studio_slice_header
int ff_mpeg4_decode_studio_slice_header(H263DecContext *const h)
Decode the next video packet.
Definition: mpeg4videodec.c:808
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem_internal.h:104
Mpeg4DecContext::lavc_build
int lavc_build
Definition: mpeg4videodec.h:77
ff_mpeg4_parse_picture_header
int ff_mpeg4_parse_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, int header, int parse_only)
Decode MPEG-4 headers.
Definition: mpeg4videodec.c:3582
Mpeg4DecContext::sprite_shift
int sprite_shift[2]
sprite shift [isChroma]
Definition: mpeg4videodec.h:54
header
static const uint8_t header[24]
Definition: sdr2.c:68
ff_mpeg4_pred_ac
void ff_mpeg4_pred_ac(H263DecContext *const h, int16_t *block, int n, int dir)
Predict the ac.
Definition: mpeg4videodec.c:328
Mpeg4DecContext::sprite_traj
uint16_t sprite_traj[4][2]
sprite trajectory points
Definition: mpeg4videodec.h:52
Mpeg4DecContext::cplx_estimation_trash_p
int cplx_estimation_trash_p
Definition: mpeg4videodec.h:89
ff_mpeg4_decode_partitions
int ff_mpeg4_decode_partitions(H263DecContext *const h)
Decode the first and second partition.
Definition: mpeg4videodec.c:1316
Mpeg4DecContext::time_increment_bits
int time_increment_bits
number of bits to represent the fractional part of time
Definition: mpeg4videodec.h:42
Mpeg4DecContext::f_code
int f_code
forward MV resolution
Definition: mpeg4videodec.h:38
Mpeg4DecContext::num_sprite_warping_points
int num_sprite_warping_points
Definition: mpeg4videodec.h:47
Mpeg4DecContext::block32
int32_t block32[12][64]
Definition: mpeg4videodec.h:104
Mpeg4DecContext::vol_control_parameters
int vol_control_parameters
does the stream contain the low_delay flag, used to work around buggy encoders.
Definition: mpeg4videodec.h:87
Mpeg4DecContext::dct_unquantize_h263_intra
void(* dct_unquantize_h263_intra)(MpegEncContext *s, int16_t *block, int n, int qscale)
Definition: mpeg4videodec.h:100
H263DecContext
Definition: h263dec.h:43
AVCodecContext
main external API structure.
Definition: avcodec.h:431
mpeg4videodsp.h
Mpeg4DecContext::resync_marker
int resync_marker
could this stream contain resync markers
Definition: mpeg4videodec.h:60
Mpeg4DecContext::enhancement_type
int enhancement_type
Definition: mpeg4videodec.h:65
Mpeg4DecContext::dpcm_macroblock
int16_t dpcm_macroblock[3][256]
Definition: mpeg4videodec.h:105
Mpeg4DecContext::real_sprite_warping_points
int real_sprite_warping_points
Definition: mpeg4videodec.h:48
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
AVPacket
This structure stores compressed data.
Definition: packet.h:529
Mpeg4DecContext::quant_precision
int quant_precision
Definition: mpeg4videodec.h:68
int32_t
int32_t
Definition: audioconvert.c:56
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
Mpeg4DecContext::divx_build
int divx_build
Definition: mpeg4videodec.h:75
ff_mpeg4_decode_studio
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: mpeg4videodec.c:260
Mpeg4DecContext::xvid_build
int xvid_build
Definition: mpeg4videodec.h:76
h
h
Definition: vp9dsp_template.c:2070
MpegEncContext
MpegEncContext.
Definition: mpegvideo.h:63
Mpeg4DecContext::intra_dc_threshold
int intra_dc_threshold
QP above which the ac VLC should be used for intra dc.
Definition: mpeg4videodec.h:71
Mpeg4DecContext::vo_type
int vo_type
Definition: mpeg4videodec.h:81