Commit 0c1a9eda authored by Zdenek Kabelac's avatar Zdenek Kabelac

* UINTX -> uintx_t INTX -> intx_t

Originally committed as revision 1578 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 4596673c
......@@ -40,7 +40,7 @@
#define INFINITY HUGE_VAL
#endif
#define MAXINT64 INT64_C(0x7fffffffffffffff)
#define MAXINT64 int64_t_C(0x7fffffffffffffff)
typedef struct {
const char *name;
......@@ -142,7 +142,7 @@ static int audio_disable = 0;
static int audio_channels = 1;
static int audio_codec_id = CODEC_ID_NONE;
static INT64 recording_time = 0;
static int64_t recording_time = 0;
static int file_overwrite = 0;
static char *str_title = NULL;
static char *str_author = NULL;
......@@ -178,7 +178,7 @@ typedef struct AVOutputStream {
for A/V sync */
double sync_ipts;
double sync_ipts_offset;
INT64 sync_opts;
int64_t sync_opts;
/* video only */
int video_resample; /* video_resample and video_crop are mutually exclusive */
AVPicture pict_tmp; /* temporary image for resampling */
......@@ -201,7 +201,7 @@ typedef struct AVInputStream {
AVStream *st;
int discard; /* true if stream data should be discarded */
int decoding_needed; /* true if the packets must be decoded in 'raw_fifo' */
INT64 sample_index; /* current sample */
int64_t sample_index; /* current sample */
int frame_decoded; /* true if a video or audio frame has been decoded */
} AVInputStream;
......@@ -320,9 +320,9 @@ static void do_audio_out(AVFormatContext *s,
AVInputStream *ist,
unsigned char *buf, int size)
{
UINT8 *buftmp;
UINT8 audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it */
UINT8 audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it - yep really WMA */
uint8_t *buftmp;
uint8_t audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it */
uint8_t audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it - yep really WMA */
int size_out, frame_bytes, ret;
AVCodecContext *enc;
......@@ -376,7 +376,7 @@ static void do_audio_out(AVFormatContext *s,
static void write_picture(AVFormatContext *s, int index, AVPicture *picture,
int pix_fmt, int w, int h)
{
UINT8 *buf, *src, *dest;
uint8_t *buf, *src, *dest;
int size, j, i;
/* XXX: not efficient, should add test if we can take
......@@ -473,7 +473,7 @@ static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void
AVCodecContext *dec;
AVPicture *picture2;
AVPicture picture_tmp;
UINT8 *buf = 0;
uint8_t *buf = 0;
dec = &ist->st->codec;
......@@ -520,8 +520,8 @@ static void do_video_out(AVFormatContext *s,
int nb_frames, i, ret;
AVPicture *final_picture, *formatted_picture;
AVPicture picture_format_temp, picture_crop_temp;
static UINT8 *video_buffer;
UINT8 *buf = NULL, *buf1 = NULL;
static uint8_t *video_buffer;
uint8_t *buf = NULL, *buf1 = NULL;
AVCodecContext *enc, *dec;
#define VIDEO_BUFFER_SIZE (1024*1024)
......@@ -675,7 +675,7 @@ static void do_video_out(AVFormatContext *s,
avoid any copies. We support temorarily the older
method. */
av_write_frame(s, ost->index,
(UINT8 *)final_picture, sizeof(AVPicture));
(uint8_t *)final_picture, sizeof(AVPicture));
} else {
write_picture(s, ost->index, final_picture, enc->pix_fmt,
enc->width, enc->height);
......@@ -697,13 +697,13 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
int frame_size)
{
static FILE *fvstats=NULL;
static INT64 total_size = 0;
static int64_t total_size = 0;
char filename[40];
time_t today2;
struct tm *today;
AVCodecContext *enc;
int frame_number;
INT64 ti;
int64_t ti;
double ti1, bitrate, avg_bitrate;
if (!fvstats) {
......@@ -749,14 +749,14 @@ static void print_report(AVFormatContext **output_files,
char buf[1024];
AVOutputStream *ost;
AVFormatContext *oc, *os;
INT64 total_size;
int64_t total_size;
AVCodecContext *enc;
int frame_number, vid, i;
double bitrate, ti1, pts;
static INT64 last_time = -1;
static int64_t last_time = -1;
if (!is_last_report) {
INT64 cur_time;
int64_t cur_time;
/* display the report every 0.5 seconds */
cur_time = av_gettime();
if (last_time == -1) {
......@@ -1019,7 +1019,7 @@ static int av_encode(AVFormatContext **output_files,
ost->topBand = frame_topBand;
ost->leftBand = frame_leftBand;
} else {
UINT8 *buf;
uint8_t *buf;
ost->video_resample = 1;
ost->video_crop = 0; // cropping is handled as part of resample
buf = av_malloc((codec->width * codec->height * 3) / 2);
......@@ -1179,9 +1179,9 @@ static int av_encode(AVFormatContext **output_files,
for(;;) {
int file_index, ist_index;
AVPacket pkt;
UINT8 *ptr;
uint8_t *ptr;
int len;
UINT8 *data_buf;
uint8_t *data_buf;
int data_size, got_picture;
AVPicture picture;
short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
......@@ -1252,7 +1252,7 @@ static int av_encode(AVFormatContext **output_files,
ptr = pkt.data;
pts_set = 0;
while (len > 0) {
INT64 ipts;
int64_t ipts;
ipts = AV_NOPTS_VALUE;
......@@ -1288,7 +1288,7 @@ static int av_encode(AVFormatContext **output_files,
len -= ret;
continue;
}
data_buf = (UINT8 *)samples;
data_buf = (uint8_t *)samples;
break;
case CODEC_TYPE_VIDEO:
if (ist->st->codec.codec_id == CODEC_ID_RAWVIDEO) {
......@@ -1348,7 +1348,7 @@ static int av_encode(AVFormatContext **output_files,
/* XXX: add mpeg4 too ? */
if (ist->st->codec.codec_id == CODEC_ID_MPEG1VIDEO) {
if (ist->st->codec.pict_type != B_TYPE) {
INT64 tmp;
int64_t tmp;
tmp = ist->last_ip_pts;
ist->last_ip_pts = ist->frac_pts.val;
ist->frac_pts.val = tmp;
......@@ -2539,12 +2539,12 @@ static void opt_pass(const char *pass_str)
}
#if defined(CONFIG_WIN32) || defined(CONFIG_OS2)
static INT64 getutime(void)
static int64_t getutime(void)
{
return av_gettime();
}
#else
static INT64 getutime(void)
static int64_t getutime(void)
{
struct rusage rusage;
......@@ -2770,7 +2770,7 @@ int main(int argc, char **argv)
int optindex, i;
const char *opt, *arg;
const OptionDef *po;
INT64 ti;
int64_t ti;
av_register_all();
......
This diff is collapsed.
......@@ -29,8 +29,8 @@ static const char* liba52name = "liba52.so.0";
* released under the GPL license.
*/
typedef struct AC3DecodeState {
UINT8 inbuf[4096]; /* input buffer */
UINT8 *inbuf_ptr;
uint8_t inbuf[4096]; /* input buffer */
uint8_t *inbuf_ptr;
int frame_size;
int flags;
int channels;
......@@ -123,7 +123,7 @@ static inline int blah (int32_t i)
return i - 0x43c00000;
}
static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
static inline void float_to_int (float * _f, int16_t * s16, int nchannels)
{
int i, j, c;
int32_t * f = (int32_t *) _f; // XXX assumes IEEE float format
......@@ -142,10 +142,10 @@ static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
static int a52_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
AC3DecodeState *s = avctx->priv_data;
UINT8 *buf_ptr;
uint8_t *buf_ptr;
int flags, i, len;
int sample_rate, bit_rate;
short *out_samples = data;
......@@ -221,7 +221,7 @@ static int a52_decode_frame(AVCodecContext *avctx,
}
s->inbuf_ptr = s->inbuf;
s->frame_size = 0;
*data_size = 6 * avctx->channels * 256 * sizeof(INT16);
*data_size = 6 * avctx->channels * 256 * sizeof(int16_t);
break;
}
}
......
......@@ -38,19 +38,19 @@ typedef struct AC3BitAllocParameters {
int cplfleak, cplsleak;
} AC3BitAllocParameters;
extern const UINT16 ac3_freqs[3];
extern const UINT16 ac3_bitratetab[19];
extern const INT16 ac3_window[256];
extern const UINT8 sdecaytab[4];
extern const UINT8 fdecaytab[4];
extern const UINT16 sgaintab[4];
extern const UINT16 dbkneetab[4];
extern const UINT16 floortab[8];
extern const UINT16 fgaintab[8];
extern const uint16_t ac3_freqs[3];
extern const uint16_t ac3_bitratetab[19];
extern const int16_t ac3_window[256];
extern const uint8_t sdecaytab[4];
extern const uint8_t fdecaytab[4];
extern const uint16_t sgaintab[4];
extern const uint16_t dbkneetab[4];
extern const uint16_t floortab[8];
extern const uint16_t fgaintab[8];
void ac3_common_init(void);
void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, UINT8 *bap,
INT8 *exp, int start, int end,
void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
int8_t *exp, int start, int end,
int snroffset, int fgain, int is_lfe,
int deltbae,int deltnseg,
UINT8 *deltoffst, UINT8 *deltlen, UINT8 *deltba);
uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba);
......@@ -22,8 +22,8 @@
/* currently, I use libac3 which is Copyright (C) Aaron Holtzman and
released under the GPL license. I may reimplement it someday... */
typedef struct AC3DecodeState {
UINT8 inbuf[4096]; /* input buffer */
UINT8 *inbuf_ptr;
uint8_t inbuf[4096]; /* input buffer */
uint8_t *inbuf_ptr;
int frame_size;
int flags;
int channels;
......@@ -53,7 +53,7 @@ static inline int blah (int32_t i)
return i - 0x43c00000;
}
static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
static inline void float_to_int (float * _f, int16_t * s16, int nchannels)
{
int i, j, c;
int32_t * f = (int32_t *) _f; // XXX assumes IEEE float format
......@@ -72,10 +72,10 @@ static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
static int ac3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
AC3DecodeState *s = avctx->priv_data;
UINT8 *buf_ptr;
uint8_t *buf_ptr;
int flags, i, len;
int sample_rate, bit_rate;
short *out_samples = data;
......@@ -151,7 +151,7 @@ static int ac3_decode_frame(AVCodecContext *avctx,
}
s->inbuf_ptr = s->inbuf;
s->frame_size = 0;
*data_size = 6 * avctx->channels * 256 * sizeof(INT16);
*data_size = 6 * avctx->channels * 256 * sizeof(int16_t);
break;
}
}
......
This diff is collapsed.
/* tables taken directly from AC3 spec */
/* possible frequencies */
const UINT16 ac3_freqs[3] = { 48000, 44100, 32000 };
const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };
/* possible bitrates */
const UINT16 ac3_bitratetab[19] = {
const uint16_t ac3_bitratetab[19] = {
32, 40, 48, 56, 64, 80, 96, 112, 128,
160, 192, 224, 256, 320, 384, 448, 512, 576, 640
};
......@@ -12,7 +12,7 @@ const UINT16 ac3_bitratetab[19] = {
/* AC3 MDCT window */
/* MDCT window */
const INT16 ac3_window[256] = {
const int16_t ac3_window[256] = {
4, 7, 12, 16, 21, 28, 34, 42,
51, 61, 72, 84, 97, 111, 127, 145,
164, 184, 207, 231, 257, 285, 315, 347,
......@@ -47,9 +47,9 @@ const INT16 ac3_window[256] = {
32767,32767,32767,32767,32767,32767,32767,32767,
};
static UINT8 masktab[253];
static uint8_t masktab[253];
static const UINT8 latab[260]= {
static const uint8_t latab[260]= {
0x0040,0x003f,0x003e,0x003d,0x003c,0x003b,0x003a,0x0039,0x0038,0x0037,
0x0036,0x0035,0x0034,0x0034,0x0033,0x0032,0x0031,0x0030,0x002f,0x002f,
0x002e,0x002d,0x002c,0x002c,0x002b,0x002a,0x0029,0x0029,0x0028,0x0027,
......@@ -78,7 +78,7 @@ static const UINT8 latab[260]= {
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
};
static const UINT16 hth[50][3]= {
static const uint16_t hth[50][3]= {
{ 0x04d0,0x04f0,0x0580 },
{ 0x04d0,0x04f0,0x0580 },
{ 0x0440,0x0460,0x04b0 },
......@@ -131,7 +131,7 @@ static const UINT16 hth[50][3]= {
{ 0x0840,0x0840,0x04e0 },
};
static const UINT8 baptab[64]= {
static const uint8_t baptab[64]= {
0, 1, 1, 1, 1, 1, 2, 2, 3, 3,
3, 4, 4, 5, 5, 6, 6, 6, 6, 7,
7, 7, 7, 8, 8, 8, 8, 9, 9, 9,
......@@ -141,43 +141,43 @@ static const UINT8 baptab[64]= {
15, 15, 15, 15,
};
const UINT8 sdecaytab[4]={
const uint8_t sdecaytab[4]={
0x0f, 0x11, 0x13, 0x15,
};
const UINT8 fdecaytab[4]={
const uint8_t fdecaytab[4]={
0x3f, 0x53, 0x67, 0x7b,
};
const UINT16 sgaintab[4]= {
const uint16_t sgaintab[4]= {
0x540, 0x4d8, 0x478, 0x410,
};
const UINT16 dbkneetab[4]= {
const uint16_t dbkneetab[4]= {
0x000, 0x700, 0x900, 0xb00,
};
const UINT16 floortab[8]= {
const uint16_t floortab[8]= {
0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
};
const UINT16 fgaintab[8]= {
const uint16_t fgaintab[8]= {
0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
};
static const UINT8 bndsz[50]={
static const uint8_t bndsz[50]={
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
};
static UINT8 bndtab[51];
static uint8_t bndtab[51];
/* fft & mdct sin cos tables */
static INT16 costab[64];
static INT16 sintab[64];
static INT16 fft_rev[512];
static INT16 xcos1[128];
static INT16 xsin1[128];
static int16_t costab[64];
static int16_t sintab[64];
static int16_t fft_rev[512];
static int16_t xcos1[128];
static int16_t xsin1[128];
static UINT16 crc_table[256];
static uint16_t crc_table[256];
......@@ -329,14 +329,14 @@ static inline short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, char nibble)
static int adpcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
ADPCMContext *c = avctx->priv_data;
ADPCMChannelStatus *cs;
int n, m, channel;
int block_predictor[2];
short *samples;
UINT8 *src;
uint8_t *src;
int st; /* stereo */
samples = data;
......@@ -500,7 +500,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
*data_size = 0;
return -1;
}
*data_size = (UINT8 *)samples - (UINT8 *)data;
*data_size = (uint8_t *)samples - (uint8_t *)data;
return src - buf;
}
......
......@@ -28,7 +28,7 @@ void audio_encode_example(const char *filename)
FILE *f;
short *samples;
float t, tincr;
UINT8 *outbuf;
uint8_t *outbuf;
printf("Audio encoding\n");
......@@ -94,8 +94,8 @@ void audio_decode_example(const char *outfilename, const char *filename)
AVCodecContext *c= NULL;
int out_size, size, len;
FILE *f, *outfile;
UINT8 *outbuf;
UINT8 inbuf[INBUF_SIZE], *inbuf_ptr;
uint8_t *outbuf;
uint8_t inbuf[INBUF_SIZE], *inbuf_ptr;
printf("Audio decoding\n");
......@@ -169,7 +169,7 @@ void video_encode_example(const char *filename)
int i, out_size, size, x, y, outbuf_size;
FILE *f;
AVFrame *picture;
UINT8 *outbuf, *picture_buf;
uint8_t *outbuf, *picture_buf;
printf("Video encoding\n");
......@@ -283,7 +283,7 @@ void video_decode_example(const char *outfilename, const char *filename)
int frame, size, got_picture, len;
FILE *f;
AVFrame *picture;
UINT8 inbuf[INBUF_SIZE], *inbuf_ptr;
uint8_t inbuf[INBUF_SIZE], *inbuf_ptr;
char buf[1024];
printf("Video decoding\n");
......
......@@ -23,17 +23,17 @@
extern void j_rev_dct_ARM(DCTELEM *data);
/* XXX: local hack */
static void (*ff_put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
static void arm_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
static void arm_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
{
j_rev_dct_ARM (block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void arm_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
static void arm_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
{
j_rev_dct_ARM (block);
ff_add_pixels_clamped(block, dest, line_size);
......
......@@ -393,7 +393,7 @@ typedef struct AVCodecContext {
* decoding: set by user.
*/
void (*draw_horiz_band)(struct AVCodecContext *s,
UINT8 **src_ptr, int linesize,
uint8_t **src_ptr, int linesize,
int y, int width, int height);
/* audio only */
......@@ -992,10 +992,10 @@ typedef struct AVCodec {
int id;
int priv_data_size;
int (*init)(AVCodecContext *);
int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data);
int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
int (*close)(AVCodecContext *);
int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
UINT8 *buf, int buf_size);
uint8_t *buf, int buf_size);
int capabilities;
const AVOption *options;
struct AVCodec *next;
......@@ -1006,7 +1006,7 @@ typedef struct AVCodec {
* the last component is alpha
*/
typedef struct AVPicture {
UINT8 *data[4];
uint8_t *data[4];
int linesize[4];
} AVPicture;
......@@ -1110,7 +1110,7 @@ void img_resample(ImgReSampleContext *s,
void img_resample_close(ImgReSampleContext *s);
int avpicture_fill(AVPicture *picture, UINT8 *ptr,
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
int pix_fmt, int width, int height);
int avpicture_get_size(int pix_fmt, int width, int height);
void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
......@@ -1152,18 +1152,18 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples,
int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
UINT8 *buf, int buf_size);
uint8_t *buf, int buf_size);
int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
UINT8 *buf, int buf_size);
int avcodec_parse_frame(AVCodecContext *avctx, UINT8 **pdata,
uint8_t *buf, int buf_size);
int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
int *data_size_ptr,
UINT8 *buf, int buf_size);
int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size,
uint8_t *buf, int buf_size);
int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const short *samples);
int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size,
int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVFrame *pict);
int avcodec_close(AVCodecContext *avctx);
......
......@@ -20,7 +20,7 @@
*/
#include "avcodec.h"
const UINT8 ff_sqrt_tab[128]={
const uint8_t ff_sqrt_tab[128]={
0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
......@@ -39,9 +39,9 @@ const uint8_t ff_log2_tab[256]={
};
void init_put_bits(PutBitContext *s,
UINT8 *buffer, int buffer_size,
uint8_t *buffer, int buffer_size,
void *opaque,
void (*write_data)(void *, UINT8 *, int))
void (*write_data)(void *, uint8_t *, int))
{
s->buf = buffer;
s->buf_end = s->buf + buffer_size;
......@@ -62,12 +62,12 @@ void init_put_bits(PutBitContext *s,
}
/* return the number of bits output */
INT64 get_bit_count(PutBitContext *s)
int64_t get_bit_count(PutBitContext *s)
{
#ifdef ALT_BITSTREAM_WRITER
return s->data_out_size * 8 + s->index;
#else
return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (INT64)s->bit_left;
return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (int64_t)s->bit_left;
#endif
}
......@@ -110,7 +110,7 @@ void put_string(PutBitContext * pbc, char *s)
/* bit input functions */
void init_get_bits(GetBitContext *s,
UINT8 *buffer, int bit_size)
uint8_t *buffer, int bit_size)
{
const int buffer_size= (bit_size+7)>>3;
......@@ -160,16 +160,16 @@ int check_marker(GetBitContext *s, const char *msg)
#define GET_DATA(v, table, i, wrap, size) \
{\
const UINT8 *ptr = (const UINT8 *)table + i * wrap;\
const uint8_t *ptr = (const uint8_t *)table + i * wrap;\
switch(size) {\
case 1:\
v = *(const UINT8 *)ptr;\
v = *(const uint8_t *)ptr;\
break;\
case 2:\
v = *(const UINT16 *)ptr;\
v = *(const uint16_t *)ptr;\
break;\
default:\
v = *(const UINT32 *)ptr;\
v = *(const uint32_t *)ptr;\
break;\
}\
}
......@@ -194,10 +194,10 @@ static int build_table(VLC *vlc, int table_nb_bits,
int nb_codes,
const void *bits, int bits_wrap, int bits_size,
const void *codes, int codes_wrap, int codes_size,
UINT32 code_prefix, int n_prefix)
uint32_t code_prefix, int n_prefix)
{
int i, j, k, n, table_size, table_index, nb, n1, index;
UINT32 code;
uint32_t code;
VLC_TYPE (*table)[2];
table_size = 1 << table_nb_bits;
......
......@@ -72,33 +72,24 @@
/* windows */
typedef unsigned short UINT16;
typedef signed short INT16;
typedef unsigned char UINT8;
typedef unsigned int UINT32;
typedef unsigned __int64 UINT64;
typedef signed char INT8;
typedef signed int INT32;
typedef signed __int64 INT64;
typedef UINT8 uint8_t;
typedef INT8 int8_t;
typedef UINT16 uint16_t;
typedef INT16 int16_t;
typedef UINT32 uint32_t;
typedef INT32 int32_t;
typedef UINT64 uint64_t;
typedef INT64 int64_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
typedef signed char int8_t;
typedef signed int int32_t;
typedef signed __int64 int64_t;
# ifndef __MINGW32__
# define INT64_C(c) (c ## i64)
# define UINT64_C(c) (c ## i64)
# define int64_t_C(c) (c ## i64)
# define uint64_t_C(c) (c ## i64)
# define inline __inline
# else
# define INT64_C(c) (c ## LL)
# define UINT64_C(c) (c ## ULL)
# define int64_t_C(c) (c ## LL)
# define uint64_t_C(c) (c ## ULL)
# endif /* __MINGW32__ */
# ifdef _DEBUG
......@@ -114,20 +105,11 @@ typedef INT64 int64_t;
#include <inttypes.h>
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned int UINT32;
typedef unsigned long long UINT64;
typedef signed char INT8;
typedef signed short INT16;
typedef signed int INT32;
typedef signed long long INT64;
#ifdef HAVE_AV_CONFIG_H
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#ifndef int64_t_C
#define int64_t_C(c) (c ## LL)
#define uint64_t_C(c) (c ## ULL)
#endif
#ifdef USE_FASTMEMCPY
......@@ -145,23 +127,10 @@ typedef signed long long INT64;
# include <inttypes.h>
# ifndef __WINE_WINDEF16_H
/* workaround for typedef conflict in MPlayer (wine typedefs) */
typedef unsigned short UINT16;
typedef signed short INT16;
# endif
typedef unsigned char UINT8;
typedef unsigned int UINT32;
typedef unsigned long long UINT64;
typedef signed char INT8;
typedef signed int INT32;
typedef signed long long INT64;
# ifdef HAVE_AV_CONFIG_H
# ifndef INT64_C
# define INT64_C(c) (c ## LL)
# define UINT64_C(c) (c ## ULL)
# ifndef int64_t_C
# define int64_t_C(c) (c ## LL)
# define uint64_t_C(c) (c ## ULL)
# endif
# ifdef USE_FASTMEMCPY
......@@ -240,26 +209,26 @@ static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
struct PutBitContext;
typedef void (*WriteDataFunc)(void *, UINT8 *, int);
typedef void (*WriteDataFunc)(void *, uint8_t *, int);
typedef struct PutBitContext {
#ifdef ALT_BITSTREAM_WRITER
UINT8 *buf, *buf_end;
uint8_t *buf, *buf_end;
int index;
#else
UINT32 bit_buf;
uint32_t bit_buf;
int bit_left;
UINT8 *buf, *buf_ptr, *buf_end;
uint8_t *buf, *buf_ptr, *buf_end;
#endif
INT64 data_out_size; /* in bytes */
int64_t data_out_size; /* in bytes */
} PutBitContext;
void init_put_bits(PutBitContext *s,
UINT8 *buffer, int buffer_size,
uint8_t *buffer, int buffer_size,
void *opaque,
void (*write_data)(void *, UINT8 *, int));
void (*write_data)(void *, uint8_t *, int));
INT64 get_bit_count(PutBitContext *s); /* XXX: change function name */
int64_t get_bit_count(PutBitContext *s); /* XXX: change function name */
void align_put_bits(PutBitContext *s);
void flush_put_bits(PutBitContext *s);
void put_string(PutBitContext * pbc, char *s);
......@@ -267,17 +236,17 @@ void put_string(PutBitContext * pbc, char *s);
/* bit input */
typedef struct GetBitContext {
UINT8 *buffer, *buffer_end;
uint8_t *buffer, *buffer_end;
#ifdef ALT_BITSTREAM_READER
int index;
#elif defined LIBMPEG2_BITSTREAM_READER
UINT8 *buffer_ptr;
UINT32 cache;
uint8_t *buffer_ptr;
uint32_t cache;
int bit_count;
#elif defined A32_BITSTREAM_READER
UINT32 *buffer_ptr;
UINT32 cache0;
UINT32 cache1;
uint32_t *buffer_ptr;
uint32_t cache0;
uint32_t cache1;
int bit_count;
#endif
int size_in_bits;
......@@ -285,7 +254,7 @@ typedef struct GetBitContext {
static inline int get_bits_count(GetBitContext *s);
#define VLC_TYPE INT16
#define VLC_TYPE int16_t
typedef struct VLC {
int bits;
......@@ -305,7 +274,7 @@ typedef struct RL_VLC_ELEM {
/* used to avoid missaligned exceptions on some archs (alpha, ...) */
#ifdef ARCH_X86
# define unaligned32(a) (*(UINT32*)(a))
# define unaligned32(a) (*(uint32_t*)(a))
#else
# ifdef __GNUC__
static inline uint32_t unaligned32(const void *v) {
......@@ -357,7 +326,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
s->buf_ptr[3] = bit_buf ;
} else
#endif
*(UINT32 *)s->buf_ptr = be2me_32(bit_buf);
*(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
//printf("bitbuf = %08x\n", bit_buf);
s->buf_ptr+=4;
bit_left+=32 - n;
......@@ -700,7 +669,7 @@ static inline void skip_bits1(GetBitContext *s){
}
void init_get_bits(GetBitContext *s,
UINT8 *buffer, int buffer_size);
uint8_t *buffer, int buffer_size);
int check_marker(GetBitContext *s, const char *msg);
void align_get_bits(GetBitContext *s);
......
......@@ -56,7 +56,7 @@ static int cyuv_decode_init(AVCodecContext *avctx)
static int cyuv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
CyuvDecodeContext *s=avctx->priv_data;
......
......@@ -40,13 +40,13 @@ static const unsigned short aanscales[64] = {
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
INT64 gettime(void)
int64_t gettime(void)
{
struct timeval tv;
gettimeofday(&tv,NULL);
return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}
#define NB_ITS 20000
......@@ -86,8 +86,8 @@ void dct_error(const char *name, int is_idct,
{
int it, i, scale;
int err_inf, v;
INT64 err2, ti, ti1, it1;
INT64 sysErr[64], sysErrMax=0;
int64_t err2, ti, ti1, it1;
int64_t sysErr[64], sysErrMax=0;
int maxout=0;
int blockSumErrMax=0, blockSumErr;
......@@ -261,10 +261,10 @@ void dct_error(const char *name, int is_idct,
#endif
}
static UINT8 img_dest[64] __attribute__ ((aligned (8)));
static UINT8 img_dest1[64] __attribute__ ((aligned (8)));
static uint8_t img_dest[64] __attribute__ ((aligned (8)));
static uint8_t img_dest1[64] __attribute__ ((aligned (8)));
void idct248_ref(UINT8 *dest, int linesize, INT16 *block)
void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
{
static int init;
static double c8[8][8];
......@@ -345,7 +345,7 @@ void idct248_ref(UINT8 *dest, int linesize, INT16 *block)
}
void idct248_error(const char *name,
void (*idct248_put)(UINT8 *dest, int line_size, INT16 *block))
void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block))
{
int it, i, it1, ti, ti1, err_max, v;
......
This diff is collapsed.
......@@ -35,16 +35,16 @@ void j_rev_dct (DCTELEM *data);
void ff_fdct_mmx(DCTELEM *block);
/* encoding scans */
extern const UINT8 ff_alternate_horizontal_scan[64];
extern const UINT8 ff_alternate_vertical_scan[64];
extern const UINT8 ff_zigzag_direct[64];
extern const uint8_t ff_alternate_horizontal_scan[64];
extern const uint8_t ff_alternate_vertical_scan[64];
extern const uint8_t ff_zigzag_direct[64];
/* pixel operations */
#define MAX_NEG_CROP 384
/* temporary */
extern UINT32 squareTbl[512];
extern UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
extern uint32_t squareTbl[512];
extern uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
/* minimum alignment rules ;)
......@@ -58,22 +58,22 @@ i (michael) didnt check them, these are just the alignents which i think could b
*/
/*
void get_pixels_c(DCTELEM *block, const UINT8 *pixels, int line_size);
void diff_pixels_c(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride);
void put_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
void add_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);
void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
void clear_blocks_c(DCTELEM *blocks);
*/
/* add and put pixel (decoding) */
// blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
typedef void (*op_pixels_func)(UINT8 *block/*align width (8 or 16)*/, const UINT8 *pixels/*align 1*/, int line_size, int h);
typedef void (*qpel_mc_func)(UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);
typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
#define DEF_OLD_QPEL(name)\
void ff_put_ ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);\
void ff_put_no_rnd_ ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);\
void ff_avg_ ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);
void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
DEF_OLD_QPEL(qpel16_mc11_old_c)
DEF_OLD_QPEL(qpel16_mc31_old_c)
......@@ -96,22 +96,22 @@ static void a(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
/* motion estimation */
typedef int (*op_pixels_abs_func)(UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
typedef int (*op_pixels_abs_func)(uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
typedef struct DSPContext {
/* pixel ops : interface with DCT */
void (*get_pixels)(DCTELEM *block/*align 16*/, const UINT8 *pixels/*align 8*/, int line_size);
void (*diff_pixels)(DCTELEM *block/*align 16*/, const UINT8 *s1/*align 8*/, const UINT8 *s2/*align 8*/, int stride);
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
void (*gmc1)(UINT8 *dst/*align 8*/, UINT8 *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
void (*gmc )(UINT8 *dst/*align 8*/, UINT8 *src/*align 1*/, int stride, int h, int ox, int oy,
void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
int (*pix_sum)(UINT8 * pix, int line_size);
int (*pix_norm1)(UINT8 * pix, int line_size);
int (*pix_sum)(uint8_t * pix, int line_size);
int (*pix_norm1)(uint8_t * pix, int line_size);
me_cmp_func sad[2]; /* identical to pix_absAxA except additional void * */
me_cmp_func sse[2];
me_cmp_func hadamard8_diff[2];
......@@ -157,7 +157,7 @@ void dsputil_init(DSPContext* p, unsigned mask);
* permute block according to permuatation.
* @param last last non zero element in scantable order
*/
void ff_block_permute(DCTELEM *block, UINT8 *permutation, const UINT8 *scantable, int last);
void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
#define emms_c()
......@@ -177,8 +177,8 @@ int mm_support(void);
extern int mm_flags;
void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size);
void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size);
void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
static inline void emms(void)
{
......@@ -264,7 +264,7 @@ struct unaligned_32 { uint32_t l; } __attribute__((packed));
#endif /* !__GNUC__ */
/* PSNR */
void get_psnr(UINT8 *orig_image[3], UINT8 *coded_image[3],
void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
int orig_linesize[3], int coded_linesize,
AVCodecContext *avctx);
......
......@@ -32,15 +32,15 @@ typedef struct DVVideoDecodeContext {
VLC *vlc;
int sampling_411; /* 0 = 420, 1 = 411 */
int width, height;
UINT8 *current_picture[3]; /* picture structure */
uint8_t *current_picture[3]; /* picture structure */
AVFrame picture;
int linesize[3];
DCTELEM block[5*6][64] __align8;
UINT8 dv_zigzag[2][64];
UINT8 idct_permutation[64];
uint8_t dv_zigzag[2][64];
uint8_t idct_permutation[64];
/* XXX: move it to static storage ? */
UINT8 dv_shift[2][22][64];
void (*idct_put[2])(UINT8 *dest, int line_size, DCTELEM *block);
uint8_t dv_shift[2][22][64];
void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block);
} DVVideoDecodeContext;
#include "dvdata.h"
......@@ -136,18 +136,18 @@ static int dvvideo_decode_init(AVCodecContext *avctx)
//#define VLC_DEBUG
typedef struct BlockInfo {
const UINT8 *shift_table;
const UINT8 *scan_table;
UINT8 pos; /* position in block */
UINT8 eob_reached; /* true if EOB has been reached */
UINT8 dct_mode;
UINT8 partial_bit_count;
UINT16 partial_bit_buffer;
const uint8_t *shift_table;
const uint8_t *scan_table;
uint8_t pos; /* position in block */
uint8_t eob_reached; /* true if EOB has been reached */
uint8_t dct_mode;
uint8_t partial_bit_count;
uint16_t partial_bit_buffer;
int shift_offset;
} BlockInfo;
/* block size in bits */
static const UINT16 block_sizes[6] = {
static const uint16_t block_sizes[6] = {
112, 112, 112, 112, 80, 80
};
......@@ -161,8 +161,8 @@ static void dv_decode_ac(DVVideoDecodeContext *s,
{
int last_re_index;
int shift_offset = mb->shift_offset;
const UINT8 *scan_table = mb->scan_table;
const UINT8 *shift_table = mb->shift_table;
const uint8_t *scan_table = mb->scan_table;
const uint8_t *shift_table = mb->shift_table;
int pos = mb->pos;
int level, pos1, sign, run;
int partial_bit_count;
......@@ -176,8 +176,8 @@ static void dv_decode_ac(DVVideoDecodeContext *s,
/* if we must parse a partial vlc, we do it here */
partial_bit_count = mb->partial_bit_count;
if (partial_bit_count > 0) {
UINT8 buf[4];
UINT32 v;
uint8_t buf[4];
uint32_t v;
int l, l1;
GetBitContext gb1;
......@@ -298,21 +298,21 @@ static inline void bit_copy(PutBitContext *pb, GetBitContext *gb, int bits_left)
/* mb_x and mb_y are in units of 8 pixels */
static inline void dv_decode_video_segment(DVVideoDecodeContext *s,
UINT8 *buf_ptr1,
const UINT16 *mb_pos_ptr)
uint8_t *buf_ptr1,
const uint16_t *mb_pos_ptr)
{
int quant, dc, dct_mode, class1, j;
int mb_index, mb_x, mb_y, v, last_index;
DCTELEM *block, *block1;
int c_offset, bits_left;
UINT8 *y_ptr;
uint8_t *y_ptr;
BlockInfo mb_data[5 * 6], *mb, *mb1;
void (*idct_put)(UINT8 *dest, int line_size, DCTELEM *block);
UINT8 *buf_ptr;
void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block);
uint8_t *buf_ptr;
PutBitContext pb, vs_pb;
UINT8 mb_bit_buffer[80 + 4]; /* allow some slack */
uint8_t mb_bit_buffer[80 + 4]; /* allow some slack */
int mb_bit_count;
UINT8 vs_bit_buffer[5 * 80 + 4]; /* allow some slack */
uint8_t vs_bit_buffer[5 * 80 + 4]; /* allow some slack */
int vs_bit_count;
memset(s->block, 0, sizeof(s->block));
......@@ -493,12 +493,12 @@ static inline void dv_decode_video_segment(DVVideoDecodeContext *s,
144000 bytes for PAL) */
static int dvvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
DVVideoDecodeContext *s = avctx->priv_data;
int sct, dsf, apt, ds, nb_dif_segs, vs, width, height, i, packet_size;
UINT8 *buf_ptr;
const UINT16 *mb_pos_ptr;
uint8_t *buf_ptr;
const uint16_t *mb_pos_ptr;
/* parse id */
init_get_bits(&s->gb, buf, buf_size*8);
......@@ -642,9 +642,9 @@ static int dvaudio_decode_init(AVCodecContext *avctx)
return 0;
}
static UINT16 dv_audio_12to16(UINT16 sample)
static uint16_t dv_audio_12to16(uint16_t sample)
{
UINT16 shift, result;
uint16_t shift, result;
sample = (sample < 0x800) ? sample : sample | 0xf000;
shift = (sample & 0xf00) >> 8;
......@@ -676,13 +676,13 @@ static UINT16 dv_audio_12to16(UINT16 sample)
*/
static int dvaudio_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
DVVideoDecodeContext *s = avctx->priv_data;
const UINT16 (*unshuffle)[9];
const uint16_t (*unshuffle)[9];
int smpls, freq, quant, sys, stride, difseg, ad, dp, nb_dif_segs, i;
UINT16 lc, rc;
UINT8 *buf_ptr;
uint16_t lc, rc;
uint8_t *buf_ptr;
/* parse id */
init_get_bits(&s->gb, &buf[AAUX_OFFSET], 5*8);
......@@ -742,10 +742,10 @@ static int dvaudio_decode_frame(AVCodecContext *avctx,
if (difseg >= nb_dif_segs/2)
goto out; /* We're not doing 4ch at this time */
lc = ((UINT16)buf_ptr[dp] << 4) |
((UINT16)buf_ptr[dp+2] >> 4);
rc = ((UINT16)buf_ptr[dp+1] << 4) |
((UINT16)buf_ptr[dp+2] & 0x0f);
lc = ((uint16_t)buf_ptr[dp] << 4) |
((uint16_t)buf_ptr[dp+2] >> 4);
rc = ((uint16_t)buf_ptr[dp+1] << 4) |
((uint16_t)buf_ptr[dp+2] & 0x0f);
lc = dv_audio_12to16(lc);
rc = dv_audio_12to16(rc);
......
......@@ -20,7 +20,7 @@
#define NB_DV_VLC 409
#define AAUX_OFFSET (80*6 + 80*16*3 + 3)
static const UINT16 dv_vlc_bits[409] = {
static const uint16_t dv_vlc_bits[409] = {
0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a,
0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2,
......@@ -75,7 +75,7 @@ static const UINT16 dv_vlc_bits[409] = {
0x0006,
};
static const UINT8 dv_vlc_len[409] = {
static const uint8_t dv_vlc_len[409] = {
2, 3, 4, 4, 4, 5, 5, 5,
5, 6, 6, 6, 6, 7, 7, 7,
7, 7, 7, 7, 7, 8, 8, 8,
......@@ -130,7 +130,7 @@ static const UINT8 dv_vlc_len[409] = {
4,
};
static const UINT8 dv_vlc_run[409] = {
static const uint8_t dv_vlc_run[409] = {
0, 0, 1, 0, 0, 2, 1, 0,
0, 3, 4, 0, 0, 5, 6, 2,
1, 1, 0, 0, 0, 7, 8, 9,
......@@ -185,7 +185,7 @@ static const UINT8 dv_vlc_run[409] = {
0,
};
static const UINT8 dv_vlc_level[409] = {
static const uint8_t dv_vlc_level[409] = {
1, 2, 1, 3, 4, 1, 2, 5,
6, 1, 1, 7, 8, 1, 1, 2,
3, 4, 9, 10, 11, 1, 1, 1,
......@@ -242,7 +242,7 @@ static const UINT8 dv_vlc_level[409] = {
/* Specific zigzag scan for 248 idct. NOTE that unlike the
specification, we interleave the fields */
static const UINT8 dv_248_zigzag[64] = {
static const uint8_t dv_248_zigzag[64] = {
0, 8, 1, 9, 16, 24, 2, 10,
17, 25, 32, 40, 48, 56, 33, 41,
18, 26, 3, 11, 4, 12, 19, 27,
......@@ -254,7 +254,7 @@ static const UINT8 dv_248_zigzag[64] = {
};
/* unquant tables (not used directly) */
static const UINT8 dv_88_areas[64] = {
static const uint8_t dv_88_areas[64] = {
0,0,0,1,1,1,2,2,
0,0,1,1,1,2,2,2,
0,1,1,1,2,2,2,3,
......@@ -265,7 +265,7 @@ static const UINT8 dv_88_areas[64] = {
2,2,3,3,3,3,3,3,
};
static const UINT8 dv_248_areas[64] = {
static const uint8_t dv_248_areas[64] = {
0,0,1,1,1,2,2,3,
0,0,1,1,2,2,2,3,
0,1,1,2,2,2,3,3,
......@@ -276,7 +276,7 @@ static const UINT8 dv_248_areas[64] = {
1,2,2,3,3,3,3,3,
};
static UINT8 dv_quant_shifts[22][4] = {
static uint8_t dv_quant_shifts[22][4] = {
{ 3,3,4,4 },
{ 3,3,4,4 },
{ 2,3,3,4 },
......@@ -301,12 +301,12 @@ static UINT8 dv_quant_shifts[22][4] = {
{ 0,0,0,0 },
};
static const UINT8 dv_quant_offset[4] = { 6, 3, 0, 1 };
static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 };
/* NOTE: I prefer hardcoding the positionning of dv blocks, it is
simpler :-) */
static const UINT16 dv_place_420[1620] = {
static const uint16_t dv_place_420[1620] = {
0x0c24, 0x2412, 0x3036, 0x0000, 0x1848,
0x0e24, 0x2612, 0x3236, 0x0200, 0x1a48,
0x1024, 0x2812, 0x3436, 0x0400, 0x1c48,
......@@ -633,7 +633,7 @@ static const UINT16 dv_place_420[1620] = {
0x0a34, 0x2222, 0x2e46, 0x4610, 0x1658,
};
static const UINT16 dv_place_411[1350] = {
static const uint16_t dv_place_411[1350] = {
0x0c24, 0x2710, 0x3334, 0x0000, 0x1848,
0x0d24, 0x2810, 0x3434, 0x0100, 0x1948,
0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48,
......@@ -906,7 +906,7 @@ static const UINT16 dv_place_411[1350] = {
0x0834, 0x2320, 0x2f44, 0x3810, 0x1658,
};
static const UINT16 dv_place_audio60[10][9] = {
static const uint16_t dv_place_audio60[10][9] = {
{ 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
{ 6, 36, 66, 26, 56, 86, 16, 46, 76 },
{ 12, 42, 72, 2, 32, 62, 22, 52, 82 },
......@@ -920,7 +920,7 @@ static const UINT16 dv_place_audio60[10][9] = {
{ 25, 55, 85, 15, 45, 75, 5, 35, 65 },
};
static const UINT16 dv_place_audio50[12][9] = {
static const uint16_t dv_place_audio50[12][9] = {
{ 0, 36, 72, 26, 62, 98, 16, 52, 88}, /* 1st channel */
{ 6, 42, 78, 32, 68, 104, 22, 58, 94},
{ 12, 48, 84, 2, 38, 74, 28, 64, 100},
......
......@@ -54,7 +54,7 @@ static void put_dc(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t
}
}
static void filter181(INT16 *data, int width, int height, int stride){
static void filter181(int16_t *data, int width, int height, int stride){
int x,y;
/* horizontal filter */
......@@ -95,7 +95,7 @@ static void filter181(INT16 *data, int width, int height, int stride){
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
static void guess_dc(MpegEncContext *s, INT16 *dc, int w, int h, int stride, int is_luma){
static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma){
int b_x, b_y;
for(b_y=0; b_y<h; b_y++){
......@@ -103,7 +103,7 @@ static void guess_dc(MpegEncContext *s, INT16 *dc, int w, int h, int stride, int
int color[4]={1024,1024,1024,1024};
int distance[4]={9999,9999,9999,9999};
int mb_index, error, j;
INT64 guess, weight_sum;
int64_t guess, weight_sum;
mb_index= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_width;
......@@ -163,8 +163,8 @@ static void guess_dc(MpegEncContext *s, INT16 *dc, int w, int h, int stride, int
weight_sum=0;
guess=0;
for(j=0; j<4; j++){
INT64 weight= 256*256*256*16/distance[j];
guess+= weight*(INT64)color[j];
int64_t weight= 256*256*256*16/distance[j];
guess+= weight*(int64_t)color[j];
weight_sum+= weight;
}
guess= (guess + weight_sum/2) / weight_sum;
......@@ -179,9 +179,9 @@ static void guess_dc(MpegEncContext *s, INT16 *dc, int w, int h, int stride, int
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
static void h_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stride, int is_luma){
static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
int b_x, b_y;
UINT8 *cm = cropTbl + MAX_NEG_CROP;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
for(b_y=0; b_y<h; b_y++){
for(b_x=0; b_x<w-1; b_x++){
......@@ -193,8 +193,8 @@ static void h_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri
int left_damage = left_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int right_damage= right_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int offset= b_x*8 + b_y*stride*8;
INT16 *left_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ( b_x <<(1-is_luma))];
INT16 *right_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ((b_x+1)<<(1-is_luma))];
int16_t *left_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ( b_x <<(1-is_luma))];
int16_t *right_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ((b_x+1)<<(1-is_luma))];
if(!(left_damage||right_damage)) continue; // both undamaged
......@@ -239,9 +239,9 @@ static void h_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stride, int is_luma){
static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
int b_x, b_y;
UINT8 *cm = cropTbl + MAX_NEG_CROP;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
for(b_y=0; b_y<h-1; b_y++){
for(b_x=0; b_x<w; b_x++){
......@@ -253,8 +253,8 @@ static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri
int top_damage = top_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int bottom_damage= bottom_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int offset= b_x*8 + b_y*stride*8;
INT16 *top_mv= s->motion_val[s->block_wrap[0]*(( b_y <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
INT16 *bottom_mv= s->motion_val[s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
int16_t *top_mv= s->motion_val[s->block_wrap[0]*(( b_y <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
int16_t *bottom_mv= s->motion_val[s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
if(!(top_damage||bottom_damage)) continue; // both undamaged
......@@ -295,7 +295,7 @@ static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri
}
static void guess_mv(MpegEncContext *s){
UINT8 fixed[s->mb_num];
uint8_t fixed[s->mb_num];
#define MV_FROZEN 3
#define MV_CHANGED 2
#define MV_UNCHANGED 1
......@@ -464,7 +464,7 @@ int score_sum=0;
s->mb_y= mb_y;
for(j=0; j<pred_count; j++){
int score=0;
UINT8 *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
uint8_t *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
s->motion_val[mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0];
s->motion_val[mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1];
......@@ -558,8 +558,8 @@ static int is_intra_more_likely(MpegEncContext *s){
if((j%skip_amount) != 0) continue; //skip a few to speed things up
if(s->pict_type==I_TYPE){
UINT8 *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
UINT8 *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
is_intra_likely += s->dsp.pix_abs16x16(last_mb_ptr, mb_ptr , s->linesize);
is_intra_likely -= s->dsp.pix_abs16x16(last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize);
......@@ -795,8 +795,8 @@ void ff_error_resilience(MpegEncContext *s){
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
int dc, dcu, dcv, y, n;
INT16 *dc_ptr;
UINT8 *dest_y, *dest_cb, *dest_cr;
int16_t *dc_ptr;
uint8_t *dest_y, *dest_cb, *dest_cr;
i++;
error= s->error_status_table[i];
......@@ -846,7 +846,7 @@ void ff_error_resilience(MpegEncContext *s){
i= -1;
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
UINT8 *dest_y, *dest_cb, *dest_cr;
uint8_t *dest_y, *dest_cb, *dest_cr;
i++;
error= s->error_status_table[i];
......
......@@ -105,11 +105,11 @@ float frandom(void)
return (float)((random() & 0xffff) - 32768) / 32768.0;
}
INT64 gettime(void)
int64_t gettime(void)
{
struct timeval tv;
gettimeofday(&tv,NULL);
return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}
void check_diff(float *tab1, float *tab2, int n)
......@@ -233,7 +233,7 @@ int main(int argc, char **argv)
/* do a speed test */
if (do_speed) {
INT64 time_start, duration;
int64_t time_start, duration;
int nb_its;
printf("Speed test...\n");
......
This diff is collapsed.
/* intra MCBPC, mb_type = (intra), then (intraq) */
const UINT8 intra_MCBPC_code[8] = { 1, 1, 2, 3, 1, 1, 2, 3 };
const UINT8 intra_MCBPC_bits[8] = { 1, 3, 3, 3, 4, 6, 6, 6 };
const uint8_t intra_MCBPC_code[8] = { 1, 1, 2, 3, 1, 1, 2, 3 };
const uint8_t intra_MCBPC_bits[8] = { 1, 3, 3, 3, 4, 6, 6, 6 };
/* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */
/* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */
const UINT8 inter_MCBPC_code[25] = {
const uint8_t inter_MCBPC_code[25] = {
1, 3, 2, 5,
3, 4, 3, 3,
3, 7, 6, 5,
......@@ -14,7 +14,7 @@ const UINT8 inter_MCBPC_code[25] = {
1, /* Stuffing */
2, 12, 14, 15,
};
const UINT8 inter_MCBPC_bits[25] = {
const uint8_t inter_MCBPC_bits[25] = {
1, 4, 4, 6,
5, 8, 8, 7,
3, 7, 7, 9,
......@@ -25,14 +25,14 @@ const UINT8 inter_MCBPC_bits[25] = {
};
/* This is the old table
static const UINT8 inter_MCBPC_code[20] = {
static const uint8_t inter_MCBPC_code[20] = {
1, 3, 2, 5,
3, 4, 3, 3,
0, 1, 2, 3,
4, 4, 3, 2,
2, 5, 4, 5,
};
static const UINT8 inter_MCBPC_bits[20] = {
static const uint8_t inter_MCBPC_bits[20] = {
1, 4, 4, 6,
5, 8, 8, 7,
12, 12, 12, 12,
......@@ -40,13 +40,13 @@ static const UINT8 inter_MCBPC_bits[20] = {
3, 7, 7, 8,
};*/
const UINT8 cbpy_tab[16][2] =
const uint8_t cbpy_tab[16][2] =
{
{3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4},
{2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
};
const UINT8 mvtab[33][2] =
const uint8_t mvtab[33][2] =
{
{1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
{11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10},
......@@ -56,7 +56,7 @@ const UINT8 mvtab[33][2] =
};
/* third non intra table */
const UINT16 inter_vlc[103][2] = {
const uint16_t inter_vlc[103][2] = {
{ 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 },
{ 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 },
{ 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 },
......@@ -85,7 +85,7 @@ const UINT16 inter_vlc[103][2] = {
{ 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 },
};
const INT8 inter_level[102] = {
const int8_t inter_level[102] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 1, 2, 3, 4,
5, 6, 1, 2, 3, 4, 1, 2,
......@@ -101,7 +101,7 @@ const INT8 inter_level[102] = {
1, 1, 1, 1, 1, 1,
};
const INT8 inter_run[102] = {
const int8_t inter_run[102] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 2, 2, 2, 2, 3, 3,
......@@ -125,7 +125,7 @@ static RLTable rl_inter = {
inter_level,
};
const UINT16 intra_vlc_aic[103][2] = {
const uint16_t intra_vlc_aic[103][2] = {
{ 0x2, 2 }, { 0x6, 3 }, { 0xe, 4 }, { 0xc, 5 },
{ 0xd, 5 }, { 0x10, 6 }, { 0x11, 6 }, { 0x12, 6 },
{ 0x16, 7 }, { 0x1b, 8 }, { 0x20, 9 }, { 0x21, 9 },
......@@ -154,7 +154,7 @@ const UINT16 intra_vlc_aic[103][2] = {
{ 0x59, 12 }, { 0x5a, 12 }, { 0x3, 7 },
};
const INT8 intra_run_aic[102] = {
const int8_t intra_run_aic[102] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
......@@ -170,7 +170,7 @@ const INT8 intra_run_aic[102] = {
18, 19, 20, 21, 22, 23,
};
const INT8 intra_level_aic[102] = {
const int8_t intra_level_aic[102] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24,
......@@ -194,7 +194,7 @@ static RLTable rl_intra_aic = {
intra_level_aic,
};
static const UINT16 h263_format[8][2] = {
static const uint16_t h263_format[8][2] = {
{ 0, 0 },
{ 128, 96 },
{ 176, 144 },
......@@ -203,7 +203,7 @@ static const UINT16 h263_format[8][2] = {
{ 1408, 1152 },
};
static UINT8 h263_aic_dc_scale_table[32]={
static uint8_t h263_aic_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
};
......
......@@ -299,7 +299,7 @@ static int decode_slice(MpegEncContext *s){
* finds the end of the current frame in the bitstream.
* @return the position of the first byte of the next frame, or -1
*/
static int mpeg4_find_frame_end(MpegEncContext *s, UINT8 *buf, int buf_size){
static int mpeg4_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){
ParseContext *pc= &s->parse_context;
int vop_found, i;
uint32_t state;
......@@ -403,7 +403,7 @@ static void draw_arrow(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int
int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
int ret,i;
......@@ -629,7 +629,7 @@ retry:
#endif
if(s->error_resilience)
memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_num*sizeof(UINT8));
memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_num*sizeof(uint8_t));
/* decode each macroblock */
s->block_wrap[0]=
......
......@@ -638,7 +638,7 @@ static void decode_bgr_bitstream(HYuvContext *s, int count){
static void draw_slice(HYuvContext *s, int y){
int h, cy;
UINT8 *src_ptr[3];
uint8_t *src_ptr[3];
if(s->avctx->draw_horiz_band==NULL)
return;
......
This diff is collapsed.
......@@ -25,7 +25,7 @@
/* XXX: we use explicit registers to avoid a gcc 2.95.2 register asm
clobber bug - now it will work with 2.95.2 and also with -fPIC
*/
static void DEF(put_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
......@@ -85,7 +85,7 @@ static void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
:"memory");
}
static void DEF(put_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
......@@ -154,7 +154,7 @@ static void DEF(put_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
}
/* GL: this function does incorrect rounding if overflow */
static void DEF(put_no_rnd_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put_no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BONE(mm6);
__asm __volatile(
......@@ -191,7 +191,7 @@ static void DEF(put_no_rnd_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int li
:"%eax", "memory");
}
static void DEF(put_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
......@@ -222,7 +222,7 @@ static void DEF(put_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size
}
/* GL: this function does incorrect rounding if overflow */
static void DEF(put_no_rnd_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put_no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BONE(mm6);
__asm __volatile(
......@@ -255,7 +255,7 @@ static void DEF(put_no_rnd_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int li
:"%eax", "memory");
}
static void DEF(avg_pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg_pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
......@@ -283,7 +283,7 @@ static void DEF(avg_pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, i
:"%eax", "memory");
}
static void DEF(avg_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
......@@ -315,7 +315,7 @@ static void DEF(avg_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size
:"%eax", "memory");
}
static void DEF(avg_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
......@@ -354,7 +354,7 @@ static void DEF(avg_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size
}
// Note this is not correctly rounded, but this function is only used for b frames so it doesnt matter
static void DEF(avg_pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BONE(mm6);
__asm __volatile(
......@@ -396,31 +396,31 @@ static void DEF(avg_pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_siz
}
//FIXME the following could be optimized too ...
static void DEF(put_no_rnd_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put_no_rnd_pixels8_x2)(block , pixels , line_size, h);
DEF(put_no_rnd_pixels8_x2)(block+8, pixels+8, line_size, h);
}
static void DEF(put_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(put_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put_pixels8_y2)(block , pixels , line_size, h);
DEF(put_pixels8_y2)(block+8, pixels+8, line_size, h);
}
static void DEF(put_no_rnd_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(put_no_rnd_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put_no_rnd_pixels8_y2)(block , pixels , line_size, h);
DEF(put_no_rnd_pixels8_y2)(block+8, pixels+8, line_size, h);
}
static void DEF(avg_pixels16)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(avg_pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8)(block , pixels , line_size, h);
DEF(avg_pixels8)(block+8, pixels+8, line_size, h);
}
static void DEF(avg_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(avg_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8_x2)(block , pixels , line_size, h);
DEF(avg_pixels8_x2)(block+8, pixels+8, line_size, h);
}
static void DEF(avg_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(avg_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8_y2)(block , pixels , line_size, h);
DEF(avg_pixels8_y2)(block+8, pixels+8, line_size, h);
}
static void DEF(avg_pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8_xy2)(block , pixels , line_size, h);
DEF(avg_pixels8_xy2)(block+8, pixels+8, line_size, h);
}
......
......@@ -22,7 +22,7 @@
*/
// put_pixels
static void DEF(put, pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
......@@ -104,7 +104,7 @@ static void DEF(put, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
:"memory");
}
static void DEF(put, pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
......@@ -199,7 +199,7 @@ static void DEF(put, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, in
:"memory");
}
static void DEF(put, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
......@@ -228,7 +228,7 @@ static void DEF(put, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_siz
:"eax", "memory");
}
static void DEF(put, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_ZERO(mm7);
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
......@@ -296,7 +296,7 @@ static void DEF(put, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_si
// avg_pixels
// in case more speed is needed - unroling would certainly help
static void DEF(avg, pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
......@@ -315,7 +315,7 @@ static void DEF(avg, pixels8)(UINT8 *block, const UINT8 *pixels, int line_size,
while (--h);
}
static void DEF(avg, pixels16)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
......@@ -338,7 +338,7 @@ static void DEF(avg, pixels16)(UINT8 *block, const UINT8 *pixels, int line_size,
while (--h);
}
static void DEF(avg, pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
......@@ -379,7 +379,7 @@ static void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
} while (--h);
}
static void DEF(avg, pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
......@@ -432,7 +432,7 @@ static void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, in
} while (--h);
}
static void DEF(avg, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
......@@ -472,7 +472,7 @@ static void DEF(avg, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_siz
}
// this routine is 'slightly' suboptimal but mostly unused
static void DEF(avg, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_ZERO(mm7);
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
......@@ -547,22 +547,22 @@ static void DEF(avg, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_si
}
//FIXME optimize
static void DEF(put, pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(put, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put, pixels8_y2)(block , pixels , line_size, h);
DEF(put, pixels8_y2)(block+8, pixels+8, line_size, h);
}
static void DEF(put, pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put, pixels8_xy2)(block , pixels , line_size, h);
DEF(put, pixels8_xy2)(block+8, pixels+8, line_size, h);
}
static void DEF(avg, pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(avg, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg, pixels8_y2)(block , pixels , line_size, h);
DEF(avg, pixels8_y2)(block+8, pixels+8, line_size, h);
}
static void DEF(avg, pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
static void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg, pixels8_xy2)(block , pixels , line_size, h);
DEF(avg, pixels8_xy2)(block+8, pixels+8, line_size, h);
}
......
......@@ -23,7 +23,7 @@
void dsputil_init_pix_mmx(DSPContext* c, unsigned mask);
void dsputil_set_bit_exact_pix_mmx(DSPContext* c, unsigned mask);
static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={
static const __attribute__ ((aligned(8))) uint64_t round_tab[3]={
0x0000000000000000,
0x0001000100010001,
0x0002000200020002,
......@@ -31,7 +31,7 @@ static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={
static __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL;
static inline void sad8_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
......@@ -67,7 +67,7 @@ static inline void sad8_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
);
}
static inline void sad8_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
static inline void sad8_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
......@@ -89,7 +89,7 @@ static inline void sad8_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
);
}
static inline void sad8_2_mmx2(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
static inline void sad8_2_mmx2(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
......@@ -115,7 +115,7 @@ static inline void sad8_2_mmx2(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stri
);
}
static inline void sad8_4_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{ //FIXME reuse src
int len= -(stride<<h);
asm volatile(
......@@ -152,7 +152,7 @@ static inline void sad8_4_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
);
}
static inline void sad8_2_mmx(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
......@@ -190,7 +190,7 @@ static inline void sad8_2_mmx(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int strid
);
}
static inline void sad8_4_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
......@@ -268,7 +268,7 @@ static inline int sum_mmx2(void)
#define PIX_SAD(suf)\
static int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs8x8_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
......@@ -277,7 +277,7 @@ static int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
\
return sum_ ## suf();\
}\
static int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
static int sad8x8_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
......@@ -287,7 +287,7 @@ static int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
return sum_ ## suf();\
}\
\
static int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs8x8_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
......@@ -300,7 +300,7 @@ static int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
return sum_ ## suf();\
}\
\
static int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs8x8_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
......@@ -313,7 +313,7 @@ static int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
return sum_ ## suf();\
}\
\
static int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs8x8_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
......@@ -326,7 +326,7 @@ static int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
return sum_ ## suf();\
}\
\
static int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs16x16_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
......@@ -336,7 +336,7 @@ static int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
\
return sum_ ## suf();\
}\
static int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
static int sad16x16_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
......@@ -346,7 +346,7 @@ static int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
\
return sum_ ## suf();\
}\
static int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs16x16_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
......@@ -359,7 +359,7 @@ static int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
\
return sum_ ## suf();\
}\
static int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs16x16_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
......@@ -372,7 +372,7 @@ static int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
\
return sum_ ## suf();\
}\
static int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
static int pix_abs16x16_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
......
......@@ -25,9 +25,9 @@
#include "../avcodec.h"
#include "../simple_idct.h"
extern UINT8 zigzag_direct_noperm[64];
extern UINT16 inv_zigzag_direct16[64];
extern UINT32 inverse[256];
extern uint8_t zigzag_direct_noperm[64];
extern uint16_t inv_zigzag_direct16[64];
extern uint32_t inverse[256];
static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL;
static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
......@@ -144,7 +144,7 @@ static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int nCoeffs;
const UINT16 *quant_matrix;
const uint16_t *quant_matrix;
assert(s->block_last_index[n]>=0);
......@@ -272,7 +272,7 @@ static void dct_unquantize_mpeg2_mmx(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int nCoeffs;
const UINT16 *quant_matrix;
const uint16_t *quant_matrix;
assert(s->block_last_index[n]>=0);
......@@ -404,9 +404,9 @@ asm volatile(
/* draw the edges of width 'w' of an image of size width, height
this mmx version can only handle w==8 || w==16 */
static void draw_edges_mmx(UINT8 *buf, int wrap, int width, int height, int w)
static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, int w)
{
UINT8 *ptr, *last_line;
uint8_t *ptr, *last_line;
int i;
last_line = buf + (height - 1) * wrap;
......@@ -505,22 +505,22 @@ void ff_mmxext_idct(DCTELEM *block);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
static void ff_libmpeg2mmx_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmx_idct (block);
put_pixels_clamped_mmx(block, dest, line_size);
}
static void ff_libmpeg2mmx_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmx_idct (block);
add_pixels_clamped_mmx(block, dest, line_size);
}
static void ff_libmpeg2mmx2_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmxext_idct (block);
put_pixels_clamped_mmx(block, dest, line_size);
}
static void ff_libmpeg2mmx2_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmxext_idct (block);
add_pixels_clamped_mmx(block, dest, line_size);
......
......@@ -37,8 +37,8 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
int qscale, int *overflow)
{
int level=0, last_non_zero_p1, q; //=0 is cuz gcc says uninitalized ...
const UINT16 *qmat, *bias;
static __align8 INT16 temp_block[64];
const uint16_t *qmat, *bias;
static __align8 int16_t temp_block[64];
//s->fdct (block);
ff_fdct_mmx (block); //cant be anything else ...
......
......@@ -1298,12 +1298,12 @@ void ff_simple_idct_mmx(int16_t *block)
//FIXME merge add/put into the idct
void ff_simple_idct_put_mmx(UINT8 *dest, int line_size, DCTELEM *block)
void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block)
{
idct(block);
put_pixels_clamped_mmx(block, dest, line_size);
}
void ff_simple_idct_add_mmx(UINT8 *dest, int line_size, DCTELEM *block)
void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block)
{
idct(block);
add_pixels_clamped_mmx(block, dest, line_size);
......
This diff is collapsed.
......@@ -41,9 +41,9 @@
struct ImgReSampleContext {
int iwidth, iheight, owidth, oheight, topBand, bottomBand, leftBand, rightBand;
int h_incr, v_incr;
INT16 h_filters[NB_PHASES][NB_TAPS] __align8; /* horizontal filters */
INT16 v_filters[NB_PHASES][NB_TAPS] __align8; /* vertical filters */
UINT8 *line_buf;
int16_t h_filters[NB_PHASES][NB_TAPS] __align8; /* horizontal filters */
int16_t v_filters[NB_PHASES][NB_TAPS] __align8; /* vertical filters */
uint8_t *line_buf;
};
static inline int get_phase(int pos)
......@@ -52,12 +52,12 @@ static inline int get_phase(int pos)
}
/* This function must be optimized */
static void h_resample_fast(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
int src_start, int src_incr, INT16 *filters)
static void h_resample_fast(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
int src_start, int src_incr, int16_t *filters)
{
int src_pos, phase, sum, i;
UINT8 *s;
INT16 *filter;
uint8_t *s;
int16_t *filter;
src_pos = src_start;
for(i=0;i<dst_width;i++) {
......@@ -95,11 +95,11 @@ static void h_resample_fast(UINT8 *dst, int dst_width, UINT8 *src, int src_width
}
/* This function must be optimized */
static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
INT16 *filter)
static void v_resample(uint8_t *dst, int dst_width, uint8_t *src, int wrap,
int16_t *filter)
{
int sum, i;
UINT8 *s;
uint8_t *s;
s = src;
for(i=0;i<dst_width;i++) {
......@@ -111,7 +111,7 @@ static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
#else
{
int j;
UINT8 *s1 = s;
uint8_t *s1 = s;
sum = 0;
for(j=0;j<NB_TAPS;j++) {
......@@ -154,12 +154,12 @@ static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
#define DUMP(reg) movq_r2m(reg, tmp); printf(#reg "=%016Lx\n", tmp.uq);
/* XXX: do four pixels at a time */
static void h_resample_fast4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
int src_start, int src_incr, INT16 *filters)
static void h_resample_fast4_mmx(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
int src_start, int src_incr, int16_t *filters)
{
int src_pos, phase;
UINT8 *s;
INT16 *filter;
uint8_t *s;
int16_t *filter;
mmx_t tmp;
src_pos = src_start;
......@@ -198,11 +198,11 @@ static void h_resample_fast4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int src_
emms();
}
static void v_resample4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
INT16 *filter)
static void v_resample4_mmx(uint8_t *dst, int dst_width, uint8_t *src, int wrap,
int16_t *filter)
{
int sum, i, v;
UINT8 *s;
uint8_t *s;
mmx_t tmp;
mmx_t coefs[4];
......@@ -239,7 +239,7 @@ static void v_resample4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
packuswb_r2r(mm7, mm0);
movq_r2m(mm0, tmp);
*(UINT32 *)dst = tmp.ud[0];
*(uint32_t *)dst = tmp.ud[0];
dst += 4;
s += 4;
dst_width -= 4;
......@@ -274,8 +274,8 @@ typedef union {
signed short s[8];
} vec_ss_t;
void v_resample16_altivec(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
INT16 *filter)
void v_resample16_altivec(uint8_t *dst, int dst_width, uint8_t *src, int wrap,
int16_t *filter)
{
int sum, i;
uint8_t *s;
......@@ -391,12 +391,12 @@ void v_resample16_altivec(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
#endif
/* slow version to handle limit cases. Does not need optimisation */
static void h_resample_slow(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
int src_start, int src_incr, INT16 *filters)
static void h_resample_slow(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
int src_start, int src_incr, int16_t *filters)
{
int src_pos, phase, sum, j, v, i;
UINT8 *s, *src_end;
INT16 *filter;
uint8_t *s, *src_end;
int16_t *filter;
src_end = src + src_width;
src_pos = src_start;
......@@ -426,8 +426,8 @@ static void h_resample_slow(UINT8 *dst, int dst_width, UINT8 *src, int src_width
}
}
static void h_resample(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
int src_start, int src_incr, INT16 *filters)
static void h_resample(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
int src_start, int src_incr, int16_t *filters)
{
int n, src_end;
......@@ -463,11 +463,11 @@ static void h_resample(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
}
static void component_resample(ImgReSampleContext *s,
UINT8 *output, int owrap, int owidth, int oheight,
UINT8 *input, int iwrap, int iwidth, int iheight)
uint8_t *output, int owrap, int owidth, int oheight,
uint8_t *input, int iwrap, int iwidth, int iheight)
{
int src_y, src_y1, last_src_y, ring_y, phase_y, y1, y;
UINT8 *new_line, *src_line;
uint8_t *new_line, *src_line;
last_src_y = - FCENTER - 1;
/* position of the bottom of the filter in the source image */
......@@ -528,7 +528,7 @@ static void component_resample(ImgReSampleContext *s,
/* XXX: the following filter is quite naive, but it seems to suffice
for 4 taps */
static void build_filter(INT16 *filter, float factor)
static void build_filter(int16_t *filter, float factor)
{
int ph, i, v;
float x, y, tab[NB_TAPS], norm, mult;
......@@ -641,15 +641,15 @@ void av_free(void *ptr)
/* input */
#define XSIZE 256
#define YSIZE 256
UINT8 img[XSIZE * YSIZE];
uint8_t img[XSIZE * YSIZE];
/* output */
#define XSIZE1 512
#define YSIZE1 512
UINT8 img1[XSIZE1 * YSIZE1];
UINT8 img2[XSIZE1 * YSIZE1];
uint8_t img1[XSIZE1 * YSIZE1];
uint8_t img2[XSIZE1 * YSIZE1];
void save_pgm(const char *filename, UINT8 *img, int xsize, int ysize)
void save_pgm(const char *filename, uint8_t *img, int xsize, int ysize)
{
FILE *f;
f=fopen(filename,"w");
......@@ -658,7 +658,7 @@ void save_pgm(const char *filename, UINT8 *img, int xsize, int ysize)
fclose(f);
}
static void dump_filter(INT16 *filter)
static void dump_filter(int16_t *filter)
{
int i, ph;
......
......@@ -78,10 +78,10 @@
*/
#if CONST_BITS == 8
#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */
#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */
#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */
#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */
#define FIX_0_382683433 ((int32_t) 98) /* FIX(0.382683433) */
#define FIX_0_541196100 ((int32_t) 139) /* FIX(0.541196100) */
#define FIX_0_707106781 ((int32_t) 181) /* FIX(0.707106781) */
#define FIX_1_306562965 ((int32_t) 334) /* FIX(1.306562965) */
#else
#define FIX_0_382683433 FIX(0.382683433)
#define FIX_0_541196100 FIX(0.541196100)
......@@ -101,7 +101,7 @@
#endif
/* Multiply a DCTELEM variable by an INT32 constant, and immediately
/* Multiply a DCTELEM variable by an int32_t constant, and immediately
* descale to yield a DCTELEM result.
*/
......
......@@ -78,7 +78,7 @@
* they are represented to better-than-integral precision. These outputs
* require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
* with the recommended scaling. (For 12-bit sample data, the intermediate
* array is INT32 anyway.)
* array is int32_t anyway.)
*
* To avoid overflow of the 32-bit intermediate results in pass 2, we must
* have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
......@@ -101,18 +101,18 @@
*/
#if CONST_BITS == 13
#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
#define FIX_0_298631336 ((int32_t) 2446) /* FIX(0.298631336) */
#define FIX_0_390180644 ((int32_t) 3196) /* FIX(0.390180644) */
#define FIX_0_541196100 ((int32_t) 4433) /* FIX(0.541196100) */
#define FIX_0_765366865 ((int32_t) 6270) /* FIX(0.765366865) */
#define FIX_0_899976223 ((int32_t) 7373) /* FIX(0.899976223) */
#define FIX_1_175875602 ((int32_t) 9633) /* FIX(1.175875602) */
#define FIX_1_501321110 ((int32_t) 12299) /* FIX(1.501321110) */
#define FIX_1_847759065 ((int32_t) 15137) /* FIX(1.847759065) */
#define FIX_1_961570560 ((int32_t) 16069) /* FIX(1.961570560) */
#define FIX_2_053119869 ((int32_t) 16819) /* FIX(2.053119869) */
#define FIX_2_562915447 ((int32_t) 20995) /* FIX(2.562915447) */
#define FIX_3_072711026 ((int32_t) 25172) /* FIX(3.072711026) */
#else
#define FIX_0_298631336 FIX(0.298631336)
#define FIX_0_390180644 FIX(0.390180644)
......@@ -129,7 +129,7 @@
#endif
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
* For 8-bit samples with the recommended scaling, all the variable
* and constant values involved are no more than 16 bits wide, so a
* 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
......@@ -150,9 +150,9 @@
GLOBAL(void)
ff_jpeg_fdct_islow (DCTELEM * data)
{
INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
INT32 tmp10, tmp11, tmp12, tmp13;
INT32 z1, z2, z3, z4, z5;
int32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int32_t tmp10, tmp11, tmp12, tmp13;
int32_t z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int ctr;
SHIFT_TEMPS
......
......@@ -92,7 +92,7 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2];
#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
#endif
#define ONE ((INT32) 1)
#define ONE ((int32_t) 1)
#define CONST_SCALE (ONE << CONST_BITS)
......@@ -103,16 +103,16 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2];
*/
/* Actually FIX is no longer used, we precomputed them all */
#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
#define FIX(x) ((int32_t) ((x) * CONST_SCALE + 0.5))
/* Descale and correctly round an INT32 value that's scaled by N bits.
/* Descale and correctly round an int32_t value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
* For 8-bit samples with the recommended scaling, all the variable
* and constant values involved are no more than 16 bits wide, so a
* 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
......@@ -125,10 +125,10 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2];
#ifdef EIGHT_BIT_SAMPLES
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
#define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const)))
#define MULTIPLY(var,const) (((int16_t) (var)) * ((int16_t) (const)))
#endif
#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
#define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const)))
#define MULTIPLY(var,const) (((int16_t) (var)) * ((int32_t) (const)))
#endif
#endif
......@@ -172,10 +172,10 @@ ones here or successive P-frames will drift too much with Reference frame coding
void j_rev_dct(DCTBLOCK data)
{
INT32 tmp0, tmp1, tmp2, tmp3;
INT32 tmp10, tmp11, tmp12, tmp13;
INT32 z1, z2, z3, z4, z5;
INT32 d0, d1, d2, d3, d4, d5, d6, d7;
int32_t tmp0, tmp1, tmp2, tmp3;
int32_t tmp10, tmp11, tmp12, tmp13;
int32_t z1, z2, z3, z4, z5;
int32_t d0, d1, d2, d3, d4, d5, d6, d7;
register DCTELEM *dataptr;
int rowctr;
......
......@@ -24,11 +24,11 @@
* libavcodec api, context stuff, interlaced stereo out).
*/
static const UINT16 MACEtab1[] = { 0xfff3, 0x0008, 0x004c, 0x00de, 0x00de, 0x004c, 0x0008, 0xfff3 };
static const uint16_t MACEtab1[] = { 0xfff3, 0x0008, 0x004c, 0x00de, 0x00de, 0x004c, 0x0008, 0xfff3 };
static const UINT16 MACEtab3[] = { 0xffee, 0x008c, 0x008c, 0xffee };
static const uint16_t MACEtab3[] = { 0xffee, 0x008c, 0x008c, 0xffee };
static const UINT16 MACEtab2[][8] = {
static const uint16_t MACEtab2[][8] = {
{ 0x0025, 0x0074, 0x00CE, 0x014A, 0xFEB5, 0xFF31, 0xFF8B, 0xFFDA },
{ 0x0027, 0x0079, 0x00D8, 0x015A, 0xFEA5, 0xFF27, 0xFF86, 0xFFD8 },
{ 0x0029, 0x007F, 0x00E1, 0x0169, 0xFE96, 0xFF1E, 0xFF80, 0xFFD6 },
......@@ -159,7 +159,7 @@ static const UINT16 MACEtab2[][8] = {
{ 0x25A7, 0x741F, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x8BE0, 0xDA58 },
};
static const UINT16 MACEtab4[][8] = {
static const uint16_t MACEtab4[][8] = {
{ 0x0040, 0x00D8, 0xFF27, 0xFFBF, 0, 0, 0, 0 }, { 0x0043, 0x00E2, 0xFF1D, 0xFFBC, 0, 0, 0, 0 },
{ 0x0046, 0x00EC, 0xFF13, 0xFFB9, 0, 0, 0, 0 }, { 0x004A, 0x00F6, 0xFF09, 0xFFB5, 0, 0, 0, 0 },
{ 0x004D, 0x0101, 0xFEFE, 0xFFB2, 0, 0, 0, 0 }, { 0x0050, 0x010C, 0xFEF3, 0xFFAF, 0, 0, 0, 0 },
......@@ -234,9 +234,9 @@ typedef struct MACEContext {
/* /// "chomp3()" */
static void chomp3(MACEContext *ctx,
UINT8 val,
const UINT16 tab1[],
const UINT16 tab2[][8])
uint8_t val,
const uint16_t tab1[],
const uint16_t tab2[][8])
{
short current;
......@@ -253,13 +253,13 @@ static void chomp3(MACEContext *ctx,
/* /// "Exp1to3()" */
static void Exp1to3(MACEContext *ctx,
UINT8 *inBuffer,
uint8_t *inBuffer,
void *outBuffer,
UINT32 cnt,
UINT32 numChannels,
UINT32 whichChannel)
uint32_t cnt,
uint32_t numChannels,
uint32_t whichChannel)
{
UINT8 pkt;
uint8_t pkt;
/*
if (inState) {
......@@ -298,9 +298,9 @@ static void Exp1to3(MACEContext *ctx,
/* /// "chomp6()" */
static void chomp6(MACEContext *ctx,
UINT8 val,
const UINT16 tab1[],
const UINT16 tab2[][8])
uint8_t val,
const uint16_t tab1[],
const uint16_t tab2[][8])
{
short current;
......@@ -335,13 +335,13 @@ static void chomp6(MACEContext *ctx,
/* /// "Exp1to6()" */
static void Exp1to6(MACEContext *ctx,
UINT8 *inBuffer,
uint8_t *inBuffer,
void *outBuffer,
UINT32 cnt,
UINT32 numChannels,
UINT32 whichChannel)
uint32_t cnt,
uint32_t numChannels,
uint32_t whichChannel)
{
UINT8 pkt;
uint8_t pkt;
/*
if (inState) {
......@@ -389,7 +389,7 @@ static int mace_decode_init(AVCodecContext * avctx)
static int mace_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
short *samples;
MACEContext *c = avctx->priv_data;
......
......@@ -30,15 +30,15 @@
#undef TWOMATRIXES
typedef struct MJpegContext {
UINT8 huff_size_dc_luminance[12];
UINT16 huff_code_dc_luminance[12];
UINT8 huff_size_dc_chrominance[12];
UINT16 huff_code_dc_chrominance[12];
UINT8 huff_size_ac_luminance[256];
UINT16 huff_code_ac_luminance[256];
UINT8 huff_size_ac_chrominance[256];
UINT16 huff_code_ac_chrominance[256];
uint8_t huff_size_dc_luminance[12];
uint16_t huff_code_dc_luminance[12];
uint8_t huff_size_dc_chrominance[12];
uint16_t huff_code_dc_chrominance[12];
uint8_t huff_size_ac_luminance[256];
uint16_t huff_code_ac_luminance[256];
uint8_t huff_size_ac_chrominance[256];
uint16_t huff_code_ac_chrominance[256];
} MJpegContext;
/* JPEG marker codes */
......@@ -152,19 +152,19 @@ static const unsigned char std_chrominance_quant_tbl[64] = {
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
static const UINT8 bits_dc_luminance[17] =
static const uint8_t bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_luminance[] =
static const uint8_t val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_dc_chrominance[17] =
static const uint8_t bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_chrominance[] =
static const uint8_t val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_ac_luminance[17] =
static const uint8_t bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
static const UINT8 val_ac_luminance[] =
static const uint8_t val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
......@@ -188,10 +188,10 @@ static const UINT8 val_ac_luminance[] =
0xf9, 0xfa
};
static const UINT8 bits_ac_chrominance[17] =
static const uint8_t bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
static const UINT8 val_ac_chrominance[] =
static const uint8_t val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
......@@ -216,8 +216,8 @@ static const UINT8 val_ac_chrominance[] =
};
/* isn't this function nicer than the one in the libjpeg ? */
static void build_huffman_codes(UINT8 *huff_size, UINT16 *huff_code,
const UINT8 *bits_table, const UINT8 *val_table)
static void build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
const uint8_t *bits_table, const uint8_t *val_table)
{
int i, j, k,nb, code, sym;
......@@ -282,7 +282,7 @@ static inline void put_marker(PutBitContext *p, int code)
/* table_class: 0 = DC coef, 1 = AC coefs */
static int put_huffman_table(MpegEncContext *s, int table_class, int table_id,
const UINT8 *bits_table, const UINT8 *value_table)
const uint8_t *bits_table, const uint8_t *value_table)
{
PutBitContext *p = &s->pb;
int n, i;
......@@ -306,7 +306,7 @@ static void jpeg_table_header(MpegEncContext *s)
{
PutBitContext *p = &s->pb;
int i, j, size;
UINT8 *ptr;
uint8_t *ptr;
/* quant matrixes */
put_marker(p, DQT);
......@@ -349,7 +349,7 @@ static void jpeg_put_comments(MpegEncContext *s)
{
PutBitContext *p = &s->pb;
int size;
UINT8 *ptr;
uint8_t *ptr;
if (s->aspect_ratio_info)
{
......@@ -541,7 +541,7 @@ void mjpeg_picture_trailer(MpegEncContext *s)
}
static inline void mjpeg_encode_dc(MpegEncContext *s, int val,
UINT8 *huff_size, UINT16 *huff_code)
uint8_t *huff_size, uint16_t *huff_code)
{
int mant, nbits;
......@@ -572,8 +572,8 @@ static void encode_block(MpegEncContext *s, DCTELEM *block, int n)
int mant, nbits, code, i, j;
int component, dc, run, last_index, val;
MJpegContext *m = s->mjpeg_ctx;
UINT8 *huff_size_ac;
UINT16 *huff_code_ac;
uint8_t *huff_size_ac;
uint16_t *huff_code_ac;
/* DC coef */
component = (n <= 3 ? 0 : n - 4 + 1);
......@@ -651,9 +651,9 @@ typedef struct MJpegDecodeContext {
int start_code; /* current start code */
int buffer_size;
UINT8 *buffer;
uint8_t *buffer;
INT16 quant_matrixes[4][64];
int16_t quant_matrixes[4][64];
VLC vlcs[2][4];
int org_width, org_height; /* size given at codec init */
......@@ -669,11 +669,11 @@ typedef struct MJpegDecodeContext {
int h_max, v_max; /* maximum h and v counts */
int quant_index[4]; /* quant table index for each component */
int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
UINT8 *current_picture[MAX_COMPONENTS]; /* picture structure */
uint8_t *current_picture[MAX_COMPONENTS]; /* picture structure */
int linesize[MAX_COMPONENTS];
DCTELEM block[64] __align8;
ScanTable scantable;
void (*idct_put)(UINT8 *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
int restart_interval;
int restart_count;
......@@ -684,11 +684,11 @@ typedef struct MJpegDecodeContext {
static int mjpeg_decode_dht(MJpegDecodeContext *s);
static void build_vlc(VLC *vlc, const UINT8 *bits_table, const UINT8 *val_table,
static void build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table,
int nb_codes)
{
UINT8 huff_size[256];
UINT16 huff_code[256];
uint8_t huff_size[256];
uint16_t huff_code[256];
memset(huff_size, 0, sizeof(huff_size));
build_huffman_codes(huff_size, huff_code, bits_table, val_table);
......@@ -776,8 +776,8 @@ static int mjpeg_decode_dqt(MJpegDecodeContext *s)
static int mjpeg_decode_dht(MJpegDecodeContext *s)
{
int len, index, i, class, n, v, code_max;
UINT8 bits_table[17];
UINT8 val_table[256];
uint8_t bits_table[17];
uint8_t val_table[256];
len = get_bits(&s->gb, 16) - 2;
......@@ -928,7 +928,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
int nbits, code, i, j, level;
int run, val;
VLC *ac_vlc;
INT16 *quant_matrix;
int16_t *quant_matrix;
/* DC coef */
val = mjpeg_decode_dc(s, dc_index);
......@@ -1071,7 +1071,7 @@ static int mjpeg_decode_sos(MJpegDecodeContext *s)
for(mb_y = 0; mb_y < mb_height; mb_y++) {
for(mb_x = 0; mb_x < mb_width; mb_x++) {
for(i=0;i<nb_components;i++) {
UINT8 *ptr;
uint8_t *ptr;
int x, y, c;
n = nb_blocks[i];
c = comp_index[i];
......@@ -1266,7 +1266,7 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
unsigned int len = get_bits(&s->gb, 16);
if (len >= 2 && len < 32768) {
/* XXX: any better upper bound */
UINT8 *cbuf = av_malloc(len - 1);
uint8_t *cbuf = av_malloc(len - 1);
if (cbuf) {
int i;
for (i = 0; i < len - 2; i++)
......@@ -1318,9 +1318,9 @@ static int valid_marker_list[] =
/* return the 8 bit start code value and update the search
state. Return -1 if no start code found */
static int find_marker(UINT8 **pbuf_ptr, UINT8 *buf_end)
static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end)
{
UINT8 *buf_ptr;
uint8_t *buf_ptr;
unsigned int v, v2;
int val;
#ifdef DEBUG
......@@ -1350,10 +1350,10 @@ found:
static int mjpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
MJpegDecodeContext *s = avctx->priv_data;
UINT8 *buf_end, *buf_ptr;
uint8_t *buf_end, *buf_ptr;
int i, start_code;
AVPicture *picture = data;
......@@ -1387,12 +1387,12 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
/* unescape buffer of SOS */
if (start_code == SOS)
{
UINT8 *src = buf_ptr;
UINT8 *dst = s->buffer;
uint8_t *src = buf_ptr;
uint8_t *dst = s->buffer;
while (src<buf_end)
{
UINT8 x = *(src++);
uint8_t x = *(src++);
*(dst++) = x;
if (x == 0xff)
......@@ -1527,10 +1527,10 @@ the_end:
static int mjpegb_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
MJpegDecodeContext *s = avctx->priv_data;
UINT8 *buf_end, *buf_ptr;
uint8_t *buf_end, *buf_ptr;
int i;
AVPicture *picture = data;
GetBitContext hgb; /* for the header */
......
......@@ -198,10 +198,10 @@ static void avg_pixels8_xy2_mlib (uint8_t * dest, const uint8_t * ref,
}
static void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
static void (*put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
static void add_pixels_clamped_mlib(const DCTELEM *block, UINT8 *pixels, int line_size)
static void add_pixels_clamped_mlib(const DCTELEM *block, uint8_t *pixels, int line_size)
{
mlib_VideoAddBlock_U8_S16(pixels, (mlib_s16 *)block, line_size);
}
......@@ -209,13 +209,13 @@ static void add_pixels_clamped_mlib(const DCTELEM *block, UINT8 *pixels, int lin
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
static void ff_idct_put_mlib(UINT8 *dest, int line_size, DCTELEM *data)
static void ff_idct_put_mlib(uint8_t *dest, int line_size, DCTELEM *data)
{
mlib_VideoIDCT8x8_S16_S16 (data, data);
put_pixels_clamped(data, dest, line_size);
}
static void ff_idct_add_mlib(UINT8 *dest, int line_size, DCTELEM *data)
static void ff_idct_add_mlib(uint8_t *dest, int line_size, DCTELEM *data)
{
mlib_VideoIDCT8x8_S16_S16 (data, data);
mlib_VideoAddBlock_U8_S16(dest, (mlib_s16 *)data, line_size);
......
......@@ -387,7 +387,7 @@ void ff_init_me(MpegEncContext *s){
}
}
static int pix_dev(UINT8 * pix, int line_size, int mean)
static int pix_dev(uint8_t * pix, int line_size, int mean)
{
int s, i, j;
......@@ -422,7 +422,7 @@ static int full_motion_search(MpegEncContext * s,
{
int x1, y1, x2, y2, xx, yy, x, y;
int mx, my, dmin, d;
UINT8 *pix;
uint8_t *pix;
xx = 16 * s->mb_x;
yy = 16 * s->mb_y;
......@@ -476,7 +476,7 @@ static int log_motion_search(MpegEncContext * s,
{
int x1, y1, x2, y2, xx, yy, x, y;
int mx, my, dmin, d;
UINT8 *pix;
uint8_t *pix;
xx = s->mb_x << 4;
yy = s->mb_y << 4;
......@@ -552,7 +552,7 @@ static int phods_motion_search(MpegEncContext * s,
{
int x1, y1, x2, y2, xx, yy, x, y, lastx, d;
int mx, my, dminx, dminy;
UINT8 *pix;
uint8_t *pix;
xx = s->mb_x << 4;
yy = s->mb_y << 4;
......@@ -657,7 +657,7 @@ static inline int sad_hpel_motion_search(MpegEncContext * s,
uint32_t *score_map= s->me.score_map;
const int penalty_factor= s->me.sub_penalty_factor;
int mx, my, xx, yy, dminh;
UINT8 *pix, *ptr;
uint8_t *pix, *ptr;
op_pixels_abs_func pix_abs_x2;
op_pixels_abs_func pix_abs_y2;
op_pixels_abs_func pix_abs_xy2;
......@@ -964,7 +964,7 @@ static inline int h263_mv4_search(MpegEncContext *s, int xmin, int ymin, int xma
void ff_estimate_p_frame_motion(MpegEncContext * s,
int mb_x, int mb_y)
{
UINT8 *pix, *ppix;
uint8_t *pix, *ppix;
int sum, varc, vard, mx, my, range, dmin, xx, yy;
int xmin, ymin, xmax, ymax;
int rel_xmin, rel_ymin, rel_xmax, rel_ymax;
......@@ -1302,7 +1302,7 @@ static inline int check_bidir_mv(MpegEncContext * s,
//FIXME optimize?
//FIXME move into template?
//FIXME better f_code prediction (max mv & distance)
UINT16 *mv_penalty= s->me.mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
uint16_t *mv_penalty= s->me.mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
uint8_t *dest_y = s->me.scratchpad;
uint8_t *ptr;
int dxy;
......@@ -1535,7 +1535,7 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
if(s->me_method>=ME_EPZS){
int score[8];
int i, y;
UINT8 * fcode_tab= s->fcode_tab;
uint8_t * fcode_tab= s->fcode_tab;
int best_fcode=-1;
int best_score=-10000000;
......@@ -1584,7 +1584,7 @@ void ff_fix_long_p_mvs(MpegEncContext * s)
{
const int f_code= s->f_code;
int y;
UINT8 * fcode_tab= s->fcode_tab;
uint8_t * fcode_tab= s->fcode_tab;
//int clip=0;
//int noclip=0;
/* clip / convert to intra 16x16 type MVs */
......@@ -1648,7 +1648,7 @@ void ff_fix_long_p_mvs(MpegEncContext * s)
void ff_fix_long_b_mvs(MpegEncContext * s, int16_t (*mv_table)[2], int f_code, int type)
{
int y;
UINT8 * fcode_tab= s->fcode_tab;
uint8_t * fcode_tab= s->fcode_tab;
// RAL: 8 in MPEG-1, 16 in MPEG-4
int range = (((s->codec_id == CODEC_ID_MPEG1VIDEO) ? 8 : 16) << f_code);
......
......@@ -9,27 +9,27 @@
#include "i386/mmx.h"
int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_x2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_y2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_xy2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx);
typedef int motion_func(UINT8 *blk1, UINT8 *blk2, int lx);
int pix_abs16x16_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_x2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_x2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_x2_c(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_y2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_y2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_y2_c(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_xy2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_xy2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
int pix_abs16x16_xy2_c(uint8_t *blk1, uint8_t *blk2, int lx);
typedef int motion_func(uint8_t *blk1, uint8_t *blk2, int lx);
#define WIDTH 64
#define HEIGHT 64
UINT8 img1[WIDTH * HEIGHT];
UINT8 img2[WIDTH * HEIGHT];
uint8_t img1[WIDTH * HEIGHT];
uint8_t img2[WIDTH * HEIGHT];
void fill_random(UINT8 *tab, int size)
void fill_random(uint8_t *tab, int size)
{
int i;
for(i=0;i<size;i++) {
......@@ -48,11 +48,11 @@ void help(void)
exit(1);
}
INT64 gettime(void)
int64_t gettime(void)
{
struct timeval tv;
gettimeofday(&tv,NULL);
return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}
#define NB_ITS 500
......@@ -63,8 +63,8 @@ void test_motion(const char *name,
motion_func *test_func, motion_func *ref_func)
{
int x, y, d1, d2, it;
UINT8 *ptr;
INT64 ti;
uint8_t *ptr;
int64_t ti;
printf("testing '%s'\n", name);
/* test correctness */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -23,7 +23,7 @@
quantization stage) */
#define FRAC_BITS 15
#define WFRAC_BITS 14
#define MUL(a,b) (((INT64)(a) * (INT64)(b)) >> FRAC_BITS)
#define MUL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
#define FIX(a) ((int)((a) * (1 << FRAC_BITS)))
#define SAMPLES_BUF_SIZE 4096
......@@ -36,7 +36,7 @@ typedef struct MpegAudioContext {
int bitrate_index; /* bit rate */
int freq_index;
int frame_size; /* frame size, in bits, without padding */
INT64 nb_samples; /* total number of samples encoded */
int64_t nb_samples; /* total number of samples encoded */
/* padding computation */
int frame_frac, frame_frac_incr, do_padding;
short samples_buf[MPA_MAX_CHANNELS][SAMPLES_BUF_SIZE]; /* buffer for filter */
......
......@@ -17,11 +17,11 @@
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
extern const UINT16 mpa_bitrate_tab[2][3][15];
extern const UINT16 mpa_freq_tab[3];
extern const uint16_t mpa_bitrate_tab[2][3][15];
extern const uint16_t mpa_freq_tab[3];
extern const unsigned char *alloc_tables[5];
extern const double enwindow[512];
extern const int sblimit_table[5];
extern const int quant_steps[17];
extern const int quant_bits[17];
extern const INT32 mpa_enwindow[257];
extern const int32_t mpa_enwindow[257];
This diff is collapsed.
This diff is collapsed.
......@@ -54,13 +54,13 @@ static const int bitinv32[32] = {
};
static INT16 filter_bank[512];
static int16_t filter_bank[512];
static int scale_factor_table[64];
#ifdef USE_FLOATS
static float scale_factor_inv_table[64];
#else
static INT8 scale_factor_shift[64];
static int8_t scale_factor_shift[64];
static unsigned short scale_factor_mult[64];
#endif
static unsigned char scale_diff_table[128];
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -179,7 +179,7 @@ static inline int conv(int samples, float **pcm, char *buf, int channels) {
static int oggvorbis_decode_frame(AVCodecContext *avccontext,
void *data, int *data_size,
UINT8 *buf, int buf_size)
uint8_t *buf, int buf_size)
{
OggVorbisContext *context = avccontext->priv_data ;
ogg_packet *op = (ogg_packet*)buf ;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment