forked from len0rd/rockbox
Reformat and code police (tabs, trailing whitespace, annoying overuse of parentheses, etc.) in libmpeg2 so I can stomach working on it. Don't call IDCT functions through pointers - I don't feel like extracting that change just for relevance sake.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15892 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5886efabf5
commit
2b5f979d75
10 changed files with 1772 additions and 1098 deletions
|
@ -20,26 +20,28 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef MPEG2_INTERNAL_H
|
||||
#define MPEG2_INTERNAL_H
|
||||
|
||||
#include "config.h" /* for Rockbox CPU_ #defines */
|
||||
|
||||
/* macroblock modes */
|
||||
#define MACROBLOCK_INTRA 1
|
||||
#define MACROBLOCK_PATTERN 2
|
||||
#define MACROBLOCK_MOTION_BACKWARD 4
|
||||
#define MACROBLOCK_MOTION_FORWARD 8
|
||||
#define MACROBLOCK_QUANT 16
|
||||
#define DCT_TYPE_INTERLACED 32
|
||||
#define MACROBLOCK_INTRA 1
|
||||
#define MACROBLOCK_PATTERN 2
|
||||
#define MACROBLOCK_MOTION_BACKWARD 4
|
||||
#define MACROBLOCK_MOTION_FORWARD 8
|
||||
#define MACROBLOCK_QUANT 16
|
||||
#define DCT_TYPE_INTERLACED 32
|
||||
/* motion_type */
|
||||
#define MOTION_TYPE_SHIFT 6
|
||||
#define MC_FIELD 1
|
||||
#define MC_FRAME 2
|
||||
#define MC_16X8 2
|
||||
#define MC_DMV 3
|
||||
#define MC_16X8 2
|
||||
#define MC_DMV 3
|
||||
|
||||
/* picture structure */
|
||||
#define TOP_FIELD 1
|
||||
#define BOTTOM_FIELD 2
|
||||
#define TOP_FIELD 1
|
||||
#define BOTTOM_FIELD 2
|
||||
#define FRAME_PICTURE 3
|
||||
|
||||
/* picture coding type */
|
||||
|
@ -50,18 +52,20 @@
|
|||
|
||||
typedef void mpeg2_mc_fct (uint8_t *, const uint8_t *, int, int);
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
uint8_t * ref[2][3];
|
||||
uint8_t ** ref2[2];
|
||||
int pmv[2][2];
|
||||
int f_code[2];
|
||||
} motion_t;
|
||||
|
||||
typedef void motion_parser_t (mpeg2_decoder_t * decoder,
|
||||
motion_t * motion,
|
||||
mpeg2_mc_fct * const * table);
|
||||
typedef void motion_parser_t(mpeg2_decoder_t * decoder,
|
||||
motion_t * motion,
|
||||
mpeg2_mc_fct * const * table);
|
||||
|
||||
struct mpeg2_decoder_s {
|
||||
struct mpeg2_decoder_s
|
||||
{
|
||||
/* first, state that carries information from one macroblock to the */
|
||||
/* next inside a slice, and is never used outside of mpeg2_slice() */
|
||||
|
||||
|
@ -102,7 +106,7 @@ struct mpeg2_decoder_s {
|
|||
|
||||
uint8_t * picture_dest[3];
|
||||
void (* convert) (void * convert_id, uint8_t * const * src,
|
||||
unsigned int v_offset);
|
||||
unsigned int v_offset);
|
||||
void * convert_id;
|
||||
|
||||
int dmv_offset;
|
||||
|
@ -152,11 +156,13 @@ struct mpeg2_decoder_s {
|
|||
int mpeg1;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
mpeg2_fbuf_t fbuf;
|
||||
} fbuf_alloc_t;
|
||||
|
||||
struct mpeg2dec_s {
|
||||
struct mpeg2dec_s
|
||||
{
|
||||
mpeg2_decoder_t decoder;
|
||||
|
||||
mpeg2_info_t info;
|
||||
|
@ -208,8 +214,8 @@ struct mpeg2dec_s {
|
|||
unsigned int convert_id_size;
|
||||
int convert_stride;
|
||||
void (* convert_start) (void * id, const mpeg2_fbuf_t * fbuf,
|
||||
const mpeg2_picture_t * picture,
|
||||
const mpeg2_gop_t * gop);
|
||||
const mpeg2_picture_t * picture,
|
||||
const mpeg2_gop_t * gop);
|
||||
|
||||
uint8_t * buf_start;
|
||||
uint8_t * buf_end;
|
||||
|
@ -222,19 +228,6 @@ struct mpeg2dec_s {
|
|||
uint8_t new_quantizer_matrix[4][64];
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
#ifdef ARCH_PPC
|
||||
uint8_t regv[12*16];
|
||||
#endif
|
||||
int dummy;
|
||||
} cpu_state_t;
|
||||
|
||||
/* cpu_accel.c */
|
||||
uint32_t mpeg2_detect_accel (void);
|
||||
|
||||
/* cpu_state.c */
|
||||
void mpeg2_cpu_state_init (uint32_t accel);
|
||||
|
||||
/* decode.c */
|
||||
mpeg2_state_t mpeg2_seek_header (mpeg2dec_t * mpeg2dec);
|
||||
mpeg2_state_t mpeg2_parse_header (mpeg2dec_t * mpeg2dec);
|
||||
|
@ -257,11 +250,26 @@ void mpeg2_set_fbuf (mpeg2dec_t * mpeg2dec, int b_type);
|
|||
|
||||
/* idct.c */
|
||||
void mpeg2_idct_init (void);
|
||||
void mpeg2_idct_copy(int16_t * block, uint8_t * dest,
|
||||
const int stride);
|
||||
void mpeg2_idct_add(const int last, int16_t * block,
|
||||
uint8_t * dest, const int stride);
|
||||
|
||||
extern const uint8_t default_mpeg2_scan_norm[64];
|
||||
extern const uint8_t default_mpeg2_scan_alt[64];
|
||||
extern uint8_t mpeg2_scan_norm[64];
|
||||
extern uint8_t mpeg2_scan_alt[64];
|
||||
|
||||
/* motion_comp.c */
|
||||
void mpeg2_mc_init (void);
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
mpeg2_mc_fct * put [8];
|
||||
mpeg2_mc_fct * avg [8];
|
||||
} mpeg2_mc_t;
|
||||
|
||||
extern const mpeg2_mc_t mpeg2_mc;
|
||||
|
||||
#endif /* MPEG2_INTERNAL_H */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue