* qatar/master: (23 commits) ac3enc: correct the flipped sign in the ac3_fixed encoder Eliminate pointless '#if 1' statements without matching '#else'. Add AVX FFT implementation. Increase alignment of av_malloc() as needed by AVX ASM. Update x86inc.asm from x264 to allow AVX emulation using SSE and MMX. mjpeg: Detect overreads in mjpeg_decode_scan() and error out. documentation: extend documentation for ffmpeg -aspect option APIChanges: update commit hashes for recent additions. lavc: deprecate FF_*_TYPE macros in favor of AV_PICTURE_TYPE_* enums aac: add headers needed for log2f() lavc: remove FF_API_MB_Q cruft lavc: remove FF_API_RATE_EMU cruft lavc: remove FF_API_HURRY_UP cruft pad: make the filter parametric vsrc_movie: add key_frame and pict_type. vsrc_movie: fix leak in request_frame() lavfi: add key_frame and pict_type to AVFilterBufferRefVideo. vsrc_buffer: add sample_aspect_ratio fields to arguments. lavfi: add fieldorder filter scale: make the filter parametric ... Conflicts: Changelog doc/filters.texi ffmpeg.c libavcodec/ac3dec.h libavcodec/dsputil.c libavfilter/avfilter.h libavfilter/vf_scale.c libavfilter/vf_yadif.c libavfilter/vsrc_buffer.c
Unified · Split
| @@ -10,7 +10,7 @@ version <next>: · 9 unmodified lines | ||
| 10 | 10 | - libxvid aspect pickiness fixed |
| 11 | 11 | - Frame multithreaded decoding |
| 12 | 12 | - Lots of deprecated API cruft removed |
| 13 | − | |
| 13 | +- fft and imdct optimizations for AVX (Sandy Bridge) processors | |
| 14 | 14 | |
| 15 | 15 | version 0.7_beta1: |
| 16 | 16 | |
| @@ -13,6 +13,17 @@ libavutil: 2011-04-18 · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2011-04-XX - bebe72f - lavu 51.1.0 - avutil.h | |
| 17 | + Add AVPictureType enum and av_get_picture_type_char(), deprecate | |
| 18 | + FF_*_TYPE defines and av_get_pict_type_char() defined in | |
| 19 | + libavcodec/avcodec.h. | |
| 20 | + | |
| 21 | +2011-04-xx - 10d3940 - lavfi 2.3.0 - avfilter.h | |
| 22 | + Add pict_type and key_frame fields to AVFilterBufferRefVideo. | |
| 23 | + | |
| 24 | +2011-04-xx - 7a11c82 - lavfi 2.2.0 - vsrc_buffer | |
| 25 | + Add sample_aspect_ratio fields to vsrc_buffer arguments | |
| 26 | + | |
| 16 | 27 | 2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h |
| 17 | 28 | Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading. |
| 18 | 29 | |
| @@ -2908,6 +2908,10 @@ static void opt_frame_aspect_ratio(const char *arg) · 2907 unmodified lines | ||
| 2908 | 2908 | ffmpeg_exit(1); |
| 2909 | 2909 | } |
| 2910 | 2910 | frame_aspect_ratio = ar; |
| 2911 | + | |
| 2912 | + x = vfilters ? strlen(vfilters) : 0; | |
| 2913 | + vfilters = av_realloc(vfilters, x+100); | |
| 2914 | + snprintf(vfilters+x, x+100, "%csetdar=%f\n", x?',':' ', ar); | |
| 2911 | 2915 | } |
| 2912 | 2916 | |
| 2913 | 2917 | static int opt_metadata(const char *opt, const char *arg) |
| @@ -2185,10 +2185,8 @@ static int open_input_stream(HTTPContext *c, const char *info) · 2184 unmodified lines | ||
| 2185 | 2185 | } |
| 2186 | 2186 | } |
| 2187 | 2187 | |
| 2188 | −#if 1 | |
| 2189 | 2188 | if (c->fmt_in->iformat->read_seek) |
| 2190 | 2189 | av_seek_frame(c->fmt_in, -1, stream_pos, 0); |
| 2191 | −#endif | |
| 2192 | 2190 | /* set the start time (needed for maxtime and RTP packet timing) */ |
| 2193 | 2191 | c->start_time = cur_time; |
| 2194 | 2192 | c->first_pts = AV_NOPTS_VALUE; |
| @@ -223,9 +223,9 @@ typedef struct { · 222 unmodified lines | ||
| 223 | 223 | float sf[120]; ///< scalefactors |
| 224 | 224 | int sf_idx[128]; ///< scalefactor indices (used by encoder) |
| 225 | 225 | uint8_t zeroes[128]; ///< band is not coded (used by encoder) |
| 226 | − DECLARE_ALIGNED(16, float, coeffs)[1024]; ///< coefficients for IMDCT | |
| 227 | − DECLARE_ALIGNED(16, float, saved)[1024]; ///< overlap | |
| 228 | − DECLARE_ALIGNED(16, float, ret)[2048]; ///< PCM output | |
| 226 | + DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT | |
| 227 | + DECLARE_ALIGNED(32, float, saved)[1024]; ///< overlap | |
| 228 | + DECLARE_ALIGNED(32, float, ret)[2048]; ///< PCM output | |
| 229 | 229 | DECLARE_ALIGNED(16, int16_t, ltp_state)[3072]; ///< time signal for LTP |
| 230 | 230 | PredictorState predictor_state[MAX_PREDICTORS]; |
| 231 | 231 | } SingleChannelElement; |
| @@ -272,7 +272,7 @@ typedef struct { · 40 unmodified lines | ||
| 272 | 272 | * @defgroup temporary aligned temporary buffers (We do not want to have these on the stack.) |
| 273 | 273 | * @{ |
| 274 | 274 | */ |
| 275 | − DECLARE_ALIGNED(16, float, buf_mdct)[1024]; | |
| 275 | + DECLARE_ALIGNED(32, float, buf_mdct)[1024]; | |
| 276 | 276 | /** @} */ |
| 277 | 277 | |
| 278 | 278 | /** |
| @@ -296,7 +296,7 @@ typedef struct { · 17 unmodified lines | ||
| 296 | 296 | int sf_offset; ///< offset into pow2sf_tab as appropriate for dsp.float_to_int16 |
| 297 | 297 | /** @} */ |
| 298 | 298 | |
| 299 | − DECLARE_ALIGNED(16, float, temp)[128]; | |
| 299 | + DECLARE_ALIGNED(32, float, temp)[128]; | |
| 300 | 300 | |
| 301 | 301 | enum OCStatus output_configured; |
| 302 | 302 | } AACContext; |
| @@ -37,6 +37,7 @@ · 36 unmodified lines | ||
| 37 | 37 | #include "aac.h" |
| 38 | 38 | #include "aacenc.h" |
| 39 | 39 | #include "aactab.h" |
| 40 | +#include "libavutil/libm.h" | |
| 40 | 41 | |
| 41 | 42 | /** bits needed to code codebook run value for long windows */ |
| 42 | 43 | static const uint8_t run_value_bits_long[64] = { |
| @@ -64,7 +64,7 @@ typedef struct AACEncContext { · 63 unmodified lines | ||
| 64 | 64 | int last_frame; |
| 65 | 65 | float lambda; |
| 66 | 66 | DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients |
| 67 | − DECLARE_ALIGNED(16, float, scoefs)[1024]; ///< scaled coefficients | |
| 67 | + DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients | |
| 68 | 68 | } AACEncContext; |
| 69 | 69 | |
| 70 | 70 | #endif /* AVCODEC_AACENC_H */ |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | #include "aacsbrdata.h" |
| 33 | 33 | #include "fft.h" |
| 34 | 34 | #include "aacps.h" |
| 35 | +#include "libavutil/libm.h" | |
| 35 | 36 | |
| 36 | 37 | #include <stdint.h> |
| 37 | 38 | #include <float.h> |
| @@ -201,13 +201,13 @@ typedef struct { · 200 unmodified lines | ||
| 201 | 201 | ///@} |
| 202 | 202 | |
| 203 | 203 | ///@defgroup arrays aligned arrays |
| 204 | − DECLARE_ALIGNED(16, int, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< fixed-point transform coefficients | |
| 205 | − DECLARE_ALIGNED(16, float, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients | |
| 206 | − DECLARE_ALIGNED(16, float, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block | |
| 207 | − DECLARE_ALIGNED(16, float, window)[AC3_BLOCK_SIZE]; ///< window coefficients | |
| 208 | − DECLARE_ALIGNED(16, float, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing | |
| 209 | − DECLARE_ALIGNED(16, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing | |
| 210 | − DECLARE_ALIGNED(16, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread | |
| 204 | + DECLARE_ALIGNED(16, int, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///> fixed-point transform coefficients | |
| 205 | + DECLARE_ALIGNED(32, float, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients | |
| 206 | + DECLARE_ALIGNED(32, float, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block | |
| 207 | + DECLARE_ALIGNED(32, float, window)[AC3_BLOCK_SIZE]; ///< window coefficients | |
| 208 | + DECLARE_ALIGNED(32, float, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing | |
| 209 | + DECLARE_ALIGNED(32, float, output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing | |
| 210 | + DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread | |
| 211 | 211 | ///@} |
| 212 | 212 | } AC3DecodeContext; |
| 213 | 213 | |
| @@ -171,7 +171,7 @@ typedef struct AC3EncodeContext { · 170 unmodified lines | ||
| 171 | 171 | |
| 172 | 172 | uint8_t exp_strategy[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< exponent strategies |
| 173 | 173 | |
| 174 | − DECLARE_ALIGNED(16, SampleType, windowed_samples)[AC3_WINDOW_SIZE]; | |
| 174 | + DECLARE_ALIGNED(32, SampleType, windowed_samples)[AC3_WINDOW_SIZE]; | |
| 175 | 175 | } AC3EncodeContext; |
| 176 | 176 | |
| 177 | 177 | typedef struct AC3Mant { |
| @@ -47,7 +47,7 @@ static av_cold void mdct_end(AC3MDCTContext *mdct) · 46 unmodified lines | ||
| 47 | 47 | static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct, |
| 48 | 48 | int nbits) |
| 49 | 49 | { |
| 50 | − int ret = ff_mdct_init(&mdct->fft, nbits, 0, 1.0); | |
| 50 | + int ret = ff_mdct_init(&mdct->fft, nbits, 0, -1.0); | |
| 51 | 51 | mdct->window = ff_ac3_window; |
| 52 | 52 | return ret; |
| 53 | 53 | } |
| @@ -60,11 +60,11 @@ typedef struct { · 59 unmodified lines | ||
| 60 | 60 | int log2_block_count[AT1_QMF_BANDS]; ///< log2 number of blocks in a band |
| 61 | 61 | int num_bfus; ///< number of Block Floating Units |
| 62 | 62 | float* spectrum[2]; |
| 63 | − DECLARE_ALIGNED(16, float, spec1)[AT1_SU_SAMPLES]; ///< mdct buffer | |
| 64 | − DECLARE_ALIGNED(16, float, spec2)[AT1_SU_SAMPLES]; ///< mdct buffer | |
| 65 | − DECLARE_ALIGNED(16, float, fst_qmf_delay)[46]; ///< delay line for the 1st stacked QMF filter | |
| 66 | − DECLARE_ALIGNED(16, float, snd_qmf_delay)[46]; ///< delay line for the 2nd stacked QMF filter | |
| 67 | − DECLARE_ALIGNED(16, float, last_qmf_delay)[256+23]; ///< delay line for the last stacked QMF filter | |
| 63 | + DECLARE_ALIGNED(32, float, spec1)[AT1_SU_SAMPLES]; ///< mdct buffer | |
| 64 | + DECLARE_ALIGNED(32, float, spec2)[AT1_SU_SAMPLES]; ///< mdct buffer | |
| 65 | + DECLARE_ALIGNED(32, float, fst_qmf_delay)[46]; ///< delay line for the 1st stacked QMF filter | |
| 66 | + DECLARE_ALIGNED(32, float, snd_qmf_delay)[46]; ///< delay line for the 2nd stacked QMF filter | |
| 67 | + DECLARE_ALIGNED(32, float, last_qmf_delay)[256+23]; ///< delay line for the last stacked QMF filter | |
| 68 | 68 | } AT1SUCtx; |
| 69 | 69 | |
| 70 | 70 | /** |
| @@ -72,13 +72,13 @@ typedef struct { · 1 unmodified line | ||
| 72 | 72 | */ |
| 73 | 73 | typedef struct { |
| 74 | 74 | AT1SUCtx SUs[AT1_MAX_CHANNELS]; ///< channel sound unit |
| 75 | − DECLARE_ALIGNED(16, float, spec)[AT1_SU_SAMPLES]; ///< the mdct spectrum buffer | |
| 75 | + DECLARE_ALIGNED(32, float, spec)[AT1_SU_SAMPLES]; ///< the mdct spectrum buffer | |
| 76 | 76 | |
| 77 | − DECLARE_ALIGNED(16, float, low)[256]; | |
| 78 | − DECLARE_ALIGNED(16, float, mid)[256]; | |
| 79 | − DECLARE_ALIGNED(16, float, high)[512]; | |
| 77 | + DECLARE_ALIGNED(32, float, low)[256]; | |
| 78 | + DECLARE_ALIGNED(32, float, mid)[256]; | |
| 79 | + DECLARE_ALIGNED(32, float, high)[512]; | |
| 80 | 80 | float* bands[3]; |
| 81 | − DECLARE_ALIGNED(16, float, out_samples)[AT1_MAX_CHANNELS][AT1_SU_SAMPLES]; | |
| 81 | + DECLARE_ALIGNED(32, float, out_samples)[AT1_MAX_CHANNELS][AT1_SU_SAMPLES]; | |
| 82 | 82 | FFTContext mdct_ctx[3]; |
| 83 | 83 | int channels; |
| 84 | 84 | DSPContext dsp; |
| @@ -74,8 +74,8 @@ typedef struct { · 73 unmodified lines | ||
| 74 | 74 | int gcBlkSwitch; |
| 75 | 75 | gain_block gainBlock[2]; |
| 76 | 76 | |
| 77 | − DECLARE_ALIGNED(16, float, spectrum)[1024]; | |
| 78 | − DECLARE_ALIGNED(16, float, IMDCT_buf)[1024]; | |
| 77 | + DECLARE_ALIGNED(32, float, spectrum)[1024]; | |
| 78 | + DECLARE_ALIGNED(32, float, IMDCT_buf)[1024]; | |
| 79 | 79 | |
| 80 | 80 | float delayBuf1[46]; ///<qmf delay buffers |
| 81 | 81 | float delayBuf2[46]; |
| @@ -122,7 +122,7 @@ typedef struct { · 40 unmodified lines | ||
| 122 | 122 | FFTContext mdct_ctx; |
| 123 | 123 | } ATRAC3Context; |
| 124 | 124 | |
| 125 | −static DECLARE_ALIGNED(16, float,mdct_window)[512]; | |
| 125 | +static DECLARE_ALIGNED(32, float, mdct_window)[512]; | |
| 126 | 126 | static VLC spectral_coeff_tab[7]; |
| 127 | 127 | static float gain_tab1[16]; |
| 128 | 128 | static float gain_tab2[31]; |
| @@ -766,7 +766,7 @@ typedef struct AVPanScan{ · 765 unmodified lines | ||
| 766 | 766 | * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\ |
| 767 | 767 | * - decoding: Set by libavcodec.\ |
| 768 | 768 | */\ |
| 769 | − int pict_type;\ | |
| 769 | + enum AVPictureType pict_type;\ | |
| 770 | 770 | \ |
| 771 | 771 | /**\ |
| 772 | 772 | * presentation timestamp in time_base units (time when frame should be shown to user)\ |
| @@ -1016,14 +1016,16 @@ typedef struct AVPanScan{ · 243 unmodified lines | ||
| 1016 | 1016 | #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared. |
| 1017 | 1017 | #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything. |
| 1018 | 1018 | |
| 1019 | − | |
| 1020 | −#define FF_I_TYPE 1 ///< Intra | |
| 1021 | −#define FF_P_TYPE 2 ///< Predicted | |
| 1022 | −#define FF_B_TYPE 3 ///< Bi-dir predicted | |
| 1023 | −#define FF_S_TYPE 4 ///< S(GMC)-VOP MPEG4 | |
| 1024 | −#define FF_SI_TYPE 5 ///< Switching Intra | |
| 1025 | −#define FF_SP_TYPE 6 ///< Switching Predicted | |
| 1026 | −#define FF_BI_TYPE 7 | |
| 1019 | +#if FF_API_OLD_FF_PICT_TYPES | |
| 1020 | +/* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values */ | |
| 1021 | +#define FF_I_TYPE AV_PICTURE_TYPE_I ///< Intra | |
| 1022 | +#define FF_P_TYPE AV_PICTURE_TYPE_P ///< Predicted | |
| 1023 | +#define FF_B_TYPE AV_PICTURE_TYPE_B ///< Bi-dir predicted | |
| 1024 | +#define FF_S_TYPE AV_PICTURE_TYPE_S ///< S(GMC)-VOP MPEG4 | |
| 1025 | +#define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra | |
| 1026 | +#define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted | |
| 1027 | +#define FF_BI_TYPE AV_PICTURE_TYPE_BI | |
| 1028 | +#endif | |
| 1027 | 1029 | |
| 1028 | 1030 | #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore). |
| 1029 | 1031 | #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer. |
| @@ -1215,16 +1217,6 @@ typedef struct AVCodecContext { · 185 unmodified lines | ||
| 1215 | 1217 | */ |
| 1216 | 1218 | enum PixelFormat pix_fmt; |
| 1217 | 1219 | |
| 1218 | −#if FF_API_RATE_EMU | |
| 1219 | − /** | |
| 1220 | − * Frame rate emulation. If not zero, the lower layer (i.e. format handler) | |
| 1221 | − * has to read frames at native frame rate. | |
| 1222 | − * - encoding: Set by user. | |
| 1223 | − * - decoding: unused | |
| 1224 | − */ | |
| 1225 | − attribute_deprecated int rate_emu; | |
| 1226 | −#endif | |
| 1227 | − | |
| 1228 | 1220 | /** |
| 1229 | 1221 | * If non NULL, 'draw_horiz_band' is called by the libavcodec |
| 1230 | 1222 | * decoder to draw a horizontal band. It improves cache usage. Not |
| @@ -1326,16 +1318,6 @@ typedef struct AVCodecContext { · 95 unmodified lines | ||
| 1326 | 1318 | |
| 1327 | 1319 | int b_frame_strategy; |
| 1328 | 1320 | |
| 1329 | −#if FF_API_HURRY_UP | |
| 1330 | − /** | |
| 1331 | − * hurry up amount | |
| 1332 | − * - encoding: unused | |
| 1333 | − * - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header | |
| 1334 | − * @deprecated Deprecated in favor of skip_idct and skip_frame. | |
| 1335 | − */ | |
| 1336 | − attribute_deprecated int hurry_up; | |
| 1337 | −#endif | |
| 1338 | − | |
| 1339 | 1321 | struct AVCodec *codec; |
| 1340 | 1322 | |
| 1341 | 1323 | void *priv_data; |
| @@ -1800,22 +1782,6 @@ typedef struct AVCodecContext { · 458 unmodified lines | ||
| 1800 | 1782 | */ |
| 1801 | 1783 | uint64_t error[4]; |
| 1802 | 1784 | |
| 1803 | −#if FF_API_MB_Q | |
| 1804 | − /** | |
| 1805 | − * minimum MB quantizer | |
| 1806 | − * - encoding: unused | |
| 1807 | − * - decoding: unused | |
| 1808 | − */ | |
| 1809 | − attribute_deprecated int mb_qmin; | |
| 1810 | − | |
| 1811 | − /** | |
| 1812 | − * maximum MB quantizer | |
| 1813 | − * - encoding: unused | |
| 1814 | − * - decoding: unused | |
| 1815 | − */ | |
| 1816 | − attribute_deprecated int mb_qmax; | |
| 1817 | −#endif | |
| 1818 | − | |
| 1819 | 1785 | /** |
| 1820 | 1786 | * motion estimation comparison function |
| 1821 | 1787 | * - encoding: Set by user. |
| @@ -3866,13 +3832,17 @@ void avcodec_default_free_buffers(AVCodecContext *s); · 2044 unmodified lines | ||
| 3866 | 3832 | |
| 3867 | 3833 | /* misc useful functions */ |
| 3868 | 3834 | |
| 3835 | +#if FF_API_OLD_FF_PICT_TYPES | |
| 3869 | 3836 | /** |
| 3870 | 3837 | * Return a single letter to describe the given picture type pict_type. |
| 3871 | 3838 | * |
| 3872 | 3839 | * @param[in] pict_type the picture type |
| 3873 | 3840 | * @return A single character representing the picture type. |
| 3841 | + * @deprecated Use av_get_picture_type_char() instead. | |
| 3874 | 3842 | */ |
| 3843 | +attribute_deprecated | |
| 3875 | 3844 | char av_get_pict_type_char(int pict_type); |
| 3845 | +#endif | |
| 3876 | 3846 | |
| 3877 | 3847 | /** |
| 3878 | 3848 | * Return codec bits per sample. |
| @@ -55,7 +55,7 @@ typedef struct { · 54 unmodified lines | ||
| 55 | 55 | int num_bands; |
| 56 | 56 | unsigned int *bands; |
| 57 | 57 | float root; |
| 58 | − DECLARE_ALIGNED(16, FFTSample, coeffs)[BINK_BLOCK_MAX_SIZE]; | |
| 58 | + DECLARE_ALIGNED(32, FFTSample, coeffs)[BINK_BLOCK_MAX_SIZE]; | |
| 59 | 59 | DECLARE_ALIGNED(16, short, previous)[BINK_BLOCK_MAX_SIZE / 16]; ///< coeffs from previous audio block |
| 60 | 60 | float *coeffs_ptr[MAX_CHANNELS]; ///< pointers to the coeffs arrays for float_to_int16_interleave |
| 61 | 61 | union { |
| @@ -153,7 +153,7 @@ typedef struct cook { · 152 unmodified lines | ||
| 153 | 153 | /* data buffers */ |
| 154 | 154 | |
| 155 | 155 | uint8_t* decoded_bytes_buffer; |
| 156 | − DECLARE_ALIGNED(16, float,mono_mdct_output)[2048]; | |
| 156 | + DECLARE_ALIGNED(32, float, mono_mdct_output)[2048]; | |
| 157 | 157 | float decode_buffer_1[1024]; |
| 158 | 158 | float decode_buffer_2[1024]; |
| 159 | 159 | float decode_buffer_0[1060]; /* static allocation for joint decode */ |
| @@ -321,16 +321,16 @@ typedef struct { · 320 unmodified lines | ||
| 321 | 321 | |
| 322 | 322 | /* Subband samples history (for ADPCM) */ |
| 323 | 323 | float subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4]; |
| 324 | − DECLARE_ALIGNED(16, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512]; | |
| 325 | − DECLARE_ALIGNED(16, float, subband_fir_noidea)[DCA_PRIM_CHANNELS_MAX][32]; | |
| 324 | + DECLARE_ALIGNED(32, float, subband_fir_hist)[DCA_PRIM_CHANNELS_MAX][512]; | |
| 325 | + DECLARE_ALIGNED(32, float, subband_fir_noidea)[DCA_PRIM_CHANNELS_MAX][32]; | |
| 326 | 326 | int hist_index[DCA_PRIM_CHANNELS_MAX]; |
| 327 | − DECLARE_ALIGNED(16, float, raXin)[32]; | |
| 327 | + DECLARE_ALIGNED(32, float, raXin)[32]; | |
| 328 | 328 | |
| 329 | 329 | int output; ///< type of output |
| 330 | 330 | float scale_bias; ///< output scale |
| 331 | 331 | |
| 332 | − DECLARE_ALIGNED(16, float, subband_samples)[DCA_BLOCKS_MAX][DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8]; | |
| 333 | − DECLARE_ALIGNED(16, float, samples)[(DCA_PRIM_CHANNELS_MAX+1)*256]; | |
| 332 | + DECLARE_ALIGNED(32, float, subband_samples)[DCA_BLOCKS_MAX][DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8]; | |
| 333 | + DECLARE_ALIGNED(32, float, samples)[(DCA_PRIM_CHANNELS_MAX+1)*256]; | |
| 334 | 334 | const float *samples_chanptr[DCA_PRIM_CHANNELS_MAX+1]; |
| 335 | 335 | |
| 336 | 336 | uint8_t dca_buffer[DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE + DCA_BUFFER_PADDING_SIZE]; |
| @@ -312,18 +312,16 @@ static void dct_error(const char *name, int is_idct, · 311 unmodified lines | ||
| 312 | 312 | } |
| 313 | 313 | for(i=0; i<64; i++) sysErrMax= FFMAX(sysErrMax, FFABS(sysErr[i])); |
| 314 | 314 | |
| 315 | −#if 1 // dump systematic errors | |
| 316 | 315 | for(i=0; i<64; i++){ |
| 317 | 316 | if(i%8==0) printf("\n"); |
| 318 | 317 | printf("%7d ", (int)sysErr[i]); |
| 319 | 318 | } |
| 320 | 319 | printf("\n"); |
| 321 | −#endif | |
| 322 | 320 | |
| 323 | 321 | printf("%s %s: err_inf=%d err2=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n", |
| 324 | 322 | is_idct ? "IDCT" : "DCT", |
| 325 | 323 | name, err_inf, (double)err2 / NB_ITS / 64.0, (double)sysErrMax / NB_ITS, maxout, blockSumErrMax); |
| 326 | −#if 1 //Speed test | |
| 324 | + | |
| 327 | 325 | /* speed test */ |
| 328 | 326 | for(i=0;i<64;i++) |
| 329 | 327 | block1[i] = 0; |
| @@ -376,7 +374,6 @@ static void dct_error(const char *name, int is_idct, · 46 unmodified lines | ||
| 376 | 374 | printf("%s %s: %0.1f kdct/s\n", |
| 377 | 375 | is_idct ? "IDCT" : "DCT", |
| 378 | 376 | name, (double)it1 * 1000.0 / (double)ti1); |
| 379 | −#endif | |
| 380 | 377 | } |
| 381 | 378 | |
| 382 | 379 | DECLARE_ALIGNED(8, static uint8_t, img_dest)[64]; |
| @@ -786,7 +786,6 @@ void ff_er_frame_end(MpegEncContext *s){ · 785 unmodified lines | ||
| 786 | 786 | } |
| 787 | 787 | } |
| 788 | 788 | |
| 789 | −#if 1 | |
| 790 | 789 | /* handle overlapping slices */ |
| 791 | 790 | for(error_type=1; error_type<=3; error_type++){ |
| 792 | 791 | int end_ok=0; |
| @@ -807,8 +806,7 @@ void ff_er_frame_end(MpegEncContext *s){ · 14 unmodified lines | ||
| 807 | 806 | end_ok=0; |
| 808 | 807 | } |
| 809 | 808 | } |
| 810 | −#endif | |
| 811 | −#if 1 | |
| 809 | + | |
| 812 | 810 | /* handle slices with partitions of different length */ |
| 813 | 811 | if(s->partitioned_frame){ |
| 814 | 812 | int end_ok=0; |
| @@ -829,7 +827,7 @@ void ff_er_frame_end(MpegEncContext *s){ · 14 unmodified lines | ||
| 829 | 827 | end_ok=0; |
| 830 | 828 | } |
| 831 | 829 | } |
| 832 | −#endif | |
| 830 | + | |
| 833 | 831 | /* handle missing slices */ |
| 834 | 832 | if(s->error_recognition>=4){ |
| 835 | 833 | int end_ok=1; |
| @@ -853,7 +851,6 @@ void ff_er_frame_end(MpegEncContext *s){ · 17 unmodified lines | ||
| 853 | 851 | } |
| 854 | 852 | } |
| 855 | 853 | |
| 856 | −#if 1 | |
| 857 | 854 | /* backward mark errors */ |
| 858 | 855 | distance=9999999; |
| 859 | 856 | for(error_type=1; error_type<=3; error_type++){ |
| @@ -878,7 +875,6 @@ void ff_er_frame_end(MpegEncContext *s){ · 18 unmodified lines | ||
| 878 | 875 | distance= 9999999; |
| 879 | 876 | } |
| 880 | 877 | } |
| 881 | −#endif | |
| 882 | 878 | |
| 883 | 879 | /* forward mark errors */ |
| 884 | 880 | error=0; |
| @@ -893,7 +889,7 @@ void ff_er_frame_end(MpegEncContext *s){ · 8 unmodified lines | ||
| 893 | 889 | s->error_status_table[mb_xy]|= error; |
| 894 | 890 | } |
| 895 | 891 | } |
| 896 | −#if 1 | |
| 892 | + | |
| 897 | 893 | /* handle not partitioned case */ |
| 898 | 894 | if(!s->partitioned_frame){ |
| 899 | 895 | for(i=0; i<s->mb_num; i++){ |
| @@ -904,7 +900,6 @@ void ff_er_frame_end(MpegEncContext *s){ · 4 unmodified lines | ||
| 904 | 900 | s->error_status_table[mb_xy]= error; |
| 905 | 901 | } |
| 906 | 902 | } |
| 907 | −#endif | |
| 908 | 903 | |
| 909 | 904 | dc_error= ac_error= mv_error=0; |
| 910 | 905 | for(i=0; i<s->mb_num; i++){ |
| @@ -1065,16 +1060,15 @@ void ff_er_frame_end(MpegEncContext *s){ · 154 unmodified lines | ||
| 1065 | 1060 | s->dc_val[2][mb_x + mb_y*s->mb_stride]= (dcv+4)>>3; |
| 1066 | 1061 | } |
| 1067 | 1062 | } |
| 1068 | −#if 1 | |
| 1063 | + | |
| 1069 | 1064 | /* guess DC for damaged blocks */ |
| 1070 | 1065 | guess_dc(s, s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride, 1); |
| 1071 | 1066 | guess_dc(s, s->dc_val[1], s->mb_width , s->mb_height , s->mb_stride, 0); |
| 1072 | 1067 | guess_dc(s, s->dc_val[2], s->mb_width , s->mb_height , s->mb_stride, 0); |
| 1073 | −#endif | |
| 1068 | + | |
| 1074 | 1069 | /* filter luma DC */ |
| 1075 | 1070 | filter181(s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride); |
| 1076 | 1071 | |
| 1077 | −#if 1 | |
| 1078 | 1072 | /* render DC only intra */ |
| 1079 | 1073 | for(mb_y=0; mb_y<s->mb_height; mb_y++){ |
| 1080 | 1074 | for(mb_x=0; mb_x<s->mb_width; mb_x++){ |
| @@ -1094,7 +1088,6 @@ void ff_er_frame_end(MpegEncContext *s){ · 13 unmodified lines | ||
| 1094 | 1088 | put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y); |
| 1095 | 1089 | } |
| 1096 | 1090 | } |
| 1097 | −#endif | |
| 1098 | 1091 | |
| 1099 | 1092 | if(s->avctx->error_concealment&FF_EC_DEBLOCK){ |
| 1100 | 1093 | /* filter horizontal block boundaries */ |
| @@ -93,6 +93,44 @@ av_cold void ff_init_ff_cos_tabs(int index) · 92 unmodified lines | ||
| 93 | 93 | #endif |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | +static const int avx_tab[] = { | |
| 97 | + 0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15 | |
| 98 | +}; | |
| 99 | + | |
| 100 | +static int is_second_half_of_fft32(int i, int n) | |
| 101 | +{ | |
| 102 | + if (n <= 32) | |
| 103 | + return i >= 16; | |
| 104 | + else if (i < n/2) | |
| 105 | + return is_second_half_of_fft32(i, n/2); | |
| 106 | + else if (i < 3*n/4) | |
| 107 | + return is_second_half_of_fft32(i - n/2, n/4); | |
| 108 | + else | |
| 109 | + return is_second_half_of_fft32(i - 3*n/4, n/4); | |
| 110 | +} | |
| 111 | + | |
| 112 | +static av_cold void fft_perm_avx(FFTContext *s) | |
| 113 | +{ | |
| 114 | + int i; | |
| 115 | + int n = 1 << s->nbits; | |
| 116 | + | |
| 117 | + for (i = 0; i < n; i += 16) { | |
| 118 | + int k; | |
| 119 | + if (is_second_half_of_fft32(i, n)) { | |
| 120 | + for (k = 0; k < 16; k++) | |
| 121 | + s->revtab[-split_radix_permutation(i + k, n, s->inverse) & (n - 1)] = | |
| 122 | + i + avx_tab[k]; | |
| 123 | + | |
| 124 | + } else { | |
| 125 | + for (k = 0; k < 16; k++) { | |
| 126 | + int j = i + k; | |
| 127 | + j = (j & ~7) | ((j >> 1) & 3) | ((j << 2) & 4); | |
| 128 | + s->revtab[-split_radix_permutation(i + k, n, s->inverse) & (n - 1)] = j; | |
| 129 | + } | |
| 130 | + } | |
| 131 | + } | |
| 132 | +} | |
| 133 | + | |
| 96 | 134 | av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) |
| 97 | 135 | { |
| 98 | 136 | int i, j, n; |
| @@ -132,11 +170,16 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) · 33 unmodified lines | ||
| 132 | 170 | for(j=4; j<=nbits; j++) { |
| 133 | 171 | ff_init_ff_cos_tabs(j); |
| 134 | 172 | } |
| 135 | − for(i=0; i<n; i++) { | |
| 136 | − int j = i; | |
| 137 | − if (s->fft_permutation == FF_FFT_PERM_SWAP_LSBS) | |
| 138 | − j = (j&~3) | ((j>>1)&1) | ((j<<1)&2); | |
| 139 | − s->revtab[-split_radix_permutation(i, n, s->inverse) & (n-1)] = j; | |
| 173 | + | |
| 174 | + if (s->fft_permutation == FF_FFT_PERM_AVX) { | |
| 175 | + fft_perm_avx(s); | |
| 176 | + } else { | |
| 177 | + for(i=0; i<n; i++) { | |
| 178 | + int j = i; | |
| 179 | + if (s->fft_permutation == FF_FFT_PERM_SWAP_LSBS) | |
| 180 | + j = (j&~3) | ((j>>1)&1) | ((j<<1)&2); | |
| 181 | + s->revtab[-split_radix_permutation(i, n, s->inverse) & (n-1)] = j; | |
| 182 | + } | |
| 140 | 183 | } |
| 141 | 184 | |
| 142 | 185 | return 0; |
| @@ -85,6 +85,7 @@ struct FFTContext { · 84 unmodified lines | ||
| 85 | 85 | int fft_permutation; |
| 86 | 86 | #define FF_FFT_PERM_DEFAULT 0 |
| 87 | 87 | #define FF_FFT_PERM_SWAP_LSBS 1 |
| 88 | +#define FF_FFT_PERM_AVX 2 | |
| 88 | 89 | int mdct_permutation; |
| 89 | 90 | #define FF_MDCT_PERM_NONE 0 |
| 90 | 91 | #define FF_MDCT_PERM_INTERLEAVE 1 |
| @@ -97,7 +98,7 @@ struct FFTContext { · 6 unmodified lines | ||
| 97 | 98 | #endif |
| 98 | 99 | |
| 99 | 100 | #define COSTABLE(size) \ |
| 100 | − COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, FFT_NAME(ff_cos_##size))[size/2] | |
| 101 | + COSTABLE_CONST DECLARE_ALIGNED(32, FFTSample, FFT_NAME(ff_cos_##size))[size/2] | |
| 101 | 102 | |
| 102 | 103 | extern COSTABLE(16); |
| 103 | 104 | extern COSTABLE(32); |
| @@ -599,10 +599,6 @@ retry: · 598 unmodified lines | ||
| 599 | 599 | s->current_picture.pict_type= s->pict_type; |
| 600 | 600 | s->current_picture.key_frame= s->pict_type == FF_I_TYPE; |
| 601 | 601 | |
| 602 | −#if FF_API_HURRY_UP | |
| 603 | − /* skip everything if we are in a hurry>=5 */ | |
| 604 | − if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size); | |
| 605 | −#endif | |
| 606 | 602 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE) |
| 607 | 603 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) |
| 608 | 604 | || avctx->skip_frame >= AVDISCARD_ALL) |
| @@ -612,18 +612,10 @@ retry: · 611 unmodified lines | ||
| 612 | 612 | |
| 613 | 613 | /* skip B-frames if we don't have reference frames */ |
| 614 | 614 | if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size); |
| 615 | −#if FF_API_HURRY_UP | |
| 616 | − /* skip b frames if we are in a hurry */ | |
| 617 | − if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return get_consumed_bytes(s, buf_size); | |
| 618 | −#endif | |
| 619 | 615 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE) |
| 620 | 616 | || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) |
| 621 | 617 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 622 | 618 | return get_consumed_bytes(s, buf_size); |
| 623 | −#if FF_API_HURRY_UP | |
| 624 | − /* skip everything if we are in a hurry>=5 */ | |
| 625 | − if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size); | |
| 626 | −#endif | |
| 627 | 619 | |
| 628 | 620 | if(s->next_p_frame_damaged){ |
| 629 | 621 | if(s->pict_type==FF_B_TYPE) |
| @@ -2966,11 +2966,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ · 2965 unmodified lines | ||
| 2966 | 2966 | buf_index += consumed; |
| 2967 | 2967 | |
| 2968 | 2968 | //FIXME do not discard SEI id |
| 2969 | − if( | |
| 2970 | −#if FF_API_HURRY_UP | |
| 2971 | − (s->hurry_up == 1 && h->nal_ref_idc == 0) || | |
| 2972 | −#endif | |
| 2973 | − (avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0)) | |
| 2969 | + if(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0) | |
| 2974 | 2970 | continue; |
| 2975 | 2971 | |
| 2976 | 2972 | again: |
| @@ -3007,9 +3003,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ · 30 unmodified lines | ||
| 3007 | 3003 | } |
| 3008 | 3004 | |
| 3009 | 3005 | if(hx->redundant_pic_count==0 |
| 3010 | −#if FF_API_HURRY_UP | |
| 3011 | − && hx->s.hurry_up < 5 | |
| 3012 | −#endif | |
| 3013 | 3006 | && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) |
| 3014 | 3007 | && (avctx->skip_frame < AVDISCARD_BIDIR || hx->slice_type_nos!=FF_B_TYPE) |
| 3015 | 3008 | && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE) |
| @@ -3047,9 +3040,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ · 31 unmodified lines | ||
| 3047 | 3040 | |
| 3048 | 3041 | if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning |
| 3049 | 3042 | && s->context_initialized |
| 3050 | −#if FF_API_HURRY_UP | |
| 3051 | − && s->hurry_up < 5 | |
| 3052 | −#endif | |
| 3053 | 3043 | && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) |
| 3054 | 3044 | && (avctx->skip_frame < AVDISCARD_BIDIR || hx->slice_type_nos!=FF_B_TYPE) |
| 3055 | 3045 | && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE) |
| @@ -3186,11 +3176,7 @@ static int decode_frame(AVCodecContext *avctx, · 130 unmodified lines | ||
| 3186 | 3176 | } |
| 3187 | 3177 | |
| 3188 | 3178 | if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){ |
| 3189 | − if (avctx->skip_frame >= AVDISCARD_NONREF | |
| 3190 | −#if FF_API_HURRY_UP | |
| 3191 | − || s->hurry_up | |
| 3192 | −#endif | |
| 3193 | − ) | |
| 3179 | + if (avctx->skip_frame >= AVDISCARD_NONREF) | |
| 3194 | 3180 | return 0; |
| 3195 | 3181 | av_log(avctx, AV_LOG_ERROR, "no frame!\n"); |
| 3196 | 3182 | return -1; |
| @@ -1007,7 +1007,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 1006 unmodified lines | ||
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | −#if 1 | |
| 1011 | 1010 | if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){ |
| 1012 | 1011 | int list; |
| 1013 | 1012 | for(list=0; list<h->list_count; list++){ |
| @@ -1182,7 +1181,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 168 unmodified lines | ||
| 1182 | 1181 | } |
| 1183 | 1182 | } |
| 1184 | 1183 | } |
| 1185 | −#endif | |
| 1186 | 1184 | |
| 1187 | 1185 | h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]); |
| 1188 | 1186 | } |
| @@ -88,7 +88,7 @@ typedef struct { · 87 unmodified lines | ||
| 88 | 88 | |
| 89 | 89 | DSPContext dsp; |
| 90 | 90 | FFTContext fft; |
| 91 | − DECLARE_ALIGNED(16, FFTComplex, samples)[COEFFS/2]; | |
| 91 | + DECLARE_ALIGNED(32, FFTComplex, samples)[COEFFS/2]; | |
| 92 | 92 | float *out_samples; |
| 93 | 93 | } IMCContext; |
| 94 | 94 | |
| @@ -158,7 +158,6 @@ static int hpel_motion_search(MpegEncContext * s, · 157 unmodified lines | ||
| 158 | 158 | const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] |
| 159 | 159 | + (mv_penalty[bx - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor; |
| 160 | 160 | |
| 161 | −#if 1 | |
| 162 | 161 | int key; |
| 163 | 162 | int map_generation= c->map_generation; |
| 164 | 163 | #ifndef NDEBUG |
| @@ -172,7 +171,6 @@ static int hpel_motion_search(MpegEncContext * s, · 7 unmodified lines | ||
| 172 | 171 | assert(map[(index+1)&(ME_MAP_SIZE-1)] == key); |
| 173 | 172 | key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation; |
| 174 | 173 | assert(map[(index-1)&(ME_MAP_SIZE-1)] == key); |
| 175 | −#endif | |
| 176 | 174 | if(t<=b){ |
| 177 | 175 | CHECK_HALF_MV(0, 1, mx ,my-1) |
| 178 | 176 | if(l<=r){ |
| @@ -2476,18 +2476,10 @@ static int decode_chunks(AVCodecContext *avctx, · 2475 unmodified lines | ||
| 2476 | 2476 | /* Skip P-frames if we do not have a reference frame or we have an invalid header. */ |
| 2477 | 2477 | if(s2->pict_type==FF_P_TYPE && !s->sync) break; |
| 2478 | 2478 | } |
| 2479 | −#if FF_API_HURRY_UP | |
| 2480 | − /* Skip B-frames if we are in a hurry. */ | |
| 2481 | − if(avctx->hurry_up && s2->pict_type==FF_B_TYPE) break; | |
| 2482 | −#endif | |
| 2483 | 2479 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==FF_B_TYPE) |
| 2484 | 2480 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=FF_I_TYPE) |
| 2485 | 2481 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 2486 | 2482 | break; |
| 2487 | −#if FF_API_HURRY_UP | |
| 2488 | − /* Skip everything if we are in a hurry>=5. */ | |
| 2489 | − if(avctx->hurry_up>=5) break; | |
| 2490 | −#endif | |
| 2491 | 2483 | |
| 2492 | 2484 | if (!s->mpeg_enc_ctx_allocated) break; |
| 2493 | 2485 | |
| @@ -1131,9 +1131,6 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 1130 unmodified lines | ||
| 1131 | 1131 | } |
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | −#if FF_API_HURRY_UP | |
| 1135 | − s->hurry_up= s->avctx->hurry_up; | |
| 1136 | −#endif | |
| 1137 | 1134 | s->error_recognition= avctx->error_recognition; |
| 1138 | 1135 | |
| 1139 | 1136 | /* set dequantizer, we can't do it during init as it might change for mpeg4 |
| @@ -2125,9 +2122,6 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], · 985 unmodified lines | ||
| 2125 | 2122 | } |
| 2126 | 2123 | |
| 2127 | 2124 | /* skip dequant / idct if we are really late ;) */ |
| 2128 | −#if FF_API_HURRY_UP | |
| 2129 | − if(s->hurry_up>1) goto skip_idct; | |
| 2130 | −#endif | |
| 2131 | 2125 | if(s->avctx->skip_idct){ |
| 2132 | 2126 | if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE) |
| 2133 | 2127 | ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE) |
| @@ -391,11 +391,6 @@ typedef struct MpegEncContext { · 390 unmodified lines | ||
| 391 | 391 | int no_rounding; /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...) |
| 392 | 392 | for b-frames rounding mode is always 0 */ |
| 393 | 393 | |
| 394 | −#if FF_API_HURRY_UP | |
| 395 | − int hurry_up; /**< when set to 1 during decoding, b frames will be skipped | |
| 396 | − when set to 2 idct/dequant will be skipped too */ | |
| 397 | −#endif | |
| 398 | − | |
| 399 | 394 | /* macroblock layer */ |
| 400 | 395 | int mb_x, mb_y; |
| 401 | 396 | int mb_skip_run; |
| @@ -985,10 +985,9 @@ void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n) · 984 unmodified lines | ||
| 985 | 985 | if(level<=MAX_LEVEL && run<=MAX_RUN){ |
| 986 | 986 | s->ac_stats[s->mb_intra][n>3][level][run][last]++; |
| 987 | 987 | } |
| 988 | −#if 0 | |
| 989 | −else | |
| 990 | − s->ac_stats[s->mb_intra][n>3][40][63][0]++; //esc3 like | |
| 991 | −#endif | |
| 988 | + | |
| 989 | + s->ac_stats[s->mb_intra][n > 3][40][63][0]++; //esc3 like | |
| 990 | + | |
| 992 | 991 | code = get_rl_index(rl, last, run, level); |
| 993 | 992 | put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); |
| 994 | 993 | if (code == rl->n) { |
| @@ -47,7 +47,7 @@ · 46 unmodified lines | ||
| 47 | 47 | |
| 48 | 48 | typedef struct NellyMoserDecodeContext { |
| 49 | 49 | AVCodecContext* avctx; |
| 50 | − DECLARE_ALIGNED(16, float,float_buf)[NELLY_SAMPLES]; | |
| 50 | + DECLARE_ALIGNED(32, float, float_buf)[NELLY_SAMPLES]; | |
| 51 | 51 | float state[128]; |
| 52 | 52 | AVLFG random_state; |
| 53 | 53 | GetBitContext gb; |
| @@ -55,7 +55,7 @@ typedef struct NellyMoserDecodeContext { · 1 unmodified line | ||
| 55 | 55 | DSPContext dsp; |
| 56 | 56 | FFTContext imdct_ctx; |
| 57 | 57 | FmtConvertContext fmt_conv; |
| 58 | − DECLARE_ALIGNED(16, float,imdct_out)[NELLY_BUF_LEN * 2]; | |
| 58 | + DECLARE_ALIGNED(32, float, imdct_out)[NELLY_BUF_LEN * 2]; | |
| 59 | 59 | } NellyMoserDecodeContext; |
| 60 | 60 | |
| 61 | 61 | static void overlap_and_window(NellyMoserDecodeContext *s, float *state, float *audio, float *a_in) |
| @@ -55,9 +55,9 @@ typedef struct NellyMoserEncodeContext { · 54 unmodified lines | ||
| 55 | 55 | int have_saved; |
| 56 | 56 | DSPContext dsp; |
| 57 | 57 | FFTContext mdct_ctx; |
| 58 | − DECLARE_ALIGNED(16, float, mdct_out)[NELLY_SAMPLES]; | |
| 59 | − DECLARE_ALIGNED(16, float, in_buff)[NELLY_SAMPLES]; | |
| 60 | − DECLARE_ALIGNED(16, float, buf)[2][3 * NELLY_BUF_LEN]; ///< sample buffer | |
| 58 | + DECLARE_ALIGNED(32, float, mdct_out)[NELLY_SAMPLES]; | |
| 59 | + DECLARE_ALIGNED(32, float, in_buff)[NELLY_SAMPLES]; | |
| 60 | + DECLARE_ALIGNED(32, float, buf)[2][3 * NELLY_BUF_LEN]; ///< sample buffer | |
| 61 | 61 | float (*opt )[NELLY_BANDS]; |
| 62 | 62 | uint8_t (*path)[NELLY_BANDS]; |
| 63 | 63 | } NellyMoserEncodeContext; |
| @@ -105,9 +105,6 @@ static const AVOption options[]={ · 104 unmodified lines | ||
| 105 | 105 | {"extradata_size", NULL, OFFSET(extradata_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, |
| 106 | 106 | {"time_base", NULL, OFFSET(time_base), FF_OPT_TYPE_RATIONAL, DEFAULT, INT_MIN, INT_MAX}, |
| 107 | 107 | {"g", "set the group of picture size", OFFSET(gop_size), FF_OPT_TYPE_INT, 12, INT_MIN, INT_MAX, V|E}, |
| 108 | −#if FF_API_RATE_EMU | |
| 109 | −{"rate_emu", "frame rate emulation", OFFSET(rate_emu), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, | |
| 110 | −#endif | |
| 111 | 108 | {"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, |
| 112 | 109 | {"ac", "set number of audio channels", OFFSET(channels), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, |
| 113 | 110 | {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E}, |
| @@ -124,9 +121,6 @@ static const AVOption options[]={ · 10 unmodified lines | ||
| 124 | 121 | {"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E}, |
| 125 | 122 | {"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E}, |
| 126 | 123 | {"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E}, |
| 127 | −#if FF_API_HURRY_UP | |
| 128 | −{"hurry_up", "deprecated, use skip_idct/skip_frame instead", OFFSET(hurry_up), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D}, | |
| 129 | −#endif | |
| 130 | 124 | {"ps", "rtp payload size in bytes", OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E}, |
| 131 | 125 | {"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, |
| 132 | 126 | {"header_bits", NULL, OFFSET(header_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, |
| @@ -253,10 +247,6 @@ static const AVOption options[]={ · 120 unmodified lines | ||
| 253 | 247 | {"pf", "forward predicted MVs of P-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_P_FOR, INT_MIN, INT_MAX, V|D, "debug_mv"}, |
| 254 | 248 | {"bf", "forward predicted MVs of B-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_B_FOR, INT_MIN, INT_MAX, V|D, "debug_mv"}, |
| 255 | 249 | {"bb", "backward predicted MVs of B-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_B_BACK, INT_MIN, INT_MAX, V|D, "debug_mv"}, |
| 256 | −#if FF_API_MB_Q | |
| 257 | −{"mb_qmin", "obsolete, use qmin", OFFSET(mb_qmin), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E}, | |
| 258 | −{"mb_qmax", "obsolete, use qmax", OFFSET(mb_qmax), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E}, | |
| 259 | −#endif | |
| 260 | 250 | {"cmp", "full pel me compare function", OFFSET(me_cmp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "cmp_func"}, |
| 261 | 251 | {"subcmp", "sub pel me compare function", OFFSET(me_sub_cmp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "cmp_func"}, |
| 262 | 252 | {"mbcmp", "macroblock compare function", OFFSET(mb_cmp), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E, "cmp_func"}, |
| @@ -380,9 +380,6 @@ static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src) · 379 unmodified lines | ||
| 380 | 380 | dst->release_buffer = src->release_buffer; |
| 381 | 381 | |
| 382 | 382 | dst->opaque = src->opaque; |
| 383 | −#if FF_API_HURRY_UP | |
| 384 | − dst->hurry_up = src->hurry_up; | |
| 385 | −#endif | |
| 386 | 383 | dst->dsp_mask = src->dsp_mask; |
| 387 | 384 | dst->debug = src->debug; |
| 388 | 385 | dst->debug_mv = src->debug_mv; |
| @@ -120,7 +120,7 @@ typedef struct { · 119 unmodified lines | ||
| 120 | 120 | } FFTCoefficient; |
| 121 | 121 | |
| 122 | 122 | typedef struct { |
| 123 | − DECLARE_ALIGNED(16, QDM2Complex, complex)[MPA_MAX_CHANNELS][256]; | |
| 123 | + DECLARE_ALIGNED(32, QDM2Complex, complex)[MPA_MAX_CHANNELS][256]; | |
| 124 | 124 | } QDM2FFT; |
| 125 | 125 | |
| 126 | 126 | /** |
| @@ -1454,19 +1454,10 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, · 1453 unmodified lines | ||
| 1454 | 1454 | } |
| 1455 | 1455 | if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE) |
| 1456 | 1456 | return -1; |
| 1457 | −#if FF_API_HURRY_UP | |
| 1458 | − /* skip b frames if we are in a hurry */ | |
| 1459 | − if(avctx->hurry_up && si.type==FF_B_TYPE) return buf_size; | |
| 1460 | −#endif | |
| 1461 | 1457 | if( (avctx->skip_frame >= AVDISCARD_NONREF && si.type==FF_B_TYPE) |
| 1462 | 1458 | || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=FF_I_TYPE) |
| 1463 | 1459 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 1464 | 1460 | return buf_size; |
| 1465 | −#if FF_API_HURRY_UP | |
| 1466 | − /* skip everything if we are in a hurry>=5 */ | |
| 1467 | − if(avctx->hurry_up>=5) | |
| 1468 | − return buf_size; | |
| 1469 | −#endif | |
| 1470 | 1461 | |
| 1471 | 1462 | for(i=0; i<slice_count; i++){ |
| 1472 | 1463 | int offset= get_slice_offset(avctx, slices_hdr, i); |
| @@ -897,7 +897,6 @@ QPEL_MC(0, avg_ , _ , op_avg) · 896 unmodified lines | ||
| 897 | 897 | #undef op_put |
| 898 | 898 | #undef op_put_no_rnd |
| 899 | 899 | |
| 900 | −#if 1 | |
| 901 | 900 | #define H264_LOWPASS(OPNAME, OP, OP2) \ |
| 902 | 901 | static inline void OPNAME ## h264_qpel_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,int w,int h){\ |
| 903 | 902 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\ |
| @@ -1298,7 +1297,6 @@ H264_MC(avg_, 16) · 394 unmodified lines | ||
| 1298 | 1297 | #undef op_put |
| 1299 | 1298 | #undef op2_avg |
| 1300 | 1299 | #undef op2_put |
| 1301 | −#endif | |
| 1302 | 1300 | |
| 1303 | 1301 | static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){ |
| 1304 | 1302 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; |
| @@ -3293,10 +3293,8 @@ static void iterative_me(SnowContext *s){ · 3292 unmodified lines | ||
| 3293 | 3293 | } |
| 3294 | 3294 | best_rd= ref_rd; |
| 3295 | 3295 | *block= ref_b; |
| 3296 | −#if 1 | |
| 3297 | 3296 | check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd); |
| 3298 | 3297 | //FIXME RD style color selection |
| 3299 | −#endif | |
| 3300 | 3298 | if(!same_block(block, &backup)){ |
| 3301 | 3299 | if(tb ) tb ->type &= ~BLOCK_OPT; |
| 3302 | 3300 | if(lb ) lb ->type &= ~BLOCK_OPT; |
| @@ -684,9 +684,6 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 683 unmodified lines | ||
| 684 | 684 | //this should be removed after libavcodec can handle more flexible picture types & ordering |
| 685 | 685 | if(s->pict_type==FF_B_TYPE && s->last_picture_ptr==NULL) return buf_size; |
| 686 | 686 | |
| 687 | −#if FF_API_HURRY_UP | |
| 688 | − if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return buf_size; | |
| 689 | −#endif | |
| 690 | 687 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE) |
| 691 | 688 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) |
| 692 | 689 | || avctx->skip_frame >= AVDISCARD_ALL) |
| @@ -952,14 +952,6 @@ static int svq3_decode_frame(AVCodecContext *avctx, · 951 unmodified lines | ||
| 952 | 952 | /* Skip B-frames if we do not have reference frames. */ |
| 953 | 953 | if (s->last_picture_ptr == NULL && s->pict_type == FF_B_TYPE) |
| 954 | 954 | return 0; |
| 955 | −#if FF_API_HURRY_UP | |
| 956 | − /* Skip B-frames if we are in a hurry. */ | |
| 957 | − if (avctx->hurry_up && s->pict_type == FF_B_TYPE) | |
| 958 | − return 0; | |
| 959 | − /* Skip everything if we are in a hurry >= 5. */ | |
| 960 | − if (avctx->hurry_up >= 5) | |
| 961 | − return 0; | |
| 962 | −#endif | |
| 963 | 955 | if ( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE) |
| 964 | 956 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE) |
| 965 | 957 | || avctx->skip_frame >= AVDISCARD_ALL) |
| @@ -1105,18 +1105,11 @@ void avcodec_default_free_buffers(AVCodecContext *s){ · 1104 unmodified lines | ||
| 1105 | 1105 | s->internal_buffer_count=0; |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | +#if FF_API_OLD_FF_PICT_TYPES | |
| 1108 | 1109 | char av_get_pict_type_char(int pict_type){ |
| 1109 | − switch(pict_type){ | |
| 1110 | − case FF_I_TYPE: return 'I'; | |
| 1111 | − case FF_P_TYPE: return 'P'; | |
| 1112 | − case FF_B_TYPE: return 'B'; | |
| 1113 | − case FF_S_TYPE: return 'S'; | |
| 1114 | − case FF_SI_TYPE:return 'i'; | |
| 1115 | − case FF_SP_TYPE:return 'p'; | |
| 1116 | − case FF_BI_TYPE:return 'b'; | |
| 1117 | − default: return '?'; | |
| 1118 | − } | |
| 1110 | + return av_get_picture_type_char(pict_type); | |
| 1119 | 1111 | } |
| 1112 | +#endif | |
| 1120 | 1113 | |
| 1121 | 1114 | int av_get_bits_per_sample(enum CodecID codec_id){ |
| 1122 | 1115 | switch(codec_id){ |
| @@ -3519,21 +3519,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, · 3518 unmodified lines | ||
| 3519 | 3519 | if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)){ |
| 3520 | 3520 | goto err; |
| 3521 | 3521 | } |
| 3522 | −#if FF_API_HURRY_UP | |
| 3523 | − /* skip b frames if we are in a hurry */ | |
| 3524 | − if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return -1;//buf_size; | |
| 3525 | −#endif | |
| 3526 | 3522 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE) |
| 3527 | 3523 | || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) |
| 3528 | 3524 | || avctx->skip_frame >= AVDISCARD_ALL) { |
| 3529 | 3525 | goto end; |
| 3530 | 3526 | } |
| 3531 | −#if FF_API_HURRY_UP | |
| 3532 | − /* skip everything if we are in a hurry>=5 */ | |
| 3533 | − if(avctx->hurry_up>=5) { | |
| 3534 | − goto err; | |
| 3535 | − } | |
| 3536 | −#endif | |
| 3537 | 3527 | |
| 3538 | 3528 | if(s->next_p_frame_damaged){ |
| 3539 | 3529 | if(s->pict_type==FF_B_TYPE) |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | #define LIBAVCODEC_VERSION_MAJOR 53 |
| 24 | 24 | #define LIBAVCODEC_VERSION_MINOR 1 |
| 25 | −#define LIBAVCODEC_VERSION_MICRO 0 | |
| 25 | +#define LIBAVCODEC_VERSION_MICRO 1 | |
| 26 | 26 | |
| 27 | 27 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 28 | 28 | LIBAVCODEC_VERSION_MINOR, \ |
| @@ -47,15 +47,6 @@ · 18 unmodified lines | ||
| 47 | 47 | #ifndef FF_API_OLD_AUDIOCONVERT |
| 48 | 48 | #define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54) |
| 49 | 49 | #endif |
| 50 | −#ifndef FF_API_HURRY_UP | |
| 51 | −#define FF_API_HURRY_UP (LIBAVCODEC_VERSION_MAJOR < 53) | |
| 52 | −#endif | |
| 53 | −#ifndef FF_API_RATE_EMU | |
| 54 | −#define FF_API_RATE_EMU (LIBAVCODEC_VERSION_MAJOR < 53) | |
| 55 | −#endif | |
| 56 | −#ifndef FF_API_MB_Q | |
| 57 | −#define FF_API_MB_Q (LIBAVCODEC_VERSION_MAJOR < 53) | |
| 58 | −#endif | |
| 59 | 50 | #ifndef FF_API_ANTIALIAS_ALGO |
| 60 | 51 | #define FF_API_ANTIALIAS_ALGO (LIBAVCODEC_VERSION_MAJOR < 54) |
| 61 | 52 | #endif |
| @@ -68,5 +59,8 @@ · 6 unmodified lines | ||
| 68 | 59 | #ifndef FF_API_THREAD_INIT |
| 69 | 60 | #define FF_API_THREAD_INIT (LIBAVCODEC_VERSION_MAJOR < 54) |
| 70 | 61 | #endif |
| 62 | +#ifndef FF_API_OLD_FF_PICT_TYPES | |
| 63 | +#define FF_API_OLD_FF_PICT_TYPES (LIBAVCODEC_VERSION_MAJOR < 54) | |
| 64 | +#endif | |
| 71 | 65 | |
| 72 | 66 | #endif /* AVCODEC_VERSION_H */ |
| @@ -113,15 +113,15 @@ typedef struct WMACodecContext { · 112 unmodified lines | ||
| 113 | 113 | uint8_t ms_stereo; ///< true if mid/side stereo mode |
| 114 | 114 | uint8_t channel_coded[MAX_CHANNELS]; ///< true if channel is coded |
| 115 | 115 | int exponents_bsize[MAX_CHANNELS]; ///< log2 ratio frame/exp. length |
| 116 | − DECLARE_ALIGNED(16, float, exponents)[MAX_CHANNELS][BLOCK_MAX_SIZE]; | |
| 116 | + DECLARE_ALIGNED(32, float, exponents)[MAX_CHANNELS][BLOCK_MAX_SIZE]; | |
| 117 | 117 | float max_exponent[MAX_CHANNELS]; |
| 118 | 118 | WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]; |
| 119 | − DECLARE_ALIGNED(16, float, coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE]; | |
| 120 | − DECLARE_ALIGNED(16, FFTSample, output)[BLOCK_MAX_SIZE * 2]; | |
| 119 | + DECLARE_ALIGNED(32, float, coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE]; | |
| 120 | + DECLARE_ALIGNED(32, FFTSample, output)[BLOCK_MAX_SIZE * 2]; | |
| 121 | 121 | FFTContext mdct_ctx[BLOCK_NB_SIZES]; |
| 122 | 122 | float *windows[BLOCK_NB_SIZES]; |
| 123 | 123 | /* output buffer for one frame and the last for IMDCT windowing */ |
| 124 | − DECLARE_ALIGNED(16, float, frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]; | |
| 124 | + DECLARE_ALIGNED(32, float, frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]; | |
| 125 | 125 | /* last frame info */ |
| 126 | 126 | uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4]; /* padding added */ |
| 127 | 127 | int last_bitoffset; |
| @@ -145,7 +145,7 @@ typedef struct { · 144 unmodified lines | ||
| 145 | 145 | uint8_t table_idx; ///< index in sf_offsets for the scale factor reference block |
| 146 | 146 | float* coeffs; ///< pointer to the subframe decode buffer |
| 147 | 147 | uint16_t num_vec_coeffs; ///< number of vector coded coefficients |
| 148 | − DECLARE_ALIGNED(16, float, out)[WMAPRO_BLOCK_MAX_SIZE + WMAPRO_BLOCK_MAX_SIZE / 2]; ///< output buffer | |
| 148 | + DECLARE_ALIGNED(32, float, out)[WMAPRO_BLOCK_MAX_SIZE + WMAPRO_BLOCK_MAX_SIZE / 2]; ///< output buffer | |
| 149 | 149 | } WMAProChannelCtx; |
| 150 | 150 | |
| 151 | 151 | /** |
| @@ -170,7 +170,7 @@ typedef struct WMAProDecodeCtx { · 18 unmodified lines | ||
| 170 | 170 | FF_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data |
| 171 | 171 | PutBitContext pb; ///< context for filling the frame_data buffer |
| 172 | 172 | FFTContext mdct_ctx[WMAPRO_BLOCK_SIZES]; ///< MDCT context per block size |
| 173 | − DECLARE_ALIGNED(16, float, tmp)[WMAPRO_BLOCK_MAX_SIZE]; ///< IMDCT output buffer | |
| 173 | + DECLARE_ALIGNED(32, float, tmp)[WMAPRO_BLOCK_MAX_SIZE]; ///< IMDCT output buffer | |
| 174 | 174 | float* windows[WMAPRO_BLOCK_SIZES]; ///< windows for the different block sizes |
| 175 | 175 | |
| 176 | 176 | /* frame size dependent frame information (set during initialization) */ |
| @@ -275,11 +275,11 @@ typedef struct { · 274 unmodified lines | ||
| 275 | 275 | ///< by postfilter |
| 276 | 276 | float denoise_filter_cache[MAX_FRAMESIZE]; |
| 277 | 277 | int denoise_filter_cache_size; ///< samples in #denoise_filter_cache |
| 278 | − DECLARE_ALIGNED(16, float, tilted_lpcs_pf)[0x80]; | |
| 278 | + DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x80]; | |
| 279 | 279 | ///< aligned buffer for LPC tilting |
| 280 | − DECLARE_ALIGNED(16, float, denoise_coeffs_pf)[0x80]; | |
| 280 | + DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x80]; | |
| 281 | 281 | ///< aligned buffer for denoise coefficients |
| 282 | − DECLARE_ALIGNED(16, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; | |
| 282 | + DECLARE_ALIGNED(32, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; | |
| 283 | 283 | ///< aligned buffer for postfilter speech |
| 284 | 284 | ///< synthesis |
| 285 | 285 | /** |
| @@ -25,7 +25,14 @@ av_cold void ff_fft_init_mmx(FFTContext *s) · 24 unmodified lines | ||
| 25 | 25 | { |
| 26 | 26 | #if HAVE_YASM |
| 27 | 27 | int has_vectors = av_get_cpu_flags(); |
| 28 | − if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) { | |
| 28 | + if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) { | |
| 29 | + /* AVX for SB */ | |
| 30 | + s->imdct_calc = ff_imdct_calc_sse; | |
| 31 | + s->imdct_half = ff_imdct_half_avx; | |
| 32 | + s->fft_permute = ff_fft_permute_sse; | |
| 33 | + s->fft_calc = ff_fft_calc_avx; | |
| 34 | + s->fft_permutation = FF_FFT_PERM_AVX; | |
| 35 | + } else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) { | |
| 29 | 36 | /* SSE for P3/P4/K8 */ |
| 30 | 37 | s->imdct_calc = ff_imdct_calc_sse; |
| 31 | 38 | s->imdct_half = ff_imdct_half_sse; |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include "libavcodec/fft.h" |
| 23 | 23 | |
| 24 | 24 | void ff_fft_permute_sse(FFTContext *s, FFTComplex *z); |
| 25 | +void ff_fft_calc_avx(FFTContext *s, FFTComplex *z); | |
| 25 | 26 | void ff_fft_calc_sse(FFTContext *s, FFTComplex *z); |
| 26 | 27 | void ff_fft_calc_3dn(FFTContext *s, FFTComplex *z); |
| 27 | 28 | void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z); |
| @@ -32,6 +33,7 @@ void ff_imdct_calc_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input · 4 unmodified lines | ||
| 32 | 33 | void ff_imdct_half_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input); |
| 33 | 34 | void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input); |
| 34 | 35 | void ff_imdct_half_sse(FFTContext *s, FFTSample *output, const FFTSample *input); |
| 36 | +void ff_imdct_half_avx(FFTContext *s, FFTSample *output, const FFTSample *input); | |
| 35 | 37 | void ff_dct32_float_sse(FFTSample *out, const FFTSample *in); |
| 36 | 38 | |
| 37 | 39 | #endif |
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | ;****************************************************************************** |
| 2 | 2 | ;* FFT transform with SSE/3DNow optimizations |
| 3 | 3 | ;* Copyright (c) 2008 Loren Merritt |
| 4 | +;* Copyright (c) 2011 Vitor Sessak | |
| 4 | 5 | ;* |
| 5 | 6 | ;* This algorithm (though not any of the implementation details) is |
| 6 | 7 | ;* based on libdjbfft by D. J. Bernstein. |
| @@ -49,9 +50,21 @@ endstruc · 42 unmodified lines | ||
| 49 | 50 | SECTION_RODATA |
| 50 | 51 | |
| 51 | 52 | %define M_SQRT1_2 0.70710678118654752440 |
| 52 | −ps_root2: times 4 dd M_SQRT1_2 | |
| 53 | −ps_root2mppm: dd -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2 | |
| 54 | −ps_p1p1m1p1: dd 0, 0, 1<<31, 0 | |
| 53 | +%define M_COS_PI_1_8 0.923879532511287 | |
| 54 | +%define M_COS_PI_3_8 0.38268343236509 | |
| 55 | + | |
| 56 | +align 32 | |
| 57 | +ps_cos16_1: dd 1.0, M_COS_PI_1_8, M_SQRT1_2, M_COS_PI_3_8, 1.0, M_COS_PI_1_8, M_SQRT1_2, M_COS_PI_3_8 | |
| 58 | +ps_cos16_2: dd 0, M_COS_PI_3_8, M_SQRT1_2, M_COS_PI_1_8, 0, -M_COS_PI_3_8, -M_SQRT1_2, -M_COS_PI_1_8 | |
| 59 | + | |
| 60 | +ps_root2: times 8 dd M_SQRT1_2 | |
| 61 | +ps_root2mppm: dd -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2, -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2 | |
| 62 | +ps_p1p1m1p1: dd 0, 0, 1<<31, 0, 0, 0, 1<<31, 0 | |
| 63 | + | |
| 64 | +perm1: dd 0x00, 0x02, 0x03, 0x01, 0x03, 0x00, 0x02, 0x01 | |
| 65 | +perm2: dd 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x03 | |
| 66 | +ps_p1p1m1p1root2: dd 1.0, 1.0, -1.0, 1.0, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2 | |
| 67 | +ps_m1m1p1m1p1m1m1m1: dd 1<<31, 1<<31, 0, 1<<31, 0, 1<<31, 1<<31, 1<<31 | |
| 55 | 68 | ps_m1p1: dd 1<<31, 0 |
| 56 | 69 | |
| 57 | 70 | %assign i 16 |
| @@ -96,51 +109,80 @@ section .text align=16 · 38 unmodified lines | ||
| 96 | 109 | SWAP %3, %6 |
| 97 | 110 | %endmacro |
| 98 | 111 | |
| 112 | +; in: %1 = {r0,i0,r2,i2,r4,i4,r6,i6} | |
| 113 | +; %2 = {r1,i1,r3,i3,r5,i5,r7,i7} | |
| 114 | +; %3, %4, %5 tmp | |
| 115 | +; out: %1 = {r0,r1,r2,r3,i0,i1,i2,i3} | |
| 116 | +; %2 = {r4,r5,r6,r7,i4,i5,i6,i7} | |
| 117 | +%macro T8_AVX 5 | |
| 118 | + vsubps %5, %1, %2 ; v = %1 - %2 | |
| 119 | + vaddps %3, %1, %2 ; w = %1 + %2 | |
| 120 | + vmulps %2, %5, [ps_p1p1m1p1root2] ; v *= vals1 | |
| 121 | + vpermilps %2, %2, [perm1] | |
| 122 | + vblendps %1, %2, %3, 0x33 ; q = {w1,w2,v4,v2,w5,w6,v7,v6} | |
| 123 | + vshufps %5, %3, %2, 0x4e ; r = {w3,w4,v1,v3,w7,w8,v8,v5} | |
| 124 | + vsubps %4, %5, %1 ; s = r - q | |
| 125 | + vaddps %1, %5, %1 ; u = r + q | |
| 126 | + vpermilps %1, %1, [perm2] ; k = {u1,u2,u3,u4,u6,u5,u7,u8} | |
| 127 | + vshufps %5, %4, %1, 0xbb | |
| 128 | + vshufps %3, %4, %1, 0xee | |
| 129 | + vperm2f128 %3, %3, %5, 0x13 | |
| 130 | + vxorps %4, %4, [ps_m1m1p1m1p1m1m1m1] ; s *= {1,1,-1,-1,1,-1,-1,-1} | |
| 131 | + vshufps %2, %1, %4, 0xdd | |
| 132 | + vshufps %1, %1, %4, 0x88 | |
| 133 | + vperm2f128 %4, %2, %1, 0x02 ; v = {k1,k3,s1,s3,k2,k4,s2,s4} | |
| 134 | + vperm2f128 %1, %1, %2, 0x13 ; w = {k6,k8,s6,s8,k5,k7,s5,s7} | |
| 135 | + vsubps %5, %1, %3 | |
| 136 | + vblendps %1, %5, %1, 0x55 ; w -= {0,s7,0,k7,0,s8,0,k8} | |
| 137 | + vsubps %2, %4, %1 ; %2 = v - w | |
| 138 | + vaddps %1, %4, %1 ; %1 = v + w | |
| 139 | +%endmacro | |
| 140 | + | |
| 141 | +; In SSE mode do one fft4 transforms | |
| 99 | 142 | ; in: %1={r0,i0,r2,i2} %2={r1,i1,r3,i3} |
| 100 | 143 | ; out: %1={r0,r1,r2,r3} %2={i0,i1,i2,i3} |
| 144 | +; | |
| 145 | +; In AVX mode do two fft4 transforms | |
| 146 | +; in: %1={r0,i0,r2,i2,r4,i4,r6,i6} %2={r1,i1,r3,i3,r5,i5,r7,i7} | |
| 147 | +; out: %1={r0,r1,r2,r3,r4,r5,r6,r7} %2={i0,i1,i2,i3,i4,i5,i6,i7} | |
| 101 | 148 | %macro T4_SSE 3 |
| 102 | − mova %3, %1 | |
| 103 | − addps %1, %2 ; {t1,t2,t6,t5} | |
| 104 | − subps %3, %2 ; {t3,t4,-t8,t7} | |
| 105 | − xorps %3, [ps_p1p1m1p1] | |
| 106 | − mova %2, %1 | |
| 107 | − shufps %1, %3, 0x44 ; {t1,t2,t3,t4} | |
| 108 | − shufps %2, %3, 0xbe ; {t6,t5,t7,t8} | |
| 109 | − mova %3, %1 | |
| 110 | − addps %1, %2 ; {r0,i0,r1,i1} | |
| 111 | − subps %3, %2 ; {r2,i2,r3,i3} | |
| 112 | − mova %2, %1 | |
| 113 | − shufps %1, %3, 0x88 ; {r0,r1,r2,r3} | |
| 114 | − shufps %2, %3, 0xdd ; {i0,i1,i2,i3} | |
| 149 | + subps %3, %1, %2 ; {t3,t4,-t8,t7} | |
| 150 | + addps %1, %1, %2 ; {t1,t2,t6,t5} | |
| 151 | + xorps %3, %3, [ps_p1p1m1p1] | |
| 152 | + shufps %2, %1, %3, 0xbe ; {t6,t5,t7,t8} | |
| 153 | + shufps %1, %1, %3, 0x44 ; {t1,t2,t3,t4} | |
| 154 | + subps %3, %1, %2 ; {r2,i2,r3,i3} | |
| 155 | + addps %1, %1, %2 ; {r0,i0,r1,i1} | |
| 156 | + shufps %2, %1, %3, 0xdd ; {i0,i1,i2,i3} | |
| 157 | + shufps %1, %1, %3, 0x88 ; {r0,r1,r2,r3} | |
| 115 | 158 | %endmacro |
| 116 | 159 | |
| 160 | +; In SSE mode do one FFT8 | |
| 117 | 161 | ; in: %1={r0,r1,r2,r3} %2={i0,i1,i2,i3} %3={r4,i4,r6,i6} %4={r5,i5,r7,i7} |
| 118 | 162 | ; out: %1={r0,r1,r2,r3} %2={i0,i1,i2,i3} %1={r4,r5,r6,r7} %2={i4,i5,i6,i7} |
| 163 | +; | |
| 164 | +; In AVX mode do two FFT8 | |
| 165 | +; in: %1={r0,i0,r2,i2,r8, i8, r10,i10} %2={r1,i1,r3,i3,r9, i9, r11,i11} | |
| 166 | +; %3={r4,i4,r6,i6,r12,i12,r14,i14} %4={r5,i5,r7,i7,r13,i13,r15,i15} | |
| 167 | +; out: %1={r0,r1,r2,r3,r8, r9, r10,r11} %2={i0,i1,i2,i3,i8, i9, i10,i11} | |
| 168 | +; %3={r4,r5,r6,r7,r12,r13,r14,r15} %4={i4,i5,i6,i7,i12,i13,i14,i15} | |
| 119 | 169 | %macro T8_SSE 6 |
| 120 | − mova %6, %3 | |
| 121 | − subps %3, %4 ; {r5,i5,r7,i7} | |
| 122 | − addps %6, %4 ; {t1,t2,t3,t4} | |
| 123 | − mova %4, %3 | |
| 124 | − shufps %4, %4, 0xb1 ; {i5,r5,i7,r7} | |
| 125 | − mulps %3, [ps_root2mppm] ; {-r5,i5,r7,-i7} | |
| 126 | − mulps %4, [ps_root2] | |
| 127 | − addps %3, %4 ; {t8,t7,ta,t9} | |
| 128 | − mova %4, %6 | |
| 129 | − shufps %6, %3, 0x36 ; {t3,t2,t9,t8} | |
| 130 | − shufps %4, %3, 0x9c ; {t1,t4,t7,ta} | |
| 131 | − mova %3, %6 | |
| 132 | − addps %6, %4 ; {t1,t2,t9,ta} | |
| 133 | − subps %3, %4 ; {t6,t5,tc,tb} | |
| 134 | − mova %4, %6 | |
| 135 | − shufps %6, %3, 0xd8 ; {t1,t9,t5,tb} | |
| 136 | − shufps %4, %3, 0x8d ; {t2,ta,t6,tc} | |
| 137 | − mova %3, %1 | |
| 138 | − mova %5, %2 | |
| 139 | − addps %1, %6 ; {r0,r1,r2,r3} | |
| 140 | − addps %2, %4 ; {i0,i1,i2,i3} | |
| 141 | − subps %3, %6 ; {r4,r5,r6,r7} | |
| 142 | − subps %5, %4 ; {i4,i5,i6,i7} | |
| 143 | − SWAP %4, %5 | |
| 170 | + addps %6, %3, %4 ; {t1,t2,t3,t4} | |
| 171 | + subps %3, %3, %4 ; {r5,i5,r7,i7} | |
| 172 | + shufps %4, %3, %3, 0xb1 ; {i5,r5,i7,r7} | |
| 173 | + mulps %3, %3, [ps_root2mppm] ; {-r5,i5,r7,-i7} | |
| 174 | + mulps %4, %4, [ps_root2] | |
| 175 | + addps %3, %3, %4 ; {t8,t7,ta,t9} | |
| 176 | + shufps %4, %6, %3, 0x9c ; {t1,t4,t7,ta} | |
| 177 | + shufps %6, %6, %3, 0x36 ; {t3,t2,t9,t8} | |
| 178 | + subps %3, %6, %4 ; {t6,t5,tc,tb} | |
| 179 | + addps %6, %6, %4 ; {t1,t2,t9,ta} | |
| 180 | + shufps %5, %6, %3, 0x8d ; {t2,ta,t6,tc} | |
| 181 | + shufps %6, %6, %3, 0xd8 ; {t1,t9,t5,tb} | |
| 182 | + subps %3, %1, %6 ; {r4,r5,r6,r7} | |
| 183 | + addps %1, %1, %6 ; {r0,r1,r2,r3} | |
| 184 | + subps %4, %2, %5 ; {i4,i5,i6,i7} | |
| 185 | + addps %2, %2, %5 ; {i0,i1,i2,i3} | |
| 144 | 186 | %endmacro |
| 145 | 187 | |
| 146 | 188 | ; scheduled for cpu-bound sizes |
| @@ -148,52 +190,44 @@ section .text align=16 · 1 unmodified line | ||
| 148 | 190 | IF%1 mova m4, Z(4) |
| 149 | 191 | IF%1 mova m5, Z(5) |
| 150 | 192 | mova m0, %2 ; wre |
| 151 | − mova m2, m4 | |
| 152 | 193 | mova m1, %3 ; wim |
| 153 | − mova m3, m5 | |
| 154 | − mulps m2, m0 ; r2*wre | |
| 194 | + mulps m2, m4, m0 ; r2*wre | |
| 155 | 195 | IF%1 mova m6, Z2(6) |
| 156 | − mulps m3, m1 ; i2*wim | |
| 196 | + mulps m3, m5, m1 ; i2*wim | |
| 157 | 197 | IF%1 mova m7, Z2(7) |
| 158 | − mulps m4, m1 ; r2*wim | |
| 159 | − mulps m5, m0 ; i2*wre | |
| 160 | − addps m2, m3 ; r2*wre + i2*wim | |
| 161 | − mova m3, m1 | |
| 162 | − mulps m1, m6 ; r3*wim | |
| 163 | − subps m5, m4 ; i2*wre - r2*wim | |
| 164 | − mova m4, m0 | |
| 165 | − mulps m3, m7 ; i3*wim | |
| 166 | − mulps m4, m6 ; r3*wre | |
| 167 | − mulps m0, m7 ; i3*wre | |
| 168 | − subps m4, m3 ; r3*wre - i3*wim | |
| 198 | + mulps m4, m4, m1 ; r2*wim | |
| 199 | + mulps m5, m5, m0 ; i2*wre | |
| 200 | + addps m2, m2, m3 ; r2*wre + i2*wim | |
| 201 | + mulps m3, m1, m7 ; i3*wim | |
| 202 | + subps m5, m5, m4 ; i2*wre - r2*wim | |
| 203 | + mulps m1, m1, m6 ; r3*wim | |
| 204 | + mulps m4, m0, m6 ; r3*wre | |
| 205 | + mulps m0, m0, m7 ; i3*wre | |
| 206 | + subps m4, m4, m3 ; r3*wre - i3*wim | |
| 169 | 207 | mova m3, Z(0) |
| 170 | − addps m0, m1 ; i3*wre + r3*wim | |
| 171 | − mova m1, m4 | |
| 172 | − addps m4, m2 ; t5 | |
| 173 | − subps m1, m2 ; t3 | |
| 174 | − subps m3, m4 ; r2 | |
| 175 | − addps m4, Z(0) ; r0 | |
| 208 | + addps m0, m0, m1 ; i3*wre + r3*wim | |
| 209 | + subps m1, m4, m2 ; t3 | |
| 210 | + addps m4, m4, m2 ; t5 | |
| 211 | + subps m3, m3, m4 ; r2 | |
| 212 | + addps m4, m4, Z(0) ; r0 | |
| 176 | 213 | mova m6, Z(2) |
| 177 | 214 | mova Z(4), m3 |
| 178 | 215 | mova Z(0), m4 |
| 179 | − mova m3, m5 | |
| 180 | − subps m5, m0 ; t4 | |
| 181 | − mova m4, m6 | |
| 182 | − subps m6, m5 ; r3 | |
| 183 | − addps m5, m4 ; r1 | |
| 184 | − mova Z2(6), m6 | |
| 185 | − mova Z(2), m5 | |
| 216 | + subps m3, m5, m0 ; t4 | |
| 217 | + subps m4, m6, m3 ; r3 | |
| 218 | + addps m3, m3, m6 ; r1 | |
| 219 | + mova Z2(6), m4 | |
| 220 | + mova Z(2), m3 | |
| 186 | 221 | mova m2, Z(3) |
| 187 | − addps m3, m0 ; t6 | |
| 188 | − subps m2, m1 ; i3 | |
| 222 | + addps m3, m5, m0 ; t6 | |
| 223 | + subps m2, m2, m1 ; i3 | |
| 189 | 224 | mova m7, Z(1) |
| 190 | − addps m1, Z(3) ; i1 | |
| 225 | + addps m1, m1, Z(3) ; i1 | |
| 191 | 226 | mova Z2(7), m2 |
| 192 | 227 | mova Z(3), m1 |
| 193 | − mova m4, m7 | |
| 194 | − subps m7, m3 ; i2 | |
| 195 | − addps m3, m4 ; i0 | |
| 196 | − mova Z(5), m7 | |
| 228 | + subps m4, m7, m3 ; i2 | |
| 229 | + addps m3, m3, m7 ; i0 | |
| 230 | + mova Z(5), m4 | |
| 197 | 231 | mova Z(1), m3 |
| 198 | 232 | %endmacro |
| 199 | 233 | |
| @@ -201,77 +235,55 @@ IF%1 mova m7, Z2(7) · 1 unmodified line | ||
| 201 | 235 | %macro PASS_BIG 1 ; (!interleave) |
| 202 | 236 | mova m4, Z(4) ; r2 |
| 203 | 237 | mova m5, Z(5) ; i2 |
| 204 | − mova m2, m4 | |
| 205 | 238 | mova m0, [wq] ; wre |
| 206 | − mova m3, m5 | |
| 207 | 239 | mova m1, [wq+o1q] ; wim |
| 208 | − mulps m2, m0 ; r2*wre | |
| 240 | + mulps m2, m4, m0 ; r2*wre | |
| 209 | 241 | mova m6, Z2(6) ; r3 |
| 210 | − mulps m3, m1 ; i2*wim | |
| 242 | + mulps m3, m5, m1 ; i2*wim | |
| 211 | 243 | mova m7, Z2(7) ; i3 |
| 212 | − mulps m4, m1 ; r2*wim | |
| 213 | − mulps m5, m0 ; i2*wre | |
| 214 | − addps m2, m3 ; r2*wre + i2*wim | |
| 215 | − mova m3, m1 | |
| 216 | − mulps m1, m6 ; r3*wim | |
| 217 | − subps m5, m4 ; i2*wre - r2*wim | |
| 218 | − mova m4, m0 | |
| 219 | − mulps m3, m7 ; i3*wim | |
| 220 | − mulps m4, m6 ; r3*wre | |
| 221 | − mulps m0, m7 ; i3*wre | |
| 222 | − subps m4, m3 ; r3*wre - i3*wim | |
| 244 | + mulps m4, m4, m1 ; r2*wim | |
| 245 | + mulps m5, m5, m0 ; i2*wre | |
| 246 | + addps m2, m2, m3 ; r2*wre + i2*wim | |
| 247 | + mulps m3, m1, m7 ; i3*wim | |
| 248 | + mulps m1, m1, m6 ; r3*wim | |
| 249 | + subps m5, m5, m4 ; i2*wre - r2*wim | |
| 250 | + mulps m4, m0, m6 ; r3*wre | |
| 251 | + mulps m0, m0, m7 ; i3*wre | |
| 252 | + subps m4, m4, m3 ; r3*wre - i3*wim | |
| 223 | 253 | mova m3, Z(0) |
| 224 | − addps m0, m1 ; i3*wre + r3*wim | |
| 225 | − mova m1, m4 | |
| 226 | − addps m4, m2 ; t5 | |
| 227 | − subps m1, m2 ; t3 | |
| 228 | − subps m3, m4 ; r2 | |
| 229 | − addps m4, Z(0) ; r0 | |
| 254 | + addps m0, m0, m1 ; i3*wre + r3*wim | |
| 255 | + subps m1, m4, m2 ; t3 | |
| 256 | + addps m4, m4, m2 ; t5 | |
| 257 | + subps m3, m3, m4 ; r2 | |
| 258 | + addps m4, m4, Z(0) ; r0 | |
| 230 | 259 | mova m6, Z(2) |
| 231 | 260 | mova Z(4), m3 |
| 232 | 261 | mova Z(0), m4 |
| 233 | − mova m3, m5 | |
| 234 | − subps m5, m0 ; t4 | |
| 235 | − mova m4, m6 | |
| 236 | − subps m6, m5 ; r3 | |
| 237 | − addps m5, m4 ; r1 | |
| 238 | −IF%1 mova Z2(6), m6 | |
| 239 | −IF%1 mova Z(2), m5 | |
| 262 | + subps m3, m5, m0 ; t4 | |
| 263 | + subps m4, m6, m3 ; r3 | |
| 264 | + addps m3, m3, m6 ; r1 | |
| 265 | +IF%1 mova Z2(6), m4 | |
| 266 | +IF%1 mova Z(2), m3 | |
| 240 | 267 | mova m2, Z(3) |
| 241 | − addps m3, m0 ; t6 | |
| 242 | − subps m2, m1 ; i3 | |
| 268 | + addps m5, m5, m0 ; t6 | |
| 269 | + subps m2, m2, m1 ; i3 | |
| 243 | 270 | mova m7, Z(1) |
| 244 | − addps m1, Z(3) ; i1 | |
| 271 | + addps m1, m1, Z(3) ; i1 | |
| 245 | 272 | IF%1 mova Z2(7), m2 |
| 246 | 273 | IF%1 mova Z(3), m1 |
| 247 | − mova m4, m7 | |
| 248 | − subps m7, m3 ; i2 | |
| 249 | − addps m3, m4 ; i0 | |
| 250 | −IF%1 mova Z(5), m7 | |
| 251 | −IF%1 mova Z(1), m3 | |
| 274 | + subps m6, m7, m5 ; i2 | |
| 275 | + addps m5, m5, m7 ; i0 | |
| 276 | +IF%1 mova Z(5), m6 | |
| 277 | +IF%1 mova Z(1), m5 | |
| 252 | 278 | %if %1==0 |
| 253 | − mova m4, m5 ; r1 | |
| 254 | − mova m0, m6 ; r3 | |
| 255 | − unpcklps m5, m1 | |
| 256 | − unpckhps m4, m1 | |
| 257 | − unpcklps m6, m2 | |
| 258 | − unpckhps m0, m2 | |
| 279 | + INTERL m1, m3, m7, Z, 2 | |
| 280 | + INTERL m2, m4, m0, Z2, 6 | |
| 281 | + | |
| 259 | 282 | mova m1, Z(0) |
| 260 | 283 | mova m2, Z(4) |
| 261 | − mova Z(2), m5 | |
| 262 | − mova Z(3), m4 | |
| 263 | − mova Z2(6), m6 | |
| 264 | − mova Z2(7), m0 | |
| 265 | − mova m5, m1 ; r0 | |
| 266 | − mova m4, m2 ; r2 | |
| 267 | − unpcklps m1, m3 | |
| 268 | − unpckhps m5, m3 | |
| 269 | − unpcklps m2, m7 | |
| 270 | − unpckhps m4, m7 | |
| 271 | − mova Z(0), m1 | |
| 272 | − mova Z(1), m5 | |
| 273 | − mova Z(4), m2 | |
| 274 | − mova Z(5), m4 | |
| 284 | + | |
| 285 | + INTERL m5, m1, m3, Z, 0 | |
| 286 | + INTERL m6, m2, m7, Z, 4 | |
| 275 | 287 | %endif |
| 276 | 288 | %endmacro |
| 277 | 289 | |
| @@ -281,13 +293,106 @@ IF%1 mova Z(1), m3 · 3 unmodified lines | ||
| 281 | 293 | punpckhdq %3, %2 |
| 282 | 294 | %endmacro |
| 283 | 295 | |
| 284 | −INIT_XMM | |
| 285 | −%define mova movaps | |
| 286 | − | |
| 287 | 296 | %define Z(x) [r0+mmsize*x] |
| 288 | 297 | %define Z2(x) [r0+mmsize*x] |
| 298 | +%define ZH(x) [r0+mmsize*x+mmsize/2] | |
| 299 | + | |
| 300 | +INIT_YMM | |
| 301 | + | |
| 302 | +align 16 | |
| 303 | +fft8_avx: | |
| 304 | + mova m0, Z(0) | |
| 305 | + mova m1, Z(1) | |
| 306 | + T8_AVX m0, m1, m2, m3, m4 | |
| 307 | + mova Z(0), m0 | |
| 308 | + mova Z(1), m1 | |
| 309 | + ret | |
| 310 | + | |
| 311 | + | |
| 312 | +align 16 | |
| 313 | +fft16_avx: | |
| 314 | + mova m2, Z(2) | |
| 315 | + mova m3, Z(3) | |
| 316 | + T4_SSE m2, m3, m7 | |
| 317 | + | |
| 318 | + mova m0, Z(0) | |
| 319 | + mova m1, Z(1) | |
| 320 | + T8_AVX m0, m1, m4, m5, m7 | |
| 321 | + | |
| 322 | + mova m4, [ps_cos16_1] | |
| 323 | + mova m5, [ps_cos16_2] | |
| 324 | + vmulps m6, m2, m4 | |
| 325 | + vmulps m7, m3, m5 | |
| 326 | + vaddps m7, m7, m6 | |
| 327 | + vmulps m2, m2, m5 | |
| 328 | + vmulps m3, m3, m4 | |
| 329 | + vsubps m3, m3, m2 | |
| 330 | + vblendps m2, m7, m3, 0xf0 | |
| 331 | + vperm2f128 m3, m7, m3, 0x21 | |
| 332 | + vaddps m4, m2, m3 | |
| 333 | + vsubps m2, m3, m2 | |
| 334 | + vperm2f128 m2, m2, m2, 0x01 | |
| 335 | + vsubps m3, m1, m2 | |
| 336 | + vaddps m1, m1, m2 | |
| 337 | + vsubps m5, m0, m4 | |
| 338 | + vaddps m0, m0, m4 | |
| 339 | + vextractf128 Z(0), m0, 0 | |
| 340 | + vextractf128 ZH(0), m1, 0 | |
| 341 | + vextractf128 Z(1), m0, 1 | |
| 342 | + vextractf128 ZH(1), m1, 1 | |
| 343 | + vextractf128 Z(2), m5, 0 | |
| 344 | + vextractf128 ZH(2), m3, 0 | |
| 345 | + vextractf128 Z(3), m5, 1 | |
| 346 | + vextractf128 ZH(3), m3, 1 | |
| 347 | + ret | |
| 348 | + | |
| 349 | +align 16 | |
| 350 | +fft32_avx: | |
| 351 | + call fft16_avx | |
| 352 | + | |
| 353 | + mova m0, Z(4) | |
| 354 | + mova m1, Z(5) | |
| 355 | + | |
| 356 | + T4_SSE m0, m1, m4 | |
| 357 | + | |
| 358 | + mova m2, Z(6) | |
| 359 | + mova m3, Z(7) | |
| 360 | + | |
| 361 | + T8_SSE m0, m1, m2, m3, m4, m6 | |
| 362 | + ; m0={r0,r1,r2,r3,r8, r9, r10,r11} m1={i0,i1,i2,i3,i8, i9, i10,i11} | |
| 363 | + ; m2={r4,r5,r6,r7,r12,r13,r14,r15} m3={i4,i5,i6,i7,i12,i13,i14,i15} | |
| 364 | + | |
| 365 | + vperm2f128 m4, m0, m2, 0x20 | |
| 366 | + vperm2f128 m5, m1, m3, 0x20 | |
| 367 | + vperm2f128 m6, m0, m2, 0x31 | |
| 368 | + vperm2f128 m7, m1, m3, 0x31 | |
| 369 | + | |
| 370 | + PASS_SMALL 0, [cos_32], [cos_32+32] | |
| 371 | + | |
| 372 | + ret | |
| 373 | + | |
| 374 | +fft32_interleave_avx: | |
| 375 | + call fft32_avx | |
| 376 | + mov r2d, 32 | |
| 377 | +.deint_loop: | |
| 378 | + mova m2, Z(0) | |
| 379 | + mova m3, Z(1) | |
| 380 | + vunpcklps m0, m2, m3 | |
| 381 | + vunpckhps m1, m2, m3 | |
| 382 | + vextractf128 Z(0), m0, 0 | |
| 383 | + vextractf128 ZH(0), m1, 0 | |
| 384 | + vextractf128 Z(1), m0, 1 | |
| 385 | + vextractf128 ZH(1), m1, 1 | |
| 386 | + add r0, mmsize*2 | |
| 387 | + sub r2d, mmsize/4 | |
| 388 | + jg .deint_loop | |
| 389 | + ret | |
| 390 | + | |
| 391 | +INIT_XMM | |
| 392 | +%define movdqa movaps | |
| 289 | 393 | |
| 290 | 394 | align 16 |
| 395 | +fft4_avx: | |
| 291 | 396 | fft4_sse: |
| 292 | 397 | mova m0, Z(0) |
| 293 | 398 | mova m1, Z(1) |
| @@ -406,6 +511,8 @@ FFT48_3DN _3dn · 112 unmodified lines | ||
| 406 | 511 | |
| 407 | 512 | %define Z(x) [zq + o1q*(x&6) + mmsize*(x&1)] |
| 408 | 513 | %define Z2(x) [zq + o3q + mmsize*(x&1)] |
| 514 | +%define ZH(x) [zq + o1q*(x&6) + mmsize*(x&1) + mmsize/2] | |
| 515 | +%define Z2H(x) [zq + o3q + mmsize*(x&1) + mmsize/2] | |
| 409 | 516 | |
| 410 | 517 | %macro DECL_PASS 2+ ; name, payload |
| 411 | 518 | align 16 |
| @@ -423,8 +530,34 @@ DEFINE_ARGS z, w, n, o1, o3 · 11 unmodified lines | ||
| 423 | 530 | rep ret |
| 424 | 531 | %endmacro |
| 425 | 532 | |
| 533 | +INIT_YMM | |
| 534 | + | |
| 535 | +%macro INTERL_AVX 5 | |
| 536 | + vunpckhps %3, %2, %1 | |
| 537 | + vunpcklps %2, %2, %1 | |
| 538 | + vextractf128 %4(%5), %2, 0 | |
| 539 | + vextractf128 %4 %+ H(%5), %3, 0 | |
| 540 | + vextractf128 %4(%5 + 1), %2, 1 | |
| 541 | + vextractf128 %4 %+ H(%5 + 1), %3, 1 | |
| 542 | +%endmacro | |
| 543 | + | |
| 544 | +%define INTERL INTERL_AVX | |
| 545 | + | |
| 546 | +DECL_PASS pass_avx, PASS_BIG 1 | |
| 547 | +DECL_PASS pass_interleave_avx, PASS_BIG 0 | |
| 548 | + | |
| 426 | 549 | INIT_XMM |
| 427 | −%define mova movaps | |
| 550 | + | |
| 551 | +%macro INTERL_SSE 5 | |
| 552 | + mova %3, %2 | |
| 553 | + unpcklps %2, %1 | |
| 554 | + unpckhps %3, %1 | |
| 555 | + mova %4(%5), %2 | |
| 556 | + mova %4(%5+1), %3 | |
| 557 | +%endmacro | |
| 558 | + | |
| 559 | +%define INTERL INTERL_SSE | |
| 560 | + | |
| 428 | 561 | DECL_PASS pass_sse, PASS_BIG 1 |
| 429 | 562 | DECL_PASS pass_interleave_sse, PASS_BIG 0 |
| 430 | 563 | |
| @@ -457,9 +590,12 @@ DECL_PASS pass_interleave_3dn, PASS_BIG 0 · 26 unmodified lines | ||
| 457 | 590 | |
| 458 | 591 | %macro DECL_FFT 2-3 ; nbits, cpu, suffix |
| 459 | 592 | %xdefine list_of_fft fft4%2 SECTION_REL, fft8%2 SECTION_REL |
| 460 | −%if %1==5 | |
| 593 | +%if %1>=5 | |
| 461 | 594 | %xdefine list_of_fft list_of_fft, fft16%2 SECTION_REL |
| 462 | 595 | %endif |
| 596 | +%if %1>=6 | |
| 597 | +%xdefine list_of_fft list_of_fft, fft32%3%2 SECTION_REL | |
| 598 | +%endif | |
| 463 | 599 | |
| 464 | 600 | %assign n 1<<%1 |
| 465 | 601 | %rep 17-%1 |
| @@ -492,9 +628,14 @@ section .text · 26 unmodified lines | ||
| 492 | 628 | ; The others pass args in registers and don't spill anything. |
| 493 | 629 | cglobal fft_dispatch%3%2, 2,5,8, z, nbits |
| 494 | 630 | FFT_DISPATCH %3%2, nbits |
| 631 | +%ifidn %2, _avx | |
| 632 | + vzeroupper | |
| 633 | +%endif | |
| 495 | 634 | RET |
| 496 | 635 | %endmacro ; DECL_FFT |
| 497 | 636 | |
| 637 | +DECL_FFT 6, _avx | |
| 638 | +DECL_FFT 6, _avx, _interleave | |
| 498 | 639 | DECL_FFT 5, _sse |
| 499 | 640 | DECL_FFT 5, _sse, _interleave |
| 500 | 641 | DECL_FFT 4, _3dn |
| @@ -533,21 +674,53 @@ INIT_XMM · 32 unmodified lines | ||
| 533 | 674 | %endmacro |
| 534 | 675 | |
| 535 | 676 | %macro CMUL 6 ;j, xmm0, xmm1, 3, 4, 5 |
| 536 | − movaps xmm6, [%4+%1*2] | |
| 537 | − movaps %2, [%4+%1*2+0x10] | |
| 538 | − movaps %3, xmm6 | |
| 539 | − movaps xmm7, %2 | |
| 540 | − mulps xmm6, [%5+%1] | |
| 541 | − mulps %2, [%6+%1] | |
| 542 | − mulps %3, [%6+%1] | |
| 543 | − mulps xmm7, [%5+%1] | |
| 544 | − subps %2, xmm6 | |
| 545 | − addps %3, xmm7 | |
| 677 | + mulps m6, %3, [%5+%1] | |
| 678 | + mulps m7, %2, [%5+%1] | |
| 679 | + mulps %2, %2, [%6+%1] | |
| 680 | + mulps %3, %3, [%6+%1] | |
| 681 | + subps %2, %2, m6 | |
| 682 | + addps %3, %3, m7 | |
| 683 | +%endmacro | |
| 684 | + | |
| 685 | +%macro POSROTATESHUF_AVX 5 ;j, k, z+n8, tcos+n8, tsin+n8 | |
| 686 | +.post: | |
| 687 | + vmovaps ymm1, [%3+%1*2] | |
| 688 | + vmovaps ymm0, [%3+%1*2+0x20] | |
| 689 | + vmovaps ymm3, [%3+%2*2] | |
| 690 | + vmovaps ymm2, [%3+%2*2+0x20] | |
| 691 | + | |
| 692 | + CMUL %1, ymm0, ymm1, %3, %4, %5 | |
| 693 | + CMUL %2, ymm2, ymm3, %3, %4, %5 | |
| 694 | + vshufps ymm1, ymm1, ymm1, 0x1b | |
| 695 | + vshufps ymm3, ymm3, ymm3, 0x1b | |
| 696 | + vperm2f128 ymm1, ymm1, ymm1, 0x01 | |
| 697 | + vperm2f128 ymm3, ymm3, ymm3, 0x01 | |
| 698 | + vunpcklps ymm6, ymm2, ymm1 | |
| 699 | + vunpckhps ymm4, ymm2, ymm1 | |
| 700 | + vunpcklps ymm7, ymm0, ymm3 | |
| 701 | + vunpckhps ymm5, ymm0, ymm3 | |
| 702 | + | |
| 703 | + vextractf128 [%3+%1*2], ymm7, 0 | |
| 704 | + vextractf128 [%3+%1*2+0x10], ymm5, 0 | |
| 705 | + vextractf128 [%3+%1*2+0x20], ymm7, 1 | |
| 706 | + vextractf128 [%3+%1*2+0x30], ymm5, 1 | |
| 707 | + | |
| 708 | + vextractf128 [%3+%2*2], ymm6, 0 | |
| 709 | + vextractf128 [%3+%2*2+0x10], ymm4, 0 | |
| 710 | + vextractf128 [%3+%2*2+0x20], ymm6, 1 | |
| 711 | + vextractf128 [%3+%2*2+0x30], ymm4, 1 | |
| 712 | + sub %2, 0x20 | |
| 713 | + add %1, 0x20 | |
| 714 | + jl .post | |
| 546 | 715 | %endmacro |
| 547 | 716 | |
| 548 | 717 | %macro POSROTATESHUF 5 ;j, k, z+n8, tcos+n8, tsin+n8 |
| 549 | 718 | .post: |
| 719 | + movaps xmm1, [%3+%1*2] | |
| 720 | + movaps xmm0, [%3+%1*2+0x10] | |
| 550 | 721 | CMUL %1, xmm0, xmm1, %3, %4, %5 |
| 722 | + movaps xmm5, [%3+%2*2] | |
| 723 | + movaps xmm4, [%3+%2*2+0x10] | |
| 551 | 724 | CMUL %2, xmm4, xmm5, %3, %4, %5 |
| 552 | 725 | shufps xmm1, xmm1, 0x1b |
| 553 | 726 | shufps xmm5, xmm5, 0x1b |
| @@ -566,7 +739,8 @@ INIT_XMM · 12 unmodified lines | ||
| 566 | 739 | jl .post |
| 567 | 740 | %endmacro |
| 568 | 741 | |
| 569 | −cglobal imdct_half_sse, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *input | |
| 742 | +%macro DECL_IMDCT 2 | |
| 743 | +cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *input | |
| 570 | 744 | %ifdef ARCH_X86_64 |
| 571 | 745 | %define rrevtab r10 |
| 572 | 746 | %define rtcos r11 |
| @@ -641,7 +815,7 @@ cglobal imdct_half_sse, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample · 68 unmodified lines | ||
| 641 | 815 | mov r0, r1 |
| 642 | 816 | mov r1d, [r5+FFTContext.nbits] |
| 643 | 817 | |
| 644 | − FFT_DISPATCH _sse, r1 | |
| 818 | + FFT_DISPATCH %1, r1 | |
| 645 | 819 | |
| 646 | 820 | mov r0d, [r5+FFTContext.mdctsize] |
| 647 | 821 | add r6, r0 |
| @@ -653,14 +827,24 @@ cglobal imdct_half_sse, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample · 5 unmodified lines | ||
| 653 | 827 | mov rtsin, [esp+4] |
| 654 | 828 | %endif |
| 655 | 829 | neg r0 |
| 656 | − mov r1, -16 | |
| 830 | + mov r1, -mmsize | |
| 657 | 831 | sub r1, r0 |
| 658 | − POSROTATESHUF r0, r1, r6, rtcos, rtsin | |
| 832 | + %2 r0, r1, r6, rtcos, rtsin | |
| 659 | 833 | %ifdef ARCH_X86_64 |
| 660 | 834 | pop r14 |
| 661 | 835 | pop r13 |
| 662 | 836 | pop r12 |
| 663 | 837 | %else |
| 664 | 838 | add esp, 12 |
| 839 | +%endif | |
| 840 | +%ifidn avx_enabled, 1 | |
| 841 | + vzeroupper | |
| 665 | 842 | %endif |
| 666 | 843 | RET |
| 844 | +%endmacro | |
| 845 | + | |
| 846 | +DECL_IMDCT _sse, POSROTATESHUF | |
| 847 | + | |
| 848 | +INIT_YMM | |
| 849 | + | |
| 850 | +DECL_IMDCT _avx, POSROTATESHUF_AVX | |
| @@ -28,6 +28,12 @@ DECLARE_ASM_CONST(16, int, ff_m1m1m1m1)[4] = · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | void ff_fft_dispatch_sse(FFTComplex *z, int nbits); |
| 30 | 30 | void ff_fft_dispatch_interleave_sse(FFTComplex *z, int nbits); |
| 31 | +void ff_fft_dispatch_interleave_avx(FFTComplex *z, int nbits); | |
| 32 | + | |
| 33 | +void ff_fft_calc_avx(FFTContext *s, FFTComplex *z) | |
| 34 | +{ | |
| 35 | + ff_fft_dispatch_interleave_avx(z, s->nbits); | |
| 36 | +} | |
| 31 | 37 | |
| 32 | 38 | void ff_fft_calc_sse(FFTContext *s, FFTComplex *z) |
| 33 | 39 | { |
| @@ -77,7 +83,7 @@ void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input) · 43 unmodified lines | ||
| 77 | 83 | long n = s->mdct_size; |
| 78 | 84 | long n4 = n >> 2; |
| 79 | 85 | |
| 80 | − ff_imdct_half_sse(s, output+n4, input); | |
| 86 | + s->imdct_half(s, output + n4, input); | |
| 81 | 87 | |
| 82 | 88 | j = -n; |
| 83 | 89 | k = n-16; |
| @@ -1,10 +1,11 @@ | ||
| 1 | 1 | ;***************************************************************************** |
| 2 | 2 | ;* x86inc.asm |
| 3 | 3 | ;***************************************************************************** |
| 4 | −;* Copyright (C) 2005-2008 x264 project | |
| 4 | +;* Copyright (C) 2005-2011 x264 project | |
| 5 | 5 | ;* |
| 6 | 6 | ;* Authors: Loren Merritt <lorenm@u.washington.edu> |
| 7 | 7 | ;* Anton Mitrofanov <BugMaster@narod.ru> |
| 8 | +;* Jason Garrett-Glaser <darkshikari@gmail.com> | |
| 8 | 9 | ;* |
| 9 | 10 | ;* Permission to use, copy, modify, and/or distribute this software for any |
| 10 | 11 | ;* purpose with or without fee is hereby granted, provided that the above |
| @@ -499,6 +500,7 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits · 488 unmodified lines | ||
| 499 | 500 | %endmacro |
| 500 | 501 | |
| 501 | 502 | %macro INIT_MMX 0 |
| 503 | + %assign avx_enabled 0 | |
| 502 | 504 | %define RESET_MM_PERMUTATION INIT_MMX |
| 503 | 505 | %define mmsize 8 |
| 504 | 506 | %define num_mmregs 8 |
| @@ -520,6 +522,7 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits · 15 unmodified lines | ||
| 520 | 522 | %endmacro |
| 521 | 523 | |
| 522 | 524 | %macro INIT_XMM 0 |
| 525 | + %assign avx_enabled 0 | |
| 523 | 526 | %define RESET_MM_PERMUTATION INIT_XMM |
| 524 | 527 | %define mmsize 16 |
| 525 | 528 | %define num_mmregs 8 |
| @@ -538,6 +541,31 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits · 12 unmodified lines | ||
| 538 | 541 | %endrep |
| 539 | 542 | %endmacro |
| 540 | 543 | |
| 544 | +%macro INIT_AVX 0 | |
| 545 | + INIT_XMM | |
| 546 | + %assign avx_enabled 1 | |
| 547 | + %define PALIGNR PALIGNR_SSSE3 | |
| 548 | + %define RESET_MM_PERMUTATION INIT_AVX | |
| 549 | +%endmacro | |
| 550 | + | |
| 551 | +%macro INIT_YMM 0 | |
| 552 | + %assign avx_enabled 1 | |
| 553 | + %define RESET_MM_PERMUTATION INIT_YMM | |
| 554 | + %define mmsize 32 | |
| 555 | + %define num_mmregs 8 | |
| 556 | + %ifdef ARCH_X86_64 | |
| 557 | + %define num_mmregs 16 | |
| 558 | + %endif | |
| 559 | + %define mova vmovaps | |
| 560 | + %define movu vmovups | |
| 561 | + %assign %%i 0 | |
| 562 | + %rep num_mmregs | |
| 563 | + CAT_XDEFINE m, %%i, ymm %+ %%i | |
| 564 | + CAT_XDEFINE nymm, %%i, %%i | |
| 565 | + %assign %%i %%i+1 | |
| 566 | + %endrep | |
| 567 | +%endmacro | |
| 568 | + | |
| 541 | 569 | INIT_MMX |
| 542 | 570 | |
| 543 | 571 | ; I often want to use macros that permute their arguments. e.g. there's no |
| @@ -645,3 +673,222 @@ INIT_MMX · 101 unmodified lines | ||
| 645 | 673 | sub %1, %2 |
| 646 | 674 | %endif |
| 647 | 675 | %endmacro |
| 676 | + | |
| 677 | +;============================================================================= | |
| 678 | +; AVX abstraction layer | |
| 679 | +;============================================================================= | |
| 680 | + | |
| 681 | +%assign i 0 | |
| 682 | +%rep 16 | |
| 683 | + %if i < 8 | |
| 684 | + CAT_XDEFINE sizeofmm, i, 8 | |
| 685 | + %endif | |
| 686 | + CAT_XDEFINE sizeofxmm, i, 16 | |
| 687 | + CAT_XDEFINE sizeofymm, i, 32 | |
| 688 | +%assign i i+1 | |
| 689 | +%endrep | |
| 690 | +%undef i | |
| 691 | + | |
| 692 | +;%1 == instruction | |
| 693 | +;%2 == 1 if float, 0 if int | |
| 694 | +;%3 == 0 if 3-operand (xmm, xmm, xmm), 1 if 4-operand (xmm, xmm, xmm, imm) | |
| 695 | +;%4 == number of operands given | |
| 696 | +;%5+: operands | |
| 697 | +%macro RUN_AVX_INSTR 6-7+ | |
| 698 | + %if sizeof%5==32 | |
| 699 | + v%1 %5, %6, %7 | |
| 700 | + %else | |
| 701 | + %if sizeof%5==8 | |
| 702 | + %define %%regmov movq | |
| 703 | + %elif %2 | |
| 704 | + %define %%regmov movaps | |
| 705 | + %else | |
| 706 | + %define %%regmov movdqa | |
| 707 | + %endif | |
| 708 | + | |
| 709 | + %if %4>=3+%3 | |
| 710 | + %ifnidn %5, %6 | |
| 711 | + %if avx_enabled && sizeof%5==16 | |
| 712 | + v%1 %5, %6, %7 | |
| 713 | + %else | |
| 714 | + %%regmov %5, %6 | |
| 715 | + %1 %5, %7 | |
| 716 | + %endif | |
| 717 | + %else | |
| 718 | + %1 %5, %7 | |
| 719 | + %endif | |
| 720 | + %elif %3 | |
| 721 | + %1 %5, %6, %7 | |
| 722 | + %else | |
| 723 | + %1 %5, %6 | |
| 724 | + %endif | |
| 725 | + %endif | |
| 726 | +%endmacro | |
| 727 | + | |
| 728 | +;%1 == instruction | |
| 729 | +;%2 == 1 if float, 0 if int | |
| 730 | +;%3 == 0 if 3-operand (xmm, xmm, xmm), 1 if 4-operand (xmm, xmm, xmm, imm) | |
| 731 | +%macro AVX_INSTR 3 | |
| 732 | + %macro %1 2-8 fnord, fnord, fnord, %1, %2, %3 | |
| 733 | + %ifidn %3, fnord | |
| 734 | + RUN_AVX_INSTR %6, %7, %8, 2, %1, %2 | |
| 735 | + %elifidn %4, fnord | |
| 736 | + RUN_AVX_INSTR %6, %7, %8, 3, %1, %2, %3 | |
| 737 | + %elifidn %5, fnord | |
| 738 | + RUN_AVX_INSTR %6, %7, %8, 4, %1, %2, %3, %4 | |
| 739 | + %else | |
| 740 | + RUN_AVX_INSTR %6, %7, %8, 5, %1, %2, %3, %4, %5 | |
| 741 | + %endif | |
| 742 | + %endmacro | |
| 743 | +%endmacro | |
| 744 | + | |
| 745 | +AVX_INSTR addpd, 1, 0 | |
| 746 | +AVX_INSTR addps, 1, 0 | |
| 747 | +AVX_INSTR addsd, 1, 0 | |
| 748 | +AVX_INSTR addss, 1, 0 | |
| 749 | +AVX_INSTR addsubpd, 1, 0 | |
| 750 | +AVX_INSTR addsubps, 1, 0 | |
| 751 | +AVX_INSTR andpd, 1, 0 | |
| 752 | +AVX_INSTR andps, 1, 0 | |
| 753 | +AVX_INSTR andnpd, 1, 0 | |
| 754 | +AVX_INSTR andnps, 1, 0 | |
| 755 | +AVX_INSTR blendpd, 1, 0 | |
| 756 | +AVX_INSTR blendps, 1, 0 | |
| 757 | +AVX_INSTR blendvpd, 1, 0 | |
| 758 | +AVX_INSTR blendvps, 1, 0 | |
| 759 | +AVX_INSTR cmppd, 1, 0 | |
| 760 | +AVX_INSTR cmpps, 1, 0 | |
| 761 | +AVX_INSTR cmpsd, 1, 0 | |
| 762 | +AVX_INSTR cmpss, 1, 0 | |
| 763 | +AVX_INSTR divpd, 1, 0 | |
| 764 | +AVX_INSTR divps, 1, 0 | |
| 765 | +AVX_INSTR divsd, 1, 0 | |
| 766 | +AVX_INSTR divss, 1, 0 | |
| 767 | +AVX_INSTR dppd, 1, 0 | |
| 768 | +AVX_INSTR dpps, 1, 0 | |
| 769 | +AVX_INSTR haddpd, 1, 0 | |
| 770 | +AVX_INSTR haddps, 1, 0 | |
| 771 | +AVX_INSTR hsubpd, 1, 0 | |
| 772 | +AVX_INSTR hsubps, 1, 0 | |
| 773 | +AVX_INSTR maxpd, 1, 0 | |
| 774 | +AVX_INSTR maxps, 1, 0 | |
| 775 | +AVX_INSTR maxsd, 1, 0 | |
| 776 | +AVX_INSTR maxss, 1, 0 | |
| 777 | +AVX_INSTR minpd, 1, 0 | |
| 778 | +AVX_INSTR minps, 1, 0 | |
| 779 | +AVX_INSTR minsd, 1, 0 | |
| 780 | +AVX_INSTR minss, 1, 0 | |
| 781 | +AVX_INSTR mpsadbw, 0, 1 | |
| 782 | +AVX_INSTR mulpd, 1, 0 | |
| 783 | +AVX_INSTR mulps, 1, 0 | |
| 784 | +AVX_INSTR mulsd, 1, 0 | |
| 785 | +AVX_INSTR mulss, 1, 0 | |
| 786 | +AVX_INSTR orpd, 1, 0 | |
| 787 | +AVX_INSTR orps, 1, 0 | |
| 788 | +AVX_INSTR packsswb, 0, 0 | |
| 789 | +AVX_INSTR packssdw, 0, 0 | |
| 790 | +AVX_INSTR packuswb, 0, 0 | |
| 791 | +AVX_INSTR packusdw, 0, 0 | |
| 792 | +AVX_INSTR paddb, 0, 0 | |
| 793 | +AVX_INSTR paddw, 0, 0 | |
| 794 | +AVX_INSTR paddd, 0, 0 | |
| 795 | +AVX_INSTR paddq, 0, 0 | |
| 796 | +AVX_INSTR paddsb, 0, 0 | |
| 797 | +AVX_INSTR paddsw, 0, 0 | |
| 798 | +AVX_INSTR paddusb, 0, 0 | |
| 799 | +AVX_INSTR paddusw, 0, 0 | |
| 800 | +AVX_INSTR palignr, 0, 1 | |
| 801 | +AVX_INSTR pand, 0, 0 | |
| 802 | +AVX_INSTR pandn, 0, 0 | |
| 803 | +AVX_INSTR pavgb, 0, 0 | |
| 804 | +AVX_INSTR pavgw, 0, 0 | |
| 805 | +AVX_INSTR pblendvb, 0, 0 | |
| 806 | +AVX_INSTR pblendw, 0, 1 | |
| 807 | +AVX_INSTR pcmpestri, 0, 0 | |
| 808 | +AVX_INSTR pcmpestrm, 0, 0 | |
| 809 | +AVX_INSTR pcmpistri, 0, 0 | |
| 810 | +AVX_INSTR pcmpistrm, 0, 0 | |
| 811 | +AVX_INSTR pcmpeqb, 0, 0 | |
| 812 | +AVX_INSTR pcmpeqw, 0, 0 | |
| 813 | +AVX_INSTR pcmpeqd, 0, 0 | |
| 814 | +AVX_INSTR pcmpeqq, 0, 0 | |
| 815 | +AVX_INSTR pcmpgtb, 0, 0 | |
| 816 | +AVX_INSTR pcmpgtw, 0, 0 | |
| 817 | +AVX_INSTR pcmpgtd, 0, 0 | |
| 818 | +AVX_INSTR pcmpgtq, 0, 0 | |
| 819 | +AVX_INSTR phaddw, 0, 0 | |
| 820 | +AVX_INSTR phaddd, 0, 0 | |
| 821 | +AVX_INSTR phaddsw, 0, 0 | |
| 822 | +AVX_INSTR phsubw, 0, 0 | |
| 823 | +AVX_INSTR phsubd, 0, 0 | |
| 824 | +AVX_INSTR phsubsw, 0, 0 | |
| 825 | +AVX_INSTR pmaddwd, 0, 0 | |
| 826 | +AVX_INSTR pmaddubsw, 0, 0 | |
| 827 | +AVX_INSTR pmaxsb, 0, 0 | |
| 828 | +AVX_INSTR pmaxsw, 0, 0 | |
| 829 | +AVX_INSTR pmaxsd, 0, 0 | |
| 830 | +AVX_INSTR pmaxub, 0, 0 | |
| 831 | +AVX_INSTR pmaxuw, 0, 0 | |
| 832 | +AVX_INSTR pmaxud, 0, 0 | |
| 833 | +AVX_INSTR pminsb, 0, 0 | |
| 834 | +AVX_INSTR pminsw, 0, 0 | |
| 835 | +AVX_INSTR pminsd, 0, 0 | |
| 836 | +AVX_INSTR pminub, 0, 0 | |
| 837 | +AVX_INSTR pminuw, 0, 0 | |
| 838 | +AVX_INSTR pminud, 0, 0 | |
| 839 | +AVX_INSTR pmulhuw, 0, 0 | |
| 840 | +AVX_INSTR pmulhrsw, 0, 0 | |
| 841 | +AVX_INSTR pmulhw, 0, 0 | |
| 842 | +AVX_INSTR pmullw, 0, 0 | |
| 843 | +AVX_INSTR pmulld, 0, 0 | |
| 844 | +AVX_INSTR pmuludq, 0, 0 | |
| 845 | +AVX_INSTR pmuldq, 0, 0 | |
| 846 | +AVX_INSTR por, 0, 0 | |
| 847 | +AVX_INSTR psadbw, 0, 0 | |
| 848 | +AVX_INSTR pshufb, 0, 0 | |
| 849 | +AVX_INSTR psignb, 0, 0 | |
| 850 | +AVX_INSTR psignw, 0, 0 | |
| 851 | +AVX_INSTR psignd, 0, 0 | |
| 852 | +AVX_INSTR psllw, 0, 0 | |
| 853 | +AVX_INSTR pslld, 0, 0 | |
| 854 | +AVX_INSTR psllq, 0, 0 | |
| 855 | +AVX_INSTR pslldq, 0, 0 | |
| 856 | +AVX_INSTR psraw, 0, 0 | |
| 857 | +AVX_INSTR psrad, 0, 0 | |
| 858 | +AVX_INSTR psrlw, 0, 0 | |
| 859 | +AVX_INSTR psrld, 0, 0 | |
| 860 | +AVX_INSTR psrlq, 0, 0 | |
| 861 | +AVX_INSTR psrldq, 0, 0 | |
| 862 | +AVX_INSTR psubb, 0, 0 | |
| 863 | +AVX_INSTR psubw, 0, 0 | |
| 864 | +AVX_INSTR psubd, 0, 0 | |
| 865 | +AVX_INSTR psubq, 0, 0 | |
| 866 | +AVX_INSTR psubsb, 0, 0 | |
| 867 | +AVX_INSTR psubsw, 0, 0 | |
| 868 | +AVX_INSTR psubusb, 0, 0 | |
| 869 | +AVX_INSTR psubusw, 0, 0 | |
| 870 | +AVX_INSTR punpckhbw, 0, 0 | |
| 871 | +AVX_INSTR punpckhwd, 0, 0 | |
| 872 | +AVX_INSTR punpckhdq, 0, 0 | |
| 873 | +AVX_INSTR punpckhqdq, 0, 0 | |
| 874 | +AVX_INSTR punpcklbw, 0, 0 | |
| 875 | +AVX_INSTR punpcklwd, 0, 0 | |
| 876 | +AVX_INSTR punpckldq, 0, 0 | |
| 877 | +AVX_INSTR punpcklqdq, 0, 0 | |
| 878 | +AVX_INSTR pxor, 0, 0 | |
| 879 | +AVX_INSTR shufps, 0, 1 | |
| 880 | +AVX_INSTR subpd, 1, 0 | |
| 881 | +AVX_INSTR subps, 1, 0 | |
| 882 | +AVX_INSTR subsd, 1, 0 | |
| 883 | +AVX_INSTR subss, 1, 0 | |
| 884 | +AVX_INSTR unpckhpd, 1, 0 | |
| 885 | +AVX_INSTR unpckhps, 1, 0 | |
| 886 | +AVX_INSTR unpcklpd, 1, 0 | |
| 887 | +AVX_INSTR unpcklps, 1, 0 | |
| 888 | +AVX_INSTR xorpd, 1, 0 | |
| 889 | +AVX_INSTR xorps, 1, 0 | |
| 890 | + | |
| 891 | +; 3DNow instructions, for sharing code between AVX, SSE and 3DN | |
| 892 | +AVX_INSTR pfadd, 1, 0 | |
| 893 | +AVX_INSTR pfsub, 1, 0 | |
| 894 | +AVX_INSTR pfmul, 1, 0 | |
| @@ -26,8 +26,8 @@ · 25 unmodified lines | ||
| 26 | 26 | #include "libavutil/samplefmt.h" |
| 27 | 27 | |
| 28 | 28 | #define LIBAVFILTER_VERSION_MAJOR 2 |
| 29 | −#define LIBAVFILTER_VERSION_MINOR 0 | |
| 30 | −#define LIBAVFILTER_VERSION_MICRO 0 | |
| 29 | +#define LIBAVFILTER_VERSION_MINOR 3 | |
| 30 | +#define LIBAVFILTER_VERSION_MICRO 1 | |
| 31 | 31 | |
| 32 | 32 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| 33 | 33 | LIBAVFILTER_VERSION_MINOR, \ |
| @@ -115,7 +115,7 @@ typedef struct AVFilterBufferRefVideoProps { · 81 unmodified lines | ||
| 115 | 115 | AVRational pixel_aspect; ///< pixel aspect ratio |
| 116 | 116 | int interlaced; ///< is frame interlaced |
| 117 | 117 | int top_field_first; ///< field order |
| 118 | − int pict_type; ///< Picture type of the frame | |
| 118 | + enum AVPictureType pict_type; ///< picture type of the frame | |
| 119 | 119 | int key_frame; ///< 1 -> keyframe, 0-> not |
| 120 | 120 | } AVFilterBufferRefVideoProps; |
| 121 | 121 | |
| @@ -75,8 +75,8 @@ typedef struct { · 74 unmodified lines | ||
| 75 | 75 | int input_is_pal; ///< set to 1 if the input format is paletted |
| 76 | 76 | int interlaced; |
| 77 | 77 | |
| 78 | − char w_expr[256]; ///< width expression string | |
| 79 | − char h_expr[256]; ///< height expression string | |
| 78 | + char w_expr[256]; ///< width expression string | |
| 79 | + char h_expr[256]; ///< height expression string | |
| 80 | 80 | } ScaleContext; |
| 81 | 81 | |
| 82 | 82 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * Copyright (C) 2006-2010 Michael Niedermayer <michaelni@gmx.at> |
| 3 | − * 2010 James Darnley <james.darnley@gmail.com> | |
| 4 | − * This file is part of FFmpeg. | |
| 3 | + * 2010 James Darnley <james.darnley@gmail.com> | |
| 5 | 4 | * |
| 6 | 5 | * FFmpeg is free software; you can redistribute it and/or modify |
| 7 | 6 | * it under the terms of the GNU General Public License as published by |
| @@ -131,7 +131,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 130 unmodified lines | ||
| 131 | 131 | (n = sscanf(args, "%d:%d:%127[^:]:%d:%d:%d:%d", &c->w, &c->h, pix_fmt_str, |
| 132 | 132 | &c->time_base.num, &c->time_base.den, |
| 133 | 133 | &c->pixel_aspect.num, &c->pixel_aspect.den)) != 7) { |
| 134 | − av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but %d found in '%s'\n", n, args); | |
| 134 | + av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but only %d found in '%s'\n", n, args); | |
| 135 | 135 | return AVERROR(EINVAL); |
| 136 | 136 | } |
| 137 | 137 | if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) { |
| @@ -175,7 +175,6 @@ static void build_frame_code(AVFormatContext *s){ · 174 unmodified lines | ||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | key_frame= intra_only; |
| 178 | −#if 1 | |
| 179 | 178 | if(is_audio){ |
| 180 | 179 | int frame_bytes= codec->frame_size*(int64_t)codec->bit_rate / (8*codec->sample_rate); |
| 181 | 180 | int pts; |
| @@ -199,7 +198,6 @@ static void build_frame_code(AVFormatContext *s){ · 17 unmodified lines | ||
| 199 | 198 | ft->pts_delta=1; |
| 200 | 199 | start2++; |
| 201 | 200 | } |
| 202 | −#endif | |
| 203 | 201 | |
| 204 | 202 | if(codec->has_b_frames){ |
| 205 | 203 | pred_count=5; |
| @@ -40,7 +40,7 @@ · 39 unmodified lines | ||
| 40 | 40 | #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) |
| 41 | 41 | |
| 42 | 42 | #define LIBAVUTIL_VERSION_MAJOR 51 |
| 43 | −#define LIBAVUTIL_VERSION_MINOR 0 | |
| 43 | +#define LIBAVUTIL_VERSION_MINOR 1 | |
| 44 | 44 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 45 | 45 | |
| 46 | 46 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| @@ -97,6 +97,25 @@ enum AVMediaType { · 50 unmodified lines | ||
| 97 | 97 | #define AV_TIME_BASE 1000000 |
| 98 | 98 | #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} |
| 99 | 99 | |
| 100 | +enum AVPictureType { | |
| 101 | + AV_PICTURE_TYPE_I = 1, ///< Intra | |
| 102 | + AV_PICTURE_TYPE_P, ///< Predicted | |
| 103 | + AV_PICTURE_TYPE_B, ///< Bi-dir predicted | |
| 104 | + AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 | |
| 105 | + AV_PICTURE_TYPE_SI, ///< Switching Intra | |
| 106 | + AV_PICTURE_TYPE_SP, ///< Switching Predicted | |
| 107 | + AV_PICTURE_TYPE_BI, ///< BI type | |
| 108 | +}; | |
| 109 | + | |
| 110 | +/** | |
| 111 | + * Return a single letter to describe the given picture type | |
| 112 | + * pict_type. | |
| 113 | + * | |
| 114 | + * @param[in] pict_type the picture type @return a single character | |
| 115 | + * representing the picture type, '?' if pict_type is unknown | |
| 116 | + */ | |
| 117 | +char av_get_picture_type_char(enum AVPictureType pict_type); | |
| 118 | + | |
| 100 | 119 | #include "common.h" |
| 101 | 120 | #include "error.h" |
| 102 | 121 | #include "mathematics.h" |
| @@ -69,21 +69,21 @@ void *av_malloc(size_t size) · 68 unmodified lines | ||
| 69 | 69 | #endif |
| 70 | 70 | |
| 71 | 71 | /* let's disallow possible ambiguous cases */ |
| 72 | − if(size > (INT_MAX-16) ) | |
| 72 | + if(size > (INT_MAX-32) ) | |
| 73 | 73 | return NULL; |
| 74 | 74 | |
| 75 | 75 | #if CONFIG_MEMALIGN_HACK |
| 76 | − ptr = malloc(size+16); | |
| 76 | + ptr = malloc(size+32); | |
| 77 | 77 | if(!ptr) |
| 78 | 78 | return ptr; |
| 79 | − diff= ((-(long)ptr - 1)&15) + 1; | |
| 79 | + diff= ((-(long)ptr - 1)&31) + 1; | |
| 80 | 80 | ptr = (char*)ptr + diff; |
| 81 | 81 | ((char*)ptr)[-1]= diff; |
| 82 | 82 | #elif HAVE_POSIX_MEMALIGN |
| 83 | − if (posix_memalign(&ptr,16,size)) | |
| 83 | + if (posix_memalign(&ptr,32,size)) | |
| 84 | 84 | ptr = NULL; |
| 85 | 85 | #elif HAVE_MEMALIGN |
| 86 | − ptr = memalign(16,size); | |
| 86 | + ptr = memalign(32,size); | |
| 87 | 87 | /* Why 64? |
| 88 | 88 | Indeed, we should align it: |
| 89 | 89 | on 4 for 386 |
| @@ -93,10 +93,8 @@ void *av_malloc(size_t size) · 3 unmodified lines | ||
| 93 | 93 | Because L1 and L2 caches are aligned on those values. |
| 94 | 94 | But I don't want to code such logic here! |
| 95 | 95 | */ |
| 96 | − /* Why 16? | |
| 97 | − Because some CPUs need alignment, for example SSE2 on P4, & most RISC CPUs | |
| 98 | − it will just trigger an exception and the unaligned load will be done in the | |
| 99 | − exception handler or it will just segfault (SSE2 on P4). | |
| 96 | + /* Why 32? | |
| 97 | + For AVX ASM. SSE / NEON needs only 16. | |
| 100 | 98 | Why not larger? Because I did not see a difference in benchmarks ... |
| 101 | 99 | */ |
| 102 | 100 | /* benchmarks with P3 |
| @@ -218,7 +218,6 @@ int main(void){ · 217 unmodified lines | ||
| 218 | 218 | printf("\n"); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | −#if 1 | |
| 222 | 221 | for(i=0; i<LEN; i++){ |
| 223 | 222 | double v[LEN]; |
| 224 | 223 | double error=0; |
| @@ -233,7 +232,7 @@ int main(void){ · 8 unmodified lines | ||
| 233 | 232 | printf("%f ", error); |
| 234 | 233 | } |
| 235 | 234 | printf("\n"); |
| 236 | −#endif | |
| 235 | + | |
| 237 | 236 | for(i=0; i<LEN; i++){ |
| 238 | 237 | for(j=0; j<LEN; j++){ |
| 239 | 238 | printf("%9.6f ", eigenvector[i + j*LEN]); |
| @@ -39,3 +39,17 @@ const char *avutil_license(void) · 38 unmodified lines | ||
| 39 | 39 | #define LICENSE_PREFIX "libavutil license: " |
| 40 | 40 | return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; |
| 41 | 41 | } |
| 42 | + | |
| 43 | +char av_get_picture_type_char(enum AVPictureType pict_type) | |
| 44 | +{ | |
| 45 | + switch (pict_type) { | |
| 46 | + case AV_PICTURE_TYPE_I: return 'I'; | |
| 47 | + case AV_PICTURE_TYPE_P: return 'P'; | |
| 48 | + case AV_PICTURE_TYPE_B: return 'B'; | |
| 49 | + case AV_PICTURE_TYPE_S: return 'S'; | |
| 50 | + case AV_PICTURE_TYPE_SI: return 'i'; | |
| 51 | + case AV_PICTURE_TYPE_SP: return 'p'; | |
| 52 | + case AV_PICTURE_TYPE_BI: return 'b'; | |
| 53 | + default: return '?'; | |
| 54 | + } | |
| 55 | +} | |
| @@ -1,2 +1,2 @@ | ||
| 1 | −5ddb6d25dd117db29627f9d286153a7a *./tests/data/acodec/ac3.rm | |
| 1 | +0f14801e166819dd4a58981aea36e08b *./tests/data/acodec/ac3.rm | |
| 2 | 2 | 98751 ./tests/data/acodec/ac3.rm |
| @@ -1,2 +1,2 @@ | ||
| 1 | −a1c71456f21d5459d2824d75bbdcc80c *./tests/data/lavf/lavf.rm | |
| 1 | +2e3d6b1944c6cd2cf14e13055aecf82a *./tests/data/lavf/lavf.rm | |
| 2 | 2 | 346706 ./tests/data/lavf/lavf.rm |
| @@ -11,7 +11,8 @@ ret:-1 st:-1 flags:1 ts: 1.470835 · 10 unmodified lines | ||
| 11 | 11 | ret:-1 st: 0 flags:0 ts: 0.365000 |
| 12 | 12 | ret: 0 st: 0 flags:1 ts:-0.741000 |
| 13 | 13 | ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 |
| 14 | −ret:-1 st:-1 flags:0 ts: 2.153336 | |
| 14 | +ret: 0 st:-1 flags:0 ts: 2.153336 | |
| 15 | +ret: 0 st: 0 flags:1 dts: 2.159000 pts: 2.159000 pos: 35567 size: 556 | |
| 15 | 16 | ret:-1 st:-1 flags:1 ts: 1.047503 |
| 16 | 17 | ret: 0 st: 0 flags:0 ts:-0.058000 |
| 17 | 18 | ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 271 size: 556 |