[PATCH 1/2] mpegaudio: define only one of compute_antialias_{float, integer}
This removes warnings about unused functions as well as warnings about pointer types inside the unused functions. --- libavcodec/mpegaudiodec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 0ae21e0..3edfc65 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -73,8 +73,6 @@ # include "dct32.c" #endif -static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g); -static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g); static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr); @@ -1573,6 +1571,7 @@ static void compute_stereo(MPADecodeContext *s, } } +#if !CONFIG_FLOAT static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g) { @@ -1612,7 +1611,7 @@ static void compute_antialias_integer(MPADecodeContext *s, ptr += 18; } } - +#else static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g) { @@ -1651,6 +1650,7 @@ static void compute_antialias_float(MPADecodeContext *s, ptr += 18; } } +#endif /* CONFIG_FLOAT */ static void compute_imdct(MPADecodeContext *s, GranuleDef *g, -- 1.7.1.1
The mmx code is floating-point only, and this function does not know from which decoder it is called. Without this change, the integer decoder only "works" because the size of the context struct is smaller in this case, and the mmx init function writes the function pointer outside the allocated context. --- libavcodec/mpegaudiodec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 3edfc65..af5b3b8 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -320,7 +320,7 @@ static av_cold int decode_init(AVCodecContext * avctx) s->avctx = avctx; s->apply_window_mp3 = apply_window_mp3_c; -#if HAVE_MMX +#if HAVE_MMX && CONFIG_FLOAT ff_mpegaudiodec_init_mmx(s); #endif avctx->sample_fmt= OUT_FMT; -- 1.7.1.1
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
The mmx code is floating-point only, and this function does not know from which decoder it is called. Without this change, the integer decoder only "works" because the size of the context struct is smaller in this case, and the mmx init function writes the function pointer outside the allocated context. --- libavcodec/mpegaudiodec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 3edfc65..af5b3b8 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -320,7 +320,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
s->avctx = avctx; s->apply_window_mp3 = apply_window_mp3_c; -#if HAVE_MMX +#if HAVE_MMX&& CONFIG_FLOAT
I was thinking about committing something similar. Your patch should fix issue2054. I would also move the line s->apply_window_mp3 = apply_window_mp3_c; inside a #if CONFIG_FLOAT. -Vitor
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
The mmx code is floating-point only, and this function does not know from which decoder it is called. Without this change, the integer decoder only "works" because the size of the context struct is smaller in this case, and the mmx init function writes the function pointer outside the allocated context. --- libavcodec/mpegaudiodec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 3edfc65..af5b3b8 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -320,7 +320,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
s->avctx = avctx; s->apply_window_mp3 = apply_window_mp3_c; -#if HAVE_MMX +#if HAVE_MMX&& CONFIG_FLOAT
I was thinking about committing something similar. Your patch should fix issue2054. I would also move the line
s->apply_window_mp3 = apply_window_mp3_c;
inside a #if CONFIG_FLOAT.
Don't we want to allow asm optimisation of the fixed-point one as well? -- M?ns Rullg?rd mans at mansr.com
On Thu, Jul 01, 2010 at 06:14:16PM +0100, M?ns Rullg?rd wrote:
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
The mmx code is floating-point only, and this function does not know from which decoder it is called. Without this change, the integer decoder only "works" because the size of the context struct is smaller in this case, and the mmx init function writes the function pointer outside the allocated context. --- libavcodec/mpegaudiodec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 3edfc65..af5b3b8 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -320,7 +320,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
s->avctx = avctx; s->apply_window_mp3 = apply_window_mp3_c; -#if HAVE_MMX +#if HAVE_MMX&& CONFIG_FLOAT
I was thinking about committing something similar. Your patch should fix issue2054. I would also move the line
s->apply_window_mp3 = apply_window_mp3_c;
inside a #if CONFIG_FLOAT.
Don't we want to allow asm optimisation of the fixed-point one as well?
on systems with mmx optimized float decoding will liekly be faster anywaym fix this in whichever way you prefer [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
Michael Niedermayer <michaelni at gmx.at> writes:
On Thu, Jul 01, 2010 at 06:14:16PM +0100, M?ns Rullg?rd wrote:
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
The mmx code is floating-point only, and this function does not know from which decoder it is called. Without this change, the integer decoder only "works" because the size of the context struct is smaller in this case, and the mmx init function writes the function pointer outside the allocated context. --- libavcodec/mpegaudiodec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 3edfc65..af5b3b8 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -320,7 +320,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
s->avctx = avctx; s->apply_window_mp3 = apply_window_mp3_c; -#if HAVE_MMX +#if HAVE_MMX&& CONFIG_FLOAT
I was thinking about committing something similar. Your patch should fix issue2054. I would also move the line
s->apply_window_mp3 = apply_window_mp3_c;
inside a #if CONFIG_FLOAT.
Don't we want to allow asm optimisation of the fixed-point one as well?
on systems with mmx optimized float decoding will liekly be faster anywaym fix this in whichever way you prefer
I was thinking of FPU-less ARM systems and the like. -- M?ns Rullg?rd mans at mansr.com
On Thu, Jul 01, 2010 at 08:33:55PM +0100, M?ns Rullg?rd wrote:
Michael Niedermayer <michaelni at gmx.at> writes:
On Thu, Jul 01, 2010 at 06:14:16PM +0100, M?ns Rullg?rd wrote:
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
The mmx code is floating-point only, and this function does not know from which decoder it is called. Without this change, the integer decoder only "works" because the size of the context struct is smaller in this case, and the mmx init function writes the function pointer outside the allocated context. --- libavcodec/mpegaudiodec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 3edfc65..af5b3b8 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -320,7 +320,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
s->avctx = avctx; s->apply_window_mp3 = apply_window_mp3_c; -#if HAVE_MMX +#if HAVE_MMX&& CONFIG_FLOAT
I was thinking about committing something similar. Your patch should fix issue2054. I would also move the line
s->apply_window_mp3 = apply_window_mp3_c;
inside a #if CONFIG_FLOAT.
Don't we want to allow asm optimisation of the fixed-point one as well?
on systems with mmx optimized float decoding will liekly be faster anywaym fix this in whichever way you prefer
I was thinking of FPU-less ARM systems and the like.
ive read the asm as "mmx" it seems, i need sleep [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have never wished to cater to the crowd; for what I know they do not approve, and what they approve I do not know. -- Epicurus
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
This removes warnings about unused functions as well as warnings about pointer types inside the unused functions. --- libavcodec/mpegaudiodec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 0ae21e0..3edfc65 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -73,8 +73,6 @@ # include "dct32.c" #endif
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g); -static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g); static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr);
@@ -1573,6 +1571,7 @@ static void compute_stereo(MPADecodeContext *s, } }
+#if !CONFIG_FLOAT static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g) { @@ -1612,7 +1611,7 @@ static void compute_antialias_integer(MPADecodeContext *s, ptr += 18; } } - +#else static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g) { @@ -1651,6 +1650,7 @@ static void compute_antialias_float(MPADecodeContext *s, ptr += 18; } } +#endif /* CONFIG_FLOAT */
Can't this function be moved to mpegaudiodec_float.c? -Vitor
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
This removes warnings about unused functions as well as warnings about pointer types inside the unused functions. --- libavcodec/mpegaudiodec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 0ae21e0..3edfc65 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -73,8 +73,6 @@ # include "dct32.c" #endif
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g); -static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g); static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr);
@@ -1573,6 +1571,7 @@ static void compute_stereo(MPADecodeContext *s, } }
+#if !CONFIG_FLOAT static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g) { @@ -1612,7 +1611,7 @@ static void compute_antialias_integer(MPADecodeContext *s, ptr += 18; } } - +#else static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g) { @@ -1651,6 +1650,7 @@ static void compute_antialias_float(MPADecodeContext *s, ptr += 18; } } +#endif /* CONFIG_FLOAT */
Can't this function be moved to mpegaudiodec_float.c?
I suppose it can. OK to do that? -- M?ns Rullg?rd mans at mansr.com
On Thu, Jul 01, 2010 at 06:14:45PM +0100, M?ns Rullg?rd wrote:
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
This removes warnings about unused functions as well as warnings about pointer types inside the unused functions. --- libavcodec/mpegaudiodec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 0ae21e0..3edfc65 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -73,8 +73,6 @@ # include "dct32.c" #endif
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g); -static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g); static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr);
@@ -1573,6 +1571,7 @@ static void compute_stereo(MPADecodeContext *s, } }
+#if !CONFIG_FLOAT static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g) { @@ -1612,7 +1611,7 @@ static void compute_antialias_integer(MPADecodeContext *s, ptr += 18; } } - +#else static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g) { @@ -1651,6 +1650,7 @@ static void compute_antialias_float(MPADecodeContext *s, ptr += 18; } } +#endif /* CONFIG_FLOAT */
Can't this function be moved to mpegaudiodec_float.c?
I suppose it can. OK to do that?
ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I wish the Xiph folks would stop pretending they've got something they do not. Somehow I fear this will remain a wish. -- M?ns Rullg?rd
Michael Niedermayer <michaelni at gmx.at> writes:
On Thu, Jul 01, 2010 at 06:14:45PM +0100, M?ns Rullg?rd wrote:
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
This removes warnings about unused functions as well as warnings about pointer types inside the unused functions. --- libavcodec/mpegaudiodec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 0ae21e0..3edfc65 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -73,8 +73,6 @@ # include "dct32.c" #endif
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g); -static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g); static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr);
@@ -1573,6 +1571,7 @@ static void compute_stereo(MPADecodeContext *s, } }
+#if !CONFIG_FLOAT static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g) { @@ -1612,7 +1611,7 @@ static void compute_antialias_integer(MPADecodeContext *s, ptr += 18; } } - +#else static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g) { @@ -1651,6 +1650,7 @@ static void compute_antialias_float(MPADecodeContext *s, ptr += 18; } } +#endif /* CONFIG_FLOAT */
Can't this function be moved to mpegaudiodec_float.c?
I suppose it can. OK to do that?
ok
Moving the it requires ugly forward declarations of static functions. Do you still want to move it? -- M?ns Rullg?rd mans at mansr.com
On Thu, Jul 01, 2010 at 11:47:01PM +0100, M?ns Rullg?rd wrote:
Michael Niedermayer <michaelni at gmx.at> writes:
On Thu, Jul 01, 2010 at 06:14:45PM +0100, M?ns Rullg?rd wrote:
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
This removes warnings about unused functions as well as warnings about pointer types inside the unused functions. --- libavcodec/mpegaudiodec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 0ae21e0..3edfc65 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -73,8 +73,6 @@ # include "dct32.c" #endif
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g); -static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g); static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr);
@@ -1573,6 +1571,7 @@ static void compute_stereo(MPADecodeContext *s, } }
+#if !CONFIG_FLOAT static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g) { @@ -1612,7 +1611,7 @@ static void compute_antialias_integer(MPADecodeContext *s, ptr += 18; } } - +#else static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g) { @@ -1651,6 +1650,7 @@ static void compute_antialias_float(MPADecodeContext *s, ptr += 18; } } +#endif /* CONFIG_FLOAT */
Can't this function be moved to mpegaudiodec_float.c?
I suppose it can. OK to do that?
ok
Moving the it requires ugly forward declarations of static functions. Do you still want to move it?
iam hoping that they will disappear at some future point so yes iam ok with them [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
Michael Niedermayer <michaelni at gmx.at> writes:
On Thu, Jul 01, 2010 at 06:14:45PM +0100, M?ns Rullg?rd wrote:
Vitor Sessak <vitor1001 at gmail.com> writes:
On 07/01/2010 06:26 PM, Mans Rullgard wrote:
This removes warnings about unused functions as well as warnings about pointer types inside the unused functions. --- libavcodec/mpegaudiodec.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 0ae21e0..3edfc65 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -73,8 +73,6 @@ # include "dct32.c" #endif
-static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g); -static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g); static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr);
@@ -1573,6 +1571,7 @@ static void compute_stereo(MPADecodeContext *s, } }
+#if !CONFIG_FLOAT static void compute_antialias_integer(MPADecodeContext *s, GranuleDef *g) { @@ -1612,7 +1611,7 @@ static void compute_antialias_integer(MPADecodeContext *s, ptr += 18; } } - +#else static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g) { @@ -1651,6 +1650,7 @@ static void compute_antialias_float(MPADecodeContext *s, ptr += 18; } } +#endif /* CONFIG_FLOAT */
Can't this function be moved to mpegaudiodec_float.c?
I suppose it can. OK to do that?
ok
Done. -- M?ns Rullg?rd mans at mansr.com
participants (3)
-
mans@mansr.com -
michaelni@gmx.at -
vitor1001@gmail.com