[FFmpeg-devel] [PATCH] libavcodec/mips/h264dsp_msa.c: fix type in some function parameters

2016-10-12 Thread Vicente Olivert Riera
This fixes a build problem for MIPS architecture that looks like this:

libavcodec/mips/h264dsp_msa.c:2498:6: error: conflicting types for
‘ff_weight_h264_pixels16_8_msa’
 void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride,

This bug was introduced by commit bc26fe89275c267d169b468356c82ee59874407d:

  avcodec/h264: Use ptrdiff_t for (bi)weight functions

That commit changed the data type of some function parameters in some
function definitions. However, the implementation of those functions in
libavcodec/mips/h264dsp_msa.c wasn't changed accordingly.

Signed-off-by: Vicente Olivert Riera 
---
 libavcodec/mips/h264dsp_msa.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/mips/h264dsp_msa.c b/libavcodec/mips/h264dsp_msa.c
index fce01ac..16e4858 100644
--- a/libavcodec/mips/h264dsp_msa.c
+++ b/libavcodec/mips/h264dsp_msa.c
@@ -2495,21 +2495,21 @@ void ff_h264_h_loop_filter_luma_mbaff_intra_msa(uint8_t 
*src,
 avc_h_loop_filter_luma_mbaff_intra_msa(src, ystride, alpha, beta);
 }
 
-void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride,
+void ff_weight_h264_pixels16_8_msa(uint8_t *src, ptrdiff_t stride,
int height, int log2_denom,
int weight_src, int offset)
 {
 avc_wgt_16width_msa(src, stride, height, log2_denom, weight_src, offset);
 }
 
-void ff_weight_h264_pixels8_8_msa(uint8_t *src, int stride,
+void ff_weight_h264_pixels8_8_msa(uint8_t *src, ptrdiff_t stride,
   int height, int log2_denom,
   int weight_src, int offset)
 {
 avc_wgt_8width_msa(src, stride, height, log2_denom, weight_src, offset);
 }
 
-void ff_weight_h264_pixels4_8_msa(uint8_t *src, int stride,
+void ff_weight_h264_pixels4_8_msa(uint8_t *src, ptrdiff_t stride,
   int height, int log2_denom,
   int weight_src, int offset)
 {
@@ -2517,7 +2517,7 @@ void ff_weight_h264_pixels4_8_msa(uint8_t *src, int 
stride,
 }
 
 void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, uint8_t *src,
- int stride, int height,
+ ptrdiff_t stride, int height,
  int log2_denom, int weight_dst,
  int weight_src, int offset)
 {
@@ -2526,7 +2526,7 @@ void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, 
uint8_t *src,
 }
 
 void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t *src,
-int stride, int height,
+ptrdiff_t stride, int height,
 int log2_denom, int weight_dst,
 int weight_src, int offset)
 {
@@ -2535,7 +2535,7 @@ void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t 
*src,
 }
 
 void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src,
-int stride, int height,
+ptrdiff_t stride, int height,
 int log2_denom, int weight_dst,
 int weight_src, int offset)
 {
-- 
2.10.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 3/3] mips: add support for R6

2016-03-09 Thread Vicente Olivert Riera
ping

On 24/02/16 16:38, Vicente Olivert Riera wrote:
> Understanding the mips32r6 and mips64r6 ISAs in the configure script is
> not enough. In order to have full support for MIPS R6 in FFmpeg we need
> to be able to build it, and for that we need to make sure we don't use
> incompatible assembler code which makes the build fail. Ifdefing the
> offending code is sufficient to fix the problem.
> 
> Signed-off-by: Vicente Olivert Riera 
> ---
> Changes v1 -> v7:
>  - Nothing.
> 
>  libavcodec/mips/aaccoder_mips.c   |  4 
>  libavcodec/mips/aacdec_mips.h |  2 ++
>  libavcodec/mips/aacpsdsp_mips.c   |  4 
>  libavcodec/mips/aacpsy_mips.h |  2 ++
>  libavcodec/mips/aacsbr_mips.c |  4 
>  libavcodec/mips/aacsbr_mips.h |  2 ++
>  libavcodec/mips/ac3dsp_mips.c |  6 +-
>  libavcodec/mips/acelp_filters_mips.c  |  4 
>  libavcodec/mips/acelp_vectors_mips.c  |  4 
>  libavcodec/mips/amrwbdec_mips.c   |  2 ++
>  libavcodec/mips/amrwbdec_mips.h   |  2 ++
>  libavcodec/mips/celp_filters_mips.c   |  4 
>  libavcodec/mips/celp_math_mips.c  |  4 
>  libavcodec/mips/compute_antialias_float.h |  2 ++
>  libavcodec/mips/fft_mips.c|  4 
>  libavcodec/mips/iirfilter_mips.c  |  4 
>  libavcodec/mips/lsp_mips.h|  2 ++
>  libavcodec/mips/mpegaudiodsp_mips_fixed.c | 10 ++
>  libavcodec/mips/mpegaudiodsp_mips_float.c | 10 ++
>  libavcodec/mips/sbrdsp_mips.c |  4 
>  libavutil/mips/float_dsp_mips.c   |  4 
>  21 files changed, 83 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
> index 8fbdfd2..d690c8c 100644
> --- a/libavcodec/mips/aaccoder_mips.c
> +++ b/libavcodec/mips/aaccoder_mips.c
> @@ -66,6 +66,7 @@
>  #include "libavcodec/aacenc_utils.h"
>  
>  #if HAVE_INLINE_ASM
> +#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
>  typedef struct BandCodingPath {
>  int prev_idx;
>  float cost;
> @@ -2477,10 +2478,12 @@ static void search_for_ms_mips(AACEncContext *s, 
> ChannelElement *cpe)
>  
>  #include "libavcodec/aaccoder_trellis.h"
>  
> +#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
>  #endif /* HAVE_INLINE_ASM */
>  
>  void ff_aac_coder_init_mips(AACEncContext *c) {
>  #if HAVE_INLINE_ASM
> +#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
>  AACCoefficientsEncoder *e = c->coder;
>  int option = c->options.coder;
>  
> @@ -2494,5 +2497,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
>  #if HAVE_MIPSFPU
>  e->search_for_ms= search_for_ms_mips;
>  #endif /* HAVE_MIPSFPU */
> +#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
>  #endif /* HAVE_INLINE_ASM */
>  }
> diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
> index c4f6438..758266f 100644
> --- a/libavcodec/mips/aacdec_mips.h
> +++ b/libavcodec/mips/aacdec_mips.h
> @@ -61,6 +61,7 @@
>  #include "libavutil/mips/asmdefs.h"
>  
>  #if HAVE_INLINE_ASM && HAVE_MIPSFPU
> +#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
>  static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
> const float *scale)
>  {
> @@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
> *v, unsigned idx,
>  #define VMUL4 VMUL4_mips
>  #define VMUL2S VMUL2S_mips
>  #define VMUL4S VMUL4S_mips
> +#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
>  #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
>  
>  #endif /* AVCODEC_MIPS_AACDEC_MIPS_H */
> diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
> index 695f9ef..83fdc2f 100644
> --- a/libavcodec/mips/aacpsdsp_mips.c
> +++ b/libavcodec/mips/aacpsdsp_mips.c
> @@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
> out[2][38][64],
>  }
>  
>  #if HAVE_MIPSFPU
> +#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
>  static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
>  {
>  int i;
> @@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], 
> float (*r)[2],
>  : "memory"
>  );
>  }
> +#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
>  #endif /* HAVE_MIPSFPU */
>  #endif /* HAVE_INLINE_ASM */
>  
> @@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
>  s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
>  s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
>  #if HAVE_MIPSFPU
> +#if !HA

[FFmpeg-devel] [PATCH v7 3/3] mips: add support for R6

2016-02-24 Thread Vicente Olivert Riera
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v7:
 - Nothing.

 libavcodec/mips/aaccoder_mips.c   |  4 
 libavcodec/mips/aacdec_mips.h |  2 ++
 libavcodec/mips/aacpsdsp_mips.c   |  4 
 libavcodec/mips/aacpsy_mips.h |  2 ++
 libavcodec/mips/aacsbr_mips.c |  4 
 libavcodec/mips/aacsbr_mips.h |  2 ++
 libavcodec/mips/ac3dsp_mips.c |  6 +-
 libavcodec/mips/acelp_filters_mips.c  |  4 
 libavcodec/mips/acelp_vectors_mips.c  |  4 
 libavcodec/mips/amrwbdec_mips.c   |  2 ++
 libavcodec/mips/amrwbdec_mips.h   |  2 ++
 libavcodec/mips/celp_filters_mips.c   |  4 
 libavcodec/mips/celp_math_mips.c  |  4 
 libavcodec/mips/compute_antialias_float.h |  2 ++
 libavcodec/mips/fft_mips.c|  4 
 libavcodec/mips/iirfilter_mips.c  |  4 
 libavcodec/mips/lsp_mips.h|  2 ++
 libavcodec/mips/mpegaudiodsp_mips_fixed.c | 10 ++
 libavcodec/mips/mpegaudiodsp_mips_float.c | 10 ++
 libavcodec/mips/sbrdsp_mips.c |  4 
 libavutil/mips/float_dsp_mips.c   |  4 
 21 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
index 8fbdfd2..d690c8c 100644
--- a/libavcodec/mips/aaccoder_mips.c
+++ b/libavcodec/mips/aaccoder_mips.c
@@ -66,6 +66,7 @@
 #include "libavcodec/aacenc_utils.h"
 
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 typedef struct BandCodingPath {
 int prev_idx;
 float cost;
@@ -2477,10 +2478,12 @@ static void search_for_ms_mips(AACEncContext *s, 
ChannelElement *cpe)
 
 #include "libavcodec/aaccoder_trellis.h"
 
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
 void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 AACCoefficientsEncoder *e = c->coder;
 int option = c->options.coder;
 
@@ -2494,5 +2497,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_MIPSFPU
 e->search_for_ms= search_for_ms_mips;
 #endif /* HAVE_MIPSFPU */
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index c4f6438..758266f 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -61,6 +61,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
 {
@@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 #define VMUL4 VMUL4_mips
 #define VMUL2S VMUL2S_mips
 #define VMUL4S VMUL4S_mips
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
 
 #endif /* AVCODEC_MIPS_AACDEC_MIPS_H */
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 695f9ef..83fdc2f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
out[2][38][64],
 }
 
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
 {
 int i;
@@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float 
(*r)[2],
 : "memory"
 );
 }
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 
@@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
 s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
 s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 s->add_squares= ps_add_squares_mips;
 s->mul_pair_single= ps_mul_pair_single_mips;
 s->decorrelate= ps_decorrelate_mips;
 s->stereo_interpolate[0]  = ps_stereo_interpolate_mips;
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacpsy_mips.h b/libavcodec/mips/aacpsy_mips.h
index 42ff442..a1fe5cc 100644
--- a/libavcodec/mips/aacpsy_mips.h
+++ b/libavcodec/mips/aacpsy_mips.h
@@ -59,6 +59,7 @@
 #include "libavutil/mips/asmdefs.h&

[FFmpeg-devel] [PATCH v7 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-02-24 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v6 -> v7:
 - Do not pass -msoft-float. Leave the mipsfpu handling as it was
   before, so nothing changes. This could be improbed in the future.

Changes v5 -> v6:
 - Multiple changes:
   - Use separate if blocks when detecting the MIPS ISA, this way when a block
 disables one ISA it will be detected by the next one. Before the elif was
 preventing this to be done.
   - Don't use check_cflags and use only check_ldflags instead, which will
 check if that flag is valid for compiling and linking. The compiler may
 accept some cflags for compiling but not for linking, so if we check first
 for the cflags it will succeed, and the cflags will be added to the CFLAGS
 variable despite of the check_ldflags failing after that. This can cause
 problems because of having multiple incompatible cflags enabled at the same
 time.
   - Check if mipsfpu has been disabled, and if so, then use -msoft-float. This
 way we override the compiler default behavious which can be building for
 hard-float.
   - Explicitly disable the features that fail any check by adding "|| disable
 $feature" at the end of the checks chain.

Changes v4 -> v5:
 - Check for msa.h and disable msa if not found.

Changes v3 -> v4:
 - Nothing.

Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Add a block of code for mipsdspr2 which was previously placed in the
   first patch of this series causing a syntax error in the configure
   script.
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 configure | 101 +++---
 1 file changed, 83 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 857b683..ee0d00f 100755
--- a/configure
+++ b/configure
@@ -5076,27 +5076,92 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
-add_cflags "-mips64r2"
-add_asflags "-mips64r2"
-elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled 
loongson3; then
-add_cflags "-mips64"
-add_asflags "-mips64"
-elif enabled mipsdsp || enabled mipsdspr2; then
-add_cflags "-mips32r2 -mfp32"
-add_asflags "-mips32r2 -mfp32"
+if enabled mips64; then
+if enabled mips64r6; then
+check_ldflags "-mips64r6" &&
+add_cflags "-mips64r6" &&
+add_asflags "-mips64r6" &&
+check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' ||
+disable mips64r6
+fi
+if disabled mips64r6 && enabled mips64r2; then
+check_ldflags "-mips64r2" &&
+add_cflags "-mips64r2" &&
+add_asflags "-mips64r2" &&
+check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' ||
+disable mips64r2
+fi
+if disabled mips64r6 && disabled mips64r2; then
+check_ldflags "-mips64" &&
+add_cflags "-mips64" &&
+add_asflags "-mips64" &&
+check_inline_asm mips64r1 '"daddi $0, $0, 0"' ||
+disable mips64r1
+fi
+else
+if enabled mips32r6; then
+check_ldflags "-mips32r6" &&
+add_cflags "-mips32r6" &&
+add_asflags "-mips32r6" &&
+check_inline_asm mips32r6 '"aui $0, $0, 0"' ||
+disable mips32r6
+fi
+if disabled mips32r6 && enabled mips32r2; then
+check_ldflags "-mips32r2" &&
+add_cflags "-mips32r2" &&
+add_asflags "-mips32r2" &&
+check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' ||
+disable mips32r2
+fi
+if disabled mips32r6 && disabled mips32r2; then
+check_ldflags "-mips32" &&
+add_cflags "-mips32" &&
+add_asflags "-mips32" &&
+check_inline_asm mips32r1 '"addi $0, $0, 0"' ||
+disable mips32r1
+fi
 fi
 
-enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
-enabled mipsdspr2 && add_cflags "-mdspr2" && ad

[FFmpeg-devel] [PATCH v7 2/3] mips: do not disable any feature for generic cores

2016-02-24 Thread Vicente Olivert Riera
We don't know which features are available when the user selects a
generic core, so don't disable anything by default and let the user
decide.

Signed-off-by: Vicente Olivert Riera 
---
Changes v4 -> v7:
 - Nothing.

Changes v3 -> v4:
 - Minor change in the commit log: remove "let's".

Changes v2 -> v3:
 - Change the logic of this patch. Instead of removing the generic core,
   do not disable any feature and add a warning message to state that.
   The patch subject has also changed accordingly.

Changes v1 -> v2:
 - Nothing.

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index ee0d00f..6167f7c 100755
--- a/configure
+++ b/configure
@@ -4251,8 +4251,8 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips64r6
-disable msa
+# We do not disable anything. Is up to the user to disable
+# the unwanted features.
 ;;
 *)
 # Unknown CPU. Disable everything.
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v6 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-01-25 Thread Vicente Olivert Riera
On 25/01/16 11:32, Michael Niedermayer wrote:
> On Mon, Jan 25, 2016 at 10:35:12AM +0000, Vicente Olivert Riera wrote:
>> On 21/01/16 23:17, Michael Niedermayer wrote:
>>> On Wed, Jan 20, 2016 at 02:33:21PM +0000, Vicente Olivert Riera wrote:
>>>> On 20/01/16 13:15, Michael Niedermayer wrote:
>>>>> On Wed, Jan 20, 2016 at 12:21:37PM +, Vicente Olivert Riera wrote:
>>>>>> On 20/01/16 12:05, Michael Niedermayer wrote:
>>>>>>> On Wed, Jan 20, 2016 at 11:37:52AM +, Vicente Olivert Riera wrote:
>>>>>>>> Hello Michael,
>>>>>>>>
>>>>>>>> On 19/01/16 22:11, Michael Niedermayer wrote:
>>>>>>>>> On Thu, Jan 14, 2016 at 02:59:03PM +, Vicente Olivert Riera wrote:
>>>>>>>>>> Signed-off-by: Vicente Olivert Riera 
>>>>>>>>>> ---
>>>>>>>>>> Changes v5 -> v6:
>>>>>>>>>>  - Multiple changes:
>>>>>>>>>>- Use separate if blocks when detecting the MIPS ISA, this way 
>>>>>>>>>> when a block
>>>>>>>>>>  disables one ISA it will be detected by the next one. Before 
>>>>>>>>>> the elif was
>>>>>>>>>>  preventing this to be done.
>>>>>>>>>>- Don't use check_cflags and use only check_ldflags instead, 
>>>>>>>>>> which will
>>>>>>>>>>  check if that flag is valid for compiling and linking. The 
>>>>>>>>>> compiler may
>>>>>>>>>>  accept some cflags for compiling but not for linking, so if we 
>>>>>>>>>> check first
>>>>>>>>>>  for the cflags it will succeed, and the cflags will be added to 
>>>>>>>>>> the CFLAGS
>>>>>>>>>>  variable despite of the check_ldflags failing after that. This 
>>>>>>>>>> can cause
>>>>>>>>>>  problems because of having multiple incompatible cflags enabled 
>>>>>>>>>> at the same
>>>>>>>>>>  time.
>>>>>>>>>>- Check if mipsfpu has been disabled, and if so, then use 
>>>>>>>>>> -msoft-float. This
>>>>>>>>>>  way we override the compiler default behavious which can be 
>>>>>>>>>> building for
>>>>>>>>>>  hard-float.
>>>>>>>>>>- Explicitly disable the features that fail any check by adding 
>>>>>>>>>> "|| disable
>>>>>>>>>>  $feature" at the end of the checks chain.
>>>>>>>>>>
>>>>>>>>>> Changes v4 -> v5:
>>>>>>>>>>  - Check for msa.h and disable msa if not found.
>>>>>>>>>>
>>>>>>>>>> Changes v3 -> v4:
>>>>>>>>>>  - Nothing.
>>>>>>>>>>
>>>>>>>>>> Changes v2 -> v3:
>>>>>>>>>>  - Nothing.
>>>>>>>>>>
>>>>>>>>>> Changes v1 -> v2:
>>>>>>>>>>  - Add a block of code for mipsdspr2 which was previously placed in 
>>>>>>>>>> the
>>>>>>>>>>first patch of this series causing a syntax error in the configure
>>>>>>>>>>script.
>>>>>>>>>>
>>>>>>>>>> https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html
>>>>>>>>>
>>>>>>>>> make distclean ; ../configure --cross-prefix=/usr/mips-linux-gnu/bin/ 
>>>>>>>>> --cc='ccache mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux 
>>>>>>>>> --enable-cross-compile  --disable-mipsfpu && make -j12
>>>>>>>>> results in pages of:
>>>>>>>>>
>>>>>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>>>>>> libswresample/libswresample.a(dither.o) uses soft

Re: [FFmpeg-devel] [PATCH v6 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-01-25 Thread Vicente Olivert Riera
On 21/01/16 23:17, Michael Niedermayer wrote:
> On Wed, Jan 20, 2016 at 02:33:21PM +0000, Vicente Olivert Riera wrote:
>> On 20/01/16 13:15, Michael Niedermayer wrote:
>>> On Wed, Jan 20, 2016 at 12:21:37PM +0000, Vicente Olivert Riera wrote:
>>>> On 20/01/16 12:05, Michael Niedermayer wrote:
>>>>> On Wed, Jan 20, 2016 at 11:37:52AM +, Vicente Olivert Riera wrote:
>>>>>> Hello Michael,
>>>>>>
>>>>>> On 19/01/16 22:11, Michael Niedermayer wrote:
>>>>>>> On Thu, Jan 14, 2016 at 02:59:03PM +, Vicente Olivert Riera wrote:
>>>>>>>> Signed-off-by: Vicente Olivert Riera 
>>>>>>>> ---
>>>>>>>> Changes v5 -> v6:
>>>>>>>>  - Multiple changes:
>>>>>>>>- Use separate if blocks when detecting the MIPS ISA, this way when 
>>>>>>>> a block
>>>>>>>>  disables one ISA it will be detected by the next one. Before the 
>>>>>>>> elif was
>>>>>>>>  preventing this to be done.
>>>>>>>>- Don't use check_cflags and use only check_ldflags instead, which 
>>>>>>>> will
>>>>>>>>  check if that flag is valid for compiling and linking. The 
>>>>>>>> compiler may
>>>>>>>>  accept some cflags for compiling but not for linking, so if we 
>>>>>>>> check first
>>>>>>>>  for the cflags it will succeed, and the cflags will be added to 
>>>>>>>> the CFLAGS
>>>>>>>>  variable despite of the check_ldflags failing after that. This 
>>>>>>>> can cause
>>>>>>>>  problems because of having multiple incompatible cflags enabled 
>>>>>>>> at the same
>>>>>>>>  time.
>>>>>>>>- Check if mipsfpu has been disabled, and if so, then use 
>>>>>>>> -msoft-float. This
>>>>>>>>  way we override the compiler default behavious which can be 
>>>>>>>> building for
>>>>>>>>  hard-float.
>>>>>>>>- Explicitly disable the features that fail any check by adding "|| 
>>>>>>>> disable
>>>>>>>>  $feature" at the end of the checks chain.
>>>>>>>>
>>>>>>>> Changes v4 -> v5:
>>>>>>>>  - Check for msa.h and disable msa if not found.
>>>>>>>>
>>>>>>>> Changes v3 -> v4:
>>>>>>>>  - Nothing.
>>>>>>>>
>>>>>>>> Changes v2 -> v3:
>>>>>>>>  - Nothing.
>>>>>>>>
>>>>>>>> Changes v1 -> v2:
>>>>>>>>  - Add a block of code for mipsdspr2 which was previously placed in the
>>>>>>>>first patch of this series causing a syntax error in the configure
>>>>>>>>script.
>>>>>>>>
>>>>>>>> https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html
>>>>>>>
>>>>>>> make distclean ; ../configure --cross-prefix=/usr/mips-linux-gnu/bin/ 
>>>>>>> --cc='ccache mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux 
>>>>>>> --enable-cross-compile  --disable-mipsfpu && make -j12
>>>>>>> results in pages of:
>>>>>>>
>>>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>>>> libswresample/libswresample.a(dither.o) uses soft float
>>>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>>>> libswresample/libswresample.a(resample.o) uses soft float
>>>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>>>> libswresample/libswresample.a(resample_dsp.o) uses soft float
>>>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>>>> Warning: lib

Re: [FFmpeg-devel] [PATCH v6 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-01-20 Thread Vicente Olivert Riera
On 20/01/16 13:15, Michael Niedermayer wrote:
> On Wed, Jan 20, 2016 at 12:21:37PM +0000, Vicente Olivert Riera wrote:
>> On 20/01/16 12:05, Michael Niedermayer wrote:
>>> On Wed, Jan 20, 2016 at 11:37:52AM +0000, Vicente Olivert Riera wrote:
>>>> Hello Michael,
>>>>
>>>> On 19/01/16 22:11, Michael Niedermayer wrote:
>>>>> On Thu, Jan 14, 2016 at 02:59:03PM +0000, Vicente Olivert Riera wrote:
>>>>>> Signed-off-by: Vicente Olivert Riera 
>>>>>> ---
>>>>>> Changes v5 -> v6:
>>>>>>  - Multiple changes:
>>>>>>- Use separate if blocks when detecting the MIPS ISA, this way when a 
>>>>>> block
>>>>>>  disables one ISA it will be detected by the next one. Before the 
>>>>>> elif was
>>>>>>  preventing this to be done.
>>>>>>- Don't use check_cflags and use only check_ldflags instead, which 
>>>>>> will
>>>>>>  check if that flag is valid for compiling and linking. The compiler 
>>>>>> may
>>>>>>  accept some cflags for compiling but not for linking, so if we 
>>>>>> check first
>>>>>>  for the cflags it will succeed, and the cflags will be added to the 
>>>>>> CFLAGS
>>>>>>  variable despite of the check_ldflags failing after that. This can 
>>>>>> cause
>>>>>>  problems because of having multiple incompatible cflags enabled at 
>>>>>> the same
>>>>>>  time.
>>>>>>- Check if mipsfpu has been disabled, and if so, then use 
>>>>>> -msoft-float. This
>>>>>>  way we override the compiler default behavious which can be 
>>>>>> building for
>>>>>>  hard-float.
>>>>>>- Explicitly disable the features that fail any check by adding "|| 
>>>>>> disable
>>>>>>  $feature" at the end of the checks chain.
>>>>>>
>>>>>> Changes v4 -> v5:
>>>>>>  - Check for msa.h and disable msa if not found.
>>>>>>
>>>>>> Changes v3 -> v4:
>>>>>>  - Nothing.
>>>>>>
>>>>>> Changes v2 -> v3:
>>>>>>  - Nothing.
>>>>>>
>>>>>> Changes v1 -> v2:
>>>>>>  - Add a block of code for mipsdspr2 which was previously placed in the
>>>>>>first patch of this series causing a syntax error in the configure
>>>>>>script.
>>>>>>
>>>>>> https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html
>>>>>
>>>>> make distclean ; ../configure --cross-prefix=/usr/mips-linux-gnu/bin/ 
>>>>> --cc='ccache mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux 
>>>>> --enable-cross-compile  --disable-mipsfpu && make -j12
>>>>> results in pages of:
>>>>>
>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>> libswresample/libswresample.a(dither.o) uses soft float
>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>> libswresample/libswresample.a(resample.o) uses soft float
>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>> libswresample/libswresample.a(resample_dsp.o) uses soft float
>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>> libavutil/libavutil.a(adler32.o) uses soft float
>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>> libavutil/libavutil.a(aes.o) uses soft float
>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>>>> libavutil/libavutil.a(aes_ctr.o) uses soft float
>>>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>>>> Warni

Re: [FFmpeg-devel] [PATCH v6 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-01-20 Thread Vicente Olivert Riera
On 20/01/16 12:05, Michael Niedermayer wrote:
> On Wed, Jan 20, 2016 at 11:37:52AM +0000, Vicente Olivert Riera wrote:
>> Hello Michael,
>>
>> On 19/01/16 22:11, Michael Niedermayer wrote:
>>> On Thu, Jan 14, 2016 at 02:59:03PM +, Vicente Olivert Riera wrote:
>>>> Signed-off-by: Vicente Olivert Riera 
>>>> ---
>>>> Changes v5 -> v6:
>>>>  - Multiple changes:
>>>>- Use separate if blocks when detecting the MIPS ISA, this way when a 
>>>> block
>>>>  disables one ISA it will be detected by the next one. Before the elif 
>>>> was
>>>>  preventing this to be done.
>>>>- Don't use check_cflags and use only check_ldflags instead, which will
>>>>  check if that flag is valid for compiling and linking. The compiler 
>>>> may
>>>>  accept some cflags for compiling but not for linking, so if we check 
>>>> first
>>>>  for the cflags it will succeed, and the cflags will be added to the 
>>>> CFLAGS
>>>>  variable despite of the check_ldflags failing after that. This can 
>>>> cause
>>>>  problems because of having multiple incompatible cflags enabled at 
>>>> the same
>>>>  time.
>>>>- Check if mipsfpu has been disabled, and if so, then use -msoft-float. 
>>>> This
>>>>  way we override the compiler default behavious which can be building 
>>>> for
>>>>  hard-float.
>>>>- Explicitly disable the features that fail any check by adding "|| 
>>>> disable
>>>>  $feature" at the end of the checks chain.
>>>>
>>>> Changes v4 -> v5:
>>>>  - Check for msa.h and disable msa if not found.
>>>>
>>>> Changes v3 -> v4:
>>>>  - Nothing.
>>>>
>>>> Changes v2 -> v3:
>>>>  - Nothing.
>>>>
>>>> Changes v1 -> v2:
>>>>  - Add a block of code for mipsdspr2 which was previously placed in the
>>>>first patch of this series causing a syntax error in the configure
>>>>script.
>>>>
>>>> https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html
>>>
>>> make distclean ; ../configure --cross-prefix=/usr/mips-linux-gnu/bin/ 
>>> --cc='ccache mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux 
>>> --enable-cross-compile  --disable-mipsfpu && make -j12
>>> results in pages of:
>>>
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>> libswresample/libswresample.a(dither.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>> libswresample/libswresample.a(resample.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>> libswresample/libswresample.a(resample_dsp.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>> libavutil/libavutil.a(adler32.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>> libavutil/libavutil.a(aes.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>> libavutil/libavutil.a(aes_ctr.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: 
>>> Warning: libavfilter/filtfmts-test uses hard float, 
>>> libavutil/libavutil.a(audio_fifo.o) uses soft float
>>>
>>>
>>> [...]
>>>
>>
>> I can't reproduce your issue. Look:
>>
>> $ make distclean ; ./configure --cross-prefix=mips-linux-gnu-
>> --arch=mips --target-os=linux --enable-cross-compile --disable-mipsfpu
>>
>> And then:
>>
>> $ make -j1 V=1 2>&1 | tee build.log
>>
>> And then:
>>
>> $ grep "uses soft float" build.log
>> $ grep "filtfmts-test" build.log
>>
>> It gives me nothing.
>>
>> Also I try to find for that filtfmts-test file which your logs say that
>> 

Re: [FFmpeg-devel] [PATCH v6 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-01-20 Thread Vicente Olivert Riera
Hello Michael,

On 19/01/16 22:11, Michael Niedermayer wrote:
> On Thu, Jan 14, 2016 at 02:59:03PM +0000, Vicente Olivert Riera wrote:
>> Signed-off-by: Vicente Olivert Riera 
>> ---
>> Changes v5 -> v6:
>>  - Multiple changes:
>>- Use separate if blocks when detecting the MIPS ISA, this way when a 
>> block
>>  disables one ISA it will be detected by the next one. Before the elif 
>> was
>>  preventing this to be done.
>>- Don't use check_cflags and use only check_ldflags instead, which will
>>  check if that flag is valid for compiling and linking. The compiler may
>>  accept some cflags for compiling but not for linking, so if we check 
>> first
>>  for the cflags it will succeed, and the cflags will be added to the 
>> CFLAGS
>>  variable despite of the check_ldflags failing after that. This can cause
>>  problems because of having multiple incompatible cflags enabled at the 
>> same
>>  time.
>>- Check if mipsfpu has been disabled, and if so, then use -msoft-float. 
>> This
>>  way we override the compiler default behavious which can be building for
>>  hard-float.
>>- Explicitly disable the features that fail any check by adding "|| 
>> disable
>>  $feature" at the end of the checks chain.
>>
>> Changes v4 -> v5:
>>  - Check for msa.h and disable msa if not found.
>>
>> Changes v3 -> v4:
>>  - Nothing.
>>
>> Changes v2 -> v3:
>>  - Nothing.
>>
>> Changes v1 -> v2:
>>  - Add a block of code for mipsdspr2 which was previously placed in the
>>first patch of this series causing a syntax error in the configure
>>script.
>>https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html
> 
> make distclean ; ../configure --cross-prefix=/usr/mips-linux-gnu/bin/ 
> --cc='ccache mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux 
> --enable-cross-compile  --disable-mipsfpu && make -j12
> results in pages of:
> 
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: 
> libavfilter/filtfmts-test uses hard float, 
> libswresample/libswresample.a(dither.o) uses soft float
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: 
> libavfilter/filtfmts-test uses hard float, 
> libswresample/libswresample.a(resample.o) uses soft float
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: 
> libavfilter/filtfmts-test uses hard float, 
> libswresample/libswresample.a(resample_dsp.o) uses soft float
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: 
> libavfilter/filtfmts-test uses hard float, libavutil/libavutil.a(adler32.o) 
> uses soft float
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: 
> libavfilter/filtfmts-test uses hard float, libavutil/libavutil.a(aes.o) uses 
> soft float
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: 
> libavfilter/filtfmts-test uses hard float, libavutil/libavutil.a(aes_ctr.o) 
> uses soft float
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: 
> libavfilter/filtfmts-test uses hard float, 
> libavutil/libavutil.a(audio_fifo.o) uses soft float
> 
> 
> [...]
> 

I can't reproduce your issue. Look:

$ make distclean ; ./configure --cross-prefix=mips-linux-gnu-
--arch=mips --target-os=linux --enable-cross-compile --disable-mipsfpu

And then:

$ make -j1 V=1 2>&1 | tee build.log

And then:

$ grep "uses soft float" build.log
$ grep "filtfmts-test" build.log

It gives me nothing.

Also I try to find for that filtfmts-test file which your logs say that
is using hard-float, and I cannot find it:

$ find . -name "filtfmts-test*"
$

Regards,

Vincent.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v6 3/3] mips: add support for R6

2016-01-14 Thread Vicente Olivert Riera
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera 
---
Changes v5 -> v6:
 - Nothing.

Changes v4 -> v5:
 - Nothing.

Changes v3 -> v4:
 - Nothing.

Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 libavcodec/mips/aaccoder_mips.c   |  4 
 libavcodec/mips/aacdec_mips.h |  2 ++
 libavcodec/mips/aacpsdsp_mips.c   |  4 
 libavcodec/mips/aacpsy_mips.h |  2 ++
 libavcodec/mips/aacsbr_mips.c |  4 
 libavcodec/mips/aacsbr_mips.h |  2 ++
 libavcodec/mips/ac3dsp_mips.c |  6 +-
 libavcodec/mips/acelp_filters_mips.c  |  4 
 libavcodec/mips/acelp_vectors_mips.c  |  4 
 libavcodec/mips/amrwbdec_mips.c   |  2 ++
 libavcodec/mips/amrwbdec_mips.h   |  2 ++
 libavcodec/mips/celp_filters_mips.c   |  4 
 libavcodec/mips/celp_math_mips.c  |  4 
 libavcodec/mips/compute_antialias_float.h |  2 ++
 libavcodec/mips/fft_mips.c|  4 
 libavcodec/mips/iirfilter_mips.c  |  4 
 libavcodec/mips/lsp_mips.h|  2 ++
 libavcodec/mips/mpegaudiodsp_mips_fixed.c | 10 ++
 libavcodec/mips/mpegaudiodsp_mips_float.c | 10 ++
 libavcodec/mips/sbrdsp_mips.c |  4 
 libavutil/mips/float_dsp_mips.c   |  4 
 21 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
index 8fbdfd2..d690c8c 100644
--- a/libavcodec/mips/aaccoder_mips.c
+++ b/libavcodec/mips/aaccoder_mips.c
@@ -66,6 +66,7 @@
 #include "libavcodec/aacenc_utils.h"
 
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 typedef struct BandCodingPath {
 int prev_idx;
 float cost;
@@ -2477,10 +2478,12 @@ static void search_for_ms_mips(AACEncContext *s, 
ChannelElement *cpe)
 
 #include "libavcodec/aaccoder_trellis.h"
 
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
 void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 AACCoefficientsEncoder *e = c->coder;
 int option = c->options.coder;
 
@@ -2494,5 +2497,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_MIPSFPU
 e->search_for_ms= search_for_ms_mips;
 #endif /* HAVE_MIPSFPU */
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index 054a9fb..0c2b243 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -61,6 +61,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
 {
@@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 #define VMUL4 VMUL4_mips
 #define VMUL2S VMUL2S_mips
 #define VMUL4S VMUL4S_mips
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
 
 #endif /* AVCODEC_MIPS_AACDEC_FLOAT_H */
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 695f9ef..83fdc2f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
out[2][38][64],
 }
 
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
 {
 int i;
@@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float 
(*r)[2],
 : "memory"
 );
 }
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 
@@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
 s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
 s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 s->add_squares= ps_add_squares_mips;
 s->mul_pair_single= ps_mul_pair_single_mips;
 s->decorrelate= ps_decorrelate_mips;
 s->stereo_interpolate[0]  = ps_stereo_interpolate_mips;
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacpsy_mips.h b/libavcodec/mips/aacpsy_mips.h
index 42ff44

[FFmpeg-devel] [PATCH v6 2/3] mips: do not disable any feature for generic cores

2016-01-14 Thread Vicente Olivert Riera
We don't know which features are available when the user selects a
generic core, so don't disable anything by default and let the user
decide.

Signed-off-by: Vicente Olivert Riera 
---
Changes v4 -> v6:
 - Nothing.

Changes v4 -> v5:
 - Nothing.

Changes v3 -> v4:
 - Minor change in the commit log: remove "let's".

Changes v2 -> v3:
 - Change the logic of this patch. Instead of removing the generic core,
   do not disable any feature and add a warning message to state that.
   The patch subject has also changed accordingly.

Changes v1 -> v2:
 - Nothing.

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 331fd04..6b65179 100755
--- a/configure
+++ b/configure
@@ -4237,8 +4237,8 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips64r6
-disable msa
+# We do not disable anything. Is up to the user to disable
+# the unwanted features.
 ;;
 *)
 # Unknown CPU. Disable everything.
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v6 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-01-14 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v5 -> v6:
 - Multiple changes:
   - Use separate if blocks when detecting the MIPS ISA, this way when a block
 disables one ISA it will be detected by the next one. Before the elif was
 preventing this to be done.
   - Don't use check_cflags and use only check_ldflags instead, which will
 check if that flag is valid for compiling and linking. The compiler may
 accept some cflags for compiling but not for linking, so if we check first
 for the cflags it will succeed, and the cflags will be added to the CFLAGS
 variable despite of the check_ldflags failing after that. This can cause
 problems because of having multiple incompatible cflags enabled at the same
 time.
   - Check if mipsfpu has been disabled, and if so, then use -msoft-float. This
 way we override the compiler default behavious which can be building for
 hard-float.
   - Explicitly disable the features that fail any check by adding "|| disable
 $feature" at the end of the checks chain.

Changes v4 -> v5:
 - Check for msa.h and disable msa if not found.

Changes v3 -> v4:
 - Nothing.

Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Add a block of code for mipsdspr2 which was previously placed in the
   first patch of this series causing a syntax error in the configure
   script.
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 configure | 106 +++---
 1 file changed, 88 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 28ec5bf..331fd04 100755
--- a/configure
+++ b/configure
@@ -5044,27 +5044,97 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
-add_cflags "-mips64r2"
-add_asflags "-mips64r2"
-elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled 
loongson3; then
-add_cflags "-mips64"
-add_asflags "-mips64"
-elif enabled mipsdsp || enabled mipsdspr2; then
-add_cflags "-mips32r2 -mfp32"
-add_asflags "-mips32r2 -mfp32"
+if enabled mips64; then
+if enabled mips64r6; then
+check_ldflags "-mips64r6" &&
+add_cflags "-mips64r6" &&
+add_asflags "-mips64r6" &&
+check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' ||
+disable mips64r6
+fi
+if disabled mips64r6 && enabled mips64r2; then
+check_ldflags "-mips64r2" &&
+add_cflags "-mips64r2" &&
+add_asflags "-mips64r2" &&
+check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' ||
+disable mips64r2
+fi
+if disabled mips64r6 && disabled mips64r2; then
+check_ldflags "-mips64" &&
+add_cflags "-mips64" &&
+add_asflags "-mips64" &&
+check_inline_asm mips64r1 '"daddi $0, $0, 0"' ||
+disable mips64r1
+fi
+else
+if enabled mips32r6; then
+check_ldflags "-mips32r6" &&
+add_cflags "-mips32r6" &&
+add_asflags "-mips32r6" &&
+check_inline_asm mips32r6 '"aui $0, $0, 0"' ||
+disable mips32r6
+fi
+if disabled mips32r6 && enabled mips32r2; then
+check_ldflags "-mips32r2" &&
+add_cflags "-mips32r2" &&
+add_asflags "-mips32r2" &&
+check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' ||
+disable mips32r2
+fi
+if disabled mips32r6 && disabled mips32r2; then
+check_ldflags "-mips32" &&
+add_cflags "-mips32" &&
+add_asflags "-mips32" &&
+check_inline_asm mips32r1 '"addi $0, $0, 0"' ||
+disable mips32r1
+fi
 fi
 
-enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
-enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
- check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
-enabled mipsfpu   && add_

[FFmpeg-devel] [PATCH v5 3/4] mips: add support for R6

2016-01-06 Thread Vicente Olivert Riera
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera 
---
Changes v4 -> v5:
 - Nothing.

Changes v3 -> v4:
 - Nothing.

Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 libavcodec/mips/aaccoder_mips.c   |  4 
 libavcodec/mips/aacdec_mips.h |  2 ++
 libavcodec/mips/aacpsdsp_mips.c   |  4 
 libavcodec/mips/aacpsy_mips.h |  2 ++
 libavcodec/mips/aacsbr_mips.c |  4 
 libavcodec/mips/aacsbr_mips.h |  2 ++
 libavcodec/mips/ac3dsp_mips.c |  6 +-
 libavcodec/mips/acelp_filters_mips.c  |  4 
 libavcodec/mips/acelp_vectors_mips.c  |  4 
 libavcodec/mips/amrwbdec_mips.c   |  2 ++
 libavcodec/mips/amrwbdec_mips.h   |  2 ++
 libavcodec/mips/celp_filters_mips.c   |  4 
 libavcodec/mips/celp_math_mips.c  |  4 
 libavcodec/mips/compute_antialias_float.h |  2 ++
 libavcodec/mips/fft_mips.c|  4 
 libavcodec/mips/iirfilter_mips.c  |  4 
 libavcodec/mips/lsp_mips.h|  2 ++
 libavcodec/mips/mpegaudiodsp_mips_fixed.c | 10 ++
 libavcodec/mips/mpegaudiodsp_mips_float.c | 10 ++
 libavcodec/mips/sbrdsp_mips.c |  4 
 libavutil/mips/float_dsp_mips.c   |  4 
 21 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
index 04b3dca..3ebd776 100644
--- a/libavcodec/mips/aaccoder_mips.c
+++ b/libavcodec/mips/aaccoder_mips.c
@@ -66,6 +66,7 @@
 #include "libavcodec/aacenc_utils.h"
 
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 typedef struct BandCodingPath {
 int prev_idx;
 float cost;
@@ -2474,10 +2475,12 @@ static void search_for_ms_mips(AACEncContext *s, 
ChannelElement *cpe)
 
 #include "libavcodec/aaccoder_trellis.h"
 
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
 void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 AACCoefficientsEncoder *e = c->coder;
 int option = c->options.coder;
 
@@ -2491,5 +2494,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_MIPSFPU
 e->search_for_ms= search_for_ms_mips;
 #endif /* HAVE_MIPSFPU */
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index 054a9fb..0c2b243 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -61,6 +61,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
 {
@@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 #define VMUL4 VMUL4_mips
 #define VMUL2S VMUL2S_mips
 #define VMUL4S VMUL4S_mips
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
 
 #endif /* AVCODEC_MIPS_AACDEC_FLOAT_H */
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 695f9ef..83fdc2f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
out[2][38][64],
 }
 
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
 {
 int i;
@@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float 
(*r)[2],
 : "memory"
 );
 }
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 
@@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
 s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
 s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 s->add_squares= ps_add_squares_mips;
 s->mul_pair_single= ps_mul_pair_single_mips;
 s->decorrelate= ps_decorrelate_mips;
 s->stereo_interpolate[0]  = ps_stereo_interpolate_mips;
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacpsy_mips.h b/libavcodec/mips/aacpsy_mips.h
index 42ff442..a1fe5cc 100644
--- a/libavcodec/mips/aacpsy_mips.h

[FFmpeg-devel] [PATCH v5 4/4] mips: display a warning message when using an unknown CPU

2016-01-06 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v4 -> v5:
 - Nothing.

Changes v3 -> v4:
 - Use a more accurate warning message.

Changes v2 -> v3:
 - This patch has been added for v3.

Changes v1 -> v2:
 - This patch didn't exist at that point.

 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index b6ca84d..9e1e615 100755
--- a/configure
+++ b/configure
@@ -4241,6 +4241,8 @@ elif enabled mips; then
 # the unwanted features.
 ;;
 *)
+# Unknown CPU. Disable everything.
+echo "Warning: unknown CPU. Disabling all MIPS optimizations."
 disable mipsfpu
 disable mips32r2
 disable mips32r6
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5 1/4] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2016-01-06 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v4 -> v5:
 - Check for msa.h and disable msa if not found.

Changes v3 -> v4:
 - Nothing.

Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Add a block of code for mipsdspr2 which was previously placed in the
   first patch of this series causing a syntax error in the configure
   script.
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 configure | 85 +--
 1 file changed, 67 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 6710f85..1cfa31e 100755
--- a/configure
+++ b/configure
@@ -5042,27 +5042,76 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
-add_cflags "-mips64r2"
-add_asflags "-mips64r2"
-elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled 
loongson3; then
-add_cflags "-mips64"
-add_asflags "-mips64"
-elif enabled mipsdsp || enabled mipsdspr2; then
-add_cflags "-mips32r2 -mfp32"
-add_asflags "-mips32r2 -mfp32"
+if enabled mips64; then
+if enabled mips64r6; then
+check_cflags "-mips64r6" &&
+check_ldflags "-mips64r6" &&
+add_asflags "-mips64r6" &&
+check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"'
+elif enabled mips64r2; then
+check_cflags "-mips64r2" &&
+check_ldflags "-mips64r2" &&
+add_asflags "-mips64r2" &&
+check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
+else
+check_cflags "-mips64" &&
+check_ldflags "-mips64" &&
+add_asflags "-mips64" &&
+check_inline_asm mips64r1 '"daddi $0, $0, 0"'
+fi
+else
+if enabled mips32r6; then
+check_cflags "-mips32r6" &&
+check_ldflags "-mips32r6" &&
+add_asflags "-mips32r6" &&
+check_inline_asm mips32r6 '"aui $0, $0, 0"'
+elif enabled mips32r2; then
+check_cflags "-mips32r2" &&
+check_ldflags "-mips32r2" &&
+add_asflags "-mips32r2" &&
+check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
+else
+check_cflags "-mips32" &&
+check_ldflags "-mips32" &&
+add_asflags "-mips32" &&
+check_inline_asm mips32r1 '"addi $0, $0, 0"'
+fi
+fi
+
+# MIPS FPU
+if enabled mipsfpu; then
+add_cflags "-mhard-float" &&
+add_asflags "-mhard-float" &&
+check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
 fi
 
-enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
-enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
- check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
-enabled mipsfpu   && add_cflags "-mhard-float" && add_asflags 
"-mhard-float" &&
- check_inline_asm mipsfpu   '"madd.d $f0, $f2, $f4, $f6"'
-enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
- check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
+# MSA and DSP support require ISA revision level 2 or greater
+if enabled mips32r2 || enabled mips64r2 || enabled mips32r6 || enabled 
mips64r6; then
+# MSA must be used with -mfp64 and -mhard-float
+if enabled mipsfpu; then
+if enabled msa; then
+check_cflags "-mfp64 -mmsa" &&
+check_ldflags "-mfp64 -mmsa" &&
+add_asflags "-mfp64 -mmsa" &&
+check_inline_asm msa '"addvi.b $w0, $w1, 1"' &&
+check_header msa.h ||
+disable msa
+fi
+else
+disable msa
+fi
 
-enabled msa && add_asflags "-mmsa"
+if enabled mipsdsp; then
+check_cflags "-mdsp" &&
+add_asflags "-mdsp" &&
+check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
+fi
+if enabled mipsdspr2; then
+check_cflags "-mdspr2" &&
+add_asflags "-mdspr2" &&
+check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
+fi
+fi
 
 elif enabled parisc; then
 
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5 2/4] mips: do not disable any feature for generic cores

2016-01-06 Thread Vicente Olivert Riera
We don't know which features are available when the user selects a
generic core, so don't disable anything by default and let the user
decide.

Signed-off-by: Vicente Olivert Riera 
---
Changes v4 -> v5:
 - Nothing.

Changes v3 -> v4:
 - Minor change in the commit log: remove "let's".

Changes v2 -> v3:
 - Change the logic of this patch. Instead of removing the generic core,
   do not disable any feature and add a warning message to state that.
   The patch subject has also changed accordingly.

Changes v1 -> v2:
 - Nothing.

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 1cfa31e..b6ca84d 100755
--- a/configure
+++ b/configure
@@ -4237,8 +4237,8 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips64r6
-disable msa
+# We do not disable anything. Is up to the user to disable
+# the unwanted features.
 ;;
 *)
 disable mipsfpu
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4 11/14] mips: do not disable any feature for generic cores

2016-01-06 Thread Vicente Olivert Riera

Dear Andreas Cadhalpun and Michael Niedermayer,

On 30/12/15 21:02, Andreas Cadhalpun wrote:

On 30.12.2015 20:35, Michael Niedermayer wrote:

On Fri, Dec 04, 2015 at 03:48:27PM +, Vicente Olivert Riera wrote:

We don't know which features are available when the user selects a
generic core, so don't disable anything by default and let the user
decide.

Signed-off-by: Vicente Olivert Riera 
---
Changes v3 -> v4:
  - Minor change in the commit log: remove "let's".

Changes v2 -> v3:
  - Change the logic of this patch. Instead of removing the generic core,
do not disable any feature and add a warning message to state that.
The patch subject has also changed accordingly.

Changes v1 -> v2:
  - Nothing.


  configure | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8bd47b9..2ee10db 100755
--- a/configure
+++ b/configure
@@ -4159,8 +4159,8 @@ elif enabled mips; then
  esac
  ;;
  generic)
-disable mips64r6
-disable msa
+# We do not disable anything. Is up to the user to disable
+# the unwanted features.


i just noticed now but this breaks build


That explains, why it got disabled here.


make distclean ; ./configure --cross-prefix=/usr/mips-linux-gnu/bin/ --cc='ccache 
mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux --enable-cross-compile && 
make -j12

CC  libavcodec/mips/blockdsp_msa.o
In file included from ffmpeg/libavcodec/mips/blockdsp_msa.c:21:
ffmpeg/libavutil/mips/generic_macros_msa.h:25:17: warning: msa.h: No such file 
or directory


This looks like configure should check for msa.h and disable msa
if that header is not found.


yes, and it's better to reorder the remaining patches and apply the one 
who improves the detection of the ISAs, FPU and ASEs (DSP, MSA) first. I 
will re-send that 4-patch series.


Regards,

Vincent.


Best regards,
Andreas


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v4 14/14] mips: display a warning message when using an unknown CPU

2015-12-04 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v3 -> v4:
 - Use a more accurate warning message.

Changes v2 -> v3:
 - This patch has been added for v3.

Changes v1 -> v2:
 - This patch didn't exist at that point.

 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 7d06494..ebef6b0 100755
--- a/configure
+++ b/configure
@@ -4163,6 +4163,8 @@ elif enabled mips; then
 # the unwanted features.
 ;;
 *)
