Browse code

Merge remote-tracking branch 'newdev/master'

* newdev/master:
avio: make udp_set_remote_url/get_local_port internal.
asfdec: also subtract preroll when reading simple index object
matroskaenc: remove a variable that's unused after bc17bd9.
avio: cosmetics - nicer vertical alignment.
Remove unnecessary icc version checks
Disable 'attribute "foo" ignored' warnings from icc
rtsp: Don't use a locale dependent format string
Add xd55 codec tag for XDCAM HD422 720p25 CBR files.
configure: get libavcodec version from new version.h header
lavc: move the version macros to a new installed header.
matroskaenc: simplify get_aac_sample_rates by using ff_mpeg4audio_get_config
Do not use format string "%0.3f" for RTSP Range field.
Add apply_window_int16() to DSPContext with x86-optimized versions and use it in the ac3_fixed encoder.
Document usage of import libraries created by dlltool
configure: Set the correct lib target for arm/wince dlltool
fate: simplify regression-funcs.sh
fate: add support for multithread testing

Conflicts:
libavformat/rtspdec.c
libavutil/attributes.h
libavutil/internal.h
libavutil/mem.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/03/24 10:12:17
Showing 31 changed files
... ...
@@ -290,7 +290,7 @@ fate: $(FATE)
290 290
 
291 291
 $(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
292 292
 	@echo "TEST    $(@:fate-%=%)"
293
-	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)'
293
+	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)'
294 294
 
295 295
 fate-list:
296 296
 	@printf '%s\n' $(sort $(FATE))
... ...
@@ -2424,7 +2424,7 @@ case $target_os in
2424 2424
             enable malloc_aligned
2425 2425
             LIBTARGET="i386:x86-64"
2426 2426
         elif enabled arm; then
2427
-            LIBTARGET=arm
2427
+            LIBTARGET=arm-wince
2428 2428
         fi
2429 2429
         shlibdir_default="$bindir_default"
2430 2430
         disable ffserver
... ...
@@ -3009,10 +3009,11 @@ if enabled icc; then
3009 3009
     check_cflags -w1
3010 3010
     # -wd: Disable following warnings
3011 3011
     # 144, 167, 556: -Wno-pointer-sign
3012
+    # 1292: attribute "foo" ignored
3012 3013
     # 10006: ignoring unknown option -fno-signed-zeros
3013 3014
     # 10148: ignoring unknown option -Wno-parentheses
3014 3015
     # 10156: ignoring option '-W'; no argument required
3015
-    check_cflags -wd144,167,556,10006,10148,10156
3016
+    check_cflags -wd144,167,556,1292,10006,10148,10156
3016 3017
     # 11030: Warning unknown option --as-needed
3017 3018
     # 10156: ignoring option '-export'; no argument required
3018 3019
     check_ldflags -wd10156,11030
... ...
@@ -3310,7 +3311,7 @@ get_version(){
3310 3310
 
3311 3311
 get_version LIBSWSCALE  libswscale/swscale.h
3312 3312
 get_version LIBPOSTPROC libpostproc/postprocess.h
3313
-get_version LIBAVCODEC  libavcodec/avcodec.h
3313
+get_version LIBAVCODEC  libavcodec/version.h
3314 3314
 get_version LIBAVDEVICE libavdevice/avdevice.h
3315 3315
 get_version LIBAVFORMAT libavformat/version.h
3316 3316
 get_version LIBAVUTIL   libavutil/avutil.h
... ...
@@ -1009,6 +1009,12 @@ libavutil/pixdesc.h you should have:
1009 1009
 extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
1010 1010
 @end example
1011 1011
 
1012
+Note that using import libraries created by dlltool requires
1013
+the linker optimization option to be set to
1014
+"References: Keep Unreferenced Data (/OPT:NOREF)", otherwise
1015
+the resulting binaries will fail during runtime. This isn't
1016
+required when using import libraries generated by lib.exe.
1017
+
1012 1018
 @subsection Cross compilation for Windows with Linux
1013 1019
 
1014 1020
 You must use the MinGW cross compilation tools available at
... ...
@@ -433,9 +433,9 @@ set the time to live value (for multicast only)
433 433
 
434 434
 @item connect=@var{1|0}
435 435
 Initialize the UDP socket with @code{connect()}. In this case, the
436
-destination address can't be changed with udp_set_remote_url later.
436
+destination address can't be changed with ff_udp_set_remote_url later.
437 437
 If the destination address isn't known at the start, this option can
438
-be specified in udp_set_remote_url, too.
438
+be specified in ff_udp_set_remote_url, too.
439 439
 This allows finding out the source address for the packets with getsockname,
440 440
 and makes writes return with AVERROR(ECONNREFUSED) if "destination
441 441
 unreachable" is received.
... ...
@@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak
3 3
 NAME = avcodec
4 4
 FFLIBS = avutil
5 5
 
6
-HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vdpau.h xvmc.h
6
+HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vdpau.h version.h xvmc.h
7 7
 
8 8
 OBJS = allcodecs.o                                                      \
9 9
        audioconvert.o                                                   \
... ...
@@ -167,7 +167,7 @@ static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
167 167
 static void mdct512(AC3MDCTContext *mdct, CoefType *out, SampleType *in);
168 168
 
169 169
 static void apply_window(DSPContext *dsp, SampleType *output, const SampleType *input,
170
-                         const SampleType *window, int n);
170
+                         const SampleType *window, unsigned int len);
171 171
 
172 172
 static int normalize_samples(AC3EncodeContext *s);
173 173
 
... ...
@@ -252,15 +252,9 @@ static void mdct512(AC3MDCTContext *mdct, int32_t *out, int16_t *in)
252 252
  * Apply KBD window to input samples prior to MDCT.
253 253
  */
254 254
 static void apply_window(DSPContext *dsp, int16_t *output, const int16_t *input,
255
-                         const int16_t *window, int n)
255
+                         const int16_t *window, unsigned int len)
256 256
 {
257
-    int i;
258
-    int n2 = n >> 1;
259
-
260
-    for (i = 0; i < n2; i++) {
261
-        output[i]     = MUL16(input[i],     window[i]) >> 15;
262
-        output[n-i-1] = MUL16(input[n-i-1], window[i]) >> 15;
263
-    }
257
+    dsp->apply_window_int16(output, input, window, len);
264 258
 }
265 259
 
266 260
 
... ...
@@ -83,9 +83,9 @@ static void mdct512(AC3MDCTContext *mdct, float *out, float *in)
83 83
  * Apply KBD window to input samples prior to MDCT.
84 84
  */
85 85
 static void apply_window(DSPContext *dsp, float *output, const float *input,
86
-                         const float *window, int n)
86
+                         const float *window, unsigned int len)
87 87
 {
88
-    dsp->vector_fmul(output, input, window, n);
88
+    dsp->vector_fmul(output, input, window, len);
89 89
 }
90 90
 
91 91
 
... ...
@@ -141,7 +141,7 @@ const uint8_t ff_ac3_rematrix_band_tab[5] = { 13, 25, 37, 61, 253 };
141 141
 /* AC-3 MDCT window */
142 142
 
143 143
 /* MDCT window */
144
-const int16_t ff_ac3_window[AC3_WINDOW_SIZE/2] = {
144
+DECLARE_ALIGNED(16, const int16_t, ff_ac3_window)[AC3_WINDOW_SIZE/2] = {
145 145
     4,    7,   12,   16,   21,   28,   34,   42,
146 146
    51,   61,   72,   84,   97,  111,  127,  145,
147 147
   164,  184,  207,  231,  257,  285,  315,  347,
... ...
@@ -31,57 +31,7 @@
31 31
 #include "libavutil/avutil.h"
32 32
 #include "libavutil/cpu.h"
33 33
 
34
-#define LIBAVCODEC_VERSION_MAJOR 52
35
-#define LIBAVCODEC_VERSION_MINOR 114
36
-#define LIBAVCODEC_VERSION_MICRO  0
37
-
38
-#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
39
-                                               LIBAVCODEC_VERSION_MINOR, \
40
-                                               LIBAVCODEC_VERSION_MICRO)
41
-#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
42
-                                           LIBAVCODEC_VERSION_MINOR,    \
43
-                                           LIBAVCODEC_VERSION_MICRO)
44
-#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
45
-
46
-#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
47
-
48
-/**
49
- * Those FF_API_* defines are not part of public API.
50
- * They may change, break or disappear at any time.
51
- */
52
-#ifndef FF_API_PALETTE_CONTROL
53
-#define FF_API_PALETTE_CONTROL  (LIBAVCODEC_VERSION_MAJOR < 54)
54
-#endif
55
-#ifndef FF_API_MM_FLAGS
56
-#define FF_API_MM_FLAGS         (LIBAVCODEC_VERSION_MAJOR < 53)
57
-#endif
58
-#ifndef FF_API_OPT_SHOW
59
-#define FF_API_OPT_SHOW         (LIBAVCODEC_VERSION_MAJOR < 53)
60
-#endif
61
-#ifndef FF_API_AUDIO_OLD
62
-#define FF_API_AUDIO_OLD        (LIBAVCODEC_VERSION_MAJOR < 53)
63
-#endif
64
-#ifndef FF_API_VIDEO_OLD
65
-#define FF_API_VIDEO_OLD        (LIBAVCODEC_VERSION_MAJOR < 53)
66
-#endif
67
-#ifndef FF_API_SUBTITLE_OLD
68
-#define FF_API_SUBTITLE_OLD     (LIBAVCODEC_VERSION_MAJOR < 53)
69
-#endif
70
-#ifndef FF_API_USE_LPC
71
-#define FF_API_USE_LPC          (LIBAVCODEC_VERSION_MAJOR < 53)
72
-#endif
73
-#ifndef FF_API_SET_STRING_OLD
74
-#define FF_API_SET_STRING_OLD   (LIBAVCODEC_VERSION_MAJOR < 53)
75
-#endif
76
-#ifndef FF_API_INOFFICIAL
77
-#define FF_API_INOFFICIAL       (LIBAVCODEC_VERSION_MAJOR < 53)
78
-#endif
79
-#ifndef FF_API_OLD_SAMPLE_FMT
80
-#define FF_API_OLD_SAMPLE_FMT   (LIBAVCODEC_VERSION_MAJOR < 53)
81
-#endif
82
-#ifndef FF_API_OLD_AUDIOCONVERT
83
-#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 53)
84
-#endif
34
+#include "libavcodec/version.h"
85 35
 
86 36
 #if LIBAVCODEC_VERSION_MAJOR < 53
87 37
 #   define FF_INTERNALC_MEM_TYPE unsigned int
... ...
@@ -3895,6 +3895,19 @@ static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, const int16_t *v2, co
3895 3895
     return res;
3896 3896
 }
3897 3897
 
3898
+static void apply_window_int16_c(int16_t *output, const int16_t *input,
3899
+                                 const int16_t *window, unsigned int len)
3900
+{
3901
+    int i;
3902
+    int len2 = len >> 1;
3903
+
3904
+    for (i = 0; i < len2; i++) {
3905
+        int16_t w       = window[i];
3906
+        output[i]       = (MUL16(input[i],       w) + (1 << 14)) >> 15;
3907
+        output[len-i-1] = (MUL16(input[len-i-1], w) + (1 << 14)) >> 15;
3908
+    }
3909
+}
3910
+
3898 3911
 #define W0 2048
3899 3912
 #define W1 2841 /* 2048*sqrt (2)*cos (1*pi/16) */
3900 3913
 #define W2 2676 /* 2048*sqrt (2)*cos (2*pi/16) */
... ...
@@ -4369,6 +4382,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
4369 4369
     c->vector_clipf = vector_clipf_c;
4370 4370
     c->scalarproduct_int16 = scalarproduct_int16_c;
4371 4371
     c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c;
4372
+    c->apply_window_int16 = apply_window_int16_c;
4372 4373
     c->scalarproduct_float = scalarproduct_float_c;
4373 4374
     c->butterflies_float = butterflies_float_c;
