diff options
Diffstat (limited to 'src/libmpeg2new/include/mpeg2.h')
-rw-r--r-- | src/libmpeg2new/include/mpeg2.h | 83 |
1 files changed, 59 insertions, 24 deletions
diff --git a/src/libmpeg2new/include/mpeg2.h b/src/libmpeg2new/include/mpeg2.h index a67154772..6c1a3805b 100644 --- a/src/libmpeg2new/include/mpeg2.h +++ b/src/libmpeg2new/include/mpeg2.h @@ -1,6 +1,6 @@ /* * mpeg2.h - * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org> + * Copyright (C) 2000-2004 Michel Lespinasse <walken@zoy.org> * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. @@ -25,7 +25,7 @@ #define MPEG2_H #define MPEG2_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c)) -#define MPEG2_RELEASE MPEG2_VERSION (0, 3, 2) /* 0.3.2 */ +#define MPEG2_RELEASE MPEG2_VERSION (0, 4, 1) /* 0.4.1 */ #define SEQ_FLAG_MPEG2 1 #define SEQ_FLAG_CONSTRAINED_PARAMETERS 2 @@ -41,7 +41,7 @@ #define SEQ_VIDEO_FORMAT_MAC 0x80 #define SEQ_VIDEO_FORMAT_UNSPECIFIED 0xa0 -typedef struct { +typedef struct mpeg2_sequence_s { unsigned int width, height; unsigned int chroma_width, chroma_height; unsigned int byte_rate; @@ -63,7 +63,7 @@ typedef struct { #define GOP_FLAG_BROKEN_LINK 2 #define GOP_FLAG_CLOSED_GOP 4 -typedef struct { +typedef struct mpeg2_gop_s { uint8_t hours; uint8_t minutes; uint8_t seconds; @@ -81,25 +81,25 @@ typedef struct { #define PIC_FLAG_PROGRESSIVE_FRAME 16 #define PIC_FLAG_COMPOSITE_DISPLAY 32 #define PIC_FLAG_SKIP 64 -#define PIC_FLAG_PTS 128 +#define PIC_FLAG_TAGS 128 #define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000 -typedef struct { +typedef struct mpeg2_picture_s { unsigned int temporal_reference; unsigned int nb_fields; - uint32_t pts; + uint32_t tag, tag2; uint32_t flags; struct { int x, y; } display_offset[3]; } mpeg2_picture_t; -typedef struct { +typedef struct mpeg2_fbuf_s { uint8_t * buf[3]; void * id; } mpeg2_fbuf_t; -typedef struct { +typedef struct mpeg2_info_s { const mpeg2_sequence_t * sequence; const mpeg2_gop_t * gop; const mpeg2_picture_t * current_picture; @@ -110,7 +110,7 @@ typedef struct { const mpeg2_fbuf_t * display_fbuf; const mpeg2_fbuf_t * discard_fbuf; const uint8_t * user_data; - int user_data_len; + unsigned int user_data_len; } mpeg2_info_t; typedef struct mpeg2dec_s mpeg2dec_t; @@ -120,48 +120,83 @@ typedef enum { STATE_BUFFER = 0, STATE_SEQUENCE = 1, STATE_SEQUENCE_REPEATED = 2, - STATE_GOP = 3, - STATE_PICTURE = 4, - STATE_SLICE_1ST = 5, - STATE_PICTURE_2ND = 6, - STATE_SLICE = 7, - STATE_END = 8, - STATE_INVALID = 9 + STATE_SEQUENCE_MODIFIED = 3, + STATE_GOP = 4, + STATE_PICTURE = 5, + STATE_SLICE_1ST = 6, + STATE_PICTURE_2ND = 7, + STATE_SLICE = 8, + STATE_END = 9, + STATE_INVALID = 10, + STATE_INVALID_END = 11 } mpeg2_state_t; -struct convert_init_s; -void mpeg2_convert (mpeg2dec_t * mpeg2dec, - void (* convert) (int, int, uint32_t, void *, - struct convert_init_s *), void * arg); +typedef struct mpeg2_convert_init_s { + unsigned int id_size; + unsigned int buf_size[3]; + void (* start) (void * id, const mpeg2_fbuf_t * fbuf, + const mpeg2_picture_t * picture, const mpeg2_gop_t * gop); + void (* copy) (void * id, uint8_t * const * src, unsigned int v_offset); +} mpeg2_convert_init_t; +typedef enum { + MPEG2_CONVERT_SET = 0, + MPEG2_CONVERT_STRIDE = 1, + MPEG2_CONVERT_START = 2 +} mpeg2_convert_stage_t; +typedef int mpeg2_convert_t (int stage, void * id, + const mpeg2_sequence_t * sequence, int stride, + uint32_t accel, void * arg, + mpeg2_convert_init_t * result); +int mpeg2_convert (mpeg2dec_t * mpeg2dec, mpeg2_convert_t convert, void * arg); +int mpeg2_stride (mpeg2dec_t * mpeg2dec, int stride); void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id); void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf); #define MPEG2_ACCEL_X86_MMX 1 #define MPEG2_ACCEL_X86_3DNOW 2 #define MPEG2_ACCEL_X86_MMXEXT 4 +#define MPEG2_ACCEL_X86_SSE2 8 +#define MPEG2_ACCEL_X86_SSE3 16 #define MPEG2_ACCEL_PPC_ALTIVEC 1 #define MPEG2_ACCEL_ALPHA 1 #define MPEG2_ACCEL_ALPHA_MVI 2 -#define MPEG2_ACCEL_MLIB 0x40000000 +#define MPEG2_ACCEL_SPARC_VIS 1 +#define MPEG2_ACCEL_SPARC_VIS2 2 #define MPEG2_ACCEL_DETECT 0x80000000 uint32_t mpeg2_accel (uint32_t accel); mpeg2dec_t * mpeg2_init (void); const mpeg2_info_t * mpeg2_info (mpeg2dec_t * mpeg2dec); void mpeg2_close (mpeg2dec_t * mpeg2dec); -mpeg2_state_t mpeg2_reset (mpeg2dec_t * mpeg2dec); void mpeg2_buffer (mpeg2dec_t * mpeg2dec, uint8_t * start, uint8_t * end); int mpeg2_getpos (mpeg2dec_t * mpeg2dec); mpeg2_state_t mpeg2_parse (mpeg2dec_t * mpeg2dec); +void mpeg2_reset (mpeg2dec_t * mpeg2dec, int full_reset); void mpeg2_skip (mpeg2dec_t * mpeg2dec, int skip); void mpeg2_slice_region (mpeg2dec_t * mpeg2dec, int start, int end); -void mpeg2_pts (mpeg2dec_t * mpeg2dec, uint32_t pts); +void mpeg2_tag_picture (mpeg2dec_t * mpeg2dec, uint32_t tag, uint32_t tag2); void mpeg2_init_fbuf (mpeg2_decoder_t * decoder, uint8_t * current_fbuf[3], uint8_t * forward_fbuf[3], uint8_t * backward_fbuf[3]); void mpeg2_slice (mpeg2_decoder_t * decoder, int code, const uint8_t * buffer); +int mpeg2_guess_aspect (const mpeg2_sequence_t * sequence, + unsigned int * pixel_width, + unsigned int * pixel_height); + +typedef enum { + MPEG2_ALLOC_MPEG2DEC = 0, + MPEG2_ALLOC_CHUNK = 1, + MPEG2_ALLOC_YUV = 2, + MPEG2_ALLOC_CONVERT_ID = 3, + MPEG2_ALLOC_CONVERTED = 4 +} mpeg2_alloc_t; + +void * mpeg2_malloc (unsigned size, mpeg2_alloc_t reason); +void mpeg2_free (void * buf); +void mpeg2_malloc_hooks (void * malloc (unsigned, mpeg2_alloc_t), + int free (void *)); #endif /* MPEG2_H */ |