Browse code

* UINTX -> uintx_t INTX -> intx_t

Originally committed as revision 1578 to svn://svn.ffmpeg.org/ffmpeg/trunk

Zdenek Kabelac authored on 2003/02/12 01:35:48
Showing 110 changed files
... ...
@@ -40,7 +40,7 @@
40 40
 #define INFINITY HUGE_VAL
41 41
 #endif
42 42
 
43
-#define MAXINT64 INT64_C(0x7fffffffffffffff)
43
+#define MAXINT64 int64_t_C(0x7fffffffffffffff)
44 44
 
45 45
 typedef struct {
46 46
     const char *name;
... ...
@@ -142,7 +142,7 @@ static int audio_disable = 0;
142 142
 static int audio_channels = 1;
143 143
 static int audio_codec_id = CODEC_ID_NONE;
144 144
 
145
-static INT64 recording_time = 0;
145
+static int64_t recording_time = 0;
146 146
 static int file_overwrite = 0;
147 147
 static char *str_title = NULL;
148 148
 static char *str_author = NULL;
... ...
@@ -178,7 +178,7 @@ typedef struct AVOutputStream {
178 178
        for A/V sync */
179 179
     double sync_ipts;
180 180
     double sync_ipts_offset;
181
-    INT64 sync_opts;
181
+    int64_t sync_opts;
182 182
     /* video only */
183 183
     int video_resample;      /* video_resample and video_crop are mutually exclusive */
184 184
     AVPicture pict_tmp;      /* temporary image for resampling */
... ...
@@ -201,7 +201,7 @@ typedef struct AVInputStream {
201 201
     AVStream *st;
202 202
     int discard;             /* true if stream data should be discarded */
203 203
     int decoding_needed;     /* true if the packets must be decoded in 'raw_fifo' */
204
-    INT64 sample_index;      /* current sample */
204
+    int64_t sample_index;      /* current sample */
205 205
     int frame_decoded;       /* true if a video or audio frame has been decoded */
206 206
 } AVInputStream;
207 207
 
... ...
@@ -320,9 +320,9 @@ static void do_audio_out(AVFormatContext *s,
320 320
                          AVInputStream *ist,
321 321
                          unsigned char *buf, int size)
322 322
 {
323
-    UINT8 *buftmp;
324
-    UINT8 audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it */
325
-    UINT8 audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it - yep really WMA */
323
+    uint8_t *buftmp;
324
+    uint8_t audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it */
325
+    uint8_t audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it - yep really WMA */
326 326
     int size_out, frame_bytes, ret;
327 327
     AVCodecContext *enc;
328 328
 
... ...
@@ -376,7 +376,7 @@ static void do_audio_out(AVFormatContext *s,
376 376
 static void write_picture(AVFormatContext *s, int index, AVPicture *picture, 
377 377
                           int pix_fmt, int w, int h)
378 378
 {
379
-    UINT8 *buf, *src, *dest;
379
+    uint8_t *buf, *src, *dest;
380 380
     int size, j, i;
381 381
 
382 382
     /* 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
473 473
     AVCodecContext *dec;
474 474
     AVPicture *picture2;
475 475
     AVPicture picture_tmp;
476
-    UINT8 *buf = 0;
476
+    uint8_t *buf = 0;
477 477
 
478 478
     dec = &ist->st->codec;
479 479
 
... ...
@@ -520,8 +520,8 @@ static void do_video_out(AVFormatContext *s,
520 520
     int nb_frames, i, ret;
521 521
     AVPicture *final_picture, *formatted_picture;
522 522
     AVPicture picture_format_temp, picture_crop_temp;
523
-    static UINT8 *video_buffer;
524
-    UINT8 *buf = NULL, *buf1 = NULL;
523
+    static uint8_t *video_buffer;
524
+    uint8_t *buf = NULL, *buf1 = NULL;
525 525
     AVCodecContext *enc, *dec;
526 526
 
527 527
 #define VIDEO_BUFFER_SIZE (1024*1024)
... ...
@@ -675,7 +675,7 @@ static void do_video_out(AVFormatContext *s,
675 675
                    avoid any copies. We support temorarily the older
676 676
                    method. */
677 677
                 av_write_frame(s, ost->index, 
678
-                               (UINT8 *)final_picture, sizeof(AVPicture));
678
+                               (uint8_t *)final_picture, sizeof(AVPicture));
679 679
             } else {
680 680
                 write_picture(s, ost->index, final_picture, enc->pix_fmt, 
681 681
                               enc->width, enc->height);
... ...
@@ -697,13 +697,13 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
697 697
                            int frame_size)
698 698
 {
699 699
     static FILE *fvstats=NULL;
700
-    static INT64 total_size = 0;
700
+    static int64_t total_size = 0;
701 701
     char filename[40];
702 702
     time_t today2;
703 703
     struct tm *today;
704 704
     AVCodecContext *enc;
705 705
     int frame_number;
706
-    INT64 ti;
706
+    int64_t ti;
707 707
     double ti1, bitrate, avg_bitrate;
708 708
     
709 709
     if (!fvstats) {
... ...
@@ -749,14 +749,14 @@ static void print_report(AVFormatContext **output_files,
749 749
     char buf[1024];
750 750
     AVOutputStream *ost;
751 751
     AVFormatContext *oc, *os;
752
-    INT64 total_size;
752
+    int64_t total_size;
753 753
     AVCodecContext *enc;
754 754
     int frame_number, vid, i;
755 755
     double bitrate, ti1, pts;
756
-    static INT64 last_time = -1;
756
+    static int64_t last_time = -1;
757 757
     
758 758
     if (!is_last_report) {
759
-        INT64 cur_time;
759
+        int64_t cur_time;
760 760
         /* display the report every 0.5 seconds */
761 761
         cur_time = av_gettime();
762 762
         if (last_time == -1) {
... ...
@@ -1019,7 +1019,7 @@ static int av_encode(AVFormatContext **output_files,
1019 1019
                     ost->topBand = frame_topBand;
1020 1020
                     ost->leftBand = frame_leftBand;
1021 1021
                 } else {
1022
-                    UINT8 *buf;
1022
+                    uint8_t *buf;
1023 1023
                     ost->video_resample = 1;
1024 1024
                     ost->video_crop = 0; // cropping is handled as part of resample
1025 1025
                     buf = av_malloc((codec->width * codec->height * 3) / 2);
... ...
@@ -1179,9 +1179,9 @@ static int av_encode(AVFormatContext **output_files,
1179 1179
     for(;;) {
1180 1180
         int file_index, ist_index;
1181 1181
         AVPacket pkt;
1182
-        UINT8 *ptr;
1182
+        uint8_t *ptr;
1183 1183
         int len;
1184
-        UINT8 *data_buf;
1184
+        uint8_t *data_buf;
1185 1185
         int data_size, got_picture;
1186 1186
         AVPicture picture;
1187 1187
         short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
... ...
@@ -1252,7 +1252,7 @@ static int av_encode(AVFormatContext **output_files,
1252 1252
         ptr = pkt.data;
1253 1253
         pts_set = 0;
1254 1254
         while (len > 0) {
1255
-            INT64 ipts;
1255
+            int64_t ipts;
1256 1256
 
1257 1257
             ipts = AV_NOPTS_VALUE;
1258 1258
 
... ...
@@ -1288,7 +1288,7 @@ static int av_encode(AVFormatContext **output_files,
1288 1288
                         len -= ret;
1289 1289
                         continue;
1290 1290
                     }
1291
-                    data_buf = (UINT8 *)samples;
1291
+                    data_buf = (uint8_t *)samples;
1292 1292
                     break;
1293 1293
                 case CODEC_TYPE_VIDEO:
1294 1294
                     if (ist->st->codec.codec_id == CODEC_ID_RAWVIDEO) {
... ...
@@ -1348,7 +1348,7 @@ static int av_encode(AVFormatContext **output_files,
1348 1348
             /* XXX: add mpeg4 too ? */
1349 1349
             if (ist->st->codec.codec_id == CODEC_ID_MPEG1VIDEO) {
1350 1350
                 if (ist->st->codec.pict_type != B_TYPE) {
1351
-                    INT64 tmp;
1351
+                    int64_t tmp;
1352 1352
                     tmp = ist->last_ip_pts;
1353 1353
                     ist->last_ip_pts  = ist->frac_pts.val;
1354 1354
                     ist->frac_pts.val = tmp;
... ...
@@ -2539,12 +2539,12 @@ static void opt_pass(const char *pass_str)
2539 2539
 }
2540 2540
 
2541 2541
 #if defined(CONFIG_WIN32) || defined(CONFIG_OS2)
2542
-static INT64 getutime(void)
2542
+static int64_t getutime(void)
2543 2543
 {
2544 2544
   return av_gettime();
2545 2545
 }
2546 2546
 #else
2547
-static INT64 getutime(void)
2547
+static int64_t getutime(void)
2548 2548
 {
2549 2549
     struct rusage rusage;
2550 2550
 
... ...
@@ -2770,7 +2770,7 @@ int main(int argc, char **argv)
2770 2770
     int optindex, i;
2771 2771
     const char *opt, *arg;
2772 2772
     const OptionDef *po;
2773
-    INT64 ti;
2773
+    int64_t ti;
2774 2774
 
2775 2775
     av_register_all();
2776 2776
 
... ...
@@ -90,7 +90,7 @@ const char *http_state[] = {
90 90
 #define SYNC_TIMEOUT (10 * 1000)
91 91
 
92 92
 typedef struct {
93
-    INT64 count1, count2;
93
+    int64_t count1, count2;
94 94
     long time1, time2;
95 95
 } DataRateData;
96 96
 
... ...
@@ -101,17 +101,17 @@ typedef struct HTTPContext {
101 101
     struct sockaddr_in from_addr; /* origin */
102 102
     struct pollfd *poll_entry; /* used when polling */
103 103
     long timeout;
104
-    UINT8 *buffer_ptr, *buffer_end;
104
+    uint8_t *buffer_ptr, *buffer_end;
105 105
     int http_error;
106 106
     struct HTTPContext *next;
107 107
     int got_key_frame; /* stream 0 => 1, stream 1 => 2, stream 2=> 4 */
108
-    INT64 data_count;
108
+    int64_t data_count;
109 109
     /* feed input */
110 110
     int feed_fd;
111 111
     /* input format handling */
112 112
     AVFormatContext *fmt_in;
113 113
     long start_time;            /* In milliseconds - this wraps fairly often */
114
-    INT64 first_pts;            /* initial pts value */
114
+    int64_t first_pts;            /* initial pts value */
115 115
     int pts_stream_index;       /* stream we choose as clock reference */
116 116
     /* output format handling */
117 117
     struct FFStream *stream;
... ...
@@ -128,12 +128,12 @@ typedef struct HTTPContext {
128 128
     char method[16];
129 129
     char url[128];
130 130
     int buffer_size;
131
-    UINT8 *buffer;
131
+    uint8_t *buffer;
132 132
     int is_packetized; /* if true, the stream is packetized */
133 133
     int packet_stream_index; /* current stream for output in state machine */
134 134
     
135 135
     /* RTSP state specific */
136
-    UINT8 *pb_buffer; /* XXX: use that in all the code */
136
+    uint8_t *pb_buffer; /* XXX: use that in all the code */
137 137
     ByteIOContext *pb;
138 138
     int seq; /* RTSP sequence number */
139 139
 
... ...
@@ -207,10 +207,10 @@ typedef struct FFStream {
207 207
     int feed_opened;     /* true if someone is writing to the feed */
208 208
     int is_feed;         /* true if it is a feed */
209 209
     int conns_served;
210
-    INT64 bytes_served;
211
-    INT64 feed_max_size;      /* maximum storage size */
212
-    INT64 feed_write_index;   /* current write position in feed (it wraps round) */
213
-    INT64 feed_size;          /* current size of feed */
210
+    int64_t bytes_served;
211
+    int64_t feed_max_size;      /* maximum storage size */
212
+    int64_t feed_write_index;   /* current write position in feed (it wraps round) */
213
+    int64_t feed_size;          /* current size of feed */
214 214
     struct FFStream *next_feed;
215 215
 } FFStream;
216 216
 
... ...
@@ -249,7 +249,7 @@ static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPHeader *h);
249 249
 static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h);
250 250
 
251 251
 /* SDP handling */
252
-static int prepare_sdp_description(FFStream *stream, UINT8 **pbuffer, 
252
+static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, 
253 253
                                    struct in_addr my_ip);
254 254
 
255 255
 /* RTP handling */
... ...
@@ -323,7 +323,7 @@ static void log_connection(HTTPContext *c)
323 323
              c->protocol, (c->http_error ? c->http_error : 200), c->data_count);
324 324
 }
325 325
 
326
-static void update_datarate(DataRateData *drd, INT64 count)
326
+static void update_datarate(DataRateData *drd, int64_t count)
327 327
 {
328 328
     if (!drd->time1 && !drd->count1) {
329 329
         drd->time1 = drd->time2 = cur_time;
... ...
@@ -339,7 +339,7 @@ static void update_datarate(DataRateData *drd, INT64 count)
339 339
 }
340 340
 
341 341
 /* In bytes per second */
342
-static int compute_datarate(DataRateData *drd, INT64 count)
342
+static int compute_datarate(DataRateData *drd, int64_t count)
343 343
 {
344 344
     if (cur_time == drd->time1)
345 345
         return 0;
... ...
@@ -347,7 +347,7 @@ static int compute_datarate(DataRateData *drd, INT64 count)
347 347
     return ((count - drd->count1) * 1000) / (cur_time - drd->time1);
348 348
 }
349 349
 
350
-static int get_longterm_datarate(DataRateData *drd, INT64 count)
350
+static int get_longterm_datarate(DataRateData *drd, int64_t count)
351 351
 {
352 352
     /* You get the first 3 seconds flat out */
353 353
     if (cur_time - drd->time1 < 3000)
... ...
@@ -775,7 +775,7 @@ static int handle_connection(HTTPContext *c)
775 775
             return -1;
776 776
         } else {
777 777
             /* search for end of request. XXX: not fully correct since garbage could come after the end */
778
-            UINT8 *ptr;
778
+            uint8_t *ptr;
779 779
             c->buffer_ptr += len;
780 780
             ptr = c->buffer_ptr;
781 781
             if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
... ...
@@ -1351,7 +1351,7 @@ static int http_parse_request(HTTPContext *c)
1351 1351
                         break;
1352 1352
                     case REDIR_SDP:
1353 1353
                         {
1354
-                            UINT8 *sdp_data;
1354
+                            uint8_t *sdp_data;
1355 1355
                             int sdp_data_size, len;
1356 1356
                             struct sockaddr_in my_addr;
1357 1357
 
... ...
@@ -1529,7 +1529,7 @@ static int http_parse_request(HTTPContext *c)
1529 1529
     return 0;
1530 1530
 }
1531 1531
 
1532
-static void fmt_bytecount(ByteIOContext *pb, INT64 count)
1532
+static void fmt_bytecount(ByteIOContext *pb, int64_t count)
1533 1533
 {
1534 1534
     static const char *suffix = " kMGTP";
1535 1535
     const char *s;
... ...
@@ -1837,7 +1837,7 @@ static int open_input_stream(HTTPContext *c, const char *info)
1837 1837
     char input_filename[1024];
1838 1838
     AVFormatContext *s;
1839 1839
     int buf_size, i;
1840
-    INT64 stream_pos;
1840
+    int64_t stream_pos;
1841 1841
 
1842 1842
     /* find file name */
1843 1843
     if (c->stream->feed) {
... ...
@@ -1848,9 +1848,9 @@ static int open_input_stream(HTTPContext *c, const char *info)
1848 1848
             stream_pos = parse_date(buf, 0);
1849 1849
         } else if (find_info_tag(buf, sizeof(buf), "buffer", info)) {
1850 1850
             int prebuffer = strtol(buf, 0, 10);
1851
-            stream_pos = av_gettime() - prebuffer * (INT64)1000000;
1851
+            stream_pos = av_gettime() - prebuffer * (int64_t)1000000;
1852 1852
         } else {
1853
-            stream_pos = av_gettime() - c->stream->prebuffer * (INT64)1000;
1853
+            stream_pos = av_gettime() - c->stream->prebuffer * (int64_t)1000;
1854 1854
         }
1855 1855
     } else {
1856 1856
         strcpy(input_filename, c->stream->feed_filename);
... ...
@@ -1930,14 +1930,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
1930 1930
                     if (st->pts.den == 0) {
1931 1931
                         switch(st->codec.codec_type) {
1932 1932
                         case CODEC_TYPE_AUDIO:
1933
-                            st->pts_incr = (INT64)s->pts_den;
1933
+                            st->pts_incr = (int64_t)s->pts_den;
1934 1934
                             av_frac_init(&st->pts, st->pts.val, 0, 
1935
-                                         (INT64)s->pts_num * st->codec.sample_rate);
1935
+                                         (int64_t)s->pts_num * st->codec.sample_rate);
1936 1936
                             break;
1937 1937
                         case CODEC_TYPE_VIDEO:
1938
-                            st->pts_incr = (INT64)s->pts_den * FRAME_RATE_BASE;
1938
+                            st->pts_incr = (int64_t)s->pts_den * FRAME_RATE_BASE;
1939 1939
                             av_frac_init(&st->pts, st->pts.val, 0,
1940
-                                         (INT64)s->pts_num * st->codec.frame_rate);
1940
+                                         (int64_t)s->pts_num * st->codec.frame_rate);
1941 1941
                             break;
1942 1942
                         default:
1943 1943
                             av_abort();
... ...
@@ -1998,14 +1998,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
1998 1998
                 if (st->pts.den == 0) {
1999 1999
                     switch(st->codec.codec_type) {
2000 2000
                     case CODEC_TYPE_AUDIO:
2001
-                        st->pts_incr = (INT64)s->pts_den * st->codec.frame_size;
2001
+                        st->pts_incr = (int64_t)s->pts_den * st->codec.frame_size;
2002 2002
                         av_frac_init(&st->pts, st->pts.val, 0, 
2003
-                                     (INT64)s->pts_num * st->codec.sample_rate);
2003
+                                     (int64_t)s->pts_num * st->codec.sample_rate);
2004 2004
                         break;
2005 2005
                     case CODEC_TYPE_VIDEO:
2006
-                        st->pts_incr = (INT64)s->pts_den * FRAME_RATE_BASE;
2006
+                        st->pts_incr = (int64_t)s->pts_den * FRAME_RATE_BASE;
2007 2007
                         av_frac_init(&st->pts, st->pts.val, 0,
2008
-                                     (INT64)s->pts_num * st->codec.frame_rate);
2008
+                                     (int64_t)s->pts_num * st->codec.frame_rate);
2009 2009
                         break;
2010 2010
                     default:
2011 2011
                         av_abort();
... ...
@@ -2023,11 +2023,11 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
2023 2023
 
2024 2024
 static int compute_send_delay(HTTPContext *c)
2025 2025
 {
2026
-    INT64 cur_pts, delta_pts, next_pts;
2026
+    int64_t cur_pts, delta_pts, next_pts;
2027 2027
     int delay1;
2028 2028
     
2029 2029
     /* compute current pts value from system time */
2030
-    cur_pts = ((INT64)(cur_time - c->start_time) * c->fmt_in->pts_den) / 
2030
+    cur_pts = ((int64_t)(cur_time - c->start_time) * c->fmt_in->pts_den) / 
2031 2031
         (c->fmt_in->pts_num * 1000LL);
2032 2032
     /* compute the delta from the stream we choose as
2033 2033
        main clock (we do that to avoid using explicit
... ...
@@ -2328,8 +2328,8 @@ static int http_send_data(HTTPContext *c)
2328 2328
             if (dt < 1)
2329 2329
                 dt = 1;
2330 2330
 
2331
-            if ((c->packet_byte_count + len) * (INT64)1000000 >= 
2332
-                (SHORT_TERM_BANDWIDTH / 8) * (INT64)dt) {
2331
+            if ((c->packet_byte_count + len) * (int64_t)1000000 >= 
2332
+                (SHORT_TERM_BANDWIDTH / 8) * (int64_t)dt) {
2333 2333
                 /* bandwidth overflow : wait at most one tick and retry */
2334 2334
                 c->state = HTTPSTATE_WAIT_SHORT;
2335 2335
                 return 0;
... ...
@@ -2620,7 +2620,7 @@ static int rtsp_parse_request(HTTPContext *c)
2620 2620
 
2621 2621
 /* XXX: move that to rtsp.c, but would need to replace FFStream by
2622 2622
    AVFormatContext */
2623
-static int prepare_sdp_description(FFStream *stream, UINT8 **pbuffer, 
2623
+static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer, 
2624 2624
                                    struct in_addr my_ip)
2625 2625
 {
2626 2626
     ByteIOContext pb1, *pb = &pb1;
... ...
@@ -2710,7 +2710,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
2710 2710
     FFStream *stream;
2711 2711
     char path1[1024];
2712 2712
     const char *path;
2713
-    UINT8 *content;
2713
+    uint8_t *content;
2714 2714
     int content_length, len;
2715 2715
     struct sockaddr_in my_addr;
2716 2716
     
... ...
@@ -3087,7 +3087,7 @@ static int rtp_new_av_stream(HTTPContext *c,
3087 3087
     AVStream *st;
3088 3088
     char *ipaddr;
3089 3089
     URLContext *h;
3090
-    UINT8 *dummy_buf;
3090
+    uint8_t *dummy_buf;
3091 3091
     char buf2[32];
3092 3092
     
3093 3093
     /* now we can open the relevant output stream */
... ...
@@ -3240,7 +3240,7 @@ static void extract_mpeg4_header(AVFormatContext *infile)
3240 3240
     int mpeg4_count, i, size;
3241 3241
     AVPacket pkt;
3242 3242
     AVStream *st;
3243
-    const UINT8 *p;
3243
+    const uint8_t *p;
3244 3244
 
3245 3245
     mpeg4_count = 0;
3246 3246
     for(i=0;i<infile->nb_streams;i++) {
... ...
@@ -3805,7 +3805,7 @@ static int parse_ffconfig(const char *filename)
3805 3805
                     fsize *= 1024 * 1024 * 1024;
3806 3806
                     break;
3807 3807
                 }
3808
-                feed->feed_max_size = (INT64)fsize;
3808
+                feed->feed_max_size = (int64_t)fsize;
3809 3809
             }
3810 3810
         } else if (!strcasecmp(cmd, "</Feed>")) {
3811 3811
             if (!feed) {
... ...
@@ -4251,14 +4251,14 @@ static int parse_ffconfig(const char *filename)
4251 4251
 
4252 4252
 #if 0
4253 4253
 static void write_packet(FFCodec *ffenc,
4254
-                         UINT8 *buf, int size)
4254
+                         uint8_t *buf, int size)
4255 4255
 {
4256 4256
     PacketHeader hdr;
4257 4257
     AVCodecContext *enc = &ffenc->enc;
4258
-    UINT8 *wptr;
4258
+    uint8_t *wptr;
4259 4259
     mk_header(&hdr, enc, size);
4260 4260
     wptr = http_fifo.wptr;
4261
-    fifo_write(&http_fifo, (UINT8 *)&hdr, sizeof(hdr), &wptr);
4261
+    fifo_write(&http_fifo, (uint8_t *)&hdr, sizeof(hdr), &wptr);
4262 4262
     fifo_write(&http_fifo, buf, size, &wptr);
4263 4263
     /* atomic modification of wptr */
4264 4264
     http_fifo.wptr = wptr;
... ...
@@ -29,8 +29,8 @@ static const char* liba52name = "liba52.so.0";
29 29
  * released under the GPL license.
30 30
  */
31 31
 typedef struct AC3DecodeState {
32
-    UINT8 inbuf[4096]; /* input buffer */
33
-    UINT8 *inbuf_ptr;
32
+    uint8_t inbuf[4096]; /* input buffer */
33
+    uint8_t *inbuf_ptr;
34 34
     int frame_size;
35 35
     int flags;
36 36
     int channels;
... ...
@@ -123,7 +123,7 @@ static inline int blah (int32_t i)
123 123
     return i - 0x43c00000;
124 124
 }
125 125
 
126
-static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
126
+static inline void float_to_int (float * _f, int16_t * s16, int nchannels)
127 127
 {
128 128
     int i, j, c;
129 129
     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)
142 142
 
143 143
 static int a52_decode_frame(AVCodecContext *avctx,
144 144
                             void *data, int *data_size,
145
-                            UINT8 *buf, int buf_size)
145
+                            uint8_t *buf, int buf_size)
146 146
 {
147 147
     AC3DecodeState *s = avctx->priv_data;
148
-    UINT8 *buf_ptr;
148
+    uint8_t *buf_ptr;
149 149
     int flags, i, len;
150 150
     int sample_rate, bit_rate;
151 151
     short *out_samples = data;
... ...
@@ -221,7 +221,7 @@ static int a52_decode_frame(AVCodecContext *avctx,
221 221
             }
222 222
             s->inbuf_ptr = s->inbuf;
223 223
             s->frame_size = 0;
224
-            *data_size = 6 * avctx->channels * 256 * sizeof(INT16);
224
+            *data_size = 6 * avctx->channels * 256 * sizeof(int16_t);
225 225
             break;
226 226
         }
227 227
     }
... ...
@@ -38,19 +38,19 @@ typedef struct AC3BitAllocParameters {
38 38
     int cplfleak, cplsleak;
39 39
 } AC3BitAllocParameters;
40 40
 
41
-extern const UINT16 ac3_freqs[3];
42
-extern const UINT16 ac3_bitratetab[19];
43
-extern const INT16 ac3_window[256];
44
-extern const UINT8 sdecaytab[4];
45
-extern const UINT8 fdecaytab[4];
46
-extern const UINT16 sgaintab[4];
47
-extern const UINT16 dbkneetab[4];
48
-extern const UINT16 floortab[8];
49
-extern const UINT16 fgaintab[8];
41
+extern const uint16_t ac3_freqs[3];
42
+extern const uint16_t ac3_bitratetab[19];
43
+extern const int16_t ac3_window[256];
44
+extern const uint8_t sdecaytab[4];
45
+extern const uint8_t fdecaytab[4];
46
+extern const uint16_t sgaintab[4];
47
+extern const uint16_t dbkneetab[4];
48
+extern const uint16_t floortab[8];
49
+extern const uint16_t fgaintab[8];
50 50
 
51 51
 void ac3_common_init(void);
52
-void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, UINT8 *bap,
53
-                                   INT8 *exp, int start, int end,
52
+void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
53
+                                   int8_t *exp, int start, int end,
54 54
                                    int snroffset, int fgain, int is_lfe,
55 55
                                    int deltbae,int deltnseg, 
56
-                                   UINT8 *deltoffst, UINT8 *deltlen, UINT8 *deltba);
56
+                                   uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba);
... ...
@@ -22,8 +22,8 @@
22 22
 /* currently, I use libac3 which is Copyright (C) Aaron Holtzman and
23 23
    released under the GPL license. I may reimplement it someday... */
24 24
 typedef struct AC3DecodeState {
25
-    UINT8 inbuf[4096]; /* input buffer */
26
-    UINT8 *inbuf_ptr;
25
+    uint8_t inbuf[4096]; /* input buffer */
26
+    uint8_t *inbuf_ptr;
27 27
     int frame_size;
28 28
     int flags;
29 29
     int channels;
... ...
@@ -53,7 +53,7 @@ static inline int blah (int32_t i)
53 53
 	return i - 0x43c00000;
54 54
 }
55 55
 
56
-static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
56
+static inline void float_to_int (float * _f, int16_t * s16, int nchannels)
57 57
 {
58 58
     int i, j, c;
59 59
     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)
72 72
 
73 73
 static int ac3_decode_frame(AVCodecContext *avctx, 
74 74
                             void *data, int *data_size,
75
-                            UINT8 *buf, int buf_size)
75
+                            uint8_t *buf, int buf_size)
76 76
 {
77 77
     AC3DecodeState *s = avctx->priv_data;
78
-    UINT8 *buf_ptr;
78
+    uint8_t *buf_ptr;
79 79
     int flags, i, len;
80 80
     int sample_rate, bit_rate;
81 81
     short *out_samples = data;
... ...
@@ -151,7 +151,7 @@ static int ac3_decode_frame(AVCodecContext *avctx,
151 151
             }
152 152
             s->inbuf_ptr = s->inbuf;
153 153
             s->frame_size = 0;
154
-            *data_size = 6 * avctx->channels * 256 * sizeof(INT16);
154
+            *data_size = 6 * avctx->channels * 256 * sizeof(int16_t);
155 155
             break;
156 156
         }
157 157
     }
... ...
@@ -63,7 +63,7 @@ typedef struct AC3EncodeContext {
63 63
 static void fft_init(int ln);
64 64
 static void ac3_crc_init(void);
65 65
 
66
-static inline INT16 fix15(float a)
66
+static inline int16_t fix15(float a)
67 67
 {
68 68
     int v;
69 69
     v = (int)(a * (float)(1 << 15));
... ...
@@ -110,18 +110,18 @@ static inline int calc_lowcomp(int a, int b0, int b1, int bin)
110 110
 
111 111
 /* AC3 bit allocation. The algorithm is the one described in the AC3
112 112
    spec. */
113
-void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, UINT8 *bap,
114
-                                   INT8 *exp, int start, int end,
113
+void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
114
+                                   int8_t *exp, int start, int end,
115 115
                                    int snroffset, int fgain, int is_lfe,
116 116
                                    int deltbae,int deltnseg, 
117
-                                   UINT8 *deltoffst, UINT8 *deltlen, UINT8 *deltba)
117
+                                   uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba)
118 118
 {
119 119
     int bin,i,j,k,end1,v,v1,bndstrt,bndend,lowcomp,begin;
120 120
     int fastleak,slowleak,address,tmp;
121
-    INT16 psd[256]; /* scaled exponents */
122
-    INT16 bndpsd[50]; /* interpolated exponents */
123
-    INT16 excite[50]; /* excitation */
124
-    INT16 mask[50];   /* masking value */
121
+    int16_t psd[256]; /* scaled exponents */
122
+    int16_t bndpsd[50]; /* interpolated exponents */
123
+    int16_t excite[50]; /* excitation */
124
+    int16_t mask[50];   /* masking value */
125 125
 
126 126
     /* exponent mapping to PSD */
127 127
     for(bin=start;bin<end;bin++) {
... ...
@@ -404,10 +404,10 @@ static void fft(IComplex *z, int ln)
404 404
 }
405 405
 
406 406
 /* do a 512 point mdct */
407
-static void mdct512(INT32 *out, INT16 *in)
407
+static void mdct512(int32_t *out, int16_t *in)
408 408
 {
409 409
     int i, re, im, re1, im1;
410
-    INT16 rot[N]; 
410
+    int16_t rot[N]; 
411 411
     IComplex x[N/4];
412 412
 
413 413
     /* shift to simplify computations */
... ...
@@ -436,7 +436,7 @@ static void mdct512(INT32 *out, INT16 *in)
436 436
 }
437 437
 
438 438
 /* XXX: use another norm ? */
439
-static int calc_exp_diff(UINT8 *exp1, UINT8 *exp2, int n)
439
+static int calc_exp_diff(uint8_t *exp1, uint8_t *exp2, int n)
440 440
 {
441 441
     int sum, i;
442 442
     sum = 0;
... ...
@@ -446,8 +446,8 @@ static int calc_exp_diff(UINT8 *exp1, UINT8 *exp2, int n)
446 446
     return sum;
447 447
 }
448 448
 
449
-static void compute_exp_strategy(UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
450
-                                 UINT8 exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
449
+static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
450
+                                 uint8_t exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
451 451
                                  int ch, int is_lfe)
452 452
 {
453 453
     int i, j;
... ...
@@ -493,7 +493,7 @@ static void compute_exp_strategy(UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS]
493 493
 }
494 494
 
495 495
 /* set exp[i] to min(exp[i], exp1[i]) */
496
-static void exponent_min(UINT8 exp[N/2], UINT8 exp1[N/2], int n)
496
+static void exponent_min(uint8_t exp[N/2], uint8_t exp1[N/2], int n)
497 497
 {
498 498
     int i;
499 499
 
... ...
@@ -505,13 +505,13 @@ static void exponent_min(UINT8 exp[N/2], UINT8 exp1[N/2], int n)
505 505
                                  
506 506
 /* update the exponents so that they are the ones the decoder will
507 507
    decode. Return the number of bits used to code the exponents */
508
-static int encode_exp(UINT8 encoded_exp[N/2], 
509
-                      UINT8 exp[N/2], 
508
+static int encode_exp(uint8_t encoded_exp[N/2], 
509
+                      uint8_t exp[N/2], 
510 510
                       int nb_exps,
511 511
                       int exp_strategy)
512 512
 {
513 513
     int group_size, nb_groups, i, j, k, recurse, exp_min, delta;
514
-    UINT8 exp1[N/2];
514
+    uint8_t exp1[N/2];
515 515
 
516 516
     switch(exp_strategy) {
517 517
     case EXP_D15:
... ...
@@ -586,7 +586,7 @@ static int encode_exp(UINT8 encoded_exp[N/2],
586 586
 }
587 587
 
588 588
 /* return the size in bits taken by the mantissa */
589
-static int compute_mantissa_size(AC3EncodeContext *s, UINT8 *m, int nb_coefs)
589
+static int compute_mantissa_size(AC3EncodeContext *s, uint8_t *m, int nb_coefs)
590 590
 {
591 591
     int bits, mant, i;
592 592
 
... ...
@@ -637,9 +637,9 @@ static int compute_mantissa_size(AC3EncodeContext *s, UINT8 *m, int nb_coefs)
637 637
 
638 638
 
639 639
 static int bit_alloc(AC3EncodeContext *s,
640
-                     UINT8 bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
641
-                     UINT8 encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
642
-                     UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
640
+                     uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
641
+                     uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
642
+                     uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
643 643
                      int frame_bits, int csnroffst, int fsnroffst)
644 644
 {
645 645
     int i, ch;
... ...
@@ -651,7 +651,7 @@ static int bit_alloc(AC3EncodeContext *s,
651 651
         s->mant4_cnt = 0;
652 652
         for(ch=0;ch<s->nb_all_channels;ch++) {
653 653
             ac3_parametric_bit_allocation(&s->bit_alloc, 
654
-                                          bap[i][ch], (INT8 *)encoded_exp[i][ch], 
654
+                                          bap[i][ch], (int8_t *)encoded_exp[i][ch], 
655 655
                                           0, s->nb_coefs[ch], 
656 656
                                           (((csnroffst-15) << 4) + 
657 657
                                            fsnroffst) << 2, 
... ...
@@ -673,14 +673,14 @@ static int bit_alloc(AC3EncodeContext *s,
673 673
 #define SNR_INC1 4
674 674
 
675 675
 static int compute_bit_allocation(AC3EncodeContext *s,
676
-                                  UINT8 bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
677
-                                  UINT8 encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
678
-                                  UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
676
+                                  uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
677
+                                  uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
678
+                                  uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
679 679
                                   int frame_bits)
680 680
 {
681 681
     int i, ch;
682 682
     int csnroffst, fsnroffst;
683
-    UINT8 bap1[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
683
+    uint8_t bap1[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
684 684
     static int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
685 685
 
686 686
     /* init default parameters */
... ...
@@ -816,7 +816,7 @@ static int AC3_encode_init(AVCodecContext *avctx)
816 816
     AC3EncodeContext *s = avctx->priv_data;
817 817
     int i, j, ch;
818 818
     float alpha;
819
-    static const UINT8 acmod_defs[6] = {
819
+    static const uint8_t acmod_defs[6] = {
820 820
 	0x01, /* C */
821 821
 	0x02, /* L R */
822 822
 	0x03, /* L C R */
... ...
@@ -966,19 +966,19 @@ static inline int asym_quant(int c, int e, int qbits)
966 966
 /* Output one audio block. There are NB_BLOCKS audio blocks in one AC3
967 967
    frame */
968 968
 static void output_audio_block(AC3EncodeContext *s,
969
-                               UINT8 exp_strategy[AC3_MAX_CHANNELS],
970
-                               UINT8 encoded_exp[AC3_MAX_CHANNELS][N/2],
971
-                               UINT8 bap[AC3_MAX_CHANNELS][N/2],
972
-                               INT32 mdct_coefs[AC3_MAX_CHANNELS][N/2],
973
-                               INT8 global_exp[AC3_MAX_CHANNELS],
969
+                               uint8_t exp_strategy[AC3_MAX_CHANNELS],
970
+                               uint8_t encoded_exp[AC3_MAX_CHANNELS][N/2],
971
+                               uint8_t bap[AC3_MAX_CHANNELS][N/2],
972
+                               int32_t mdct_coefs[AC3_MAX_CHANNELS][N/2],
973
+                               int8_t global_exp[AC3_MAX_CHANNELS],
974 974
                                int block_num)
975 975
 {
976 976
     int ch, nb_groups, group_size, i, baie;
977
-    UINT8 *p;
978
-    UINT16 qmant[AC3_MAX_CHANNELS][N/2];
977
+    uint8_t *p;
978
+    uint16_t qmant[AC3_MAX_CHANNELS][N/2];
979 979
     int exp0, exp1;
980 980
     int mant1_cnt, mant2_cnt, mant4_cnt;
981
-    UINT16 *qmant1_ptr, *qmant2_ptr, *qmant4_ptr;
981
+    uint16_t *qmant1_ptr, *qmant2_ptr, *qmant4_ptr;
982 982
     int delta0, delta1, delta2;
983 983
 
984 984
     for(ch=0;ch<s->nb_channels;ch++) 
... ...
@@ -1244,7 +1244,7 @@ static void ac3_crc_init(void)
1244 1244
     }
1245 1245
 }
1246 1246
 
1247
-static unsigned int ac3_crc(UINT8 *data, int n, unsigned int crc)
1247
+static unsigned int ac3_crc(uint8_t *data, int n, unsigned int crc)
1248 1248
 {
1249 1249
     int i;
1250 1250
     for(i=0;i<n;i++) {
... ...
@@ -1284,7 +1284,7 @@ static unsigned int pow_poly(unsigned int a, unsigned int n, unsigned int poly)
1284 1284
 
1285 1285
 
1286 1286
 /* compute log2(max(abs(tab[]))) */
1287
-static int log2_tab(INT16 *tab, int n)
1287
+static int log2_tab(int16_t *tab, int n)
1288 1288
 {
1289 1289
     int i, v;
1290 1290
 
... ...
@@ -1295,7 +1295,7 @@ static int log2_tab(INT16 *tab, int n)
1295 1295
     return av_log2(v);
1296 1296
 }
1297 1297
 
1298
-static void lshift_tab(INT16 *tab, int n, int lshift)
1298
+static void lshift_tab(int16_t *tab, int n, int lshift)
1299 1299
 {
1300 1300
     int i;
1301 1301
 
... ...
@@ -1315,7 +1315,7 @@ static void lshift_tab(INT16 *tab, int n, int lshift)
1315 1315
 static int output_frame_end(AC3EncodeContext *s)
1316 1316
 {
1317 1317
     int frame_size, frame_size_58, n, crc1, crc2, crc_inv;
1318
-    UINT8 *frame;
1318
+    uint8_t *frame;
1319 1319
 
1320 1320
     frame_size = s->frame_size; /* frame size in words */
1321 1321
     /* align to 8 bits */
... ...
@@ -1350,24 +1350,24 @@ static int AC3_encode_frame(AVCodecContext *avctx,
1350 1350
     AC3EncodeContext *s = avctx->priv_data;
1351 1351
     short *samples = data;
1352 1352
     int i, j, k, v, ch;
1353
-    INT16 input_samples[N];
1354
-    INT32 mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1355
-    UINT8 exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1356
-    UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS];
1357
-    UINT8 encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1358
-    UINT8 bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1359
-    INT8 exp_samples[NB_BLOCKS][AC3_MAX_CHANNELS];
1353
+    int16_t input_samples[N];
1354
+    int32_t mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1355
+    uint8_t exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1356
+    uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS];
1357
+    uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1358
+    uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1359
+    int8_t exp_samples[NB_BLOCKS][AC3_MAX_CHANNELS];
1360 1360
     int frame_bits;
1361 1361
 
1362 1362
     frame_bits = 0;
1363 1363
     for(ch=0;ch<s->nb_all_channels;ch++) {
1364 1364
         /* fixed mdct to the six sub blocks & exponent computation */
1365 1365
         for(i=0;i<NB_BLOCKS;i++) {
1366
-            INT16 *sptr;
1366
+            int16_t *sptr;
1367 1367
             int sinc;
1368 1368
 
1369 1369
             /* compute input samples */
1370
-            memcpy(input_samples, s->last_samples[ch], N/2 * sizeof(INT16));
1370
+            memcpy(input_samples, s->last_samples[ch], N/2 * sizeof(int16_t));
1371 1371
             sinc = s->nb_all_channels;
1372 1372
             sptr = samples + (sinc * (N/2) * i) + ch;
1373 1373
             for(j=0;j<N/2;j++) {
... ...
@@ -1432,7 +1432,7 @@ static int AC3_encode_frame(AVCodecContext *avctx,
1432 1432
             /* copy encoded exponents for reuse case */
1433 1433
             for(k=i+1;k<j;k++) {
1434 1434
                 memcpy(encoded_exp[k][ch], encoded_exp[i][ch], 
1435
-                       s->nb_coefs[ch] * sizeof(UINT8));
1435
+                       s->nb_coefs[ch] * sizeof(uint8_t));
1436 1436
             }
1437 1437
             i = j;
1438 1438
         }
... ...
@@ -1492,8 +1492,8 @@ void fft_test(void)
1492 1492
 
1493 1493
 void mdct_test(void)
1494 1494
 {
1495
-    INT16 input[N];
1496
-    INT32 output[N/2];
1495
+    int16_t input[N];
1496
+    int32_t output[N/2];
1497 1497
     float input1[N];
1498 1498
     float output1[N/2];
1499 1499
     float s, a, err, e, emax;
... ...
@@ -1,10 +1,10 @@
1 1
 /* tables taken directly from AC3 spec */
2 2
 
3 3
 /* possible frequencies */
4
-const UINT16 ac3_freqs[3] = { 48000, 44100, 32000 };
4
+const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };
5 5
 
6 6
 /* possible bitrates */
7
-const UINT16 ac3_bitratetab[19] = {
7
+const uint16_t ac3_bitratetab[19] = {
8 8
     32, 40, 48, 56, 64, 80, 96, 112, 128, 
9 9
     160, 192, 224, 256, 320, 384, 448, 512, 576, 640 
10 10
 };
... ...
@@ -12,7 +12,7 @@ const UINT16 ac3_bitratetab[19] = {
12 12
 /* AC3 MDCT window */
13 13
 
14 14
 /* MDCT window */
15
-const INT16 ac3_window[256] = {
15
+const int16_t ac3_window[256] = {
16 16
     4,    7,   12,   16,   21,   28,   34,   42,
17 17
    51,   61,   72,   84,   97,  111,  127,  145,
18 18
   164,  184,  207,  231,  257,  285,  315,  347,
... ...
@@ -47,9 +47,9 @@ const INT16 ac3_window[256] = {
47 47
 32767,32767,32767,32767,32767,32767,32767,32767,  
48 48
 };
49 49
 
50
-static UINT8 masktab[253];
50
+static uint8_t masktab[253];
51 51
 
52
-static const UINT8 latab[260]= {
52
+static const uint8_t latab[260]= {
53 53
 0x0040,0x003f,0x003e,0x003d,0x003c,0x003b,0x003a,0x0039,0x0038,0x0037,
54 54
 0x0036,0x0035,0x0034,0x0034,0x0033,0x0032,0x0031,0x0030,0x002f,0x002f,
55 55
 0x002e,0x002d,0x002c,0x002c,0x002b,0x002a,0x0029,0x0029,0x0028,0x0027,
... ...
@@ -78,7 +78,7 @@ static const UINT8 latab[260]= {
78 78
 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
79 79
 };
80 80
 
81
-static const UINT16 hth[50][3]= {
81
+static const uint16_t hth[50][3]= {
82 82
 { 0x04d0,0x04f0,0x0580 },
83 83
 { 0x04d0,0x04f0,0x0580 },
84 84
 { 0x0440,0x0460,0x04b0 },
... ...
@@ -131,7 +131,7 @@ static const UINT16 hth[50][3]= {
131 131
 { 0x0840,0x0840,0x04e0 },
132 132
 };
133 133
 
134
-static const UINT8 baptab[64]= {
134
+static const uint8_t baptab[64]= {
135 135
     0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 
136 136
     3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 
137 137
     7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 
... ...
@@ -141,43 +141,43 @@ static const UINT8 baptab[64]= {
141 141
     15, 15, 15, 15,
142 142
 };
143 143
 
144
-const UINT8 sdecaytab[4]={ 
144
+const uint8_t sdecaytab[4]={ 
145 145
     0x0f, 0x11, 0x13, 0x15,
146 146
 };
147 147
 
148
-const UINT8 fdecaytab[4]={ 
148
+const uint8_t fdecaytab[4]={ 
149 149
     0x3f, 0x53, 0x67, 0x7b, 
150 150
 };
151 151
 
152
-const UINT16 sgaintab[4]= { 
152
+const uint16_t sgaintab[4]= { 
153 153
     0x540, 0x4d8, 0x478, 0x410,
154 154
 };
155 155
 
156
-const UINT16 dbkneetab[4]= { 
156
+const uint16_t dbkneetab[4]= { 
157 157
     0x000, 0x700, 0x900, 0xb00,
158 158
 };
159 159
 
160
-const UINT16 floortab[8]= { 
160
+const uint16_t floortab[8]= { 
161 161
     0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
162 162
 };
163 163
 
164
-const UINT16 fgaintab[8]= {
164
+const uint16_t fgaintab[8]= {
165 165
     0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
166 166
 };
167 167
 
168
-static const UINT8 bndsz[50]={
168
+static const uint8_t bndsz[50]={
169 169
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
170 170
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 
171 171
     3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24 
172 172
 };
173 173
 
174
-static UINT8 bndtab[51]; 
174
+static uint8_t bndtab[51]; 
175 175
 
176 176
 /* fft & mdct sin cos tables */
177
-static INT16 costab[64];
178
-static INT16 sintab[64];
179
-static INT16 fft_rev[512];
180
-static INT16 xcos1[128];
181
-static INT16 xsin1[128];
177
+static int16_t costab[64];
178
+static int16_t sintab[64];
179
+static int16_t fft_rev[512];
180
+static int16_t xcos1[128];
181
+static int16_t xsin1[128];
182 182
 
183
-static UINT16 crc_table[256];
183
+static uint16_t crc_table[256];
... ...
@@ -329,14 +329,14 @@ static inline short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, char nibble)
329 329
 
330 330
 static int adpcm_decode_frame(AVCodecContext *avctx,
331 331
 			    void *data, int *data_size,
332
-			    UINT8 *buf, int buf_size)
332
+			    uint8_t *buf, int buf_size)
333 333
 {
334 334
     ADPCMContext *c = avctx->priv_data;
335 335
     ADPCMChannelStatus *cs;
336 336
     int n, m, channel;
337 337
     int block_predictor[2];
338 338
     short *samples;
339
-    UINT8 *src;
339
+    uint8_t *src;
340 340
     int st; /* stereo */
341 341
 
342 342
     samples = data;
... ...
@@ -500,7 +500,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
500 500
         *data_size = 0;
501 501
         return -1;
502 502
     }
503
-    *data_size = (UINT8 *)samples - (UINT8 *)data;
503
+    *data_size = (uint8_t *)samples - (uint8_t *)data;
504 504
     return src - buf;
505 505
 }
506 506
 
... ...
@@ -28,7 +28,7 @@ void audio_encode_example(const char *filename)
28 28
     FILE *f;
29 29
     short *samples;
30 30
     float t, tincr;
31
-    UINT8 *outbuf;
31
+    uint8_t *outbuf;
32 32
 
33 33
     printf("Audio encoding\n");
34 34
 
... ...
@@ -94,8 +94,8 @@ void audio_decode_example(const char *outfilename, const char *filename)
94 94
     AVCodecContext *c= NULL;
95 95
     int out_size, size, len;
96 96
     FILE *f, *outfile;
97
-    UINT8 *outbuf;
98
-    UINT8 inbuf[INBUF_SIZE], *inbuf_ptr;
97
+    uint8_t *outbuf;
98
+    uint8_t inbuf[INBUF_SIZE], *inbuf_ptr;
99 99
 
100 100
     printf("Audio decoding\n");
101 101
 
... ...
@@ -169,7 +169,7 @@ void video_encode_example(const char *filename)
169 169
     int i, out_size, size, x, y, outbuf_size;
170 170
     FILE *f;
171 171
     AVFrame *picture;
172
-    UINT8 *outbuf, *picture_buf;
172
+    uint8_t *outbuf, *picture_buf;
173 173
 
174 174
     printf("Video encoding\n");
175 175
 
... ...
@@ -283,7 +283,7 @@ void video_decode_example(const char *outfilename, const char *filename)
283 283
     int frame, size, got_picture, len;
284 284
     FILE *f;
285 285
     AVFrame *picture;
286
-    UINT8 inbuf[INBUF_SIZE], *inbuf_ptr;
286
+    uint8_t inbuf[INBUF_SIZE], *inbuf_ptr;
287 287
     char buf[1024];
288 288
 
289 289
     printf("Video decoding\n");
... ...
@@ -23,17 +23,17 @@
23 23
 
24 24
 extern void j_rev_dct_ARM(DCTELEM *data);
25 25
 /* XXX: local hack */
26
-static void (*ff_put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
27
-static void (*ff_add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
26
+static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
27
+static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
28 28
 
29 29
 /* XXX: those functions should be suppressed ASAP when all IDCTs are
30 30
    converted */
31
-static void arm_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
31
+static void arm_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
32 32
 {
33 33
     j_rev_dct_ARM (block);
34 34
     ff_put_pixels_clamped(block, dest, line_size);
35 35
 }
36
-static void arm_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
36
+static void arm_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
37 37
 {
38 38
     j_rev_dct_ARM (block);
39 39
     ff_add_pixels_clamped(block, dest, line_size);
... ...
@@ -393,7 +393,7 @@ typedef struct AVCodecContext {
393 393
      * decoding: set by user.
394 394
      */
395 395
     void (*draw_horiz_band)(struct AVCodecContext *s,
396
-                            UINT8 **src_ptr, int linesize,
396
+                            uint8_t **src_ptr, int linesize,
397 397
                             int y, int width, int height);
398 398
 
399 399
     /* audio only */
... ...
@@ -992,10 +992,10 @@ typedef struct AVCodec {
992 992
     int id;
993 993
     int priv_data_size;
994 994
     int (*init)(AVCodecContext *);
995
-    int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data);
995
+    int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
996 996
     int (*close)(AVCodecContext *);
997 997
     int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
998
-                  UINT8 *buf, int buf_size);
998
+                  uint8_t *buf, int buf_size);
999 999
     int capabilities;
1000 1000
     const AVOption *options;
1001 1001
     struct AVCodec *next;
... ...
@@ -1006,7 +1006,7 @@ typedef struct AVCodec {
1006 1006
  * the last component is alpha
1007 1007
  */
1008 1008
 typedef struct AVPicture {
1009
-    UINT8 *data[4];
1009
+    uint8_t *data[4];
1010 1010
     int linesize[4];
1011 1011
 } AVPicture;
1012 1012
 
... ...
@@ -1110,7 +1110,7 @@ void img_resample(ImgReSampleContext *s,
1110 1110
 
1111 1111
 void img_resample_close(ImgReSampleContext *s);
1112 1112
 
1113
-int avpicture_fill(AVPicture *picture, UINT8 *ptr,
1113
+int avpicture_fill(AVPicture *picture, uint8_t *ptr,
1114 1114
                    int pix_fmt, int width, int height);
1115 1115
 int avpicture_get_size(int pix_fmt, int width, int height);
1116 1116
 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);
1152 1152
 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
1153 1153
 
1154 1154
 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
1155
-int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples, 
1155
+int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples, 
1156 1156
                          int *frame_size_ptr,
1157
-                         UINT8 *buf, int buf_size);
1157
+                         uint8_t *buf, int buf_size);
1158 1158
 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, 
1159 1159
                          int *got_picture_ptr,
1160
-                         UINT8 *buf, int buf_size);
1161
-int avcodec_parse_frame(AVCodecContext *avctx, UINT8 **pdata, 
1160
+                         uint8_t *buf, int buf_size);
1161
+int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata, 
1162 1162
                         int *data_size_ptr,
1163
-                        UINT8 *buf, int buf_size);
1164
-int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size, 
1163
+                        uint8_t *buf, int buf_size);
1164
+int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, 
1165 1165
                          const short *samples);
1166
-int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, 
1166
+int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, 
1167 1167
                          const AVFrame *pict);
1168 1168
 
1169 1169
 int avcodec_close(AVCodecContext *avctx);
... ...
@@ -20,7 +20,7 @@
20 20
  */
21 21
 #include "avcodec.h"
22 22
 
23
-const UINT8 ff_sqrt_tab[128]={
23
+const uint8_t ff_sqrt_tab[128]={
24 24
         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,
25 25
         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,
26 26
         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]={
39 39
 };
40 40
 
41 41
 void init_put_bits(PutBitContext *s, 
42
-                   UINT8 *buffer, int buffer_size,
42
+                   uint8_t *buffer, int buffer_size,
43 43
                    void *opaque,
44
-                   void (*write_data)(void *, UINT8 *, int))
44
+                   void (*write_data)(void *, uint8_t *, int))
45 45
 {
46 46
     s->buf = buffer;
47 47
     s->buf_end = s->buf + buffer_size;
... ...
@@ -62,12 +62,12 @@ void init_put_bits(PutBitContext *s,
62 62
 }
63 63
 
64 64
 /* return the number of bits output */
65
-INT64 get_bit_count(PutBitContext *s)
65
+int64_t get_bit_count(PutBitContext *s)
66 66
 {
67 67
 #ifdef ALT_BITSTREAM_WRITER
68 68
     return s->data_out_size * 8 + s->index;
69 69
 #else
70
-    return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (INT64)s->bit_left;
70
+    return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (int64_t)s->bit_left;
71 71
 #endif
72 72
 }
73 73
 
... ...
@@ -110,7 +110,7 @@ void put_string(PutBitContext * pbc, char *s)
110 110
 /* bit input functions */
111 111
 
112 112
 void init_get_bits(GetBitContext *s,
113
-                   UINT8 *buffer, int bit_size)
113
+                   uint8_t *buffer, int bit_size)
114 114
 {
115 115
     const int buffer_size= (bit_size+7)>>3;
116 116
 
... ...
@@ -160,16 +160,16 @@ int check_marker(GetBitContext *s, const char *msg)
160 160
 
161 161
 #define GET_DATA(v, table, i, wrap, size) \
162 162
 {\
163
-    const UINT8 *ptr = (const UINT8 *)table + i * wrap;\
163
+    const uint8_t *ptr = (const uint8_t *)table + i * wrap;\
164 164
     switch(size) {\
165 165
     case 1:\
166
-        v = *(const UINT8 *)ptr;\
166
+        v = *(const uint8_t *)ptr;\
167 167
         break;\
168 168
     case 2:\
169
-        v = *(const UINT16 *)ptr;\
169
+        v = *(const uint16_t *)ptr;\
170 170
         break;\
171 171
     default:\
172
-        v = *(const UINT32 *)ptr;\
172
+        v = *(const uint32_t *)ptr;\
173 173
         break;\
174 174
     }\
175 175
 }
... ...
@@ -194,10 +194,10 @@ static int build_table(VLC *vlc, int table_nb_bits,
194 194
                        int nb_codes,
195 195
                        const void *bits, int bits_wrap, int bits_size,
196 196
                        const void *codes, int codes_wrap, int codes_size,
197
-                       UINT32 code_prefix, int n_prefix)
197
+                       uint32_t code_prefix, int n_prefix)
198 198
 {
199 199
     int i, j, k, n, table_size, table_index, nb, n1, index;
200
-    UINT32 code;
200
+    uint32_t code;
201 201
     VLC_TYPE (*table)[2];
202 202
 
203 203
     table_size = 1 << table_nb_bits;
... ...
@@ -72,33 +72,24 @@
72 72
 
73 73
 /* windows */
74 74
 
75
-typedef unsigned short UINT16;
76
-typedef signed short INT16;
77
-typedef unsigned char UINT8;
78
-typedef unsigned int UINT32;
79
-typedef unsigned __int64 UINT64;
80
-typedef signed char INT8;
81
-typedef signed int INT32;
82
-typedef signed __int64 INT64;
83
-
84
-typedef UINT8 uint8_t;
85
-typedef INT8 int8_t;
86
-typedef UINT16 uint16_t;
87
-typedef INT16 int16_t;
88
-typedef UINT32 uint32_t;
89
-typedef INT32 int32_t;
90
-typedef UINT64 uint64_t;
91
-typedef INT64 int64_t;
75
+typedef unsigned short uint16_t;
76
+typedef signed short int16_t;
77
+typedef unsigned char uint8_t;
78
+typedef unsigned int uint32_t;
79
+typedef unsigned __int64 uint64_t;
80
+typedef signed char int8_t;
81
+typedef signed int int32_t;
82
+typedef signed __int64 int64_t;
92 83
 
93 84
 #    ifndef __MINGW32__
94
-#        define INT64_C(c)     (c ## i64)
95
-#        define UINT64_C(c)    (c ## i64)
85
+#        define int64_t_C(c)     (c ## i64)
86
+#        define uint64_t_C(c)    (c ## i64)
96 87
 
97 88
 #        define inline __inline
98 89
 
99 90
 #    else
100
-#        define INT64_C(c)     (c ## LL)
101
-#        define UINT64_C(c)    (c ## ULL)
91
+#        define int64_t_C(c)     (c ## LL)
92
+#        define uint64_t_C(c)    (c ## ULL)
102 93
 #    endif /* __MINGW32__ */
103 94
 
104 95
 #    ifdef _DEBUG
... ...
@@ -114,20 +105,11 @@ typedef INT64 int64_t;
114 114
 
115 115
 #include <inttypes.h>
116 116
 
117
-typedef unsigned char UINT8;
118
-typedef unsigned short UINT16;
119
-typedef unsigned int UINT32;
120
-typedef unsigned long long UINT64;
121
-typedef signed char INT8;
122
-typedef signed short INT16;
123
-typedef signed int INT32;
124
-typedef signed long long INT64;
125
-
126 117
 #ifdef HAVE_AV_CONFIG_H
127 118
 
128
-#ifndef INT64_C
129
-#define INT64_C(c)     (c ## LL)
130
-#define UINT64_C(c)    (c ## ULL)
119
+#ifndef int64_t_C
120
+#define int64_t_C(c)     (c ## LL)
121
+#define uint64_t_C(c)    (c ## ULL)
131 122
 #endif
132 123
 
133 124
 #ifdef USE_FASTMEMCPY
... ...
@@ -145,23 +127,10 @@ typedef signed long long INT64;
145 145
 
146 146
 #    include <inttypes.h>
147 147
 
148
-#    ifndef __WINE_WINDEF16_H
149
-/* workaround for typedef conflict in MPlayer (wine typedefs) */
150
-typedef unsigned short UINT16;
151
-typedef signed short INT16;
152
-#    endif
153
-
154
-typedef unsigned char UINT8;
155
-typedef unsigned int UINT32;
156
-typedef unsigned long long UINT64;
157
-typedef signed char INT8;
158
-typedef signed int INT32;
159
-typedef signed long long INT64;
160
-
161 148
 #    ifdef HAVE_AV_CONFIG_H
162
-#        ifndef INT64_C
163
-#            define INT64_C(c)     (c ## LL)
164
-#            define UINT64_C(c)    (c ## ULL)
149
+#        ifndef int64_t_C
150
+#            define int64_t_C(c)     (c ## LL)
151
+#            define uint64_t_C(c)    (c ## ULL)
165 152
 #        endif
166 153
 
167 154
 #        ifdef USE_FASTMEMCPY
... ...
@@ -240,26 +209,26 @@ static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
240 240
 
241 241
 struct PutBitContext;
242 242
 
243
-typedef void (*WriteDataFunc)(void *, UINT8 *, int);
243
+typedef void (*WriteDataFunc)(void *, uint8_t *, int);
244 244
 
245 245
 typedef struct PutBitContext {
246 246
 #ifdef ALT_BITSTREAM_WRITER
247
-    UINT8 *buf, *buf_end;
247
+    uint8_t *buf, *buf_end;
248 248
     int index;
249 249
 #else
250
-    UINT32 bit_buf;
250
+    uint32_t bit_buf;
251 251
     int bit_left;
252
-    UINT8 *buf, *buf_ptr, *buf_end;
252
+    uint8_t *buf, *buf_ptr, *buf_end;
253 253
 #endif
254
-    INT64 data_out_size; /* in bytes */
254
+    int64_t data_out_size; /* in bytes */
255 255
 } PutBitContext;
256 256
 
257 257
 void init_put_bits(PutBitContext *s, 
258
-                   UINT8 *buffer, int buffer_size,
258
+                   uint8_t *buffer, int buffer_size,
259 259
                    void *opaque,
260
-                   void (*write_data)(void *, UINT8 *, int));
260
+                   void (*write_data)(void *, uint8_t *, int));
261 261
 
262
-INT64 get_bit_count(PutBitContext *s); /* XXX: change function name */
262
+int64_t get_bit_count(PutBitContext *s); /* XXX: change function name */
263 263
 void align_put_bits(PutBitContext *s);
264 264
 void flush_put_bits(PutBitContext *s);
265 265
 void put_string(PutBitContext * pbc, char *s);
... ...
@@ -267,17 +236,17 @@ void put_string(PutBitContext * pbc, char *s);
267 267
 /* bit input */
268 268
 
269 269
 typedef struct GetBitContext {
270
-    UINT8 *buffer, *buffer_end;
270
+    uint8_t *buffer, *buffer_end;
271 271
 #ifdef ALT_BITSTREAM_READER
272 272
     int index;
273 273
 #elif defined LIBMPEG2_BITSTREAM_READER
274
-    UINT8 *buffer_ptr;
275
-    UINT32 cache;
274
+    uint8_t *buffer_ptr;
275
+    uint32_t cache;
276 276
     int bit_count;
277 277
 #elif defined A32_BITSTREAM_READER
278
-    UINT32 *buffer_ptr;
279
-    UINT32 cache0;
280
-    UINT32 cache1;
278
+    uint32_t *buffer_ptr;
279
+    uint32_t cache0;
280
+    uint32_t cache1;
281 281
     int bit_count;
282 282
 #endif
283 283
     int size_in_bits;
... ...
@@ -285,7 +254,7 @@ typedef struct GetBitContext {
285 285
 
286 286
 static inline int get_bits_count(GetBitContext *s);
287 287
 
288
-#define VLC_TYPE INT16
288
+#define VLC_TYPE int16_t
289 289
 
290 290
 typedef struct VLC {
291 291
     int bits;
... ...
@@ -305,7 +274,7 @@ typedef struct RL_VLC_ELEM {
305 305
 
306 306
 /* used to avoid missaligned exceptions on some archs (alpha, ...) */
307 307
 #ifdef ARCH_X86
308
-#    define unaligned32(a) (*(UINT32*)(a))
308
+#    define unaligned32(a) (*(uint32_t*)(a))
309 309
 #else
310 310
 #    ifdef __GNUC__
311 311
 static inline uint32_t unaligned32(const void *v) {
... ...
@@ -357,7 +326,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
357 357
             s->buf_ptr[3] = bit_buf      ;
358 358
         } else
359 359
 #endif
360
-        *(UINT32 *)s->buf_ptr = be2me_32(bit_buf);
360
+        *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
361 361
         //printf("bitbuf = %08x\n", bit_buf);
362 362
         s->buf_ptr+=4;
363 363
 	bit_left+=32 - n;
... ...
@@ -700,7 +669,7 @@ static inline void skip_bits1(GetBitContext *s){
700 700
 }
701 701
 
702 702
 void init_get_bits(GetBitContext *s,
703
-                   UINT8 *buffer, int buffer_size);
703
+                   uint8_t *buffer, int buffer_size);
704 704
 
705 705
 int check_marker(GetBitContext *s, const char *msg);
706 706
 void align_get_bits(GetBitContext *s);
... ...
@@ -56,7 +56,7 @@ static int cyuv_decode_init(AVCodecContext *avctx)
56 56
 
57 57
 static int cyuv_decode_frame(AVCodecContext *avctx, 
58 58
                              void *data, int *data_size,
59
-                             UINT8 *buf, int buf_size)
59
+                             uint8_t *buf, int buf_size)
60 60
 {
61 61
     CyuvDecodeContext *s=avctx->priv_data;
62 62
 
... ...
@@ -40,13 +40,13 @@ static const unsigned short aanscales[64] = {
40 40
     4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247
41 41
 };
42 42
 
43
-UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
43
+uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
44 44
 
45
-INT64 gettime(void)
45
+int64_t gettime(void)
46 46
 {
47 47
     struct timeval tv;
48 48
     gettimeofday(&tv,NULL);
49
-    return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
49
+    return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
50 50
 }
51 51
 
52 52
 #define NB_ITS 20000
... ...
@@ -86,8 +86,8 @@ void dct_error(const char *name, int is_idct,
86 86
 {
87 87
     int it, i, scale;
88 88
     int err_inf, v;
89
-    INT64 err2, ti, ti1, it1;
90
-    INT64 sysErr[64], sysErrMax=0;
89
+    int64_t err2, ti, ti1, it1;
90
+    int64_t sysErr[64], sysErrMax=0;
91 91
     int maxout=0;
92 92
     int blockSumErrMax=0, blockSumErr;
93 93
 
... ...
@@ -261,10 +261,10 @@ void dct_error(const char *name, int is_idct,
261 261
 #endif
262 262
 }
263 263
 
264
-static UINT8 img_dest[64] __attribute__ ((aligned (8)));
265
-static UINT8 img_dest1[64] __attribute__ ((aligned (8)));
264
+static uint8_t img_dest[64] __attribute__ ((aligned (8)));
265
+static uint8_t img_dest1[64] __attribute__ ((aligned (8)));
266 266
 
267
-void idct248_ref(UINT8 *dest, int linesize, INT16 *block)
267
+void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
268 268
 {
269 269
     static int init;
270 270
     static double c8[8][8];
... ...
@@ -345,7 +345,7 @@ void idct248_ref(UINT8 *dest, int linesize, INT16 *block)
345 345
 }
346 346
 
347 347
 void idct248_error(const char *name, 
348
-                    void (*idct248_put)(UINT8 *dest, int line_size, INT16 *block))
348
+                    void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block))
349 349
 {
350 350
     int it, i, it1, ti, ti1, err_max, v;
351 351
 
... ...
@@ -24,10 +24,10 @@
24 24
 
25 25
 int ff_bit_exact=0;
26 26
 
27
-UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
28
-UINT32 squareTbl[512];
27
+uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
28
+uint32_t squareTbl[512];
29 29
 
30
-const UINT8 ff_zigzag_direct[64] = {
30
+const uint8_t ff_zigzag_direct[64] = {
31 31
     0,   1,  8, 16,  9,  2,  3, 10,
32 32
     17, 24, 32, 25, 18, 11,  4,  5,
33 33
     12, 19, 26, 33, 40, 48, 41, 34,
... ...
@@ -39,9 +39,9 @@ const UINT8 ff_zigzag_direct[64] = {
39 39
 };
40 40
 
41 41
 /* not permutated inverse zigzag_direct + 1 for MMX quantizer */
42
-UINT16 __align8 inv_zigzag_direct16[64];
42
+uint16_t __align8 inv_zigzag_direct16[64];
43 43
 
44
-const UINT8 ff_alternate_horizontal_scan[64] = {
44
+const uint8_t ff_alternate_horizontal_scan[64] = {
45 45
     0,  1,   2,  3,  8,  9, 16, 17, 
46 46
     10, 11,  4,  5,  6,  7, 15, 14,
47 47
     13, 12, 19, 18, 24, 25, 32, 33, 
... ...
@@ -52,7 +52,7 @@ const UINT8 ff_alternate_horizontal_scan[64] = {
52 52
     52, 53, 54, 55, 60, 61, 62, 63,
53 53
 };
54 54
 
55
-const UINT8 ff_alternate_vertical_scan[64] = {
55
+const uint8_t ff_alternate_vertical_scan[64] = {
56 56
     0,  8,  16, 24,  1,  9,  2, 10, 
57 57
     17, 25, 32, 40, 48, 56, 57, 49,
58 58
     41, 33, 26, 18,  3, 11,  4, 12, 
... ...
@@ -64,7 +64,7 @@ const UINT8 ff_alternate_vertical_scan[64] = {
64 64
 };
65 65
 
66 66
 /* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */
67
-const UINT32 inverse[256]={
67
+const uint32_t inverse[256]={
68 68
          0, 4294967295U,2147483648U,1431655766, 1073741824,  858993460,  715827883,  613566757, 
69 69
  536870912,  477218589,  429496730,  390451573,  357913942,  330382100,  306783379,  286331154, 
70 70
  268435456,  252645136,  238609295,  226050911,  214748365,  204522253,  195225787,  186737709, 
... ...
@@ -99,7 +99,7 @@ const UINT32 inverse[256]={
99 99
   17318417,   17248865,   17179870,   17111424,   17043522,   16976156,   16909321,   16843010,
100 100
 };
101 101
 
102
-static int pix_sum_c(UINT8 * pix, int line_size)
102
+static int pix_sum_c(uint8_t * pix, int line_size)
103 103
 {
104 104
     int s, i, j;
105 105
 
... ...
@@ -121,10 +121,10 @@ static int pix_sum_c(UINT8 * pix, int line_size)
121 121
     return s;
122 122
 }
123 123
 
124
-static int pix_norm1_c(UINT8 * pix, int line_size)
124
+static int pix_norm1_c(uint8_t * pix, int line_size)
125 125
 {
126 126
     int s, i, j;
127
-    UINT32 *sq = squareTbl + 256;
127
+    uint32_t *sq = squareTbl + 256;
128 128
 
129 129
     s = 0;
130 130
     for (i = 0; i < 16; i++) {
... ...
@@ -170,10 +170,10 @@ static int pix_norm1_c(UINT8 * pix, int line_size)
170 170
 }
171 171
 
172 172
 
173
-static int sse8_c(void *v, UINT8 * pix1, UINT8 * pix2, int line_size)
173
+static int sse8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size)
174 174
 {
175 175
     int s, i;
176
-    UINT32 *sq = squareTbl + 256;
176
+    uint32_t *sq = squareTbl + 256;
177 177
 
178 178
     s = 0;
179 179
     for (i = 0; i < 8; i++) {
... ...
@@ -221,7 +221,7 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size)
221 221
     return s;
222 222
 }
223 223
 
224
-static void get_pixels_c(DCTELEM *restrict block, const UINT8 *pixels, int line_size)
224
+static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
225 225
 {
226 226
     int i;
227 227
 
... ...
@@ -240,8 +240,8 @@ static void get_pixels_c(DCTELEM *restrict block, const UINT8 *pixels, int line_
240 240
     }
241 241
 }
242 242
 
243
-static void diff_pixels_c(DCTELEM *restrict block, const UINT8 *s1,
244
-			  const UINT8 *s2, int stride){
243
+static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1,
244
+			  const uint8_t *s2, int stride){
245 245
     int i;
246 246
 
247 247
     /* read the pixels */
... ...
@@ -261,11 +261,11 @@ static void diff_pixels_c(DCTELEM *restrict block, const UINT8 *s1,
261 261
 }
262 262
 
263 263
 
264
-static void put_pixels_clamped_c(const DCTELEM *block, UINT8 *restrict pixels,
264
+static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
265 265
 				 int line_size)
266 266
 {
267 267
     int i;
268
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;
268
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
269 269
     
270 270
     /* read the pixels */
271 271
     for(i=0;i<8;i++) {
... ...
@@ -283,11 +283,11 @@ static void put_pixels_clamped_c(const DCTELEM *block, UINT8 *restrict pixels,
283 283
     }
284 284
 }
285 285
 
286
-static void add_pixels_clamped_c(const DCTELEM *block, UINT8 *restrict pixels,
286
+static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
287 287
                           int line_size)
288 288
 {
289 289
     int i;
290
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;
290
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
291 291
     
292 292
     /* read the pixels */
293 293
     for(i=0;i<8;i++) {
... ...
@@ -702,7 +702,7 @@ PIXOP2(put, op_put)
702 702
 #define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
703 703
 
704 704
 
705
-static void gmc1_c(UINT8 *dst, UINT8 *src, int stride, int h, int x16, int y16, int rounder)
705
+static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder)
706 706
 {
707 707
     const int A=(16-x16)*(16-y16);
708 708
     const int B=(   x16)*(16-y16);
... ...
@@ -725,7 +725,7 @@ static void gmc1_c(UINT8 *dst, UINT8 *src, int stride, int h, int x16, int y16,
725 725
     }
726 726
 }
727 727
 
728
-static void gmc_c(UINT8 *dst, UINT8 *src, int stride, int h, int ox, int oy, 
728
+static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, 
729 729
                   int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
730 730
 {
731 731
     int y, vx, vy;
... ...
@@ -783,7 +783,7 @@ static void gmc_c(UINT8 *dst, UINT8 *src, int stride, int h, int ox, int oy,
783 783
     }
784 784
 }
785 785
 
786
-static inline void copy_block17(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h)
786
+static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
787 787
 {
788 788
     int i;
789 789
     for(i=0; i<h; i++)
... ...
@@ -798,7 +798,7 @@ static inline void copy_block17(UINT8 *dst, UINT8 *src, int dstStride, int srcSt
798 798
     }
799 799
 }
800 800
 
801
-static inline void copy_block9(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h)
801
+static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
802 802
 {
803 803
     int i;
804 804
     for(i=0; i<h; i++)
... ...
@@ -813,8 +813,8 @@ static inline void copy_block9(UINT8 *dst, UINT8 *src, int dstStride, int srcStr
813 813
 
814 814
 
815 815
 #define QPEL_MC(r, OPNAME, RND, OP) \
816
-static void OPNAME ## mpeg4_qpel8_h_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h){\
817
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;\
816
+static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
817
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;\
818 818
     int i;\
819 819
     for(i=0; i<h; i++)\
820 820
     {\
... ...
@@ -831,9 +831,9 @@ static void OPNAME ## mpeg4_qpel8_h_lowpass(UINT8 *dst, UINT8 *src, int dstStrid
831 831
     }\
832 832
 }\
833 833
 \
834
-static void OPNAME ## mpeg4_qpel8_v_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride){\
834
+static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
835 835
     const int w=8;\
836
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;\
836
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;\
837 837
     int i;\
838 838
     for(i=0; i<w; i++)\
839 839
     {\
... ...
@@ -859,8 +859,8 @@ static void OPNAME ## mpeg4_qpel8_v_lowpass(UINT8 *dst, UINT8 *src, int dstStrid
859 859
     }\
860 860
 }\
861 861
 \
862
-static void OPNAME ## mpeg4_qpel16_h_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h){\
863
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;\
862
+static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
863
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;\
864 864
     int i;\
865 865
     \
866 866
     for(i=0; i<h; i++)\
... ...
@@ -886,8 +886,8 @@ static void OPNAME ## mpeg4_qpel16_h_lowpass(UINT8 *dst, UINT8 *src, int dstStri
886 886
     }\
887 887
 }\
888 888
 \
889
-static void OPNAME ## mpeg4_qpel16_v_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride){\
890
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;\
889
+static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
890
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;\
891 891
     int i;\
892 892
     const int w=16;\
893 893
     for(i=0; i<w; i++)\
... ...
@@ -930,367 +930,367 @@ static void OPNAME ## mpeg4_qpel16_v_lowpass(UINT8 *dst, UINT8 *src, int dstStri
930 930
     }\
931 931
 }\
932 932
 \
933
-static void OPNAME ## qpel8_mc00_c (UINT8 *dst, UINT8 *src, int stride){\
933
+static void OPNAME ## qpel8_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
934 934
     OPNAME ## pixels8_c(dst, src, stride, 8);\
935 935
 }\
936 936
 \
937
-static void OPNAME ## qpel8_mc10_c(UINT8 *dst, UINT8 *src, int stride){\
938
-    UINT8 half[64];\
937
+static void OPNAME ## qpel8_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
938
+    uint8_t half[64];\
939 939
     put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
940 940
     OPNAME ## pixels8_l2(dst, src, half, stride, stride, 8, 8);\
941 941
 }\
942 942
 \
943
-static void OPNAME ## qpel8_mc20_c(UINT8 *dst, UINT8 *src, int stride){\
943
+static void OPNAME ## qpel8_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
944 944
     OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8);\
945 945
 }\
946 946
 \
947
-static void OPNAME ## qpel8_mc30_c(UINT8 *dst, UINT8 *src, int stride){\
948
-    UINT8 half[64];\
947
+static void OPNAME ## qpel8_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
948
+    uint8_t half[64];\
949 949
     put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
950 950
     OPNAME ## pixels8_l2(dst, src+1, half, stride, stride, 8, 8);\
951 951
 }\
952 952
 \
953
-static void OPNAME ## qpel8_mc01_c(UINT8 *dst, UINT8 *src, int stride){\
954
-    UINT8 full[16*9];\
955
-    UINT8 half[64];\
953
+static void OPNAME ## qpel8_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
954
+    uint8_t full[16*9];\
955
+    uint8_t half[64];\
956 956
     copy_block9(full, src, 16, stride, 9);\
957 957
     put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
958 958
     OPNAME ## pixels8_l2(dst, full, half, stride, 16, 8, 8);\
959 959
 }\
960 960
 \
961
-static void OPNAME ## qpel8_mc02_c(UINT8 *dst, UINT8 *src, int stride){\
962
-    UINT8 full[16*9];\
961
+static void OPNAME ## qpel8_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
962
+    uint8_t full[16*9];\
963 963
     copy_block9(full, src, 16, stride, 9);\
964 964
     OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16);\
965 965
 }\
966 966
 \
967
-static void OPNAME ## qpel8_mc03_c(UINT8 *dst, UINT8 *src, int stride){\
968
-    UINT8 full[16*9];\
969
-    UINT8 half[64];\
967
+static void OPNAME ## qpel8_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
968
+    uint8_t full[16*9];\
969
+    uint8_t half[64];\
970 970
     copy_block9(full, src, 16, stride, 9);\
971 971
     put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
972 972
     OPNAME ## pixels8_l2(dst, full+16, half, stride, 16, 8, 8);\
973 973
 }\
974
-void ff_ ## OPNAME ## qpel8_mc11_old_c(UINT8 *dst, UINT8 *src, int stride){\
975
-    UINT8 full[16*9];\
976
-    UINT8 halfH[72];\
977
-    UINT8 halfV[64];\
978
-    UINT8 halfHV[64];\
974
+void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
975
+    uint8_t full[16*9];\
976
+    uint8_t halfH[72];\
977
+    uint8_t halfV[64];\
978
+    uint8_t halfHV[64];\
979 979
     copy_block9(full, src, 16, stride, 9);\
980 980
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
981 981
     put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
982 982
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
983 983
     OPNAME ## pixels8_l4(dst, full, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
984 984
 }\
985
-static void OPNAME ## qpel8_mc11_c(UINT8 *dst, UINT8 *src, int stride){\
986
-    UINT8 full[16*9];\
987
-    UINT8 halfH[72];\
988
-    UINT8 halfHV[64];\
985
+static void OPNAME ## qpel8_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
986
+    uint8_t full[16*9];\
987
+    uint8_t halfH[72];\
988
+    uint8_t halfHV[64];\
989 989
     copy_block9(full, src, 16, stride, 9);\
990 990
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
991 991
     put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
992 992
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
993 993
     OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
994 994
 }\
995
-void ff_ ## OPNAME ## qpel8_mc31_old_c(UINT8 *dst, UINT8 *src, int stride){\
996
-    UINT8 full[16*9];\
997
-    UINT8 halfH[72];\
998
-    UINT8 halfV[64];\
999
-    UINT8 halfHV[64];\
995
+void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
996
+    uint8_t full[16*9];\
997
+    uint8_t halfH[72];\
998
+    uint8_t halfV[64];\
999
+    uint8_t halfHV[64];\
1000 1000
     copy_block9(full, src, 16, stride, 9);\
1001 1001
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1002 1002
     put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
1003 1003
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1004 1004
     OPNAME ## pixels8_l4(dst, full+1, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
1005 1005
 }\
1006
-static void OPNAME ## qpel8_mc31_c(UINT8 *dst, UINT8 *src, int stride){\
1007
-    UINT8 full[16*9];\
1008
-    UINT8 halfH[72];\
1009
-    UINT8 halfHV[64];\
1006
+static void OPNAME ## qpel8_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
1007
+    uint8_t full[16*9];\
1008
+    uint8_t halfH[72];\
1009
+    uint8_t halfHV[64];\
1010 1010
     copy_block9(full, src, 16, stride, 9);\
1011 1011
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1012 1012
     put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
1013 1013
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1014 1014
     OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
1015 1015
 }\
1016
-void ff_ ## OPNAME ## qpel8_mc13_old_c(UINT8 *dst, UINT8 *src, int stride){\
1017
-    UINT8 full[16*9];\
1018
-    UINT8 halfH[72];\
1019
-    UINT8 halfV[64];\
1020
-    UINT8 halfHV[64];\
1016
+void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
1017
+    uint8_t full[16*9];\
1018
+    uint8_t halfH[72];\
1019
+    uint8_t halfV[64];\
1020
+    uint8_t halfHV[64];\
1021 1021
     copy_block9(full, src, 16, stride, 9);\
1022 1022
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1023 1023
     put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
1024 1024
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1025 1025
     OPNAME ## pixels8_l4(dst, full+16, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
1026 1026
 }\
1027
-static void OPNAME ## qpel8_mc13_c(UINT8 *dst, UINT8 *src, int stride){\
1028
-    UINT8 full[16*9];\
1029
-    UINT8 halfH[72];\
1030
-    UINT8 halfHV[64];\
1027
+static void OPNAME ## qpel8_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
1028
+    uint8_t full[16*9];\
1029
+    uint8_t halfH[72];\
1030
+    uint8_t halfHV[64];\
1031 1031
     copy_block9(full, src, 16, stride, 9);\
1032 1032
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1033 1033
     put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
1034 1034
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1035 1035
     OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
1036 1036
 }\
1037
-void ff_ ## OPNAME ## qpel8_mc33_old_c(UINT8 *dst, UINT8 *src, int stride){\
1038
-    UINT8 full[16*9];\
1039
-    UINT8 halfH[72];\
1040
-    UINT8 halfV[64];\
1041
-    UINT8 halfHV[64];\
1037
+void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
1038
+    uint8_t full[16*9];\
1039
+    uint8_t halfH[72];\
1040
+    uint8_t halfV[64];\
1041
+    uint8_t halfHV[64];\
1042 1042
     copy_block9(full, src, 16, stride, 9);\
1043 1043
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full  , 8, 16, 9);\
1044 1044
     put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
1045 1045
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1046 1046
     OPNAME ## pixels8_l4(dst, full+17, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
1047 1047
 }\
1048
-static void OPNAME ## qpel8_mc33_c(UINT8 *dst, UINT8 *src, int stride){\
1049
-    UINT8 full[16*9];\
1050
-    UINT8 halfH[72];\
1051
-    UINT8 halfHV[64];\
1048
+static void OPNAME ## qpel8_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
1049
+    uint8_t full[16*9];\
1050
+    uint8_t halfH[72];\
1051
+    uint8_t halfHV[64];\
1052 1052
     copy_block9(full, src, 16, stride, 9);\
1053 1053
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1054 1054
     put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
1055 1055
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1056 1056
     OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
1057 1057
 }\
1058
-static void OPNAME ## qpel8_mc21_c(UINT8 *dst, UINT8 *src, int stride){\
1059
-    UINT8 halfH[72];\
1060
-    UINT8 halfHV[64];\
1058
+static void OPNAME ## qpel8_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
1059
+    uint8_t halfH[72];\
1060
+    uint8_t halfHV[64];\
1061 1061
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
1062 1062
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1063 1063
     OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
1064 1064
 }\
1065
-static void OPNAME ## qpel8_mc23_c(UINT8 *dst, UINT8 *src, int stride){\
1066
-    UINT8 halfH[72];\
1067
-    UINT8 halfHV[64];\
1065
+static void OPNAME ## qpel8_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
1066
+    uint8_t halfH[72];\
1067
+    uint8_t halfHV[64];\
1068 1068
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
1069 1069
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1070 1070
     OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
1071 1071
 }\
1072
-void ff_ ## OPNAME ## qpel8_mc12_old_c(UINT8 *dst, UINT8 *src, int stride){\
1073
-    UINT8 full[16*9];\
1074
-    UINT8 halfH[72];\
1075
-    UINT8 halfV[64];\
1076
-    UINT8 halfHV[64];\
1072
+void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
1073
+    uint8_t full[16*9];\
1074
+    uint8_t halfH[72];\
1075
+    uint8_t halfV[64];\
1076
+    uint8_t halfHV[64];\
1077 1077
     copy_block9(full, src, 16, stride, 9);\
1078 1078
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1079 1079
     put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
1080 1080
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1081 1081
     OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
1082 1082
 }\
1083
-static void OPNAME ## qpel8_mc12_c(UINT8 *dst, UINT8 *src, int stride){\
1084
-    UINT8 full[16*9];\
1085
-    UINT8 halfH[72];\
1083
+static void OPNAME ## qpel8_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
1084
+    uint8_t full[16*9];\
1085
+    uint8_t halfH[72];\
1086 1086
     copy_block9(full, src, 16, stride, 9);\
1087 1087
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1088 1088
     put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
1089 1089
     OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
1090 1090
 }\
1091
-void ff_ ## OPNAME ## qpel8_mc32_old_c(UINT8 *dst, UINT8 *src, int stride){\
1092
-    UINT8 full[16*9];\
1093
-    UINT8 halfH[72];\
1094
-    UINT8 halfV[64];\
1095
-    UINT8 halfHV[64];\
1091
+void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
1092
+    uint8_t full[16*9];\
1093
+    uint8_t halfH[72];\
1094
+    uint8_t halfV[64];\
1095
+    uint8_t halfHV[64];\
1096 1096
     copy_block9(full, src, 16, stride, 9);\
1097 1097
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1098 1098
     put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
1099 1099
     put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
1100 1100
     OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
1101 1101
 }\
1102
-static void OPNAME ## qpel8_mc32_c(UINT8 *dst, UINT8 *src, int stride){\
1103
-    UINT8 full[16*9];\
1104
-    UINT8 halfH[72];\
1102
+static void OPNAME ## qpel8_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
1103
+    uint8_t full[16*9];\
1104
+    uint8_t halfH[72];\
1105 1105
     copy_block9(full, src, 16, stride, 9);\
1106 1106
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
1107 1107
     put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
1108 1108
     OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
1109 1109
 }\
1110
-static void OPNAME ## qpel8_mc22_c(UINT8 *dst, UINT8 *src, int stride){\
1111
-    UINT8 halfH[72];\
1110
+static void OPNAME ## qpel8_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
1111
+    uint8_t halfH[72];\
1112 1112
     put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
1113 1113
     OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
1114 1114
 }\
1115
-static void OPNAME ## qpel16_mc00_c (UINT8 *dst, UINT8 *src, int stride){\
1115
+static void OPNAME ## qpel16_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
1116 1116
     OPNAME ## pixels16_c(dst, src, stride, 16);\
1117 1117
 }\
1118 1118
 \
1119
-static void OPNAME ## qpel16_mc10_c(UINT8 *dst, UINT8 *src, int stride){\
1120
-    UINT8 half[256];\
1119
+static void OPNAME ## qpel16_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
1120
+    uint8_t half[256];\
1121 1121
     put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
1122 1122
     OPNAME ## pixels16_l2(dst, src, half, stride, stride, 16, 16);\
1123 1123
 }\
1124 1124
 \
1125
-static void OPNAME ## qpel16_mc20_c(UINT8 *dst, UINT8 *src, int stride){\
1125
+static void OPNAME ## qpel16_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
1126 1126
     OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16);\
1127 1127
 }\
1128 1128
 \
1129
-static void OPNAME ## qpel16_mc30_c(UINT8 *dst, UINT8 *src, int stride){\
1130
-    UINT8 half[256];\
1129
+static void OPNAME ## qpel16_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
1130
+    uint8_t half[256];\
1131 1131
     put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
1132 1132
     OPNAME ## pixels16_l2(dst, src+1, half, stride, stride, 16, 16);\
1133 1133
 }\
1134 1134
 \
1135
-static void OPNAME ## qpel16_mc01_c(UINT8 *dst, UINT8 *src, int stride){\
1136
-    UINT8 full[24*17];\
1137
-    UINT8 half[256];\
1135
+static void OPNAME ## qpel16_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
1136
+    uint8_t full[24*17];\
1137
+    uint8_t half[256];\
1138 1138
     copy_block17(full, src, 24, stride, 17);\
1139 1139
     put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
1140 1140
     OPNAME ## pixels16_l2(dst, full, half, stride, 24, 16, 16);\
1141 1141
 }\
1142 1142
 \
1143
-static void OPNAME ## qpel16_mc02_c(UINT8 *dst, UINT8 *src, int stride){\
1144
-    UINT8 full[24*17];\
1143
+static void OPNAME ## qpel16_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
1144
+    uint8_t full[24*17];\
1145 1145
     copy_block17(full, src, 24, stride, 17);\
1146 1146
     OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24);\
1147 1147
 }\
1148 1148
 \
1149
-static void OPNAME ## qpel16_mc03_c(UINT8 *dst, UINT8 *src, int stride){\
1150
-    UINT8 full[24*17];\
1151
-    UINT8 half[256];\
1149
+static void OPNAME ## qpel16_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
1150
+    uint8_t full[24*17];\
1151
+    uint8_t half[256];\
1152 1152
     copy_block17(full, src, 24, stride, 17);\
1153 1153
     put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
1154 1154
     OPNAME ## pixels16_l2(dst, full+24, half, stride, 24, 16, 16);\
1155 1155
 }\
1156
-void ff_ ## OPNAME ## qpel16_mc11_old_c(UINT8 *dst, UINT8 *src, int stride){\
1157
-    UINT8 full[24*17];\
1158
-    UINT8 halfH[272];\
1159
-    UINT8 halfV[256];\
1160
-    UINT8 halfHV[256];\
1156
+void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
1157
+    uint8_t full[24*17];\
1158
+    uint8_t halfH[272];\
1159
+    uint8_t halfV[256];\
1160
+    uint8_t halfHV[256];\
1161 1161
     copy_block17(full, src, 24, stride, 17);\
1162 1162
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1163 1163
     put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
1164 1164
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1165 1165
     OPNAME ## pixels16_l4(dst, full, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1166 1166
 }\
1167
-static void OPNAME ## qpel16_mc11_c(UINT8 *dst, UINT8 *src, int stride){\
1168
-    UINT8 full[24*17];\
1169
-    UINT8 halfH[272];\
1170
-    UINT8 halfHV[256];\
1167
+static void OPNAME ## qpel16_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
1168
+    uint8_t full[24*17];\
1169
+    uint8_t halfH[272];\
1170
+    uint8_t halfHV[256];\
1171 1171
     copy_block17(full, src, 24, stride, 17);\
1172 1172
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1173 1173
     put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
1174 1174
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1175 1175
     OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
1176 1176
 }\
1177
-void ff_ ## OPNAME ## qpel16_mc31_old_c(UINT8 *dst, UINT8 *src, int stride){\
1178
-    UINT8 full[24*17];\
1179
-    UINT8 halfH[272];\
1180
-    UINT8 halfV[256];\
1181
-    UINT8 halfHV[256];\
1177
+void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
1178
+    uint8_t full[24*17];\
1179
+    uint8_t halfH[272];\
1180
+    uint8_t halfV[256];\
1181
+    uint8_t halfHV[256];\
1182 1182
     copy_block17(full, src, 24, stride, 17);\
1183 1183
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1184 1184
     put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
1185 1185
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1186 1186
     OPNAME ## pixels16_l4(dst, full+1, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1187 1187
 }\
1188
-static void OPNAME ## qpel16_mc31_c(UINT8 *dst, UINT8 *src, int stride){\
1189
-    UINT8 full[24*17];\
1190
-    UINT8 halfH[272];\
1191
-    UINT8 halfHV[256];\
1188
+static void OPNAME ## qpel16_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
1189
+    uint8_t full[24*17];\
1190
+    uint8_t halfH[272];\
1191
+    uint8_t halfHV[256];\
1192 1192
     copy_block17(full, src, 24, stride, 17);\
1193 1193
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1194 1194
     put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
1195 1195
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1196 1196
     OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
1197 1197
 }\
1198
-void ff_ ## OPNAME ## qpel16_mc13_old_c(UINT8 *dst, UINT8 *src, int stride){\
1199
-    UINT8 full[24*17];\
1200
-    UINT8 halfH[272];\
1201
-    UINT8 halfV[256];\
1202
-    UINT8 halfHV[256];\
1198
+void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
1199
+    uint8_t full[24*17];\
1200
+    uint8_t halfH[272];\
1201
+    uint8_t halfV[256];\
1202
+    uint8_t halfHV[256];\
1203 1203
     copy_block17(full, src, 24, stride, 17);\
1204 1204
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1205 1205
     put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
1206 1206
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1207 1207
     OPNAME ## pixels16_l4(dst, full+24, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1208 1208
 }\
1209
-static void OPNAME ## qpel16_mc13_c(UINT8 *dst, UINT8 *src, int stride){\
1210
-    UINT8 full[24*17];\
1211
-    UINT8 halfH[272];\
1212
-    UINT8 halfHV[256];\
1209
+static void OPNAME ## qpel16_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
1210
+    uint8_t full[24*17];\
1211
+    uint8_t halfH[272];\
1212
+    uint8_t halfHV[256];\
1213 1213
     copy_block17(full, src, 24, stride, 17);\
1214 1214
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1215 1215
     put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
1216 1216
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1217 1217
     OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
1218 1218
 }\
1219
-void ff_ ## OPNAME ## qpel16_mc33_old_c(UINT8 *dst, UINT8 *src, int stride){\
1220
-    UINT8 full[24*17];\
1221
-    UINT8 halfH[272];\
1222
-    UINT8 halfV[256];\
1223
-    UINT8 halfHV[256];\
1219
+void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
1220
+    uint8_t full[24*17];\
1221
+    uint8_t halfH[272];\
1222
+    uint8_t halfV[256];\
1223
+    uint8_t halfHV[256];\
1224 1224
     copy_block17(full, src, 24, stride, 17);\
1225 1225
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full  , 16, 24, 17);\
1226 1226
     put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
1227 1227
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1228 1228
     OPNAME ## pixels16_l4(dst, full+25, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
1229 1229
 }\
1230
-static void OPNAME ## qpel16_mc33_c(UINT8 *dst, UINT8 *src, int stride){\
1231
-    UINT8 full[24*17];\
1232
-    UINT8 halfH[272];\
1233
-    UINT8 halfHV[256];\
1230
+static void OPNAME ## qpel16_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
1231
+    uint8_t full[24*17];\
1232
+    uint8_t halfH[272];\
1233
+    uint8_t halfHV[256];\
1234 1234
     copy_block17(full, src, 24, stride, 17);\
1235 1235
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1236 1236
     put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
1237 1237
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1238 1238
     OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
1239 1239
 }\
1240
-static void OPNAME ## qpel16_mc21_c(UINT8 *dst, UINT8 *src, int stride){\
1241
-    UINT8 halfH[272];\
1242
-    UINT8 halfHV[256];\
1240
+static void OPNAME ## qpel16_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
1241
+    uint8_t halfH[272];\
1242
+    uint8_t halfHV[256];\
1243 1243
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
1244 1244
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1245 1245
     OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
1246 1246
 }\
1247
-static void OPNAME ## qpel16_mc23_c(UINT8 *dst, UINT8 *src, int stride){\
1248
-    UINT8 halfH[272];\
1249
-    UINT8 halfHV[256];\
1247
+static void OPNAME ## qpel16_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
1248
+    uint8_t halfH[272];\
1249
+    uint8_t halfHV[256];\
1250 1250
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
1251 1251
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1252 1252
     OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
1253 1253
 }\
1254
-void ff_ ## OPNAME ## qpel16_mc12_old_c(UINT8 *dst, UINT8 *src, int stride){\
1255
-    UINT8 full[24*17];\
1256
-    UINT8 halfH[272];\
1257
-    UINT8 halfV[256];\
1258
-    UINT8 halfHV[256];\
1254
+void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
1255
+    uint8_t full[24*17];\
1256
+    uint8_t halfH[272];\
1257
+    uint8_t halfV[256];\
1258
+    uint8_t halfHV[256];\
1259 1259
     copy_block17(full, src, 24, stride, 17);\
1260 1260
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1261 1261
     put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
1262 1262
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1263 1263
     OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
1264 1264
 }\
1265
-static void OPNAME ## qpel16_mc12_c(UINT8 *dst, UINT8 *src, int stride){\
1266
-    UINT8 full[24*17];\
1267
-    UINT8 halfH[272];\
1265
+static void OPNAME ## qpel16_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
1266
+    uint8_t full[24*17];\
1267
+    uint8_t halfH[272];\
1268 1268
     copy_block17(full, src, 24, stride, 17);\
1269 1269
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1270 1270
     put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
1271 1271
     OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
1272 1272
 }\
1273
-void ff_ ## OPNAME ## qpel16_mc32_old_c(UINT8 *dst, UINT8 *src, int stride){\
1274
-    UINT8 full[24*17];\
1275
-    UINT8 halfH[272];\
1276
-    UINT8 halfV[256];\
1277
-    UINT8 halfHV[256];\
1273
+void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
1274
+    uint8_t full[24*17];\
1275
+    uint8_t halfH[272];\
1276
+    uint8_t halfV[256];\
1277
+    uint8_t halfHV[256];\
1278 1278
     copy_block17(full, src, 24, stride, 17);\
1279 1279
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1280 1280
     put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
1281 1281
     put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
1282 1282
     OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
1283 1283
 }\
1284
-static void OPNAME ## qpel16_mc32_c(UINT8 *dst, UINT8 *src, int stride){\
1285
-    UINT8 full[24*17];\
1286
-    UINT8 halfH[272];\
1284
+static void OPNAME ## qpel16_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
1285
+    uint8_t full[24*17];\
1286
+    uint8_t halfH[272];\
1287 1287
     copy_block17(full, src, 24, stride, 17);\
1288 1288
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
1289 1289
     put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
1290 1290
     OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
1291 1291
 }\
1292
-static void OPNAME ## qpel16_mc22_c(UINT8 *dst, UINT8 *src, int stride){\
1293
-    UINT8 halfH[272];\
1292
+static void OPNAME ## qpel16_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
1293
+    uint8_t halfH[272];\
1294 1294
     put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
1295 1295
     OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
1296 1296
 }
... ...
@@ -1405,7 +1405,7 @@ static void put_mspel8_mc22_c(uint8_t *dst, uint8_t *src, int stride){
1405 1405
 }
1406 1406
 
1407 1407
 
1408
-static inline int pix_abs16x16_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1408
+static inline int pix_abs16x16_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1409 1409
 {
1410 1410
     int s, i;
1411 1411
 
... ...
@@ -1433,7 +1433,7 @@ static inline int pix_abs16x16_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1433 1433
     return s;
1434 1434
 }
1435 1435
 
1436
-static int pix_abs16x16_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1436
+static int pix_abs16x16_x2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1437 1437
 {
1438 1438
     int s, i;
1439 1439
 
... ...
@@ -1461,10 +1461,10 @@ static int pix_abs16x16_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1461 1461
     return s;
1462 1462
 }
1463 1463
 
1464
-static int pix_abs16x16_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1464
+static int pix_abs16x16_y2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1465 1465
 {
1466 1466
     int s, i;
1467
-    UINT8 *pix3 = pix2 + line_size;
1467
+    uint8_t *pix3 = pix2 + line_size;
1468 1468
 
1469 1469
     s = 0;
1470 1470
     for(i=0;i<16;i++) {
... ...
@@ -1491,10 +1491,10 @@ static int pix_abs16x16_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1491 1491
     return s;
1492 1492
 }
1493 1493
 
1494
-static int pix_abs16x16_xy2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1494
+static int pix_abs16x16_xy2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1495 1495
 {
1496 1496
     int s, i;
1497
-    UINT8 *pix3 = pix2 + line_size;
1497
+    uint8_t *pix3 = pix2 + line_size;
1498 1498
 
1499 1499
     s = 0;
1500 1500
     for(i=0;i<16;i++) {
... ...
@@ -1521,7 +1521,7 @@ static int pix_abs16x16_xy2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1521 1521
     return s;
1522 1522
 }
1523 1523
 
1524
-static inline int pix_abs8x8_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1524
+static inline int pix_abs8x8_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1525 1525
 {
1526 1526
     int s, i;
1527 1527
 
... ...
@@ -1541,7 +1541,7 @@ static inline int pix_abs8x8_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1541 1541
     return s;
1542 1542
 }
1543 1543
 
1544
-static int pix_abs8x8_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1544
+static int pix_abs8x8_x2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1545 1545
 {
1546 1546
     int s, i;
1547 1547
 
... ...
@@ -1561,10 +1561,10 @@ static int pix_abs8x8_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1561 1561
     return s;
1562 1562
 }
1563 1563
 
1564
-static int pix_abs8x8_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1564
+static int pix_abs8x8_y2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1565 1565
 {
1566 1566
     int s, i;
1567
-    UINT8 *pix3 = pix2 + line_size;
1567
+    uint8_t *pix3 = pix2 + line_size;
1568 1568
 
1569 1569
     s = 0;
1570 1570
     for(i=0;i<8;i++) {
... ...
@@ -1583,10 +1583,10 @@ static int pix_abs8x8_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1583 1583
     return s;
1584 1584
 }
1585 1585
 
1586
-static int pix_abs8x8_xy2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
1586
+static int pix_abs8x8_xy2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
1587 1587
 {
1588 1588
     int s, i;
1589
-    UINT8 *pix3 = pix2 + line_size;
1589
+    uint8_t *pix3 = pix2 + line_size;
1590 1590
 
1591 1591
     s = 0;
1592 1592
     for(i=0;i<8;i++) {
... ...
@@ -1613,7 +1613,7 @@ static int sad8x8_c(void *s, uint8_t *a, uint8_t *b, int stride){
1613 1613
     return pix_abs8x8_c(a,b,stride);
1614 1614
 }
1615 1615
 
1616
-void ff_block_permute(DCTELEM *block, UINT8 *permutation, const UINT8 *scantable, int last)
1616
+void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)
1617 1617
 {
1618 1618
     int i;
1619 1619
     DCTELEM temp[64];
... ...
@@ -1822,7 +1822,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s
1822 1822
 
1823 1823
 static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){
1824 1824
     MpegEncContext * const s= (MpegEncContext *)c;
1825
-    const UINT8 *scantable= s->intra_scantable.permutated;
1825
+    const uint8_t *scantable= s->intra_scantable.permutated;
1826 1826
     uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
1827 1827
     uint64_t __align8 aligned_bak[stride];
1828 1828
     DCTELEM * const temp= (DCTELEM*)aligned_temp;
... ...
@@ -1896,7 +1896,7 @@ static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int
1896 1896
 
1897 1897
 static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){
1898 1898
     MpegEncContext * const s= (MpegEncContext *)c;
1899
-    const UINT8 *scantable= s->intra_scantable.permutated;
1899
+    const uint8_t *scantable= s->intra_scantable.permutated;
1900 1900
     uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
1901 1901
     DCTELEM * const temp= (DCTELEM*)aligned_temp;
1902 1902
     int i, last, run, bits, level, start_i;
... ...
@@ -35,16 +35,16 @@ void j_rev_dct (DCTELEM *data);
35 35
 void ff_fdct_mmx(DCTELEM *block);
36 36
 
37 37
 /* encoding scans */
38
-extern const UINT8 ff_alternate_horizontal_scan[64];
39
-extern const UINT8 ff_alternate_vertical_scan[64];
40
-extern const UINT8 ff_zigzag_direct[64];
38
+extern const uint8_t ff_alternate_horizontal_scan[64];
39
+extern const uint8_t ff_alternate_vertical_scan[64];
40
+extern const uint8_t ff_zigzag_direct[64];
41 41
 
42 42
 /* pixel operations */
43 43
 #define MAX_NEG_CROP 384
44 44
 
45 45
 /* temporary */
46
-extern UINT32 squareTbl[512];
47
-extern UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
46
+extern uint32_t squareTbl[512];
47
+extern uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
48 48
 
49 49
 
50 50
 /* minimum alignment rules ;)
... ...
@@ -58,22 +58,22 @@ i (michael) didnt check them, these are just the alignents which i think could b
58 58
 */
59 59
 
60 60
 /*
61
-void get_pixels_c(DCTELEM *block, const UINT8 *pixels, int line_size);
62
-void diff_pixels_c(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride);
63
-void put_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
64
-void add_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
61
+void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);
62
+void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
63
+void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
64
+void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
65 65
 void clear_blocks_c(DCTELEM *blocks);
66 66
 */
67 67
 
68 68
 /* add and put pixel (decoding) */
69 69
 // blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
70
-typedef void (*op_pixels_func)(UINT8 *block/*align width (8 or 16)*/, const UINT8 *pixels/*align 1*/, int line_size, int h);
71
-typedef void (*qpel_mc_func)(UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);
70
+typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
71
+typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
72 72
 
73 73
 #define DEF_OLD_QPEL(name)\
74
-void ff_put_        ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);\
75
-void ff_put_no_rnd_ ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);\
76
-void ff_avg_        ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);
74
+void ff_put_        ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
75
+void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
76
+void ff_avg_        ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
77 77
 
78 78
 DEF_OLD_QPEL(qpel16_mc11_old_c)
79 79
 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){\
96 96
 
97 97
 /* motion estimation */
98 98
 
99
-typedef int (*op_pixels_abs_func)(UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
99
+typedef int (*op_pixels_abs_func)(uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
100 100
 
101
-typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
101
+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))*/;
102 102
 
103 103
 typedef struct DSPContext {
104 104
     /* pixel ops : interface with DCT */
105
-    void (*get_pixels)(DCTELEM *block/*align 16*/, const UINT8 *pixels/*align 8*/, int line_size);
106
-    void (*diff_pixels)(DCTELEM *block/*align 16*/, const UINT8 *s1/*align 8*/, const UINT8 *s2/*align 8*/, int stride);
107
-    void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
108
-    void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
109
-    void (*gmc1)(UINT8 *dst/*align 8*/, UINT8 *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
110
-    void (*gmc )(UINT8 *dst/*align 8*/, UINT8 *src/*align 1*/, int stride, int h, int ox, int oy,
105
+    void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
106
+    void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
107
+    void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
108
+    void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
109
+    void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
110
+    void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
111 111
 		    int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
112 112
     void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
113
-    int (*pix_sum)(UINT8 * pix, int line_size);
114
-    int (*pix_norm1)(UINT8 * pix, int line_size);
113
+    int (*pix_sum)(uint8_t * pix, int line_size);
114
+    int (*pix_norm1)(uint8_t * pix, int line_size);
115 115
     me_cmp_func sad[2]; /* identical to pix_absAxA except additional void * */
116 116
     me_cmp_func sse[2];
117 117
     me_cmp_func hadamard8_diff[2];
... ...
@@ -157,7 +157,7 @@ void dsputil_init(DSPContext* p, unsigned mask);
157 157
  * permute block according to permuatation.
158 158
  * @param last last non zero element in scantable order
159 159
  */
160
-void ff_block_permute(DCTELEM *block, UINT8 *permutation, const UINT8 *scantable, int last);
160
+void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
161 161
 
162 162
 #define emms_c()
163 163
 
... ...
@@ -177,8 +177,8 @@ int mm_support(void);
177 177
 
178 178
 extern int mm_flags;
179 179
 
180
-void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size);
181
-void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size);
180
+void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
181
+void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
182 182
 
183 183
 static inline void emms(void)
184 184
 {
... ...
@@ -264,7 +264,7 @@ struct unaligned_32 { uint32_t l; } __attribute__((packed));
264 264
 #endif /* !__GNUC__ */
265 265
 
266 266
 /* PSNR */
267
-void get_psnr(UINT8 *orig_image[3], UINT8 *coded_image[3],
267
+void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
268 268
               int orig_linesize[3], int coded_linesize,
269 269
               AVCodecContext *avctx);
270 270
 
... ...
@@ -32,15 +32,15 @@ typedef struct DVVideoDecodeContext {
32 32
     VLC *vlc;
33 33
     int sampling_411; /* 0 = 420, 1 = 411 */
34 34
     int width, height;
35
-    UINT8 *current_picture[3]; /* picture structure */
35
+    uint8_t *current_picture[3]; /* picture structure */
36 36
     AVFrame picture;
37 37
     int linesize[3];
38 38
     DCTELEM block[5*6][64] __align8;
39
-    UINT8 dv_zigzag[2][64];
40
-    UINT8 idct_permutation[64];
39
+    uint8_t dv_zigzag[2][64];
40
+    uint8_t idct_permutation[64];
41 41
     /* XXX: move it to static storage ? */
42
-    UINT8 dv_shift[2][22][64];
43
-    void (*idct_put[2])(UINT8 *dest, int line_size, DCTELEM *block);
42
+    uint8_t dv_shift[2][22][64];
43
+    void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block);
44 44
 } DVVideoDecodeContext;
45 45
 
46 46
 #include "dvdata.h"
... ...
@@ -136,18 +136,18 @@ static int dvvideo_decode_init(AVCodecContext *avctx)
136 136
 //#define VLC_DEBUG
137 137
 
138 138
 typedef struct BlockInfo {
139
-    const UINT8 *shift_table;
140
-    const UINT8 *scan_table;
141
-    UINT8 pos; /* position in block */
142
-    UINT8 eob_reached; /* true if EOB has been reached */
143
-    UINT8 dct_mode;
144
-    UINT8 partial_bit_count;
145
-    UINT16 partial_bit_buffer;
139
+    const uint8_t *shift_table;
140
+    const uint8_t *scan_table;
141
+    uint8_t pos; /* position in block */
142
+    uint8_t eob_reached; /* true if EOB has been reached */
143
+    uint8_t dct_mode;
144
+    uint8_t partial_bit_count;
145
+    uint16_t partial_bit_buffer;
146 146
     int shift_offset;
147 147
 } BlockInfo;
148 148
 
149 149
 /* block size in bits */
150
-static const UINT16 block_sizes[6] = {
150
+static const uint16_t block_sizes[6] = {
151 151
     112, 112, 112, 112, 80, 80
152 152
 };
153 153
 
... ...
@@ -161,8 +161,8 @@ static void dv_decode_ac(DVVideoDecodeContext *s,
161 161
 {
162 162
     int last_re_index;
163 163
     int shift_offset = mb->shift_offset;
164
-    const UINT8 *scan_table = mb->scan_table;
165
-    const UINT8 *shift_table = mb->shift_table;
164
+    const uint8_t *scan_table = mb->scan_table;
165
+    const uint8_t *shift_table = mb->shift_table;
166 166
     int pos = mb->pos;
167 167
     int level, pos1, sign, run;
168 168
     int partial_bit_count;
... ...
@@ -176,8 +176,8 @@ static void dv_decode_ac(DVVideoDecodeContext *s,
176 176
     /* if we must parse a partial vlc, we do it here */
177 177
     partial_bit_count = mb->partial_bit_count;
178 178
     if (partial_bit_count > 0) {
179
-        UINT8 buf[4];
180
-        UINT32 v;
179
+        uint8_t buf[4];
180
+        uint32_t v;
181 181
         int l, l1;
182 182
         GetBitContext gb1;
183 183
 
... ...
@@ -298,21 +298,21 @@ static inline void bit_copy(PutBitContext *pb, GetBitContext *gb, int bits_left)
298 298
 
299 299
 /* mb_x and mb_y are in units of 8 pixels */
300 300
 static inline void dv_decode_video_segment(DVVideoDecodeContext *s, 
301
-                                           UINT8 *buf_ptr1, 
302
-                                           const UINT16 *mb_pos_ptr)
301
+                                           uint8_t *buf_ptr1, 
302
+                                           const uint16_t *mb_pos_ptr)
303 303
 {
304 304
     int quant, dc, dct_mode, class1, j;
305 305
     int mb_index, mb_x, mb_y, v, last_index;
306 306
     DCTELEM *block, *block1;
307 307
     int c_offset, bits_left;
308
-    UINT8 *y_ptr;
308
+    uint8_t *y_ptr;
309 309
     BlockInfo mb_data[5 * 6], *mb, *mb1;
310
-    void (*idct_put)(UINT8 *dest, int line_size, DCTELEM *block);
311
-    UINT8 *buf_ptr;
310
+    void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block);
311
+    uint8_t *buf_ptr;
312 312
     PutBitContext pb, vs_pb;
313
-    UINT8 mb_bit_buffer[80 + 4]; /* allow some slack */
313
+    uint8_t mb_bit_buffer[80 + 4]; /* allow some slack */
314 314
     int mb_bit_count;
315
-    UINT8 vs_bit_buffer[5 * 80 + 4]; /* allow some slack */
315
+    uint8_t vs_bit_buffer[5 * 80 + 4]; /* allow some slack */
316 316
     int vs_bit_count;
317 317
     
318 318
     memset(s->block, 0, sizeof(s->block));
... ...
@@ -493,12 +493,12 @@ static inline void dv_decode_video_segment(DVVideoDecodeContext *s,
493 493
    144000 bytes for PAL) */
494 494
 static int dvvideo_decode_frame(AVCodecContext *avctx, 
495 495
                                  void *data, int *data_size,
496
-                                 UINT8 *buf, int buf_size)
496
+                                 uint8_t *buf, int buf_size)
497 497
 {
498 498
     DVVideoDecodeContext *s = avctx->priv_data;
499 499
     int sct, dsf, apt, ds, nb_dif_segs, vs, width, height, i, packet_size;
500
-    UINT8 *buf_ptr;
501
-    const UINT16 *mb_pos_ptr;
500
+    uint8_t *buf_ptr;
501
+    const uint16_t *mb_pos_ptr;
502 502
     
503 503
     /* parse id */
504 504
     init_get_bits(&s->gb, buf, buf_size*8);
... ...
@@ -642,9 +642,9 @@ static int dvaudio_decode_init(AVCodecContext *avctx)
642 642
     return 0;
643 643
 }
644 644
 
645
-static UINT16 dv_audio_12to16(UINT16 sample)
645
+static uint16_t dv_audio_12to16(uint16_t sample)
646 646
 {
647
-    UINT16 shift, result;
647
+    uint16_t shift, result;
648 648
     
649 649
     sample = (sample < 0x800) ? sample : sample | 0xf000;
650 650
     shift = (sample & 0xf00) >> 8;
... ...
@@ -676,13 +676,13 @@ static UINT16 dv_audio_12to16(UINT16 sample)
676 676
 */
677 677
 static int dvaudio_decode_frame(AVCodecContext *avctx, 
678 678
                                  void *data, int *data_size,
679
-                                 UINT8 *buf, int buf_size)
679
+                                 uint8_t *buf, int buf_size)
680 680
 {
681 681
     DVVideoDecodeContext *s = avctx->priv_data;
682
-    const UINT16 (*unshuffle)[9];
682
+    const uint16_t (*unshuffle)[9];
683 683
     int smpls, freq, quant, sys, stride, difseg, ad, dp, nb_dif_segs, i;
684
-    UINT16 lc, rc;
685
-    UINT8 *buf_ptr;
684
+    uint16_t lc, rc;
685
+    uint8_t *buf_ptr;
686 686
     
687 687
     /* parse id */
688 688
     init_get_bits(&s->gb, &buf[AAUX_OFFSET], 5*8);
... ...
@@ -742,10 +742,10 @@ static int dvaudio_decode_frame(AVCodecContext *avctx,
742 742
 		       if (difseg >= nb_dif_segs/2)
743 743
 			   goto out;  /* We're not doing 4ch at this time */
744 744
 		       
745
-		       lc = ((UINT16)buf_ptr[dp] << 4) | 
746
-			    ((UINT16)buf_ptr[dp+2] >> 4);
747
-		       rc = ((UINT16)buf_ptr[dp+1] << 4) |
748
-			    ((UINT16)buf_ptr[dp+2] & 0x0f);
745
+		       lc = ((uint16_t)buf_ptr[dp] << 4) | 
746
+			    ((uint16_t)buf_ptr[dp+2] >> 4);
747
+		       rc = ((uint16_t)buf_ptr[dp+1] << 4) |
748
+			    ((uint16_t)buf_ptr[dp+2] & 0x0f);
749 749
 		       lc = dv_audio_12to16(lc);
750 750
 		       rc = dv_audio_12to16(rc);
751 751
 
... ...
@@ -20,7 +20,7 @@
20 20
 #define NB_DV_VLC 409
21 21
 #define AAUX_OFFSET (80*6 + 80*16*3 + 3)
22 22
 
23
-static const UINT16 dv_vlc_bits[409] = {
23
+static const uint16_t dv_vlc_bits[409] = {
24 24
  0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
25 25
  0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a,
26 26
  0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2,
... ...
@@ -75,7 +75,7 @@ static const UINT16 dv_vlc_bits[409] = {
75 75
  0x0006,
76 76
 };
77 77
 
78
-static const UINT8 dv_vlc_len[409] = {
78
+static const uint8_t dv_vlc_len[409] = {
79 79
   2,  3,  4,  4,  4,  5,  5,  5,
80 80
   5,  6,  6,  6,  6,  7,  7,  7,
81 81
   7,  7,  7,  7,  7,  8,  8,  8,
... ...
@@ -130,7 +130,7 @@ static const UINT8 dv_vlc_len[409] = {
130 130
   4,
131 131
 };
132 132
 
133
-static const UINT8 dv_vlc_run[409] = {
133
+static const uint8_t dv_vlc_run[409] = {
134 134
   0,  0,  1,  0,  0,  2,  1,  0,
135 135
   0,  3,  4,  0,  0,  5,  6,  2,
136 136
   1,  1,  0,  0,  0,  7,  8,  9,
... ...
@@ -185,7 +185,7 @@ static const UINT8 dv_vlc_run[409] = {
185 185
   0,
186 186
 };
187 187
 
188
-static const UINT8 dv_vlc_level[409] = {
188
+static const uint8_t dv_vlc_level[409] = {
189 189
   1,  2,  1,  3,  4,  1,  2,  5,
190 190
   6,  1,  1,  7,  8,  1,  1,  2,
191 191
   3,  4,  9, 10, 11,  1,  1,  1,
... ...
@@ -242,7 +242,7 @@ static const UINT8 dv_vlc_level[409] = {
242 242
 
243 243
 /* Specific zigzag scan for 248 idct. NOTE that unlike the
244 244
    specification, we interleave the fields */
245
-static const UINT8 dv_248_zigzag[64] = {
245
+static const uint8_t dv_248_zigzag[64] = {
246 246
   0,  8,  1,  9, 16, 24,  2, 10,
247 247
  17, 25, 32, 40, 48, 56, 33, 41,
248 248
  18, 26,  3, 11,  4, 12, 19, 27,
... ...
@@ -254,7 +254,7 @@ static const UINT8 dv_248_zigzag[64] = {
254 254
 };
255 255
 
256 256
 /* unquant tables (not used directly) */
257
-static const UINT8 dv_88_areas[64] = {
257
+static const uint8_t dv_88_areas[64] = {
258 258
     0,0,0,1,1,1,2,2,
259 259
     0,0,1,1,1,2,2,2,
260 260
     0,1,1,1,2,2,2,3,
... ...
@@ -265,7 +265,7 @@ static const UINT8 dv_88_areas[64] = {
265 265
     2,2,3,3,3,3,3,3,
266 266
 };
267 267
 
268
-static const UINT8 dv_248_areas[64] = {
268
+static const uint8_t dv_248_areas[64] = {
269 269
     0,0,1,1,1,2,2,3,
270 270
     0,0,1,1,2,2,2,3,
271 271
     0,1,1,2,2,2,3,3,
... ...
@@ -276,7 +276,7 @@ static const UINT8 dv_248_areas[64] = {
276 276
     1,2,2,3,3,3,3,3,
277 277
 };
278 278
 
279
-static UINT8 dv_quant_shifts[22][4] = {
279
+static uint8_t dv_quant_shifts[22][4] = {
280 280
   { 3,3,4,4 }, 
281 281
   { 3,3,4,4 }, 
282 282
   { 2,3,3,4 }, 
... ...
@@ -301,12 +301,12 @@ static UINT8 dv_quant_shifts[22][4] = {
301 301
   { 0,0,0,0 },
302 302
 };
303 303
 
304
-static const UINT8 dv_quant_offset[4] = { 6, 3, 0, 1 };
304
+static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 };
305 305
 
306 306
 /* NOTE: I prefer hardcoding the positionning of dv blocks, it is
307 307
    simpler :-) */
308 308
 
309
-static const UINT16 dv_place_420[1620] = {
309
+static const uint16_t dv_place_420[1620] = {
310 310
  0x0c24, 0x2412, 0x3036, 0x0000, 0x1848,
311 311
  0x0e24, 0x2612, 0x3236, 0x0200, 0x1a48,
312 312
  0x1024, 0x2812, 0x3436, 0x0400, 0x1c48,
... ...
@@ -633,7 +633,7 @@ static const UINT16 dv_place_420[1620] = {
633 633
  0x0a34, 0x2222, 0x2e46, 0x4610, 0x1658,
634 634
 };
635 635
 
636
-static const UINT16 dv_place_411[1350] = {
636
+static const uint16_t dv_place_411[1350] = {
637 637
  0x0c24, 0x2710, 0x3334, 0x0000, 0x1848,
638 638
  0x0d24, 0x2810, 0x3434, 0x0100, 0x1948,
639 639
  0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48,
... ...
@@ -906,7 +906,7 @@ static const UINT16 dv_place_411[1350] = {
906 906
  0x0834, 0x2320, 0x2f44, 0x3810, 0x1658,
907 907
 };
908 908
 
909
-static const UINT16 dv_place_audio60[10][9] = {
909
+static const uint16_t dv_place_audio60[10][9] = {
910 910
   {  0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
911 911
   {  6, 36, 66, 26, 56, 86, 16, 46, 76 },
912 912
   { 12, 42, 72,  2, 32, 62, 22, 52, 82 },
... ...
@@ -920,7 +920,7 @@ static const UINT16 dv_place_audio60[10][9] = {
920 920
   { 25, 55, 85, 15, 45, 75,  5, 35, 65 },
921 921
 };
922 922
 
923
-static const UINT16 dv_place_audio50[12][9] = {
923
+static const uint16_t dv_place_audio50[12][9] = {
924 924
   {   0,  36,  72,  26,  62,  98,  16,  52,  88}, /* 1st channel */
925 925
   {   6,  42,  78,  32,  68, 104,  22,  58,  94},
926 926
   {  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
54 54
     }
55 55
 }
56 56
 
57
-static void filter181(INT16 *data, int width, int height, int stride){
57
+static void filter181(int16_t *data, int width, int height, int stride){
58 58
     int x,y;
59 59
 
60 60
     /* horizontal filter */
... ...
@@ -95,7 +95,7 @@ static void filter181(INT16 *data, int width, int height, int stride){
95 95
  * @param w	width in 8 pixel blocks
96 96
  * @param h	height in 8 pixel blocks
97 97
  */
98
-static void guess_dc(MpegEncContext *s, INT16 *dc, int w, int h, int stride, int is_luma){
98
+static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma){
99 99
     int b_x, b_y;
100 100
 
101 101
     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
103 103
             int color[4]={1024,1024,1024,1024};
104 104
             int distance[4]={9999,9999,9999,9999};
105 105
             int mb_index, error, j;
106
-            INT64 guess, weight_sum;
106
+            int64_t guess, weight_sum;
107 107
             
108 108
             mb_index= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_width;
109 109
             
... ...
@@ -163,8 +163,8 @@ static void guess_dc(MpegEncContext *s, INT16 *dc, int w, int h, int stride, int
163 163
             weight_sum=0;
164 164
             guess=0;
165 165
             for(j=0; j<4; j++){
166
-                INT64 weight= 256*256*256*16/distance[j];
167
-                guess+= weight*(INT64)color[j];
166
+                int64_t weight= 256*256*256*16/distance[j];
167
+                guess+= weight*(int64_t)color[j];
168 168
                 weight_sum+= weight;
169 169
             }
170 170
             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
179 179
  * @param w	width in 8 pixel blocks
180 180
  * @param h	height in 8 pixel blocks
181 181
  */
182
-static void h_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stride, int is_luma){
182
+static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
183 183
     int b_x, b_y;
184
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;
184
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
185 185
 
186 186
     for(b_y=0; b_y<h; b_y++){
187 187
         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
193 193
             int left_damage =  left_status&(DC_ERROR|AC_ERROR|MV_ERROR);
194 194
             int right_damage= right_status&(DC_ERROR|AC_ERROR|MV_ERROR);
195 195
             int offset= b_x*8 + b_y*stride*8;
196
-            INT16 *left_mv=  s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ( b_x   <<(1-is_luma))];
197
-            INT16 *right_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ((b_x+1)<<(1-is_luma))];
196
+            int16_t *left_mv=  s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ( b_x   <<(1-is_luma))];
197
+            int16_t *right_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ((b_x+1)<<(1-is_luma))];
198 198
             
199 199
             if(!(left_damage||right_damage)) continue; // both undamaged
200 200
             
... ...
@@ -239,9 +239,9 @@ static void h_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri
239 239
  * @param w	width in 8 pixel blocks
240 240
  * @param h	height in 8 pixel blocks
241 241
  */
242
-static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stride, int is_luma){
242
+static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
243 243
     int b_x, b_y;
244
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;
244
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
245 245
 
246 246
     for(b_y=0; b_y<h-1; b_y++){
247 247
         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
253 253
             int top_damage =      top_status&(DC_ERROR|AC_ERROR|MV_ERROR);
254 254
             int bottom_damage= bottom_status&(DC_ERROR|AC_ERROR|MV_ERROR);
255 255
             int offset= b_x*8 + b_y*stride*8;
256
-            INT16 *top_mv=    s->motion_val[s->block_wrap[0]*(( b_y   <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
257
-            INT16 *bottom_mv= s->motion_val[s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
256
+            int16_t *top_mv=    s->motion_val[s->block_wrap[0]*(( b_y   <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
257
+            int16_t *bottom_mv= s->motion_val[s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
258 258
             
259 259
             if(!(top_damage||bottom_damage)) continue; // both undamaged
260 260
             
... ...
@@ -295,7 +295,7 @@ static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stri
295 295
 }
296 296
 
297 297
 static void guess_mv(MpegEncContext *s){
298
-    UINT8 fixed[s->mb_num];
298
+    uint8_t fixed[s->mb_num];
299 299
 #define MV_FROZEN    3
300 300
 #define MV_CHANGED   2
301 301
 #define MV_UNCHANGED 1
... ...
@@ -464,7 +464,7 @@ int score_sum=0;
464 464
                     s->mb_y= mb_y;
465 465
                     for(j=0; j<pred_count; j++){
466 466
                         int score=0;
467
-                        UINT8 *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
467
+                        uint8_t *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
468 468
 
469 469
                         s->motion_val[mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0];
470 470
                         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){
558 558
             if((j%skip_amount) != 0) continue; //skip a few to speed things up
559 559
     
560 560
             if(s->pict_type==I_TYPE){
561
-                UINT8 *mb_ptr     = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
562
-                UINT8 *last_mb_ptr= s->last_picture.data   [0] + mb_x*16 + mb_y*16*s->linesize;
561
+                uint8_t *mb_ptr     = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
562
+                uint8_t *last_mb_ptr= s->last_picture.data   [0] + mb_x*16 + mb_y*16*s->linesize;
563 563
     
564 564
 		is_intra_likely += s->dsp.pix_abs16x16(last_mb_ptr, mb_ptr                    , s->linesize);
565 565
                 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){
795 795
     for(mb_y=0; mb_y<s->mb_height; mb_y++){
796 796
         for(mb_x=0; mb_x<s->mb_width; mb_x++){
797 797
             int dc, dcu, dcv, y, n;
798
-            INT16 *dc_ptr;
799
-            UINT8 *dest_y, *dest_cb, *dest_cr;
798
+            int16_t *dc_ptr;
799
+            uint8_t *dest_y, *dest_cb, *dest_cr;
800 800
            
801 801
             i++;
802 802
             error= s->error_status_table[i];
... ...
@@ -846,7 +846,7 @@ void ff_error_resilience(MpegEncContext *s){
846 846
     i= -1;
847 847
     for(mb_y=0; mb_y<s->mb_height; mb_y++){
848 848
         for(mb_x=0; mb_x<s->mb_width; mb_x++){
849
-            UINT8 *dest_y, *dest_cb, *dest_cr;
849
+            uint8_t *dest_y, *dest_cb, *dest_cr;
850 850
            
851 851
             i++;
852 852
             error= s->error_status_table[i];
... ...
@@ -105,11 +105,11 @@ float frandom(void)
105 105
     return (float)((random() & 0xffff) - 32768) / 32768.0;
106 106
 }
107 107
 
108
-INT64 gettime(void)
108
+int64_t gettime(void)
109 109
 {
110 110
     struct timeval tv;
111 111
     gettimeofday(&tv,NULL);
112
-    return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
112
+    return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
113 113
 }
114 114
 
115 115
 void check_diff(float *tab1, float *tab2, int n)
... ...
@@ -233,7 +233,7 @@ int main(int argc, char **argv)
233 233
     /* do a speed test */
234 234
 
235 235
     if (do_speed) {
236
-        INT64 time_start, duration;
236
+        int64_t time_start, duration;
237 237
         int nb_its;
238 238
 
239 239
         printf("Speed test...\n");
... ...
@@ -61,7 +61,7 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block,
61 61
 static void h263_encode_motion(MpegEncContext * s, int val, int fcode);
62 62
 static void h263p_encode_umotion(MpegEncContext * s, int val);
63 63
 static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block,
64
-			       int n, int dc, UINT8 *scan_table, 
64
+			       int n, int dc, uint8_t *scan_table, 
65 65
                                PutBitContext *dc_pb, PutBitContext *ac_pb);
66 66
 #endif
67 67
 
... ...
@@ -72,23 +72,23 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
72 72
 static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
73 73
 static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
74 74
                               int n, int coded, int intra);
75
-static int h263_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr);
75
+static int h263_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr);
76 76
 static void mpeg4_inv_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
77 77
                               int dir);
78 78
 static void mpeg4_decode_sprite_trajectory(MpegEncContext * s);
79
-static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr, int *dir_ptr);
79
+static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr, int *dir_ptr);
80 80
 
81
-extern UINT32 inverse[256];
81
+extern uint32_t inverse[256];
82 82
 
83
-static UINT8 uni_DCtab_lum_len[512];
84
-static UINT8 uni_DCtab_chrom_len[512];
85
-static UINT16 uni_DCtab_lum_bits[512];
86
-static UINT16 uni_DCtab_chrom_bits[512];
83
+static uint8_t uni_DCtab_lum_len[512];
84
+static uint8_t uni_DCtab_chrom_len[512];
85
+static uint16_t uni_DCtab_lum_bits[512];
86
+static uint16_t uni_DCtab_chrom_bits[512];
87 87
 
88 88
 #ifdef CONFIG_ENCODERS
89
-static UINT16 (*mv_penalty)[MAX_MV*2+1]= NULL;
90
-static UINT8 fcode_tab[MAX_MV*2+1];
91
-static UINT8 umv_fcode_tab[MAX_MV*2+1];
89
+static uint16_t (*mv_penalty)[MAX_MV*2+1]= NULL;
90
+static uint8_t fcode_tab[MAX_MV*2+1];
91
+static uint8_t umv_fcode_tab[MAX_MV*2+1];
92 92
 
93 93
 static uint32_t uni_mpeg4_intra_rl_bits[64*64*2*2];
94 94
 static uint8_t  uni_mpeg4_intra_rl_len [64*64*2*2];
... ...
@@ -161,7 +161,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
161 161
     s->gob_number = 0;
162 162
 
163 163
     put_bits(&s->pb, 22, 0x20); /* PSC */
164
-    put_bits(&s->pb, 8, (((INT64)s->picture_number * 30 * FRAME_RATE_BASE) / 
164
+    put_bits(&s->pb, 8, (((int64_t)s->picture_number * 30 * FRAME_RATE_BASE) / 
165 165
                          s->frame_rate) & 0xff);
166 166
 
167 167
     put_bits(&s->pb, 1, 1);	/* marker */
... ...
@@ -280,7 +280,7 @@ static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], int d
280 280
     int8_t * const qscale_table= s->current_picture.qscale_table;
281 281
 
282 282
     for(n=0; n<6; n++){
283
-        INT16 *ac_val, *ac_val1;
283
+        int16_t *ac_val, *ac_val1;
284 284
 
285 285
         ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
286 286
         ac_val1= ac_val;
... ...
@@ -728,12 +728,12 @@ void mpeg4_encode_mb(MpegEncContext * s,
728 728
         int dc_diff[6];   //dc values with the dc prediction subtracted 
729 729
         int dir[6];  //prediction direction
730 730
         int zigzag_last_index[6];
731
-	UINT8 *scan_table[6];
731
+	uint8_t *scan_table[6];
732 732
         int i;
733 733
 
734 734
         for(i=0; i<6; i++){
735 735
             const int level= block[i][0];
736
-            UINT16 *dc_ptr;
736
+            uint16_t *dc_ptr;
737 737
 
738 738
             dc_diff[i]= level - ff_mpeg4_pred_dc(s, i, &dc_ptr, &dir[i]);
739 739
             if (i < 4) {
... ...
@@ -747,7 +747,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
747 747
 
748 748
         if(s->ac_pred){
749 749
             for(i=0; i<6; i++){
750
-                UINT8 *st;
750
+                uint8_t *st;
751 751
                 int last_index;
752 752
 
753 753
                 mpeg4_inv_pred_ac(s, block[i], i, dir[i]);
... ...
@@ -817,7 +817,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
817 817
         if(s->ac_pred){
818 818
             for(i=0; i<6; i++){
819 819
                 int j;    
820
-                INT16 *ac_val;
820
+                int16_t *ac_val;
821 821
 
822 822
                 ac_val = s->ac_val[0][0] + s->block_index[i] * 16;
823 823
 
... ...
@@ -839,9 +839,9 @@ void h263_encode_mb(MpegEncContext * s,
839 839
 		    int motion_x, int motion_y)
840 840
 {
841 841
     int cbpc, cbpy, i, cbp, pred_x, pred_y;
842
-    INT16 pred_dc;
843
-    INT16 rec_intradc[6];
844
-    UINT16 *dc_ptr[6];
842
+    int16_t pred_dc;
843
+    int16_t rec_intradc[6];
844
+    uint16_t *dc_ptr[6];
845 845
     const int dquant_code[5]= {1,0,9,2,3};
846 846
            
847 847
     //printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
... ...
@@ -890,7 +890,7 @@ void h263_encode_mb(MpegEncContext * s,
890 890
         for(i=0; i<6; i++) {
891 891
             /* Predict DC */
892 892
             if (s->h263_aic && s->mb_intra) {
893
-                INT16 level = block[i][0];
893
+                int16_t level = block[i][0];
894 894
             
895 895
                 pred_dc = h263_pred_dc(s, i, &dc_ptr[i]);
896 896
                 level -= pred_dc;
... ...
@@ -965,10 +965,10 @@ void h263_encode_mb(MpegEncContext * s,
965 965
 }
966 966
 #endif
967 967
 
968
-static int h263_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr)
968
+static int h263_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr)
969 969
 {
970 970
     int x, y, wrap, a, c, pred_dc, scale;
971
-    INT16 *dc_val, *ac_val;
971
+    int16_t *dc_val, *ac_val;
972 972
 
973 973
     /* find prediction */
974 974
     if (n < 4) {
... ...
@@ -1014,7 +1014,7 @@ static int h263_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr)
1014 1014
 static void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
1015 1015
 {
1016 1016
     int x, y, wrap, a, c, pred_dc, scale, i;
1017
-    INT16 *dc_val, *ac_val, *ac_val1;
1017
+    int16_t *dc_val, *ac_val, *ac_val1;
1018 1018
 
1019 1019
     /* find prediction */
1020 1020
     if (n < 4) {
... ...
@@ -1095,11 +1095,11 @@ static void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
1095 1095
         ac_val1[8 + i] = block[s->idct_permutation[i   ]];
1096 1096
 }
1097 1097
 
1098
-INT16 *h263_pred_motion(MpegEncContext * s, int block, 
1098
+int16_t *h263_pred_motion(MpegEncContext * s, int block, 
1099 1099
                         int *px, int *py)
1100 1100
 {
1101 1101
     int xy, wrap;
1102
-    INT16 *A, *B, *C, *mot_val;
1102
+    int16_t *A, *B, *C, *mot_val;
1103 1103
     static const int off[4]= {2, 1, 1, -1};
1104 1104
 
1105 1105
     wrap = s->block_wrap[0];
... ...
@@ -1249,7 +1249,7 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s)
1249 1249
     int mv;
1250 1250
     
1251 1251
     if(mv_penalty==NULL)
1252
-        mv_penalty= av_mallocz( sizeof(UINT16)*(MAX_FCODE+1)*(2*MAX_MV+1) );
1252
+        mv_penalty= av_mallocz( sizeof(uint16_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
1253 1253
     
1254 1254
     for(f_code=1; f_code<=MAX_FCODE; f_code++){
1255 1255
         for(mv=-MAX_MV; mv<=MAX_MV; mv++){
... ...
@@ -1343,7 +1343,7 @@ static void init_uni_dc_tab(void)
1343 1343
 }
1344 1344
 
1345 1345
 #ifdef CONFIG_ENCODERS
1346
-static void init_uni_mpeg4_rl_tab(RLTable *rl, UINT32 *bits_tab, UINT8 *len_tab){
1346
+static void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){
1347 1347
     int slevel, run, last;
1348 1348
     
1349 1349
     assert(MAX_LEVEL >= 64);
... ...
@@ -1575,7 +1575,7 @@ void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){
1575 1575
     if(s->current_picture.pts)
1576 1576
         s->time= (s->current_picture.pts*s->time_increment_resolution + 500*1000)/(1000*1000);
1577 1577
     else
1578
-        s->time= picture_number*(INT64)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate;
1578
+        s->time= picture_number*(int64_t)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate;
1579 1579
     time_div= s->time/s->time_increment_resolution;
1580 1580
     time_mod= s->time%s->time_increment_resolution;
1581 1581
 
... ...
@@ -1821,10 +1821,10 @@ static void change_qscale(MpegEncContext * s, int dquant)
1821 1821
  * @param dir_ptr pointer to an integer where the prediction direction will be stored
1822 1822
  * @return the quantized predicted dc
1823 1823
  */
1824
-static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr, int *dir_ptr)
1824
+static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr, int *dir_ptr)
1825 1825
 {
1826 1826
     int a, b, c, wrap, pred, scale;
1827
-    UINT16 *dc_val;
1827
+    uint16_t *dc_val;
1828 1828
     int dummy;
1829 1829
 
1830 1830
     /* find prediction */
... ...
@@ -1887,7 +1887,7 @@ void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
1887 1887
                    int dir)
1888 1888
 {
1889 1889
     int i;
1890
-    INT16 *ac_val, *ac_val1;
1890
+    int16_t *ac_val, *ac_val1;
1891 1891
     int8_t * const qscale_table= s->current_picture.qscale_table;
1892 1892
 
1893 1893
     /* find prediction */
... ...
@@ -1942,7 +1942,7 @@ static void mpeg4_inv_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
1942 1942
                               int dir)
1943 1943
 {
1944 1944
     int i;
1945
-    INT16 *ac_val;
1945
+    int16_t *ac_val;
1946 1946
     int8_t * const qscale_table= s->current_picture.qscale_table;
1947 1947
 
1948 1948
     /* find prediction */
... ...
@@ -2031,15 +2031,15 @@ static inline void mpeg4_encode_dc(PutBitContext * s, int level, int n)
2031 2031
  * @param n block index (0-3 are luma, 4-5 are chroma)
2032 2032
  */
2033 2033
 static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, 
2034
-                               UINT8 *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
2034
+                               uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
2035 2035
 {
2036 2036
     int i, last_non_zero;
2037 2037
 #if 0 //variables for the outcommented version
2038 2038
     int code, sign, last;
2039 2039
 #endif
2040 2040
     const RLTable *rl;
2041
-    UINT32 *bits_tab;
2042
-    UINT8 *len_tab;
2041
+    uint32_t *bits_tab;
2042
+    uint8_t *len_tab;
2043 2043
     const int last_index = s->block_last_index[n];
2044 2044
 
2045 2045
     if (s->mb_intra) { //Note gcc (3.2.1 at least) will optimize this away
... ...
@@ -2147,11 +2147,11 @@ static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n
2147 2147
 }
2148 2148
 
2149 2149
 static inline int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, 
2150
-                               UINT8 *scan_table)
2150
+                               uint8_t *scan_table)
2151 2151
 {
2152 2152
     int i, last_non_zero;
2153 2153
     const RLTable *rl;
2154
-    UINT8 *len_tab;
2154
+    uint8_t *len_tab;
2155 2155
     const int last_index = s->block_last_index[n];
2156 2156
     int len=0;
2157 2157
 
... ...
@@ -2564,14 +2564,14 @@ void ff_mpeg4_clean_buffers(MpegEncContext *s)
2564 2564
 #endif
2565 2565
 
2566 2566
     /* clean AC */
2567
-    memset(s->ac_val[0] + l_xy, 0, (l_wrap*2+1)*16*sizeof(INT16));
2568
-    memset(s->ac_val[1] + c_xy, 0, (c_wrap  +1)*16*sizeof(INT16));
2569
-    memset(s->ac_val[2] + c_xy, 0, (c_wrap  +1)*16*sizeof(INT16));
2567
+    memset(s->ac_val[0] + l_xy, 0, (l_wrap*2+1)*16*sizeof(int16_t));
2568
+    memset(s->ac_val[1] + c_xy, 0, (c_wrap  +1)*16*sizeof(int16_t));
2569
+    memset(s->ac_val[2] + c_xy, 0, (c_wrap  +1)*16*sizeof(int16_t));
2570 2570
 
2571 2571
     /* clean MV */
2572 2572
     // we cant clear the MVs as they might be needed by a b frame
2573
-//    memset(s->motion_val + l_xy, 0, (l_wrap*2+1)*2*sizeof(INT16));
2574
-//    memset(s->motion_val, 0, 2*sizeof(INT16)*(2 + s->mb_width*2)*(2 + s->mb_height*2));
2573
+//    memset(s->motion_val + l_xy, 0, (l_wrap*2+1)*2*sizeof(int16_t));
2574
+//    memset(s->motion_val, 0, 2*sizeof(int16_t)*(2 + s->mb_width*2)*(2 + s->mb_height*2));
2575 2575
     s->last_mv[0][0][0]=
2576 2576
     s->last_mv[0][0][1]=
2577 2577
     s->last_mv[1][0][0]=
... ...
@@ -2671,7 +2671,7 @@ static inline int get_amv(MpegEncContext *s, int n){
2671 2671
  */
2672 2672
 static int mpeg4_decode_partition_a(MpegEncContext *s){
2673 2673
     int mb_num;
2674
-    static const INT8 quant_tab[4] = { -1, -2, 1, 2 };
2674
+    static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
2675 2675
     
2676 2676
     /* decode first partition */
2677 2677
     mb_num=0;
... ...
@@ -2729,7 +2729,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
2729 2729
                 s->error_status_table[xy]= AC_ERROR;
2730 2730
             }else{ /* P/S_TYPE */
2731 2731
                 int mx, my, pred_x, pred_y, bits;
2732
-                INT16 * const mot_val= s->motion_val[s->block_index[0]];
2732
+                int16_t * const mot_val= s->motion_val[s->block_index[0]];
2733 2733
                 const int stride= s->block_wrap[0]*2;
2734 2734
 
2735 2735
                 bits= show_bits(&s->gb, 17);
... ...
@@ -2817,7 +2817,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
2817 2817
                         PRINT_MB_TYPE("4");
2818 2818
                         s->mb_type[xy]= MB_TYPE_INTER4V;
2819 2819
                         for(i=0;i<4;i++) {
2820
-                            INT16 *mot_val= h263_pred_motion(s, i, &pred_x, &pred_y);
2820
+                            int16_t *mot_val= h263_pred_motion(s, i, &pred_x, &pred_y);
2821 2821
                             mx = h263_decode_motion(s, pred_x, s->f_code);
2822 2822
                             if (mx >= 0xffff)
2823 2823
                                 return -1;
... ...
@@ -2845,7 +2845,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
2845 2845
  */
2846 2846
 static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
2847 2847
     int mb_num=0;
2848
-    static const INT8 quant_tab[4] = { -1, -2, 1, 2 };
2848
+    static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
2849 2849
 
2850 2850
     s->mb_x= s->resync_mb_x;
2851 2851
     s->first_slice_line=1;
... ...
@@ -3073,8 +3073,8 @@ int ff_h263_decode_mb(MpegEncContext *s,
3073 3073
                       DCTELEM block[6][64])
3074 3074
 {
3075 3075
     int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
3076
-    INT16 *mot_val;
3077
-    static INT8 quant_tab[4] = { -1, -2, 1, 2 };
3076
+    int16_t *mot_val;
3077
+    static int8_t quant_tab[4] = { -1, -2, 1, 2 };
3078 3078
 
3079 3079
     s->error_status_table[s->mb_x + s->mb_y*s->mb_width]= 0;
3080 3080
 
... ...
@@ -3216,7 +3216,6 @@ int ff_h263_decode_mb(MpegEncContext *s,
3216 3216
         int modb1; // first bit of modb
3217 3217
         int modb2; // second bit of modb
3218 3218
         int mb_type;
3219
-        int xy;
3220 3219
 
3221 3220
         s->mb_intra = 0; //B-frames never contain intra blocks
3222 3221
         s->mcsel=0;      //     ...               true gmc blocks
... ...
@@ -3501,7 +3500,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
3501 3501
 {
3502 3502
     int code, level, i, j, last, run;
3503 3503
     RLTable *rl = &rl_inter;
3504
-    const UINT8 *scan_table;
3504
+    const uint8_t *scan_table;
3505 3505
 
3506 3506
     scan_table = s->intra_scantable.permutated;
3507 3507
     if (s->h263_aic && s->mb_intra) {
... ...
@@ -3556,7 +3555,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
3556 3556
             /* escape */
3557 3557
             last = get_bits1(&s->gb);
3558 3558
             run = get_bits(&s->gb, 6);
3559
-            level = (INT8)get_bits(&s->gb, 8);
3559
+            level = (int8_t)get_bits(&s->gb, 8);
3560 3560
             if (s->h263_rv10 && level == -128) {
3561 3561
                 /* XXX: should patch encoder too */
3562 3562
                 level = get_bits(&s->gb, 12);
... ...
@@ -3598,7 +3597,7 @@ not_coded:
3598 3598
 static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
3599 3599
 {
3600 3600
     int level, pred, code;
3601
-    UINT16 *dc_val;
3601
+    uint16_t *dc_val;
3602 3602
 
3603 3603
     if (n < 4) 
3604 3604
         code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1);
... ...
@@ -3657,7 +3656,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
3657 3657
     int dc_pred_dir;
3658 3658
     RLTable * rl;
3659 3659
     RL_VLC_ELEM * rl_vlc;
3660
-    const UINT8 * scan_table;
3660
+    const uint8_t * scan_table;
3661 3661
     int qmul, qadd;
3662 3662
 
3663 3663
     if(intra) {
... ...
@@ -1,11 +1,11 @@
1 1
 
2 2
 /* intra MCBPC, mb_type = (intra), then (intraq) */
3
-const UINT8 intra_MCBPC_code[8] = { 1, 1, 2, 3, 1, 1, 2, 3 };
4
-const UINT8 intra_MCBPC_bits[8] = { 1, 3, 3, 3, 4, 6, 6, 6 };
3
+const uint8_t intra_MCBPC_code[8] = { 1, 1, 2, 3, 1, 1, 2, 3 };
4
+const uint8_t intra_MCBPC_bits[8] = { 1, 3, 3, 3, 4, 6, 6, 6 };
5 5
 
6 6
 /* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */
7 7
 /* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */
8
-const UINT8 inter_MCBPC_code[25] = { 
8
+const uint8_t inter_MCBPC_code[25] = { 
9 9
     1, 3, 2, 5, 
10 10
     3, 4, 3, 3, 
11 11
     3, 7, 6, 5,
... ...
@@ -14,7 +14,7 @@ const UINT8 inter_MCBPC_code[25] = {
14 14
     1, /* Stuffing */
15 15
     2, 12, 14, 15,
16 16
 };
17
-const UINT8 inter_MCBPC_bits[25] = { 
17
+const uint8_t inter_MCBPC_bits[25] = { 
18 18
     1, 4, 4, 6, 
19 19
     5, 8, 8, 7,
20 20
     3, 7, 7, 9,
... ...
@@ -25,14 +25,14 @@ const UINT8 inter_MCBPC_bits[25] = {
25 25
 };
26 26
 
27 27
 /* This is the old table 
28
-static const UINT8 inter_MCBPC_code[20] = { 
28
+static const uint8_t inter_MCBPC_code[20] = { 
29 29
     1, 3, 2, 5, 
30 30
     3, 4, 3, 3, 
31 31
     0, 1, 2, 3,
32 32
     4, 4, 3, 2,
33 33
     2, 5, 4, 5,
34 34
 };
35
-static const UINT8 inter_MCBPC_bits[20] = { 
35
+static const uint8_t inter_MCBPC_bits[20] = { 
36 36
     1, 4, 4, 6, 
37 37
     5, 8, 8, 7,
38 38
     12, 12, 12, 12,
... ...
@@ -40,13 +40,13 @@ static const UINT8 inter_MCBPC_bits[20] = {
40 40
     3, 7, 7, 8,
41 41
 };*/
42 42
 
43
-const UINT8 cbpy_tab[16][2] =
43
+const uint8_t cbpy_tab[16][2] =
44 44
 {
45 45
   {3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4},
46 46
   {2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
47 47
 };
48 48
 
49
-const UINT8 mvtab[33][2] =
49
+const uint8_t mvtab[33][2] =
50 50
 {
51 51
   {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
52 52
   {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] =
56 56
 };
57 57
 
58 58
 /* third non intra table */
59
-const UINT16 inter_vlc[103][2] = {
59
+const uint16_t inter_vlc[103][2] = {
60 60
 { 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 },
61 61
 { 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 },
62 62
 { 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 },
... ...
@@ -85,7 +85,7 @@ const UINT16 inter_vlc[103][2] = {
85 85
 { 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 },
86 86
 };
87 87
 
88
-const INT8 inter_level[102] = {
88
+const int8_t inter_level[102] = {
89 89
   1,  2,  3,  4,  5,  6,  7,  8,
90 90
   9, 10, 11, 12,  1,  2,  3,  4,
91 91
   5,  6,  1,  2,  3,  4,  1,  2,
... ...
@@ -101,7 +101,7 @@ const INT8 inter_level[102] = {
101 101
   1,  1,  1,  1,  1,  1,
102 102
 };
103 103
 
104
-const INT8 inter_run[102] = {
104
+const int8_t inter_run[102] = {
105 105
   0,  0,  0,  0,  0,  0,  0,  0,
106 106
   0,  0,  0,  0,  1,  1,  1,  1,
107 107
   1,  1,  2,  2,  2,  2,  3,  3,
... ...
@@ -125,7 +125,7 @@ static RLTable rl_inter = {
125 125
     inter_level,
126 126
 };
127 127
 
128
-const UINT16 intra_vlc_aic[103][2] = {
128
+const uint16_t intra_vlc_aic[103][2] = {
129 129
 {  0x2,  2 }, {  0x6,  3 }, {  0xe,  4 }, {  0xc,  5 }, 
130 130
 {  0xd,  5 }, { 0x10,  6 }, { 0x11,  6 }, { 0x12,  6 }, 
131 131
 { 0x16,  7 }, { 0x1b,  8 }, { 0x20,  9 }, { 0x21,  9 }, 
... ...
@@ -154,7 +154,7 @@ const UINT16 intra_vlc_aic[103][2] = {
154 154
 { 0x59, 12 }, { 0x5a, 12 }, {  0x3,  7 },
155 155
 };
156 156
 
157
-const INT8 intra_run_aic[102] = {
157
+const int8_t intra_run_aic[102] = {
158 158
  0,  0,  0,  0,  0,  0,  0,  0, 
159 159
  0,  0,  0,  0,  0,  0,  0,  0, 
160 160
  0,  0,  0,  0,  0,  0,  0,  0, 
... ...
@@ -170,7 +170,7 @@ const INT8 intra_run_aic[102] = {
170 170
 18, 19, 20, 21, 22, 23, 
171 171
 };
172 172
 
173
-const INT8 intra_level_aic[102] = {
173
+const int8_t intra_level_aic[102] = {
174 174
  1,  2,  3,  4,  5,  6,  7,  8, 
175 175
  9, 10, 11, 12, 13, 14, 15, 16, 
176 176
 17, 18, 19, 20, 21, 22, 23, 24, 
... ...
@@ -194,7 +194,7 @@ static RLTable rl_intra_aic = {
194 194
     intra_level_aic,
195 195
 };
196 196
 
197
-static const UINT16 h263_format[8][2] = {
197
+static const uint16_t h263_format[8][2] = {
198 198
     { 0, 0 },
199 199
     { 128, 96 },
200 200
     { 176, 144 },
... ...
@@ -203,7 +203,7 @@ static const UINT16 h263_format[8][2] = {
203 203
     { 1408, 1152 },
204 204
 };
205 205
 
206
-static UINT8 h263_aic_dc_scale_table[32]={
206
+static uint8_t h263_aic_dc_scale_table[32]={
207 207
 //  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
208 208
     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
209 209
 };
... ...
@@ -299,7 +299,7 @@ static int decode_slice(MpegEncContext *s){
299 299
  * finds the end of the current frame in the bitstream.
300 300
  * @return the position of the first byte of the next frame, or -1
301 301
  */
302
-static int mpeg4_find_frame_end(MpegEncContext *s, UINT8 *buf, int buf_size){
302
+static int mpeg4_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){
303 303
     ParseContext *pc= &s->parse_context;
304 304
     int vop_found, i;
305 305
     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
403 403
 
404 404
 int ff_h263_decode_frame(AVCodecContext *avctx, 
405 405
                              void *data, int *data_size,
406
-                             UINT8 *buf, int buf_size)
406
+                             uint8_t *buf, int buf_size)
407 407
 {
408 408
     MpegEncContext *s = avctx->priv_data;
409 409
     int ret,i;
... ...
@@ -629,7 +629,7 @@ retry:
629 629
 #endif
630 630
 
631 631
     if(s->error_resilience)
632
-        memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_num*sizeof(UINT8));
632
+        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));
633 633
     
634 634
     /* decode each macroblock */
635 635
     s->block_wrap[0]=
... ...
@@ -638,7 +638,7 @@ static void decode_bgr_bitstream(HYuvContext *s, int count){
638 638
 
639 639
 static void draw_slice(HYuvContext *s, int y){
640 640
     int h, cy;
641
-    UINT8 *src_ptr[3];
641
+    uint8_t *src_ptr[3];
642 642
     
643 643
     if(s->avctx->draw_horiz_band==NULL) 
644 644
         return;
... ...
@@ -172,7 +172,7 @@ static const uint64_t ff_pw_15 __attribute__ ((aligned(8))) = 0x000F000F000F000F
172 172
 /***********************************/
173 173
 /* standard MMX */
174 174
 
175
-static void get_pixels_mmx(DCTELEM *block, const UINT8 *pixels, int line_size)
175
+static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size)
176 176
 {
177 177
     asm volatile(
178 178
         "movl $-128, %%eax	\n\t"
... ...
@@ -200,7 +200,7 @@ static void get_pixels_mmx(DCTELEM *block, const UINT8 *pixels, int line_size)
200 200
     );
201 201
 }
202 202
 
203
-static inline void diff_pixels_mmx(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride)
203
+static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride)
204 204
 {
205 205
     asm volatile(
206 206
         "pxor %%mm7, %%mm7	\n\t"
... ...
@@ -229,10 +229,10 @@ static inline void diff_pixels_mmx(DCTELEM *block, const UINT8 *s1, const UINT8
229 229
     );
230 230
 }
231 231
 
232
-void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
232
+void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
233 233
 {
234 234
     const DCTELEM *p;
235
-    UINT8 *pix;
235
+    uint8_t *pix;
236 236
 
237 237
     /* read the pixels */
238 238
     p = block;
... ...
@@ -284,10 +284,10 @@ void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
284 284
 	    :"memory");
285 285
 }
286 286
 
287
-void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
287
+void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
288 288
 {
289 289
     const DCTELEM *p;
290
-    UINT8 *pix;
290
+    uint8_t *pix;
291 291
     int i;
292 292
 
293 293
     /* read the pixels */
... ...
@@ -325,7 +325,7 @@ void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
325 325
     } while (--i);
326 326
 }
327 327
 
328
-static void put_pixels8_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
328
+static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
329 329
 {
330 330
     __asm __volatile(
331 331
 	 "lea (%3, %3), %%eax		\n\t"
... ...
@@ -351,7 +351,7 @@ static void put_pixels8_mmx(UINT8 *block, const UINT8 *pixels, int line_size, in
351 351
 	);
352 352
 }
353 353
 
354
-static void put_pixels16_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
354
+static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
355 355
 {
356 356
     __asm __volatile(
357 357
 	 "lea (%3, %3), %%eax		\n\t"
... ...
@@ -402,7 +402,7 @@ static void clear_blocks_mmx(DCTELEM *blocks)
402 402
         );
403 403
 }
404 404
 
405
-static int pix_sum16_mmx(UINT8 * pix, int line_size){
405
+static int pix_sum16_mmx(uint8_t * pix, int line_size){
406 406
     const int h=16;
407 407
     int sum;
408 408
     int index= -line_size*h;
... ...
@@ -505,7 +505,7 @@ static int pix_norm1_mmx(uint8_t *pix, int line_size) {
505 505
     return tmp;
506 506
 }
507 507
 
508
-static int sse16_mmx(void *v, UINT8 * pix1, UINT8 * pix2, int line_size) {
508
+static int sse16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size) {
509 509
     int tmp;
510 510
   asm volatile (
511 511
       "movl $16,%%ecx\n"
... ...
@@ -1158,46 +1158,46 @@ static void OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src,
1158 1158
    );\
1159 1159
 }\
1160 1160
 \
1161
-static void OPNAME ## qpel8_mc00_ ## MMX (UINT8 *dst, UINT8 *src, int stride){\
1161
+static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
1162 1162
     OPNAME ## pixels8_mmx(dst, src, stride, 8);\
1163 1163
 }\
1164 1164
 \
1165
-static void OPNAME ## qpel8_mc10_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1165
+static void OPNAME ## qpel8_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1166 1166
     uint64_t temp[8];\
1167 1167
     uint8_t * const half= (uint8_t*)temp;\
1168 1168
     put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\
1169 1169
     OPNAME ## pixels8_l2_mmx(dst, src, half, stride, stride, 8);\
1170 1170
 }\
1171 1171
 \
1172
-static void OPNAME ## qpel8_mc20_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1172
+static void OPNAME ## qpel8_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1173 1173
     OPNAME ## mpeg4_qpel8_h_lowpass_ ## MMX(dst, src, stride, stride, 8);\
1174 1174
 }\
1175 1175
 \
1176
-static void OPNAME ## qpel8_mc30_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1176
+static void OPNAME ## qpel8_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1177 1177
     uint64_t temp[8];\
1178 1178
     uint8_t * const half= (uint8_t*)temp;\
1179 1179
     put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\
1180 1180
     OPNAME ## pixels8_l2_mmx(dst, src+1, half, stride, stride, 8);\
1181 1181
 }\
1182 1182
 \
1183
-static void OPNAME ## qpel8_mc01_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1183
+static void OPNAME ## qpel8_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1184 1184
     uint64_t temp[8];\
1185 1185
     uint8_t * const half= (uint8_t*)temp;\
1186 1186
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\
1187 1187
     OPNAME ## pixels8_l2_mmx(dst, src, half, stride, stride, 8);\
1188 1188
 }\
1189 1189
 \
1190
-static void OPNAME ## qpel8_mc02_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1190
+static void OPNAME ## qpel8_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1191 1191
     OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, src, stride, stride);\
1192 1192
 }\
1193 1193
 \
1194
-static void OPNAME ## qpel8_mc03_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1194
+static void OPNAME ## qpel8_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1195 1195
     uint64_t temp[8];\
1196 1196
     uint8_t * const half= (uint8_t*)temp;\
1197 1197
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\
1198 1198
     OPNAME ## pixels8_l2_mmx(dst, src+stride, half, stride, stride, 8);\
1199 1199
 }\
1200
-static void OPNAME ## qpel8_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1200
+static void OPNAME ## qpel8_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1201 1201
     uint64_t half[8 + 9];\
1202 1202
     uint8_t * const halfH= ((uint8_t*)half) + 64;\
1203 1203
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1206,7 +1206,7 @@ static void OPNAME ## qpel8_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1206 1206
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
1207 1207
     OPNAME ## pixels8_l2_mmx(dst, halfH, halfHV, stride, 8, 8);\
1208 1208
 }\
1209
-static void OPNAME ## qpel8_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1209
+static void OPNAME ## qpel8_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1210 1210
     uint64_t half[8 + 9];\
1211 1211
     uint8_t * const halfH= ((uint8_t*)half) + 64;\
1212 1212
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1215,7 +1215,7 @@ static void OPNAME ## qpel8_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1215 1215
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
1216 1216
     OPNAME ## pixels8_l2_mmx(dst, halfH, halfHV, stride, 8, 8);\
1217 1217
 }\
1218
-static void OPNAME ## qpel8_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1218
+static void OPNAME ## qpel8_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1219 1219
     uint64_t half[8 + 9];\
1220 1220
     uint8_t * const halfH= ((uint8_t*)half) + 64;\
1221 1221
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1224,7 +1224,7 @@ static void OPNAME ## qpel8_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1224 1224
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
1225 1225
     OPNAME ## pixels8_l2_mmx(dst, halfH+8, halfHV, stride, 8, 8);\
1226 1226
 }\
1227
-static void OPNAME ## qpel8_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1227
+static void OPNAME ## qpel8_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1228 1228
     uint64_t half[8 + 9];\
1229 1229
     uint8_t * const halfH= ((uint8_t*)half) + 64;\
1230 1230
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1233,7 +1233,7 @@ static void OPNAME ## qpel8_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1233 1233
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
1234 1234
     OPNAME ## pixels8_l2_mmx(dst, halfH+8, halfHV, stride, 8, 8);\
1235 1235
 }\
1236
-static void OPNAME ## qpel8_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1236
+static void OPNAME ## qpel8_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1237 1237
     uint64_t half[8 + 9];\
1238 1238
     uint8_t * const halfH= ((uint8_t*)half) + 64;\
1239 1239
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1241,7 +1241,7 @@ static void OPNAME ## qpel8_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1241 1241
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
1242 1242
     OPNAME ## pixels8_l2_mmx(dst, halfH, halfHV, stride, 8, 8);\
1243 1243
 }\
1244
-static void OPNAME ## qpel8_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1244
+static void OPNAME ## qpel8_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1245 1245
     uint64_t half[8 + 9];\
1246 1246
     uint8_t * const halfH= ((uint8_t*)half) + 64;\
1247 1247
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1249,66 +1249,66 @@ static void OPNAME ## qpel8_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1249 1249
     put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
1250 1250
     OPNAME ## pixels8_l2_mmx(dst, halfH+8, halfHV, stride, 8, 8);\
1251 1251
 }\
1252
-static void OPNAME ## qpel8_mc12_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1252
+static void OPNAME ## qpel8_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1253 1253
     uint64_t half[8 + 9];\
1254 1254
     uint8_t * const halfH= ((uint8_t*)half);\
1255 1255
     put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
1256 1256
     put ## RND ## pixels8_l2_mmx(halfH, src, halfH, 8, stride, 9);\
1257 1257
     OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
1258 1258
 }\
1259
-static void OPNAME ## qpel8_mc32_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1259
+static void OPNAME ## qpel8_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1260 1260
     uint64_t half[8 + 9];\
1261 1261
     uint8_t * const halfH= ((uint8_t*)half);\
1262 1262
     put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
1263 1263
     put ## RND ## pixels8_l2_mmx(halfH, src+1, halfH, 8, stride, 9);\
1264 1264
     OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
1265 1265
 }\
1266
-static void OPNAME ## qpel8_mc22_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1266
+static void OPNAME ## qpel8_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1267 1267
     uint64_t half[9];\
1268 1268
     uint8_t * const halfH= ((uint8_t*)half);\
1269 1269
     put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
1270 1270
     OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
1271 1271
 }\
1272
-static void OPNAME ## qpel16_mc00_ ## MMX (UINT8 *dst, UINT8 *src, int stride){\
1272
+static void OPNAME ## qpel16_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
1273 1273
     OPNAME ## pixels16_mmx(dst, src, stride, 16);\
1274 1274
 }\
1275 1275
 \
1276
-static void OPNAME ## qpel16_mc10_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1276
+static void OPNAME ## qpel16_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1277 1277
     uint64_t temp[32];\
1278 1278
     uint8_t * const half= (uint8_t*)temp;\
1279 1279
     put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\
1280 1280
     OPNAME ## pixels16_l2_mmx(dst, src, half, stride, stride, 16);\
1281 1281
 }\
1282 1282
 \
1283
-static void OPNAME ## qpel16_mc20_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1283
+static void OPNAME ## qpel16_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1284 1284
     OPNAME ## mpeg4_qpel16_h_lowpass_ ## MMX(dst, src, stride, stride, 16);\
1285 1285
 }\
1286 1286
 \
1287
-static void OPNAME ## qpel16_mc30_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1287
+static void OPNAME ## qpel16_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1288 1288
     uint64_t temp[32];\
1289 1289
     uint8_t * const half= (uint8_t*)temp;\
1290 1290
     put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\
1291 1291
     OPNAME ## pixels16_l2_mmx(dst, src+1, half, stride, stride, 16);\
1292 1292
 }\
1293 1293
 \
1294
-static void OPNAME ## qpel16_mc01_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1294
+static void OPNAME ## qpel16_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1295 1295
     uint64_t temp[32];\
1296 1296
     uint8_t * const half= (uint8_t*)temp;\
1297 1297
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\
1298 1298
     OPNAME ## pixels16_l2_mmx(dst, src, half, stride, stride, 16);\
1299 1299
 }\
1300 1300
 \
1301
-static void OPNAME ## qpel16_mc02_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1301
+static void OPNAME ## qpel16_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1302 1302
     OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, src, stride, stride);\
1303 1303
 }\
1304 1304
 \
1305
-static void OPNAME ## qpel16_mc03_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1305
+static void OPNAME ## qpel16_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1306 1306
     uint64_t temp[32];\
1307 1307
     uint8_t * const half= (uint8_t*)temp;\
1308 1308
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\
1309 1309
     OPNAME ## pixels16_l2_mmx(dst, src+stride, half, stride, stride, 16);\
1310 1310
 }\
1311
-static void OPNAME ## qpel16_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1311
+static void OPNAME ## qpel16_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1312 1312
     uint64_t half[16*2 + 17*2];\
1313 1313
     uint8_t * const halfH= ((uint8_t*)half) + 256;\
1314 1314
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1317,7 +1317,7 @@ static void OPNAME ## qpel16_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1317 1317
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
1318 1318
     OPNAME ## pixels16_l2_mmx(dst, halfH, halfHV, stride, 16, 16);\
1319 1319
 }\
1320
-static void OPNAME ## qpel16_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1320
+static void OPNAME ## qpel16_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1321 1321
     uint64_t half[16*2 + 17*2];\
1322 1322
     uint8_t * const halfH= ((uint8_t*)half) + 256;\
1323 1323
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1326,7 +1326,7 @@ static void OPNAME ## qpel16_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1326 1326
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
1327 1327
     OPNAME ## pixels16_l2_mmx(dst, halfH, halfHV, stride, 16, 16);\
1328 1328
 }\
1329
-static void OPNAME ## qpel16_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1329
+static void OPNAME ## qpel16_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1330 1330
     uint64_t half[16*2 + 17*2];\
1331 1331
     uint8_t * const halfH= ((uint8_t*)half) + 256;\
1332 1332
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1335,7 +1335,7 @@ static void OPNAME ## qpel16_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1335 1335
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
1336 1336
     OPNAME ## pixels16_l2_mmx(dst, halfH+16, halfHV, stride, 16, 16);\
1337 1337
 }\
1338
-static void OPNAME ## qpel16_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1338
+static void OPNAME ## qpel16_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1339 1339
     uint64_t half[16*2 + 17*2];\
1340 1340
     uint8_t * const halfH= ((uint8_t*)half) + 256;\
1341 1341
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1344,7 +1344,7 @@ static void OPNAME ## qpel16_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1344 1344
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
1345 1345
     OPNAME ## pixels16_l2_mmx(dst, halfH+16, halfHV, stride, 16, 16);\
1346 1346
 }\
1347
-static void OPNAME ## qpel16_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1347
+static void OPNAME ## qpel16_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1348 1348
     uint64_t half[16*2 + 17*2];\
1349 1349
     uint8_t * const halfH= ((uint8_t*)half) + 256;\
1350 1350
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1352,7 +1352,7 @@ static void OPNAME ## qpel16_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1352 1352
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
1353 1353
     OPNAME ## pixels16_l2_mmx(dst, halfH, halfHV, stride, 16, 16);\
1354 1354
 }\
1355
-static void OPNAME ## qpel16_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1355
+static void OPNAME ## qpel16_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1356 1356
     uint64_t half[16*2 + 17*2];\
1357 1357
     uint8_t * const halfH= ((uint8_t*)half) + 256;\
1358 1358
     uint8_t * const halfHV= ((uint8_t*)half);\
... ...
@@ -1360,21 +1360,21 @@ static void OPNAME ## qpel16_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1360 1360
     put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
1361 1361
     OPNAME ## pixels16_l2_mmx(dst, halfH+16, halfHV, stride, 16, 16);\
1362 1362
 }\
1363
-static void OPNAME ## qpel16_mc12_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1363
+static void OPNAME ## qpel16_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1364 1364
     uint64_t half[17*2];\
1365 1365
     uint8_t * const halfH= ((uint8_t*)half);\
1366 1366
     put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
1367 1367
     put ## RND ## pixels16_l2_mmx(halfH, src, halfH, 16, stride, 17);\
1368 1368
     OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
1369 1369
 }\
1370
-static void OPNAME ## qpel16_mc32_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1370
+static void OPNAME ## qpel16_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1371 1371
     uint64_t half[17*2];\
1372 1372
     uint8_t * const halfH= ((uint8_t*)half);\
1373 1373
     put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
1374 1374
     put ## RND ## pixels16_l2_mmx(halfH, src+1, halfH, 16, stride, 17);\
1375 1375
     OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
1376 1376
 }\
1377
-static void OPNAME ## qpel16_mc22_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
1377
+static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1378 1378
     uint64_t half[17*2];\
1379 1379
     uint8_t * const halfH= ((uint8_t*)half);\
1380 1380
     put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
... ...
@@ -25,7 +25,7 @@
25 25
 /* XXX: we use explicit registers to avoid a gcc 2.95.2 register asm
26 26
    clobber bug - now it will work with 2.95.2 and also with -fPIC
27 27
  */
28
-static void DEF(put_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
28
+static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
29 29
 {
30 30
     __asm __volatile(
31 31
 	"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
85 85
 	:"memory");
86 86
 }
87 87
 
88
-static void DEF(put_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
88
+static void DEF(put_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
89 89
 {
90 90
     __asm __volatile(
91 91
 	"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
154 154
 }
155 155
  
156 156
 /* GL: this function does incorrect rounding if overflow */
157
-static void DEF(put_no_rnd_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
157
+static void DEF(put_no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
158 158
 {
159 159
     MOVQ_BONE(mm6);
160 160
     __asm __volatile(
... ...
@@ -191,7 +191,7 @@ static void DEF(put_no_rnd_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int li
191 191
 	:"%eax", "memory");
192 192
 }
193 193
 
194
-static void DEF(put_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
194
+static void DEF(put_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
195 195
 {
196 196
     __asm __volatile(
197 197
 	"lea (%3, %3), %%eax		\n\t"
... ...
@@ -222,7 +222,7 @@ static void DEF(put_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size
222 222
 }
223 223
 
224 224
 /* GL: this function does incorrect rounding if overflow */
225
-static void DEF(put_no_rnd_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
225
+static void DEF(put_no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
226 226
 {
227 227
     MOVQ_BONE(mm6);
228 228
     __asm __volatile(
... ...
@@ -255,7 +255,7 @@ static void DEF(put_no_rnd_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int li
255 255
 	:"%eax", "memory");
256 256
 }
257 257
 
258
-static void DEF(avg_pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
258
+static void DEF(avg_pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
259 259
 {
260 260
     __asm __volatile(
261 261
 	"lea (%3, %3), %%eax		\n\t"
... ...
@@ -283,7 +283,7 @@ static void DEF(avg_pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, i
283 283
 	:"%eax", "memory");
284 284
 }
285 285
 
286
-static void DEF(avg_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
286
+static void DEF(avg_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
287 287
 {
288 288
     __asm __volatile(
289 289
 	"lea (%3, %3), %%eax		\n\t"
... ...
@@ -315,7 +315,7 @@ static void DEF(avg_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size
315 315
 	:"%eax", "memory");
316 316
 }
317 317
 
318
-static void DEF(avg_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
318
+static void DEF(avg_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
319 319
 {
320 320
     __asm __volatile(
321 321
 	"lea (%3, %3), %%eax		\n\t"
... ...
@@ -354,7 +354,7 @@ static void DEF(avg_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size
354 354
 }
355 355
 
356 356
 // Note this is not correctly rounded, but this function is only used for b frames so it doesnt matter 
357
-static void DEF(avg_pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
357
+static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
358 358
 {
359 359
     MOVQ_BONE(mm6);
360 360
     __asm __volatile(
... ...
@@ -396,31 +396,31 @@ static void DEF(avg_pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_siz
396 396
 }
397 397
 
398 398
 //FIXME the following could be optimized too ...
399
-static void DEF(put_no_rnd_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
399
+static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
400 400
     DEF(put_no_rnd_pixels8_x2)(block  , pixels  , line_size, h);
401 401
     DEF(put_no_rnd_pixels8_x2)(block+8, pixels+8, line_size, h);
402 402
 }
403
-static void DEF(put_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
403
+static void DEF(put_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
404 404
     DEF(put_pixels8_y2)(block  , pixels  , line_size, h);
405 405
     DEF(put_pixels8_y2)(block+8, pixels+8, line_size, h);
406 406
 }
407
-static void DEF(put_no_rnd_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
407
+static void DEF(put_no_rnd_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
408 408
     DEF(put_no_rnd_pixels8_y2)(block  , pixels  , line_size, h);
409 409
     DEF(put_no_rnd_pixels8_y2)(block+8, pixels+8, line_size, h);
410 410
 }
411
-static void DEF(avg_pixels16)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
411
+static void DEF(avg_pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
412 412
     DEF(avg_pixels8)(block  , pixels  , line_size, h);
413 413
     DEF(avg_pixels8)(block+8, pixels+8, line_size, h);
414 414
 }
415
-static void DEF(avg_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
415
+static void DEF(avg_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
416 416
     DEF(avg_pixels8_x2)(block  , pixels  , line_size, h);
417 417
     DEF(avg_pixels8_x2)(block+8, pixels+8, line_size, h);
418 418
 }
419
-static void DEF(avg_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
419
+static void DEF(avg_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
420 420
     DEF(avg_pixels8_y2)(block  , pixels  , line_size, h);
421 421
     DEF(avg_pixels8_y2)(block+8, pixels+8, line_size, h);
422 422
 }
423
-static void DEF(avg_pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
423
+static void DEF(avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
424 424
     DEF(avg_pixels8_xy2)(block  , pixels  , line_size, h);
425 425
     DEF(avg_pixels8_xy2)(block+8, pixels+8, line_size, h);
426 426
 }
... ...
@@ -22,7 +22,7 @@
22 22
  */
23 23
 
24 24
 // put_pixels
25
-static void DEF(put, pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
25
+static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
26 26
 {
27 27
     MOVQ_BFE(mm6);
28 28
     __asm __volatile(
... ...
@@ -104,7 +104,7 @@ static void DEF(put, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
104 104
 	:"memory");
105 105
 }
106 106
 
107
-static void DEF(put, pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
107
+static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
108 108
 {
109 109
     MOVQ_BFE(mm6);
110 110
     __asm __volatile(
... ...
@@ -199,7 +199,7 @@ static void DEF(put, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, in
199 199
 	:"memory"); 
200 200
 }
201 201
 
202
-static void DEF(put, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
202
+static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
203 203
 {
204 204
     MOVQ_BFE(mm6);
205 205
     __asm __volatile(
... ...
@@ -228,7 +228,7 @@ static void DEF(put, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_siz
228 228
 	:"eax", "memory");
229 229
 }
230 230
 
231
-static void DEF(put, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
231
+static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
232 232
 {
233 233
     MOVQ_ZERO(mm7);
234 234
     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
296 296
 
297 297
 // avg_pixels
298 298
 // in case more speed is needed - unroling would certainly help
299
-static void DEF(avg, pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
299
+static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
300 300
 {
301 301
     MOVQ_BFE(mm6);
302 302
     JUMPALIGN();
... ...
@@ -315,7 +315,7 @@ static void DEF(avg, pixels8)(UINT8 *block, const UINT8 *pixels, int line_size,
315 315
     while (--h);
316 316
 }
317 317
 
318
-static void DEF(avg, pixels16)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
318
+static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
319 319
 {
320 320
     MOVQ_BFE(mm6);
321 321
     JUMPALIGN();
... ...
@@ -338,7 +338,7 @@ static void DEF(avg, pixels16)(UINT8 *block, const UINT8 *pixels, int line_size,
338 338
     while (--h);
339 339
 }
340 340
 
341
-static void DEF(avg, pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
341
+static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
342 342
 {
343 343
     MOVQ_BFE(mm6);
344 344
     JUMPALIGN();
... ...
@@ -379,7 +379,7 @@ static void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
379 379
     } while (--h);
380 380
 }
381 381
 
382
-static void DEF(avg, pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
382
+static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
383 383
 {
384 384
     MOVQ_BFE(mm6);
385 385
     JUMPALIGN();
... ...
@@ -432,7 +432,7 @@ static void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, in
432 432
     } while (--h);
433 433
 }
434 434
 
435
-static void DEF(avg, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
435
+static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
436 436
 {
437 437
     MOVQ_BFE(mm6);
438 438
     __asm __volatile(
... ...
@@ -472,7 +472,7 @@ static void DEF(avg, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_siz
472 472
 }
473 473
 
474 474
 // this routine is 'slightly' suboptimal but mostly unused
475
-static void DEF(avg, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
475
+static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
476 476
 {
477 477
     MOVQ_ZERO(mm7);
478 478
     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
547 547
 }
548 548
 
549 549
 //FIXME optimize
550
-static void DEF(put, pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
550
+static void DEF(put, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
551 551
     DEF(put, pixels8_y2)(block  , pixels  , line_size, h);
552 552
     DEF(put, pixels8_y2)(block+8, pixels+8, line_size, h);
553 553
 }
554 554
 
555
-static void DEF(put, pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
555
+static void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
556 556
     DEF(put, pixels8_xy2)(block  , pixels  , line_size, h);
557 557
     DEF(put, pixels8_xy2)(block+8, pixels+8, line_size, h);
558 558
 }
559 559
 
560
-static void DEF(avg, pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
560
+static void DEF(avg, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
561 561
     DEF(avg, pixels8_y2)(block  , pixels  , line_size, h);
562 562
     DEF(avg, pixels8_y2)(block+8, pixels+8, line_size, h);
563 563
 }
564 564
 
565
-static void DEF(avg, pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
565
+static void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
566 566
     DEF(avg, pixels8_xy2)(block  , pixels  , line_size, h);
567 567
     DEF(avg, pixels8_xy2)(block+8, pixels+8, line_size, h);
568 568
 }
... ...
@@ -23,7 +23,7 @@
23 23
 void dsputil_init_pix_mmx(DSPContext* c, unsigned mask);
24 24
 void dsputil_set_bit_exact_pix_mmx(DSPContext* c, unsigned mask);
25 25
 
26
-static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={
26
+static const __attribute__ ((aligned(8))) uint64_t round_tab[3]={
27 27
 0x0000000000000000,
28 28
 0x0001000100010001,
29 29
 0x0002000200020002,
... ...
@@ -31,7 +31,7 @@ static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={
31 31
 
32 32
 static __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL;
33 33
 
34
-static inline void sad8_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
34
+static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
35 35
 {
36 36
     int len= -(stride<<h);
37 37
     asm volatile(
... ...
@@ -67,7 +67,7 @@ static inline void sad8_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
67 67
     );
68 68
 }
69 69
 
70
-static inline void sad8_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
70
+static inline void sad8_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
71 71
 {
72 72
     int len= -(stride<<h);
73 73
     asm volatile(
... ...
@@ -89,7 +89,7 @@ static inline void sad8_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
89 89
     );
90 90
 }
91 91
 
92
-static inline void sad8_2_mmx2(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
92
+static inline void sad8_2_mmx2(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
93 93
 {
94 94
     int len= -(stride<<h);
95 95
     asm volatile(
... ...
@@ -115,7 +115,7 @@ static inline void sad8_2_mmx2(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stri
115 115
     );
116 116
 }
117 117
 
118
-static inline void sad8_4_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
118
+static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
119 119
 { //FIXME reuse src
120 120
     int len= -(stride<<h);
121 121
     asm volatile(
... ...
@@ -152,7 +152,7 @@ static inline void sad8_4_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
152 152
     );
153 153
 }
154 154
 
155
-static inline void sad8_2_mmx(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
155
+static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
156 156
 {
157 157
     int len= -(stride<<h);
158 158
     asm volatile(
... ...
@@ -190,7 +190,7 @@ static inline void sad8_2_mmx(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int strid
190 190
     );
191 191
 }
192 192
 
193
-static inline void sad8_4_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
193
+static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
194 194
 {
195 195
     int len= -(stride<<h);
196 196
     asm volatile(
... ...
@@ -268,7 +268,7 @@ static inline int sum_mmx2(void)
268 268
 
269 269
 
270 270
 #define PIX_SAD(suf)\
271
-static int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
271
+static int pix_abs8x8_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
272 272
 {\
273 273
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
274 274
                  "pxor %%mm6, %%mm6		\n\t":);\
... ...
@@ -277,7 +277,7 @@ static int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
277 277
 \
278 278
     return sum_ ## suf();\
279 279
 }\
280
-static int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
280
+static int sad8x8_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
281 281
 {\
282 282
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
283 283
                  "pxor %%mm6, %%mm6		\n\t":);\
... ...
@@ -287,7 +287,7 @@ static int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
287 287
     return sum_ ## suf();\
288 288
 }\
289 289
 \
290
-static int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
290
+static int pix_abs8x8_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
291 291
 {\
292 292
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
293 293
                  "pxor %%mm6, %%mm6		\n\t"\
... ...
@@ -300,7 +300,7 @@ static int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
300 300
     return sum_ ## suf();\
301 301
 }\
302 302
 \
303
-static int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
303
+static int pix_abs8x8_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
304 304
 {\
305 305
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
306 306
                  "pxor %%mm6, %%mm6		\n\t"\
... ...
@@ -313,7 +313,7 @@ static int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
313 313
     return sum_ ## suf();\
314 314
 }\
315 315
 \
316
-static int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
316
+static int pix_abs8x8_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
317 317
 {\
318 318
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
319 319
                  "pxor %%mm6, %%mm6		\n\t"\
... ...
@@ -326,7 +326,7 @@ static int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
326 326
     return sum_ ## suf();\
327 327
 }\
328 328
 \
329
-static int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
329
+static int pix_abs16x16_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
330 330
 {\
331 331
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
332 332
                  "pxor %%mm6, %%mm6		\n\t":);\
... ...
@@ -336,7 +336,7 @@ static int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
336 336
 \
337 337
     return sum_ ## suf();\
338 338
 }\
339
-static int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
339
+static int sad16x16_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
340 340
 {\
341 341
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
342 342
                  "pxor %%mm6, %%mm6		\n\t":);\
... ...
@@ -346,7 +346,7 @@ static int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
346 346
 \
347 347
     return sum_ ## suf();\
348 348
 }\
349
-static int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
349
+static int pix_abs16x16_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
350 350
 {\
351 351
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
352 352
                  "pxor %%mm6, %%mm6		\n\t"\
... ...
@@ -359,7 +359,7 @@ static int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
359 359
 \
360 360
     return sum_ ## suf();\
361 361
 }\
362
-static int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
362
+static int pix_abs16x16_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
363 363
 {\
364 364
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
365 365
                  "pxor %%mm6, %%mm6		\n\t"\
... ...
@@ -372,7 +372,7 @@ static int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
372 372
 \
373 373
     return sum_ ## suf();\
374 374
 }\
375
-static int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
375
+static int pix_abs16x16_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
376 376
 {\
377 377
     asm volatile("pxor %%mm7, %%mm7		\n\t"\
378 378
                  "pxor %%mm6, %%mm6		\n\t"\
... ...
@@ -25,9 +25,9 @@
25 25
 #include "../avcodec.h"
26 26
 #include "../simple_idct.h"
27 27
 
28
-extern UINT8 zigzag_direct_noperm[64];
29
-extern UINT16 inv_zigzag_direct16[64];
30
-extern UINT32 inverse[256];
28
+extern uint8_t zigzag_direct_noperm[64];
29
+extern uint16_t inv_zigzag_direct16[64];
30
+extern uint32_t inverse[256];
31 31
 
32 32
 static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL;
33 33
 static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
... ...
@@ -144,7 +144,7 @@ static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,
144 144
                                      DCTELEM *block, int n, int qscale)
145 145
 {
146 146
     int nCoeffs;
147
-    const UINT16 *quant_matrix;
147
+    const uint16_t *quant_matrix;
148 148
 
149 149
     assert(s->block_last_index[n]>=0);
150 150
 
... ...
@@ -272,7 +272,7 @@ static void dct_unquantize_mpeg2_mmx(MpegEncContext *s,
272 272
                                      DCTELEM *block, int n, int qscale)
273 273
 {
274 274
     int nCoeffs;
275
-    const UINT16 *quant_matrix;
275
+    const uint16_t *quant_matrix;
276 276
     
277 277
     assert(s->block_last_index[n]>=0);
278 278
 
... ...
@@ -404,9 +404,9 @@ asm volatile(
404 404
 
405 405
 /* draw the edges of width 'w' of an image of size width, height 
406 406
    this mmx version can only handle w==8 || w==16 */
407
-static void draw_edges_mmx(UINT8 *buf, int wrap, int width, int height, int w)
407
+static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, int w)
408 408
 {
409
-    UINT8 *ptr, *last_line;
409
+    uint8_t *ptr, *last_line;
410 410
     int i;
411 411
 
412 412
     last_line = buf + (height - 1) * wrap;
... ...
@@ -505,22 +505,22 @@ void ff_mmxext_idct(DCTELEM *block);
505 505
 
506 506
 /* XXX: those functions should be suppressed ASAP when all IDCTs are
507 507
    converted */
508
-static void ff_libmpeg2mmx_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
508
+static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
509 509
 {
510 510
     ff_mmx_idct (block);
511 511
     put_pixels_clamped_mmx(block, dest, line_size);
512 512
 }
513
-static void ff_libmpeg2mmx_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
513
+static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
514 514
 {
515 515
     ff_mmx_idct (block);
516 516
     add_pixels_clamped_mmx(block, dest, line_size);
517 517
 }
518
-static void ff_libmpeg2mmx2_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
518
+static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
519 519
 {
520 520
     ff_mmxext_idct (block);
521 521
     put_pixels_clamped_mmx(block, dest, line_size);
522 522
 }
523
-static void ff_libmpeg2mmx2_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
523
+static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
524 524
 {
525 525
     ff_mmxext_idct (block);
526 526
     add_pixels_clamped_mmx(block, dest, line_size);
... ...
@@ -37,8 +37,8 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
37 37
                             int qscale, int *overflow)
38 38
 {
39 39
     int level=0, last_non_zero_p1, q; //=0 is cuz gcc says uninitalized ...
40
-    const UINT16 *qmat, *bias;
41
-    static __align8 INT16 temp_block[64];
40
+    const uint16_t *qmat, *bias;
41
+    static __align8 int16_t temp_block[64];
42 42
 
43 43
     //s->fdct (block);
44 44
     ff_fdct_mmx (block); //cant be anything else ...
... ...
@@ -1298,12 +1298,12 @@ void ff_simple_idct_mmx(int16_t *block)
1298 1298
 
1299 1299
 //FIXME merge add/put into the idct
1300 1300
 
1301
-void ff_simple_idct_put_mmx(UINT8 *dest, int line_size, DCTELEM *block)
1301
+void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block)
1302 1302
 {
1303 1303
     idct(block);
1304 1304
     put_pixels_clamped_mmx(block, dest, line_size);
1305 1305
 }
1306
-void ff_simple_idct_add_mmx(UINT8 *dest, int line_size, DCTELEM *block)
1306
+void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block)
1307 1307
 {
1308 1308
     idct(block);
1309 1309
     add_pixels_clamped_mmx(block, dest, line_size);
... ...
@@ -29,14 +29,14 @@
29 29
 
30 30
 typedef struct PixFmtInfo {
31 31
     const char *name;
32
-    UINT8 nb_components;     /* number of components in AVPicture array  */
33
-    UINT8 is_yuv : 1;    /* true if YUV instead of RGB color space */
34
-    UINT8 is_packed : 1; /* true if multiple components in same word */
35
-    UINT8 is_paletted : 1; /* true if paletted */
36
-    UINT8 is_alpha : 1;    /* true if alpha can be specified */
37
-    UINT8 is_gray : 1;     /* true if gray or monochrome format */
38
-    UINT8 x_chroma_shift; /* X chroma subsampling factor is 2 ^ shift */
39
-    UINT8 y_chroma_shift; /* Y chroma subsampling factor is 2 ^ shift */
32
+    uint8_t nb_components;     /* number of components in AVPicture array  */
33
+    uint8_t is_yuv : 1;    /* true if YUV instead of RGB color space */
34
+    uint8_t is_packed : 1; /* true if multiple components in same word */
35
+    uint8_t is_paletted : 1; /* true if paletted */
36
+    uint8_t is_alpha : 1;    /* true if alpha can be specified */
37
+    uint8_t is_gray : 1;     /* true if gray or monochrome format */
38
+    uint8_t x_chroma_shift; /* X chroma subsampling factor is 2 ^ shift */
39
+    uint8_t y_chroma_shift; /* Y chroma subsampling factor is 2 ^ shift */
40 40
 } PixFmtInfo;
41 41
 
42 42
 /* this table gives more information about formats */
... ...
@@ -136,7 +136,7 @@ const char *avcodec_get_pix_fmt_name(int pix_fmt)
136 136
 }
137 137
 
138 138
 /* Picture field are filled with 'ptr' addresses. Also return size */
139
-int avpicture_fill(AVPicture *picture, UINT8 *ptr,
139
+int avpicture_fill(AVPicture *picture, uint8_t *ptr,
140 140
                    int pix_fmt, int width, int height)
141 141
 {
142 142
     int size, w2, h2, size2;
... ...
@@ -223,9 +223,9 @@ int avpicture_get_size(int pix_fmt, int width, int height)
223 223
 static void yuv422_to_yuv420p(AVPicture *dst, AVPicture *src,
224 224
                               int width, int height)
225 225
 {
226
-    UINT8 *lum, *cb, *cr;
226
+    uint8_t *lum, *cb, *cr;
227 227
     int x, y;
228
-    const UINT8 *p;
228
+    const uint8_t *p;
229 229
  
230 230
     lum = dst->data[0];
231 231
     cb = dst->data[1];
... ...
@@ -258,12 +258,12 @@ static void yuv422_to_yuv420p(AVPicture *dst, AVPicture *src,
258 258
 
259 259
 /* XXX: use generic filter ? */
260 260
 /* 1x2 -> 1x1 */
261
-static void shrink2(UINT8 *dst, int dst_wrap, 
262
-                    UINT8 *src, int src_wrap,
261
+static void shrink2(uint8_t *dst, int dst_wrap, 
262
+                    uint8_t *src, int src_wrap,
263 263
                     int width, int height)
264 264
 {
265 265
     int w;
266
-    UINT8 *s1, *s2, *d;
266
+    uint8_t *s1, *s2, *d;
267 267
 
268 268
     for(;height > 0; height--) {
269 269
         s1 = src;
... ...
@@ -290,12 +290,12 @@ static void shrink2(UINT8 *dst, int dst_wrap,
290 290
 }
291 291
 
292 292
 /* 2x2 -> 1x1 */
293
-static void shrink22(UINT8 *dst, int dst_wrap, 
294
-                     UINT8 *src, int src_wrap,
293
+static void shrink22(uint8_t *dst, int dst_wrap, 
294
+                     uint8_t *src, int src_wrap,
295 295
                      int width, int height)
296 296
 {
297 297
     int w;
298
-    UINT8 *s1, *s2, *d;
298
+    uint8_t *s1, *s2, *d;
299 299
 
300 300
     for(;height > 0; height--) {
301 301
         s1 = src;
... ...
@@ -322,12 +322,12 @@ static void shrink22(UINT8 *dst, int dst_wrap,
322 322
 }
323 323
 
324 324
 /* 1x1 -> 2x2 */
325
-static void grow22(UINT8 *dst, int dst_wrap,
326
-                     UINT8 *src, int src_wrap,
325
+static void grow22(uint8_t *dst, int dst_wrap,
326
+                     uint8_t *src, int src_wrap,
327 327
                      int width, int height)
328 328
 {
329 329
     int w;
330
-    UINT8 *s1, *d;
330
+    uint8_t *s1, *d;
331 331
 
332 332
     for(;height > 0; height--) {
333 333
         s1 = src;
... ...
@@ -350,12 +350,12 @@ static void grow22(UINT8 *dst, int dst_wrap,
350 350
 }
351 351
 
352 352
 /* 1x2 -> 2x1 */
353
-static void conv411(UINT8 *dst, int dst_wrap, 
354
-                    UINT8 *src, int src_wrap,
353
+static void conv411(uint8_t *dst, int dst_wrap, 
354
+                    uint8_t *src, int src_wrap,
355 355
                     int width, int height)
356 356
 {
357 357
     int w, c;
358
-    UINT8 *s1, *s2, *d;
358
+    uint8_t *s1, *s2, *d;
359 359
 
360 360
     for(;height > 0; height--) {
361 361
         s1 = src;
... ...
@@ -374,8 +374,8 @@ static void conv411(UINT8 *dst, int dst_wrap,
374 374
     }
375 375
 }
376 376
 
377
-static void img_copy(UINT8 *dst, int dst_wrap, 
378
-                     UINT8 *src, int src_wrap,
377
+static void img_copy(uint8_t *dst, int dst_wrap, 
378
+                     uint8_t *src, int src_wrap,
379 379
                      int width, int height)
380 380
 {
381 381
     for(;height > 0; height--) {
... ...
@@ -407,9 +407,9 @@ static void img_copy(UINT8 *dst, int dst_wrap,
407 407
 static void yuv420p_to_ ## rgb_name (AVPicture *dst, AVPicture *src,    \
408 408
                                      int width, int height)             \
409 409
 {                                                                       \
410
-    UINT8 *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr, *d, *d1, *d2;             \
410
+    uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr, *d, *d1, *d2;             \
411 411
     int w, y, cb, cr, r_add, g_add, b_add, width2;                      \
412
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;                                 \
412
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;                                 \
413 413
     unsigned int r, g, b;                                               \
414 414
                                                                         \
415 415
     d = dst->data[0];                                                   \
... ...
@@ -521,9 +521,9 @@ static void yuv420p_to_ ## rgb_name (AVPicture *dst, AVPicture *src,    \
521 521
 static void yuv422p_to_ ## rgb_name (AVPicture *dst, AVPicture *src,    \
522 522
                                     int width, int height)              \
523 523
 {                                                                       \
524
-    UINT8 *y1_ptr, *cb_ptr, *cr_ptr, *d, *d1;                           \
524
+    uint8_t *y1_ptr, *cb_ptr, *cr_ptr, *d, *d1;                           \
525 525
     int w, y, cb, cr, r_add, g_add, b_add, width2;                      \
526
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;                                 \
526
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;                                 \
527 527
     unsigned int r, g, b;                                               \
528 528
                                                                         \
529 529
     d = dst->data[0];                                                   \
... ...
@@ -582,8 +582,8 @@ static void rgb_name ## _to_yuv420p(AVPicture *dst, AVPicture *src,     \
582 582
 {                                                                       \
583 583
     int wrap, wrap3, x, y;                                              \
584 584
     int r, g, b, r1, g1, b1;                                            \
585
-    UINT8 *lum, *cb, *cr;                                               \
586
-    const UINT8 *p;                                                     \
585
+    uint8_t *lum, *cb, *cr;                                               \
586
+    const uint8_t *p;                                                     \
587 587
                                                                         \
588 588
     lum = dst->data[0];                                                 \
589 589
     cb = dst->data[1];                                                  \
... ...
@@ -739,7 +739,7 @@ static inline unsigned int bitcopy_n(unsigned int a, int n)
739 739
 
740 740
 #define RGB_IN(r, g, b, s)\
741 741
 {\
742
-    unsigned int v = ((const UINT16 *)(s))[0];\
742
+    unsigned int v = ((const uint16_t *)(s))[0];\
743 743
     r = bitcopy_n(v >> (10 - 3), 3);\
744 744
     g = bitcopy_n(v >> (5 - 3), 3);\
745 745
     b = bitcopy_n(v << 3, 3);\
... ...
@@ -747,7 +747,7 @@ static inline unsigned int bitcopy_n(unsigned int a, int n)
747 747
 
748 748
 #define RGB_OUT(d, r, g, b)\
749 749
 {\
750
-    ((UINT16 *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3) | 0x8000;\
750
+    ((uint16_t *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3) | 0x8000;\
751 751
 }
752 752
 
753 753
 #define BPP 2
... ...
@@ -762,7 +762,7 @@ RGB_FUNCTIONS(rgb555)
762 762
 
763 763
 #define RGB_IN(r, g, b, s)\
764 764
 {\
765
-    unsigned int v = ((const UINT16 *)(s))[0];\
765
+    unsigned int v = ((const uint16_t *)(s))[0];\
766 766
     r = bitcopy_n(v >> (11 - 3), 3);\
767 767
     g = bitcopy_n(v >> (5 - 2), 2);\
768 768
     b = bitcopy_n(v << 3, 3);\
... ...
@@ -770,7 +770,7 @@ RGB_FUNCTIONS(rgb555)
770 770
 
771 771
 #define RGB_OUT(d, r, g, b)\
772 772
 {\
773
-    ((UINT16 *)(d))[0] = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);\
773
+    ((uint16_t *)(d))[0] = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);\
774 774
 }
775 775
 
776 776
 #define BPP 2
... ...
@@ -833,7 +833,7 @@ RGB_FUNCTIONS(rgb24)
833 833
 
834 834
 #define RGB_IN(r, g, b, s)\
835 835
 {\
836
-    unsigned int v = ((const UINT32 *)(s))[0];\
836
+    unsigned int v = ((const uint32_t *)(s))[0];\
837 837
     r = (v >> 16) & 0xff;\
838 838
     g = (v >> 8) & 0xff;\
839 839
     b = v & 0xff;\
... ...
@@ -841,7 +841,7 @@ RGB_FUNCTIONS(rgb24)
841 841
 
842 842
 #define RGB_OUT(d, r, g, b)\
843 843
 {\
844
-    ((UINT32 *)(d))[0] = (0xff << 24) | (r << 16) | (g << 8) | b;\
844
+    ((uint32_t *)(d))[0] = (0xff << 24) | (r << 16) | (g << 8) | b;\
845 845
 }
846 846
 
847 847
 #define BPP 4
... ...
@@ -971,8 +971,8 @@ static void gray_to_mono(AVPicture *dst, AVPicture *src,
971 971
                          int width, int height, int xor_mask)
972 972
 {
973 973
     int n;
974
-    const UINT8 *s;
975
-    UINT8 *d;
974
+    const uint8_t *s;
975
+    uint8_t *d;
976 976
     int j, b, v, n1, src_wrap, dst_wrap, y;
977 977
 
978 978
     s = src->data[0];
... ...
@@ -1025,7 +1025,7 @@ static void gray_to_monoblack(AVPicture *dst, AVPicture *src,
1025 1025
 }
1026 1026
 
1027 1027
 /* this is maybe slow, but allows for extensions */
1028
-static inline unsigned char gif_clut_index(UINT8 r, UINT8 g, UINT8 b)
1028
+static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
1029 1029
 {
1030 1030
     return ((((r)/47)%6)*6*6+(((g)/47)%6)*6+(((b)/47)%6));
1031 1031
 }
... ...
@@ -1330,8 +1330,8 @@ int img_convert(AVPicture *dst, int dst_pix_fmt,
1330 1330
     /* YUV to YUV */
1331 1331
     if (dst_pix->is_yuv && src_pix->is_yuv) {
1332 1332
         int x_shift, y_shift, w, h;
1333
-        void (*resize_func)(UINT8 *dst, int dst_wrap, 
1334
-                            UINT8 *src, int src_wrap,
1333
+        void (*resize_func)(uint8_t *dst, int dst_wrap, 
1334
+                            uint8_t *src, int src_wrap,
1335 1335
                             int width, int height);
1336 1336
 
1337 1337
         /* compute chroma size of the smallest dimensions */
... ...
@@ -1447,11 +1447,11 @@ int img_convert(AVPicture *dst, int dst_pix_fmt,
1447 1447
 #endif
1448 1448
 
1449 1449
 /* filter parameters: [-1 4 2 4 -1] // 8 */
1450
-static void deinterlace_line(UINT8 *dst, UINT8 *lum_m4, UINT8 *lum_m3, UINT8 *lum_m2, UINT8 *lum_m1, UINT8 *lum,
1450
+static void deinterlace_line(uint8_t *dst, uint8_t *lum_m4, uint8_t *lum_m3, uint8_t *lum_m2, uint8_t *lum_m1, uint8_t *lum,
1451 1451
                                 int size)
1452 1452
 {
1453 1453
 #ifndef HAVE_MMX
1454
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;
1454
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
1455 1455
     int sum;
1456 1456
 
1457 1457
     for(;size > 0;size--) {
... ...
@@ -1490,11 +1490,11 @@ static void deinterlace_line(UINT8 *dst, UINT8 *lum_m4, UINT8 *lum_m3, UINT8 *lu
1490 1490
     }
1491 1491
 #endif
1492 1492
 }
1493
-static void deinterlace_line_inplace(UINT8 *lum_m4, UINT8 *lum_m3, UINT8 *lum_m2, UINT8 *lum_m1, UINT8 *lum,
1493
+static void deinterlace_line_inplace(uint8_t *lum_m4, uint8_t *lum_m3, uint8_t *lum_m2, uint8_t *lum_m1, uint8_t *lum,
1494 1494
                              int size)
1495 1495
 {
1496 1496
 #ifndef HAVE_MMX
1497
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;
1497
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
1498 1498
     int sum;
1499 1499
 
1500 1500
     for(;size > 0;size--) {
... ...
@@ -1536,11 +1536,11 @@ static void deinterlace_line_inplace(UINT8 *lum_m4, UINT8 *lum_m3, UINT8 *lum_m2
1536 1536
 /* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
1537 1537
    top field is copied as is, but the bottom field is deinterlaced
1538 1538
    against the top field. */
1539
-static void deinterlace_bottom_field(UINT8 *dst, int dst_wrap,
1540
-                                    UINT8 *src1, int src_wrap,
1539
+static void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
1540
+                                    uint8_t *src1, int src_wrap,
1541 1541
                                     int width, int height)
1542 1542
 {
1543
-    UINT8 *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
1543
+    uint8_t *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
1544 1544
     int y;
1545 1545
 
1546 1546
     src_m2 = src1;
... ...
@@ -1565,13 +1565,13 @@ static void deinterlace_bottom_field(UINT8 *dst, int dst_wrap,
1565 1565
     deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width);
1566 1566
 }
1567 1567
 
1568
-static void deinterlace_bottom_field_inplace(UINT8 *src1, int src_wrap,
1568
+static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
1569 1569
                                      int width, int height)
1570 1570
 {
1571
-    UINT8 *src_m1, *src_0, *src_p1, *src_p2;
1571
+    uint8_t *src_m1, *src_0, *src_p1, *src_p2;
1572 1572
     int y;
1573
-    UINT8 *buf;
1574
-    buf = (UINT8*)av_malloc(width);
1573
+    uint8_t *buf;
1574
+    buf = (uint8_t*)av_malloc(width);
1575 1575
 
1576 1576
     src_m1 = src1;
1577 1577
     memcpy(buf,src_m1,width);
... ...
@@ -41,9 +41,9 @@
41 41
 struct ImgReSampleContext {
42 42
     int iwidth, iheight, owidth, oheight, topBand, bottomBand, leftBand, rightBand;
43 43
     int h_incr, v_incr;
44
-    INT16 h_filters[NB_PHASES][NB_TAPS] __align8; /* horizontal filters */
45
-    INT16 v_filters[NB_PHASES][NB_TAPS] __align8; /* vertical filters */
46
-    UINT8 *line_buf;
44
+    int16_t h_filters[NB_PHASES][NB_TAPS] __align8; /* horizontal filters */
45
+    int16_t v_filters[NB_PHASES][NB_TAPS] __align8; /* vertical filters */
46
+    uint8_t *line_buf;
47 47
 };
48 48
 
49 49
 static inline int get_phase(int pos)
... ...
@@ -52,12 +52,12 @@ static inline int get_phase(int pos)
52 52
 }
53 53
 
54 54
 /* This function must be optimized */
55
-static void h_resample_fast(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
56
-                            int src_start, int src_incr, INT16 *filters)
55
+static void h_resample_fast(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
56
+                            int src_start, int src_incr, int16_t *filters)
57 57
 {
58 58
     int src_pos, phase, sum, i;
59
-    UINT8 *s;
60
-    INT16 *filter;
59
+    uint8_t *s;
60
+    int16_t *filter;
61 61
 
62 62
     src_pos = src_start;
63 63
     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
95 95
 }
96 96
 
97 97
 /* This function must be optimized */
98
-static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap, 
99
-                       INT16 *filter)
98
+static void v_resample(uint8_t *dst, int dst_width, uint8_t *src, int wrap, 
99
+                       int16_t *filter)
100 100
 {
101 101
     int sum, i;
102
-    UINT8 *s;
102
+    uint8_t *s;
103 103
 
104 104
     s = src;
105 105
     for(i=0;i<dst_width;i++) {
... ...
@@ -111,7 +111,7 @@ static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
111 111
 #else
112 112
         {
113 113
             int j;
114
-            UINT8 *s1 = s;
114
+            uint8_t *s1 = s;
115 115
 
116 116
             sum = 0;
117 117
             for(j=0;j<NB_TAPS;j++) {
... ...
@@ -154,12 +154,12 @@ static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
154 154
 #define DUMP(reg) movq_r2m(reg, tmp); printf(#reg "=%016Lx\n", tmp.uq);
155 155
 
156 156
 /* XXX: do four pixels at a time */
157
-static void h_resample_fast4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
158
-                                 int src_start, int src_incr, INT16 *filters)
157
+static void h_resample_fast4_mmx(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
158
+                                 int src_start, int src_incr, int16_t *filters)
159 159
 {
160 160
     int src_pos, phase;
161
-    UINT8 *s;
162
-    INT16 *filter;
161
+    uint8_t *s;
162
+    int16_t *filter;
163 163
     mmx_t tmp;
164 164
     
165 165
     src_pos = src_start;
... ...
@@ -198,11 +198,11 @@ static void h_resample_fast4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int src_
198 198
     emms();
199 199
 }
200 200
 
201
-static void v_resample4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int wrap, 
202
-                            INT16 *filter)
201
+static void v_resample4_mmx(uint8_t *dst, int dst_width, uint8_t *src, int wrap, 
202
+                            int16_t *filter)
203 203
 {
204 204
     int sum, i, v;
205
-    UINT8 *s;
205
+    uint8_t *s;
206 206
     mmx_t tmp;
207 207
     mmx_t coefs[4];
208 208
     
... ...
@@ -239,7 +239,7 @@ static void v_resample4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
239 239
         packuswb_r2r(mm7, mm0);
240 240
         movq_r2m(mm0, tmp);
241 241
 
242
-        *(UINT32 *)dst = tmp.ud[0];
242
+        *(uint32_t *)dst = tmp.ud[0];
243 243
         dst += 4;
244 244
         s += 4;
245 245
         dst_width -= 4;
... ...
@@ -274,8 +274,8 @@ typedef	union {
274 274
     signed short s[8];
275 275
 } vec_ss_t;
276 276
 
277
-void v_resample16_altivec(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
278
-                            INT16 *filter)
277
+void v_resample16_altivec(uint8_t *dst, int dst_width, uint8_t *src, int wrap,
278
+                            int16_t *filter)
279 279
 {
280 280
     int sum, i;
281 281
     uint8_t *s;
... ...
@@ -391,12 +391,12 @@ void v_resample16_altivec(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
391 391
 #endif
392 392
 
393 393
 /* slow version to handle limit cases. Does not need optimisation */
394
-static void h_resample_slow(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
395
-                            int src_start, int src_incr, INT16 *filters)
394
+static void h_resample_slow(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
395
+                            int src_start, int src_incr, int16_t *filters)
396 396
 {
397 397
     int src_pos, phase, sum, j, v, i;
398
-    UINT8 *s, *src_end;
399
-    INT16 *filter;
398
+    uint8_t *s, *src_end;
399
+    int16_t *filter;
400 400
 
401 401
     src_end = src + src_width;
402 402
     src_pos = src_start;
... ...
@@ -426,8 +426,8 @@ static void h_resample_slow(UINT8 *dst, int dst_width, UINT8 *src, int src_width
426 426
     }
427 427
 }
428 428
 
429
-static void h_resample(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
430
-                       int src_start, int src_incr, INT16 *filters)
429
+static void h_resample(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
430
+                       int src_start, int src_incr, int16_t *filters)
431 431
 {
432 432
     int n, src_end;
433 433
 
... ...
@@ -463,11 +463,11 @@ static void h_resample(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
463 463
 }
464 464
 
465 465
 static void component_resample(ImgReSampleContext *s, 
466
-                               UINT8 *output, int owrap, int owidth, int oheight,
467
-                               UINT8 *input, int iwrap, int iwidth, int iheight)
466
+                               uint8_t *output, int owrap, int owidth, int oheight,
467
+                               uint8_t *input, int iwrap, int iwidth, int iheight)
468 468
 {
469 469
     int src_y, src_y1, last_src_y, ring_y, phase_y, y1, y;
470
-    UINT8 *new_line, *src_line;
470
+    uint8_t *new_line, *src_line;
471 471
 
472 472
     last_src_y = - FCENTER - 1;
473 473
     /* position of the bottom of the filter in the source image */
... ...
@@ -528,7 +528,7 @@ static void component_resample(ImgReSampleContext *s,
528 528
 
529 529
 /* XXX: the following filter is quite naive, but it seems to suffice
530 530
    for 4 taps */
531
-static void build_filter(INT16 *filter, float factor)
531
+static void build_filter(int16_t *filter, float factor)
532 532
 {
533 533
     int ph, i, v;
534 534
     float x, y, tab[NB_TAPS], norm, mult;
... ...
@@ -641,15 +641,15 @@ void av_free(void *ptr)
641 641
 /* input */
642 642
 #define XSIZE 256
643 643
 #define YSIZE 256
644
-UINT8 img[XSIZE * YSIZE];
644
+uint8_t img[XSIZE * YSIZE];
645 645
 
646 646
 /* output */
647 647
 #define XSIZE1 512
648 648
 #define YSIZE1 512
649
-UINT8 img1[XSIZE1 * YSIZE1];
650
-UINT8 img2[XSIZE1 * YSIZE1];
649
+uint8_t img1[XSIZE1 * YSIZE1];
650
+uint8_t img2[XSIZE1 * YSIZE1];
651 651
 
652
-void save_pgm(const char *filename, UINT8 *img, int xsize, int ysize)
652
+void save_pgm(const char *filename, uint8_t *img, int xsize, int ysize)
653 653
 {
654 654
     FILE *f;
655 655
     f=fopen(filename,"w");
... ...
@@ -658,7 +658,7 @@ void save_pgm(const char *filename, UINT8 *img, int xsize, int ysize)
658 658
     fclose(f);
659 659
 }
660 660
 
661
-static void dump_filter(INT16 *filter)
661
+static void dump_filter(int16_t *filter)
662 662
 {
663 663
     int i, ph;
664 664
 
... ...
@@ -78,10 +78,10 @@
78 78
  */
79 79
 
80 80
 #if CONST_BITS == 8
81
-#define FIX_0_382683433  ((INT32)   98)		/* FIX(0.382683433) */
82
-#define FIX_0_541196100  ((INT32)  139)		/* FIX(0.541196100) */
83
-#define FIX_0_707106781  ((INT32)  181)		/* FIX(0.707106781) */
84
-#define FIX_1_306562965  ((INT32)  334)		/* FIX(1.306562965) */
81
+#define FIX_0_382683433  ((int32_t)   98)		/* FIX(0.382683433) */
82
+#define FIX_0_541196100  ((int32_t)  139)		/* FIX(0.541196100) */
83
+#define FIX_0_707106781  ((int32_t)  181)		/* FIX(0.707106781) */
84
+#define FIX_1_306562965  ((int32_t)  334)		/* FIX(1.306562965) */
85 85
 #else
86 86
 #define FIX_0_382683433  FIX(0.382683433)
87 87
 #define FIX_0_541196100  FIX(0.541196100)
... ...
@@ -101,7 +101,7 @@
101 101
 #endif
102 102
 
103 103
 
104
-/* Multiply a DCTELEM variable by an INT32 constant, and immediately
104
+/* Multiply a DCTELEM variable by an int32_t constant, and immediately
105 105
  * descale to yield a DCTELEM result.
106 106
  */
107 107
 
... ...
@@ -78,7 +78,7 @@
78 78
  * they are represented to better-than-integral precision.  These outputs
79 79
  * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
80 80
  * with the recommended scaling.  (For 12-bit sample data, the intermediate
81
- * array is INT32 anyway.)
81
+ * array is int32_t anyway.)
82 82
  *
83 83
  * To avoid overflow of the 32-bit intermediate results in pass 2, we must
84 84
  * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
... ...
@@ -101,18 +101,18 @@
101 101
  */
102 102
 
103 103
 #if CONST_BITS == 13
104
-#define FIX_0_298631336  ((INT32)  2446)	/* FIX(0.298631336) */
105
-#define FIX_0_390180644  ((INT32)  3196)	/* FIX(0.390180644) */
106
-#define FIX_0_541196100  ((INT32)  4433)	/* FIX(0.541196100) */
107
-#define FIX_0_765366865  ((INT32)  6270)	/* FIX(0.765366865) */
108
-#define FIX_0_899976223  ((INT32)  7373)	/* FIX(0.899976223) */
109
-#define FIX_1_175875602  ((INT32)  9633)	/* FIX(1.175875602) */
110
-#define FIX_1_501321110  ((INT32)  12299)	/* FIX(1.501321110) */
111
-#define FIX_1_847759065  ((INT32)  15137)	/* FIX(1.847759065) */
112
-#define FIX_1_961570560  ((INT32)  16069)	/* FIX(1.961570560) */
113
-#define FIX_2_053119869  ((INT32)  16819)	/* FIX(2.053119869) */
114
-#define FIX_2_562915447  ((INT32)  20995)	/* FIX(2.562915447) */
115
-#define FIX_3_072711026  ((INT32)  25172)	/* FIX(3.072711026) */
104
+#define FIX_0_298631336  ((int32_t)  2446)	/* FIX(0.298631336) */
105
+#define FIX_0_390180644  ((int32_t)  3196)	/* FIX(0.390180644) */
106
+#define FIX_0_541196100  ((int32_t)  4433)	/* FIX(0.541196100) */
107
+#define FIX_0_765366865  ((int32_t)  6270)	/* FIX(0.765366865) */
108
+#define FIX_0_899976223  ((int32_t)  7373)	/* FIX(0.899976223) */
109
+#define FIX_1_175875602  ((int32_t)  9633)	/* FIX(1.175875602) */
110
+#define FIX_1_501321110  ((int32_t)  12299)	/* FIX(1.501321110) */
111
+#define FIX_1_847759065  ((int32_t)  15137)	/* FIX(1.847759065) */
112
+#define FIX_1_961570560  ((int32_t)  16069)	/* FIX(1.961570560) */
113
+#define FIX_2_053119869  ((int32_t)  16819)	/* FIX(2.053119869) */
114
+#define FIX_2_562915447  ((int32_t)  20995)	/* FIX(2.562915447) */
115
+#define FIX_3_072711026  ((int32_t)  25172)	/* FIX(3.072711026) */
116 116
 #else
117 117
 #define FIX_0_298631336  FIX(0.298631336)
118 118
 #define FIX_0_390180644  FIX(0.390180644)
... ...
@@ -129,7 +129,7 @@
129 129
 #endif
130 130
 
131 131
 
132
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
132
+/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
133 133
  * For 8-bit samples with the recommended scaling, all the variable
134 134
  * and constant values involved are no more than 16 bits wide, so a
135 135
  * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
... ...
@@ -150,9 +150,9 @@
150 150
 GLOBAL(void)
151 151
 ff_jpeg_fdct_islow (DCTELEM * data)
152 152
 {
153
-  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
154
-  INT32 tmp10, tmp11, tmp12, tmp13;
155
-  INT32 z1, z2, z3, z4, z5;
153
+  int32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
154
+  int32_t tmp10, tmp11, tmp12, tmp13;
155
+  int32_t z1, z2, z3, z4, z5;
156 156
   DCTELEM *dataptr;
157 157
   int ctr;
158 158
   SHIFT_TEMPS
... ...
@@ -92,7 +92,7 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2];
92 92
 #define PASS1_BITS  1		/* lose a little precision to avoid overflow */
93 93
 #endif
94 94
 
95
-#define ONE	((INT32) 1)
95
+#define ONE	((int32_t) 1)
96 96
 
97 97
 #define CONST_SCALE (ONE << CONST_BITS)
98 98
 
... ...
@@ -103,16 +103,16 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2];
103 103
  */
104 104
 
105 105
 /* Actually FIX is no longer used, we precomputed them all */
106
-#define FIX(x)	((INT32) ((x) * CONST_SCALE + 0.5)) 
106
+#define FIX(x)	((int32_t) ((x) * CONST_SCALE + 0.5)) 
107 107
 
108
-/* Descale and correctly round an INT32 value that's scaled by N bits.
108
+/* Descale and correctly round an int32_t value that's scaled by N bits.
109 109
  * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
110 110
  * the fudge factor is correct for either sign of X.
111 111
  */
112 112
 
113 113
 #define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
114 114
 
115
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
115
+/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
116 116
  * For 8-bit samples with the recommended scaling, all the variable
117 117
  * and constant values involved are no more than 16 bits wide, so a
118 118
  * 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
... ...
@@ -125,10 +125,10 @@ typedef DCTELEM DCTBLOCK[DCTSIZE2];
125 125
 
126 126
 #ifdef EIGHT_BIT_SAMPLES
127 127
 #ifdef SHORTxSHORT_32		/* may work if 'int' is 32 bits */
128
-#define MULTIPLY(var,const)  (((INT16) (var)) * ((INT16) (const)))
128
+#define MULTIPLY(var,const)  (((int16_t) (var)) * ((int16_t) (const)))
129 129
 #endif
130 130
 #ifdef SHORTxLCONST_32		/* known to work with Microsoft C 6.0 */
131
-#define MULTIPLY(var,const)  (((INT16) (var)) * ((INT32) (const)))
131
+#define MULTIPLY(var,const)  (((int16_t) (var)) * ((int32_t) (const)))
132 132
 #endif
133 133
 #endif
134 134
 
... ...
@@ -172,10 +172,10 @@ ones here or successive P-frames will drift too much with Reference frame coding
172 172
 
173 173
 void j_rev_dct(DCTBLOCK data)
174 174
 {
175
-  INT32 tmp0, tmp1, tmp2, tmp3;
176
-  INT32 tmp10, tmp11, tmp12, tmp13;
177
-  INT32 z1, z2, z3, z4, z5;
178
-  INT32 d0, d1, d2, d3, d4, d5, d6, d7;
175
+  int32_t tmp0, tmp1, tmp2, tmp3;
176
+  int32_t tmp10, tmp11, tmp12, tmp13;
177
+  int32_t z1, z2, z3, z4, z5;
178
+  int32_t d0, d1, d2, d3, d4, d5, d6, d7;
179 179
   register DCTELEM *dataptr;
180 180
   int rowctr;
181 181
    
... ...
@@ -24,11 +24,11 @@
24 24
  * libavcodec api, context stuff, interlaced stereo out).
25 25
  */
26 26
 
27
-static const UINT16 MACEtab1[] = { 0xfff3, 0x0008, 0x004c, 0x00de, 0x00de, 0x004c, 0x0008, 0xfff3 };
27
+static const uint16_t MACEtab1[] = { 0xfff3, 0x0008, 0x004c, 0x00de, 0x00de, 0x004c, 0x0008, 0xfff3 };
28 28
 
29
-static const UINT16 MACEtab3[] = { 0xffee, 0x008c, 0x008c, 0xffee };
29
+static const uint16_t MACEtab3[] = { 0xffee, 0x008c, 0x008c, 0xffee };
30 30
 
31
-static const UINT16 MACEtab2[][8] = {
31
+static const uint16_t MACEtab2[][8] = {
32 32
     { 0x0025, 0x0074, 0x00CE, 0x014A, 0xFEB5, 0xFF31, 0xFF8B, 0xFFDA },
33 33
     { 0x0027, 0x0079, 0x00D8, 0x015A, 0xFEA5, 0xFF27, 0xFF86, 0xFFD8 },
34 34
     { 0x0029, 0x007F, 0x00E1, 0x0169, 0xFE96, 0xFF1E, 0xFF80, 0xFFD6 },
... ...
@@ -159,7 +159,7 @@ static const UINT16 MACEtab2[][8] = {
159 159
     { 0x25A7, 0x741F, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x8BE0, 0xDA58 },
160 160
 };
161 161
 
162
-static const UINT16 MACEtab4[][8] = {
162
+static const uint16_t MACEtab4[][8] = {
163 163
     { 0x0040, 0x00D8, 0xFF27, 0xFFBF, 0, 0, 0, 0 },  { 0x0043, 0x00E2, 0xFF1D, 0xFFBC, 0, 0, 0, 0 },
164 164
     { 0x0046, 0x00EC, 0xFF13, 0xFFB9, 0, 0, 0, 0 },  { 0x004A, 0x00F6, 0xFF09, 0xFFB5, 0, 0, 0, 0 },
165 165
     { 0x004D, 0x0101, 0xFEFE, 0xFFB2, 0, 0, 0, 0 },  { 0x0050, 0x010C, 0xFEF3, 0xFFAF, 0, 0, 0, 0 },
... ...
@@ -234,9 +234,9 @@ typedef struct MACEContext {
234 234
 
235 235
 /* /// "chomp3()" */
236 236
 static void chomp3(MACEContext *ctx,
237
-            UINT8 val,
238
-            const UINT16 tab1[],
239
-            const UINT16 tab2[][8])
237
+            uint8_t val,
238
+            const uint16_t tab1[],
239
+            const uint16_t tab2[][8])
240 240
 {
241 241
   short current;
242 242
 
... ...
@@ -253,13 +253,13 @@ static void chomp3(MACEContext *ctx,
253 253
 
254 254
 /* /// "Exp1to3()" */
255 255
 static void Exp1to3(MACEContext *ctx,
256
-             UINT8 *inBuffer,
256
+             uint8_t *inBuffer,
257 257
              void *outBuffer,
258
-             UINT32 cnt,
259
-             UINT32 numChannels,
260
-             UINT32 whichChannel)
258
+             uint32_t cnt,
259
+             uint32_t numChannels,
260
+             uint32_t whichChannel)
261 261
 {
262
-   UINT8 pkt;
262
+   uint8_t pkt;
263 263
 
264 264
 /*
265 265
    if (inState) {
... ...
@@ -298,9 +298,9 @@ static void Exp1to3(MACEContext *ctx,
298 298
 
299 299
 /* /// "chomp6()" */
300 300
 static void chomp6(MACEContext *ctx,
301
-            UINT8 val,
302
-            const UINT16 tab1[],
303
-            const UINT16 tab2[][8])
301
+            uint8_t val,
302
+            const uint16_t tab1[],
303
+            const uint16_t tab2[][8])
304 304
 {
305 305
   short current;
306 306
 
... ...
@@ -335,13 +335,13 @@ static void chomp6(MACEContext *ctx,
335 335
 
336 336
 /* /// "Exp1to6()" */
337 337
 static void Exp1to6(MACEContext *ctx,
338
-             UINT8 *inBuffer,
338
+             uint8_t *inBuffer,
339 339
              void *outBuffer,
340
-             UINT32 cnt,
341
-             UINT32 numChannels,
342
-             UINT32 whichChannel)
340
+             uint32_t cnt,
341
+             uint32_t numChannels,
342
+             uint32_t whichChannel)
343 343
 {
344
-   UINT8 pkt;
344
+   uint8_t pkt;
345 345
 
346 346
 /*
347 347
    if (inState) {
... ...
@@ -389,7 +389,7 @@ static int mace_decode_init(AVCodecContext * avctx)
389 389
 
390 390
 static int mace_decode_frame(AVCodecContext *avctx,
391 391
                             void *data, int *data_size,
392
-                            UINT8 *buf, int buf_size)
392
+                            uint8_t *buf, int buf_size)
393 393
 {
394 394
     short *samples;
395 395
     MACEContext *c = avctx->priv_data;
... ...
@@ -30,15 +30,15 @@
30 30
 #undef TWOMATRIXES
31 31
 
32 32
 typedef struct MJpegContext {
33
-    UINT8 huff_size_dc_luminance[12];
34
-    UINT16 huff_code_dc_luminance[12];
35
-    UINT8 huff_size_dc_chrominance[12];
36
-    UINT16 huff_code_dc_chrominance[12];
37
-
38
-    UINT8 huff_size_ac_luminance[256];
39
-    UINT16 huff_code_ac_luminance[256];
40
-    UINT8 huff_size_ac_chrominance[256];
41
-    UINT16 huff_code_ac_chrominance[256];
33
+    uint8_t huff_size_dc_luminance[12];
34
+    uint16_t huff_code_dc_luminance[12];
35
+    uint8_t huff_size_dc_chrominance[12];
36
+    uint16_t huff_code_dc_chrominance[12];
37
+
38
+    uint8_t huff_size_ac_luminance[256];
39
+    uint16_t huff_code_ac_luminance[256];
40
+    uint8_t huff_size_ac_chrominance[256];
41
+    uint16_t huff_code_ac_chrominance[256];
42 42
 } MJpegContext;
43 43
 
44 44
 /* JPEG marker codes */
... ...
@@ -152,19 +152,19 @@ static const unsigned char std_chrominance_quant_tbl[64] = {
152 152
 
153 153
 /* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
154 154
 /* IMPORTANT: these are only valid for 8-bit data precision! */
155
-static const UINT8 bits_dc_luminance[17] =
155
+static const uint8_t bits_dc_luminance[17] =
156 156
 { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
157
-static const UINT8 val_dc_luminance[] =
157
+static const uint8_t val_dc_luminance[] =
158 158
 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
159 159
 
160
-static const UINT8 bits_dc_chrominance[17] =
160
+static const uint8_t bits_dc_chrominance[17] =
161 161
 { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
162
-static const UINT8 val_dc_chrominance[] =
162
+static const uint8_t val_dc_chrominance[] =
163 163
 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
164 164
 
165
-static const UINT8 bits_ac_luminance[17] =
165
+static const uint8_t bits_ac_luminance[17] =
166 166
 { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
167
-static const UINT8 val_ac_luminance[] =
167
+static const uint8_t val_ac_luminance[] =
168 168
 { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
169 169
   0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
170 170
   0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
... ...
@@ -188,10 +188,10 @@ static const UINT8 val_ac_luminance[] =
188 188
   0xf9, 0xfa 
189 189
 };
190 190
 
191
-static const UINT8 bits_ac_chrominance[17] =
191
+static const uint8_t bits_ac_chrominance[17] =
192 192
 { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
193 193
 
194
-static const UINT8 val_ac_chrominance[] =
194
+static const uint8_t val_ac_chrominance[] =
195 195
 { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
196 196
   0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
197 197
   0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
... ...
@@ -216,8 +216,8 @@ static const UINT8 val_ac_chrominance[] =
216 216
 };
217 217
 
218 218
 /* isn't this function nicer than the one in the libjpeg ? */
219
-static void build_huffman_codes(UINT8 *huff_size, UINT16 *huff_code,
220
-                                const UINT8 *bits_table, const UINT8 *val_table)
219
+static void build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
220
+                                const uint8_t *bits_table, const uint8_t *val_table)
221 221
 {
222 222
     int i, j, k,nb, code, sym;
223 223
 
... ...
@@ -282,7 +282,7 @@ static inline void put_marker(PutBitContext *p, int code)
282 282
 
283 283
 /* table_class: 0 = DC coef, 1 = AC coefs */
284 284
 static int put_huffman_table(MpegEncContext *s, int table_class, int table_id,
285
-                             const UINT8 *bits_table, const UINT8 *value_table)
285
+                             const uint8_t *bits_table, const uint8_t *value_table)
286 286
 {
287 287
     PutBitContext *p = &s->pb;
288 288
     int n, i;
... ...
@@ -306,7 +306,7 @@ static void jpeg_table_header(MpegEncContext *s)
306 306
 {
307 307
     PutBitContext *p = &s->pb;
308 308
     int i, j, size;
309
-    UINT8 *ptr;
309
+    uint8_t *ptr;
310 310
 
311 311
     /* quant matrixes */
312 312
     put_marker(p, DQT);
... ...
@@ -349,7 +349,7 @@ static void jpeg_put_comments(MpegEncContext *s)
349 349
 {
350 350
     PutBitContext *p = &s->pb;
351 351
     int size;
352
-    UINT8 *ptr;
352
+    uint8_t *ptr;
353 353
 
354 354
     if (s->aspect_ratio_info)
355 355
     {
... ...
@@ -541,7 +541,7 @@ void mjpeg_picture_trailer(MpegEncContext *s)
541 541
 }
542 542
 
543 543
 static inline void mjpeg_encode_dc(MpegEncContext *s, int val,
544
-				   UINT8 *huff_size, UINT16 *huff_code)
544
+				   uint8_t *huff_size, uint16_t *huff_code)
545 545
 {
546 546
     int mant, nbits;
547 547
 
... ...
@@ -572,8 +572,8 @@ static void encode_block(MpegEncContext *s, DCTELEM *block, int n)
572 572
     int mant, nbits, code, i, j;
573 573
     int component, dc, run, last_index, val;
574 574
     MJpegContext *m = s->mjpeg_ctx;
575
-    UINT8 *huff_size_ac;
576
-    UINT16 *huff_code_ac;
575
+    uint8_t *huff_size_ac;
576
+    uint16_t *huff_code_ac;
577 577
     
578 578
     /* DC coef */
579 579
     component = (n <= 3 ? 0 : n - 4 + 1);
... ...
@@ -651,9 +651,9 @@ typedef struct MJpegDecodeContext {
651 651
 
652 652
     int start_code; /* current start code */
653 653
     int buffer_size;
654
-    UINT8 *buffer;
654
+    uint8_t *buffer;
655 655
 
656
-    INT16 quant_matrixes[4][64];
656
+    int16_t quant_matrixes[4][64];
657 657
     VLC vlcs[2][4];
658 658
 
659 659
     int org_width, org_height;  /* size given at codec init */
... ...
@@ -669,11 +669,11 @@ typedef struct MJpegDecodeContext {
669 669
     int h_max, v_max; /* maximum h and v counts */
670 670
     int quant_index[4];   /* quant table index for each component */
671 671
     int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
672
-    UINT8 *current_picture[MAX_COMPONENTS]; /* picture structure */
672
+    uint8_t *current_picture[MAX_COMPONENTS]; /* picture structure */
673 673
     int linesize[MAX_COMPONENTS];
674 674
     DCTELEM block[64] __align8;
675 675
     ScanTable scantable;
676
-    void (*idct_put)(UINT8 *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
676
+    void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
677 677
 
678 678
     int restart_interval;
679 679
     int restart_count;
... ...
@@ -684,11 +684,11 @@ typedef struct MJpegDecodeContext {
684 684
 
685 685
 static int mjpeg_decode_dht(MJpegDecodeContext *s);
686 686
 
687
-static void build_vlc(VLC *vlc, const UINT8 *bits_table, const UINT8 *val_table, 
687
+static void build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table, 
688 688
                       int nb_codes)
689 689
 {
690
-    UINT8 huff_size[256];
691
-    UINT16 huff_code[256];
690
+    uint8_t huff_size[256];
691
+    uint16_t huff_code[256];
692 692
 
693 693
     memset(huff_size, 0, sizeof(huff_size));
694 694
     build_huffman_codes(huff_size, huff_code, bits_table, val_table);
... ...
@@ -776,8 +776,8 @@ static int mjpeg_decode_dqt(MJpegDecodeContext *s)
776 776
 static int mjpeg_decode_dht(MJpegDecodeContext *s)
777 777
 {
778 778
     int len, index, i, class, n, v, code_max;
779
-    UINT8 bits_table[17];
780
-    UINT8 val_table[256];
779
+    uint8_t bits_table[17];
780
+    uint8_t val_table[256];
781 781
     
782 782
     len = get_bits(&s->gb, 16) - 2;
783 783
 
... ...
@@ -928,7 +928,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
928 928
     int nbits, code, i, j, level;
929 929
     int run, val;
930 930
     VLC *ac_vlc;
931
-    INT16 *quant_matrix;
931
+    int16_t *quant_matrix;
932 932
 
933 933
     /* DC coef */
934 934
     val = mjpeg_decode_dc(s, dc_index);
... ...
@@ -1071,7 +1071,7 @@ static int mjpeg_decode_sos(MJpegDecodeContext *s)
1071 1071
     for(mb_y = 0; mb_y < mb_height; mb_y++) {
1072 1072
         for(mb_x = 0; mb_x < mb_width; mb_x++) {
1073 1073
             for(i=0;i<nb_components;i++) {
1074
-                UINT8 *ptr;
1074
+                uint8_t *ptr;
1075 1075
                 int x, y, c;
1076 1076
                 n = nb_blocks[i];
1077 1077
                 c = comp_index[i];
... ...
@@ -1266,7 +1266,7 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
1266 1266
     unsigned int len = get_bits(&s->gb, 16);
1267 1267
     if (len >= 2 && len < 32768) {
1268 1268
 	/* XXX: any better upper bound */
1269
-	UINT8 *cbuf = av_malloc(len - 1);
1269
+	uint8_t *cbuf = av_malloc(len - 1);
1270 1270
 	if (cbuf) {
1271 1271
 	    int i;
1272 1272
 	    for (i = 0; i < len - 2; i++)
... ...
@@ -1318,9 +1318,9 @@ static int valid_marker_list[] =
1318 1318
 
1319 1319
 /* return the 8 bit start code value and update the search
1320 1320
    state. Return -1 if no start code found */
1321
-static int find_marker(UINT8 **pbuf_ptr, UINT8 *buf_end)
1321
+static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end)
1322 1322
 {
1323
-    UINT8 *buf_ptr;
1323
+    uint8_t *buf_ptr;
1324 1324
     unsigned int v, v2;
1325 1325
     int val;
1326 1326
 #ifdef DEBUG
... ...
@@ -1350,10 +1350,10 @@ found:
1350 1350
 
1351 1351
 static int mjpeg_decode_frame(AVCodecContext *avctx, 
1352 1352
                               void *data, int *data_size,
1353
-                              UINT8 *buf, int buf_size)
1353
+                              uint8_t *buf, int buf_size)
1354 1354
 {
1355 1355
     MJpegDecodeContext *s = avctx->priv_data;
1356
-    UINT8 *buf_end, *buf_ptr;
1356
+    uint8_t *buf_end, *buf_ptr;
1357 1357
     int i, start_code;
1358 1358
     AVPicture *picture = data;
1359 1359
 
... ...
@@ -1387,12 +1387,12 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
1387 1387
 		/* unescape buffer of SOS */
1388 1388
 		if (start_code == SOS)
1389 1389
 		{
1390
-		    UINT8 *src = buf_ptr;
1391
-		    UINT8 *dst = s->buffer;
1390
+		    uint8_t *src = buf_ptr;
1391
+		    uint8_t *dst = s->buffer;
1392 1392
 
1393 1393
 		    while (src<buf_end)
1394 1394
 		    {
1395
-			UINT8 x = *(src++);
1395
+			uint8_t x = *(src++);
1396 1396
 
1397 1397
 			*(dst++) = x;
1398 1398
 			if (x == 0xff)
... ...
@@ -1527,10 +1527,10 @@ the_end:
1527 1527
 
1528 1528
 static int mjpegb_decode_frame(AVCodecContext *avctx, 
1529 1529
                               void *data, int *data_size,
1530
-                              UINT8 *buf, int buf_size)
1530
+                              uint8_t *buf, int buf_size)
1531 1531
 {
1532 1532
     MJpegDecodeContext *s = avctx->priv_data;
1533
-    UINT8 *buf_end, *buf_ptr;
1533
+    uint8_t *buf_end, *buf_ptr;
1534 1534
     int i;
1535 1535
     AVPicture *picture = data;
1536 1536
     GetBitContext hgb; /* for the header */
... ...
@@ -198,10 +198,10 @@ static void avg_pixels8_xy2_mlib (uint8_t * dest, const uint8_t * ref,
198 198
 }
199 199
 
200 200
 
201
-static void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
201
+static void (*put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
202 202
 
203 203
 
204
-static void add_pixels_clamped_mlib(const DCTELEM *block, UINT8 *pixels, int line_size)
204
+static void add_pixels_clamped_mlib(const DCTELEM *block, uint8_t *pixels, int line_size)
205 205
 {
206 206
     mlib_VideoAddBlock_U8_S16(pixels, (mlib_s16 *)block, line_size);
207 207
 }
... ...
@@ -209,13 +209,13 @@ static void add_pixels_clamped_mlib(const DCTELEM *block, UINT8 *pixels, int lin
209 209
 
210 210
 /* XXX: those functions should be suppressed ASAP when all IDCTs are
211 211
    converted */
212
-static void ff_idct_put_mlib(UINT8 *dest, int line_size, DCTELEM *data)
212
+static void ff_idct_put_mlib(uint8_t *dest, int line_size, DCTELEM *data)
213 213
 {
214 214
     mlib_VideoIDCT8x8_S16_S16 (data, data);
215 215
     put_pixels_clamped(data, dest, line_size);
216 216
 }
217 217
 
218
-static void ff_idct_add_mlib(UINT8 *dest, int line_size, DCTELEM *data)
218
+static void ff_idct_add_mlib(uint8_t *dest, int line_size, DCTELEM *data)
219 219
 {
220 220
     mlib_VideoIDCT8x8_S16_S16 (data, data);
221 221
     mlib_VideoAddBlock_U8_S16(dest, (mlib_s16 *)data, line_size);
... ...
@@ -387,7 +387,7 @@ void ff_init_me(MpegEncContext *s){
387 387
     }
388 388
 }
389 389
       
390
-static int pix_dev(UINT8 * pix, int line_size, int mean)
390
+static int pix_dev(uint8_t * pix, int line_size, int mean)
391 391
 {
392 392
     int s, i, j;
393 393
 
... ...
@@ -422,7 +422,7 @@ static int full_motion_search(MpegEncContext * s,
422 422
 {
423 423
     int x1, y1, x2, y2, xx, yy, x, y;
424 424
     int mx, my, dmin, d;
425
-    UINT8 *pix;
425
+    uint8_t *pix;
426 426
 
427 427
     xx = 16 * s->mb_x;
428 428
     yy = 16 * s->mb_y;
... ...
@@ -476,7 +476,7 @@ static int log_motion_search(MpegEncContext * s,
476 476
 {
477 477
     int x1, y1, x2, y2, xx, yy, x, y;
478 478
     int mx, my, dmin, d;
479
-    UINT8 *pix;
479
+    uint8_t *pix;
480 480
 
481 481
     xx = s->mb_x << 4;
482 482
     yy = s->mb_y << 4;
... ...
@@ -552,7 +552,7 @@ static int phods_motion_search(MpegEncContext * s,
552 552
 {
553 553
     int x1, y1, x2, y2, xx, yy, x, y, lastx, d;
554 554
     int mx, my, dminx, dminy;
555
-    UINT8 *pix;
555
+    uint8_t *pix;
556 556
 
557 557
     xx = s->mb_x << 4;
558 558
     yy = s->mb_y << 4;
... ...
@@ -657,7 +657,7 @@ static inline int sad_hpel_motion_search(MpegEncContext * s,
657 657
     uint32_t *score_map= s->me.score_map;
658 658
     const int penalty_factor= s->me.sub_penalty_factor;
659 659
     int mx, my, xx, yy, dminh;
660
-    UINT8 *pix, *ptr;
660
+    uint8_t *pix, *ptr;
661 661
     op_pixels_abs_func pix_abs_x2;
662 662
     op_pixels_abs_func pix_abs_y2;
663 663
     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
964 964
 void ff_estimate_p_frame_motion(MpegEncContext * s,
965 965
                                 int mb_x, int mb_y)
966 966
 {
967
-    UINT8 *pix, *ppix;
967
+    uint8_t *pix, *ppix;
968 968
     int sum, varc, vard, mx, my, range, dmin, xx, yy;
969 969
     int xmin, ymin, xmax, ymax;
970 970
     int rel_xmin, rel_ymin, rel_xmax, rel_ymax;
... ...
@@ -1302,7 +1302,7 @@ static inline int check_bidir_mv(MpegEncContext * s,
1302 1302
     //FIXME optimize?
1303 1303
     //FIXME move into template?
1304 1304
     //FIXME better f_code prediction (max mv & distance)
1305
-    UINT16 *mv_penalty= s->me.mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
1305
+    uint16_t *mv_penalty= s->me.mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
1306 1306
     uint8_t *dest_y = s->me.scratchpad;
1307 1307
     uint8_t *ptr;
1308 1308
     int dxy;
... ...
@@ -1535,7 +1535,7 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
1535 1535
     if(s->me_method>=ME_EPZS){
1536 1536
         int score[8];
1537 1537
         int i, y;
1538
-        UINT8 * fcode_tab= s->fcode_tab;
1538
+        uint8_t * fcode_tab= s->fcode_tab;
1539 1539
         int best_fcode=-1;
1540 1540
         int best_score=-10000000;
1541 1541
 
... ...
@@ -1584,7 +1584,7 @@ void ff_fix_long_p_mvs(MpegEncContext * s)
1584 1584
 {
1585 1585
     const int f_code= s->f_code;
1586 1586
     int y;
1587
-    UINT8 * fcode_tab= s->fcode_tab;
1587
+    uint8_t * fcode_tab= s->fcode_tab;
1588 1588
 //int clip=0;
1589 1589
 //int noclip=0;
1590 1590
     /* clip / convert to intra 16x16 type MVs */
... ...
@@ -1648,7 +1648,7 @@ void ff_fix_long_p_mvs(MpegEncContext * s)
1648 1648
 void ff_fix_long_b_mvs(MpegEncContext * s, int16_t (*mv_table)[2], int f_code, int type)
1649 1649
 {
1650 1650
     int y;
1651
-    UINT8 * fcode_tab= s->fcode_tab;
1651
+    uint8_t * fcode_tab= s->fcode_tab;
1652 1652
 
1653 1653
     // RAL: 8 in MPEG-1, 16 in MPEG-4
1654 1654
     int range = (((s->codec_id == CODEC_ID_MPEG1VIDEO) ? 8 : 16) << f_code);
... ...
@@ -9,27 +9,27 @@
9 9
 
10 10
 #include "i386/mmx.h"
11 11
 
12
-int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
13
-int pix_abs16x16_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
14
-int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
15
-int pix_abs16x16_x2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
16
-int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx);
17
-int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
18
-int pix_abs16x16_y2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
19
-int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx);
20
-int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
21
-int pix_abs16x16_xy2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
22
-int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx);
23
-
24
-typedef int motion_func(UINT8 *blk1, UINT8 *blk2, int lx);
12
+int pix_abs16x16_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
13
+int pix_abs16x16_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
14
+int pix_abs16x16_x2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
15
+int pix_abs16x16_x2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
16
+int pix_abs16x16_x2_c(uint8_t *blk1, uint8_t *blk2, int lx);
17
+int pix_abs16x16_y2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
18
+int pix_abs16x16_y2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
19
+int pix_abs16x16_y2_c(uint8_t *blk1, uint8_t *blk2, int lx);
20
+int pix_abs16x16_xy2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
21
+int pix_abs16x16_xy2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
22
+int pix_abs16x16_xy2_c(uint8_t *blk1, uint8_t *blk2, int lx);
23
+
24
+typedef int motion_func(uint8_t *blk1, uint8_t *blk2, int lx);
25 25
 
26 26
 #define WIDTH 64
27 27
 #define HEIGHT 64
28 28
 
29
-UINT8 img1[WIDTH * HEIGHT];
30
-UINT8 img2[WIDTH * HEIGHT];
29
+uint8_t img1[WIDTH * HEIGHT];
30
+uint8_t img2[WIDTH * HEIGHT];
31 31
 
32
-void fill_random(UINT8 *tab, int size)
32
+void fill_random(uint8_t *tab, int size)
33 33
 {
34 34
     int i;
35 35
     for(i=0;i<size;i++) {
... ...
@@ -48,11 +48,11 @@ void help(void)
48 48
     exit(1);
49 49
 }
50 50
 
51
-INT64 gettime(void)
51
+int64_t gettime(void)
52 52
 {
53 53
     struct timeval tv;
54 54
     gettimeofday(&tv,NULL);
55
-    return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
55
+    return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
56 56
 }
57 57
 
58 58
 #define NB_ITS 500
... ...
@@ -63,8 +63,8 @@ void test_motion(const char *name,
63 63
                  motion_func *test_func, motion_func *ref_func)
64 64
 {
65 65
     int x, y, d1, d2, it;
66
-    UINT8 *ptr;
67
-    INT64 ti;
66
+    uint8_t *ptr;
67
+    int64_t ti;
68 68
     printf("testing '%s'\n", name);
69 69
 
70 70
     /* test correctness */
... ...
@@ -67,8 +67,8 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
67 67
 static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred);
68 68
 
69 69
 #ifdef CONFIG_ENCODERS
70
-static UINT16 mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
71
-static UINT8 fcode_tab[MAX_MV*2+1];
70
+static uint16_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
71
+static uint8_t fcode_tab[MAX_MV*2+1];
72 72
 
73 73
 static uint32_t uni_mpeg1_ac_vlc_bits[64*64*2];
74 74
 static uint8_t  uni_mpeg1_ac_vlc_len [64*64*2];
... ...
@@ -182,7 +182,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
182 182
         unsigned int vbv_buffer_size;
183 183
         unsigned int fps, v;
184 184
         int n, i;
185
-        UINT64 time_code;
185
+        uint64_t time_code;
186 186
         float best_aspect_error= 1E10;
187 187
         float aspect_ratio= s->avctx->aspect_ratio;
188 188
         
... ...
@@ -242,13 +242,13 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
242 242
             /* time code : we must convert from the real frame rate to a
243 243
                fake mpeg frame rate in case of low frame rate */
244 244
             fps = frame_rate_tab[s->frame_rate_index];
245
-            time_code = (INT64)s->fake_picture_number * FRAME_RATE_BASE;
245
+            time_code = (int64_t)s->fake_picture_number * FRAME_RATE_BASE;
246 246
             s->gop_picture_number = s->fake_picture_number;
247
-            put_bits(&s->pb, 5, (UINT32)((time_code / (fps * 3600)) % 24));
248
-            put_bits(&s->pb, 6, (UINT32)((time_code / (fps * 60)) % 60));
247
+            put_bits(&s->pb, 5, (uint32_t)((time_code / (fps * 3600)) % 24));
248
+            put_bits(&s->pb, 6, (uint32_t)((time_code / (fps * 60)) % 60));
249 249
             put_bits(&s->pb, 1, 1);
250
-            put_bits(&s->pb, 6, (UINT32)((time_code / fps) % 60));
251
-            put_bits(&s->pb, 6, (UINT32)((time_code % fps) / FRAME_RATE_BASE));
250
+            put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60));
251
+            put_bits(&s->pb, 6, (uint32_t)((time_code % fps) / FRAME_RATE_BASE));
252 252
             put_bits(&s->pb, 1, 1); /* closed gop */
253 253
             put_bits(&s->pb, 1, 0); /* broken link */
254 254
         }
... ...
@@ -257,7 +257,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
257 257
             /* insert empty P pictures to slow down to the desired
258 258
                frame rate. Each fake pictures takes about 20 bytes */
259 259
             fps = frame_rate_tab[s->frame_rate_index];
260
-            n = (((INT64)s->picture_number * fps) / s->frame_rate) - 1;
260
+            n = (((int64_t)s->picture_number * fps) / s->frame_rate) - 1;
261 261
             while (s->fake_picture_number < n) {
262 262
                 mpeg1_skip_picture(s, s->fake_picture_number - 
263 263
                                    s->gop_picture_number); 
... ...
@@ -737,7 +737,7 @@ static void mpeg1_encode_block(MpegEncContext *s,
737 737
            it is handled slightly differently */
738 738
         level = block[0];
739 739
         if (abs(level) == 1) {
740
-                code = ((UINT32)level >> 31); /* the sign bit */
740
+                code = ((uint32_t)level >> 31); /* the sign bit */
741 741
                 put_bits(&s->pb, 2, code | 0x02);
742 742
                 i = 1;
743 743
         } else {
... ...
@@ -1208,8 +1208,8 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s,
1208 1208
     int level, dc, diff, i, j, run;
1209 1209
     int component;
1210 1210
     RLTable *rl = &rl_mpeg1;
1211
-    UINT8 * const scantable= s->intra_scantable.permutated;
1212
-    const UINT16 *quant_matrix= s->intra_matrix;
1211
+    uint8_t * const scantable= s->intra_scantable.permutated;
1212
+    const uint16_t *quant_matrix= s->intra_matrix;
1213 1213
     const int qscale= s->qscale;
1214 1214
 
1215 1215
     /* DC coef */
... ...
@@ -1280,8 +1280,8 @@ static inline int mpeg1_decode_block_inter(MpegEncContext *s,
1280 1280
 {
1281 1281
     int level, i, j, run;
1282 1282
     RLTable *rl = &rl_mpeg1;
1283
-    UINT8 * const scantable= s->intra_scantable.permutated;
1284
-    const UINT16 *quant_matrix= s->inter_matrix;
1283
+    uint8_t * const scantable= s->intra_scantable.permutated;
1284
+    const uint16_t *quant_matrix= s->inter_matrix;
1285 1285
     const int qscale= s->qscale;
1286 1286
 
1287 1287
     {
... ...
@@ -1358,8 +1358,8 @@ static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
1358 1358
 {
1359 1359
     int level, i, j, run;
1360 1360
     RLTable *rl = &rl_mpeg1;
1361
-    UINT8 * const scantable= s->intra_scantable.permutated;
1362
-    const UINT16 *quant_matrix;
1361
+    uint8_t * const scantable= s->intra_scantable.permutated;
1362
+    const uint16_t *quant_matrix;
1363 1363
     const int qscale= s->qscale;
1364 1364
     int mismatch;
1365 1365
 
... ...
@@ -1438,8 +1438,8 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
1438 1438
     int level, dc, diff, i, j, run;
1439 1439
     int component;
1440 1440
     RLTable *rl;
1441
-    UINT8 * const scantable= s->intra_scantable.permutated;
1442
-    const UINT16 *quant_matrix;
1441
+    uint8_t * const scantable= s->intra_scantable.permutated;
1442
+    const uint16_t *quant_matrix;
1443 1443
     const int qscale= s->qscale;
1444 1444
     int mismatch;
1445 1445
 
... ...
@@ -1516,10 +1516,10 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
1516 1516
 
1517 1517
 typedef struct Mpeg1Context {
1518 1518
     MpegEncContext mpeg_enc_ctx;
1519
-    UINT32 header_state;
1519
+    uint32_t header_state;
1520 1520
     int start_code; /* current start code */
1521
-    UINT8 buffer[PICTURE_BUFFER_SIZE]; 
1522
-    UINT8 *buf_ptr;
1521
+    uint8_t buffer[PICTURE_BUFFER_SIZE]; 
1522
+    uint8_t *buf_ptr;
1523 1523
     int buffer_size;
1524 1524
     int mpeg_enc_ctx_allocated; /* true if decoding context allocated */
1525 1525
     int repeat_field; /* true if we must repeat the field */
... ...
@@ -1546,10 +1546,10 @@ static int mpeg_decode_init(AVCodecContext *avctx)
1546 1546
 
1547 1547
 /* return the 8 bit start code value and update the search
1548 1548
    state. Return -1 if no start code found */
1549
-static int find_start_code(UINT8 **pbuf_ptr, UINT8 *buf_end, 
1550
-                           UINT32 *header_state)
1549
+static int find_start_code(uint8_t **pbuf_ptr, uint8_t *buf_end, 
1550
+                           uint32_t *header_state)
1551 1551
 {
1552
-    UINT8 *buf_ptr;
1552
+    uint8_t *buf_ptr;
1553 1553
     unsigned int state, v;
1554 1554
     int val;
1555 1555
 
... ...
@@ -1572,7 +1572,7 @@ static int find_start_code(UINT8 **pbuf_ptr, UINT8 *buf_end,
1572 1572
 }
1573 1573
 
1574 1574
 static int mpeg1_decode_picture(AVCodecContext *avctx, 
1575
-                                UINT8 *buf, int buf_size)
1575
+                                uint8_t *buf, int buf_size)
1576 1576
 {
1577 1577
     Mpeg1Context *s1 = avctx->priv_data;
1578 1578
     MpegEncContext *s = &s1->mpeg_enc_ctx;
... ...
@@ -1724,7 +1724,7 @@ static void mpeg_decode_picture_coding_extension(MpegEncContext *s)
1724 1724
 }
1725 1725
 
1726 1726
 static void mpeg_decode_extension(AVCodecContext *avctx, 
1727
-                                  UINT8 *buf, int buf_size)
1727
+                                  uint8_t *buf, int buf_size)
1728 1728
 {
1729 1729
     Mpeg1Context *s1 = avctx->priv_data;
1730 1730
     MpegEncContext *s = &s1->mpeg_enc_ctx;
... ...
@@ -1764,7 +1764,7 @@ static void mpeg_decode_extension(AVCodecContext *avctx,
1764 1764
 static int mpeg_decode_slice(AVCodecContext *avctx, 
1765 1765
                               AVFrame *pict,
1766 1766
                               int start_code,
1767
-                              UINT8 *buf, int buf_size)
1767
+                              uint8_t *buf, int buf_size)
1768 1768
 {
1769 1769
     Mpeg1Context *s1 = avctx->priv_data;
1770 1770
     MpegEncContext *s = &s1->mpeg_enc_ctx;
... ...
@@ -1897,7 +1897,7 @@ eos: //end of slice
1897 1897
 }
1898 1898
 
1899 1899
 static int mpeg1_decode_sequence(AVCodecContext *avctx, 
1900
-                                 UINT8 *buf, int buf_size)
1900
+                                 uint8_t *buf, int buf_size)
1901 1901
 {
1902 1902
     Mpeg1Context *s1 = avctx->priv_data;
1903 1903
     MpegEncContext *s = &s1->mpeg_enc_ctx;
... ...
@@ -2010,10 +2010,10 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
2010 2010
 /* handle buffering and image synchronisation */
2011 2011
 static int mpeg_decode_frame(AVCodecContext *avctx, 
2012 2012
                              void *data, int *data_size,
2013
-                             UINT8 *buf, int buf_size)
2013
+                             uint8_t *buf, int buf_size)
2014 2014
 {
2015 2015
     Mpeg1Context *s = avctx->priv_data;
2016
-    UINT8 *buf_end, *buf_ptr, *buf_start;
2016
+    uint8_t *buf_end, *buf_ptr, *buf_start;
2017 2017
     int len, start_code_found, ret, code, start_code, input_size;
2018 2018
     AVFrame *picture = data;
2019 2019
     MpegEncContext *s2 = &s->mpeg_enc_ctx;
... ...
@@ -2,7 +2,7 @@
2 2
  * MPEG1/2 tables
3 3
  */
4 4
 
5
-const INT16 ff_mpeg1_default_intra_matrix[64] = {
5
+const int16_t ff_mpeg1_default_intra_matrix[64] = {
6 6
 	8, 16, 19, 22, 26, 27, 29, 34,
7 7
 	16, 16, 22, 24, 27, 29, 34, 37,
8 8
 	19, 22, 26, 27, 29, 34, 34, 38,
... ...
@@ -13,7 +13,7 @@ const INT16 ff_mpeg1_default_intra_matrix[64] = {
13 13
 	27, 29, 35, 38, 46, 56, 69, 83
14 14
 };
15 15
 
16
-const INT16 ff_mpeg1_default_non_intra_matrix[64] = {
16
+const int16_t ff_mpeg1_default_non_intra_matrix[64] = {
17 17
     16, 16, 16, 16, 16, 16, 16, 16,
18 18
     16, 16, 16, 16, 16, 16, 16, 16,
19 19
     16, 16, 16, 16, 16, 16, 16, 16,
... ...
@@ -47,14 +47,14 @@ const unsigned char vlc_dc_table[256] = {
47 47
     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
48 48
 };
49 49
 
50
-const UINT16 vlc_dc_lum_code[12] = {
50
+const uint16_t vlc_dc_lum_code[12] = {
51 51
     0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff,
52 52
 };
53 53
 const unsigned char vlc_dc_lum_bits[12] = {
54 54
     3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9,
55 55
 };
56 56
 
57
-const UINT16 vlc_dc_chroma_code[12] = {
57
+const uint16_t vlc_dc_chroma_code[12] = {
58 58
     0x0, 0x1, 0x2, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x3fe, 0x3ff,
59 59
 };
60 60
 const unsigned char vlc_dc_chroma_bits[12] = {
... ...
@@ -62,10 +62,10 @@ const unsigned char vlc_dc_chroma_bits[12] = {
62 62
 };
63 63
 
64 64
 /* simple include everything table for dc, first byte is bits number next 3 are code*/
65
-static UINT32 mpeg1_lum_dc_uni[512];
66
-static UINT32 mpeg1_chr_dc_uni[512];
65
+static uint32_t mpeg1_lum_dc_uni[512];
66
+static uint32_t mpeg1_chr_dc_uni[512];
67 67
 
68
-static const UINT16 mpeg1_vlc[113][2] = {
68
+static const uint16_t mpeg1_vlc[113][2] = {
69 69
  { 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 },
70 70
  { 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 },
71 71
  { 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 },
... ...
@@ -98,7 +98,7 @@ static const UINT16 mpeg1_vlc[113][2] = {
98 98
  { 0x2, 2 }, /* EOB */
99 99
 };
100 100
 
101
-static const UINT16 mpeg2_vlc[113][2] = {
101
+static const uint16_t mpeg2_vlc[113][2] = {
102 102
   {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5},
103 103
   {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7},
104 104
   {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8},
... ...
@@ -131,7 +131,7 @@ static const UINT16 mpeg2_vlc[113][2] = {
131 131
   {0x06,4}, /* EOB */
132 132
 };
133 133
 
134
-static const INT8 mpeg1_level[111] = {
134
+static const int8_t mpeg1_level[111] = {
135 135
   1,  2,  3,  4,  5,  6,  7,  8,
136 136
   9, 10, 11, 12, 13, 14, 15, 16,
137 137
  17, 18, 19, 20, 21, 22, 23, 24,
... ...
@@ -148,7 +148,7 @@ static const INT8 mpeg1_level[111] = {
148 148
   1,  1,  1,  1,  1,  1,  1,
149 149
 };
150 150
 
151
-static const INT8 mpeg1_run[111] = {
151
+static const int8_t mpeg1_run[111] = {
152 152
   0,  0,  0,  0,  0,  0,  0,  0,
153 153
   0,  0,  0,  0,  0,  0,  0,  0,
154 154
   0,  0,  0,  0,  0,  0,  0,  0,
... ...
@@ -165,8 +165,8 @@ static const INT8 mpeg1_run[111] = {
165 165
  25, 26, 27, 28, 29, 30, 31,
166 166
 };
167 167
 
168
-static UINT8 mpeg1_index_run[2][64];
169
-static INT8 mpeg1_max_level[2][64];
168
+static uint8_t mpeg1_index_run[2][64];
169
+static int8_t mpeg1_max_level[2][64];
170 170
 
171 171
 static RLTable rl_mpeg1 = {
172 172
     111,
... ...
@@ -184,7 +184,7 @@ static RLTable rl_mpeg2 = {
184 184
     mpeg1_level,
185 185
 };
186 186
 
187
-static const UINT8 mbAddrIncrTable[35][2] = {
187
+static const uint8_t mbAddrIncrTable[35][2] = {
188 188
     {0x1, 1},
189 189
     {0x3, 3},
190 190
     {0x2, 3},
... ...
@@ -222,7 +222,7 @@ static const UINT8 mbAddrIncrTable[35][2] = {
222 222
     {0xf, 11}, /* stuffing */
223 223
 };
224 224
 
225
-static const UINT8 mbPatTable[63][2] = {
225
+static const uint8_t mbPatTable[63][2] = {
226 226
     {0xb, 5},
227 227
     {0x9, 5},
228 228
     {0xd, 6},
... ...
@@ -294,7 +294,7 @@ static const UINT8 mbPatTable[63][2] = {
294 294
 #define MB_FOR   0x08
295 295
 #define MB_QUANT 0x10  
296 296
 
297
-static const UINT8 table_mb_ptype[32][2] = {
297
+static const uint8_t table_mb_ptype[32][2] = {
298 298
     { 0, 0 }, // 0x00
299 299
     { 3, 5 }, // 0x01 MB_INTRA
300 300
     { 1, 2 }, // 0x02 MB_PAT
... ...
@@ -329,7 +329,7 @@ static const UINT8 table_mb_ptype[32][2] = {
329 329
     { 0, 0 }, // 0x1F
330 330
 };
331 331
 
332
-static const UINT8 table_mb_btype[32][2] = {
332
+static const uint8_t table_mb_btype[32][2] = {
333 333
     { 0, 0 }, // 0x00
334 334
     { 3, 5 }, // 0x01 MB_INTRA
335 335
     { 0, 0 }, // 0x02
... ...
@@ -364,7 +364,7 @@ static const UINT8 table_mb_btype[32][2] = {
364 364
     { 0, 0 }, // 0x1F
365 365
 };
366 366
 
367
-static const UINT8 mbMotionVectorTable[17][2] = {
367
+static const uint8_t mbMotionVectorTable[17][2] = {
368 368
 { 0x1, 1 },
369 369
 { 0x1, 2 },
370 370
 { 0x1, 3 },
... ...
@@ -396,14 +396,14 @@ static const int frame_rate_tab[9] = {
396 396
     (int)(60 * FRAME_RATE_BASE), 
397 397
 };
398 398
 
399
-static const UINT8 non_linear_qscale[32] = {
399
+static const uint8_t non_linear_qscale[32] = {
400 400
     0, 1, 2, 3, 4, 5, 6, 7,
401 401
     8,10,12,14,16,18,20,22,
402 402
     24,28,32,36,40,44,48,52,
403 403
     56,64,72,80,88,96,104,112,
404 404
 };
405 405
 
406
-UINT8 ff_mpeg1_dc_scale_table[128]={ // MN: mpeg2 really can have such large qscales?
406
+uint8_t ff_mpeg1_dc_scale_table[128]={ // MN: mpeg2 really can have such large qscales?
407 407
 //  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
408 408
     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
409 409
     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
... ...
@@ -34,19 +34,19 @@
34 34
 #define VOP_STARTCODE        0x1B6
35 35
 
36 36
 /* dc encoding for mpeg4 */
37
-const UINT8 DCtab_lum[13][2] =
37
+const uint8_t DCtab_lum[13][2] =
38 38
 {
39 39
     {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7},
40 40
     {1,8}, {1,9}, {1,10}, {1,11},
41 41
 }; 
42 42
 
43
-const UINT8 DCtab_chrom[13][2] =
43
+const uint8_t DCtab_chrom[13][2] =
44 44
 {
45 45
     {3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8},
46 46
     {1,9}, {1,10}, {1,11}, {1,12},
47 47
 }; 
48 48
 
49
-const UINT16 intra_vlc[103][2] = {
49
+const uint16_t intra_vlc[103][2] = {
50 50
 { 0x2, 2 },
51 51
 { 0x6, 3 },{ 0xf, 4 },{ 0xd, 5 },{ 0xc, 5 },
52 52
 { 0x15, 6 },{ 0x13, 6 },{ 0x12, 6 },{ 0x17, 7 },
... ...
@@ -76,7 +76,7 @@ const UINT16 intra_vlc[103][2] = {
76 76
 { 0x5f, 12 },{ 0x3, 7 },
77 77
 };
78 78
 
79
-const INT8 intra_level[102] = {
79
+const int8_t intra_level[102] = {
80 80
   1,  2,  3,  4,  5,  6,  7,  8,
81 81
   9, 10, 11, 12, 13, 14, 15, 16,
82 82
  17, 18, 19, 20, 21, 22, 23, 24,
... ...
@@ -92,7 +92,7 @@ const INT8 intra_level[102] = {
92 92
   1,  1,  1,  1,  1,  1,
93 93
 };
94 94
 
95
-const INT8 intra_run[102] = {
95
+const int8_t intra_run[102] = {
96 96
   0,  0,  0,  0,  0,  0,  0,  0,
97 97
   0,  0,  0,  0,  0,  0,  0,  0,
98 98
   0,  0,  0,  0,  0,  0,  0,  0,
... ...
@@ -116,17 +116,17 @@ static RLTable rl_intra = {
116 116
     intra_level,
117 117
 };
118 118
 
119
-static const UINT16 sprite_trajectory_tab[15][2] = {
119
+static const uint16_t sprite_trajectory_tab[15][2] = {
120 120
  {0x00, 2}, {0x02, 3},  {0x03, 3},  {0x04, 3}, {0x05, 3}, {0x06, 3},
121 121
  {0x0E, 4}, {0x1E, 5},  {0x3E, 6},  {0x7E, 7}, {0xFE, 8}, 
122 122
  {0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12},
123 123
 };
124 124
 
125
-static const UINT8 mb_type_b_tab[4][2] = {
125
+static const uint8_t mb_type_b_tab[4][2] = {
126 126
  {1, 1}, {1, 2}, {1, 3}, {1, 4},
127 127
 };
128 128
 
129
-static const UINT16 pixel_aspect[16][2]={
129
+static const uint16_t pixel_aspect[16][2]={
130 130
  {0, 0},
131 131
  {1, 1},
132 132
  {12, 11},
... ...
@@ -146,7 +146,7 @@ static const UINT16 pixel_aspect[16][2]={
146 146
 };
147 147
 
148 148
 /* these matrixes will be permuted for the idct */
149
-const INT16 ff_mpeg4_default_intra_matrix[64] = {
149
+const int16_t ff_mpeg4_default_intra_matrix[64] = {
150 150
   8, 17, 18, 19, 21, 23, 25, 27,
151 151
  17, 18, 19, 21, 23, 25, 27, 28,
152 152
  20, 21, 22, 23, 24, 26, 28, 30,
... ...
@@ -157,7 +157,7 @@ const INT16 ff_mpeg4_default_intra_matrix[64] = {
157 157
  27, 28, 30, 32, 35, 38, 41, 45, 
158 158
 };
159 159
 
160
-const INT16 ff_mpeg4_default_non_intra_matrix[64] = {
160
+const int16_t ff_mpeg4_default_non_intra_matrix[64] = {
161 161
  16, 17, 18, 19, 20, 21, 22, 23,
162 162
  17, 18, 19, 20, 21, 22, 23, 24,
163 163
  18, 19, 20, 21, 22, 23, 24, 25,
... ...
@@ -168,15 +168,15 @@ const INT16 ff_mpeg4_default_non_intra_matrix[64] = {
168 168
  23, 24, 25, 27, 28, 30, 31, 33,
169 169
 };
170 170
 
171
-UINT8 ff_mpeg4_y_dc_scale_table[32]={
171
+uint8_t ff_mpeg4_y_dc_scale_table[32]={
172 172
 //  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
173 173
     0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,40,42,44,46
174 174
 };
175
-UINT8 ff_mpeg4_c_dc_scale_table[32]={
175
+uint8_t ff_mpeg4_c_dc_scale_table[32]={
176 176
 //  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
177 177
     0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25
178 178
 };
179 179
 
180
-const UINT16 ff_mpeg4_resync_prefix[8]={
180
+const uint16_t ff_mpeg4_resync_prefix[8]={
181 181
     0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000
182 182
 };
... ...
@@ -23,7 +23,7 @@
23 23
    quantization stage) */
24 24
 #define FRAC_BITS 15
25 25
 #define WFRAC_BITS  14
26
-#define MUL(a,b) (((INT64)(a) * (INT64)(b)) >> FRAC_BITS)
26
+#define MUL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
27 27
 #define FIX(a)   ((int)((a) * (1 << FRAC_BITS)))
28 28
 
29 29
 #define SAMPLES_BUF_SIZE 4096
... ...
@@ -36,7 +36,7 @@ typedef struct MpegAudioContext {
36 36
     int bitrate_index; /* bit rate */
37 37
     int freq_index;
38 38
     int frame_size; /* frame size, in bits, without padding */
39
-    INT64 nb_samples; /* total number of samples encoded */
39
+    int64_t nb_samples; /* total number of samples encoded */
40 40
     /* padding computation */
41 41
     int frame_frac, frame_frac_incr, do_padding;
42 42
     short samples_buf[MPA_MAX_CHANNELS][SAMPLES_BUF_SIZE]; /* buffer for filter */
... ...
@@ -17,11 +17,11 @@
17 17
 
18 18
 int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
19 19
 
20
-extern const UINT16 mpa_bitrate_tab[2][3][15];
21
-extern const UINT16 mpa_freq_tab[3];
20
+extern const uint16_t mpa_bitrate_tab[2][3][15];
21
+extern const uint16_t mpa_freq_tab[3];
22 22
 extern const unsigned char *alloc_tables[5];
23 23
 extern const double enwindow[512];
24 24
 extern const int sblimit_table[5];
25 25
 extern const int quant_steps[17];
26 26
 extern const int quant_bits[17];
27
-extern const INT32 mpa_enwindow[257];
27
+extern const int32_t mpa_enwindow[257];
... ...
@@ -42,17 +42,17 @@
42 42
 
43 43
 #define FRAC_ONE    (1 << FRAC_BITS)
44 44
 
45
-#define MULL(a,b) (((INT64)(a) * (INT64)(b)) >> FRAC_BITS)
46
-#define MUL64(a,b) ((INT64)(a) * (INT64)(b))
45
+#define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
46
+#define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
47 47
 #define FIX(a)   ((int)((a) * FRAC_ONE))
48 48
 /* WARNING: only correct for posititive numbers */
49 49
 #define FIXR(a)   ((int)((a) * FRAC_ONE + 0.5))
50 50
 #define FRAC_RND(a) (((a) + (FRAC_ONE/2)) >> FRAC_BITS)
51 51
 
52 52
 #if FRAC_BITS <= 15
53
-typedef INT16 MPA_INT;
53
+typedef int16_t MPA_INT;
54 54
 #else
55
-typedef INT32 MPA_INT;
55
+typedef int32_t MPA_INT;
56 56
 #endif
57 57
 
58 58
 /****************/
... ...
@@ -61,14 +61,14 @@ typedef INT32 MPA_INT;
61 61
 #define BACKSTEP_SIZE 512
62 62
 
63 63
 typedef struct MPADecodeContext {
64
-    UINT8 inbuf1[2][MPA_MAX_CODED_FRAME_SIZE + BACKSTEP_SIZE];	/* input buffer */
64
+    uint8_t inbuf1[2][MPA_MAX_CODED_FRAME_SIZE + BACKSTEP_SIZE];	/* input buffer */
65 65
     int inbuf_index;
66
-    UINT8 *inbuf_ptr, *inbuf;
66
+    uint8_t *inbuf_ptr, *inbuf;
67 67
     int frame_size;
68 68
     int free_format_frame_size; /* frame size in case of free format
69 69
                                    (zero if currently unknown) */
70 70
     /* next header (used in free format parsing) */
71
-    UINT32 free_format_next_header; 
71
+    uint32_t free_format_next_header; 
72 72
     int error_protection;
73 73
     int layer;
74 74
     int sample_rate;
... ...
@@ -82,8 +82,8 @@ typedef struct MPADecodeContext {
82 82
     int lsf;
83 83
     MPA_INT synth_buf[MPA_MAX_CHANNELS][512 * 2];
84 84
     int synth_buf_offset[MPA_MAX_CHANNELS];
85
-    INT32 sb_samples[MPA_MAX_CHANNELS][36][SBLIMIT];
86
-    INT32 mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
85
+    int32_t sb_samples[MPA_MAX_CHANNELS][36][SBLIMIT];
86
+    int32_t mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
87 87
 #ifdef DEBUG
88 88
     int frame_count;
89 89
 #endif
... ...
@@ -91,22 +91,22 @@ typedef struct MPADecodeContext {
91 91
 
92 92
 /* layer 3 "granule" */
93 93
 typedef struct GranuleDef {
94
-    UINT8 scfsi;
94
+    uint8_t scfsi;
95 95
     int part2_3_length;
96 96
     int big_values;
97 97
     int global_gain;
98 98
     int scalefac_compress;
99
-    UINT8 block_type;
100
-    UINT8 switch_point;
99
+    uint8_t block_type;
100
+    uint8_t switch_point;
101 101
     int table_select[3];
102 102
     int subblock_gain[3];
103
-    UINT8 scalefac_scale;
104
-    UINT8 count1table_select;
103
+    uint8_t scalefac_scale;
104
+    uint8_t count1table_select;
105 105
     int region_size[3]; /* number of huffman codes in each region */
106 106
     int preflag;
107 107
     int short_start, long_end; /* long/short band indexes */
108
-    UINT8 scale_factors[40];
109
-    INT32 sb_hybrid[SBLIMIT * 18]; /* 576 samples */
108
+    uint8_t scale_factors[40];
109
+    int32_t sb_hybrid[SBLIMIT * 18]; /* 576 samples */
110 110
 } GranuleDef;
111 111
 
112 112
 #define MODE_EXT_MS_STEREO 2
... ...
@@ -115,49 +115,49 @@ typedef struct GranuleDef {
115 115
 /* layer 3 huffman tables */
116 116
 typedef struct HuffTable {
117 117
     int xsize;
118
-    const UINT8 *bits;
119
-    const UINT16 *codes;
118
+    const uint8_t *bits;
119
+    const uint16_t *codes;
120 120
 } HuffTable;
121 121
 
122 122
 #include "mpegaudiodectab.h"
123 123
 
124 124
 /* vlc structure for decoding layer 3 huffman tables */
125 125
 static VLC huff_vlc[16]; 
126
-static UINT8 *huff_code_table[16];
126
+static uint8_t *huff_code_table[16];
127 127
 static VLC huff_quad_vlc[2];
128 128
 /* computed from band_size_long */
129
-static UINT16 band_index_long[9][23];
129
+static uint16_t band_index_long[9][23];
130 130
 /* XXX: free when all decoders are closed */
131 131
 #define TABLE_4_3_SIZE (8191 + 16)
132
-static INT8  *table_4_3_exp;
132
+static int8_t  *table_4_3_exp;
133 133
 #if FRAC_BITS <= 15
134
-static UINT16 *table_4_3_value;
134
+static uint16_t *table_4_3_value;
135 135
 #else
136
-static UINT32 *table_4_3_value;
136
+static uint32_t *table_4_3_value;
137 137
 #endif
138 138
 /* intensity stereo coef table */
139
-static INT32 is_table[2][16];
140
-static INT32 is_table_lsf[2][2][16];
141
-static INT32 csa_table[8][2];
142
-static INT32 mdct_win[8][36];
139
+static int32_t is_table[2][16];
140
+static int32_t is_table_lsf[2][2][16];
141
+static int32_t csa_table[8][2];
142
+static int32_t mdct_win[8][36];
143 143
 
144 144
 /* lower 2 bits: modulo 3, higher bits: shift */
145
-static UINT16 scale_factor_modshift[64];
145
+static uint16_t scale_factor_modshift[64];
146 146
 /* [i][j]:  2^(-j/3) * FRAC_ONE * 2^(i+2) / (2^(i+2) - 1) */
147
-static INT32 scale_factor_mult[15][3];
147
+static int32_t scale_factor_mult[15][3];
148 148
 /* mult table for layer 2 group quantization */
149 149
 
150 150
 #define SCALE_GEN(v) \
151 151
 { FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) }
152 152
 
153
-static INT32 scale_factor_mult2[3][3] = {
153
+static int32_t scale_factor_mult2[3][3] = {
154 154
     SCALE_GEN(4.0 / 3.0), /* 3 steps */
155 155
     SCALE_GEN(4.0 / 5.0), /* 5 steps */
156 156
     SCALE_GEN(4.0 / 9.0), /* 9 steps */
157 157
 };
158 158
 
159 159
 /* 2^(n/4) */
160
-static UINT32 scale_factor_mult3[4] = {
160
+static uint32_t scale_factor_mult3[4] = {
161 161
     FIXR(1.0),
162 162
     FIXR(1.18920711500272106671),
163 163
     FIXR(1.41421356237309504880),
... ...
@@ -171,7 +171,7 @@ static MPA_INT window[512];
171 171
 static inline int l1_unscale(int n, int mant, int scale_factor)
172 172
 {
173 173
     int shift, mod;
174
-    INT64 val;
174
+    int64_t val;
175 175
 
176 176
     shift = scale_factor_modshift[scale_factor];
177 177
     mod = shift & 3;
... ...
@@ -203,7 +203,7 @@ static inline int l3_unscale(int value, int exponent)
203 203
 #if FRAC_BITS <= 15    
204 204
     unsigned int m;
205 205
 #else
206
-    UINT64 m;
206
+    uint64_t m;
207 207
 #endif
208 208
     int e;
209 209
 
... ...
@@ -221,7 +221,7 @@ static inline int l3_unscale(int value, int exponent)
221 221
     return m;
222 222
 #else
223 223
     m = MUL64(m, scale_factor_mult3[exponent & 3]);
224
-    m = (m + (UINT64_C(1) << (e-1))) >> e;
224
+    m = (m + (uint64_t_C(1) << (e-1))) >> e;
225 225
     return m;
226 226
 #endif
227 227
 }
... ...
@@ -232,7 +232,7 @@ static inline int l3_unscale(int value, int exponent)
232 232
 #define POW_FRAC_BITS 24
233 233
 #define POW_FRAC_ONE    (1 << POW_FRAC_BITS)
234 234
 #define POW_FIX(a)   ((int)((a) * POW_FRAC_ONE))
235
-#define POW_MULL(a,b) (((INT64)(a) * (INT64)(b)) >> POW_FRAC_BITS)
235
+#define POW_MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> POW_FRAC_BITS)
236 236
 
237 237
 static int dev_4_3_coefs[DEV_ORDER];
238 238
 
... ...
@@ -318,7 +318,7 @@ static int decode_init(AVCodecContext * avctx)
318 318
         for(i=0;i<15;i++) {
319 319
             int n, norm;
320 320
             n = i + 2;
321
-            norm = ((INT64_C(1) << n) * FRAC_ONE) / ((1 << n) - 1);
321
+            norm = ((int64_t_C(1) << n) * FRAC_ONE) / ((1 << n) - 1);
322 322
             scale_factor_mult[i][0] = MULL(FIXR(1.0 * 2.0), norm);
323 323
             scale_factor_mult[i][1] = MULL(FIXR(0.7937005259 * 2.0), norm);
324 324
             scale_factor_mult[i][2] = MULL(FIXR(0.6299605249 * 2.0), norm);
... ...
@@ -350,7 +350,7 @@ static int decode_init(AVCodecContext * avctx)
350 350
             const HuffTable *h = &mpa_huff_tables[i];
351 351
 	    int xsize, x, y;
352 352
             unsigned int n;
353
-            UINT8 *code_table;
353
+            uint8_t *code_table;
354 354
 
355 355
             xsize = h->xsize;
356 356
             n = xsize * xsize;
... ...
@@ -577,7 +577,7 @@ static int decode_init(AVCodecContext * avctx)
577 577
 #define ADD(a, b) tab[a] += tab[b]
578 578
 
579 579
 /* DCT32 without 1/sqrt(2) coef zero scaling. */
580
-static void dct32(INT32 *out, INT32 *tab)
580
+static void dct32(int32_t *out, int32_t *tab)
581 581
 {
582 582
     int tmp0, tmp1;
583 583
 
... ...
@@ -760,7 +760,7 @@ static void dct32(INT32 *out, INT32 *tab)
760 760
 #define OUT_SAMPLE(sum)\
761 761
 {\
762 762
     int sum1;\
763
-    sum1 = (int)((sum + (INT64_C(1) << (OUT_SHIFT - 1))) >> OUT_SHIFT);\
763
+    sum1 = (int)((sum + (int64_t_C(1) << (OUT_SHIFT - 1))) >> OUT_SHIFT);\
764 764
     if (sum1 < -32768)\
765 765
         sum1 = -32768;\
766 766
     else if (sum1 > 32767)\
... ...
@@ -787,17 +787,17 @@ static void dct32(INT32 *out, INT32 *tab)
787 787
    32 samples. */
788 788
 /* XXX: optimize by avoiding ring buffer usage */
789 789
 static void synth_filter(MPADecodeContext *s1,
790
-                         int ch, INT16 *samples, int incr, 
791
-                         INT32 sb_samples[SBLIMIT])
790
+                         int ch, int16_t *samples, int incr, 
791
+                         int32_t sb_samples[SBLIMIT])
792 792
 {
793
-    INT32 tmp[32];
793
+    int32_t tmp[32];
794 794
     register MPA_INT *synth_buf, *p;
795 795
     register MPA_INT *w;
796 796
     int j, offset, v;
797 797
 #if FRAC_BITS <= 15
798 798
     int sum;
799 799
 #else
800
-    INT64 sum;
800
+    int64_t sum;
801 801
 #endif
802 802
 
803 803
     dct32(tmp, sb_samples);
... ...
@@ -863,7 +863,7 @@ static void synth_filter(MPADecodeContext *s1,
863 863
 static void imdct12(int *out, int *in)
864 864
 {
865 865
     int tmp;
866
-    INT64 in1_3, in1_9, in4_3, in4_9;
866
+    int64_t in1_3, in1_9, in4_3, in4_9;
867 867
 
868 868
     in1_3 = MUL64(in[1], C3);
869 869
     in1_9 = MUL64(in[1], C9);
... ...
@@ -955,7 +955,7 @@ static void imdct36(int *out, int *in)
955 955
 {
956 956
     int i, j, t0, t1, t2, t3, s0, s1, s2, s3;
957 957
     int tmp[18], *tmp1, *in1;
958
-    INT64 in3_3, in6_6;
958
+    int64_t in3_3, in6_6;
959 959
 
960 960
     for(i=17;i>=1;i--)
961 961
         in[i] += in[i-1];
... ...
@@ -1030,7 +1030,7 @@ static void imdct36(int *out, int *in)
1030 1030
 }
1031 1031
 
1032 1032
 /* fast header check for resync */
1033
-static int check_header(UINT32 header)
1033
+static int check_header(uint32_t header)
1034 1034
 {
1035 1035
     /* header */
1036 1036
     if ((header & 0xffe00000) != 0xffe00000)
... ...
@@ -1054,7 +1054,7 @@ static int check_header(UINT32 header)
1054 1054
 /* header decoding. MUST check the header before because no
1055 1055
    consistency check is done there. Return 1 if free format found and
1056 1056
    that the frame size must be computed externally */
1057
-static int decode_header(MPADecodeContext *s, UINT32 header)
1057
+static int decode_header(MPADecodeContext *s, uint32_t header)
1058 1058
 {
1059 1059
     int sample_rate, frame_size, mpeg25, padding;
1060 1060
     int sample_rate_index, bitrate_index;
... ...
@@ -1155,8 +1155,8 @@ static int decode_header(MPADecodeContext *s, UINT32 header)
1155 1155
 static int mp_decode_layer1(MPADecodeContext *s)
1156 1156
 {
1157 1157
     int bound, i, v, n, ch, j, mant;
1158
-    UINT8 allocation[MPA_MAX_CHANNELS][SBLIMIT];
1159
-    UINT8 scale_factors[MPA_MAX_CHANNELS][SBLIMIT];
1158
+    uint8_t allocation[MPA_MAX_CHANNELS][SBLIMIT];
1159
+    uint8_t scale_factors[MPA_MAX_CHANNELS][SBLIMIT];
1160 1160
 
1161 1161
     if (s->mode == MPA_JSTEREO) 
1162 1162
         bound = (s->mode_ext + 1) * 4;
... ...
@@ -1451,7 +1451,7 @@ static int mp_decode_layer2(MPADecodeContext *s)
1451 1451
  */
1452 1452
 static void seek_to_maindata(MPADecodeContext *s, unsigned int backstep)
1453 1453
 {
1454
-    UINT8 *ptr;
1454
+    uint8_t *ptr;
1455 1455
 
1456 1456
     /* compute current position in stream */
1457 1457
     ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);
... ...
@@ -1491,11 +1491,11 @@ static inline void lsf_sf_expand(int *slen,
1491 1491
 
1492 1492
 static void exponents_from_scale_factors(MPADecodeContext *s, 
1493 1493
                                          GranuleDef *g,
1494
-                                         INT16 *exponents)
1494
+                                         int16_t *exponents)
1495 1495
 {
1496
-    const UINT8 *bstab, *pretab;
1496
+    const uint8_t *bstab, *pretab;
1497 1497
     int len, i, j, k, l, v0, shift, gain, gains[3];
1498
-    INT16 *exp_ptr;
1498
+    int16_t *exp_ptr;
1499 1499
 
1500 1500
     exp_ptr = exponents;
1501 1501
     gain = g->global_gain - 210;
... ...
@@ -1537,13 +1537,13 @@ static inline int get_bitsz(GetBitContext *s, int n)
1537 1537
 }
1538 1538
 
1539 1539
 static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
1540
-                          INT16 *exponents, int end_pos)
1540
+                          int16_t *exponents, int end_pos)
1541 1541
 {
1542 1542
     int s_index;
1543 1543
     int linbits, code, x, y, l, v, i, j, k, pos;
1544 1544
     GetBitContext last_gb;
1545 1545
     VLC *vlc;
1546
-    UINT8 *code_table;
1546
+    uint8_t *code_table;
1547 1547
 
1548 1548
     /* low frequencies (called big values) */
1549 1549
     s_index = 0;
... ...
@@ -1642,8 +1642,8 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
1642 1642
 static void reorder_block(MPADecodeContext *s, GranuleDef *g)
1643 1643
 {
1644 1644
     int i, j, k, len;
1645
-    INT32 *ptr, *dst, *ptr1;
1646
-    INT32 tmp[576];
1645
+    int32_t *ptr, *dst, *ptr1;
1646
+    int32_t tmp[576];
1647 1647
 
1648 1648
     if (g->block_type != 2)
1649 1649
         return;
... ...
@@ -1668,7 +1668,7 @@ static void reorder_block(MPADecodeContext *s, GranuleDef *g)
1668 1668
                 dst += 3;
1669 1669
             }
1670 1670
         }
1671
-        memcpy(ptr1, tmp, len * 3 * sizeof(INT32));
1671
+        memcpy(ptr1, tmp, len * 3 * sizeof(int32_t));
1672 1672
     }
1673 1673
 }
1674 1674
 
... ...
@@ -1678,10 +1678,10 @@ static void compute_stereo(MPADecodeContext *s,
1678 1678
                            GranuleDef *g0, GranuleDef *g1)
1679 1679
 {
1680 1680
     int i, j, k, l;
1681
-    INT32 v1, v2;
1681
+    int32_t v1, v2;
1682 1682
     int sf_max, tmp0, tmp1, sf, len, non_zero_found;
1683
-    INT32 (*is_tab)[16];
1684
-    INT32 *tab0, *tab1;
1683
+    int32_t (*is_tab)[16];
1684
+    int32_t *tab0, *tab1;
1685 1685
     int non_zero_found_short[3];
1686 1686
 
1687 1687
     /* intensity stereo */
... ...
@@ -1804,7 +1804,7 @@ static void compute_stereo(MPADecodeContext *s,
1804 1804
 static void compute_antialias(MPADecodeContext *s,
1805 1805
                               GranuleDef *g)
1806 1806
 {
1807
-    INT32 *ptr, *p0, *p1, *csa;
1807
+    int32_t *ptr, *p0, *p1, *csa;
1808 1808
     int n, tmp0, tmp1, i, j;
1809 1809
 
1810 1810
     /* we antialias only "long" bands */
... ...
@@ -1837,13 +1837,13 @@ static void compute_antialias(MPADecodeContext *s,
1837 1837
 
1838 1838
 static void compute_imdct(MPADecodeContext *s,
1839 1839
                           GranuleDef *g, 
1840
-                          INT32 *sb_samples,
1841
-                          INT32 *mdct_buf)
1840
+                          int32_t *sb_samples,
1841
+                          int32_t *mdct_buf)
1842 1842
 {
1843
-    INT32 *ptr, *win, *win1, *buf, *buf2, *out_ptr, *ptr1;
1844
-    INT32 in[6];
1845
-    INT32 out[36];
1846
-    INT32 out2[12];
1843
+    int32_t *ptr, *win, *win1, *buf, *buf2, *out_ptr, *ptr1;
1844
+    int32_t in[6];
1845
+    int32_t out[36];
1846
+    int32_t out2[12];
1847 1847
     int i, j, k, mdct_long_end, v, sblimit;
1848 1848
 
1849 1849
     /* find last non zero block */
... ...
@@ -1936,12 +1936,12 @@ static void compute_imdct(MPADecodeContext *s,
1936 1936
 }
1937 1937
 
1938 1938
 #if defined(DEBUG)
1939
-void sample_dump(int fnum, INT32 *tab, int n)
1939
+void sample_dump(int fnum, int32_t *tab, int n)
1940 1940
 {
1941 1941
     static FILE *files[16], *f;
1942 1942
     char buf[512];
1943 1943
     int i;
1944
-    INT32 v;
1944
+    int32_t v;
1945 1945
     
1946 1946
     f = files[fnum];
1947 1947
     if (!f) {
... ...
@@ -1972,7 +1972,7 @@ void sample_dump(int fnum, INT32 *tab, int n)
1972 1972
     for(i=0;i<n;i++) {
1973 1973
         /* normalize to 23 frac bits */
1974 1974
         v = tab[i] << (23 - FRAC_BITS);
1975
-        fwrite(&v, 1, sizeof(INT32), f);
1975
+        fwrite(&v, 1, sizeof(int32_t), f);
1976 1976
     }
1977 1977
 }
1978 1978
 #endif
... ...
@@ -1984,7 +1984,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
1984 1984
     int nb_granules, main_data_begin, private_bits;
1985 1985
     int gr, ch, blocksplit_flag, i, j, k, n, bits_pos, bits_left;
1986 1986
     GranuleDef granules[2][2], *g;
1987
-    INT16 exponents[576];
1987
+    int16_t exponents[576];
1988 1988
 
1989 1989
     /* read side info */
1990 1990
     if (s->lsf) {
... ...
@@ -2124,7 +2124,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
2124 2124
             bits_pos = get_bits_count(&s->gb);
2125 2125
             
2126 2126
             if (!s->lsf) {
2127
-                UINT8 *sc;
2127
+                uint8_t *sc;
2128 2128
                 int slen, slen1, slen2;
2129 2129
 
2130 2130
                 /* MPEG1 scale factors */
... ...
@@ -2328,11 +2328,11 @@ static int mp_decode_frame(MPADecodeContext *s,
2328 2328
 
2329 2329
 static int decode_frame(AVCodecContext * avctx,
2330 2330
 			void *data, int *data_size,
2331
-			UINT8 * buf, int buf_size)
2331
+			uint8_t * buf, int buf_size)
2332 2332
 {
2333 2333
     MPADecodeContext *s = avctx->priv_data;
2334
-    UINT32 header;
2335
-    UINT8 *buf_ptr;
2334
+    uint32_t header;
2335
+    uint8_t *buf_ptr;
2336 2336
     int len, out_size;
2337 2337
     short *out_samples = data;
2338 2338
 
... ...
@@ -2399,8 +2399,8 @@ static int decode_frame(AVCodecContext * avctx,
2399 2399
 		memcpy(s->inbuf, s->inbuf + 1, s->inbuf_ptr - s->inbuf - 1);
2400 2400
 		s->inbuf_ptr--;
2401 2401
             } else {
2402
-                UINT8 *p, *pend;
2403
-                UINT32 header1;
2402
+                uint8_t *p, *pend;
2403
+                uint32_t header1;
2404 2404
                 int padding;
2405 2405
 
2406 2406
                 memcpy(s->inbuf_ptr, buf_ptr, len);
... ...
@@ -1,5 +1,5 @@
1 1
 
2
-const UINT16 mpa_bitrate_tab[2][3][15] = {
2
+const uint16_t mpa_bitrate_tab[2][3][15] = {
3 3
     { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 },
4 4
       {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 },
5 5
       {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } },
... ...
@@ -9,11 +9,11 @@ const UINT16 mpa_bitrate_tab[2][3][15] = {
9 9
     }
10 10
 };
11 11
 
12
-const UINT16 mpa_freq_tab[3] = { 44100, 48000, 32000 };
12
+const uint16_t mpa_freq_tab[3] = { 44100, 48000, 32000 };
13 13
 
14 14
 /*******************************************************/
15 15
 /* half mpeg encoding window (full precision) */
16
-const INT32 mpa_enwindow[257] = {
16
+const int32_t mpa_enwindow[257] = {
17 17
      0,    -1,    -1,    -1,    -1,    -1,    -1,    -2,
18 18
     -2,    -2,    -2,    -3,    -3,    -4,    -4,    -5,
19 19
     -5,    -6,    -7,    -7,    -8,    -9,   -10,   -11,
... ...
@@ -200,13 +200,13 @@ const unsigned char *alloc_tables[5] =
200 200
 /* layer 3 tables */
201 201
 
202 202
 /* layer3 scale factor size */
203
-static const UINT8 slen_table[2][16] = {
203
+static const uint8_t slen_table[2][16] = {
204 204
     { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
205 205
     { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 },
206 206
 };
207 207
 
208 208
 /* number of lsf scale factors for a given size */
209
-static const UINT8 lsf_nsf_table[6][3][4] = {
209
+static const uint8_t lsf_nsf_table[6][3][4] = {
210 210
     { {  6,  5,  5, 5 }, {  9,  9,  9, 9 }, {  6,  9,  9, 9 } },
211 211
     { {  6,  5,  7, 3 }, {  9,  9, 12, 6 }, {  6,  9, 12, 6 } },
212 212
     { { 11, 10,  0, 0 }, { 18, 18,  0, 0 }, { 15, 18,  0, 0 } },
... ...
@@ -217,55 +217,55 @@ static const UINT8 lsf_nsf_table[6][3][4] = {
217 217
 
218 218
 /* mpegaudio layer 3 huffman tables */
219 219
 
220
-const UINT16 mpa_huffcodes_1[4] = {
220
+const uint16_t mpa_huffcodes_1[4] = {
221 221
  0x0001, 0x0001, 0x0001, 0x0000,
222 222
 };
223 223
 
224
-const UINT8 mpa_huffbits_1[4] = {
224
+const uint8_t mpa_huffbits_1[4] = {
225 225
   1,  3,  2,  3,
226 226
 };
227 227
 
228
-const UINT16 mpa_huffcodes_2[9] = {
228
+const uint16_t mpa_huffcodes_2[9] = {
229 229
  0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0001, 0x0003, 0x0002,
230 230
  0x0000,
231 231
 };
232 232
 
233
-const UINT8 mpa_huffbits_2[9] = {
233
+const uint8_t mpa_huffbits_2[9] = {
234 234
   1,  3,  6,  3,  3,  5,  5,  5,
235 235
   6,
236 236
 };
237 237
 
238
-const UINT16 mpa_huffcodes_3[9] = {
238
+const uint16_t mpa_huffcodes_3[9] = {
239 239
  0x0003, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0003, 0x0002,
240 240
  0x0000,
241 241
 };
242 242
 
243
-const UINT8 mpa_huffbits_3[9] = {
243
+const uint8_t mpa_huffbits_3[9] = {
244 244
   2,  2,  6,  3,  2,  5,  5,  5,
245 245
   6,
246 246
 };
247 247
 
248
-const UINT16 mpa_huffcodes_5[16] = {
248
+const uint16_t mpa_huffcodes_5[16] = {
249 249
  0x0001, 0x0002, 0x0006, 0x0005, 0x0003, 0x0001, 0x0004, 0x0004,
250 250
  0x0007, 0x0005, 0x0007, 0x0001, 0x0006, 0x0001, 0x0001, 0x0000,
251 251
 };
252 252
 
253
-const UINT8 mpa_huffbits_5[16] = {
253
+const uint8_t mpa_huffbits_5[16] = {
254 254
   1,  3,  6,  7,  3,  3,  6,  7,
255 255
   6,  6,  7,  8,  7,  6,  7,  8,
256 256
 };
257 257
 
258
-const UINT16 mpa_huffcodes_6[16] = {
258
+const uint16_t mpa_huffcodes_6[16] = {
259 259
  0x0007, 0x0003, 0x0005, 0x0001, 0x0006, 0x0002, 0x0003, 0x0002,
260 260
  0x0005, 0x0004, 0x0004, 0x0001, 0x0003, 0x0003, 0x0002, 0x0000,
261 261
 };
262 262
 
263
-const UINT8 mpa_huffbits_6[16] = {
263
+const uint8_t mpa_huffbits_6[16] = {
264 264
   3,  3,  5,  7,  3,  2,  4,  5,
265 265
   4,  4,  5,  6,  6,  5,  6,  7,
266 266
 };
267 267
 
268
-const UINT16 mpa_huffcodes_7[36] = {
268
+const uint16_t mpa_huffcodes_7[36] = {
269 269
  0x0001, 0x0002, 0x000a, 0x0013, 0x0010, 0x000a, 0x0003, 0x0003,
270 270
  0x0007, 0x000a, 0x0005, 0x0003, 0x000b, 0x0004, 0x000d, 0x0011,
271 271
  0x0008, 0x0004, 0x000c, 0x000b, 0x0012, 0x000f, 0x000b, 0x0002,
... ...
@@ -273,7 +273,7 @@ const UINT16 mpa_huffcodes_7[36] = {
273 273
  0x0005, 0x0003, 0x0002, 0x0000,
274 274
 };
275 275
 
276
-const UINT8 mpa_huffbits_7[36] = {
276
+const uint8_t mpa_huffbits_7[36] = {
277 277
   1,  3,  6,  8,  8,  9,  3,  4,
278 278
   6,  7,  7,  8,  6,  5,  7,  8,
279 279
   8,  9,  7,  7,  8,  9,  9,  9,
... ...
@@ -281,7 +281,7 @@ const UINT8 mpa_huffbits_7[36] = {
281 281
   9, 10, 10, 10,
282 282
 };
283 283
 
284
-const UINT16 mpa_huffcodes_8[36] = {
284
+const uint16_t mpa_huffcodes_8[36] = {
285 285
  0x0003, 0x0004, 0x0006, 0x0012, 0x000c, 0x0005, 0x0005, 0x0001,
286 286
  0x0002, 0x0010, 0x0009, 0x0003, 0x0007, 0x0003, 0x0005, 0x000e,
287 287
  0x0007, 0x0003, 0x0013, 0x0011, 0x000f, 0x000d, 0x000a, 0x0004,
... ...
@@ -289,7 +289,7 @@ const UINT16 mpa_huffcodes_8[36] = {
289 289
  0x0004, 0x0001, 0x0001, 0x0000,
290 290
 };
291 291
 
292
-const UINT8 mpa_huffbits_8[36] = {
292
+const uint8_t mpa_huffbits_8[36] = {
293 293
   2,  3,  6,  8,  8,  9,  3,  2,
294 294
   4,  8,  8,  8,  6,  4,  6,  8,
295 295
   8,  9,  8,  8,  8,  9,  9, 10,
... ...
@@ -297,7 +297,7 @@ const UINT8 mpa_huffbits_8[36] = {
297 297
   9,  9, 11, 11,
298 298
 };
299 299
 
300
-const UINT16 mpa_huffcodes_9[36] = {
300
+const uint16_t mpa_huffcodes_9[36] = {
301 301
  0x0007, 0x0005, 0x0009, 0x000e, 0x000f, 0x0007, 0x0006, 0x0004,
302 302
  0x0005, 0x0005, 0x0006, 0x0007, 0x0007, 0x0006, 0x0008, 0x0008,
303 303
  0x0008, 0x0005, 0x000f, 0x0006, 0x0009, 0x000a, 0x0005, 0x0001,
... ...
@@ -305,7 +305,7 @@ const UINT16 mpa_huffcodes_9[36] = {
305 305
  0x0006, 0x0002, 0x0006, 0x0000,
306 306
 };
307 307
 
308
-const UINT8 mpa_huffbits_9[36] = {
308
+const uint8_t mpa_huffbits_9[36] = {
309 309
   3,  3,  5,  6,  8,  9,  3,  3,
310 310
   4,  5,  6,  8,  4,  4,  5,  6,
311 311
   7,  8,  6,  5,  6,  7,  7,  8,
... ...
@@ -313,7 +313,7 @@ const UINT8 mpa_huffbits_9[36] = {
313 313
   8,  8,  9,  9,
314 314
 };
315 315
 
316
-const UINT16 mpa_huffcodes_10[64] = {
316
+const uint16_t mpa_huffcodes_10[64] = {
317 317
  0x0001, 0x0002, 0x000a, 0x0017, 0x0023, 0x001e, 0x000c, 0x0011,
318 318
  0x0003, 0x0003, 0x0008, 0x000c, 0x0012, 0x0015, 0x000c, 0x0007,
319 319
  0x000b, 0x0009, 0x000f, 0x0015, 0x0020, 0x0028, 0x0013, 0x0006,
... ...
@@ -324,7 +324,7 @@ const UINT16 mpa_huffcodes_10[64] = {
324 324
  0x0009, 0x0008, 0x0007, 0x0008, 0x0004, 0x0004, 0x0002, 0x0000,
325 325
 };
326 326
 
327
-const UINT8 mpa_huffbits_10[64] = {
327
+const uint8_t mpa_huffbits_10[64] = {
328 328
   1,  3,  6,  8,  9,  9,  9, 10,
329 329
   3,  4,  6,  7,  8,  9,  8,  8,
330 330
   6,  6,  7,  8,  9, 10,  9,  9,
... ...
@@ -335,7 +335,7 @@ const UINT8 mpa_huffbits_10[64] = {
335 335
   9,  8,  9, 10, 10, 11, 11, 11,
336 336
 };
337 337
 
338
-const UINT16 mpa_huffcodes_11[64] = {
338
+const uint16_t mpa_huffcodes_11[64] = {
339 339
  0x0003, 0x0004, 0x000a, 0x0018, 0x0022, 0x0021, 0x0015, 0x000f,
340 340
  0x0005, 0x0003, 0x0004, 0x000a, 0x0020, 0x0011, 0x000b, 0x000a,
341 341
  0x000b, 0x0007, 0x000d, 0x0012, 0x001e, 0x001f, 0x0014, 0x0005,
... ...
@@ -346,7 +346,7 @@ const UINT16 mpa_huffcodes_11[64] = {
346 346
  0x000b, 0x0004, 0x0006, 0x0006, 0x0006, 0x0003, 0x0002, 0x0000,
347 347
 };
348 348
 
349
-const UINT8 mpa_huffbits_11[64] = {
349
+const uint8_t mpa_huffbits_11[64] = {
350 350
   2,  3,  5,  7,  8,  9,  8,  9,
351 351
   3,  3,  4,  6,  8,  8,  7,  8,
352 352
   5,  5,  6,  7,  8,  9,  8,  8,
... ...
@@ -357,7 +357,7 @@ const UINT8 mpa_huffbits_11[64] = {
357 357
   8,  7,  8,  9, 10, 10, 10, 10,
358 358
 };
359 359
 
360
-const UINT16 mpa_huffcodes_12[64] = {
360
+const uint16_t mpa_huffcodes_12[64] = {
361 361
  0x0009, 0x0006, 0x0010, 0x0021, 0x0029, 0x0027, 0x0026, 0x001a,
362 362
  0x0007, 0x0005, 0x0006, 0x0009, 0x0017, 0x0010, 0x001a, 0x000b,
363 363
  0x0011, 0x0007, 0x000b, 0x000e, 0x0015, 0x001e, 0x000a, 0x0007,
... ...
@@ -368,7 +368,7 @@ const UINT16 mpa_huffcodes_12[64] = {
368 368
  0x001b, 0x000c, 0x0008, 0x000c, 0x0006, 0x0003, 0x0001, 0x0000,
369 369
 };
370 370
 
371
-const UINT8 mpa_huffbits_12[64] = {
371
+const uint8_t mpa_huffbits_12[64] = {
372 372
   4,  3,  5,  7,  8,  9,  9,  9,
373 373
   3,  3,  4,  5,  7,  7,  8,  8,
374 374
   5,  4,  5,  6,  7,  8,  7,  8,
... ...
@@ -379,7 +379,7 @@ const UINT8 mpa_huffbits_12[64] = {
379 379
   9,  8,  8,  9,  9,  9,  9, 10,
380 380
 };
381 381
 
382
-const UINT16 mpa_huffcodes_13[256] = {
382
+const uint16_t mpa_huffcodes_13[256] = {
383 383
  0x0001, 0x0005, 0x000e, 0x0015, 0x0022, 0x0033, 0x002e, 0x0047,
384 384
  0x002a, 0x0034, 0x0044, 0x0034, 0x0043, 0x002c, 0x002b, 0x0013,
385 385
  0x0003, 0x0004, 0x000c, 0x0013, 0x001f, 0x001a, 0x002c, 0x0021,
... ...
@@ -414,7 +414,7 @@ const UINT16 mpa_huffcodes_13[256] = {
414 414
  0x0011, 0x000c, 0x0010, 0x0008, 0x0001, 0x0001, 0x0000, 0x0001,
415 415
 };
416 416
 
417
-const UINT8 mpa_huffbits_13[256] = {
417
+const uint8_t mpa_huffbits_13[256] = {
418 418
   1,  4,  6,  7,  8,  9,  9, 10,
419 419
   9, 10, 11, 11, 12, 12, 13, 13,
420 420
   3,  4,  6,  7,  8,  8,  9,  9,
... ...
@@ -449,7 +449,7 @@ const UINT8 mpa_huffbits_13[256] = {
449 449
  15, 15, 16, 16, 19, 18, 19, 16,
450 450
 };
451 451
 
452
-const UINT16 mpa_huffcodes_15[256] = {
452
+const uint16_t mpa_huffcodes_15[256] = {
453 453
  0x0007, 0x000c, 0x0012, 0x0035, 0x002f, 0x004c, 0x007c, 0x006c,
454 454
  0x0059, 0x007b, 0x006c, 0x0077, 0x006b, 0x0051, 0x007a, 0x003f,
455 455
  0x000d, 0x0005, 0x0010, 0x001b, 0x002e, 0x0024, 0x003d, 0x0033,
... ...
@@ -484,7 +484,7 @@ const UINT16 mpa_huffcodes_15[256] = {
484 484
  0x0015, 0x0010, 0x000a, 0x0006, 0x0008, 0x0006, 0x0002, 0x0000,
485 485
 };
486 486
 
487
-const UINT8 mpa_huffbits_15[256] = {
487
+const uint8_t mpa_huffbits_15[256] = {
488 488
   3,  4,  5,  7,  7,  8,  9,  9,
489 489
   9, 10, 10, 11, 11, 11, 12, 13,
490 490
   4,  3,  5,  6,  7,  7,  8,  8,
... ...
@@ -519,7 +519,7 @@ const UINT8 mpa_huffbits_15[256] = {
519 519
  12, 12, 12, 12, 13, 13, 13, 13,
520 520
 };
521 521
 
522
-const UINT16 mpa_huffcodes_16[256] = {
522
+const uint16_t mpa_huffcodes_16[256] = {
523 523
  0x0001, 0x0005, 0x000e, 0x002c, 0x004a, 0x003f, 0x006e, 0x005d,
524 524
  0x00ac, 0x0095, 0x008a, 0x00f2, 0x00e1, 0x00c3, 0x0178, 0x0011,
525 525
  0x0003, 0x0004, 0x000c, 0x0014, 0x0023, 0x003e, 0x0035, 0x002f,
... ...
@@ -554,7 +554,7 @@ const UINT16 mpa_huffcodes_16[256] = {
554 554
  0x000d, 0x000c, 0x000a, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
555 555
 };
556 556
 
557
-const UINT8 mpa_huffbits_16[256] = {
557
+const uint8_t mpa_huffbits_16[256] = {
558 558
   1,  4,  6,  8,  9,  9, 10, 10,
559 559
  11, 11, 11, 12, 12, 12, 13,  9,
560 560
   3,  4,  6,  7,  8,  9,  9,  9,
... ...
@@ -589,7 +589,7 @@ const UINT8 mpa_huffbits_16[256] = {
589 589
  11, 11, 11, 11, 11, 11, 11,  8,
590 590
 };
591 591
 
592
-const UINT16 mpa_huffcodes_24[256] = {
592
+const uint16_t mpa_huffcodes_24[256] = {
593 593
  0x000f, 0x000d, 0x002e, 0x0050, 0x0092, 0x0106, 0x00f8, 0x01b2,
594 594
  0x01aa, 0x029d, 0x028d, 0x0289, 0x026d, 0x0205, 0x0408, 0x0058,
595 595
  0x000e, 0x000c, 0x0015, 0x0026, 0x0047, 0x0082, 0x007a, 0x00d8,
... ...
@@ -624,7 +624,7 @@ const UINT16 mpa_huffcodes_24[256] = {
624 624
  0x0007, 0x0006, 0x0004, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
625 625
 };
626 626
 
627
-const UINT8 mpa_huffbits_24[256] = {
627
+const uint8_t mpa_huffbits_24[256] = {
628 628
   4,  4,  6,  7,  8,  9,  9, 10,
629 629
  10, 11, 11, 11, 11, 11, 12,  9,
630 630
   4,  4,  5,  6,  7,  8,  8,  9,
... ...
@@ -678,7 +678,7 @@ const HuffTable mpa_huff_tables[16] = {
678 678
 { 16, mpa_huffbits_24, mpa_huffcodes_24 },
679 679
 };
680 680
 
681
-const UINT8 mpa_huff_data[32][2] = {
681
+const uint8_t mpa_huff_data[32][2] = {
682 682
 { 0, 0 },
683 683
 { 1, 0 },
684 684
 { 2, 0 },
... ...
@@ -715,18 +715,18 @@ const UINT8 mpa_huff_data[32][2] = {
715 715
 
716 716
 
717 717
 /* huffman tables for quadrules */
718
-static UINT8 mpa_quad_codes[2][16] = {
718
+static uint8_t mpa_quad_codes[2][16] = {
719 719
     {  1,  5,  4,  5,  6,  5,  4,  4, 7,  3,  6,  0,  7,  2,  3,  1, },
720 720
     { 15, 14, 13, 12, 11, 10,  9,  8, 7,  6,  5,  4,  3,  2,  1,  0, },
721 721
 };
722 722
 
723
-static UINT8 mpa_quad_bits[2][16] = {
723
+static uint8_t mpa_quad_bits[2][16] = {
724 724
     { 1, 4, 4, 5, 4, 6, 5, 6, 4, 5, 5, 6, 5, 6, 6, 6, },
725 725
     { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
726 726
 };
727 727
 
728 728
 /* band size tables */
729
-const UINT8 band_size_long[9][22] = {
729
+const uint8_t band_size_long[9][22] = {
730 730
 { 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10,
731 731
   12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, }, /* 44100 */
732 732
 { 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 10,
... ...
@@ -747,7 +747,7 @@ const UINT8 band_size_long[9][22] = {
747 747
   40, 48, 56, 64, 76, 90, 2, 2, 2, 2, 2, }, /* 8000 */
748 748
 };
749 749
 
750
-const UINT8 band_size_short[9][13] = {
750
+const uint8_t band_size_short[9][13] = {
751 751
 { 4, 4, 4, 4, 6, 8, 10, 12, 14, 18, 22, 30, 56, }, /* 44100 */
752 752
 { 4, 4, 4, 4, 6, 6, 10, 12, 14, 16, 20, 26, 66, }, /* 48000 */
753 753
 { 4, 4, 4, 4, 6, 8, 12, 16, 20, 26, 34, 42, 12, }, /* 32000 */
... ...
@@ -759,7 +759,7 @@ const UINT8 band_size_short[9][13] = {
759 759
 { 8, 8, 8, 12, 16, 20, 24, 28, 36, 2, 2, 2, 26, }, /* 8000 */
760 760
 };
761 761
 
762
-const UINT8 mpa_pretab[2][22] = {
762
+const uint8_t mpa_pretab[2][22] = {
763 763
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
764 764
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 },
765 765
 };
... ...
@@ -54,13 +54,13 @@ static const int bitinv32[32] = {
54 54
 };
55 55
 
56 56
 
57
-static INT16 filter_bank[512];
57
+static int16_t filter_bank[512];
58 58
 
59 59
 static int scale_factor_table[64];
60 60
 #ifdef USE_FLOATS
61 61
 static float scale_factor_inv_table[64];
62 62
 #else
63
-static INT8 scale_factor_shift[64];
63
+static int8_t scale_factor_shift[64];
64 64
 static unsigned short scale_factor_mult[64];
65 65
 #endif
66 66
 static unsigned char scale_diff_table[128];
... ...
@@ -40,11 +40,11 @@ static void dct_unquantize_mpeg2_c(MpegEncContext *s,
40 40
                                    DCTELEM *block, int n, int qscale);
41 41
 static void dct_unquantize_h263_c(MpegEncContext *s, 
42 42
                                   DCTELEM *block, int n, int qscale);
43
-static void draw_edges_c(UINT8 *buf, int wrap, int width, int height, int w);
43
+static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w);
44 44
 static int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
45 45
 static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
46 46
 
47
-void (*draw_edges)(UINT8 *buf, int wrap, int width, int height, int w)= draw_edges_c;
47
+void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w)= draw_edges_c;
48 48
 
49 49
 
50 50
 /* enable all paranoid tests for rounding, overflows, etc... */
... ...
@@ -85,13 +85,13 @@ static const uint8_t h263_chroma_roundtab[16] = {
85 85
     0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
86 86
 };
87 87
 
88
-static UINT16 (*default_mv_penalty)[MAX_MV*2+1]=NULL;
89
-static UINT8 default_fcode_tab[MAX_MV*2+1];
88
+static uint16_t (*default_mv_penalty)[MAX_MV*2+1]=NULL;
89
+static uint8_t default_fcode_tab[MAX_MV*2+1];
90 90
 
91 91
 enum PixelFormat ff_yuv420p_list[2]= {PIX_FMT_YUV420P, -1};
92 92
 
93 93
 static void convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16)[64], uint16_t (*qmat16_bias)[64],
94
-                           const UINT16 *quant_matrix, int bias, int qmin, int qmax)
94
+                           const uint16_t *quant_matrix, int bias, int qmin, int qmax)
95 95
 {
96 96
     int qscale;
97 97
 
... ...
@@ -105,7 +105,7 @@ static void convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16
105 105
                 /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */
106 106
                 /* 3444240       >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */
107 107
                 
108
-                qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / 
108
+                qmat[qscale][i] = (int)((uint64_t_C(1) << QMAT_SHIFT) / 
109 109
                                 (qscale * quant_matrix[j]));
110 110
             }
111 111
         } else if (s->fdct == fdct_ifast) {
... ...
@@ -116,7 +116,7 @@ static void convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16
116 116
                 /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */
117 117
                 /* 3444240       >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */
118 118
                 
119
-                qmat[qscale][i] = (int)((UINT64_C(1) << (QMAT_SHIFT + 14)) / 
119
+                qmat[qscale][i] = (int)((uint64_t_C(1) << (QMAT_SHIFT + 14)) / 
120 120
                                 (aanscales[i] * qscale * quant_matrix[j]));
121 121
             }
122 122
         } else {
... ...
@@ -127,7 +127,7 @@ static void convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16
127 127
                    so (1<<19) / 16 >= (1<<19) / (qscale * quant_matrix[i]) >= (1<<19) / 7905
128 128
                    so 32768        >= (1<<19) / (qscale * quant_matrix[i]) >= 67
129 129
                 */
130
-                qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j]));
130
+                qmat[qscale][i] = (int)((uint64_t_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j]));
131 131
 //                qmat  [qscale][i] = (1 << QMAT_SHIFT_MMX) / (qscale * quant_matrix[i]);
132 132
                 qmat16[qscale][i] = (1 << QMAT_SHIFT_MMX) / (qscale * quant_matrix[j]);
133 133
 
... ...
@@ -147,7 +147,7 @@ static void convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16
147 147
     }\
148 148
 }
149 149
 
150
-void ff_init_scantable(MpegEncContext *s, ScanTable *st, const UINT8 *src_scantable){
150
+void ff_init_scantable(MpegEncContext *s, ScanTable *st, const uint8_t *src_scantable){
151 151
     int i;
152 152
     int end;
153 153
     
... ...
@@ -174,14 +174,14 @@ void ff_init_scantable(MpegEncContext *s, ScanTable *st, const UINT8 *src_scanta
174 174
 /* XXX: those functions should be suppressed ASAP when all IDCTs are
175 175
  converted */
176 176
 // *FIXME* this is ugly hack using local static
177
-static void (*ff_put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
178
-static void (*ff_add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
179
-static void ff_jref_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
177
+static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
178
+static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
179
+static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
180 180
 {
181 181
     j_rev_dct (block);
182 182
     ff_put_pixels_clamped(block, dest, line_size);
183 183
 }
184
-static void ff_jref_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
184
+static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
185 185
 {
186 186
     j_rev_dct (block);
187 187
     ff_add_pixels_clamped(block, dest, line_size);
... ...
@@ -312,14 +312,14 @@ static int alloc_picture(MpegEncContext *s, Picture *pic, int shared){
312 312
     
313 313
     if(pic->qscale_table==NULL){
314 314
         if (s->encoding) {        
315
-            CHECKED_ALLOCZ(pic->mb_var   , s->mb_num * sizeof(INT16))
316
-            CHECKED_ALLOCZ(pic->mc_mb_var, s->mb_num * sizeof(INT16))
317
-            CHECKED_ALLOCZ(pic->mb_mean  , s->mb_num * sizeof(INT8))
315
+            CHECKED_ALLOCZ(pic->mb_var   , s->mb_num * sizeof(int16_t))
316
+            CHECKED_ALLOCZ(pic->mc_mb_var, s->mb_num * sizeof(int16_t))
317
+            CHECKED_ALLOCZ(pic->mb_mean  , s->mb_num * sizeof(int8_t))
318 318
             CHECKED_ALLOCZ(pic->mb_cmp_score, s->mb_num * sizeof(int32_t))
319 319
         }
320 320
 
321
-        CHECKED_ALLOCZ(pic->mbskip_table , s->mb_num * sizeof(UINT8)+1) //the +1 is for the slice end check
322
-        CHECKED_ALLOCZ(pic->qscale_table , s->mb_num * sizeof(UINT8))
321
+        CHECKED_ALLOCZ(pic->mbskip_table , s->mb_num * sizeof(uint8_t)+1) //the +1 is for the slice end check
322
+        CHECKED_ALLOCZ(pic->qscale_table , s->mb_num * sizeof(uint8_t))
323 323
         pic->qstride= s->mb_width;
324 324
     }
325 325
     
... ...
@@ -405,12 +405,12 @@ int MPV_common_init(MpegEncContext *s)
405 405
         int mv_table_size= (s->mb_width+2)*(s->mb_height+2);
406 406
 
407 407
         /* Allocate MV tables */
408
-        CHECKED_ALLOCZ(s->p_mv_table            , mv_table_size * 2 * sizeof(INT16))
409
-        CHECKED_ALLOCZ(s->b_forw_mv_table       , mv_table_size * 2 * sizeof(INT16))
410
-        CHECKED_ALLOCZ(s->b_back_mv_table       , mv_table_size * 2 * sizeof(INT16))
411
-        CHECKED_ALLOCZ(s->b_bidir_forw_mv_table , mv_table_size * 2 * sizeof(INT16))
412
-        CHECKED_ALLOCZ(s->b_bidir_back_mv_table , mv_table_size * 2 * sizeof(INT16))
413
-        CHECKED_ALLOCZ(s->b_direct_mv_table     , mv_table_size * 2 * sizeof(INT16))
408
+        CHECKED_ALLOCZ(s->p_mv_table            , mv_table_size * 2 * sizeof(int16_t))
409
+        CHECKED_ALLOCZ(s->b_forw_mv_table       , mv_table_size * 2 * sizeof(int16_t))
410
+        CHECKED_ALLOCZ(s->b_back_mv_table       , mv_table_size * 2 * sizeof(int16_t))
411
+        CHECKED_ALLOCZ(s->b_bidir_forw_mv_table , mv_table_size * 2 * sizeof(int16_t))
412
+        CHECKED_ALLOCZ(s->b_bidir_back_mv_table , mv_table_size * 2 * sizeof(int16_t))
413
+        CHECKED_ALLOCZ(s->b_direct_mv_table     , mv_table_size * 2 * sizeof(int16_t))
414 414
 
415 415
         //FIXME should be linesize instead of s->width*2 but that isnt known before get_buffer()
416 416
         CHECKED_ALLOCZ(s->me.scratchpad,  s->width*2*16*3*sizeof(uint8_t)) 
... ...
@@ -429,29 +429,29 @@ int MPV_common_init(MpegEncContext *s)
429 429
         CHECKED_ALLOCZ(s->avctx->stats_out, 256);
430 430
     }
431 431
         
432
-    CHECKED_ALLOCZ(s->error_status_table, s->mb_num*sizeof(UINT8))
432
+    CHECKED_ALLOCZ(s->error_status_table, s->mb_num*sizeof(uint8_t))
433 433
     
434 434
     if (s->out_format == FMT_H263 || s->encoding) {
435 435
         int size;
436 436
         /* Allocate MB type table */
437
-        CHECKED_ALLOCZ(s->mb_type  , s->mb_num * sizeof(UINT8))
437
+        CHECKED_ALLOCZ(s->mb_type  , s->mb_num * sizeof(uint8_t))
438 438
 
439 439
         /* MV prediction */
440 440
         size = (2 * s->mb_width + 2) * (2 * s->mb_height + 2);
441
-        CHECKED_ALLOCZ(s->motion_val, size * 2 * sizeof(INT16));
441
+        CHECKED_ALLOCZ(s->motion_val, size * 2 * sizeof(int16_t));
442 442
     }
443 443
 
444 444
     if(s->codec_id==CODEC_ID_MPEG4){
445 445
         /* interlaced direct mode decoding tables */
446
-        CHECKED_ALLOCZ(s->field_mv_table, s->mb_num*2*2 * sizeof(INT16))
447
-        CHECKED_ALLOCZ(s->field_select_table, s->mb_num*2* sizeof(INT8))
446
+        CHECKED_ALLOCZ(s->field_mv_table, s->mb_num*2*2 * sizeof(int16_t))
447
+        CHECKED_ALLOCZ(s->field_select_table, s->mb_num*2* sizeof(int8_t))
448 448
     }
449 449
     /* 4mv b frame decoding table */
450 450
     //note this is needed for h263 without b frames too (segfault on damaged streams otherwise)
451
-    CHECKED_ALLOCZ(s->co_located_type_table, s->mb_num * sizeof(UINT8))
451
+    CHECKED_ALLOCZ(s->co_located_type_table, s->mb_num * sizeof(uint8_t))
452 452
     if (s->out_format == FMT_H263) {
453 453
         /* ac values */
454
-        CHECKED_ALLOCZ(s->ac_val[0], yc_size * sizeof(INT16) * 16);
454
+        CHECKED_ALLOCZ(s->ac_val[0], yc_size * sizeof(int16_t) * 16);
455 455
         s->ac_val[1] = s->ac_val[0] + y_size;
456 456
         s->ac_val[2] = s->ac_val[1] + c_size;
457 457
         
... ...
@@ -462,14 +462,14 @@ int MPV_common_init(MpegEncContext *s)
462 462
         CHECKED_ALLOCZ(s->bitstream_buffer, BITSTREAM_BUFFER_SIZE);
463 463
 
464 464
         /* cbp, ac_pred, pred_dir */
465
-        CHECKED_ALLOCZ(s->cbp_table  , s->mb_num * sizeof(UINT8))
466
-        CHECKED_ALLOCZ(s->pred_dir_table, s->mb_num * sizeof(UINT8))
465
+        CHECKED_ALLOCZ(s->cbp_table  , s->mb_num * sizeof(uint8_t))
466
+        CHECKED_ALLOCZ(s->pred_dir_table, s->mb_num * sizeof(uint8_t))
467 467
     }
468 468
     
469 469
     if (s->h263_pred || s->h263_plus || !s->encoding) {
470 470
         /* dc values */
471 471
         //MN: we need these for error resilience of intra-frames
472
-        CHECKED_ALLOCZ(s->dc_val[0], yc_size * sizeof(INT16));
472
+        CHECKED_ALLOCZ(s->dc_val[0], yc_size * sizeof(int16_t));
473 473
         s->dc_val[1] = s->dc_val[0] + y_size;
474 474
         s->dc_val[2] = s->dc_val[1] + c_size;
475 475
         for(i=0;i<yc_size;i++)
... ...
@@ -716,9 +716,9 @@ int MPV_encode_init(AVCodecContext *avctx)
716 716
             int i;
717 717
             done=1;
718 718
 
719
-            default_mv_penalty= av_mallocz( sizeof(UINT16)*(MAX_FCODE+1)*(2*MAX_MV+1) );
720
-            memset(default_mv_penalty, 0, sizeof(UINT16)*(MAX_FCODE+1)*(2*MAX_MV+1));
721
-            memset(default_fcode_tab , 0, sizeof(UINT8)*(2*MAX_MV+1));
719
+            default_mv_penalty= av_mallocz( sizeof(uint16_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
720
+            memset(default_mv_penalty, 0, sizeof(uint16_t)*(MAX_FCODE+1)*(2*MAX_MV+1));
721
+            memset(default_fcode_tab , 0, sizeof(uint8_t)*(2*MAX_MV+1));
722 722
 
723 723
             for(i=-16; i<16; i++){
724 724
                 default_fcode_tab[i + MAX_MV]= 1;
... ...
@@ -812,8 +812,8 @@ int MPV_encode_end(AVCodecContext *avctx)
812 812
 
813 813
 void init_rl(RLTable *rl)
814 814
 {
815
-    INT8 max_level[MAX_RUN+1], max_run[MAX_LEVEL+1];
816
-    UINT8 index_run[MAX_RUN+1];
815
+    int8_t max_level[MAX_RUN+1], max_run[MAX_LEVEL+1];
816
+    uint8_t index_run[MAX_RUN+1];
817 817
     int last, run, level, start, end, i;
818 818
 
819 819
     /* compute max_level[], max_run[] and index_run[] */
... ...
@@ -850,9 +850,9 @@ void init_rl(RLTable *rl)
850 850
 
851 851
 /* draw the edges of width 'w' of an image of size width, height */
852 852
 //FIXME check that this is ok for mpeg4 interlaced
853
-static void draw_edges_c(UINT8 *buf, int wrap, int width, int height, int w)
853
+static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w)
854 854
 {
855
-    UINT8 *ptr, *last_line;
855
+    uint8_t *ptr, *last_line;
856 856
     int i;
857 857
 
858 858
     last_line = buf + (height - 1) * wrap;
... ...
@@ -1324,11 +1324,11 @@ int MPV_encode_picture(AVCodecContext *avctx,
1324 1324
 }
1325 1325
 
1326 1326
 static inline void gmc1_motion(MpegEncContext *s,
1327
-                               UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr,
1327
+                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1328 1328
                                int dest_offset,
1329
-                               UINT8 **ref_picture, int src_offset)
1329
+                               uint8_t **ref_picture, int src_offset)
1330 1330
 {
1331
-    UINT8 *ptr;
1331
+    uint8_t *ptr;
1332 1332
     int offset, src_x, src_y, linesize, uvlinesize;
1333 1333
     int motion_x, motion_y;
1334 1334
     int emu=0;
... ...
@@ -1412,11 +1412,11 @@ static inline void gmc1_motion(MpegEncContext *s,
1412 1412
 }
1413 1413
 
1414 1414
 static inline void gmc_motion(MpegEncContext *s,
1415
-                               UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr,
1415
+                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1416 1416
                                int dest_offset,
1417
-                               UINT8 **ref_picture, int src_offset)
1417
+                               uint8_t **ref_picture, int src_offset)
1418 1418
 {
1419
-    UINT8 *ptr;
1419
+    uint8_t *ptr;
1420 1420
     int linesize, uvlinesize;
1421 1421
     const int a= s->sprite_warping_accuracy;
1422 1422
     int ox, oy;
... ...
@@ -1475,11 +1475,11 @@ static inline void gmc_motion(MpegEncContext *s,
1475 1475
 }
1476 1476
 
1477 1477
 
1478
-void ff_emulated_edge_mc(MpegEncContext *s, UINT8 *src, int linesize, int block_w, int block_h, 
1478
+void ff_emulated_edge_mc(MpegEncContext *s, uint8_t *src, int linesize, int block_w, int block_h, 
1479 1479
                                     int src_x, int src_y, int w, int h){
1480 1480
     int x, y;
1481 1481
     int start_y, start_x, end_y, end_x;
1482
-    UINT8 *buf= s->edge_emu_buffer;
1482
+    uint8_t *buf= s->edge_emu_buffer;
1483 1483
 
1484 1484
     if(src_y>= h){
1485 1485
         src+= (h-1-src_y)*linesize;
... ...
@@ -1538,13 +1538,13 @@ void ff_emulated_edge_mc(MpegEncContext *s, UINT8 *src, int linesize, int block_
1538 1538
 
1539 1539
 /* apply one mpeg motion vector to the three components */
1540 1540
 static inline void mpeg_motion(MpegEncContext *s,
1541
-                               UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr,
1541
+                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1542 1542
                                int dest_offset,
1543
-                               UINT8 **ref_picture, int src_offset,
1543
+                               uint8_t **ref_picture, int src_offset,
1544 1544
                                int field_based, op_pixels_func (*pix_op)[4],
1545 1545
                                int motion_x, int motion_y, int h)
1546 1546
 {
1547
-    UINT8 *ptr;
1547
+    uint8_t *ptr;
1548 1548
     int dxy, offset, mx, my, src_x, src_y, height, v_edge_pos, linesize, uvlinesize;
1549 1549
     int emu=0;
1550 1550
 #if 0    
... ...
@@ -1628,14 +1628,14 @@ if(s->quarter_sample)
1628 1628
 }
1629 1629
 
1630 1630
 static inline void qpel_motion(MpegEncContext *s,
1631
-                               UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr,
1631
+                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1632 1632
                                int dest_offset,
1633
-                               UINT8 **ref_picture, int src_offset,
1633
+                               uint8_t **ref_picture, int src_offset,
1634 1634
                                int field_based, op_pixels_func (*pix_op)[4],
1635 1635
                                qpel_mc_func (*qpix_op)[16],
1636 1636
                                int motion_x, int motion_y, int h)
1637 1637
 {
1638
-    UINT8 *ptr;
1638
+    uint8_t *ptr;
1639 1639
     int dxy, offset, mx, my, src_x, src_y, height, v_edge_pos, linesize, uvlinesize;
1640 1640
     int emu=0;
1641 1641
 
... ...
@@ -1735,13 +1735,13 @@ inline int ff_h263_round_chroma(int x){
1735 1735
 }
1736 1736
 
1737 1737
 static inline void MPV_motion(MpegEncContext *s, 
1738
-                              UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr,
1739
-                              int dir, UINT8 **ref_picture, 
1738
+                              uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1739
+                              int dir, uint8_t **ref_picture, 
1740 1740
                               op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16])
1741 1741
 {
1742 1742
     int dxy, offset, mx, my, src_x, src_y, motion_x, motion_y;
1743 1743
     int mb_x, mb_y, i;
1744
-    UINT8 *ptr, *dest;
1744
+    uint8_t *ptr, *dest;
1745 1745
     int emu=0;
1746 1746
 
1747 1747
     mb_x = s->mb_x;
... ...
@@ -1916,7 +1916,7 @@ static inline void MPV_motion(MpegEncContext *s,
1916 1916
 
1917 1917
 /* put block[] to dest[] */
1918 1918
 static inline void put_dct(MpegEncContext *s, 
1919
-                           DCTELEM *block, int i, UINT8 *dest, int line_size)
1919
+                           DCTELEM *block, int i, uint8_t *dest, int line_size)
1920 1920
 {
1921 1921
     s->dct_unquantize(s, block, i, s->qscale);
1922 1922
     s->idct_put (dest, line_size, block);
... ...
@@ -1924,7 +1924,7 @@ static inline void put_dct(MpegEncContext *s,
1924 1924
 
1925 1925
 /* add block[] to dest[] */
1926 1926
 static inline void add_dct(MpegEncContext *s, 
1927
-                           DCTELEM *block, int i, UINT8 *dest, int line_size)
1927
+                           DCTELEM *block, int i, uint8_t *dest, int line_size)
1928 1928
 {
1929 1929
     if (s->block_last_index[i] >= 0) {
1930 1930
         s->idct_add (dest, line_size, block);
... ...
@@ -1932,7 +1932,7 @@ static inline void add_dct(MpegEncContext *s,
1932 1932
 }
1933 1933
 
1934 1934
 static inline void add_dequant_dct(MpegEncContext *s, 
1935
-                           DCTELEM *block, int i, UINT8 *dest, int line_size)
1935
+                           DCTELEM *block, int i, uint8_t *dest, int line_size)
1936 1936
 {
1937 1937
     if (s->block_last_index[i] >= 0) {
1938 1938
         s->dct_unquantize(s, block, i, s->qscale);
... ...
@@ -1954,8 +1954,8 @@ void ff_clean_intra_table_entries(MpegEncContext *s)
1954 1954
     s->dc_val[0][xy     + wrap] =
1955 1955
     s->dc_val[0][xy + 1 + wrap] = 1024;
1956 1956
     /* ac pred */
1957
-    memset(s->ac_val[0][xy       ], 0, 32 * sizeof(INT16));
1958
-    memset(s->ac_val[0][xy + wrap], 0, 32 * sizeof(INT16));
1957
+    memset(s->ac_val[0][xy       ], 0, 32 * sizeof(int16_t));
1958
+    memset(s->ac_val[0][xy + wrap], 0, 32 * sizeof(int16_t));
1959 1959
     if (s->msmpeg4_version>=3) {
1960 1960
         s->coded_block[xy           ] =
1961 1961
         s->coded_block[xy + 1       ] =
... ...
@@ -1968,8 +1968,8 @@ void ff_clean_intra_table_entries(MpegEncContext *s)
1968 1968
     s->dc_val[1][xy] =
1969 1969
     s->dc_val[2][xy] = 1024;
1970 1970
     /* ac pred */
1971
-    memset(s->ac_val[1][xy], 0, 16 * sizeof(INT16));
1972
-    memset(s->ac_val[2][xy], 0, 16 * sizeof(INT16));
1971
+    memset(s->ac_val[1][xy], 0, 16 * sizeof(int16_t));
1972
+    memset(s->ac_val[2][xy], 0, 16 * sizeof(int16_t));
1973 1973
     
1974 1974
     s->mbintra_table[s->mb_x + s->mb_y*s->mb_width]= 0;
1975 1975
 }
... ...
@@ -2053,7 +2053,7 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
2053 2053
     }
2054 2054
     
2055 2055
     if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==B_TYPE))) { //FIXME precalc
2056
-        UINT8 *dest_y, *dest_cb, *dest_cr;
2056
+        uint8_t *dest_y, *dest_cb, *dest_cr;
2057 2057
         int dct_linesize, dct_offset;
2058 2058
         op_pixels_func (*op_pix)[4];
2059 2059
         qpel_mc_func (*op_qpix)[16];
... ...
@@ -2065,7 +2065,7 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
2065 2065
 
2066 2066
         /* skip only during decoding as we might trash the buffers during encoding a bit */
2067 2067
         if(!s->encoding){
2068
-            UINT8 *mbskip_ptr = &s->mbskip_table[mb_xy];
2068
+            uint8_t *mbskip_ptr = &s->mbskip_table[mb_xy];
2069 2069
             const int age= s->current_picture.age;
2070 2070
 
2071 2071
             assert(age);
... ...
@@ -2327,7 +2327,7 @@ static inline void auto_requantize_coeffs(MpegEncContext *s, DCTELEM block[6][64
2327 2327
     s->qscale= newq;
2328 2328
 }
2329 2329
 #if 0
2330
-static int pix_vcmp16x8(UINT8 *s, int stride){ //FIXME move to dsputil & optimize
2330
+static int pix_vcmp16x8(uint8_t *s, int stride){ //FIXME move to dsputil & optimize
2331 2331
     int score=0;
2332 2332
     int x,y;
2333 2333
     
... ...
@@ -2342,7 +2342,7 @@ static int pix_vcmp16x8(UINT8 *s, int stride){ //FIXME move to dsputil & optimiz
2342 2342
     return score;
2343 2343
 }
2344 2344
 
2345
-static int pix_diff_vcmp16x8(UINT8 *s1, UINT8*s2, int stride){ //FIXME move to dsputil & optimize
2345
+static int pix_diff_vcmp16x8(uint8_t *s1, uint8_t*s2, int stride){ //FIXME move to dsputil & optimize
2346 2346
     int score=0;
2347 2347
     int x,y;
2348 2348
     
... ...
@@ -2359,7 +2359,7 @@ static int pix_diff_vcmp16x8(UINT8 *s1, UINT8*s2, int stride){ //FIXME move to d
2359 2359
 #else
2360 2360
 #define SQ(a) ((a)*(a))
2361 2361
 
2362
-static int pix_vcmp16x8(UINT8 *s, int stride){ //FIXME move to dsputil & optimize
2362
+static int pix_vcmp16x8(uint8_t *s, int stride){ //FIXME move to dsputil & optimize
2363 2363
     int score=0;
2364 2364
     int x,y;
2365 2365
     
... ...
@@ -2374,7 +2374,7 @@ static int pix_vcmp16x8(UINT8 *s, int stride){ //FIXME move to dsputil & optimiz
2374 2374
     return score;
2375 2375
 }
2376 2376
 
2377
-static int pix_diff_vcmp16x8(UINT8 *s1, UINT8*s2, int stride){ //FIXME move to dsputil & optimize
2377
+static int pix_diff_vcmp16x8(uint8_t *s1, uint8_t*s2, int stride){ //FIXME move to dsputil & optimize
2378 2378
     int score=0;
2379 2379
     int x,y;
2380 2380
     
... ...
@@ -2394,7 +2394,7 @@ static int pix_diff_vcmp16x8(UINT8 *s1, UINT8*s2, int stride){ //FIXME move to d
2394 2394
 void ff_draw_horiz_band(MpegEncContext *s){
2395 2395
     if (    s->avctx->draw_horiz_band 
2396 2396
         && (s->last_picture.data[0] || s->low_delay) ) {
2397
-        UINT8 *src_ptr[3];
2397
+        uint8_t *src_ptr[3];
2398 2398
         int y, h, offset;
2399 2399
         y = s->mb_y * 16;
2400 2400
         h = s->height - y;
... ...
@@ -2454,7 +2454,7 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
2454 2454
     }
2455 2455
 
2456 2456
     if (s->mb_intra) {
2457
-        UINT8 *ptr;
2457
+        uint8_t *ptr;
2458 2458
         int wrap_y;
2459 2459
         int emu=0;
2460 2460
 
... ...
@@ -2509,8 +2509,8 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
2509 2509
     }else{
2510 2510
         op_pixels_func (*op_pix)[4];
2511 2511
         qpel_mc_func (*op_qpix)[16];
2512
-        UINT8 *dest_y, *dest_cb, *dest_cr;
2513
-        UINT8 *ptr_y, *ptr_cb, *ptr_cr;
2512
+        uint8_t *dest_y, *dest_cb, *dest_cr;
2513
+        uint8_t *ptr_y, *ptr_cb, *ptr_cr;
2514 2514
         int wrap_y, wrap_c;
2515 2515
         int emu=0;
2516 2516
 
... ...
@@ -2714,7 +2714,7 @@ int ff_combine_frame( MpegEncContext *s, int next, uint8_t **buf, int *buf_size)
2714 2714
     return 0;
2715 2715
 }
2716 2716
 
2717
-void ff_copy_bits(PutBitContext *pb, UINT8 *src, int length)
2717
+void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length)
2718 2718
 {
2719 2719
     int bytes= length>>4;
2720 2720
     int bits= length&15;
... ...
@@ -2846,9 +2846,9 @@ static void encode_picture(MpegEncContext *s, int picture_number)
2846 2846
     int i;
2847 2847
     int bits;
2848 2848
     MpegEncContext best_s, backup_s;
2849
-    UINT8 bit_buf[2][3000];
2850
-    UINT8 bit_buf2[2][3000];
2851
-    UINT8 bit_buf_tex[2][3000];
2849
+    uint8_t bit_buf[2][3000];
2850
+    uint8_t bit_buf2[2][3000];
2851
+    uint8_t bit_buf_tex[2][3000];
2852 2852
     PutBitContext pb[2], pb2[2], tex_pb[2];
2853 2853
 
2854 2854
     for(i=0; i<2; i++){
... ...
@@ -2935,9 +2935,9 @@ static void encode_picture(MpegEncContext *s, int picture_number)
2935 2935
     }else /* if(s->pict_type == I_TYPE) */{
2936 2936
         /* I-Frame */
2937 2937
         //FIXME do we need to zero them?
2938
-        memset(s->motion_val[0], 0, sizeof(INT16)*(s->mb_width*2 + 2)*(s->mb_height*2 + 2)*2);
2939
-        memset(s->p_mv_table   , 0, sizeof(INT16)*(s->mb_width+2)*(s->mb_height+2)*2);
2940
-        memset(s->mb_type      , MB_TYPE_INTRA, sizeof(UINT8)*s->mb_width*s->mb_height);
2938
+        memset(s->motion_val[0], 0, sizeof(int16_t)*(s->mb_width*2 + 2)*(s->mb_height*2 + 2)*2);
2939
+        memset(s->p_mv_table   , 0, sizeof(int16_t)*(s->mb_width+2)*(s->mb_height+2)*2);
2940
+        memset(s->mb_type      , MB_TYPE_INTRA, sizeof(uint8_t)*s->mb_width*s->mb_height);
2941 2941
         
2942 2942
         if(!s->fixed_qscale){
2943 2943
             /* finding spatial complexity for I-frame rate control */
... ...
@@ -2962,7 +2962,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
2962 2962
 
2963 2963
     if(s->scene_change_score > 0 && s->pict_type == P_TYPE){
2964 2964
         s->pict_type= I_TYPE;
2965
-        memset(s->mb_type   , MB_TYPE_INTRA, sizeof(UINT8)*s->mb_width*s->mb_height);
2965
+        memset(s->mb_type   , MB_TYPE_INTRA, sizeof(uint8_t)*s->mb_width*s->mb_height);
2966 2966
 //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
2967 2967
     }
2968 2968
 
... ...
@@ -3506,7 +3506,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
3506 3506
                         DCTELEM *block, int n,
3507 3507
                         int qscale, int *overflow){
3508 3508
     const int *qmat;
3509
-    const UINT8 *scantable= s->intra_scantable.scantable;
3509
+    const uint8_t *scantable= s->intra_scantable.scantable;
3510 3510
     int max=0;
3511 3511
     unsigned int threshold1, threshold2;
3512 3512
     int bias=0;
... ...
@@ -3756,7 +3756,7 @@ static int dct_quantize_c(MpegEncContext *s,
3756 3756
 {
3757 3757
     int i, j, level, last_non_zero, q;
3758 3758
     const int *qmat;
3759
-    const UINT8 *scantable= s->intra_scantable.scantable;
3759
+    const uint8_t *scantable= s->intra_scantable.scantable;
3760 3760
     int bias;
3761 3761
     int max=0;
3762 3762
     unsigned int threshold1, threshold2;
... ...
@@ -3823,7 +3823,7 @@ static void dct_unquantize_mpeg1_c(MpegEncContext *s,
3823 3823
                                    DCTELEM *block, int n, int qscale)
3824 3824
 {
3825 3825
     int i, level, nCoeffs;
3826
-    const UINT16 *quant_matrix;
3826
+    const uint16_t *quant_matrix;
3827 3827
 
3828 3828
     nCoeffs= s->block_last_index[n];
3829 3829
     
... ...
@@ -3886,7 +3886,7 @@ static void dct_unquantize_mpeg2_c(MpegEncContext *s,
3886 3886
                                    DCTELEM *block, int n, int qscale)
3887 3887
 {
3888 3888
     int i, level, nCoeffs;
3889
-    const UINT16 *quant_matrix;
3889
+    const uint16_t *quant_matrix;
3890 3890
 
3891 3891
     if(s->alternate_scan) nCoeffs= 63;
3892 3892
     else nCoeffs= s->block_last_index[n];
... ...
@@ -68,7 +68,7 @@ typedef struct RateControlEntry{
68 68
     int i_tex_bits;
69 69
     int p_tex_bits;
70 70
     int misc_bits;
71
-    UINT64 expected_bits;
71
+    uint64_t expected_bits;
72 72
     int new_pict_type;
73 73
     float new_qscale;
74 74
     int mc_mb_var_sum;
... ...
@@ -92,21 +92,21 @@ typedef struct RateControlContext{
92 92
     double last_qscale_for[5]; /* last qscale for a specific pict type, used for max_diff & ipb factor stuff */
93 93
     int last_mc_mb_var_sum;
94 94
     int last_mb_var_sum;
95
-    UINT64 i_cplx_sum[5];
96
-    UINT64 p_cplx_sum[5];
97
-    UINT64 mv_bits_sum[5];
98
-    UINT64 qscale_sum[5];
95
+    uint64_t i_cplx_sum[5];
96
+    uint64_t p_cplx_sum[5];
97
+    uint64_t mv_bits_sum[5];
98
+    uint64_t qscale_sum[5];
99 99
     int frame_count[5];
100 100
     int last_non_b_pict_type;
101 101
 }RateControlContext;
102 102
 
103 103
 typedef struct ScanTable{
104
-    const UINT8 *scantable;
105
-    UINT8 permutated[64];
106
-    UINT8 raster_end[64];
104
+    const uint8_t *scantable;
105
+    uint8_t permutated[64];
106
+    uint8_t raster_end[64];
107 107
 #ifdef ARCH_POWERPC
108 108
 		/* Used by dct_quantise_alitvec to find last-non-zero */
109
-    UINT8 __align8 inverse[64];
109
+    uint8_t __align8 inverse[64];
110 110
 #endif
111 111
 } ScanTable;
112 112
 
... ...
@@ -123,7 +123,7 @@ typedef struct Picture{
123 123
 } Picture;
124 124
 
125 125
 typedef struct ParseContext{
126
-    UINT8 *buffer;
126
+    uint8_t *buffer;
127 127
     int index;
128 128
     int last_index;
129 129
     int buffer_size;
... ...
@@ -147,7 +147,7 @@ typedef struct MotionEstContext{
147 147
     int mb_penalty_factor;
148 148
     int pre_pass;                      /* = 1 for the pre pass */
149 149
     int dia_size;
150
-    UINT16 (*mv_penalty)[MAX_MV*2+1];  /* amount of bits needed to encode a MV */
150
+    uint16_t (*mv_penalty)[MAX_MV*2+1];  /* amount of bits needed to encode a MV */
151 151
     int (*sub_motion_search)(struct MpegEncContext * s,
152 152
 				  int *mx_ptr, int *my_ptr, int dmin,
153 153
 				  int xmin, int ymin, int xmax, int ymax,
... ...
@@ -224,21 +224,21 @@ typedef struct MpegEncContext {
224 224
     Picture new_picture;        /* source picture for encoding */
225 225
     Picture current_picture;    /* buffer to store the decompressed current picture */
226 226
     int last_dc[3];              /* last DC values for MPEG1 */
227
-    INT16 *dc_val[3];            /* used for mpeg4 DC prediction, all 3 arrays must be continuous */
227
+    int16_t *dc_val[3];            /* used for mpeg4 DC prediction, all 3 arrays must be continuous */
228 228
     int y_dc_scale, c_dc_scale;
229
-    UINT8 *y_dc_scale_table;     /* qscale -> y_dc_scale table */
230
-    UINT8 *c_dc_scale_table;     /* qscale -> c_dc_scale table */
231
-    UINT8 *coded_block;          /* used for coded block pattern prediction (msmpeg4v3, wmv1)*/
232
-    INT16 (*ac_val[3])[16];      /* used for for mpeg4 AC prediction, all 3 arrays must be continuous */
229
+    uint8_t *y_dc_scale_table;     /* qscale -> y_dc_scale table */
230
+    uint8_t *c_dc_scale_table;     /* qscale -> c_dc_scale table */
231
+    uint8_t *coded_block;          /* used for coded block pattern prediction (msmpeg4v3, wmv1)*/
232
+    int16_t (*ac_val[3])[16];      /* used for for mpeg4 AC prediction, all 3 arrays must be continuous */
233 233
     int ac_pred;
234 234
     uint8_t *prev_pict_types;   /* previous picture types in bitstream order, used for mb skip */
235 235
 #define PREV_PICT_TYPES_BUFFER_SIZE 256
236 236
     int mb_skiped;              /* MUST BE SET only during DECODING */
237
-    UINT8 *mbskip_table;        /* used to avoid copy if macroblock skipped (for black regions for example) 
237
+    uint8_t *mbskip_table;        /* used to avoid copy if macroblock skipped (for black regions for example) 
238 238
                                    and used for b-frame encoding & decoding (contains skip table of next P Frame) */
239
-    UINT8 *mbintra_table;       /* used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding */
240
-    UINT8 *cbp_table;           /* used to store cbp, ac_pred for partitioned decoding */
241
-    UINT8 *pred_dir_table;      /* used to store pred_dir for partitioned decoding */
239
+    uint8_t *mbintra_table;       /* used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding */
240
+    uint8_t *cbp_table;           /* used to store cbp, ac_pred for partitioned decoding */
241
+    uint8_t *pred_dir_table;      /* used to store pred_dir for partitioned decoding */
242 242
     uint8_t *allocated_edge_emu_buffer;
243 243
     uint8_t *edge_emu_buffer;     /* points into the middle of allocated_edge_emu_buffer */ 
244 244
 
... ...
@@ -257,13 +257,13 @@ typedef struct MpegEncContext {
257 257
     DSPContext dsp;             /* pointers for accelerated dsp fucntions */
258 258
     int f_code; /* forward MV resolution */
259 259
     int b_code; /* backward MV resolution for B Frames (mpeg4) */
260
-    INT16 (*motion_val)[2];            /* used for MV prediction (4MV per MB) */
261
-    INT16 (*p_mv_table)[2];            /* MV table (1MV per MB) p-frame encoding */
262
-    INT16 (*b_forw_mv_table)[2];       /* MV table (1MV per MB) forward mode b-frame encoding */
263
-    INT16 (*b_back_mv_table)[2];       /* MV table (1MV per MB) backward mode b-frame encoding */
264
-    INT16 (*b_bidir_forw_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */
265
-    INT16 (*b_bidir_back_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */
266
-    INT16 (*b_direct_mv_table)[2];     /* MV table (1MV per MB) direct mode b-frame encoding */
260
+    int16_t (*motion_val)[2];            /* used for MV prediction (4MV per MB) */
261
+    int16_t (*p_mv_table)[2];            /* MV table (1MV per MB) p-frame encoding */
262
+    int16_t (*b_forw_mv_table)[2];       /* MV table (1MV per MB) forward mode b-frame encoding */
263
+    int16_t (*b_back_mv_table)[2];       /* MV table (1MV per MB) backward mode b-frame encoding */
264
+    int16_t (*b_bidir_forw_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */
265
+    int16_t (*b_bidir_back_mv_table)[2]; /* MV table (1MV per MB) bidir mode b-frame encoding */
266
+    int16_t (*b_direct_mv_table)[2];     /* MV table (1MV per MB) direct mode b-frame encoding */
267 267
     int me_method;                     /* ME algorithm */
268 268
     int scene_change_score;
269 269
     int mv_dir;
... ...
@@ -284,7 +284,7 @@ typedef struct MpegEncContext {
284 284
     int mv[2][4][2];
285 285
     int field_select[2][2];
286 286
     int last_mv[2][2][2];             /* last MV, used for MV prediction in MPEG1 & B-frame MPEG4 */
287
-    UINT8 *fcode_tab; /* smallest fcode needed for each MV */
287
+    uint8_t *fcode_tab; /* smallest fcode needed for each MV */
288 288
     
289 289
     MotionEstContext me;
290 290
 
... ...
@@ -298,7 +298,7 @@ typedef struct MpegEncContext {
298 298
     int mb_x, mb_y;
299 299
     int mb_incr;
300 300
     int mb_intra;
301
-    UINT8 *mb_type;       /* Table for MB type */
301
+    uint8_t *mb_type;       /* Table for MB type */
302 302
 #define MB_TYPE_INTRA    0x01
303 303
 #define MB_TYPE_INTER    0x02
304 304
 #define MB_TYPE_INTER4V  0x04
... ...
@@ -314,10 +314,10 @@ typedef struct MpegEncContext {
314 314
     int block_wrap[6];
315 315
 
316 316
     /* matrix transmitted in the bitstream */
317
-    UINT16 intra_matrix[64];
318
-    UINT16 chroma_intra_matrix[64];
319
-    UINT16 inter_matrix[64];
320
-    UINT16 chroma_inter_matrix[64];
317
+    uint16_t intra_matrix[64];
318
+    uint16_t chroma_intra_matrix[64];
319
+    uint16_t inter_matrix[64];
320
+    uint16_t chroma_inter_matrix[64];
321 321
 #define QUANT_BIAS_SHIFT 4
322 322
     int intra_quant_bias;    /* bias for the quantizer */
323 323
     int inter_quant_bias;    /* bias for the quantizer */
... ...
@@ -336,17 +336,17 @@ typedef struct MpegEncContext {
336 336
     int __align8 q_intra_matrix[32][64];
337 337
     int __align8 q_inter_matrix[32][64];
338 338
     /* identical to the above but for MMX & these are not permutated */
339
-    UINT16 __align8 q_intra_matrix16[32][64];
340
-    UINT16 __align8 q_inter_matrix16[32][64];
341
-    UINT16 __align8 q_intra_matrix16_bias[32][64];
342
-    UINT16 __align8 q_inter_matrix16_bias[32][64];
339
+    uint16_t __align8 q_intra_matrix16[32][64];
340
+    uint16_t __align8 q_inter_matrix16[32][64];
341
+    uint16_t __align8 q_intra_matrix16_bias[32][64];
342
+    uint16_t __align8 q_inter_matrix16_bias[32][64];
343 343
     int block_last_index[6];  /* last non zero coefficient in block */
344 344
     /* scantables */
345 345
     ScanTable __align8 intra_scantable;
346 346
     ScanTable intra_h_scantable;
347 347
     ScanTable intra_v_scantable;
348 348
     ScanTable inter_scantable; // if inter == intra then intra should be used to reduce tha cache usage
349
-    UINT8 idct_permutation[64];
349
+    uint8_t idct_permutation[64];
350 350
     int idct_permutation_type;
351 351
 #define FF_NO_IDCT_PERM 1
352 352
 #define FF_LIBMPEG2_IDCT_PERM 2
... ...
@@ -357,8 +357,8 @@ typedef struct MpegEncContext {
357 357
 
358 358
     /* bit rate control */
359 359
     int I_frame_bits; //FIXME used in mpeg12 ...
360
-    INT64 wanted_bits;
361
-    INT64 total_bits;
360
+    int64_t wanted_bits;
361
+    int64_t total_bits;
362 362
     int frame_bits;        /* bits used for the current frame */
363 363
     RateControlContext rc_context; // contains stuff only accessed in ratecontrol.c
364 364
 
... ...
@@ -375,7 +375,7 @@ typedef struct MpegEncContext {
375 375
     int last_bits; //temp var used for calculating the above vars
376 376
     
377 377
     /* error concealment / resync */
378
-    UINT8 *error_status_table;       /* table of the error status of each MB */ 
378
+    uint8_t *error_status_table;       /* table of the error status of each MB */ 
379 379
 #define VP_START            1        /* current MB is the first after a resync marker */
380 380
 #define AC_ERROR            2
381 381
 #define DC_ERROR            4
... ...
@@ -409,12 +409,12 @@ typedef struct MpegEncContext {
409 409
     int time_increment_bits;        /* number of bits to represent the fractional part of time */
410 410
     int last_time_base;
411 411
     int time_base;                  /* time in seconds of last I,P,S Frame */
412
-    INT64 time;                   /* time of current frame */ 
413
-    INT64 last_non_b_time;
414
-    UINT16 pp_time;               /* time distance between the last 2 p,s,i frames */
415
-    UINT16 pb_time;               /* time distance between the last b and p,s,i frame */
416
-    UINT16 pp_field_time;
417
-    UINT16 pb_field_time;         /* like above, just for interlaced */
412
+    int64_t time;                   /* time of current frame */ 
413
+    int64_t last_non_b_time;
414
+    uint16_t pp_time;               /* time distance between the last 2 p,s,i frames */
415
+    uint16_t pb_time;               /* time distance between the last b and p,s,i frame */
416
+    uint16_t pp_field_time;
417
+    uint16_t pb_field_time;         /* like above, just for interlaced */
418 418
     int shape;
419 419
     int vol_sprite_usage;
420 420
     int sprite_width;
... ...
@@ -455,9 +455,9 @@ typedef struct MpegEncContext {
455 455
     int mpeg_quant;
456 456
 #define CO_LOCATED_TYPE_4MV     1
457 457
 #define CO_LOCATED_TYPE_FIELDMV 2
458
-    INT8 *co_located_type_table;     /* 4mv & field_mv info for next b frame */
459
-    INT16 (*field_mv_table)[2][2];   /* used for interlaced b frame decoding */
460
-    INT8 (*field_select_table)[2];   /* wtf, no really another table for interlaced b frames */
458
+    int8_t *co_located_type_table;     /* 4mv & field_mv info for next b frame */
459
+    int16_t (*field_mv_table)[2][2];   /* used for interlaced b frame decoding */
460
+    int8_t (*field_select_table)[2];   /* wtf, no really another table for interlaced b frames */
461 461
     int t_frame;                     /* time distance of first I -> B, used for interlaced b frames */
462 462
     int padding_bug_score;           /* used to detect the VERY common padding bug in MPEG4 */
463 463
 
... ...
@@ -465,7 +465,7 @@ typedef struct MpegEncContext {
465 465
     int divx_version;
466 466
     int divx_build;
467 467
 #define BITSTREAM_BUFFER_SIZE 1024*256
468
-    UINT8 *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them
468
+    uint8_t *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them
469 469
     int bitstream_buffer_size;
470 470
     
471 471
     int xvid_build;
... ...
@@ -541,9 +541,9 @@ typedef struct MpegEncContext {
541 541
     int rtp_mode;
542 542
     int rtp_payload_size;
543 543
     void (*rtp_callback)(void *data, int size, int packet_number);
544
-    UINT8 *ptr_lastgob;
545
-    UINT8 *ptr_last_mb_line;
546
-    UINT32 mb_line_avgsize;
544
+    uint8_t *ptr_lastgob;
545
+    uint8_t *ptr_last_mb_line;
546
+    uint32_t mb_line_avgsize;
547 547
     
548 548
     DCTELEM (*block)[64]; /* points to one of the following blocks */
549 549
     DCTELEM blocks[2][6][64] __align8; // for HQ mode we need to keep the best block
... ...
@@ -564,8 +564,8 @@ typedef struct MpegEncContext {
564 564
     int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
565 565
     int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
566 566
     void (*fdct)(DCTELEM *block/* align 16*/);
567
-    void (*idct_put)(UINT8 *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
568
-    void (*idct_add)(UINT8 *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
567
+    void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
568
+    void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
569 569
     //FIXME move above funcs into dspContext perhaps
570 570
 } MpegEncContext;
571 571
 
... ...
@@ -597,14 +597,14 @@ void MPV_common_init_armv4l(MpegEncContext *s);
597 597
 #ifdef ARCH_POWERPC
598 598
 void MPV_common_init_ppc(MpegEncContext *s);
599 599
 #endif
600
-extern void (*draw_edges)(UINT8 *buf, int wrap, int width, int height, int w);
600
+extern void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w);
601 601
 void ff_conceal_past_errors(MpegEncContext *s, int conceal_all);
602
-void ff_copy_bits(PutBitContext *pb, UINT8 *src, int length);
602
+void ff_copy_bits(PutBitContext *pb, uint8_t *src, int length);
603 603
 void ff_clean_intra_table_entries(MpegEncContext *s);
604
-void ff_init_scantable(MpegEncContext *s, ScanTable *st, const UINT8 *src_scantable);
604
+void ff_init_scantable(MpegEncContext *s, ScanTable *st, const uint8_t *src_scantable);
605 605
 void ff_error_resilience(MpegEncContext *s);
606 606
 void ff_draw_horiz_band(MpegEncContext *s);
607
-void ff_emulated_edge_mc(MpegEncContext *s, UINT8 *src, int linesize, int block_w, int block_h, 
607
+void ff_emulated_edge_mc(MpegEncContext *s, uint8_t *src, int linesize, int block_w, int block_h, 
608 608
                                     int src_x, int src_y, int w, int h);
609 609
 char ff_get_pict_type_char(int pict_type);
610 610
 int ff_combine_frame( MpegEncContext *s, int next, uint8_t **buf, int *buf_size);
... ...
@@ -645,9 +645,9 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y);
645 645
 
646 646
 
647 647
 /* mpeg12.c */
648
-extern const INT16 ff_mpeg1_default_intra_matrix[64];
649
-extern const INT16 ff_mpeg1_default_non_intra_matrix[64];
650
-extern UINT8 ff_mpeg1_dc_scale_table[128];
648
+extern const int16_t ff_mpeg1_default_intra_matrix[64];
649
+extern const int16_t ff_mpeg1_default_non_intra_matrix[64];
650
+extern uint8_t ff_mpeg1_dc_scale_table[128];
651 651
 
652 652
 void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
653 653
 void mpeg1_encode_mb(MpegEncContext *s,
... ...
@@ -660,12 +660,12 @@ void ff_mpeg1_encode_init(MpegEncContext *s);
660 660
 typedef struct RLTable {
661 661
     int n; /* number of entries of table_vlc minus 1 */
662 662
     int last; /* number of values for last = 0 */
663
-    const UINT16 (*table_vlc)[2];
664
-    const INT8 *table_run;
665
-    const INT8 *table_level;
666
-    UINT8 *index_run[2]; /* encoding only */
667
-    INT8 *max_level[2]; /* encoding & decoding */
668
-    INT8 *max_run[2];   /* encoding & decoding */
663
+    const uint16_t (*table_vlc)[2];
664
+    const int8_t *table_run;
665
+    const int8_t *table_level;
666
+    uint8_t *index_run[2]; /* encoding only */
667
+    int8_t *max_level[2]; /* encoding & decoding */
668
+    int8_t *max_run[2];   /* encoding & decoding */
669 669
     VLC vlc;            /* decoding only deprected FIXME remove*/
670 670
     RL_VLC_ELEM *rl_vlc[32]; /* decoding only */
671 671
 } RLTable;
... ...
@@ -684,14 +684,14 @@ static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
684 684
     return index + level - 1;
685 685
 }
686 686
 
687
-extern UINT8 ff_mpeg4_y_dc_scale_table[32];
688
-extern UINT8 ff_mpeg4_c_dc_scale_table[32];
689
-extern const INT16 ff_mpeg4_default_intra_matrix[64];
690
-extern const INT16 ff_mpeg4_default_non_intra_matrix[64];
687
+extern uint8_t ff_mpeg4_y_dc_scale_table[32];
688
+extern uint8_t ff_mpeg4_c_dc_scale_table[32];
689
+extern const int16_t ff_mpeg4_default_intra_matrix[64];
690
+extern const int16_t ff_mpeg4_default_non_intra_matrix[64];
691 691
 int ff_h263_decode_init(AVCodecContext *avctx);
692 692
 int ff_h263_decode_frame(AVCodecContext *avctx, 
693 693
                              void *data, int *data_size,
694
-                             UINT8 *buf, int buf_size);
694
+                             uint8_t *buf, int buf_size);
695 695
 int ff_h263_decode_end(AVCodecContext *avctx);
696 696
 void h263_encode_mb(MpegEncContext *s, 
697 697
                     DCTELEM block[6][64],
... ...
@@ -701,7 +701,7 @@ void mpeg4_encode_mb(MpegEncContext *s,
701 701
                     int motion_x, int motion_y);
702 702
 void h263_encode_picture_header(MpegEncContext *s, int picture_number);
703 703
 int h263_encode_gob_header(MpegEncContext * s, int mb_line);
704
-INT16 *h263_pred_motion(MpegEncContext * s, int block, 
704
+int16_t *h263_pred_motion(MpegEncContext * s, int block, 
705 705
                         int *px, int *py);
706 706
 void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, 
707 707
                    int dir);
... ...
@@ -751,8 +751,8 @@ void ff_msmpeg4_encode_init(MpegEncContext *s);
751 751
 int ff_wmv2_decode_picture_header(MpegEncContext * s);
752 752
 void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);
753 753
 void ff_mspel_motion(MpegEncContext *s,
754
-                               UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr,
755
-                               UINT8 **ref_picture, op_pixels_func (*pix_op)[4],
754
+                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
755
+                               uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
756 756
                                int motion_x, int motion_y, int h);
757 757
 int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);
758 758
 void ff_wmv2_encode_mb(MpegEncContext * s, 
... ...
@@ -50,8 +50,8 @@
50 50
 
51 51
 #define DEFAULT_INTER_INDEX 3
52 52
 
53
-static UINT32 v2_dc_lum_table[512][2];
54
-static UINT32 v2_dc_chroma_table[512][2];
53
+static uint32_t v2_dc_lum_table[512][2];
54
+static uint32_t v2_dc_chroma_table[512][2];
55 55
 
56 56
 static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n);
57 57
 static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
... ...
@@ -67,7 +67,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
67 67
 static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
68 68
 static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
69 69
 
70
-extern UINT32 inverse[256];
70
+extern uint32_t inverse[256];
71 71
 
72 72
 
73 73
 #ifdef DEBUG
... ...
@@ -77,7 +77,7 @@ int frame_count = 0;
77 77
 
78 78
 #include "msmpeg4data.h"
79 79
 
80
-static UINT8 rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
80
+static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
81 81
 
82 82
 #ifdef STATS
83 83
 
... ...
@@ -190,7 +190,7 @@ static void init_mv_table(MVTable *tab)
190 190
 {
191 191
     int i, x, y;
192 192
 
193
-    tab->table_mv_index = av_malloc(sizeof(UINT16) * 4096);
193
+    tab->table_mv_index = av_malloc(sizeof(uint16_t) * 4096);
194 194
     /* mark all entries as not used */
195 195
     for(i=0;i<4096;i++)
196 196
         tab->table_mv_index[i] = tab->n;
... ...
@@ -434,7 +434,7 @@ void msmpeg4_encode_ext_header(MpegEncContext * s)
434 434
 }
435 435
 
436 436
 /* predict coded block */
437
-static inline int coded_block_pred(MpegEncContext * s, int n, UINT8 **coded_block_ptr)
437
+static inline int coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr)
438 438
 {
439 439
     int xy, wrap, pred, a, b, c;
440 440
 
... ...
@@ -518,7 +518,7 @@ void msmpeg4_encode_mb(MpegEncContext * s,
518 518
 {
519 519
     int cbp, coded_cbp, i;
520 520
     int pred_x, pred_y;
521
-    UINT8 *coded_block;
521
+    uint8_t *coded_block;
522 522
 
523 523
     handle_slices(s);
524 524
     
... ...
@@ -640,7 +640,7 @@ static void ff_old_msmpeg4_dc_scale(MpegEncContext * s)
640 640
 }
641 641
 
642 642
 static inline int msmpeg4v1_pred_dc(MpegEncContext * s, int n, 
643
-                                    INT32 **dc_val_ptr)
643
+                                    int32_t **dc_val_ptr)
644 644
 {
645 645
     int i;
646 646
 
... ...
@@ -669,10 +669,10 @@ static int get_dc(uint8_t *src, int stride, int scale)
669 669
 
670 670
 /* dir = 0: left, dir = 1: top prediction */
671 671
 static inline int msmpeg4_pred_dc(MpegEncContext * s, int n, 
672
-                             UINT16 **dc_val_ptr, int *dir_ptr)
672
+                             uint16_t **dc_val_ptr, int *dir_ptr)
673 673
 {
674 674
     int a, b, c, wrap, pred, scale;
675
-    INT16 *dc_val;
675
+    int16_t *dc_val;
676 676
 
677 677
     /* find prediction */
678 678
     if (n < 4) {
... ...
@@ -823,13 +823,13 @@ static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr
823 823
     int pred;
824 824
 
825 825
     if(s->msmpeg4_version==1){
826
-        INT32 *dc_val;
826
+        int32_t *dc_val;
827 827
         pred = msmpeg4v1_pred_dc(s, n, &dc_val);
828 828
         
829 829
         /* update predictor */
830 830
         *dc_val= level;
831 831
     }else{
832
-        UINT16 *dc_val;
832
+        uint16_t *dc_val;
833 833
         pred = msmpeg4_pred_dc(s, n, &dc_val, dir_ptr);
834 834
 
835 835
         /* update predictor */
... ...
@@ -895,7 +895,7 @@ static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int
895 895
     int last_non_zero, sign, slevel;
896 896
     int code, run_diff, dc_pred_dir;
897 897
     const RLTable *rl;
898
-    const UINT8 *scantable;
898
+    const uint8_t *scantable;
899 899
 
900 900
     if (s->mb_intra) {
901 901
         set_stat(ST_DC);
... ...
@@ -1544,7 +1544,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
1544 1544
 static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
1545 1545
 {
1546 1546
     int cbp, code, i;
1547
-    UINT8 *coded_val;
1547
+    uint8_t *coded_val;
1548 1548
 
1549 1549
 #ifdef PRINT_MB
1550 1550
 if(s->mb_x==0){
... ...
@@ -1939,14 +1939,14 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
1939 1939
     }
1940 1940
 
1941 1941
     if(s->msmpeg4_version==1){
1942
-        INT32 *dc_val;
1942
+        int32_t *dc_val;
1943 1943
         pred = msmpeg4v1_pred_dc(s, n, &dc_val);
1944 1944
         level += pred;
1945 1945
         
1946 1946
         /* update predictor */
1947 1947
         *dc_val= level;
1948 1948
     }else{
1949
-        UINT16 *dc_val;
1949
+        uint16_t *dc_val;
1950 1950
         pred = msmpeg4_pred_dc(s, n, &dc_val, dir_ptr);
1951 1951
         level += pred;
1952 1952
 
... ...
@@ -179,7 +179,7 @@ static inline int conv(int samples, float **pcm, char *buf, int channels) {
179 179
 	
180 180
 static int oggvorbis_decode_frame(AVCodecContext *avccontext,
181 181
                         void *data, int *data_size,
182
-                        UINT8 *buf, int buf_size)
182
+                        uint8_t *buf, int buf_size)
183 183
 {
184 184
     OggVorbisContext *context = avccontext->priv_data ;
185 185
     ogg_packet *op = (ogg_packet*)buf ;
... ...
@@ -73,13 +73,13 @@ static int ulaw2linear(unsigned char	u_val)
73 73
 }
74 74
 
75 75
 /* 16384 entries per table */
76
-static UINT8 *linear_to_alaw = NULL;
76
+static uint8_t *linear_to_alaw = NULL;
77 77
 static int linear_to_alaw_ref = 0;
78 78
 
79
-static UINT8 *linear_to_ulaw = NULL;
79
+static uint8_t *linear_to_ulaw = NULL;
80 80
 static int linear_to_ulaw_ref = 0;
81 81
 
82
-static void build_xlaw_table(UINT8 *linear_to_xlaw, 
82
+static void build_xlaw_table(uint8_t *linear_to_xlaw, 
83 83
                              int (*xlaw2linear)(unsigned char),
84 84
                              int mask) 
85 85
 {
... ...
@@ -274,12 +274,12 @@ static int pcm_decode_init(AVCodecContext * avctx)
274 274
 
275 275
 static int pcm_decode_frame(AVCodecContext *avctx,
276 276
 			    void *data, int *data_size,
277
-			    UINT8 *buf, int buf_size)
277
+			    uint8_t *buf, int buf_size)
278 278
 {
279 279
     PCMDecode *s = avctx->priv_data;
280 280
     int n;
281 281
     short *samples;
282
-    UINT8 *src;
282
+    uint8_t *src;
283 283
 
284 284
     samples = data;
285 285
     src = buf;
... ...
@@ -339,7 +339,7 @@ static int pcm_decode_frame(AVCodecContext *avctx,
339 339
         *data_size = 0;
340 340
         return -1;
341 341
     }
342
-    *data_size = (UINT8 *)samples - (UINT8 *)data;
342
+    *data_size = (uint8_t *)samples - (uint8_t *)data;
343 343
     return src - buf;
344 344
 }
345 345
 
... ...
@@ -480,7 +480,7 @@ int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size)
480 480
     return s;
481 481
 }
482 482
 
483
-int pix_sum_altivec(UINT8 * pix, int line_size)
483
+int pix_sum_altivec(uint8_t * pix, int line_size)
484 484
 {
485 485
     const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
486 486
     vector unsigned char perm, *pixv;
... ...
@@ -513,7 +513,7 @@ int pix_sum_altivec(UINT8 * pix, int line_size)
513 513
     return s;
514 514
 }
515 515
 
516
-void get_pixels_altivec(DCTELEM *restrict block, const UINT8 *pixels, int line_size)
516
+void get_pixels_altivec(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
517 517
 {
518 518
     int i;
519 519
     vector unsigned char perm, bytes, *pixv;
... ...
@@ -539,8 +539,8 @@ void get_pixels_altivec(DCTELEM *restrict block, const UINT8 *pixels, int line_s
539 539
     }
540 540
 }
541 541
 
542
-void diff_pixels_altivec(DCTELEM *restrict block, const UINT8 *s1,
543
-        const UINT8 *s2, int stride)
542
+void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1,
543
+        const uint8_t *s2, int stride)
544 544
 {
545 545
     int i;
546 546
     vector unsigned char perm, bytes, *pixv;
... ...
@@ -34,12 +34,12 @@ extern int sad8x8_altivec(void *s, uint8_t *a, uint8_t *b, int stride);
34 34
 extern int pix_norm1_altivec(uint8_t *pix, int line_size);
35 35
 extern int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size);
36 36
 extern int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size);
37
-extern int pix_sum_altivec(UINT8 * pix, int line_size);
38
-extern void diff_pixels_altivec(DCTELEM* block, const UINT8* s1, const UINT8* s2, int stride);
39
-extern void get_pixels_altivec(DCTELEM* block, const UINT8 * pixels, int line_size);
37
+extern int pix_sum_altivec(uint8_t * pix, int line_size);
38
+extern void diff_pixels_altivec(DCTELEM* block, const uint8_t* s1, const uint8_t* s2, int stride);
39
+extern void get_pixels_altivec(DCTELEM* block, const uint8_t * pixels, int line_size);
40 40
 
41 41
 extern void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w);
42
-extern void put_pixels_clamped_altivec(const DCTELEM *block, UINT8 *restrict pixels, int line_size);
42
+extern void put_pixels_clamped_altivec(const DCTELEM *block, uint8_t *restrict pixels, int line_size);
43 43
 extern void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
44 44
 extern void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
45 45
 extern void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h);
... ...
@@ -48,7 +48,7 @@ extern void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels
48 48
 extern void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h);
49 49
 extern void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h);
50 50
 
51
-extern void gmc1_altivec(UINT8 *dst, UINT8 *src, int stride, int h, int x16, int y16, int rounder);
51
+extern void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder);
52 52
 
53 53
 extern int has_altivec(void);
54 54
 
... ...
@@ -26,7 +26,7 @@
26 26
   altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8,
27 27
   to preserve proper dst alignement.
28 28
 */
29
-void gmc1_altivec(UINT8 *dst /* align 8 */, UINT8 *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
29
+void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
30 30
 {
31 31
 POWERPC_TBL_DECLARE(altivec_gmc1_num, h == 8);
32 32
 #ifdef ALTIVEC_USE_REFERENCE_C_CODE
... ...
@@ -176,8 +176,8 @@ void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)
176 176
 POWERPC_TBL_DECLARE(altivec_idct_put_num, 1);
177 177
 #ifdef ALTIVEC_USE_REFERENCE_C_CODE
178 178
 POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1);
179
-    void simple_idct_put(UINT8 *dest, int line_size, INT16 *block);
180
-    simple_idct_put(dest, stride, (INT16*)block);
179
+    void simple_idct_put(uint8_t *dest, int line_size, int16_t *block);
180
+    simple_idct_put(dest, stride, (int16_t*)block);
181 181
 POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1);
182 182
 #else /* ALTIVEC_USE_REFERENCE_C_CODE */
183 183
     vector_u8_t tmp;
... ...
@@ -209,8 +209,8 @@ void idct_add_altivec(uint8_t* dest, int stride, vector_s16_t* block)
209 209
 POWERPC_TBL_DECLARE(altivec_idct_add_num, 1);
210 210
 #ifdef ALTIVEC_USE_REFERENCE_C_CODE
211 211
 POWERPC_TBL_START_COUNT(altivec_idct_add_num, 1);
212
-    void simple_idct_add(UINT8 *dest, int line_size, INT16 *block);
213
-    simple_idct_add(dest, stride, (INT16*)block);
212
+    void simple_idct_add(uint8_t *dest, int line_size, int16_t *block);
213
+    simple_idct_add(dest, stride, (int16_t*)block);
214 214
 POWERPC_TBL_STOP_COUNT(altivec_idct_add_num, 1);
215 215
 #else /* ALTIVEC_USE_REFERENCE_C_CODE */
216 216
     vector_u8_t tmp;
... ...
@@ -30,8 +30,8 @@ extern int dct_quantize_altivec(MpegEncContext *s,
30 30
 extern void dct_unquantize_h263_altivec(MpegEncContext *s,
31 31
                                         DCTELEM *block, int n, int qscale);
32 32
 
33
-extern void idct_put_altivec(UINT8 *dest, int line_size, INT16 *block);
34
-extern void idct_add_altivec(UINT8 *dest, int line_size, INT16 *block);
33
+extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
34
+extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
35 35
 
36 36
 
37 37
 void MPV_common_init_ppc(MpegEncContext *s)
... ...
@@ -41,7 +41,7 @@ static void clear_blocks_mmi(DCTELEM * blocks)
41 41
 }
42 42
 
43 43
 
44
-static void get_pixels_mmi(DCTELEM *block, const UINT8 *pixels, int line_size)
44
+static void get_pixels_mmi(DCTELEM *block, const uint8_t *pixels, int line_size)
45 45
 {
46 46
     int i;
47 47
     for(i=0;i<8;i++) {
... ...
@@ -299,7 +299,7 @@ void ff_mmi_idct(int16_t * block)
299 299
 }
300 300
 
301 301
 
302
-void ff_mmi_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
302
+void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
303 303
 {
304 304
     /* $4 = dest, $5 = line_size, $6 = block */
305 305
     __asm__ __volatile__("la $24, %0"::"m"(consttable[0]));
... ...
@@ -323,7 +323,7 @@ void ff_mmi_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
323 323
 }
324 324
 
325 325
 
326
-void ff_mmi_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
326
+void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
327 327
 {
328 328
     /* $4 = dest, $5 = line_size, $6 = block */
329 329
     __asm__ __volatile__("la $24, %0"::"m"(consttable[0]));
... ...
@@ -22,8 +22,8 @@
22 22
 #include "../mpegvideo.h"
23 23
 #include "../avcodec.h"
24 24
 
25
-void ff_mmi_idct_put(UINT8 *dest, int line_size, DCTELEM *block);
26
-void ff_mmi_idct_add(UINT8 *dest, int line_size, DCTELEM *block);
25
+void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block);
26
+void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
27 27
 
28 28
 
29 29
 static void dct_unquantize_h263_mmi(MpegEncContext *s, 
... ...
@@ -20,8 +20,8 @@
20 20
 
21 21
 typedef struct {
22 22
     /* fractional resampling */
23
-    UINT32 incr; /* fractional increment */
24
-    UINT32 frac;
23
+    uint32_t incr; /* fractional increment */
24
+    uint32_t frac;
25 25
     int last_sample;
26 26
     /* integer down sample */
27 27
     int iratio;  /* integer divison ratio */
... ...
@@ -24,7 +24,7 @@
24 24
 
25 25
 #define DC_VLC_BITS 14 //FIXME find a better solution
26 26
 
27
-static const UINT16 rv_lum_code[256] =
27
+static const uint16_t rv_lum_code[256] =
28 28
 {
29 29
  0x3e7f, 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06,
30 30
  0x0f07, 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e,
... ...
@@ -60,7 +60,7 @@ static const UINT16 rv_lum_code[256] =
60 60
  0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
61 61
 };
62 62
 
63
-static const UINT8 rv_lum_bits[256] = 
63
+static const uint8_t rv_lum_bits[256] = 
64 64
 {
65 65
  14, 12, 12, 12, 12, 12, 12, 12,
66 66
  12, 12, 12, 12, 12, 12, 12, 12,
... ...
@@ -96,7 +96,7 @@ static const UINT8 rv_lum_bits[256] =
96 96
  12, 12, 12, 12, 12, 12, 12, 12,
97 97
 };
98 98
 
99
-static const UINT16 rv_chrom_code[256] =
99
+static const uint16_t rv_chrom_code[256] =
100 100
 {
101 101
  0xfe7f, 0x3f00, 0x3f01, 0x3f02, 0x3f03, 0x3f04, 0x3f05, 0x3f06,
102 102
  0x3f07, 0x3f08, 0x3f09, 0x3f0a, 0x3f0b, 0x3f0c, 0x3f0d, 0x3f0e,
... ...
@@ -132,7 +132,7 @@ static const UINT16 rv_chrom_code[256] =
132 132
  0x3f78, 0x3f79, 0x3f7a, 0x3f7b, 0x3f7c, 0x3f7d, 0x3f7e, 0x3f7f,
133 133
 };
134 134
 
135
-static const UINT8 rv_chrom_bits[256] =
135
+static const uint8_t rv_chrom_bits[256] =
136 136
 {
137 137
  16, 14, 14, 14, 14, 14, 14, 14,
138 138
  14, 14, 14, 14, 14, 14, 14, 14,
... ...
@@ -182,14 +182,14 @@ int rv_decode_dc(MpegEncContext *s, int n)
182 182
                if they had thought about it !!! */
183 183
             code = get_bits(&s->gb, 7);
184 184
             if (code == 0x7c) {
185
-                code = (INT8)(get_bits(&s->gb, 7) + 1);
185
+                code = (int8_t)(get_bits(&s->gb, 7) + 1);
186 186
             } else if (code == 0x7d) {
187 187
                 code = -128 + get_bits(&s->gb, 7);
188 188
             } else if (code == 0x7e) {
189 189
                 if (get_bits(&s->gb, 1) == 0)
190
-                    code = (INT8)(get_bits(&s->gb, 8) + 1);
190
+                    code = (int8_t)(get_bits(&s->gb, 8) + 1);
191 191
                 else
192
-                    code = (INT8)(get_bits(&s->gb, 8));
192
+                    code = (int8_t)(get_bits(&s->gb, 8));
193 193
             } else if (code == 0x7f) {
194 194
                 get_bits(&s->gb, 11);
195 195
                 code = 1;
... ...
@@ -203,7 +203,7 @@ int rv_decode_dc(MpegEncContext *s, int n)
203 203
         if (code < 0) {
204 204
             code = get_bits(&s->gb, 9);
205 205
             if (code == 0x1fc) {
206
-                code = (INT8)(get_bits(&s->gb, 7) + 1);
206
+                code = (int8_t)(get_bits(&s->gb, 7) + 1);
207 207
             } else if (code == 0x1fd) {
208 208
                 code = -128 + get_bits(&s->gb, 7);
209 209
             } else if (code == 0x1fe) {
... ...
@@ -390,7 +390,7 @@ static int rv10_decode_end(AVCodecContext *avctx)
390 390
 }
391 391
 
392 392
 static int rv10_decode_packet(AVCodecContext *avctx, 
393
-                             UINT8 *buf, int buf_size)
393
+                             uint8_t *buf, int buf_size)
394 394
 {
395 395
     MpegEncContext *s = avctx->priv_data;
396 396
     int i, mb_count, mb_pos, left;
... ...
@@ -468,7 +468,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
468 468
 
469 469
 static int rv10_decode_frame(AVCodecContext *avctx, 
470 470
                              void *data, int *data_size,
471
-                             UINT8 *buf, int buf_size)
471
+                             uint8_t *buf, int buf_size)
472 472
 {
473 473
     MpegEncContext *s = avctx->priv_data;
474 474
     int i;
... ...
@@ -172,11 +172,11 @@ static inline void idctRowCondDC (DCTELEM * row)
172 172
 	row[4] = (a3 - b3) >> ROW_SHIFT;
173 173
 }
174 174
 
175
-static inline void idctSparseColPut (UINT8 *dest, int line_size, 
175
+static inline void idctSparseColPut (uint8_t *dest, int line_size, 
176 176
                                      DCTELEM * col)
177 177
 {
178 178
 	int a0, a1, a2, a3, b0, b1, b2, b3;
179
-        UINT8 *cm = cropTbl + MAX_NEG_CROP;
179
+        uint8_t *cm = cropTbl + MAX_NEG_CROP;
180 180
 
181 181
         /* XXX: I did that only to give same values as previous code */
182 182
 	a0 = W4 * (col[8*0] + ((1<<(COL_SHIFT-1))/W4));
... ...
@@ -244,11 +244,11 @@ static inline void idctSparseColPut (UINT8 *dest, int line_size,
244 244
         dest[0] = cm[(a0 - b0) >> COL_SHIFT];
245 245
 }
246 246
 
247
-static inline void idctSparseColAdd (UINT8 *dest, int line_size, 
247
+static inline void idctSparseColAdd (uint8_t *dest, int line_size, 
248 248
                                      DCTELEM * col)
249 249
 {
250 250
 	int a0, a1, a2, a3, b0, b1, b2, b3;
251
-        UINT8 *cm = cropTbl + MAX_NEG_CROP;
251
+        uint8_t *cm = cropTbl + MAX_NEG_CROP;
252 252
 
253 253
         /* XXX: I did that only to give same values as previous code */
254 254
 	a0 = W4 * (col[8*0] + ((1<<(COL_SHIFT-1))/W4));
... ...
@@ -379,7 +379,7 @@ static inline void idctSparseCol (DCTELEM * col)
379 379
         col[56] = ((a0 - b0) >> COL_SHIFT);
380 380
 }
381 381
 
382
-void simple_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
382
+void simple_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
383 383
 {
384 384
     int i;
385 385
     for(i=0; i<8; i++)
... ...
@@ -389,7 +389,7 @@ void simple_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
389 389
         idctSparseColPut(dest + i, line_size, block + i);
390 390
 }
391 391
 
392
-void simple_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
392
+void simple_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
393 393
 {
394 394
     int i;
395 395
     for(i=0; i<8; i++)
... ...
@@ -420,10 +420,10 @@ void simple_idct(DCTELEM *block)
420 420
    and the butterfly must be multiplied by 0.5 * sqrt(2.0) */
421 421
 #define C_SHIFT (4+1+12)
422 422
 
423
-static inline void idct4col(UINT8 *dest, int line_size, const DCTELEM *col)
423
+static inline void idct4col(uint8_t *dest, int line_size, const DCTELEM *col)
424 424
 {
425 425
     int c0, c1, c2, c3, a0, a1, a2, a3;
426
-    const UINT8 *cm = cropTbl + MAX_NEG_CROP;
426
+    const uint8_t *cm = cropTbl + MAX_NEG_CROP;
427 427
 
428 428
     a0 = col[8*0];
429 429
     a1 = col[8*2];
... ...
@@ -457,7 +457,7 @@ static inline void idct4col(UINT8 *dest, int line_size, const DCTELEM *col)
457 457
 /* XXX: I think a 1.0/sqrt(2) normalization should be needed to
458 458
    compensate the extra butterfly stage - I don't have the full DV
459 459
    specification */
460
-void simple_idct248_put(UINT8 *dest, int line_size, DCTELEM *block)
460
+void simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block)
461 461
 {
462 462
     int i;
463 463
     DCTELEM *ptr;
... ...
@@ -500,10 +500,10 @@ void simple_idct248_put(UINT8 *dest, int line_size, DCTELEM *block)
500 500
 #define C2 C_FIX(0.2705980501)
501 501
 #define C3 C_FIX(0.5)
502 502
 #define C_SHIFT (4+1+12)
503
-static inline void idct4col_add(UINT8 *dest, int line_size, const DCTELEM *col)
503
+static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col)
504 504
 {
505 505
     int c0, c1, c2, c3, a0, a1, a2, a3;
506
-    const UINT8 *cm = cropTbl + MAX_NEG_CROP;
506
+    const uint8_t *cm = cropTbl + MAX_NEG_CROP;
507 507
 
508 508
     a0 = col[8*0];
509 509
     a1 = col[8*1];
... ...
@@ -531,7 +531,7 @@ static inline void idct4col_add(UINT8 *dest, int line_size, const DCTELEM *col)
531 531
 static inline void idct4row(DCTELEM *row)
532 532
 {
533 533
     int c0, c1, c2, c3, a0, a1, a2, a3;
534
-    const UINT8 *cm = cropTbl + MAX_NEG_CROP;
534
+    //const uint8_t *cm = cropTbl + MAX_NEG_CROP;
535 535
 
536 536
     a0 = row[0];
537 537
     a1 = row[1];
... ...
@@ -547,7 +547,7 @@ static inline void idct4row(DCTELEM *row)
547 547
     row[3]= (c0 - c1) >> R_SHIFT;
548 548
 }
549 549
 
550
-void simple_idct84_add(UINT8 *dest, int line_size, DCTELEM *block)
550
+void simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block)
551 551
 {
552 552
     int i;
553 553
 
... ...
@@ -562,7 +562,7 @@ void simple_idct84_add(UINT8 *dest, int line_size, DCTELEM *block)
562 562
     }
563 563
 }
564 564
 
565
-void simple_idct48_add(UINT8 *dest, int line_size, DCTELEM *block)
565
+void simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block)
566 566
 {
567 567
     int i;
568 568
 
... ...
@@ -18,14 +18,14 @@
18 18
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 19
  */
20 20
 
21
-void simple_idct_put(UINT8 *dest, int line_size, DCTELEM *block);
22
-void simple_idct_add(UINT8 *dest, int line_size, DCTELEM *block);
21
+void simple_idct_put(uint8_t *dest, int line_size, DCTELEM *block);
22
+void simple_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
23 23
 void ff_simple_idct_mmx(int16_t *block);
24
-void ff_simple_idct_add_mmx(UINT8 *dest, int line_size, int16_t *block);
25
-void ff_simple_idct_put_mmx(UINT8 *dest, int line_size, int16_t *block);
24
+void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
25
+void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
26 26
 void simple_idct(DCTELEM *block);
27 27
 
28
-void simple_idct248_put(UINT8 *dest, int line_size, DCTELEM *block);
28
+void simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block);
29 29
 
30
-void simple_idct84_add(UINT8 *dest, int line_size, DCTELEM *block);
31
-void simple_idct48_add(UINT8 *dest, int line_size, DCTELEM *block);
30
+void simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block);
31
+void simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block);
... ...
@@ -1083,7 +1083,7 @@ static int svq1_decode_frame_header (bit_buffer_t *bitbuf,MpegEncContext *s) {
1083 1083
 
1084 1084
 static int svq1_decode_frame(AVCodecContext *avctx, 
1085 1085
                              void *data, int *data_size,
1086
-                             UINT8 *buf, int buf_size)
1086
+                             uint8_t *buf, int buf_size)
1087 1087
 {
1088 1088
   MpegEncContext *s=avctx->priv_data;
1089 1089
   uint8_t      *current, *previous;
... ...
@@ -285,7 +285,7 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
285 285
     return 0;
286 286
 }
287 287
 
288
-int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size, 
288
+int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, 
289 289
                          const short *samples)
290 290
 {
291 291
     int ret;
... ...
@@ -295,7 +295,7 @@ int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size,
295 295
     return ret;
296 296
 }
297 297
 
298
-int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, 
298
+int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, 
299 299
                          const AVFrame *pict)
300 300
 {
301 301
     int ret;
... ...
@@ -313,7 +313,7 @@ int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size,
313 313
    zero. Otherwise, it is non zero */
314 314
 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, 
315 315
                          int *got_picture_ptr,
316
-                         UINT8 *buf, int buf_size)
316
+                         uint8_t *buf, int buf_size)
317 317
 {
318 318
     int ret;
319 319
     
... ...
@@ -331,9 +331,9 @@ int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
331 331
    *number of bytes used. If no frame could be decompressed,
332 332
    *frame_size_ptr is zero. Otherwise, it is the decompressed frame
333 333
    *size in BYTES. */
334
-int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples, 
334
+int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples, 
335 335
                          int *frame_size_ptr,
336
-                         UINT8 *buf, int buf_size)
336
+                         uint8_t *buf, int buf_size)
337 337
 {
338 338
     int ret;
339 339
 
... ...
@@ -589,7 +589,7 @@ static int raw_encode_init(AVCodecContext *s)
589 589
 
590 590
 static int raw_decode_frame(AVCodecContext *avctx,
591 591
 			    void *data, int *data_size,
592
-			    UINT8 *buf, int buf_size)
592
+			    uint8_t *buf, int buf_size)
593 593
 {
594 594
     return -1;
595 595
 }
... ...
@@ -1215,7 +1215,7 @@ static int wma_decode_frame(WMADecodeContext *s, int16_t *samples)
1215 1215
 
1216 1216
 static int wma_decode_superframe(AVCodecContext *avctx, 
1217 1217
                                  void *data, int *data_size,
1218
-                                 UINT8 *buf, int buf_size)
1218
+                                 uint8_t *buf, int buf_size)
1219 1219
 {
1220 1220
     WMADecodeContext *s = avctx->priv_data;
1221 1221
     int nb_frames, bit_offset, i, pos, len;
... ...
@@ -192,7 +192,7 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
192 192
     Wmv2Context * const w= (Wmv2Context*)s;
193 193
     int cbp, coded_cbp, i;
194 194
     int pred_x, pred_y;
195
-    UINT8 *coded_block;
195
+    uint8_t *coded_block;
196 196
 
197 197
     handle_slices(s);
198 198
     
... ...
@@ -491,7 +491,7 @@ static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
491 491
 static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){
492 492
     MpegEncContext * const s= &w->s;
493 493
     int xy, wrap, diff, type;
494
-    INT16 *A, *B, *C, *mot_val;
494
+    int16_t *A, *B, *C, *mot_val;
495 495
 
496 496
     wrap = s->block_wrap[0];
497 497
     xy = s->block_index[0];
... ...
@@ -576,8 +576,7 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n,
576 576
 static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){
577 577
     MpegEncContext * const s= &w->s;
578 578
     uint8_t temp[2][64];
579
-    int i;
580
-        
579
+
581 580
     switch(w->abt_type_table[n]){
582 581
     case 0:
583 582
         if (s->block_last_index[n] >= 0) {
... ...
@@ -614,12 +613,12 @@ void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block1[6][64], uint8_t *dest_y, u
614 614
 }
615 615
 
616 616
 void ff_mspel_motion(MpegEncContext *s,
617
-                               UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr,
618
-                               UINT8 **ref_picture, op_pixels_func (*pix_op)[4],
617
+                               uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
618
+                               uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
619 619
                                int motion_x, int motion_y, int h)
620 620
 {
621 621
     Wmv2Context * const w= (Wmv2Context*)s;
622
-    UINT8 *ptr;
622
+    uint8_t *ptr;
623 623
     int dxy, offset, mx, my, src_x, src_y, v_edge_pos, linesize, uvlinesize;
624 624
     int emu=0;
625 625
     
... ...
@@ -700,7 +699,7 @@ static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
700 700
 {
701 701
     Wmv2Context * const w= (Wmv2Context*)s;
702 702
     int cbp, code, i;
703
-    UINT8 *coded_val;
703
+    uint8_t *coded_val;
704 704
 
705 705
     if(w->j_type) return 0;
706 706
     
... ...
@@ -31,7 +31,7 @@ typedef struct {
31 31
     AVPacket pkt;
32 32
     int frag_offset;
33 33
     int timestamp;
34
-    INT64 duration;
34
+    int64_t duration;
35 35
 
36 36
     int ds_span;		/* descrambling  */
37 37
     int ds_packet_size;
... ...
@@ -42,10 +42,10 @@ typedef struct {
42 42
 } ASFStream;
43 43
 
44 44
 typedef struct {
45
-    UINT32 v1;
46
-    UINT16 v2;
47
-    UINT16 v3;
48
-    UINT8 v4[8];
45
+    uint32_t v1;
46
+    uint16_t v2;
47
+    uint16_t v3;
48
+    uint8_t v4[8];
49 49
 } GUID;
50 50
 
51 51
 typedef struct __attribute__((packed)) {
... ...
@@ -83,14 +83,14 @@ typedef struct {
83 83
     int asfid2avid[128];        /* conversion table from asf ID 2 AVStream ID */
84 84
     ASFStream streams[128];	/* it's max number and it's not that big */
85 85
     /* non streamed additonnal info */
86
-    INT64 nb_packets;
87
-    INT64 duration; /* in 100ns units */
86
+    int64_t nb_packets;
87
+    int64_t duration; /* in 100ns units */
88 88
     /* packet filling */
89 89
     int packet_size_left;
90 90
     int packet_timestamp_start;
91 91
     int packet_timestamp_end;
92 92
     int packet_nb_frames;
93
-    UINT8 packet_buf[PACKET_SIZE];
93
+    uint8_t packet_buf[PACKET_SIZE];
94 94
     ByteIOContext pb;
95 95
     /* only for reading */
96 96
     uint64_t data_offset; /* begining of the first data packet */
... ...
@@ -199,7 +199,7 @@ static void put_str16(ByteIOContext *s, const char *tag)
199 199
 
200 200
     put_le16(s,strlen(tag) + 1);
201 201
     for(;;) {
202
-        c = (UINT8)*tag++;
202
+        c = (uint8_t)*tag++;
203 203
         put_le16(s, c);
204 204
         if (c == '\0')
205 205
             break;
... ...
@@ -211,16 +211,16 @@ static void put_str16_nolen(ByteIOContext *s, const char *tag)
211 211
     int c;
212 212
 
213 213
     for(;;) {
214
-        c = (UINT8)*tag++;
214
+        c = (uint8_t)*tag++;
215 215
         put_le16(s, c);
216 216
         if (c == '\0')
217 217
             break;
218 218
     }
219 219
 }
220 220
 
221
-static INT64 put_header(ByteIOContext *pb, const GUID *g)
221
+static int64_t put_header(ByteIOContext *pb, const GUID *g)
222 222
 {
223
-    INT64 pos;
223
+    int64_t pos;
224 224
 
225 225
     pos = url_ftell(pb);
226 226
     put_guid(pb, g);
... ...
@@ -229,9 +229,9 @@ static INT64 put_header(ByteIOContext *pb, const GUID *g)
229 229
 }
230 230
 
231 231
 /* update header size */
232
-static void end_header(ByteIOContext *pb, INT64 pos)
232
+static void end_header(ByteIOContext *pb, int64_t pos)
233 233
 {
234
-    INT64 pos1;
234
+    int64_t pos1;
235 235
 
236 236
     pos1 = url_ftell(pb);
237 237
     url_fseek(pb, pos + 16, SEEK_SET);
... ...
@@ -256,24 +256,24 @@ static void put_chunk(AVFormatContext *s, int type, int payload_length, int flag
256 256
 }
257 257
 
258 258
 /* convert from unix to windows time */
259
-static INT64 unix_to_file_time(int ti)
259
+static int64_t unix_to_file_time(int ti)
260 260
 {
261
-    INT64 t;
261
+    int64_t t;
262 262
 
263
-    t = ti * INT64_C(10000000);
264
-    t += INT64_C(116444736000000000);
263
+    t = ti * int64_t_C(10000000);
264
+    t += int64_t_C(116444736000000000);
265 265
     return t;
266 266
 }
267 267
 
268 268
 /* write the header (used two times if non streamed) */
269
-static int asf_write_header1(AVFormatContext *s, INT64 file_size, INT64 data_chunk_size)
269
+static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data_chunk_size)
270 270
 {
271 271
     ASFContext *asf = s->priv_data;
272 272
     ByteIOContext *pb = &s->pb;
273 273
     int header_size, n, extra_size, extra_size2, wav_extra_size, file_time;
274 274
     int has_title;
275 275
     AVCodecContext *enc;
276
-    INT64 header_offset, cur_pos, hpos;
276
+    int64_t header_offset, cur_pos, hpos;
277 277
     int bit_rate;
278 278
 
279 279
     has_title = (s->title[0] || s->author[0] || s->copyright[0] || s->comment[0]);
... ...
@@ -337,7 +337,7 @@ static int asf_write_header1(AVFormatContext *s, INT64 file_size, INT64 data_chu
337 337
 
338 338
     /* stream headers */
339 339
     for(n=0;n<s->nb_streams;n++) {
340
-        INT64 es_pos;
340
+        int64_t es_pos;
341 341
         //        ASFStream *stream = &asf->streams[n];
342 342
 
343 343
         enc = &s->streams[n]->codec;
... ...
@@ -574,7 +574,7 @@ static void put_frame_header(AVFormatContext *s, ASFStream *stream, int timestam
574 574
    crap. They have misread the MPEG Systems spec !
575 575
  */
576 576
 static void put_frame(AVFormatContext *s, ASFStream *stream, int timestamp,
577
-                      UINT8 *buf, int payload_size)
577
+                      uint8_t *buf, int payload_size)
578 578
 {
579 579
     ASFContext *asf = s->priv_data;
580 580
     int frag_pos, frag_len, frag_len1;
... ...
@@ -607,22 +607,22 @@ static void put_frame(AVFormatContext *s, ASFStream *stream, int timestamp,
607 607
 
608 608
 
609 609
 static int asf_write_packet(AVFormatContext *s, int stream_index,
610
-                            UINT8 *buf, int size, int timestamp)
610
+                            uint8_t *buf, int size, int timestamp)
611 611
 {
612 612
     ASFContext *asf = s->priv_data;
613 613
     ASFStream *stream;
614
-    INT64 duration;
614
+    int64_t duration;
615 615
     AVCodecContext *codec;
616 616
 
617 617
     codec = &s->streams[stream_index]->codec;
618 618
     stream = &asf->streams[stream_index];
619 619
 
620 620
     if (codec->codec_type == CODEC_TYPE_AUDIO) {
621
-        duration = (codec->frame_number * codec->frame_size * INT64_C(10000000)) /
621
+        duration = (codec->frame_number * codec->frame_size * int64_t_C(10000000)) /
622 622
             codec->sample_rate;
623 623
     } else {
624 624
         duration = codec->frame_number *
625
-            ((INT64_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);
625
+            ((int64_t_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);
626 626
     }
627 627
     if (duration > asf->duration)
628 628
         asf->duration = duration;
... ...
@@ -634,7 +634,7 @@ static int asf_write_packet(AVFormatContext *s, int stream_index,
634 634
 static int asf_write_trailer(AVFormatContext *s)
635 635
 {
636 636
     ASFContext *asf = s->priv_data;
637
-    INT64 file_size;
637
+    int64_t file_size;
638 638
 
639 639
     /* flush the current packet */
640 640
     if (asf->pb.buf_ptr > asf->pb.buffer)
... ...
@@ -746,7 +746,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
746 746
     AVStream *st;
747 747
     ASFStream *asf_st;
748 748
     int size, i;
749
-    INT64 gsize;
749
+    int64_t gsize;
750 750
 
751 751
     av_set_pts_info(s, 32, 1, 1000); /* 32 bit pts in ms */
752 752
 
... ...
@@ -786,7 +786,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
786 786
         } else if (!memcmp(&g, &stream_header, sizeof(GUID))) {
787 787
             int type, total_size;
788 788
             unsigned int tag1;
789
-            INT64 pos1, pos2;
789
+            int64_t pos1, pos2;
790 790
 
791 791
             pos1 = url_ftell(pb);
792 792
 
... ...
@@ -29,7 +29,7 @@
29 29
 #include "avi.h"
30 30
 
31 31
 /* if we don't know the size in advance */
32
-#define AU_UNKOWN_SIZE ((UINT32)(~0))
32
+#define AU_UNKOWN_SIZE ((uint32_t)(~0))
33 33
 
34 34
 /* The ffmpeg codecs we support, and the IDs they have in the file */
35 35
 static const CodecTag codec_au_tags[] = {
... ...
@@ -50,9 +50,9 @@ static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
50 50
     put_tag(pb, ".snd");       /* magic number */
51 51
     put_be32(pb, 24);           /* header size */
52 52
     put_be32(pb, AU_UNKOWN_SIZE); /* data size */
53
-    put_be32(pb, (UINT32)tag);     /* codec ID */
53
+    put_be32(pb, (uint32_t)tag);     /* codec ID */
54 54
     put_be32(pb, enc->sample_rate);
55
-    put_be32(pb, (UINT32)enc->channels);
55
+    put_be32(pb, (uint32_t)enc->channels);
56 56
     return 0;
57 57
 }
58 58
 
... ...
@@ -73,7 +73,7 @@ static int au_write_header(AVFormatContext *s)
73 73
 }
74 74
 
75 75
 static int au_write_packet(AVFormatContext *s, int stream_index_ptr,
76
-                           UINT8 *buf, int size, int force_pts)
76
+                           uint8_t *buf, int size, int force_pts)
77 77
 {
78 78
     ByteIOContext *pb = &s->pb;
79 79
     put_buffer(pb, buf, size);
... ...
@@ -90,7 +90,7 @@ static int au_write_trailer(AVFormatContext *s)
90 90
         /* update file size */
91 91
         file_size = url_ftell(pb);
92 92
         url_fseek(pb, 8, SEEK_SET);
93
-        put_be32(pb, (UINT32)(file_size - 24));
93
+        put_be32(pb, (uint32_t)(file_size - 24));
94 94
         url_fseek(pb, file_size, SEEK_SET);
95 95
 
96 96
         put_flush_packet(pb);
... ...
@@ -37,7 +37,7 @@ typedef struct {
37 37
     int frame_size; /* in bytes ! */
38 38
     int codec_id;
39 39
     int flip_left : 1;
40
-    UINT8 buffer[AUDIO_BLOCK_SIZE];
40
+    uint8_t buffer[AUDIO_BLOCK_SIZE];
41 41
     int buffer_ptr;
42 42
 } AudioData;
43 43
 
... ...
@@ -165,7 +165,7 @@ static int audio_write_header(AVFormatContext *s1)
165 165
 }
166 166
 
167 167
 static int audio_write_packet(AVFormatContext *s1, int stream_index,
168
-                              UINT8 *buf, int size, int force_pts)
168
+                              uint8_t *buf, int size, int force_pts)
169 169
 {
170 170
     AudioData *s = s1->priv_data;
171 171
     int len, ret;
... ...
@@ -18,8 +18,8 @@ extern "C" {
18 18
 #define AV_NOPTS_VALUE 0
19 19
 
20 20
 typedef struct AVPacket {
21
-    INT64 pts; /* presentation time stamp in stream units (set av_set_pts_info) */
22
-    UINT8 *data;
21
+    int64_t pts; /* presentation time stamp in stream units (set av_set_pts_info) */
22
+    uint8_t *data;
23 23
     int   size;
24 24
     int   stream_index;
25 25
     int   flags;
... ...
@@ -54,12 +54,12 @@ static inline void av_free_packet(AVPacket *pkt)
54 54
 /* the exact value of the fractional number is: 'val + num / den'. num
55 55
    is assumed to be such as 0 <= num < den */
56 56
 typedef struct AVFrac {
57
-    INT64 val, num, den; 
57
+    int64_t val, num, den; 
58 58
 } AVFrac;
59 59
 
60
-void av_frac_init(AVFrac *f, INT64 val, INT64 num, INT64 den);
61
-void av_frac_add(AVFrac *f, INT64 incr);
62
-void av_frac_set(AVFrac *f, INT64 val);
60
+void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den);
61
+void av_frac_add(AVFrac *f, int64_t incr);
62
+void av_frac_set(AVFrac *f, int64_t val);
63 63
 
64 64
 /*************************************************/
65 65
 /* input/output formats */
... ...
@@ -141,7 +141,7 @@ typedef struct AVInputFormat {
141 141
     int (*read_close)(struct AVFormatContext *);
142 142
     /* seek at or before a given pts (given in microsecond). The pts
143 143
        origin is defined by the stream */
144
-    int (*read_seek)(struct AVFormatContext *, INT64 pts);
144
+    int (*read_seek)(struct AVFormatContext *, int64_t pts);
145 145
     /* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_NOHEADER */
146 146
     int flags;
147 147
     /* if extensions are defined, then no probe is done. You should
... ...
@@ -337,20 +337,20 @@ AVOutputFormat *guess_stream_format(const char *short_name,
337 337
 AVOutputFormat *guess_format(const char *short_name, 
338 338
                              const char *filename, const char *mime_type);
339 339
 
340
-void av_hex_dump(UINT8 *buf, int size);
340
+void av_hex_dump(uint8_t *buf, int size);
341 341
 
342 342
 void av_register_all(void);
343 343
 
344 344
 typedef struct FifoBuffer {
345
-    UINT8 *buffer;
346
-    UINT8 *rptr, *wptr, *end;
345
+    uint8_t *buffer;
346
+    uint8_t *rptr, *wptr, *end;
347 347
 } FifoBuffer;
348 348
 
349 349
 int fifo_init(FifoBuffer *f, int size);
350 350
 void fifo_free(FifoBuffer *f);
351
-int fifo_size(FifoBuffer *f, UINT8 *rptr);
352
-int fifo_read(FifoBuffer *f, UINT8 *buf, int buf_size, UINT8 **rptr_ptr);
353
-void fifo_write(FifoBuffer *f, UINT8 *buf, int size, UINT8 **wptr_ptr);
351
+int fifo_size(FifoBuffer *f, uint8_t *rptr);
352
+int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr);
353
+void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr);
354 354
 
355 355
 /* media file input */
356 356
 AVInputFormat *av_find_input_format(const char *short_name);
... ...
@@ -386,9 +386,9 @@ void dump_format(AVFormatContext *ic,
386 386
                  const char *url,
387 387
                  int is_output);
388 388
 int parse_image_size(int *width_ptr, int *height_ptr, const char *str);
389
-INT64 parse_date(const char *datestr, int duration);
389
+int64_t parse_date(const char *datestr, int duration);
390 390
 
391
-INT64 av_gettime(void);
391
+int64_t av_gettime(void);
392 392
 
393 393
 /* ffm specific for ffserver */
394 394
 #define FFM_PACKET_SIZE 4096
... ...
@@ -28,7 +28,7 @@ typedef struct AVIIndex {
28 28
 } AVIIndex;
29 29
 
30 30
 typedef struct {
31
-    INT64 movi_end;
31
+    int64_t movi_end;
32 32
     offset_t movi_list;
33 33
     AVIIndex *first, *last;
34 34
 } AVIContext;
... ...
@@ -49,7 +49,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
49 49
 {
50 50
     AVIContext *avi = s->priv_data;
51 51
     ByteIOContext *pb = &s->pb;
52
-    UINT32 tag, tag1;
52
+    uint32_t tag, tag1;
53 53
     int codec_type, stream_index, frame_period, bit_rate;
54 54
     unsigned int size;
55 55
     int i;
... ...
@@ -144,7 +144,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
144 144
                     st->codec.width = get_le32(pb);
145 145
                     st->codec.height = get_le32(pb);
146 146
                     if (frame_period)
147
-                        st->codec.frame_rate = (INT64_C(1000000) * FRAME_RATE_BASE) / frame_period;
147
+                        st->codec.frame_rate = (int64_t_C(1000000) * FRAME_RATE_BASE) / frame_period;
148 148
                     else
149 149
                         st->codec.frame_rate = 25 * FRAME_RATE_BASE;
150 150
                     get_le16(pb); /* panes */
... ...
@@ -49,7 +49,7 @@ void end_tag(ByteIOContext *pb, offset_t start)
49 49
 
50 50
     pos = url_ftell(pb);
51 51
     url_fseek(pb, start - 4, SEEK_SET);
52
-    put_le32(pb, (UINT32)(pos - start));
52
+    put_le32(pb, (uint32_t)(pos - start));
53 53
     url_fseek(pb, pos, SEEK_SET);
54 54
 }
55 55
 
... ...
@@ -211,7 +211,7 @@ static int avi_write_header(AVFormatContext *s)
211 211
     nb_frames = 0;
212 212
 
213 213
     if(video_enc){
214
-    put_le32(pb, (UINT32)(INT64_C(1000000) * FRAME_RATE_BASE / video_enc->frame_rate));
214
+    put_le32(pb, (uint32_t)(int64_t_C(1000000) * FRAME_RATE_BASE / video_enc->frame_rate));
215 215
     } else {
216 216
 	put_le32(pb, 0);
217 217
     }
... ...
@@ -320,7 +320,7 @@ static int avi_write_header(AVFormatContext *s)
320 320
 }
321 321
 
322 322
 static int avi_write_packet(AVFormatContext *s, int stream_index,
323
-                            UINT8 *buf, int size, int force_pts)
323
+                            uint8_t *buf, int size, int force_pts)
324 324
 {
325 325
     AVIContext *avi = s->priv_data;
326 326
     ByteIOContext *pb = &s->pb;
... ...
@@ -395,7 +395,7 @@ static int avi_write_trailer(AVFormatContext *s)
395 395
         /* update file size */
396 396
         file_size = url_ftell(pb);
397 397
         url_fseek(pb, 4, SEEK_SET);
398
-        put_le32(pb, (UINT32)(file_size - 8));
398
+        put_le32(pb, (uint32_t)(file_size - 8));
399 399
 
400 400
         /* Fill in frame/sample counters */
401 401
         nb_frames = 0;
... ...
@@ -3,7 +3,7 @@
3 3
 
4 4
 /* output byte stream handling */
5 5
 
6
-typedef INT64 offset_t;
6
+typedef int64_t offset_t;
7 7
 
8 8
 /* unbuffered I/O */
9 9
 
... ...
@@ -60,8 +60,8 @@ typedef struct {
60 60
     int buffer_size;
61 61
     unsigned char *buf_ptr, *buf_end;
62 62
     void *opaque;
63
-    int (*read_packet)(void *opaque, UINT8 *buf, int buf_size);
64
-    void (*write_packet)(void *opaque, UINT8 *buf, int buf_size);
63
+    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
64
+    void (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
65 65
     int (*seek)(void *opaque, offset_t offset, int whence);
66 66
     offset_t pos; /* position in the file of the current buffer */
67 67
     int must_flush; /* true if the next seek should flush */
... ...
@@ -76,14 +76,14 @@ int init_put_byte(ByteIOContext *s,
76 76
                   int buffer_size,
77 77
                   int write_flag,
78 78
                   void *opaque,
79
-                  int (*read_packet)(void *opaque, UINT8 *buf, int buf_size),
80
-                  void (*write_packet)(void *opaque, UINT8 *buf, int buf_size),
79
+                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
80
+                  void (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
81 81
                   int (*seek)(void *opaque, offset_t offset, int whence));
82 82
 
83 83
 void put_byte(ByteIOContext *s, int b);
84 84
 void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
85
-void put_le64(ByteIOContext *s, UINT64 val);
86
-void put_be64(ByteIOContext *s, UINT64 val);
85
+void put_le64(ByteIOContext *s, uint64_t val);
86
+void put_be64(ByteIOContext *s, uint64_t val);
87 87
 void put_le32(ByteIOContext *s, unsigned int val);
88 88
 void put_be32(ByteIOContext *s, unsigned int val);
89 89
 void put_le16(ByteIOContext *s, unsigned int val);
... ...
@@ -108,14 +108,14 @@ void put_flush_packet(ByteIOContext *s);
108 108
 int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
109 109
 int get_byte(ByteIOContext *s);
110 110
 unsigned int get_le32(ByteIOContext *s);
111
-UINT64 get_le64(ByteIOContext *s);
111
+uint64_t get_le64(ByteIOContext *s);
112 112
 unsigned int get_le16(ByteIOContext *s);
113 113
 
114 114
 double get_be64_double(ByteIOContext *s);
115 115
 char *get_strz(ByteIOContext *s, char *buf, int maxlen);
116 116
 unsigned int get_be16(ByteIOContext *s);
117 117
 unsigned int get_be32(ByteIOContext *s);
118
-UINT64 get_be64(ByteIOContext *s);
118
+uint64_t get_be64(ByteIOContext *s);
119 119
 
120 120
 static inline int url_is_streamed(ByteIOContext *s)
121 121
 {
... ...
@@ -129,12 +129,12 @@ int url_fclose(ByteIOContext *s);
129 129
 URLContext *url_fileno(ByteIOContext *s);
130 130
 int url_fget_max_packet_size(ByteIOContext *s);
131 131
 
132
-int url_open_buf(ByteIOContext *s, UINT8 *buf, int buf_size, int flags);
132
+int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags);
133 133
 int url_close_buf(ByteIOContext *s);
134 134
 
135 135
 int url_open_dyn_buf(ByteIOContext *s);
136 136
 int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size);
137
-int url_close_dyn_buf(ByteIOContext *s, UINT8 **pbuffer);
137
+int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
138 138
 
139 139
 /* file.c */
140 140
 extern URLProtocol file_protocol;
... ...
@@ -27,8 +27,8 @@ int init_put_byte(ByteIOContext *s,
27 27
                   int buffer_size,
28 28
                   int write_flag,
29 29
                   void *opaque,
30
-                  int (*read_packet)(void *opaque, UINT8 *buf, int buf_size),
31
-                  void (*write_packet)(void *opaque, UINT8 *buf, int buf_size),
30
+                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
31
+                  void (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
32 32
                   int (*seek)(void *opaque, offset_t offset, int whence))
33 33
 {
34 34
     s->buffer = buffer;
... ...
@@ -182,7 +182,7 @@ void put_be64_double(ByteIOContext *s, double val)
182 182
 {
183 183
     union {
184 184
         double d;
185
-        UINT64 ull;
185
+        uint64_t ull;
186 186
     } u;
187 187
     u.d = val;
188 188
     put_be64(s, u.ull);
... ...
@@ -196,16 +196,16 @@ void put_strz(ByteIOContext *s, const char *str)
196 196
         put_byte(s, 0);
197 197
 }
198 198
 
199
-void put_le64(ByteIOContext *s, UINT64 val)
199
+void put_le64(ByteIOContext *s, uint64_t val)
200 200
 {
201
-    put_le32(s, (UINT32)(val & 0xffffffff));
202
-    put_le32(s, (UINT32)(val >> 32));
201
+    put_le32(s, (uint32_t)(val & 0xffffffff));
202
+    put_le32(s, (uint32_t)(val >> 32));
203 203
 }
204 204
 
205
-void put_be64(ByteIOContext *s, UINT64 val)
205
+void put_be64(ByteIOContext *s, uint64_t val)
206 206
 {
207
-    put_be32(s, (UINT32)(val >> 32));
208
-    put_be32(s, (UINT32)(val & 0xffffffff));
207
+    put_be32(s, (uint32_t)(val >> 32));
208
+    put_be32(s, (uint32_t)(val & 0xffffffff));
209 209
 }
210 210
 
211 211
 void put_le16(ByteIOContext *s, unsigned int val)
... ...
@@ -320,11 +320,11 @@ unsigned int get_le32(ByteIOContext *s)
320 320
     return val;
321 321
 }
322 322
 
323
-UINT64 get_le64(ByteIOContext *s)
323
+uint64_t get_le64(ByteIOContext *s)
324 324
 {
325
-    UINT64 val;
326
-    val = (UINT64)get_le32(s);
327
-    val |= (UINT64)get_le32(s) << 32;
325
+    uint64_t val;
326
+    val = (uint64_t)get_le32(s);
327
+    val |= (uint64_t)get_le32(s) << 32;
328 328
     return val;
329 329
 }
330 330
 
... ...
@@ -350,7 +350,7 @@ double get_be64_double(ByteIOContext *s)
350 350
 {
351 351
     union {
352 352
         double d;
353
-        UINT64 ull;
353
+        uint64_t ull;
354 354
     } u;
355 355
 
356 356
     u.ull = get_be64(s);
... ...
@@ -372,29 +372,29 @@ char *get_strz(ByteIOContext *s, char *buf, int maxlen)
372 372
     return buf;
373 373
 }
374 374
 
375
-UINT64 get_be64(ByteIOContext *s)
375
+uint64_t get_be64(ByteIOContext *s)
376 376
 {
377
-    UINT64 val;
378
-    val = (UINT64)get_be32(s) << 32;
379
-    val |= (UINT64)get_be32(s);
377
+    uint64_t val;
378
+    val = (uint64_t)get_be32(s) << 32;
379
+    val |= (uint64_t)get_be32(s);
380 380
     return val;
381 381
 }
382 382
 
383 383
 /* link with avio functions */
384 384
 
385
-static void url_write_packet(void *opaque, UINT8 *buf, int buf_size)
385
+static void url_write_packet(void *opaque, uint8_t *buf, int buf_size)
386 386
 {
387 387
     URLContext *h = opaque;
388 388
     url_write(h, buf, buf_size);
389 389
 }
390 390
 
391
-static int url_read_packet(void *opaque, UINT8 *buf, int buf_size)
391
+static int url_read_packet(void *opaque, uint8_t *buf, int buf_size)
392 392
 {
393 393
     URLContext *h = opaque;
394 394
     return url_read(h, buf, buf_size);
395 395
 }
396 396
 
397
-static int url_seek_packet(void *opaque, INT64 offset, int whence)
397
+static int url_seek_packet(void *opaque, int64_t offset, int whence)
398 398
 {
399 399
     URLContext *h = opaque;
400 400
     url_seek(h, offset, whence);
... ...
@@ -403,7 +403,7 @@ static int url_seek_packet(void *opaque, INT64 offset, int whence)
403 403
 
404 404
 int url_fdopen(ByteIOContext *s, URLContext *h)
405 405
 {
406
-    UINT8 *buffer;
406
+    uint8_t *buffer;
407 407
     int buffer_size, max_packet_size;
408 408
 
409 409
     
... ...
@@ -431,7 +431,7 @@ int url_fdopen(ByteIOContext *s, URLContext *h)
431 431
 /* XXX: must be called before any I/O */
432 432
 int url_setbufsize(ByteIOContext *s, int buf_size)
433 433
 {
434
-    UINT8 *buffer;
434
+    uint8_t *buffer;
435 435
     buffer = av_malloc(buf_size);
436 436
     if (!buffer)
437 437
         return -ENOMEM;
... ...
@@ -530,7 +530,7 @@ int url_fget_max_packet_size(ByteIOContext *s)
530 530
 }
531 531
 
532 532
 /* buffer handling */
533
-int url_open_buf(ByteIOContext *s, UINT8 *buf, int buf_size, int flags)
533
+int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags)
534 534
 {
535 535
     return init_put_byte(s, buf, buf_size, 
536 536
                          (flags & URL_WRONLY) != 0, NULL, NULL, NULL, NULL);
... ...
@@ -547,16 +547,16 @@ int url_close_buf(ByteIOContext *s)
547 547
 
548 548
 typedef struct DynBuffer {
549 549
     int pos, size, allocated_size;
550
-    UINT8 *buffer;
550
+    uint8_t *buffer;
551 551
     int io_buffer_size;
552
-    UINT8 io_buffer[1];
552
+    uint8_t io_buffer[1];
553 553
 } DynBuffer;
554 554
 
555
-static void dyn_buf_write(void *opaque, UINT8 *buf, int buf_size)
555
+static void dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
556 556
 {
557 557
     DynBuffer *d = opaque;
558 558
     int new_size, new_allocated_size;
559
-    UINT8 *new_buffer;
559
+    uint8_t *new_buffer;
560 560
     
561 561
     /* reallocate buffer if needed */
562 562
     new_size = d->pos + buf_size;
... ...
@@ -583,7 +583,7 @@ static void dyn_buf_write(void *opaque, UINT8 *buf, int buf_size)
583 583
         d->size = d->pos;
584 584
 }
585 585
 
586
-static void dyn_packet_buf_write(void *opaque, UINT8 *buf, int buf_size)
586
+static void dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
587 587
 {
588 588
     unsigned char buf1[4];
589 589
 
... ...
@@ -674,7 +674,7 @@ int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size)
674 674
  * @param pointer to a byte buffer
675 675
  * @return the length of the byte buffer
676 676
  */
677
-int url_close_dyn_buf(ByteIOContext *s, UINT8 **pbuffer)
677
+int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer)
678 678
 {
679 679
     DynBuffer *d = s->opaque;
680 680
     int size;
... ...
@@ -33,7 +33,7 @@
33 33
 #define DO8(buf)  DO4(buf); DO4(buf);
34 34
 #define DO16(buf) DO8(buf); DO8(buf);
35 35
 
36
-static UINT32 adler32(UINT32 adler, UINT8 *buf, unsigned int len)
36
+static uint32_t adler32(uint32_t adler, uint8_t *buf, unsigned int len)
37 37
 {
38 38
     unsigned long s1 = adler & 0xffff;
39 39
     unsigned long s2 = (adler >> 16) & 0xffff;
... ...
@@ -58,7 +58,7 @@ static UINT32 adler32(UINT32 adler, UINT8 *buf, unsigned int len)
58 58
 }
59 59
 
60 60
 typedef struct CRCState {
61
-    UINT32 crcval;
61
+    uint32_t crcval;
62 62
 } CRCState;
63 63
 
64 64
 static int crc_write_header(struct AVFormatContext *s)
... ...
@@ -46,7 +46,7 @@ struct dv1394_data {
46 46
     int done;   /* Number of completed frames */
47 47
 
48 48
     int stream; /* Current stream. 0 - video, 1 - audio */
49
-    INT64 pts;  /* Current timestamp */
49
+    int64_t pts;  /* Current timestamp */
50 50
 };
51 51
 
52 52
 static int dv1394_reset(struct dv1394_data *dv)
... ...
@@ -28,7 +28,7 @@
28 28
 #define FLAG_KEY_FRAME       0x01
29 29
 
30 30
 typedef struct FFMStream {
31
-    INT64 pts;
31
+    int64_t pts;
32 32
 } FFMStream;
33 33
 
34 34
 enum {
... ...
@@ -40,15 +40,15 @@ typedef struct FFMContext {
40 40
     /* only reading mode */
41 41
     offset_t write_index, file_size;
42 42
     int read_state;
43
-    UINT8 header[FRAME_HEADER_SIZE];
43
+    uint8_t header[FRAME_HEADER_SIZE];
44 44
 
45 45
     /* read and write */
46 46
     int first_packet; /* true if first packet, needed to set the discontinuity tag */
47 47
     int packet_size;
48 48
     int frame_offset;
49
-    INT64 pts;
50
-    UINT8 *packet_ptr, *packet_end;
51
-    UINT8 packet[FFM_PACKET_SIZE];
49
+    int64_t pts;
50
+    uint8_t *packet_ptr, *packet_end;
51
+    uint8_t packet[FFM_PACKET_SIZE];
52 52
 } FFMContext;
53 53
 
54 54
 /* disable pts hack for testing */
... ...
@@ -82,8 +82,8 @@ static void flush_packet(AVFormatContext *s)
82 82
 
83 83
 /* 'first' is true if first data of a frame */
84 84
 static void ffm_write_data(AVFormatContext *s,
85
-                           UINT8 *buf, int size,
86
-                           INT64 pts, int first)
85
+                           uint8_t *buf, int size,
86
+                           int64_t pts, int first)
87 87
 {
88 88
     FFMContext *ffm = s->priv_data;
89 89
     int len;
... ...
@@ -214,12 +214,12 @@ static int ffm_write_header(AVFormatContext *s)
214 214
 }
215 215
 
216 216
 static int ffm_write_packet(AVFormatContext *s, int stream_index,
217
-                            UINT8 *buf, int size, int force_pts)
217
+                            uint8_t *buf, int size, int force_pts)
218 218
 {
219 219
     AVStream *st = s->streams[stream_index];
220 220
     FFMStream *fst = st->priv_data;
221
-    INT64 pts;
222
-    UINT8 header[FRAME_HEADER_SIZE];
221
+    int64_t pts;
222
+    uint8_t header[FRAME_HEADER_SIZE];
223 223
     int duration;
224 224
 
225 225
     if (st->codec.codec_type == CODEC_TYPE_AUDIO) {
... ...
@@ -260,7 +260,7 @@ static int ffm_write_trailer(AVFormatContext *s)
260 260
     put_flush_packet(pb);
261 261
 
262 262
     if (!url_is_streamed(pb)) {
263
-        INT64 size;
263
+        int64_t size;
264 264
         /* update the write offset */
265 265
         size = url_ftell(pb);
266 266
         url_fseek(pb, 8, SEEK_SET);
... ...
@@ -305,7 +305,7 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
305 305
 
306 306
 /* first is true if we read the frame header */
307 307
 static int ffm_read_data(AVFormatContext *s,
308
-                         UINT8 *buf, int size, int first)
308
+                         uint8_t *buf, int size, int first)
309 309
 {
310 310
     FFMContext *ffm = s->priv_data;
311 311
     ByteIOContext *pb = &s->pb;
... ...
@@ -368,7 +368,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
368 368
     ByteIOContext *pb = &s->pb;
369 369
     AVCodecContext *codec;
370 370
     int i;
371
-    UINT32 tag;
371
+    uint32_t tag;
372 372
 
373 373
     /* header */
374 374
     tag = get_le32(pb);
... ...
@@ -382,7 +382,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
382 382
     if (!url_is_streamed(pb)) {
383 383
         ffm->file_size = url_filesize(url_fileno(pb));
384 384
     } else {
385
-        ffm->file_size = (UINT64_C(1) << 63) - 1;
385
+        ffm->file_size = (uint64_t_C(1) << 63) - 1;
386 386
     }
387 387
 
388 388
     s->nb_streams = get_be32(pb);
... ...
@@ -411,7 +411,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
411 411
         /* specific info */
412 412
         switch(codec->codec_type) {
413 413
         case CODEC_TYPE_VIDEO:
414
-            codec->frame_rate = ((INT64)get_be32(pb) * FRAME_RATE_BASE) / 1000;
414
+            codec->frame_rate = ((int64_t)get_be32(pb) * FRAME_RATE_BASE) / 1000;
415 415
             codec->width = get_be16(pb);
416 416
             codec->height = get_be16(pb);
417 417
             codec->gop_size = get_be16(pb);
... ...
@@ -539,10 +539,10 @@ static void ffm_seek1(AVFormatContext *s, offset_t pos1)
539 539
     url_fseek(pb, pos, SEEK_SET);
540 540
 }
541 541
 
542
-static INT64 get_pts(AVFormatContext *s, offset_t pos)
542
+static int64_t get_pts(AVFormatContext *s, offset_t pos)
543 543
 {
544 544
     ByteIOContext *pb = &s->pb;
545
-    INT64 pts;
545
+    int64_t pts;
546 546
 
547 547
     ffm_seek1(s, pos);
548 548
     url_fskip(pb, 4);
... ...
@@ -556,11 +556,11 @@ static INT64 get_pts(AVFormatContext *s, offset_t pos)
556 556
 /* seek to a given time in the file. The file read pointer is
557 557
    positionned at or before pts. XXX: the following code is quite
558 558
    approximative */
559
-static int ffm_seek(AVFormatContext *s, INT64 wanted_pts)
559
+static int ffm_seek(AVFormatContext *s, int64_t wanted_pts)
560 560
 {
561 561
     FFMContext *ffm = s->priv_data;
562 562
     offset_t pos_min, pos_max, pos;
563
-    INT64 pts_min, pts_max, pts;
563
+    int64_t pts_min, pts_max, pts;
564 564
     double pos1;
565 565
 
566 566
 #ifdef DEBUG_SEEK
... ...
@@ -576,7 +576,7 @@ static int ffm_seek(AVFormatContext *s, INT64 wanted_pts)
576 576
         /* linear interpolation */
577 577
         pos1 = (double)(pos_max - pos_min) * (double)(wanted_pts - pts_min) /
578 578
             (double)(pts_max - pts_min);
579
-        pos = (((INT64)pos1) / FFM_PACKET_SIZE) * FFM_PACKET_SIZE;
579
+        pos = (((int64_t)pos1) / FFM_PACKET_SIZE) * FFM_PACKET_SIZE;
580 580
         if (pos <= pos_min)
581 581
             pos = pos_min;
582 582
         else if (pos >= pos_max)
... ...
@@ -601,7 +601,7 @@ static int ffm_seek(AVFormatContext *s, INT64 wanted_pts)
601 601
 
602 602
 offset_t ffm_read_write_index(int fd)
603 603
 {
604
-    UINT8 buf[8];
604
+    uint8_t buf[8];
605 605
     offset_t pos;
606 606
     int i;
607 607
 
... ...
@@ -615,7 +615,7 @@ offset_t ffm_read_write_index(int fd)
615 615
 
616 616
 void ffm_write_write_index(int fd, offset_t pos)
617 617
 {
618
-    UINT8 buf[8];
618
+    uint8_t buf[8];
619 619
     int i;
620 620
 
621 621
     for(i=0;i<8;i++)
... ...
@@ -95,7 +95,7 @@ void frame_hook_process(AVPicture *pict, enum PixelFormat pix_fmt, int width, in
95 95
 {
96 96
     if (first_hook) {
97 97
         FrameHookEntry *fhe;
98
-        INT64 pts = av_gettime();
98
+        int64_t pts = av_gettime();
99 99
 
100 100
         for (fhe = first_hook; fhe; fhe = fhe->next) {
101 101
             fhe->Process(fhe->ctx, pict, pix_fmt, width, height, pts);
... ...
@@ -13,7 +13,7 @@ typedef FrameHookConfigure *FrameHookConfigureFn;
13 13
 extern FrameHookConfigure Configure;
14 14
 
15 15
 /* Function must be called 'Process' */
16
-typedef void (FrameHookProcess)(void *ctx, struct AVPicture *pict, enum PixelFormat pix_fmt, int width, int height, INT64 pts);
16
+typedef void (FrameHookProcess)(void *ctx, struct AVPicture *pict, enum PixelFormat pix_fmt, int width, int height, int64_t pts);
17 17
 typedef FrameHookProcess *FrameHookProcessFn;
18 18
 extern FrameHookProcess Process;
19 19
 
... ...
@@ -212,7 +212,7 @@ static int gif_image_write_header(ByteIOContext *pb,
212 212
 }
213 213
 
214 214
 /* this is maybe slow, but allows for extensions */
215
-static inline unsigned char gif_clut_index(UINT8 r, UINT8 g, UINT8 b)
215
+static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
216 216
 {
217 217
     return ((((r)/47)%6)*6*6+(((g)/47)%6)*6+(((b)/47)%6));
218 218
 }
... ...
@@ -223,7 +223,7 @@ static int gif_image_write_image(ByteIOContext *pb,
223 223
                                  uint8_t *buf, int linesize, int pix_fmt)
224 224
 {
225 225
     PutBitContext p;
226
-    UINT8 buffer[200]; /* 100 * 9 / 8 = 113 */
226
+    uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */
227 227
     int i, left, w, v;
228 228
     uint8_t *ptr;
229 229
     /* image block */
... ...
@@ -287,8 +287,8 @@ static int gif_image_write_image(ByteIOContext *pb,
287 287
 }
288 288
 
289 289
 typedef struct {
290
-    INT64 time, file_time;
291
-    UINT8 buffer[100]; /* data chunks */
290
+    int64_t time, file_time;
291
+    uint8_t buffer[100]; /* data chunks */
292 292
 } GIFContext;
293 293
 
294 294
 static int gif_write_header(AVFormatContext *s)
... ...
@@ -331,12 +331,12 @@ static int gif_write_header(AVFormatContext *s)
331 331
 }
332 332
 
333 333
 static int gif_write_video(AVFormatContext *s, 
334
-                           AVCodecContext *enc, UINT8 *buf, int size)
334
+                           AVCodecContext *enc, uint8_t *buf, int size)
335 335
 {
336 336
     ByteIOContext *pb = &s->pb;
337 337
     GIFContext *gif = s->priv_data;
338 338
     int jiffies;
339
-    INT64 delay;
339
+    int64_t delay;
340 340
 
341 341
     /* graphic control extension block */
342 342
     put_byte(pb, 0x21);
... ...
@@ -366,7 +366,7 @@ static int gif_write_video(AVFormatContext *s,
366 366
 }
367 367
 
368 368
 static int gif_write_packet(AVFormatContext *s, int stream_index, 
369
-                           UINT8 *buf, int size, int force_pts)
369
+                           uint8_t *buf, int size, int force_pts)
370 370
 {
371 371
     AVCodecContext *codec = &s->streams[stream_index]->codec;
372 372
     if (codec->codec_type == CODEC_TYPE_AUDIO)
... ...
@@ -31,11 +31,11 @@ typedef struct {
31 31
     int use_mmap;
32 32
     int width, height;
33 33
     int frame_rate;
34
-    INT64 time_frame;
34
+    int64_t time_frame;
35 35
     int frame_size;
36 36
     struct video_capability video_cap;
37 37
     struct video_audio audio_saved;
38
-    UINT8 *video_buf;
38
+    uint8_t *video_buf;
39 39
     struct video_mbuf gb_buffers;
40 40
     struct video_mmap gb_buf;
41 41
     int gb_frame;
... ...
@@ -45,8 +45,8 @@ typedef struct {
45 45
     int aiw_enabled;
46 46
     int deint;
47 47
     int halfw;
48
-    UINT8 *src_mem;
49
-    UINT8 *lum_m4_mem;
48
+    uint8_t *src_mem;
49
+    uint8_t *lum_m4_mem;
50 50
 } VideoData;
51 51
 
52 52
 static int aiw_init(VideoData *s);
... ...
@@ -252,9 +252,9 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
252 252
     return -EIO;
253 253
 }
254 254
 
255
-static int v4l_mm_read_picture(VideoData *s, UINT8 *buf)
255
+static int v4l_mm_read_picture(VideoData *s, uint8_t *buf)
256 256
 {
257
-    UINT8 *ptr;
257
+    uint8_t *ptr;
258 258
 
259 259
     /* Setup to capture the next frame */
260 260
     s->gb_buf.frame = (s->gb_frame + 1) % s->gb_buffers.frames;
... ...
@@ -281,9 +281,9 @@ static int v4l_mm_read_picture(VideoData *s, UINT8 *buf)
281 281
 static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
282 282
 {
283 283
     VideoData *s = s1->priv_data;
284
-    INT64 curtime, delay;
284
+    int64_t curtime, delay;
285 285
     struct timespec ts;
286
-    INT64 per_frame = (INT64_C(1000000) * FRAME_RATE_BASE) / s->frame_rate;
286
+    int64_t per_frame = (int64_t_C(1000000) * FRAME_RATE_BASE) / s->frame_rate;
287 287
 
288 288
     /* Calculate the time of the next frame */
289 289
     s->time_frame += per_frame;
... ...
@@ -617,13 +617,13 @@ static int aiw_init(VideoData *s)
617 617
 /* Read two fields separately. */
618 618
 static int aiw_read_picture(VideoData *s, uint8_t *data)
619 619
 {
620
-    UINT8 *ptr, *lum, *cb, *cr;
620
+    uint8_t *ptr, *lum, *cb, *cr;
621 621
     int h;
622 622
 #ifndef HAVE_MMX
623 623
     int sum;
624 624
 #endif
625
-    UINT8* src = s->src_mem;
626
-    UINT8 *ptrend = &src[s->width*2];
625
+    uint8_t* src = s->src_mem;
626
+    uint8_t *ptrend = &src[s->width*2];
627 627
     lum=data;
628 628
     cb=&lum[s->width*s->height];
629 629
     cr=&cb[(s->width*s->height)/4];
... ...
@@ -715,7 +715,7 @@ static int aiw_read_picture(VideoData *s, uint8_t *data)
715 715
             read(s->fd,src,s->width*4);
716 716
         }
717 717
     } else {
718
-        UINT8 *lum_m1, *lum_m2, *lum_m3, *lum_m4;
718
+        uint8_t *lum_m1, *lum_m2, *lum_m3, *lum_m4;
719 719
 #ifdef HAVE_MMX
720 720
         mmx_t rounder;
721 721
         rounder.uw[0]=4;
... ...
@@ -725,7 +725,7 @@ static int aiw_read_picture(VideoData *s, uint8_t *data)
725 725
         movq_m2r(rounder,mm6);
726 726
         pxor_r2r(mm7,mm7);
727 727
 #else
728
-        UINT8 *cm = cropTbl + MAX_NEG_CROP;
728
+        uint8_t *cm = cropTbl + MAX_NEG_CROP;
729 729
 #endif
730 730
 
731 731
         /* read two fields and deinterlace them */
... ...
@@ -48,7 +48,7 @@ typedef struct {
48 48
 } HTTPContext;
49 49
 
50 50
 static int http_connect(URLContext *h, const char *path, const char *hoststr);
51
-static int http_write(URLContext *h, UINT8 *buf, int size);
51
+static int http_write(URLContext *h, uint8_t *buf, int size);
52 52
 
53 53
 
54 54
 /* return non zero if error */
... ...
@@ -236,7 +236,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr)
236 236
 }
237 237
 
238 238
 
239
-static int http_read(URLContext *h, UINT8 *buf, int size)
239
+static int http_read(URLContext *h, uint8_t *buf, int size)
240 240
 {
241 241
     HTTPContext *s = h->priv_data;
242 242
     int size1, len;
... ...
@@ -265,7 +265,7 @@ static int http_read(URLContext *h, UINT8 *buf, int size)
265 265
 }
266 266
 
267 267
 /* used only when posting data */
268
-static int http_write(URLContext *h, UINT8 *buf, int size)
268
+static int http_write(URLContext *h, uint8_t *buf, int size)
269 269
 {
270 270
     HTTPContext *s = h->priv_data;
271 271
     return url_write(s->hd, buf, size);
... ...
@@ -157,18 +157,18 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
157 157
     char filename[1024];
158 158
     int ret;
159 159
     ByteIOContext f1, *f;
160
-    static INT64 first_frame; // BUG -> to context FIXME
160
+    static int64_t first_frame; // BUG -> to context FIXME
161 161
 
162 162
     if (emulate_frame_rate) {
163 163
         if (!first_frame) {
164 164
             first_frame = av_gettime();
165 165
         } else {
166
-            INT64 pts;
167
-            INT64 nowus;
166
+            int64_t pts;
167
+            int64_t nowus;
168 168
 
169 169
             nowus = av_gettime() - first_frame;
170 170
 
171
-            pts = ((INT64)s->img_number * FRAME_RATE_BASE * 1000000) / (s1->streams[0]->codec.frame_rate);
171
+            pts = ((int64_t)s->img_number * FRAME_RATE_BASE * 1000000) / (s1->streams[0]->codec.frame_rate);
172 172
 
173 173
             if (pts > nowus)
174 174
                 usleep(pts - nowus);
... ...
@@ -201,7 +201,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
201 201
         av_free_packet(pkt);
202 202
         return -EIO; /* signal EOF */
203 203
     } else {
204
-        pkt->pts = ((INT64)s->img_number * s1->pts_den * FRAME_RATE_BASE) / (s1->streams[0]->codec.frame_rate * s1->pts_num);
204
+        pkt->pts = ((int64_t)s->img_number * s1->pts_den * FRAME_RATE_BASE) / (s1->streams[0]->codec.frame_rate * s1->pts_num);
205 205
         s->img_number++;
206 206
         return 0;
207 207
     }
... ...
@@ -265,7 +265,7 @@ static int img_write_header(AVFormatContext *s)
265 265
 }
266 266
 
267 267
 static int img_write_packet(AVFormatContext *s, int stream_index,
268
-                            UINT8 *buf, int size, int force_pts)
268
+                            uint8_t *buf, int size, int force_pts)
269 269
 {
270 270
     VideoData *img = s->priv_data;
271 271
     AVStream *st = s->streams[stream_index];
... ...
@@ -56,8 +56,8 @@ static int jpeg_get_buffer(AVCodecContext *c, AVFrame *picture)
56 56
     }
57 57
 }
58 58
 
59
-static void img_copy(UINT8 *dst, int dst_wrap, 
60
-                     UINT8 *src, int src_wrap,
59
+static void img_copy(uint8_t *dst, int dst_wrap, 
60
+                     uint8_t *src, int src_wrap,
61 61
                      int width, int height)
62 62
 {
63 63
     for(;height > 0; height--) {
... ...
@@ -61,7 +61,7 @@
61 61
  * Avoid them. This is here just to help debugging.
62 62
  */
63 63
 static int debug_indent = 0;
64
-void print_atom(const char *str, UINT32 type, UINT64 offset, UINT64 size)
64
+void print_atom(const char *str, uint32_t type, uint64_t offset, uint64_t size)
65 65
 {
66 66
     unsigned int tag, i;
67 67
     tag = (unsigned int) type;
... ...
@@ -149,7 +149,7 @@ typedef struct MOVStreamContext {
149 149
     int is_ff_stream; /* Is this stream presented to ffmpeg ? i.e. is this an audio or video stream ? */
150 150
     long next_chunk;
151 151
     long chunk_count;
152
-    INT64 *chunk_offsets;
152
+    int64_t *chunk_offsets;
153 153
     long sample_to_chunk_sz;
154 154
     MOV_sample_to_chunk_tbl *sample_to_chunk;
155 155
     long sample_to_chunk_index;
... ...
@@ -170,15 +170,15 @@ typedef struct MOVContext {
170 170
     long time_scale;
171 171
     int found_moov; /* when both 'moov' and 'mdat' sections has been found */
172 172
     int found_mdat; /* we suppose we have enough data to read the file */
173
-    INT64 mdat_size;
174
-    INT64 mdat_offset;
173
+    int64_t mdat_size;
174
+    int64_t mdat_offset;
175 175
     int total_streams;
176 176
     /* some streams listed here aren't presented to the ffmpeg API, since they aren't either video nor audio
177 177
      * but we need the info to be able to skip data from those streams in the 'mdat' section
178 178
      */
179 179
     MOVStreamContext *streams[MAX_STREAMS];
180 180
     
181
-    INT64 next_chunk_offset;
181
+    int64_t next_chunk_offset;
182 182
     int partial; /* != 0 : there is still to read in the current chunk (=id of the stream + 1) */
183 183
 } MOVContext;
184 184
 
... ...
@@ -195,18 +195,18 @@ struct MOVParseTableEntry;
195 195
  */
196 196
 typedef int (*mov_parse_function)(const struct MOVParseTableEntry *parse_table,
197 197
                                   ByteIOContext *pb,
198
-                                  UINT32 atom_type,
199
-                                  INT64 atom_offset, /* after the size and type field (and eventually the extended size) */
200
-                                  INT64 atom_size, /* total size (excluding the size and type fields) */
198
+                                  uint32_t atom_type,
199
+                                  int64_t atom_offset, /* after the size and type field (and eventually the extended size) */
200
+                                  int64_t atom_size, /* total size (excluding the size and type fields) */
201 201
                                   void *param);
202 202
 
203 203
 /* links atom IDs to parse functions */
204 204
 typedef struct MOVParseTableEntry {
205
-    UINT32 type;
205
+    uint32_t type;
206 206
     mov_parse_function func;
207 207
 } MOVParseTableEntry;
208 208
 
209
-static int parse_leaf(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
209
+static int parse_leaf(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
210 210
 {
211 211
 #ifdef DEBUG
212 212
     print_atom("leaf", atom_type, atom_offset, atom_size);
... ...
@@ -218,11 +218,11 @@ static int parse_leaf(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
218 218
 }
219 219
 
220 220
 
221
-static int parse_default(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
221
+static int parse_default(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
222 222
 {
223
-    UINT32 type, foo=0;
224
-    UINT64 offset, size;
225
-    UINT64 total_size = 0;
223
+    uint32_t type, foo=0;
224
+    uint64_t offset, size;
225
+    uint64_t total_size = 0;
226 226
     int i;
227 227
     int err = 0;
228 228
     foo=0;
... ...
@@ -276,7 +276,7 @@ static int parse_default(const MOVParseTableEntry *parse_table, ByteIOContext *p
276 276
     return err;
277 277
 }
278 278
 
279
-static int parse_mvhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
279
+static int parse_mvhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
280 280
 {
281 281
     MOVContext *c;
282 282
 #ifdef DEBUG
... ...
@@ -314,7 +314,7 @@ static int parse_mvhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
314 314
 }
315 315
 
316 316
 /* this atom should contain all header atoms */
317
-static int parse_moov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
317
+static int parse_moov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
318 318
 {
319 319
     int err;
320 320
     MOVContext *c;
... ...
@@ -333,7 +333,7 @@ static int parse_moov(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
333 333
 }
334 334
 
335 335
 /* this atom contains actual media data */
336
-static int parse_mdat(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
336
+static int parse_mdat(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
337 337
 {
338 338
     MOVContext *c;
339 339
 #ifdef DEBUG
... ...
@@ -355,10 +355,10 @@ static int parse_mdat(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
355 355
 /* this atom should be null (from specs), but some buggy files put the 'moov' atom inside it... */
356 356
 /* like the files created with Adobe Premiere 5.0, for samples see */
357 357
 /* http://graphics.tudelft.nl/~wouter/publications/soundtests/ */
358
-static int parse_wide(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
358
+static int parse_wide(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
359 359
 {
360 360
     int err;
361
-    UINT32 type;
361
+    uint32_t type;
362 362
 #ifdef DEBUG
363 363
     print_atom("wide", atom_type, atom_offset, atom_size);
364 364
     debug_indent++;
... ...
@@ -381,7 +381,7 @@ static int parse_wide(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
381 381
     return err;
382 382
 }
383 383
 
384
-static int parse_trak(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
384
+static int parse_trak(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
385 385
 {
386 386
     MOVContext *c;
387 387
     AVStream *st;
... ...
@@ -401,7 +401,7 @@ static int parse_trak(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
401 401
     return parse_default(parse_table, pb, atom_type, atom_offset, atom_size, param);
402 402
 }
403 403
 
404
-static int parse_tkhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
404
+static int parse_tkhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
405 405
 {
406 406
     MOVContext *c;
407 407
     AVStream *st;
... ...
@@ -445,7 +445,7 @@ static int parse_tkhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
445 445
     return 0;
446 446
 }
447 447
 
448
-static int parse_mdhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
448
+static int parse_mdhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
449 449
 {
450 450
     MOVContext *c;
451 451
     AVStream *st;
... ...
@@ -477,14 +477,14 @@ static int parse_mdhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
477 477
     return 0;
478 478
 }
479 479
 
480
-static int parse_hdlr(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
480
+static int parse_hdlr(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
481 481
 {
482 482
     MOVContext *c;
483 483
     int len = 0;
484 484
     char *buf;
485
-    UINT32 type;
485
+    uint32_t type;
486 486
     AVStream *st;
487
-    UINT32 ctype;
487
+    uint32_t ctype;
488 488
 #ifdef DEBUG
489 489
     print_atom("hdlr", atom_type, atom_offset, atom_size);
490 490
 #endif
... ...
@@ -612,11 +612,11 @@ static int mp4_read_descr(ByteIOContext *pb, int *tag)
612 612
     return len;
613 613
 }
614 614
 
615
-static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
615
+static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
616 616
 {
617 617
     MOVContext *c;
618 618
     int entries, size, samp_sz, frames_per_sample, id;
619
-    UINT32 format;
619
+    uint32_t format;
620 620
     AVStream *st;
621 621
     MOVStreamContext *sc;
622 622
 #ifdef DEBUG
... ...
@@ -691,7 +691,7 @@ static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
691 691
             size -= (16+8*4+2+32+2*2);
692 692
             while (size >= 8) {
693 693
                 int atom_size, atom_type;
694
-                INT64 start_pos;
694
+                int64_t start_pos;
695 695
                 
696 696
                 atom_size = get_be32(pb);
697 697
                 atom_type = get_le32(pb);
... ...
@@ -800,7 +800,7 @@ static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
800 800
     return 0;
801 801
 }
802 802
 
803
-static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
803
+static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
804 804
 {
805 805
     MOVContext *c;
806 806
     int entries, i;
... ...
@@ -818,7 +818,7 @@ static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
818 818
 
819 819
     entries = get_be32(pb);
820 820
     sc->chunk_count = entries;
821
-    sc->chunk_offsets = av_malloc(entries * sizeof(INT64));
821
+    sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));
822 822
     if(atom_type == MKTAG('s', 't', 'c', 'o')) {
823 823
         for(i=0; i<entries; i++) {
824 824
             sc->chunk_offsets[i] = get_be32(pb);
... ...
@@ -839,7 +839,7 @@ static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
839 839
     return 0;
840 840
 }
841 841
 
842
-static int parse_stsc(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
842
+static int parse_stsc(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
843 843
 {
844 844
     MOVContext *c;
845 845
     int entries, i;
... ...
@@ -872,7 +872,7 @@ printf("track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
872 872
     return 0;
873 873
 }
874 874
 
875
-static int parse_stsz(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
875
+static int parse_stsz(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
876 876
 {
877 877
     MOVContext *c;
878 878
     int entries, i;
... ...
@@ -906,7 +906,7 @@ static int parse_stsz(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
906 906
     return 0;
907 907
 }
908 908
 
909
-static int parse_stts(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
909
+static int parse_stts(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
910 910
 {
911 911
     MOVContext *c;
912 912
     int entries, i;
... ...
@@ -944,12 +944,12 @@ printf("track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
944 944
 }
945 945
 
946 946
 #ifdef CONFIG_ZLIB
947
-static int null_read_packet(void *opaque, UINT8 *buf, int buf_size)
947
+static int null_read_packet(void *opaque, uint8_t *buf, int buf_size)
948 948
 {
949 949
     return -1;
950 950
 }
951 951
 
952
-static int parse_cmov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
952
+static int parse_cmov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
953 953
 {
954 954
     MOVContext *c;
955 955
     ByteIOContext ctx;
... ...
@@ -1130,7 +1130,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
1130 1130
     MOVContext *mov = s->priv_data;
1131 1131
     ByteIOContext *pb = &s->pb;
1132 1132
     int i, j, nb, err;
1133
-    INT64 size;
1133
+    int64_t size;
1134 1134
 
1135 1135
     mov->fc = s;
1136 1136
 #if 0
... ...
@@ -1200,7 +1200,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
1200 1200
 {
1201 1201
     MOVContext *mov = s->priv_data;
1202 1202
     MOVStreamContext *sc;
1203
-    INT64 offset = 0x0FFFFFFFFFFFFFFF;
1203
+    int64_t offset = 0x0FFFFFFFFFFFFFFF;
1204 1204
     int i;
1205 1205
     int st_id = 0, size;
1206 1206
     size = 0x0FFFFFFF;
... ...
@@ -22,12 +22,12 @@
22 22
 #define NB_STREAMS 2
23 23
 
24 24
 typedef struct {
25
-    UINT8 buffer[MAX_PAYLOAD_SIZE];
25
+    uint8_t buffer[MAX_PAYLOAD_SIZE];
26 26
     int buffer_ptr;
27
-    UINT8 id;
27
+    uint8_t id;
28 28
     int max_buffer_size; /* in bytes */
29 29
     int packet_number;
30
-    INT64 start_pts;
30
+    int64_t start_pts;
31 31
 } StreamInfo;
32 32
 
33 33
 typedef struct {
... ...
@@ -66,7 +66,7 @@ extern AVOutputFormat mpeg1vcd_mux;
66 66
 extern AVOutputFormat mpeg2vob_mux;
67 67
 
68 68
 static int put_pack_header(AVFormatContext *ctx, 
69
-                           UINT8 *buf, INT64 timestamp)
69
+                           uint8_t *buf, int64_t timestamp)
70 70
 {
71 71
     MpegMuxContext *s = ctx->priv_data;
72 72
     PutBitContext pb;
... ...
@@ -79,11 +79,11 @@ static int put_pack_header(AVFormatContext *ctx,
79 79
     } else {
80 80
         put_bits(&pb, 4, 0x2);
81 81
     }
82
-    put_bits(&pb, 3, (UINT32)((timestamp >> 30) & 0x07));
82
+    put_bits(&pb, 3, (uint32_t)((timestamp >> 30) & 0x07));
83 83
     put_bits(&pb, 1, 1);
84
-    put_bits(&pb, 15, (UINT32)((timestamp >> 15) & 0x7fff));
84
+    put_bits(&pb, 15, (uint32_t)((timestamp >> 15) & 0x7fff));
85 85
     put_bits(&pb, 1, 1);
86
-    put_bits(&pb, 15, (UINT32)((timestamp) & 0x7fff));
86
+    put_bits(&pb, 15, (uint32_t)((timestamp) & 0x7fff));
87 87
     put_bits(&pb, 1, 1);
88 88
     if (s->is_mpeg2) {
89 89
         /* clock extension */
... ...
@@ -101,7 +101,7 @@ static int put_pack_header(AVFormatContext *ctx,
101 101
     return pbBufPtr(&pb) - pb.buf;
102 102
 }
103 103
 
104
-static int put_system_header(AVFormatContext *ctx, UINT8 *buf)
104
+static int put_system_header(AVFormatContext *ctx, uint8_t *buf)
105 105
 {
106 106
     MpegMuxContext *s = ctx->priv_data;
107 107
     int size, rate_bound, i, private_stream_coded, id;
... ...
@@ -254,10 +254,10 @@ static void flush_packet(AVFormatContext *ctx, int stream_index, int last_pkt)
254 254
 {
255 255
     MpegMuxContext *s = ctx->priv_data;
256 256
     StreamInfo *stream = ctx->streams[stream_index]->priv_data;
257
-    UINT8 *buf_ptr;
257
+    uint8_t *buf_ptr;
258 258
     int size, payload_size, startcode, id, len, stuffing_size, i, header_len;
259
-    INT64 timestamp;
260
-    UINT8 buffer[128];
259
+    int64_t timestamp;
260
+    uint8_t buffer[128];
261 261
     int last = last_pkt ? 4 : 0;
262 262
     
263 263
     id = stream->id;
... ...
@@ -314,8 +314,8 @@ static void flush_packet(AVFormatContext *ctx, int stream_index, int last_pkt)
314 314
              (0x02 << 4) | 
315 315
              (((timestamp >> 30) & 0x07) << 1) | 
316 316
              1);
317
-    put_be16(&ctx->pb, (UINT16)((((timestamp >> 15) & 0x7fff) << 1) | 1));
318
-    put_be16(&ctx->pb, (UINT16)((((timestamp) & 0x7fff) << 1) | 1));
317
+    put_be16(&ctx->pb, (uint16_t)((((timestamp >> 15) & 0x7fff) << 1) | 1));
318
+    put_be16(&ctx->pb, (uint16_t)((((timestamp) & 0x7fff) << 1) | 1));
319 319
 
320 320
     if (startcode == PRIVATE_STREAM_1) {
321 321
         put_byte(&ctx->pb, id);
... ...
@@ -347,7 +347,7 @@ static void flush_packet(AVFormatContext *ctx, int stream_index, int last_pkt)
347 347
 }
348 348
 
349 349
 static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index,
350
-                                 UINT8 *buf, int size, int pts)
350
+                                 uint8_t *buf, int size, int pts)
351 351
 {
352 352
     MpegMuxContext *s = ctx->priv_data;
353 353
     AVStream *st = ctx->streams[stream_index];
... ...
@@ -440,7 +440,7 @@ typedef struct MpegDemuxContext {
440 440
 } MpegDemuxContext;
441 441
 
442 442
 static int find_start_code(ByteIOContext *pb, int *size_ptr, 
443
-                           UINT32 *header_state)
443
+                           uint32_t *header_state)
444 444
 {
445 445
     unsigned int state, v;
446 446
     int val, n;
... ...
@@ -475,18 +475,18 @@ static int mpegps_read_header(AVFormatContext *s,
475 475
     return 0;
476 476
 }
477 477
 
478
-static INT64 get_pts(ByteIOContext *pb, int c)
478
+static int64_t get_pts(ByteIOContext *pb, int c)
479 479
 {
480
-    INT64 pts;
480
+    int64_t pts;
481 481
     int val;
482 482
 
483 483
     if (c < 0)
484 484
         c = get_byte(pb);
485
-    pts = (INT64)((c >> 1) & 0x07) << 30;
485
+    pts = (int64_t)((c >> 1) & 0x07) << 30;
486 486
     val = get_be16(pb);
487
-    pts |= (INT64)(val >> 1) << 15;
487
+    pts |= (int64_t)(val >> 1) << 15;
488 488
     val = get_be16(pb);
489
-    pts |= (INT64)(val >> 1);
489
+    pts |= (int64_t)(val >> 1);
490 490
     return pts;
491 491
 }
492 492
 
... ...
@@ -496,7 +496,7 @@ static int mpegps_read_packet(AVFormatContext *s,
496 496
     MpegDemuxContext *m = s->priv_data;
497 497
     AVStream *st;
498 498
     int len, size, startcode, i, c, flags, header_len, type, codec_id;
499
-    INT64 pts, dts;
499
+    int64_t pts, dts;
500 500
 
501 501
     /* next start code (should be immediately after) */
502 502
  redo:
... ...
@@ -88,7 +88,7 @@ static int mpegts_read_header(AVFormatContext *s,
88 88
     ByteIOContext *pb = &s->pb;
89 89
     unsigned char buf[1024];
90 90
     int len;
91
-    INT64 pos;
91
+    int64_t pos;
92 92
 
93 93
     /* read the first 1024 bytes to get packet size */
94 94
     pos = url_ftell(pb);
... ...
@@ -24,7 +24,7 @@
24 24
 
25 25
 static int mpjpeg_write_header(AVFormatContext *s)
26 26
 {
27
-    UINT8 buf1[256];
27
+    uint8_t buf1[256];
28 28
 
29 29
     snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG);
30 30
     put_buffer(&s->pb, buf1, strlen(buf1));
... ...
@@ -33,9 +33,9 @@ static int mpjpeg_write_header(AVFormatContext *s)
33 33
 }
34 34
 
35 35
 static int mpjpeg_write_packet(AVFormatContext *s, int stream_index, 
36
-                               UINT8 *buf, int size, int force_pts)
36
+                               uint8_t *buf, int size, int force_pts)
37 37
 {
38
-    UINT8 buf1[256];
38
+    uint8_t buf1[256];
39 39
 
40 40
     snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\n\n");
41 41
     put_buffer(&s->pb, buf1, strlen(buf1));
... ...
@@ -75,7 +75,7 @@ static int single_jpeg_write_header(AVFormatContext *s)
75 75
 }
76 76
 
77 77
 static int single_jpeg_write_packet(AVFormatContext *s, int stream_index,
78
-                            UINT8 *buf, int size, int force_pts)
78
+                            uint8_t *buf, int size, int force_pts)
79 79
 {
80 80
     put_buffer(&s->pb, buf, size);
81 81
     put_flush_packet(&s->pb);
... ...
@@ -161,7 +161,7 @@ static int pnm_write(ByteIOContext *pb, AVImageInfo *info)
161 161
 {
162 162
     int i, h, h1, c, n, linesize;
163 163
     char buf[100];
164
-    UINT8 *ptr, *ptr1, *ptr2;
164
+    uint8_t *ptr, *ptr1, *ptr2;
165 165
 
166 166
     h = info->height;
167 167
     h1 = h;
... ...
@@ -38,7 +38,7 @@ static int raw_write_trailer(struct AVFormatContext *s)
38 38
 }
39 39
 
40 40
 /* raw input */
41
-static static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
41
+static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
42 42
 {
43 43
     AVStream *st;
44 44
     int id;
... ...
@@ -322,16 +322,16 @@ static int rm_write_header(AVFormatContext *s)
322 322
     return 0;
323 323
 }
324 324
 
325
-static int rm_write_audio(AVFormatContext *s, UINT8 *buf, int size)
325
+static int rm_write_audio(AVFormatContext *s, uint8_t *buf, int size)
326 326
 {
327
-    UINT8 *buf1;
327
+    uint8_t *buf1;
328 328
     RMContext *rm = s->priv_data;
329 329
     ByteIOContext *pb = &s->pb;
330 330
     StreamInfo *stream = rm->audio_stream;
331 331
     int i;
332 332
 
333 333
     /* XXX: suppress this malloc */
334
-    buf1= (UINT8*) av_malloc( size * sizeof(UINT8) );
334
+    buf1= (uint8_t*) av_malloc( size * sizeof(uint8_t) );
335 335
     
336 336
     write_packet_header(s, stream, size, stream->enc->coded_frame->key_frame);
337 337
     
... ...
@@ -347,7 +347,7 @@ static int rm_write_audio(AVFormatContext *s, UINT8 *buf, int size)
347 347
     return 0;
348 348
 }
349 349
 
350
-static int rm_write_video(AVFormatContext *s, UINT8 *buf, int size)
350
+static int rm_write_video(AVFormatContext *s, uint8_t *buf, int size)
351 351
 {
352 352
     RMContext *rm = s->priv_data;
353 353
     ByteIOContext *pb = &s->pb;
... ...
@@ -388,7 +388,7 @@ static int rm_write_video(AVFormatContext *s, UINT8 *buf, int size)
388 388
 }
389 389
 
390 390
 static int rm_write_packet(AVFormatContext *s, int stream_index, 
391
-                           UINT8 *buf, int size, int force_pts)
391
+                           uint8_t *buf, int size, int force_pts)
392 392
 {
393 393
     if (s->streams[stream_index]->codec.codec_type == 
394 394
         CODEC_TYPE_AUDIO)
... ...
@@ -472,7 +472,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
472 472
     ByteIOContext *pb = &s->pb;
473 473
     unsigned int tag, v;
474 474
     int tag_size, size, codec_data_size, i;
475
-    INT64 codec_pos;
475
+    int64_t codec_pos;
476 476
     unsigned int h263_hack_version;
477 477
     char buf[128];
478 478
     int flags = 0;
... ...
@@ -650,7 +650,7 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
650 650
     ByteIOContext *pb = &s->pb;
651 651
     AVStream *st;
652 652
     int len, num, timestamp, i, tmp, j;
653
-    UINT8 *ptr;
653
+    uint8_t *ptr;
654 654
     int flags;
655 655
 
656 656
  redo:
... ...
@@ -90,23 +90,23 @@ enum RTPPayloadType {
90 90
 
91 91
 typedef struct RTPContext {
92 92
     int payload_type;
93
-    UINT32 ssrc;
94
-    UINT16 seq;
95
-    UINT32 timestamp;
96
-    UINT32 base_timestamp;
97
-    UINT32 cur_timestamp;
93
+    uint32_t ssrc;
94
+    uint16_t seq;
95
+    uint32_t timestamp;
96
+    uint32_t base_timestamp;
97
+    uint32_t cur_timestamp;
98 98
     int max_payload_size;
99 99
     /* rtcp sender statistics receive */
100
-    INT64 last_rtcp_ntp_time;
101
-    UINT32 last_rtcp_timestamp;
100
+    int64_t last_rtcp_ntp_time;
101
+    uint32_t last_rtcp_timestamp;
102 102
     /* rtcp sender statistics */
103 103
     unsigned int packet_count;
104 104
     unsigned int octet_count;
105 105
     unsigned int last_octet_count;
106 106
     int first_packet;
107 107
     /* buffer for output */
108
-    UINT8 buf[RTP_MAX_PACKET_LENGTH];
109
-    UINT8 *buf_ptr;
108
+    uint8_t buf[RTP_MAX_PACKET_LENGTH];
109
+    uint8_t *buf_ptr;
110 110
 } RTPContext;
111 111
 
112 112
 int rtp_get_codec_info(AVCodecContext *codec, int payload_type)
... ...
@@ -184,14 +184,14 @@ int rtp_get_payload_type(AVCodecContext *codec)
184 184
     return payload_type;
185 185
 }
186 186
 
187
-static inline UINT32 decode_be32(const UINT8 *p)
187
+static inline uint32_t decode_be32(const uint8_t *p)
188 188
 {
189 189
     return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
190 190
 }
191 191
 
192
-static inline UINT32 decode_be64(const UINT8 *p)
192
+static inline uint32_t decode_be64(const uint8_t *p)
193 193
 {
194
-    return ((UINT64)decode_be32(p) << 32) | decode_be32(p + 4);
194
+    return ((uint64_t)decode_be32(p) << 32) | decode_be32(p + 4);
195 195
 }
196 196
 
197 197
 static int rtcp_parse_packet(AVFormatContext *s1, const unsigned char *buf, int len)
... ...
@@ -221,7 +221,7 @@ int rtp_parse_packet(AVFormatContext *s1, AVPacket *pkt,
221 221
     unsigned int ssrc, h;
222 222
     int payload_type, seq, delta_timestamp;
223 223
     AVStream *st;
224
-    UINT32 timestamp;
224
+    uint32_t timestamp;
225 225
     
226 226
     if (len < 12)
227 227
         return -1;
... ...
@@ -390,7 +390,7 @@ static int rtp_write_header(AVFormatContext *s1)
390 390
 }
391 391
 
392 392
 /* send an rtcp sender report packet */
393
-static void rtcp_send_sr(AVFormatContext *s1, INT64 ntp_time)
393
+static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
394 394
 {
395 395
     RTPContext *s = s1->priv_data;
396 396
 #if defined(DEBUG)
... ...
@@ -409,7 +409,7 @@ static void rtcp_send_sr(AVFormatContext *s1, INT64 ntp_time)
409 409
 
410 410
 /* send an rtp packet. sequence number is incremented, but the caller
411 411
    must update the timestamp itself */
412
-static void rtp_send_data(AVFormatContext *s1, UINT8 *buf1, int len)
412
+static void rtp_send_data(AVFormatContext *s1, uint8_t *buf1, int len)
413 413
 {
414 414
     RTPContext *s = s1->priv_data;
415 415
 
... ...
@@ -435,7 +435,7 @@ static void rtp_send_data(AVFormatContext *s1, UINT8 *buf1, int len)
435 435
 /* send an integer number of samples and compute time stamp and fill
436 436
    the rtp send buffer before sending. */
437 437
 static void rtp_send_samples(AVFormatContext *s1,
438
-                             UINT8 *buf1, int size, int sample_size)
438
+                             uint8_t *buf1, int size, int sample_size)
439 439
 {
440 440
     RTPContext *s = s1->priv_data;
441 441
     int len, max_packet_size, n;
... ...
@@ -468,7 +468,7 @@ static void rtp_send_samples(AVFormatContext *s1,
468 468
 /* NOTE: we suppose that exactly one frame is given as argument here */
469 469
 /* XXX: test it */
470 470
 static void rtp_send_mpegaudio(AVFormatContext *s1,
471
-                               UINT8 *buf1, int size)
471
+                               uint8_t *buf1, int size)
472 472
 {
473 473
     RTPContext *s = s1->priv_data;
474 474
     AVStream *st = s1->streams[0];
... ...
@@ -524,12 +524,12 @@ static void rtp_send_mpegaudio(AVFormatContext *s1,
524 524
 /* NOTE: a single frame must be passed with sequence header if
525 525
    needed. XXX: use slices. */
526 526
 static void rtp_send_mpegvideo(AVFormatContext *s1,
527
-                               UINT8 *buf1, int size)
527
+                               uint8_t *buf1, int size)
528 528
 {
529 529
     RTPContext *s = s1->priv_data;
530 530
     AVStream *st = s1->streams[0];
531 531
     int len, h, max_packet_size;
532
-    UINT8 *q;
532
+    uint8_t *q;
533 533
 
534 534
     max_packet_size = s->max_payload_size;
535 535
 
... ...
@@ -572,7 +572,7 @@ static void rtp_send_mpegvideo(AVFormatContext *s1,
572 572
 }
573 573
 
574 574
 static void rtp_send_raw(AVFormatContext *s1,
575
-                         UINT8 *buf1, int size)
575
+                         uint8_t *buf1, int size)
576 576
 {
577 577
     RTPContext *s = s1->priv_data;
578 578
     AVStream *st = s1->streams[0];
... ...
@@ -599,12 +599,12 @@ static void rtp_send_raw(AVFormatContext *s1,
599 599
 
600 600
 /* write an RTP packet. 'buf1' must contain a single specific frame. */
601 601
 static int rtp_write_packet(AVFormatContext *s1, int stream_index,
602
-                            UINT8 *buf1, int size, int force_pts)
602
+                            uint8_t *buf1, int size, int force_pts)
603 603
 {
604 604
     RTPContext *s = s1->priv_data;
605 605
     AVStream *st = s1->streams[0];
606 606
     int rtcp_bytes;
607
-    INT64 ntp_time;
607
+    int64_t ntp_time;
608 608
     
609 609
 #ifdef DEBUG
610 610
     printf("%d: write len=%d\n", stream_index, size);
... ...
@@ -615,7 +615,7 @@ static int rtp_write_packet(AVFormatContext *s1, int stream_index,
615 615
         RTCP_TX_RATIO_DEN;
616 616
     if (s->first_packet || rtcp_bytes >= 28) {
617 617
         /* compute NTP time */
618
-        ntp_time = force_pts; // ((INT64)force_pts << 28) / 5625
618
+        ntp_time = force_pts; // ((int64_t)force_pts << 28) / 5625
619 619
         rtcp_send_sr(s1, ntp_time); 
620 620
         s->last_octet_count = s->octet_count;
621 621
         s->first_packet = 0;
... ...
@@ -171,7 +171,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
171 171
     return -EIO;
172 172
 }
173 173
 
174
-static int rtp_read(URLContext *h, UINT8 *buf, int size)
174
+static int rtp_read(URLContext *h, uint8_t *buf, int size)
175 175
 {
176 176
     RTPContext *s = h->priv_data;
177 177
     struct sockaddr_in from;
... ...
@@ -230,7 +230,7 @@ static int rtp_read(URLContext *h, UINT8 *buf, int size)
230 230
     return len;
231 231
 }
232 232
 
233
-static int rtp_write(URLContext *h, UINT8 *buf, int size)
233
+static int rtp_write(URLContext *h, uint8_t *buf, int size)
234 234
 {
235 235
     RTPContext *s = h->priv_data;
236 236
     int ret;
... ...
@@ -41,7 +41,7 @@ typedef struct RTSPTransportField {
41 41
     int client_port_min, client_port_max; /* RTP ports */
42 42
     int server_port_min, server_port_max; /* RTP ports */
43 43
     int ttl; /* ttl value */
44
-    UINT32 destination; /* destination IP address */
44
+    uint32_t destination; /* destination IP address */
45 45
     enum RTSPProtocol protocol;
46 46
 } RTSPTransportField;
47 47
 
... ...
@@ -63,7 +63,7 @@ enum RTSPCallbackAction {
63 63
 };
64 64
 
65 65
 typedef struct RTSPActionServerSetup {
66
-    UINT32 ipaddr;
66
+    uint32_t ipaddr;
67 67
     char transport_option[512];
68 68
 } RTSPActionServerSetup;
69 69
 
... ...
@@ -107,7 +107,7 @@ static void put_swf_rect(ByteIOContext *pb,
107 107
                          int xmin, int xmax, int ymin, int ymax)
108 108
 {
109 109
     PutBitContext p;
110
-    UINT8 buf[256];
110
+    uint8_t buf[256];
111 111
     int nbits, mask;
112 112
 
113 113
     init_put_bits(&p, buf, sizeof(buf), NULL, NULL);
... ...
@@ -164,7 +164,7 @@ static void put_swf_matrix(ByteIOContext *pb,
164 164
                            int a, int b, int c, int d, int tx, int ty)
165 165
 {
166 166
     PutBitContext p;
167
-    UINT8 buf[256];
167
+    uint8_t buf[256];
168 168
 
169 169
     init_put_bits(&p, buf, sizeof(buf), NULL, NULL);
170 170
     
... ...
@@ -193,7 +193,7 @@ static int swf_write_header(AVFormatContext *s)
193 193
     ByteIOContext *pb = &s->pb;
194 194
     AVCodecContext *enc, *audio_enc, *video_enc;
195 195
     PutBitContext p;
196
-    UINT8 buf1[256];
196
+    uint8_t buf1[256];
197 197
     int i, width, height, rate;
198 198
 
199 199
     swf = av_malloc(sizeof(SWFContext));
... ...
@@ -230,7 +230,7 @@ static int swf_write_header(AVFormatContext *s)
230 230
     put_swf_rect(pb, 0, width, 0, height);
231 231
     put_le16(pb, (rate * 256) / FRAME_RATE_BASE); /* frame rate */
232 232
     swf->duration_pos = url_ftell(pb);
233
-    put_le16(pb, (UINT16)(DUMMY_DURATION * (INT64)rate / FRAME_RATE_BASE)); /* frame count */
233
+    put_le16(pb, (uint16_t)(DUMMY_DURATION * (int64_t)rate / FRAME_RATE_BASE)); /* frame count */
234 234
     
235 235
     /* define a shape with the jpeg inside */
236 236
 
... ...
@@ -316,7 +316,7 @@ static int swf_write_header(AVFormatContext *s)
316 316
 }
317 317
 
318 318
 static int swf_write_video(AVFormatContext *s, 
319
-                           AVCodecContext *enc, UINT8 *buf, int size)
319
+                           AVCodecContext *enc, uint8_t *buf, int size)
320 320
 {
321 321
     ByteIOContext *pb = &s->pb;
322 322
     static int tag_id = 0;
... ...
@@ -364,7 +364,7 @@ static int swf_write_video(AVFormatContext *s,
364 364
     return 0;
365 365
 }
366 366
 
367
-static int swf_write_audio(AVFormatContext *s, UINT8 *buf, int size)
367
+static int swf_write_audio(AVFormatContext *s, uint8_t *buf, int size)
368 368
 {
369 369
     ByteIOContext *pb = &s->pb;
370 370
 
... ...
@@ -378,7 +378,7 @@ static int swf_write_audio(AVFormatContext *s, UINT8 *buf, int size)
378 378
 }
379 379
 
380 380
 static int swf_write_packet(AVFormatContext *s, int stream_index, 
381
-                           UINT8 *buf, int size, int force_pts)
381
+                           uint8_t *buf, int size, int force_pts)
382 382
 {
383 383
     AVCodecContext *codec = &s->streams[stream_index]->codec;
384 384
     if (codec->codec_type == CODEC_TYPE_AUDIO)
... ...
@@ -100,7 +100,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
100 100
     return -EIO;
101 101
 }
102 102
 
103
-static int tcp_read(URLContext *h, UINT8 *buf, int size)
103
+static int tcp_read(URLContext *h, uint8_t *buf, int size)
104 104
 {
105 105
     TCPContext *s = h->priv_data;
106 106
     int size1, len;
... ...
@@ -130,7 +130,7 @@ static int tcp_read(URLContext *h, UINT8 *buf, int size)
130 130
     return size1 - size;
131 131
 }
132 132
 
133
-static int tcp_write(URLContext *h, UINT8 *buf, int size)
133
+static int tcp_write(URLContext *h, uint8_t *buf, int size)
134 134
 {
135 135
     TCPContext *s = h->priv_data;
136 136
     int ret, size1;
... ...
@@ -208,7 +208,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
208 208
     return -EIO;
209 209
 }
210 210
 
211
-static int udp_read(URLContext *h, UINT8 *buf, int size)
211
+static int udp_read(URLContext *h, uint8_t *buf, int size)
212 212
 {
213 213
     UDPContext *s = h->priv_data;
214 214
     struct sockaddr_in from;
... ...
@@ -228,7 +228,7 @@ static int udp_read(URLContext *h, UINT8 *buf, int size)
228 228
     return len;
229 229
 }
230 230
 
231
-static int udp_write(URLContext *h, UINT8 *buf, int size)
231
+static int udp_write(URLContext *h, uint8_t *buf, int size)
232 232
 {
233 233
     UDPContext *s = h->priv_data;
234 234
     int ret;
... ...
@@ -197,7 +197,7 @@ void fifo_free(FifoBuffer *f)
197 197
     av_free(f->buffer);
198 198
 }
199 199
 
200
-int fifo_size(FifoBuffer *f, UINT8 *rptr)
200
+int fifo_size(FifoBuffer *f, uint8_t *rptr)
201 201
 {
202 202
     int size;
203 203
 
... ...
@@ -210,9 +210,9 @@ int fifo_size(FifoBuffer *f, UINT8 *rptr)
210 210
 }
211 211
 
212 212
 /* get data from the fifo (return -1 if not enough data) */
213
-int fifo_read(FifoBuffer *f, UINT8 *buf, int buf_size, UINT8 **rptr_ptr)
213
+int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr)
214 214
 {
215
-    UINT8 *rptr = *rptr_ptr;
215
+    uint8_t *rptr = *rptr_ptr;
216 216
     int size, len;
217 217
 
218 218
     if (f->wptr >= rptr) {
... ...
@@ -238,10 +238,10 @@ int fifo_read(FifoBuffer *f, UINT8 *buf, int buf_size, UINT8 **rptr_ptr)
238 238
     return 0;
239 239
 }
240 240
 
241
-void fifo_write(FifoBuffer *f, UINT8 *buf, int size, UINT8 **wptr_ptr)
241
+void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr)
242 242
 {
243 243
     int len;
244
-    UINT8 *wptr;
244
+    uint8_t *wptr;
245 245
     wptr = *wptr_ptr;
246 246
     while (size > 0) {
247 247
         len = f->end - wptr;
... ...
@@ -471,7 +471,7 @@ int av_find_stream_info(AVFormatContext *ic)
471 471
     AVFrame picture;
472 472
     AVPacketList *pktl=NULL, **ppktl;
473 473
     short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
474
-    UINT8 *ptr;
474
+    uint8_t *ptr;
475 475
     int min_read_size, max_read_size;
476 476
 
477 477
     /* typical mpeg ts rate is 40 Mbits. DVD rate is about 10
... ...
@@ -759,11 +759,11 @@ int av_write_header(AVFormatContext *s)
759 759
         switch (st->codec.codec_type) {
760 760
         case CODEC_TYPE_AUDIO:
761 761
             av_frac_init(&st->pts, 0, 0, 
762
-                         (INT64)s->pts_num * st->codec.sample_rate);
762
+                         (int64_t)s->pts_num * st->codec.sample_rate);
763 763
             break;
764 764
         case CODEC_TYPE_VIDEO:
765 765
             av_frac_init(&st->pts, 0, 0, 
766
-                         (INT64)s->pts_num * st->codec.frame_rate);
766
+                         (int64_t)s->pts_num * st->codec.frame_rate);
767 767
             break;
768 768
         default:
769 769
             break;
... ...
@@ -786,7 +786,7 @@ int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,
786 786
                    int size)
787 787
 {
788 788
     AVStream *st;
789
-    INT64 pts_mask;
789
+    int64_t pts_mask;
790 790
     int ret, frame_size;
791 791
 
792 792
     st = s->streams[stream_index];
... ...
@@ -816,11 +816,11 @@ int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,
816 816
             frame_size = st->codec.frame_size;
817 817
         }
818 818
         av_frac_add(&st->pts, 
819
-                    (INT64)s->pts_den * frame_size);
819
+                    (int64_t)s->pts_den * frame_size);
820 820
         break;
821 821
     case CODEC_TYPE_VIDEO:
822 822
         av_frac_add(&st->pts, 
823
-                    (INT64)s->pts_den * FRAME_RATE_BASE);
823
+                    (int64_t)s->pts_den * FRAME_RATE_BASE);
824 824
         break;
825 825
     default:
826 826
         break;
... ...
@@ -914,16 +914,16 @@ int parse_image_size(int *width_ptr, int *height_ptr, const char *str)
914 914
     return 0;
915 915
 }
916 916
 
917
-INT64 av_gettime(void)
917
+int64_t av_gettime(void)
918 918
 {
919 919
 #ifdef CONFIG_WIN32
920 920
     struct _timeb tb;
921 921
     _ftime(&tb);
922
-    return ((INT64)tb.time * INT64_C(1000) + (INT64)tb.millitm) * INT64_C(1000);
922
+    return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000);
923 923
 #else
924 924
     struct timeval tv;
925 925
     gettimeofday(&tv,NULL);
926
-    return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
926
+    return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
927 927
 #endif
928 928
 }
929 929
 
... ...
@@ -955,10 +955,10 @@ static time_t mktimegm(struct tm *tm)
955 955
  *  HH[:MM[:SS[.m...]]]
956 956
  *  S+[.m...]
957 957
  */
958
-INT64 parse_date(const char *datestr, int duration)
958
+int64_t parse_date(const char *datestr, int duration)
959 959
 {
960 960
     const char *p;
961
-    INT64 t;
961
+    int64_t t;
962 962
     struct tm dt;
963 963
     int i;
964 964
     static const char *date_fmt[] = {
... ...
@@ -1027,7 +1027,7 @@ INT64 parse_date(const char *datestr, int duration)
1027 1027
         if (duration)
1028 1028
             return 0;
1029 1029
         else
1030
-            return now * INT64_C(1000000);
1030
+            return now * int64_t_C(1000000);
1031 1031
     }
1032 1032
 
1033 1033
     if (duration) {
... ...
@@ -1167,7 +1167,7 @@ int get_frame_filename(char *buf, int buf_size,
1167 1167
  * @param buf buffer
1168 1168
  * @param size buffer size
1169 1169
  */
1170
-void av_hex_dump(UINT8 *buf, int size)
1170
+void av_hex_dump(uint8_t *buf, int size)
1171 1171
 {
1172 1172
     int len, i, j, c;
1173 1173
 
... ...
@@ -1271,7 +1271,7 @@ void av_set_pts_info(AVFormatContext *s, int pts_wrap_bits,
1271 1271
  * @param num must be >= 0
1272 1272
  * @param den must be >= 1 
1273 1273
  */
1274
-void av_frac_init(AVFrac *f, INT64 val, INT64 num, INT64 den)
1274
+void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
1275 1275
 {
1276 1276
     num += (den >> 1);
1277 1277
     if (num >= den) {
... ...
@@ -1284,7 +1284,7 @@ void av_frac_init(AVFrac *f, INT64 val, INT64 num, INT64 den)
1284 1284
 }
1285 1285
 
1286 1286
 /* set f to (val + 0.5) */
1287
-void av_frac_set(AVFrac *f, INT64 val)
1287
+void av_frac_set(AVFrac *f, int64_t val)
1288 1288
 {
1289 1289
     f->val = val;
1290 1290
     f->num = f->den >> 1;
... ...
@@ -1296,9 +1296,9 @@ void av_frac_set(AVFrac *f, INT64 val)
1296 1296
  * @param f fractional number
1297 1297
  * @param incr increment, can be positive or negative
1298 1298
  */
1299
-void av_frac_add(AVFrac *f, INT64 incr)
1299
+void av_frac_add(AVFrac *f, int64_t incr)
1300 1300
 {
1301
-    INT64 num, den;
1301
+    int64_t num, den;
1302 1302
 
1303 1303
     num = f->num + incr;
1304 1304
     den = f->den;
... ...
@@ -171,7 +171,7 @@ static int wav_write_header(AVFormatContext *s)
171 171
 }
172 172
 
173 173
 static int wav_write_packet(AVFormatContext *s, int stream_index_ptr,
174
-                           UINT8 *buf, int size, int force_pts)
174
+                           uint8_t *buf, int size, int force_pts)
175 175
 {
176 176
     ByteIOContext *pb = &s->pb;
177 177
     put_buffer(pb, buf, size);
... ...
@@ -190,7 +190,7 @@ static int wav_write_trailer(AVFormatContext *s)
190 190
         /* update file size */
191 191
         file_size = url_ftell(pb);
192 192
         url_fseek(pb, 4, SEEK_SET);
193
-        put_le32(pb, (UINT32)(file_size - 8));
193
+        put_le32(pb, (uint32_t)(file_size - 8));
194 194
         url_fseek(pb, file_size, SEEK_SET);
195 195
 
196 196
         put_flush_packet(pb);
... ...
@@ -200,7 +200,7 @@ static int wav_write_trailer(AVFormatContext *s)
200 200
 
201 201
 /* return the size of the found tag */
202 202
 /* XXX: > 2GB ? */
203
-static int find_tag(ByteIOContext *pb, UINT32 tag1)
203
+static int find_tag(ByteIOContext *pb, uint32_t tag1)
204 204
 {
205 205
     unsigned int tag;
206 206
     int size;
... ...
@@ -97,7 +97,7 @@ static int yuv_write(ByteIOContext *pb2, AVImageInfo *info)
97 97
     ByteIOContext pb1, *pb;
98 98
     char fname[1024], *p;
99 99
     int i, j, width, height;
100
-    UINT8 *ptr;
100
+    uint8_t *ptr;
101 101
     URLContext *h;
102 102
     static const char *ext = "YUV";
103 103
     
... ...
@@ -101,7 +101,7 @@ static int yuv4_write_header(AVFormatContext *s)
101 101
 }
102 102
 
103 103
 static int yuv4_write_packet(AVFormatContext *s, int stream_index,
104
-                             UINT8 *buf, int size, int force_pts)
104
+                             uint8_t *buf, int size, int force_pts)
105 105
 {
106 106
     AVStream *st = s->streams[stream_index];
107 107
     ByteIOContext *pb = &s->pb;
... ...
@@ -109,7 +109,7 @@ static int yuv4_write_packet(AVFormatContext *s, int stream_index,
109 109
     int width, height;
110 110
     int i, m;
111 111
     char buf1[20];
112
-    UINT8 *ptr, *ptr1, *ptr2;
112
+    uint8_t *ptr, *ptr1, *ptr2;
113 113
 
114 114
     picture = (AVPicture *)buf;
115 115
 
... ...
@@ -8,14 +8,14 @@
8 8
 #define SCALEBITS 8
9 9
 #define ONE_HALF  (1 << (SCALEBITS - 1))
10 10
 #define FIX(x)		((int) ((x) * (1L<<SCALEBITS) + 0.5))
11
-typedef unsigned char UINT8;
11
+typedef unsigned char uint8_t;
12 12
 
13
-static void rgb24_to_yuv420p(UINT8 *lum, UINT8 *cb, UINT8 *cr,
14
-                              UINT8 *src, int width, int height)
13
+static void rgb24_to_yuv420p(uint8_t *lum, uint8_t *cb, uint8_t *cr,
14
+                              uint8_t *src, int width, int height)
15 15
 {
16 16
     int wrap, wrap3, x, y;
17 17
     int r, g, b, r1, g1, b1;
18
-    UINT8 *p;
18
+    uint8_t *p;
19 19
 
20 20
     wrap = width;
21 21
     wrap3 = width * 3;
... ...
@@ -68,7 +68,7 @@ typedef struct {
68 68
     int file_limit;
69 69
     int debug;
70 70
     int min_interval;
71
-    INT64 next_pts;
71
+    int64_t next_pts;
72 72
     int inset;
73 73
     int min_width;
74 74
 } ContextInfo;
... ...
@@ -193,10 +193,10 @@ static void get_hsv(HSV *hsv, int r, int g, int b)
193 193
     return;
194 194
 }                                                                               
195 195
 
196
-void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, INT64 pts)
196
+void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, int64_t pts)
197 197
 {
198 198
     ContextInfo *ci = (ContextInfo *) ctx;
199
-    UINT8 *cm = cropTbl + MAX_NEG_CROP;                                         
199
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;                                         
200 200
     int rowsize = picture->linesize[0];
201 201
 
202 202
     if (pts < ci->next_pts)
... ...
@@ -208,7 +208,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
208 208
     ci->next_pts = pts + 1000000;    
209 209
 
210 210
     if (pix_fmt == PIX_FMT_YUV420P) {
211
-        UINT8 *y, *u, *v;
211
+        uint8_t *y, *u, *v;
212 212
         int width2 = width >> 1;
213 213
         int inrange = 0;
214 214
         int pixcnt;
... ...
@@ -193,7 +193,7 @@ static void put_cached_image(ContextInfo *ci, Imlib_Image image, int width, int
193 193
     ci->cache = cache;
194 194
 }
195 195
 
196
-void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, INT64 pts)
196
+void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, int64_t pts)
197 197
 {
198 198
     ContextInfo *ci = (ContextInfo *) ctx;
199 199
     AVPicture picture1;
... ...
@@ -211,7 +211,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
211 211
     data = imlib_image_get_data();
212 212
 
213 213
     if (pix_fmt != PIX_FMT_RGBA32) {
214
-        avpicture_fill(&picture1, (UINT8 *) data, PIX_FMT_RGBA32, width, height);
214
+        avpicture_fill(&picture1, (uint8_t *) data, PIX_FMT_RGBA32, width, height);
215 215
         if (img_convert(&picture1, PIX_FMT_RGBA32, 
216 216
                         picture, pix_fmt, width, height) < 0) {
217 217
             goto done;
... ...
@@ -41,7 +41,7 @@ int Configure(void **ctxp, int argc, char *argv[])
41 41
     return 0;
42 42
 }
43 43
 
44
-void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, INT64 pts)
44
+void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, int64_t pts)
45 45
 {
46 46
     ContextInfo *ci = (ContextInfo *) ctx;
47 47
     char *buf = 0;