4374 4375
     c->vector_fmul_scalar = vector_fmul_scalar_c;
... ...
@@ -526,6 +526,20 @@ typedef struct DSPContext {
526 526
      */
527 527
     int32_t (*scalarproduct_and_madd_int16)(int16_t *v1/*align 16*/, const int16_t *v2, const int16_t *v3, int len, int mul);
528 528
 
529
+    /**
530
+     * Apply symmetric window in 16-bit fixed-point.
531
+     * @param output destination array
532
+     *               constraints: 16-byte aligned
533
+     * @param input  source array
534
+     *               constraints: 16-byte aligned
535
+     * @param window window array
536
+     *               constraints: 16-byte aligned, at least len/2 elements
537
+     * @param len    full window length
538
+     *               constraints: multiple of ? greater than zero
539
+     */
540
+    void (*apply_window_int16)(int16_t *output, const int16_t *input,
541
+                               const int16_t *window, unsigned int len);
542
+
529 543
     /* rv30 functions */
530 544
     qpel_mc_func put_rv30_tpel_pixels_tab[4][16];
531 545
     qpel_mc_func avg_rv30_tpel_pixels_tab[4][16];
532 546
new file mode 100644
... ...
@@ -0,0 +1,75 @@
0
+/*
1
+ *
2
+ * This file is part of FFmpeg.
3
+ *
4
+ * FFmpeg is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU Lesser General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 2.1 of the License, or (at your option) any later version.
8
+ *
9
+ * FFmpeg is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * Lesser General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Lesser General Public
15
+ * License along with FFmpeg; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ */
18
+
19
+#ifndef AVCODEC_VERSION_H
20
+#define AVCODEC_VERSION_H
21
+
22
+#define LIBAVCODEC_VERSION_MAJOR 52
23
+#define LIBAVCODEC_VERSION_MINOR 114
24
+#define LIBAVCODEC_VERSION_MICRO  0
25
+
26
+#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
27
+                                               LIBAVCODEC_VERSION_MINOR, \
28
+                                               LIBAVCODEC_VERSION_MICRO)
29
+#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
30
+                                           LIBAVCODEC_VERSION_MINOR,    \
31
+                                           LIBAVCODEC_VERSION_MICRO)
32
+#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
33
+
34
+#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
35
+
36
+/**
37
+ * Those FF_API_* defines are not part of public API.
38
+ * They may change, break or disappear at any time.
39
+ */
40
+#ifndef FF_API_PALETTE_CONTROL
41
+#define FF_API_PALETTE_CONTROL  (LIBAVCODEC_VERSION_MAJOR < 54)
42
+#endif
43
+#ifndef FF_API_MM_FLAGS
44
+#define FF_API_MM_FLAGS         (LIBAVCODEC_VERSION_MAJOR < 53)
45
+#endif
46
+#ifndef FF_API_OPT_SHOW
47
+#define FF_API_OPT_SHOW         (LIBAVCODEC_VERSION_MAJOR < 53)
48
+#endif
49
+#ifndef FF_API_AUDIO_OLD
50
+#define FF_API_AUDIO_OLD        (LIBAVCODEC_VERSION_MAJOR < 53)
51
+#endif
52
+#ifndef FF_API_VIDEO_OLD
53
+#define FF_API_VIDEO_OLD        (LIBAVCODEC_VERSION_MAJOR < 53)
54
+#endif
55
+#ifndef FF_API_SUBTITLE_OLD
56
+#define FF_API_SUBTITLE_OLD     (LIBAVCODEC_VERSION_MAJOR < 53)
57
+#endif
58
+#ifndef FF_API_USE_LPC
59
+#define FF_API_USE_LPC          (LIBAVCODEC_VERSION_MAJOR < 53)
60
+#endif
61
+#ifndef FF_API_SET_STRING_OLD
62
+#define FF_API_SET_STRING_OLD   (LIBAVCODEC_VERSION_MAJOR < 53)
63
+#endif
64
+#ifndef FF_API_INOFFICIAL
65
+#define FF_API_INOFFICIAL       (LIBAVCODEC_VERSION_MAJOR < 53)
66
+#endif
67
+#ifndef FF_API_OLD_SAMPLE_FMT
68
+#define FF_API_OLD_SAMPLE_FMT   (LIBAVCODEC_VERSION_MAJOR < 53)
69
+#endif
70
+#ifndef FF_API_OLD_AUDIOCONVERT
71
+#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 53)
72
+#endif
73
+
74
+#endif /* AVCODEC_VERSION_H */
... ...
@@ -2393,6 +2393,20 @@ int32_t ff_scalarproduct_int16_sse2(const int16_t *v1, const int16_t *v2, int or
2393 2393
 int32_t ff_scalarproduct_and_madd_int16_mmx2(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul);
2394 2394
 int32_t ff_scalarproduct_and_madd_int16_sse2(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul);
2395 2395
 int32_t ff_scalarproduct_and_madd_int16_ssse3(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul);
2396
+
2397
+void ff_apply_window_int16_mmxext    (int16_t *output, const int16_t *input,
2398
+                                      const int16_t *window, unsigned int len);
2399
+void ff_apply_window_int16_mmxext_ba (int16_t *output, const int16_t *input,
2400
+                                      const int16_t *window, unsigned int len);
2401
+void ff_apply_window_int16_sse2      (int16_t *output, const int16_t *input,
2402
+                                      const int16_t *window, unsigned int len);
2403
+void ff_apply_window_int16_sse2_ba   (int16_t *output, const int16_t *input,
2404
+                                      const int16_t *window, unsigned int len);
2405
+void ff_apply_window_int16_ssse3     (int16_t *output, const int16_t *input,
2406
+                                      const int16_t *window, unsigned int len);
2407
+void ff_apply_window_int16_ssse3_atom(int16_t *output, const int16_t *input,
2408
+                                      const int16_t *window, unsigned int len);
2409
+
2396 2410
 void ff_add_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top);
2397 2411
 int  ff_add_hfyu_left_prediction_ssse3(uint8_t *dst, const uint8_t *src, int w, int left);
