[08/24] libavcodec: Prefix fdct_ifast, fdct_ifast248

Message ID 1329310724-44294-9-git-send-email-martin@martin.st
State Committed
Commit 3e2efacdd8a3ffb5d1c9004f112492b946284f9b
Headers show

Commit Message

Martin Storsjö Feb. 15, 2012, 12:58 p.m.
---
 libavcodec/dct-test.c      |    2 +-
 libavcodec/dsputil.c       |    4 ++--
 libavcodec/dsputil.h       |    4 ++--
 libavcodec/jfdctfst.c      |    4 ++--
 libavcodec/mpegvideo_enc.c |    6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)

Comments

Ronald Bultje Feb. 15, 2012, 6:50 p.m. | #1
Hi,

On Wed, Feb 15, 2012 at 4:58 AM, Martin Storsjö <martin@martin.st> wrote:
> ---
>  libavcodec/dct-test.c      |    2 +-
>  libavcodec/dsputil.c       |    4 ++--
>  libavcodec/dsputil.h       |    4 ++--
>  libavcodec/jfdctfst.c      |    4 ++--
>  libavcodec/mpegvideo_enc.c |    6 +++---
>  5 files changed, 10 insertions(+), 10 deletions(-)

This is OK - but there's still an issue after this, where the
application (dct-test) accesses internal symbols that may not be
visible to it (ff_*):

> --- a/libavcodec/dct-test.c
> +++ b/libavcodec/dct-test.c
> @@ -87,7 +87,7 @@ static int cpu_flags;
>  static const struct algo fdct_tab[] = {
>     { "REF-DBL",        ff_ref_fdct,           NO_PERM    },
>     { "FAAN",           ff_faandct,            FAAN_SCALE },
> -    { "IJG-AAN-INT",    fdct_ifast,            SCALE_PERM },
> +    { "IJG-AAN-INT",    ff_fdct_ifast,         SCALE_PERM },
>     { "IJG-LLM-INT",    ff_jpeg_fdct_islow_8,  NO_PERM    },

Ronald
Janne Grunau Feb. 16, 2012, 12:51 a.m. | #2
On 2012-02-15 10:50:22 -0800, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, Feb 15, 2012 at 4:58 AM, Martin Storsjö <martin@martin.st> wrote:
> > ---
> >  libavcodec/dct-test.c      |    2 +-
> >  libavcodec/dsputil.c       |    4 ++--
> >  libavcodec/dsputil.h       |    4 ++--
> >  libavcodec/jfdctfst.c      |    4 ++--
> >  libavcodec/mpegvideo_enc.c |    6 +++---
> >  5 files changed, 10 insertions(+), 10 deletions(-)
> 
> This is OK - but there's still an issue after this, where the
> application (dct-test) accesses internal symbols that may not be
> visible to it (ff_*):

We kind of "solved" that problem by always statically linking the tests
programs. It still uses symbols which aren't visible to normal
applications. The test programs aren't normal applications though.

Janne

Patch

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index daa95bd..7aa2292 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -87,7 +87,7 @@  static int cpu_flags;
 static const struct algo fdct_tab[] = {
     { "REF-DBL",        ff_ref_fdct,           NO_PERM    },
     { "FAAN",           ff_faandct,            FAAN_SCALE },
-    { "IJG-AAN-INT",    fdct_ifast,            SCALE_PERM },
+    { "IJG-AAN-INT",    ff_fdct_ifast,         SCALE_PERM },
     { "IJG-LLM-INT",    ff_jpeg_fdct_islow_8,  NO_PERM    },
 
 #if HAVE_MMX
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index d918853..3a84cce 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2796,8 +2796,8 @@  av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
         c->fdct248 = ff_fdct248_islow_10;
     } else {
         if(avctx->dct_algo==FF_DCT_FASTINT) {
-            c->fdct    = fdct_ifast;
-            c->fdct248 = fdct_ifast248;
+            c->fdct    = ff_fdct_ifast;
+            c->fdct248 = ff_fdct_ifast248;
         }
         else if(avctx->dct_algo==FF_DCT_FAAN) {
             c->fdct    = ff_faandct;
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index e915a82..f793712 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -38,8 +38,8 @@ 
 /* dct code */
 typedef short DCTELEM;
 
-void fdct_ifast (DCTELEM *data);
-void fdct_ifast248 (DCTELEM *data);
+void ff_fdct_ifast (DCTELEM *data);
+void ff_fdct_ifast248 (DCTELEM *data);
 void ff_jpeg_fdct_islow_8(DCTELEM *data);
 void ff_jpeg_fdct_islow_10(DCTELEM *data);
 void ff_fdct248_islow_8(DCTELEM *data);
diff --git a/libavcodec/jfdctfst.c b/libavcodec/jfdctfst.c
index b8dc407..3e30e5d 100644
--- a/libavcodec/jfdctfst.c
+++ b/libavcodec/jfdctfst.c
@@ -205,7 +205,7 @@  static av_always_inline void row_fdct(DCTELEM * data){
  */
 
 GLOBAL(void)
-fdct_ifast (DCTELEM * data)
+ff_fdct_ifast (DCTELEM * data)
 {
   int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
   int tmp10, tmp11, tmp12, tmp13;
@@ -271,7 +271,7 @@  fdct_ifast (DCTELEM * data)
  */
 
 GLOBAL(void)
-fdct_ifast248 (DCTELEM * data)
+ff_fdct_ifast248 (DCTELEM * data)
 {
   int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
   int tmp10, tmp11, tmp12, tmp13;
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 5890f8c..ae1f39f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -89,7 +89,7 @@  void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
                 qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
                                         (qscale * quant_matrix[j]));
             }
-        } else if (dsp->fdct == fdct_ifast
+        } else if (dsp->fdct == ff_fdct_ifast
 #ifndef FAAN_POSTSCALE
                    || dsp->fdct == ff_faandct
 #endif
@@ -132,7 +132,7 @@  void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
 
         for (i = intra; i < 64; i++) {
             int64_t max = 8191;
-            if (dsp->fdct == fdct_ifast
+            if (dsp->fdct == ff_fdct_ifast
 #ifndef FAAN_POSTSCALE
                 || dsp->fdct == ff_faandct
 #endif
@@ -3370,7 +3370,7 @@  static int dct_quantize_trellis_c(MpegEncContext *s,
         int dct_coeff= FFABS(block[ scantable[i] ]);
         int best_score=256*256*256*120;
 
-        if (   s->dsp.fdct == fdct_ifast
+        if (   s->dsp.fdct == ff_fdct_ifast
 #ifndef FAAN_POSTSCALE
             || s->dsp.fdct == ff_faandct
 #endif