FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
h263dec.h
Go to the documentation of this file.
1 /*
2  * H.263 decoder internal header
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 #ifndef AVCODEC_H263DEC_H
21 #define AVCODEC_H263DEC_H
22 
23 #include "get_bits.h"
24 #include "mpegvideo.h"
25 #include "vlc.h"
26 #include "libavutil/mem_internal.h"
27 
28 // The defines below define the number of bits that are read at once for
29 // reading vlc values. Changing these may improve speed and data cache needs
30 // be aware though that decreasing them may need the number of stages that is
31 // passed to get_vlc* to be increased.
32 #define H263_MV_VLC_BITS 9
33 #define INTRA_MCBPC_VLC_BITS 6
34 #define INTER_MCBPC_VLC_BITS 7
35 #define CBPY_VLC_BITS 6
36 #define TEX_VLC_BITS 9
37 
40 extern VLCElem ff_h263_cbpy_vlc[];
41 extern VLCElem ff_h263_mv_vlc[];
42 
43 typedef struct H263DecContext {
45 
47 
48  int mb_num_left; ///< number of MBs left in this video packet (for partitioned slices only)
49 
51 
52  int pb_frame; ///< PB-frame mode (0 = none, 1 = base, 2 = improved)
53 
54  /* motion compensation */
55  int h263_long_vectors; ///< use horrible H.263v1 long vector mode
56 
57  /* FLV specific */
58  int flv; ///< use flv H.263 header
59 
60  /* H.263 specific */
61  int ehc_mode;
62  int gob_index;
63 
64  /* H.263+ specific */
66  int umvplus; ///< == H.263+ && unrestricted_mv
68  int alt_inter_vlc; ///< alternative inter vlc
71 
72  /* MPEG-4 specific */
73  int padding_bug_score; ///< used to detect the VERY common padding bug in MPEG-4
75  int divx_packed; ///< divx specific, used to workaround (many) bugs in divx5
76  int data_partitioning; ///< data partitioning flag from header
77  int partitioned_frame; ///< is current frame partitioned
78 
79  /* MSMPEG4 specific */
80  int slice_height; ///< in macroblocks
81 
82  /* RV10 specific */
83  int rv10_version; ///< RV10 version: 0 or 3
85 
86  int (*decode_header)(struct H263DecContext *const h);
87 #define FRAME_SKIPPED 100 ///< Frame is not coded
88 
89  int (*decode_mb)(struct H263DecContext *h);
90 #define SLICE_OK 0
91 #define SLICE_ERROR -1
92 #define SLICE_END -2 ///<end marker found
93 #define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded
94 
95  GetBitContext last_resync_gb; ///< used to search for the next resync marker
96 
97  DECLARE_ALIGNED_32(int16_t, block)[6][64];
99 
100 int ff_h263_decode_motion(H263DecContext *const h, int pred, int f_code);
103  int *got_frame, AVPacket *avpkt);
104 void ff_h263_decode_init_vlc(void);
108 
109 /**
110  * Print picture info if FF_DEBUG_PICT_INFO is set.
111  */
112 void ff_h263_show_pict_info(H263DecContext *const h, int h263_plus);
113 
116 
117 int ff_h263_resync(H263DecContext *const h);
118 
119 #endif
H263DecContext::padding_bug_score
int padding_bug_score
used to detect the VERY common padding bug in MPEG-4
Definition: h263dec.h:73
ff_h263_cbpy_vlc
VLCElem ff_h263_cbpy_vlc[]
Definition: ituh263dec.c:104
ff_h263_resync
int ff_h263_resync(H263DecContext *const h)
Decode the group of blocks / video packet header / slice header (MPEG-4 Studio).
Definition: ituh263dec.c:217
H263DecContext::ehc_mode
int ehc_mode
Definition: h263dec.h:61
mem_internal.h
H263DecContext::loop_filter
int loop_filter
Definition: h263dec.h:69
ff_h263_show_pict_info
void ff_h263_show_pict_info(H263DecContext *const h, int h263_plus)
Print picture info if FF_DEBUG_PICT_INFO is set.
Definition: ituh263dec.c:80
H263DecContext::rv10_version
int rv10_version
RV10 version: 0 or 3.
Definition: h263dec.h:83
H263DecContext::rv10_first_dc_coded
int rv10_first_dc_coded[3]
Definition: h263dec.h:84
H263DecContext::slice_height
int slice_height
in macroblocks
Definition: h263dec.h:80
H263DecContext::modified_quant
int modified_quant
Definition: h263dec.h:70
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:421
H263DecContext::last_resync_gb
GetBitContext last_resync_gb
used to search for the next resync marker
Definition: h263dec.h:95
ff_h263_decode_frame
int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: h263dec.c:429
mpegvideo.h
ff_h263_decode_gob_header
int ff_h263_decode_gob_header(H263DecContext *const h)
H263DecContext::c
MPVContext c
Definition: h263dec.h:44
GetBitContext
Definition: get_bits.h:109
H263DecContext::picture_number
int picture_number
Definition: h263dec.h:50
H263DecContext::partitioned_frame
int partitioned_frame
is current frame partitioned
Definition: h263dec.h:77
H263DecContext::pb_frame
int pb_frame
PB-frame mode (0 = none, 1 = base, 2 = improved)
Definition: h263dec.h:52
ff_h263_decode_motion
int ff_h263_decode_motion(H263DecContext *const h, int pred, int f_code)
Definition: ituh263dec.c:275
get_bits.h
ff_h263_decode_init_vlc
void ff_h263_decode_init_vlc(void)
Definition: ituh263dec.c:136
H263DecContext::h263_slice_structured
int h263_slice_structured
Definition: h263dec.h:67
ff_h263_decode_mb
int ff_h263_decode_mb(H263DecContext *const h)
Definition: ituh263dec.c:780
H263DecContext::decode_mb
int(* decode_mb)(struct H263DecContext *h)
Definition: h263dec.h:89
ff_h263_mv_vlc
VLCElem ff_h263_mv_vlc[]
Definition: ituh263dec.c:105
H263DecContext::decode_header
int(* decode_header)(struct H263DecContext *const h)
Definition: h263dec.h:86
ff_h263_intra_MCBPC_vlc
VLCElem ff_h263_intra_MCBPC_vlc[]
Definition: ituh263dec.c:102
H263DecContext::alt_inter_vlc
int alt_inter_vlc
alternative inter vlc
Definition: h263dec.h:68
H263DecContext::h263_long_vectors
int h263_long_vectors
use horrible H.263v1 long vector mode
Definition: h263dec.h:55
VLCElem
Definition: vlc.h:32
H263DecContext::data_partitioning
int data_partitioning
data partitioning flag from header
Definition: h263dec.h:76
ff_h263_decode_mba
int ff_h263_decode_mba(H263DecContext *const h)
Definition: ituh263dec.c:142
H263DecContext::custom_pcf
int custom_pcf
Definition: h263dec.h:65
H263DecContext::DECLARE_ALIGNED_32
DECLARE_ALIGNED_32(int16_t, block)[6][64]
ff_intel_h263_decode_picture_header
int ff_intel_h263_decode_picture_header(H263DecContext *const h)
Definition: intelh263dec.c:29
pred
static const float pred[4]
Definition: siprdata.h:259
ff_h263_decode_init
int ff_h263_decode_init(AVCodecContext *avctx)
Definition: h263dec.c:91
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:265
H263DecContext
Definition: h263dec.h:43
AVCodecContext
main external API structure.
Definition: avcodec.h:431
H263DecContext::gob_index
int gob_index
Definition: h263dec.h:62
H263DecContext::gb
GetBitContext gb
Definition: h263dec.h:46
H263DecContext::mb_num_left
int mb_num_left
number of MBs left in this video packet (for partitioned slices only)
Definition: h263dec.h:48
H263DecContext::divx_packed
int divx_packed
divx specific, used to workaround (many) bugs in divx5
Definition: h263dec.h:75
H263DecContext::umvplus
int umvplus
== H.263+ && unrestricted_mv
Definition: h263dec.h:66
ff_h263_inter_MCBPC_vlc
VLCElem ff_h263_inter_MCBPC_vlc[]
Definition: ituh263dec.c:103
AVPacket
This structure stores compressed data.
Definition: packet.h:529
vlc.h
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
h
h
Definition: vp9dsp_template.c:2070
H263DecContext::flv
int flv
use flv H.263 header
Definition: h263dec.h:58
MpegEncContext
MpegEncContext.
Definition: mpegvideo.h:63
H263DecContext::skipped_last_frame
int skipped_last_frame
Definition: h263dec.h:74
ff_h263_decode_picture_header
int ff_h263_decode_picture_header(H263DecContext *const h)
Definition: ituh263dec.c:1088