+# Unknown CPU. Disable everything.
+echo "Warning: unknown CPU. Disabling all MIPS optimizations."
 disable mipsfpu
 disable mips32r2
 disable mips32r6
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v4 11/14] mips: do not disable any feature for generic cores

2015-12-04 Thread Vicente Olivert Riera
We don't know which features are available when the user selects a
generic core, so don't disable anything by default and let the user
decide.

Signed-off-by: Vicente Olivert Riera 
---
Changes v3 -> v4:
 - Minor change in the commit log: remove "let's".

Changes v2 -> v3:
 - Change the logic of this patch. Instead of removing the generic core,
   do not disable any feature and add a warning message to state that.
   The patch subject has also changed accordingly.

Changes v1 -> v2:
 - Nothing.


 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8bd47b9..2ee10db 100755
--- a/configure
+++ b/configure
@@ -4159,8 +4159,8 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips64r6
-disable msa
+# We do not disable anything. Is up to the user to disable
+# the unwanted features.
 ;;
 *)
 disable mipsfpu
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 14/14] mips: display a warning message when using an unknown CPU

2015-12-04 Thread Vicente Olivert Riera
Hello Andreas,

On 04/12/15 14:32, Andreas Cadhalpun wrote:
> On 03.12.2015 14:22, Vicente Olivert Riera wrote:
>> Signed-off-by: Vicente Olivert Riera 
>> ---
>> Changes v2 -> v3:
>>  - This patch has been added for v3.
>>
>> Changes v1 -> v2:
>>  - This patch didn't exist at that point.
>>
>>  configure | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/configure b/configure
>> index 7d06494..62a5452 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4163,6 +4163,8 @@ elif enabled mips; then
>>  # the unwanted features.
>>  ;;
>>  *)
>> +# Unknown CPU. Disable everything.
>> +echo "Warning: unknown CPU. All features disabled by default."
> 
> This sounds strange. I'd rather say:
> 'Warning: unknown CPU. Disabling all mips optimizations.'
> 
> Otherwise looks good.