2398 2412
 int  ff_add_hfyu_left_prediction_sse4(uint8_t *dst, const uint8_t *src, int w, int left);
... ...
@@ -2754,6 +2768,11 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
2754 2754
 #if HAVE_YASM
2755 2755
             c->scalarproduct_int16 = ff_scalarproduct_int16_mmx2;
2756 2756
             c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_mmx2;
2757
+            if (avctx->flags & CODEC_FLAG_BITEXACT) {
2758
+                c->apply_window_int16 = ff_apply_window_int16_mmxext_ba;
2759
+            } else {
2760
+                c->apply_window_int16 = ff_apply_window_int16_mmxext;
2761
+            }
2757 2762
 #endif
2758 2763
         }
2759 2764
         if(mm_flags & AV_CPU_FLAG_SSE){
... ...
@@ -2776,13 +2795,30 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
2776 2776
 #if HAVE_YASM
2777 2777
             c->scalarproduct_int16 = ff_scalarproduct_int16_sse2;
2778 2778
             c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_sse2;
2779
+            if (avctx->flags & CODEC_FLAG_BITEXACT) {
2780
+                c->apply_window_int16 = ff_apply_window_int16_sse2_ba;
2781
+            } else {
2782
+                if (!(mm_flags & AV_CPU_FLAG_SSE2SLOW)) {
2783
+                    c->apply_window_int16 = ff_apply_window_int16_sse2;
2784
+                }
2785
+            }
2779 2786
 
2780 2787
             c->emulated_edge_mc = emulated_edge_mc_sse;
2781 2788
             c->gmc= gmc_sse;
2782 2789
 #endif
2783 2790
         }
2784
-        if((mm_flags & AV_CPU_FLAG_SSSE3) && !(mm_flags & (AV_CPU_FLAG_SSE42|AV_CPU_FLAG_3DNOW)) && HAVE_YASM) // cachesplit
2785
-            c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3;
2791
+        if (mm_flags & AV_CPU_FLAG_SSSE3) {
2792
+#if HAVE_YASM
2793
+            if (mm_flags & AV_CPU_FLAG_ATOM) {
2794
+                c->apply_window_int16 = ff_apply_window_int16_ssse3_atom;
2795
+            } else {
2796
+                c->apply_window_int16 = ff_apply_window_int16_ssse3;
2797
+            }
2798
+            if (!(mm_flags & (AV_CPU_FLAG_SSE42|AV_CPU_FLAG_3DNOW))) { // cachesplit
2799
+                c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3;
2800
+            }
2801
+#endif
2802
+        }
2786 2803
     }
2787 2804
 
2788 2805
     if (CONFIG_ENCODERS)
... ...
@@ -27,6 +27,8 @@ pb_zzzzzzzz77777777: times 8 db -1
27 27
 pb_7: times 8 db 7
28 28
 pb_zzzz3333zzzzbbbb: db -1,-1,-1,-1,3,3,3,3,-1,-1,-1,-1,11,11,11,11
29 29
 pb_zz11zz55zz99zzdd: db -1,-1,1,1,-1,-1,5,5,-1,-1,9,9,-1,-1,13,13
30
+pb_revwords: db 14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1
31
+pd_16384: times 4 dd 16384
30 32
 
31 33
 section .text align=16
32 34
 
... ...
@@ -202,6 +204,130 @@ SCALARPRODUCT_LOOP 0
202 202
     RET
203 203
 
204 204
 
205
+;-----------------------------------------------------------------------------
206
+; void ff_apply_window_int16(int16_t *output, const int16_t *input,
207
+;                            const int16_t *window, unsigned int len)
208
+;-----------------------------------------------------------------------------
209
+
210
+%macro REVERSE_WORDS_MMXEXT 1-2
211
+    pshufw   %1, %1, 0x1B
212
+%endmacro
213
+
214
+%macro REVERSE_WORDS_SSE2 1-2
215
+    pshuflw  %1, %1, 0x1B
216
+    pshufhw  %1, %1, 0x1B
217
+    pshufd   %1, %1, 0x4E
218
+%endmacro
219
+
220
+%macro REVERSE_WORDS_SSSE3 2
221
+    pshufb  %1, %2
222
+%endmacro
223
+
224
+; dst = (dst * src) >> 15
225
+; pmulhw cuts off the bottom bit, so we have to lshift by 1 and add it back
226
+; in from the pmullw result.
227
+%macro MUL16FIXED_MMXEXT 3 ; dst, src, temp
228
+    mova    %3, %1
229
+    pmulhw  %1, %2
230
+    pmullw  %3, %2
231
+    psrlw   %3, 15
232
+    psllw   %1, 1
233
+    por     %1, %3
234
+%endmacro
235
+
236
+; dst = ((dst * src) + (1<<14)) >> 15
237
+%macro MUL16FIXED_SSSE3 3 ; dst, src, unused
238
+    pmulhrsw   %1, %2
239
+%endmacro
240
+
241
+%macro APPLY_WINDOW_INT16 3 ; %1=instruction set, %2=mmxext/sse2 bit exact version, %3=has_ssse3
242
+cglobal apply_window_int16_%1, 4,5,6, output, input, window, offset, offset2
243
+    lea     offset2q, [offsetq-mmsize]
244
+%if %2
245
+    mova          m5, [pd_16384]
246
+%elifidn %1, ssse3
247
+    mova          m5, [pb_revwords]
248
+    ALIGN 16
249
+%endif
250
+.loop:
251
+%if %2
252
+    ; This version expands 16-bit to 32-bit, multiplies by the window,
253
+    ; adds 16384 for rounding, right shifts 15, then repacks back to words to
254
+    ; save to the output. The window is reversed for the second half.
255
+    mova          m3, [windowq+offset2q]
256
+    mova          m4, [ inputq+offset2q]
257
+    pxor          m0, m0
258
+    punpcklwd     m0, m3
259
+    punpcklwd     m1, m4
260
+    pmaddwd       m0, m1
261
+    paddd         m0, m5
262
+    psrad         m0, 15
263
+    pxor          m2, m2
264
+    punpckhwd     m2, m3
265
+    punpckhwd     m1, m4
266
+    pmaddwd       m2, m1
267
+    paddd         m2, m5
268
+    psrad         m2, 15
269
+    packssdw      m0, m2
270
+    mova  [outputq+offset2q], m0
271
+    REVERSE_WORDS m3
272
+    mova          m4, [ inputq+offsetq]
273
+    pxor          m0, m0
274
+    punpcklwd     m0, m3
275
+    punpcklwd     m1, m4
276
+    pmaddwd       m0, m1
277
+    paddd         m0, m5
278
+    psrad         m0, 15
279
+    pxor          m2, m2
280
+    punpckhwd     m2, m3
281
+    punpckhwd     m1, m4
282
+    pmaddwd       m2, m1
283
+    paddd         m2, m5
284
+    psrad         m2, 15
285
+    packssdw      m0, m2
286
+    mova  [outputq+offsetq], m0
287
+%elif %3
288
+    ; This version does the 16x16->16 multiplication in-place without expanding
289
+    ; to 32-bit. The ssse3 version is bit-identical.
290
+    mova          m0, [windowq+offset2q]
291
+    mova          m1, [ inputq+offset2q]
292
+    pmulhrsw      m1, m0
293
+    REVERSE_WORDS m0, m5
294
+    pmulhrsw      m0, [ inputq+offsetq ]
295
+    mova  [outputq+offset2q], m1
296
+    mova  [outputq+offsetq ], m0
297
+%else
298
+    ; This version does the 16x16->16 multiplication in-place without expanding
299
+    ; to 32-bit. The mmxext and sse2 versions do not use rounding, and
300
+    ; therefore are not bit-identical to the C version.
301
+    mova          m0, [windowq+offset2q]
302
+    mova          m1, [ inputq+offset2q]
303
+    mova          m2, [ inputq+offsetq ]
304
+    MUL16FIXED    m1, m0, m3
305
+    REVERSE_WORDS m0
306
+    MUL16FIXED    m2, m0, m3
307
+    mova  [outputq+offset2q], m1
308
+    mova  [outputq+offsetq ], m2
309
+%endif
310
+    add      offsetd, mmsize
311
+    sub     offset2d, mmsize
312
+    jae .loop
313
+    REP_RET
314
+%endmacro
315
+
316
+INIT_MMX
317
+%define REVERSE_WORDS REVERSE_WORDS_MMXEXT
318
+%define MUL16FIXED MUL16FIXED_MMXEXT
319
+APPLY_WINDOW_INT16 mmxext,     0, 0
320
+APPLY_WINDOW_INT16 mmxext_ba,  1, 0
321
+INIT_XMM
322
+%define REVERSE_WORDS REVERSE_WORDS_SSE2
323
+APPLY_WINDOW_INT16 sse2,       0, 0
324
+APPLY_WINDOW_INT16 sse2_ba,    1, 0
325
+APPLY_WINDOW_INT16 ssse3_atom, 0, 1
326
+%define REVERSE_WORDS REVERSE_WORDS_SSSE3
327
+APPLY_WINDOW_INT16 ssse3,      0, 1
328
+
205 329
 
206 330
 ; void add_hfyu_median_prediction_mmx2(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top)
207 331
 cglobal add_hfyu_median_prediction_mmx2, 6,6,0, dst, top, diff, w, left, left_top
... ...
@@ -1217,10 +1217,10 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
1217 1217
             int pktnum=avio_rl32(s->pb);
1218 1218
             int pktct =avio_rl16(s->pb);
1219 1219
             int64_t pos      = s->data_offset + s->packet_size*(int64_t)pktnum;
1220
-            int64_t index_pts= av_rescale(itime, i, 10000);
1220
+            int64_t index_pts= FFMAX(av_rescale(itime, i, 10000) - asf->hdr.preroll, 0);
1221 1221
 
1222 1222
             if(pos != last_pos){
1223
-            av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d\n", pktnum, pktct);
1223
+            av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d  pts: %"PRId64"\n", pktnum, pktct, index_pts);
1224 1224
             av_add_index_entry(s->streams[stream_index], pos, index_pts, s->packet_size, 0, AVINDEX_KEYFRAME);
1225 1225
             last_pos=pos;
1226 1226
             }
... ...
@@ -416,7 +416,7 @@ attribute_deprecated void         put_tag(AVIOContext *s, const char *tag);
416 416
  */
417 417
 
418 418
 attribute_deprecated int     av_url_read_fpause(AVIOContext *h,    int pause);
419
-attribute_deprecated int64_t av_url_read_fseek( AVIOContext *h,    int stream_index,
419
+attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h,    int stream_index,
420 420
                                                 int64_t timestamp, int flags);
421 421
 
422 422
 /**
... ...
@@ -444,6 +444,9 @@ attribute_deprecated void put_flush_packet(AVIOContext *s);
444 444
  */
445 445
 
446 446
 attribute_deprecated int url_ferror(AVIOContext *s);
447
+
448
+attribute_deprecated int udp_set_remote_url(URLContext *h, const char *uri);
449
+attribute_deprecated int udp_get_local_port(URLContext *h);
447 450
 #endif
448 451
 
449 452
 AVIOContext *avio_alloc_context(
... ...
@@ -674,9 +677,6 @@ void init_checksum(AVIOContext *s,
674 674
                    unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
675 675
                    unsigned long checksum);
676 676
 
677
-/* udp.c */
678
-int udp_set_remote_url(URLContext *h, const char *uri);
679
-int udp_get_local_port(URLContext *h);
680 677
 #if FF_API_UDP_GET_FILE
681 678
 int udp_get_file_handle(URLContext *h);
682 679
 #endif
... ...
@@ -67,8 +67,12 @@ uint64_t ffio_read_varlen(AVIOContext *bc);
67 67
 int ffio_set_buf_size(AVIOContext *s, int buf_size);
68 68
 
69 69
 int     ffio_read_pause(AVIOContext *h,    int pause);
70
-int64_t ffio_read_seek( AVIOContext *h,    int stream_index,
70
+int64_t ffio_read_seek (AVIOContext *h,    int stream_index,
71 71
                         int64_t timestamp, int flags);
72 72
 
73
+/* udp.c */
74
+int ff_udp_set_remote_url(URLContext *h, const char *uri);
75
+int ff_udp_get_local_port(URLContext *h);
76
+
73 77
 
74 78
 #endif // AVFORMAT_AVIO_INTERNAL_H
... ...
@@ -438,29 +438,15 @@ static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContex
438 438
 
439 439
 static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int *sample_rate, int *output_sample_rate)
440 440
 {
441
-    int sri;
441
+    MPEG4AudioConfig mp4ac;
442 442
 
443
-    if (codec->extradata_size < 2) {
444
-        av_log(s, AV_LOG_WARNING, "No AAC extradata, unable to determine samplerate.\n");
443
+    if (ff_mpeg4audio_get_config(&mp4ac, codec->extradata, codec->extradata_size) < 0) {
444
+        av_log(s, AV_LOG_WARNING, "Error parsing AAC extradata, unable to determine samplerate.\n");
445 445
         return;
446 446
     }
447 447
 
448
-    sri = ((codec->extradata[0] << 1) & 0xE) | (codec->extradata[1] >> 7);
449
-    if (sri > 12) {
450
-        av_log(s, AV_LOG_WARNING, "AAC samplerate index out of bounds\n");
451
-        return;
452
-    }
453
-    *sample_rate = ff_mpeg4audio_sample_rates[sri];
454
-
455
-    // if sbr, get output sample rate as well
456
-    if (codec->extradata_size == 5) {
457
-        sri = (codec->extradata[4] >> 3) & 0xF;
458
-        if (sri > 12) {
459
-            av_log(s, AV_LOG_WARNING, "AAC output samplerate index out of bounds\n");
460
-            return;
461
-        }
462
-        *output_sample_rate = ff_mpeg4audio_sample_rates[sri];
463
-    }
448
+    *sample_rate        = mp4ac.sample_rate;
449
+    *output_sample_rate = mp4ac.ext_sample_rate;
464 450
 }
465 451
 
466 452
 static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int native_id, int qt_id)
... ...
@@ -27,6 +27,7 @@
27 27
 #include "libavutil/parseutils.h"
28 28
 #include "libavutil/avstring.h"
29 29
 #include "avformat.h"
30
+#include "avio_internal.h"
30 31
 #include "rtpdec.h"
31 32
 
32 33
 #include <unistd.h>
... ...
@@ -71,10 +72,10 @@ int rtp_set_remote_url(URLContext *h, const char *uri)
71 71
                  path, sizeof(path), uri);
72 72
 
73 73
     ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, port, "%s", path);
74
-    udp_set_remote_url(s->rtp_hd, buf);
74
+    ff_udp_set_remote_url(s->rtp_hd, buf);
75 75
 
76 76
     ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, port + 1, "%s", path);
77
-    udp_set_remote_url(s->rtcp_hd, buf);
77
+    ff_udp_set_remote_url(s->rtcp_hd, buf);
78 78
     return 0;
79 79
 }
80 80
 
... ...
@@ -191,7 +192,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
191 191
     if (url_open(&s->rtp_hd, buf, flags) < 0)
192 192
         goto fail;
193 193
     if (local_rtp_port>=0 && local_rtcp_port<0)
194
-        local_rtcp_port = udp_get_local_port(s->rtp_hd) + 1;
194
+        local_rtcp_port = ff_udp_get_local_port(s->rtp_hd) + 1;
195 195
 
