blackfin: use optimised (I)DCT only when ctx->(i)dct_algo is auto
authorMåns Rullgård <mans@mansr.com>
Thu, 28 May 2009 22:35:58 +0000 (22:35 +0000)
committerMåns Rullgård <mans@mansr.com>
Thu, 28 May 2009 22:35:58 +0000 (22:35 +0000)
Originally committed as revision 18975 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/bfin/dsputil_bfin.c

index 1a8ae3b..4641c3b 100644 (file)
@@ -293,13 +293,16 @@ void dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx )
     c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_nornd;
     c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd;
 
     c->put_no_rnd_pixels_tab[0][2] = bfin_put_pixels16_y2_nornd;
     c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd;
 
-    c->idct_permutation_type = FF_NO_IDCT_PERM;
-    c->fdct                  = ff_bfin_fdct;
+    if (avctx->dct_algo == FF_DCT_AUTO)
+        c->fdct               = ff_bfin_fdct;
+
     if (avctx->idct_algo==FF_IDCT_VP3) {
     if (avctx->idct_algo==FF_IDCT_VP3) {
+        c->idct_permutation_type = FF_NO_IDCT_PERM;
         c->idct               = ff_bfin_vp3_idct;
         c->idct_add           = ff_bfin_vp3_idct_add;
         c->idct_put           = ff_bfin_vp3_idct_put;
         c->idct               = ff_bfin_vp3_idct;
         c->idct_add           = ff_bfin_vp3_idct_add;
         c->idct_put           = ff_bfin_vp3_idct_put;
-    } else {
+    } else if (avctx->idct_algo == FF_IDCT_AUTO) {
+        c->idct_permutation_type = FF_NO_IDCT_PERM;
         c->idct               = ff_bfin_idct;
         c->idct_add           = bfin_idct_add;
         c->idct_put           = bfin_idct_put;
         c->idct               = ff_bfin_idct;
         c->idct_add           = bfin_idct_add;
         c->idct_put           = bfin_idct_put;