is the first time I contribute to ffmpeg. Does that issue needs a
re-spin of the 13 patch series, or is it something that the maintainer
can do for me when applying the patch? Same question for your review in
the 11th patch about the "let's".

Regards,

Vincent.

> Best regards,
> Andreas
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 01/14] mips: rename mipsdspr1 to mipsdsp

2015-12-04 Thread Vicente Olivert Riera
On 04/12/15 01:36, Michael Niedermayer wrote:
> On Thu, Dec 03, 2015 at 01:22:16PM +0000, Vicente Olivert Riera wrote:
>> Signed-off-by: Vicente Olivert Riera 
>> ---
>> Changes v2 -> v3:
>>  - Document it in the Changelog
>>
>> Changes v1 -> v2:
>>  - Remove a block of code for mipsdspr2 which wasn't intended to be in
>>this patch and it was causing a syntax error in the configure script.
>>Highlighted by Michael Niedermayer:
>>https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html
>>
>>  Changelog |  1 +
>>  Makefile  |  2 +-
>>  arch.mak  |  2 +-
>>  configure | 28 ++--
>>  libavcodec/aacenc.c   |  2 +-
>>  libavcodec/mips/Makefile  |  4 ++--
>>  libavcodec/mips/ac3dsp_mips.c |  4 ++--
>>  libavcodec/mips/mpegaudiodsp_mips_fixed.c |  2 +-
>>  libavcodec/mpegaudiodec_template.c|  4 ++--
>>  libavcodec/mpegaudiodsp.c |  2 +-
>>  libavcodec/mpegaudiodsp.h |  2 +-
>>  11 files changed, 27 insertions(+), 26 deletions(-)
> 
> patch applied
> 
> thanks

Thank you Michael,

is there anything else that has to be done in order to get the rest of
the series applied?

Regards,

Vincent.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 11/14] mips: do not disable any feature for generic cores

2015-12-03 Thread Vicente Olivert Riera
Hello all,

On 03/12/15 13:22, Vicente Olivert Riera wrote:
> We don't know which features are available when the user selects a
> generic core, so let's don't disable anything by default and let the
> user decide.
> 
> Signed-off-by: Vicente Olivert Riera 
> ---
> Changes v2 -> v3:
>  - Change the logic of this patch. Instead of removing the generic core,
>do not disable any feature ** and add a warning message to state that. **

I shouldn't have written that in the "Changes". There is no warning
message. I was thinking in another patch. Ignore that sentence.

Regards,

Vincent.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 13/14] mips: add support for R6

2015-12-03 Thread Vicente Olivert Riera
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 libavcodec/mips/aaccoder_mips.c   |  4 
 libavcodec/mips/aacdec_mips.h |  2 ++
 libavcodec/mips/aacpsdsp_mips.c   |  4 
 libavcodec/mips/aacpsy_mips.h |  2 ++
 libavcodec/mips/aacsbr_mips.c |  4 
 libavcodec/mips/aacsbr_mips.h |  2 ++
 libavcodec/mips/ac3dsp_mips.c |  6 +-
 libavcodec/mips/acelp_filters_mips.c  |  4 
 libavcodec/mips/acelp_vectors_mips.c  |  4 
 libavcodec/mips/amrwbdec_mips.c   |  2 ++
 libavcodec/mips/amrwbdec_mips.h   |  2 ++
 libavcodec/mips/celp_filters_mips.c   |  4 
 libavcodec/mips/celp_math_mips.c  |  4 
 libavcodec/mips/compute_antialias_float.h |  2 ++
 libavcodec/mips/fft_mips.c|  4 
 libavcodec/mips/iirfilter_mips.c  |  4 
 libavcodec/mips/lsp_mips.h|  2 ++
 libavcodec/mips/mpegaudiodsp_mips_fixed.c | 10 ++
 libavcodec/mips/mpegaudiodsp_mips_float.c | 10 ++
 libavcodec/mips/sbrdsp_mips.c |  4 
 libavutil/mips/float_dsp_mips.c   |  4 
 21 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
index 04b3dca..3ebd776 100644
--- a/libavcodec/mips/aaccoder_mips.c
+++ b/libavcodec/mips/aaccoder_mips.c
@@ -66,6 +66,7 @@
 #include "libavcodec/aacenc_utils.h"
 
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 typedef struct BandCodingPath {
 int prev_idx;
 float cost;
@@ -2474,10 +2475,12 @@ static void search_for_ms_mips(AACEncContext *s, 
ChannelElement *cpe)
 
 #include "libavcodec/aaccoder_trellis.h"
 
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
 void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 AACCoefficientsEncoder *e = c->coder;
 int option = c->options.coder;
 
@@ -2491,5 +2494,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_MIPSFPU
 e->search_for_ms= search_for_ms_mips;
 #endif /* HAVE_MIPSFPU */
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index 054a9fb..0c2b243 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -61,6 +61,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
 {
@@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 #define VMUL4 VMUL4_mips
 #define VMUL2S VMUL2S_mips
 #define VMUL4S VMUL4S_mips
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
 
 #endif /* AVCODEC_MIPS_AACDEC_FLOAT_H */
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 695f9ef..83fdc2f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
out[2][38][64],
 }
 
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
 {
 int i;
@@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float 
(*r)[2],
 : "memory"
 );
 }
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 
@@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
 s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
 s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 s->add_squares= ps_add_squares_mips;
 s->mul_pair_single= ps_mul_pair_single_mips;
 s->decorrelate= ps_decorrelate_mips;
 s->stereo_interpolate[0]  = ps_stereo_interpolate_mips;
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacpsy_mips.h b/libavcodec/mips/aacpsy_mips.h
index 42ff442..a1fe5cc 100644
--- a/libavcodec/mips/aacpsy_mips.h
+++ b/libavcodec/mips/aacpsy_mips.h
@@ -59,6 +59,7 @@
 #inclu

[FFmpeg-devel] [PATCH v3 11/14] mips: do not disable any feature for generic cores

2015-12-03 Thread Vicente Olivert Riera
We don't know which features are available when the user selects a
generic core, so let's don't disable anything by default and let the
user decide.

Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Change the logic of this patch. Instead of removing the generic core,
   do not disable any feature and add a warning message to state that.
   The patch subject has also changed accordingly.

Changes v1 -> v2:
 - Nothing.

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8bd47b9..2ee10db 100755
--- a/configure
+++ b/configure
@@ -4159,8 +4159,8 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips64r6
-disable msa
+# We do not disable anything. Is up to the user to disable
+# the unwanted features.
 ;;
 *)
 disable mipsfpu
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 14/14] mips: display a warning message when using an unknown CPU

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - This patch has been added for v3.

Changes v1 -> v2:
 - This patch didn't exist at that point.

 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 7d06494..62a5452 100755
--- a/configure
+++ b/configure
@@ -4163,6 +4163,8 @@ elif enabled mips; then
 # the unwanted features.
 ;;
 *)
+# Unknown CPU. Disable everything.
+echo "Warning: unknown CPU. All features disabled by default."
 disable mipsfpu
 disable mips32r2
 disable mips32r6
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 12/14] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Add a block of code for mipsdspr2 which was previously placed in the
   first patch of this series causing a syntax error in the configure
   script.
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 configure | 83 +--
 1 file changed, 65 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 2ee10db..7d06494 100755
--- a/configure
+++ b/configure
@@ -4964,27 +4964,74 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
-add_cflags "-mips64r2"
-add_asflags "-mips64r2"
-elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled 
loongson3; then
-add_cflags "-mips64"
-add_asflags "-mips64"
-elif enabled mipsdsp || enabled mipsdspr2; then
-add_cflags "-mips32r2 -mfp32"
-add_asflags "-mips32r2 -mfp32"
+if enabled mips64; then
+if enabled mips64r6; then
+check_cflags "-mips64r6" &&
+check_ldflags "-mips64r6" &&
+add_asflags "-mips64r6" &&
+check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"'
+elif enabled mips64r2; then
+check_cflags "-mips64r2" &&
+check_ldflags "-mips64r2" &&
+add_asflags "-mips64r2" &&
+check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
+else
+check_cflags "-mips64" &&
+check_ldflags "-mips64" &&
+add_asflags "-mips64" &&
+check_inline_asm mips64r1 '"daddi $0, $0, 0"'
+fi
+else
+if enabled mips32r6; then
+check_cflags "-mips32r6" &&
+check_ldflags "-mips32r6" &&
+add_asflags "-mips32r6" &&
+check_inline_asm mips32r6 '"aui $0, $0, 0"'
+elif enabled mips32r2; then
+check_cflags "-mips32r2" &&
+check_ldflags "-mips32r2" &&
+add_asflags "-mips32r2" &&
+check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
+else
+check_cflags "-mips32" &&
+check_ldflags "-mips32" &&
+add_asflags "-mips32" &&
+check_inline_asm mips32r1 '"addi $0, $0, 0"'
+fi
+fi
+
+# MIPS FPU
+if enabled mipsfpu; then
+add_cflags "-mhard-float" &&
+add_asflags "-mhard-float" &&
+check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
 fi
 
-enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
-enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
- check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
-enabled mipsfpu   && add_cflags "-mhard-float" && add_asflags 
"-mhard-float" &&
- check_inline_asm mipsfpu   '"madd.d $f0, $f2, $f4, $f6"'
-enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
- check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
+# MSA and DSP support require ISA revision level 2 or greater
+if enabled mips32r2 || enabled mips64r2 || enabled mips32r6 || enabled 
mips64r6; then
+# MSA must be used with -mfp64 and -mhard-float
+if enabled mipsfpu; then
+if enabled msa; then
+check_cflags "-mfp64 -mmsa" &&
+check_ldflags "-mfp64 -mmsa" &&
+add_asflags "-mfp64 -mmsa" &&
+check_inline_asm msa '"addvi.b $w0, $w1, 1"'
+fi
+else
+disable msa
+fi
 
-enabled msa && add_asflags "-mmsa"
+if enabled mipsdsp; then
+check_cflags "-mdsp" &&
+add_asflags "-mdsp" &&
+check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
+fi
+if enabled mipsdspr2; then
+check_cflags "-mdspr2" &&
+add_asflags "-mdspr2" &&
+check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
+fi
+fi
 
 elif enabled parisc; then
 
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 10/14] mips: put "disable mipsfpu" in a better place for loongson

2015-12-03 Thread Vicente Olivert Riera
Let's disable the ISAs first, and then the core capabilities, as we do
for the rest of the cores. This way the code is better organized.

Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 5cf487a..8bd47b9 100755
--- a/configure
+++ b/configure
@@ -4131,11 +4131,11 @@ elif enabled mips; then
 add_asflags "-mfp64"
 ;;
 loongson*)
-disable mipsfpu
 disable mips32r2
 disable mips32r6
 disable mips64r2
 disable mips64r6
+disable mipsfpu
 disable mipsdsp
 disable mipsdspr2
 disable msa
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 09/14] mips: add mips32r6 architecture variant

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 configure | 12 
 1 file changed, 12 insertions(+)

diff --git a/configure b/configure
index 0254e9a..5cf487a 100755
--- a/configure
+++ b/configure
@@ -1630,6 +1630,7 @@ ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
 mips64r2
+mips32r6
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2107,6 +2108,7 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
+mips32r6_deps="mips"
 mips64r2_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
@@ -4063,6 +4065,7 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
@@ -4071,6 +4074,7 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4078,6 +4082,7 @@ elif enabled mips; then
 disable msa
 ;;
 24kec|34kc|1004kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
@@ -4085,23 +4090,27 @@ elif enabled mips; then
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable msa
 ;;
 p5600)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4112,6 +4121,7 @@ elif enabled mips; then
 ;;
 i6400)
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mipsdsp
 disable mipsdspr2
@@ -4123,6 +4133,7 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4154,6 +4165,7 @@ elif enabled mips; then
 *)
 disable mipsfpu
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 07/14] mips: i6400 core is not mips32r2, so disable mips32r2

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 045f5bf..ca6e0a0 100755
--- a/configure
+++ b/configure
@@ -4102,6 +4102,7 @@ elif enabled mips; then
 add_asflags "-mfp64"
 ;;
 i6400)
+disable mips32r2
 disable mipsdsp
 disable mipsdspr2
 check_cflags "-mtune=i6400 -mabi=64" &&
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 08/14] mips: add mips64r2 architecture variant

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 configure | 12 
 1 file changed, 12 insertions(+)

diff --git a/configure b/configure
index ca6e0a0..0254e9a 100755
--- a/configure
+++ b/configure
@@ -1629,6 +1629,7 @@ ARCH_EXT_LIST_ARM="
 ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
