#define INFINITY HUGE_VAL
#endif
-#define MAXINT64 INT64_C(0x7fffffffffffffff)
+#define MAXINT64 int64_t_C(0x7fffffffffffffff)
typedef struct {
const char *name;
static int audio_channels = 1;
static int audio_codec_id = CODEC_ID_NONE;
-static INT64 recording_time = 0;
+static int64_t recording_time = 0;
static int file_overwrite = 0;
static char *str_title = NULL;
static char *str_author = NULL;
for A/V sync */
double sync_ipts;
double sync_ipts_offset;
- INT64 sync_opts;
+ int64_t sync_opts;
/* video only */
int video_resample; /* video_resample and video_crop are mutually exclusive */
AVPicture pict_tmp; /* temporary image for resampling */
AVStream *st;
int discard; /* true if stream data should be discarded */
int decoding_needed; /* true if the packets must be decoded in 'raw_fifo' */
- INT64 sample_index; /* current sample */
+ int64_t sample_index; /* current sample */
int frame_decoded; /* true if a video or audio frame has been decoded */
} AVInputStream;
AVInputStream *ist,
unsigned char *buf, int size)
{
- UINT8 *buftmp;
- UINT8 audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it */
- UINT8 audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it - yep really WMA */
+ uint8_t *buftmp;
+ uint8_t audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it */
+ uint8_t audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* XXX: allocate it - yep really WMA */
int size_out, frame_bytes, ret;
AVCodecContext *enc;
static void write_picture(AVFormatContext *s, int index, AVPicture *picture,
int pix_fmt, int w, int h)
{
- UINT8 *buf, *src, *dest;
+ uint8_t *buf, *src, *dest;
int size, j, i;
/* XXX: not efficient, should add test if we can take
AVCodecContext *dec;
AVPicture *picture2;
AVPicture picture_tmp;
- UINT8 *buf = 0;
+ uint8_t *buf = 0;
dec = &ist->st->codec;
int nb_frames, i, ret;
AVPicture *final_picture, *formatted_picture;
AVPicture picture_format_temp, picture_crop_temp;
- static UINT8 *video_buffer;
- UINT8 *buf = NULL, *buf1 = NULL;
+ static uint8_t *video_buffer;
+ uint8_t *buf = NULL, *buf1 = NULL;
AVCodecContext *enc, *dec;
#define VIDEO_BUFFER_SIZE (1024*1024)
avoid any copies. We support temorarily the older
method. */
av_write_frame(s, ost->index,
- (UINT8 *)final_picture, sizeof(AVPicture));
+ (uint8_t *)final_picture, sizeof(AVPicture));
} else {
write_picture(s, ost->index, final_picture, enc->pix_fmt,
enc->width, enc->height);
int frame_size)
{
static FILE *fvstats=NULL;
- static INT64 total_size = 0;
+ static int64_t total_size = 0;
char filename[40];
time_t today2;
struct tm *today;
AVCodecContext *enc;
int frame_number;
- INT64 ti;
+ int64_t ti;
double ti1, bitrate, avg_bitrate;
if (!fvstats) {
char buf[1024];
AVOutputStream *ost;
AVFormatContext *oc, *os;
- INT64 total_size;
+ int64_t total_size;
AVCodecContext *enc;
int frame_number, vid, i;
double bitrate, ti1, pts;
- static INT64 last_time = -1;
+ static int64_t last_time = -1;
if (!is_last_report) {
- INT64 cur_time;
+ int64_t cur_time;
/* display the report every 0.5 seconds */
cur_time = av_gettime();
if (last_time == -1) {
ost->topBand = frame_topBand;
ost->leftBand = frame_leftBand;
} else {
- UINT8 *buf;
+ uint8_t *buf;
ost->video_resample = 1;
ost->video_crop = 0; // cropping is handled as part of resample
buf = av_malloc((codec->width * codec->height * 3) / 2);
for(;;) {
int file_index, ist_index;
AVPacket pkt;
- UINT8 *ptr;
+ uint8_t *ptr;
int len;
- UINT8 *data_buf;
+ uint8_t *data_buf;
int data_size, got_picture;
AVPicture picture;
short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
ptr = pkt.data;
pts_set = 0;
while (len > 0) {
- INT64 ipts;
+ int64_t ipts;
ipts = AV_NOPTS_VALUE;
len -= ret;
continue;
}
- data_buf = (UINT8 *)samples;
+ data_buf = (uint8_t *)samples;
break;
case CODEC_TYPE_VIDEO:
if (ist->st->codec.codec_id == CODEC_ID_RAWVIDEO) {
/* XXX: add mpeg4 too ? */
if (ist->st->codec.codec_id == CODEC_ID_MPEG1VIDEO) {
if (ist->st->codec.pict_type != B_TYPE) {
- INT64 tmp;
+ int64_t tmp;
tmp = ist->last_ip_pts;
ist->last_ip_pts = ist->frac_pts.val;
ist->frac_pts.val = tmp;
}
#if defined(CONFIG_WIN32) || defined(CONFIG_OS2)
-static INT64 getutime(void)
+static int64_t getutime(void)
{
return av_gettime();
}
#else
-static INT64 getutime(void)
+static int64_t getutime(void)
{
struct rusage rusage;
int optindex, i;
const char *opt, *arg;
const OptionDef *po;
- INT64 ti;
+ int64_t ti;
av_register_all();
#define SYNC_TIMEOUT (10 * 1000)
typedef struct {
- INT64 count1, count2;
+ int64_t count1, count2;
long time1, time2;
} DataRateData;
struct sockaddr_in from_addr; /* origin */
struct pollfd *poll_entry; /* used when polling */
long timeout;
- UINT8 *buffer_ptr, *buffer_end;
+ uint8_t *buffer_ptr, *buffer_end;
int http_error;
struct HTTPContext *next;
int got_key_frame; /* stream 0 => 1, stream 1 => 2, stream 2=> 4 */
- INT64 data_count;
+ int64_t data_count;
/* feed input */
int feed_fd;
/* input format handling */
AVFormatContext *fmt_in;
long start_time; /* In milliseconds - this wraps fairly often */
- INT64 first_pts; /* initial pts value */
+ int64_t first_pts; /* initial pts value */
int pts_stream_index; /* stream we choose as clock reference */
/* output format handling */
struct FFStream *stream;
char method[16];
char url[128];
int buffer_size;
- UINT8 *buffer;
+ uint8_t *buffer;
int is_packetized; /* if true, the stream is packetized */
int packet_stream_index; /* current stream for output in state machine */
/* RTSP state specific */
- UINT8 *pb_buffer; /* XXX: use that in all the code */
+ uint8_t *pb_buffer; /* XXX: use that in all the code */
ByteIOContext *pb;
int seq; /* RTSP sequence number */
int feed_opened; /* true if someone is writing to the feed */
int is_feed; /* true if it is a feed */
int conns_served;
- INT64 bytes_served;
- INT64 feed_max_size; /* maximum storage size */
- INT64 feed_write_index; /* current write position in feed (it wraps round) */
- INT64 feed_size; /* current size of feed */
+ int64_t bytes_served;
+ int64_t feed_max_size; /* maximum storage size */
+ int64_t feed_write_index; /* current write position in feed (it wraps round) */
+ int64_t feed_size; /* current size of feed */
struct FFStream *next_feed;
} FFStream;
static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h);
/* SDP handling */
-static int prepare_sdp_description(FFStream *stream, UINT8 **pbuffer,
+static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
struct in_addr my_ip);
/* RTP handling */
c->protocol, (c->http_error ? c->http_error : 200), c->data_count);
}
-static void update_datarate(DataRateData *drd, INT64 count)
+static void update_datarate(DataRateData *drd, int64_t count)
{
if (!drd->time1 && !drd->count1) {
drd->time1 = drd->time2 = cur_time;
}
/* In bytes per second */
-static int compute_datarate(DataRateData *drd, INT64 count)
+static int compute_datarate(DataRateData *drd, int64_t count)
{
if (cur_time == drd->time1)
return 0;
return ((count - drd->count1) * 1000) / (cur_time - drd->time1);
}
-static int get_longterm_datarate(DataRateData *drd, INT64 count)
+static int get_longterm_datarate(DataRateData *drd, int64_t count)
{
/* You get the first 3 seconds flat out */
if (cur_time - drd->time1 < 3000)
return -1;
} else {
/* search for end of request. XXX: not fully correct since garbage could come after the end */
- UINT8 *ptr;
+ uint8_t *ptr;
c->buffer_ptr += len;
ptr = c->buffer_ptr;
if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
break;
case REDIR_SDP:
{
- UINT8 *sdp_data;
+ uint8_t *sdp_data;
int sdp_data_size, len;
struct sockaddr_in my_addr;
return 0;
}
-static void fmt_bytecount(ByteIOContext *pb, INT64 count)
+static void fmt_bytecount(ByteIOContext *pb, int64_t count)
{
static const char *suffix = " kMGTP";
const char *s;
char input_filename[1024];
AVFormatContext *s;
int buf_size, i;
- INT64 stream_pos;
+ int64_t stream_pos;
/* find file name */
if (c->stream->feed) {
stream_pos = parse_date(buf, 0);
} else if (find_info_tag(buf, sizeof(buf), "buffer", info)) {
int prebuffer = strtol(buf, 0, 10);
- stream_pos = av_gettime() - prebuffer * (INT64)1000000;
+ stream_pos = av_gettime() - prebuffer * (int64_t)1000000;
} else {
- stream_pos = av_gettime() - c->stream->prebuffer * (INT64)1000;
+ stream_pos = av_gettime() - c->stream->prebuffer * (int64_t)1000;
}
} else {
strcpy(input_filename, c->stream->feed_filename);
if (st->pts.den == 0) {
switch(st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
- st->pts_incr = (INT64)s->pts_den;
+ st->pts_incr = (int64_t)s->pts_den;
av_frac_init(&st->pts, st->pts.val, 0,
- (INT64)s->pts_num * st->codec.sample_rate);
+ (int64_t)s->pts_num * st->codec.sample_rate);
break;
case CODEC_TYPE_VIDEO:
- st->pts_incr = (INT64)s->pts_den * FRAME_RATE_BASE;
+ st->pts_incr = (int64_t)s->pts_den * FRAME_RATE_BASE;
av_frac_init(&st->pts, st->pts.val, 0,
- (INT64)s->pts_num * st->codec.frame_rate);
+ (int64_t)s->pts_num * st->codec.frame_rate);
break;
default:
av_abort();
if (st->pts.den == 0) {
switch(st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
- st->pts_incr = (INT64)s->pts_den * st->codec.frame_size;
+ st->pts_incr = (int64_t)s->pts_den * st->codec.frame_size;
av_frac_init(&st->pts, st->pts.val, 0,
- (INT64)s->pts_num * st->codec.sample_rate);
+ (int64_t)s->pts_num * st->codec.sample_rate);
break;
case CODEC_TYPE_VIDEO:
- st->pts_incr = (INT64)s->pts_den * FRAME_RATE_BASE;
+ st->pts_incr = (int64_t)s->pts_den * FRAME_RATE_BASE;
av_frac_init(&st->pts, st->pts.val, 0,
- (INT64)s->pts_num * st->codec.frame_rate);
+ (int64_t)s->pts_num * st->codec.frame_rate);
break;
default:
av_abort();
static int compute_send_delay(HTTPContext *c)
{
- INT64 cur_pts, delta_pts, next_pts;
+ int64_t cur_pts, delta_pts, next_pts;
int delay1;
/* compute current pts value from system time */
- cur_pts = ((INT64)(cur_time - c->start_time) * c->fmt_in->pts_den) /
+ cur_pts = ((int64_t)(cur_time - c->start_time) * c->fmt_in->pts_den) /
(c->fmt_in->pts_num * 1000LL);
/* compute the delta from the stream we choose as
main clock (we do that to avoid using explicit
if (dt < 1)
dt = 1;
- if ((c->packet_byte_count + len) * (INT64)1000000 >=
- (SHORT_TERM_BANDWIDTH / 8) * (INT64)dt) {
+ if ((c->packet_byte_count + len) * (int64_t)1000000 >=
+ (SHORT_TERM_BANDWIDTH / 8) * (int64_t)dt) {
/* bandwidth overflow : wait at most one tick and retry */
c->state = HTTPSTATE_WAIT_SHORT;
return 0;
/* XXX: move that to rtsp.c, but would need to replace FFStream by
AVFormatContext */
-static int prepare_sdp_description(FFStream *stream, UINT8 **pbuffer,
+static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
struct in_addr my_ip)
{
ByteIOContext pb1, *pb = &pb1;
FFStream *stream;
char path1[1024];
const char *path;
- UINT8 *content;
+ uint8_t *content;
int content_length, len;
struct sockaddr_in my_addr;
AVStream *st;
char *ipaddr;
URLContext *h;
- UINT8 *dummy_buf;
+ uint8_t *dummy_buf;
char buf2[32];
/* now we can open the relevant output stream */
int mpeg4_count, i, size;
AVPacket pkt;
AVStream *st;
- const UINT8 *p;
+ const uint8_t *p;
mpeg4_count = 0;
for(i=0;i<infile->nb_streams;i++) {
fsize *= 1024 * 1024 * 1024;
break;
}
- feed->feed_max_size = (INT64)fsize;
+ feed->feed_max_size = (int64_t)fsize;
}
} else if (!strcasecmp(cmd, "</Feed>")) {
if (!feed) {
#if 0
static void write_packet(FFCodec *ffenc,
- UINT8 *buf, int size)
+ uint8_t *buf, int size)
{
PacketHeader hdr;
AVCodecContext *enc = &ffenc->enc;
- UINT8 *wptr;
+ uint8_t *wptr;
mk_header(&hdr, enc, size);
wptr = http_fifo.wptr;
- fifo_write(&http_fifo, (UINT8 *)&hdr, sizeof(hdr), &wptr);
+ fifo_write(&http_fifo, (uint8_t *)&hdr, sizeof(hdr), &wptr);
fifo_write(&http_fifo, buf, size, &wptr);
/* atomic modification of wptr */
http_fifo.wptr = wptr;
* released under the GPL license.
*/
typedef struct AC3DecodeState {
- UINT8 inbuf[4096]; /* input buffer */
- UINT8 *inbuf_ptr;
+ uint8_t inbuf[4096]; /* input buffer */
+ uint8_t *inbuf_ptr;
int frame_size;
int flags;
int channels;
return i - 0x43c00000;
}
-static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
+static inline void float_to_int (float * _f, int16_t * s16, int nchannels)
{
int i, j, c;
int32_t * f = (int32_t *) _f; // XXX assumes IEEE float format
static int a52_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
AC3DecodeState *s = avctx->priv_data;
- UINT8 *buf_ptr;
+ uint8_t *buf_ptr;
int flags, i, len;
int sample_rate, bit_rate;
short *out_samples = data;
}
s->inbuf_ptr = s->inbuf;
s->frame_size = 0;
- *data_size = 6 * avctx->channels * 256 * sizeof(INT16);
+ *data_size = 6 * avctx->channels * 256 * sizeof(int16_t);
break;
}
}
int cplfleak, cplsleak;
} AC3BitAllocParameters;
-extern const UINT16 ac3_freqs[3];
-extern const UINT16 ac3_bitratetab[19];
-extern const INT16 ac3_window[256];
-extern const UINT8 sdecaytab[4];
-extern const UINT8 fdecaytab[4];
-extern const UINT16 sgaintab[4];
-extern const UINT16 dbkneetab[4];
-extern const UINT16 floortab[8];
-extern const UINT16 fgaintab[8];
+extern const uint16_t ac3_freqs[3];
+extern const uint16_t ac3_bitratetab[19];
+extern const int16_t ac3_window[256];
+extern const uint8_t sdecaytab[4];
+extern const uint8_t fdecaytab[4];
+extern const uint16_t sgaintab[4];
+extern const uint16_t dbkneetab[4];
+extern const uint16_t floortab[8];
+extern const uint16_t fgaintab[8];
void ac3_common_init(void);
-void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, UINT8 *bap,
- INT8 *exp, int start, int end,
+void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
+ int8_t *exp, int start, int end,
int snroffset, int fgain, int is_lfe,
int deltbae,int deltnseg,
- UINT8 *deltoffst, UINT8 *deltlen, UINT8 *deltba);
+ uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba);
/* currently, I use libac3 which is Copyright (C) Aaron Holtzman and
released under the GPL license. I may reimplement it someday... */
typedef struct AC3DecodeState {
- UINT8 inbuf[4096]; /* input buffer */
- UINT8 *inbuf_ptr;
+ uint8_t inbuf[4096]; /* input buffer */
+ uint8_t *inbuf_ptr;
int frame_size;
int flags;
int channels;
return i - 0x43c00000;
}
-static inline void float_to_int (float * _f, INT16 * s16, int nchannels)
+static inline void float_to_int (float * _f, int16_t * s16, int nchannels)
{
int i, j, c;
int32_t * f = (int32_t *) _f; // XXX assumes IEEE float format
static int ac3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
AC3DecodeState *s = avctx->priv_data;
- UINT8 *buf_ptr;
+ uint8_t *buf_ptr;
int flags, i, len;
int sample_rate, bit_rate;
short *out_samples = data;
}
s->inbuf_ptr = s->inbuf;
s->frame_size = 0;
- *data_size = 6 * avctx->channels * 256 * sizeof(INT16);
+ *data_size = 6 * avctx->channels * 256 * sizeof(int16_t);
break;
}
}
static void fft_init(int ln);
static void ac3_crc_init(void);
-static inline INT16 fix15(float a)
+static inline int16_t fix15(float a)
{
int v;
v = (int)(a * (float)(1 << 15));
/* AC3 bit allocation. The algorithm is the one described in the AC3
spec. */
-void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, UINT8 *bap,
- INT8 *exp, int start, int end,
+void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
+ int8_t *exp, int start, int end,
int snroffset, int fgain, int is_lfe,
int deltbae,int deltnseg,
- UINT8 *deltoffst, UINT8 *deltlen, UINT8 *deltba)
+ uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba)
{
int bin,i,j,k,end1,v,v1,bndstrt,bndend,lowcomp,begin;
int fastleak,slowleak,address,tmp;
- INT16 psd[256]; /* scaled exponents */
- INT16 bndpsd[50]; /* interpolated exponents */
- INT16 excite[50]; /* excitation */
- INT16 mask[50]; /* masking value */
+ int16_t psd[256]; /* scaled exponents */
+ int16_t bndpsd[50]; /* interpolated exponents */
+ int16_t excite[50]; /* excitation */
+ int16_t mask[50]; /* masking value */
/* exponent mapping to PSD */
for(bin=start;bin<end;bin++) {
}
/* do a 512 point mdct */
-static void mdct512(INT32 *out, INT16 *in)
+static void mdct512(int32_t *out, int16_t *in)
{
int i, re, im, re1, im1;
- INT16 rot[N];
+ int16_t rot[N];
IComplex x[N/4];
/* shift to simplify computations */
}
/* XXX: use another norm ? */
-static int calc_exp_diff(UINT8 *exp1, UINT8 *exp2, int n)
+static int calc_exp_diff(uint8_t *exp1, uint8_t *exp2, int n)
{
int sum, i;
sum = 0;
return sum;
}
-static void compute_exp_strategy(UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
- UINT8 exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
+static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
+ uint8_t exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
int ch, int is_lfe)
{
int i, j;
}
/* set exp[i] to min(exp[i], exp1[i]) */
-static void exponent_min(UINT8 exp[N/2], UINT8 exp1[N/2], int n)
+static void exponent_min(uint8_t exp[N/2], uint8_t exp1[N/2], int n)
{
int i;
/* update the exponents so that they are the ones the decoder will
decode. Return the number of bits used to code the exponents */
-static int encode_exp(UINT8 encoded_exp[N/2],
- UINT8 exp[N/2],
+static int encode_exp(uint8_t encoded_exp[N/2],
+ uint8_t exp[N/2],
int nb_exps,
int exp_strategy)
{
int group_size, nb_groups, i, j, k, recurse, exp_min, delta;
- UINT8 exp1[N/2];
+ uint8_t exp1[N/2];
switch(exp_strategy) {
case EXP_D15:
}
/* return the size in bits taken by the mantissa */
-static int compute_mantissa_size(AC3EncodeContext *s, UINT8 *m, int nb_coefs)
+static int compute_mantissa_size(AC3EncodeContext *s, uint8_t *m, int nb_coefs)
{
int bits, mant, i;
static int bit_alloc(AC3EncodeContext *s,
- UINT8 bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
- UINT8 encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
- UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
+ uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
+ uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
+ uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
int frame_bits, int csnroffst, int fsnroffst)
{
int i, ch;
s->mant4_cnt = 0;
for(ch=0;ch<s->nb_all_channels;ch++) {
ac3_parametric_bit_allocation(&s->bit_alloc,
- bap[i][ch], (INT8 *)encoded_exp[i][ch],
+ bap[i][ch], (int8_t *)encoded_exp[i][ch],
0, s->nb_coefs[ch],
(((csnroffst-15) << 4) +
fsnroffst) << 2,
#define SNR_INC1 4
static int compute_bit_allocation(AC3EncodeContext *s,
- UINT8 bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
- UINT8 encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
- UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
+ uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
+ uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2],
+ uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS],
int frame_bits)
{
int i, ch;
int csnroffst, fsnroffst;
- UINT8 bap1[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
+ uint8_t bap1[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
static int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
/* init default parameters */
AC3EncodeContext *s = avctx->priv_data;
int i, j, ch;
float alpha;
- static const UINT8 acmod_defs[6] = {
+ static const uint8_t acmod_defs[6] = {
0x01, /* C */
0x02, /* L R */
0x03, /* L C R */
/* Output one audio block. There are NB_BLOCKS audio blocks in one AC3
frame */
static void output_audio_block(AC3EncodeContext *s,
- UINT8 exp_strategy[AC3_MAX_CHANNELS],
- UINT8 encoded_exp[AC3_MAX_CHANNELS][N/2],
- UINT8 bap[AC3_MAX_CHANNELS][N/2],
- INT32 mdct_coefs[AC3_MAX_CHANNELS][N/2],
- INT8 global_exp[AC3_MAX_CHANNELS],
+ uint8_t exp_strategy[AC3_MAX_CHANNELS],
+ uint8_t encoded_exp[AC3_MAX_CHANNELS][N/2],
+ uint8_t bap[AC3_MAX_CHANNELS][N/2],
+ int32_t mdct_coefs[AC3_MAX_CHANNELS][N/2],
+ int8_t global_exp[AC3_MAX_CHANNELS],
int block_num)
{
int ch, nb_groups, group_size, i, baie;
- UINT8 *p;
- UINT16 qmant[AC3_MAX_CHANNELS][N/2];
+ uint8_t *p;
+ uint16_t qmant[AC3_MAX_CHANNELS][N/2];
int exp0, exp1;
int mant1_cnt, mant2_cnt, mant4_cnt;
- UINT16 *qmant1_ptr, *qmant2_ptr, *qmant4_ptr;
+ uint16_t *qmant1_ptr, *qmant2_ptr, *qmant4_ptr;
int delta0, delta1, delta2;
for(ch=0;ch<s->nb_channels;ch++)
}
}
-static unsigned int ac3_crc(UINT8 *data, int n, unsigned int crc)
+static unsigned int ac3_crc(uint8_t *data, int n, unsigned int crc)
{
int i;
for(i=0;i<n;i++) {
/* compute log2(max(abs(tab[]))) */
-static int log2_tab(INT16 *tab, int n)
+static int log2_tab(int16_t *tab, int n)
{
int i, v;
return av_log2(v);
}
-static void lshift_tab(INT16 *tab, int n, int lshift)
+static void lshift_tab(int16_t *tab, int n, int lshift)
{
int i;
static int output_frame_end(AC3EncodeContext *s)
{
int frame_size, frame_size_58, n, crc1, crc2, crc_inv;
- UINT8 *frame;
+ uint8_t *frame;
frame_size = s->frame_size; /* frame size in words */
/* align to 8 bits */
AC3EncodeContext *s = avctx->priv_data;
short *samples = data;
int i, j, k, v, ch;
- INT16 input_samples[N];
- INT32 mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
- UINT8 exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
- UINT8 exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS];
- UINT8 encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
- UINT8 bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
- INT8 exp_samples[NB_BLOCKS][AC3_MAX_CHANNELS];
+ int16_t input_samples[N];
+ int32_t mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
+ uint8_t exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
+ uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS];
+ uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
+ uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
+ int8_t exp_samples[NB_BLOCKS][AC3_MAX_CHANNELS];
int frame_bits;
frame_bits = 0;
for(ch=0;ch<s->nb_all_channels;ch++) {
/* fixed mdct to the six sub blocks & exponent computation */
for(i=0;i<NB_BLOCKS;i++) {
- INT16 *sptr;
+ int16_t *sptr;
int sinc;
/* compute input samples */
- memcpy(input_samples, s->last_samples[ch], N/2 * sizeof(INT16));
+ memcpy(input_samples, s->last_samples[ch], N/2 * sizeof(int16_t));
sinc = s->nb_all_channels;
sptr = samples + (sinc * (N/2) * i) + ch;
for(j=0;j<N/2;j++) {
/* copy encoded exponents for reuse case */
for(k=i+1;k<j;k++) {
memcpy(encoded_exp[k][ch], encoded_exp[i][ch],
- s->nb_coefs[ch] * sizeof(UINT8));
+ s->nb_coefs[ch] * sizeof(uint8_t));
}
i = j;
}
void mdct_test(void)
{
- INT16 input[N];
- INT32 output[N/2];
+ int16_t input[N];
+ int32_t output[N/2];
float input1[N];
float output1[N/2];
float s, a, err, e, emax;
/* tables taken directly from AC3 spec */
/* possible frequencies */
-const UINT16 ac3_freqs[3] = { 48000, 44100, 32000 };
+const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };
/* possible bitrates */
-const UINT16 ac3_bitratetab[19] = {
+const uint16_t ac3_bitratetab[19] = {
32, 40, 48, 56, 64, 80, 96, 112, 128,
160, 192, 224, 256, 320, 384, 448, 512, 576, 640
};
/* AC3 MDCT window */
/* MDCT window */
-const INT16 ac3_window[256] = {
+const int16_t ac3_window[256] = {
4, 7, 12, 16, 21, 28, 34, 42,
51, 61, 72, 84, 97, 111, 127, 145,
164, 184, 207, 231, 257, 285, 315, 347,
32767,32767,32767,32767,32767,32767,32767,32767,
};
-static UINT8 masktab[253];
+static uint8_t masktab[253];
-static const UINT8 latab[260]= {
+static const uint8_t latab[260]= {
0x0040,0x003f,0x003e,0x003d,0x003c,0x003b,0x003a,0x0039,0x0038,0x0037,
0x0036,0x0035,0x0034,0x0034,0x0033,0x0032,0x0031,0x0030,0x002f,0x002f,
0x002e,0x002d,0x002c,0x002c,0x002b,0x002a,0x0029,0x0029,0x0028,0x0027,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
};
-static const UINT16 hth[50][3]= {
+static const uint16_t hth[50][3]= {
{ 0x04d0,0x04f0,0x0580 },
{ 0x04d0,0x04f0,0x0580 },
{ 0x0440,0x0460,0x04b0 },
{ 0x0840,0x0840,0x04e0 },
};
-static const UINT8 baptab[64]= {
+static const uint8_t baptab[64]= {
0, 1, 1, 1, 1, 1, 2, 2, 3, 3,
3, 4, 4, 5, 5, 6, 6, 6, 6, 7,
7, 7, 7, 8, 8, 8, 8, 9, 9, 9,
15, 15, 15, 15,
};
-const UINT8 sdecaytab[4]={
+const uint8_t sdecaytab[4]={
0x0f, 0x11, 0x13, 0x15,
};
-const UINT8 fdecaytab[4]={
+const uint8_t fdecaytab[4]={
0x3f, 0x53, 0x67, 0x7b,
};
-const UINT16 sgaintab[4]= {
+const uint16_t sgaintab[4]= {
0x540, 0x4d8, 0x478, 0x410,
};
-const UINT16 dbkneetab[4]= {
+const uint16_t dbkneetab[4]= {
0x000, 0x700, 0x900, 0xb00,
};
-const UINT16 floortab[8]= {
+const uint16_t floortab[8]= {
0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
};
-const UINT16 fgaintab[8]= {
+const uint16_t fgaintab[8]= {
0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
};
-static const UINT8 bndsz[50]={
+static const uint8_t bndsz[50]={
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
};
-static UINT8 bndtab[51];
+static uint8_t bndtab[51];
/* fft & mdct sin cos tables */
-static INT16 costab[64];
-static INT16 sintab[64];
-static INT16 fft_rev[512];
-static INT16 xcos1[128];
-static INT16 xsin1[128];
+static int16_t costab[64];
+static int16_t sintab[64];
+static int16_t fft_rev[512];
+static int16_t xcos1[128];
+static int16_t xsin1[128];
-static UINT16 crc_table[256];
+static uint16_t crc_table[256];
static int adpcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
ADPCMContext *c = avctx->priv_data;
ADPCMChannelStatus *cs;
int n, m, channel;
int block_predictor[2];
short *samples;
- UINT8 *src;
+ uint8_t *src;
int st; /* stereo */
samples = data;
*data_size = 0;
return -1;
}
- *data_size = (UINT8 *)samples - (UINT8 *)data;
+ *data_size = (uint8_t *)samples - (uint8_t *)data;
return src - buf;
}
FILE *f;
short *samples;
float t, tincr;
- UINT8 *outbuf;
+ uint8_t *outbuf;
printf("Audio encoding\n");
AVCodecContext *c= NULL;
int out_size, size, len;
FILE *f, *outfile;
- UINT8 *outbuf;
- UINT8 inbuf[INBUF_SIZE], *inbuf_ptr;
+ uint8_t *outbuf;
+ uint8_t inbuf[INBUF_SIZE], *inbuf_ptr;
printf("Audio decoding\n");
int i, out_size, size, x, y, outbuf_size;
FILE *f;
AVFrame *picture;
- UINT8 *outbuf, *picture_buf;
+ uint8_t *outbuf, *picture_buf;
printf("Video encoding\n");
int frame, size, got_picture, len;
FILE *f;
AVFrame *picture;
- UINT8 inbuf[INBUF_SIZE], *inbuf_ptr;
+ uint8_t inbuf[INBUF_SIZE], *inbuf_ptr;
char buf[1024];
printf("Video decoding\n");
extern void j_rev_dct_ARM(DCTELEM *data);
/* XXX: local hack */
-static void (*ff_put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
-static void (*ff_add_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
+static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
+static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
-static void arm_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
+static void arm_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
{
j_rev_dct_ARM (block);
ff_put_pixels_clamped(block, dest, line_size);
}
-static void arm_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
+static void arm_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
{
j_rev_dct_ARM (block);
ff_add_pixels_clamped(block, dest, line_size);
* decoding: set by user.
*/
void (*draw_horiz_band)(struct AVCodecContext *s,
- UINT8 **src_ptr, int linesize,
+ uint8_t **src_ptr, int linesize,
int y, int width, int height);
/* audio only */
int id;
int priv_data_size;
int (*init)(AVCodecContext *);
- int (*encode)(AVCodecContext *, UINT8 *buf, int buf_size, void *data);
+ int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
int (*close)(AVCodecContext *);
int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
- UINT8 *buf, int buf_size);
+ uint8_t *buf, int buf_size);
int capabilities;
const AVOption *options;
struct AVCodec *next;
* the last component is alpha
*/
typedef struct AVPicture {
- UINT8 *data[4];
+ uint8_t *data[4];
int linesize[4];
} AVPicture;
void img_resample_close(ImgReSampleContext *s);
-int avpicture_fill(AVPicture *picture, UINT8 *ptr,
+int avpicture_fill(AVPicture *picture, uint8_t *ptr,
int pix_fmt, int width, int height);
int avpicture_get_size(int pix_fmt, int width, int height);
void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
-int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples,
+int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
- UINT8 *buf, int buf_size);
+ uint8_t *buf, int buf_size);
int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
- UINT8 *buf, int buf_size);
-int avcodec_parse_frame(AVCodecContext *avctx, UINT8 **pdata,
+ uint8_t *buf, int buf_size);
+int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
int *data_size_ptr,
- UINT8 *buf, int buf_size);
-int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size,
+ uint8_t *buf, int buf_size);
+int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const short *samples);
-int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size,
+int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVFrame *pict);
int avcodec_close(AVCodecContext *avctx);
*/
#include "avcodec.h"
-const UINT8 ff_sqrt_tab[128]={
+const uint8_t ff_sqrt_tab[128]={
0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
};
void init_put_bits(PutBitContext *s,
- UINT8 *buffer, int buffer_size,
+ uint8_t *buffer, int buffer_size,
void *opaque,
- void (*write_data)(void *, UINT8 *, int))
+ void (*write_data)(void *, uint8_t *, int))
{
s->buf = buffer;
s->buf_end = s->buf + buffer_size;
}
/* return the number of bits output */
-INT64 get_bit_count(PutBitContext *s)
+int64_t get_bit_count(PutBitContext *s)
{
#ifdef ALT_BITSTREAM_WRITER
return s->data_out_size * 8 + s->index;
#else
- return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (INT64)s->bit_left;
+ return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (int64_t)s->bit_left;
#endif
}
/* bit input functions */
void init_get_bits(GetBitContext *s,
- UINT8 *buffer, int bit_size)
+ uint8_t *buffer, int bit_size)
{
const int buffer_size= (bit_size+7)>>3;
#define GET_DATA(v, table, i, wrap, size) \
{\
- const UINT8 *ptr = (const UINT8 *)table + i * wrap;\
+ const uint8_t *ptr = (const uint8_t *)table + i * wrap;\
switch(size) {\
case 1:\
- v = *(const UINT8 *)ptr;\
+ v = *(const uint8_t *)ptr;\
break;\
case 2:\
- v = *(const UINT16 *)ptr;\
+ v = *(const uint16_t *)ptr;\
break;\
default:\
- v = *(const UINT32 *)ptr;\
+ v = *(const uint32_t *)ptr;\
break;\
}\
}
int nb_codes,
const void *bits, int bits_wrap, int bits_size,
const void *codes, int codes_wrap, int codes_size,
- UINT32 code_prefix, int n_prefix)
+ uint32_t code_prefix, int n_prefix)
{
int i, j, k, n, table_size, table_index, nb, n1, index;
- UINT32 code;
+ uint32_t code;
VLC_TYPE (*table)[2];
table_size = 1 << table_nb_bits;
/* windows */
-typedef unsigned short UINT16;
-typedef signed short INT16;
-typedef unsigned char UINT8;
-typedef unsigned int UINT32;
-typedef unsigned __int64 UINT64;
-typedef signed char INT8;
-typedef signed int INT32;
-typedef signed __int64 INT64;
-
-typedef UINT8 uint8_t;
-typedef INT8 int8_t;
-typedef UINT16 uint16_t;
-typedef INT16 int16_t;
-typedef UINT32 uint32_t;
-typedef INT32 int32_t;
-typedef UINT64 uint64_t;
-typedef INT64 int64_t;
+typedef unsigned short uint16_t;
+typedef signed short int16_t;
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+typedef unsigned __int64 uint64_t;
+typedef signed char int8_t;
+typedef signed int int32_t;
+typedef signed __int64 int64_t;
# ifndef __MINGW32__
-# define INT64_C(c) (c ## i64)
-# define UINT64_C(c) (c ## i64)
+# define int64_t_C(c) (c ## i64)
+# define uint64_t_C(c) (c ## i64)
# define inline __inline
# else
-# define INT64_C(c) (c ## LL)
-# define UINT64_C(c) (c ## ULL)
+# define int64_t_C(c) (c ## LL)
+# define uint64_t_C(c) (c ## ULL)
# endif /* __MINGW32__ */
# ifdef _DEBUG
#include <inttypes.h>
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-typedef signed char INT8;
-typedef signed short INT16;
-typedef signed int INT32;
-typedef signed long long INT64;
-
#ifdef HAVE_AV_CONFIG_H
-#ifndef INT64_C
-#define INT64_C(c) (c ## LL)
-#define UINT64_C(c) (c ## ULL)
+#ifndef int64_t_C
+#define int64_t_C(c) (c ## LL)
+#define uint64_t_C(c) (c ## ULL)
#endif
#ifdef USE_FASTMEMCPY
# include <inttypes.h>
-# ifndef __WINE_WINDEF16_H
-/* workaround for typedef conflict in MPlayer (wine typedefs) */
-typedef unsigned short UINT16;
-typedef signed short INT16;
-# endif
-
-typedef unsigned char UINT8;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-typedef signed char INT8;
-typedef signed int INT32;
-typedef signed long long INT64;
-
# ifdef HAVE_AV_CONFIG_H
-# ifndef INT64_C
-# define INT64_C(c) (c ## LL)
-# define UINT64_C(c) (c ## ULL)
+# ifndef int64_t_C
+# define int64_t_C(c) (c ## LL)
+# define uint64_t_C(c) (c ## ULL)
# endif
# ifdef USE_FASTMEMCPY
struct PutBitContext;
-typedef void (*WriteDataFunc)(void *, UINT8 *, int);
+typedef void (*WriteDataFunc)(void *, uint8_t *, int);
typedef struct PutBitContext {
#ifdef ALT_BITSTREAM_WRITER
- UINT8 *buf, *buf_end;
+ uint8_t *buf, *buf_end;
int index;
#else
- UINT32 bit_buf;
+ uint32_t bit_buf;
int bit_left;
- UINT8 *buf, *buf_ptr, *buf_end;
+ uint8_t *buf, *buf_ptr, *buf_end;
#endif
- INT64 data_out_size; /* in bytes */
+ int64_t data_out_size; /* in bytes */
} PutBitContext;
void init_put_bits(PutBitContext *s,
- UINT8 *buffer, int buffer_size,
+ uint8_t *buffer, int buffer_size,
void *opaque,
- void (*write_data)(void *, UINT8 *, int));
+ void (*write_data)(void *, uint8_t *, int));
-INT64 get_bit_count(PutBitContext *s); /* XXX: change function name */
+int64_t get_bit_count(PutBitContext *s); /* XXX: change function name */
void align_put_bits(PutBitContext *s);
void flush_put_bits(PutBitContext *s);
void put_string(PutBitContext * pbc, char *s);
/* bit input */
typedef struct GetBitContext {
- UINT8 *buffer, *buffer_end;
+ uint8_t *buffer, *buffer_end;
#ifdef ALT_BITSTREAM_READER
int index;
#elif defined LIBMPEG2_BITSTREAM_READER
- UINT8 *buffer_ptr;
- UINT32 cache;
+ uint8_t *buffer_ptr;
+ uint32_t cache;
int bit_count;
#elif defined A32_BITSTREAM_READER
- UINT32 *buffer_ptr;
- UINT32 cache0;
- UINT32 cache1;
+ uint32_t *buffer_ptr;
+ uint32_t cache0;
+ uint32_t cache1;
int bit_count;
#endif
int size_in_bits;
static inline int get_bits_count(GetBitContext *s);
-#define VLC_TYPE INT16
+#define VLC_TYPE int16_t
typedef struct VLC {
int bits;
/* used to avoid missaligned exceptions on some archs (alpha, ...) */
#ifdef ARCH_X86
-# define unaligned32(a) (*(UINT32*)(a))
+# define unaligned32(a) (*(uint32_t*)(a))
#else
# ifdef __GNUC__
static inline uint32_t unaligned32(const void *v) {
s->buf_ptr[3] = bit_buf ;
} else
#endif
- *(UINT32 *)s->buf_ptr = be2me_32(bit_buf);
+ *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
//printf("bitbuf = %08x\n", bit_buf);
s->buf_ptr+=4;
bit_left+=32 - n;
}
void init_get_bits(GetBitContext *s,
- UINT8 *buffer, int buffer_size);
+ uint8_t *buffer, int buffer_size);
int check_marker(GetBitContext *s, const char *msg);
void align_get_bits(GetBitContext *s);
static int cyuv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
CyuvDecodeContext *s=avctx->priv_data;
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
-UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
+uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
-INT64 gettime(void)
+int64_t gettime(void)
{
struct timeval tv;
gettimeofday(&tv,NULL);
- return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
+ return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}
#define NB_ITS 20000
{
int it, i, scale;
int err_inf, v;
- INT64 err2, ti, ti1, it1;
- INT64 sysErr[64], sysErrMax=0;
+ int64_t err2, ti, ti1, it1;
+ int64_t sysErr[64], sysErrMax=0;
int maxout=0;
int blockSumErrMax=0, blockSumErr;
#endif
}
-static UINT8 img_dest[64] __attribute__ ((aligned (8)));
-static UINT8 img_dest1[64] __attribute__ ((aligned (8)));
+static uint8_t img_dest[64] __attribute__ ((aligned (8)));
+static uint8_t img_dest1[64] __attribute__ ((aligned (8)));
-void idct248_ref(UINT8 *dest, int linesize, INT16 *block)
+void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
{
static int init;
static double c8[8][8];
}
void idct248_error(const char *name,
- void (*idct248_put)(UINT8 *dest, int line_size, INT16 *block))
+ void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block))
{
int it, i, it1, ti, ti1, err_max, v;
int ff_bit_exact=0;
-UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
-UINT32 squareTbl[512];
+uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
+uint32_t squareTbl[512];
-const UINT8 ff_zigzag_direct[64] = {
+const uint8_t ff_zigzag_direct[64] = {
0, 1, 8, 16, 9, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34,
};
/* not permutated inverse zigzag_direct + 1 for MMX quantizer */
-UINT16 __align8 inv_zigzag_direct16[64];
+uint16_t __align8 inv_zigzag_direct16[64];
-const UINT8 ff_alternate_horizontal_scan[64] = {
+const uint8_t ff_alternate_horizontal_scan[64] = {
0, 1, 2, 3, 8, 9, 16, 17,
10, 11, 4, 5, 6, 7, 15, 14,
13, 12, 19, 18, 24, 25, 32, 33,
52, 53, 54, 55, 60, 61, 62, 63,
};
-const UINT8 ff_alternate_vertical_scan[64] = {
+const uint8_t ff_alternate_vertical_scan[64] = {
0, 8, 16, 24, 1, 9, 2, 10,
17, 25, 32, 40, 48, 56, 57, 49,
41, 33, 26, 18, 3, 11, 4, 12,
};
/* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */
-const UINT32 inverse[256]={
+const uint32_t inverse[256]={
0, 4294967295U,2147483648U,1431655766, 1073741824, 858993460, 715827883, 613566757,
536870912, 477218589, 429496730, 390451573, 357913942, 330382100, 306783379, 286331154,
268435456, 252645136, 238609295, 226050911, 214748365, 204522253, 195225787, 186737709,
17318417, 17248865, 17179870, 17111424, 17043522, 16976156, 16909321, 16843010,
};
-static int pix_sum_c(UINT8 * pix, int line_size)
+static int pix_sum_c(uint8_t * pix, int line_size)
{
int s, i, j;
return s;
}
-static int pix_norm1_c(UINT8 * pix, int line_size)
+static int pix_norm1_c(uint8_t * pix, int line_size)
{
int s, i, j;
- UINT32 *sq = squareTbl + 256;
+ uint32_t *sq = squareTbl + 256;
s = 0;
for (i = 0; i < 16; i++) {
}
-static int sse8_c(void *v, UINT8 * pix1, UINT8 * pix2, int line_size)
+static int sse8_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size)
{
int s, i;
- UINT32 *sq = squareTbl + 256;
+ uint32_t *sq = squareTbl + 256;
s = 0;
for (i = 0; i < 8; i++) {
return s;
}
-static void get_pixels_c(DCTELEM *restrict block, const UINT8 *pixels, int line_size)
+static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
{
int i;
}
}
-static void diff_pixels_c(DCTELEM *restrict block, const UINT8 *s1,
- const UINT8 *s2, int stride){
+static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1,
+ const uint8_t *s2, int stride){
int i;
/* read the pixels */
}
-static void put_pixels_clamped_c(const DCTELEM *block, UINT8 *restrict pixels,
+static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
int line_size)
{
int i;
- UINT8 *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
/* read the pixels */
for(i=0;i<8;i++) {
}
}
-static void add_pixels_clamped_c(const DCTELEM *block, UINT8 *restrict pixels,
+static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,
int line_size)
{
int i;
- UINT8 *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
/* read the pixels */
for(i=0;i<8;i++) {
#define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
-static void gmc1_c(UINT8 *dst, UINT8 *src, int stride, int h, int x16, int y16, int rounder)
+static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder)
{
const int A=(16-x16)*(16-y16);
const int B=( x16)*(16-y16);
}
}
-static void gmc_c(UINT8 *dst, UINT8 *src, int stride, int h, int ox, int oy,
+static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
{
int y, vx, vy;
}
}
-static inline void copy_block17(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h)
+static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
{
int i;
for(i=0; i<h; i++)
}
}
-static inline void copy_block9(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h)
+static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
{
int i;
for(i=0; i<h; i++)
#define QPEL_MC(r, OPNAME, RND, OP) \
-static void OPNAME ## mpeg4_qpel8_h_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h){\
- UINT8 *cm = cropTbl + MAX_NEG_CROP;\
+static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;\
int i;\
for(i=0; i<h; i++)\
{\
}\
}\
\
-static void OPNAME ## mpeg4_qpel8_v_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride){\
+static void OPNAME ## mpeg4_qpel8_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int w=8;\
- UINT8 *cm = cropTbl + MAX_NEG_CROP;\
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;\
int i;\
for(i=0; i<w; i++)\
{\
}\
}\
\
-static void OPNAME ## mpeg4_qpel16_h_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride, int h){\
- UINT8 *cm = cropTbl + MAX_NEG_CROP;\
+static void OPNAME ## mpeg4_qpel16_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;\
int i;\
\
for(i=0; i<h; i++)\
}\
}\
\
-static void OPNAME ## mpeg4_qpel16_v_lowpass(UINT8 *dst, UINT8 *src, int dstStride, int srcStride){\
- UINT8 *cm = cropTbl + MAX_NEG_CROP;\
+static void OPNAME ## mpeg4_qpel16_v_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;\
int i;\
const int w=16;\
for(i=0; i<w; i++)\
}\
}\
\
-static void OPNAME ## qpel8_mc00_c (UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## pixels8_c(dst, src, stride, 8);\
}\
\
-static void OPNAME ## qpel8_mc10_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 half[64];\
+static void OPNAME ## qpel8_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t half[64];\
put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
OPNAME ## pixels8_l2(dst, src, half, stride, stride, 8, 8);\
}\
\
-static void OPNAME ## qpel8_mc20_c(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## mpeg4_qpel8_h_lowpass(dst, src, stride, stride, 8);\
}\
\
-static void OPNAME ## qpel8_mc30_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 half[64];\
+static void OPNAME ## qpel8_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t half[64];\
put ## RND ## mpeg4_qpel8_h_lowpass(half, src, 8, stride, 8);\
OPNAME ## pixels8_l2(dst, src+1, half, stride, stride, 8, 8);\
}\
\
-static void OPNAME ## qpel8_mc01_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 half[64];\
+static void OPNAME ## qpel8_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t half[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
OPNAME ## pixels8_l2(dst, full, half, stride, 16, 8, 8);\
}\
\
-static void OPNAME ## qpel8_mc02_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
+static void OPNAME ## qpel8_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
copy_block9(full, src, 16, stride, 9);\
OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16);\
}\
\
-static void OPNAME ## qpel8_mc03_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 half[64];\
+static void OPNAME ## qpel8_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t half[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16);\
OPNAME ## pixels8_l2(dst, full+16, half, stride, 16, 8, 8);\
}\
-void ff_ ## OPNAME ## qpel8_mc11_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfV[64];\
- UINT8 halfHV[64];\
+void ff_ ## OPNAME ## qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfV[64];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l4(dst, full, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc11_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfHV[64];\
+static void OPNAME ## qpel8_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
}\
-void ff_ ## OPNAME ## qpel8_mc31_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfV[64];\
- UINT8 halfHV[64];\
+void ff_ ## OPNAME ## qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfV[64];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l4(dst, full+1, halfH, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc31_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfHV[64];\
+static void OPNAME ## qpel8_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
}\
-void ff_ ## OPNAME ## qpel8_mc13_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfV[64];\
- UINT8 halfHV[64];\
+void ff_ ## OPNAME ## qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfV[64];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l4(dst, full+16, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc13_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfHV[64];\
+static void OPNAME ## qpel8_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
}\
-void ff_ ## OPNAME ## qpel8_mc33_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfV[64];\
- UINT8 halfHV[64];\
+void ff_ ## OPNAME ## qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfV[64];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full , 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l4(dst, full+17, halfH+8, halfV, halfHV, stride, 16, 8, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc33_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfHV[64];\
+static void OPNAME ## qpel8_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc21_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 halfH[72];\
- UINT8 halfHV[64];\
+static void OPNAME ## qpel8_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t halfH[72];\
+ uint8_t halfHV[64];\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfH, halfHV, stride, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc23_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 halfH[72];\
- UINT8 halfHV[64];\
+static void OPNAME ## qpel8_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t halfH[72];\
+ uint8_t halfHV[64];\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfH+8, halfHV, stride, 8, 8, 8);\
}\
-void ff_ ## OPNAME ## qpel8_mc12_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfV[64];\
- UINT8 halfHV[64];\
+void ff_ ## OPNAME ## qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfV[64];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full, 8, 16);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc12_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
+static void OPNAME ## qpel8_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## pixels8_l2(halfH, halfH, full, 8, 8, 16, 9);\
OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
}\
-void ff_ ## OPNAME ## qpel8_mc32_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
- UINT8 halfV[64];\
- UINT8 halfHV[64];\
+void ff_ ## OPNAME ## qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
+ uint8_t halfV[64];\
+ uint8_t halfHV[64];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfV, full+1, 8, 16);\
put ## RND ## mpeg4_qpel8_v_lowpass(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2(dst, halfV, halfHV, stride, 8, 8, 8);\
}\
-static void OPNAME ## qpel8_mc32_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[16*9];\
- UINT8 halfH[72];\
+static void OPNAME ## qpel8_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[16*9];\
+ uint8_t halfH[72];\
copy_block9(full, src, 16, stride, 9);\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, full, 8, 16, 9);\
put ## RND ## pixels8_l2(halfH, halfH, full+1, 8, 8, 16, 9);\
OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
}\
-static void OPNAME ## qpel8_mc22_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 halfH[72];\
+static void OPNAME ## qpel8_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t halfH[72];\
put ## RND ## mpeg4_qpel8_h_lowpass(halfH, src, 8, stride, 9);\
OPNAME ## mpeg4_qpel8_v_lowpass(dst, halfH, stride, 8);\
}\
-static void OPNAME ## qpel16_mc00_c (UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc00_c (uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## pixels16_c(dst, src, stride, 16);\
}\
\
-static void OPNAME ## qpel16_mc10_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 half[256];\
+static void OPNAME ## qpel16_mc10_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t half[256];\
put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
OPNAME ## pixels16_l2(dst, src, half, stride, stride, 16, 16);\
}\
\
-static void OPNAME ## qpel16_mc20_c(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc20_c(uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## mpeg4_qpel16_h_lowpass(dst, src, stride, stride, 16);\
}\
\
-static void OPNAME ## qpel16_mc30_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 half[256];\
+static void OPNAME ## qpel16_mc30_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t half[256];\
put ## RND ## mpeg4_qpel16_h_lowpass(half, src, 16, stride, 16);\
OPNAME ## pixels16_l2(dst, src+1, half, stride, stride, 16, 16);\
}\
\
-static void OPNAME ## qpel16_mc01_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 half[256];\
+static void OPNAME ## qpel16_mc01_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t half[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
OPNAME ## pixels16_l2(dst, full, half, stride, 24, 16, 16);\
}\
\
-static void OPNAME ## qpel16_mc02_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
+static void OPNAME ## qpel16_mc02_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
copy_block17(full, src, 24, stride, 17);\
OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24);\
}\
\
-static void OPNAME ## qpel16_mc03_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 half[256];\
+static void OPNAME ## qpel16_mc03_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t half[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24);\
OPNAME ## pixels16_l2(dst, full+24, half, stride, 24, 16, 16);\
}\
-void ff_ ## OPNAME ## qpel16_mc11_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfV[256];\
- UINT8 halfHV[256];\
+void ff_ ## OPNAME ## qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfV[256];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l4(dst, full, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc11_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfHV[256];\
+static void OPNAME ## qpel16_mc11_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
}\
-void ff_ ## OPNAME ## qpel16_mc31_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfV[256];\
- UINT8 halfHV[256];\
+void ff_ ## OPNAME ## qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfV[256];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l4(dst, full+1, halfH, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc31_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfHV[256];\
+static void OPNAME ## qpel16_mc31_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
}\
-void ff_ ## OPNAME ## qpel16_mc13_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfV[256];\
- UINT8 halfHV[256];\
+void ff_ ## OPNAME ## qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfV[256];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l4(dst, full+24, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc13_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfHV[256];\
+static void OPNAME ## qpel16_mc13_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
}\
-void ff_ ## OPNAME ## qpel16_mc33_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfV[256];\
- UINT8 halfHV[256];\
+void ff_ ## OPNAME ## qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfV[256];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full , 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l4(dst, full+25, halfH+16, halfV, halfHV, stride, 24, 16, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc33_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfHV[256];\
+static void OPNAME ## qpel16_mc33_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc21_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 halfH[272];\
- UINT8 halfHV[256];\
+static void OPNAME ## qpel16_mc21_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t halfH[272];\
+ uint8_t halfHV[256];\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfH, halfHV, stride, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc23_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 halfH[272];\
- UINT8 halfHV[256];\
+static void OPNAME ## qpel16_mc23_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t halfH[272];\
+ uint8_t halfHV[256];\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfH+16, halfHV, stride, 16, 16, 16);\
}\
-void ff_ ## OPNAME ## qpel16_mc12_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfV[256];\
- UINT8 halfHV[256];\
+void ff_ ## OPNAME ## qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfV[256];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full, 16, 24);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc12_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
+static void OPNAME ## qpel16_mc12_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## pixels16_l2(halfH, halfH, full, 16, 16, 24, 17);\
OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
}\
-void ff_ ## OPNAME ## qpel16_mc32_old_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
- UINT8 halfV[256];\
- UINT8 halfHV[256];\
+void ff_ ## OPNAME ## qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
+ uint8_t halfV[256];\
+ uint8_t halfHV[256];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfV, full+1, 16, 24);\
put ## RND ## mpeg4_qpel16_v_lowpass(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2(dst, halfV, halfHV, stride, 16, 16, 16);\
}\
-static void OPNAME ## qpel16_mc32_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 full[24*17];\
- UINT8 halfH[272];\
+static void OPNAME ## qpel16_mc32_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t full[24*17];\
+ uint8_t halfH[272];\
copy_block17(full, src, 24, stride, 17);\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, full, 16, 24, 17);\
put ## RND ## pixels16_l2(halfH, halfH, full+1, 16, 16, 24, 17);\
OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
}\
-static void OPNAME ## qpel16_mc22_c(UINT8 *dst, UINT8 *src, int stride){\
- UINT8 halfH[272];\
+static void OPNAME ## qpel16_mc22_c(uint8_t *dst, uint8_t *src, int stride){\
+ uint8_t halfH[272];\
put ## RND ## mpeg4_qpel16_h_lowpass(halfH, src, 16, stride, 17);\
OPNAME ## mpeg4_qpel16_v_lowpass(dst, halfH, stride, 16);\
}
}
-static inline int pix_abs16x16_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static inline int pix_abs16x16_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
return s;
}
-static int pix_abs16x16_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static int pix_abs16x16_x2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
return s;
}
-static int pix_abs16x16_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static int pix_abs16x16_y2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
- UINT8 *pix3 = pix2 + line_size;
+ uint8_t *pix3 = pix2 + line_size;
s = 0;
for(i=0;i<16;i++) {
return s;
}
-static int pix_abs16x16_xy2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static int pix_abs16x16_xy2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
- UINT8 *pix3 = pix2 + line_size;
+ uint8_t *pix3 = pix2 + line_size;
s = 0;
for(i=0;i<16;i++) {
return s;
}
-static inline int pix_abs8x8_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static inline int pix_abs8x8_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
return s;
}
-static int pix_abs8x8_x2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static int pix_abs8x8_x2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
return s;
}
-static int pix_abs8x8_y2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static int pix_abs8x8_y2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
- UINT8 *pix3 = pix2 + line_size;
+ uint8_t *pix3 = pix2 + line_size;
s = 0;
for(i=0;i<8;i++) {
return s;
}
-static int pix_abs8x8_xy2_c(UINT8 *pix1, UINT8 *pix2, int line_size)
+static int pix_abs8x8_xy2_c(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int s, i;
- UINT8 *pix3 = pix2 + line_size;
+ uint8_t *pix3 = pix2 + line_size;
s = 0;
for(i=0;i<8;i++) {
return pix_abs8x8_c(a,b,stride);
}
-void ff_block_permute(DCTELEM *block, UINT8 *permutation, const UINT8 *scantable, int last)
+void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)
{
int i;
DCTELEM temp[64];
static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){
MpegEncContext * const s= (MpegEncContext *)c;
- const UINT8 *scantable= s->intra_scantable.permutated;
+ const uint8_t *scantable= s->intra_scantable.permutated;
uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
uint64_t __align8 aligned_bak[stride];
DCTELEM * const temp= (DCTELEM*)aligned_temp;
static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride){
MpegEncContext * const s= (MpegEncContext *)c;
- const UINT8 *scantable= s->intra_scantable.permutated;
+ const uint8_t *scantable= s->intra_scantable.permutated;
uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
DCTELEM * const temp= (DCTELEM*)aligned_temp;
int i, last, run, bits, level, start_i;
void ff_fdct_mmx(DCTELEM *block);
/* encoding scans */
-extern const UINT8 ff_alternate_horizontal_scan[64];
-extern const UINT8 ff_alternate_vertical_scan[64];
-extern const UINT8 ff_zigzag_direct[64];
+extern const uint8_t ff_alternate_horizontal_scan[64];
+extern const uint8_t ff_alternate_vertical_scan[64];
+extern const uint8_t ff_zigzag_direct[64];
/* pixel operations */
#define MAX_NEG_CROP 384
/* temporary */
-extern UINT32 squareTbl[512];
-extern UINT8 cropTbl[256 + 2 * MAX_NEG_CROP];
+extern uint32_t squareTbl[512];
+extern uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
/* minimum alignment rules ;)
*/
/*
-void get_pixels_c(DCTELEM *block, const UINT8 *pixels, int line_size);
-void diff_pixels_c(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride);
-void put_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
-void add_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size);
+void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);
+void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
+void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
+void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
void clear_blocks_c(DCTELEM *blocks);
*/
/* add and put pixel (decoding) */
// blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
-typedef void (*op_pixels_func)(UINT8 *block/*align width (8 or 16)*/, const UINT8 *pixels/*align 1*/, int line_size, int h);
-typedef void (*qpel_mc_func)(UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);
+typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
+typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
#define DEF_OLD_QPEL(name)\
-void ff_put_ ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);\
-void ff_put_no_rnd_ ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);\
-void ff_avg_ ## name (UINT8 *dst/*align width (8 or 16)*/, UINT8 *src/*align 1*/, int stride);
+void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
+void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
+void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
DEF_OLD_QPEL(qpel16_mc11_old_c)
DEF_OLD_QPEL(qpel16_mc31_old_c)
/* motion estimation */
-typedef int (*op_pixels_abs_func)(UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
+typedef int (*op_pixels_abs_func)(uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
-typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, UINT8 *blk1/*align width (8 or 16)*/, UINT8 *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
+typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
typedef struct DSPContext {
/* pixel ops : interface with DCT */
- void (*get_pixels)(DCTELEM *block/*align 16*/, const UINT8 *pixels/*align 8*/, int line_size);
- void (*diff_pixels)(DCTELEM *block/*align 16*/, const UINT8 *s1/*align 8*/, const UINT8 *s2/*align 8*/, int stride);
- void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
- void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
- void (*gmc1)(UINT8 *dst/*align 8*/, UINT8 *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
- void (*gmc )(UINT8 *dst/*align 8*/, UINT8 *src/*align 1*/, int stride, int h, int ox, int oy,
+ void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
+ void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
+ void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
+ void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
+ void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
+ void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
- int (*pix_sum)(UINT8 * pix, int line_size);
- int (*pix_norm1)(UINT8 * pix, int line_size);
+ int (*pix_sum)(uint8_t * pix, int line_size);
+ int (*pix_norm1)(uint8_t * pix, int line_size);
me_cmp_func sad[2]; /* identical to pix_absAxA except additional void * */
me_cmp_func sse[2];
me_cmp_func hadamard8_diff[2];
* permute block according to permuatation.
* @param last last non zero element in scantable order
*/
-void ff_block_permute(DCTELEM *block, UINT8 *permutation, const UINT8 *scantable, int last);
+void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
#define emms_c()
extern int mm_flags;
-void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size);
-void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size);
+void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
+void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
static inline void emms(void)
{
#endif /* !__GNUC__ */
/* PSNR */
-void get_psnr(UINT8 *orig_image[3], UINT8 *coded_image[3],
+void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
int orig_linesize[3], int coded_linesize,
AVCodecContext *avctx);
VLC *vlc;
int sampling_411; /* 0 = 420, 1 = 411 */
int width, height;
- UINT8 *current_picture[3]; /* picture structure */
+ uint8_t *current_picture[3]; /* picture structure */
AVFrame picture;
int linesize[3];
DCTELEM block[5*6][64] __align8;
- UINT8 dv_zigzag[2][64];
- UINT8 idct_permutation[64];
+ uint8_t dv_zigzag[2][64];
+ uint8_t idct_permutation[64];
/* XXX: move it to static storage ? */
- UINT8 dv_shift[2][22][64];
- void (*idct_put[2])(UINT8 *dest, int line_size, DCTELEM *block);
+ uint8_t dv_shift[2][22][64];
+ void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block);
} DVVideoDecodeContext;
#include "dvdata.h"
//#define VLC_DEBUG
typedef struct BlockInfo {
- const UINT8 *shift_table;
- const UINT8 *scan_table;
- UINT8 pos; /* position in block */
- UINT8 eob_reached; /* true if EOB has been reached */
- UINT8 dct_mode;
- UINT8 partial_bit_count;
- UINT16 partial_bit_buffer;
+ const uint8_t *shift_table;
+ const uint8_t *scan_table;
+ uint8_t pos; /* position in block */
+ uint8_t eob_reached; /* true if EOB has been reached */
+ uint8_t dct_mode;
+ uint8_t partial_bit_count;
+ uint16_t partial_bit_buffer;
int shift_offset;
} BlockInfo;
/* block size in bits */
-static const UINT16 block_sizes[6] = {
+static const uint16_t block_sizes[6] = {
112, 112, 112, 112, 80, 80
};
{
int last_re_index;
int shift_offset = mb->shift_offset;
- const UINT8 *scan_table = mb->scan_table;
- const UINT8 *shift_table = mb->shift_table;
+ const uint8_t *scan_table = mb->scan_table;
+ const uint8_t *shift_table = mb->shift_table;
int pos = mb->pos;
int level, pos1, sign, run;
int partial_bit_count;
/* if we must parse a partial vlc, we do it here */
partial_bit_count = mb->partial_bit_count;
if (partial_bit_count > 0) {
- UINT8 buf[4];
- UINT32 v;
+ uint8_t buf[4];
+ uint32_t v;
int l, l1;
GetBitContext gb1;
/* mb_x and mb_y are in units of 8 pixels */
static inline void dv_decode_video_segment(DVVideoDecodeContext *s,
- UINT8 *buf_ptr1,
- const UINT16 *mb_pos_ptr)
+ uint8_t *buf_ptr1,
+ const uint16_t *mb_pos_ptr)
{
int quant, dc, dct_mode, class1, j;
int mb_index, mb_x, mb_y, v, last_index;
DCTELEM *block, *block1;
int c_offset, bits_left;
- UINT8 *y_ptr;
+ uint8_t *y_ptr;
BlockInfo mb_data[5 * 6], *mb, *mb1;
- void (*idct_put)(UINT8 *dest, int line_size, DCTELEM *block);
- UINT8 *buf_ptr;
+ void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block);
+ uint8_t *buf_ptr;
PutBitContext pb, vs_pb;
- UINT8 mb_bit_buffer[80 + 4]; /* allow some slack */
+ uint8_t mb_bit_buffer[80 + 4]; /* allow some slack */
int mb_bit_count;
- UINT8 vs_bit_buffer[5 * 80 + 4]; /* allow some slack */
+ uint8_t vs_bit_buffer[5 * 80 + 4]; /* allow some slack */
int vs_bit_count;
memset(s->block, 0, sizeof(s->block));
144000 bytes for PAL) */
static int dvvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
DVVideoDecodeContext *s = avctx->priv_data;
int sct, dsf, apt, ds, nb_dif_segs, vs, width, height, i, packet_size;
- UINT8 *buf_ptr;
- const UINT16 *mb_pos_ptr;
+ uint8_t *buf_ptr;
+ const uint16_t *mb_pos_ptr;
/* parse id */
init_get_bits(&s->gb, buf, buf_size*8);
return 0;
}
-static UINT16 dv_audio_12to16(UINT16 sample)
+static uint16_t dv_audio_12to16(uint16_t sample)
{
- UINT16 shift, result;
+ uint16_t shift, result;
sample = (sample < 0x800) ? sample : sample | 0xf000;
shift = (sample & 0xf00) >> 8;
*/
static int dvaudio_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
DVVideoDecodeContext *s = avctx->priv_data;
- const UINT16 (*unshuffle)[9];
+ const uint16_t (*unshuffle)[9];
int smpls, freq, quant, sys, stride, difseg, ad, dp, nb_dif_segs, i;
- UINT16 lc, rc;
- UINT8 *buf_ptr;
+ uint16_t lc, rc;
+ uint8_t *buf_ptr;
/* parse id */
init_get_bits(&s->gb, &buf[AAUX_OFFSET], 5*8);
if (difseg >= nb_dif_segs/2)
goto out; /* We're not doing 4ch at this time */
- lc = ((UINT16)buf_ptr[dp] << 4) |
- ((UINT16)buf_ptr[dp+2] >> 4);
- rc = ((UINT16)buf_ptr[dp+1] << 4) |
- ((UINT16)buf_ptr[dp+2] & 0x0f);
+ lc = ((uint16_t)buf_ptr[dp] << 4) |
+ ((uint16_t)buf_ptr[dp+2] >> 4);
+ rc = ((uint16_t)buf_ptr[dp+1] << 4) |
+ ((uint16_t)buf_ptr[dp+2] & 0x0f);
lc = dv_audio_12to16(lc);
rc = dv_audio_12to16(rc);
#define NB_DV_VLC 409
#define AAUX_OFFSET (80*6 + 80*16*3 + 3)
-static const UINT16 dv_vlc_bits[409] = {
+static const uint16_t dv_vlc_bits[409] = {
0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a,
0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2,
0x0006,
};
-static const UINT8 dv_vlc_len[409] = {
+static const uint8_t dv_vlc_len[409] = {
2, 3, 4, 4, 4, 5, 5, 5,
5, 6, 6, 6, 6, 7, 7, 7,
7, 7, 7, 7, 7, 8, 8, 8,
4,
};
-static const UINT8 dv_vlc_run[409] = {
+static const uint8_t dv_vlc_run[409] = {
0, 0, 1, 0, 0, 2, 1, 0,
0, 3, 4, 0, 0, 5, 6, 2,
1, 1, 0, 0, 0, 7, 8, 9,
0,
};
-static const UINT8 dv_vlc_level[409] = {
+static const uint8_t dv_vlc_level[409] = {
1, 2, 1, 3, 4, 1, 2, 5,
6, 1, 1, 7, 8, 1, 1, 2,
3, 4, 9, 10, 11, 1, 1, 1,
/* Specific zigzag scan for 248 idct. NOTE that unlike the
specification, we interleave the fields */
-static const UINT8 dv_248_zigzag[64] = {
+static const uint8_t dv_248_zigzag[64] = {
0, 8, 1, 9, 16, 24, 2, 10,
17, 25, 32, 40, 48, 56, 33, 41,
18, 26, 3, 11, 4, 12, 19, 27,
};
/* unquant tables (not used directly) */
-static const UINT8 dv_88_areas[64] = {
+static const uint8_t dv_88_areas[64] = {
0,0,0,1,1,1,2,2,
0,0,1,1,1,2,2,2,
0,1,1,1,2,2,2,3,
2,2,3,3,3,3,3,3,
};
-static const UINT8 dv_248_areas[64] = {
+static const uint8_t dv_248_areas[64] = {
0,0,1,1,1,2,2,3,
0,0,1,1,2,2,2,3,
0,1,1,2,2,2,3,3,
1,2,2,3,3,3,3,3,
};
-static UINT8 dv_quant_shifts[22][4] = {
+static uint8_t dv_quant_shifts[22][4] = {
{ 3,3,4,4 },
{ 3,3,4,4 },
{ 2,3,3,4 },
{ 0,0,0,0 },
};
-static const UINT8 dv_quant_offset[4] = { 6, 3, 0, 1 };
+static const uint8_t dv_quant_offset[4] = { 6, 3, 0, 1 };
/* NOTE: I prefer hardcoding the positionning of dv blocks, it is
simpler :-) */
-static const UINT16 dv_place_420[1620] = {
+static const uint16_t dv_place_420[1620] = {
0x0c24, 0x2412, 0x3036, 0x0000, 0x1848,
0x0e24, 0x2612, 0x3236, 0x0200, 0x1a48,
0x1024, 0x2812, 0x3436, 0x0400, 0x1c48,
0x0a34, 0x2222, 0x2e46, 0x4610, 0x1658,
};
-static const UINT16 dv_place_411[1350] = {
+static const uint16_t dv_place_411[1350] = {
0x0c24, 0x2710, 0x3334, 0x0000, 0x1848,
0x0d24, 0x2810, 0x3434, 0x0100, 0x1948,
0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48,
0x0834, 0x2320, 0x2f44, 0x3810, 0x1658,
};
-static const UINT16 dv_place_audio60[10][9] = {
+static const uint16_t dv_place_audio60[10][9] = {
{ 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
{ 6, 36, 66, 26, 56, 86, 16, 46, 76 },
{ 12, 42, 72, 2, 32, 62, 22, 52, 82 },
{ 25, 55, 85, 15, 45, 75, 5, 35, 65 },
};
-static const UINT16 dv_place_audio50[12][9] = {
+static const uint16_t dv_place_audio50[12][9] = {
{ 0, 36, 72, 26, 62, 98, 16, 52, 88}, /* 1st channel */
{ 6, 42, 78, 32, 68, 104, 22, 58, 94},
{ 12, 48, 84, 2, 38, 74, 28, 64, 100},
}
}
-static void filter181(INT16 *data, int width, int height, int stride){
+static void filter181(int16_t *data, int width, int height, int stride){
int x,y;
/* horizontal filter */
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
-static void guess_dc(MpegEncContext *s, INT16 *dc, int w, int h, int stride, int is_luma){
+static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma){
int b_x, b_y;
for(b_y=0; b_y<h; b_y++){
int color[4]={1024,1024,1024,1024};
int distance[4]={9999,9999,9999,9999};
int mb_index, error, j;
- INT64 guess, weight_sum;
+ int64_t guess, weight_sum;
mb_index= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_width;
weight_sum=0;
guess=0;
for(j=0; j<4; j++){
- INT64 weight= 256*256*256*16/distance[j];
- guess+= weight*(INT64)color[j];
+ int64_t weight= 256*256*256*16/distance[j];
+ guess+= weight*(int64_t)color[j];
weight_sum+= weight;
}
guess= (guess + weight_sum/2) / weight_sum;
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
-static void h_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stride, int is_luma){
+static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
int b_x, b_y;
- UINT8 *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
for(b_y=0; b_y<h; b_y++){
for(b_x=0; b_x<w-1; b_x++){
int left_damage = left_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int right_damage= right_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int offset= b_x*8 + b_y*stride*8;
- INT16 *left_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ( b_x <<(1-is_luma))];
- INT16 *right_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ((b_x+1)<<(1-is_luma))];
+ int16_t *left_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ( b_x <<(1-is_luma))];
+ int16_t *right_mv= s->motion_val[s->block_wrap[0]*((b_y<<(1-is_luma)) + 1) + ((b_x+1)<<(1-is_luma))];
if(!(left_damage||right_damage)) continue; // both undamaged
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
-static void v_block_filter(MpegEncContext *s, UINT8 *dst, int w, int h, int stride, int is_luma){
+static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
int b_x, b_y;
- UINT8 *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
for(b_y=0; b_y<h-1; b_y++){
for(b_x=0; b_x<w; b_x++){
int top_damage = top_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int bottom_damage= bottom_status&(DC_ERROR|AC_ERROR|MV_ERROR);
int offset= b_x*8 + b_y*stride*8;
- INT16 *top_mv= s->motion_val[s->block_wrap[0]*(( b_y <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
- INT16 *bottom_mv= s->motion_val[s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
+ int16_t *top_mv= s->motion_val[s->block_wrap[0]*(( b_y <<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
+ int16_t *bottom_mv= s->motion_val[s->block_wrap[0]*(((b_y+1)<<(1-is_luma)) + 1) + (b_x<<(1-is_luma))];
if(!(top_damage||bottom_damage)) continue; // both undamaged
}
static void guess_mv(MpegEncContext *s){
- UINT8 fixed[s->mb_num];
+ uint8_t fixed[s->mb_num];
#define MV_FROZEN 3
#define MV_CHANGED 2
#define MV_UNCHANGED 1
s->mb_y= mb_y;
for(j=0; j<pred_count; j++){
int score=0;
- UINT8 *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
+ uint8_t *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
s->motion_val[mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0];
s->motion_val[mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1];
if((j%skip_amount) != 0) continue; //skip a few to speed things up
if(s->pict_type==I_TYPE){
- UINT8 *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
- UINT8 *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
+ uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
+ uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
is_intra_likely += s->dsp.pix_abs16x16(last_mb_ptr, mb_ptr , s->linesize);
is_intra_likely -= s->dsp.pix_abs16x16(last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize);
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
int dc, dcu, dcv, y, n;
- INT16 *dc_ptr;
- UINT8 *dest_y, *dest_cb, *dest_cr;
+ int16_t *dc_ptr;
+ uint8_t *dest_y, *dest_cb, *dest_cr;
i++;
error= s->error_status_table[i];
i= -1;
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
- UINT8 *dest_y, *dest_cb, *dest_cr;
+ uint8_t *dest_y, *dest_cb, *dest_cr;
i++;
error= s->error_status_table[i];
return (float)((random() & 0xffff) - 32768) / 32768.0;
}
-INT64 gettime(void)
+int64_t gettime(void)
{
struct timeval tv;
gettimeofday(&tv,NULL);
- return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
+ return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}
void check_diff(float *tab1, float *tab2, int n)
/* do a speed test */
if (do_speed) {
- INT64 time_start, duration;
+ int64_t time_start, duration;
int nb_its;
printf("Speed test...\n");
static void h263_encode_motion(MpegEncContext * s, int val, int fcode);
static void h263p_encode_umotion(MpegEncContext * s, int val);
static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block,
- int n, int dc, UINT8 *scan_table,
+ int n, int dc, uint8_t *scan_table,
PutBitContext *dc_pb, PutBitContext *ac_pb);
#endif
static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int n, int coded, int intra);
-static int h263_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr);
+static int h263_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr);
static void mpeg4_inv_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
int dir);
static void mpeg4_decode_sprite_trajectory(MpegEncContext * s);
-static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr, int *dir_ptr);
+static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr, int *dir_ptr);
-extern UINT32 inverse[256];
+extern uint32_t inverse[256];
-static UINT8 uni_DCtab_lum_len[512];
-static UINT8 uni_DCtab_chrom_len[512];
-static UINT16 uni_DCtab_lum_bits[512];
-static UINT16 uni_DCtab_chrom_bits[512];
+static uint8_t uni_DCtab_lum_len[512];
+static uint8_t uni_DCtab_chrom_len[512];
+static uint16_t uni_DCtab_lum_bits[512];
+static uint16_t uni_DCtab_chrom_bits[512];
#ifdef CONFIG_ENCODERS
-static UINT16 (*mv_penalty)[MAX_MV*2+1]= NULL;
-static UINT8 fcode_tab[MAX_MV*2+1];
-static UINT8 umv_fcode_tab[MAX_MV*2+1];
+static uint16_t (*mv_penalty)[MAX_MV*2+1]= NULL;
+static uint8_t fcode_tab[MAX_MV*2+1];
+static uint8_t umv_fcode_tab[MAX_MV*2+1];
static uint32_t uni_mpeg4_intra_rl_bits[64*64*2*2];
static uint8_t uni_mpeg4_intra_rl_len [64*64*2*2];
s->gob_number = 0;
put_bits(&s->pb, 22, 0x20); /* PSC */
- put_bits(&s->pb, 8, (((INT64)s->picture_number * 30 * FRAME_RATE_BASE) /
+ put_bits(&s->pb, 8, (((int64_t)s->picture_number * 30 * FRAME_RATE_BASE) /
s->frame_rate) & 0xff);
put_bits(&s->pb, 1, 1); /* marker */
int8_t * const qscale_table= s->current_picture.qscale_table;
for(n=0; n<6; n++){
- INT16 *ac_val, *ac_val1;
+ int16_t *ac_val, *ac_val1;
ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
ac_val1= ac_val;
int dc_diff[6]; //dc values with the dc prediction subtracted
int dir[6]; //prediction direction
int zigzag_last_index[6];
- UINT8 *scan_table[6];
+ uint8_t *scan_table[6];
int i;
for(i=0; i<6; i++){
const int level= block[i][0];
- UINT16 *dc_ptr;
+ uint16_t *dc_ptr;
dc_diff[i]= level - ff_mpeg4_pred_dc(s, i, &dc_ptr, &dir[i]);
if (i < 4) {
if(s->ac_pred){
for(i=0; i<6; i++){
- UINT8 *st;
+ uint8_t *st;
int last_index;
mpeg4_inv_pred_ac(s, block[i], i, dir[i]);
if(s->ac_pred){
for(i=0; i<6; i++){
int j;
- INT16 *ac_val;
+ int16_t *ac_val;
ac_val = s->ac_val[0][0] + s->block_index[i] * 16;
int motion_x, int motion_y)
{
int cbpc, cbpy, i, cbp, pred_x, pred_y;
- INT16 pred_dc;
- INT16 rec_intradc[6];
- UINT16 *dc_ptr[6];
+ int16_t pred_dc;
+ int16_t rec_intradc[6];
+ uint16_t *dc_ptr[6];
const int dquant_code[5]= {1,0,9,2,3};
//printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
for(i=0; i<6; i++) {
/* Predict DC */
if (s->h263_aic && s->mb_intra) {
- INT16 level = block[i][0];
+ int16_t level = block[i][0];
pred_dc = h263_pred_dc(s, i, &dc_ptr[i]);
level -= pred_dc;
}
#endif
-static int h263_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr)
+static int h263_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr)
{
int x, y, wrap, a, c, pred_dc, scale;
- INT16 *dc_val, *ac_val;
+ int16_t *dc_val, *ac_val;
/* find prediction */
if (n < 4) {
static void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
{
int x, y, wrap, a, c, pred_dc, scale, i;
- INT16 *dc_val, *ac_val, *ac_val1;
+ int16_t *dc_val, *ac_val, *ac_val1;
/* find prediction */
if (n < 4) {
ac_val1[8 + i] = block[s->idct_permutation[i ]];
}
-INT16 *h263_pred_motion(MpegEncContext * s, int block,
+int16_t *h263_pred_motion(MpegEncContext * s, int block,
int *px, int *py)
{
int xy, wrap;
- INT16 *A, *B, *C, *mot_val;
+ int16_t *A, *B, *C, *mot_val;
static const int off[4]= {2, 1, 1, -1};
wrap = s->block_wrap[0];
int mv;
if(mv_penalty==NULL)
- mv_penalty= av_mallocz( sizeof(UINT16)*(MAX_FCODE+1)*(2*MAX_MV+1) );
+ mv_penalty= av_mallocz( sizeof(uint16_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
for(f_code=1; f_code<=MAX_FCODE; f_code++){
for(mv=-MAX_MV; mv<=MAX_MV; mv++){
}
#ifdef CONFIG_ENCODERS
-static void init_uni_mpeg4_rl_tab(RLTable *rl, UINT32 *bits_tab, UINT8 *len_tab){
+static void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){
int slevel, run, last;
assert(MAX_LEVEL >= 64);
if(s->current_picture.pts)
s->time= (s->current_picture.pts*s->time_increment_resolution + 500*1000)/(1000*1000);
else
- s->time= picture_number*(INT64)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate;
+ s->time= picture_number*(int64_t)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate;
time_div= s->time/s->time_increment_resolution;
time_mod= s->time%s->time_increment_resolution;
* @param dir_ptr pointer to an integer where the prediction direction will be stored
* @return the quantized predicted dc
*/
-static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr, int *dir_ptr)
+static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr, int *dir_ptr)
{
int a, b, c, wrap, pred, scale;
- UINT16 *dc_val;
+ uint16_t *dc_val;
int dummy;
/* find prediction */
int dir)
{
int i;
- INT16 *ac_val, *ac_val1;
+ int16_t *ac_val, *ac_val1;
int8_t * const qscale_table= s->current_picture.qscale_table;
/* find prediction */
int dir)
{
int i;
- INT16 *ac_val;
+ int16_t *ac_val;
int8_t * const qscale_table= s->current_picture.qscale_table;
/* find prediction */
* @param n block index (0-3 are luma, 4-5 are chroma)
*/
static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
- UINT8 *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
+ uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
{
int i, last_non_zero;
#if 0 //variables for the outcommented version
int code, sign, last;
#endif
const RLTable *rl;
- UINT32 *bits_tab;
- UINT8 *len_tab;
+ uint32_t *bits_tab;
+ uint8_t *len_tab;
const int last_index = s->block_last_index[n];
if (s->mb_intra) { //Note gcc (3.2.1 at least) will optimize this away
}
static inline int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
- UINT8 *scan_table)
+ uint8_t *scan_table)
{
int i, last_non_zero;
const RLTable *rl;
- UINT8 *len_tab;
+ uint8_t *len_tab;
const int last_index = s->block_last_index[n];
int len=0;
#endif
/* clean AC */
- memset(s->ac_val[0] + l_xy, 0, (l_wrap*2+1)*16*sizeof(INT16));
- memset(s->ac_val[1] + c_xy, 0, (c_wrap +1)*16*sizeof(INT16));
- memset(s->ac_val[2] + c_xy, 0, (c_wrap +1)*16*sizeof(INT16));
+ memset(s->ac_val[0] + l_xy, 0, (l_wrap*2+1)*16*sizeof(int16_t));
+ memset(s->ac_val[1] + c_xy, 0, (c_wrap +1)*16*sizeof(int16_t));
+ memset(s->ac_val[2] + c_xy, 0, (c_wrap +1)*16*sizeof(int16_t));
/* clean MV */
// we cant clear the MVs as they might be needed by a b frame
-// memset(s->motion_val + l_xy, 0, (l_wrap*2+1)*2*sizeof(INT16));
-// memset(s->motion_val, 0, 2*sizeof(INT16)*(2 + s->mb_width*2)*(2 + s->mb_height*2));
+// memset(s->motion_val + l_xy, 0, (l_wrap*2+1)*2*sizeof(int16_t));
+// memset(s->motion_val, 0, 2*sizeof(int16_t)*(2 + s->mb_width*2)*(2 + s->mb_height*2));
s->last_mv[0][0][0]=
s->last_mv[0][0][1]=
s->last_mv[1][0][0]=
*/
static int mpeg4_decode_partition_a(MpegEncContext *s){
int mb_num;
- static const INT8 quant_tab[4] = { -1, -2, 1, 2 };
+ static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
/* decode first partition */
mb_num=0;
s->error_status_table[xy]= AC_ERROR;
}else{ /* P/S_TYPE */
int mx, my, pred_x, pred_y, bits;
- INT16 * const mot_val= s->motion_val[s->block_index[0]];
+ int16_t * const mot_val= s->motion_val[s->block_index[0]];
const int stride= s->block_wrap[0]*2;
bits= show_bits(&s->gb, 17);
PRINT_MB_TYPE("4");
s->mb_type[xy]= MB_TYPE_INTER4V;
for(i=0;i<4;i++) {
- INT16 *mot_val= h263_pred_motion(s, i, &pred_x, &pred_y);
+ int16_t *mot_val= h263_pred_motion(s, i, &pred_x, &pred_y);
mx = h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
*/
static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
int mb_num=0;
- static const INT8 quant_tab[4] = { -1, -2, 1, 2 };
+ static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
s->mb_x= s->resync_mb_x;
s->first_slice_line=1;
DCTELEM block[6][64])
{
int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
- INT16 *mot_val;
- static INT8 quant_tab[4] = { -1, -2, 1, 2 };
+ int16_t *mot_val;
+ static int8_t quant_tab[4] = { -1, -2, 1, 2 };
s->error_status_table[s->mb_x + s->mb_y*s->mb_width]= 0;
int modb1; // first bit of modb
int modb2; // second bit of modb
int mb_type;
- int xy;
s->mb_intra = 0; //B-frames never contain intra blocks
s->mcsel=0; // ... true gmc blocks
{
int code, level, i, j, last, run;
RLTable *rl = &rl_inter;
- const UINT8 *scan_table;
+ const uint8_t *scan_table;
scan_table = s->intra_scantable.permutated;
if (s->h263_aic && s->mb_intra) {
/* escape */
last = get_bits1(&s->gb);
run = get_bits(&s->gb, 6);
- level = (INT8)get_bits(&s->gb, 8);
+ level = (int8_t)get_bits(&s->gb, 8);
if (s->h263_rv10 && level == -128) {
/* XXX: should patch encoder too */
level = get_bits(&s->gb, 12);
static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
{
int level, pred, code;
- UINT16 *dc_val;
+ uint16_t *dc_val;
if (n < 4)
code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1);
int dc_pred_dir;
RLTable * rl;
RL_VLC_ELEM * rl_vlc;
- const UINT8 * scan_table;
+ const uint8_t * scan_table;
int qmul, qadd;
if(intra) {
/* intra MCBPC, mb_type = (intra), then (intraq) */
-const UINT8 intra_MCBPC_code[8] = { 1, 1, 2, 3, 1, 1, 2, 3 };
-const UINT8 intra_MCBPC_bits[8] = { 1, 3, 3, 3, 4, 6, 6, 6 };
+const uint8_t intra_MCBPC_code[8] = { 1, 1, 2, 3, 1, 1, 2, 3 };
+const uint8_t intra_MCBPC_bits[8] = { 1, 3, 3, 3, 4, 6, 6, 6 };
/* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */
/* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */
-const UINT8 inter_MCBPC_code[25] = {
+const uint8_t inter_MCBPC_code[25] = {
1, 3, 2, 5,
3, 4, 3, 3,
3, 7, 6, 5,
1, /* Stuffing */
2, 12, 14, 15,
};
-const UINT8 inter_MCBPC_bits[25] = {
+const uint8_t inter_MCBPC_bits[25] = {
1, 4, 4, 6,
5, 8, 8, 7,
3, 7, 7, 9,
};
/* This is the old table
-static const UINT8 inter_MCBPC_code[20] = {
+static const uint8_t inter_MCBPC_code[20] = {
1, 3, 2, 5,
3, 4, 3, 3,
0, 1, 2, 3,
4, 4, 3, 2,
2, 5, 4, 5,
};
-static const UINT8 inter_MCBPC_bits[20] = {
+static const uint8_t inter_MCBPC_bits[20] = {
1, 4, 4, 6,
5, 8, 8, 7,
12, 12, 12, 12,
3, 7, 7, 8,
};*/
-const UINT8 cbpy_tab[16][2] =
+const uint8_t cbpy_tab[16][2] =
{
{3,4}, {5,5}, {4,5}, {9,4}, {3,5}, {7,4}, {2,6}, {11,4},
{2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
};
-const UINT8 mvtab[33][2] =
+const uint8_t mvtab[33][2] =
{
{1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
{11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10},
};
/* third non intra table */
-const UINT16 inter_vlc[103][2] = {
+const uint16_t inter_vlc[103][2] = {
{ 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 },
{ 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 },
{ 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 },
{ 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 },
};
-const INT8 inter_level[102] = {
+const int8_t inter_level[102] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 1, 2, 3, 4,
5, 6, 1, 2, 3, 4, 1, 2,
1, 1, 1, 1, 1, 1,
};
-const INT8 inter_run[102] = {
+const int8_t inter_run[102] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 2, 2, 2, 2, 3, 3,
inter_level,
};
-const UINT16 intra_vlc_aic[103][2] = {
+const uint16_t intra_vlc_aic[103][2] = {
{ 0x2, 2 }, { 0x6, 3 }, { 0xe, 4 }, { 0xc, 5 },
{ 0xd, 5 }, { 0x10, 6 }, { 0x11, 6 }, { 0x12, 6 },
{ 0x16, 7 }, { 0x1b, 8 }, { 0x20, 9 }, { 0x21, 9 },
{ 0x59, 12 }, { 0x5a, 12 }, { 0x3, 7 },
};
-const INT8 intra_run_aic[102] = {
+const int8_t intra_run_aic[102] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
18, 19, 20, 21, 22, 23,
};
-const INT8 intra_level_aic[102] = {
+const int8_t intra_level_aic[102] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24,
intra_level_aic,
};
-static const UINT16 h263_format[8][2] = {
+static const uint16_t h263_format[8][2] = {
{ 0, 0 },
{ 128, 96 },
{ 176, 144 },
{ 1408, 1152 },
};
-static UINT8 h263_aic_dc_scale_table[32]={
+static uint8_t h263_aic_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
};
* finds the end of the current frame in the bitstream.
* @return the position of the first byte of the next frame, or -1
*/
-static int mpeg4_find_frame_end(MpegEncContext *s, UINT8 *buf, int buf_size){
+static int mpeg4_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){
ParseContext *pc= &s->parse_context;
int vop_found, i;
uint32_t state;
int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
int ret,i;
#endif
if(s->error_resilience)
- memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_num*sizeof(UINT8));
+ memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_num*sizeof(uint8_t));
/* decode each macroblock */
s->block_wrap[0]=
static void draw_slice(HYuvContext *s, int y){
int h, cy;
- UINT8 *src_ptr[3];
+ uint8_t *src_ptr[3];
if(s->avctx->draw_horiz_band==NULL)
return;
/***********************************/
/* standard MMX */
-static void get_pixels_mmx(DCTELEM *block, const UINT8 *pixels, int line_size)
+static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size)
{
asm volatile(
"movl $-128, %%eax \n\t"
);
}
-static inline void diff_pixels_mmx(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride)
+static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride)
{
asm volatile(
"pxor %%mm7, %%mm7 \n\t"
);
}
-void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
+void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
{
const DCTELEM *p;
- UINT8 *pix;
+ uint8_t *pix;
/* read the pixels */
p = block;
:"memory");
}
-void add_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size)
+void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
{
const DCTELEM *p;
- UINT8 *pix;
+ uint8_t *pix;
int i;
/* read the pixels */
} while (--i);
}
-static void put_pixels8_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
);
}
-static void put_pixels16_mmx(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
);
}
-static int pix_sum16_mmx(UINT8 * pix, int line_size){
+static int pix_sum16_mmx(uint8_t * pix, int line_size){
const int h=16;
int sum;
int index= -line_size*h;
return tmp;
}
-static int sse16_mmx(void *v, UINT8 * pix1, UINT8 * pix2, int line_size) {
+static int sse16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size) {
int tmp;
asm volatile (
"movl $16,%%ecx\n"
);\
}\
\
-static void OPNAME ## qpel8_mc00_ ## MMX (UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## pixels8_mmx(dst, src, stride, 8);\
}\
\
-static void OPNAME ## qpel8_mc10_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[8];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\
OPNAME ## pixels8_l2_mmx(dst, src, half, stride, stride, 8);\
}\
\
-static void OPNAME ## qpel8_mc20_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## mpeg4_qpel8_h_lowpass_ ## MMX(dst, src, stride, stride, 8);\
}\
\
-static void OPNAME ## qpel8_mc30_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[8];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(half, src, 8, stride, 8);\
OPNAME ## pixels8_l2_mmx(dst, src+1, half, stride, stride, 8);\
}\
\
-static void OPNAME ## qpel8_mc01_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[8];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\
OPNAME ## pixels8_l2_mmx(dst, src, half, stride, stride, 8);\
}\
\
-static void OPNAME ## qpel8_mc02_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, src, stride, stride);\
}\
\
-static void OPNAME ## qpel8_mc03_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[8];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(half, src, 8, stride);\
OPNAME ## pixels8_l2_mmx(dst, src+stride, half, stride, stride, 8);\
}\
-static void OPNAME ## qpel8_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half) + 64;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2_mmx(dst, halfH, halfHV, stride, 8, 8);\
}\
-static void OPNAME ## qpel8_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half) + 64;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2_mmx(dst, halfH, halfHV, stride, 8, 8);\
}\
-static void OPNAME ## qpel8_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half) + 64;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2_mmx(dst, halfH+8, halfHV, stride, 8, 8);\
}\
-static void OPNAME ## qpel8_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half) + 64;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2_mmx(dst, halfH+8, halfHV, stride, 8, 8);\
}\
-static void OPNAME ## qpel8_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half) + 64;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2_mmx(dst, halfH, halfHV, stride, 8, 8);\
}\
-static void OPNAME ## qpel8_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half) + 64;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_v_lowpass_ ## MMX(halfHV, halfH, 8, 8);\
OPNAME ## pixels8_l2_mmx(dst, halfH+8, halfHV, stride, 8, 8);\
}\
-static void OPNAME ## qpel8_mc12_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
put ## RND ## pixels8_l2_mmx(halfH, src, halfH, 8, stride, 9);\
OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
}\
-static void OPNAME ## qpel8_mc32_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[8 + 9];\
uint8_t * const halfH= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
put ## RND ## pixels8_l2_mmx(halfH, src+1, halfH, 8, stride, 9);\
OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
}\
-static void OPNAME ## qpel8_mc22_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel8_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[9];\
uint8_t * const halfH= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel8_h_lowpass_ ## MMX(halfH, src, 8, stride, 9);\
OPNAME ## mpeg4_qpel8_v_lowpass_ ## MMX(dst, halfH, stride, 8);\
}\
-static void OPNAME ## qpel16_mc00_ ## MMX (UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## pixels16_mmx(dst, src, stride, 16);\
}\
\
-static void OPNAME ## qpel16_mc10_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[32];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\
OPNAME ## pixels16_l2_mmx(dst, src, half, stride, stride, 16);\
}\
\
-static void OPNAME ## qpel16_mc20_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## mpeg4_qpel16_h_lowpass_ ## MMX(dst, src, stride, stride, 16);\
}\
\
-static void OPNAME ## qpel16_mc30_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[32];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(half, src, 16, stride, 16);\
OPNAME ## pixels16_l2_mmx(dst, src+1, half, stride, stride, 16);\
}\
\
-static void OPNAME ## qpel16_mc01_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[32];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\
OPNAME ## pixels16_l2_mmx(dst, src, half, stride, stride, 16);\
}\
\
-static void OPNAME ## qpel16_mc02_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, src, stride, stride);\
}\
\
-static void OPNAME ## qpel16_mc03_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t temp[32];\
uint8_t * const half= (uint8_t*)temp;\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(half, src, 16, stride);\
OPNAME ## pixels16_l2_mmx(dst, src+stride, half, stride, stride, 16);\
}\
-static void OPNAME ## qpel16_mc11_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[16*2 + 17*2];\
uint8_t * const halfH= ((uint8_t*)half) + 256;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2_mmx(dst, halfH, halfHV, stride, 16, 16);\
}\
-static void OPNAME ## qpel16_mc31_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[16*2 + 17*2];\
uint8_t * const halfH= ((uint8_t*)half) + 256;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2_mmx(dst, halfH, halfHV, stride, 16, 16);\
}\
-static void OPNAME ## qpel16_mc13_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[16*2 + 17*2];\
uint8_t * const halfH= ((uint8_t*)half) + 256;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2_mmx(dst, halfH+16, halfHV, stride, 16, 16);\
}\
-static void OPNAME ## qpel16_mc33_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[16*2 + 17*2];\
uint8_t * const halfH= ((uint8_t*)half) + 256;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2_mmx(dst, halfH+16, halfHV, stride, 16, 16);\
}\
-static void OPNAME ## qpel16_mc21_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[16*2 + 17*2];\
uint8_t * const halfH= ((uint8_t*)half) + 256;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2_mmx(dst, halfH, halfHV, stride, 16, 16);\
}\
-static void OPNAME ## qpel16_mc23_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[16*2 + 17*2];\
uint8_t * const halfH= ((uint8_t*)half) + 256;\
uint8_t * const halfHV= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_v_lowpass_ ## MMX(halfHV, halfH, 16, 16);\
OPNAME ## pixels16_l2_mmx(dst, halfH+16, halfHV, stride, 16, 16);\
}\
-static void OPNAME ## qpel16_mc12_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[17*2];\
uint8_t * const halfH= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
put ## RND ## pixels16_l2_mmx(halfH, src, halfH, 16, stride, 17);\
OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
}\
-static void OPNAME ## qpel16_mc32_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[17*2];\
uint8_t * const halfH= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
put ## RND ## pixels16_l2_mmx(halfH, src+1, halfH, 16, stride, 17);\
OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
}\
-static void OPNAME ## qpel16_mc22_ ## MMX(UINT8 *dst, UINT8 *src, int stride){\
+static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
uint64_t half[17*2];\
uint8_t * const halfH= ((uint8_t*)half);\
put ## RND ## mpeg4_qpel16_h_lowpass_ ## MMX(halfH, src, 16, stride, 17);\
/* XXX: we use explicit registers to avoid a gcc 2.95.2 register asm
clobber bug - now it will work with 2.95.2 and also with -fPIC
*/
-static void DEF(put_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
:"memory");
}
-static void DEF(put_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
}
/* GL: this function does incorrect rounding if overflow */
-static void DEF(put_no_rnd_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put_no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BONE(mm6);
__asm __volatile(
:"%eax", "memory");
}
-static void DEF(put_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
}
/* GL: this function does incorrect rounding if overflow */
-static void DEF(put_no_rnd_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put_no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BONE(mm6);
__asm __volatile(
:"%eax", "memory");
}
-static void DEF(avg_pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg_pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
:"%eax", "memory");
}
-static void DEF(avg_pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
:"%eax", "memory");
}
-static void DEF(avg_pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
__asm __volatile(
"lea (%3, %3), %%eax \n\t"
}
// Note this is not correctly rounded, but this function is only used for b frames so it doesnt matter
-static void DEF(avg_pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BONE(mm6);
__asm __volatile(
}
//FIXME the following could be optimized too ...
-static void DEF(put_no_rnd_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put_no_rnd_pixels8_x2)(block , pixels , line_size, h);
DEF(put_no_rnd_pixels8_x2)(block+8, pixels+8, line_size, h);
}
-static void DEF(put_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(put_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put_pixels8_y2)(block , pixels , line_size, h);
DEF(put_pixels8_y2)(block+8, pixels+8, line_size, h);
}
-static void DEF(put_no_rnd_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(put_no_rnd_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put_no_rnd_pixels8_y2)(block , pixels , line_size, h);
DEF(put_no_rnd_pixels8_y2)(block+8, pixels+8, line_size, h);
}
-static void DEF(avg_pixels16)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(avg_pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8)(block , pixels , line_size, h);
DEF(avg_pixels8)(block+8, pixels+8, line_size, h);
}
-static void DEF(avg_pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(avg_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8_x2)(block , pixels , line_size, h);
DEF(avg_pixels8_x2)(block+8, pixels+8, line_size, h);
}
-static void DEF(avg_pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(avg_pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8_y2)(block , pixels , line_size, h);
DEF(avg_pixels8_y2)(block+8, pixels+8, line_size, h);
}
-static void DEF(avg_pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg_pixels8_xy2)(block , pixels , line_size, h);
DEF(avg_pixels8_xy2)(block+8, pixels+8, line_size, h);
}
*/
// put_pixels
-static void DEF(put, pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
:"memory");
}
-static void DEF(put, pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
:"memory");
}
-static void DEF(put, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
:"eax", "memory");
}
-static void DEF(put, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_ZERO(mm7);
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
// avg_pixels
// in case more speed is needed - unroling would certainly help
-static void DEF(avg, pixels8)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
while (--h);
}
-static void DEF(avg, pixels16)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
while (--h);
}
-static void DEF(avg, pixels8_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
} while (--h);
}
-static void DEF(avg, pixels16_x2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
JUMPALIGN();
} while (--h);
}
-static void DEF(avg, pixels8_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BFE(mm6);
__asm __volatile(
}
// this routine is 'slightly' suboptimal but mostly unused
-static void DEF(avg, pixels8_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h)
+static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_ZERO(mm7);
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
}
//FIXME optimize
-static void DEF(put, pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(put, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put, pixels8_y2)(block , pixels , line_size, h);
DEF(put, pixels8_y2)(block+8, pixels+8, line_size, h);
}
-static void DEF(put, pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(put, pixels8_xy2)(block , pixels , line_size, h);
DEF(put, pixels8_xy2)(block+8, pixels+8, line_size, h);
}
-static void DEF(avg, pixels16_y2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(avg, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg, pixels8_y2)(block , pixels , line_size, h);
DEF(avg, pixels8_y2)(block+8, pixels+8, line_size, h);
}
-static void DEF(avg, pixels16_xy2)(UINT8 *block, const UINT8 *pixels, int line_size, int h){
+static void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){
DEF(avg, pixels8_xy2)(block , pixels , line_size, h);
DEF(avg, pixels8_xy2)(block+8, pixels+8, line_size, h);
}
void dsputil_init_pix_mmx(DSPContext* c, unsigned mask);
void dsputil_set_bit_exact_pix_mmx(DSPContext* c, unsigned mask);
-static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={
+static const __attribute__ ((aligned(8))) uint64_t round_tab[3]={
0x0000000000000000,
0x0001000100010001,
0x0002000200020002,
static __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL;
-static inline void sad8_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
+static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
);
}
-static inline void sad8_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
+static inline void sad8_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
);
}
-static inline void sad8_2_mmx2(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
+static inline void sad8_2_mmx2(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
);
}
-static inline void sad8_4_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
+static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{ //FIXME reuse src
int len= -(stride<<h);
asm volatile(
);
}
-static inline void sad8_2_mmx(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
+static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
);
}
-static inline void sad8_4_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
+static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
int len= -(stride<<h);
asm volatile(
#define PIX_SAD(suf)\
-static int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs8x8_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
\
return sum_ ## suf();\
}\
-static int sad8x8_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
+static int sad8x8_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
return sum_ ## suf();\
}\
\
-static int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs8x8_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
return sum_ ## suf();\
}\
\
-static int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs8x8_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
return sum_ ## suf();\
}\
\
-static int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs8x8_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
return sum_ ## suf();\
}\
\
-static int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs16x16_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
\
return sum_ ## suf();\
}\
-static int sad16x16_ ## suf(void *s, UINT8 *blk2, UINT8 *blk1, int stride)\
+static int sad16x16_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t":);\
\
return sum_ ## suf();\
}\
-static int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs16x16_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
\
return sum_ ## suf();\
}\
-static int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs16x16_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
\
return sum_ ## suf();\
}\
-static int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
+static int pix_abs16x16_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
{\
asm volatile("pxor %%mm7, %%mm7 \n\t"\
"pxor %%mm6, %%mm6 \n\t"\
#include "../avcodec.h"
#include "../simple_idct.h"
-extern UINT8 zigzag_direct_noperm[64];
-extern UINT16 inv_zigzag_direct16[64];
-extern UINT32 inverse[256];
+extern uint8_t zigzag_direct_noperm[64];
+extern uint16_t inv_zigzag_direct16[64];
+extern uint32_t inverse[256];
static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL;
static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
DCTELEM *block, int n, int qscale)
{
int nCoeffs;
- const UINT16 *quant_matrix;
+ const uint16_t *quant_matrix;
assert(s->block_last_index[n]>=0);
DCTELEM *block, int n, int qscale)
{
int nCoeffs;
- const UINT16 *quant_matrix;
+ const uint16_t *quant_matrix;
assert(s->block_last_index[n]>=0);
/* draw the edges of width 'w' of an image of size width, height
this mmx version can only handle w==8 || w==16 */
-static void draw_edges_mmx(UINT8 *buf, int wrap, int width, int height, int w)
+static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, int w)
{
- UINT8 *ptr, *last_line;
+ uint8_t *ptr, *last_line;
int i;
last_line = buf + (height - 1) * wrap;
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
-static void ff_libmpeg2mmx_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
+static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmx_idct (block);
put_pixels_clamped_mmx(block, dest, line_size);
}
-static void ff_libmpeg2mmx_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
+static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmx_idct (block);
add_pixels_clamped_mmx(block, dest, line_size);
}
-static void ff_libmpeg2mmx2_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
+static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmxext_idct (block);
put_pixels_clamped_mmx(block, dest, line_size);
}
-static void ff_libmpeg2mmx2_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
+static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_mmxext_idct (block);
add_pixels_clamped_mmx(block, dest, line_size);
int qscale, int *overflow)
{
int level=0, last_non_zero_p1, q; //=0 is cuz gcc says uninitalized ...
- const UINT16 *qmat, *bias;
- static __align8 INT16 temp_block[64];
+ const uint16_t *qmat, *bias;
+ static __align8 int16_t temp_block[64];
//s->fdct (block);
ff_fdct_mmx (block); //cant be anything else ...
//FIXME merge add/put into the idct
-void ff_simple_idct_put_mmx(UINT8 *dest, int line_size, DCTELEM *block)
+void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block)
{
idct(block);
put_pixels_clamped_mmx(block, dest, line_size);
}
-void ff_simple_idct_add_mmx(UINT8 *dest, int line_size, DCTELEM *block)
+void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block)
{
idct(block);
add_pixels_clamped_mmx(block, dest, line_size);
typedef struct PixFmtInfo {
const char *name;
- UINT8 nb_components; /* number of components in AVPicture array */
- UINT8 is_yuv : 1; /* true if YUV instead of RGB color space */
- UINT8 is_packed : 1; /* true if multiple components in same word */
- UINT8 is_paletted : 1; /* true if paletted */
- UINT8 is_alpha : 1; /* true if alpha can be specified */
- UINT8 is_gray : 1; /* true if gray or monochrome format */
- UINT8 x_chroma_shift; /* X chroma subsampling factor is 2 ^ shift */
- UINT8 y_chroma_shift; /* Y chroma subsampling factor is 2 ^ shift */
+ uint8_t nb_components; /* number of components in AVPicture array */
+ uint8_t is_yuv : 1; /* true if YUV instead of RGB color space */
+ uint8_t is_packed : 1; /* true if multiple components in same word */
+ uint8_t is_paletted : 1; /* true if paletted */
+ uint8_t is_alpha : 1; /* true if alpha can be specified */
+ uint8_t is_gray : 1; /* true if gray or monochrome format */
+ uint8_t x_chroma_shift; /* X chroma subsampling factor is 2 ^ shift */
+ uint8_t y_chroma_shift; /* Y chroma subsampling factor is 2 ^ shift */
} PixFmtInfo;
/* this table gives more information about formats */
}
/* Picture field are filled with 'ptr' addresses. Also return size */
-int avpicture_fill(AVPicture *picture, UINT8 *ptr,
+int avpicture_fill(AVPicture *picture, uint8_t *ptr,
int pix_fmt, int width, int height)
{
int size, w2, h2, size2;
static void yuv422_to_yuv420p(AVPicture *dst, AVPicture *src,
int width, int height)
{
- UINT8 *lum, *cb, *cr;
+ uint8_t *lum, *cb, *cr;
int x, y;
- const UINT8 *p;
+ const uint8_t *p;
lum = dst->data[0];
cb = dst->data[1];
/* XXX: use generic filter ? */
/* 1x2 -> 1x1 */
-static void shrink2(UINT8 *dst, int dst_wrap,
- UINT8 *src, int src_wrap,
+static void shrink2(uint8_t *dst, int dst_wrap,
+ uint8_t *src, int src_wrap,
int width, int height)
{
int w;
- UINT8 *s1, *s2, *d;
+ uint8_t *s1, *s2, *d;
for(;height > 0; height--) {
s1 = src;
}
/* 2x2 -> 1x1 */
-static void shrink22(UINT8 *dst, int dst_wrap,
- UINT8 *src, int src_wrap,
+static void shrink22(uint8_t *dst, int dst_wrap,
+ uint8_t *src, int src_wrap,
int width, int height)
{
int w;
- UINT8 *s1, *s2, *d;
+ uint8_t *s1, *s2, *d;
for(;height > 0; height--) {
s1 = src;
}
/* 1x1 -> 2x2 */
-static void grow22(UINT8 *dst, int dst_wrap,
- UINT8 *src, int src_wrap,
+static void grow22(uint8_t *dst, int dst_wrap,
+ uint8_t *src, int src_wrap,
int width, int height)
{
int w;
- UINT8 *s1, *d;
+ uint8_t *s1, *d;
for(;height > 0; height--) {
s1 = src;
}
/* 1x2 -> 2x1 */
-static void conv411(UINT8 *dst, int dst_wrap,
- UINT8 *src, int src_wrap,
+static void conv411(uint8_t *dst, int dst_wrap,
+ uint8_t *src, int src_wrap,
int width, int height)
{
int w, c;
- UINT8 *s1, *s2, *d;
+ uint8_t *s1, *s2, *d;
for(;height > 0; height--) {
s1 = src;
}
}
-static void img_copy(UINT8 *dst, int dst_wrap,
- UINT8 *src, int src_wrap,
+static void img_copy(uint8_t *dst, int dst_wrap,
+ uint8_t *src, int src_wrap,
int width, int height)
{
for(;height > 0; height--) {
static void yuv420p_to_ ## rgb_name (AVPicture *dst, AVPicture *src, \
int width, int height) \
{ \
- UINT8 *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr, *d, *d1, *d2; \
+ uint8_t *y1_ptr, *y2_ptr, *cb_ptr, *cr_ptr, *d, *d1, *d2; \
int w, y, cb, cr, r_add, g_add, b_add, width2; \
- UINT8 *cm = cropTbl + MAX_NEG_CROP; \
+ uint8_t *cm = cropTbl + MAX_NEG_CROP; \
unsigned int r, g, b; \
\
d = dst->data[0]; \
static void yuv422p_to_ ## rgb_name (AVPicture *dst, AVPicture *src, \
int width, int height) \
{ \
- UINT8 *y1_ptr, *cb_ptr, *cr_ptr, *d, *d1; \
+ uint8_t *y1_ptr, *cb_ptr, *cr_ptr, *d, *d1; \
int w, y, cb, cr, r_add, g_add, b_add, width2; \
- UINT8 *cm = cropTbl + MAX_NEG_CROP; \
+ uint8_t *cm = cropTbl + MAX_NEG_CROP; \
unsigned int r, g, b; \
\
d = dst->data[0]; \
{ \
int wrap, wrap3, x, y; \
int r, g, b, r1, g1, b1; \
- UINT8 *lum, *cb, *cr; \
- const UINT8 *p; \
+ uint8_t *lum, *cb, *cr; \
+ const uint8_t *p; \
\
lum = dst->data[0]; \
cb = dst->data[1]; \
#define RGB_IN(r, g, b, s)\
{\
- unsigned int v = ((const UINT16 *)(s))[0];\
+ unsigned int v = ((const uint16_t *)(s))[0];\
r = bitcopy_n(v >> (10 - 3), 3);\
g = bitcopy_n(v >> (5 - 3), 3);\
b = bitcopy_n(v << 3, 3);\
#define RGB_OUT(d, r, g, b)\
{\
- ((UINT16 *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3) | 0x8000;\
+ ((uint16_t *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3) | 0x8000;\
}
#define BPP 2
#define RGB_IN(r, g, b, s)\
{\
- unsigned int v = ((const UINT16 *)(s))[0];\
+ unsigned int v = ((const uint16_t *)(s))[0];\
r = bitcopy_n(v >> (11 - 3), 3);\
g = bitcopy_n(v >> (5 - 2), 2);\
b = bitcopy_n(v << 3, 3);\
#define RGB_OUT(d, r, g, b)\
{\
- ((UINT16 *)(d))[0] = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);\
+ ((uint16_t *)(d))[0] = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);\
}
#define BPP 2
#define RGB_IN(r, g, b, s)\
{\
- unsigned int v = ((const UINT32 *)(s))[0];\
+ unsigned int v = ((const uint32_t *)(s))[0];\
r = (v >> 16) & 0xff;\
g = (v >> 8) & 0xff;\
b = v & 0xff;\
#define RGB_OUT(d, r, g, b)\
{\
- ((UINT32 *)(d))[0] = (0xff << 24) | (r << 16) | (g << 8) | b;\
+ ((uint32_t *)(d))[0] = (0xff << 24) | (r << 16) | (g << 8) | b;\
}
#define BPP 4
int width, int height, int xor_mask)
{
int n;
- const UINT8 *s;
- UINT8 *d;
+ const uint8_t *s;
+ uint8_t *d;
int j, b, v, n1, src_wrap, dst_wrap, y;
s = src->data[0];
}
/* this is maybe slow, but allows for extensions */
-static inline unsigned char gif_clut_index(UINT8 r, UINT8 g, UINT8 b)
+static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
{
return ((((r)/47)%6)*6*6+(((g)/47)%6)*6+(((b)/47)%6));
}
/* YUV to YUV */
if (dst_pix->is_yuv && src_pix->is_yuv) {
int x_shift, y_shift, w, h;
- void (*resize_func)(UINT8 *dst, int dst_wrap,
- UINT8 *src, int src_wrap,
+ void (*resize_func)(uint8_t *dst, int dst_wrap,
+ uint8_t *src, int src_wrap,
int width, int height);
/* compute chroma size of the smallest dimensions */
#endif
/* filter parameters: [-1 4 2 4 -1] // 8 */
-static void deinterlace_line(UINT8 *dst, UINT8 *lum_m4, UINT8 *lum_m3, UINT8 *lum_m2, UINT8 *lum_m1, UINT8 *lum,
+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,
int size)
{
#ifndef HAVE_MMX
- UINT8 *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
int sum;
for(;size > 0;size--) {
}
#endif
}
-static void deinterlace_line_inplace(UINT8 *lum_m4, UINT8 *lum_m3, UINT8 *lum_m2, UINT8 *lum_m1, UINT8 *lum,
+static void deinterlace_line_inplace(uint8_t *lum_m4, uint8_t *lum_m3, uint8_t *lum_m2, uint8_t *lum_m1, uint8_t *lum,
int size)
{
#ifndef HAVE_MMX
- UINT8 *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
int sum;
for(;size > 0;size--) {
/* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
top field is copied as is, but the bottom field is deinterlaced
against the top field. */
-static void deinterlace_bottom_field(UINT8 *dst, int dst_wrap,
- UINT8 *src1, int src_wrap,
+static void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
+ uint8_t *src1, int src_wrap,
int width, int height)
{
- UINT8 *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
+ uint8_t *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
int y;
src_m2 = src1;
deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width);
}
-static void deinterlace_bottom_field_inplace(UINT8 *src1, int src_wrap,
+static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
int width, int height)
{
- UINT8 *src_m1, *src_0, *src_p1, *src_p2;
+ uint8_t *src_m1, *src_0, *src_p1, *src_p2;
int y;
- UINT8 *buf;
- buf = (UINT8*)av_malloc(width);
+ uint8_t *buf;
+ buf = (uint8_t*)av_malloc(width);
src_m1 = src1;
memcpy(buf,src_m1,width);
struct ImgReSampleContext {
int iwidth, iheight, owidth, oheight, topBand, bottomBand, leftBand, rightBand;
int h_incr, v_incr;
- INT16 h_filters[NB_PHASES][NB_TAPS] __align8; /* horizontal filters */
- INT16 v_filters[NB_PHASES][NB_TAPS] __align8; /* vertical filters */
- UINT8 *line_buf;
+ int16_t h_filters[NB_PHASES][NB_TAPS] __align8; /* horizontal filters */
+ int16_t v_filters[NB_PHASES][NB_TAPS] __align8; /* vertical filters */
+ uint8_t *line_buf;
};
static inline int get_phase(int pos)
}
/* This function must be optimized */
-static void h_resample_fast(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
- int src_start, int src_incr, INT16 *filters)
+static void h_resample_fast(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
+ int src_start, int src_incr, int16_t *filters)
{
int src_pos, phase, sum, i;
- UINT8 *s;
- INT16 *filter;
+ uint8_t *s;
+ int16_t *filter;
src_pos = src_start;
for(i=0;i<dst_width;i++) {
}
/* This function must be optimized */
-static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
- INT16 *filter)
+static void v_resample(uint8_t *dst, int dst_width, uint8_t *src, int wrap,
+ int16_t *filter)
{
int sum, i;
- UINT8 *s;
+ uint8_t *s;
s = src;
for(i=0;i<dst_width;i++) {
#else
{
int j;
- UINT8 *s1 = s;
+ uint8_t *s1 = s;
sum = 0;
for(j=0;j<NB_TAPS;j++) {
#define DUMP(reg) movq_r2m(reg, tmp); printf(#reg "=%016Lx\n", tmp.uq);
/* XXX: do four pixels at a time */
-static void h_resample_fast4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
- int src_start, int src_incr, INT16 *filters)
+static void h_resample_fast4_mmx(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
+ int src_start, int src_incr, int16_t *filters)
{
int src_pos, phase;
- UINT8 *s;
- INT16 *filter;
+ uint8_t *s;
+ int16_t *filter;
mmx_t tmp;
src_pos = src_start;
emms();
}
-static void v_resample4_mmx(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
- INT16 *filter)
+static void v_resample4_mmx(uint8_t *dst, int dst_width, uint8_t *src, int wrap,
+ int16_t *filter)
{
int sum, i, v;
- UINT8 *s;
+ uint8_t *s;
mmx_t tmp;
mmx_t coefs[4];
packuswb_r2r(mm7, mm0);
movq_r2m(mm0, tmp);
- *(UINT32 *)dst = tmp.ud[0];
+ *(uint32_t *)dst = tmp.ud[0];
dst += 4;
s += 4;
dst_width -= 4;
signed short s[8];
} vec_ss_t;
-void v_resample16_altivec(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
- INT16 *filter)
+void v_resample16_altivec(uint8_t *dst, int dst_width, uint8_t *src, int wrap,
+ int16_t *filter)
{
int sum, i;
uint8_t *s;
#endif
/* slow version to handle limit cases. Does not need optimisation */
-static void h_resample_slow(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
- int src_start, int src_incr, INT16 *filters)
+static void h_resample_slow(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
+ int src_start, int src_incr, int16_t *filters)
{
int src_pos, phase, sum, j, v, i;
- UINT8 *s, *src_end;
- INT16 *filter;
+ uint8_t *s, *src_end;
+ int16_t *filter;
src_end = src + src_width;
src_pos = src_start;
}
}
-static void h_resample(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
- int src_start, int src_incr, INT16 *filters)
+static void h_resample(uint8_t *dst, int dst_width, uint8_t *src, int src_width,
+ int src_start, int src_incr, int16_t *filters)
{
int n, src_end;
}
static void component_resample(ImgReSampleContext *s,
- UINT8 *output, int owrap, int owidth, int oheight,
- UINT8 *input, int iwrap, int iwidth, int iheight)
+ uint8_t *output, int owrap, int owidth, int oheight,
+ uint8_t *input, int iwrap, int iwidth, int iheight)
{
int src_y, src_y1, last_src_y, ring_y, phase_y, y1, y;
- UINT8 *new_line, *src_line;
+ uint8_t *new_line, *src_line;
last_src_y = - FCENTER - 1;
/* position of the bottom of the filter in the source image */
/* XXX: the following filter is quite naive, but it seems to suffice
for 4 taps */
-static void build_filter(INT16 *filter, float factor)
+static void build_filter(int16_t *filter, float factor)
{
int ph, i, v;
float x, y, tab[NB_TAPS], norm, mult;
/* input */
#define XSIZE 256
#define YSIZE 256
-UINT8 img[XSIZE * YSIZE];
+uint8_t img[XSIZE * YSIZE];
/* output */
#define XSIZE1 512
#define YSIZE1 512
-UINT8 img1[XSIZE1 * YSIZE1];
-UINT8 img2[XSIZE1 * YSIZE1];
+uint8_t img1[XSIZE1 * YSIZE1];
+uint8_t img2[XSIZE1 * YSIZE1];
-void save_pgm(const char *filename, UINT8 *img, int xsize, int ysize)
+void save_pgm(const char *filename, uint8_t *img, int xsize, int ysize)
{
FILE *f;
f=fopen(filename,"w");
fclose(f);
}
-static void dump_filter(INT16 *filter)
+static void dump_filter(int16_t *filter)
{
int i, ph;
*/
#if CONST_BITS == 8
-#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */
-#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */
-#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */
-#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */
+#define FIX_0_382683433 ((int32_t) 98) /* FIX(0.382683433) */
+#define FIX_0_541196100 ((int32_t) 139) /* FIX(0.541196100) */
+#define FIX_0_707106781 ((int32_t) 181) /* FIX(0.707106781) */
+#define FIX_1_306562965 ((int32_t) 334) /* FIX(1.306562965) */
#else
#define FIX_0_382683433 FIX(0.382683433)
#define FIX_0_541196100 FIX(0.541196100)
#endif
-/* Multiply a DCTELEM variable by an INT32 constant, and immediately
+/* Multiply a DCTELEM variable by an int32_t constant, and immediately
* descale to yield a DCTELEM result.
*/
* they are represented to better-than-integral precision. These outputs
* require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
* with the recommended scaling. (For 12-bit sample data, the intermediate
- * array is INT32 anyway.)
+ * array is int32_t anyway.)
*
* To avoid overflow of the 32-bit intermediate results in pass 2, we must
* have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
*/
#if CONST_BITS == 13
-#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
-#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
-#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
-#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
-#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
-#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
-#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
-#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
-#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
-#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
-#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
-#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
+#define FIX_0_298631336 ((int32_t) 2446) /* FIX(0.298631336) */
+#define FIX_0_390180644 ((int32_t) 3196) /* FIX(0.390180644) */
+#define FIX_0_541196100 ((int32_t) 4433) /* FIX(0.541196100) */
+#define FIX_0_765366865 ((int32_t) 6270) /* FIX(0.765366865) */
+#define FIX_0_899976223 ((int32_t) 7373) /* FIX(0.899976223) */
+#define FIX_1_175875602 ((int32_t) 9633) /* FIX(1.175875602) */
+#define FIX_1_501321110 ((int32_t) 12299) /* FIX(1.501321110) */
+#define FIX_1_847759065 ((int32_t) 15137) /* FIX(1.847759065) */
+#define FIX_1_961570560 ((int32_t) 16069) /* FIX(1.961570560) */
+#define FIX_2_053119869 ((int32_t) 16819) /* FIX(2.053119869) */
+#define FIX_2_562915447 ((int32_t) 20995) /* FIX(2.562915447) */
+#define FIX_3_072711026 ((int32_t) 25172) /* FIX(3.072711026) */
#else
#define FIX_0_298631336 FIX(0.298631336)
#define FIX_0_390180644 FIX(0.390180644)
#endif
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
* For 8-bit samples with the recommended scaling, all the variable
* and constant values involved are no more than 16 bits wide, so a
* 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
GLOBAL(void)
ff_jpeg_fdct_islow (DCTELEM * data)
{
- INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- INT32 tmp10, tmp11, tmp12, tmp13;
- INT32 z1, z2, z3, z4, z5;
+ int32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ int32_t tmp10, tmp11, tmp12, tmp13;
+ int32_t z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int ctr;
SHIFT_TEMPS
#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
#endif
-#define ONE ((INT32) 1)
+#define ONE ((int32_t) 1)
#define CONST_SCALE (ONE << CONST_BITS)
*/
/* Actually FIX is no longer used, we precomputed them all */
-#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
+#define FIX(x) ((int32_t) ((x) * CONST_SCALE + 0.5))
-/* Descale and correctly round an INT32 value that's scaled by N bits.
+/* Descale and correctly round an int32_t value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
* the fudge factor is correct for either sign of X.
*/
#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+/* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
* For 8-bit samples with the recommended scaling, all the variable
* and constant values involved are no more than 16 bits wide, so a
* 16x16->32 bit multiply can be used instead of a full 32x32 multiply;
#ifdef EIGHT_BIT_SAMPLES
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
-#define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const)))
+#define MULTIPLY(var,const) (((int16_t) (var)) * ((int16_t) (const)))
#endif
#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
-#define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const)))
+#define MULTIPLY(var,const) (((int16_t) (var)) * ((int32_t) (const)))
#endif
#endif
void j_rev_dct(DCTBLOCK data)
{
- INT32 tmp0, tmp1, tmp2, tmp3;
- INT32 tmp10, tmp11, tmp12, tmp13;
- INT32 z1, z2, z3, z4, z5;
- INT32 d0, d1, d2, d3, d4, d5, d6, d7;
+ int32_t tmp0, tmp1, tmp2, tmp3;
+ int32_t tmp10, tmp11, tmp12, tmp13;
+ int32_t z1, z2, z3, z4, z5;
+ int32_t d0, d1, d2, d3, d4, d5, d6, d7;
register DCTELEM *dataptr;
int rowctr;
* libavcodec api, context stuff, interlaced stereo out).
*/
-static const UINT16 MACEtab1[] = { 0xfff3, 0x0008, 0x004c, 0x00de, 0x00de, 0x004c, 0x0008, 0xfff3 };
+static const uint16_t MACEtab1[] = { 0xfff3, 0x0008, 0x004c, 0x00de, 0x00de, 0x004c, 0x0008, 0xfff3 };
-static const UINT16 MACEtab3[] = { 0xffee, 0x008c, 0x008c, 0xffee };
+static const uint16_t MACEtab3[] = { 0xffee, 0x008c, 0x008c, 0xffee };
-static const UINT16 MACEtab2[][8] = {
+static const uint16_t MACEtab2[][8] = {
{ 0x0025, 0x0074, 0x00CE, 0x014A, 0xFEB5, 0xFF31, 0xFF8B, 0xFFDA },
{ 0x0027, 0x0079, 0x00D8, 0x015A, 0xFEA5, 0xFF27, 0xFF86, 0xFFD8 },
{ 0x0029, 0x007F, 0x00E1, 0x0169, 0xFE96, 0xFF1E, 0xFF80, 0xFFD6 },
{ 0x25A7, 0x741F, 0x7FFF, 0x7FFF, 0x8000, 0x8000, 0x8BE0, 0xDA58 },
};
-static const UINT16 MACEtab4[][8] = {
+static const uint16_t MACEtab4[][8] = {
{ 0x0040, 0x00D8, 0xFF27, 0xFFBF, 0, 0, 0, 0 }, { 0x0043, 0x00E2, 0xFF1D, 0xFFBC, 0, 0, 0, 0 },
{ 0x0046, 0x00EC, 0xFF13, 0xFFB9, 0, 0, 0, 0 }, { 0x004A, 0x00F6, 0xFF09, 0xFFB5, 0, 0, 0, 0 },
{ 0x004D, 0x0101, 0xFEFE, 0xFFB2, 0, 0, 0, 0 }, { 0x0050, 0x010C, 0xFEF3, 0xFFAF, 0, 0, 0, 0 },
/* /// "chomp3()" */
static void chomp3(MACEContext *ctx,
- UINT8 val,
- const UINT16 tab1[],
- const UINT16 tab2[][8])
+ uint8_t val,
+ const uint16_t tab1[],
+ const uint16_t tab2[][8])
{
short current;
/* /// "Exp1to3()" */
static void Exp1to3(MACEContext *ctx,
- UINT8 *inBuffer,
+ uint8_t *inBuffer,
void *outBuffer,
- UINT32 cnt,
- UINT32 numChannels,
- UINT32 whichChannel)
+ uint32_t cnt,
+ uint32_t numChannels,
+ uint32_t whichChannel)
{
- UINT8 pkt;
+ uint8_t pkt;
/*
if (inState) {
/* /// "chomp6()" */
static void chomp6(MACEContext *ctx,
- UINT8 val,
- const UINT16 tab1[],
- const UINT16 tab2[][8])
+ uint8_t val,
+ const uint16_t tab1[],
+ const uint16_t tab2[][8])
{
short current;
/* /// "Exp1to6()" */
static void Exp1to6(MACEContext *ctx,
- UINT8 *inBuffer,
+ uint8_t *inBuffer,
void *outBuffer,
- UINT32 cnt,
- UINT32 numChannels,
- UINT32 whichChannel)
+ uint32_t cnt,
+ uint32_t numChannels,
+ uint32_t whichChannel)
{
- UINT8 pkt;
+ uint8_t pkt;
/*
if (inState) {
static int mace_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
short *samples;
MACEContext *c = avctx->priv_data;
#undef TWOMATRIXES
typedef struct MJpegContext {
- UINT8 huff_size_dc_luminance[12];
- UINT16 huff_code_dc_luminance[12];
- UINT8 huff_size_dc_chrominance[12];
- UINT16 huff_code_dc_chrominance[12];
-
- UINT8 huff_size_ac_luminance[256];
- UINT16 huff_code_ac_luminance[256];
- UINT8 huff_size_ac_chrominance[256];
- UINT16 huff_code_ac_chrominance[256];
+ uint8_t huff_size_dc_luminance[12];
+ uint16_t huff_code_dc_luminance[12];
+ uint8_t huff_size_dc_chrominance[12];
+ uint16_t huff_code_dc_chrominance[12];
+
+ uint8_t huff_size_ac_luminance[256];
+ uint16_t huff_code_ac_luminance[256];
+ uint8_t huff_size_ac_chrominance[256];
+ uint16_t huff_code_ac_chrominance[256];
} MJpegContext;
/* JPEG marker codes */
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
-static const UINT8 bits_dc_luminance[17] =
+static const uint8_t bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
-static const UINT8 val_dc_luminance[] =
+static const uint8_t val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-static const UINT8 bits_dc_chrominance[17] =
+static const uint8_t bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
-static const UINT8 val_dc_chrominance[] =
+static const uint8_t val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-static const UINT8 bits_ac_luminance[17] =
+static const uint8_t bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
-static const UINT8 val_ac_luminance[] =
+static const uint8_t val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0xf9, 0xfa
};
-static const UINT8 bits_ac_chrominance[17] =
+static const uint8_t bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
-static const UINT8 val_ac_chrominance[] =
+static const uint8_t val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
};
/* isn't this function nicer than the one in the libjpeg ? */
-static void build_huffman_codes(UINT8 *huff_size, UINT16 *huff_code,
- const UINT8 *bits_table, const UINT8 *val_table)
+static void build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
+ const uint8_t *bits_table, const uint8_t *val_table)
{
int i, j, k,nb, code, sym;
/* table_class: 0 = DC coef, 1 = AC coefs */
static int put_huffman_table(MpegEncContext *s, int table_class, int table_id,
- const UINT8 *bits_table, const UINT8 *value_table)
+ const uint8_t *bits_table, const uint8_t *value_table)
{
PutBitContext *p = &s->pb;
int n, i;
{
PutBitContext *p = &s->pb;
int i, j, size;
- UINT8 *ptr;
+ uint8_t *ptr;
/* quant matrixes */
put_marker(p, DQT);
{
PutBitContext *p = &s->pb;
int size;
- UINT8 *ptr;
+ uint8_t *ptr;
if (s->aspect_ratio_info)
{
}
static inline void mjpeg_encode_dc(MpegEncContext *s, int val,
- UINT8 *huff_size, UINT16 *huff_code)
+ uint8_t *huff_size, uint16_t *huff_code)
{
int mant, nbits;
int mant, nbits, code, i, j;
int component, dc, run, last_index, val;
MJpegContext *m = s->mjpeg_ctx;
- UINT8 *huff_size_ac;
- UINT16 *huff_code_ac;
+ uint8_t *huff_size_ac;
+ uint16_t *huff_code_ac;
/* DC coef */
component = (n <= 3 ? 0 : n - 4 + 1);
int start_code; /* current start code */
int buffer_size;
- UINT8 *buffer;
+ uint8_t *buffer;
- INT16 quant_matrixes[4][64];
+ int16_t quant_matrixes[4][64];
VLC vlcs[2][4];
int org_width, org_height; /* size given at codec init */
int h_max, v_max; /* maximum h and v counts */
int quant_index[4]; /* quant table index for each component */
int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
- UINT8 *current_picture[MAX_COMPONENTS]; /* picture structure */
+ uint8_t *current_picture[MAX_COMPONENTS]; /* picture structure */
int linesize[MAX_COMPONENTS];
DCTELEM block[64] __align8;
ScanTable scantable;
- void (*idct_put)(UINT8 *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
+ void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
int restart_interval;
int restart_count;
static int mjpeg_decode_dht(MJpegDecodeContext *s);
-static void build_vlc(VLC *vlc, const UINT8 *bits_table, const UINT8 *val_table,
+static void build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table,
int nb_codes)
{
- UINT8 huff_size[256];
- UINT16 huff_code[256];
+ uint8_t huff_size[256];
+ uint16_t huff_code[256];
memset(huff_size, 0, sizeof(huff_size));
build_huffman_codes(huff_size, huff_code, bits_table, val_table);
static int mjpeg_decode_dht(MJpegDecodeContext *s)
{
int len, index, i, class, n, v, code_max;
- UINT8 bits_table[17];
- UINT8 val_table[256];
+ uint8_t bits_table[17];
+ uint8_t val_table[256];
len = get_bits(&s->gb, 16) - 2;
int nbits, code, i, j, level;
int run, val;
VLC *ac_vlc;
- INT16 *quant_matrix;
+ int16_t *quant_matrix;
/* DC coef */
val = mjpeg_decode_dc(s, dc_index);
for(mb_y = 0; mb_y < mb_height; mb_y++) {
for(mb_x = 0; mb_x < mb_width; mb_x++) {
for(i=0;i<nb_components;i++) {
- UINT8 *ptr;
+ uint8_t *ptr;
int x, y, c;
n = nb_blocks[i];
c = comp_index[i];
unsigned int len = get_bits(&s->gb, 16);
if (len >= 2 && len < 32768) {
/* XXX: any better upper bound */
- UINT8 *cbuf = av_malloc(len - 1);
+ uint8_t *cbuf = av_malloc(len - 1);
if (cbuf) {
int i;
for (i = 0; i < len - 2; i++)
/* return the 8 bit start code value and update the search
state. Return -1 if no start code found */
-static int find_marker(UINT8 **pbuf_ptr, UINT8 *buf_end)
+static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end)
{
- UINT8 *buf_ptr;
+ uint8_t *buf_ptr;
unsigned int v, v2;
int val;
#ifdef DEBUG
static int mjpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
MJpegDecodeContext *s = avctx->priv_data;
- UINT8 *buf_end, *buf_ptr;
+ uint8_t *buf_end, *buf_ptr;
int i, start_code;
AVPicture *picture = data;
/* unescape buffer of SOS */
if (start_code == SOS)
{
- UINT8 *src = buf_ptr;
- UINT8 *dst = s->buffer;
+ uint8_t *src = buf_ptr;
+ uint8_t *dst = s->buffer;
while (src<buf_end)
{
- UINT8 x = *(src++);
+ uint8_t x = *(src++);
*(dst++) = x;
if (x == 0xff)
static int mjpegb_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
MJpegDecodeContext *s = avctx->priv_data;
- UINT8 *buf_end, *buf_ptr;
+ uint8_t *buf_end, *buf_ptr;
int i;
AVPicture *picture = data;
GetBitContext hgb; /* for the header */
}
-static void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);
+static void (*put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
-static void add_pixels_clamped_mlib(const DCTELEM *block, UINT8 *pixels, int line_size)
+static void add_pixels_clamped_mlib(const DCTELEM *block, uint8_t *pixels, int line_size)
{
mlib_VideoAddBlock_U8_S16(pixels, (mlib_s16 *)block, line_size);
}
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
-static void ff_idct_put_mlib(UINT8 *dest, int line_size, DCTELEM *data)
+static void ff_idct_put_mlib(uint8_t *dest, int line_size, DCTELEM *data)
{
mlib_VideoIDCT8x8_S16_S16 (data, data);
put_pixels_clamped(data, dest, line_size);
}
-static void ff_idct_add_mlib(UINT8 *dest, int line_size, DCTELEM *data)
+static void ff_idct_add_mlib(uint8_t *dest, int line_size, DCTELEM *data)
{
mlib_VideoIDCT8x8_S16_S16 (data, data);
mlib_VideoAddBlock_U8_S16(dest, (mlib_s16 *)data, line_size);
}
}
-static int pix_dev(UINT8 * pix, int line_size, int mean)
+static int pix_dev(uint8_t * pix, int line_size, int mean)
{
int s, i, j;
{
int x1, y1, x2, y2, xx, yy, x, y;
int mx, my, dmin, d;
- UINT8 *pix;
+ uint8_t *pix;
xx = 16 * s->mb_x;
yy = 16 * s->mb_y;
{
int x1, y1, x2, y2, xx, yy, x, y;
int mx, my, dmin, d;
- UINT8 *pix;
+ uint8_t *pix;
xx = s->mb_x << 4;
yy = s->mb_y << 4;
{
int x1, y1, x2, y2, xx, yy, x, y, lastx, d;
int mx, my, dminx, dminy;
- UINT8 *pix;
+ uint8_t *pix;
xx = s->mb_x << 4;
yy = s->mb_y << 4;
uint32_t *score_map= s->me.score_map;
const int penalty_factor= s->me.sub_penalty_factor;
int mx, my, xx, yy, dminh;
- UINT8 *pix, *ptr;
+ uint8_t *pix, *ptr;
op_pixels_abs_func pix_abs_x2;
op_pixels_abs_func pix_abs_y2;
op_pixels_abs_func pix_abs_xy2;
void ff_estimate_p_frame_motion(MpegEncContext * s,
int mb_x, int mb_y)
{
- UINT8 *pix, *ppix;
+ uint8_t *pix, *ppix;
int sum, varc, vard, mx, my, range, dmin, xx, yy;
int xmin, ymin, xmax, ymax;
int rel_xmin, rel_ymin, rel_xmax, rel_ymax;
//FIXME optimize?
//FIXME move into template?
//FIXME better f_code prediction (max mv & distance)
- UINT16 *mv_penalty= s->me.mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
+ uint16_t *mv_penalty= s->me.mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
uint8_t *dest_y = s->me.scratchpad;
uint8_t *ptr;
int dxy;
if(s->me_method>=ME_EPZS){
int score[8];
int i, y;
- UINT8 * fcode_tab= s->fcode_tab;
+ uint8_t * fcode_tab= s->fcode_tab;
int best_fcode=-1;
int best_score=-10000000;
{
const int f_code= s->f_code;
int y;
- UINT8 * fcode_tab= s->fcode_tab;
+ uint8_t * fcode_tab= s->fcode_tab;
//int clip=0;
//int noclip=0;
/* clip / convert to intra 16x16 type MVs */
void ff_fix_long_b_mvs(MpegEncContext * s, int16_t (*mv_table)[2], int f_code, int type)
{
int y;
- UINT8 * fcode_tab= s->fcode_tab;
+ uint8_t * fcode_tab= s->fcode_tab;
// RAL: 8 in MPEG-1, 16 in MPEG-4
int range = (((s->codec_id == CODEC_ID_MPEG1VIDEO) ? 8 : 16) << f_code);
#include "i386/mmx.h"
-int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_x2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_y2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_xy2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx);
-int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx);
-
-typedef int motion_func(UINT8 *blk1, UINT8 *blk2, int lx);
+int pix_abs16x16_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_x2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_x2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_x2_c(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_y2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_y2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_y2_c(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_xy2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_xy2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_xy2_c(uint8_t *blk1, uint8_t *blk2, int lx);
+
+typedef int motion_func(uint8_t *blk1, uint8_t *blk2, int lx);
#define WIDTH 64
#define HEIGHT 64
-UINT8 img1[WIDTH * HEIGHT];
-UINT8 img2[WIDTH * HEIGHT];
+uint8_t img1[WIDTH * HEIGHT];
+uint8_t img2[WIDTH * HEIGHT];
-void fill_random(UINT8 *tab, int size)
+void fill_random(uint8_t *tab, int size)
{
int i;
for(i=0;i<size;i++) {
exit(1);
}
-INT64 gettime(void)
+int64_t gettime(void)
{
struct timeval tv;
gettimeofday(&tv,NULL);
- return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
+ return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}
#define NB_ITS 500
motion_func *test_func, motion_func *ref_func)
{
int x, y, d1, d2, it;
- UINT8 *ptr;
- INT64 ti;
+ uint8_t *ptr;
+ int64_t ti;
printf("testing '%s'\n", name);
/* test correctness */
static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred);
#ifdef CONFIG_ENCODERS
-static UINT16 mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
-static UINT8 fcode_tab[MAX_MV*2+1];
+static uint16_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
+static uint8_t fcode_tab[MAX_MV*2+1];
static uint32_t uni_mpeg1_ac_vlc_bits[64*64*2];
static uint8_t uni_mpeg1_ac_vlc_len [64*64*2];
unsigned int vbv_buffer_size;
unsigned int fps, v;
int n, i;
- UINT64 time_code;
+ uint64_t time_code;
float best_aspect_error= 1E10;
float aspect_ratio= s->avctx->aspect_ratio;
/* time code : we must convert from the real frame rate to a
fake mpeg frame rate in case of low frame rate */
fps = frame_rate_tab[s->frame_rate_index];
- time_code = (INT64)s->fake_picture_number * FRAME_RATE_BASE;
+ time_code = (int64_t)s->fake_picture_number * FRAME_RATE_BASE;
s->gop_picture_number = s->fake_picture_number;
- put_bits(&s->pb, 5, (UINT32)((time_code / (fps * 3600)) % 24));
- put_bits(&s->pb, 6, (UINT32)((time_code / (fps * 60)) % 60));
+ put_bits(&s->pb, 5, (uint32_t)((time_code / (fps * 3600)) % 24));
+ put_bits(&s->pb, 6, (uint32_t)((time_code / (fps * 60)) % 60));
put_bits(&s->pb, 1, 1);
- put_bits(&s->pb, 6, (UINT32)((time_code / fps) % 60));
- put_bits(&s->pb, 6, (UINT32)((time_code % fps) / FRAME_RATE_BASE));
+ put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60));
+ put_bits(&s->pb, 6, (uint32_t)((time_code % fps) / FRAME_RATE_BASE));
put_bits(&s->pb, 1, 1); /* closed gop */
put_bits(&s->pb, 1, 0); /* broken link */
}
/* insert empty P pictures to slow down to the desired
frame rate. Each fake pictures takes about 20 bytes */
fps = frame_rate_tab[s->frame_rate_index];
- n = (((INT64)s->picture_number * fps) / s->frame_rate) - 1;
+ n = (((int64_t)s->picture_number * fps) / s->frame_rate) - 1;
while (s->fake_picture_number < n) {
mpeg1_skip_picture(s, s->fake_picture_number -
s->gop_picture_number);
it is handled slightly differently */
level = block[0];
if (abs(level) == 1) {
- code = ((UINT32)level >> 31); /* the sign bit */
+ code = ((uint32_t)level >> 31); /* the sign bit */
put_bits(&s->pb, 2, code | 0x02);
i = 1;
} else {
int level, dc, diff, i, j, run;
int component;
RLTable *rl = &rl_mpeg1;
- UINT8 * const scantable= s->intra_scantable.permutated;
- const UINT16 *quant_matrix= s->intra_matrix;
+ uint8_t * const scantable= s->intra_scantable.permutated;
+ const uint16_t *quant_matrix= s->intra_matrix;
const int qscale= s->qscale;
/* DC coef */
{
int level, i, j, run;
RLTable *rl = &rl_mpeg1;
- UINT8 * const scantable= s->intra_scantable.permutated;
- const UINT16 *quant_matrix= s->inter_matrix;
+ uint8_t * const scantable= s->intra_scantable.permutated;
+ const uint16_t *quant_matrix= s->inter_matrix;
const int qscale= s->qscale;
{
{
int level, i, j, run;
RLTable *rl = &rl_mpeg1;
- UINT8 * const scantable= s->intra_scantable.permutated;
- const UINT16 *quant_matrix;
+ uint8_t * const scantable= s->intra_scantable.permutated;
+ const uint16_t *quant_matrix;
const int qscale= s->qscale;
int mismatch;
int level, dc, diff, i, j, run;
int component;
RLTable *rl;
- UINT8 * const scantable= s->intra_scantable.permutated;
- const UINT16 *quant_matrix;
+ uint8_t * const scantable= s->intra_scantable.permutated;
+ const uint16_t *quant_matrix;
const int qscale= s->qscale;
int mismatch;
typedef struct Mpeg1Context {
MpegEncContext mpeg_enc_ctx;
- UINT32 header_state;
+ uint32_t header_state;
int start_code; /* current start code */
- UINT8 buffer[PICTURE_BUFFER_SIZE];
- UINT8 *buf_ptr;
+ uint8_t buffer[PICTURE_BUFFER_SIZE];
+ uint8_t *buf_ptr;
int buffer_size;
int mpeg_enc_ctx_allocated; /* true if decoding context allocated */
int repeat_field; /* true if we must repeat the field */
/* return the 8 bit start code value and update the search
state. Return -1 if no start code found */
-static int find_start_code(UINT8 **pbuf_ptr, UINT8 *buf_end,
- UINT32 *header_state)
+static int find_start_code(uint8_t **pbuf_ptr, uint8_t *buf_end,
+ uint32_t *header_state)
{
- UINT8 *buf_ptr;
+ uint8_t *buf_ptr;
unsigned int state, v;
int val;
}
static int mpeg1_decode_picture(AVCodecContext *avctx,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
}
static void mpeg_decode_extension(AVCodecContext *avctx,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
static int mpeg_decode_slice(AVCodecContext *avctx,
AVFrame *pict,
int start_code,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
}
static int mpeg1_decode_sequence(AVCodecContext *avctx,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
/* handle buffering and image synchronisation */
static int mpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
Mpeg1Context *s = avctx->priv_data;
- UINT8 *buf_end, *buf_ptr, *buf_start;
+ uint8_t *buf_end, *buf_ptr, *buf_start;
int len, start_code_found, ret, code, start_code, input_size;
AVFrame *picture = data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
* MPEG1/2 tables
*/
-const INT16 ff_mpeg1_default_intra_matrix[64] = {
+const int16_t ff_mpeg1_default_intra_matrix[64] = {
8, 16, 19, 22, 26, 27, 29, 34,
16, 16, 22, 24, 27, 29, 34, 37,
19, 22, 26, 27, 29, 34, 34, 38,
27, 29, 35, 38, 46, 56, 69, 83
};
-const INT16 ff_mpeg1_default_non_intra_matrix[64] = {
+const int16_t ff_mpeg1_default_non_intra_matrix[64] = {
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
};
-const UINT16 vlc_dc_lum_code[12] = {
+const uint16_t vlc_dc_lum_code[12] = {
0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff,
};
const unsigned char vlc_dc_lum_bits[12] = {
3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9,
};
-const UINT16 vlc_dc_chroma_code[12] = {
+const uint16_t vlc_dc_chroma_code[12] = {
0x0, 0x1, 0x2, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x3fe, 0x3ff,
};
const unsigned char vlc_dc_chroma_bits[12] = {
};
/* simple include everything table for dc, first byte is bits number next 3 are code*/
-static UINT32 mpeg1_lum_dc_uni[512];
-static UINT32 mpeg1_chr_dc_uni[512];
+static uint32_t mpeg1_lum_dc_uni[512];
+static uint32_t mpeg1_chr_dc_uni[512];
-static const UINT16 mpeg1_vlc[113][2] = {
+static const uint16_t mpeg1_vlc[113][2] = {
{ 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 },
{ 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 },
{ 0x18, 12 }, { 0x13, 12 }, { 0x10, 12 }, { 0x1a, 13 },
{ 0x2, 2 }, /* EOB */
};
-static const UINT16 mpeg2_vlc[113][2] = {
+static const uint16_t mpeg2_vlc[113][2] = {
{0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5},
{0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7},
{0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8},
{0x06,4}, /* EOB */
};
-static const INT8 mpeg1_level[111] = {
+static const int8_t mpeg1_level[111] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24,
1, 1, 1, 1, 1, 1, 1,
};
-static const INT8 mpeg1_run[111] = {
+static const int8_t mpeg1_run[111] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
25, 26, 27, 28, 29, 30, 31,
};
-static UINT8 mpeg1_index_run[2][64];
-static INT8 mpeg1_max_level[2][64];
+static uint8_t mpeg1_index_run[2][64];
+static int8_t mpeg1_max_level[2][64];
static RLTable rl_mpeg1 = {
111,
mpeg1_level,
};
-static const UINT8 mbAddrIncrTable[35][2] = {
+static const uint8_t mbAddrIncrTable[35][2] = {
{0x1, 1},
{0x3, 3},
{0x2, 3},
{0xf, 11}, /* stuffing */
};
-static const UINT8 mbPatTable[63][2] = {
+static const uint8_t mbPatTable[63][2] = {
{0xb, 5},
{0x9, 5},
{0xd, 6},
#define MB_FOR 0x08
#define MB_QUANT 0x10
-static const UINT8 table_mb_ptype[32][2] = {
+static const uint8_t table_mb_ptype[32][2] = {
{ 0, 0 }, // 0x00
{ 3, 5 }, // 0x01 MB_INTRA
{ 1, 2 }, // 0x02 MB_PAT
{ 0, 0 }, // 0x1F
};
-static const UINT8 table_mb_btype[32][2] = {
+static const uint8_t table_mb_btype[32][2] = {
{ 0, 0 }, // 0x00
{ 3, 5 }, // 0x01 MB_INTRA
{ 0, 0 }, // 0x02
{ 0, 0 }, // 0x1F
};
-static const UINT8 mbMotionVectorTable[17][2] = {
+static const uint8_t mbMotionVectorTable[17][2] = {
{ 0x1, 1 },
{ 0x1, 2 },
{ 0x1, 3 },
(int)(60 * FRAME_RATE_BASE),
};
-static const UINT8 non_linear_qscale[32] = {
+static const uint8_t non_linear_qscale[32] = {
0, 1, 2, 3, 4, 5, 6, 7,
8,10,12,14,16,18,20,22,
24,28,32,36,40,44,48,52,
56,64,72,80,88,96,104,112,
};
-UINT8 ff_mpeg1_dc_scale_table[128]={ // MN: mpeg2 really can have such large qscales?
+uint8_t ff_mpeg1_dc_scale_table[128]={ // MN: mpeg2 really can have such large qscales?
// 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
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,
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,
#define VOP_STARTCODE 0x1B6
/* dc encoding for mpeg4 */
-const UINT8 DCtab_lum[13][2] =
+const uint8_t DCtab_lum[13][2] =
{
{3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7},
{1,8}, {1,9}, {1,10}, {1,11},
};
-const UINT8 DCtab_chrom[13][2] =
+const uint8_t DCtab_chrom[13][2] =
{
{3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8},
{1,9}, {1,10}, {1,11}, {1,12},
};
-const UINT16 intra_vlc[103][2] = {
+const uint16_t intra_vlc[103][2] = {
{ 0x2, 2 },
{ 0x6, 3 },{ 0xf, 4 },{ 0xd, 5 },{ 0xc, 5 },
{ 0x15, 6 },{ 0x13, 6 },{ 0x12, 6 },{ 0x17, 7 },
{ 0x5f, 12 },{ 0x3, 7 },
};
-const INT8 intra_level[102] = {
+const int8_t intra_level[102] = {
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24,
1, 1, 1, 1, 1, 1,
};
-const INT8 intra_run[102] = {
+const int8_t intra_run[102] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
intra_level,
};
-static const UINT16 sprite_trajectory_tab[15][2] = {
+static const uint16_t sprite_trajectory_tab[15][2] = {
{0x00, 2}, {0x02, 3}, {0x03, 3}, {0x04, 3}, {0x05, 3}, {0x06, 3},
{0x0E, 4}, {0x1E, 5}, {0x3E, 6}, {0x7E, 7}, {0xFE, 8},
{0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12},
};
-static const UINT8 mb_type_b_tab[4][2] = {
+static const uint8_t mb_type_b_tab[4][2] = {
{1, 1}, {1, 2}, {1, 3}, {1, 4},
};
-static const UINT16 pixel_aspect[16][2]={
+static const uint16_t pixel_aspect[16][2]={
{0, 0},
{1, 1},
{12, 11},
};
/* these matrixes will be permuted for the idct */
-const INT16 ff_mpeg4_default_intra_matrix[64] = {
+const int16_t ff_mpeg4_default_intra_matrix[64] = {
8, 17, 18, 19, 21, 23, 25, 27,
17, 18, 19, 21, 23, 25, 27, 28,
20, 21, 22, 23, 24, 26, 28, 30,
27, 28, 30, 32, 35, 38, 41, 45,
};
-const INT16 ff_mpeg4_default_non_intra_matrix[64] = {
+const int16_t ff_mpeg4_default_non_intra_matrix[64] = {
16, 17, 18, 19, 20, 21, 22, 23,
17, 18, 19, 20, 21, 22, 23, 24,
18, 19, 20, 21, 22, 23, 24, 25,
23, 24, 25, 27, 28, 30, 31, 33,
};
-UINT8 ff_mpeg4_y_dc_scale_table[32]={
+uint8_t ff_mpeg4_y_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 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
};
-UINT8 ff_mpeg4_c_dc_scale_table[32]={
+uint8_t ff_mpeg4_c_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 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
};
-const UINT16 ff_mpeg4_resync_prefix[8]={
+const uint16_t ff_mpeg4_resync_prefix[8]={
0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000
};
quantization stage) */
#define FRAC_BITS 15
#define WFRAC_BITS 14
-#define MUL(a,b) (((INT64)(a) * (INT64)(b)) >> FRAC_BITS)
+#define MUL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
#define FIX(a) ((int)((a) * (1 << FRAC_BITS)))
#define SAMPLES_BUF_SIZE 4096
int bitrate_index; /* bit rate */
int freq_index;
int frame_size; /* frame size, in bits, without padding */
- INT64 nb_samples; /* total number of samples encoded */
+ int64_t nb_samples; /* total number of samples encoded */
/* padding computation */
int frame_frac, frame_frac_incr, do_padding;
short samples_buf[MPA_MAX_CHANNELS][SAMPLES_BUF_SIZE]; /* buffer for filter */
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
-extern const UINT16 mpa_bitrate_tab[2][3][15];
-extern const UINT16 mpa_freq_tab[3];
+extern const uint16_t mpa_bitrate_tab[2][3][15];
+extern const uint16_t mpa_freq_tab[3];
extern const unsigned char *alloc_tables[5];
extern const double enwindow[512];
extern const int sblimit_table[5];
extern const int quant_steps[17];
extern const int quant_bits[17];
-extern const INT32 mpa_enwindow[257];
+extern const int32_t mpa_enwindow[257];
#define FRAC_ONE (1 << FRAC_BITS)
-#define MULL(a,b) (((INT64)(a) * (INT64)(b)) >> FRAC_BITS)
-#define MUL64(a,b) ((INT64)(a) * (INT64)(b))
+#define MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
+#define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
#define FIX(a) ((int)((a) * FRAC_ONE))
/* WARNING: only correct for posititive numbers */
#define FIXR(a) ((int)((a) * FRAC_ONE + 0.5))
#define FRAC_RND(a) (((a) + (FRAC_ONE/2)) >> FRAC_BITS)
#if FRAC_BITS <= 15
-typedef INT16 MPA_INT;
+typedef int16_t MPA_INT;
#else
-typedef INT32 MPA_INT;
+typedef int32_t MPA_INT;
#endif
/****************/
#define BACKSTEP_SIZE 512
typedef struct MPADecodeContext {
- UINT8 inbuf1[2][MPA_MAX_CODED_FRAME_SIZE + BACKSTEP_SIZE]; /* input buffer */
+ uint8_t inbuf1[2][MPA_MAX_CODED_FRAME_SIZE + BACKSTEP_SIZE]; /* input buffer */
int inbuf_index;
- UINT8 *inbuf_ptr, *inbuf;
+ uint8_t *inbuf_ptr, *inbuf;
int frame_size;
int free_format_frame_size; /* frame size in case of free format
(zero if currently unknown) */
/* next header (used in free format parsing) */
- UINT32 free_format_next_header;
+ uint32_t free_format_next_header;
int error_protection;
int layer;
int sample_rate;
int lsf;
MPA_INT synth_buf[MPA_MAX_CHANNELS][512 * 2];
int synth_buf_offset[MPA_MAX_CHANNELS];
- INT32 sb_samples[MPA_MAX_CHANNELS][36][SBLIMIT];
- INT32 mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
+ int32_t sb_samples[MPA_MAX_CHANNELS][36][SBLIMIT];
+ int32_t mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
#ifdef DEBUG
int frame_count;
#endif
/* layer 3 "granule" */
typedef struct GranuleDef {
- UINT8 scfsi;
+ uint8_t scfsi;
int part2_3_length;
int big_values;
int global_gain;
int scalefac_compress;
- UINT8 block_type;
- UINT8 switch_point;
+ uint8_t block_type;
+ uint8_t switch_point;
int table_select[3];
int subblock_gain[3];
- UINT8 scalefac_scale;
- UINT8 count1table_select;
+ uint8_t scalefac_scale;
+ uint8_t count1table_select;
int region_size[3]; /* number of huffman codes in each region */
int preflag;
int short_start, long_end; /* long/short band indexes */
- UINT8 scale_factors[40];
- INT32 sb_hybrid[SBLIMIT * 18]; /* 576 samples */
+ uint8_t scale_factors[40];
+ int32_t sb_hybrid[SBLIMIT * 18]; /* 576 samples */
} GranuleDef;
#define MODE_EXT_MS_STEREO 2
/* layer 3 huffman tables */
typedef struct HuffTable {
int xsize;
- const UINT8 *bits;
- const UINT16 *codes;
+ const uint8_t *bits;
+ const uint16_t *codes;
} HuffTable;
#include "mpegaudiodectab.h"
/* vlc structure for decoding layer 3 huffman tables */
static VLC huff_vlc[16];
-static UINT8 *huff_code_table[16];
+static uint8_t *huff_code_table[16];
static VLC huff_quad_vlc[2];
/* computed from band_size_long */
-static UINT16 band_index_long[9][23];
+static uint16_t band_index_long[9][23];
/* XXX: free when all decoders are closed */
#define TABLE_4_3_SIZE (8191 + 16)
-static INT8 *table_4_3_exp;
+static int8_t *table_4_3_exp;
#if FRAC_BITS <= 15
-static UINT16 *table_4_3_value;
+static uint16_t *table_4_3_value;
#else
-static UINT32 *table_4_3_value;
+static uint32_t *table_4_3_value;
#endif
/* intensity stereo coef table */
-static INT32 is_table[2][16];
-static INT32 is_table_lsf[2][2][16];
-static INT32 csa_table[8][2];
-static INT32 mdct_win[8][36];
+static int32_t is_table[2][16];
+static int32_t is_table_lsf[2][2][16];
+static int32_t csa_table[8][2];
+static int32_t mdct_win[8][36];
/* lower 2 bits: modulo 3, higher bits: shift */
-static UINT16 scale_factor_modshift[64];
+static uint16_t scale_factor_modshift[64];
/* [i][j]: 2^(-j/3) * FRAC_ONE * 2^(i+2) / (2^(i+2) - 1) */
-static INT32 scale_factor_mult[15][3];
+static int32_t scale_factor_mult[15][3];
/* mult table for layer 2 group quantization */
#define SCALE_GEN(v) \
{ FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) }
-static INT32 scale_factor_mult2[3][3] = {
+static int32_t scale_factor_mult2[3][3] = {
SCALE_GEN(4.0 / 3.0), /* 3 steps */
SCALE_GEN(4.0 / 5.0), /* 5 steps */
SCALE_GEN(4.0 / 9.0), /* 9 steps */
};
/* 2^(n/4) */
-static UINT32 scale_factor_mult3[4] = {
+static uint32_t scale_factor_mult3[4] = {
FIXR(1.0),
FIXR(1.18920711500272106671),
FIXR(1.41421356237309504880),
static inline int l1_unscale(int n, int mant, int scale_factor)
{
int shift, mod;
- INT64 val;
+ int64_t val;
shift = scale_factor_modshift[scale_factor];
mod = shift & 3;
#if FRAC_BITS <= 15
unsigned int m;
#else
- UINT64 m;
+ uint64_t m;
#endif
int e;
return m;
#else
m = MUL64(m, scale_factor_mult3[exponent & 3]);
- m = (m + (UINT64_C(1) << (e-1))) >> e;
+ m = (m + (uint64_t_C(1) << (e-1))) >> e;
return m;
#endif
}
#define POW_FRAC_BITS 24
#define POW_FRAC_ONE (1 << POW_FRAC_BITS)
#define POW_FIX(a) ((int)((a) * POW_FRAC_ONE))
-#define POW_MULL(a,b) (((INT64)(a) * (INT64)(b)) >> POW_FRAC_BITS)
+#define POW_MULL(a,b) (((int64_t)(a) * (int64_t)(b)) >> POW_FRAC_BITS)
static int dev_4_3_coefs[DEV_ORDER];
for(i=0;i<15;i++) {
int n, norm;
n = i + 2;
- norm = ((INT64_C(1) << n) * FRAC_ONE) / ((1 << n) - 1);
+ norm = ((int64_t_C(1) << n) * FRAC_ONE) / ((1 << n) - 1);
scale_factor_mult[i][0] = MULL(FIXR(1.0 * 2.0), norm);
scale_factor_mult[i][1] = MULL(FIXR(0.7937005259 * 2.0), norm);
scale_factor_mult[i][2] = MULL(FIXR(0.6299605249 * 2.0), norm);
const HuffTable *h = &mpa_huff_tables[i];
int xsize, x, y;
unsigned int n;
- UINT8 *code_table;
+ uint8_t *code_table;
xsize = h->xsize;
n = xsize * xsize;
#define ADD(a, b) tab[a] += tab[b]
/* DCT32 without 1/sqrt(2) coef zero scaling. */
-static void dct32(INT32 *out, INT32 *tab)
+static void dct32(int32_t *out, int32_t *tab)
{
int tmp0, tmp1;
#define OUT_SAMPLE(sum)\
{\
int sum1;\
- sum1 = (int)((sum + (INT64_C(1) << (OUT_SHIFT - 1))) >> OUT_SHIFT);\
+ sum1 = (int)((sum + (int64_t_C(1) << (OUT_SHIFT - 1))) >> OUT_SHIFT);\
if (sum1 < -32768)\
sum1 = -32768;\
else if (sum1 > 32767)\
32 samples. */
/* XXX: optimize by avoiding ring buffer usage */
static void synth_filter(MPADecodeContext *s1,
- int ch, INT16 *samples, int incr,
- INT32 sb_samples[SBLIMIT])
+ int ch, int16_t *samples, int incr,
+ int32_t sb_samples[SBLIMIT])
{
- INT32 tmp[32];
+ int32_t tmp[32];
register MPA_INT *synth_buf, *p;
register MPA_INT *w;
int j, offset, v;
#if FRAC_BITS <= 15
int sum;
#else
- INT64 sum;
+ int64_t sum;
#endif
dct32(tmp, sb_samples);
static void imdct12(int *out, int *in)
{
int tmp;
- INT64 in1_3, in1_9, in4_3, in4_9;
+ int64_t in1_3, in1_9, in4_3, in4_9;
in1_3 = MUL64(in[1], C3);
in1_9 = MUL64(in[1], C9);
{
int i, j, t0, t1, t2, t3, s0, s1, s2, s3;
int tmp[18], *tmp1, *in1;
- INT64 in3_3, in6_6;
+ int64_t in3_3, in6_6;
for(i=17;i>=1;i--)
in[i] += in[i-1];
}
/* fast header check for resync */
-static int check_header(UINT32 header)
+static int check_header(uint32_t header)
{
/* header */
if ((header & 0xffe00000) != 0xffe00000)
/* header decoding. MUST check the header before because no
consistency check is done there. Return 1 if free format found and
that the frame size must be computed externally */
-static int decode_header(MPADecodeContext *s, UINT32 header)
+static int decode_header(MPADecodeContext *s, uint32_t header)
{
int sample_rate, frame_size, mpeg25, padding;
int sample_rate_index, bitrate_index;
static int mp_decode_layer1(MPADecodeContext *s)
{
int bound, i, v, n, ch, j, mant;
- UINT8 allocation[MPA_MAX_CHANNELS][SBLIMIT];
- UINT8 scale_factors[MPA_MAX_CHANNELS][SBLIMIT];
+ uint8_t allocation[MPA_MAX_CHANNELS][SBLIMIT];
+ uint8_t scale_factors[MPA_MAX_CHANNELS][SBLIMIT];
if (s->mode == MPA_JSTEREO)
bound = (s->mode_ext + 1) * 4;
*/
static void seek_to_maindata(MPADecodeContext *s, unsigned int backstep)
{
- UINT8 *ptr;
+ uint8_t *ptr;
/* compute current position in stream */
ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);
static void exponents_from_scale_factors(MPADecodeContext *s,
GranuleDef *g,
- INT16 *exponents)
+ int16_t *exponents)
{
- const UINT8 *bstab, *pretab;
+ const uint8_t *bstab, *pretab;
int len, i, j, k, l, v0, shift, gain, gains[3];
- INT16 *exp_ptr;
+ int16_t *exp_ptr;
exp_ptr = exponents;
gain = g->global_gain - 210;
}
static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
- INT16 *exponents, int end_pos)
+ int16_t *exponents, int end_pos)
{
int s_index;
int linbits, code, x, y, l, v, i, j, k, pos;
GetBitContext last_gb;
VLC *vlc;
- UINT8 *code_table;
+ uint8_t *code_table;
/* low frequencies (called big values) */
s_index = 0;
static void reorder_block(MPADecodeContext *s, GranuleDef *g)
{
int i, j, k, len;
- INT32 *ptr, *dst, *ptr1;
- INT32 tmp[576];
+ int32_t *ptr, *dst, *ptr1;
+ int32_t tmp[576];
if (g->block_type != 2)
return;
dst += 3;
}
}
- memcpy(ptr1, tmp, len * 3 * sizeof(INT32));
+ memcpy(ptr1, tmp, len * 3 * sizeof(int32_t));
}
}
GranuleDef *g0, GranuleDef *g1)
{
int i, j, k, l;
- INT32 v1, v2;
+ int32_t v1, v2;
int sf_max, tmp0, tmp1, sf, len, non_zero_found;
- INT32 (*is_tab)[16];
- INT32 *tab0, *tab1;
+ int32_t (*is_tab)[16];
+ int32_t *tab0, *tab1;
int non_zero_found_short[3];
/* intensity stereo */
static void compute_antialias(MPADecodeContext *s,
GranuleDef *g)
{
- INT32 *ptr, *p0, *p1, *csa;
+ int32_t *ptr, *p0, *p1, *csa;
int n, tmp0, tmp1, i, j;
/* we antialias only "long" bands */
static void compute_imdct(MPADecodeContext *s,
GranuleDef *g,
- INT32 *sb_samples,
- INT32 *mdct_buf)
+ int32_t *sb_samples,
+ int32_t *mdct_buf)
{
- INT32 *ptr, *win, *win1, *buf, *buf2, *out_ptr, *ptr1;
- INT32 in[6];
- INT32 out[36];
- INT32 out2[12];
+ int32_t *ptr, *win, *win1, *buf, *buf2, *out_ptr, *ptr1;
+ int32_t in[6];
+ int32_t out[36];
+ int32_t out2[12];
int i, j, k, mdct_long_end, v, sblimit;
/* find last non zero block */
}
#if defined(DEBUG)
-void sample_dump(int fnum, INT32 *tab, int n)
+void sample_dump(int fnum, int32_t *tab, int n)
{
static FILE *files[16], *f;
char buf[512];
int i;
- INT32 v;
+ int32_t v;
f = files[fnum];
if (!f) {
for(i=0;i<n;i++) {
/* normalize to 23 frac bits */
v = tab[i] << (23 - FRAC_BITS);
- fwrite(&v, 1, sizeof(INT32), f);
+ fwrite(&v, 1, sizeof(int32_t), f);
}
}
#endif
int nb_granules, main_data_begin, private_bits;
int gr, ch, blocksplit_flag, i, j, k, n, bits_pos, bits_left;
GranuleDef granules[2][2], *g;
- INT16 exponents[576];
+ int16_t exponents[576];
/* read side info */
if (s->lsf) {
bits_pos = get_bits_count(&s->gb);
if (!s->lsf) {
- UINT8 *sc;
+ uint8_t *sc;
int slen, slen1, slen2;
/* MPEG1 scale factors */
static int decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- UINT8 * buf, int buf_size)
+ uint8_t * buf, int buf_size)
{
MPADecodeContext *s = avctx->priv_data;
- UINT32 header;
- UINT8 *buf_ptr;
+ uint32_t header;
+ uint8_t *buf_ptr;
int len, out_size;
short *out_samples = data;
memcpy(s->inbuf, s->inbuf + 1, s->inbuf_ptr - s->inbuf - 1);
s->inbuf_ptr--;
} else {
- UINT8 *p, *pend;
- UINT32 header1;
+ uint8_t *p, *pend;
+ uint32_t header1;
int padding;
memcpy(s->inbuf_ptr, buf_ptr, len);
-const UINT16 mpa_bitrate_tab[2][3][15] = {
+const uint16_t mpa_bitrate_tab[2][3][15] = {
{ {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 },
{0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 },
{0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } },
}
};
-const UINT16 mpa_freq_tab[3] = { 44100, 48000, 32000 };
+const uint16_t mpa_freq_tab[3] = { 44100, 48000, 32000 };
/*******************************************************/
/* half mpeg encoding window (full precision) */
-const INT32 mpa_enwindow[257] = {
+const int32_t mpa_enwindow[257] = {
0, -1, -1, -1, -1, -1, -1, -2,
-2, -2, -2, -3, -3, -4, -4, -5,
-5, -6, -7, -7, -8, -9, -10, -11,
/* layer 3 tables */
/* layer3 scale factor size */
-static const UINT8 slen_table[2][16] = {
+static const uint8_t slen_table[2][16] = {
{ 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 },
{ 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 },
};
/* number of lsf scale factors for a given size */
-static const UINT8 lsf_nsf_table[6][3][4] = {
+static const uint8_t lsf_nsf_table[6][3][4] = {
{ { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } },
{ { 6, 5, 7, 3 }, { 9, 9, 12, 6 }, { 6, 9, 12, 6 } },
{ { 11, 10, 0, 0 }, { 18, 18, 0, 0 }, { 15, 18, 0, 0 } },
/* mpegaudio layer 3 huffman tables */
-const UINT16 mpa_huffcodes_1[4] = {
+const uint16_t mpa_huffcodes_1[4] = {
0x0001, 0x0001, 0x0001, 0x0000,
};
-const UINT8 mpa_huffbits_1[4] = {
+const uint8_t mpa_huffbits_1[4] = {
1, 3, 2, 3,
};
-const UINT16 mpa_huffcodes_2[9] = {
+const uint16_t mpa_huffcodes_2[9] = {
0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0001, 0x0003, 0x0002,
0x0000,
};
-const UINT8 mpa_huffbits_2[9] = {
+const uint8_t mpa_huffbits_2[9] = {
1, 3, 6, 3, 3, 5, 5, 5,
6,
};
-const UINT16 mpa_huffcodes_3[9] = {
+const uint16_t mpa_huffcodes_3[9] = {
0x0003, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0003, 0x0002,
0x0000,
};
-const UINT8 mpa_huffbits_3[9] = {
+const uint8_t mpa_huffbits_3[9] = {
2, 2, 6, 3, 2, 5, 5, 5,
6,
};
-const UINT16 mpa_huffcodes_5[16] = {
+const uint16_t mpa_huffcodes_5[16] = {
0x0001, 0x0002, 0x0006, 0x0005, 0x0003, 0x0001, 0x0004, 0x0004,
0x0007, 0x0005, 0x0007, 0x0001, 0x0006, 0x0001, 0x0001, 0x0000,
};
-const UINT8 mpa_huffbits_5[16] = {
+const uint8_t mpa_huffbits_5[16] = {
1, 3, 6, 7, 3, 3, 6, 7,
6, 6, 7, 8, 7, 6, 7, 8,
};
-const UINT16 mpa_huffcodes_6[16] = {
+const uint16_t mpa_huffcodes_6[16] = {
0x0007, 0x0003, 0x0005, 0x0001, 0x0006, 0x0002, 0x0003, 0x0002,
0x0005, 0x0004, 0x0004, 0x0001, 0x0003, 0x0003, 0x0002, 0x0000,
};
-const UINT8 mpa_huffbits_6[16] = {
+const uint8_t mpa_huffbits_6[16] = {
3, 3, 5, 7, 3, 2, 4, 5,
4, 4, 5, 6, 6, 5, 6, 7,
};
-const UINT16 mpa_huffcodes_7[36] = {
+const uint16_t mpa_huffcodes_7[36] = {
0x0001, 0x0002, 0x000a, 0x0013, 0x0010, 0x000a, 0x0003, 0x0003,
0x0007, 0x000a, 0x0005, 0x0003, 0x000b, 0x0004, 0x000d, 0x0011,
0x0008, 0x0004, 0x000c, 0x000b, 0x0012, 0x000f, 0x000b, 0x0002,
0x0005, 0x0003, 0x0002, 0x0000,
};
-const UINT8 mpa_huffbits_7[36] = {
+const uint8_t mpa_huffbits_7[36] = {
1, 3, 6, 8, 8, 9, 3, 4,
6, 7, 7, 8, 6, 5, 7, 8,
8, 9, 7, 7, 8, 9, 9, 9,
9, 10, 10, 10,
};
-const UINT16 mpa_huffcodes_8[36] = {
+const uint16_t mpa_huffcodes_8[36] = {
0x0003, 0x0004, 0x0006, 0x0012, 0x000c, 0x0005, 0x0005, 0x0001,
0x0002, 0x0010, 0x0009, 0x0003, 0x0007, 0x0003, 0x0005, 0x000e,
0x0007, 0x0003, 0x0013, 0x0011, 0x000f, 0x000d, 0x000a, 0x0004,
0x0004, 0x0001, 0x0001, 0x0000,
};
-const UINT8 mpa_huffbits_8[36] = {
+const uint8_t mpa_huffbits_8[36] = {
2, 3, 6, 8, 8, 9, 3, 2,
4, 8, 8, 8, 6, 4, 6, 8,
8, 9, 8, 8, 8, 9, 9, 10,
9, 9, 11, 11,
};
-const UINT16 mpa_huffcodes_9[36] = {
+const uint16_t mpa_huffcodes_9[36] = {
0x0007, 0x0005, 0x0009, 0x000e, 0x000f, 0x0007, 0x0006, 0x0004,
0x0005, 0x0005, 0x0006, 0x0007, 0x0007, 0x0006, 0x0008, 0x0008,
0x0008, 0x0005, 0x000f, 0x0006, 0x0009, 0x000a, 0x0005, 0x0001,
0x0006, 0x0002, 0x0006, 0x0000,
};
-const UINT8 mpa_huffbits_9[36] = {
+const uint8_t mpa_huffbits_9[36] = {
3, 3, 5, 6, 8, 9, 3, 3,
4, 5, 6, 8, 4, 4, 5, 6,
7, 8, 6, 5, 6, 7, 7, 8,
8, 8, 9, 9,
};
-const UINT16 mpa_huffcodes_10[64] = {
+const uint16_t mpa_huffcodes_10[64] = {
0x0001, 0x0002, 0x000a, 0x0017, 0x0023, 0x001e, 0x000c, 0x0011,
0x0003, 0x0003, 0x0008, 0x000c, 0x0012, 0x0015, 0x000c, 0x0007,
0x000b, 0x0009, 0x000f, 0x0015, 0x0020, 0x0028, 0x0013, 0x0006,
0x0009, 0x0008, 0x0007, 0x0008, 0x0004, 0x0004, 0x0002, 0x0000,
};
-const UINT8 mpa_huffbits_10[64] = {
+const uint8_t mpa_huffbits_10[64] = {
1, 3, 6, 8, 9, 9, 9, 10,
3, 4, 6, 7, 8, 9, 8, 8,
6, 6, 7, 8, 9, 10, 9, 9,
9, 8, 9, 10, 10, 11, 11, 11,
};
-const UINT16 mpa_huffcodes_11[64] = {
+const uint16_t mpa_huffcodes_11[64] = {
0x0003, 0x0004, 0x000a, 0x0018, 0x0022, 0x0021, 0x0015, 0x000f,
0x0005, 0x0003, 0x0004, 0x000a, 0x0020, 0x0011, 0x000b, 0x000a,
0x000b, 0x0007, 0x000d, 0x0012, 0x001e, 0x001f, 0x0014, 0x0005,
0x000b, 0x0004, 0x0006, 0x0006, 0x0006, 0x0003, 0x0002, 0x0000,
};
-const UINT8 mpa_huffbits_11[64] = {
+const uint8_t mpa_huffbits_11[64] = {
2, 3, 5, 7, 8, 9, 8, 9,
3, 3, 4, 6, 8, 8, 7, 8,
5, 5, 6, 7, 8, 9, 8, 8,
8, 7, 8, 9, 10, 10, 10, 10,
};
-const UINT16 mpa_huffcodes_12[64] = {
+const uint16_t mpa_huffcodes_12[64] = {
0x0009, 0x0006, 0x0010, 0x0021, 0x0029, 0x0027, 0x0026, 0x001a,
0x0007, 0x0005, 0x0006, 0x0009, 0x0017, 0x0010, 0x001a, 0x000b,
0x0011, 0x0007, 0x000b, 0x000e, 0x0015, 0x001e, 0x000a, 0x0007,
0x001b, 0x000c, 0x0008, 0x000c, 0x0006, 0x0003, 0x0001, 0x0000,
};
-const UINT8 mpa_huffbits_12[64] = {
+const uint8_t mpa_huffbits_12[64] = {
4, 3, 5, 7, 8, 9, 9, 9,
3, 3, 4, 5, 7, 7, 8, 8,
5, 4, 5, 6, 7, 8, 7, 8,
9, 8, 8, 9, 9, 9, 9, 10,
};
-const UINT16 mpa_huffcodes_13[256] = {
+const uint16_t mpa_huffcodes_13[256] = {
0x0001, 0x0005, 0x000e, 0x0015, 0x0022, 0x0033, 0x002e, 0x0047,
0x002a, 0x0034, 0x0044, 0x0034, 0x0043, 0x002c, 0x002b, 0x0013,
0x0003, 0x0004, 0x000c, 0x0013, 0x001f, 0x001a, 0x002c, 0x0021,
0x0011, 0x000c, 0x0010, 0x0008, 0x0001, 0x0001, 0x0000, 0x0001,
};
-const UINT8 mpa_huffbits_13[256] = {
+const uint8_t mpa_huffbits_13[256] = {
1, 4, 6, 7, 8, 9, 9, 10,
9, 10, 11, 11, 12, 12, 13, 13,
3, 4, 6, 7, 8, 8, 9, 9,
15, 15, 16, 16, 19, 18, 19, 16,
};
-const UINT16 mpa_huffcodes_15[256] = {
+const uint16_t mpa_huffcodes_15[256] = {
0x0007, 0x000c, 0x0012, 0x0035, 0x002f, 0x004c, 0x007c, 0x006c,
0x0059, 0x007b, 0x006c, 0x0077, 0x006b, 0x0051, 0x007a, 0x003f,
0x000d, 0x0005, 0x0010, 0x001b, 0x002e, 0x0024, 0x003d, 0x0033,
0x0015, 0x0010, 0x000a, 0x0006, 0x0008, 0x0006, 0x0002, 0x0000,
};
-const UINT8 mpa_huffbits_15[256] = {
+const uint8_t mpa_huffbits_15[256] = {
3, 4, 5, 7, 7, 8, 9, 9,
9, 10, 10, 11, 11, 11, 12, 13,
4, 3, 5, 6, 7, 7, 8, 8,
12, 12, 12, 12, 13, 13, 13, 13,
};
-const UINT16 mpa_huffcodes_16[256] = {
+const uint16_t mpa_huffcodes_16[256] = {
0x0001, 0x0005, 0x000e, 0x002c, 0x004a, 0x003f, 0x006e, 0x005d,
0x00ac, 0x0095, 0x008a, 0x00f2, 0x00e1, 0x00c3, 0x0178, 0x0011,
0x0003, 0x0004, 0x000c, 0x0014, 0x0023, 0x003e, 0x0035, 0x002f,
0x000d, 0x000c, 0x000a, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
};
-const UINT8 mpa_huffbits_16[256] = {
+const uint8_t mpa_huffbits_16[256] = {
1, 4, 6, 8, 9, 9, 10, 10,
11, 11, 11, 12, 12, 12, 13, 9,
3, 4, 6, 7, 8, 9, 9, 9,
11, 11, 11, 11, 11, 11, 11, 8,
};
-const UINT16 mpa_huffcodes_24[256] = {
+const uint16_t mpa_huffcodes_24[256] = {
0x000f, 0x000d, 0x002e, 0x0050, 0x0092, 0x0106, 0x00f8, 0x01b2,
0x01aa, 0x029d, 0x028d, 0x0289, 0x026d, 0x0205, 0x0408, 0x0058,
0x000e, 0x000c, 0x0015, 0x0026, 0x0047, 0x0082, 0x007a, 0x00d8,
0x0007, 0x0006, 0x0004, 0x0007, 0x0005, 0x0003, 0x0001, 0x0003,
};
-const UINT8 mpa_huffbits_24[256] = {
+const uint8_t mpa_huffbits_24[256] = {
4, 4, 6, 7, 8, 9, 9, 10,
10, 11, 11, 11, 11, 11, 12, 9,
4, 4, 5, 6, 7, 8, 8, 9,
{ 16, mpa_huffbits_24, mpa_huffcodes_24 },
};
-const UINT8 mpa_huff_data[32][2] = {
+const uint8_t mpa_huff_data[32][2] = {
{ 0, 0 },
{ 1, 0 },
{ 2, 0 },
/* huffman tables for quadrules */
-static UINT8 mpa_quad_codes[2][16] = {
+static uint8_t mpa_quad_codes[2][16] = {
{ 1, 5, 4, 5, 6, 5, 4, 4, 7, 3, 6, 0, 7, 2, 3, 1, },
{ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, },
};
-static UINT8 mpa_quad_bits[2][16] = {
+static uint8_t mpa_quad_bits[2][16] = {
{ 1, 4, 4, 5, 4, 6, 5, 6, 4, 5, 5, 6, 5, 6, 6, 6, },
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
};
/* band size tables */
-const UINT8 band_size_long[9][22] = {
+const uint8_t band_size_long[9][22] = {
{ 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10,
12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, }, /* 44100 */
{ 4, 4, 4, 4, 4, 4, 6, 6, 6, 8, 10,
40, 48, 56, 64, 76, 90, 2, 2, 2, 2, 2, }, /* 8000 */
};
-const UINT8 band_size_short[9][13] = {
+const uint8_t band_size_short[9][13] = {
{ 4, 4, 4, 4, 6, 8, 10, 12, 14, 18, 22, 30, 56, }, /* 44100 */
{ 4, 4, 4, 4, 6, 6, 10, 12, 14, 16, 20, 26, 66, }, /* 48000 */
{ 4, 4, 4, 4, 6, 8, 12, 16, 20, 26, 34, 42, 12, }, /* 32000 */
{ 8, 8, 8, 12, 16, 20, 24, 28, 36, 2, 2, 2, 26, }, /* 8000 */
};
-const UINT8 mpa_pretab[2][22] = {
+const uint8_t mpa_pretab[2][22] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 },
};