[FFmpeg-devel] MPEG-2 Acceleration Refactor

Greg Hulands ghulands
Sat Jun 16 19:43:03 CEST 2007


Hi,
I am trying to pick up where the original patch left off to get  
hardware acceleration added for mac os x. In the original thread  
(http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/35816/ 
focus=35852) It was said that the _fast methods needed to be  
refactored out before the patch would be accepted. I am attaching the  
diff for this. I know it looks big, but it is not really as it is  
removing the 3 _fast functions. I have also benchmarked the changes  
and they are as follows:

Without Patch Applied

Tiger1080:~/ffmpeg ghulands$ ./ffmpeg -benchmark -threads 1 -i ~/ 
Desktop/720p-short.m2v -f rawvideo -y /dev/null
FFmpeg version SVN-r9329, Copyright (c) 2000-2007 Fabrice Bellard, et  
al.
   configuration: --disable-ffserver --disable-mmx --enable-pthreads
   libavutil version: 49.4.0
   libavcodec version: 51.40.4
   libavformat version: 51.12.1
   built on Jun 15 2007 19:46:35, gcc: 4.0.1 (Apple Computer, Inc.  
build 5367)

Seems stream 0 codec frame rate differs from container frame rate:  
59.94 (60000/1001) -> 25.00 (25/1)
Input #0, mpegvideo, from '/Users/ghulands/Desktop/720p-short.m2v':
   Duration: 00:00:08.0, start: 0.000000, bitrate: 38867 kb/s
   Stream #0.0: Video: mpeg2video, yuv420p, 1280x720, 38810 kb/s,  
25.00 fps(r)
Output #0, rawvideo, to '/dev/null':
   Stream #0.0: Video: rawvideo, yuv420p, 1280x720, q=2-31, 200 kb/s,  
25.00 fps(c)
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1244 fps= 77 q=0.0 Lsize= 1679400kB time=49.8  
bitrate=276480.0kbits/s
video:1679400kB audio:0kB global headers:0kB muxing overhead 0.000000%
bench: utime=14.061s


With Patch Applied

Tiger1080:~/htp/trunk/ffmpeg ghulands$ ./ffmpeg -benchmark -threads 1  
-i ~/Desktop/720p-short.m2v -f rawvideo -y /dev/null
FFmpeg version SVN-r9226, Copyright (c) 2000-2007 Fabrice Bellard, et  
al.
   configuration: --disable-ffserver --disable-mmx --enable-pthreads
   libavutil version: 49.4.0
   libavcodec version: 51.40.4
   libavformat version: 51.12.1
   built on Jun 15 2007 19:22:35, gcc: 4.0.1 (Apple Computer, Inc.  
build 5367)

Seems stream 0 codec frame rate differs from container frame rate:  
59.94 (60000/1001) -> 25.00 (25/1)
Input #0, mpegvideo, from '/Users/ghulands/Desktop/720p-short.m2v':
   Duration: 00:00:08.0, start: 0.000000, bitrate: 38867 kb/s
   Stream #0.0: Video: mpeg2video, yuv420p, 1280x720, 38810 kb/s,  
25.00 fps(r)
Output #0, rawvideo, to '/dev/null':
   Stream #0.0: Video: rawvideo, yuv420p, 1280x720, q=2-31, 200 kb/s,  
25.00 fps(c)
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1244 fps= 77 q=0.0 Lsize= 1679400kB time=49.8  
bitrate=276480.0kbits/s
video:1679400kB audio:0kB global headers:0kB muxing overhead 0.000000%
bench: utime=14.164s

So you can see there is only a very marginal difference that this  
makes. I ran make test on the trunk but it failed, so I did a new  
check out and did the same and it too failed. Is there a problem with  
the regression tests?

./ffmpeg_g -y -flags +bitexact -dct fastint -idct simple -y -i ./ 
tests/data/a-wmav2.asf -f wav ./tests/data/out.wav
FFmpeg version SVN-r9329, Copyright (c) 2000-2007 Fabrice Bellard, et  
al.
   configuration: --disable-ffserver --disable-mmx --enable-pthreads
   libavutil version: 49.4.0
   libavcodec version: 51.40.4
   libavformat version: 51.12.1
   built on Jun 15 2007 19:46:35, gcc: 4.0.1 (Apple Computer, Inc.  
build 5367)
size=    1032kB time=6.0 bitrate=1411.3kbits/s
--- ./tests/data/ffmpeg.regression      2007-06-16 10:28:07.000000000  
-0700
+++ /Users/ghulands/ffmpeg/tests/ffmpeg.regression.ref  2007-06-15  
19:42:23.000000000 -0700
@@ -27,9 +27,9 @@
    803833 ./tests/data/a-mpeg2threadivlc.mpg
c0e8cbde76ff8377494fe6843fd03e11 *./tests/data/out.yuv
stddev:  7.63 PSNR:30.47 bytes:7602176
-8c86de8472e4a26f5bacc8176899e88f *./tests/data/a-mpeg2reuse.mpg
- 2104576 ./tests/data/a-mpeg2reuse.mpg
-9026b64d0fc595d660af110090a3da73 *./tests/data/out.yuv
+c8d8b07b5fa97e0affb4a52d4d30a2b6 *./tests/data/a-mpeg2reuse.mpg
+2102956 ./tests/data/a-mpeg2reuse.mpg
+75d3dfc8133f0122cb9e272a21bc8c5c *./tests/data/out.yuv
stddev:  7.67 PSNR:30.42 bytes:7602176
c83ae8d8f3e2b4506df58e6a2f7e3b2a *./tests/data/a-msmpeg4v2.avi
    636512 ./tests/data/a-msmpeg4v2.avi
@@ -87,9 +87,9 @@
    878264 ./tests/data/a-mpeg4-Q.avi
8995abbcc97ed4767fcbc0bf46accd01 *./tests/data/out.yuv
stddev:  5.61 PSNR:33.13 bytes:7602176
-f652195fe0e12bcde91de268ef6962e6 *./tests/data/a-mpeg4-thread.avi
-  763058 ./tests/data/a-mpeg4-thread.avi
-c1293a5ca45c40379aaae1737de8f037 *./tests/data/out.yuv
+5fff534f0b958547dfdb811d4f289931 *./tests/data/a-mpeg4-thread.avi
+761170 ./tests/data/a-mpeg4-thread.avi
+fe1d119938f8a26174b38eeaa18dff85 *./tests/data/out.yuv
stddev: 12.31 PSNR:26.31 bytes:7602176
c1dae02bddd79790266bc0a9f7d6eb0e *./tests/data/a-mpeg4-PSP.mp4
    406449 ./tests/data/a-mpeg4-PSP.mp4

Regression test: Error.
make: *** [codectest] Error 1

It would be great to get this patch applied so I can then submit a  
patch for the hardware acceleration stuff for Mac OS X.

Cheers,
Greg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpeg12.diff
Type: application/octet-stream
Size: 21554 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070616/0cb3161d/attachment.obj>



More information about the ffmpeg-devel mailing list