xine-lib  1.2.10
mpeg2.h
Go to the documentation of this file.
1 /*
2  * mpeg2.h
3  * Copyright (C) 1999-2001 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
4  *
5  * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
6  *
7  * mpeg2dec is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * mpeg2dec is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 /* Structure for the mpeg2dec decoder */
23 
24 #ifndef MPEG2_H
25 #define MPEG2_H
26 
27 #include "libmpeg2_accel.h"
28 
29 typedef struct mpeg2dec_s {
31  uint32_t frame_format;
32 
33  /* this is where we keep the state of the decoder */
34  struct picture_s * picture;
35 
36  uint32_t shift;
41  int in_slice;
43 
44  /* the maximum chunk size is determined by vbv_buffer_size */
45  /* which is 224K for MP@ML streams. */
46  /* (we make no pretenses of decoding anything more than that) */
47  /* allocated in init - gcc has problems allocating such big structures */
48  uint8_t * chunk_buffer;
49  /* pointer to current position in chunk_buffer */
50  uint8_t * chunk_ptr;
51  /* last start code ? */
52  uint8_t code;
53  uint32_t chunk_size;
54 
55  int64_t pts;
56  uint32_t rff_pattern;
59 
60  /* AFD data can be found after a sequence, group or picture start code */
61  /* and will be stored in afd_value_seen. Later it will be transfered to */
62  /* a stream property and stored into afd_value_reported to detect changes */
65 
67 
68  /* a spu decoder for possible closed captions */
71 
72 } mpeg2dec_t ;
73 
74 
75 /* initialize mpegdec with a opaque user pointer */
76 void mpeg2_init (mpeg2dec_t * mpeg2dec,
77  xine_video_port_t * output);
78 
79 /* destroy everything which was allocated, shutdown the output */
80 void mpeg2_close (mpeg2dec_t * mpeg2dec);
81 
82 int mpeg2_decode_data (mpeg2dec_t * mpeg2dec,
83  uint8_t * data_start, uint8_t * data_end,
84  uint64_t pts);
85 
86 void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec,
87  uint8_t * data_start, uint8_t * data_end);
88 
89 void mpeg2_flush (mpeg2dec_t * mpeg2dec);
90 void mpeg2_reset (mpeg2dec_t * mpeg2dec);
91 void mpeg2_discontinuity (mpeg2dec_t * mpeg2dec);
92 
93 /* Not needed, it is defined as static in decode.c, and no-one else called it
94  * currently
95  */
96 /* void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer); */
97 
98 #endif
pand_m2r
#define pand_m2r(var, reg)
Definition: mmx.h:554
punpcklbw_r2r
#define punpcklbw_r2r(regs, regd)
Definition: mmx.h:695
xine_stream_s
Definition: xine_internal.h:123
put
#define put(predictor, i)
Definition: motion_comp.c:72
mpeg2dec_s
Definition: mpeg2.h:29
paddw_m2r
#define paddw_m2r(var, reg)
Definition: mmx.h:442
mpeg2dec_s::drop_frame
int drop_frame
Definition: mpeg2.h:40
xineutils.h
vis_mul8x16
#define vis_mul8x16(rs1, rs2, rd)
Definition: vis.h:215
mpeg2_mc_3dnow
mpeg2_mc_t mpeg2_mc_3dnow
mpeg2_close
void mpeg2_close(mpeg2dec_t *mpeg2dec)
Definition: decode.c:811
mpeg2dec_s::stream
xine_stream_t * stream
Definition: mpeg2.h:66
MPEG2_ACCEL_SPARC_VIS
#define MPEG2_ACCEL_SPARC_VIS
Definition: mpeg2.h:163
mpeg2_mc_mmx
mpeg2_mc_t mpeg2_mc_mmx
vis_st64_2
#define vis_st64_2(rs1, mem1, mem2)
Definition: vis.h:162
D
#define D(__VA_ARGS__)
Definition: input_gnome_vfs.c:37
paddw_r2r
#define paddw_r2r(regs, regd)
Definition: mmx.h:443
vis_faligndata
#define vis_faligndata(rs1, rs2, rd)
Definition: vis.h:289
vis_or
#define vis_or(rs1, rs2, rd)
Definition: vis.h:305
mpeg2dec_s::force_aspect
int force_aspect
Definition: mpeg2.h:57
vis_alignaddr
static void * vis_alignaddr(void *_ptr)
Definition: vis.h:225
MPEG2_ACCEL_PPC_ALTIVEC
#define MPEG2_ACCEL_PPC_ALTIVEC
Definition: mpeg2.h:160
mpeg2dec_s::shift
uint32_t shift
Definition: mpeg2.h:36
MM_ACCEL_X86_MMX
#define MM_ACCEL_X86_MMX
Definition: xineutils.h:164
MM_ACCEL_MLIB
#define MM_ACCEL_MLIB
Definition: xineutils.h:161
mpeg2_flush
void mpeg2_flush(mpeg2dec_t *mpeg2dec)
Definition: decode.c:789
MPEG2_ACCEL_ALPHA
#define MPEG2_ACCEL_ALPHA
Definition: mpeg2.h:161
libmpeg2_accel.h
xine_mmx.h
mpeg2dec_s::is_frame_needed
int is_frame_needed
Definition: mpeg2.h:42
mpeg2_discontinuity
void mpeg2_discontinuity(mpeg2dec_t *mpeg2dec)
Definition: decode.c:723
mpeg2dec_s::in_slice
int in_slice
Definition: mpeg2.h:41
psubusb_r2r
#define psubusb_r2r(regs, regd)
Definition: mmx.h:506
mpeg2_mc_c
mpeg2_mc_t mpeg2_mc_c
MC_FUNC
#define MC_FUNC(op, xy)
Definition: motion_comp.c:77
mpeg2dec_s::chunk_size
uint32_t chunk_size
Definition: mpeg2.h:53
spu_decoder_s
Definition: spu_decoder.h:74
mpeg2_init
void mpeg2_init(mpeg2dec_t *mpeg2dec, xine_video_port_t *output)
Definition: decode.c:57
xine_video_port_s
Definition: video_out.h:176
ATTR_ALIGN
#define ATTR_ALIGN(align)
Definition: attributes.h:64
vis_padd16
#define vis_padd16(rs1, rs2, rd)
Definition: vis.h:196
mpeg2dec_accel_t
Definition: libmpeg2_accel.h:32
psrlq_i2r
#define psrlq_i2r(imm, reg)
Definition: mmx.h:633
put
#define put(predictor, i)
Definition: motion_comp.c:96
mpeg2dec_s::seek_mode
int seek_mode
Definition: mpeg2.h:42
mpeg2_mc_mmxext
mpeg2_mc_t mpeg2_mc_mmxext
MPEG2_ACCEL_X86_3DNOW
#define MPEG2_ACCEL_X86_3DNOW
Definition: mpeg2.h:156
por_r2r
#define por_r2r(regs, regd)
Definition: mmx.h:570
MPEG2_ACCEL_X86_MMX
#define MPEG2_ACCEL_X86_MMX
Definition: mpeg2.h:155
vis_set_gsr
static void vis_set_gsr(unsigned int _val)
Definition: vis.h:141
mpeg2dec_t
struct mpeg2dec_s mpeg2dec_t
pxor_r2r
#define pxor_r2r(regs, regd)
Definition: mmx.h:577
mpeg2dec_s::rff_pattern
uint32_t rff_pattern
Definition: mpeg2.h:56
movq_m2r
#define movq_m2r(var, reg)
Definition: mmx.h:411
avg
#define avg(predictor, i)
Definition: motion_comp.c:73
mpeg2dec_s::afd_value_reported
int afd_value_reported
Definition: mpeg2.h:64
vis_st64
#define vis_st64(rs1, mem)
Definition: vis.h:161
mpeg2dec_s::afd_value_seen
int afd_value_seen
Definition: mpeg2.h:63
MPEG2_MC_EXTERN
#define MPEG2_MC_EXTERN(x)
Definition: mpeg2_internal.h:271
mpeg2_mc_init
void mpeg2_mc_init(uint32_t mm_accel)
Definition: motion_comp.c:34
mpeg2_find_sequence_header
void mpeg2_find_sequence_header(mpeg2dec_t *mpeg2dec, uint8_t *data_start, uint8_t *data_end)
Definition: decode.c:871
mpeg2_mc_t
Definition: mpeg2_internal.h:284
width
unsigned int width
Definition: gfontrle.c:4
vis_psub16
#define vis_psub16(rs1, rs2, rd)
Definition: vis.h:200
vis_src1
#define vis_src1(rs1, rd)
Definition: vis.h:297
MM_ACCEL_X86_3DNOW
#define MM_ACCEL_X86_3DNOW
Definition: xineutils.h:165
mpeg2dec_s::force_pan_scan
int force_pan_scan
Definition: mpeg2.h:58
mpeg2dec_s::accel
mpeg2dec_accel_t accel
Definition: mpeg2.h:70
picture_s
Definition: mpeg2_internal.h:68
mmx_t
Definition: mmx.h:53
mpeg2_mc_vis
mpeg2_mc_t mpeg2_mc_vis
mpeg2_mc_altivec
mpeg2_mc_t mpeg2_mc_altivec
avg
#define avg(predictor, i)
Definition: motion_comp.c:97
vis_fzero
#define vis_fzero(rd)
Definition: vis.h:293
psubb_r2r
#define psubb_r2r(regs, regd)
Definition: mmx.h:484
MPEG2_ACCEL_X86_MMXEXT
#define MPEG2_ACCEL_X86_MMXEXT
Definition: mpeg2.h:157
MC_FUNC
#define MC_FUNC(op, xy)
Definition: motion_comp.c:101
mpeg2_mc_mlib
mpeg2_mc_t mpeg2_mc_mlib
mpeg2dec_s::output
xine_video_port_t * output
Definition: mpeg2.h:30
mpeg2_reset
void mpeg2_reset(mpeg2dec_t *mpeg2dec)
Definition: decode.c:741
vis_xor
#define vis_xor(rs1, rs2, rd)
Definition: vis.h:313
mpeg2dec_s::is_wait_for_ip_frames
int is_wait_for_ip_frames
Definition: mpeg2.h:39
movq_r2m
#define movq_r2m(reg, var)
Definition: mmx.h:412
mpeg2dec_s::pts
int64_t pts
Definition: mpeg2.h:55
mpeg2dec_s::frames_to_drop
int frames_to_drop
Definition: mpeg2.h:40
height
unsigned int height
Definition: gfontrle.c:5
mpeg2_internal.h
vis_pmerge
#define vis_pmerge(rs1, rs2, rd)
Definition: vis.h:211
mpeg2dec_s::code
uint8_t code
Definition: mpeg2.h:52
mpeg2_internal.h
mpeg2dec_s::picture
struct picture_s * picture
Definition: mpeg2.h:34
mpeg2_mc_alpha
mpeg2_mc_t mpeg2_mc_alpha
mpeg2_decode_data
int mpeg2_decode_data(mpeg2dec_t *mpeg2dec, uint8_t *data_start, uint8_t *data_end, uint64_t pts)
Definition: decode.c:691
MM_ACCEL_SPARC_VIS
#define MM_ACCEL_SPARC_VIS
Definition: xineutils.h:181
vis_ld64_2
#define vis_ld64_2(mem1, mem2, rs1)
Definition: vis.h:160
mpeg2dec_s::chunk_ptr
uint8_t * chunk_ptr
Definition: mpeg2.h:50
vis_ld64
#define vis_ld64(mem, rs1)
Definition: vis.h:159
config.h
movq_r2r
#define movq_r2r(regs, regd)
Definition: mmx.h:413
vis_mul8x16al
#define vis_mul8x16al(rs1, rs2, rd)
Definition: vis.h:217
punpckhbw_r2r
#define punpckhbw_r2r(regs, regd)
Definition: mmx.h:712
pand_r2r
#define pand_r2r(regs, regd)
Definition: mmx.h:555
mpeg2dec_s::cc_dec
spu_decoder_t * cc_dec
Definition: mpeg2.h:69
psraw_i2r
#define psraw_i2r(imm, reg)
Definition: mmx.h:656
mpeg2dec_s::frame_format
uint32_t frame_format
Definition: mpeg2.h:31
mpeg2dec_s::is_sequence_needed
int is_sequence_needed
Definition: mpeg2.h:38
packuswb_r2r
#define packuswb_r2r(regs, regd)
Definition: mmx.h:678
mpeg2dec_s::chunk_buffer
uint8_t * chunk_buffer
Definition: mpeg2.h:48
MM_ACCEL_PPC_ALTIVEC
#define MM_ACCEL_PPC_ALTIVEC
Definition: xineutils.h:176
vis_pack16
#define vis_pack16(rs2, rd)
Definition: vis.h:207
mpeg2dec_s::new_sequence
int new_sequence
Definition: mpeg2.h:37
mpeg2_mc
mpeg2_mc_t mpeg2_mc
Definition: motion_comp.c:32
MM_ACCEL_X86_MMXEXT
#define MM_ACCEL_X86_MMXEXT
Definition: xineutils.h:166
vis_alignaddr_g0
static void vis_alignaddr_g0(void *_ptr)
Definition: vis.h:242
VIS_GSR_SCALEFACT_SHIFT
#define VIS_GSR_SCALEFACT_SHIFT
Definition: vis.h:153
vis_mul8x16au
#define vis_mul8x16au(rs1, rs2, rd)
Definition: vis.h:216
vis_and
#define vis_and(rs1, rs2, rd)
Definition: vis.h:309