|
From: Stein-Erik <se...@in...> - 2001-03-15 21:47:14
|
Hello!
I have been playing with playdv in the libdv-0.6
release for a couple of days now - I have just gotten my
'graphics machine' put together.
I have added a timing routine like this:
struct timeval seenTime;
long seenLast = 0;
void showTime( char *text ) {
long usec, diff;
gettimeofday( &seenTime, NULL );
usec = seenTime.tv_usec;
diff = usec - seenLast;
seenLast = usec;
printf( "%18s : %6ld, %6ld\n", text, usec, diff );
}
and adding ShowTime( "sensible text" ) at proper
places, to check the speed of the different parts, and to
see the effect of commenting out different parts.
The routine dv_decode_full_frame in dv.c has been one of
those I have looked at. Each of the ds loops (12 all in all
on my system) takes around 1700 microseconds, and on my 4
seconds test film (100 frames) I get 26.81 - 27.09 fps. This
is with the audio (the dv_oss_play call in playdv.c)
commented out.
When I (as part of many tests) removed the assembler code
for
dv_parse_video_segment
and
dv_parse_ac_coeffs_pass0
(by commenting out #if ! ARCH_X86 and #endif, and
renaming the corresponding 2 names in vlc_x86.S to
xdv_parse_...), I got an *increase* in speed. Now it
averaged 1500 microseconds for each ds loop, and 28.05 -
28.15 fps! So the C code is actually quite a bit faster than
the assembler code...
I also tried to remove the assembler code for the other 2
routines in vlc_x86.S , but that increased the time
from around 1500 microseconds per loop, to around 1900...
Has the C code been optimized without the assembler code
following on, or is the compiler better at finding good
instructions here?
I am running on an AMD 1.2 GHz processor with 266 MHz memory
bus, 256 MB 133 MHz RAM, SuSE 7.1, but with a clean 2.4.2
kernel with the newest firewire patch (as of a week
ago...:.), XFree86 4.0.2, 45 MB 7200 IBM IDE disk, which
with hdparm -tT gives 35.5 MB/s after enabling udma5,
CardExpert GeForce 2 Pro/400, and the NVidia optimized
driver with 2D and 3D optimizations, 1024x768 resolution, 16
bits. The gears program stabilizes on 1710-1711 FPS (as a
measure of the OpenGL 3D speed). The Xvideo extension is
used by playdv, when I commented that out the performance
dropped below 20 fps.
I am also looking into extending playdv a bit:
- Making it react to keyboard keys to stop, start, play
slowly, play backwards etc.
I don't want to add mouse operations, its only the keyboard
handling I'd like, to be able to scroll back an forwards,
move a frame at a time etc.
The changes will mostly affect the main loop in playdv.c -
make it have a frame index as the main loop counter, and
knowing the first and last frame available, instead of the
offset it has today, to easily be able to go to the next
frame, the previous frame etc. Also synchronization will be
needed - at least without sound I am able to get it to go
quicker than the 25 fps PAL is supposed to be.
Are anybody else doing anything with playdv, or is this OK?
I am planning on sending it back, to let the one responsible
include it as the playdv program, if it works as I want it
to.
Regards,
Stein-Erik
|