+mips64r2
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2106,6 +2107,7 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
+mips64r2_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
 mmi_deps="mips"
@@ -4061,6 +4063,7 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable mipsdsp
@@ -4068,32 +4071,38 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kec|34kc|1004kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable mipsdspr2
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
+disable mips64r2
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
+disable mips64r2
 disable mips64r6
 disable msa
 ;;
 p5600)
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4103,6 +4112,7 @@ elif enabled mips; then
 ;;
 i6400)
 disable mips32r2
+disable mips64r2
 disable mipsdsp
 disable mipsdspr2
 check_cflags "-mtune=i6400 -mabi=64" &&
@@ -4113,6 +4123,7 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4143,6 +4154,7 @@ elif enabled mips; then
 *)
 disable mipsfpu
 disable mips32r2
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 06/14] mips: i6400 core does have an FPU, so not disable it

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Fix a grammar mistake in the commit log. Change "do has" by "does
   have". Thanks to Moritz Barsnick:
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183437.html

configure | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configure b/configure
index 62dd3a4..045f5bf 100755
--- a/configure
+++ b/configure
@@ -4104,7 +4104,6 @@ elif enabled mips; then
 i6400)
 disable mipsdsp
 disable mipsdspr2
-disable mipsfpu
 check_cflags "-mtune=i6400 -mabi=64" &&
 check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
 check_ldflags "-mabi=64" &&
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 05/14] mips: add i6400 core optimizations

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 configure | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 24ea270..62dd3a4 100755
--- a/configure
+++ b/configure
@@ -4105,9 +4105,10 @@ elif enabled mips; then
 disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
-
-check_cflags "-mtune=i6400 -mabi=64"
-check_ldflags "-mabi=64"
+check_cflags "-mtune=i6400 -mabi=64" &&
+check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
+check_ldflags "-mabi=64" &&
+add_asflags "-mfp64"
 ;;
 loongson*)
 disable mipsfpu
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 04/14] mips: remove --mips64r6 configure option

2015-12-03 Thread Vicente Olivert Riera
Having a configure option with the same name as a MIPS ISA is confusing,
so better to remove it. This option was being used to add some
optimizations to a specific core (i6400). We will add the optimizations
just when the i6400 core has been detected, in a later patch.

Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Document it in the Changelog.

Changes v1 -> v2:
 - Nothing.

 Changelog | 1 +
 configure | 9 -
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/Changelog b/Changelog
index c28d854..705742f 100644
--- a/Changelog
+++ b/Changelog
@@ -41,6 +41,7 @@ version :
 - sidechaingate audio filter
 - mipsdspr1 option has been renamed to mipsdsp
 - mips32r5 option has been removed
+- mips64r6 option has been removed
 
 version 2.8:
 - colorkey video filter
diff --git a/configure b/configure
index 0397ea1..24ea270 100755
--- a/configure
+++ b/configure
@@ -382,7 +382,6 @@ Optimization options (experts only):
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
   --disable-yasm   disable use of nasm/yasm assembly
-  --disable-mips64r6   disable MIPS64R6 optimizations
   --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-msadisable MSA optimizations
@@ -4949,14 +4948,8 @@ elif enabled mips; then
 elif enabled mipsdsp || enabled mipsdspr2; then
 add_cflags "-mips32r2 -mfp32"
 add_asflags "-mips32r2 -mfp32"
-elif enabled mips64r6; then
-check_cflags "-mfp64"
-check_ldflags "-mfp64"
 fi
 
-enabled mips64r6  && check_cflags "-mips64r6 -msched-weight 
-mload-store-pairs -funroll-loops" &&
- check_ldflags "-mips64r6" &&
- check_inline_asm mips64r6  '"aui $t0, $t1, 1"'
 enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
 enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
@@ -4966,7 +4959,6 @@ elif enabled mips; then
 enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
 
-enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
 enabled msa && add_asflags "-mmsa"
 
 elif enabled parisc; then
@@ -6033,7 +6025,6 @@ if enabled arm; then
 fi
 if enabled mips; then
 echo "MIPS FPU enabled  ${mipsfpu-no}"
-echo "MIPS64R6 enabled  ${mips64r6-no}"
 echo "MIPS DSP R1 enabled   ${mipsdsp-no}"
 echo "MIPS DSP R2 enabled   ${mipsdspr2-no}"
 echo "MIPS MSA enabled  ${msa-no}"
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 03/14] mips: add p5600 core optimizations

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Nothing.

Changes v1 -> v2:
 - Nothing.

 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index d0631a0..0397ea1 100755
--- a/configure
+++ b/configure
@@ -4098,8 +4098,9 @@ elif enabled mips; then
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
-
-check_cflags "-mtune=p5600"
+check_cflags "-mtune=p5600" &&
+check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
+add_asflags "-mfp64"
 ;;
 i6400)
 disable mipsdsp
-- 
2.4.10

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 02/14] mips: remove --mips32r5 configure option

2015-12-03 Thread Vicente Olivert Riera
Having a configure option with the same name as a MIPS ISA is confusing,
so better to remove it. This option was being used to add some
optimizations to a specific core (p5600). We will add the optimizations
just when the p5600 core has been detected, in a later patch.

Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Document it in the Changelog.

Changes v1 -> v2:
 - Nothing.

 Changelog |  2 +-
 configure | 20 +---
 2 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/Changelog b/Changelog
index 600ffea..c28d854 100644
--- a/Changelog
+++ b/Changelog
@@ -40,7 +40,7 @@ version :
 - apulsator filter
 - sidechaingate audio filter
 - mipsdspr1 option has been renamed to mipsdsp
-
+- mips32r5 option has been removed
 
 version 2.8:
 - colorkey video filter
diff --git a/configure b/configure
index ea2a746..d0631a0 100755
--- a/configure
+++ b/configure
@@ -382,7 +382,6 @@ Optimization options (experts only):
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
   --disable-yasm   disable use of nasm/yasm assembly
-  --disable-mips32r5   disable MIPS32R5 optimizations
   --disable-mips64r6   disable MIPS64R6 optimizations
   --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
@@ -1631,7 +1630,6 @@ ARCH_EXT_LIST_ARM="
 ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
-mips32r5
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2109,7 +2107,6 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
-mips32r5_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
 mmi_deps="mips"
@@ -4065,7 +4062,6 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable mipsdsp
@@ -4073,33 +4069,28 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kec|34kc|1004kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable mipsdspr2
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
-disable mips32r5
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
-disable mips32r5
 disable mips64r6
 disable msa
 ;;
@@ -4111,7 +4102,6 @@ elif enabled mips; then
 check_cflags "-mtune=p5600"
 ;;
 i6400)
-disable mips32r5
 disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
@@ -4122,7 +4112,6 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4147,14 +4136,12 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips32r5
 disable mips64r6
 disable msa
 ;;
 *)
 disable mipsfpu
 disable mips32r2
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4961,14 +4948,11 @@ elif enabled mips; then
 elif enabled mipsdsp || enabled mipsdspr2; then
 add_cflags "-mips32r2 -mfp32"
 add_asflags "-mips32r2 -mfp32"
-elif enabled mips32r5 || enabled mips64r6; then
+elif enabled mips64r6; then
 check_cflags "-mfp64"
 check_ldflags "-mfp64"
 fi
 
-enabled mips32r5  && check_cflags "-mips32r5 -msched-weight 
-mload-store-pairs -funroll-loops" &&
- check_ldflags "-mips32r5" &&
- check_inline_asm mips32r5  '"ulw $t0, ($t1)"'
 enabled mips64r6  && check_cflags "-mips64r6 -msched-weight 
-mload-store-pairs -funroll-loops" &&
  check_ldflags "-mips64r6" &&
  check_inline_asm mips64r6  '"aui $t0, $t1, 1"'
@@ -4981,7 +4965,6 @@ elif enabled mips; then
 enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
 
-enabled mips32r5 && add_asflags "-mips32r5 -mfp64"
 enabled mips64r6 && add_asflags

[FFmpeg-devel] [PATCH v3 01/14] mips: rename mipsdspr1 to mipsdsp

2015-12-03 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v2 -> v3:
 - Document it in the Changelog

Changes v1 -> v2:
 - Remove a block of code for mipsdspr2 which wasn't intended to be in
   this patch and it was causing a syntax error in the configure script.
   Highlighted by Michael Niedermayer:
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 Changelog |  1 +
 Makefile  |  2 +-
 arch.mak  |  2 +-
 configure | 28 ++--
 libavcodec/aacenc.c   |  2 +-
 libavcodec/mips/Makefile  |  4 ++--
 libavcodec/mips/ac3dsp_mips.c |  4 ++--
 libavcodec/mips/mpegaudiodsp_mips_fixed.c |  2 +-
 libavcodec/mpegaudiodec_template.c|  4 ++--
 libavcodec/mpegaudiodsp.c |  2 +-
 libavcodec/mpegaudiodsp.h |  2 +-
 11 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/Changelog b/Changelog
index 2d2a92b..600ffea 100644
--- a/Changelog
+++ b/Changelog
@@ -39,6 +39,7 @@ version :
 - support encoding 16-bit RLE SGI images
 - apulsator filter
 - sidechaingate audio filter
+- mipsdspr1 option has been renamed to mipsdsp
 
 
 version 2.8:
diff --git a/Makefile b/Makefile
index 58f1a3a..7836a20 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS 
TOOLS  \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS\
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS MMX-OBJS YASM-OBJS   \
-   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MSA-OBJS   \
+   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
 
 define RESET
diff --git a/arch.mak b/arch.mak
index 98fde4a..08f78b4 100644
--- a/arch.mak
+++ b/arch.mak
@@ -5,7 +5,7 @@ OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
 OBJS-$(HAVE_NEON)+= $(NEON-OBJS)$(NEON-OBJS-yes)
 
 OBJS-$(HAVE_MIPSFPU)   += $(MIPSFPU-OBJS)$(MIPSFPU-OBJS-yes)
-OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS)  $(MIPSDSPR1-OBJS-yes)
+OBJS-$(HAVE_MIPSDSP)   += $(MIPSDSP-OBJS)$(MIPSDSP-OBJS-yes)
 OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS)  $(MIPSDSPR2-OBJS-yes)
 OBJS-$(HAVE_MSA)   += $(MSA-OBJS)$(MSA-OBJS-yes)
 OBJS-$(HAVE_MMI)   += $(MMI-OBJS)   $(MMI-OBJS-yes)
diff --git a/configure b/configure
index a30d831..ea2a746 100755
--- a/configure
+++ b/configure
@@ -384,7 +384,7 @@ Optimization options (experts only):
   --disable-yasm   disable use of nasm/yasm assembly
   --disable-mips32r5   disable MIPS32R5 optimizations
   --disable-mips64r6   disable MIPS64R6 optimizations
-  --disable-mipsdspr1  disable MIPS DSP ASE R1 optimizations
+  --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-msadisable MSA optimizations
   --disable-mipsfpudisable floating point MIPS optimizations
@@ -1633,7 +1633,7 @@ ARCH_EXT_LIST_MIPS="
 mips32r2
 mips32r5
 mips64r6
-mipsdspr1
+mipsdsp
 mipsdspr2
 msa
 "
@@ -2106,7 +2106,7 @@ setend_deps="arm"
 map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
 
 mipsfpu_deps="mips"
-mipsdspr1_deps="mips"
+mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
 mips32r5_deps="mips"
@@ -4068,14 +4068,14 @@ elif enabled mips; then
 disable mips32r5
 disable mips64r6
 disable mipsfpu
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kf*)
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
@@ -4105,14 +4105,14 @@ elif enabled mips; then
 ;;
 p5600)
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 
 check_cflags "-mtune=p5600"
 ;;
 i6400)
 disable mips32r5
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
 
@@ -4124,7 +4124,7 @@ elif enabled mips; then
 disable mips32r2
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 enable local_aligned_8 local_aligned_16 local_aligned_32
@@ -4156,7 +4156,7 @@ elif enabled mips; then
 disable mips32r2

Re: [FFmpeg-devel] [PATCH v2 11/13] Remove the MIPS "generic" core in favor of "*"

2015-12-02 Thread Vicente Olivert Riera
Dear Andreas Cadhalpun,

On 20/11/15 20:10, Andreas Cadhalpun wrote:
> On 18.11.2015 12:13, Vicente Olivert Riera wrote:
>> There is no point to have a "generic" core when we can catch all
>> unsupported cores with the "*" option, so remove it.
>>
>> Signed-off-by: Vicente Olivert Riera 
>> ---
>> Changes v1 -> v2:
>>  - Nothing.
>>
>>  configure |4 
>>  1 files changed, 0 insertions(+), 4 deletions(-)
>>
>> diff --git a/configure b/configure
>> index fc3d559..7d87e5c 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4154,10 +4154,6 @@ elif enabled mips; then
>>  ;;
>>  esac
>>  ;;
>> -generic)
>> -disable mips64r6
>> -disable msa
>> -;;
>>  *)
>>  disable mipsfpu
>>  disable mips32r2
>>
> 
> This is a bad idea.
> If the cpu is not explicitly set via configure options, it is set to generic.
> Removing this generic case here, will force-disable all mips optimizations,
> even if they were explicitly enabled with configure options.
> That would e.g. break how the Debian ffmpeg package is built for mips64el.

Aha, I see.

But I don't understand why msa is disabled for a generic cpu and not the
dsp or dspr2. Either we disable everything, or nothing. But just
disabling features randomly doesn't make any sense, at least for me.

What about this?

generic)
# We don't disable anything. Is up to the user to
# disable the unwanted features.
;;
*)
# Unknown CPU. Disable everything.
disable mipsfpu
disable mips32r2
...
;;

Regards,

Vincent.

> Best regards,
> Andreas
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 02/13] Remove --mips32r5 configure option

2015-11-18 Thread Vicente Olivert Riera
Dear Michael Niedermayer,

On 11/18/2015 04:59 PM, Michael Niedermayer wrote:
> On Wed, Nov 18, 2015 at 11:13:38AM +0000, Vicente Olivert Riera wrote:
>> Having a configure option with the same name as a MIPS ISA is confusing,
>> so better to remove it. This option was being used to add some
>> optimizations to a specific core (p5600). We will add the optimizations
>> just when the p5600 core has been detected, in a later patch.
>>
>> Signed-off-by: Vicente Olivert Riera 
>> ---
>> Changes v1 -> v2:
>>  - Nothing.
> 
> If a patch didnt change and was previously approved, please add a
> Reviewed-by: or Approved-by: or somethig equivalent to the commit
> message, so readers, developers and reveiwers know that it has already
> been reviewed

Nobody replied to my emails with a "Reviewed-by:" tag, that's why I
haven't added it in my v2.

Regards,

Vincent.

> 
> [...]
> 
> 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 12/13] Improve detection of MIPS ISAs, FPU and ASEs (DSP, MSA)

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Add a block of code for mipsdspr2 which was previously placed in the
   first patch of this series causing a syntax error in the configure
   script.
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 configure |   83 +++-
 1 files changed, 65 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 7d87e5c..be1ac99 100755
--- a/configure
+++ b/configure
@@ -4952,27 +4952,74 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
-add_cflags "-mips64r2"
-add_asflags "-mips64r2"
-elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled 
loongson3; then
-add_cflags "-mips64"
-add_asflags "-mips64"
-elif enabled mipsdsp || enabled mipsdspr2; then
-add_cflags "-mips32r2 -mfp32"
-add_asflags "-mips32r2 -mfp32"
+if enabled mips64; then
+if enabled mips64r6; then
+check_cflags "-mips64r6" &&
+check_ldflags "-mips64r6" &&
+add_asflags "-mips64r6" &&
+check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"'
+elif enabled mips64r2; then
+check_cflags "-mips64r2" &&
+check_ldflags "-mips64r2" &&
+add_asflags "-mips64r2" &&
+check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
+else
+check_cflags "-mips64" &&
+check_ldflags "-mips64" &&
+add_asflags "-mips64" &&
+check_inline_asm mips64r1 '"daddi $0, $0, 0"'
+fi
+else
+if enabled mips32r6; then
+check_cflags "-mips32r6" &&
+check_ldflags "-mips32r6" &&
+add_asflags "-mips32r6" &&
+check_inline_asm mips32r6 '"aui $0, $0, 0"'
+elif enabled mips32r2; then
+check_cflags "-mips32r2" &&
+check_ldflags "-mips32r2" &&
+add_asflags "-mips32r2" &&
+check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
+else
+check_cflags "-mips32" &&
+check_ldflags "-mips32" &&
+add_asflags "-mips32" &&
+check_inline_asm mips32r1 '"addi $0, $0, 0"'
+fi
+fi
+
+# MIPS FPU
+if enabled mipsfpu; then
+add_cflags "-mhard-float" &&
+add_asflags "-mhard-float" &&
+check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
 fi
 
-enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
-enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
- check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
-enabled mipsfpu   && add_cflags "-mhard-float" && add_asflags 
"-mhard-float" &&
- check_inline_asm mipsfpu   '"madd.d $f0, $f2, $f4, $f6"'
-enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
- check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
+# MSA and DSP support require ISA revision level 2 or greater
+if enabled mips32r2 || enabled mips64r2 || enabled mips32r6 || enabled 
mips64r6; then
+# MSA must be used with -mfp64 and -mhard-float
+if enabled mipsfpu; then
+if enabled msa; then
+check_cflags "-mfp64 -mmsa" &&
+check_ldflags "-mfp64 -mmsa" &&
+add_asflags "-mfp64 -mmsa" &&
+check_inline_asm msa '"addvi.b $w0, $w1, 1"'
+fi
+else
+disable msa
+fi
 
-enabled msa && add_asflags "-mmsa"
+if enabled mipsdsp; then
+check_cflags "-mdsp" &&
+add_asflags "-mdsp" &&
+check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
+fi
+if enabled mipsdspr2; then
+check_cflags "-mdspr2" &&
+add_asflags "-mdspr2" &&
+check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
+fi
+fi
 
 elif enabled parisc; then
 
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 13/13] Add support for MIPS R6

2015-11-18 Thread Vicente Olivert Riera
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 libavcodec/mips/aaccoder_mips.c   |4 
 libavcodec/mips/aacdec_mips.h |2 ++
 libavcodec/mips/aacpsdsp_mips.c   |4 
 libavcodec/mips/aacpsy_mips.h |2 ++
 libavcodec/mips/aacsbr_mips.c |4 
 libavcodec/mips/aacsbr_mips.h |2 ++
 libavcodec/mips/ac3dsp_mips.c |6 +-
 libavcodec/mips/acelp_filters_mips.c  |4 
 libavcodec/mips/acelp_vectors_mips.c  |4 
 libavcodec/mips/amrwbdec_mips.c   |2 ++
 libavcodec/mips/amrwbdec_mips.h   |2 ++
 libavcodec/mips/celp_filters_mips.c   |4 
 libavcodec/mips/celp_math_mips.c  |4 
 libavcodec/mips/compute_antialias_float.h |2 ++
 libavcodec/mips/fft_mips.c|4 
 libavcodec/mips/iirfilter_mips.c  |4 
 libavcodec/mips/lsp_mips.h|2 ++
 libavcodec/mips/mpegaudiodsp_mips_fixed.c |   10 ++
 libavcodec/mips/mpegaudiodsp_mips_float.c |   10 ++
 libavcodec/mips/sbrdsp_mips.c |4 
 libavutil/mips/float_dsp_mips.c   |4 
 21 files changed, 83 insertions(+), 1 deletions(-)

diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
index e8e1e62..2385ed2 100644
--- a/libavcodec/mips/aaccoder_mips.c
+++ b/libavcodec/mips/aaccoder_mips.c
@@ -66,6 +66,7 @@
 #include "libavcodec/aacenc_utils.h"
 
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 typedef struct BandCodingPath {
 int prev_idx;
 float cost;
@@ -2412,10 +2413,12 @@ static void search_for_ms_mips(AACEncContext *s, 
ChannelElement *cpe)
 
 #include "libavcodec/aaccoder_trellis.h"
 
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
 void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 AACCoefficientsEncoder *e = c->coder;
 int option = c->options.coder;
 
@@ -2429,5 +2432,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_MIPSFPU
 e->search_for_ms= search_for_ms_mips;
 #endif /* HAVE_MIPSFPU */
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index 054a9fb..0c2b243 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -61,6 +61,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
 {
@@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 #define VMUL4 VMUL4_mips
 #define VMUL2S VMUL2S_mips
 #define VMUL4S VMUL4S_mips
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
 
 #endif /* AVCODEC_MIPS_AACDEC_FLOAT_H */
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 695f9ef..83fdc2f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
out[2][38][64],
 }
 
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
 {
 int i;
@@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float 
(*r)[2],
 : "memory"
 );
 }
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 
@@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
 s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
 s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 s->add_squares= ps_add_squares_mips;
 s->mul_pair_single= ps_mul_pair_single_mips;
 s->decorrelate= ps_decorrelate_mips;
 s->stereo_interpolate[0]  = ps_stereo_interpolate_mips;
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacpsy_mips.h b/libavcodec/mips/aacpsy_mips.h
index 596dcad..a216df6 100644
--- a/libavcodec/mips/aacpsy_mips.h
+++ b/libavcodec/mips/aacpsy_mips.h
@@ -59,6 +59,7 @@
 #in

[FFmpeg-devel] [PATCH v2 11/13] Remove the MIPS "generic" core in favor of "*"

2015-11-18 Thread Vicente Olivert Riera
There is no point to have a "generic" core when we can catch all
unsupported cores with the "*" option, so remove it.

Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index fc3d559..7d87e5c 100755
--- a/configure
+++ b/configure
@@ -4154,10 +4154,6 @@ elif enabled mips; then
 ;;
 esac
 ;;
-generic)
-disable mips64r6
-disable msa
-;;
 *)
 disable mipsfpu
 disable mips32r2
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 10/13] Put "disable mipsfpu" in a better place for loongson

2015-11-18 Thread Vicente Olivert Riera
Let's disable the ISAs first, and then the core capabilities, as we do
for the rest of the cores. This way the code is better organized.

Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index b31567e..fc3d559 100755
--- a/configure
+++ b/configure
@@ -4127,11 +4127,11 @@ elif enabled mips; then
 add_asflags "-mfp64"
 ;;
 loongson*)
-disable mipsfpu
 disable mips32r2
 disable mips32r6
 disable mips64r2
 disable mips64r6
+disable mipsfpu
 disable mipsdsp
 disable mipsdspr2
 disable msa
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 09/13] Add mips32r6 architecture variant

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 761c4cb..b31567e 100755
--- a/configure
+++ b/configure
@@ -1624,6 +1624,7 @@ ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
 mips64r2
+mips32r6
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2103,6 +2104,7 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
+mips32r6_deps="mips"
 mips64r2_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
@@ -4059,6 +4061,7 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
@@ -4067,6 +4070,7 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4074,6 +4078,7 @@ elif enabled mips; then
 disable msa
 ;;
 24kec|34kc|1004kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
@@ -4081,23 +4086,27 @@ elif enabled mips; then
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable msa
 ;;
 p5600)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4108,6 +4117,7 @@ elif enabled mips; then
 ;;
 i6400)
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mipsdsp
 disable mipsdspr2
@@ -4119,6 +4129,7 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4150,6 +4161,7 @@ elif enabled mips; then
 *)
 disable mipsfpu
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 07/13] MIPS i6400 core is not mips32r2, so disable mips32r2

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index d14b02b..ca5c784 100755
--- a/configure
+++ b/configure
@@ -4098,6 +4098,7 @@ elif enabled mips; then
 add_asflags "-mfp64"
 ;;
 i6400)
+disable mips32r2
 disable mipsdsp
 disable mipsdspr2
 check_cflags "-mtune=i6400 -mabi=64" &&
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 08/13] Add mips64r2 architecture variant

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index ca5c784..761c4cb 100755
--- a/configure
+++ b/configure
@@ -1623,6 +1623,7 @@ ARCH_EXT_LIST_ARM="
 ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
+mips64r2
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2102,6 +2103,7 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
+mips64r2_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
 mmi_deps="mips"
@@ -4057,6 +4059,7 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable mipsdsp
@@ -4064,32 +4067,38 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kec|34kc|1004kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable mipsdspr2
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
+disable mips64r2
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
+disable mips64r2
 disable mips64r6
 disable msa
 ;;
 p5600)
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4099,6 +4108,7 @@ elif enabled mips; then
 ;;
 i6400)
 disable mips32r2
+disable mips64r2
 disable mipsdsp
 disable mipsdspr2
 check_cflags "-mtune=i6400 -mabi=64" &&
@@ -4109,6 +4119,7 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4139,6 +4150,7 @@ elif enabled mips; then
 *)
 disable mipsfpu
 disable mips32r2
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 06/13] MIPS i6400 core does have an FPU, so not disable it

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Fix a grammar mistake in the commit log. Change "do has" by "does
   have". Thanks to Moritz Barsnick:
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183437.html

 configure |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index d0685f3..d14b02b 100755
--- a/configure
+++ b/configure
@@ -4100,7 +4100,6 @@ elif enabled mips; then
 i6400)
 disable mipsdsp
 disable mipsdspr2
-disable mipsfpu
 check_cflags "-mtune=i6400 -mabi=64" &&
 check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
 check_ldflags "-mabi=64" &&
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 05/13] Add MIPS i6400 core optimizations

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 8598fe1..d0685f3 100755
--- a/configure
+++ b/configure
@@ -4101,9 +4101,10 @@ elif enabled mips; then
 disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
-
-check_cflags "-mtune=i6400 -mabi=64"
-check_ldflags "-mabi=64"
+check_cflags "-mtune=i6400 -mabi=64" &&
+check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
+check_ldflags "-mabi=64" &&
+add_asflags "-mfp64"
 ;;
 loongson*)
 disable mipsfpu
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 04/13] Remove --mips64r6 configure option

2015-11-18 Thread Vicente Olivert Riera
Having a configure option with the same name as a MIPS ISA is confusing,
so better to remove it. This option was being used to add some
optimizations to a specific core (i6400). We will add the optimizations
just when the i6400 core has been detected, in a later patch.

Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |9 -
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index ea129be..8598fe1 100755
--- a/configure
+++ b/configure
@@ -378,7 +378,6 @@ Optimization options (experts only):
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
   --disable-yasm   disable use of nasm/yasm assembly
-  --disable-mips64r6   disable MIPS64R6 optimizations
   --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-msadisable MSA optimizations
@@ -4941,14 +4940,8 @@ elif enabled mips; then
 elif enabled mipsdsp || enabled mipsdspr2; then
 add_cflags "-mips32r2 -mfp32"
 add_asflags "-mips32r2 -mfp32"
-elif enabled mips64r6; then
-check_cflags "-mfp64"
-check_ldflags "-mfp64"
 fi
 
-enabled mips64r6  && check_cflags "-mips64r6 -msched-weight 
-mload-store-pairs -funroll-loops" &&
- check_ldflags "-mips64r6" &&
- check_inline_asm mips64r6  '"aui $t0, $t1, 1"'
 enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
 enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
@@ -4958,7 +4951,6 @@ elif enabled mips; then
 enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
 
-enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
 enabled msa && add_asflags "-mmsa"
 
 elif enabled parisc; then
@@ -6028,7 +6020,6 @@ if enabled arm; then
 fi
 if enabled mips; then
 echo "MIPS FPU enabled  ${mipsfpu-no}"
-echo "MIPS64R6 enabled  ${mips64r6-no}"
 echo "MIPS DSP R1 enabled   ${mipsdsp-no}"
 echo "MIPS DSP R2 enabled   ${mipsdspr2-no}"
 echo "MIPS MSA enabled  ${msa-no}"
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 03/13] Add MIPS p5600 core optimizations

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 83b2a64..ea129be 100755
--- a/configure
+++ b/configure
@@ -4094,8 +4094,9 @@ elif enabled mips; then
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
-
-check_cflags "-mtune=p5600"
+check_cflags "-mtune=p5600" &&
+check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
+add_asflags "-mfp64"
 ;;
 i6400)
 disable mipsdsp
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 02/13] Remove --mips32r5 configure option

2015-11-18 Thread Vicente Olivert Riera
Having a configure option with the same name as a MIPS ISA is confusing,
so better to remove it. This option was being used to add some
optimizations to a specific core (p5600). We will add the optimizations
just when the p5600 core has been detected, in a later patch.

Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Nothing.

 configure |   20 +---
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/configure b/configure
index 0905ec2..83b2a64 100755
--- a/configure
+++ b/configure
@@ -378,7 +378,6 @@ Optimization options (experts only):
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
   --disable-yasm   disable use of nasm/yasm assembly
-  --disable-mips32r5   disable MIPS32R5 optimizations
   --disable-mips64r6   disable MIPS64R6 optimizations
   --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
@@ -1625,7 +1624,6 @@ ARCH_EXT_LIST_ARM="
 ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
-mips32r5
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2105,7 +2103,6 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
-mips32r5_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
 mmi_deps="mips"
@@ -4061,7 +4058,6 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable mipsdsp
@@ -4069,33 +4065,28 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kec|34kc|1004kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable mipsdspr2
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
-disable mips32r5
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
-disable mips32r5
 disable mips64r6
 disable msa
 ;;
@@ -4107,7 +4098,6 @@ elif enabled mips; then
 check_cflags "-mtune=p5600"
 ;;
 i6400)
-disable mips32r5
 disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
@@ -4118,7 +4108,6 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4143,14 +4132,12 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips32r5
 disable mips64r6
 disable msa
 ;;
 *)
 disable mipsfpu
 disable mips32r2
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4953,14 +4940,11 @@ elif enabled mips; then
 elif enabled mipsdsp || enabled mipsdspr2; then
 add_cflags "-mips32r2 -mfp32"
 add_asflags "-mips32r2 -mfp32"
-elif enabled mips32r5 || enabled mips64r6; then
+elif enabled mips64r6; then
 check_cflags "-mfp64"
 check_ldflags "-mfp64"
 fi
 
-enabled mips32r5  && check_cflags "-mips32r5 -msched-weight 
-mload-store-pairs -funroll-loops" &&
- check_ldflags "-mips32r5" &&
- check_inline_asm mips32r5  '"ulw $t0, ($t1)"'
 enabled mips64r6  && check_cflags "-mips64r6 -msched-weight 
-mload-store-pairs -funroll-loops" &&
  check_ldflags "-mips64r6" &&
  check_inline_asm mips64r6  '"aui $t0, $t1, 1"'
@@ -4973,7 +4957,6 @@ elif enabled mips; then
 enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
 
-enabled mips32r5 && add_asflags "-mips32r5 -mfp64"
 enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
 enabled msa && add_asflags "-mmsa"
 
@@ -6044,7 +6027,6 @@ if enabled arm; then
 fi
 if enabled mips; then
 echo "MIPS FPU enabled  ${mipsfpu-no}"
-echo "MIPS32R5 enabled  ${mips32r5-no}"
 echo "MIPS64R6 enabled  ${mips64r6-no}"
 echo "MIPS DSP R1 enabled   ${mipsdsp-no}"
 echo "MIPS DSP R2 enabled   ${mipsdspr2-no}"
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 01/13] Rename mipsdspr1 to mipsdsp

2015-11-18 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
Changes v1 -> v2:
 - Remove a block of code for mipsdspr2 which wasn't intended to be in
   this patch and it was causing a syntax error in the configure script.
   Highlighted by Michael Niedermayer:
   https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html

 Makefile  |2 +-
 arch.mak  |2 +-
 configure |   28 ++--
 libavcodec/aacenc.c   |2 +-
 libavcodec/mips/Makefile  |4 ++--
 libavcodec/mips/ac3dsp_mips.c |4 ++--
 libavcodec/mips/mpegaudiodsp_mips_fixed.c |2 +-
 libavcodec/mpegaudiodec_template.c|4 ++--
 libavcodec/mpegaudiodsp.c |2 +-
 libavcodec/mpegaudiodsp.h |2 +-
 10 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
index 306f060..6c53ceb 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS 
TOOLS  \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS\
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS MMX-OBJS YASM-OBJS   \
-   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MSA-OBJS   \
+   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
 
 define RESET
diff --git a/arch.mak b/arch.mak
index 98fde4a..08f78b4 100644
--- a/arch.mak
+++ b/arch.mak
@@ -5,7 +5,7 @@ OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
 OBJS-$(HAVE_NEON)+= $(NEON-OBJS)$(NEON-OBJS-yes)
 
 OBJS-$(HAVE_MIPSFPU)   += $(MIPSFPU-OBJS)$(MIPSFPU-OBJS-yes)
-OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS)  $(MIPSDSPR1-OBJS-yes)
+OBJS-$(HAVE_MIPSDSP)   += $(MIPSDSP-OBJS)$(MIPSDSP-OBJS-yes)
 OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS)  $(MIPSDSPR2-OBJS-yes)
 OBJS-$(HAVE_MSA)   += $(MSA-OBJS)$(MSA-OBJS-yes)
 OBJS-$(HAVE_MMI)   += $(MMI-OBJS)   $(MMI-OBJS-yes)
diff --git a/configure b/configure
index 9a736ce..0905ec2 100755
--- a/configure
+++ b/configure
@@ -380,7 +380,7 @@ Optimization options (experts only):
   --disable-yasm   disable use of nasm/yasm assembly
   --disable-mips32r5   disable MIPS32R5 optimizations
   --disable-mips64r6   disable MIPS64R6 optimizations
-  --disable-mipsdspr1  disable MIPS DSP ASE R1 optimizations
+  --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-msadisable MSA optimizations
   --disable-mipsfpudisable floating point MIPS optimizations
@@ -1627,7 +1627,7 @@ ARCH_EXT_LIST_MIPS="
 mips32r2
 mips32r5
 mips64r6
-mipsdspr1
+mipsdsp
 mipsdspr2
 msa
 "
@@ -2102,7 +2102,7 @@ setend_deps="arm"
 map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
 
 mipsfpu_deps="mips"
-mipsdspr1_deps="mips"
+mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
 mips32r5_deps="mips"
@@ -4064,14 +4064,14 @@ elif enabled mips; then
 disable mips32r5
 disable mips64r6
 disable mipsfpu
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kf*)
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
@@ -4101,14 +4101,14 @@ elif enabled mips; then
 ;;
 p5600)
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 
 check_cflags "-mtune=p5600"
 ;;
 i6400)
 disable mips32r5
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
 
@@ -4120,7 +4120,7 @@ elif enabled mips; then
 disable mips32r2
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 enable local_aligned_8 local_aligned_16 local_aligned_32
@@ -4152,7 +4152,7 @@ elif enabled mips; then
 disable mips32r2
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
@@ -4944,13 +4944,13 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options

Re: [FFmpeg-devel] [PATCH 01/13] Rename mipsdspr1 to mipsdsp

2015-11-18 Thread Vicente Olivert Riera
Dear Michael Niedermayer,

On 11/17/2015 09:17 PM, Michael Niedermayer wrote:
> On Mon, Nov 16, 2015 at 02:57:07PM +0000, Vicente Olivert Riera wrote:
> [...]
>> index 9a736ce..0461a97 100755
>> --- a/configure
>> +++ b/configure
>> @@ -380,7 +380,7 @@ Optimization options (experts only):
>>--disable-yasm   disable use of nasm/yasm assembly
>>--disable-mips32r5   disable MIPS32R5 optimizations
>>--disable-mips64r6   disable MIPS64R6 optimizations
>> -  --disable-mipsdspr1  disable MIPS DSP ASE R1 optimizations
>> +  --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
>>--disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
>>--disable-msadisable MSA optimizations
>>--disable-mipsfpudisable floating point MIPS optimizations
>> @@ -1627,7 +1627,7 @@ ARCH_EXT_LIST_MIPS="
>>  mips32r2
>>  mips32r5
>>  mips64r6
>> -mipsdspr1
>> +mipsdsp
>>  mipsdspr2
>>  msa
>>  "
>> @@ -2102,7 +2102,7 @@ setend_deps="arm"
>>  map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
>>  
>>  mipsfpu_deps="mips"
>> -mipsdspr1_deps="mips"
>> +mipsdsp_deps="mips"
>>  mipsdspr2_deps="mips"
>>  mips32r2_deps="mips"
>>  mips32r5_deps="mips"
>> @@ -4064,14 +4064,14 @@ elif enabled mips; then
>>  disable mips32r5
>>  disable mips64r6
>>  disable mipsfpu
>> -disable mipsdspr1
>> +disable mipsdsp
>>  disable mipsdspr2
>>  disable msa
>>  ;;
>>  24kf*)
>>  disable mips32r5
>>  disable mips64r6
>> -disable mipsdspr1
>> +disable mipsdsp
>>  disable mipsdspr2
>>  disable msa
>>  ;;
>> @@ -4101,14 +4101,14 @@ elif enabled mips; then
>>  ;;
>>  p5600)
>>  disable mips64r6
>> -disable mipsdspr1
>> +disable mipsdsp
>>  disable mipsdspr2
>>  
>>  check_cflags "-mtune=p5600"
>>  ;;
>>  i6400)
>>  disable mips32r5
>> -disable mipsdspr1
>> +disable mipsdsp
>>  disable mipsdspr2
>>  disable mipsfpu
>>  
>> @@ -4120,7 +4120,7 @@ elif enabled mips; then
>>  disable mips32r2
>>  disable mips32r5
>>  disable mips64r6
>> -disable mipsdspr1
>> +disable mipsdsp
>>  disable mipsdspr2
>>  disable msa
>>  enable local_aligned_8 local_aligned_16 local_aligned_32
>> @@ -4152,7 +4152,7 @@ elif enabled mips; then
>>  disable mips32r2
>>  disable mips32r5
>>  disable mips64r6
>> -disable mipsdspr1
>> +disable mipsdsp
>>  disable mipsdspr2
>>  disable msa
>>  ;;
>> @@ -4944,13 +4944,13 @@ elif enabled mips; then
>>  enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
>>  
>>  # Enable minimum ISA based on selected options
>> -if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
>> +if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
>>  add_cflags "-mips64r2"
>>  add_asflags "-mips64r2"
>>  elif enabled mips64 && enabled mipsfpu && disabled loongson2 && 
>> disabled loongson3; then
>>  add_cflags "-mips64"
>>  add_asflags "-mips64"
>> -elif enabled mipsdspr1 || enabled mipsdspr2; then
>> +elif enabled mipsdsp || enabled mipsdspr2; then
>>  add_cflags "-mips32r2 -mfp32"
>>  add_asflags "-mips32r2 -mfp32"
>>  elif enabled mips32r5 || enabled mips64r6; then
>> @@ -4964,8 +4964,8 @@ elif enabled mips; then
>>  enabled mips64r6  && check_cflags "-mips64r6 -msched-weight 
>> -mload-store-pairs -funroll-loops" &&
>>   check_ldflags "-mips64r6" &&
>>   check_inline_asm mips64r6  '"aui $t0, $t1, 1"'
>> -enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags &qu

Re: [FFmpeg-devel] [PATCH 06/13] MIPS i6400 core do has an FPU, so not disable it

2015-11-17 Thread Vicente Olivert Riera
Dear Moritz Barsnick,

On 11/17/2015 04:20 PM, Moritz Barsnick wrote:
> On Tue, Nov 17, 2015 at 15:07:56 +0000, Vicente Olivert Riera wrote:
>> file. Do you mean the patch subject instead of patch name? If so, what's
>> the error?
> 
> Indeed, the grammar:
> 
>> [PATCH 06/13] MIPS i6400 core do has an FPU, so not disable it
> 
> -> MIPS i6400 core has an FPU, so not disable it
> or with emphasis
> -> MIPS i6400 core does have an FPU, so not disable it
> (infinitive of "to have" following the third person singular of the
> helper verb "to do")

That's right, thanks for the clarification. Does that mistake require
the patch to be resent?

Regards,

Vincent.

> Moritz
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/13] MIPS i6400 core do has an FPU, so not disable it

2015-11-17 Thread Vicente Olivert Riera
Dear Nedeljko Babic,

On 11/17/2015 03:04 PM, Nedeljko Babic wrote:
> It looks to me that there is an error in patch name.

the patch has been sent via git send-email, so there is no attachment
file. Do you mean the patch subject instead of patch name? If so, what's
the error?

Regards,

Vincent.

> Other than that LGTM.
> 
> Thanks,
> Nedeljko
> 
> Od: Vincent Olivert Riera
> Poslato: 16. novembar 2015 15:57
> Za: ffmpeg-devel@ffmpeg.org
> Cc: Nedeljko Babic; Shivraj Patil; Vincent Olivert Riera
> Tema: [PATCH 06/13] MIPS i6400 core do has an FPU, so not disable it
> 
> Signed-off-by: Vicente Olivert Riera 
> ---
>  configure |1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/configure b/configure
> index e1c8851..ff5e132 100755
> --- a/configure
> +++ b/configure
> @@ -4100,7 +4100,6 @@ elif enabled mips; then
>  i6400)
>  disable mipsdsp
>  disable mipsdspr2
> -disable mipsfpu
>  check_cflags "-mtune=i6400 -mabi=64" &&
>  check_cflags "-mfp64 -msched-weight -mload-store-pairs 
> -funroll-loops" &&
>  check_ldflags "-mabi=64" &&
> --
> 1.7.1
> 
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 06/13] MIPS i6400 core do has an FPU, so not disable it

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index e1c8851..ff5e132 100755
--- a/configure
+++ b/configure
@@ -4100,7 +4100,6 @@ elif enabled mips; then
 i6400)
 disable mipsdsp
 disable mipsdspr2
-disable mipsfpu
 check_cflags "-mtune=i6400 -mabi=64" &&
 check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
 check_ldflags "-mabi=64" &&
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 05/13] Add MIPS i6400 core optimizations

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index d180c0d..e1c8851 100755
--- a/configure
+++ b/configure
@@ -4101,9 +4101,10 @@ elif enabled mips; then
 disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
-
-check_cflags "-mtune=i6400 -mabi=64"
-check_ldflags "-mabi=64"
+check_cflags "-mtune=i6400 -mabi=64" &&
+check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
+check_ldflags "-mabi=64" &&
+add_asflags "-mfp64"
 ;;
 loongson*)
 disable mipsfpu
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 03/13] Add MIPS p5600 core optimizations

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 3fd156e..fa5207c 100755
--- a/configure
+++ b/configure
@@ -4094,8 +4094,9 @@ elif enabled mips; then
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
-
-check_cflags "-mtune=p5600"
+check_cflags "-mtune=p5600" &&
+check_cflags "-mfp64 -msched-weight -mload-store-pairs 
-funroll-loops" &&
+add_asflags "-mfp64"
 ;;
 i6400)
 disable mipsdsp
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 02/13] Remove --mips32r5 configure option

2015-11-16 Thread Vicente Olivert Riera
Having a configure option with the same name as a MIPS ISA is confusing,
so better to remove it. This option was being used to add some
optimizations to a specific core (p5600). We will add the optimizations
just when the p5600 core has been detected, in a later patch.

Signed-off-by: Vicente Olivert Riera 
---
 configure |   20 +---
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/configure b/configure
index 0461a97..3fd156e 100755
--- a/configure
+++ b/configure
@@ -378,7 +378,6 @@ Optimization options (experts only):
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
   --disable-yasm   disable use of nasm/yasm assembly
-  --disable-mips32r5   disable MIPS32R5 optimizations
   --disable-mips64r6   disable MIPS64R6 optimizations
   --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
@@ -1625,7 +1624,6 @@ ARCH_EXT_LIST_ARM="
 ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
-mips32r5
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2105,7 +2103,6 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
-mips32r5_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
 mmi_deps="mips"
@@ -4061,7 +4058,6 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable mipsdsp
@@ -4069,33 +4065,28 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kec|34kc|1004kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable mipsdspr2
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
-disable mips32r5
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
-disable mips32r5
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
-disable mips32r5
 disable mips64r6
 disable msa
 ;;
@@ -4107,7 +4098,6 @@ elif enabled mips; then
 check_cflags "-mtune=p5600"
 ;;
 i6400)
-disable mips32r5
 disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
@@ -4118,7 +4108,6 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4143,14 +4132,12 @@ elif enabled mips; then
 esac
 ;;
 generic)
-disable mips32r5
 disable mips64r6
 disable msa
 ;;
 *)
 disable mipsfpu
 disable mips32r2
-disable mips32r5
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4953,14 +4940,11 @@ elif enabled mips; then
 elif enabled mipsdsp || enabled mipsdspr2; then
 add_cflags "-mips32r2 -mfp32"
 add_asflags "-mips32r2 -mfp32"
-elif enabled mips32r5 || enabled mips64r6; then
+elif enabled mips64r6; then
 check_cflags "-mfp64"
 check_ldflags "-mfp64"
 fi
 
-enabled mips32r5  && check_cflags "-mips32r5 -msched-weight 
-mload-store-pairs -funroll-loops" &&
- check_ldflags "-mips32r5" &&
- check_inline_asm mips32r5  '"ulw $t0, ($t1)"'
 enabled mips64r6  && check_cflags "-mips64r6 -msched-weight 
-mload-store-pairs -funroll-loops" &&
  check_ldflags "-mips64r6" &&
  check_inline_asm mips64r6  '"aui $t0, $t1, 1"'
@@ -4973,7 +4957,6 @@ elif enabled mips; then
 enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
 
-enabled mips32r5 && add_asflags "-mips32r5 -mfp64"
 enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
 enabled msa && add_asflags "-mmsa"
 
@@ -6050,7 +6033,6 @@ if enabled arm; then
 fi
 if enabled mips; then
 echo "MIPS FPU enabled  ${mipsfpu-no}"
-echo "MIPS32R5 enabled  ${mips32r5-no}"
 echo "MIPS64R6 enabled  ${mips64r6-no}"
 echo "MIPS DSP R1 enabled   ${mipsdsp-no}"
 echo "MIPS DSP R2 enabled   ${mipsdspr2-no}"
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 11/13] Remove the MIPS "generic" core in favor of "*"

2015-11-16 Thread Vicente Olivert Riera
There is no point to have a "generic" core when we can catch all
unsupported cores with the "*" option, so remove it.

Signed-off-by: Vicente Olivert Riera 
---
 configure |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index d366eb2..1bfcc67 100755
--- a/configure
+++ b/configure
@@ -4154,10 +4154,6 @@ elif enabled mips; then
 ;;
 esac
 ;;
-generic)
-disable mips64r6
-disable msa
-;;
 *)
 disable mipsfpu
 disable mips32r2
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 12/13] Improve detection of MIPS ISAs, FPU and ASEs (DSP, MSA)

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |   77 ++--
 1 files changed, 59 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 1bfcc67..4173684 100755
--- a/configure
+++ b/configure
@@ -4952,27 +4952,68 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
-add_cflags "-mips64r2"
-add_asflags "-mips64r2"
-elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled 
loongson3; then
-add_cflags "-mips64"
-add_asflags "-mips64"
-elif enabled mipsdsp || enabled mipsdspr2; then
-add_cflags "-mips32r2 -mfp32"
-add_asflags "-mips32r2 -mfp32"
+if enabled mips64; then
+if enabled mips64r6; then
+check_cflags "-mips64r6" &&
+check_ldflags "-mips64r6" &&
+add_asflags "-mips64r6" &&
+check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"'
+elif enabled mips64r2; then
+check_cflags "-mips64r2" &&
+check_ldflags "-mips64r2" &&
+add_asflags "-mips64r2" &&
+check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
+else
+check_cflags "-mips64" &&
+check_ldflags "-mips64" &&
+add_asflags "-mips64" &&
+check_inline_asm mips64r1 '"daddi $0, $0, 0"'
+fi
+else
+if enabled mips32r6; then
+check_cflags "-mips32r6" &&
+check_ldflags "-mips32r6" &&
+add_asflags "-mips32r6" &&
+check_inline_asm mips32r6 '"aui $0, $0, 0"'
+elif enabled mips32r2; then
+check_cflags "-mips32r2" &&
+check_ldflags "-mips32r2" &&
+add_asflags "-mips32r2" &&
+check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
+else
+check_cflags "-mips32" &&
+check_ldflags "-mips32" &&
+add_asflags "-mips32" &&
+check_inline_asm mips32r1 '"addi $0, $0, 0"'
+fi
+fi
+
+# MIPS FPU
+if enabled mipsfpu; then
+add_cflags "-mhard-float" &&
+add_asflags "-mhard-float" &&
+check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
 fi
 
-enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
-enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
- check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
-enabled mipsfpu   && add_cflags "-mhard-float" && add_asflags 
"-mhard-float" &&
- check_inline_asm mipsfpu   '"madd.d $f0, $f2, $f4, $f6"'
-enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
- check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
+# MSA and DSP support require ISA revision level 2 or greater
+if enabled mips32r2 || enabled mips64r2 || enabled mips32r6 || enabled 
mips64r6; then
+# MSA must be used with -mfp64 and -mhard-float
+if enabled mipsfpu; then
+if enabled msa; then
+check_cflags "-mfp64 -mmsa" &&
+check_ldflags "-mfp64 -mmsa" &&
+add_asflags "-mfp64 -mmsa" &&
+check_inline_asm msa '"addvi.b $w0, $w1, 1"'
+fi
+else
+disable msa
+fi
 
