[FFmpeg-cvslog] mips: use float* to hold pointer instead of int

James Cowgill git at videolan.org
Tue Mar 3 22:40:16 CET 2015


ffmpeg | branch: master | James Cowgill <james410 at cowgill.org.uk> | Thu Feb 26 13:42:51 2015 +0000| [de4f59b5367213fc5a10df6570f9f33757302fbd] | committer: Michael Niedermayer

mips: use float* to hold pointer instead of int

This is obviously needed for 64-bit support.

Signed-off-by: James Cowgill <james410 at cowgill.org.uk>
Reviewed-by: Nedeljko Babic <Nedeljko.Babic at imgtec.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de4f59b5367213fc5a10df6570f9f33757302fbd
---

 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 909e22b..93947be 100644
--- a/libavcodec/mips/aacdec_mips.c
+++ b/libavcodec/mips/aacdec_mips.c
@@ -343,7 +343,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 06d99d8..b6b5446 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -292,7 +292,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(
@@ -368,7 +368,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"
 
@@ -379,7 +379,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"
     );
 }
@@ -399,7 +399,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"
@@ -426,7 +426,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"
 
@@ -437,7 +437,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 c76e709..000d3b5 100644
--- a/libavcodec/mips/sbrdsp_mips.c
+++ b/libavcodec/mips/sbrdsp_mips.c
@@ -664,14 +664,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"



More information about the ffmpeg-cvslog mailing list