[Ffmpeg-devel] [PATCH] ported SGI decoder to the new API

Xiaohui Sun sunxiaohui
Sat Apr 7 18:19:38 CEST 2007


Michael Niedermayer wrote:
> Hi
>
> On Sat, Apr 07, 2007 at 08:39:06PM +0800, Xiaohui Sun wrote:
>   
>> Michael Niedermayer wrote:
>>     
>>> Hi
>>>
>>> On Sat, Apr 07, 2007 at 11:34:57AM +0800, Xiaohui Sun wrote:
>>>  
>>>       
>>>> Michael Niedermayer wrote:
>>>>    
>>>>         
>>>>> Hi
>>>>>
>>>>> On Fri, Apr 06, 2007 at 08:30:05PM +0200, Diego Biurrun wrote:
>>>>>
>>>>>      
>>>>>           
>>>>>> On Sat, Apr 07, 2007 at 12:03:37AM +0800, Xiaohui Sun wrote:
>>>>>>   
>>>>>>        
>>>>>>             
>>>>>>> patch updated.
>>>>>>>
>>>>>>> Diego Biurrun wrote:
>>>>>>>     
>>>>>>>          
>>>>>>>               
>>>>>>>> On Fri, Apr 06, 2007 at 12:34:05AM +0800, Xiaohui Sun wrote:
>>>>>>>>
>>>>>>>>       
>>>>>>>>            
>>>>>>>>                 
>>>>>>>>> patch updated.
>>>>>>>>>
>>>>>>>>> --- libavcodec/sgidec.c	(revision 0)
>>>>>>>>> +++ libavcodec/sgidec.c	(revision 0)
>>>>>>>>> @@ -0,0 +1,267 @@
>>>>>>>>> +
>>>>>>>>> +#include "sgi.h"
>>>>>>>>>         
>>>>>>>>>              
>>>>>>>>>                   
>>>>>>>> Where is sgi.h ???
>>>>>>>>       
>>>>>>>>            
>>>>>>>>                 
>>>>>>> Sorry , I forgot attach it, try this new patch.
>>>>>>>     
>>>>>>>          
>>>>>>>               
>>>>>> Patch applied.
>>>>>>   
>>>>>>        
>>>>>>             
>>>>> the code doesnt work (see regresion tests, encoding does something
>>>>> but decoding does just produce
>>>>>
>>>>> ffmpeg -i b-libav02.sgi -y test.avi
>>>>> FFmpeg version SVN-r8635, Copyright (c) 2000-2007 Fabrice Bellard, et al.
>>>>> configuration: --enable-pthreads --cc=/home/michael/bin/colorgcc 
>>>>> --enable-libmp3lame --enable-liba52 --enable-libvorbis --enable-libfaad 
>>>>> --enable-gpl --enable-libogg --enable-libfaac --enable-x264
>>>>> libavutil version: 49.4.0
>>>>> libavcodec version: 51.40.2
>>>>> libavformat version: 51.11.0
>>>>> built on Apr  6 2007 22:26:57, gcc: 4.1.2 20061115 (prerelease) (Debian 
>>>>> 4.1.1-21)
>>>>> Input #0, image2, from 'b-libav02.sgi':
>>>>> Duration: 00:00:00.0, start: 0.000000, bitrate: N/A
>>>>> Stream #0.0: Video: sgi, rgb24, 352x288, 25.00 fps(r)
>>>>> Output #0, avi, to 'test.avi':
>>>>> Stream #0.0: Video: mpeg4, yuv420p, 352x288, q=2-31, 200 kb/s, 25.00 
>>>>> fps(c)
>>>>> Stream mapping:
>>>>> Stream #0.0 -> #0.0
>>>>> Press [q] to stop encoding
>>>>> Error while decoding stream #0.0
>>>>> frame=    0 fps=  0 q=0.0 Lsize=       6kB time=10000000000.0 bitrate=   
>>>>> 0.0kbits/s    video:0kB audio:0kB global headers:0kB muxing overhead inf%
>>>>>
>>>>>      
>>>>>           
>>>> I think the problem lies in the RLE encoding, which should count up to 
>>>> 127 consecutive pixels and I have sent the path before.
>>>> Please use the attached path and have a test, thanks.
>>>>    
>>>>         
>>> this change needs testing to see what effects it has on compression rate 
>>> with
>>> a few of the stanard test images like lena, ...
>>>       
  
  I have made a test for tga and tiff format using some standard 
pictures from _http://links.uwaterloo.ca/bragzone.base.html_
The second column is with the consecutive pixels set to 127, and the 
third column is the consecutive pixels set to 128, and a compression 
rate lost
is calculated as " (127-RLE size - 128-RLE size) / 128-RLE size"
Hope this will be helpful.

   test image               127-RLE size(byte)   128-RLE size(byte)  
compression rate lost (%)
814*880*24/clegg.tga             1282940           1282940               
0.0000
1118?1105?24/frymire.tga         867478            867475                
0.0003
512?512?24/lena.tga              786476            786476                
0.0000
768?512?24/monarch.tga           1129988           1129982               
0.0005
512?512?24/peppers.tga           776266            776248                
0.0023
768?512?24/sail.tga              1168461           1168444               
0.0015
629?794?24/serrano.tga           410156            410156                
0.0000
768?512?24/tulips.tga            1152120           1152109               
0.0010
256*256*8/bird.tga               173100            173100                
0.0000
256*256*8/camera.tga             179182            179180                
0.0011
256*256*8/crosses.tga            9282              9058                  
2.4730
256*256*8/horiz.tga              3228              2204                  
46.4610
256*256*8/montage.tga            120071            119635                
0.3644
256*256*8/squares.tga            4012              3564                  
12.5701
256*256*8/bridge.tga             191919            191920                
-0.0005
256*256*8/circles.tga            4956              4716                  
5.0891
256*256*8/goldhill.tga           191852            191847                
0.0026
256*256*8/lena.tga               190512            190512                
0.0000
256*256*8/slope.tga              105893            105893                
0.0000
256*256*8/text.tga               40520             40316                 
0.5060
512*512*8/barb.tga               764882            764874                
0.0010
512*512*8/france.tga             102259            102199                
0.0587
672*498*8/goldhill.tga           762997            762995                
0.0003
464*352*8/library.tga            359095            359095                
0.0000
640*480*8/mountain.tga           834980            834976                
0.0005
512*512*8/washsat.tga            553703            553703                
0.0000
512*512*8/boat.tga               753534            753530                
0.0005
621*498*8/frog.tga               823958            823958                
0.0000
512*512*8/lena.tga               756735            756736                
-0.0001
512*512*8/mandrill.tga           777401            777400                
0.0001
512*512*8/peppers.tga            760598            760598                
0.0000
512*512*8/zelda.tga              761093            761091                
0.0003

814*880*24/clegg.tiff           2050457            2050424               
0.0016
1118?1105?24/frymire.tiff       2228033            2227841               
0.0086
512?512?24/lena.tiff            794127             793616                
0.0644
768?512?24/monarch.tiff         1190712            1190221               
0.0413
512?512?24/peppers.tiff         790802             790304                
0.0630
768?512?24/sail.tiff            1190711            1190373               
0.0284
629?794?24/serrano.tiff         1489886            1489837               
0.0033
768?512?24/tulips.tiff          1189406            1189244               
0.0136
256*256*8/bird.tiff             66241              66240                 
0.0015
256*256*8/camera.tiff           66256              66235                 
0.0317
256*256*8/crosses.tiff          6443               6331                  
1.7691
256*256*8/horiz.tiff            3422               2910                  
17.5945
256*256*8/montage.tiff          44805              44581                 
0.5025
256*256*8/squares.tiff          3814               3590                  
6.2396
256*256*8/bridge.tiff           67542              67429                 
0.1676
256*256*8/circles.tiff          4286               4166                  
2.8805
256*256*8/goldhill.tiff         67845              67745                 
0.1476
256*256*8/lena.tiff             67763              67729                 
0.0502
256*256*8/slope.tiff            39627              39627                 
0.0000
256*256*8/text.tiff             21269              21167                 
0.4819
512*512*8/barb.tiff             265581             265547                
0.0128
512*512*8/france.tiff           52451              52421                 
0.0572
672*498*8/goldhill.tiff         265404             265327                
0.0290
464*352*8/library.tiff          130257             130250                
0.0054
640*480*8/mountain.tiff         299463             299449                
0.0047
512*512*8/washsat.tiff          231250             231250                
0.0000
512*512*8/boat.tiff             264750             264724                
0.0098
621*498*8/frog.tiff             301301             301300                
0.0003
512*512*8/lena.tiff             265204             265183                
0.0079
512*512*8/mandrill.tiff         266356             266082                
0.1030
512*512*8/peppers.tiff          265324             265291                
0.0124
512*512*8/zelda.tiff            265607             265569                
0.0143


                                                                



>>>  
>>>       
>> I think another solution is addint an additional parameter or let SGI 
>> use another RLE encoder.
>>     
>
> adding a redundant rle encoder is unaccpetable adding an additional
> parameter and thus complexity and lower speed needs some justification
> like some compression gain (=encoding with a few test images)
>
> [...]
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel





More information about the ffmpeg-devel mailing list