FFmpeg
Loading...
Searching...
No Matches
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
34
35typedef 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]
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
63
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
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
96 void (*dct_unquantize_mpeg2_inter)(const MPVContext *s,
97 int16_t *block, int n, int qscale);
98 void (*dct_unquantize_mpeg2_intra)(const MPVContext *s,
99 int16_t *block, int n, int qscale);
100 void (*dct_unquantize_h263_intra)(const MPVContext *s,
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);
114void 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);
124void ff_mpeg4_pred_ac(H263DecContext *const h, int16_t *block, int n,
125 int dir);
127
128
129#endif
int32_t
#define s(width, name)
Definition cbs_vp9.c:198
static int16_t block[64]
Definition dct.c:125
static AVPacket * pkt
bitstream reader API header.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
int ff_mpeg4_frame_end(AVCodecContext *avctx, const AVPacket *pkt)
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)
int ff_mpeg4_decode_partitions(H263DecContext *const h)
Decode the first and second partition.
int ff_mpeg4_parse_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, int header, int parse_only)
Decode MPEG-4 headers.
int ff_mpeg4_decode_video_packet_header(H263DecContext *const h)
Decode the next video packet.
void ff_mpeg4_pred_ac(H263DecContext *const h, int16_t *block, int n, int dir)
Predict the ac.
int ff_mpeg4_decode_studio_slice_header(H263DecContext *const h)
Decode the next video packet.
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_workaround_bugs(AVCodecContext *avctx)
mpegvideo header.
static const uint8_t header[24]
Definition sdr2.c:68
A reference to a data buffer.
Definition buffer.h:82
main external API structure.
Definition avcodec.h:443
This structure stores compressed data.
Definition packet.h:580
int b_code
backward MV resolution for B-frames
int intra_dc_threshold
QP above which the ac VLC should be used for intra dc.
int time_increment_bits
number of bits to represent the fractional part of time
int16_t dpcm_macroblock[3][256]
int num_sprite_warping_points
int showed_packed_warning
flag for having shown the warning about invalid Divx B-frames
int sprite_shift[2]
sprite shift [isChroma]
void(* dct_unquantize_h263_intra)(const MPVContext *s, int16_t *block, int n, int qscale)
int sprite_offset[2][2]
sprite offset[isChroma][isMVY]
H263DecContext h
int vol_control_parameters
does the stream contain the low_delay flag, used to work around buggy encoders.
Mpeg4VideoDSPContext mdsp
int32_t block32[12][64]
uint16_t sprite_traj[4][2]
sprite trajectory points
int f_code
forward MV resolution
int t_frame
time distance of first I -> B, used for interlaced B-frames
void(* dct_unquantize_mpeg2_intra)(const MPVContext *s, int16_t *block, int n, int qscale)
int real_sprite_warping_points
int sprite_delta[2][2]
sprite_delta [isY][isMVY]
void(* dct_unquantize_mpeg2_inter)(const MPVContext *s, int16_t *block, int n, int qscale)
AVBufferRef * bitstream_buffer
Divx 5.01 puts several frames in a single one, this is used to reorder them.
int resync_marker
could this stream contain resync markers
MpegEncContext.
Definition mpegvideo.h:67
static AVFormatContext * ctx
Definition movenc.c:49