Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master:
Fix even more missing includes after the common.h removal
build: Factor out rangecoder dependencies to CONFIG_RANGECODER
build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
x86: avcodec: Consistently name all init files
Add more missing includes after removing the implicit common.h
Add some more missing includes after removing the implicit common.h
Don't include common.h from avutil.h
rtmp: Automatically compute the hash for SWFVerification

Conflicts:
configure
doc/APIchanges
doc/examples/decoding_encoding.c
libavcodec/Makefile
libavcodec/assdec.c
libavcodec/audio_frame_queue.c
libavcodec/avpacket.c
libavcodec/dv_profile.c
libavcodec/dwt.c
libavcodec/libtheoraenc.c
libavcodec/rawdec.c
libavcodec/rv40dsp.c
libavcodec/tiff.c
libavcodec/tiffenc.c
libavcodec/v210dec.h
libavcodec/vc1dsp.c
libavcodec/x86/Makefile
libavfilter/asrc_anullsrc.c
libavfilter/avfilter.c
libavfilter/buffer.c
libavfilter/formats.c
libavfilter/vf_ass.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_select.c
libavfilter/video.c
libavfilter/vsrc_testsrc.c
libavformat/version.h
libavutil/audioconvert.c
libavutil/error.h
libavutil/version.h

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

Michael Niedermayer authored on 2012/08/16 23:12:45
Showing 250 changed files
... ...
@@ -1365,6 +1365,7 @@ CONFIG_EXTRA="
1365 1365
     aandcttables
1366 1366
     ac3dsp
1367 1367
     avutil
1368
+    error_resilience
1368 1369
     gcrypt
1369 1370
     golomb
1370 1371
     gplv3
... ...
@@ -1379,6 +1380,7 @@ CONFIG_EXTRA="
1379 1379
     mpegvideo
1380 1380
     mpegvideoenc
1381 1381
     nettle
1382
+    rangecoder
1382 1383
     rtpdec
1383 1384
     sinewin
1384 1385
     vp3dsp
... ...
@@ -1527,11 +1529,12 @@ dnxhd_encoder_select="aandcttables mpegvideoenc"
1527 1527
 dxa_decoder_select="zlib"
1528 1528
 eac3_decoder_select="ac3_decoder"
1529 1529
 eac3_encoder_select="mdct ac3dsp"
1530
-eamad_decoder_select="aandcttables"
1530
+eamad_decoder_select="aandcttables error_resilience"
1531 1531
 eatgq_decoder_select="aandcttables"
1532
-eatqi_decoder_select="aandcttables mpegvideo"
1532
+eatqi_decoder_select="aandcttables error_resilience mpegvideo"
1533 1533
 exr_decoder_select="zlib"
1534
-ffv1_decoder_select="golomb"
1534
+ffv1_decoder_select="golomb rangecoder"
1535
+ffv1_encoder_select="rangecoder"
1535 1536
 flac_decoder_select="golomb"
1536 1537
 flac_encoder_select="golomb lpc"
1537 1538
 flashsv_decoder_select="zlib"
... ...
@@ -1541,15 +1544,15 @@ flashsv2_decoder_select="zlib"
1541 1541
 flv_decoder_select="h263_decoder"
1542 1542
 flv_encoder_select="h263_encoder"
1543 1543
 fraps_decoder_select="huffman"
1544
-h261_decoder_select="mpegvideo"
1544
+h261_decoder_select="error_resilience mpegvideo"
1545 1545
 h261_encoder_select="aandcttables mpegvideoenc"
1546
-h263_decoder_select="h263_parser mpegvideo"
1547
-h263_encoder_select="aandcttables mpegvideoenc"
1546
+h263_decoder_select="error_resilience h263_parser mpegvideo"
1547
+h263_encoder_select="aandcttables error_resilience mpegvideoenc"
1548 1548
 h263_vaapi_hwaccel_select="vaapi h263_decoder"
1549 1549
 h263i_decoder_select="h263_decoder"
1550 1550
 h263p_encoder_select="h263_encoder"
1551 1551
 h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
1552
-h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
1552
+h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
1553 1553
 h264_dxva2_hwaccel_deps="dxva2api_h"
1554 1554
 h264_dxva2_hwaccel_select="dxva2 h264_decoder"
1555 1555
 h264_vaapi_hwaccel_select="vaapi h264_decoder"
... ...
@@ -1562,7 +1565,7 @@ jpegls_decoder_select="golomb"
1562 1562
 jpegls_encoder_select="golomb"
1563 1563
 ljpeg_encoder_select="aandcttables mpegvideoenc"
1564 1564
 loco_decoder_select="golomb"
1565
-mdec_decoder_select="mpegvideo"
1565
+mdec_decoder_select="error_resilience mpegvideo"
1566 1566
 mjpeg_encoder_select="aandcttables mpegvideoenc"
1567 1567
 mlp_decoder_select="mlp_parser"
1568 1568
 mp1_decoder_select="mpegaudiodsp"
... ...
@@ -1582,15 +1585,15 @@ mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
1582 1582
 mpeg_xvmc_decoder_select="mpegvideo_decoder"
1583 1583
 mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
1584 1584
 mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
1585
-mpeg1video_decoder_select="mpegvideo"
1586
-mpeg1video_encoder_select="aandcttables mpegvideoenc"
1585
+mpeg1video_decoder_select="error_resilience mpegvideo"
1586
+mpeg1video_encoder_select="aandcttables error_resilience mpegvideoenc"
1587 1587
 mpeg2_crystalhd_decoder_select="crystalhd"
1588 1588
 mpeg2_dxva2_hwaccel_deps="dxva2api_h"
1589 1589
 mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
1590 1590
 mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
1591 1591
 mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
1592
-mpeg2video_decoder_select="mpegvideo"
1593
-mpeg2video_encoder_select="aandcttables mpegvideoenc"
1592
+mpeg2video_decoder_select="error_resilience mpegvideo"
1593
+mpeg2video_encoder_select="aandcttables error_resilience mpegvideoenc"
1594 1594
 mpeg4_crystalhd_decoder_select="crystalhd"
1595 1595
 mpeg4_decoder_select="h263_decoder mpeg4video_parser"
1596 1596
 mpeg4_encoder_select="h263_encoder"
... ...
@@ -1615,18 +1618,18 @@ rv10_decoder_select="h263_decoder"
1615 1615
 rv10_encoder_select="h263_encoder"
1616 1616
 rv20_decoder_select="h263_decoder"
1617 1617
 rv20_encoder_select="h263_encoder"
1618
-rv30_decoder_select="golomb h264chroma h264pred h264qpel mpegvideo"
1619
-rv40_decoder_select="golomb h264chroma h264pred h264qpel mpegvideo"
1618
+rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
1619
+rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
1620 1620
 shorten_decoder_select="golomb"
1621 1621
 sipr_decoder_select="lsp"
1622
-snow_decoder_select="dwt"
1623
-snow_encoder_select="aandcttables dwt mpegvideoenc"
1622
+snow_decoder_select="dwt rangecoder"
1623
+snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
1624 1624
 sonic_decoder_select="golomb"
1625 1625
 sonic_encoder_select="golomb"
1626 1626
 sonic_ls_encoder_select="golomb"
1627
-svq1_decoder_select="mpegvideo"
1628
-svq1_encoder_select="aandcttables mpegvideoenc"
1629
-svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
1627
+svq1_decoder_select="error_resilience mpegvideo"
1628
+svq1_encoder_select="aandcttables error_resilience mpegvideoenc"
1629
+svq3_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
1630 1630
 svq3_decoder_suggest="zlib"
1631 1631
 theora_decoder_select="vp3_decoder"
1632 1632
 tiff_decoder_suggest="zlib"
... ...
@@ -1676,10 +1679,10 @@ vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
1676 1676
 vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
1677 1677
 
1678 1678
 # parsers
1679
-h264_parser_select="golomb h264dsp h264pred mpegvideo"
1680
-mpeg4video_parser_select="mpegvideo"
1681
-mpegvideo_parser_select="mpegvideo"
1682
-vc1_parser_select="mpegvideo"
1679
+h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo"
1680
+mpeg4video_parser_select="error_resilience mpegvideo"
1681
+mpegvideo_parser_select="error_resilience mpegvideo"
1682
+vc1_parser_select="error_resilience mpegvideo"
1683 1683
 
1684 1684
 # external libraries
1685 1685
 libaacplus_encoder_deps="libaacplus"
... ...
@@ -34,6 +34,7 @@
34 34
 #include <libavutil/opt.h>
35 35
 #include <libavcodec/avcodec.h>
36 36
 #include <libavutil/audioconvert.h>
37
+#include <libavutil/common.h>
37 38
 #include <libavutil/imgutils.h>
38 39
 #include <libavutil/mathematics.h>
39 40
 #include <libavutil/samplefmt.h>
... ...
@@ -281,6 +281,9 @@ Size of the decompressed SWF file, required for SWFVerification.
281 281
 @item rtmp_swfurl
282 282
 URL of the SWF player for the media. By default no value will be sent.
283 283
 
284
+@item rtmp_swfverify
285
+URL to player swf file, compute hash/size automatically.
286
+
284 287
 @item rtmp_tcurl
285 288
 URL of the target stream. Defaults to proto://host[:port]/app.
286 289
 
... ...
@@ -33,7 +33,9 @@
33 33
 
34 34
 #include <stdio.h>
35 35
 #include <stdlib.h>
36
+#include <string.h>
36 37
 
38
+#include "libavutil/internal.h"
37 39
 #include "libavutil/intreadwrite.h"
38 40
 #include "avcodec.h"
39 41
 
... ...
@@ -39,6 +39,7 @@
39 39
 
40 40
 #include "libavutil/avassert.h"
41 41
 #include "avcodec.h"
42
+#include "libavutil/common.h"
42 43
 
43 44
 /** decoder context */
44 45
 typedef struct EightSvxContext {
... ...
@@ -41,6 +41,7 @@ OBJS-$(CONFIG_ENCODERS)                += faandct.o jfdctfst.o jfdctint.o
41 41
 OBJS-$(CONFIG_DCT)                     += dct.o dct32_fixed.o dct32_float.o
42 42
 OBJS-$(CONFIG_DWT)                     += dwt.o snow.o
43 43
 OBJS-$(CONFIG_DXVA2)                   += dxva2.o
44
+OBJS-$(CONFIG_ERROR_RESILIENCE)        += error_resilience.o
44 45
 FFT-OBJS-$(CONFIG_HARDCODED_TABLES)    += cos_tables.o cos_fixed_tables.o
45 46
 OBJS-$(CONFIG_FFT)                     += avfft.o fft_fixed.o fft_float.o \
46 47
                                           $(FFT-OBJS-yes)
... ...
@@ -58,6 +59,7 @@ OBJS-$(CONFIG_MPEGAUDIODSP)            += mpegaudiodsp.o                \
58 58
 OBJS-$(CONFIG_MPEGVIDEO)               += mpegvideo.o mpegvideo_motion.o
59 59
 OBJS-$(CONFIG_MPEGVIDEOENC)            += mpegvideo_enc.o mpeg12data.o  \
60 60
                                           motion_est.o ratecontrol.o
61
+OBJS-$(CONFIG_RANGECODER)              += rangecoder.o
61 62
 RDFT-OBJS-$(CONFIG_HARDCODED_TABLES)   += sin_tables.o
62 63
 OBJS-$(CONFIG_RDFT)                    += rdft.o $(RDFT-OBJS-yes)
63 64
 OBJS-$(CONFIG_SINEWIN)                 += sinewin.o
... ...
@@ -164,19 +166,19 @@ OBJS-$(CONFIG_EAC3_ENCODER)            += eac3enc.o ac3enc.o ac3enc_float.o \
164 164
                                           ac3tab.o ac3.o kbdwin.o eac3_data.o
165 165
 OBJS-$(CONFIG_EACMV_DECODER)           += eacmv.o
166 166
 OBJS-$(CONFIG_EAMAD_DECODER)           += eamad.o eaidct.o mpeg12.o \
167
-                                          mpeg12data.o error_resilience.o
167
+                                          mpeg12data.o
168 168
 OBJS-$(CONFIG_EATGQ_DECODER)           += eatgq.o eaidct.o
169 169
 OBJS-$(CONFIG_EATGV_DECODER)           += eatgv.o
170 170
 OBJS-$(CONFIG_EATQI_DECODER)           += eatqi.o eaidct.o mpeg12.o \
171
-                                          mpeg12data.o  error_resilience.o
171
+                                          mpeg12data.o
172 172
 OBJS-$(CONFIG_EIGHTBPS_DECODER)        += 8bps.o
173 173
 OBJS-$(CONFIG_EIGHTSVX_EXP_DECODER)    += 8svx.o
174 174
 OBJS-$(CONFIG_EIGHTSVX_FIB_DECODER)    += 8svx.o
175 175
 OBJS-$(CONFIG_ESCAPE124_DECODER)       += escape124.o
176 176
 OBJS-$(CONFIG_ESCAPE130_DECODER)       += escape130.o
177 177
 OBJS-$(CONFIG_EXR_DECODER)             += exr.o
178
-OBJS-$(CONFIG_FFV1_DECODER)            += ffv1.o rangecoder.o
179
-OBJS-$(CONFIG_FFV1_ENCODER)            += ffv1.o rangecoder.o
178
+OBJS-$(CONFIG_FFV1_DECODER)            += ffv1.o
179
+OBJS-$(CONFIG_FFV1_ENCODER)            += ffv1.o
180 180
 OBJS-$(CONFIG_FFVHUFF_DECODER)         += huffyuv.o
181 181
 OBJS-$(CONFIG_FFVHUFF_ENCODER)         += huffyuv.o
182 182
 OBJS-$(CONFIG_FFWAVESYNTH_DECODER)     += ffwavesynth.o
... ...
@@ -198,20 +200,18 @@ OBJS-$(CONFIG_GIF_DECODER)             += gifdec.o lzw.o
198 198
 OBJS-$(CONFIG_GIF_ENCODER)             += gif.o lzwenc.o
199 199
 OBJS-$(CONFIG_GSM_DECODER)             += gsmdec.o gsmdec_data.o msgsmdec.o
200 200
 OBJS-$(CONFIG_GSM_MS_DECODER)          += gsmdec.o gsmdec_data.o msgsmdec.o
201
-OBJS-$(CONFIG_H261_DECODER)            += h261dec.o h261.o h261data.o error_resilience.o
201
+OBJS-$(CONFIG_H261_DECODER)            += h261dec.o h261.o h261data.o
202 202
 OBJS-$(CONFIG_H261_ENCODER)            += h261enc.o h261.o h261data.o
203 203
 OBJS-$(CONFIG_H263_DECODER)            += h263dec.o h263.o ituh263dec.o        \
204 204
                                           mpeg4video.o mpeg4videodec.o flvdec.o\
205
-                                          intelh263dec.o  error_resilience.o
205
+                                          intelh263dec.o
206 206
 OBJS-$(CONFIG_H263_VAAPI_HWACCEL)      += vaapi_mpeg4.o
207 207
 OBJS-$(CONFIG_H263_ENCODER)            += mpeg4videoenc.o mpeg4video.o  \
208
-                                          h263.o ituh263enc.o flvenc.o  \
209
-                                          error_resilience.o
208
+                                          h263.o ituh263enc.o flvenc.o
210 209
 OBJS-$(CONFIG_H264_DECODER)            += h264.o                               \
211 210
                                           h264_loopfilter.o h264_direct.o      \
212 211
                                           cabac.o h264_sei.o h264_ps.o         \
213
-                                          h264_refs.o h264_cavlc.o h264_cabac.o\
214
-                                          error_resilience.o
212
+                                          h264_refs.o h264_cavlc.o h264_cabac.o
215 213
 OBJS-$(CONFIG_H264_DXVA2_HWACCEL)      += dxva2_h264.o
216 214
 OBJS-$(CONFIG_H264_VAAPI_HWACCEL)      += vaapi_h264.o
217 215
 OBJS-$(CONFIG_H264_VDA_HWACCEL)        += vda_h264.o
... ...
@@ -243,8 +243,7 @@ OBJS-$(CONFIG_LJPEG_ENCODER)           += ljpegenc.o mjpegenc.o mjpeg.o
243 243
 OBJS-$(CONFIG_LOCO_DECODER)            += loco.o
244 244
 OBJS-$(CONFIG_MACE3_DECODER)           += mace.o
245 245
 OBJS-$(CONFIG_MACE6_DECODER)           += mace.o
246
-OBJS-$(CONFIG_MDEC_DECODER)            += mdec.o mpeg12.o mpeg12data.o \
247
-                                          error_resilience.o
246
+OBJS-$(CONFIG_MDEC_DECODER)            += mdec.o mpeg12.o mpeg12data.o
248 247
 OBJS-$(CONFIG_MICRODVD_DECODER)        += microdvddec.o ass.o
249 248
 OBJS-$(CONFIG_MIMIC_DECODER)           += mimic.o
250 249
 OBJS-$(CONFIG_MJPEG_DECODER)           += mjpegdec.o mjpeg.o
... ...
@@ -288,18 +287,14 @@ OBJS-$(CONFIG_MPC8_DECODER)            += mpc8.o mpc.o mpegaudiodec.o      \
288 288
 OBJS-$(CONFIG_MPEGVIDEO_DECODER)       += mpeg12.o mpeg12data.o \
289 289
                                           mpegvideo.o error_resilience.o
290 290
 OBJS-$(CONFIG_MPEG_XVMC_DECODER)       += mpegvideo_xvmc.o
291
-OBJS-$(CONFIG_MPEG1VIDEO_DECODER)      += mpeg12.o mpeg12data.o \
292
-                                          error_resilience.o
291
+OBJS-$(CONFIG_MPEG1VIDEO_DECODER)      += mpeg12.o mpeg12data.o
293 292
 OBJS-$(CONFIG_MPEG1VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o          \
294
-                                          timecode.o                  \
295
-                                          error_resilience.o
293
+                                          timecode.o
296 294
 OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL)     += dxva2_mpeg2.o
297 295
 OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL)     += vaapi_mpeg2.o
298
-OBJS-$(CONFIG_MPEG2VIDEO_DECODER)      += mpeg12.o mpeg12data.o \
299
-                                          error_resilience.o
296
+OBJS-$(CONFIG_MPEG2VIDEO_DECODER)      += mpeg12.o mpeg12data.o
300 297
 OBJS-$(CONFIG_MPEG2VIDEO_ENCODER)      += mpeg12enc.o mpeg12.o          \
301
-                                          timecode.o                  \
302
-                                          error_resilience.o
298
+                                          timecode.o
303 299
 OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL)     += vaapi_mpeg4.o
304 300
 OBJS-$(CONFIG_MSMPEG4V1_DECODER)       += msmpeg4.o msmpeg4data.o
305 301
 OBJS-$(CONFIG_MSMPEG4V2_DECODER)       += msmpeg4.o msmpeg4data.o h263dec.o \
... ...
@@ -380,10 +375,8 @@ OBJS-$(CONFIG_RV10_DECODER)            += rv10.o
380 380
 OBJS-$(CONFIG_RV10_ENCODER)            += rv10enc.o
381 381
 OBJS-$(CONFIG_RV20_DECODER)            += rv10.o
382 382
 OBJS-$(CONFIG_RV20_ENCODER)            += rv20enc.o
383
-OBJS-$(CONFIG_RV30_DECODER)            += rv30.o rv34.o rv30dsp.o rv34dsp.o \
384
-                                          error_resilience.o
385
-OBJS-$(CONFIG_RV40_DECODER)            += rv40.o rv34.o rv34dsp.o rv40dsp.o \
386
-                                          error_resilience.o
383
+OBJS-$(CONFIG_RV30_DECODER)            += rv30.o rv34.o rv30dsp.o rv34dsp.o
384
+OBJS-$(CONFIG_RV40_DECODER)            += rv40.o rv34.o rv34dsp.o rv40dsp.o
387 385
 OBJS-$(CONFIG_SAMI_DECODER)            += samidec.o ass.o
388 386
 OBJS-$(CONFIG_S302M_DECODER)           += s302m.o
389 387
 OBJS-$(CONFIG_SANM_DECODER)            += sanm.o
... ...
@@ -397,10 +390,9 @@ OBJS-$(CONFIG_SIPR_DECODER)            += sipr.o acelp_pitch_delay.o \
397 397
 OBJS-$(CONFIG_SMACKAUD_DECODER)        += smacker.o
398 398
 OBJS-$(CONFIG_SMACKER_DECODER)         += smacker.o
399 399
 OBJS-$(CONFIG_SMC_DECODER)             += smc.o
400
-OBJS-$(CONFIG_SNOW_DECODER)            += snowdec.o snow.o rangecoder.o
401
-OBJS-$(CONFIG_SNOW_ENCODER)            += snowenc.o snow.o rangecoder.o    \
402
-                                          h263.o ituh263enc.o          \
403
-                                          error_resilience.o
400
+OBJS-$(CONFIG_SNOW_DECODER)            += snowdec.o snow.o
401
+OBJS-$(CONFIG_SNOW_ENCODER)            += snowenc.o snow.o              \
402
+                                          h263.o ituh263enc.o
404 403
 OBJS-$(CONFIG_SOL_DPCM_DECODER)        += dpcm.o
405 404
 OBJS-$(CONFIG_SONIC_DECODER)           += sonic.o
406 405
 OBJS-$(CONFIG_SONIC_ENCODER)           += sonic.o
... ...
@@ -413,16 +405,13 @@ OBJS-$(CONFIG_SUBRIP_ENCODER)          += srtenc.o ass_split.o
413 413
 OBJS-$(CONFIG_SUBVIEWER_DECODER)       += subviewerdec.o ass.o
414 414
 OBJS-$(CONFIG_SUNRAST_DECODER)         += sunrast.o
415 415
 OBJS-$(CONFIG_SUNRAST_ENCODER)         += sunrastenc.o
416
-OBJS-$(CONFIG_SVQ1_DECODER)            += svq1dec.o svq1.o h263.o \
417
-                                          error_resilience.o
416
+OBJS-$(CONFIG_SVQ1_DECODER)            += svq1dec.o svq1.o h263.o
418 417
 OBJS-$(CONFIG_SVQ1_ENCODER)            += svq1enc.o svq1.o    \
419
-                                          h263.o ituh263enc.o \
420
-                                          error_resilience.o
418
+                                          h263.o ituh263enc.o
421 419
 OBJS-$(CONFIG_SVQ3_DECODER)            += h264.o svq3.o                       \
422 420
                                           h264_loopfilter.o h264_direct.o     \
423 421
                                           h264_sei.o h264_ps.o h264_refs.o    \
424 422
                                           h264_cavlc.o h264_cabac.o cabac.o   \
425
-                                          error_resilience.o                  \
426 423
                                           svq1dec.o svq1.o h263.o
427 424
 OBJS-$(CONFIG_TARGA_DECODER)           += targa.o
428 425
 OBJS-$(CONFIG_TARGA_ENCODER)           += targaenc.o rle.o
... ...
@@ -715,27 +704,24 @@ OBJS-$(CONFIG_H264_PARSER)             += h264_parser.o h264.o            \
715 715
                                           cabac.o                         \
716 716
                                           h264_refs.o h264_sei.o h264_direct.o \
717 717
                                           h264_loopfilter.o h264_cabac.o \
718
-                                          h264_cavlc.o h264_ps.o \
719
-                                          error_resilience.o
718
+                                          h264_cavlc.o h264_ps.o
720 719
 OBJS-$(CONFIG_AAC_LATM_PARSER)         += latm_parser.o
721 720
 OBJS-$(CONFIG_MJPEG_PARSER)            += mjpeg_parser.o
722 721
 OBJS-$(CONFIG_MLP_PARSER)              += mlp_parser.o mlp.o
723 722
 OBJS-$(CONFIG_MPEG4VIDEO_PARSER)       += mpeg4video_parser.o h263.o \
724
-                                          error_resilience.o \
725 723
                                           mpeg4videodec.o mpeg4video.o \
726 724
                                           ituh263dec.o h263dec.o
727 725
 OBJS-$(CONFIG_PNG_PARSER)              += png_parser.o
728 726
 OBJS-$(CONFIG_MPEGAUDIO_PARSER)        += mpegaudio_parser.o \
729 727
                                           mpegaudiodecheader.o mpegaudiodata.o
730 728
 OBJS-$(CONFIG_MPEGVIDEO_PARSER)        += mpegvideo_parser.o    \
731
-                                          mpeg12.o mpeg12data.o \
732
-                                          error_resilience.o
729
+                                          mpeg12.o mpeg12data.o
733 730
 OBJS-$(CONFIG_PNM_PARSER)              += pnm_parser.o pnm.o
734 731
 OBJS-$(CONFIG_RV30_PARSER)             += rv34_parser.o
735 732
 OBJS-$(CONFIG_RV40_PARSER)             += rv34_parser.o
736 733
 OBJS-$(CONFIG_VC1_PARSER)              += vc1_parser.o vc1.o vc1data.o \
737 734
                                           msmpeg4.o msmpeg4data.o mpeg4video.o \
738
-                                          h263.o error_resilience.o
735
+                                          h263.o
739 736
 OBJS-$(CONFIG_VORBIS_PARSER)           += vorbis_parser.o xiph.o
740 737
 OBJS-$(CONFIG_VP3_PARSER)              += vp3_parser.o
741 738
 OBJS-$(CONFIG_VP8_PARSER)              += vp8_parser.o
... ...
@@ -29,6 +29,7 @@
29 29
 #include "a64tables.h"
30 30
 #include "elbg.h"
31 31
 #include "internal.h"
32
+#include "libavutil/common.h"
32 33
 #include "libavutil/intreadwrite.h"
33 34
 
34 35
 #define DITHERSTEPS   8
... ...
@@ -20,6 +20,7 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include "libavutil/common.h"
23 24
 #include "parser.h"
24 25
 #include "aac_ac3_parser.h"
25 26
 
... ...
@@ -22,6 +22,7 @@
22 22
 
23 23
 #include <inttypes.h>
24 24
 
25
+#include "libavutil/common.h"
25 26
 #include "avcodec.h"
26 27
 #include "acelp_filters.h"
27 28
 
... ...
@@ -20,6 +20,7 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include "libavutil/common.h"
23 24
 #include "libavutil/mathematics.h"
24 25
 #include "avcodec.h"
25 26
 #include "dsputil.h"
... ...
@@ -21,6 +21,8 @@
21 21
  */
22 22
 
23 23
 #include <inttypes.h>
24
+
25
+#include "libavutil/common.h"
24 26
 #include "avcodec.h"
25 27
 #include "acelp_vectors.h"
26 28
 #include "celp_math.h"
... ...
@@ -18,6 +18,7 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/common.h"
21 22
 #include "libavutil/intreadwrite.h"
22 23
 #include "libavutil/mathematics.h"
23 24
 #include "adx.h"
... ...
@@ -25,6 +25,7 @@
25 25
  */
26 26
 
27 27
 #include "avcodec.h"
28
+#include "config.h"
28 29
 
29 30
 #define REGISTER_HWACCEL(X,x) { \
30 31
           extern AVHWAccel ff_##x##_hwaccel; \
... ...
@@ -23,6 +23,8 @@
23 23
 #ifndef AVCODEC_AMR_H
24 24
 #define AVCODEC_AMR_H
25 25
 
26
+#include <string.h>
27
+
26 28
 #include "avcodec.h"
27 29
 
28 30
 #ifdef AMR_USE_16BIT_TABLES
... ...
@@ -24,6 +24,7 @@
24 24
  * AMR wideband decoder
25 25
  */
26 26
 
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/lfg.h"
28 29
 
29 30
 #include "avcodec.h"
... ...
@@ -24,6 +24,7 @@
24 24
  * ASCII/ANSI art decoder
25 25
  */
26 26
 
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/lfg.h"
28 29
 #include "avcodec.h"
29 30
 #include "cga_data.h"
... ...
@@ -22,6 +22,7 @@
22 22
 #include "avcodec.h"
23 23
 #include "ass.h"
24 24
 #include "libavutil/avstring.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 int ff_ass_subtitle_header(AVCodecContext *avctx,
27 28
                            const char *font, int font_size,
... ...
@@ -19,9 +19,13 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <string.h>
23
+
22 24
 #include "avcodec.h"
23 25
 #include "ass.h"
24 26
 #include "ass_split.h"
27
+#include "libavutil/internal.h"
28
+#include "libavutil/mem.h"
25 29
 
26 30
 static av_cold int ass_decode_init(AVCodecContext *avctx)
