[FFmpeg-devel] IDCT permutation (was: pre discussion around Blackfin dct_quantize_bfin routine)

Michael Niedermayer michaelni
Wed Jun 13 20:14:09 CEST 2007


On Wed, Jun 13, 2007 at 10:57:26AM +0300, Siarhei Siamashka wrote:
> > also decoding involes a mandatory permutation
> > so no matter what idct_permutation is set to it will be the same speed and
> > wisely setting the idct permutation can simplify the idct and thus speed
> > it up, this is a high level optimization and wont make code slower no
> > matter how expensive the permutation is as there arent more permutations
> > done
> By looking at ffmpeg code, this does not seem to be absolutely true...
> > the extra cost is just on the encoder side, where its just a single if()
> > if its the no permutation case ...
> Please check the patch which is attached. It was generated by a ruby script
> which is also attached:
> Before patch:
> $ ./mplayer.orig  -nosound -quiet -benchmark -vo null -loop 
> 3 /media/mmc1/Video/MissionImpossible3_Trailer4.divx | grep BENCHMARKs
> BENCHMARKs: VC:  89.976s VO:   0.034s A:   0.000s Sys:   1.089s =   91.098s
> BENCHMARKs: VC:  93.419s VO:   0.033s A:   0.000s Sys:   1.069s =   94.521s
> BENCHMARKs: VC:  93.307s VO:   0.032s A:   0.000s Sys:   1.078s =   94.418s
> After patch:
> ~ $ ./mplayer.patched -nosound -quiet -benchmark -vo null -loop 
> 3 /media/mmc1/Video/MissionImpossible3_Trailer4.divx | grep BENCHMARKs
> BENCHMARKs: VC:  87.998s VO:   0.036s A:   0.000s Sys:   1.086s =   89.120s
> BENCHMARKs: VC:  91.074s VO:   0.035s A:   0.000s Sys:   1.069s =   92.177s
> BENCHMARKs: VC:  91.377s VO:   0.036s A:   0.000s Sys:   1.069s =   92.482s

i do not belive that the changes in the patch (95% of them in very rarely executed
init code) directly caused this difference
the only part which might have caused it is the ac prediction, if this really
is that critical iam sure there are more sensibly ways to optimize it, keep
in mind we are permutating a lot of zeros around and we know where the last
non zero element is
also your patch breaks half of the IDCTs if the permutation is ignored

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070613/8368a718/attachment.pgp>

More information about the ffmpeg-devel mailing list