196 196
     build_udp_url(buf, sizeof(buf),
197 197
                   hostname, rtcp_port, local_rtcp_port, ttl, max_packet_size,
... ...
@@ -326,7 +327,7 @@ static int rtp_close(URLContext *h)
326 326
 int rtp_get_local_rtp_port(URLContext *h)
327 327
 {
328 328
     RTPContext *s = h->priv_data;
329
-    return udp_get_local_port(s->rtp_hd);
329
+    return ff_udp_get_local_port(s->rtp_hd);
330 330
 }
331 331
 
332 332
 /**
... ...
@@ -338,7 +339,7 @@ int rtp_get_local_rtp_port(URLContext *h)
338 338
 int rtp_get_local_rtcp_port(URLContext *h)
339 339
 {
340 340
     RTPContext *s = h->priv_data;
341
-    return udp_get_local_port(s->rtcp_hd);
341
+    return ff_udp_get_local_port(s->rtcp_hd);
342 342
 }
343 343
 
344 344
 static int rtp_get_file_handle(URLContext *h)
... ...
@@ -59,14 +59,10 @@ static int rtsp_read_play(AVFormatContext *s)
59 59
         if (rt->state == RTSP_STATE_PAUSED) {
60 60
             cmd[0] = 0;
61 61
         } else {
62
-            if (!rt->seek_timestamp) {
63
-                snprintf(cmd, sizeof(cmd), "Range: npt=0.000-\r\n");
64
-            } else {
65
-                snprintf(cmd, sizeof(cmd),
66
-                         "Range: npt=%"PRId64".%03"PRId64"-\r\n",
67
-                         rt->seek_timestamp / AV_TIME_BASE,
68
-                         rt->seek_timestamp / (AV_TIME_BASE / 1000) % 1000);
69
-            }
62
+            snprintf(cmd, sizeof(cmd),
63
+                     "Range: npt=%"PRId64".%03"PRId64"-\r\n",
64
+                     rt->seek_timestamp / AV_TIME_BASE,
65
+                     rt->seek_timestamp / (AV_TIME_BASE / 1000) % 1000);
70 66
         }
71 67
         ff_rtsp_send_cmd(s, "PLAY", rt->control_uri, cmd, reply, NULL);
72 68
         if (reply->status_code != RTSP_STATUS_OK) {
... ...
@@ -103,8 +103,7 @@ static int rtsp_write_record(AVFormatContext *s)
103 103
     char cmd[1024];
104 104
 
105 105
     snprintf(cmd, sizeof(cmd),
106
-             "Range: npt=%0.3f-\r\n",
107
-             (double) 0);
106
+             "Range: npt=0.000-\r\n");
108 107
     ff_rtsp_send_cmd(s, "RECORD", rt->control_uri, cmd, reply, NULL);
109 108
     if (reply->status_code != RTSP_STATUS_OK)
110 109
         return -1;
... ...
@@ -27,6 +27,7 @@
27 27
 #define _BSD_SOURCE     /* Needed for using struct ip_mreq with recent glibc */
28 28
 #define _DARWIN_C_SOURCE /* Needed for using IP_MULTICAST_TTL on OS X */
29 29
 #include "avformat.h"
30
+#include "avio_internal.h"
30 31
 #include "libavutil/parseutils.h"
31 32
 #include <unistd.h>
32 33
 #include "internal.h"
... ...
@@ -243,7 +244,7 @@ static int udp_port(struct sockaddr_storage *addr, int addr_len)
243 243
  * @param uri of the remote server
244 244
  * @return zero if no error.
245 245
  */
246
-int udp_set_remote_url(URLContext *h, const char *uri)
246
+int ff_udp_set_remote_url(URLContext *h, const char *uri)
247 247
 {
248 248
     UDPContext *s = h->priv_data;
249 249
     char hostname[256], buf[10];
... ...
@@ -282,7 +283,7 @@ int udp_set_remote_url(URLContext *h, const char *uri)
282 282
  * @param h media file context
283 283
  * @return the local port number
284 284
  */
285
-int udp_get_local_port(URLContext *h)
285
+int ff_udp_get_local_port(URLContext *h)
286 286
 {
287 287
     UDPContext *s = h->priv_data;
288 288
     return s->local_port;
... ...
@@ -365,7 +366,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
365 365
         if (flags & URL_WRONLY)
366 366
             goto fail;
367 367
     } else {
368
-        if (udp_set_remote_url(h, uri) < 0)
368
+        if (ff_udp_set_remote_url(h, uri) < 0)
369 369
             goto fail;
370 370
     }
371 371
 
... ...
@@ -65,7 +65,7 @@
65 65
 #endif
66 66
 
67 67
 #ifndef av_cold
68
-#if (!defined(__INTEL_COMPILER) || __INTEL_COMPILER > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
68
+#if AV_GCC_VERSION_AT_LEAST(4,3)
69 69
 #    define av_cold __attribute__((cold))
70 70
 #else
71 71
 #    define av_cold
... ...
@@ -73,7 +73,7 @@
73 73
 #endif
74 74
 
75 75
 #ifndef av_flatten
76
-#if (!defined(__INTEL_COMPILER) || __INTEL_COMPILER > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
76
+#if AV_GCC_VERSION_AT_LEAST(4,1)
77 77
 #    define av_flatten __attribute__((flatten))
78 78
 #else
79 79
 #    define av_flatten
... ...
@@ -110,7 +110,7 @@
110 110
 #endif
111 111
 
112 112
 #ifndef av_alias
113
-#if (!defined(__INTEL_COMPILER) || __INTEL_COMPILER > 1200) && AV_GCC_VERSION_AT_LEAST(3,3)
113
+#if AV_GCC_VERSION_AT_LEAST(3,3)
114 114
 #   define av_alias __attribute__((may_alias))
115 115
 #else
116 116
 #   define av_alias
... ...
@@ -39,7 +39,7 @@
39 39
 #include "timer.h"
40 40
 
41 41
 #ifndef attribute_align_arg
42
-#if ARCH_X86_32 && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER > 1200) && AV_GCC_VERSION_AT_LEAST(4,2)
42
+#if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2)
43 43
 #    define attribute_align_arg __attribute__((force_align_arg_pointer))
44 44
 #else
45 45
 #    define attribute_align_arg
... ...
@@ -56,7 +56,7 @@
56 56
     #define av_malloc_attrib
57 57
 #endif
58 58
 
59
-#if (!defined(__INTEL_COMPILER) || __INTEL_COMPILER > 1200) && AV_GCC_VERSION_AT_LEAST(4,3)
59
+#if AV_GCC_VERSION_AT_LEAST(4,3)
60 60
     #define av_alloc_size(n) __attribute__((alloc_size(n)))
61 61
 #else
62 62
     #define av_alloc_size(n)
... ...
@@ -15,6 +15,7 @@ command=$5
15 15
 cmp=${6:-diff}
16 16
 ref=${7:-"${base}/ref/fate/${test}"}
17 17
 fuzz=$8
18
+threads=${9:-1}
18 19
 
19 20
 outdir="tests/data/fate"
20 21
 outfile="${outdir}/${test}"
... ...
@@ -48,7 +49,7 @@ run(){
48 48
 }
49 49
 
50 50
 ffmpeg(){
51
-    run ffmpeg -v 0 "$@"
51
+    run ffmpeg -v 0 -threads $threads "$@"
52 52
 }
53 53
 
54 54
 framecrc(){
... ...
@@ -77,7 +78,7 @@ regtest(){
77 77
     cleanfiles="$cleanfiles $outfile $errfile"
78 78
     outfile=tests/data/regression/$2/$t
79 79
     errfile=tests/data/$t.$2.err
80
-    ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path"
80
+    ${base}/${1}-regression.sh $t $2 $3 "$target_exec" "$target_path" "$threads"
81 81
 }
82 82
 
83 83
 codectest(){
... ...
@@ -1,2 +1,2 @@
1
-b3a8f0a8809a58b2ece90744f06fff96 *./tests/data/acodec/ac3.rm
1
+346073c97eada69330f61e103a170ca1 *./tests/data/acodec/ac3.rm
2 2
 98751 ./tests/data/acodec/ac3.rm
... ...
@@ -1,2 +1,2 @@
1
-7da378131db880bcf2e58305d54418ec *./tests/data/lavf/lavf.rm
1
+7b7ede9548a09346675edad36acfbf19 *./tests/data/lavf/lavf.rm
2 2
 346706 ./tests/data/lavf/lavf.rm
... ...
@@ -1,45 +1,35 @@
1 1
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
2 2
 ret: 0         st:-1 flags:0  ts:-1.000000
3 3
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
4
-ret: 0         st:-1 flags:1  ts: 1.894167
5
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
6
-ret: 0         st: 0 flags:0  ts: 0.788000
7
-ret: 0         st: 0 flags:1 dts:12581.487000 pts:12581.487000 pos:   5822 size:   916
4
+ret:-1         st:-1 flags:1  ts: 1.894167
5
+ret:-1         st: 0 flags:0  ts: 0.788000
8 6
 ret: 0         st: 0 flags:1  ts:-0.317000
9 7
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
10
-ret: 0         st:-1 flags:0  ts: 2.576668
11
-ret: 0         st: 0 flags:1 dts:524.800000 pts:524.800000 pos:   6155 size:   244
8
+ret:-1         st:-1 flags:0  ts: 2.576668
12 9
 ret:-1         st:-1 flags:1  ts: 1.470835
13
-ret: 0         st: 0 flags:0  ts: 0.365000
14
-ret: 0         st: 0 flags:1 dts:12581.487000 pts:12581.487000 pos:   5822 size:   916
10
+ret:-1         st: 0 flags:0  ts: 0.365000
15 11
 ret: 0         st: 0 flags:1  ts:-0.741000
16 12
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
17 13
 ret:-1         st:-1 flags:0  ts: 2.153336
18
-ret: 0         st:-1 flags:1  ts: 1.047503
19
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
14
+ret:-1         st:-1 flags:1  ts: 1.047503
20 15
 ret: 0         st: 0 flags:0  ts:-0.058000
21 16
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
22
-ret: 0         st: 0 flags:1  ts: 2.836000
23
-ret: 0         st: 0 flags:1 dts: 2.681000 pts: 2.681000 pos:  44105 size:   558
17
+ret:-1         st: 0 flags:1  ts: 2.836000
24 18
 ret:-1         st:-1 flags:0  ts: 1.730004
25
-ret: 0         st:-1 flags:1  ts: 0.624171
26
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
19
+ret:-1         st:-1 flags:1  ts: 0.624171
27 20
 ret: 0         st: 0 flags:0  ts:-0.482000
28 21
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
29 22
 ret:-1         st: 0 flags:1  ts: 2.413000
30 23
 ret:-1         st:-1 flags:0  ts: 1.306672
31
-ret: 0         st:-1 flags:1  ts: 0.200839
32
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
24
+ret:-1         st:-1 flags:1  ts: 0.200839
33 25
 ret: 0         st: 0 flags:0  ts:-0.905000
34 26
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
35 27
 ret:-1         st: 0 flags:1  ts: 1.989000
36
-ret: 0         st:-1 flags:0  ts: 0.883340
37
-ret: 0         st: 0 flags:1 dts:12581.487000 pts:12581.487000 pos:   5822 size:   916
28
+ret:-1         st:-1 flags:0  ts: 0.883340
38 29
 ret: 0         st:-1 flags:1  ts:-0.222493
39 30
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
40 31
 ret:-1         st: 0 flags:0  ts: 2.672000
41 32
 ret:-1         st: 0 flags:1  ts: 1.566000
42
-ret: 0         st:-1 flags:0  ts: 0.460008
43
-ret: 0         st: 0 flags:1 dts:12581.487000 pts:12581.487000 pos:   5822 size:   916
33
+ret:-1         st:-1 flags:0  ts: 0.460008
44 34
 ret: 0         st:-1 flags:1  ts:-0.645825
45 35
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:    271 size:   556
... ...
@@ -9,6 +9,7 @@ test_ref=$2
9 9
 raw_src_dir=$3
10 10
 target_exec=$4
11 11
 target_path=$5
12
+threads=${6:-1}
12 13
 
13 14
 datadir="./tests/data"
14 15
 target_datadir="${target_path}/${datadir}"
... ...
@@ -52,7 +53,7 @@ echov(){
52 52
 
53 53
 . $(dirname $0)/md5.sh
54 54
 
55
-FFMPEG_OPTS="-v 0 -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
55
+FFMPEG_OPTS="-v 0 -threads $threads -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
56 56
 
57 57
 run_ffmpeg()
58 58
 {
... ...
@@ -65,8 +66,7 @@ do_ffmpeg()
65 65
     f="$1"
66 66
     shift
67 67
     set -- $* ${target_path}/$f
68
-    $echov $ffmpeg $FFMPEG_OPTS $*
69
-    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
68
+    run_ffmpeg -benchmark $* > $bench
70 69
     do_md5sum $f >> $logfile
71 70
     if [ $f = $raw_dst ] ; then
72 71
         $tiny_psnr $f $raw_ref >> $logfile
... ...
@@ -84,8 +84,7 @@ do_ffmpeg_nomd5()
84 84
     f="$1"
85 85
     shift
86 86
     set -- $* ${target_path}/$f
87
-    $echov $ffmpeg $FFMPEG_OPTS $*
88
-    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
87
+    run_ffmpeg -benchmark $* > $bench
89 88
     if [ $f = $raw_dst ] ; then
90 89
         $tiny_psnr $f $raw_ref >> $logfile
91 90
     elif [ $f = $pcm_dst ] ; then
... ...
@@ -101,8 +100,7 @@ do_ffmpeg_crc()
101 101
 {
102 102
     f="$1"
103 103
     shift
104
-    $echov $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
105
-    $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
104
+    run_ffmpeg $* -f crc "$target_crcfile"
106 105
     echo "$f $(cat $crcfile)" >> $logfile
107 106
 }
108 107
 
... ...
@@ -110,8 +108,7 @@ do_ffmpeg_nocheck()
110 110
 {
111 111
     f="$1"
112 112
     shift
113
-    $echov $ffmpeg $FFMPEG_OPTS $*
114
-    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench
113
+    run_ffmpeg -benchmark $* > $bench
115 114
     expr "$(cat $bench)" : '.*utime=\(.*s\)' > $bench2
116 115
     echo $(cat $bench2) $f >> $benchfile
117 116
 }