Commit bb270c08 authored by Diego Biurrun's avatar Diego Biurrun

COSMETICS: tabs --> spaces, some prettyprinting

Originally committed as revision 4764 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 50827fcf
......@@ -96,7 +96,7 @@ unknown_opt:
if(po->u.func2_arg(opt+1, arg)<0)
goto unknown_opt;
} else {
po->u.func_arg(arg);
po->u.func_arg(arg);
}
} else {
parse_arg_file(opt);
......@@ -122,8 +122,8 @@ void print_error(const char *filename, int err)
break;
case AVERROR_IO:
fprintf(stderr, "%s: I/O error occured\n"
"Usually that means that input file is truncated and/or corrupted.\n",
filename);
"Usually that means that input file is truncated and/or corrupted.\n",
filename);
break;
case AVERROR_NOMEM:
fprintf(stderr, "%s: memory allocation error occured\n", filename);
......
......@@ -688,26 +688,26 @@ fi
needmdynamicnopic="no"
if test $targetos = Darwin; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then
CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
else
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
case "$gcc_version" in
*2.95*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
;;
*[34].*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
if test "$lshared" = no; then
needmdynamicnopic="yes"
fi
;;
*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
if test "$lshared" = no; then
needmdynamicnopic="yes"
fi
;;
esac
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
case "$gcc_version" in
*2.95*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
;;
*[34].*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
if test "$lshared" = no; then
needmdynamicnopic="yes"
fi
;;
*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
if test "$lshared" = no; then
needmdynamicnopic="yes"
fi
;;
esac
fi
fi
......@@ -725,62 +725,62 @@ TUNECPU="generic"
POWERPCMODE="32bits"
if test $tune != "generic"; then
case $tune in
601|ppc601|PowerPC601)
CFLAGS="$CFLAGS -mcpu=601"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
fi
TUNECPU=ppc601
;;
603*|ppc603*|PowerPC603*)
CFLAGS="$CFLAGS -mcpu=603"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
fi
TUNECPU=ppc603
;;
604*|ppc604*|PowerPC604*)
CFLAGS="$CFLAGS -mcpu=604"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
fi
TUNECPU=ppc604
;;
G3|g3|75*|ppc75*|PowerPC75*)
CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
fi
TUNECPU=ppc750
;;
G4|g4|745*|ppc745*|PowerPC745*)
CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
fi
TUNECPU=ppc7450
;;
74*|ppc74*|PowerPC74*)
CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
fi
TUNECPU=ppc7400
;;
G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
fi
TUNECPU=ppc970
601|ppc601|PowerPC601)
CFLAGS="$CFLAGS -mcpu=601"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
fi
TUNECPU=ppc601
;;
603*|ppc603*|PowerPC603*)
CFLAGS="$CFLAGS -mcpu=603"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
fi
TUNECPU=ppc603
;;
604*|ppc604*|PowerPC604*)
CFLAGS="$CFLAGS -mcpu=604"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
fi
TUNECPU=ppc604
;;
G3|g3|75*|ppc75*|PowerPC75*)
CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
if test $altivec = "yes"; then
echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
fi
TUNECPU=ppc750
;;
G4|g4|745*|ppc745*|PowerPC745*)
CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
fi
TUNECPU=ppc7450
;;
74*|ppc74*|PowerPC74*)
CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
fi
TUNECPU=ppc7400
;;
G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
if test $altivec = "no"; then
echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
fi
TUNECPU=ppc970
POWERPCMODE="64bits"
;;
i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
CFLAGS="$CFLAGS -march=$tune"
;;
*)
echo "WARNING: Unknown CPU \"$tune\", ignored."
;;
;;
i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
CFLAGS="$CFLAGS -march=$tune"
;;
*)
echo "WARNING: Unknown CPU \"$tune\", ignored."
;;
esac
fi
......@@ -876,8 +876,8 @@ if test -z "$cross_prefix" ; then
cat > $TMPC << EOF
#include <inttypes.h>
int main(int argc, char ** argv){
volatile uint32_t i=0x01234567;
return (*((uint8_t*)(&i))) == 0x67;
volatile uint32_t i=0x01234567;
return (*((uint8_t*)(&i))) == 0x67;
}
EOF
......@@ -912,8 +912,8 @@ $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
cat > $TMPC << EOF
#include <inttypes.h>
int main(int argc, char ** argv){
volatile uint_fast64_t i=0x01234567;
return 0;
volatile uint_fast64_t i=0x01234567;
return 0;
}
EOF
......@@ -1152,10 +1152,10 @@ fi
case "`$cc -v 2>&1 | grep version`" in
*gcc*)
CFLAGS="-Wall -Wno-switch $CFLAGS"
;;
CFLAGS="-Wall -Wno-switch $CFLAGS"
;;
*)
;;
;;
esac
if test "$sdl" = "no" ; then
......@@ -1163,7 +1163,7 @@ if test "$sdl" = "no" ; then
fi
if test "$debug" = "yes"; then
CFLAGS="-g $CFLAGS"
CFLAGS="-g $CFLAGS"
fi
if test "$optimize" = "small"; then
......@@ -1173,10 +1173,10 @@ fi
if test "$optimize" = "yes"; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then
CFLAGS="$CFLAGS -O5"
LDFLAGS="$LDFLAGS -O5"
CFLAGS="$CFLAGS -O5"
LDFLAGS="$LDFLAGS -O5"
else
CFLAGS="-O3 $CFLAGS"
CFLAGS="-O3 $CFLAGS"
fi
fi
......@@ -1793,9 +1793,9 @@ done
diff $TMPH config.h >/dev/null 2>&1
if test $? -ne 0 ; then
mv -f $TMPH config.h
mv -f $TMPH config.h
else
echo "config.h is unchanged"
echo "config.h is unchanged"
fi
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
......
......@@ -25,37 +25,37 @@ main(int argc, char *argv[])
if (argc < 3)
{
printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
exit(1);
printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
exit(1);
}
fd_in = open(argv[1], O_RDONLY);
if (fd_in < 0)
{
perror("Error while opening: ");
exit(1);
perror("Error while opening: ");
exit(1);
}
fd_out = open(argv[2], O_WRONLY|O_CREAT, 00644);
if (fd_out < 0)
{
perror("Error while opening: ");
close(fd_in);
exit(1);
perror("Error while opening: ");
close(fd_in);
exit(1);
}
if (read(fd_in, &buf_in, 8) != 8)
{
printf("Header error\n");
close(fd_in);
close(fd_out);
exit(1);
printf("Header error\n");
close(fd_in);
close(fd_out);
exit(1);
}
if (buf_in[0] != 'C' || buf_in[1] != 'W' || buf_in[2] != 'S')
{
printf("Not a compressed flash file\n");
exit(1);
printf("Not a compressed flash file\n");
exit(1);
}
fstat(fd_in, &statbuf);
......@@ -75,48 +75,48 @@ main(int argc, char *argv[])
for (i = 0; i < comp_len-4;)
{
int ret, len = read(fd_in, &buf_in, 1024);
int ret, len = read(fd_in, &buf_in, 1024);
dbgprintf("read %d bytes\n", len);
dbgprintf("read %d bytes\n", len);
last_out = zstream.total_out;
last_out = zstream.total_out;
zstream.next_in = &buf_in[0];
zstream.avail_in = len;
zstream.next_out = &buf_out[0];
zstream.avail_out = 1024;
zstream.next_in = &buf_in[0];
zstream.avail_in = len;
zstream.next_out = &buf_out[0];
zstream.avail_out = 1024;
ret = inflate(&zstream, Z_SYNC_FLUSH);
if (ret == Z_STREAM_END || ret == Z_BUF_ERROR)
break;
if (ret != Z_OK)
{
printf("Error while decompressing: %d\n", ret);
inflateEnd(&zstream);
exit(1);
}
ret = inflate(&zstream, Z_SYNC_FLUSH);
if (ret == Z_STREAM_END || ret == Z_BUF_ERROR)
break;
if (ret != Z_OK)
{
printf("Error while decompressing: %d\n", ret);
inflateEnd(&zstream);
exit(1);
}
dbgprintf("a_in: %d t_in: %d a_out: %d t_out: %d -- %d out\n",
zstream.avail_in, zstream.total_in, zstream.avail_out, zstream.total_out,
zstream.total_out-last_out);
dbgprintf("a_in: %d t_in: %d a_out: %d t_out: %d -- %d out\n",
zstream.avail_in, zstream.total_in, zstream.avail_out, zstream.total_out,
zstream.total_out-last_out);
write(fd_out, &buf_out, zstream.total_out-last_out);
write(fd_out, &buf_out, zstream.total_out-last_out);
i += len;
i += len;
}
if (zstream.total_out != uncomp_len-8)
{
printf("Size mismatch (%d != %d), updating header...\n",
zstream.total_out, uncomp_len-8);
printf("Size mismatch (%d != %d), updating header...\n",
zstream.total_out, uncomp_len-8);
buf_in[0] = (zstream.total_out+8) & 0xff;
buf_in[1] = (zstream.total_out+8 >> 8) & 0xff;
buf_in[2] = (zstream.total_out+8 >> 16) & 0xff;
buf_in[3] = (zstream.total_out+8 >> 24) & 0xff;
buf_in[0] = (zstream.total_out+8) & 0xff;
buf_in[1] = (zstream.total_out+8 >> 8) & 0xff;
buf_in[2] = (zstream.total_out+8 >> 16) & 0xff;
buf_in[3] = (zstream.total_out+8 >> 24) & 0xff;
lseek(fd_out, 4, SEEK_SET);
write(fd_out, &buf_in, 4);
lseek(fd_out, 4, SEEK_SET);
write(fd_out, &buf_in, 4);
}
inflateEnd(&zstream);
......
This diff is collapsed.
......@@ -579,7 +579,7 @@ static void do_audio_out(AVFormatContext *s,
break;
}
ret = avcodec_encode_audio(enc, audio_out, size_out,
(short *)buftmp);
(short *)buftmp);
audio_size += ret;
pkt.stream_index= ost->index;
pkt.data= audio_out;
......@@ -821,10 +821,10 @@ static void do_video_out(AVFormatContext *s,
padcolor);
}
if (enc->pix_fmt != PIX_FMT_YUV420P) {
if (enc->pix_fmt != PIX_FMT_YUV420P) {
int size;
av_free(buf);
av_free(buf);
/* create temporary picture */
size = avpicture_get_size(enc->pix_fmt, enc->width, enc->height);
buf = av_malloc(size);
......@@ -842,7 +842,7 @@ static void do_video_out(AVFormatContext *s,
goto the_end;
}
}
}
} else if (ost->video_crop) {
picture_crop_temp.data[0] = formatted_picture->data[0] +
(ost->topBand * formatted_picture->linesize[0]) + ost->leftBand;
......@@ -921,7 +921,7 @@ static void do_video_out(AVFormatContext *s,
avoid any copies. We support temorarily the older
method. */
AVFrame* old_frame = enc->coded_frame;
enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
pkt.data= (uint8_t *)final_picture;
pkt.size= sizeof(AVPicture);
if(dec->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
......@@ -930,7 +930,7 @@ static void do_video_out(AVFormatContext *s,
pkt.flags |= PKT_FLAG_KEY;
av_interleaved_write_frame(s, &pkt);
enc->coded_frame = old_frame;
enc->coded_frame = old_frame;
} else {
AVFrame big_picture;
......@@ -1044,8 +1044,8 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
}
static void print_report(AVFormatContext **output_files,
AVOutputStream **ost_table, int nb_ostreams,
int is_last_report)
AVOutputStream **ost_table, int nb_ostreams,
int is_last_report)
{
char buf[1024];
AVOutputStream *ost;
......@@ -1138,9 +1138,9 @@ static void print_report(AVFormatContext **output_files,
"size=%8.0fkB time=%0.1f bitrate=%6.1fkbits/s",
(double)total_size / 1024, ti1, bitrate);
if (verbose > 1)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
nb_frames_dup, nb_frames_drop);
if (verbose > 1)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
nb_frames_dup, nb_frames_drop);
if (verbose >= 0)
fprintf(stderr, "%s \r", buf);
......@@ -1323,7 +1323,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
}
#endif
/* if output time reached then transcode raw format,
encode packets and output them */
encode packets and output them */
if (start_time == 0 || ist->pts >= start_time)
for(i=0;i<nb_ostreams;i++) {
int frame_size;
......@@ -1898,7 +1898,7 @@ static int av_encode(AVFormatContext **output_files,
/* init pts */
for(i=0;i<nb_istreams;i++) {
ist = ist_table[i];
is = input_files[ist->file_index];
is = input_files[ist->file_index];
ist->pts = 0;
ist->next_pts = av_rescale_q(ist->st->start_time, ist->st->time_base, AV_TIME_BASE_Q);
if(ist->st->start_time == AV_NOPTS_VALUE)
......@@ -2273,7 +2273,7 @@ static void opt_frame_rate(const char *arg)
{
if (parse_frame_rate(&frame_rate, &frame_rate_base, arg) < 0) {
fprintf(stderr, "Incorrect frame rate\n");
exit(1);
exit(1);
}
}
......@@ -2289,7 +2289,7 @@ static void opt_frame_crop_top(const char *arg)
exit(1);
}
if ((frame_topBand) >= frame_height){
fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_height -= frame_topBand;
......@@ -2307,7 +2307,7 @@ static void opt_frame_crop_bottom(const char *arg)
exit(1);
}
if ((frame_bottomBand) >= frame_height){
fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_height -= frame_bottomBand;
......@@ -2325,7 +2325,7 @@ static void opt_frame_crop_left(const char *arg)
exit(1);
}
if ((frame_leftBand) >= frame_width){
fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_width -= frame_leftBand;
......@@ -2343,7 +2343,7 @@ static void opt_frame_crop_right(const char *arg)
exit(1);
}
if ((frame_rightBand) >= frame_width){
fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_width -= frame_rightBand;
......@@ -2364,7 +2364,7 @@ static void opt_frame_size(const char *arg)
#define SCALEBITS 10
#define ONE_HALF (1 << (SCALEBITS - 1))
#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define RGB_TO_Y(r, g, b) \
((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \
......@@ -2462,16 +2462,16 @@ static void opt_frame_aspect_ratio(const char *arg)
p = strchr(arg, ':');
if (p) {
x = strtol(arg, (char **)&arg, 10);
if (arg == p)
y = strtol(arg+1, (char **)&arg, 10);
if (x > 0 && y > 0)
ar = (double)x / (double)y;
if (arg == p)
y = strtol(arg+1, (char **)&arg, 10);
if (x > 0 && y > 0)
ar = (double)x / (double)y;
} else
ar = strtod(arg, (char **)&arg);
if (!ar) {
fprintf(stderr, "Incorrect aspect ratio specification.\n");
exit(1);
exit(1);
}
frame_aspect_ratio = ar;
}
......@@ -2957,8 +2957,8 @@ static void opt_input_file(const char *filename)
}
frame_height = enc->height;
frame_width = enc->width;
frame_aspect_ratio = av_q2d(enc->sample_aspect_ratio) * enc->width / enc->height;
frame_pix_fmt = enc->pix_fmt;
frame_aspect_ratio = av_q2d(enc->sample_aspect_ratio) * enc->width / enc->height;
frame_pix_fmt = enc->pix_fmt;
rfps = ic->streams[i]->r_frame_rate.num;
rfps_base = ic->streams[i]->r_frame_rate.den;
enc->workaround_bugs = workaround_bugs;
......@@ -3454,7 +3454,7 @@ static void opt_output_file(const char *filename)
oc->timestamp = rec_timestamp;
if (str_title)
if (str_title)
pstrcpy(oc->title, sizeof(oc->title), str_title);
if (str_author)
pstrcpy(oc->author, sizeof(oc->author), str_author);
......@@ -3490,11 +3490,11 @@ static void opt_output_file(const char *filename)
fprintf(stderr, "Not overwriting - exiting\n");
exit(1);
}
}
else {
}
else {
fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
exit(1);
}
}
}
}
......@@ -3579,14 +3579,14 @@ static void prepare_grab(void)
fmt1 = av_find_input_format(video_grab_format);
vp->device = video_device;
vp->channel = video_channel;
vp->standard = video_standard;
vp->standard = video_standard;
if (av_open_input_file(&ic, "", fmt1, 0, vp) < 0) {
fprintf(stderr, "Could not find video grab device\n");
exit(1);
}
/* If not enough info to get the stream parameters, we decode the
first frames to get it. */
if ((ic->ctx_flags & AVFMTCTX_NOHEADER) && av_find_stream_info(ic) < 0) {
if ((ic->ctx_flags & AVFMTCTX_NOHEADER) && av_find_stream_info(ic) < 0) {
fprintf(stderr, "Could not find video grab parameters\n");
exit(1);
}
......@@ -4276,11 +4276,11 @@ int main(int argc, char **argv)
for(i=0;i<nb_output_files;i++) {
/* maybe av_close_output_file ??? */
AVFormatContext *s = output_files[i];
int j;
int j;
if (!(s->oformat->flags & AVFMT_NOFILE))
url_fclose(&s->pb);
for(j=0;j<s->nb_streams;j++)
av_free(s->streams[j]);
url_fclose(&s->pb);
for(j=0;j<s->nb_streams;j++)
av_free(s->streams[j]);
av_free(s);
}
for(i=0;i<nb_input_files;i++)
......
......@@ -1649,7 +1649,7 @@ static int stream_component_open(VideoState *is, int stream_index)
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
packet_queue_init(&is->audioq);
SDL_PauseAudio(0);
SDL_PauseAudio(0);
break;
case CODEC_TYPE_VIDEO:
is->video_stream = stream_index;
......@@ -1937,11 +1937,11 @@ static int decode_thread(void *arg)
}
ret = av_read_frame(ic, pkt);
if (ret < 0) {
if (url_ferror(&ic->pb) == 0) {
if (url_ferror(&ic->pb) == 0) {
SDL_Delay(100); /* wait for user event */
continue;
} else
break;
continue;
} else
break;
}
if (pkt->stream_index == is->audio_stream) {
packet_queue_put(&is->audioq, pkt);
......@@ -2224,23 +2224,23 @@ void event_loop(void)
}
break;
case SDL_MOUSEBUTTONDOWN:
if (cur_stream) {
int ns, hh, mm, ss;
int tns, thh, tmm, tss;
tns = cur_stream->ic->duration/1000000LL;
thh = tns/3600;
tmm = (tns%3600)/60;
tss = (tns%60);
frac = (double)event.button.x/(double)cur_stream->width;
ns = frac*tns;
hh = ns/3600;
mm = (ns%3600)/60;
ss = (ns%60);
fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d) \n", frac*100,
hh, mm, ss, thh, tmm, tss);
stream_seek(cur_stream, (int64_t)(cur_stream->ic->start_time+frac*cur_stream->ic->duration), 0);
}
break;
if (cur_stream) {
int ns, hh, mm, ss;
int tns, thh, tmm, tss;
tns = cur_stream->ic->duration/1000000LL;
thh = tns/3600;
tmm = (tns%3600)/60;
tss = (tns%60);
frac = (double)event.button.x/(double)cur_stream->width;
ns = frac*tns;
hh = ns/3600;
mm = (ns%3600)/60;
ss = (ns%60);
fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d) \n", frac*100,
hh, mm, ss, thh, tmm, tss);
stream_seek(cur_stream, (int64_t)(cur_stream->ic->start_time+frac*cur_stream->ic->duration), 0);
}
break;
case SDL_VIDEORESIZE:
if (cur_stream) {
screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
......@@ -2452,7 +2452,7 @@ int main(int argc, char **argv)
if (dpy) {
fs_screen_width = DisplayWidth(dpy, DefaultScreen(dpy));
fs_screen_height = DisplayHeight(dpy, DefaultScreen(dpy));
XCloseDisplay(dpy);
XCloseDisplay(dpy);
}
}
#endif
......
......@@ -1204,7 +1204,7 @@ static int http_parse_request(HTTPContext *c)
pstrcpy(c->protocol, sizeof(c->protocol), protocol);
if (ffserver_debug)
http_log("New connection: %s %s\n", cmd, url);
http_log("New connection: %s %s\n", cmd, url);
/* find the filename and the optional info string in the request */
p = url;
......@@ -2001,7 +2001,7 @@ static int http_prepare_data(HTTPContext *c)
c->fmt_ctx.nb_streams = c->stream->nb_streams;
for(i=0;i<c->fmt_ctx.nb_streams;i++) {
AVStream *st;
AVStream *src;
AVStream *src;
st = av_mallocz(sizeof(AVStream));
st->codec= avcodec_alloc_context();
c->fmt_ctx.streams[i] = st;
......@@ -2012,8 +2012,8 @@ static int http_prepare_data(HTTPContext *c)
else
src = c->stream->feed->streams[c->stream->feed_streams[i]];
*st = *src;
st->priv_data = 0;
*st = *src;
st->priv_data = 0;
st->codec->frame_number = 0; /* XXX: should be done in
AVStream, not in codec */
/* I'm pretty sure that this is not correct...
......@@ -2452,8 +2452,8 @@ static int http_receive_data(HTTPContext *c)
s.priv_data = av_mallocz(fmt_in->priv_data_size);
if (!s.priv_data)
goto fail;
} else
s.priv_data = NULL;
} else
s.priv_data = NULL;
if (fmt_in->read_header(&s, 0) < 0) {
av_freep(&s.priv_data);
......@@ -3868,20 +3868,20 @@ static int parse_ffconfig(const char *filename)
feed->child_argv[i] = av_malloc(30 + strlen(feed->filename));
snprintf(feed->child_argv[i], 30+strlen(feed->filename),
"http://%s:%d/%s",
(my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
inet_ntoa(my_http_addr.sin_addr),
ntohs(my_http_addr.sin_port), feed->filename);
if (ffserver_debug)
{
int j;
fprintf(stdout, "Launch commandline: ");
for (j = 0; j <= i; j++)
fprintf(stdout, "%s ", feed->child_argv[j]);
fprintf(stdout, "\n");
}
snprintf(feed->child_argv[i], 30+strlen(feed->filename),
"http://%s:%d/%s",
(my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
inet_ntoa(my_http_addr.sin_addr),
ntohs(my_http_addr.sin_port), feed->filename);
if (ffserver_debug)
{
int j;
fprintf(stdout, "Launch commandline: ");
for (j = 0; j <= i; j++)
fprintf(stdout, "%s ", feed->child_argv[j]);
fprintf(stdout, "\n");
}
}
} else if (!strcasecmp(cmd, "ReadOnlyFile")) {
if (feed) {
......@@ -4074,8 +4074,8 @@ static int parse_ffconfig(const char *filename)
if (stream) {
audio_enc.sample_rate = atoi(arg);
}
} else if (!strcasecmp(cmd, "AudioQuality")) {
get_arg(arg, sizeof(arg), &p);
} else if (!strcasecmp(cmd, "AudioQuality")) {
get_arg(arg, sizeof(arg), &p);
if (stream) {
// audio_enc.quality = atof(arg) * 1000;
}
......
This diff is collapsed.
......@@ -58,11 +58,11 @@ typedef struct AC3DecodeState {
a52_state_t* (*a52_init)(uint32_t mm_accel);
sample_t* (*a52_samples)(a52_state_t * state);
int (*a52_syncinfo)(uint8_t * buf, int * flags,
int * sample_rate, int * bit_rate);
int * sample_rate, int * bit_rate);
int (*a52_frame)(a52_state_t * state, uint8_t * buf, int * flags,
sample_t * level, sample_t bias);
sample_t * level, sample_t bias);
void (*a52_dynrng)(a52_state_t * state,
sample_t (* call) (sample_t, void *), void * data);
sample_t (* call) (sample_t, void *), void * data);
int (*a52_block)(a52_state_t * state);
void (*a52_free)(a52_state_t * state);
......@@ -105,7 +105,7 @@ static int a52_decode_init(AVCodecContext *avctx)
if (!s->a52_init || !s->a52_samples || !s->a52_syncinfo
|| !s->a52_frame || !s->a52_block || !s->a52_free)
{
dlclose(s->handle);
dlclose(s->handle);
return -1;
}
#else
......@@ -130,22 +130,22 @@ static int a52_decode_init(AVCodecContext *avctx)
static inline int blah (int32_t i)
{
if (i > 0x43c07fff)
return 32767;
return 32767;
else if (i < 0x43bf8000)
return -32768;
return -32768;
return i - 0x43c00000;
}
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
int32_t * f = (int32_t *) _f; // XXX assumes IEEE float format
j = 0;
nchannels *= 256;
for (i = 0; i < 256; i++) {
for (c = 0; c < nchannels; c += 256)
s16[j++] = blah (f[i + c]);
for (c = 0; c < nchannels; c += 256)
s16[j++] = blah (f[i + c]);
}
}
......@@ -164,7 +164,7 @@ static int a52_decode_frame(AVCodecContext *avctx,
short *out_samples = data;
float level;
static const int ac3_channels[8] = {
2, 1, 2, 3, 3, 4, 4, 5
2, 1, 2, 3, 3, 4, 4, 5
};
buf_ptr = buf;
......@@ -186,20 +186,20 @@ static int a52_decode_frame(AVCodecContext *avctx,
memcpy(s->inbuf, s->inbuf + 1, HEADER_SIZE - 1);
s->inbuf_ptr--;
} else {
s->frame_size = len;
s->frame_size = len;
/* update codec info */
avctx->sample_rate = sample_rate;
s->channels = ac3_channels[s->flags & 7];
if (s->flags & A52_LFE)
s->channels++;
if (avctx->channels == 0)
/* No specific number of channel requested */
avctx->channels = s->channels;
else if (s->channels < avctx->channels) {
av_log(avctx, AV_LOG_ERROR, "ac3dec: AC3 Source channels are less than specified: output to %d channels.. (frmsize: %d)\n", s->channels, len);
avctx->channels = s->channels;
}
avctx->bit_rate = bit_rate;
s->channels++;
if (avctx->channels == 0)
/* No specific number of channel requested */
avctx->channels = s->channels;
else if (s->channels < avctx->channels) {
av_log(avctx, AV_LOG_ERROR, "ac3dec: AC3 Source channels are less than specified: output to %d channels.. (frmsize: %d)\n", s->channels, len);
avctx->channels = s->channels;
}
avctx->bit_rate = bit_rate;
}
}
} else if (len < s->frame_size) {
......
......@@ -54,23 +54,23 @@ stream_samples_t samples;
static inline int blah (int32_t i)
{
if (i > 0x43c07fff)
return 32767;
return 32767;
else if (i < 0x43bf8000)
return -32768;
return -32768;
else
return i - 0x43c00000;
return i - 0x43c00000;
}
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
int32_t * f = (int32_t *) _f; // XXX assumes IEEE float format
j = 0;
nchannels *= 256;
for (i = 0; i < 256; i++) {
for (c = 0; c < nchannels; c += 256)
s16[j++] = blah (f[i + c]);
for (c = 0; c < nchannels; c += 256)
s16[j++] = blah (f[i + c]);
}
}
......@@ -89,7 +89,7 @@ static int ac3_decode_frame(AVCodecContext *avctx,
short *out_samples = data;
float level;
static const int ac3_channels[8] = {
2, 1, 2, 3, 3, 4, 4, 5
2, 1, 2, 3, 3, 4, 4, 5
};
buf_ptr = buf;
......@@ -111,20 +111,20 @@ static int ac3_decode_frame(AVCodecContext *avctx,
memcpy(s->inbuf, s->inbuf + 1, HEADER_SIZE - 1);
s->inbuf_ptr--;
} else {
s->frame_size = len;
s->frame_size = len;
/* update codec info */
avctx->sample_rate = sample_rate;
s->channels = ac3_channels[s->flags & 7];
if (s->flags & AC3_LFE)
s->channels++;
if (avctx->channels == 0)
/* No specific number of channel requested */
avctx->channels = s->channels;
else if (s->channels < avctx->channels) {
s->channels++;
if (avctx->channels == 0)
/* No specific number of channel requested */
avctx->channels = s->channels;
else if (s->channels < avctx->channels) {
av_log( avctx, AV_LOG_INFO, "ac3dec: AC3 Source channels are less than specified: output to %d channels.. (frmsize: %d)\n", s->channels, len);
avctx->channels = s->channels;
}
avctx->bit_rate = bit_rate;
avctx->channels = s->channels;
}
avctx->bit_rate = bit_rate;
}
}
} else if (len < s->frame_size) {
......
......@@ -337,8 +337,8 @@ static void fft_init(int ln)
/* do a 2^n point complex fft on 2^ln points. */
static void fft(IComplex *z, int ln)
{
int j, l, np, np2;
int nblocks, nloops;
int j, l, np, np2;
int nblocks, nloops;
register IComplex *p,*q;
int tmp_re, tmp_im;
......@@ -472,7 +472,7 @@ static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNEL
exp_strategy[i][ch] = EXP_REUSE;
}
if (is_lfe)
return;
return;
/* now select the encoding strategy type : if exponents are often
recoded, we use a coarse encoding */
......@@ -493,7 +493,7 @@ static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNEL
exp_strategy[i][ch] = EXP_D15;
break;
}
i = j;
i = j;
}
}
......@@ -553,9 +553,9 @@ static int encode_exp(uint8_t encoded_exp[N/2],
/* Decrease the delta between each groups to within 2
* so that they can be differentially encoded */
for (i=1;i<=nb_groups;i++)
exp1[i] = FFMIN(exp1[i], exp1[i-1] + 2);
exp1[i] = FFMIN(exp1[i], exp1[i-1] + 2);
for (i=nb_groups-1;i>=0;i--)
exp1[i] = FFMIN(exp1[i], exp1[i+1] + 2);
exp1[i] = FFMIN(exp1[i], exp1[i+1] + 2);
/* now we have the exponent values the decoder will see */
encoded_exp[0] = exp1[0];
......@@ -708,8 +708,8 @@ static int compute_bit_allocation(AC3EncodeContext *s,
if(i==0) frame_bits += 4;
}
frame_bits += 2 * s->nb_channels; /* chexpstr[2] * c */
if (s->lfe)
frame_bits++; /* lfeexpstr */
if (s->lfe)
frame_bits++; /* lfeexpstr */
for(ch=0;ch<s->nb_channels;ch++) {
if (exp_strategy[i][ch] != EXP_REUSE)
frame_bits += 6 + 2; /* chbwcod[6], gainrng[2] */
......@@ -736,11 +736,11 @@ static int compute_bit_allocation(AC3EncodeContext *s,
csnroffst = s->csnroffst;
while (csnroffst >= 0 &&
bit_alloc(s, bap, encoded_exp, exp_strategy, frame_bits, csnroffst, 0) < 0)
csnroffst -= SNR_INC1;
bit_alloc(s, bap, encoded_exp, exp_strategy, frame_bits, csnroffst, 0) < 0)
csnroffst -= SNR_INC1;
if (csnroffst < 0) {
av_log(NULL, AV_LOG_ERROR, "Yack, Error !!!\n");
return -1;
av_log(NULL, AV_LOG_ERROR, "Yack, Error !!!\n");
return -1;
}
while ((csnroffst + SNR_INC1) <= 63 &&
bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits,
......@@ -815,19 +815,19 @@ static int AC3_encode_init(AVCodecContext *avctx)
int i, j, ch;
float alpha;
static const uint8_t acmod_defs[6] = {
0x01, /* C */
0x02, /* L R */
0x03, /* L C R */
0x06, /* L R SL SR */
0x07, /* L C R SL SR */
0x07, /* L C R SL SR (+LFE) */
0x01, /* C */
0x02, /* L R */
0x03, /* L C R */
0x06, /* L R SL SR */
0x07, /* L C R SL SR */
0x07, /* L C R SL SR (+LFE) */
};
avctx->frame_size = AC3_FRAME_SIZE;
/* number of channels */
if (channels < 1 || channels > 6)
return -1;
return -1;
s->acmod = acmod_defs[channels - 1];
s->lfe = (channels == 6) ? 1 : 0;
s->nb_all_channels = channels;
......@@ -871,7 +871,7 @@ static int AC3_encode_init(AVCodecContext *avctx)
s->nb_coefs[ch] = ((s->chbwcod[ch] + 12) * 3) + 37;
}
if (s->lfe) {
s->nb_coefs[s->lfe_channel] = 7; /* fixed */
s->nb_coefs[s->lfe_channel] = 7; /* fixed */
}
/* initial snr offset */
s->csnroffst = 40;
......@@ -907,9 +907,9 @@ static void output_frame_header(AC3EncodeContext *s, unsigned char *frame)
put_bits(&s->pb, 3, s->bsmod);
put_bits(&s->pb, 3, s->acmod);
if ((s->acmod & 0x01) && s->acmod != 0x01)
put_bits(&s->pb, 2, 1); /* XXX -4.5 dB */
put_bits(&s->pb, 2, 1); /* XXX -4.5 dB */
if (s->acmod & 0x04)
put_bits(&s->pb, 2, 1); /* XXX -6 dB */
put_bits(&s->pb, 2, 1); /* XXX -6 dB */
if (s->acmod == 0x02)
put_bits(&s->pb, 2, 0); /* surround not indicated */
put_bits(&s->pb, 1, s->lfe); /* LFE */
......@@ -995,20 +995,20 @@ static void output_audio_block(AC3EncodeContext *s,
if (s->acmod == 2)
{
if(block_num==0)
{
/* first block must define rematrixing (rematstr) */
put_bits(&s->pb, 1, 1);
/* dummy rematrixing rematflg(1:4)=0 */
for (rbnd=0;rbnd<4;rbnd++)
put_bits(&s->pb, 1, 0);
}
else
{
/* no matrixing (but should be used in the future) */
put_bits(&s->pb, 1, 0);
}
if(block_num==0)
{
/* first block must define rematrixing (rematstr) */
put_bits(&s->pb, 1, 1);
/* dummy rematrixing rematflg(1:4)=0 */
for (rbnd=0;rbnd<4;rbnd++)
put_bits(&s->pb, 1, 0);
}
else
{
/* no matrixing (but should be used in the future) */
put_bits(&s->pb, 1, 0);
}
}
#if defined(DEBUG)
......@@ -1023,7 +1023,7 @@ static void output_audio_block(AC3EncodeContext *s,
}
if (s->lfe) {
put_bits(&s->pb, 1, exp_strategy[s->lfe_channel]);
put_bits(&s->pb, 1, exp_strategy[s->lfe_channel]);
}
for(ch=0;ch<s->nb_channels;ch++) {
......@@ -1047,7 +1047,7 @@ static void output_audio_block(AC3EncodeContext *s,
group_size = 4;
break;
}
nb_groups = (s->nb_coefs[ch] + (group_size * 3) - 4) / (3 * group_size);
nb_groups = (s->nb_coefs[ch] + (group_size * 3) - 4) / (3 * group_size);
p = encoded_exp[ch];
/* first exponent */
......@@ -1075,8 +1075,8 @@ static void output_audio_block(AC3EncodeContext *s,
put_bits(&s->pb, 7, ((delta0 * 5 + delta1) * 5) + delta2);
}
if (ch != s->lfe_channel)
put_bits(&s->pb, 2, 0); /* no gain range info */
if (ch != s->lfe_channel)
put_bits(&s->pb, 2, 0); /* no gain range info */
}
/* bit allocation info */
......
......@@ -300,7 +300,7 @@ static inline unsigned char adpcm_yamaha_compress_sample(ADPCMChannelStatus *c,
}
static int adpcm_encode_frame(AVCodecContext *avctx,
unsigned char *frame, int buf_size, void *data)
unsigned char *frame, int buf_size, void *data)
{
int n, i, st;
short *samples;
......@@ -431,8 +431,8 @@ static int adpcm_decode_init(AVCodecContext * avctx)
switch(avctx->codec->id) {
case CODEC_ID_ADPCM_CT:
c->status[0].step = c->status[1].step = 511;
break;
c->status[0].step = c->status[1].step = 511;
break;
default:
break;
}
......@@ -498,16 +498,16 @@ static inline short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)
predictor = c->predictor;
/* predictor update is not so trivial: predictor is multiplied on 254/256 before updating */
if(sign)
predictor = ((predictor * 254) >> 8) - diff;
predictor = ((predictor * 254) >> 8) - diff;
else
predictor = ((predictor * 254) >> 8) + diff;
predictor = ((predictor * 254) >> 8) + diff;
/* calculate new step and clamp it to range 511..32767 */
new_step = (ct_adpcm_table[nibble & 7] * c->step) >> 8;
c->step = new_step;
if(c->step < 511)
c->step = 511;
c->step = 511;
if(c->step > 32767)
c->step = 32767;
c->step = 32767;
CLAMP_TO_SHORT(predictor);
c->predictor = predictor;
......@@ -612,8 +612,8 @@ static void xa_decode(short *out, const unsigned char *in,
}
static int adpcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
ADPCMContext *c = avctx->priv_data;
ADPCMChannelStatus *cs;
......@@ -701,7 +701,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
cs->predictor -= 0x10000;
CLAMP_TO_SHORT(cs->predictor);
// XXX: is this correct ??: *samples++ = cs->predictor;
// XXX: is this correct ??: *samples++ = cs->predictor;
cs->step_index = *src++;
if (cs->step_index < 0) cs->step_index = 0;
......@@ -710,19 +710,19 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
for(m=4; src < (buf + buf_size);) {
*samples++ = adpcm_ima_expand_nibble(&c->status[0], src[0] & 0x0F, 3);
*samples++ = adpcm_ima_expand_nibble(&c->status[0], src[0] & 0x0F, 3);
if (st)
*samples++ = adpcm_ima_expand_nibble(&c->status[1], src[4] & 0x0F, 3);
*samples++ = adpcm_ima_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F, 3);
if (st) {
if (st) {
*samples++ = adpcm_ima_expand_nibble(&c->status[1], (src[4] >> 4) & 0x0F, 3);
if (!--m) {
m=4;
src+=4;
}
}
src++;
}
if (!--m) {
m=4;
src+=4;
}
}
src++;
}
break;
case CODEC_ID_ADPCM_4XM:
cs = &(c->status[0]);
......@@ -739,13 +739,13 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
m= (buf_size - (src - buf))>>st;
for(i=0; i<m; i++) {
*samples++ = adpcm_ima_expand_nibble(&c->status[0], src[i] & 0x0F, 4);
*samples++ = adpcm_ima_expand_nibble(&c->status[0], src[i] & 0x0F, 4);
if (st)
*samples++ = adpcm_ima_expand_nibble(&c->status[1], src[i+m] & 0x0F, 4);
*samples++ = adpcm_ima_expand_nibble(&c->status[0], src[i] >> 4, 4);
if (st)
if (st)
*samples++ = adpcm_ima_expand_nibble(&c->status[1], src[i+m] >> 4, 4);
}
}
src += m<<st;
......@@ -958,7 +958,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
break;
case CODEC_ID_ADPCM_CT:
while (src < buf + buf_size) {
while (src < buf + buf_size) {
if (st) {
*samples++ = adpcm_ct_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F);
......@@ -970,78 +970,78 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
*samples++ = adpcm_ct_expand_nibble(&c->status[0],
src[0] & 0x0F);
}
src++;
src++;
}
break;
case CODEC_ID_ADPCM_SWF:
{
GetBitContext gb;
const int *table;
int k0, signmask;
int size = buf_size*8;
init_get_bits(&gb, buf, size);
// first frame, read bits & inital values
if (!c->nb_bits)
{
c->nb_bits = get_bits(&gb, 2)+2;
// av_log(NULL,AV_LOG_INFO,"nb_bits: %d\n", c->nb_bits);
}
table = swf_index_tables[c->nb_bits-2];
k0 = 1 << (c->nb_bits-2);
signmask = 1 << (c->nb_bits-1);
while (get_bits_count(&gb) <= size)
{
int i;
c->nb_samples++;
// wrap around at every 4096 samples...
if ((c->nb_samples & 0xfff) == 1)
{
for (i = 0; i <= st; i++)
{
*samples++ = c->status[i].predictor = get_sbits(&gb, 16);
c->status[i].step_index = get_bits(&gb, 6);
}
}
// similar to IMA adpcm
for (i = 0; i <= st; i++)
{
int delta = get_bits(&gb, c->nb_bits);
int step = step_table[c->status[i].step_index];
long vpdiff = 0; // vpdiff = (delta+0.5)*step/4
int k = k0;
do {
if (delta & k)
vpdiff += step;
step >>= 1;
k >>= 1;
} while(k);
vpdiff += step;
if (delta & signmask)
c->status[i].predictor -= vpdiff;
else
c->status[i].predictor += vpdiff;
c->status[i].step_index += table[delta & (~signmask)];
c->status[i].step_index = clip(c->status[i].step_index, 0, 88);
c->status[i].predictor = clip(c->status[i].predictor, -32768, 32767);
*samples++ = c->status[i].predictor;
}
}
// src += get_bits_count(&gb)*8;
src += size;
break;
GetBitContext gb;
const int *table;
int k0, signmask;
int size = buf_size*8;
init_get_bits(&gb, buf, size);
// first frame, read bits & inital values
if (!c->nb_bits)
{
c->nb_bits = get_bits(&gb, 2)+2;
// av_log(NULL,AV_LOG_INFO,"nb_bits: %d\n", c->nb_bits);
}
table = swf_index_tables[c->nb_bits-2];
k0 = 1 << (c->nb_bits-2);
signmask = 1 << (c->nb_bits-1);
while (get_bits_count(&gb) <= size)
{
int i;
c->nb_samples++;
// wrap around at every 4096 samples...
if ((c->nb_samples & 0xfff) == 1)
{
for (i = 0; i <= st; i++)
{
*samples++ = c->status[i].predictor = get_sbits(&gb, 16);
c->status[i].step_index = get_bits(&gb, 6);
}
}
// similar to IMA adpcm
for (i = 0; i <= st; i++)
{
int delta = get_bits(&gb, c->nb_bits);
int step = step_table[c->status[i].step_index];
long vpdiff = 0; // vpdiff = (delta+0.5)*step/4
int k = k0;
do {
if (delta & k)
vpdiff += step;
step >>= 1;
k >>= 1;
} while(k);
vpdiff += step;
if (delta & signmask)
c->status[i].predictor -= vpdiff;
else
c->status[i].predictor += vpdiff;
c->status[i].step_index += table[delta & (~signmask)];
c->status[i].step_index = clip(c->status[i].step_index, 0, 88);
c->status[i].predictor = clip(c->status[i].predictor, -32768, 32767);
*samples++ = c->status[i].predictor;
}
}
// src += get_bits_count(&gb)*8;
src += size;
break;
}
case CODEC_ID_ADPCM_YAMAHA:
while (src < buf + buf_size) {
......
......@@ -35,7 +35,7 @@ void avcodec_register_all(void)
static int inited = 0;
if (inited != 0)
return;
return;
inited = 1;
/* encoders */
......
......@@ -84,24 +84,24 @@ static inline uint64_t WORD_VEC(uint64_t x)
} *) (p))->__l) = l; \
} while (0)
struct unaligned_long { uint64_t l; } __attribute__((packed));
#define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
#define uldq(a) (((const struct unaligned_long *) (a))->l)
#define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
#define uldq(a) (((const struct unaligned_long *) (a))->l)
#if GNUC_PREREQ(3,3)
#define prefetch(p) __builtin_prefetch((p), 0, 1)
#define prefetch_en(p) __builtin_prefetch((p), 0, 0)
#define prefetch_m(p) __builtin_prefetch((p), 1, 1)
#define prefetch_men(p) __builtin_prefetch((p), 1, 0)
#define cmpbge __builtin_alpha_cmpbge
#define cmpbge __builtin_alpha_cmpbge
/* Avoid warnings. */
#define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
#define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
#define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
#define zap __builtin_alpha_zap
#define zapnot __builtin_alpha_zapnot
#define amask __builtin_alpha_amask
#define implver __builtin_alpha_implver
#define rpcc __builtin_alpha_rpcc
#define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
#define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
#define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
#define zap __builtin_alpha_zap
#define zapnot __builtin_alpha_zapnot
#define amask __builtin_alpha_amask
#define implver __builtin_alpha_implver
#define rpcc __builtin_alpha_rpcc
#else
#define prefetch(p) asm volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")
#define prefetch_en(p) asm volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")
......@@ -113,26 +113,26 @@ struct unaligned_long { uint64_t l; } __attribute__((packed));
#define extqh(a, b) ({ uint64_t __r; asm ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
#define zap(a, b) ({ uint64_t __r; asm ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
#define zapnot(a, b) ({ uint64_t __r; asm ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
#define amask(a) ({ uint64_t __r; asm ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
#define implver() ({ uint64_t __r; asm ("implver %0" : "=r" (__r)); __r; })
#define rpcc() ({ uint64_t __r; asm volatile ("rpcc %0" : "=r" (__r)); __r; })
#define amask(a) ({ uint64_t __r; asm ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
#define implver() ({ uint64_t __r; asm ("implver %0" : "=r" (__r)); __r; })
#define rpcc() ({ uint64_t __r; asm volatile ("rpcc %0" : "=r" (__r)); __r; })
#endif
#define wh64(p) asm volatile("wh64 (%0)" : : "r"(p) : "memory")
#if GNUC_PREREQ(3,3) && defined(__alpha_max__)
#define minub8 __builtin_alpha_minub8
#define minsb8 __builtin_alpha_minsb8
#define minuw4 __builtin_alpha_minuw4
#define minsw4 __builtin_alpha_minsw4
#define maxub8 __builtin_alpha_maxub8
#define maxsb8 __builtin_alpha_maxsb8
#define maxuw4 __builtin_alpha_maxuw4
#define maxsw4 __builtin_alpha_maxsw4
#define perr __builtin_alpha_perr
#define pklb __builtin_alpha_pklb
#define pkwb __builtin_alpha_pkwb
#define unpkbl __builtin_alpha_unpkbl
#define unpkbw __builtin_alpha_unpkbw
#define minub8 __builtin_alpha_minub8
#define minsb8 __builtin_alpha_minsb8
#define minuw4 __builtin_alpha_minuw4
#define minsw4 __builtin_alpha_minsw4
#define maxub8 __builtin_alpha_maxub8
#define maxsb8 __builtin_alpha_maxsb8
#define maxuw4 __builtin_alpha_maxuw4
#define maxsw4 __builtin_alpha_maxsw4
#define perr __builtin_alpha_perr
#define pklb __builtin_alpha_pklb
#define pkwb __builtin_alpha_pkwb
#define unpkbl __builtin_alpha_unpkbl
#define unpkbw __builtin_alpha_unpkbw
#else
#define minub8(a, b) ({ uint64_t __r; asm (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
#define minsb8(a, b) ({ uint64_t __r; asm (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
......@@ -143,13 +143,13 @@ struct unaligned_long { uint64_t l; } __attribute__((packed));
#define maxuw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
#define maxsw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
#define perr(a, b) ({ uint64_t __r; asm (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })
#define pklb(a) ({ uint64_t __r; asm (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#define pkwb(a) ({ uint64_t __r; asm (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#define unpkbl(a) ({ uint64_t __r; asm (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#define unpkbw(a) ({ uint64_t __r; asm (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#define pklb(a) ({ uint64_t __r; asm (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#define pkwb(a) ({ uint64_t __r; asm (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#define unpkbl(a) ({ uint64_t __r; asm (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#define unpkbw(a) ({ uint64_t __r; asm (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#endif
#elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
#elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
#include <c_asm.h>
#define ldq(p) (*(const uint64_t *) (p))
......@@ -157,7 +157,7 @@ struct unaligned_long { uint64_t l; } __attribute__((packed));
#define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
#define stl(l, p) do { *(int32_t *) (p) = (l); } while (0)
#define ldq_u(a) asm ("ldq_u %v0,0(%a0)", a)
#define uldq(a) (*(const __unaligned uint64_t *) (a))
#define uldq(a) (*(const __unaligned uint64_t *) (a))
#define cmpbge(a, b) asm ("cmpbge %a0,%a1,%v0", a, b)
#define extql(a, b) asm ("extql %a0,%a1,%v0", a, b)
#define extwl(a, b) asm ("extwl %a0,%a1,%v0", a, b)
......@@ -166,7 +166,7 @@ struct unaligned_long { uint64_t l; } __attribute__((packed));
#define zapnot(a, b) asm ("zapnot %a0,%a1,%v0", a, b)
#define amask(a) asm ("amask %a0,%v0", a)
#define implver() asm ("implver %v0")
#define rpcc() asm ("rpcc %v0")
#define rpcc() asm ("rpcc %v0")
#define minub8(a, b) asm ("minub8 %a0,%a1,%v0", a, b)
#define minsb8(a, b) asm ("minsb8 %a0,%a1,%v0", a, b)
#define minuw4(a, b) asm ("minuw4 %a0,%a1,%v0", a, b)
......
......@@ -71,7 +71,7 @@ $unaligned:
addq a1, a2, a1
nop
ldq_u t4, 0(a1)
ldq_u t4, 0(a1)
ldq_u t5, 8(a1)
addq a1, a2, a1
nop
......@@ -120,20 +120,20 @@ $aligned:
addq a1, a2, a1
ldq t3, 0(a1)
addq a0, a2, t4
addq a1, a2, a1
addq t4, a2, t5
subq a3, 4, a3
addq a0, a2, t4
addq a1, a2, a1
addq t4, a2, t5
subq a3, 4, a3
stq t0, 0(a0)
addq t5, a2, t6
stq t1, 0(t4)
addq t6, a2, a0
stq t0, 0(a0)
addq t5, a2, t6
stq t1, 0(t4)
addq t6, a2, a0
stq t2, 0(t5)
stq t3, 0(t6)
stq t2, 0(t5)
stq t3, 0(t6)
bne a3, $aligned
bne a3, $aligned
ret
.end put_pixels_axp_asm
......
......@@ -116,7 +116,7 @@ int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
return result;
}
#if 0 /* now done in assembly */
#if 0 /* now done in assembly */
int pix_abs16x16_mvi(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int result = 0;
......
......@@ -285,7 +285,7 @@ void simple_idct_axp(DCTELEM *block)
stq(v, block + 1 * 4);
stq(w, block + 2 * 4);
stq(w, block + 3 * 4);
block += 4 * 4;
block += 4 * 4;
}
} else {
for (i = 0; i < 8; i++)
......
......@@ -301,7 +301,7 @@ static int amr_nb_decode_frame(AVCodecContext * avctx,
static int amr_nb_encode_frame(AVCodecContext *avctx,
unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
{
short serial_data[250] = {0};
......@@ -440,7 +440,7 @@ static int amr_nb_decode_frame(AVCodecContext * avctx,
}
static int amr_nb_encode_frame(AVCodecContext *avctx,
unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
{
AMRContext *s = (AMRContext*)avctx->priv_data;
int written;
......@@ -584,7 +584,7 @@ static int amr_wb_encode_close(AVCodecContext * avctx)
}
static int amr_wb_encode_frame(AVCodecContext *avctx,
unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
{
AMRWBContext *s = (AMRWBContext*) avctx->priv_data;
int size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx);
......
......@@ -205,13 +205,13 @@ void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx)
#endif
c->idct_put= j_rev_dct_ARM_put;
c->idct_add= j_rev_dct_ARM_add;
c->idct = j_rev_dct_ARM;
c->idct = j_rev_dct_ARM;
c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
} else if (idct_algo==FF_IDCT_SIMPLEARM){
c->idct_put= simple_idct_ARM_put;
c->idct_add= simple_idct_ARM_add;
c->idct = simple_idct_ARM;
c->idct_permutation_type= FF_NO_IDCT_PERM;
c->idct_put= simple_idct_ARM_put;
c->idct_add= simple_idct_ARM_add;
c->idct = simple_idct_ARM;
c->idct_permutation_type= FF_NO_IDCT_PERM;
#ifdef HAVE_IPP
} else if (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_IPP){
#else
......
......@@ -138,10 +138,10 @@ void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx)
mm_flags = mm_support();
if (avctx->dsp_mask) {
if (avctx->dsp_mask & FF_MM_FORCE)
mm_flags |= (avctx->dsp_mask & 0xffff);
else
mm_flags &= ~(avctx->dsp_mask & 0xffff);
if (avctx->dsp_mask & FF_MM_FORCE)
mm_flags |= (avctx->dsp_mask & 0xffff);
else
mm_flags &= ~(avctx->dsp_mask & 0xffff);
}
if (!(mm_flags & MM_IWMMXT)) return;
......
This diff is collapsed.
This diff is collapsed.
......@@ -15,21 +15,21 @@ extern "C" {
#include <sys/types.h> /* size_t */
//FIXME the following 2 really dont belong in here
#define FFMPEG_VERSION_INT 0x000409
#define FFMPEG_VERSION "CVS"
#define FFMPEG_VERSION_INT 0x000409
#define FFMPEG_VERSION "CVS"
#define AV_STRINGIFY(s) AV_TOSTRING(s)
#define AV_STRINGIFY(s) AV_TOSTRING(s)
#define AV_TOSTRING(s) #s
#define LIBAVCODEC_VERSION_INT ((51<<16)+(0<<8)+0)
#define LIBAVCODEC_VERSION 51.0.0
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_VERSION_INT ((51<<16)+(0<<8)+0)
#define LIBAVCODEC_VERSION 51.0.0
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
#define AV_NOPTS_VALUE int64_t_C(0x8000000000000000)
#define AV_TIME_BASE 1000000
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
#define AV_NOPTS_VALUE int64_t_C(0x8000000000000000)
#define AV_TIME_BASE 1000000
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
enum CodecID {
CODEC_ID_NONE,
......@@ -362,9 +362,9 @@ extern int motion_estimation_method;
#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< place global headers at every keyframe instead of in extradata
/* Unsupported options :
* Syntax Arithmetic coding (SAC)
* Reference Picture Selection
* Independant Segment Decoding */
* Syntax Arithmetic coding (SAC)
* Reference Picture Selection
* Independant Segment Decoding */
/* /Fx */
/* codec capabilities */
......@@ -646,9 +646,9 @@ typedef struct AVPanScan{
*/\
int8_t *ref_index[2];
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
#define FF_QSCALE_TYPE_H264 2
#define FF_QSCALE_TYPE_MPEG1 0
#define FF_QSCALE_TYPE_MPEG2 1
#define FF_QSCALE_TYPE_H264 2
#define FF_BUFFER_TYPE_INTERNAL 1
#define FF_BUFFER_TYPE_USER 2 ///< Direct rendering buffers (image is (de)allocated by user)
......@@ -684,9 +684,9 @@ typedef struct AVCLASS AVClass;
struct AVCLASS {
const char* class_name;
const char* (*item_name)(void*); /* actually passing a pointer to an AVCodecContext
or AVFormatContext, which begin with an AVClass.
Needed because av_log is in libavcodec and has no visibility
of AVIn/OutputFormat */
or AVFormatContext, which begin with an AVClass.
Needed because av_log is in libavcodec and has no visibility
of AVIn/OutputFormat */
struct AVOption *option;
};
......@@ -1252,18 +1252,18 @@ typedef struct AVCodecContext {
* result into program crash)
*/
unsigned dsp_mask;
#define FF_MM_FORCE 0x80000000 /* force usage of selected flags (OR) */
#define FF_MM_FORCE 0x80000000 /* force usage of selected flags (OR) */
/* lower 16 bits - CPU features */
#ifdef HAVE_MMX
#define FF_MM_MMX 0x0001 /* standard MMX */
#define FF_MM_3DNOW 0x0004 /* AMD 3DNOW */
#define FF_MM_MMXEXT 0x0002 /* SSE integer functions or AMD MMX ext */
#define FF_MM_SSE 0x0008 /* SSE functions */
#define FF_MM_SSE2 0x0010 /* PIV SSE2 functions */
#define FF_MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
#define FF_MM_MMX 0x0001 /* standard MMX */
#define FF_MM_3DNOW 0x0004 /* AMD 3DNOW */
#define FF_MM_MMXEXT 0x0002 /* SSE integer functions or AMD MMX ext */
#define FF_MM_SSE 0x0008 /* SSE functions */
#define FF_MM_SSE2 0x0010 /* PIV SSE2 functions */
#define FF_MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
#endif /* HAVE_MMX */
#ifdef HAVE_IWMMXT
#define FF_MM_IWMMXT 0x0100 /* XScale IWMMXT */
#define FF_MM_IWMMXT 0x0100 /* XScale IWMMXT */
#endif /* HAVE_IWMMXT */
/**
......@@ -2223,7 +2223,7 @@ int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
int img_get_alpha_info(const AVPicture *src,
int pix_fmt, int width, int height);
int pix_fmt, int width, int height);
/* convert among pixel formats */
int img_convert(AVPicture *dst, int dst_pix_fmt,
......
......@@ -35,20 +35,20 @@ typedef struct ThreadContext{
// it's odd Be never patented that :D
struct benaphore {
vint32 atom;
sem_id sem;
vint32 atom;
sem_id sem;
};
static inline int lock_ben(struct benaphore *ben)
{
if (atomic_add(&ben->atom, 1) > 0)
return acquire_sem(ben->sem);
return B_OK;
if (atomic_add(&ben->atom, 1) > 0)
return acquire_sem(ben->sem);
return B_OK;
}
static inline int unlock_ben(struct benaphore *ben)
{
if (atomic_add(&ben->atom, -1) > 1)
return release_sem(ben->sem);
return B_OK;
if (atomic_add(&ben->atom, -1) > 1)
return release_sem(ben->sem);
return B_OK;
}
static struct benaphore av_thread_lib_ben;
......@@ -155,25 +155,25 @@ fail:
int avcodec_thread_lock_lib(void)
{
return lock_ben(&av_thread_lib_ben);
return lock_ben(&av_thread_lib_ben);
}
int avcodec_thread_unlock_lib(void)
{
return unlock_ben(&av_thread_lib_ben);
return unlock_ben(&av_thread_lib_ben);
}
/* our versions of _init and _fini (which are called by those actually from crt.o) */
void initialize_after(void)
{
av_thread_lib_ben.atom = 0;
av_thread_lib_ben.sem = create_sem(0, "libavcodec benaphore");
av_thread_lib_ben.atom = 0;
av_thread_lib_ben.sem = create_sem(0, "libavcodec benaphore");
}
void uninitialize_before(void)
{
delete_sem(av_thread_lib_ben.sem);
delete_sem(av_thread_lib_ben.sem);
}
......
......@@ -83,7 +83,7 @@ int check_marker(GetBitContext *s, const char *msg)
{
int bit= get_bits1(s);
if(!bit)
av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
return bit;
}
......
......@@ -146,7 +146,7 @@ typedef struct RL_VLC_ELEM {
# ifdef __GNUC__
static inline uint32_t unaligned32(const void *v) {
struct Unaligned {
uint32_t i;
uint32_t i;
} __attribute__((packed));
return ((const struct Unaligned *) v)->i;
......@@ -183,7 +183,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
bit_buf = (bit_buf<<n) | value;
bit_left-=n;
} else {
bit_buf<<=bit_left;
bit_buf<<=bit_left;
bit_buf |= value >> (n - bit_left);
#ifdef UNALIGNED_STORES_ARE_BAD
if (3 & (intptr_t) s->buf_ptr) {
......@@ -196,7 +196,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
*(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
//printf("bitbuf = %08x\n", bit_buf);
s->buf_ptr+=4;
bit_left+=32 - n;
bit_left+=32 - n;
bit_buf = value;
}
......@@ -212,21 +212,21 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
# ifdef ALIGNED_BITSTREAM_WRITER
# if defined(ARCH_X86) || defined(ARCH_X86_64)
asm volatile(
"movl %0, %%ecx \n\t"
"xorl %%eax, %%eax \n\t"
"shrdl %%cl, %1, %%eax \n\t"
"shrl %%cl, %1 \n\t"
"movl %0, %%ecx \n\t"
"shrl $3, %%ecx \n\t"
"andl $0xFFFFFFFC, %%ecx \n\t"
"bswapl %1 \n\t"
"orl %1, (%2, %%ecx) \n\t"
"bswapl %%eax \n\t"
"addl %3, %0 \n\t"
"movl %%eax, 4(%2, %%ecx) \n\t"
: "=&r" (s->index), "=&r" (value)
: "r" (s->buf), "r" (n), "0" (s->index), "1" (value<<(-n))
: "%eax", "%ecx"
"movl %0, %%ecx \n\t"
"xorl %%eax, %%eax \n\t"
"shrdl %%cl, %1, %%eax \n\t"
"shrl %%cl, %1 \n\t"
"movl %0, %%ecx \n\t"
"shrl $3, %%ecx \n\t"
"andl $0xFFFFFFFC, %%ecx \n\t"
"bswapl %1 \n\t"
"orl %1, (%2, %%ecx) \n\t"
"bswapl %%eax \n\t"
"addl %3, %0 \n\t"
"movl %%eax, 4(%2, %%ecx) \n\t"
: "=&r" (s->index), "=&r" (value)
: "r" (s->buf), "r" (n), "0" (s->index), "1" (value<<(-n))
: "%eax", "%ecx"
);
# else
int index= s->index;
......@@ -243,20 +243,20 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
# else //ALIGNED_BITSTREAM_WRITER
# if defined(ARCH_X86) || defined(ARCH_X86_64)
asm volatile(
"movl $7, %%ecx \n\t"
"andl %0, %%ecx \n\t"
"addl %3, %%ecx \n\t"
"negl %%ecx \n\t"
"shll %%cl, %1 \n\t"
"bswapl %1 \n\t"
"movl %0, %%ecx \n\t"
"shrl $3, %%ecx \n\t"
"orl %1, (%%ecx, %2) \n\t"
"addl %3, %0 \n\t"
"movl $0, 4(%%ecx, %2) \n\t"
: "=&r" (s->index), "=&r" (value)
: "r" (s->buf), "r" (n), "0" (s->index), "1" (value)
: "%ecx"
"movl $7, %%ecx \n\t"
"andl %0, %%ecx \n\t"
"addl %3, %%ecx \n\t"
"negl %%ecx \n\t"
"shll %%cl, %1 \n\t"
"bswapl %1 \n\t"
"movl %0, %%ecx \n\t"
"shrl $3, %%ecx \n\t"
"orl %1, (%%ecx, %2) \n\t"
"addl %3, %0 \n\t"
"movl $0, 4(%%ecx, %2) \n\t"
: "=&r" (s->index), "=&r" (value)
: "r" (s->buf), "r" (n), "0" (s->index), "1" (value)
: "%ecx"
);
# else
int index= s->index;
......@@ -276,9 +276,9 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
static inline uint8_t* pbBufPtr(PutBitContext *s)
{
#ifdef ALT_BITSTREAM_WRITER
return s->buf + (s->index>>3);
return s->buf + (s->index>>3);
#else
return s->buf_ptr;
return s->buf_ptr;
#endif
}
......@@ -290,10 +290,10 @@ static inline void skip_put_bytes(PutBitContext *s, int n){
assert((put_bits_count(s)&7)==0);
#ifdef ALT_BITSTREAM_WRITER
FIXME may need some cleaning of the buffer
s->index += n<<3;
s->index += n<<3;
#else
assert(s->bit_left==32);
s->buf_ptr += n;
s->buf_ptr += n;
#endif
}
......@@ -366,10 +366,10 @@ for examples see get_bits, show_bits, skip_bits, get_vlc
static inline int unaligned32_be(const void *v)
{
#ifdef CONFIG_ALIGN
const uint8_t *p=v;
return (((p[0]<<8) | p[1])<<16) | (p[2]<<8) | (p[3]);
const uint8_t *p=v;
return (((p[0]<<8) | p[1])<<16) | (p[2]<<8) | (p[3]);
#else
return be2me_32( unaligned32(v)); //original
return be2me_32( unaligned32(v)); //original
#endif
}
......@@ -528,8 +528,8 @@ static inline int get_bits_count(GetBitContext *s){
#if defined(ARCH_X86) || defined(ARCH_X86_64)
# define SKIP_CACHE(name, gb, num)\
asm(\
"shldl %2, %1, %0 \n\t"\
"shll %2, %1 \n\t"\
"shldl %2, %1, %0 \n\t"\
"shll %2, %1 \n\t"\
: "+r" (name##_cache0), "+r" (name##_cache1)\
: "Ic" ((uint8_t)num)\
);
......
......@@ -61,13 +61,13 @@ static int decode_frame(AVCodecContext *avctx,
uint8_t *cb= &a->picture.data[1][ y*a->picture.linesize[1] ];
uint8_t *cr= &a->picture.data[2][ y*a->picture.linesize[2] ];
for(x=0; x<avctx->width; x+=4){
luma[3] = get_bits(&a->gb, 5) << 3;
luma[2] = get_bits(&a->gb, 5) << 3;
luma[1] = get_bits(&a->gb, 5) << 3;
luma[0] = get_bits(&a->gb, 5) << 3;
luma+= 4;
*(cb++) = get_bits(&a->gb, 6) << 2;
*(cr++) = get_bits(&a->gb, 6) << 2;
luma[3] = get_bits(&a->gb, 5) << 3;
luma[2] = get_bits(&a->gb, 5) << 3;
luma[1] = get_bits(&a->gb, 5) << 3;
luma[0] = get_bits(&a->gb, 5) << 3;
luma+= 4;
*(cb++) = get_bits(&a->gb, 6) << 2;
*(cr++) = get_bits(&a->gb, 6) << 2;
}
}
......
......@@ -65,14 +65,14 @@ int64_t gettime(void)
static short idct_mmx_perm[64];
static short idct_simple_mmx_perm[64]={
0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
};
void idct_mmx_init(void)
......@@ -81,8 +81,8 @@ void idct_mmx_init(void)
/* the mmx/mmxext idct uses a reordered input, so we patch scan tables */
for (i = 0; i < 64; i++) {
idct_mmx_perm[i] = (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
// idct_simple_mmx_perm[i] = simple_block_permute_op(i);
idct_mmx_perm[i] = (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
// idct_simple_mmx_perm[i] = simple_block_permute_op(i);
}
}
......@@ -151,7 +151,7 @@ void dct_error(const char *name, int is_idct,
for(i=0;i<64;i++)
block[idct_simple_mmx_perm[i]] = block1[i];
} else {
} else {
for(i=0; i<64; i++)
block[i]= block1[i];
}
......@@ -186,9 +186,9 @@ void dct_error(const char *name, int is_idct,
if (v > err_inf)
err_inf = v;
err2 += v * v;
sysErr[i] += block[i] - block1[i];
blockSumErr += v;
if( abs(block[i])>maxout) maxout=abs(block[i]);
sysErr[i] += block[i] - block1[i];
blockSumErr += v;
if( abs(block[i])>maxout) maxout=abs(block[i]);
}
if(blockSumErrMax < blockSumErr) blockSumErrMax= blockSumErr;
#if 0 // print different matrix pairs
......@@ -209,7 +209,7 @@ void dct_error(const char *name, int is_idct,
#if 1 // dump systematic errors
for(i=0; i<64; i++){
if(i%8==0) printf("\n");
if(i%8==0) printf("\n");
printf("%5d ", (int)sysErr[i]);
}
printf("\n");
......@@ -503,7 +503,7 @@ int main(int argc, char **argv)
dct_error("XVID-MMX2", 1, ff_idct_xvid_mmx2, idct, test);
// dct_error("ODIVX-C", 1, odivx_idct_c, idct);
//printf(" test against odivx idct\n");
// dct_error("REF", 1, idct, odivx_idct_c);
// dct_error("REF", 1, idct, odivx_idct_c);
// dct_error("INT", 1, j_rev_dct, odivx_idct_c);
// dct_error("MMX", 1, ff_mmx_idct, odivx_idct_c);
// dct_error("MMXEXT", 1, ff_mmxext_idct, odivx_idct_c);
......
This diff is collapsed.
......@@ -151,7 +151,7 @@ typedef struct DSPContext {
* global motion compensation.
*/
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);
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_t * pix, int line_size);
int (*pix_norm1)(uint8_t * pix, int line_size);
......@@ -342,7 +342,7 @@ void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scant
void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
#define BYTE_VEC32(c) ((c)*0x01010101UL)
#define BYTE_VEC32(c) ((c)*0x01010101UL)
static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
{
......
......@@ -194,7 +194,7 @@ channels_multi (int flags)
{
if (flags & DTS_LFE)
return 6;
else if (flags & 1) /* center channel */
else if (flags & 1) /* center channel */
return 5;
else if ((flags & DTS_CHANNEL_MASK) == DTS_2F2R)
return 4;
......
This diff is collapsed.
......@@ -192,7 +192,7 @@ static void dvb_encode_rle4(uint8_t **pq,
#define SCALEBITS 10
#define ONE_HALF (1 << (SCALEBITS - 1))
#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define RGB_TO_Y_CCIR(r, g, b) \
((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \
......
......@@ -108,8 +108,8 @@ static void filter181(int16_t *data, int width, int height, int stride){
/**
* guess the dc of blocks which dont have a undamaged dc
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma){
int b_x, b_y;
......@@ -192,8 +192,8 @@ static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, i
/**
* simple horizontal deblocking filter used for error resilience
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
int b_x, b_y;
......@@ -252,8 +252,8 @@ static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int st
/**
* simple vertical deblocking filter used for error resilience
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
* @param w width in 8 pixel blocks
* @param h height in 8 pixel blocks
*/
static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
int b_x, b_y;
......@@ -348,7 +348,7 @@ static void guess_mv(MpegEncContext *s){
s->mv_type = MV_TYPE_16X16;
s->mb_skipped=0;
s->dsp.clear_blocks(s->block[0]);
s->dsp.clear_blocks(s->block[0]);
s->mb_x= mb_x;
s->mb_y= mb_y;
......@@ -476,7 +476,7 @@ int score_sum=0;
s->mv_type = MV_TYPE_16X16;
s->mb_skipped=0;
s->dsp.clear_blocks(s->block[0]);
s->dsp.clear_blocks(s->block[0]);
s->mb_x= mb_x;
s->mb_y= mb_y;
......@@ -582,7 +582,7 @@ static int is_intra_more_likely(MpegEncContext *s){
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.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16);
is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16);
is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16);
}else{
if(IS_INTRA(s->current_picture.mb_type[mb_xy]))
......@@ -873,7 +873,7 @@ void ff_er_frame_end(MpegEncContext *s){
s->mv[0][0][1] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][1];
}
s->dsp.clear_blocks(s->block[0]);
s->dsp.clear_blocks(s->block[0]);
s->mb_x= mb_x;
s->mb_y= mb_y;
......
......@@ -46,7 +46,7 @@ static int Faac_encode_init(AVCodecContext *avctx)
/* check faac version */
faac_cfg = faacEncGetCurrentConfiguration(s->faac_handle);
if (faac_cfg->version != FAAC_CFG_VERSION) {
av_log(avctx, AV_LOG_ERROR, "wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
av_log(avctx, AV_LOG_ERROR, "wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
faacEncClose(s->faac_handle);
return -1;
}
......
This diff is collapsed.
......@@ -204,15 +204,15 @@ void ff_faandct248(DCTELEM * data)
data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
tmp10 = tmp4 + tmp7;
tmp11 = tmp5 + tmp6;
tmp12 = tmp5 - tmp6;
tmp13 = tmp4 - tmp7;
tmp11 = tmp5 + tmp6;
tmp12 = tmp5 - tmp6;
tmp13 = tmp4 - tmp7;
data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
z1 = (tmp12 + tmp13)* A1;
data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + z1));
data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
z1 = (tmp12 + tmp13)* A1;
data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + z1));
data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
}
}
This diff is collapsed.
......@@ -149,8 +149,8 @@ int ff_fft_init(FFTContext *s, int nbits, int inverse)
void ff_fft_calc_c(FFTContext *s, FFTComplex *z)
{
int ln = s->nbits;
int j, np, np2;
int nblocks, nloops;
int j, np, np2;
int nblocks, nloops;
register FFTComplex *p, *q;
FFTComplex *exptab = s->exptab;
int l;
......
This diff is collapsed.
......@@ -288,7 +288,7 @@ static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, int es
* read unsigned golomb rice code (shorten).
*/
static inline unsigned int get_ur_golomb_shorten(GetBitContext *gb, int k){
return get_ur_golomb_jpegls(gb, k, INT_MAX, 0);
return get_ur_golomb_jpegls(gb, k, INT_MAX, 0);
}
/**
......@@ -395,7 +395,7 @@ static inline void set_te_golomb(PutBitContext *pb, int i, int range){
*/
static inline void set_se_golomb(PutBitContext *pb, int i){
// if (i>32767 || i<-32767)
// av_log(NULL,AV_LOG_ERROR,"value out of range %d\n", i);
// av_log(NULL,AV_LOG_ERROR,"value out of range %d\n", i);
#if 0
if(i<=0) i= -2*i;
else i= 2*i-1;
......
This diff is collapsed.
This diff is collapsed.
......@@ -15,7 +15,7 @@
/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
#define cpuid(index,eax,ebx,ecx,edx)\
__asm __volatile\
("mov %%"REG_b", %%"REG_S"\n\t"\
("mov %%"REG_b", %%"REG_S"\n\t"\
"cpuid\n\t"\
"xchg %%"REG_b", %%"REG_S\
: "=a" (eax), "=S" (ebx),\
......@@ -89,8 +89,8 @@ int mm_support(void)
edx == 0x48727561 &&
ecx == 0x736c7561) { /* "CentaurHauls" */
/* VIA C3 */
if(ext_caps & (1<<24))
rval |= MM_MMXEXT;
if(ext_caps & (1<<24))
rval |= MM_MMXEXT;
} else if (ebx == 0x69727943 &&
edx == 0x736e4978 &&
ecx == 0x64616574) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment