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();
......
......@@ -90,7 +90,7 @@ const char *http_state[] = {
#define SYNC_TIMEOUT (10 * 1000)
typedef struct {
INT64 count1, count2;
int64_t count1, count2;
long time1, time2;
} DataRateData;
......@@ -101,17 +101,17 @@ typedef struct HTTPContext {
struct sockaddr_in from_addr; /* origin */
struct pollfd *poll_entry; /* used when polling */
long timeout;
UINT8 *buffer_ptr, *buffer_end;
uint8_t *buffer_ptr, *buffer_end;
int http_error;
struct HTTPContext *next;
int got_key_frame; /* stream 0 => 1, stream 1 => 2, stream 2=> 4 */
INT64 data_count;
int64_t data_count;
/* feed input */
int feed_fd;
/* input format handling */
AVFormatContext *fmt_in;
long start_time; /* In milliseconds - this wraps fairly often */
INT64 first_pts; /* initial pts value */
int64_t first_pts; /* initial pts value */
int pts_stream_index; /* stream we choose as clock reference */
/* output format handling */
struct FFStream *stream;
......@@ -128,12 +128,12 @@ typedef struct HTTPContext {
char method[16];
char url[128];
int buffer_size;
UINT8 *buffer;
uint8_t *buffer;
int is_packetized; /* if true, the stream is packetized */
int packet_stream_index; /* current stream for output in state machine */
/* RTSP state specific */
UINT8 *pb_buffer; /* XXX: use that in all the code */
uint8_t *pb_buffer; /* XXX: use that in all the code */
ByteIOContext *pb;
int seq; /* RTSP sequence number */
......@@ -207,10 +207,10 @@ typedef struct FFStream {
int feed_opened; /* true if someone is writing to the feed */
int is_feed; /* true if it is a feed */
int conns_served;
INT64 bytes_served;
INT64 feed_max_size; /* maximum storage size */
INT64 feed_write_index; /* current write position in feed (it wraps round) */
INT64 feed_size; /* current size of feed */
int64_t bytes_served;
int64_t feed_max_size; /* maximum storage size */
int64_t feed_write_index; /* current write position in feed (it wraps round) */
int64_t feed_size; /* current size of feed */
struct FFStream *next_feed;
} FFStream;
......@@ -249,7 +249,7 @@ static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPHeader *h);
static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h);
/* SDP handling */
static int prepare_sdp_description(FFStream *stream, UINT8 **pbuffer,
static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
struct in_addr my_ip);
/* RTP handling */
......@@ -323,7 +323,7 @@ static void log_connection(HTTPContext *c)
c->protocol, (c->http_error ? c->http_error : 200), c->data_count);
}
static void update_datarate(DataRateData *drd, INT64 count)
static void update_datarate(DataRateData *drd, int64_t count)
{
if (!drd->time1 && !drd->count1) {
drd->time1 = drd->time2 = cur_time;
......@@ -339,7 +339,7 @@ static void update_datarate(DataRateData *drd, INT64 count)
}
/* In bytes per second */
static int compute_datarate(DataRateData *drd, INT64 count)
static int compute_datarate(DataRateData *drd, int64_t count)
{
if (cur_time == drd->time1)
return 0;
......@@ -347,7 +347,7 @@ static int compute_datarate(DataRateData *drd, INT64 count)
return ((count - drd->count1) * 1000) / (cur_time - drd->time1);
}
static int get_longterm_datarate(DataRateData *drd, INT64 count)
static int get_longterm_datarate(DataRateData *drd, int64_t count)
{
/* You get the first 3 seconds flat out */
if (cur_time - drd->time1 < 3000)
......@@ -775,7 +775,7 @@ static int handle_connection(HTTPContext *c)
return -1;
} else {
/* search for end of request. XXX: not fully correct since garbage could come after the end */
UINT8 *ptr;
uint8_t *ptr;
c->buffer_ptr += len;
ptr = c->buffer_ptr;
if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
......@@ -1351,7 +1351,7 @@ static int http_parse_request(HTTPContext *c)
break;
case REDIR_SDP:
{
UINT8 *sdp_data;
uint8_t *sdp_data;
int sdp_data_size, len;
struct sockaddr_in my_addr;
......@@ -1529,7 +1529,7 @@ static int http_parse_request(HTTPContext *c)
return 0;
}
static void fmt_bytecount(ByteIOContext *pb, INT64 count)
static void fmt_bytecount(ByteIOContext *pb, int64_t count)
{
static const char *suffix = " kMGTP";
const char *s;
......@@ -1837,7 +1837,7 @@ static int open_input_stream(HTTPContext *c, const char *info)
char input_filename[1024];
AVFormatContext *s;
int buf_size, i;
INT64 stream_pos;
int64_t stream_pos;
/* find file name */
if (c->stream->feed) {
......@@ -1848,9 +1848,9 @@ static int open_input_stream(HTTPContext *c, const char *info)
stream_pos = parse_date(buf, 0);
} else if (find_info_tag(buf, sizeof(buf), "buffer", info)) {
int prebuffer = strtol(buf, 0, 10);
stream_pos = av_gettime() - prebuffer * (INT64)1000000;
stream_pos = av_gettime() - prebuffer * (int64_t)1000000;
} else {
stream_pos = av_gettime() - c->stream->prebuffer * (INT64)1000;
stream_pos = av_gettime() - c->stream->prebuffer * (int64_t)1000;
}
} else {
strcpy(input_filename, c->stream->feed_filename);
......@@ -1930,14 +1930,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
if (st->pts.den == 0) {
switch(st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
st->pts_incr = (INT64)s->pts_den;
st->pts_incr = (int64_t)s->pts_den;
av_frac_init(&st->pts, st->pts.val, 0,
(INT64)s->pts_num * st->codec.sample_rate);
(int64_t)s->pts_num * st->codec.sample_rate);
break;
case CODEC_TYPE_VIDEO:
st->pts_incr = (INT64)s->pts_den * FRAME_RATE_BASE;
st->pts_incr = (int64_t)s->pts_den * FRAME_RATE_BASE;
av_frac_init(&st->pts, st->pts.val, 0,
(INT64)s->pts_num * st->codec.frame_rate);
(int64_t)s->pts_num * st->codec.frame_rate);
break;
default:
av_abort();
......@@ -1998,14 +1998,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
if (st->pts.den == 0) {
switch(st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
st->pts_incr = (INT64)s->pts_den * st->codec.frame_size;
st->pts_incr = (int64_t)s->pts_den * st->codec.frame_size;
av_frac_init(&st->pts, st->pts.val, 0,
(INT64)s->pts_num * st->codec.sample_rate);
(int64_t)s->pts_num * st->codec.sample_rate);
break;
case CODEC_TYPE_VIDEO:
st->pts_incr = (INT64)s->pts_den * FRAME_RATE_BASE;
st->pts_incr = (int64_t)s->pts_den * FRAME_RATE_BASE;
av_frac_init(&st->pts, st->pts.val, 0,
(INT64)s->pts_num * st->codec.frame_rate);
(int64_t)s->pts_num * st->codec.frame_rate);
break;
default:
av_abort();
......@@ -2023,11 +2023,11 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
static int compute_send_delay(HTTPContext *c)
{
INT64 cur_pts, delta_pts, next_pts;
int64_t cur_pts, delta_pts, next_pts;
int delay1;
/* compute current pts value from system time */
cur_pts = ((INT64)(cur_time - c->start_time) * c->fmt_in->pts_den) /
cur_pts = ((int64_t)(cur_time - c->start_time) * c->fmt_in->pts_den) /
(c->fmt_in->pts_num * 1000LL);
/* compute the delta from the stream we choose as
main clock (we do that to avoid using explicit
......@@ -2328,8 +2328,8 @@ static int http_send_data(HTTPContext *c)
if (dt < 1)
dt = 1;
if ((c->packet_byte_count + len) * (INT64)1000000 >=
(SHORT_TERM_BANDWIDTH / 8) * (INT64)dt) {
if ((c->packet_byte_count + len) * (int64_t)1000000 >=
(SHORT_TERM_BANDWIDTH / 8) * (int64_t)dt) {
/* bandwidth overflow : wait at most one tick and retry */
c->state = HTTPSTATE_WAIT_SHORT;
return 0;
......@@ -2620,7 +2620,7 @@ static int rtsp_parse_request(HTTPContext *c)
/* XXX: move that to rtsp.c, but would need to replace FFStream by
AVFormatContext */
static int prepare_sdp_description(FFStream *stream, UINT8 **pbuffer,
static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
struct in_addr my_ip)
{
ByteIOContext pb1, *pb = &pb1;
......@@ -2710,7 +2710,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
FFStream *stream;
char path1[1024];
const char *path;
UINT8 *content;
uint8_t *content;
int content_length, len;
struct sockaddr_in my_addr;
......@@ -3087,7 +3087,7 @@ static int rtp_new_av_stream(HTTPContext *c,
AVStream *st;
char *ipaddr;
URLContext *h;
UINT8 *dummy_buf;
uint8_t *dummy_buf;
char buf2[32];
/* now we can open the relevant output stream */
......@@ -3240,7 +3240,7 @@ static void extract_mpeg4_header(AVFormatContext *infile)
int mpeg4_count, i, size;
AVPacket pkt;
AVStream *st;
const UINT8 *p;
const uint8_t *p;
mpeg4_count = 0;
for(i=0;i<infile->nb_streams;i++) {
......@@ -3805,7 +3805,7 @@ static int parse_ffconfig(const char *filename)
fsize *= 1024 * 1024 * 1024;
break;
}
feed->feed_max_size = (INT64)fsize;
feed->feed_max_size = (int64_t)fsize;
}
} else if (!strcasecmp(cmd, "</Feed>")) {
if (!feed) {
......@@ -4251,14 +4251,14 @@ static int parse_ffconfig(const char *filename)
#if 0
static void write_packet(FFCodec *ffenc,
UINT8 *buf, int size)
uint8_t *buf, int size)
{
PacketHeader hdr;
AVCodecContext *enc = &ffenc->enc;
UINT8 *wptr;
uint8_t *wptr;
mk_header(&hdr, enc, size);
wptr = http_fifo.wptr;
fifo_write(&http_fifo, (UINT8 *)&hdr, sizeof(hdr), &wptr);
fifo_write(&http_fifo, (uint8_t *)&hdr, sizeof(hdr), &wptr);
fifo_write(&http_fifo, buf, size, &wptr);
/* atomic modification of wptr */
http_fifo.wptr = wptr;
......
......@@ -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;
}
}
......
......@@ -63,7 +63,7 @@ typedef struct AC3EncodeContext {
static void fft_init(int ln);
static void ac3_crc_init(void);
static inline INT16 fix15(float a)
static inline int16_t fix15(float a)
{
int v;
v = (int)(a * (float)(1 << 15));
......@@ -110,18 +110,18 @@ static inline int calc_lowcomp(int a, int b0, int b1, int bin)
/* AC3 bit allocation. The algorithm is the one described in the AC3
spec. */
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)
{
int bin,i,j,k,end1,v,v1,bndstrt,bndend,lowcomp,begin;
int fastleak,slowleak,address,tmp;
INT16 psd[256]; /* scaled exponents */
INT16 bndpsd[50]; /* interpolated exponents */