You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
5.0 KiB

  1. From 875ba2333340c2e13af370832e49c9371ffb0f91 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Sun, 5 Apr 2020 20:37:10 -0700
  4. Subject: [PATCH] avcodec/aacdec: fix compilation under soft float MIPS
  5. Place HAVE_MIPSFPU further up so that functions that use floating point
  6. ASM are defined away. Otherwise compilation failures result when soft
  7. float in enabled on the toolchain.
  8. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  9. ---
  10. libavcodec/mips/aacdec_mips.c | 4 ++--
  11. libavcodec/mips/aacpsdsp_mips.c | 4 ++--
  12. libavcodec/mips/aacsbr_mips.c | 4 ++--
  13. libavcodec/mips/sbrdsp_mips.c | 4 ++--
  14. 4 files changed, 8 insertions(+), 8 deletions(-)
  15. diff --git a/libavcodec/mips/aacdec_mips.c b/libavcodec/mips/aacdec_mips.c
  16. index 01a2b3087ba..8e306529351 100644
  17. --- a/libavcodec/mips/aacdec_mips.c
  18. +++ b/libavcodec/mips/aacdec_mips.c
  19. @@ -59,6 +59,7 @@
  20. #include "libavutil/mips/asmdefs.h"
  21. #if HAVE_INLINE_ASM
  22. +#if HAVE_MIPSFPU
  23. static av_always_inline void float_copy(float *dst, const float *src, int count)
  24. {
  25. // Copy 'count' floats from src to dst
  26. @@ -282,7 +283,6 @@ static void apply_ltp_mips(AACContext *ac, SingleChannelElement *sce)
  27. }
  28. }
  29. -#if HAVE_MIPSFPU
  30. static av_always_inline void fmul_and_reverse(float *dst, const float *src0, const float *src1, int count)
  31. {
  32. /* Multiply 'count' floats in src0 by src1 and store the results in dst in reverse */
  33. @@ -433,9 +433,9 @@ static void update_ltp_mips(AACContext *ac, SingleChannelElement *sce)
  34. void ff_aacdec_init_mips(AACContext *c)
  35. {
  36. #if HAVE_INLINE_ASM
  37. +#if HAVE_MIPSFPU
  38. c->imdct_and_windowing = imdct_and_windowing_mips;
  39. c->apply_ltp = apply_ltp_mips;
  40. -#if HAVE_MIPSFPU
  41. c->update_ltp = update_ltp_mips;
  42. #endif /* HAVE_MIPSFPU */
  43. #endif /* HAVE_INLINE_ASM */
  44. diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
  45. index 83fdc2f9dbd..ef47e31a9ea 100644
  46. --- a/libavcodec/mips/aacpsdsp_mips.c
  47. +++ b/libavcodec/mips/aacpsdsp_mips.c
  48. @@ -57,6 +57,7 @@
  49. #include "libavutil/mips/asmdefs.h"
  50. #if HAVE_INLINE_ASM
  51. +#if HAVE_MIPSFPU
  52. static void ps_hybrid_analysis_ileave_mips(float (*out)[32][2], float L[2][38][64],
  53. int i, int len)
  54. {
  55. @@ -187,7 +188,6 @@ static void ps_hybrid_synthesis_deint_mips(float out[2][38][64],
  56. }
  57. }
  58. -#if HAVE_MIPSFPU
  59. #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
  60. static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
  61. {
  62. @@ -450,9 +450,9 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float (*r)[2],
  63. void ff_psdsp_init_mips(PSDSPContext *s)
  64. {
  65. #if HAVE_INLINE_ASM
  66. +#if HAVE_MIPSFPU
  67. s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
  68. s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
  69. -#if HAVE_MIPSFPU
  70. #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
  71. s->add_squares = ps_add_squares_mips;
  72. s->mul_pair_single = ps_mul_pair_single_mips;
  73. diff --git a/libavcodec/mips/aacsbr_mips.c b/libavcodec/mips/aacsbr_mips.c
  74. index 56aa4e86822..2e0cd723d7e 100644
  75. --- a/libavcodec/mips/aacsbr_mips.c
  76. +++ b/libavcodec/mips/aacsbr_mips.c
  77. @@ -58,6 +58,7 @@
  78. #define ENVELOPE_ADJUSTMENT_OFFSET 2
  79. #if HAVE_INLINE_ASM
  80. +#if HAVE_MIPSFPU
  81. static int sbr_lf_gen_mips(AACContext *ac, SpectralBandReplication *sbr,
  82. float X_low[32][40][2], const float W[2][32][32][2],
  83. int buf_idx)
  84. @@ -310,7 +311,6 @@ static int sbr_x_gen_mips(SpectralBandReplication *sbr, float X[2][38][64],
  85. return 0;
  86. }
  87. -#if HAVE_MIPSFPU
  88. #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
  89. static void sbr_hf_assemble_mips(float Y1[38][64][2],
  90. const float X_high[64][40][2],
  91. @@ -611,9 +611,9 @@ static void sbr_hf_inverse_filter_mips(SBRDSPContext *dsp,
  92. void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c)
  93. {
  94. #if HAVE_INLINE_ASM
  95. +#if HAVE_MIPSFPU
  96. c->sbr_lf_gen = sbr_lf_gen_mips;
  97. c->sbr_x_gen = sbr_x_gen_mips;
  98. -#if HAVE_MIPSFPU
  99. #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
  100. c->sbr_hf_inverse_filter = sbr_hf_inverse_filter_mips;
  101. c->sbr_hf_assemble = sbr_hf_assemble_mips;
  102. diff --git a/libavcodec/mips/sbrdsp_mips.c b/libavcodec/mips/sbrdsp_mips.c
  103. index 1b0a10608de..83039fd802a 100644
  104. --- a/libavcodec/mips/sbrdsp_mips.c
  105. +++ b/libavcodec/mips/sbrdsp_mips.c
  106. @@ -59,6 +59,7 @@
  107. #include "libavutil/mips/asmdefs.h"
  108. #if HAVE_INLINE_ASM
  109. +#if HAVE_MIPSFPU
  110. static void sbr_qmf_pre_shuffle_mips(float *z)
  111. {
  112. int Temp1, Temp2, Temp3, Temp4, Temp5, Temp6;
  113. @@ -165,7 +166,6 @@ static void sbr_qmf_post_shuffle_mips(float W[32][2], const float *z)
  114. );
  115. }
  116. -#if HAVE_MIPSFPU
  117. #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
  118. static void sbr_sum64x5_mips(float *z)
  119. {
  120. @@ -890,9 +890,9 @@ static void sbr_hf_apply_noise_3_mips(float (*Y)[2], const float *s_m,
  121. void ff_sbrdsp_init_mips(SBRDSPContext *s)
  122. {
  123. #if HAVE_INLINE_ASM
  124. +#if HAVE_MIPSFPU
  125. s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_mips;
  126. s->qmf_post_shuffle = sbr_qmf_post_shuffle_mips;
  127. -#if HAVE_MIPSFPU
  128. #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
  129. s->sum64x5 = sbr_sum64x5_mips;
  130. s->sum_square = sbr_sum_square_mips;