-enabled msa && add_asflags "-mmsa"
+if enabled mipsdsp; then
+check_cflags "-mdsp" &&
+add_asflags "-mdsp" &&
+check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
+fi
 
 if enabled mipsdspr2; then
 check_cflags "-mdspr2" &&
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 10/13] Put "disable mipsfpu" in a better place for loongson

2015-11-16 Thread Vicente Olivert Riera
Let's disable the ISAs first, and then the core capabilities, as we do
for the rest of the cores. This way the code is better organized.

Signed-off-by: Vicente Olivert Riera 
---
 configure |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 2f5456c..d366eb2 100755
--- a/configure
+++ b/configure
@@ -4127,11 +4127,11 @@ elif enabled mips; then
 add_asflags "-mfp64"
 ;;
 loongson*)
-disable mipsfpu
 disable mips32r2
 disable mips32r6
 disable mips64r2
 disable mips64r6
+disable mipsfpu
 disable mipsdsp
 disable mipsdspr2
 disable msa
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 13/13] Add support for MIPS R6

2015-11-16 Thread Vicente Olivert Riera
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera 
---
 libavcodec/mips/aaccoder_mips.c   |4 
 libavcodec/mips/aacdec_mips.h |2 ++
 libavcodec/mips/aacpsdsp_mips.c   |4 
 libavcodec/mips/aacpsy_mips.h |2 ++
 libavcodec/mips/aacsbr_mips.c |4 
 libavcodec/mips/aacsbr_mips.h |2 ++
 libavcodec/mips/ac3dsp_mips.c |6 +-
 libavcodec/mips/acelp_filters_mips.c  |4 
 libavcodec/mips/acelp_vectors_mips.c  |4 
 libavcodec/mips/amrwbdec_mips.c   |2 ++
 libavcodec/mips/amrwbdec_mips.h   |2 ++
 libavcodec/mips/celp_filters_mips.c   |4 
 libavcodec/mips/celp_math_mips.c  |4 
 libavcodec/mips/compute_antialias_float.h |2 ++
 libavcodec/mips/fft_mips.c|4 
 libavcodec/mips/iirfilter_mips.c  |4 
 libavcodec/mips/lsp_mips.h|2 ++
 libavcodec/mips/mpegaudiodsp_mips_fixed.c |   10 ++
 libavcodec/mips/mpegaudiodsp_mips_float.c |   10 ++
 libavcodec/mips/sbrdsp_mips.c |4 
 libavutil/mips/float_dsp_mips.c   |4 
 21 files changed, 83 insertions(+), 1 deletions(-)

diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c
index e8e1e62..2385ed2 100644
--- a/libavcodec/mips/aaccoder_mips.c
+++ b/libavcodec/mips/aaccoder_mips.c
@@ -66,6 +66,7 @@
 #include "libavcodec/aacenc_utils.h"
 
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 typedef struct BandCodingPath {
 int prev_idx;
 float cost;
@@ -2412,10 +2413,12 @@ static void search_for_ms_mips(AACEncContext *s, 
ChannelElement *cpe)
 
 #include "libavcodec/aaccoder_trellis.h"
 
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
 void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_INLINE_ASM
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 AACCoefficientsEncoder *e = c->coder;
 int option = c->options.coder;
 
@@ -2429,5 +2432,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
 #if HAVE_MIPSFPU
 e->search_for_ms= search_for_ms_mips;
 #endif /* HAVE_MIPSFPU */
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h
index 054a9fb..0c2b243 100644
--- a/libavcodec/mips/aacdec_mips.h
+++ b/libavcodec/mips/aacdec_mips.h
@@ -61,6 +61,7 @@
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM && HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
const float *scale)
 {
@@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float 
*v, unsigned idx,
 #define VMUL4 VMUL4_mips
 #define VMUL2S VMUL2S_mips
 #define VMUL4S VMUL4S_mips
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
 
 #endif /* AVCODEC_MIPS_AACDEC_FLOAT_H */
diff --git a/libavcodec/mips/aacpsdsp_mips.c b/libavcodec/mips/aacpsdsp_mips.c
index 695f9ef..83fdc2f 100644
--- a/libavcodec/mips/aacpsdsp_mips.c
+++ b/libavcodec/mips/aacpsdsp_mips.c
@@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float 
out[2][38][64],
 }
 
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
 {
 int i;
@@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float 
(*r)[2],
 : "memory"
 );
 }
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 
@@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
 s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
 s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
 #if HAVE_MIPSFPU
+#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 s->add_squares= ps_add_squares_mips;
 s->mul_pair_single= ps_mul_pair_single_mips;
 s->decorrelate= ps_decorrelate_mips;
 s->stereo_interpolate[0]  = ps_stereo_interpolate_mips;
+#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_MIPSFPU */
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/mips/aacpsy_mips.h b/libavcodec/mips/aacpsy_mips.h
index 596dcad..a216df6 100644
--- a/libavcodec/mips/aacpsy_mips.h
+++ b/libavcodec/mips/aacpsy_mips.h
@@ -59,6 +59,7 @@
 #include "libavutil/mips/as

[FFmpeg-devel] [PATCH 09/13] Add mips32r6 architecture variant

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 50db22b..2f5456c 100755
--- a/configure
+++ b/configure
@@ -1624,6 +1624,7 @@ ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
 mips64r2
+mips32r6
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2103,6 +2104,7 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
+mips32r6_deps="mips"
 mips64r2_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
@@ -4059,6 +4061,7 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
@@ -4067,6 +4070,7 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4074,6 +4078,7 @@ elif enabled mips; then
 disable msa
 ;;
 24kec|34kc|1004kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
@@ -4081,23 +4086,27 @@ elif enabled mips; then
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable msa
 ;;
 p5600)
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4108,6 +4117,7 @@ elif enabled mips; then
 ;;
 i6400)
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mipsdsp
 disable mipsdspr2
@@ -4119,6 +4129,7 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
@@ -4150,6 +4161,7 @@ elif enabled mips; then
 *)
 disable mipsfpu
 disable mips32r2
+disable mips32r6
 disable mips64r2
 disable mips64r6
 disable mipsdsp
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 07/13] MIPS i6400 core is not mips32r2, so disable mips32r2

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index ff5e132..3530327 100755
--- a/configure
+++ b/configure
@@ -4098,6 +4098,7 @@ elif enabled mips; then
 add_asflags "-mfp64"
 ;;
 i6400)
+disable mips32r2
 disable mipsdsp
 disable mipsdspr2
 check_cflags "-mtune=i6400 -mabi=64" &&
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 08/13] Add mips64r2 architecture variant

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 3530327..50db22b 100755
--- a/configure
+++ b/configure
@@ -1623,6 +1623,7 @@ ARCH_EXT_LIST_ARM="
 ARCH_EXT_LIST_MIPS="
 mipsfpu
 mips32r2
+mips64r2
 mips64r6
 mipsdsp
 mipsdspr2
@@ -2102,6 +2103,7 @@ mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
+mips64r2_deps="mips"
 mips64r6_deps="mips"
 msa_deps="mips"
 mmi_deps="mips"
@@ -4057,6 +4059,7 @@ elif enabled mips; then
 
 case $cpu in
 24kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable mipsdsp
@@ -4064,32 +4067,38 @@ elif enabled mips; then
 disable msa
 ;;
 24kf*)
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kec|34kc|1004kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable mipsdspr2
 disable msa
 ;;
 24kef*|34kf*|1004kf*)
+disable mips64r2
 disable mips64r6
 disable mipsdspr2
 disable msa
 ;;
 74kc)
+disable mips64r2
 disable mips64r6
 disable mipsfpu
 disable msa
 ;;
 74kf)
+disable mips64r2
 disable mips64r6
 disable msa
 ;;
 p5600)
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4099,6 +4108,7 @@ elif enabled mips; then
 ;;
 i6400)
 disable mips32r2
+disable mips64r2
 disable mipsdsp
 disable mipsdspr2
 check_cflags "-mtune=i6400 -mabi=64" &&
@@ -4109,6 +4119,7 @@ elif enabled mips; then
 loongson*)
 disable mipsfpu
 disable mips32r2
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
@@ -4139,6 +4150,7 @@ elif enabled mips; then
 *)
 disable mipsfpu
 disable mips32r2
+disable mips64r2
 disable mips64r6
 disable mipsdsp
 disable mipsdspr2
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 04/13] Remove --mips64r6 configure option

2015-11-16 Thread Vicente Olivert Riera
Having a configure option with the same name as a MIPS ISA is confusing,
so better to remove it. This option was being used to add some
optimizations to a specific core (i6400). We will add the optimizations
just when the i6400 core has been detected, in a later patch.

Signed-off-by: Vicente Olivert Riera 
---
 configure |9 -
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index fa5207c..d180c0d 100755
--- a/configure
+++ b/configure
@@ -378,7 +378,6 @@ Optimization options (experts only):
   --disable-neon   disable NEON optimizations
   --disable-inline-asm disable use of inline assembly
   --disable-yasm   disable use of nasm/yasm assembly
-  --disable-mips64r6   disable MIPS64R6 optimizations
   --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-msadisable MSA optimizations
@@ -4941,14 +4940,8 @@ elif enabled mips; then
 elif enabled mipsdsp || enabled mipsdspr2; then
 add_cflags "-mips32r2 -mfp32"
 add_asflags "-mips32r2 -mfp32"
-elif enabled mips64r6; then
-check_cflags "-mfp64"
-check_ldflags "-mfp64"
 fi
 
-enabled mips64r6  && check_cflags "-mips64r6 -msched-weight 
-mload-store-pairs -funroll-loops" &&
- check_ldflags "-mips64r6" &&
- check_inline_asm mips64r6  '"aui $t0, $t1, 1"'
 enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
 enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
@@ -4958,7 +4951,6 @@ elif enabled mips; then
 enabled msa   && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
  check_inline_asm msa   '"addvi.b $w0, $w1, 1"'
 
-enabled mips64r6 && add_asflags "-mips64r6 -mfp64"
 enabled msa && add_asflags "-mmsa"
 
 if enabled mipsdspr2; then
@@ -6034,7 +6026,6 @@ if enabled arm; then
 fi
 if enabled mips; then
 echo "MIPS FPU enabled  ${mipsfpu-no}"
-echo "MIPS64R6 enabled  ${mips64r6-no}"
 echo "MIPS DSP R1 enabled   ${mipsdsp-no}"
 echo "MIPS DSP R2 enabled   ${mipsdspr2-no}"
 echo "MIPS MSA enabled  ${msa-no}"
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 01/13] Rename mipsdspr1 to mipsdsp

2015-11-16 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 Makefile  |2 +-
 arch.mak  |2 +-
 configure |   34 +
 libavcodec/aacenc.c   |2 +-
 libavcodec/mips/Makefile  |4 +-
 libavcodec/mips/ac3dsp_mips.c |4 +-
 libavcodec/mips/mpegaudiodsp_mips_fixed.c |2 +-
 libavcodec/mpegaudiodec_template.c|4 +-
 libavcodec/mpegaudiodsp.c |2 +-
 libavcodec/mpegaudiodsp.h |2 +-
 10 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
index 306f060..6c53ceb 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS 
TOOLS  \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS\
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS MMX-OBJS YASM-OBJS   \
-   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MSA-OBJS   \
+   MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
 
 define RESET
diff --git a/arch.mak b/arch.mak
index 98fde4a..08f78b4 100644
--- a/arch.mak
+++ b/arch.mak
@@ -5,7 +5,7 @@ OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
 OBJS-$(HAVE_NEON)+= $(NEON-OBJS)$(NEON-OBJS-yes)
 
 OBJS-$(HAVE_MIPSFPU)   += $(MIPSFPU-OBJS)$(MIPSFPU-OBJS-yes)
-OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS)  $(MIPSDSPR1-OBJS-yes)
+OBJS-$(HAVE_MIPSDSP)   += $(MIPSDSP-OBJS)$(MIPSDSP-OBJS-yes)
 OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS)  $(MIPSDSPR2-OBJS-yes)
 OBJS-$(HAVE_MSA)   += $(MSA-OBJS)$(MSA-OBJS-yes)
 OBJS-$(HAVE_MMI)   += $(MMI-OBJS)   $(MMI-OBJS-yes)
diff --git a/configure b/configure
index 9a736ce..0461a97 100755
--- a/configure
+++ b/configure
@@ -380,7 +380,7 @@ Optimization options (experts only):
   --disable-yasm   disable use of nasm/yasm assembly
   --disable-mips32r5   disable MIPS32R5 optimizations
   --disable-mips64r6   disable MIPS64R6 optimizations
-  --disable-mipsdspr1  disable MIPS DSP ASE R1 optimizations
+  --disable-mipsdspdisable MIPS DSP ASE R1 optimizations
   --disable-mipsdspr2  disable MIPS DSP ASE R2 optimizations
   --disable-msadisable MSA optimizations
   --disable-mipsfpudisable floating point MIPS optimizations
@@ -1627,7 +1627,7 @@ ARCH_EXT_LIST_MIPS="
 mips32r2
 mips32r5
 mips64r6
-mipsdspr1
+mipsdsp
 mipsdspr2
 msa
 "
@@ -2102,7 +2102,7 @@ setend_deps="arm"
 map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
 
 mipsfpu_deps="mips"
-mipsdspr1_deps="mips"
+mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
 mips32r2_deps="mips"
 mips32r5_deps="mips"
@@ -4064,14 +4064,14 @@ elif enabled mips; then
 disable mips32r5
 disable mips64r6
 disable mipsfpu
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
 24kf*)
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
@@ -4101,14 +4101,14 @@ elif enabled mips; then
 ;;
 p5600)
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 
 check_cflags "-mtune=p5600"
 ;;
 i6400)
 disable mips32r5
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable mipsfpu
 
@@ -4120,7 +4120,7 @@ elif enabled mips; then
 disable mips32r2
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 enable local_aligned_8 local_aligned_16 local_aligned_32
@@ -4152,7 +4152,7 @@ elif enabled mips; then
 disable mips32r2
 disable mips32r5
 disable mips64r6
-disable mipsdspr1
+disable mipsdsp
 disable mipsdspr2
 disable msa
 ;;
@@ -4944,13 +4944,13 @@ elif enabled mips; then
 enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
 
 # Enable minimum ISA based on selected options
-if enabled mips64 && (enabled mipsdspr1 || enabled mipsdspr2); then
+if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
 add_cflags "-mips64r2"
 add_asflags "-mips64r2"
 elif enabled mips64 && enabled mi

Re: [FFmpeg-devel] [PATCH] mips: disable all features in configure if no cpu is matched

2015-10-15 Thread Vicente Olivert Riera
Dear Nedeljko Babic,

On 10/15/2015 01:05 PM, Nedeljko Babic wrote:
> Hello,
> 
>> Signed-off-by: Vicente Olivert Riera 
>> ---
>> configure |9 +
>> 1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 7e55e92..cd27ad7 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4130,6 +4130,15 @@ elif enabled mips; then
>> disable mips64r6
>> disable msa
>> ;;
>> +*)
>> +disable mipsfpu
>> +disable mips32r2
>> +disable mips32r5
>> +disable mips64r6
>> +disable mipsdspr1
>> +disable mipsdspr2
>> +disable msa
>> +;;
>> esac
> 
> This case will never be reached.
> 
> If configure  “--cpu” option is not used, default is cpu=generic.
> 
> On the other hand, if cpu option is used with some cpu that is not supported 
> in
>  the list, configuration will break since “-march” is set to that cpu value.

Are you sure? What happen if you pass --cpu=mips32r2? Then -march will
be set to mips32r2 which is valid :-)

Regards,

Vincent.

>>
>> elif enabled ppc; then
> 
> -Nedeljko
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] mips: disable all features in configure if no cpu is matched

2015-10-14 Thread Vicente Olivert Riera
Signed-off-by: Vicente Olivert Riera 
---
 configure |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 7e55e92..cd27ad7 100755
--- a/configure
+++ b/configure
@@ -4130,6 +4130,15 @@ elif enabled mips; then
 disable mips64r6
 disable msa
 ;;
+*)
+disable mipsfpu
+disable mips32r2
+disable mips32r5
+disable mips64r6
+disable mipsdspr1
+disable mipsdspr2
+disable msa
+;;
 esac
 
 elif enabled ppc; then
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel