[FFmpeg-devel] [PATCH 10/12] mips: use float* to hold pointer instead of int

James Cowgill james410 at cowgill.org.uk
Thu Feb 26 14:42:51 CET 2015


This is obviously needed for 64-bit support.

Signed-off-by: James Cowgill <james410 at cowgill.org.uk>
---
 libavcodec/mips/aacdec_mips.c   |  2 +-
 libavcodec/mips/aacpsdsp_mips.c | 12 ++++++------
 libavcodec/mips/sbrdsp_mips.c   | 10 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libavcodec/mips/aacdec_mips.c b/libavcodec/mips/aacdec_mips.c
index 5e0a83d..b6eec53 100644
--- a/libavcodec/mips/aacdec_mips.c
+++ b/libavcodec/mips/aacdec_mips.c
@@ -344,7 +344,7 @@ static void update_ltp_mips(AACContext *ac, SingleChannelElement *sce)
 
     if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
         float *p_saved_ltp = saved_ltp + 576;
-        int loop_end1 = (int)(p_saved_ltp + 448);
+        float *loop_end1 = p_saved_ltp + 448;
 
         float_copy(saved_ltp, saved, 512);
 
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 1175918..b03cc3f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -293,7 +293,7 @@ static void ps_decorrelate_mips(float (*out)[2], float (*delay)[2],
     float phi_fract1 = phi_fract[1];
     float temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9;
 
-    len = (int)((int*)p_delay + (len << 1));
+    float *p_delay_end = (p_delay + (len << 1));
 
     /* merged 2 loops */
     __asm__ volatile(
@@ -369,7 +369,7 @@ static void ps_decorrelate_mips(float (*out)[2], float (*delay)[2],
         "swc1    %[temp3],      628(%[p_ap_delay])                       \n\t"
         "swc1    %[temp5],      -8(%[p_out])                             \n\t"
         "swc1    %[temp6],      -4(%[p_out])                             \n\t"
-        "bne     %[p_delay],    %[len],        1b                        \n\t"
+        "bne     %[p_delay],    %[p_delay_end],1b                        \n\t"
         " swc1   %[temp6],      -4(%[p_out])                             \n\t"
         ".set    pop                                                     \n\t"
 
@@ -380,7 +380,7 @@ static void ps_decorrelate_mips(float (*out)[2], float (*delay)[2],
           [p_Q_fract]"+r"(p_Q_fract), [p_t_gain]"+r"(p_t_gain), [p_out]"+r"(p_out),
           [ag0]"=&f"(ag0), [ag1]"=&f"(ag1), [ag2]"=&f"(ag2)
         : [phi_fract0]"f"(phi_fract0), [phi_fract1]"f"(phi_fract1),
-          [len]"r"(len), [g_decay_slope]"f"(g_decay_slope)
+          [p_delay_end]"r"(p_delay_end), [g_decay_slope]"f"(g_decay_slope)
         : "memory"
     );
 }
@@ -400,7 +400,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float (*r)[2],
     float temp0, temp1, temp2, temp3;
     float l_re, l_im, r_re, r_im;
 
-    len = (int)((int*)l + (len << 1));
+    float *l_end = ((float *)l + (len << 1));
 
     __asm__ volatile(
         ".set    push                                     \n\t"
@@ -427,7 +427,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float (*r)[2],
         "swc1    %[temp0],  -8(%[l])                      \n\t"
         "swc1    %[temp2],  -8(%[r])                      \n\t"
         "swc1    %[temp1],  -4(%[l])                      \n\t"
-        "bne     %[l],      %[len],    1b                 \n\t"
+        "bne     %[l],      %[l_end],  1b                 \n\t"
         " swc1   %[temp3],  -4(%[r])                      \n\t"
         ".set    pop                                      \n\t"
 
@@ -438,7 +438,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float (*r)[2],
           [l_re]"=&f"(l_re), [l_im]"=&f"(l_im),
           [r_re]"=&f"(r_re), [r_im]"=&f"(r_im)
         : [hs0]"f"(hs0), [hs1]"f"(hs1), [hs2]"f"(hs2),
-          [hs3]"f"(hs3), [len]"r"(len)
+          [hs3]"f"(hs3), [l_end]"r"(l_end)
         : "memory"
     );
 }
diff --git a/libavcodec/mips/sbrdsp_mips.c b/libavcodec/mips/sbrdsp_mips.c
index 5c21749..9f2d827 100644
--- a/libavcodec/mips/sbrdsp_mips.c
+++ b/libavcodec/mips/sbrdsp_mips.c
@@ -665,14 +665,14 @@ static void sbr_hf_gen_mips(float (*X_high)[2], const float (*X_low)[2],
 static void sbr_hf_g_filt_mips(float (*Y)[2], const float (*X_high)[40][2],
                             const float *g_filt, int m_max, intptr_t ixh)
 {
-    float *p_y, *p_x, *p_g;
+    const float *p_x, *p_g, *loop_end;
+    float *p_y;
     float temp0, temp1, temp2;
-    int loop_end;
 
-    p_g = (float*)&g_filt[0];
+    p_g = &g_filt[0];
     p_y = &Y[0][0];
-    p_x = (float*)&X_high[0][ixh][0];
-    loop_end = (int)((int*)p_g + m_max);
+    p_x = &X_high[0][ixh][0];
+    loop_end = p_g + m_max;
 
     __asm__ volatile(
         ".set    push                                \n\t"
-- 
2.1.4



More information about the ffmpeg-devel mailing list