view codec-cfg.h @ 1306:7ce37211e454

yuv2rgb_mmx crashes with ffdivx codec, when we play back avi files that have a frame width that is not an exact multiple of 8. Testcase: 405.avi (356x240). Playing on an MMX capable x86 system using the x11 video-out driver results in a segfault. The MMX routines convert image data in quantities of 8 pixels in each loop, and the inner loop was not terminated in case there are only 1-7 pixels left, producing too much RGB output. For now, just ignore the last few pixels on each row, to avoid the segfaults. (Gives a black vertical border on the right, if you play a video with width%8 != 0) A possible future enhancement would be, to add a second loop to convert the last width%8 pixels to RGB using a byte loop.
author jkeil
date Thu, 12 Jul 2001 15:23:26 +0000
parents b61c5c4484f8
children eda16e490ae7
line wrap: on
line source

#ifndef __CODEC_CFG_H
#define __CODEC_CFG_H

#define CODECS_MAX_FOURCC	16
#define CODECS_MAX_OUTFMT	16

// Global flags:
#define CODECS_FLAG_SEEKABLE	(1<<0)

// Outfmt flags:
#define CODECS_FLAG_FLIP	(1<<0)
#define CODECS_FLAG_NOFLIP	(1<<1)
#define CODECS_FLAG_YUVHACK	(1<<2)

#define CODECS_STATUS_NOT_WORKING	0
#define CODECS_STATUS_UNTESTED		-1
#define CODECS_STATUS_PROBLEMS		1
#define CODECS_STATUS_WORKING		2


typedef struct {
	unsigned long f1;
	unsigned short f2;
	unsigned short f3;
	unsigned char f4[8];
} GUID;

typedef struct {
	unsigned int fourcc[CODECS_MAX_FOURCC];
	unsigned int fourccmap[CODECS_MAX_FOURCC];
	unsigned int outfmt[CODECS_MAX_OUTFMT];
	unsigned char outflags[CODECS_MAX_OUTFMT];
	char *name;
	char *info;
	char *comment;
	char *dll;
	GUID guid;
	short driver;
	short flags;
	short status;
	short cpuflags;
} codecs_t;

codecs_t** parse_codec_cfg(char *cfgfile);
codecs_t* find_video_codec(unsigned int fourcc, unsigned int *fourccmap, codecs_t *start);
codecs_t* find_audio_codec(unsigned int fourcc, unsigned int *fourccmap, codecs_t *start);
codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap,codecs_t *start,int audioflag);

#endif