27 31
 {
... ...
@@ -19,8 +19,12 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <string.h>
23
+
22 24
 #include "avcodec.h"
23 25
 #include "libavutil/avstring.h"
26
+#include "libavutil/internal.h"
27
+#include "libavutil/mem.h"
24 28
 
25 29
 static av_cold int ass_encode_init(AVCodecContext *avctx)
26 30
 {
... ...
@@ -27,6 +27,7 @@
27 27
 #include <math.h>
28 28
 #include <stddef.h>
29 29
 #include <stdio.h>
30
+#include <string.h>
30 31
 
31 32
 #include "avcodec.h"
32 33
 #include "dsputil.h"
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "audio_frame_queue.h"
23 24
 #include "internal.h"
24 25
 #include "libavutil/avassert.h"
... ...
@@ -26,6 +26,7 @@
26 26
  */
27 27
 
28 28
 #include "libavutil/avstring.h"
29
+#include "libavutil/common.h"
29 30
 #include "libavutil/libm.h"
30 31
 #include "libavutil/samplefmt.h"
31 32
 #include "avcodec.h"
... ...
@@ -24,6 +24,7 @@
24 24
  */
25 25
 
26 26
 #include "avcodec.h"
27
+#include "libavutil/internal.h"
27 28
 
28 29
 typedef struct AuraDecodeContext {
29 30
     AVCodecContext *avctx;
... ...
@@ -19,10 +19,13 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-#include "internal.h"
22
+#include <string.h>
23
+
23 24
 #include "libavutil/avassert.h"
24
-#include "bytestream.h"
25
+#include "libavutil/mem.h"
25 26
 #include "avcodec.h"
27
+#include "bytestream.h"
28
+#include "internal.h"
26 29
 
27 30
 void av_destruct_packet_nofree(AVPacket *pkt)
28 31
 {
... ...
@@ -18,7 +18,10 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include <string.h>
22
+
21 23
 #include "avcodec.h"
24
+#include "libavutil/mem.h"
22 25
 
23 26
 static AVBitStreamFilter *first_bitstream_filter= NULL;
24 27
 
... ...
@@ -25,6 +25,7 @@
25 25
 #include <stdio.h>
26 26
 #include "dsputil.h"
27 27
 #include "cavsdsp.h"
28
+#include "libavutil/common.h"
28 29
 
29 30
 /*****************************************************************************
30 31
  *
... ...
@@ -24,6 +24,7 @@
24 24
 
25 25
 #include "avcodec.h"
26 26
 #include "celp_filters.h"
27
+#include "libavutil/common.h"
27 28
 
28 29
 void ff_celp_convolve_circ(int16_t* fc_out, const int16_t* fc_in,
29 30
                            const int16_t* filter, int len)
... ...
@@ -27,6 +27,7 @@
27 27
 #include "avcodec.h"
28 28
 #include "mathops.h"
29 29
 #include "celp_math.h"
30
+#include "libavutil/common.h"
30 31
 
31 32
 #ifdef G729_BITEXACT
32 33
 /**
... ...
@@ -34,6 +34,7 @@
34 34
 #include <stdlib.h>
35 35
 #include <string.h>
36 36
 
37
+#include "libavutil/common.h"
37 38
 #include "libavutil/intreadwrite.h"
38 39
 #include "avcodec.h"
39 40
 
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include "avcodec.h"
23 23
 
24
+#include "libavutil/common.h"
24 25
 #include "libavutil/internal.h"
25 26
 
26 27
 static const AVCodecDescriptor codec_descriptors[] = {
... ...
@@ -22,6 +22,7 @@
22 22
 #include <stdlib.h>
23 23
 
24 24
 #include "avcodec.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 #if CONFIG_ZLIB
27 28
 #include <zlib.h>
... ...
@@ -34,6 +34,7 @@
34 34
 
35 35
 #include "avcodec.h"
36 36
 #include "dsputil.h"
37
+#include "libavutil/internal.h"
37 38
 
38 39
 
39 40
 typedef struct CyuvDecodeContext {
... ...
@@ -28,6 +28,7 @@
28 28
  */
29 29
 
30 30
 #include <math.h>
31
+#include <string.h>
31 32
 
32 33
 #include "libavutil/mathematics.h"
33 34
 #include "dct.h"
... ...
@@ -27,7 +27,10 @@
27 27
  * @author Marco Gerards <marco@gnu.org>
28 28
  */
29 29
 
30
+#include <string.h>
31
+
30 32
 #include "libavutil/intreadwrite.h"
33
+#include "libavutil/mem.h"
31 34
 #include "parser.h"
32 35
 
33 36
 #define DIRAC_PARSE_INFO_PREFIX 0x42424344
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include "avcodec.h"
23 23
 #include "dnxhddata.h"
24
+#include "libavutil/common.h"
24 25
 
25 26
 /* The quantization tables below are in zigzag order! */
26 27
 
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "libavutil/intreadwrite.h"
23 24
 #include "libavutil/imgutils.h"
24 25
 #include "avcodec.h"
... ...
@@ -18,7 +18,10 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include <string.h>
22
+
21 23
 #include "avcodec.h"
24
+#include "libavutil/mem.h"
22 25
 
23 26
 
24 27
 static int dump_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
... ...
@@ -18,6 +18,7 @@
18 18
 
19 19
 #include <stdint.h>
20 20
 
21
+#include "libavutil/common.h"
21 22
 #include "libavutil/intreadwrite.h"
22 23
 #include "libavutil/log.h"
23 24
 #include "libavutil/pixdesc.h"
... ...
@@ -19,7 +19,10 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <string.h>
23
+
22 24
 #include "libavutil/intreadwrite.h"
25
+#include "libavutil/mem.h"
23 26
 #include "avcodec.h"
24 27
 
25 28
 /* parser definition */
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include "libavutil/attributes.h"
23 23
 #include "libavutil/avassert.h"
24
+#include "libavutil/common.h"
24 25
 #include "dsputil.h"
25 26
 #include "dwt.h"
26 27
 #include "libavcodec/x86/dwt.h"
... ...
@@ -27,6 +27,7 @@
27 27
 #include <stdio.h>
28 28
 #include <stdlib.h>
29 29
 
30
+#include "libavutil/common.h"
30 31
 #include "libavutil/intreadwrite.h"
31 32
 #include "avcodec.h"
32 33
 
... ...
@@ -21,6 +21,7 @@
21 21
  */
22 22
 
23 23
 #include "avcodec.h"
24
+#include "libavutil/common.h"
24 25
 #include "libavutil/intreadwrite.h"
25 26
 
26 27
 static av_cold int decode_init(AVCodecContext *avctx)
... ...
@@ -28,6 +28,7 @@
28 28
  * http://wiki.multimedia.cx/index.php?title=Electronic_Arts_CMV
29 29
  */
30 30
 
31
+#include "libavutil/common.h"
31 32
 #include "libavutil/intreadwrite.h"
32 33
 #include "libavutil/imgutils.h"
33 34
 #include "avcodec.h"
... ...
@@ -27,6 +27,7 @@
27 27
 
28 28
 #include "dsputil.h"
29 29
 #include "eaidct.h"
30
+#include "libavutil/common.h"
30 31
 
31 32
 #define ASQRT 181 /* (1/sqrt(2))<<8 */
32 33
 #define A4    669 /* cos(pi/8)*sqrt(2)<<9 */
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include <string.h>
27 27
 
28
+#include "libavutil/common.h"
28 29
 #include "libavutil/lfg.h"
29 30
 #include "elbg.h"
30 31
 #include "avcodec.h"
... ...
@@ -27,6 +27,8 @@
27 27
 
28 28
 #include "dsputil.h"
29 29
 #include "faandct.h"
30
+#include "libavutil/internal.h"
31
+#include "libavutil/libm.h"
30 32
 
31 33
 #define FLOAT float
32 34
 
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 #include "faanidct.h"
22
+#include "libavutil/common.h"
22 23
 
23 24
 /* To allow switching to double. */
24 25
 #define FLOAT float
... ...
@@ -22,6 +22,7 @@
22 22
 
23 23
 #include "avcodec.h"
24 24
 #include "fmtconvert.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 static void int32_to_float_fmul_scalar_c(float *dst, const int *src, float mul, int len){
27 28
     int i;
... ...
@@ -31,6 +31,7 @@
31 31
 #include "avcodec.h"
32 32
 #include "internal.h"
33 33
 #include "g722.h"
34
+#include "libavutil/common.h"
34 35
 
35 36
 #define FREEZE_INTERVAL 128
36 37
 
... ...
@@ -19,7 +19,10 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <string.h>
23
+
22 24
 #include "libavutil/intreadwrite.h"
25
+#include "libavutil/mem.h"
23 26
 #include "avcodec.h"
24 27
 
25 28
 typedef struct H264BSFContext {
... ...
@@ -29,6 +29,7 @@
29 29
 #include "libavutil/avassert.h"
30 30
 #include "avcodec.h"
31 31
 #include "h264dsp.h"
32
+#include "libavutil/common.h"
32 33
 
33 34
 #define BIT_DEPTH 8
34 35
 #include "h264dsp_template.c"
... ...
@@ -26,6 +26,7 @@
26 26
  */
27 27
 
28 28
 #include "bit_depth_template.c"
29
+#include "libavutil/common.h"
29 30
 
30 31
 #ifndef AVCODEC_H264IDCT_INTERNAL_H
31 32
 #define AVCODEC_H264IDCT_INTERNAL_H
... ...
@@ -49,6 +49,7 @@
49 49
 #include <string.h>
50 50
 
51 51
 #include "avcodec.h"
52
+#include "libavutil/internal.h"
52 53
 
53 54
 #define HUFFMAN_TABLE_SIZE 64 * 1024
54 55
 #define HUF_TOKENS 256
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "iirfilter.h"
28 28
 #include <math.h>
29
+#include "libavutil/common.h"
29 30
 
30 31
 /**
31 32
  * IIR filter global parameters
... ...
@@ -35,6 +35,7 @@
35 35
 #include "internal.h"
36 36
 #include "imgconvert.h"
37 37
 #include "libavutil/colorspace.h"
38
+#include "libavutil/common.h"
38 39
 #include "libavutil/pixdesc.h"
39 40
 #include "libavutil/imgutils.h"
40 41
 
... ...
@@ -22,6 +22,7 @@
22 22
  */
23 23
 
24 24
 #include "dsputil.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 /*
27 28
 area positions, #3 is 1 pixel only, other are 8 pixels
... ...
@@ -29,6 +29,7 @@
29 29
 #define AVCODEC_JPEGLS_H
30 30
 
31 31
 #include "avcodec.h"
32
+#include "libavutil/common.h"
32 33
 
33 34
 typedef struct JpeglsContext{
34 35
     AVCodecContext *avctx;
... ...
@@ -24,6 +24,7 @@
24 24
  * Kega Game Video decoder
25 25
  */
26 26
 
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/intreadwrite.h"
28 29
 #include "libavutil/imgutils.h"
29 30
 #include "avcodec.h"
... ...
@@ -45,6 +45,8 @@
45 45
 #include "avcodec.h"
46 46
 #include "internal.h"
47 47
 #include "lcl.h"
48
+#include "libavutil/internal.h"
49
+#include "libavutil/mem.h"
48 50
 
49 51
 #include <zlib.h>
50 52
 
... ...
@@ -30,6 +30,7 @@
30 30
 #include "audio_frame_queue.h"
31 31
 #include "internal.h"
32 32
 #include "libavutil/audioconvert.h"
33
+#include "libavutil/common.h"
33 34
 
34 35
 
35 36
 /* libfaac has an encoder delay of 1024 samples */
... ...
@@ -25,6 +25,7 @@
25 25
 #include "audio_frame_queue.h"
26 26
 #include "internal.h"
27 27
 #include "libavutil/audioconvert.h"
28
+#include "libavutil/common.h"
28 29
 #include "libavutil/opt.h"
29 30
 
30 31
 typedef struct AACContext {
... ...
@@ -32,6 +32,7 @@
32 32
 #include "avcodec.h"
33 33
 #include "internal.h"
34 34
 #include "gsm.h"
35
+#include "libavutil/common.h"
35 36
 
36 37
 static av_cold int libgsm_encode_close(AVCodecContext *avctx) {
37 38
 #if FF_API_OLD_ENCODE_AUDIO
... ...
@@ -22,6 +22,7 @@
22 22
 #include <ilbc.h>
23 23
 
24 24
 #include "avcodec.h"
25
+#include "libavutil/common.h"
25 26
 #include "libavutil/opt.h"
26 27
 #include "internal.h"
27 28
 
... ...
@@ -27,6 +27,7 @@
27 27
 #include <lame/lame.h>
28 28
 
29 29
 #include "libavutil/audioconvert.h"
30
+#include "libavutil/common.h"
30 31
 #include "libavutil/intreadwrite.h"
31 32
 #include "libavutil/log.h"
32 33
 #include "libavutil/opt.h"
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include "avcodec.h"
23 23
 #include "libavutil/avstring.h"
24
+#include "libavutil/common.h"
24 25
 #include "libavutil/opt.h"
25 26
 #include "audio_frame_queue.h"
26 27
 #include "internal.h"
... ...
@@ -23,6 +23,7 @@
23 23
 #include <speex/speex_stereo.h>
24 24
 #include <speex/speex_callbacks.h>
25 25
 #include "avcodec.h"
26
+#include "libavutil/common.h"
26 27
 
27 28
 typedef struct {
28 29
     AVFrame frame;
... ...
@@ -69,6 +69,7 @@
69 69
 #include <speex/speex_stereo.h>
70 70
 
71 71
 #include "libavutil/audioconvert.h"
72
+#include "libavutil/common.h"
72 73
 #include "libavutil/opt.h"
73 74
 #include "avcodec.h"
74 75
 #include "internal.h"
... ...
@@ -31,6 +31,7 @@
31 31
  */
32 32
 
33 33
 /* FFmpeg includes */
34
+#include "libavutil/common.h"
34 35
 #include "libavutil/intreadwrite.h"
35 36
 #include "libavutil/log.h"
36 37
 #include "libavutil/base64.h"
... ...
@@ -20,8 +20,12 @@
20 20
  */
21 21
 
22 22
 #include <vo-amrwbenc/enc_if.h>
23
+#include <stdio.h>
24
+#include <stdlib.h>
23 25
 
24 26
 #include "libavutil/avstring.h"
27
+#include "libavutil/internal.h"
28
+#include "libavutil/mem.h"
25 29
 #include "libavutil/opt.h"
26 30
 #include "avcodec.h"
27 31
 #include "internal.h"
... ...
@@ -27,6 +27,7 @@
27 27
 #include <vpx/vpx_decoder.h>
28 28
 #include <vpx/vp8dx.h>
29 29
 
30
+#include "libavutil/common.h"
30 31
 #include "libavutil/imgutils.h"
31 32
 #include "avcodec.h"
32 33
 
... ...
@@ -32,6 +32,7 @@
32 32
 #include "internal.h"
33 33
 #include "libavutil/avassert.h"
34 34
 #include "libavutil/base64.h"
35
+#include "libavutil/common.h"
35 36
 #include "libavutil/mathematics.h"
36 37
 #include "libavutil/opt.h"
37 38
 
... ...
@@ -19,7 +19,9 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/internal.h"
22 23
 #include "libavutil/opt.h"
24
+#include "libavutil/mem.h"
23 25
 #include "libavutil/pixdesc.h"
24 26
 #include "avcodec.h"
25 27
 #include "internal.h"
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "libavutil/lls.h"
23 24
 
24 25
 #define LPC_USE_DOUBLE
... ...
@@ -29,6 +29,7 @@
29 29
 
30 30
 #include "avcodec.h"
31 31
 #include "lzw.h"
32
+#include "libavutil/mem.h"
32 33
 
33 34
 #define LZW_MAXBITS                 12
34 35
 #define LZW_SIZTABLE                (1<<LZW_MAXBITS)
... ...
@@ -25,6 +25,7 @@
25 25
  */
26 26
 
27 27
 #include "avcodec.h"
28
+#include "libavutil/common.h"
28 29
 
29 30
 /*
30 31
  * Adapted to libavcodec by Francois Revol <revol@free.fr>
... ...
@@ -31,7 +31,9 @@
31 31
 
32 32
 #include "config.h"
33 33
 #include "dsputil.h"
34
+#include "libavutil/internal.h"
34 35
 #include "libavutil/lfg.h"
36
+#include "libavutil/mem.h"
35 37
 #include "libavutil/time.h"
36 38
 
37 39
 #undef printf
... ...
@@ -18,6 +18,7 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/common.h"
21 22
 #include "libavutil/intreadwrite.h"
22 23
 #include "avcodec.h"
23 24
 
... ...
@@ -18,6 +18,7 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/common.h"
21 22
 #include "libavutil/intreadwrite.h"
22 23
 #include "avcodec.h"
23 24
 #include "mpegaudiodecheader.h"
... ...
@@ -18,6 +18,7 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/common.h"
21 22
 #include "libavutil/intreadwrite.h"
22 23
 #include "avcodec.h"
23 24
 #include "mpegaudiodecheader.h"
... ...
@@ -22,6 +22,7 @@
22 22
 
23 23
 #include "parser.h"
24 24
 #include "mpegaudiodecheader.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 
27 28
 typedef struct MpegAudioParseContext {
... ...
@@ -31,6 +31,7 @@
31 31
 #include <stdlib.h>
32 32
 #include <string.h>
33 33
 
34
+#include "libavutil/internal.h"
34 35
 #include "libavutil/intreadwrite.h"
35 36
 #include "avcodec.h"
36 37
 
... ...
@@ -18,7 +18,11 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include <stdlib.h>
22
+#include <string.h>
23
+
21 24
 #include "avcodec.h"
25
+#include "libavutil/mem.h"
22 26
 
23 27
 
24 28
 static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
... ...
@@ -24,6 +24,7 @@
24 24
 #include <limits.h>
25 25
 
26 26
 #include "libavutil/bswap.h"
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/lzo.h"
28 29
 #include "libavutil/imgutils.h"
29 30
 #include "avcodec.h"
... ...
@@ -27,8 +27,10 @@
27 27
 #include "avcodec.h"
28 28
 #include "internal.h"
29 29
 #include "libavutil/avassert.h"
30
+#include "libavutil/mem.h"
30 31
 #include "libavutil/opt.h"
31 32
 #include <float.h>              /* FLT_MIN, FLT_MAX */
33
+#include <string.h>
32 34
 
33 35
 #include "options_table.h"
34 36
 
... ...
@@ -27,6 +27,7 @@
27 27
 
28 28
 #include "libavutil/opt.h"
29 29
 #include "avcodec.h"
30
+#include "config.h"
30 31
 
31 32
 #define OFFSET(x) offsetof(AVCodecContext,x)
32 33
 #define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
... ...
@@ -20,7 +20,10 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include <string.h>
24
+
23 25
 #include "parser.h"
26
+#include "libavutil/mem.h"
24 27
 
25 28
 static AVCodecParser *av_first_parser = NULL;
26 29
 
... ...
@@ -19,6 +19,9 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <stdlib.h>
23
+#include <string.h>
24
+
22 25
 #include "libavutil/imgutils.h"
23 26
 #include "avcodec.h"
24 27
 #include "pnm.h"
... ...
@@ -20,7 +20,10 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include <string.h>
24
+
23 25
 #include "libavutil/cpu.h"
26
+#include "libavutil/mem.h"
24 27
 #include "libavcodec/dsputil.h"
25 28
 #include "dsputil_altivec.h"
26 29
 
... ...
@@ -21,6 +21,7 @@
21 21
 #include "libavcodec/fmtconvert.h"
22 22
 
23 23
 #include "libavutil/ppc/util_altivec.h"
24
+#include "libavutil/mem.h"
24 25
 #include "dsputil_altivec.h"
25 26
 
26 27
 static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src,
... ...
@@ -20,6 +20,7 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include "libavutil/mem.h"
23 24
 #include "libavutil/ppc/types_altivec.h"
24 25
 #include "libavutil/ppc/util_altivec.h"
25 26
 #include "libavcodec/dsputil.h"
... ...
@@ -18,6 +18,8 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/mem.h"
22
+
21 23
 #ifdef DEBUG
22 24
 #define ASSERT_ALIGNED(ptr) assert(((unsigned long)ptr&0x0000000F));
23 25
 #else
... ...
@@ -21,6 +21,7 @@
21 21
  */
22 22
 
23 23
 #include "libavutil/cpu.h"
24
+#include "libavutil/mem.h"
24 25
 #include "libavutil/ppc/types_altivec.h"
25 26
 #include "libavutil/ppc/util_altivec.h"
26 27
 #include "libavcodec/vp8dsp.h"
... ...
@@ -22,6 +22,7 @@
22 22
 
23 23
 #include "proresdsp.h"
24 24
 #include "simple_idct.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 #define BIAS     (1 << (PRORES_BITS_PER_SAMPLE - 1))           ///< bias value for converting signed pixels into unsigned ones
27 28
 #define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8))           ///< minimum value for clipping resulting pixels
... ...
@@ -19,9 +19,12 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <string.h>
23
+
22 24
 #include "avcodec.h"
23 25
 #include "psymodel.h"
24 26
 #include "iirfilter.h"
27
+#include "libavutil/mem.h"
25 28
 
26 29
 extern const FFPsyModel ff_aac_psy_model;
27 30
 
... ...
@@ -53,6 +53,7 @@
53 53
 #include "avcodec.h"
54 54
 #include "internal.h"
55 55
 #include "thread.h"
56
+#include "libavutil/common.h"
56 57
 
57 58
 #if HAVE_PTHREADS
58 59
 #include <pthread.h>
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "libavutil/intreadwrite.h"
23 24
 #include "libavutil/imgutils.h"
24 25
 #include "avcodec.h"
... ...
@@ -24,6 +24,7 @@
24 24
  * Apple QuickDraw codec.
25 25
  */
26 26
 
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/intreadwrite.h"
28 29
 #include "avcodec.h"
29 30
 
... ...
@@ -22,6 +22,7 @@
22 22
 
23 23
 #include "avcodec.h"
24 24
 #include "libavutil/bswap.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 static av_cold int decode_init(AVCodecContext *avctx)
27 28
 {
... ...
@@ -23,6 +23,7 @@
23 23
 #include "avcodec.h"
24 24
 #include "celp_filters.h"
25 25
 #include "ra144.h"
26
+#include "libavutil/common.h"
26 27
 
27 28
 const int16_t ff_gain_val_tab[256][3] = {
28 29
     { 541, 956,  768}, { 877, 581,  568}, { 675,1574,  635}, {1248,1464,  668},
... ...
@@ -24,6 +24,7 @@
24 24
 
25 25
 #include <stdint.h>
26 26
 #include "dsputil.h"
27
+#include "libavutil/common.h"
27 28
 
28 29
 static const float amptable[8]={
29 30
      0.515625,  0.90234375,  1.57910156,  2.76342773,
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "avcodec.h"
28 28
 #include "raw.h"
29
+#include "libavutil/common.h"
29 30
 
30 31
 const PixelFormatTag ff_raw_pix_fmt_tags[] = {
31 32
     { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
... ...
@@ -28,6 +28,7 @@
28 28
 #include "imgconvert.h"
29 29
 #include "raw.h"
30 30
 #include "libavutil/avassert.h"
31
+#include "libavutil/common.h"
31 32
 #include "libavutil/intreadwrite.h"
32 33
 #include "libavutil/imgutils.h"
33 34
 #include "libavutil/opt.h"
... ...
@@ -29,6 +29,7 @@
29 29
 #include "internal.h"
30 30
 #include "libavutil/pixdesc.h"
31 31
 #include "libavutil/intreadwrite.h"
32
+#include "libavutil/internal.h"
32 33
 
33 34
 static av_cold int raw_init_encoder(AVCodecContext *avctx)
34 35
 {
... ...
@@ -24,9 +24,12 @@
24 24
  * samplerate conversion for both audio and video
25 25
  */
26 26
 
27
+#include <string.h>
28
+
27 29
 #include "avcodec.h"
28 30
 #include "audioconvert.h"
29 31
 #include "libavutil/opt.h"
32
+#include "libavutil/mem.h"
30 33
 #include "libavutil/samplefmt.h"
31 34
 
32 35
 #define MAX_CHANNELS 8
... ...
@@ -28,6 +28,7 @@
28 28
 #include "libavutil/avassert.h"
29 29
 #include "avcodec.h"
30 30
 #include "dsputil.h"
31
+#include "libavutil/common.h"
31 32
 
32 33
 #ifndef CONFIG_RESAMPLE_HP
33 34
 #define FILTER_SHIFT 15
... ...
@@ -30,7 +30,9 @@
30 30
 #include <stdlib.h>
31 31
 #include <string.h>
32 32
 
33
+#include "libavutil/internal.h"
33 34
 #include "libavutil/intreadwrite.h"
35
+#include "libavutil/mem.h"
34 36
 #include "avcodec.h"
35 37
 
36 38
 
... ...
@@ -20,6 +20,7 @@
20 20
  */
21 21
 #include "avcodec.h"
22 22
 #include "rle.h"
23
+#include "libavutil/common.h"
23 24
 
24 25
 /**
25 26
  * Count up to 127 consecutive pixels which are either all the same or
... ...
@@ -38,6 +38,7 @@
38 38
 #include <stdlib.h>
39 39
 #include <string.h>
40 40
 
41
+#include "libavutil/internal.h"
41 42
 #include "libavutil/intreadwrite.h"
42 43
 #include "avcodec.h"
43 44
 
... ...
@@ -24,6 +24,7 @@
24 24
 
25 25
 #include <stdint.h>
26 26
 #include "dsputil.h"
27
+#include "libavutil/mem.h"
27 28
 
28 29
 #define RTJPEG_FILE_VERSION 0
29 30
 #define RTJPEG_HEADER_SIZE 12
... ...
@@ -26,6 +26,7 @@
26 26
  */
27 27
 #include "dsputil.h"
28 28
 #include "rv34dsp.h"
29
+#include "libavutil/common.h"
29 30
 
30 31
 /**
31 32
  * @name RV30/40 inverse transform functions
... ...
@@ -28,6 +28,7 @@
28 28
 #include "dsputil.h"
29 29
 #include "rv34dsp.h"
30 30
 #include "libavutil/avassert.h"
31
+#include "libavutil/common.h"
31 32
 
32 33
 #define RV40_LOWPASS(OPNAME, OP) \
33 34
 static av_unused void OPNAME ## rv40_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,\
... ...
@@ -20,6 +20,7 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include "libavutil/common.h"
23 24
 #include "libavutil/intreadwrite.h"
24 25
 #include "avcodec.h"
25 26
 
... ...
@@ -28,6 +28,7 @@
28 28
 // for the host and the target and config.h is only valid for the target
29 29
 #include <math.h>
30 30
 #include "libavutil/attributes.h"
31
+#include "libavutil/common.h"
31 32
 
32 33
 #if !CONFIG_HARDCODED_TABLES
33 34
 SINETABLE(  32);
... ...
@@ -27,6 +27,7 @@
27 27
 #include "avcodec.h"
28 28
 #include "dsputil.h"
29 29
 #include "acelp_pitch_delay.h"
30
+#include "libavutil/mem.h"
30 31
 
31 32
 #define LP_FILTER_ORDER_16k  16
32 33
 #define L_SUBFR_16k          80
... ...
@@ -24,6 +24,7 @@
24 24
 #include <math.h>
25 25
 
26 26
 #include "sipr.h"
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/mathematics.h"
28 29
 #include "lsp.h"
29 30
 #include "celp_math.h"
... ...
@@ -27,6 +27,7 @@
27 27
 #include <inttypes.h>
28 28
 
29 29
 #include "libavcodec/dsputil.h"
30
+#include "libavutil/mem.h"
30 31
 #include "dsputil_vis.h"
31 32
 
32 33
 #include "vis.h"
... ...
@@ -22,8 +22,11 @@
22 22
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 23
  */
24 24
 
25
+#include <stdint.h>
26
+
25 27
 #include "libavcodec/dsputil.h"
26 28
 #include "dsputil_vis.h"
29
+#include "libavutil/mem.h"
27 30
 
28 31
 static const DECLARE_ALIGNED(8, int16_t, coeffs)[28] = {
29 32
     - 1259,- 1259,- 1259,- 1259,
... ...
@@ -20,6 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "libavutil/avstring.h"
23
+#include "libavutil/common.h"
23 24
 #include "libavutil/parseutils.h"
24 25
 #include "avcodec.h"
25 26
 #include "ass.h"
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "libavutil/intreadwrite.h"
23 24
 #include "libavutil/imgutils.h"
24 25
 #include "avcodec.h"
... ...
@@ -19,6 +19,9 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <string.h>
23
+
24
+#include "libavutil/internal.h"
22 25
 #include "libavutil/intreadwrite.h"
23 26
 #include "libavutil/pixdesc.h"
24 27
 #include "avcodec.h"
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "avcodec.h"
28 28
 #include "bytestream.h"
29
+#include "config.h"
29 30
 #if CONFIG_ZLIB
30 31
 #include <zlib.h>
31 32
 #endif
... ...
@@ -30,12 +30,12 @@
30 30
 #include "libavutil/opt.h"
31 31
 
32 32
 #include "avcodec.h"
33
-#include "internal.h"
33
+#include "config.h"
34 34
 #if CONFIG_ZLIB
35 35
 #include <zlib.h>
36 36
 #endif
37
-#include "libavutil/opt.h"
38 37
 #include "bytestream.h"
38
+#include "internal.h"
39 39
 #include "tiff.h"
40 40
 #include "rle.h"
41 41
 #include "lzw.h"
... ...
@@ -26,7 +26,10 @@
26 26
  * @see http://www.oldskool.org/pc/8088_Corruption
27 27
  */
28 28
 
29
+#include <string.h>
30
+
29 31
 #include "avcodec.h"
32
+#include "libavutil/internal.h"
30 33
 
31 34
 #include "cga_data.h"
32 35
 
... ...
@@ -36,6 +36,8 @@
36 36
 #include "avcodec.h"
37 37
 #include "dsputil.h"
38 38
 #include "libavutil/imgutils.h"
39
+#include "libavutil/internal.h"
40
+#include "libavutil/mem.h"
39 41
 
40 42
 #include "truemotion1data.h"
41 43
 
... ...
@@ -24,6 +24,8 @@
24 24
 #include "avcodec.h"
25 25
 #include "v210dec.h"
26 26
 #include "libavutil/bswap.h"
27
+#include "libavutil/internal.h"
28
+#include "libavutil/mem.h"
27 29
 
28 30
 #define READ_PIXELS(a, b, c)         \
29 31
     do {                             \
... ...
@@ -20,6 +20,8 @@
20 20
 
21 21
 #include "avcodec.h"
22 22
 #include "libavutil/bswap.h"
23
+#include "libavutil/internal.h"
24
+#include "libavutil/mem.h"
23 25
 
24 26
 static av_cold int decode_init(AVCodecContext *avctx)
25 27
 {
... ...
@@ -20,6 +20,7 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include "libavutil/common.h"
23 24
 #include "libavutil/intreadwrite.h"
24 25
 #include "avcodec.h"
25 26
 
... ...
@@ -20,6 +20,7 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include "libavutil/common.h"
23 24
 #include "libavutil/intreadwrite.h"
24 25
 #include "avcodec.h"
25 26
 #include "internal.h"
... ...
@@ -27,6 +27,8 @@
27 27
 
28 28
 #include "vc1dsp.h"
29 29
 #include "libavutil/avassert.h"
30
+#include "libavutil/common.h"
31
+
30 32
 
31 33
 /** Apply overlap transform to horizontal edge
32 34
 */
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "avcodec.h"
28 28
 #include "dsputil.h"
29
+#include "libavutil/internal.h"
29 30
 
30 31
 typedef struct VCR1Context {
31 32
     AVFrame picture;
... ...
@@ -43,6 +43,7 @@
43 43
 #include <stdlib.h>
44 44
 #include <string.h>
45 45
 
46
+#include "libavutil/common.h"
46 47
 #include "libavutil/intreadwrite.h"
47 48
 #include "avcodec.h"
48 49
 
... ...
@@ -28,6 +28,7 @@
28 28
 #include <stdio.h>
29 29
 #include <stdlib.h>
30 30
 
31
+#include "libavutil/common.h"
31 32
 #include "libavutil/intreadwrite.h"
32 33
 #include "avcodec.h"
33 34
 
... ...
@@ -21,6 +21,7 @@
21 21
 #include "dsputil.h"
22 22
 #include "vorbis.h"
23 23
 #include "libavutil/audioconvert.h"
24
+#include "libavutil/mem.h"
24 25
 
25 26
 const uint8_t ff_vorbis_channel_layout_offsets[8][8] = {
26 27
     { 0 },
... ...
@@ -25,6 +25,7 @@
25 25
  */
26 26
 
27 27
 #include "libavutil/attributes.h"
28
+#include "libavutil/common.h"
28 29
 #include "avcodec.h"
29 30
 #include "dsputil.h"
30 31
 #include "vp3dsp.h"
... ...
@@ -22,6 +22,7 @@
22 22
 #include <stdint.h>
23 23
 #include "avcodec.h"
24 24
 #include "vp56dsp.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 /* Gives very similar result than the vp6 version except in a few cases */
27 28
 static int vp5_adjust(int v, int t)
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "dsputil.h"
28 28
 #include "vp8dsp.h"
29
+#include "libavutil/common.h"
29 30
 
30 31
 // TODO: Maybe add dequant
31 32
 static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16])
... ...
@@ -20,6 +20,7 @@
20 20
  */
21 21
 
22 22
 #include <stdint.h>
23
+#include "libavutil/common.h"
23 24
 #include "libavutil/intreadwrite.h"
24 25
 #include "avcodec.h"
25 26
 
... ...
@@ -25,9 +25,9 @@ MMX-OBJS-$(CONFIG_H264DSP)             += x86/h264dsp_init.o
25 25
 MMX-OBJS-$(CONFIG_H264PRED)            += x86/h264_intrapred_init.o
26 26
 MMX-OBJS-$(CONFIG_LPC)                 += x86/lpc_mmx.o
27 27
 MMX-OBJS-$(CONFIG_MPEGAUDIODSP)        += x86/mpegaudiodec_mmx.o
28
-MMX-OBJS-$(CONFIG_PNG_DECODER)         += x86/pngdsp-init.o
29
-MMX-OBJS-$(CONFIG_PRORES_DECODER)      += x86/proresdsp-init.o
30
-MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp-init.o
28
+MMX-OBJS-$(CONFIG_PNG_DECODER)         += x86/pngdsp_init.o
29
+MMX-OBJS-$(CONFIG_PRORES_DECODER)      += x86/proresdsp_init.o
30
+MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o
31 31
 MMX-OBJS-$(CONFIG_RV30_DECODER)        += x86/rv34dsp_init.o
32 32
 MMX-OBJS-$(CONFIG_RV40_DECODER)        += x86/rv34dsp_init.o            \
33 33
                                           x86/rv40dsp_init.o
... ...
@@ -35,7 +35,7 @@ MMX-OBJS-$(CONFIG_V210_DECODER)        += x86/v210-init.o
35 35
 MMX-OBJS-$(CONFIG_VC1_DECODER)         += x86/vc1dsp_mmx.o
36 36
 MMX-OBJS-$(CONFIG_VP5_DECODER)         += x86/vp56dsp_init.o
37 37
 MMX-OBJS-$(CONFIG_VP6_DECODER)         += x86/vp56dsp_init.o
38
-MMX-OBJS-$(CONFIG_VP8_DECODER)         += x86/vp8dsp-init.o
38
+MMX-OBJS-$(CONFIG_VP8_DECODER)         += x86/vp8dsp_init.o
39 39
 
40 40
 YASM-OBJS-$(CONFIG_AAC_DECODER)        += x86/sbrdsp.o
41 41
 YASM-OBJS-$(CONFIG_AC3DSP)             += x86/ac3dsp.o
... ...
@@ -40,7 +40,10 @@
40 40
  */
41 41
 
42 42
 #include <inttypes.h>
43
+
44
+#include "config.h"
43 45
 #include "libavcodec/avcodec.h"
46
+#include "libavutil/mem.h"
44 47
 #include "idct_xvid.h"
45 48
 
46 49
 #if HAVE_INLINE_ASM
... ...
@@ -39,6 +39,8 @@
39 39
  */
40 40
 
41 41
 #include "libavcodec/dsputil.h"
42
+#include "libavutil/internal.h"
43
+#include "libavutil/mem.h"
42 44
 #include "libavutil/x86/asm.h"
43 45
 #include "idct_xvid.h"
44 46
 #include "dsputil_mmx.h"
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include "libavutil/x86/asm.h"
23 23
 #include "libavutil/cpu.h"
24
+#include "libavutil/internal.h"
24 25
 #include "libavcodec/lpc.h"
25 26
 
26 27
 #if HAVE_INLINE_ASM
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/internal.h"
22 23
 #include "libavutil/x86/asm.h"
23 24
 #include "libavcodec/dsputil.h"
24 25
 #include "libavcodec/mlp.h"
... ...
@@ -22,6 +22,8 @@
22 22
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 23
  */
24 24
 
25
+#include "libavutil/internal.h"
26
+#include "libavutil/mem.h"
25 27
 #include "libavutil/x86/asm.h"
26 28
 #include "libavcodec/dsputil.h"
27 29
 #include "dsputil_mmx.h"
28 30
deleted file mode 100644
... ...
@@ -1,51 +0,0 @@
1
-/*
2
- * x86 PNG optimizations.
3
- * Copyright (c) 2008 Loren Merrit <lorenm@u.washington.edu>
4
- *
5
- * This file is part of FFmpeg.
6
- *
7
- * FFmpeg is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU Lesser General Public
9
- * License as published by the Free Software Foundation; either
10
- * version 2.1 of the License, or (at your option) any later version.
11
- *
12
- * FFmpeg is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
- * Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public
18
- * License along with FFmpeg; if not, write to the Free Software
19
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
- */
21
-
22
-#include "libavutil/common.h"
23
-#include "libavutil/cpu.h"
24
-#include "libavcodec/pngdsp.h"
25
-
26
-void ff_add_png_paeth_prediction_mmx2 (uint8_t *dst, uint8_t *src,
27
-                                       uint8_t *top, int w, int bpp);
28
-void ff_add_png_paeth_prediction_ssse3(uint8_t *dst, uint8_t *src,
29
-                                       uint8_t *top, int w, int bpp);
30
-void ff_add_bytes_l2_mmx (uint8_t *dst, uint8_t *src1,
31
-                          uint8_t *src2, int w);
32
-void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
33
-                          uint8_t *src2, int w);
34
-
35
-void ff_pngdsp_init_x86(PNGDSPContext *dsp)
36
-{
37
-#if HAVE_YASM
38
-    int flags = av_get_cpu_flags();
39
-
40
-#if ARCH_X86_32
41
-    if (flags & AV_CPU_FLAG_MMX)
42
-        dsp->add_bytes_l2         = ff_add_bytes_l2_mmx;
43
-#endif
44
-    if (flags & AV_CPU_FLAG_MMXEXT)
45
-        dsp->add_paeth_prediction = ff_add_png_paeth_prediction_mmx2;
46
-    if (flags & AV_CPU_FLAG_SSE2)
47
-        dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
48
-    if (flags & AV_CPU_FLAG_SSSE3)
49
-        dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
50
-#endif
51
-}
52 1
new file mode 100644
... ...
@@ -0,0 +1,51 @@
0
+/*
1
+ * x86 PNG optimizations.
2
+ * Copyright (c) 2008 Loren Merrit <lorenm@u.washington.edu>
3
+ *
4
+ * This file is part of FFmpeg.
5
+ *
6
+ * FFmpeg is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * FFmpeg is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with FFmpeg; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
+ */
20
+
21
+#include "libavutil/common.h"
22
+#include "libavutil/cpu.h"
23
+#include "libavcodec/pngdsp.h"
24
+
25
+void ff_add_png_paeth_prediction_mmx2 (uint8_t *dst, uint8_t *src,
26
+                                       uint8_t *top, int w, int bpp);
27
+void ff_add_png_paeth_prediction_ssse3(uint8_t *dst, uint8_t *src,
28
+                                       uint8_t *top, int w, int bpp);
29
+void ff_add_bytes_l2_mmx (uint8_t *dst, uint8_t *src1,
30
+                          uint8_t *src2, int w);
31
+void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
32
+                          uint8_t *src2, int w);
33
+
34
+void ff_pngdsp_init_x86(PNGDSPContext *dsp)
35
+{
36
+#if HAVE_YASM
37
+    int flags = av_get_cpu_flags();
38
+
39
+#if ARCH_X86_32
40
+    if (flags & AV_CPU_FLAG_MMX)
41
+        dsp->add_bytes_l2         = ff_add_bytes_l2_mmx;
42
+#endif
43
+    if (flags & AV_CPU_FLAG_MMXEXT)
44
+        dsp->add_paeth_prediction = ff_add_png_paeth_prediction_mmx2;
45
+    if (flags & AV_CPU_FLAG_SSE2)
46
+        dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
47
+    if (flags & AV_CPU_FLAG_SSSE3)
48
+        dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
49
+#endif
50
+}
0 51
deleted file mode 100644
... ...
@@ -1,57 +0,0 @@
1
-/*
2
- * Apple ProRes compatible decoder
3
- *
4
- * Copyright (c) 2010-2011 Maxim Poliakovski
5
- *
6
- * This file is part of Libav.
7
- *
8
- * Libav is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU Lesser General Public
10
- * License as published by the Free Software Foundation; either
11
- * version 2.1 of the License, or (at your option) any later version.
12
- *
13
- * Libav is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
- * Lesser General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Lesser General Public
19
- * License along with Libav; if not, write to the Free Software
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
- */
22
-
23
-#include "libavcodec/proresdsp.h"
24
-
25
-void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
26
-                                DCTELEM *block, const int16_t *qmat);
27
-void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize,
28
-                                DCTELEM *block, const int16_t *qmat);
29
-void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,
30
-                                DCTELEM *block, const int16_t *qmat);
31
-
32
-void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx)
33
-{
34
-#if ARCH_X86_64 && HAVE_YASM
35
-    int flags = av_get_cpu_flags();
36
-
37
-    if(avctx->flags & CODEC_FLAG_BITEXACT)
38
-        return;
39
-
40
-    if (flags & AV_CPU_FLAG_SSE2) {
41
-        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
42
-        dsp->idct_put = ff_prores_idct_put_10_sse2;
43
-    }
44
-
45
-    if (flags & AV_CPU_FLAG_SSE4) {
46
-        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
47
-        dsp->idct_put = ff_prores_idct_put_10_sse4;
48
-    }
49
-
50
-#if HAVE_AVX
51
-    if (flags & AV_CPU_FLAG_AVX) {
52
-        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
53
-        dsp->idct_put = ff_prores_idct_put_10_avx;
54
-    }
55
-#endif /* HAVE_AVX */
56
-#endif /* ARCH_X86_64 && HAVE_YASM */
57
-}
58 1
new file mode 100644
... ...
@@ -0,0 +1,57 @@
0
+/*
1
+ * Apple ProRes compatible decoder
2
+ *
3
+ * Copyright (c) 2010-2011 Maxim Poliakovski
4
+ *
5
+ * This file is part of FFmpeg.
6
+ *
7
+ * FFmpeg is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * FFmpeg is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with FFmpeg; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+#include "libavcodec/proresdsp.h"
23
+
24
+void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
25
+                                DCTELEM *block, const int16_t *qmat);
26
+void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize,
27
+                                DCTELEM *block, const int16_t *qmat);
28
+void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,
29
+                                DCTELEM *block, const int16_t *qmat);
30
+
31
+void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx)
32
+{
33
+#if ARCH_X86_64 && HAVE_YASM
34
+    int flags = av_get_cpu_flags();
35
+
36
+    if(avctx->flags & CODEC_FLAG_BITEXACT)
37
+        return;
38
+
39
+    if (flags & AV_CPU_FLAG_SSE2) {
40
+        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
41
+        dsp->idct_put = ff_prores_idct_put_10_sse2;
42
+    }
43
+
44
+    if (flags & AV_CPU_FLAG_SSE4) {
45
+        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
46
+        dsp->idct_put = ff_prores_idct_put_10_sse4;
47
+    }
48
+
49
+#if HAVE_AVX
50
+    if (flags & AV_CPU_FLAG_AVX) {
51
+        dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
52
+        dsp->idct_put = ff_prores_idct_put_10_avx;
53
+    }
54
+#endif /* HAVE_AVX */
55
+#endif /* ARCH_X86_64 && HAVE_YASM */
56
+}
... ...
@@ -27,6 +27,7 @@
27 27
  */
28 28
 
29 29
 #include "libavcodec/rv34dsp.h"
30
+#include "libavutil/mem.h"
30 31
 #include "dsputil_mmx.h"
31 32
 
32 33
 void ff_put_rv40_chroma_mc8_mmx  (uint8_t *dst, uint8_t *src,
... ...
@@ -21,6 +21,8 @@
21 21
  */
22 22
 #include "libavcodec/dsputil.h"
23 23
 #include "libavcodec/simple_idct.h"
24
+#include "libavutil/internal.h"
25
+#include "libavutil/mem.h"
24 26
 #include "dsputil_mmx.h"
25 27
 
26 28
 #if HAVE_INLINE_ASM
... ...
@@ -25,6 +25,8 @@
25 25
  */
26 26
 
27 27
 #include "libavutil/cpu.h"
28
+#include "libavutil/internal.h"
29
+#include "libavutil/mem.h"
28 30
 #include "libavutil/x86/asm.h"
29 31
 #include "libavcodec/dsputil.h"
30 32
 #include "dsputil_mmx.h"
31 33
deleted file mode 100644
... ...
@@ -1,449 +0,0 @@
1
-/*
2
- * VP8 DSP functions x86-optimized
3
- * Copyright (c) 2010 Ronald S. Bultje <rsbultje@gmail.com>
4
- * Copyright (c) 2010 Jason Garrett-Glaser <darkshikari@gmail.com>
5
- *
6
- * This file is part of FFmpeg.
7
- *
8
- * FFmpeg is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU Lesser General Public
10
- * License as published by the Free Software Foundation; either
11
- * version 2.1 of the License, or (at your option) any later version.
12
- *
13
- * FFmpeg is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
- * Lesser General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Lesser General Public
19
- * License along with FFmpeg; if not, write to the Free Software
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
- */
22
-
23
-#include "libavutil/cpu.h"
24
-#include "libavutil/x86/asm.h"
25
-#include "libavcodec/vp8dsp.h"
26
-
27
-#if HAVE_YASM
28
-
29
-/*
30
- * MC functions
31
- */
32
-extern void ff_put_vp8_epel4_h4_mmx2  (uint8_t *dst, ptrdiff_t dststride,
33
-                                       uint8_t *src, ptrdiff_t srcstride,
34
-                                       int height, int mx, int my);
35
-extern void ff_put_vp8_epel4_h6_mmx2  (uint8_t *dst, ptrdiff_t dststride,
36
-                                       uint8_t *src, ptrdiff_t srcstride,
37
-                                       int height, int mx, int my);
38
-extern void ff_put_vp8_epel4_v4_mmx2  (uint8_t *dst, ptrdiff_t dststride,
39
-                                       uint8_t *src, ptrdiff_t srcstride,
40
-                                       int height, int mx, int my);
41
-extern void ff_put_vp8_epel4_v6_mmx2  (uint8_t *dst, ptrdiff_t dststride,
42
-                                       uint8_t *src, ptrdiff_t srcstride,
43
-                                       int height, int mx, int my);
44
-
45
-extern void ff_put_vp8_epel8_h4_sse2  (uint8_t *dst, ptrdiff_t dststride,
46
-                                       uint8_t *src, ptrdiff_t srcstride,
47
-                                       int height, int mx, int my);
48
-extern void ff_put_vp8_epel8_h6_sse2  (uint8_t *dst, ptrdiff_t dststride,
49
-                                       uint8_t *src, ptrdiff_t srcstride,
50
-                                       int height, int mx, int my);
51
-extern void ff_put_vp8_epel8_v4_sse2  (uint8_t *dst, ptrdiff_t dststride,
52
-                                       uint8_t *src, ptrdiff_t srcstride,
53
-                                       int height, int mx, int my);
54
-extern void ff_put_vp8_epel8_v6_sse2  (uint8_t *dst, ptrdiff_t dststride,
55
-                                       uint8_t *src, ptrdiff_t srcstride,
56
-                                       int height, int mx, int my);
57
-
58
-extern void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
59
-                                       uint8_t *src, ptrdiff_t srcstride,
60
-                                       int height, int mx, int my);
61
-extern void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
62
-                                       uint8_t *src, ptrdiff_t srcstride,
63
-                                       int height, int mx, int my);
64
-extern void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
65
-                                       uint8_t *src, ptrdiff_t srcstride,
66
-                                       int height, int mx, int my);
67
-extern void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
68
-                                       uint8_t *src, ptrdiff_t srcstride,
69
-                                       int height, int mx, int my);
70
-extern void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
71
-                                       uint8_t *src, ptrdiff_t srcstride,
72
-                                       int height, int mx, int my);
73
-extern void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
74
-                                       uint8_t *src, ptrdiff_t srcstride,
75
-                                       int height, int mx, int my);
76
-extern void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
77
-                                       uint8_t *src, ptrdiff_t srcstride,
78
-                                       int height, int mx, int my);
79
-extern void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
80
-                                       uint8_t *src, ptrdiff_t srcstride,
81
-                                       int height, int mx, int my);
82
-
83
-extern void ff_put_vp8_bilinear4_h_mmx2  (uint8_t *dst, ptrdiff_t dststride,
84
-                                          uint8_t *src, ptrdiff_t srcstride,
85
-                                          int height, int mx, int my);
86
-extern void ff_put_vp8_bilinear8_h_sse2  (uint8_t *dst, ptrdiff_t dststride,
87
-                                          uint8_t *src, ptrdiff_t srcstride,
88
-                                          int height, int mx, int my);
89
-extern void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
90
-                                          uint8_t *src, ptrdiff_t srcstride,
91
-                                          int height, int mx, int my);
92
-extern void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
93
-                                          uint8_t *src, ptrdiff_t srcstride,
94
-                                          int height, int mx, int my);
95
-
96
-extern void ff_put_vp8_bilinear4_v_mmx2  (uint8_t *dst, ptrdiff_t dststride,
97
-                                          uint8_t *src, ptrdiff_t srcstride,
98
-                                          int height, int mx, int my);
99
-extern void ff_put_vp8_bilinear8_v_sse2  (uint8_t *dst, ptrdiff_t dststride,
100
-                                          uint8_t *src, ptrdiff_t srcstride,
101
-                                          int height, int mx, int my);
102
-extern void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
103
-                                          uint8_t *src, ptrdiff_t srcstride,
104
-                                          int height, int mx, int my);
105
-extern void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
106
-                                          uint8_t *src, ptrdiff_t srcstride,
107
-                                          int height, int mx, int my);
108
-
109
-
110
-extern void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride,
111
-                                    uint8_t *src, ptrdiff_t srcstride,
112
-                                    int height, int mx, int my);
113
-extern void ff_put_vp8_pixels16_mmx(uint8_t *dst, ptrdiff_t dststride,
114
-                                    uint8_t *src, ptrdiff_t srcstride,
115
-                                    int height, int mx, int my);
116
-extern void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride,
117
-                                    uint8_t *src, ptrdiff_t srcstride,
118
-                                    int height, int mx, int my);
119
-
120
-#define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \
121
-static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \
122
-    uint8_t *dst,  ptrdiff_t dststride, uint8_t *src, \
123
-    ptrdiff_t srcstride, int height, int mx, int my) \
124
-{ \
125
-    ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
126
-        dst,     dststride, src,     srcstride, height, mx, my); \
127
-    ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
128
-        dst + 8, dststride, src + 8, srcstride, height, mx, my); \
129
-}
130
-#define TAP_W8(OPT, FILTERTYPE, TAPTYPE) \
131
-static void ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
132
-    uint8_t *dst,  ptrdiff_t dststride, uint8_t *src, \
133
-    ptrdiff_t srcstride, int height, int mx, int my) \
134
-{ \
135
-    ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
136
-        dst,     dststride, src,     srcstride, height, mx, my); \
137
-    ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
138
-        dst + 4, dststride, src + 4, srcstride, height, mx, my); \
139
-}
140
-
141
-#if ARCH_X86_32
142
-TAP_W8 (mmx2,  epel, h4)
143
-TAP_W8 (mmx2,  epel, h6)
144
-TAP_W16(mmx2,  epel, h6)
145
-TAP_W8 (mmx2,  epel, v4)
146
-TAP_W8 (mmx2,  epel, v6)
147
-TAP_W16(mmx2,  epel, v6)
148
-TAP_W8 (mmx2,  bilinear, h)
149
-TAP_W16(mmx2,  bilinear, h)
150
-TAP_W8 (mmx2,  bilinear, v)
151
-TAP_W16(mmx2,  bilinear, v)
152
-#endif
153
-
154
-TAP_W16(sse2,  epel, h6)
155
-TAP_W16(sse2,  epel, v6)
156
-TAP_W16(sse2,  bilinear, h)
157
-TAP_W16(sse2,  bilinear, v)
158
-
159
-TAP_W16(ssse3, epel, h6)
160
-TAP_W16(ssse3, epel, v6)
161
-TAP_W16(ssse3, bilinear, h)
162
-TAP_W16(ssse3, bilinear, v)
163
-
164
-#define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
165
-static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
166
-    uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
167
-    ptrdiff_t srcstride, int height, int mx, int my) \
168
-{ \
169
-    DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \
170
-    uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \
171
-    src -= srcstride * (TAPNUMY / 2 - 1); \
172
-    ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \
173
-        tmp, SIZE,      src,    srcstride, height + TAPNUMY - 1, mx, my); \
174
-    ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \
175
-        dst, dststride, tmpptr, SIZE,      height,               mx, my); \
176
-}
177
-
178
-#if ARCH_X86_32
179
-#define HVTAPMMX(x, y) \
180
-HVTAP(mmx2, 8, x, y,  4,  8) \
181
-HVTAP(mmx2, 8, x, y,  8, 16)
182
-
183
-HVTAP(mmx2, 8, 6, 6, 16, 16)
184
-#else
185
-#define HVTAPMMX(x, y) \
186
-HVTAP(mmx2, 8, x, y,  4,  8)
187
-#endif
188
-
189
-HVTAPMMX(4, 4)
190
-HVTAPMMX(4, 6)
191
-HVTAPMMX(6, 4)
192
-HVTAPMMX(6, 6)
193
-
194
-#define HVTAPSSE2(x, y, w) \
195
-HVTAP(sse2,  16, x, y, w, 16) \
196
-HVTAP(ssse3, 16, x, y, w, 16)
197
-
198
-HVTAPSSE2(4, 4, 8)
199
-HVTAPSSE2(4, 6, 8)
200
-HVTAPSSE2(6, 4, 8)
201
-HVTAPSSE2(6, 6, 8)
202
-HVTAPSSE2(6, 6, 16)
203
-
204
-HVTAP(ssse3, 16, 4, 4, 4, 8)
205
-HVTAP(ssse3, 16, 4, 6, 4, 8)
206
-HVTAP(ssse3, 16, 6, 4, 4, 8)
207
-HVTAP(ssse3, 16, 6, 6, 4, 8)
208
-
209
-#define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
210
-static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
211
-    uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
212
-    ptrdiff_t srcstride, int height, int mx, int my) \
213
-{ \
214
-    DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \
215
-    ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \
216
-        tmp, SIZE,      src, srcstride, height + 1, mx, my); \
217
-    ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \
218
-        dst, dststride, tmp, SIZE,      height,     mx, my); \
219
-}
220
-
221
-HVBILIN(mmx2,  8,  4,  8)
222
-#if ARCH_X86_32
223
-HVBILIN(mmx2,  8,  8, 16)
224
-HVBILIN(mmx2,  8, 16, 16)
225
-#endif
226
-HVBILIN(sse2,  8,  8, 16)
227
-HVBILIN(sse2,  8, 16, 16)
228
-HVBILIN(ssse3, 8,  4,  8)
229
-HVBILIN(ssse3, 8,  8, 16)
230
-HVBILIN(ssse3, 8, 16, 16)
231
-
232
-extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16],
233
-                                   ptrdiff_t stride);
234
-extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16],
235
-                                    ptrdiff_t stride);
236
-extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16],
237
-                                      ptrdiff_t stride);
238
-extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16],
239
-                                      ptrdiff_t stride);
240
-extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16],
241
-                                      ptrdiff_t stride);
242
-extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]);
243
-extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]);
244
-extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16],
245
-                                ptrdiff_t stride);
246
-extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16],
247
-                                ptrdiff_t stride);
248
-
249
-#define DECLARE_LOOP_FILTER(NAME)\
250
-extern void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, \
251
-                                                 ptrdiff_t stride, \
252
-                                                 int flim);\
253
-extern void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, \
254
-                                                 ptrdiff_t stride, \
255
-                                                 int flim);\
256
-extern void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
257
-                                                     ptrdiff_t stride,\
258
-                                                    int e, int i, int hvt);\
259
-extern void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
260
-                                                    ptrdiff_t stride,\
261
-                                                    int e, int i, int hvt);\
262
-extern void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
263
-                                                    uint8_t *dstV,\
264
-                                                    ptrdiff_t s, \
265
-                                                    int e, int i, int hvt);\
266
-extern void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
267
-                                                    uint8_t *dstV,\
268
-                                                    ptrdiff_t s, \
269
-                                                    int e, int i, int hvt);\
270
-extern void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
271
-                                                    ptrdiff_t stride,\
272
-                                                    int e, int i, int hvt);\
273
-extern void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
274
-                                                    ptrdiff_t stride,\
275
-                                                    int e, int i, int hvt);\
276
-extern void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
277
-                                                    uint8_t *dstV,\
278
-                                                    ptrdiff_t s, \
279
-                                                    int e, int i, int hvt);\
280
-extern void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
281
-                                                    uint8_t *dstV,\
282
-                                                    ptrdiff_t s, \
283
-                                                    int e, int i, int hvt);
284
-
285
-DECLARE_LOOP_FILTER(mmx)
286
-DECLARE_LOOP_FILTER(mmx2)
287
-DECLARE_LOOP_FILTER(sse2)
288
-DECLARE_LOOP_FILTER(ssse3)
289
-DECLARE_LOOP_FILTER(sse4)
290
-
291
-#endif
292
-
293
-#define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
294
-    c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
295
-    c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \
296
-    c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT
297
-
298
-#define VP8_MC_FUNC(IDX, SIZE, OPT) \
299
-    c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \
300
-    c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \
301
-    c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \
302
-    c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \
303
-    c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \
304
-    VP8_LUMA_MC_FUNC(IDX, SIZE, OPT)
305
-
306
-#define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \
307
-    c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
308
-    c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
309
-    c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
310
-    c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
311
-    c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
312
-    c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
313
-    c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
314
-    c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
315
-
316
-
317
-av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
318
-{
319
-#if HAVE_YASM
320
-    int mm_flags = av_get_cpu_flags();
321
-
322
-    if (mm_flags & AV_CPU_FLAG_MMX) {
323
-        c->vp8_idct_dc_add    = ff_vp8_idct_dc_add_mmx;
324
-        c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
325
-#if ARCH_X86_32
326
-        c->vp8_idct_dc_add4y  = ff_vp8_idct_dc_add4y_mmx;
327
-        c->vp8_idct_add       = ff_vp8_idct_add_mmx;
328
-        c->vp8_luma_dc_wht    = ff_vp8_luma_dc_wht_mmx;
329
-        c->put_vp8_epel_pixels_tab[0][0][0]     =
330
-        c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
331
-#endif
332
-        c->put_vp8_epel_pixels_tab[1][0][0]     =
333
-        c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
334
-
335
-#if ARCH_X86_32
336
-        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
337
-        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
338
-
339
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx;
340
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx;
341
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx;
342
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx;
343
-
344
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_mmx;
345
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_mmx;
346
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_mmx;
347
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_mmx;
348
-#endif
349
-    }
350
-
351
-    /* note that 4-tap width=16 functions are missing because w=16
352
-     * is only used for luma, and luma is always a copy or sixtap. */
353
-    if (mm_flags & AV_CPU_FLAG_MMXEXT) {
354
-        VP8_MC_FUNC(2, 4, mmx2);
355
-        VP8_BILINEAR_MC_FUNC(2, 4, mmx2);
356
-#if ARCH_X86_32
357
-        VP8_LUMA_MC_FUNC(0, 16, mmx2);
358
-        VP8_MC_FUNC(1, 8, mmx2);
359
-        VP8_BILINEAR_MC_FUNC(0, 16, mmx2);
360
-        VP8_BILINEAR_MC_FUNC(1, 8, mmx2);
361
-
362
-        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx2;
363
-        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx2;
364
-
365
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx2;
366
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx2;
367
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx2;
368
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx2;
369
-
370
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_mmx2;
371
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_mmx2;
372
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_mmx2;
373
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_mmx2;
374
-#endif
375
-    }
376
-
377
-    if (mm_flags & AV_CPU_FLAG_SSE) {
378
-        c->vp8_idct_add                         = ff_vp8_idct_add_sse;
379
-        c->vp8_luma_dc_wht                      = ff_vp8_luma_dc_wht_sse;
380
-        c->put_vp8_epel_pixels_tab[0][0][0]     =
381
-        c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
382
-    }
383
-
384
-    if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
385
-        VP8_LUMA_MC_FUNC(0, 16, sse2);
386
-        VP8_MC_FUNC(1, 8, sse2);
387
-        VP8_BILINEAR_MC_FUNC(0, 16, sse2);
388
-        VP8_BILINEAR_MC_FUNC(1, 8, sse2);
389
-
390
-        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
391
-
392
-#if ARCH_X86_64 || HAVE_ALIGNED_STACK
393
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
394
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
395
-
396
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_sse2;
397
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_sse2;
398
-#endif
399
-    }
400
-
401
-    if (mm_flags & AV_CPU_FLAG_SSE2) {
402
-        c->vp8_idct_dc_add4y          = ff_vp8_idct_dc_add4y_sse2;
403
-
404
-        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
405
-
406
-#if ARCH_X86_64 || HAVE_ALIGNED_STACK
407
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
408
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
409
-
410
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_sse2;
411
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_sse2;
412
-#endif
413
-    }
414
-
415
-    if (mm_flags & AV_CPU_FLAG_SSSE3) {
416
-        VP8_LUMA_MC_FUNC(0, 16, ssse3);
417
-        VP8_MC_FUNC(1, 8, ssse3);
418
-        VP8_MC_FUNC(2, 4, ssse3);
419
-        VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
420
-        VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
421
-        VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
422
-
423
-        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
424
-        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
425
-
426
-#if ARCH_X86_64 || HAVE_ALIGNED_STACK
427
-        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
428
-        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
429
-        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
430
-        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
431
-
432
-        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_ssse3;
433
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_ssse3;
434
-        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
435
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
436
-#endif
437
-    }
438
-
439
-    if (mm_flags & AV_CPU_FLAG_SSE4) {
440
-        c->vp8_idct_dc_add                  = ff_vp8_idct_dc_add_sse4;
441
-
442
-        c->vp8_h_loop_filter_simple   = ff_vp8_h_loop_filter_simple_sse4;
443
-#if ARCH_X86_64 || HAVE_ALIGNED_STACK
444
-        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_sse4;
445
-        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_sse4;
446
-#endif
447
-    }
448
-#endif
449
-}
450 1
new file mode 100644
... ...
@@ -0,0 +1,450 @@
0
+/*
1
+ * VP8 DSP functions x86-optimized
2
+ * Copyright (c) 2010 Ronald S. Bultje <rsbultje@gmail.com>
3
+ * Copyright (c) 2010 Jason Garrett-Glaser <darkshikari@gmail.com>
4
+ *
5
+ * This file is part of FFmpeg.
6
+ *
7
+ * FFmpeg is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * FFmpeg is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with FFmpeg; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+#include "libavutil/cpu.h"
23
+#include "libavutil/mem.h"
24
+#include "libavutil/x86/asm.h"
25
+#include "libavcodec/vp8dsp.h"
26
+
27
+#if HAVE_YASM
28
+
29
+/*
30
+ * MC functions
31
+ */
32
+extern void ff_put_vp8_epel4_h4_mmx2  (uint8_t *dst, ptrdiff_t dststride,
33
+                                       uint8_t *src, ptrdiff_t srcstride,
34
+                                       int height, int mx, int my);
35
+extern void ff_put_vp8_epel4_h6_mmx2  (uint8_t *dst, ptrdiff_t dststride,
36
+                                       uint8_t *src, ptrdiff_t srcstride,
37
+                                       int height, int mx, int my);
38
+extern void ff_put_vp8_epel4_v4_mmx2  (uint8_t *dst, ptrdiff_t dststride,
39
+                                       uint8_t *src, ptrdiff_t srcstride,
40
+                                       int height, int mx, int my);
41
+extern void ff_put_vp8_epel4_v6_mmx2  (uint8_t *dst, ptrdiff_t dststride,
42
+                                       uint8_t *src, ptrdiff_t srcstride,
43
+                                       int height, int mx, int my);
44
+
45
+extern void ff_put_vp8_epel8_h4_sse2  (uint8_t *dst, ptrdiff_t dststride,
46
+                                       uint8_t *src, ptrdiff_t srcstride,
47
+                                       int height, int mx, int my);
48
+extern void ff_put_vp8_epel8_h6_sse2  (uint8_t *dst, ptrdiff_t dststride,
49
+                                       uint8_t *src, ptrdiff_t srcstride,
50
+                                       int height, int mx, int my);
51
+extern void ff_put_vp8_epel8_v4_sse2  (uint8_t *dst, ptrdiff_t dststride,
52
+                                       uint8_t *src, ptrdiff_t srcstride,
53
+                                       int height, int mx, int my);
54
+extern void ff_put_vp8_epel8_v6_sse2  (uint8_t *dst, ptrdiff_t dststride,
55
+                                       uint8_t *src, ptrdiff_t srcstride,
56
+                                       int height, int mx, int my);
57
+
58
+extern void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
59
+                                       uint8_t *src, ptrdiff_t srcstride,
60
+                                       int height, int mx, int my);
61
+extern void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
62
+                                       uint8_t *src, ptrdiff_t srcstride,
63
+                                       int height, int mx, int my);
64
+extern void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
65
+                                       uint8_t *src, ptrdiff_t srcstride,
66
+                                       int height, int mx, int my);
67
+extern void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
68
+                                       uint8_t *src, ptrdiff_t srcstride,
69
+                                       int height, int mx, int my);
70
+extern void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
71
+                                       uint8_t *src, ptrdiff_t srcstride,
72
+                                       int height, int mx, int my);
73
+extern void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
74
+                                       uint8_t *src, ptrdiff_t srcstride,
75
+                                       int height, int mx, int my);
76
+extern void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
77
+                                       uint8_t *src, ptrdiff_t srcstride,
78
+                                       int height, int mx, int my);
79
+extern void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
80
+                                       uint8_t *src, ptrdiff_t srcstride,
81
+                                       int height, int mx, int my);
82
+
83
+extern void ff_put_vp8_bilinear4_h_mmx2  (uint8_t *dst, ptrdiff_t dststride,
84
+                                          uint8_t *src, ptrdiff_t srcstride,
85
+                                          int height, int mx, int my);
86
+extern void ff_put_vp8_bilinear8_h_sse2  (uint8_t *dst, ptrdiff_t dststride,
87
+                                          uint8_t *src, ptrdiff_t srcstride,
88
+                                          int height, int mx, int my);
89
+extern void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
90
+                                          uint8_t *src, ptrdiff_t srcstride,
91
+                                          int height, int mx, int my);
92
+extern void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
93
+                                          uint8_t *src, ptrdiff_t srcstride,
94
+                                          int height, int mx, int my);
95
+
96
+extern void ff_put_vp8_bilinear4_v_mmx2  (uint8_t *dst, ptrdiff_t dststride,
97
+                                          uint8_t *src, ptrdiff_t srcstride,
98
+                                          int height, int mx, int my);
99
+extern void ff_put_vp8_bilinear8_v_sse2  (uint8_t *dst, ptrdiff_t dststride,
100
+                                          uint8_t *src, ptrdiff_t srcstride,
101
+                                          int height, int mx, int my);
102
+extern void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
103
+                                          uint8_t *src, ptrdiff_t srcstride,
104
+                                          int height, int mx, int my);
105
+extern void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
106
+                                          uint8_t *src, ptrdiff_t srcstride,
107
+                                          int height, int mx, int my);
108
+
109
+
110
+extern void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride,
111
+                                    uint8_t *src, ptrdiff_t srcstride,
112
+                                    int height, int mx, int my);
113
+extern void ff_put_vp8_pixels16_mmx(uint8_t *dst, ptrdiff_t dststride,
114
+                                    uint8_t *src, ptrdiff_t srcstride,
115
+                                    int height, int mx, int my);
116
+extern void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride,
117
+                                    uint8_t *src, ptrdiff_t srcstride,
118
+                                    int height, int mx, int my);
119
+
120
+#define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \
121
+static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \
122
+    uint8_t *dst,  ptrdiff_t dststride, uint8_t *src, \
123
+    ptrdiff_t srcstride, int height, int mx, int my) \
124
+{ \
125
+    ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
126
+        dst,     dststride, src,     srcstride, height, mx, my); \
127
+    ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
128
+        dst + 8, dststride, src + 8, srcstride, height, mx, my); \
129
+}
130
+#define TAP_W8(OPT, FILTERTYPE, TAPTYPE) \
131
+static void ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
132
+    uint8_t *dst,  ptrdiff_t dststride, uint8_t *src, \
133
+    ptrdiff_t srcstride, int height, int mx, int my) \
134
+{ \
135
+    ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
136
+        dst,     dststride, src,     srcstride, height, mx, my); \
137
+    ff_put_vp8_ ## FILTERTYPE ## 4_ ## TAPTYPE ## _ ## OPT( \
138
+        dst + 4, dststride, src + 4, srcstride, height, mx, my); \
139
+}
140
+
141
+#if ARCH_X86_32
142
+TAP_W8 (mmx2,  epel, h4)
143
+TAP_W8 (mmx2,  epel, h6)
144
+TAP_W16(mmx2,  epel, h6)
145
+TAP_W8 (mmx2,  epel, v4)
146
+TAP_W8 (mmx2,  epel, v6)
147
+TAP_W16(mmx2,  epel, v6)
148
+TAP_W8 (mmx2,  bilinear, h)
149
+TAP_W16(mmx2,  bilinear, h)
150
+TAP_W8 (mmx2,  bilinear, v)
151
+TAP_W16(mmx2,  bilinear, v)
152
+#endif
153
+
154
+TAP_W16(sse2,  epel, h6)
155
+TAP_W16(sse2,  epel, v6)
156
+TAP_W16(sse2,  bilinear, h)
157
+TAP_W16(sse2,  bilinear, v)
158
+
159
+TAP_W16(ssse3, epel, h6)
160
+TAP_W16(ssse3, epel, v6)
161
+TAP_W16(ssse3, bilinear, h)
162
+TAP_W16(ssse3, bilinear, v)
163
+
164
+#define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
165
+static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
166
+    uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
167
+    ptrdiff_t srcstride, int height, int mx, int my) \
168
+{ \
169
+    DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + TAPNUMY - 1)]; \
170
+    uint8_t *tmpptr = tmp + SIZE * (TAPNUMY / 2 - 1); \
171
+    src -= srcstride * (TAPNUMY / 2 - 1); \
172
+    ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## _ ## OPT( \
173
+        tmp, SIZE,      src,    srcstride, height + TAPNUMY - 1, mx, my); \
174
+    ff_put_vp8_epel ## SIZE ## _v ## TAPNUMY ## _ ## OPT( \
175
+        dst, dststride, tmpptr, SIZE,      height,               mx, my); \
176
+}
177
+
178
+#if ARCH_X86_32
179
+#define HVTAPMMX(x, y) \
180
+HVTAP(mmx2, 8, x, y,  4,  8) \
181
+HVTAP(mmx2, 8, x, y,  8, 16)
182
+
183
+HVTAP(mmx2, 8, 6, 6, 16, 16)
184
+#else
185
+#define HVTAPMMX(x, y) \
186
+HVTAP(mmx2, 8, x, y,  4,  8)
187
+#endif
188
+
189
+HVTAPMMX(4, 4)
190
+HVTAPMMX(4, 6)
191
+HVTAPMMX(6, 4)
192
+HVTAPMMX(6, 6)
193
+
194
+#define HVTAPSSE2(x, y, w) \
195
+HVTAP(sse2,  16, x, y, w, 16) \
196
+HVTAP(ssse3, 16, x, y, w, 16)
197
+
198
+HVTAPSSE2(4, 4, 8)
199
+HVTAPSSE2(4, 6, 8)
200
+HVTAPSSE2(6, 4, 8)
201
+HVTAPSSE2(6, 6, 8)
202
+HVTAPSSE2(6, 6, 16)
203
+
204
+HVTAP(ssse3, 16, 4, 4, 4, 8)
205
+HVTAP(ssse3, 16, 4, 6, 4, 8)
206
+HVTAP(ssse3, 16, 6, 4, 4, 8)
207
+HVTAP(ssse3, 16, 6, 6, 4, 8)
208
+
209
+#define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
210
+static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
211
+    uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
212
+    ptrdiff_t srcstride, int height, int mx, int my) \
213
+{ \
214
+    DECLARE_ALIGNED(ALIGN, uint8_t, tmp)[SIZE * (MAXHEIGHT + 2)]; \
215
+    ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT( \
216
+        tmp, SIZE,      src, srcstride, height + 1, mx, my); \
217
+    ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT( \
218
+        dst, dststride, tmp, SIZE,      height,     mx, my); \
219
+}
220
+
221
+HVBILIN(mmx2,  8,  4,  8)
222
+#if ARCH_X86_32
223
+HVBILIN(mmx2,  8,  8, 16)
224
+HVBILIN(mmx2,  8, 16, 16)
225
+#endif
226
+HVBILIN(sse2,  8,  8, 16)
227
+HVBILIN(sse2,  8, 16, 16)
228
+HVBILIN(ssse3, 8,  4,  8)
229
+HVBILIN(ssse3, 8,  8, 16)
230
+HVBILIN(ssse3, 8, 16, 16)
231
+
232
+extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16],
233
+                                   ptrdiff_t stride);
234
+extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16],
235
+                                    ptrdiff_t stride);
236
+extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16],
237
+                                      ptrdiff_t stride);
238
+extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16],
239
+                                      ptrdiff_t stride);
240
+extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16],
241
+                                      ptrdiff_t stride);
242
+extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]);
243
+extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]);
244
+extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16],
245
+                                ptrdiff_t stride);
246
+extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16],
247
+                                ptrdiff_t stride);
248
+
249
+#define DECLARE_LOOP_FILTER(NAME)\
250
+extern void ff_vp8_v_loop_filter_simple_ ## NAME(uint8_t *dst, \
251
+                                                 ptrdiff_t stride, \
252
+                                                 int flim);\
253
+extern void ff_vp8_h_loop_filter_simple_ ## NAME(uint8_t *dst, \
254
+                                                 ptrdiff_t stride, \
255
+                                                 int flim);\
256
+extern void ff_vp8_v_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
257
+                                                     ptrdiff_t stride,\
258
+                                                    int e, int i, int hvt);\
259
+extern void ff_vp8_h_loop_filter16y_inner_ ## NAME (uint8_t *dst, \
260
+                                                    ptrdiff_t stride,\
261
+                                                    int e, int i, int hvt);\
262
+extern void ff_vp8_v_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
263
+                                                    uint8_t *dstV,\
264
+                                                    ptrdiff_t s, \
265
+                                                    int e, int i, int hvt);\
266
+extern void ff_vp8_h_loop_filter8uv_inner_ ## NAME (uint8_t *dstU, \
267
+                                                    uint8_t *dstV,\
268
+                                                    ptrdiff_t s, \
269
+                                                    int e, int i, int hvt);\
270
+extern void ff_vp8_v_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
271
+                                                    ptrdiff_t stride,\
272
+                                                    int e, int i, int hvt);\
273
+extern void ff_vp8_h_loop_filter16y_mbedge_ ## NAME(uint8_t *dst, \
274
+                                                    ptrdiff_t stride,\
275
+                                                    int e, int i, int hvt);\
276
+extern void ff_vp8_v_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
277
+                                                    uint8_t *dstV,\
278
+                                                    ptrdiff_t s, \
279
+                                                    int e, int i, int hvt);\
280
+extern void ff_vp8_h_loop_filter8uv_mbedge_ ## NAME(uint8_t *dstU, \
281
+                                                    uint8_t *dstV,\
282
+                                                    ptrdiff_t s, \
283
+                                                    int e, int i, int hvt);
284
+
285
+DECLARE_LOOP_FILTER(mmx)
286
+DECLARE_LOOP_FILTER(mmx2)
287
+DECLARE_LOOP_FILTER(sse2)
288
+DECLARE_LOOP_FILTER(ssse3)
289
+DECLARE_LOOP_FILTER(sse4)
290
+
291
+#endif
292
+
293
+#define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
294
+    c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
295
+    c->put_vp8_epel_pixels_tab[IDX][2][0] = ff_put_vp8_epel ## SIZE ## _v6_ ## OPT; \
296
+    c->put_vp8_epel_pixels_tab[IDX][2][2] = ff_put_vp8_epel ## SIZE ## _h6v6_ ## OPT
297
+
298
+#define VP8_MC_FUNC(IDX, SIZE, OPT) \
299
+    c->put_vp8_epel_pixels_tab[IDX][0][1] = ff_put_vp8_epel ## SIZE ## _h4_ ## OPT; \
300
+    c->put_vp8_epel_pixels_tab[IDX][1][0] = ff_put_vp8_epel ## SIZE ## _v4_ ## OPT; \
301
+    c->put_vp8_epel_pixels_tab[IDX][1][1] = ff_put_vp8_epel ## SIZE ## _h4v4_ ## OPT; \
302
+    c->put_vp8_epel_pixels_tab[IDX][1][2] = ff_put_vp8_epel ## SIZE ## _h6v4_ ## OPT; \
303
+    c->put_vp8_epel_pixels_tab[IDX][2][1] = ff_put_vp8_epel ## SIZE ## _h4v6_ ## OPT; \
304
+    VP8_LUMA_MC_FUNC(IDX, SIZE, OPT)
305
+
306
+#define VP8_BILINEAR_MC_FUNC(IDX, SIZE, OPT) \
307
+    c->put_vp8_bilinear_pixels_tab[IDX][0][1] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
308
+    c->put_vp8_bilinear_pixels_tab[IDX][0][2] = ff_put_vp8_bilinear ## SIZE ## _h_ ## OPT; \
309
+    c->put_vp8_bilinear_pixels_tab[IDX][1][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
310
+    c->put_vp8_bilinear_pixels_tab[IDX][1][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
311
+    c->put_vp8_bilinear_pixels_tab[IDX][1][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
312
+    c->put_vp8_bilinear_pixels_tab[IDX][2][0] = ff_put_vp8_bilinear ## SIZE ## _v_ ## OPT; \
313
+    c->put_vp8_bilinear_pixels_tab[IDX][2][1] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT; \
314
+    c->put_vp8_bilinear_pixels_tab[IDX][2][2] = ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT
315
+
316
+
317
+av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
318
+{
319
+#if HAVE_YASM
320
+    int mm_flags = av_get_cpu_flags();
321
+
322
+    if (mm_flags & AV_CPU_FLAG_MMX) {
323
+        c->vp8_idct_dc_add    = ff_vp8_idct_dc_add_mmx;
324
+        c->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmx;
325
+#if ARCH_X86_32
326
+        c->vp8_idct_dc_add4y  = ff_vp8_idct_dc_add4y_mmx;
327
+        c->vp8_idct_add       = ff_vp8_idct_add_mmx;
328
+        c->vp8_luma_dc_wht    = ff_vp8_luma_dc_wht_mmx;
329
+        c->put_vp8_epel_pixels_tab[0][0][0]     =
330
+        c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmx;
331
+#endif
332
+        c->put_vp8_epel_pixels_tab[1][0][0]     =
333
+        c->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmx;
334
+
335
+#if ARCH_X86_32
336
+        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx;
337
+        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx;
338
+
339
+        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx;
340
+        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx;
341
+        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx;
342
+        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx;
343
+
344
+        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_mmx;
345
+        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_mmx;
346
+        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_mmx;
347
+        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_mmx;
348
+#endif
349
+    }
350
+
351
+    /* note that 4-tap width=16 functions are missing because w=16
352
+     * is only used for luma, and luma is always a copy or sixtap. */
353
+    if (mm_flags & AV_CPU_FLAG_MMXEXT) {
354
+        VP8_MC_FUNC(2, 4, mmx2);
355
+        VP8_BILINEAR_MC_FUNC(2, 4, mmx2);
356
+#if ARCH_X86_32
357
+        VP8_LUMA_MC_FUNC(0, 16, mmx2);
358
+        VP8_MC_FUNC(1, 8, mmx2);
359
+        VP8_BILINEAR_MC_FUNC(0, 16, mmx2);
360
+        VP8_BILINEAR_MC_FUNC(1, 8, mmx2);
361
+
362
+        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmx2;
363
+        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmx2;
364
+
365
+        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_mmx2;
366
+        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_mmx2;
367
+        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmx2;
368
+        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmx2;
369
+
370
+        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_mmx2;
371
+        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_mmx2;
372
+        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_mmx2;
373
+        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_mmx2;
374
+#endif
375
+    }
376
+
377
+    if (mm_flags & AV_CPU_FLAG_SSE) {
378
+        c->vp8_idct_add                         = ff_vp8_idct_add_sse;
379
+        c->vp8_luma_dc_wht                      = ff_vp8_luma_dc_wht_sse;
380
+        c->put_vp8_epel_pixels_tab[0][0][0]     =
381
+        c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
382
+    }
383
+
384
+    if (mm_flags & (AV_CPU_FLAG_SSE2|AV_CPU_FLAG_SSE2SLOW)) {
385
+        VP8_LUMA_MC_FUNC(0, 16, sse2);
386
+        VP8_MC_FUNC(1, 8, sse2);
387
+        VP8_BILINEAR_MC_FUNC(0, 16, sse2);
388
+        VP8_BILINEAR_MC_FUNC(1, 8, sse2);
389
+
390
+        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
391
+
392
+#if ARCH_X86_64 || HAVE_ALIGNED_STACK
393
+        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;
394
+        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_sse2;
395
+
396
+        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_sse2;
397
+        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_sse2;
398
+#endif
399
+    }
400
+
401
+    if (mm_flags & AV_CPU_FLAG_SSE2) {
402
+        c->vp8_idct_dc_add4y          = ff_vp8_idct_dc_add4y_sse2;
403
+
404
+        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_sse2;
405
+
406
+#if ARCH_X86_64 || HAVE_ALIGNED_STACK
407
+        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_sse2;
408
+        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_sse2;
409
+
410
+        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_sse2;
411
+        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_sse2;
412
+#endif
413
+    }
414
+
415
+    if (mm_flags & AV_CPU_FLAG_SSSE3) {
416
+        VP8_LUMA_MC_FUNC(0, 16, ssse3);
417
+        VP8_MC_FUNC(1, 8, ssse3);
418
+        VP8_MC_FUNC(2, 4, ssse3);
419
+        VP8_BILINEAR_MC_FUNC(0, 16, ssse3);
420
+        VP8_BILINEAR_MC_FUNC(1, 8, ssse3);
421
+        VP8_BILINEAR_MC_FUNC(2, 4, ssse3);
422
+
423
+        c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_ssse3;
424
+        c->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_ssse3;
425
+
426
+#if ARCH_X86_64 || HAVE_ALIGNED_STACK
427
+        c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_ssse3;
428
+        c->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16y_inner_ssse3;
429
+        c->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_ssse3;
430
+        c->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_ssse3;
431
+
432
+        c->vp8_v_loop_filter16y       = ff_vp8_v_loop_filter16y_mbedge_ssse3;
433
+        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_ssse3;
434
+        c->vp8_v_loop_filter8uv       = ff_vp8_v_loop_filter8uv_mbedge_ssse3;
435
+        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_ssse3;
436
+#endif
437
+    }
438
+
439
+    if (mm_flags & AV_CPU_FLAG_SSE4) {
440
+        c->vp8_idct_dc_add                  = ff_vp8_idct_dc_add_sse4;
441
+
442
+        c->vp8_h_loop_filter_simple   = ff_vp8_h_loop_filter_simple_sse4;
443
+#if ARCH_X86_64 || HAVE_ALIGNED_STACK
444
+        c->vp8_h_loop_filter16y       = ff_vp8_h_loop_filter16y_mbedge_sse4;
445
+        c->vp8_h_loop_filter8uv       = ff_vp8_h_loop_filter8uv_mbedge_sse4;
446
+#endif
447
+    }
448
+#endif
449
+}
... ...
@@ -22,6 +22,7 @@
22 22
 
23 23
 #include "avcodec.h"
24 24
 #include "internal.h"
25
+#include "libavutil/common.h"
25 26
 
26 27
 static av_cold int xbm_encode_init(AVCodecContext *avctx)
27 28
 {
... ...
@@ -24,6 +24,7 @@
24 24
  * Miro VideoXL codec.
25 25
  */
26 26
 
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/intreadwrite.h"
28 29
 #include "avcodec.h"
29 30
 
... ...
@@ -19,6 +19,7 @@
19 19
 #include <zlib.h>
20 20
 
21 21
 #include "avcodec.h"
22
+#include "libavutil/common.h"
22 23
 
23 24
 typedef struct {
24 25
     AVFrame  previous_frame;
... ...
@@ -27,6 +27,7 @@
27 27
 #include <stdio.h>
28 28
 #include <stdlib.h>
29 29
 
30
+#include "libavutil/common.h"
30 31
 #include "libavutil/intreadwrite.h"
31 32
 #include "avcodec.h"
32 33
 
... ...
@@ -27,6 +27,7 @@
27 27
 #include <stdio.h>
28 28
 #include <stdlib.h>
29 29
 
30
+#include "libavutil/common.h"
30 31
 #include "libavutil/intreadwrite.h"
31 32
 #include "avcodec.h"
32 33
 #include "internal.h"
... ...
@@ -18,6 +18,7 @@
18 18
 
19 19
 #include "libavutil/avassert.h"
20 20
 #include "avdevice.h"
21
+#include "config.h"
21 22
 
22 23
 unsigned avdevice_version(void)
23 24
 {
... ...
@@ -22,6 +22,7 @@
22 22
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 23
  */
24 24
 
25
+#include "libavutil/common.h"
25 26
 #include "libavutil/mem.h"
26 27
 #include "config.h"
27 28
 #include "timefilter.h"
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include "libavutil/audioconvert.h"
27 27
 #include "libavutil/avstring.h"
28
+#include "libavutil/common.h"
28 29
 #include "libavutil/opt.h"
29 30
 
30 31
 #include "audio.h"
... ...
@@ -32,6 +32,7 @@
32 32
 #include "libavutil/audio_fifo.h"
33 33
 #include "libavutil/avassert.h"
34 34
 #include "libavutil/avstring.h"
35
+#include "libavutil/common.h"
35 36
 #include "libavutil/float_dsp.h"
36 37
 #include "libavutil/mathematics.h"
37 38
 #include "libavutil/opt.h"
... ...
@@ -25,6 +25,7 @@
25 25
 #include "audio.h"
26 26
 #include "avfilter.h"
27 27
 #include "internal.h"
28
+#include "libavutil/internal.h"
28 29
 
29 30
 AVFilter avfilter_af_anull = {
30 31
     .name      = "anull",
... ...
@@ -18,6 +18,7 @@
18 18
 
19 19
 #include "libavresample/avresample.h"
20 20
 #include "libavutil/audio_fifo.h"
21
+#include "libavutil/common.h"
21 22
 #include "libavutil/mathematics.h"
22 23
 #include "libavutil/opt.h"
23 24
 #include "libavutil/samplefmt.h"
... ...
@@ -27,6 +27,7 @@
27 27
 
28 28
 #include "libavutil/audioconvert.h"
29 29
 #include "libavutil/avstring.h"
30
+#include "libavutil/common.h"
30 31
 #include "libavutil/mathematics.h"
31 32
 #include "libavutil/opt.h"
32 33
 #include "libavutil/samplefmt.h"
... ...
@@ -24,6 +24,7 @@
24 24
  */
25 25
 
26 26
 #include "libavutil/audioconvert.h"
27
+#include "libavutil/internal.h"
27 28
 #include "libavutil/opt.h"
28 29
 
29 30
 #include "audio.h"
... ...
@@ -27,6 +27,7 @@
27 27
 
28 28
 #include "libavutil/audioconvert.h"
29 29
 #include "libavutil/avassert.h"
30
+#include "libavutil/common.h"
30 31
 #include "libavutil/opt.h"
31 32
 
32 33
 #include "audio.h"
... ...
@@ -24,6 +24,7 @@
24 24
 
25 25
 #include "libavutil/avassert.h"
26 26
 #include "libavutil/avstring.h"
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/mathematics.h"
28 29
 #include "libavutil/opt.h"
29 30
 
... ...
@@ -20,6 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "avfilter.h"
23
+#include "config.h"
23 24
 
24 25
 
25 26
 #define REGISTER_FILTER(X,x,y) { \
... ...
@@ -18,6 +18,7 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/internal.h"
21 22
 #include "avfilter.h"
22 23
 #include "internal.h"
23 24
 
... ...
@@ -24,14 +24,17 @@
24 24
  * null audio source
25 25
  */
26 26
 
27
-#include "internal.h"
28
-#include "libavutil/audioconvert.h"
29
-#include "libavutil/opt.h"
27
+#include <inttypes.h>
28
+#include <stdio.h>
30 29
 
31 30
 #include "audio.h"
32 31
 #include "avfilter.h"
33 32
 #include "internal.h"
34 33
 
34
+#include "libavutil/audioconvert.h"
35
+#include "libavutil/internal.h"
36
+#include "libavutil/opt.h"
37
+
35 38
 typedef struct {
36 39
     const AVClass *class;
37 40
     char   *channel_layout_str;
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include "libavutil/avassert.h"
23 23
 #include "libavutil/audioconvert.h"
24
+#include "libavutil/common.h"
24 25
 
25 26
 #include "audio.h"
26 27
 #include "avfilter.h"
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "libavutil/pixdesc.h"
23 24
 #include "libavutil/rational.h"
24 25
 #include "libavutil/audioconvert.h"
... ...
@@ -34,6 +34,7 @@
34 34
 
35 35
 #include "libavutil/audioconvert.h"
36 36
 #include "libavutil/avassert.h"
37
+#include "libavutil/common.h"
37 38
 #include "libavutil/log.h"
38 39
 
39 40
 static const AVClass filtergraph_class = {
... ...
@@ -22,6 +22,7 @@
22 22
 
23 23
 #include "libavutil/audioconvert.h"
24 24
 #include "libavutil/avassert.h"
25
+#include "libavutil/common.h"
25 26
 #include "libavutil/imgutils.h"
26 27
 #include "libavcodec/avcodec.h"
27 28
 
... ...
@@ -26,6 +26,7 @@
26 26
 #include "libavutil/audio_fifo.h"
27 27
 #include "libavutil/audioconvert.h"
28 28
 #include "libavutil/avassert.h"
29
+#include "libavutil/common.h"
29 30
 #include "libavutil/mathematics.h"
30 31
 
31 32
 #include "audio.h"
... ...
@@ -32,6 +32,7 @@
32 32
 #include "avcodec.h"
33 33
 
34 34
 #include "libavutil/audioconvert.h"
35
+#include "libavutil/common.h"
35 36
 #include "libavutil/fifo.h"
36 37
 #include "libavutil/imgutils.h"
37 38
 #include "libavutil/opt.h"
... ...
@@ -19,8 +19,11 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <string.h>
23
+
22 24
 #include "libavutil/avutil.h"
23 25
 #include "libavutil/colorspace.h"
26
+#include "libavutil/mem.h"
24 27
 #include "libavutil/pixdesc.h"
25 28
 #include "drawutils.h"
26 29
 #include "formats.h"
... ...
@@ -23,8 +23,12 @@
23 23
  * Set timebase for the output link.
24 24
  */
25 25
 
26
+#include <inttypes.h>
27
+#include <stdio.h>
28
+
26 29
 #include "libavutil/avstring.h"
27 30
 #include "libavutil/eval.h"
31
+#include "libavutil/internal.h"
28 32
 #include "libavutil/mathematics.h"
29 33
 #include "libavutil/rational.h"
30 34
 #include "avfilter.h"
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include "libavutil/avassert.h"
27 27
 #include "libavutil/audioconvert.h"
28
+#include "libavutil/common.h"
28 29
 #include "libavutil/mathematics.h"
29 30
 #include "libavutil/samplefmt.h"
30 31
 
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "libavutil/eval.h"
23 24
 #include "libavutil/pixdesc.h"
24 25
 #include "libavutil/parseutils.h"
... ...
@@ -22,8 +22,10 @@
22 22
 
23 23
 #include <ctype.h>
24 24
 #include <string.h>
25
+#include <stdio.h>
25 26
 
26 27
 #include "libavutil/avstring.h"
28
+#include "libavutil/mem.h"
27 29
 #include "avfilter.h"
28 30
 #include "avfiltergraph.h"
29 31
 
... ...
@@ -23,6 +23,10 @@
23 23
  * audio and video splitter
24 24
  */
25 25
 
26
+#include <stdio.h>
27
+
28
+#include "libavutil/internal.h"
29
+#include "libavutil/mem.h"
26 30
 #include "avfilter.h"
27 31
 #include "audio.h"
28 32
 #include "internal.h"
... ...
@@ -23,6 +23,7 @@
23 23
  * aspect ratio modification video filters
24 24
  */
25 25
 
26
+#include "libavutil/common.h"
26 27
 #include "libavutil/mathematics.h"
27 28
 #include "libavutil/parseutils.h"
28 29
 #include "avfilter.h"
... ...
@@ -27,6 +27,10 @@
27 27
  * Ported from MPlayer libmpcodecs/vf_blackframe.c.
28 28
  */
29 29
 
30
+#include <stdio.h>
31
+#include <inttypes.h>
32
+
33
+#include "libavutil/internal.h"
30 34
 #include "avfilter.h"
31 35
 #include "internal.h"
32 36
 #include "formats.h"
... ...
@@ -26,6 +26,7 @@
26 26
  */
27 27
 
28 28
 #include "libavutil/avstring.h"
29
+#include "libavutil/common.h"
29 30
 #include "libavutil/eval.h"
30 31
 #include "libavutil/pixdesc.h"
31 32
 #include "avfilter.h"
... ...
@@ -21,6 +21,7 @@
21 21
  * copy video filter
22 22
  */
23 23
 
24
+#include "libavutil/internal.h"
24 25
 #include "avfilter.h"
25 26
 #include "internal.h"
26 27
 #include "video.h"
... ...
@@ -25,12 +25,15 @@
25 25
 
26 26
 /* #define DEBUG */
27 27
 
28
+#include <stdio.h>
29
+
28 30
 #include "avfilter.h"
29 31
 #include "formats.h"
30 32
 #include "internal.h"
31 33
 #include "video.h"
32 34
 #include "libavutil/eval.h"
33 35
 #include "libavutil/avstring.h"
36
+#include "libavutil/internal.h"
34 37
 #include "libavutil/libm.h"
35 38
 #include "libavutil/imgutils.h"
36 39
 #include "libavutil/mathematics.h"
... ...
@@ -23,7 +23,10 @@
23 23
  * Ported from MPlayer libmpcodecs/vf_cropdetect.c.
24 24
  */
25 25
 
26
+#include <stdio.h>
27
+
26 28
 #include "libavutil/imgutils.h"
29
+#include "libavutil/internal.h"
27 30
 #include "avfilter.h"
28 31
 #include "formats.h"
29 32
 #include "internal.h"
... ...
@@ -25,6 +25,7 @@
25 25
  * Ported from MPlayer libmpcodecs/vf_delogo.c.
26 26
  */
27 27
 
28
+#include "libavutil/common.h"
28 29
 #include "libavutil/imgutils.h"
29 30
 #include "libavutil/opt.h"
30 31
 #include "libavutil/pixdesc.h"
... ...
@@ -25,6 +25,7 @@
25 25
  */
26 26
 
27 27
 #include "libavutil/colorspace.h"
28
+#include "libavutil/common.h"
28 29
 #include "libavutil/pixdesc.h"
29 30
 #include "libavutil/parseutils.h"
30 31
 #include "avfilter.h"
... ...
@@ -31,6 +31,7 @@
31 31
 
32 32
 #include "config.h"
33 33
 #include "libavutil/avstring.h"
34
+#include "libavutil/common.h"
34 35
 #include "libavutil/file.h"
35 36
 #include "libavutil/eval.h"
36 37
 #include "libavutil/opt.h"
... ...
@@ -26,6 +26,7 @@
26 26
  */
27 27
 
28 28
 #include "libavutil/avstring.h"
29
+#include "libavutil/common.h"
29 30
 #include "libavutil/eval.h"
30 31
 #include "libavutil/opt.h"
31 32
 #include "libavutil/pixdesc.h"
... ...
@@ -25,7 +25,11 @@
25 25
 
26 26
 /* #define DEBUG */
27 27
 
28
+#include <stdio.h>
29
+#include <string.h>
30
+
28 31
 #include "libavutil/imgutils.h"
32
+#include "libavutil/internal.h"
29 33
 #include "libavutil/pixdesc.h"
30 34
 #include "avfilter.h"
31 35
 #include "formats.h"
... ...
@@ -23,6 +23,10 @@
23 23
  * format and noformat video filters
24 24
  */
25 25
 
26
+#include <string.h>
27
+
28
+#include "libavutil/internal.h"
29
+#include "libavutil/mem.h"
26 30
 #include "libavutil/pixdesc.h"
27 31
 #include "avfilter.h"
28 32
 #include "internal.h"
... ...
@@ -25,6 +25,7 @@
25 25
  * a filter enforcing given constant framerate
26 26
  */
27 27
 
28
+#include "libavutil/common.h"
28 29
 #include "libavutil/fifo.h"
29 30
 #include "libavutil/mathematics.h"
30 31
 #include "libavutil/opt.h"
... ...
@@ -33,6 +33,7 @@
33 33
  */
34 34
 
35 35
 #include "libavutil/imgutils.h"
36
+#include "libavutil/common.h"
36 37
 #include "libavutil/cpu.h"
37 38
 #include "libavutil/pixdesc.h"
38 39
 #include "avfilter.h"
... ...
@@ -24,11 +24,14 @@
24 24
  * horizontal flip filter
25 25
  */
26 26
 
27
+#include <string.h>
28
+
27 29
 #include "avfilter.h"
28 30
 #include "formats.h"
29 31
 #include "internal.h"
30 32
 #include "video.h"
31 33
 #include "libavutil/pixdesc.h"
34
+#include "libavutil/internal.h"
32 35
 #include "libavutil/intreadwrite.h"
33 36
 #include "libavutil/imgutils.h"
34 37
 
... ...
@@ -26,6 +26,7 @@
26 26
  * libmpcodecs/vf_hqdn3d.c.
27 27
  */
28 28
 
29
+#include "libavutil/common.h"
29 30
 #include "libavutil/pixdesc.h"
30 31
 #include "libavutil/intreadwrite.h"
31 32
 #include "avfilter.h"
... ...
@@ -24,6 +24,7 @@
24 24
  * value, and apply it to input video.
25 25
  */
26 26
 
27
+#include "libavutil/common.h"
27 28
 #include "libavutil/eval.h"
28 29
 #include "libavutil/opt.h"
29 30
 #include "libavutil/pixdesc.h"
... ...
@@ -21,6 +21,7 @@
21 21
  * null video filter
22 22
  */
23 23
 
24
+#include "libavutil/internal.h"
24 25
 #include "avfilter.h"
25 26
 #include "internal.h"
26 27
 #include "video.h"
... ...
@@ -29,6 +29,7 @@
29 29
 
30 30
 #include "avfilter.h"
31 31
 #include "formats.h"
32
+#include "libavutil/common.h"
32 33
 #include "libavutil/eval.h"
33 34
 #include "libavutil/avstring.h"
34 35
 #include "libavutil/opt.h"
... ...
@@ -29,6 +29,7 @@
29 29
 #include "internal.h"
30 30
 #include "video.h"
31 31
 #include "libavutil/avstring.h"
32
+#include "libavutil/common.h"
32 33
 #include "libavutil/eval.h"
33 34
 #include "libavutil/pixdesc.h"
34 35
 #include "libavutil/colorspace.h"
... ...
@@ -23,6 +23,7 @@
23 23
  * pixdesc test filter
24 24
  */
25 25
 
26
+#include "libavutil/common.h"
26 27
 #include "libavutil/pixdesc.h"
27 28
 #include "avfilter.h"
28 29
 #include "internal.h"
... ...
@@ -23,12 +23,16 @@
23 23
  * scale video filter
24 24
  */
25 25
 
26
+#include <stdio.h>
27
+#include <string.h>
28
+
26 29
 #include "avfilter.h"
27 30
 #include "formats.h"
28 31
 #include "internal.h"
29 32
 #include "video.h"
30 33
 #include "libavutil/avstring.h"
31 34
 #include "libavutil/eval.h"
35
+#include "libavutil/internal.h"
32 36
 #include "libavutil/mathematics.h"
33 37
 #include "libavutil/opt.h"
34 38
 #include "libavutil/pixdesc.h"
... ...
@@ -26,6 +26,7 @@
26 26
 #include "libavutil/eval.h"
27 27
 #include "libavutil/fifo.h"
28 28
 #include "libavcodec/dsputil.h"
29
+#include "libavutil/internal.h"
29 30
 #include "avfilter.h"
30 31
 #include "formats.h"
31 32
 #include "internal.h"
... ...
@@ -27,6 +27,7 @@
27 27
 /* #define DEBUG */
28 28
 
29 29
 #include "libavutil/eval.h"
30
+#include "libavutil/internal.h"
30 31
 #include "libavutil/mathematics.h"
31 32
 #include "avfilter.h"
32 33
 #include "internal.h"
... ...
@@ -24,6 +24,7 @@
24 24
 
25 25
 #include "libavutil/adler32.h"
26 26
 #include "libavutil/imgutils.h"
27
+#include "libavutil/internal.h"
27 28
 #include "libavutil/pixdesc.h"
28 29
 #include "libavutil/timestamp.h"
29 30
 #include "avfilter.h"
... ...
@@ -26,6 +26,7 @@
26 26
 #include "avfilter.h"
27 27
 #include "internal.h"
28 28
 #include "video.h"
29
+#include "libavutil/common.h"
29 30
 #include "libavutil/pixdesc.h"
30 31
 
31 32
 typedef struct {
... ...
@@ -25,9 +25,12 @@
25 25
  * Based on MPlayer libmpcodecs/vf_rotate.c.
26 26
  */
27 27
 
28
+#include <stdio.h>
29
+
28 30
 #include "libavutil/intreadwrite.h"
29 31
 #include "libavutil/pixdesc.h"
30 32
 #include "libavutil/imgutils.h"
33
+#include "libavutil/internal.h"
31 34
 #include "avfilter.h"
32 35
 #include "formats.h"
33 36
 #include "internal.h"
... ...
@@ -23,6 +23,7 @@
23 23
  * video vertical flip filter
24 24
  */
25 25
 
26
+#include "libavutil/internal.h"
26 27
 #include "libavutil/pixdesc.h"
27 28
 #include "avfilter.h"
28 29
 #include "internal.h"
... ...
@@ -20,8 +20,12 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include <string.h>
24
+#include <stdio.h>
25
+
23 26
 #include "libavutil/avassert.h"
24 27
 #include "libavutil/imgutils.h"
28
+#include "libavutil/mem.h"
25 29
 
26 30
 #include "avfilter.h"
27 31
 #include "internal.h"
... ...
@@ -18,6 +18,7 @@
18 18
 
19 19
 #include "avfilter.h"
20 20
 #include "internal.h"
21
+#include "libavutil/internal.h"
21 22
 
22 23
 static int start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
23 24
 {
... ...
@@ -35,6 +35,7 @@
35 35
 
36 36
 #include <float.h>
37 37
 
38
+#include "libavutil/common.h"
38 39
 #include "libavutil/opt.h"
39 40
 #include "libavutil/imgutils.h"
40 41
 #include "libavutil/intreadwrite.h"
... ...
@@ -20,6 +20,7 @@
20 20
 
21 21
 #include "libavutil/attributes.h"
22 22
 #include "libavutil/cpu.h"
23
+#include "libavutil/mem.h"
23 24
 #include "libavutil/x86/asm.h"
24 25
 #include "libavfilter/gradfun.h"
25 26
 
... ...
@@ -20,6 +20,8 @@
20 20
 
21 21
 #include "libavutil/attributes.h"
22 22
 #include "libavutil/cpu.h"
23
+#include "libavutil/internal.h"
24
+#include "libavutil/mem.h"
23 25
 #include "libavutil/x86/asm.h"
24 26
 #include "libavcodec/x86/dsputil_mmx.h"
25 27
 #include "libavfilter/yadif.h"
... ...
@@ -21,6 +21,7 @@
21 21
 #include "libavutil/avutil.h"
22 22
 #include "network.h"
23 23
 #include "libavcodec/internal.h"
24
+#include "libavutil/mem.h"
24 25
 
25 26
 #define THREADS (HAVE_PTHREADS || (defined(WIN32) && !defined(__MINGW32CE__)))
26 27
 
... ...
@@ -41,6 +41,10 @@
41 41
 #include "rtmppkt.h"
42 42
 #include "url.h"
43 43
 
44
+#if CONFIG_ZLIB
45
+#include <zlib.h>
46
+#endif
47
+
44 48
 //#define DEBUG
45 49
 
46 50
 #define APP_MAX_LENGTH 128
... ...
@@ -95,6 +99,7 @@ typedef struct RTMPContext {
95 95
     int           swfhash_len;                ///< length of the SHA256 hash
96 96
     int           swfsize;                    ///< size of the decompressed SWF file
97 97
     char*         swfurl;                     ///< url of the swf player
98
+    char*         swfverify;                  ///< URL to player swf file, compute hash/size automatically
98 99
     char          swfverification[42];        ///< hash of the SWF verification
99 100
     char*         pageurl;                    ///< url of the web page
100 101
     char*         subscribe;                  ///< name of live stream to subscribe
... ...
@@ -825,6 +830,129 @@ static int rtmp_calc_swf_verification(URLContext *s, RTMPContext *rt,
825 825
     return 0;
826 826
 }
827 827
 
828
+#if CONFIG_ZLIB
829
+static int rtmp_uncompress_swfplayer(uint8_t *in_data, int64_t in_size,
830
+                                     uint8_t **out_data, int64_t *out_size)
831
+{
832
+    z_stream zs = { 0 };
833
+    void *ptr;
834
+    int size;
835
+    int ret = 0;
836
+
837
+    zs.avail_in = in_size;
838
+    zs.next_in  = in_data;
839
+    ret = inflateInit(&zs);
840
+    if (ret != Z_OK)
841
+        return AVERROR_UNKNOWN;
842
+
843
+    do {
844
+        uint8_t tmp_buf[16384];
845
+
846
+        zs.avail_out = sizeof(tmp_buf);
847
+        zs.next_out  = tmp_buf;
848
+
849
+        ret = inflate(&zs, Z_NO_FLUSH);
850
+        if (ret != Z_OK && ret != Z_STREAM_END) {
851
+            ret = AVERROR_UNKNOWN;
852
+            goto fail;
853
+        }
854
+
855
+        size = sizeof(tmp_buf) - zs.avail_out;
856
+        if (!(ptr = av_realloc(*out_data, *out_size + size))) {
857
+            ret = AVERROR(ENOMEM);
858
+            goto fail;
859
+        }
860
+        *out_data = ptr;
861
+
862
+        memcpy(*out_data + *out_size, tmp_buf, size);
863
+        *out_size += size;
864
+    } while (zs.avail_out == 0);
865
+
866
+fail:
867
+    inflateEnd(&zs);
868
+    return ret;
869
+}
870
+#endif
871
+
872
+static int rtmp_calc_swfhash(URLContext *s)
873
+{
874
+    RTMPContext *rt = s->priv_data;
875
+    uint8_t *in_data = NULL, *out_data = NULL, *swfdata;
876
+    int64_t in_size, out_size;
877
+    URLContext *stream;
878
+    char swfhash[32];
879
+    int swfsize;
880
+    int ret = 0;
881
+
882
+    /* Get the SWF player file. */
883
+    if ((ret = ffurl_open(&stream, rt->swfverify, AVIO_FLAG_READ,
884
+                          &s->interrupt_callback, NULL)) < 0) {
885
+        av_log(s, AV_LOG_ERROR, "Cannot open connection %s.\n", rt->swfverify);
886
+        goto fail;
887
+    }
888
+
889
+    if ((in_size = ffurl_seek(stream, 0, AVSEEK_SIZE)) < 0) {
890
+        ret = AVERROR(EIO);
891
+        goto fail;
892
+    }
893
+
894
+    if (!(in_data = av_malloc(in_size))) {
895
+        ret = AVERROR(ENOMEM);
896
+        goto fail;
897
+    }
898
+
899
+    if ((ret = ffurl_read_complete(stream, in_data, in_size)) < 0)
900
+        goto fail;
901
+
902
+    if (in_size < 3) {
903
+        ret = AVERROR_INVALIDDATA;
904
+        goto fail;
905
+    }
906
+
907
+    if (!memcmp(in_data, "CWS", 3)) {
908
+        /* Decompress the SWF player file using Zlib. */
909
+        if (!(out_data = av_malloc(8))) {
910
+            ret = AVERROR(ENOMEM);
911
+            goto fail;
912
+        }
913
+        *in_data = 'F'; // magic stuff
914
+        memcpy(out_data, in_data, 8);
915
+        out_size = 8;
916
+
917
+#if CONFIG_ZLIB
918
+        if ((ret = rtmp_uncompress_swfplayer(in_data + 8, in_size - 8,
919
+                                             &out_data, &out_size)) < 0)
920
+            goto fail;
921
+#else
922
+        av_log(s, AV_LOG_ERROR,
923
+               "Zlib is required for decompressing the SWF player file.\n");
924
+        ret = AVERROR(EINVAL);
925
+        goto fail;
926
+#endif
927
+        swfsize = out_size;
928
+        swfdata = out_data;
929
+    } else {
930
+        swfsize = in_size;
931
+        swfdata = in_data;
932
+    }
933
+
934
+    /* Compute the SHA256 hash of the SWF player file. */
935
+    if ((ret = ff_rtmp_calc_digest(swfdata, swfsize, 0,
936
+                                   "Genuine Adobe Flash Player 001", 30,
937
+                                   swfhash)) < 0)
938
+        goto fail;
939
+
940
+    /* Set SWFVerification parameters. */
941
+    av_opt_set_bin(rt, "rtmp_swfhash", swfhash, 32, 0);
942
+    rt->swfsize = swfsize;
943
+
944
+fail:
945
+    av_freep(&in_data);
946
+    av_freep(&out_data);
947
+    ffurl_close(stream);
948
+    return ret;
949
+}
950
+
828 951
 /**
829 952
  * Perform handshake with the server by means of exchanging pseudorandom data
830 953
  * signed with HMAC-SHA2 digest.
... ...
@@ -1492,6 +1620,11 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
1492 1492
         goto fail;
1493 1493
     }
1494 1494
 
1495
+    if (rt->swfverify) {
1496
+        if ((ret = rtmp_calc_swfhash(s)) < 0)
1497
+            goto fail;
1498
+    }
1499
+
1495 1500
     rt->state = STATE_START;
1496 1501
     if ((ret = rtmp_handshake(s, rt)) < 0)
1497 1502
         goto fail;
... ...
@@ -1784,6 +1917,7 @@ static const AVOption rtmp_options[] = {
1784 1784
     {"rtmp_swfhash", "SHA256 hash of the decompressed SWF file (32 bytes).", OFFSET(swfhash), AV_OPT_TYPE_BINARY, .flags = DEC},
1785 1785
     {"rtmp_swfsize", "Size of the decompressed SWF file, required for SWFVerification.", OFFSET(swfsize), AV_OPT_TYPE_INT, {0}, 0, INT_MAX, DEC},
1786 1786
     {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
1787
+    {"rtmp_swfverify", "URL to player swf file, compute hash/size automatically.", OFFSET(swfverify), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
1787 1788
     {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
1788 1789
     { NULL },
1789 1790
 };
... ...
@@ -31,7 +31,7 @@
31 31
 
32 32
 #define LIBAVFORMAT_VERSION_MAJOR 54
33 33
 #define LIBAVFORMAT_VERSION_MINOR 24
34
-#define LIBAVFORMAT_VERSION_MICRO 100
34
+#define LIBAVFORMAT_VERSION_MICRO 101
35 35
 
36 36
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
37 37
                                                LIBAVFORMAT_VERSION_MINOR, \
... ...
@@ -22,6 +22,7 @@
22 22
 #include <stdint.h>
23 23
 
24 24
 #include "config.h"
25
+#include "libavutil/common.h"
25 26
 #include "libavutil/libm.h"
26 27
 #include "libavutil/log.h"
27 28
 #include "libavutil/mem.h"
... ...
@@ -19,6 +19,7 @@
19 19
  */
20 20
 
21 21
 #include <stdint.h>
22
+#include <string.h>
22 23
 
23 24
 #include "libavutil/mem.h"
24 25
 #include "audio_data.h"
... ...
@@ -20,6 +20,7 @@
20 20
 
21 21
 #include <stdint.h>
22 22
 
23
+#include "libavutil/common.h"
23 24
 #include "libavutil/libm.h"
24 25
 #include "libavutil/samplefmt.h"
25 26
 #include "avresample.h"
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include <stdint.h>
23 23
 
24
+#include "libavutil/common.h"
24 25
 #include "libavutil/libm.h"
25 26
 #include "libavutil/samplefmt.h"
26 27
 #include "avresample.h"
... ...
@@ -23,6 +23,7 @@
23 23
 #include <stdio.h>
24 24
 
25 25
 #include "libavutil/avstring.h"
26
+#include "libavutil/common.h"
26 27
 #include "libavutil/lfg.h"
27 28
 #include "libavutil/libm.h"
28 29
 #include "libavutil/log.h"
... ...
@@ -19,6 +19,7 @@
19 19
  */
20 20
 
21 21
 #include "libavutil/mathematics.h"
22
+#include "libavutil/mem.h"
22 23
 #include "libavutil/opt.h"
23 24
 #include "avresample.h"
24 25
 #include "internal.h"
... ...
@@ -19,6 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavutil/common.h"
22 23
 #include "libavutil/libm.h"
23 24
 #include "libavutil/log.h"
24 25
 #include "internal.h"
... ...
@@ -18,6 +18,7 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/common.h"
21 22
 #include "libavutil/dict.h"
22 23
 // #include "libavutil/error.h"
23 24
 #include "libavutil/log.h"
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "avutil.h"
28 28
 #include "audio_fifo.h"
29
+#include "common.h"
29 30
 #include "fifo.h"
30 31
 #include "mem.h"
31 32
 #include "samplefmt.h"
... ...
@@ -27,6 +27,7 @@
27 27
 #include "avutil.h"
28 28
 #include "audioconvert.h"
29 29
 #include "bprint.h"
30
+#include "common.h"
30 31
 
31 32
 struct channel_name {
32 33
     const char *name;
... ...
@@ -20,6 +20,7 @@
20 20
  */
21 21
 
22 22
 #include <stdarg.h>
23
+#include <stdint.h>
23 24
 #include <stdio.h>
24 25
 #include <string.h>
25 26
 #include <ctype.h>
... ...
@@ -212,6 +213,7 @@ int av_strncasecmp(const char *a, const char *b, size_t n)
212 212
 
213 213
 #ifdef TEST
214 214
 
215
+#include "common.h"
215 216
 #undef printf
216 217
 
217 218
 int main(void)
... ...
@@ -18,6 +18,9 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include <ctype.h>
22
+#include <string.h>
23
+
21 24
 #include "avstring.h"
22 25
 #include "dict.h"
23 26
 #include "internal.h"
... ...
@@ -19,6 +19,7 @@
19 19
 #undef _GNU_SOURCE
20 20
 #include "avutil.h"
21 21
 #include "avstring.h"
22
+#include "common.h"
22 23
 
23 24
 struct error_entry {
24 25
     int num;
... ...
@@ -28,6 +28,7 @@
28 28
 
29 29
 #include <float.h>
30 30
 #include "avutil.h"
31
+#include "common.h"
31 32
 #include "eval.h"
32 33
 #include "log.h"
33 34
 #include "mathematics.h"
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include <stdint.h>
28 28
 #include "avutil.h"
29
+#include "attributes.h"
29 30
 
30 31
 typedef struct AVFifoBuffer {
31 32
     uint8_t *buffer;
... ...
@@ -16,8 +16,10 @@
16 16
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 17
  */
18 18
 
19
+#include "config.h"
19 20
 #include "file.h"
20 21
 #include "log.h"
22
+#include "mem.h"
21 23
 #include <fcntl.h>
22 24
 #include <sys/stat.h>
23 25
 #if HAVE_UNISTD_H
... ...
@@ -19,6 +19,8 @@
19 19
 #ifndef AVUTIL_FILE_H
20 20
 #define AVUTIL_FILE_H
21 21
 
22
+#include <stdint.h>
23
+
22 24
 #include "avutil.h"
23 25
 
24 26
 /**
... ...
@@ -21,6 +21,7 @@
21 21
  * misc image utilities
22 22
  */
23 23
 
24
+#include "common.h"
24 25
 #include "imgutils.h"
25 26
 #include "internal.h"
26 27
 #include "intreadwrite.h"
... ...
@@ -31,6 +31,7 @@
31 31
 #endif
32 32
 #include <stdlib.h>
33 33
 #include "avutil.h"
34
+#include "common.h"
34 35
 #include "log.h"
35 36
 
36 37
 #define LINE_SZ 1024
... ...
@@ -26,6 +26,8 @@
26 26
 #ifndef AVUTIL_MEM_H
27 27
 #define AVUTIL_MEM_H
28 28
 
29
+#include <limits.h>
30
+
29 31
 #include "attributes.h"
30 32
 #include "error.h"
31 33
 #include "avutil.h"
... ...
@@ -27,6 +27,7 @@
27 27
 
28 28
 #include "avutil.h"
29 29
 #include "avstring.h"
30
+#include "common.h"
30 31
 #include "opt.h"
31 32
 #include "eval.h"
32 33
 #include "dict.h"
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include "avstring.h"
27 27
 #include "avutil.h"
28
+#include "common.h"
28 29
 #include "eval.h"
29 30
 #include "log.h"
30 31
 #include "random_seed.h"
... ...
@@ -16,6 +16,7 @@
16 16
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 17
  */
18 18
 
19
+#include "common.h"
19 20
 #include "samplefmt.h"
20 21
 
21 22
 #include <stdio.h>
... ...
@@ -19,7 +19,10 @@
19 19
 #ifndef AVUTIL_SAMPLEFMT_H
20 20
 #define AVUTIL_SAMPLEFMT_H
21 21
 
22
+#include <stdint.h>
23
+
22 24
 #include "avutil.h"
25
+#include "attributes.h"
23 26
 
24 27
 /**
25 28
  * Audio Sample Formats
... ...
@@ -28,6 +28,7 @@
28 28
 
29 29
 #include <stdlib.h>
30 30
 #include <stdint.h>
31
+#include <inttypes.h>
31 32
 
32 33
 #include "config.h"
33 34
 
... ...
@@ -19,6 +19,7 @@
19 19
  */
20 20
 
21 21
 #include "log.h"
22
+#include "mem.h"
22 23
 #include "tree.h"
23 24
 
24 25
 typedef struct AVTreeNode {
... ...
@@ -157,6 +158,7 @@ void av_tree_enumerate(AVTreeNode *t, void *opaque,
157 157
 
158 158
 #ifdef TEST
159 159
 
160
+#include "common.h"
160 161
 #include "lfg.h"
161 162
 
162 163
 static int check(AVTreeNode *t)
... ...
@@ -39,7 +39,7 @@
39 39
  */
40 40
 
41 41
 #define LIBAVUTIL_VERSION_MAJOR 51
42
-#define LIBAVUTIL_VERSION_MINOR 69
42
+#define LIBAVUTIL_VERSION_MINOR 70
43 43
 #define LIBAVUTIL_VERSION_MICRO 100
44 44
 
45 45
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
... ...
@@ -19,9 +19,11 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include <inttypes.h>
22 23
 #include <stdint.h>
23 24
 #include <stdlib.h>
24 25
 #include <stdarg.h>
26
+#include <string.h>
25 27
 
26 28
 #include "libavutil/bswap.h"
27 29
 
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "swscale.h"
28 28
 #include "rgb2rgb.h"
29
+#include "libavutil/mem.h"
29 30
 
30 31
 #define SIZE    1000
31 32
 #define srcByte 0x55
... ...
@@ -27,6 +27,8 @@
27 27
  *     external api for the swscale stuff
28 28
  */
29 29
 
30
+#include <stdint.h>
31
+
30 32
 #include "libavutil/avutil.h"
31 33
 #include "libavutil/log.h"
32 34
 #include "libavutil/pixfmt.h"
... ...
@@ -28,6 +28,7 @@
28 28
 #endif
29 29
 
30 30
 #include "libavutil/avutil.h"
31
+#include "libavutil/common.h"
31 32
 #include "libavutil/log.h"
32 33
 #include "libavutil/pixfmt.h"
33 34
 #include "libavutil/pixdesc.h"
... ...
@@ -19,7 +19,10 @@
19 19
  */
20 20
 
21 21
 #include <unistd.h>             /* getopt */
22
+#include <stdio.h>
23
+#include <string.h>
22 24
 
25
+#include "libavutil/mem.h"
23 26
 #include "libavutil/pixdesc.h"
24 27
 #include "libavutil/audioconvert.h"
25 28
 #include "libavfilter/avfiltergraph.h"