History

Merge remote-tracking branch 'qatar/master'

* qatar/master: (40 commits) H.264: template left MB handling H.264: faster fill_decode_caches H.264: faster write_back_* H.264: faster fill_filter_caches H.264: make filter_mb_fast support the case of unavailable top mb Do not include log.h in avutil.h Do not include pixfmt.h in avutil.h Do not include rational.h in avutil.h Do not include mathematics.h in avutil.h Do not include intfloat_readwrite.h in avutil.h Remove return statements following infinite loops without break RTSP: Doxygen comment cleanup doxygen: Escape '\' in Doxygen documentation. md5: cosmetics md5: use AV_WL32 to write result md5: add fate test md5: include correct headers md5: fix test program doxygen: Drop array size declarations from Doxygen parameter names. doxygen: Fix parameter names to match the function prototypes. ... Conflicts: libavcodec/x86/dsputil_mmx.c libavformat/flvenc.c libavformat/oggenc.c libavformat/wtv.c

Michael Niedermayer committed 15 years ago

Commit 976a8b22 parents 2a375bb 556f8a0129 files · +2098 −1147Browse files

Unified · Split

129 files
  1. Doxyfile +283 −63
  2. configure +0 −2
  3. doc/examples/muxing-example.c +1 −0
  4. ffmpeg.c +1 −0
  5. ffplay.c +1 −0
  6. ffserver.c +1 −0
  7. libavcodec/aacps.c +1 −1
  8. libavcodec/acelp_pitch_delay.c +1 −0
  9. libavcodec/ansi.c +1 −1
  10. libavcodec/avcodec.h +3 −0
  11. libavcodec/cook.c +1 −2
  12. libavcodec/ffv1.c +1 −73
  13. libavcodec/flicvideo.c +0 −1
  14. libavcodec/h264.c +134 −152
  15. libavcodec/h264.h +255 −233
  16. libavcodec/h264_cabac.c +17 −16
  17. libavcodec/h264_cavlc.c +1 −1
  18. libavcodec/h264_loopfilter.c +35 −21
  19. libavcodec/h264_mvpred.h +0 −1
  20. libavcodec/h264idct_template.c +0 −1
  21. libavcodec/ituh263dec.c +1 −0
  22. libavcodec/lpc.c +1 −1
  23. libavcodec/mjpegdec.c +19 −22
  24. libavcodec/motion_est_template.c +1 −1
  25. libavcodec/mpeg12.c +0 −2
  26. libavcodec/mpegvideo_enc.c +1 −0
  27. libavcodec/pcm.c +0 −1
  28. libavcodec/shorten.c +0 −3
  29. libavcodec/snow.c +1 −342
  30. libavcodec/svq3.c +1 −1
  31. libavcodec/utils.c +1 −0
  32. libavcodec/vp8.c +1 −1
  33. libavcodec/x86/Makefile +1 −0
  34. libavcodec/x86/dsputil_mmx.c +86 −50
  35. libavcodec/x86/h264_qpel_10bit.asm +891 −0
  36. libavcodec/x86/h264_qpel_mmx.c +98 −0
  37. libavcodec/xsubdec.c +2 −0
  38. libavdevice/alsa-audio-dec.c +1 −0
  39. libavfilter/avfilter.h +3 −0
  40. libavfilter/graphparser.c +1 −1
  41. libavfilter/vf_aspect.c +1 −0
  42. libavfilter/vf_crop.c +1 −0
  43. libavfilter/vf_overlay.c +1 −0
  44. libavfilter/vf_pad.c +1 −0
  45. libavfilter/vf_scale.c +1 −0
  46. libavfilter/vf_setpts.c +1 −0
  47. libavfilter/vf_settb.c +1 −0
  48. libavfilter/vsrc_color.c +1 −0
  49. libavfilter/vsrc_nullsrc.c +1 −0
  50. libavformat/4xm.c +1 −0
  51. libavformat/a64.c +0 −1
  52. libavformat/aiffenc.c +1 −0
  53. libavformat/applehttp.c +1 −0
  54. libavformat/asfdec.c +2 −5
  55. libavformat/assdec.c +1 −0
  56. libavformat/audiointerleave.c +1 −0
  57. libavformat/avformat.h +1 −0
  58. libavformat/avidec.c +8 −11
  59. libavformat/bethsoftvid.c +0 −2
  60. libavformat/cafdec.c +1 −0
  61. libavformat/cafenc.c +1 −0
  62. libavformat/dv.c +1 −0
  63. libavformat/dvenc.c +1 −0
  64. libavformat/ffmdec.c +1 −0
  65. libavformat/ffmenc.c +1 −0
  66. libavformat/ffmetadec.c +1 −0
  67. libavformat/flvdec.c +1 −0
  68. libavformat/flvenc.c +1 −0
  69. libavformat/gxfenc.c +2 −0
  70. libavformat/idroqdec.c +0 −1
  71. libavformat/internal.h +2 −2
  72. libavformat/matroskaenc.c +2 −0
  73. libavformat/mm.c +0 −2
  74. libavformat/mmsh.c +0 −1
  75. libavformat/mov.c +2 −1
  76. libavformat/movenc.c +2 −0
  77. libavformat/mp3dec.c +1 −0
  78. libavformat/mpegenc.c +1 −0
  79. libavformat/mpegtsenc.c +1 −0
  80. libavformat/mxfdec.c +1 −0
  81. libavformat/nsvdec.c +2 −0
  82. libavformat/nut.c +1 −0
  83. libavformat/nutdec.c +1 −0
  84. libavformat/nutenc.c +1 −0
  85. libavformat/nuv.c +1 −0
  86. libavformat/oggenc.c +1 −0
  87. libavformat/oma.c +0 −1
  88. libavformat/pcm.c +1 −0
  89. libavformat/psxstr.c +0 −1
  90. libavformat/r3d.c +1 −0
  91. libavformat/riff.c +1 −0
  92. libavformat/rl2.c +1 −0
  93. libavformat/rtmppkt.c +1 −0
  94. libavformat/rtmpproto.c +1 −1
  95. libavformat/rtpdec.c +1 −0
  96. libavformat/rtpenc.c +1 −0
  97. libavformat/rtsp.c +6 −13
  98. libavformat/rtsp.h +4 −2
  99. libavformat/rtspdec.c +1 −0
  100. libavformat/seek.c +1 −0
  101. libavformat/soxdec.c +1 −0
  102. libavformat/soxenc.c +1 −0
  103. libavformat/swfdec.c +0 −1
  104. libavformat/thp.c +1 −0
  105. libavformat/utils.c +1 −0
  106. libavformat/vqf.c +1 −0
  107. libavformat/wav.c +2 −0
  108. libavformat/wc3movie.c +0 −1
  109. libavformat/wtvdec.c +1 −1
  110. libavutil/aes.c +31 −20
  111. libavutil/avutil.h +0 −4
  112. libavutil/des.c +3 −1
  113. libavutil/eval.c +1 −0
  114. libavutil/file.c +1 −0
  115. libavutil/imgutils.c +1 −0
  116. libavutil/imgutils.h +3 −3
  117. libavutil/lfg.h +1 −1
  118. libavutil/md5.c +79 −57
  119. libavutil/opt.c +1 −1
  120. libavutil/parseutils.c +1 −1
  121. libpostproc/postprocess_internal.h +1 −0
  122. libswscale/swscale.h +2 −1
  123. libswscale/swscale_internal.h +2 −0
  124. tests/Makefile +1 −0
  125. tests/fate/libavutil.mak +30 −0
  126. tests/fate2.mak +0 −18
  127. tests/ref/fate/crc +4 −0
  128. tests/ref/fate/md5 +5 −0
  129. tests/seek_test.c +1 −0
Doxyfile+283−63
@@ -1,4 +1,4 @@
1−# Doxyfile 1.5.6
1+# Doxyfile 1.7.1
22
33 # This file describes the settings to be used by the documentation system
44 # doxygen (www.doxygen.org) for a project
@@ -54,11 +54,11 @@ CREATE_SUBDIRS = NO · 49 unmodified lines
5454 # information to generate all constant output in the proper language.
5555 # The default language is English, other supported languages are:
5656 # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
57−# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
58−# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
59−# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
60−# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,
61−# and Ukrainian.
57+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
58+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
59+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
60+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
61+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
6262
6363 OUTPUT_LANGUAGE = English
6464
@@ -155,13 +155,6 @@ QT_AUTOBRIEF = NO · 90 unmodified lines
155155
156156 MULTILINE_CPP_IS_BRIEF = NO
157157
158−# If the DETAILS_AT_TOP tag is set to YES then Doxygen
159−# will output the detailed description near the top, like JavaDoc.
160−# If set to NO, the detailed description appears after the member
161−# documentation.
162−
163−DETAILS_AT_TOP = NO
164−
165158 # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
166159 # member inherits the documentation from any documented member that it
167160 # re-implements.
@@ -214,6 +207,18 @@ OPTIMIZE_FOR_FORTRAN = NO · 46 unmodified lines
214207
215208 OPTIMIZE_OUTPUT_VHDL = NO
216209
210+# Doxygen selects the parser to use depending on the extension of the files it
211+# parses. With this tag you can assign which parser to use for a given extension.
212+# Doxygen has a built-in mapping, but you can override or extend it using this
213+# tag. The format is ext=language, where ext is a file extension, and language
214+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
215+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
216+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
217+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
218+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
219+
220+EXTENSION_MAPPING =
221+
217222 # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
218223 # to include (a tag file for) the STL sources as input, then you should
219224 # set this tag to YES in order to let doxygen match functions declarations and
@@ -268,6 +273,22 @@ SUBGROUPING = YES · 48 unmodified lines
268273
269274 TYPEDEF_HIDES_STRUCT = NO
270275
276+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
277+# determine which symbols to keep in memory and which to flush to disk.
278+# When the cache is full, less often used symbols will be written to disk.
279+# For small to medium size projects (<1000 input files) the default value is
280+# probably good enough. For larger projects a too small cache size can cause
281+# doxygen to be busy swapping symbols to and from disk most of the time
282+# causing a significant performance penality.
283+# If the system has enough physical memory increasing the cache will improve the
284+# performance by keeping more symbols in memory. Note that the value works on
285+# a logarithmic scale so increasing the size by one will rougly double the
286+# memory usage. The cache size is given by this formula:
287+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
288+# corresponding to a cache size of 2^16 = 65536 symbols
289+
290+SYMBOL_CACHE_SIZE = 0
291+
271292 #---------------------------------------------------------------------------
272293 # Build related configuration options
273294 #---------------------------------------------------------------------------
@@ -366,6 +387,12 @@ HIDE_SCOPE_NAMES = NO · 92 unmodified lines
366387
367388 SHOW_INCLUDE_FILES = YES
368389
390+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
391+# will list include files with double quotes in the documentation
392+# rather than with sharp brackets.
393+
394+FORCE_LOCAL_INCLUDES = NO
395+
369396 # If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
370397 # is inserted in the documentation for inline members.
371398
@@ -385,6 +412,16 @@ SORT_MEMBER_DOCS = YES · 13 unmodified lines
385412
386413 SORT_BRIEF_DOCS = NO
387414
415+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
416+# will sort the (brief and detailed) documentation of class members so that
417+# constructors and destructors are listed first. If set to NO (the default)
418+# the constructors will appear in the respective orders defined by
419+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
420+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
421+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
422+
423+SORT_MEMBERS_CTORS_1ST = NO
424+
388425 # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
389426 # hierarchy of group names into alphabetical order. If set to NO (the default)
390427 # the group names will appear in their defined order.
@@ -459,7 +496,8 @@ SHOW_DIRECTORIES = NO · 68 unmodified lines
459496 SHOW_FILES = YES
460497
461498 # Set the SHOW_NAMESPACES tag to NO to disable the generation of the
462−# Namespaces page. This will remove the Namespaces entry from the Quick Index
499+# Namespaces page.
500+# This will remove the Namespaces entry from the Quick Index
463501 # and from the Folder Tree View (if specified). The default is YES.
464502
465503 SHOW_NAMESPACES = YES
@@ -474,6 +512,15 @@ SHOW_NAMESPACES = YES · 8 unmodified lines
474512
475513 FILE_VERSION_FILTER =
476514
515+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
516+# by doxygen. The layout file controls the global structure of the generated
517+# output files in an output format independent way. The create the layout file
518+# that represents doxygen's defaults, run doxygen with the -l option.
519+# You can optionally specify a file name after the option, if omitted
520+# DoxygenLayout.xml will be used as the name of the layout file.
521+
522+LAYOUT_FILE =
523+
477524 #---------------------------------------------------------------------------
478525 # configuration options related to warning and progress messages
479526 #---------------------------------------------------------------------------
@@ -577,7 +624,8 @@ EXCLUDE_SYMLINKS = NO · 97 unmodified lines
577624 # against the file with absolute path, so to exclude all test directories
578625 # for example use the pattern */test/*
579626
580−EXCLUDE_PATTERNS = *.git *.d
627+EXCLUDE_PATTERNS = *.git \
628+ *.d
581629
582630 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
583631 # (namespaces, classes, functions, etc.) that should be excluded from the
@@ -591,7 +639,8 @@ EXCLUDE_SYMBOLS = · 7 unmodified lines
591639 # directories that contain example code fragments that are included (see
592640 # the \include command).
593641
594−EXAMPLE_PATH = libavcodec/ libavformat/
642+EXAMPLE_PATH = libavcodec/ \
643+ libavformat/
595644
596645 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
597646 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -618,14 +667,17 @@ IMAGE_PATH = · 20 unmodified lines
618667 # by executing (via popen()) the command <filter> <input-file>, where <filter>
619668 # is the value of the INPUT_FILTER tag, and <input-file> is the name of an
620669 # input file. Doxygen will then use the output that the filter program writes
621−# to standard output. If FILTER_PATTERNS is specified, this tag will be
670+# to standard output.
671+# If FILTER_PATTERNS is specified, this tag will be
622672 # ignored.
623673
624674 INPUT_FILTER =
625675
626676 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
627−# basis. Doxygen will compare the file name with each pattern and apply the
628−# filter if there is a match. The filters are a list of the form:
677+# basis.
678+# Doxygen will compare the file name with each pattern and apply the
679+# filter if there is a match.
680+# The filters are a list of the form:
629681 # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
630682 # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
631683 # is applied to all files.
@@ -675,7 +727,8 @@ REFERENCES_RELATION = NO · 43 unmodified lines
675727 # If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
676728 # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
677729 # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
678−# link to the source code. Otherwise they will link to the documentstion.
730+# link to the source code.
731+# Otherwise they will link to the documentation.
679732
680733 REFERENCES_LINK_SOURCE = YES
681734
@@ -758,18 +811,50 @@ HTML_FOOTER = · 76 unmodified lines
758811
759812 HTML_STYLESHEET =
760813
814+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
815+# Doxygen will adjust the colors in the stylesheet and background images
816+# according to this color. Hue is specified as an angle on a colorwheel,
817+# see http://en.wikipedia.org/wiki/Hue for more information.
818+# For instance the value 0 represents red, 60 is yellow, 120 is green,
819+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
820+# The allowed range is 0 to 359.
821+
822+HTML_COLORSTYLE_HUE = 220
823+
824+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
825+# the colors in the HTML output. For a value of 0 the output will use
826+# grayscales only. A value of 255 will produce the most vivid colors.
827+
828+HTML_COLORSTYLE_SAT = 100
829+
830+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
831+# the luminance component of the colors in the HTML output. Values below
832+# 100 gradually make the output lighter, whereas values above 100 make
833+# the output darker. The value divided by 100 is the actual gamma applied,
834+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
835+# and 100 does not change the gamma.
836+
837+HTML_COLORSTYLE_GAMMA = 80
838+
839+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
840+# page will contain the date and time when the page was generated. Setting
841+# this to NO can help when comparing the output of multiple runs.
842+
843+HTML_TIMESTAMP = YES
844+
761845 # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
762846 # files or namespaces will be aligned in HTML using tables. If set to
763847 # NO a bullet list will be used.
764848
765849 HTML_ALIGN_MEMBERS = YES
766850
767−# If the GENERATE_HTMLHELP tag is set to YES, additional index files
768−# will be generated that can be used as input for tools like the
769−# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
770−# of the generated HTML documentation.
851+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
852+# documentation will contain sections that can be hidden and shown after the
853+# page has loaded. For this to work a browser that supports
854+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
855+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
771856
772−GENERATE_HTMLHELP = NO
857+HTML_DYNAMIC_SECTIONS = NO
773858
774859 # If the GENERATE_DOCSET tag is set to YES, additional index files
775860 # will be generated that can be used as input for Apple's Xcode 3
@@ -779,6 +864,8 @@ GENERATE_HTMLHELP = NO · 3 unmodified lines
779864 # directory and running "make install" will install the docset in
780865 # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
781866 # it at startup.
867+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
868+# for more information.
782869
783870 GENERATE_DOCSET = NO
784871
@@ -796,13 +883,22 @@ DOCSET_FEEDNAME = "Doxygen generated docs" · 11 unmodified lines
796883
797884 DOCSET_BUNDLE_ID = org.doxygen.Project
798885
799−# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
800−# documentation will contain sections that can be hidden and shown after the
801−# page has loaded. For this to work a browser that supports
802−# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
803−# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
886+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
887+# the documentation publisher. This should be a reverse domain-name style
888+# string, e.g. com.mycompany.MyDocSet.documentation.
804889
805−HTML_DYNAMIC_SECTIONS = NO
890+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
891+
892+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
893+
894+DOCSET_PUBLISHER_NAME = Publisher
895+
896+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
897+# will be generated that can be used as input for tools like the
898+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
899+# of the generated HTML documentation.
900+
901+GENERATE_HTMLHELP = NO
806902
807903 # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
808904 # be used to specify the file name of the resulting .chm file. You
@@ -841,6 +937,76 @@ BINARY_TOC = NO · 32 unmodified lines
841937
842938 TOC_EXPAND = NO
843939
940+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
941+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
942+# that can be used as input for Qt's qhelpgenerator to generate a
943+# Qt Compressed Help (.qch) of the generated HTML documentation.
944+
945+GENERATE_QHP = NO
946+
947+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
948+# be used to specify the file name of the resulting .qch file.
949+# The path specified is relative to the HTML output folder.
950+
951+QCH_FILE =
952+
953+# The QHP_NAMESPACE tag specifies the namespace to use when generating
954+# Qt Help Project output. For more information please see
955+# http://doc.trolltech.com/qthelpproject.html#namespace
956+
957+QHP_NAMESPACE = org.doxygen.Project
958+
959+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
960+# Qt Help Project output. For more information please see
961+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
962+
963+QHP_VIRTUAL_FOLDER = doc
964+
965+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
966+# add. For more information please see
967+# http://doc.trolltech.com/qthelpproject.html#custom-filters
968+
969+QHP_CUST_FILTER_NAME =
970+
971+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
972+# custom filter to add. For more information please see
973+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
974+# Qt Help Project / Custom Filters</a>.
975+
976+QHP_CUST_FILTER_ATTRS =
977+
978+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
979+# project's
980+# filter section matches.
981+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
982+# Qt Help Project / Filter Attributes</a>.
983+
984+QHP_SECT_FILTER_ATTRS =
985+
986+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
987+# be used to specify the location of Qt's qhelpgenerator.
988+# If non-empty doxygen will try to run qhelpgenerator on the generated
989+# .qhp file.
990+
991+QHG_LOCATION =
992+
993+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
994+# will be generated, which together with the HTML files, form an Eclipse help
995+# plugin. To install this plugin and make it available under the help contents
996+# menu in Eclipse, the contents of the directory containing the HTML and XML
997+# files needs to be copied into the plugins directory of eclipse. The name of
998+# the directory within the plugins directory should be the same as
999+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
1000+# the help appears.
1001+
1002+GENERATE_ECLIPSEHELP = NO
1003+
1004+# A unique identifier for the eclipse help plugin. When installing the plugin
1005+# the directory name containing the HTML and XML files should also have
1006+# this name.
1007+
1008+ECLIPSE_DOC_ID = org.doxygen.Project
1009+
8441010 # The DISABLE_INDEX tag can be used to turn on/off the condensed index at
8451011 # top of each HTML page. The value NO (the default) enables the index and
8461012 # the value YES disables it.
@@ -854,27 +1020,30 @@ ENUM_VALUES_PER_LINE = 4 · 7 unmodified lines
8541020
8551021 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
8561022 # structure should be generated to display hierarchical information.
857−# If the tag value is set to FRAME, a side panel will be generated
1023+# If the tag value is set to YES, a side panel will be generated
8581024 # containing a tree-like index structure (just like the one that
8591025 # is generated for HTML Help). For this to work a browser that supports
860−# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
861−# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
862−# probably better off using the HTML help feature. Other possible values
863−# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
864−# and Class Hiererachy pages using a tree view instead of an ordered list;
865−# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
866−# disables this behavior completely. For backwards compatibility with previous
867−# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
868−# respectively.
1026+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
1027+# Windows users are probably better off using the HTML help feature.
8691028
8701029 GENERATE_TREEVIEW = NO
8711030
1031+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
1032+# and Class Hierarchy pages using a tree view instead of an ordered list.
1033+
1034+USE_INLINE_TREES = NO
1035+
8721036 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
8731037 # used to set the initial width (in pixels) of the frame in which the tree
8741038 # is shown.
8751039
8761040 TREEVIEW_WIDTH = 250
8771041
1042+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
1043+# links to external symbols imported via tag files in a separate window.
1044+
1045+EXT_LINKS_IN_WINDOW = NO
1046+
8781047 # Use this tag to change the font size of Latex formulas included
8791048 # as images in the HTML documentation. The default is 10. Note that
8801049 # when you change the font size after a successful doxygen run you need
@@ -883,6 +1052,34 @@ TREEVIEW_WIDTH = 250 · 2 unmodified lines
8831052
8841053 FORMULA_FONTSIZE = 10
8851054
1055+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
1056+# generated for formulas are transparent PNGs. Transparent PNGs are
1057+# not supported properly for IE 6.0, but are supported on all modern browsers.
1058+# Note that when changing this option you need to delete any form_*.png files
1059+# in the HTML output before the changes have effect.
1060+
1061+FORMULA_TRANSPARENT = YES
1062+
1063+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
1064+# for the HTML output. The underlying search engine uses javascript
1065+# and DHTML and should work on any modern browser. Note that when using
1066+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
1067+# (GENERATE_DOCSET) there is already a search function so this one should
1068+# typically be disabled. For large projects the javascript based search engine
1069+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
1070+
1071+SEARCHENGINE = NO
1072+
1073+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
1074+# implemented using a PHP enabled web server instead of at the web client
1075+# using Javascript. Doxygen will generate the search PHP script and index
1076+# file to put on the web server. The advantage of the server
1077+# based approach is that it scales better to large projects and allows
1078+# full text search. The disadvances is that it is more difficult to setup
1079+# and does not have live searching capabilities.
1080+
1081+SERVER_BASED_SEARCH = NO
1082+
8861083 #---------------------------------------------------------------------------
8871084 # configuration options related to the LaTeX output
8881085 #---------------------------------------------------------------------------
@@ -900,6 +1097,9 @@ LATEX_OUTPUT = latex · 11 unmodified lines
9001097
9011098 # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
9021099 # invoked. If left blank `latex' will be used as the default command name.
1100+# Note that when enabling USE_PDFLATEX this option is only used for
1101+# generating bitmaps for formulas in the HTML output, but not in the
1102+# Makefile that is written to the output directory.
9031103
9041104 LATEX_CMD_NAME = latex
9051105
@@ -959,6 +1159,13 @@ LATEX_BATCHMODE = NO · 53 unmodified lines
9591159
9601160 LATEX_HIDE_INDICES = NO
9611161
1162+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
1163+# source code with syntax highlighting in the LaTeX output.
1164+# Note that which sources are shown also depends on other settings
1165+# such as SOURCE_BROWSER.
1166+
1167+LATEX_SOURCE_CODE = NO
1168+
9621169 #---------------------------------------------------------------------------
9631170 # configuration options related to the RTF output
9641171 #---------------------------------------------------------------------------
@@ -1095,8 +1302,10 @@ GENERATE_PERLMOD = NO · 130 unmodified lines
10951302 PERLMOD_LATEX = NO
10961303
10971304 # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
1098−# nicely formatted so it can be parsed by a human reader. This is useful
1099−# if you want to understand what is going on. On the other hand, if this
1305+# nicely formatted so it can be parsed by a human reader.
1306+# This is useful
1307+# if you want to understand what is going on.
1308+# On the other hand, if this
11001309 # tag is set to NO the size of the Perl module output will be much smaller
11011310 # and Perl will parse it just the same.
11021311
@@ -1158,17 +1367,22 @@ INCLUDE_FILE_PATTERNS = · 55 unmodified lines
11581367 # undefined via #undef or recursively expanded use the := operator
11591368 # instead of the = operator.
11601369
1161−PREDEFINED = __attribute__(x)="" "RENAME(x)=x ## _TMPL" "DEF(x)=x ## _TMPL" \
1162− HAVE_AV_CONFIG_H HAVE_MMX HAVE_MMX2 HAVE_AMD3DNOW \
1163− "DECLARE_ALIGNED(a,t,n)=t n" "offsetof(x,y)=0x42" \
1370+PREDEFINED = "__attribute__(x)=" \
1371+ "RENAME(x)=x ## _TMPL" \
1372+ "DEF(x)=x ## _TMPL" \
1373+ HAVE_AV_CONFIG_H \
1374+ HAVE_MMX \
1375+ HAVE_MMX2 \
1376+ HAVE_AMD3DNOW \
1377+ "DECLARE_ALIGNED(a,t,n)=t n" \
1378+ "offsetof(x,y)=0x42"
11641379
11651380 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
11661381 # this tag can be used to specify a list of macro names that should be expanded.
11671382 # The macro definition that is found in the sources will be used.
11681383 # Use the PREDEFINED tag if you want to use a different macro definition.
11691384
1170−#EXPAND_AS_DEFINED = FF_COMMON_FRAME
1171−EXPAND_AS_DEFINED = declare_idct(idct, table, idct_row_head, idct_row, idct_row_tail, idct_row_mid)
1385+EXPAND_AS_DEFINED = declare_idct
11721386
11731387 # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
11741388 # doxygen's preprocessor will remove all function-like macros that are alone
@@ -1186,9 +1400,11 @@ SKIP_FUNCTION_MACROS = YES · 11 unmodified lines
11861400 # Optionally an initial location of the external documentation
11871401 # can be added for each tagfile. The format of a tag file without
11881402 # this location is as follows:
1189−# TAGFILES = file1 file2 ...
1403+#
1404+# TAGFILES = file1 file2 ...
11901405 # Adding location for the tag files is done as follows:
1191−# TAGFILES = file1=loc1 "file2 = loc2" ...
1406+#
1407+# TAGFILES = file1=loc1 "file2 = loc2" ...
11921408 # where "loc1" and "loc2" can be relative or absolute paths or
11931409 # URLs. If a location is present for each tag, the installdox tool
11941410 # does not have to be run to correct the links.
@@ -1256,6 +1472,14 @@ HIDE_UNDOC_RELATIONS = YES · 61 unmodified lines
12561472
12571473 HAVE_DOT = NO
12581474
1475+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
1476+# allowed to run in parallel. When set to 0 (the default) doxygen will
1477+# base this on the number of processors available in the system. You can set it
1478+# explicitly to a value larger than 0 to get control over the balance
1479+# between CPU load and processing speed.
1480+
1481+DOT_NUM_THREADS = 0
1482+
12591483 # By default doxygen will write a font called FreeSans.ttf to the output
12601484 # directory and reference it in all dot files that doxygen generates. This
12611485 # font does not include all possible unicode characters however, so when you need
@@ -1267,6 +1491,11 @@ HAVE_DOT = NO · 5 unmodified lines
12671491
12681492 DOT_FONTNAME = FreeSans
12691493
1494+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
1495+# The default size is 10pt.
1496+
1497+DOT_FONTSIZE = 10
1498+
12701499 # By default doxygen will tell dot to use the output directory to look for the
12711500 # FreeSans.ttf font (which doxygen will put there itself). If you specify a
12721501 # different font using DOT_FONTNAME you can set the path where dot
@@ -1384,10 +1613,10 @@ DOT_GRAPH_MAX_NODES = 50 · 111 unmodified lines
13841613 MAX_DOT_GRAPH_DEPTH = 0
13851614
13861615 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
1387−# background. This is enabled by default, which results in a transparent
1388−# background. Warning: Depending on the platform used, enabling this option
1389−# may lead to badly anti-aliased labels on the edges of a graph (i.e. they
1390−# become hard to read).
1616+# background. This is disabled by default, because dot on Windows does not
1617+# seem to support this out of the box. Warning: Depending on the platform used,
1618+# enabling this option may lead to badly anti-aliased labels on the edges of
1619+# a graph (i.e. they become hard to read).
13911620
13921621 DOT_TRANSPARENT = YES
13931622
@@ -1409,12 +1638,3 @@ GENERATE_LEGEND = YES · 15 unmodified lines
14091638 # the various graphs.
14101639
14111640 DOT_CLEANUP = YES
1412−
1413−#---------------------------------------------------------------------------
1414−# Configuration::additions related to the search engine
1415−#---------------------------------------------------------------------------
1416−
1417−# The SEARCHENGINE tag specifies whether or not a search engine should be
1418−# used. If set to NO the values of all tags below this one will be ignored.
1419−
1420−SEARCHENGINE = NO
configure+0−2
@@ -2560,8 +2560,6 @@ EOF · 2559 unmodified lines
25602560 exit 1;
25612561 fi
25622562
2563−disabled static && LIBNAME=""
2564−
25652563 die_license_disabled() {
25662564 enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
25672565 }
doc/examples/muxing-example.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include <string.h>
3535 #include <math.h>
3636
37+#include "libavutil/mathematics.h"
3738 #include "libavformat/avformat.h"
3839 #include "libswscale/swscale.h"
3940
ffmpeg.c+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 #include "libavutil/fifo.h"
4141 #include "libavutil/intreadwrite.h"
4242 #include "libavutil/dict.h"
43+#include "libavutil/mathematics.h"
4344 #include "libavutil/pixdesc.h"
4445 #include "libavutil/avstring.h"
4546 #include "libavutil/libm.h"
ffplay.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <limits.h>
2626 #include "libavutil/avstring.h"
2727 #include "libavutil/colorspace.h"
28+#include "libavutil/mathematics.h"
2829 #include "libavutil/pixdesc.h"
2930 #include "libavutil/imgutils.h"
3031 #include "libavutil/dict.h"
ffserver.c+1−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include "libavutil/avstring.h"
3838 #include "libavutil/lfg.h"
3939 #include "libavutil/dict.h"
40+#include "libavutil/mathematics.h"
4041 #include "libavutil/random_seed.h"
4142 #include "libavutil/parseutils.h"
4243 #include "libavutil/opt.h"
libavcodec/aacps.c+1−1
@@ -77,7 +77,7 @@ static VLC vlc_ps[10]; · 76 unmodified lines
7777 * @param avctx contains the current codec context
7878 * @param gb pointer to the input bitstream
7979 * @param ps pointer to the Parametric Stereo context
80− * @param par pointer to the parameter to be read
80+ * @param PAR pointer to the parameter to be read
8181 * @param e envelope to decode
8282 * @param dt 1: time delta-coded, 0: frequency delta-coded
8383 */
libavcodec/acelp_pitch_delay.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
2222
23+#include "libavutil/mathematics.h"
2324 #include "avcodec.h"
2425 #include "dsputil.h"
2526 #include "acelp_pitch_delay.h"
libavcodec/ansi.c+1−1
@@ -154,7 +154,7 @@ static void draw_char(AVCodecContext *avctx, int c) · 153 unmodified lines
154154
155155 /**
156156 * Execute ANSI escape code
157− * @param <0 error
157+ * @return 0 on success, negative on error
158158 */
159159 static int execute_code(AVCodecContext * avctx, int c)
160160 {
libavcodec/avcodec.h+3−0
@@ -30,6 +30,9 @@ · 29 unmodified lines
3030 #include "libavutil/samplefmt.h"
3131 #include "libavutil/avutil.h"
3232 #include "libavutil/cpu.h"
33+#include "libavutil/log.h"
34+#include "libavutil/pixfmt.h"
35+#include "libavutil/rational.h"
3336
3437 #include "libavcodec/version.h"
3538
libavcodec/cook.c+1−2
@@ -335,7 +335,7 @@ static av_cold int cook_decode_close(AVCodecContext *avctx) · 334 unmodified lines
335335 * Fill the gain array for the timedomain quantization.
336336 *
337337 * @param gb pointer to the GetBitContext
338− * @param gaininfo[9] array of gain indexes
338+ * @param gaininfo array[9] of gain indexes
339339 */
340340
341341 static void decode_gain_info(GetBitContext *gb, int *gaininfo)
@@ -1156,7 +1156,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) · 814 unmodified lines
11561156 default:
11571157 av_log_ask_for_sample(avctx, "Unknown Cook version.\n");
11581158 return -1;
1159− break;
11601159 }
11611160
11621161 if(s > 1 && q->subpacket[s].samples_per_channel != q->samples_per_channel) {
libavcodec/ffv1.c+1−73
@@ -42,25 +42,6 @@ · 41 unmodified lines
4242
4343 extern const uint8_t ff_log2_run[41];
4444
45−static const int8_t quant3[256]={
46− 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
47− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
48− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
49− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
50− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
51− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
52− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
53− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
54−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
55−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
56−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
57−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
58−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
59−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
60−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
61−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,
62−};
63−
6445 static const int8_t quant5_10bit[256]={
6546 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
6647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -98,42 +79,7 @@ static const int8_t quant5[256]={ · 31 unmodified lines
9879 -2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
9980 -2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,
10081 };
101−static const int8_t quant7[256]={
102− 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
103− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
104− 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
105− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
106− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
107− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
108− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
109− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
110−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
111−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
112−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
113−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
114−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
115−-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-2,
116−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
117−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,
118−};
119−static const int8_t quant9[256]={
120− 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
121− 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
122− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
123− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
124− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
125− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
126− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
127− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
128−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
129−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
130−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
131−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
132−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
133−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
134−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,
135−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-1,-1,
136−};
82+
13783 static const int8_t quant9_10bit[256]={
13884 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
13985 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
@@ -171,24 +117,6 @@ static const int8_t quant11[256]={ · 31 unmodified lines
171117 -4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
172118 -4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,
173119 };
174−static const int8_t quant13[256]={
175− 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
176− 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
177− 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
178− 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
179− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
180− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
181− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
182− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
183−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
184−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
185−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
186−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
187−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-5,
188−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
189−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
190−-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,-2,-2,-1,
191−};
192120
193121 static const uint8_t ver2_state[256]= {
194122 0, 10, 10, 10, 10, 16, 16, 16, 28, 16, 16, 29, 42, 49, 20, 49,
libavcodec/flicvideo.c+0−1
@@ -112,7 +112,6 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) · 111 unmodified lines
112112 case 24 : avctx->pix_fmt = PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */
113113 av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");
114114 return -1;
115− break;
116115 default :
117116 av_log(avctx, AV_LOG_ERROR, "Unknown FLC/FLX depth of %d Bpp is unsupported.\n",depth);
118117 return -1;
libavcodec/h264.c+134−152
@@ -60,15 +60,6 @@ static const enum PixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = { · 59 unmodified lines
6060 PIX_FMT_NONE
6161 };
6262
63−void ff_h264_write_back_intra_pred_mode(H264Context *h){
64− int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[h->mb_xy];
65−
66− AV_COPY32(mode, h->intra4x4_pred_mode_cache + 4 + 8*4);
67− mode[4]= h->intra4x4_pred_mode_cache[7+8*3];
68− mode[5]= h->intra4x4_pred_mode_cache[7+8*2];
69− mode[6]= h->intra4x4_pred_mode_cache[7+8*1];
70−}
71−
7263 /**
7364 * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
7465 */
@@ -3057,6 +3048,82 @@ int ff_h264_get_slice_type(const H264Context *h) · 2982 unmodified lines
30573048 }
30583049 }
30593050
3051+static av_always_inline void fill_filter_caches_inter(H264Context *h, MpegEncContext * const s, int mb_type, int top_xy,
3052+ int left_xy[LEFT_MBS], int top_type, int left_type[LEFT_MBS], int mb_xy, int list)
3053+{
3054+ int b_stride = h->b_stride;
3055+ int16_t (*mv_dst)[2] = &h->mv_cache[list][scan8[0]];
3056+ int8_t *ref_cache = &h->ref_cache[list][scan8[0]];
3057+ if(IS_INTER(mb_type) || IS_DIRECT(mb_type)){
3058+ if(USES_LIST(top_type, list)){
3059+ const int b_xy= h->mb2b_xy[top_xy] + 3*b_stride;
3060+ const int b8_xy= 4*top_xy + 2;
3061+ int (*ref2frm)[64] = h->ref2frm[ h->slice_table[top_xy]&(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
3062+ AV_COPY128(mv_dst - 1*8, s->current_picture.motion_val[list][b_xy + 0]);
3063+ ref_cache[0 - 1*8]=
3064+ ref_cache[1 - 1*8]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 0]];
3065+ ref_cache[2 - 1*8]=
3066+ ref_cache[3 - 1*8]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 1]];
3067+ }else{
3068+ AV_ZERO128(mv_dst - 1*8);
3069+ AV_WN32A(&ref_cache[0 - 1*8], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3070+ }
3071+
3072+ if(!IS_INTERLACED(mb_type^left_type[LTOP])){
3073+ if(USES_LIST(left_type[LTOP], list)){
3074+ const int b_xy= h->mb2b_xy[left_xy[LTOP]] + 3;
3075+ const int b8_xy= 4*left_xy[LTOP] + 1;
3076+ int (*ref2frm)[64] = h->ref2frm[ h->slice_table[left_xy[LTOP]]&(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
3077+ AV_COPY32(mv_dst - 1 + 0, s->current_picture.motion_val[list][b_xy + b_stride*0]);
3078+ AV_COPY32(mv_dst - 1 + 8, s->current_picture.motion_val[list][b_xy + b_stride*1]);
3079+ AV_COPY32(mv_dst - 1 +16, s->current_picture.motion_val[list][b_xy + b_stride*2]);
3080+ AV_COPY32(mv_dst - 1 +24, s->current_picture.motion_val[list][b_xy + b_stride*3]);
3081+ ref_cache[-1 + 0]=
3082+ ref_cache[-1 + 8]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 2*0]];
3083+ ref_cache[-1 + 16]=
3084+ ref_cache[-1 + 24]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 2*1]];
3085+ }else{
3086+ AV_ZERO32(mv_dst - 1 + 0);
3087+ AV_ZERO32(mv_dst - 1 + 8);
3088+ AV_ZERO32(mv_dst - 1 +16);
3089+ AV_ZERO32(mv_dst - 1 +24);
3090+ ref_cache[-1 + 0]=
3091+ ref_cache[-1 + 8]=
3092+ ref_cache[-1 + 16]=
3093+ ref_cache[-1 + 24]= LIST_NOT_USED;
3094+ }
3095+ }
3096+ }
3097+
3098+ if(!USES_LIST(mb_type, list)){
3099+ fill_rectangle(mv_dst, 4, 4, 8, pack16to32(0,0), 4);
3100+ AV_WN32A(&ref_cache[0*8], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3101+ AV_WN32A(&ref_cache[1*8], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3102+ AV_WN32A(&ref_cache[2*8], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3103+ AV_WN32A(&ref_cache[3*8], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3104+ return;
3105+ }
3106+
3107+ {
3108+ int8_t *ref = &s->current_picture.ref_index[list][4*mb_xy];
3109+ int (*ref2frm)[64] = h->ref2frm[ h->slice_num&(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
3110+ uint32_t ref01 = (pack16to32(ref2frm[list][ref[0]],ref2frm[list][ref[1]])&0x00FF00FF)*0x0101;
3111+ uint32_t ref23 = (pack16to32(ref2frm[list][ref[2]],ref2frm[list][ref[3]])&0x00FF00FF)*0x0101;
3112+ AV_WN32A(&ref_cache[0*8], ref01);
3113+ AV_WN32A(&ref_cache[1*8], ref01);
3114+ AV_WN32A(&ref_cache[2*8], ref23);
3115+ AV_WN32A(&ref_cache[3*8], ref23);
3116+ }
3117+
3118+ {
3119+ int16_t (*mv_src)[2] = &s->current_picture.motion_val[list][4*s->mb_x + 4*s->mb_y*b_stride];
3120+ AV_COPY128(mv_dst + 8*0, mv_src + 0*b_stride);
3121+ AV_COPY128(mv_dst + 8*1, mv_src + 1*b_stride);
3122+ AV_COPY128(mv_dst + 8*2, mv_src + 2*b_stride);
3123+ AV_COPY128(mv_dst + 8*3, mv_src + 3*b_stride);
3124+ }
3125+}
3126+
30603127 /**
30613128 *
30623129 * @return non zero if the loop filter can be skiped
@@ -3064,208 +3131,124 @@ int ff_h264_get_slice_type(const H264Context *h) · 1 unmodified line
30643131 static int fill_filter_caches(H264Context *h, int mb_type){
30653132 MpegEncContext * const s = &h->s;
30663133 const int mb_xy= h->mb_xy;
3067− int top_xy, left_xy[2];
3068− int top_type, left_type[2];
3134+ int top_xy, left_xy[LEFT_MBS];
3135+ int top_type, left_type[LEFT_MBS];
3136+ uint8_t *nnz;
3137+ uint8_t *nnz_cache;
30693138
30703139 top_xy = mb_xy - (s->mb_stride << MB_FIELD);
30713140
3072− //FIXME deblocking could skip the intra and nnz parts.
3073−
30743141 /* Wow, what a mess, why didn't they simplify the interlacing & intra
30753142 * stuff, I can't imagine that these complex rules are worth it. */
30763143
3077− left_xy[1] = left_xy[0] = mb_xy-1;
3144+ left_xy[LBOT] = left_xy[LTOP] = mb_xy-1;
30783145 if(FRAME_MBAFF){
30793146 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);
30803147 const int curr_mb_field_flag = IS_INTERLACED(mb_type);
30813148 if(s->mb_y&1){
30823149 if (left_mb_field_flag != curr_mb_field_flag) {
3083− left_xy[0] -= s->mb_stride;
3150+ left_xy[LTOP] -= s->mb_stride;
30843151 }
30853152 }else{
30863153 if(curr_mb_field_flag){
30873154 top_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy ]>>7)&1)-1);
30883155 }
30893156 if (left_mb_field_flag != curr_mb_field_flag) {
3090− left_xy[1] += s->mb_stride;
3157+ left_xy[LBOT] += s->mb_stride;
30913158 }
30923159 }
30933160 }
30943161
30953162 h->top_mb_xy = top_xy;
3096− h->left_mb_xy[0] = left_xy[0];
3097− h->left_mb_xy[1] = left_xy[1];
3163+ h->left_mb_xy[LTOP] = left_xy[LTOP];
3164+ h->left_mb_xy[LBOT] = left_xy[LBOT];
30983165 {
30993166 //for sufficiently low qp, filtering wouldn't do anything
31003167 //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp
31013168 int qp_thresh = h->qp_thresh; //FIXME strictly we should store qp_thresh for each mb of a slice
31023169 int qp = s->current_picture.qscale_table[mb_xy];
31033170 if(qp <= qp_thresh
3104− && (left_xy[0]<0 || ((qp + s->current_picture.qscale_table[left_xy[0]] + 1)>>1) <= qp_thresh)
3105− && (top_xy < 0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){
3171+ && (left_xy[LTOP]<0 || ((qp + s->current_picture.qscale_table[left_xy[LTOP]] + 1)>>1) <= qp_thresh)
3172+ && (top_xy <0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){
31063173 if(!FRAME_MBAFF)
31073174 return 1;
3108− if( (left_xy[0]< 0 || ((qp + s->current_picture.qscale_table[left_xy[1] ] + 1)>>1) <= qp_thresh)
3109− && (top_xy < s->mb_stride || ((qp + s->current_picture.qscale_table[top_xy -s->mb_stride] + 1)>>1) <= qp_thresh))
3175+ if( (left_xy[LTOP]< 0 || ((qp + s->current_picture.qscale_table[left_xy[LBOT] ] + 1)>>1) <= qp_thresh)
3176+ && (top_xy < s->mb_stride || ((qp + s->current_picture.qscale_table[top_xy -s->mb_stride] + 1)>>1) <= qp_thresh))
31103177 return 1;
31113178 }
31123179 }
31133180
3114− top_type = s->current_picture.mb_type[top_xy] ;
3115− left_type[0] = s->current_picture.mb_type[left_xy[0]];
3116− left_type[1] = s->current_picture.mb_type[left_xy[1]];
3181+ top_type = s->current_picture.mb_type[top_xy];
3182+ left_type[LTOP] = s->current_picture.mb_type[left_xy[LTOP]];
3183+ left_type[LBOT] = s->current_picture.mb_type[left_xy[LBOT]];
31173184 if(h->deblocking_filter == 2){
3118− if(h->slice_table[top_xy ] != h->slice_num) top_type= 0;
3119− if(h->slice_table[left_xy[0] ] != h->slice_num) left_type[0]= left_type[1]= 0;
3185+ if(h->slice_table[top_xy ] != h->slice_num) top_type= 0;
3186+ if(h->slice_table[left_xy[LBOT]] != h->slice_num) left_type[LTOP]= left_type[LBOT]= 0;
31203187 }else{
3121− if(h->slice_table[top_xy ] == 0xFFFF) top_type= 0;
3122− if(h->slice_table[left_xy[0] ] == 0xFFFF) left_type[0]= left_type[1] =0;
3188+ if(h->slice_table[top_xy ] == 0xFFFF) top_type= 0;
3189+ if(h->slice_table[left_xy[LBOT]] == 0xFFFF) left_type[LTOP]= left_type[LBOT] =0;
31233190 }
3124− h->top_type = top_type ;
3125− h->left_type[0]= left_type[0];
3126− h->left_type[1]= left_type[1];
3191+ h->top_type = top_type;
3192+ h->left_type[LTOP]= left_type[LTOP];
3193+ h->left_type[LBOT]= left_type[LBOT];
31273194
31283195 if(IS_INTRA(mb_type))
31293196 return 0;
31303197
3131− AV_COPY32(&h->non_zero_count_cache[4+8* 1], &h->non_zero_count[mb_xy][ 0]);
3132− AV_COPY32(&h->non_zero_count_cache[4+8* 2], &h->non_zero_count[mb_xy][ 4]);
3133− AV_COPY32(&h->non_zero_count_cache[4+8* 3], &h->non_zero_count[mb_xy][ 8]);
3134− AV_COPY32(&h->non_zero_count_cache[4+8* 4], &h->non_zero_count[mb_xy][12]);
3198+ fill_filter_caches_inter(h, s, mb_type, top_xy, left_xy, top_type, left_type, mb_xy, 0);
3199+ if(h->list_count == 2)
3200+ fill_filter_caches_inter(h, s, mb_type, top_xy, left_xy, top_type, left_type, mb_xy, 1);
31353201
3202+ nnz = h->non_zero_count[mb_xy];
3203+ nnz_cache = h->non_zero_count_cache;
3204+ AV_COPY32(&nnz_cache[4+8*1], &nnz[ 0]);
3205+ AV_COPY32(&nnz_cache[4+8*2], &nnz[ 4]);
3206+ AV_COPY32(&nnz_cache[4+8*3], &nnz[ 8]);
3207+ AV_COPY32(&nnz_cache[4+8*4], &nnz[12]);
31363208 h->cbp= h->cbp_table[mb_xy];
31373209
3138− {
3139− int list;
3140− for(list=0; list<h->list_count; list++){
3141− int8_t *ref;
3142− int y, b_stride;
3143− int16_t (*mv_dst)[2];
3144− int16_t (*mv_src)[2];
3145−
3146− if(!USES_LIST(mb_type, list)){
3147− fill_rectangle( h->mv_cache[list][scan8[0]], 4, 4, 8, pack16to32(0,0), 4);
3148− AV_WN32A(&h->ref_cache[list][scan8[ 0]], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3149− AV_WN32A(&h->ref_cache[list][scan8[ 2]], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3150− AV_WN32A(&h->ref_cache[list][scan8[ 8]], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3151− AV_WN32A(&h->ref_cache[list][scan8[10]], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3152− continue;
3153− }
3154−
3155− ref = &s->current_picture.ref_index[list][4*mb_xy];
3156− {
3157− int (*ref2frm)[64] = h->ref2frm[ h->slice_num&(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
3158− AV_WN32A(&h->ref_cache[list][scan8[ 0]], (pack16to32(ref2frm[list][ref[0]],ref2frm[list][ref[1]])&0x00FF00FF)*0x0101);
3159− AV_WN32A(&h->ref_cache[list][scan8[ 2]], (pack16to32(ref2frm[list][ref[0]],ref2frm[list][ref[1]])&0x00FF00FF)*0x0101);
3160− ref += 2;
3161− AV_WN32A(&h->ref_cache[list][scan8[ 8]], (pack16to32(ref2frm[list][ref[0]],ref2frm[list][ref[1]])&0x00FF00FF)*0x0101);
3162− AV_WN32A(&h->ref_cache[list][scan8[10]], (pack16to32(ref2frm[list][ref[0]],ref2frm[list][ref[1]])&0x00FF00FF)*0x0101);
3163− }
3164−
3165− b_stride = h->b_stride;
3166− mv_dst = &h->mv_cache[list][scan8[0]];
3167− mv_src = &s->current_picture.motion_val[list][4*s->mb_x + 4*s->mb_y*b_stride];
3168− for(y=0; y<4; y++){
3169− AV_COPY128(mv_dst + 8*y, mv_src + y*b_stride);
3170− }
3171−
3172− }
3173− }
3174−
3175−
3176−/*
3177−0 . T T. T T T T
3178−1 L . .L . . . .
3179−2 L . .L . . . .
3180−3 . T TL . . . .
3181−4 L . .L . . . .
3182−5 L . .. . . . .
3183−*/
3184−//FIXME constraint_intra_pred & partitioning & nnz (let us hope this is just a typo in the spec)
31853210 if(top_type){
3186− AV_COPY32(&h->non_zero_count_cache[4+8*0], &h->non_zero_count[top_xy][3*4]);
3211+ nnz = h->non_zero_count[top_xy];
3212+ AV_COPY32(&nnz_cache[4+8*0], &nnz[3*4]);
31873213 }
31883214
3189− if(left_type[0]){
3190− h->non_zero_count_cache[3+8*1]= h->non_zero_count[left_xy[0]][3+0*4];
3191− h->non_zero_count_cache[3+8*2]= h->non_zero_count[left_xy[0]][3+1*4];
3192− h->non_zero_count_cache[3+8*3]= h->non_zero_count[left_xy[0]][3+2*4];
3193− h->non_zero_count_cache[3+8*4]= h->non_zero_count[left_xy[0]][3+3*4];
3215+ if(left_type[LTOP]){
3216+ nnz = h->non_zero_count[left_xy[LTOP]];
3217+ nnz_cache[3+8*1]= nnz[3+0*4];
3218+ nnz_cache[3+8*2]= nnz[3+1*4];
3219+ nnz_cache[3+8*3]= nnz[3+2*4];
3220+ nnz_cache[3+8*4]= nnz[3+3*4];
31943221 }
31953222
31963223 // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs
31973224 if(!CABAC && h->pps.transform_8x8_mode){
31983225 if(IS_8x8DCT(top_type)){
3199− h->non_zero_count_cache[4+8*0]=
3200− h->non_zero_count_cache[5+8*0]= (h->cbp_table[top_xy] & 0x4000) >> 12;
3201− h->non_zero_count_cache[6+8*0]=
3202− h->non_zero_count_cache[7+8*0]= (h->cbp_table[top_xy] & 0x8000) >> 12;
3226+ nnz_cache[4+8*0]=
3227+ nnz_cache[5+8*0]= (h->cbp_table[top_xy] & 0x4000) >> 12;
3228+ nnz_cache[6+8*0]=
3229+ nnz_cache[7+8*0]= (h->cbp_table[top_xy] & 0x8000) >> 12;
32033230 }
3204− if(IS_8x8DCT(left_type[0])){
3205− h->non_zero_count_cache[3+8*1]=
3206− h->non_zero_count_cache[3+8*2]= (h->cbp_table[left_xy[0]]&0x2000) >> 12; //FIXME check MBAFF
3231+ if(IS_8x8DCT(left_type[LTOP])){
3232+ nnz_cache[3+8*1]=
3233+ nnz_cache[3+8*2]= (h->cbp_table[left_xy[LTOP]]&0x2000) >> 12; //FIXME check MBAFF
32073234 }
3208− if(IS_8x8DCT(left_type[1])){
3209− h->non_zero_count_cache[3+8*3]=
3210− h->non_zero_count_cache[3+8*4]= (h->cbp_table[left_xy[1]]&0x8000) >> 12; //FIXME check MBAFF
3235+ if(IS_8x8DCT(left_type[LBOT])){
3236+ nnz_cache[3+8*3]=
3237+ nnz_cache[3+8*4]= (h->cbp_table[left_xy[LBOT]]&0x8000) >> 12; //FIXME check MBAFF
32113238 }
32123239
32133240 if(IS_8x8DCT(mb_type)){
3214− h->non_zero_count_cache[scan8[0 ]]= h->non_zero_count_cache[scan8[1 ]]=
3215− h->non_zero_count_cache[scan8[2 ]]= h->non_zero_count_cache[scan8[3 ]]= (h->cbp & 0x1000) >> 12;
3216−
3217− h->non_zero_count_cache[scan8[0+ 4]]= h->non_zero_count_cache[scan8[1+ 4]]=
3218− h->non_zero_count_cache[scan8[2+ 4]]= h->non_zero_count_cache[scan8[3+ 4]]= (h->cbp & 0x2000) >> 12;
3241+ nnz_cache[scan8[0 ]]= nnz_cache[scan8[1 ]]=
3242+ nnz_cache[scan8[2 ]]= nnz_cache[scan8[3 ]]= (h->cbp & 0x1000) >> 12;
32193243
3220− h->non_zero_count_cache[scan8[0+ 8]]= h->non_zero_count_cache[scan8[1+ 8]]=
3221− h->non_zero_count_cache[scan8[2+ 8]]= h->non_zero_count_cache[scan8[3+ 8]]= (h->cbp & 0x4000) >> 12;
3244+ nnz_cache[scan8[0+ 4]]= nnz_cache[scan8[1+ 4]]=
3245+ nnz_cache[scan8[2+ 4]]= nnz_cache[scan8[3+ 4]]= (h->cbp & 0x2000) >> 12;
32223246
3223− h->non_zero_count_cache[scan8[0+12]]= h->non_zero_count_cache[scan8[1+12]]=
3224− h->non_zero_count_cache[scan8[2+12]]= h->non_zero_count_cache[scan8[3+12]]= (h->cbp & 0x8000) >> 12;
3225− }
3226− }
3247+ nnz_cache[scan8[0+ 8]]= nnz_cache[scan8[1+ 8]]=
3248+ nnz_cache[scan8[2+ 8]]= nnz_cache[scan8[3+ 8]]= (h->cbp & 0x4000) >> 12;
32273249
3228− if(IS_INTER(mb_type) || IS_DIRECT(mb_type)){
3229− int list;
3230− for(list=0; list<h->list_count; list++){
3231− if(USES_LIST(top_type, list)){
3232− const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;
3233− const int b8_xy= 4*top_xy + 2;
3234− int (*ref2frm)[64] = h->ref2frm[ h->slice_table[top_xy]&(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
3235− AV_COPY128(h->mv_cache[list][scan8[0] + 0 - 1*8], s->current_picture.motion_val[list][b_xy + 0]);
3236− h->ref_cache[list][scan8[0] + 0 - 1*8]=
3237− h->ref_cache[list][scan8[0] + 1 - 1*8]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 0]];
3238− h->ref_cache[list][scan8[0] + 2 - 1*8]=
3239− h->ref_cache[list][scan8[0] + 3 - 1*8]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 1]];
3240− }else{
3241− AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]);
3242− AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((LIST_NOT_USED)&0xFF)*0x01010101u);
3243− }
3244−
3245− if(!IS_INTERLACED(mb_type^left_type[0])){
3246− if(USES_LIST(left_type[0], list)){
3247− const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
3248− const int b8_xy= 4*left_xy[0] + 1;
3249− int (*ref2frm)[64] = h->ref2frm[ h->slice_table[left_xy[0]]&(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
3250− AV_COPY32(h->mv_cache[list][scan8[0] - 1 + 0 ], s->current_picture.motion_val[list][b_xy + h->b_stride*0]);
3251− AV_COPY32(h->mv_cache[list][scan8[0] - 1 + 8 ], s->current_picture.motion_val[list][b_xy + h->b_stride*1]);
3252− AV_COPY32(h->mv_cache[list][scan8[0] - 1 +16 ], s->current_picture.motion_val[list][b_xy + h->b_stride*2]);
3253− AV_COPY32(h->mv_cache[list][scan8[0] - 1 +24 ], s->current_picture.motion_val[list][b_xy + h->b_stride*3]);
3254− h->ref_cache[list][scan8[0] - 1 + 0 ]=
3255− h->ref_cache[list][scan8[0] - 1 + 8 ]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 2*0]];
3256− h->ref_cache[list][scan8[0] - 1 +16 ]=
3257− h->ref_cache[list][scan8[0] - 1 +24 ]= ref2frm[list][s->current_picture.ref_index[list][b8_xy + 2*1]];
3258− }else{
3259− AV_ZERO32(h->mv_cache [list][scan8[0] - 1 + 0 ]);
3260− AV_ZERO32(h->mv_cache [list][scan8[0] - 1 + 8 ]);
3261− AV_ZERO32(h->mv_cache [list][scan8[0] - 1 +16 ]);
3262− AV_ZERO32(h->mv_cache [list][scan8[0] - 1 +24 ]);
3263− h->ref_cache[list][scan8[0] - 1 + 0 ]=
3264− h->ref_cache[list][scan8[0] - 1 + 8 ]=
3265− h->ref_cache[list][scan8[0] - 1 + 16 ]=
3266− h->ref_cache[list][scan8[0] - 1 + 24 ]= LIST_NOT_USED;
3267− }
3268− }
3250+ nnz_cache[scan8[0+12]]= nnz_cache[scan8[1+12]]=
3251+ nnz_cache[scan8[2+12]]= nnz_cache[scan8[3+12]]= (h->cbp & 0x8000) >> 12;
32693252 }
32703253 }
32713254
@@ -3556,7 +3539,6 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){ · 284 unmodified lines
35563539 ff_draw_horiz_band(s, 16*s->mb_y, 16);
35573540 }
35583541 #endif
3559− return -1; //not reached
35603542 }
35613543
35623544 /**
libavcodec/h264.h+255−233
@@ -70,6 +70,10 @@ · 69 unmodified lines
7070 #define MB_FIELD h->mb_field_decoding_flag
7171 #define FRAME_MBAFF h->mb_aff_frame
7272 #define FIELD_PICTURE (s->picture_structure != PICT_FRAME)
73+#define LEFT_MBS 2
74+#define LTOP 0
75+#define LBOT 1
76+#define LEFT(i) (i)
7377 #else
7478 #define MB_MBAFF 0
7579 #define MB_FIELD 0
@@ -77,6 +81,10 @@ · 1 unmodified line
7781 #define FIELD_PICTURE 0
7882 #undef IS_INTERLACED
7983 #define IS_INTERLACED(mb_type) 0
84+#define LEFT_MBS 1
85+#define LTOP 0
86+#define LBOT 0
87+#define LEFT(i) 0
8088 #endif
8189 #define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF || FIELD_PICTURE)
8290
@@ -272,12 +280,12 @@ typedef struct H264Context{ · 189 unmodified lines
272280 int topleft_mb_xy;
273281 int top_mb_xy;
274282 int topright_mb_xy;
275− int left_mb_xy[2];
283+ int left_mb_xy[LEFT_MBS];
276284
277285 int topleft_type;
278286 int top_type;
279287 int topright_type;
280− int left_type[2];
288+ int left_type[LEFT_MBS];
281289
282290 const uint8_t * left_block;
283291 int topleft_partition;
@@ -307,11 +315,6 @@ typedef struct H264Context{ · 23 unmodified lines
307315 #define LIST_NOT_USED -1 //FIXME rename?
308316 #define PART_NOT_AVAILABLE -2
309317
310− /**
311− * is 1 if the specific list MV&references are set to 0,0,-2.
312− */
313− int mv_cache_clean[2];
314−
315318 /**
316319 * number of neighbors (top and/or left) that used 8x8 dct
317320 */
@@ -658,7 +661,6 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h); · 340 unmodified lines
658661 */
659662 int ff_h264_check_intra_pred_mode(H264Context *h, int mode);
660663
661−void ff_h264_write_back_intra_pred_mode(H264Context *h);
662664 void ff_h264_hl_decode_mb(H264Context *h);
663665 int ff_h264_frame_start(H264Context *h);
664666 int ff_h264_decode_extradata(H264Context *h);
@@ -773,7 +775,7 @@ static inline void pred_pskip_motion(H264Context * const h, int * const mx, int · 108 unmodified lines
773775 static void fill_decode_neighbors(H264Context *h, int mb_type){
774776 MpegEncContext * const s = &h->s;
775777 const int mb_xy= h->mb_xy;
776− int topleft_xy, top_xy, topright_xy, left_xy[2];
778+ int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS];
777779 static const uint8_t left_block_options[4][32]={
778780 {0,1,2,3,7,10,8,11,3+0*4, 3+1*4, 3+2*4, 3+3*4, 1+4*4, 1+8*4, 1+5*4, 1+9*4},
779781 {2,2,3,3,8,11,8,11,3+2*4, 3+2*4, 3+3*4, 3+3*4, 1+5*4, 1+9*4, 1+5*4, 1+9*4},
@@ -790,16 +792,16 @@ static void fill_decode_neighbors(H264Context *h, int mb_type){ · 10 unmodified lines
790792
791793 topleft_xy = top_xy - 1;
792794 topright_xy= top_xy + 1;
793− left_xy[1] = left_xy[0] = mb_xy-1;
795+ left_xy[LBOT] = left_xy[LTOP] = mb_xy-1;
794796 h->left_block = left_block_options[0];
795797 if(FRAME_MBAFF){
796798 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);
797799 const int curr_mb_field_flag = IS_INTERLACED(mb_type);
798800 if(s->mb_y&1){
799801 if (left_mb_field_flag != curr_mb_field_flag) {
800− left_xy[1] = left_xy[0] = mb_xy - s->mb_stride - 1;
802+ left_xy[LBOT] = left_xy[LTOP] = mb_xy - s->mb_stride - 1;
801803 if (curr_mb_field_flag) {
802− left_xy[1] += s->mb_stride;
804+ left_xy[LBOT] += s->mb_stride;
803805 h->left_block = left_block_options[3];
804806 } else {
805807 topleft_xy += s->mb_stride;
@@ -816,7 +818,7 @@ static void fill_decode_neighbors(H264Context *h, int mb_type){ · 10 unmodified lines
816818 }
817819 if (left_mb_field_flag != curr_mb_field_flag) {
818820 if (curr_mb_field_flag) {
819− left_xy[1] += s->mb_stride;
821+ left_xy[LBOT] += s->mb_stride;
820822 h->left_block = left_block_options[3];
821823 } else {
822824 h->left_block = left_block_options[2];
@@ -828,25 +830,25 @@ static void fill_decode_neighbors(H264Context *h, int mb_type){ · 5 unmodified lines
828830 h->topleft_mb_xy = topleft_xy;
829831 h->top_mb_xy = top_xy;
830832 h->topright_mb_xy= topright_xy;
831− h->left_mb_xy[0] = left_xy[0];
832− h->left_mb_xy[1] = left_xy[1];
833+ h->left_mb_xy[LTOP] = left_xy[LTOP];
834+ h->left_mb_xy[LBOT] = left_xy[LBOT];
833835 //FIXME do we need all in the context?
834836
835837 h->topleft_type = s->current_picture.mb_type[topleft_xy] ;
836838 h->top_type = s->current_picture.mb_type[top_xy] ;
837839 h->topright_type= s->current_picture.mb_type[topright_xy];
838− h->left_type[0] = s->current_picture.mb_type[left_xy[0]] ;
839− h->left_type[1] = s->current_picture.mb_type[left_xy[1]] ;
840+ h->left_type[LTOP] = s->current_picture.mb_type[left_xy[LTOP]] ;
841+ h->left_type[LBOT] = s->current_picture.mb_type[left_xy[LBOT]] ;
840842
841843 if(FMO){
842− if(h->slice_table[topleft_xy ] != h->slice_num) h->topleft_type = 0;
843− if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
844− if(h->slice_table[left_xy[0] ] != h->slice_num) h->left_type[0] = h->left_type[1] = 0;
844+ if(h->slice_table[topleft_xy ] != h->slice_num) h->topleft_type = 0;
845+ if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
846+ if(h->slice_table[left_xy[LTOP] ] != h->slice_num) h->left_type[LTOP] = h->left_type[LBOT] = 0;
845847 }else{
846848 if(h->slice_table[topleft_xy ] != h->slice_num){
847849 h->topleft_type = 0;
848− if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
849− if(h->slice_table[left_xy[0] ] != h->slice_num) h->left_type[0] = h->left_type[1] = 0;
850+ if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;
851+ if(h->slice_table[left_xy[LTOP] ] != h->slice_num) h->left_type[LTOP] = h->left_type[LBOT] = 0;
850852 }
851853 }
852854 if(h->slice_table[topright_xy] != h->slice_num) h->topright_type= 0;
@@ -854,21 +856,23 @@ static void fill_decode_neighbors(H264Context *h, int mb_type){ · 1 unmodified line
854856
855857 static void fill_decode_caches(H264Context *h, int mb_type){
856858 MpegEncContext * const s = &h->s;
857− int topleft_xy, top_xy, topright_xy, left_xy[2];
858− int topleft_type, top_type, topright_type, left_type[2];
859+ int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS];
860+ int topleft_type, top_type, topright_type, left_type[LEFT_MBS];
859861 const uint8_t * left_block= h->left_block;
860862 int i;
861−
862− topleft_xy = h->topleft_mb_xy ;
863− top_xy = h->top_mb_xy ;
864− topright_xy = h->topright_mb_xy;
865− left_xy[0] = h->left_mb_xy[0] ;
866− left_xy[1] = h->left_mb_xy[1] ;
867− topleft_type = h->topleft_type ;
868− top_type = h->top_type ;
869− topright_type= h->topright_type ;
870− left_type[0] = h->left_type[0] ;
871− left_type[1] = h->left_type[1] ;
863+ uint8_t *nnz;
864+ uint8_t *nnz_cache;
865+
866+ topleft_xy = h->topleft_mb_xy;
867+ top_xy = h->top_mb_xy;
868+ topright_xy = h->topright_mb_xy;
869+ left_xy[LTOP] = h->left_mb_xy[LTOP];
870+ left_xy[LBOT] = h->left_mb_xy[LBOT];
871+ topleft_type = h->topleft_type;
872+ top_type = h->top_type;
873+ topright_type = h->topright_type;
874+ left_type[LTOP]= h->left_type[LTOP];
875+ left_type[LBOT]= h->left_type[LBOT];
872876
873877 if(!IS_SKIP(mb_type)){
874878 if(IS_INTRA(mb_type)){
@@ -883,27 +887,27 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 8 unmodified lines
883887 h->top_samples_available= 0x33FF;
884888 h->topright_samples_available= 0x26EA;
885889 }
886− if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[0])){
890+ if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[LTOP])){
887891 if(IS_INTERLACED(mb_type)){
888− if(!(left_type[0] & type_mask)){
892+ if(!(left_type[LTOP] & type_mask)){
889893 h->topleft_samples_available&= 0xDFFF;
890894 h->left_samples_available&= 0x5FFF;
891895 }
892− if(!(left_type[1] & type_mask)){
896+ if(!(left_type[LBOT] & type_mask)){
893897 h->topleft_samples_available&= 0xFF5F;
894898 h->left_samples_available&= 0xFF5F;
895899 }
896900 }else{
897− int left_typei = s->current_picture.mb_type[left_xy[0] + s->mb_stride];
901+ int left_typei = s->current_picture.mb_type[left_xy[LTOP] + s->mb_stride];
898902
899− assert(left_xy[0] == left_xy[1]);
900− if(!((left_typei & type_mask) && (left_type[0] & type_mask))){
903+ assert(left_xy[LTOP] == left_xy[LBOT]);
904+ if(!((left_typei & type_mask) && (left_type[LTOP] & type_mask))){
901905 h->topleft_samples_available&= 0xDF5F;
902906 h->left_samples_available&= 0x5F5F;
903907 }
904908 }
905909 }else{
906− if(!(left_type[0] & type_mask)){
910+ if(!(left_type[LTOP] & type_mask)){
907911 h->topleft_samples_available&= 0xDF5F;
908912 h->left_samples_available&= 0x5F5F;
909913 }
@@ -925,13 +929,13 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 15 unmodified lines
925929 h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask);
926930 }
927931 for(i=0; i<2; i++){
928− if(IS_INTRA4x4(left_type[i])){
929− int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]];
932+ if(IS_INTRA4x4(left_type[LEFT(i)])){
933+ int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[LEFT(i)]];
930934 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[6-left_block[0+2*i]];
931935 h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[6-left_block[1+2*i]];
932936 }else{
933937 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]=
934− h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= 2 - 3*!(left_type[i] & type_mask);
938+ h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= 2 - 3*!(left_type[LEFT(i)] & type_mask);
935939 }
936940 }
937941 }
@@ -947,42 +951,45 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 9 unmodified lines
947951 5 L . .. . . . .
948952 */
949953 //FIXME constraint_intra_pred & partitioning & nnz (let us hope this is just a typo in the spec)
954+ nnz_cache = h->non_zero_count_cache;
950955 if(top_type){
951− AV_COPY32(&h->non_zero_count_cache[4+8* 0], &h->non_zero_count[top_xy][4*3]);
956+ nnz = h->non_zero_count[top_xy];
957+ AV_COPY32(&nnz_cache[4+8* 0], &nnz[4*3]);
952958 if(CHROMA444){
953− AV_COPY32(&h->non_zero_count_cache[4+8* 5], &h->non_zero_count[top_xy][4* 7]);
954− AV_COPY32(&h->non_zero_count_cache[4+8*10], &h->non_zero_count[top_xy][4*11]);
959+ AV_COPY32(&nnz_cache[4+8* 5], &nnz[4* 7]);
960+ AV_COPY32(&nnz_cache[4+8*10], &nnz[4*11]);
955961 }else{
956− AV_COPY32(&h->non_zero_count_cache[4+8* 5], &h->non_zero_count[top_xy][4* 5]);
957− AV_COPY32(&h->non_zero_count_cache[4+8*10], &h->non_zero_count[top_xy][4* 9]);
962+ AV_COPY32(&nnz_cache[4+8* 5], &nnz[4* 5]);
963+ AV_COPY32(&nnz_cache[4+8*10], &nnz[4* 9]);
958964 }
959965 }else{
960966 uint32_t top_empty = CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040;
961− AV_WN32A(&h->non_zero_count_cache[4+8* 0], top_empty);
962− AV_WN32A(&h->non_zero_count_cache[4+8* 5], top_empty);
963− AV_WN32A(&h->non_zero_count_cache[4+8*10], top_empty);
967+ AV_WN32A(&nnz_cache[4+8* 0], top_empty);
968+ AV_WN32A(&nnz_cache[4+8* 5], top_empty);
969+ AV_WN32A(&nnz_cache[4+8*10], top_empty);
964970 }
965971
966972 for (i=0; i<2; i++) {
967− if(left_type[i]){
968− h->non_zero_count_cache[3+8* 1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]];
969− h->non_zero_count_cache[3+8* 2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]];
973+ if(left_type[LEFT(i)]){
974+ nnz = h->non_zero_count[left_xy[LEFT(i)]];
975+ nnz_cache[3+8* 1 + 2*8*i]= nnz[left_block[8+0+2*i]];
976+ nnz_cache[3+8* 2 + 2*8*i]= nnz[left_block[8+1+2*i]];
970977 if(CHROMA444){
971− h->non_zero_count_cache[3+8* 6 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]+4*4];
972− h->non_zero_count_cache[3+8* 7 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]+4*4];
973− h->non_zero_count_cache[3+8*11 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]+8*4];
974− h->non_zero_count_cache[3+8*12 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]+8*4];
978+ nnz_cache[3+8* 6 + 2*8*i]= nnz[left_block[8+0+2*i]+4*4];
979+ nnz_cache[3+8* 7 + 2*8*i]= nnz[left_block[8+1+2*i]+4*4];
980+ nnz_cache[3+8*11 + 2*8*i]= nnz[left_block[8+0+2*i]+8*4];
981+ nnz_cache[3+8*12 + 2*8*i]= nnz[left_block[8+1+2*i]+8*4];
975982 }else{
976− h->non_zero_count_cache[3+8* 6 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+4+2*i]];
977− h->non_zero_count_cache[3+8*11 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+5+2*i]];
983+ nnz_cache[3+8* 6 + 8*i]= nnz[left_block[8+4+2*i]];
984+ nnz_cache[3+8*11 + 8*i]= nnz[left_block[8+5+2*i]];
978985 }
979986 }else{
980− h->non_zero_count_cache[3+8* 1 + 2*8*i]=
981− h->non_zero_count_cache[3+8* 2 + 2*8*i]=
982− h->non_zero_count_cache[3+8* 6 + 2*8*i]=
983− h->non_zero_count_cache[3+8* 7 + 2*8*i]=
984− h->non_zero_count_cache[3+8*11 + 2*8*i]=
985− h->non_zero_count_cache[3+8*12 + 2*8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64;
987+ nnz_cache[3+8* 1 + 2*8*i]=
988+ nnz_cache[3+8* 2 + 2*8*i]=
989+ nnz_cache[3+8* 6 + 2*8*i]=
990+ nnz_cache[3+8* 7 + 2*8*i]=
991+ nnz_cache[3+8*11 + 2*8*i]=
992+ nnz_cache[3+8*12 + 2*8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64;
986993 }
987994 }
988995
@@ -994,10 +1001,10 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 5 unmodified lines
9941001 h->top_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
9951002 }
9961003 // left_cbp
997− if (left_type[0]) {
998− h->left_cbp = (h->cbp_table[left_xy[0]] & 0x7F0)
999− | ((h->cbp_table[left_xy[0]]>>(left_block[0]&(~1)))&2)
1000− | (((h->cbp_table[left_xy[1]]>>(left_block[2]&(~1)))&2) << 2);
1004+ if (left_type[LTOP]) {
1005+ h->left_cbp = (h->cbp_table[left_xy[LTOP]] & 0x7F0)
1006+ | ((h->cbp_table[left_xy[LTOP]]>>(left_block[0]&(~1)))&2)
1007+ | (((h->cbp_table[left_xy[LBOT]]>>(left_block[2]&(~1)))&2) << 2);
10011008 } else {
10021009 h->left_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
10031010 }
@@ -1006,144 +1013,145 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 2 unmodified lines
10061013
10071014 if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){
10081015 int list;
1016+ int b_stride = h->b_stride;
10091017 for(list=0; list<h->list_count; list++){
1018+ int8_t *ref_cache = &h->ref_cache[list][scan8[0]];
1019+ int8_t *ref = s->current_picture.ref_index[list];
1020+ int16_t (*mv_cache)[2] = &h->mv_cache[list][scan8[0]];
1021+ int16_t (*mv)[2] = s->current_picture.motion_val[list];
10101022 if(!USES_LIST(mb_type, list)){
1011− /*if(!h->mv_cache_clean[list]){
1012− memset(h->mv_cache [list], 0, 8*5*2*sizeof(int16_t)); //FIXME clean only input? clean at all?
1013− memset(h->ref_cache[list], PART_NOT_AVAILABLE, 8*5*sizeof(int8_t));
1014− h->mv_cache_clean[list]= 1;
1015− }*/
10161023 continue;
10171024 }
10181025 assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred));
10191026
1020− h->mv_cache_clean[list]= 0;
1021−
10221027 if(USES_LIST(top_type, list)){
1023− const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;
1024− AV_COPY128(h->mv_cache[list][scan8[0] + 0 - 1*8], s->current_picture.motion_val[list][b_xy + 0]);
1025− h->ref_cache[list][scan8[0] + 0 - 1*8]=
1026− h->ref_cache[list][scan8[0] + 1 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 2];
1027− h->ref_cache[list][scan8[0] + 2 - 1*8]=
1028− h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 3];
1028+ const int b_xy= h->mb2b_xy[top_xy] + 3*b_stride;
1029+ AV_COPY128(mv_cache[0 - 1*8], mv[b_xy + 0]);
1030+ ref_cache[0 - 1*8]=
1031+ ref_cache[1 - 1*8]= ref[4*top_xy + 2];
1032+ ref_cache[2 - 1*8]=
1033+ ref_cache[3 - 1*8]= ref[4*top_xy + 3];
10291034 }else{
1030− AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]);
1031− AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
1035+ AV_ZERO128(mv_cache[0 - 1*8]);
1036+ AV_WN32A(&ref_cache[0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
10321037 }
10331038
10341039 if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){
10351040 for(i=0; i<2; i++){
1036− int cache_idx = scan8[0] - 1 + i*2*8;
1037− if(USES_LIST(left_type[i], list)){
1038− const int b_xy= h->mb2b_xy[left_xy[i]] + 3;
1039− const int b8_xy= 4*left_xy[i] + 1;
1040− AV_COPY32(h->mv_cache[list][cache_idx ], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0+i*2]]);
1041− AV_COPY32(h->mv_cache[list][cache_idx+8], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[1+i*2]]);
1042− h->ref_cache[list][cache_idx ]= s->current_picture.ref_index[list][b8_xy + (left_block[0+i*2]&~1)];
1043− h->ref_cache[list][cache_idx+8]= s->current_picture.ref_index[list][b8_xy + (left_block[1+i*2]&~1)];
1041+ int cache_idx = -1 + i*2*8;
1042+ if(USES_LIST(left_type[LEFT(i)], list)){
1043+ const int b_xy= h->mb2b_xy[left_xy[LEFT(i)]] + 3;
1044+ const int b8_xy= 4*left_xy[LEFT(i)] + 1;
1045+ AV_COPY32(mv_cache[cache_idx ], mv[b_xy + b_stride*left_block[0+i*2]]);
1046+ AV_COPY32(mv_cache[cache_idx+8], mv[b_xy + b_stride*left_block[1+i*2]]);
1047+ ref_cache[cache_idx ]= ref[b8_xy + (left_block[0+i*2]&~1)];
1048+ ref_cache[cache_idx+8]= ref[b8_xy + (left_block[1+i*2]&~1)];
10441049 }else{
1045− AV_ZERO32(h->mv_cache [list][cache_idx ]);
1046− AV_ZERO32(h->mv_cache [list][cache_idx+8]);
1047− h->ref_cache[list][cache_idx ]=
1048− h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1050+ AV_ZERO32(mv_cache[cache_idx ]);
1051+ AV_ZERO32(mv_cache[cache_idx+8]);
1052+ ref_cache[cache_idx ]=
1053+ ref_cache[cache_idx+8]= (left_type[LEFT(i)]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;
10491054 }
10501055 }
10511056 }else{
1052− if(USES_LIST(left_type[0], list)){
1053− const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
1054− const int b8_xy= 4*left_xy[0] + 1;
1055− AV_COPY32(h->mv_cache[list][scan8[0] - 1], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0]]);
1056− h->ref_cache[list][scan8[0] - 1]= s->current_picture.ref_index[list][b8_xy + (left_block[0]&~1)];
1057+ if(USES_LIST(left_type[LTOP], list)){
1058+ const int b_xy= h->mb2b_xy[left_xy[LTOP]] + 3;
1059+ const int b8_xy= 4*left_xy[LTOP] + 1;
1060+ AV_COPY32(mv_cache[-1], mv[b_xy + b_stride*left_block[0]]);
1061+ ref_cache[-1]= ref[b8_xy + (left_block[0]&~1)];
10571062 }else{
1058− AV_ZERO32(h->mv_cache [list][scan8[0] - 1]);
1059− h->ref_cache[list][scan8[0] - 1]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1063+ AV_ZERO32(mv_cache[-1]);
1064+ ref_cache[-1]= left_type[LTOP] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
10601065 }
10611066 }
10621067
10631068 if(USES_LIST(topright_type, list)){
1064− const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;
1065− AV_COPY32(h->mv_cache[list][scan8[0] + 4 - 1*8], s->current_picture.motion_val[list][b_xy]);
1066− h->ref_cache[list][scan8[0] + 4 - 1*8]= s->current_picture.ref_index[list][4*topright_xy + 2];
1069+ const int b_xy= h->mb2b_xy[topright_xy] + 3*b_stride;
1070+ AV_COPY32(mv_cache[4 - 1*8], mv[b_xy]);
1071+ ref_cache[4 - 1*8]= ref[4*topright_xy + 2];
10671072 }else{
1068− AV_ZERO32(h->mv_cache [list][scan8[0] + 4 - 1*8]);
1069− h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1073+ AV_ZERO32(mv_cache[4 - 1*8]);
1074+ ref_cache[4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
10701075 }
1071− if(h->ref_cache[list][scan8[0] + 4 - 1*8] < 0){
1076+ if(ref_cache[4 - 1*8] < 0){
10721077 if(USES_LIST(topleft_type, list)){
1073− const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride);
1078+ const int b_xy = h->mb2b_xy[topleft_xy] + 3 + b_stride + (h->topleft_partition & 2*b_stride);
10741079 const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2);
1075− AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]);
1076− h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy];
1080+ AV_COPY32(mv_cache[-1 - 1*8], mv[b_xy]);
1081+ ref_cache[-1 - 1*8]= ref[b8_xy];
10771082 }else{
1078− AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]);
1079− h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1083+ AV_ZERO32(mv_cache[-1 - 1*8]);
1084+ ref_cache[-1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
10801085 }
10811086 }
10821087
10831088 if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF)
10841089 continue;
10851090
1086− if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))) {
1087− h->ref_cache[list][scan8[4 ]] =
1088− h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE;
1089− AV_ZERO32(h->mv_cache [list][scan8[4 ]]);
1090− AV_ZERO32(h->mv_cache [list][scan8[12]]);
1091−
1092− if( CABAC ) {
1093− /* XXX beurk, Load mvd */
1094− if(USES_LIST(top_type, list)){
1095− const int b_xy= h->mb2br_xy[top_xy];
1096− AV_COPY64(h->mvd_cache[list][scan8[0] + 0 - 1*8], h->mvd_table[list][b_xy + 0]);
1097− }else{
1098− AV_ZERO64(h->mvd_cache[list][scan8[0] + 0 - 1*8]);
1099− }
1100− if(USES_LIST(left_type[0], list)){
1101− const int b_xy= h->mb2br_xy[left_xy[0]] + 6;
1102− AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 0*8], h->mvd_table[list][b_xy - left_block[0]]);
1103− AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 1*8], h->mvd_table[list][b_xy - left_block[1]]);
1104− }else{
1105− AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 0*8]);
1106− AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 1*8]);
1107− }
1108− if(USES_LIST(left_type[1], list)){
1109− const int b_xy= h->mb2br_xy[left_xy[1]] + 6;
1110− AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 2*8], h->mvd_table[list][b_xy - left_block[2]]);
1111− AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 3*8], h->mvd_table[list][b_xy - left_block[3]]);
1112− }else{
1113− AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 2*8]);
1114− AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 3*8]);
1115− }
1116− AV_ZERO16(h->mvd_cache [list][scan8[4 ]]);
1117− AV_ZERO16(h->mvd_cache [list][scan8[12]]);
1118− if(h->slice_type_nos == AV_PICTURE_TYPE_B){
1119− fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1);
1120−
1121− if(IS_DIRECT(top_type)){
1122− AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101u*(MB_TYPE_DIRECT2>>1));
1123− }else if(IS_8X8(top_type)){
1124− int b8_xy = 4*top_xy;
1125− h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy + 2];
1126− h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 3];
1091+ if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))){
1092+ uint8_t (*mvd_cache)[2] = &h->mvd_cache[list][scan8[0]];
1093+ uint8_t (*mvd)[2] = h->mvd_table[list];
1094+ ref_cache[2+8*0] =
1095+ ref_cache[2+8*2] = PART_NOT_AVAILABLE;
1096+ AV_ZERO32(mv_cache[2+8*0]);
1097+ AV_ZERO32(mv_cache[2+8*2]);
1098+
1099+ if( CABAC ) {
1100+ if(USES_LIST(top_type, list)){
1101+ const int b_xy= h->mb2br_xy[top_xy];
1102+ AV_COPY64(mvd_cache[0 - 1*8], mvd[b_xy + 0]);
11271103 }else{
1128− AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101*(MB_TYPE_16x16>>1));
1104+ AV_ZERO64(mvd_cache[0 - 1*8]);
1105+ }
1106+ if(USES_LIST(left_type[LTOP], list)){
1107+ const int b_xy= h->mb2br_xy[left_xy[LTOP]] + 6;
1108+ AV_COPY16(mvd_cache[-1 + 0*8], mvd[b_xy - left_block[0]]);
1109+ AV_COPY16(mvd_cache[-1 + 1*8], mvd[b_xy - left_block[1]]);
1110+ }else{
1111+ AV_ZERO16(mvd_cache[-1 + 0*8]);
1112+ AV_ZERO16(mvd_cache[-1 + 1*8]);
1113+ }
1114+ if(USES_LIST(left_type[LBOT], list)){
1115+ const int b_xy= h->mb2br_xy[left_xy[LBOT]] + 6;
1116+ AV_COPY16(mvd_cache[-1 + 2*8], mvd[b_xy - left_block[2]]);
1117+ AV_COPY16(mvd_cache[-1 + 3*8], mvd[b_xy - left_block[3]]);
1118+ }else{
1119+ AV_ZERO16(mvd_cache[-1 + 2*8]);
1120+ AV_ZERO16(mvd_cache[-1 + 3*8]);
1121+ }
1122+ AV_ZERO16(mvd_cache[2+8*0]);
1123+ AV_ZERO16(mvd_cache[2+8*2]);
1124+ if(h->slice_type_nos == AV_PICTURE_TYPE_B){
1125+ uint8_t *direct_cache = &h->direct_cache[scan8[0]];
1126+ uint8_t *direct_table = h->direct_table;
1127+ fill_rectangle(direct_cache, 4, 4, 8, MB_TYPE_16x16>>1, 1);
1128+
1129+ if(IS_DIRECT(top_type)){
1130+ AV_WN32A(&direct_cache[-1*8], 0x01010101u*(MB_TYPE_DIRECT2>>1));
1131+ }else if(IS_8X8(top_type)){
1132+ int b8_xy = 4*top_xy;
1133+ direct_cache[0 - 1*8]= direct_table[b8_xy + 2];
1134+ direct_cache[2 - 1*8]= direct_table[b8_xy + 3];
1135+ }else{
1136+ AV_WN32A(&direct_cache[-1*8], 0x01010101*(MB_TYPE_16x16>>1));
1137+ }
1138+
1139+ if(IS_DIRECT(left_type[LTOP]))
1140+ direct_cache[-1 + 0*8]= MB_TYPE_DIRECT2>>1;
1141+ else if(IS_8X8(left_type[LTOP]))
1142+ direct_cache[-1 + 0*8]= direct_table[4*left_xy[LTOP] + 1 + (left_block[0]&~1)];
1143+ else
1144+ direct_cache[-1 + 0*8]= MB_TYPE_16x16>>1;
1145+
1146+ if(IS_DIRECT(left_type[LBOT]))
1147+ direct_cache[-1 + 2*8]= MB_TYPE_DIRECT2>>1;
1148+ else if(IS_8X8(left_type[LBOT]))
1149+ direct_cache[-1 + 2*8]= direct_table[4*left_xy[LBOT] + 1 + (left_block[2]&~1)];
1150+ else
1151+ direct_cache[-1 + 2*8]= MB_TYPE_16x16>>1;
11291152 }
1130−
1131− if(IS_DIRECT(left_type[0]))
1132− h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_DIRECT2>>1;
1133− else if(IS_8X8(left_type[0]))
1134− h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[4*left_xy[0] + 1 + (left_block[0]&~1)];
1135− else
1136− h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_16x16>>1;
1137−
1138− if(IS_DIRECT(left_type[1]))
1139− h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_DIRECT2>>1;
1140− else if(IS_8X8(left_type[1]))
1141− h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[4*left_xy[1] + 1 + (left_block[2]&~1)];
1142− else
1143− h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_16x16>>1;
11441153 }
11451154 }
1146− }
11471155 if(FRAME_MBAFF){
11481156 #define MAP_MVS\
11491157 MAP_F2F(scan8[0] - 1 - 1*8, topleft_type)\
@@ -1152,10 +1160,10 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 2 unmodified lines
11521160 MAP_F2F(scan8[0] + 2 - 1*8, top_type)\
11531161 MAP_F2F(scan8[0] + 3 - 1*8, top_type)\
11541162 MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\
1155− MAP_F2F(scan8[0] - 1 + 0*8, left_type[0])\
1156− MAP_F2F(scan8[0] - 1 + 1*8, left_type[0])\
1157− MAP_F2F(scan8[0] - 1 + 2*8, left_type[1])\
1158− MAP_F2F(scan8[0] - 1 + 3*8, left_type[1])
1163+ MAP_F2F(scan8[0] - 1 + 0*8, left_type[LTOP])\
1164+ MAP_F2F(scan8[0] - 1 + 1*8, left_type[LTOP])\
1165+ MAP_F2F(scan8[0] - 1 + 2*8, left_type[LBOT])\
1166+ MAP_F2F(scan8[0] - 1 + 3*8, left_type[LBOT])
11591167 if(MB_FIELD){
11601168 #define MAP_F2F(idx, mb_type)\
11611169 if(!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\
@@ -1179,13 +1187,13 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 17 unmodified lines
11791187 }
11801188 }
11811189
1182− h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
1190+ h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[LTOP]);
11831191 }
11841192
11851193 /**
11861194 * gets the predicted intra4x4 prediction mode.
11871195 */
1188−static inline int pred_intra_mode(H264Context *h, int n){
1196+static av_always_inline int pred_intra_mode(H264Context *h, int n){
11891197 const int index8= scan8[n];
11901198 const int left= h->intra4x4_pred_mode_cache[index8 - 1];
11911199 const int top = h->intra4x4_pred_mode_cache[index8 - 8];
@@ -1197,69 +1205,83 @@ static inline int pred_intra_mode(H264Context *h, int n){ · 5 unmodified lines
11971205 else return min;
11981206 }
11991207
1200−static inline void write_back_non_zero_count(H264Context *h){
1201− const int mb_xy= h->mb_xy;
1208+static av_always_inline void write_back_intra_pred_mode(H264Context *h){
1209+ int8_t *i4x4= h->intra4x4_pred_mode + h->mb2br_xy[h->mb_xy];
1210+ int8_t *i4x4_cache= h->intra4x4_pred_mode_cache;
1211+
1212+ AV_COPY32(i4x4, i4x4_cache + 4 + 8*4);
1213+ i4x4[4]= i4x4_cache[7+8*3];
1214+ i4x4[5]= i4x4_cache[7+8*2];
1215+ i4x4[6]= i4x4_cache[7+8*1];
1216+}
12021217
1203− AV_COPY32(&h->non_zero_count[mb_xy][ 0], &h->non_zero_count_cache[4+8* 1]);
1204− AV_COPY32(&h->non_zero_count[mb_xy][ 4], &h->non_zero_count_cache[4+8* 2]);
1205− AV_COPY32(&h->non_zero_count[mb_xy][ 8], &h->non_zero_count_cache[4+8* 3]);
1206− AV_COPY32(&h->non_zero_count[mb_xy][12], &h->non_zero_count_cache[4+8* 4]);
1207− AV_COPY32(&h->non_zero_count[mb_xy][16], &h->non_zero_count_cache[4+8* 6]);
1208− AV_COPY32(&h->non_zero_count[mb_xy][20], &h->non_zero_count_cache[4+8* 7]);
1209− AV_COPY32(&h->non_zero_count[mb_xy][32], &h->non_zero_count_cache[4+8*11]);
1210− AV_COPY32(&h->non_zero_count[mb_xy][36], &h->non_zero_count_cache[4+8*12]);
1218+static av_always_inline void write_back_non_zero_count(H264Context *h){
1219+ const int mb_xy= h->mb_xy;
1220+ uint8_t *nnz = h->non_zero_count[mb_xy];
1221+ uint8_t *nnz_cache = h->non_zero_count_cache;
1222+
1223+ AV_COPY32(&nnz[ 0], &nnz_cache[4+8* 1]);
1224+ AV_COPY32(&nnz[ 4], &nnz_cache[4+8* 2]);
1225+ AV_COPY32(&nnz[ 8], &nnz_cache[4+8* 3]);
1226+ AV_COPY32(&nnz[12], &nnz_cache[4+8* 4]);
1227+ AV_COPY32(&nnz[16], &nnz_cache[4+8* 6]);
1228+ AV_COPY32(&nnz[20], &nnz_cache[4+8* 7]);
1229+ AV_COPY32(&nnz[32], &nnz_cache[4+8*11]);
1230+ AV_COPY32(&nnz[36], &nnz_cache[4+8*12]);
12111231
12121232 if(CHROMA444){
1213− AV_COPY32(&h->non_zero_count[mb_xy][24], &h->non_zero_count_cache[4+8* 8]);
1214− AV_COPY32(&h->non_zero_count[mb_xy][28], &h->non_zero_count_cache[4+8* 9]);
1215− AV_COPY32(&h->non_zero_count[mb_xy][40], &h->non_zero_count_cache[4+8*13]);
1216− AV_COPY32(&h->non_zero_count[mb_xy][44], &h->non_zero_count_cache[4+8*14]);
1233+ AV_COPY32(&nnz[24], &nnz_cache[4+8* 8]);
1234+ AV_COPY32(&nnz[28], &nnz_cache[4+8* 9]);
1235+ AV_COPY32(&nnz[40], &nnz_cache[4+8*13]);
1236+ AV_COPY32(&nnz[44], &nnz_cache[4+8*14]);
12171237 }
12181238 }
12191239
1220−static inline void write_back_motion(H264Context *h, int mb_type){
1240+static av_always_inline void write_back_motion_list(H264Context *h, MpegEncContext * const s, int b_stride,
1241+ int b_xy, int b8_xy, int mb_type, int list )
1242+{
1243+ int16_t (*mv_dst)[2] = &s->current_picture.motion_val[list][b_xy];
1244+ int16_t (*mv_src)[2] = &h->mv_cache[list][scan8[0]];
1245+ AV_COPY128(mv_dst + 0*b_stride, mv_src + 8*0);
1246+ AV_COPY128(mv_dst + 1*b_stride, mv_src + 8*1);
1247+ AV_COPY128(mv_dst + 2*b_stride, mv_src + 8*2);
1248+ AV_COPY128(mv_dst + 3*b_stride, mv_src + 8*3);
1249+ if( CABAC ) {
1250+ uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8*h->mb_xy : h->mb2br_xy[h->mb_xy]];
1251+ uint8_t (*mvd_src)[2] = &h->mvd_cache[list][scan8[0]];
1252+ if(IS_SKIP(mb_type))
1253+ AV_ZERO128(mvd_dst);
1254+ else{
1255+ AV_COPY64(mvd_dst, mvd_src + 8*3);
1256+ AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8*0);
1257+ AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8*1);
1258+ AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8*2);
1259+ }
1260+ }
1261+
1262+ {
1263+ int8_t *ref_index = &s->current_picture.ref_index[list][b8_xy];
1264+ int8_t *ref_cache = h->ref_cache[list];
1265+ ref_index[0+0*2]= ref_cache[scan8[0]];
1266+ ref_index[1+0*2]= ref_cache[scan8[4]];
1267+ ref_index[0+1*2]= ref_cache[scan8[8]];
1268+ ref_index[1+1*2]= ref_cache[scan8[12]];
1269+ }
1270+}
1271+
1272+static av_always_inline void write_back_motion(H264Context *h, int mb_type){
12211273 MpegEncContext * const s = &h->s;
1274+ const int b_stride = h->b_stride;
12221275 const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; //try mb2b(8)_xy
12231276 const int b8_xy= 4*h->mb_xy;
1224− int list;
12251277
1226− if(!USES_LIST(mb_type, 0))
1278+ if(USES_LIST(mb_type, 0)){
1279+ write_back_motion_list(h, s, b_stride, b_xy, b8_xy, mb_type, 0);
1280+ }else{
12271281 fill_rectangle(&s->current_picture.ref_index[0][b8_xy], 2, 2, 2, (uint8_t)LIST_NOT_USED, 1);
1228−
1229− for(list=0; list<h->list_count; list++){
1230− int y, b_stride;
1231− int16_t (*mv_dst)[2];
1232− int16_t (*mv_src)[2];
1233−
1234− if(!USES_LIST(mb_type, list))
1235− continue;
1236−
1237− b_stride = h->b_stride;
1238− mv_dst = &s->current_picture.motion_val[list][b_xy];
1239− mv_src = &h->mv_cache[list][scan8[0]];
1240− for(y=0; y<4; y++){
1241− AV_COPY128(mv_dst + y*b_stride, mv_src + 8*y);
1242− }
1243− if( CABAC ) {
1244− uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8*h->mb_xy : h->mb2br_xy[h->mb_xy]];
1245− uint8_t (*mvd_src)[2] = &h->mvd_cache[list][scan8[0]];
1246− if(IS_SKIP(mb_type))
1247− AV_ZERO128(mvd_dst);
1248− else{
1249− AV_COPY64(mvd_dst, mvd_src + 8*3);
1250− AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8*0);
1251− AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8*1);
1252− AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8*2);
1253− }
1254− }
1255−
1256− {
1257− int8_t *ref_index = &s->current_picture.ref_index[list][b8_xy];
1258− ref_index[0+0*2]= h->ref_cache[list][scan8[0]];
1259− ref_index[1+0*2]= h->ref_cache[list][scan8[4]];
1260− ref_index[0+1*2]= h->ref_cache[list][scan8[8]];
1261− ref_index[1+1*2]= h->ref_cache[list][scan8[12]];
1262− }
1282+ }
1283+ if(USES_LIST(mb_type, 1)){
1284+ write_back_motion_list(h, s, b_stride, b_xy, b8_xy, mb_type, 1);
12631285 }
12641286
12651287 if(h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC){
@@ -1272,7 +1294,7 @@ static inline void write_back_motion(H264Context *h, int mb_type){ · 6 unmodified lines
12721294 }
12731295 }
12741296
1275−static inline int get_dct8x8_allowed(H264Context *h){
1297+static av_always_inline int get_dct8x8_allowed(H264Context *h){
12761298 if(h->sps.direct_8x8_inference_flag)
12771299 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8 )*0x0001000100010001ULL));
12781300 else
libavcodec/h264_cabac.c+17−16
@@ -1296,9 +1296,9 @@ static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_sl · 1295 unmodified lines
12961296
12971297 if(intra_slice){
12981298 int ctx=0;
1299− if( h->left_type[0] & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM))
1299+ if( h->left_type[LTOP] & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM))
13001300 ctx++;
1301− if( h->top_type & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM))
1301+ if( h->top_type & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM))
13021302 ctx++;
13031303 if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 )
13041304 return 0; /* I4x4 */
@@ -1376,10 +1376,10 @@ static int decode_cabac_mb_chroma_pre_mode( H264Context *h) { · 71 unmodified lines
13761376 int ctx = 0;
13771377
13781378 /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */
1379− if( h->left_type[0] && h->chroma_pred_mode_table[mba_xy] != 0 )
1379+ if( h->left_type[LTOP] && h->chroma_pred_mode_table[mba_xy] != 0 )
13801380 ctx++;
13811381
1382− if( h->top_type && h->chroma_pred_mode_table[mbb_xy] != 0 )
1382+ if( h->top_type && h->chroma_pred_mode_table[mbb_xy] != 0 )
13831383 ctx++;
13841384
13851385 if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 )
@@ -1881,7 +1881,7 @@ int ff_h264_decode_mb_cabac(H264Context *h) { · 495 unmodified lines
18811881 int ctx = 0;
18821882 assert(h->slice_type_nos == AV_PICTURE_TYPE_B);
18831883
1884− if( !IS_DIRECT( h->left_type[0]-1 ) )
1884+ if( !IS_DIRECT( h->left_type[LTOP]-1 ) )
18851885 ctx++;
18861886 if( !IS_DIRECT( h->top_type-1 ) )
18871887 ctx++;
@@ -2000,7 +2000,7 @@ decode_intra_mb: · 112 unmodified lines
20002000 //av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] );
20012001 }
20022002 }
2003− ff_h264_write_back_intra_pred_mode(h);
2003+ write_back_intra_pred_mode(h);
20042004 if( ff_h264_check_intra4x4_pred_mode(h) < 0 ) return -1;
20052005 } else {
20062006 h->intra16x16_pred_mode= ff_h264_check_intra_pred_mode( h, h->intra16x16_pred_mode );
@@ -2249,21 +2249,22 @@ decode_intra_mb: · 242 unmodified lines
22492249 * the transform mode of the current macroblock there. */
22502250 if (CHROMA444 && IS_8x8DCT(mb_type)){
22512251 int i;
2252+ uint8_t *nnz_cache = h->non_zero_count_cache;
22522253 for (i = 0; i < 2; i++){
2253− if (h->left_type[i] && !IS_8x8DCT(h->left_type[i])){
2254− h->non_zero_count_cache[3+8* 1 + 2*8*i]=
2255− h->non_zero_count_cache[3+8* 2 + 2*8*i]=
2256− h->non_zero_count_cache[3+8* 6 + 2*8*i]=
2257− h->non_zero_count_cache[3+8* 7 + 2*8*i]=
2258− h->non_zero_count_cache[3+8*11 + 2*8*i]=
2259− h->non_zero_count_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0;
2254+ if (h->left_type[LEFT(i)] && !IS_8x8DCT(h->left_type[LEFT(i)])){
2255+ nnz_cache[3+8* 1 + 2*8*i]=
2256+ nnz_cache[3+8* 2 + 2*8*i]=
2257+ nnz_cache[3+8* 6 + 2*8*i]=
2258+ nnz_cache[3+8* 7 + 2*8*i]=
2259+ nnz_cache[3+8*11 + 2*8*i]=
2260+ nnz_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0;
22602261 }
22612262 }
22622263 if (h->top_type && !IS_8x8DCT(h->top_type)){
22632264 uint32_t top_empty = CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040;
2264− AV_WN32A(&h->non_zero_count_cache[4+8* 0], top_empty);
2265− AV_WN32A(&h->non_zero_count_cache[4+8* 5], top_empty);
2266− AV_WN32A(&h->non_zero_count_cache[4+8*10], top_empty);
2265+ AV_WN32A(&nnz_cache[4+8* 0], top_empty);
2266+ AV_WN32A(&nnz_cache[4+8* 5], top_empty);
2267+ AV_WN32A(&nnz_cache[4+8*10], top_empty);
22672268 }
22682269 }
22692270 s->current_picture.mb_type[mb_xy]= mb_type;
libavcodec/h264_cavlc.c+1−1
@@ -731,7 +731,7 @@ decode_intra_mb: · 730 unmodified lines
731731 else
732732 h->intra4x4_pred_mode_cache[ scan8[i] ] = mode;
733733 }
734− ff_h264_write_back_intra_pred_mode(h);
734+ write_back_intra_pred_mode(h);
735735 if( ff_h264_check_intra4x4_pred_mode(h) < 0)
736736 return -1;
737737 }else{
libavcodec/h264_loopfilter.c+35−21
@@ -215,19 +215,20 @@ static void av_always_inline filter_mb_edgech( uint8_t *pix, int stride, int16_t · 214 unmodified lines
215215 void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {
216216 MpegEncContext * const s = &h->s;
217217 int mb_xy;
218− int mb_type, left_type;
218+ int mb_type, left_type, top_type;
219219 int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh;
220220 int chroma = !(CONFIG_GRAY && (s->flags&CODEC_FLAG_GRAY));
221221 int chroma444 = CHROMA444;
222222
223223 mb_xy = h->mb_xy;
224224
225− if(!h->top_type || !h->h264dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff) {
225+ if(!h->h264dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff) {
226226 ff_h264_filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);
227227 return;
228228 }
229229 assert(!FRAME_MBAFF);
230− left_type= h->left_type[0];
230+ left_type= h->left_type[LTOP];
231+ top_type= h->top_type;
231232
232233 mb_type = s->current_picture.mb_type[mb_xy];
233234 qp = s->current_picture.qscale_table[mb_xy];
@@ -253,13 +254,17 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, · 19 unmodified lines
253254 filter_mb_edgev( &img_y[4*0], linesize, bS4, qp0, h);
254255 if( IS_8x8DCT(mb_type) ) {
255256 filter_mb_edgev( &img_y[4*2], linesize, bS3, qp, h);
256− filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, h);
257+ if(top_type){
258+ filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, h);
259+ }
257260 filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h);
258261 } else {
259262 filter_mb_edgev( &img_y[4*1], linesize, bS3, qp, h);
260263 filter_mb_edgev( &img_y[4*2], linesize, bS3, qp, h);
261264 filter_mb_edgev( &img_y[4*3], linesize, bS3, qp, h);
262− filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, h);
265+ if(top_type){
266+ filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, h);
267+ }
263268 filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, h);
264269 filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h);
265270 filter_mb_edgeh( &img_y[4*3*linesize], linesize, bS3, qp, h);
@@ -273,8 +278,10 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, · 7 unmodified lines
273278 if( IS_8x8DCT(mb_type) ) {
274279 filter_mb_edgev( &img_cb[4*2], linesize, bS3, qpc, h);
275280 filter_mb_edgev( &img_cr[4*2], linesize, bS3, qpc, h);
276− filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, h);
277− filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, h);
281+ if(top_type){
282+ filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, h);
283+ filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, h);
284+ }
278285 filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, h);
279286 filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, h);
280287 } else {
@@ -284,8 +291,10 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, · 3 unmodified lines
284291 filter_mb_edgev( &img_cr[4*2], linesize, bS3, qpc, h);
285292 filter_mb_edgev( &img_cb[4*3], linesize, bS3, qpc, h);
286293 filter_mb_edgev( &img_cr[4*3], linesize, bS3, qpc, h);
287− filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, h);
288− filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, h);
294+ if(top_type){
295+ filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, h);
296+ filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, h);
297+ }
289298 filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, h);
290299 filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, h);
291300 filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, h);
@@ -300,9 +309,11 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, · 8 unmodified lines
300309 }
301310 filter_mb_edgecv( &img_cb[2*2], uvlinesize, bS3, qpc, h);
302311 filter_mb_edgecv( &img_cr[2*2], uvlinesize, bS3, qpc, h);
303− filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, h);
312+ if(top_type){
313+ filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, h);
314+ filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, h);
315+ }
304316 filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, h);
305− filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, h);
306317 filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, h);
307318 }
308319 }
@@ -318,7 +329,7 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, · 9 unmodified lines
318329 AV_WN64A(bS[1][2], 0x0002000200020002ULL);
319330 } else {
320331 int mask_edge1 = (3*(((5*mb_type)>>5)&1)) | (mb_type>>4); //(mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : (mb_type & MB_TYPE_16x8) ? 1 : 0;
321− int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1); // (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) && (h->left_type[0] & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : 0;
332+ int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1); // (mb_type & (MB_TYPE_16x16 | MB_TYPE_8x16)) && (h->left_type[LTOP] & (MB_TYPE_16x16 | MB_TYPE_8x16)) ? 3 : 0;
322333 int step = 1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1;
323334 edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
324335 h->h264dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,
@@ -326,7 +337,7 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, · 1 unmodified line
326337 }
327338 if( IS_INTRA(left_type) )
328339 AV_WN64A(bS[0][0], 0x0004000400040004ULL);
329− if( IS_INTRA(h->top_type) )
340+ if( IS_INTRA(top_type) )
330341 AV_WN64A(bS[1][0], FIELD_PICTURE ? 0x0003000300030003ULL : 0x0004000400040004ULL);
331342
332343 #define FILTER(hv,dir,edge)\
@@ -345,16 +356,19 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, · 12 unmodified lines
345356 if(left_type)
346357 FILTER(v,0,0);
347358 if( edges == 1 ) {
348− FILTER(h,1,0);
359+ if(top_type)
360+ FILTER(h,1,0);
349361 } else if( IS_8x8DCT(mb_type) ) {
350362 FILTER(v,0,2);
351− FILTER(h,1,0);
363+ if(top_type)
364+ FILTER(h,1,0);
352365 FILTER(h,1,2);
353366 } else {
354367 FILTER(v,0,1);
355368 FILTER(v,0,2);
356369 FILTER(v,0,3);
357− FILTER(h,1,0);
370+ if(top_type)
371+ FILTER(h,1,0);
358372 FILTER(h,1,1);
359373 FILTER(h,1,2);
360374 FILTER(h,1,3);
@@ -397,7 +411,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u · 36 unmodified lines
397411 int edge;
398412 int chroma_qp_avg[2];
399413 const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;
400− const int mbm_type = dir == 0 ? h->left_type[0] : h->top_type;
414+ const int mbm_type = dir == 0 ? h->left_type[LTOP] : h->top_type;
401415
402416 // how often to recheck mv-based bS when iterating between edges
403417 static const uint8_t mask_edge_tab[2][8]={{0,3,3,3,1,1,1,1},
@@ -633,9 +647,9 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint · 229 unmodified lines
633647
634648 if (FRAME_MBAFF
635649 // and current and left pair do not have the same interlaced type
636− && IS_INTERLACED(mb_type^h->left_type[0])
650+ && IS_INTERLACED(mb_type^h->left_type[LTOP])
637651 // and left mb is in available to us
638− && h->left_type[0]) {
652+ && h->left_type[LTOP]) {
639653 /* First vertical edge is different in MBAFF frames
640654 * There are 8 different bS to compute and 2 different Qp
641655 */
@@ -663,8 +677,8 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint · 21 unmodified lines
663677 const uint8_t *off= offset[MB_FIELD][mb_y&1];
664678 for( i = 0; i < 8; i++ ) {
665679 int j= MB_FIELD ? i>>2 : i&1;
666− int mbn_xy = h->left_mb_xy[j];
667− int mbn_type= h->left_type[j];
680+ int mbn_xy = h->left_mb_xy[LEFT(j)];
681+ int mbn_type= h->left_type[LEFT(j)];
668682
669683 if( IS_INTRA( mbn_type ) )
670684 bS[i] = 4;
libavcodec/h264_mvpred.h+0−1
@@ -64,7 +64,6 @@ static inline int fetch_diagonal_mv(H264Context *h, const int16_t **C, int i, in · 63 unmodified lines
6464 if(!MB_FIELD
6565 && IS_INTERLACED(h->left_type[0])){
6666 SET_DIAG_MV(*2, >>1, h->left_mb_xy[0]+s->mb_stride, (s->mb_y&1)*2+(i>>5));
67− assert(h->left_mb_xy[0] == h->left_mb_xy[1]);
6867 }
6968 if(MB_FIELD
7069 && !IS_INTERLACED(h->left_type[0])){
libavcodec/h264idct_template.c+0−1
@@ -237,7 +237,6 @@ void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM * · 236 unmodified lines
237237 }
238238 /**
239239 * IDCT transforms the 16 dc values and dequantizes them.
240− * @param qp quantization parameter
241240 */
242241 void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){
243242 #define stride 16
libavcodec/ituh263dec.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 //#define DEBUG
3131 #include <limits.h>
3232
33+#include "libavutil/mathematics.h"
3334 #include "dsputil.h"
3435 #include "avcodec.h"
3536 #include "mpegvideo.h"
libavcodec/lpc.c+1−1
@@ -149,7 +149,7 @@ static int estimate_best_order(double *ref, int min_order, int max_order) · 148 unmodified lines
149149 /**
150150 * Calculate LPC coefficients for multiple orders
151151 *
152− * @param use_lpc LPC method for determining coefficients
152+ * @param lpc_type LPC method for determining coefficients
153153 * 0 = LPC with fixed pre-defined coeffs
154154 * 1 = LPC with coeffs determined by Levinson-Durbin recursion
155155 * 2+ = LPC with coeffs determined by Cholesky factorization using (use_lpc-1) passes.
libavcodec/mjpegdec.c+19−22
@@ -1505,29 +1505,26 @@ eoi_parser: · 1504 unmodified lines
15051505 av_log(avctx, AV_LOG_WARNING, "Found EOI before any SOF, ignoring\n");
15061506 break;
15071507 }
1508− {
1509− if (s->interlaced) {
1510− s->bottom_field ^= 1;
1511− /* if not bottom field, do not output image yet */
1512− if (s->bottom_field == !s->interlace_polarity)
1513− goto not_the_end;
1514− }
1515− *picture = *s->picture_ptr;
1516− *data_size = sizeof(AVFrame);
1517−
1518− if(!s->lossless){
1519− picture->quality= FFMAX3(s->qscale[0], s->qscale[1], s->qscale[2]);
1520− picture->qstride= 0;
1521− picture->qscale_table= s->qscale_table;
1522− memset(picture->qscale_table, picture->quality, (s->width+15)/16);
1523− if(avctx->debug & FF_DEBUG_QP)
1524− av_log(avctx, AV_LOG_DEBUG, "QP: %d\n", picture->quality);
1525− picture->quality*= FF_QP2LAMBDA;
1526− }
1527−
1528− goto the_end;
1508+ if (s->interlaced) {
1509+ s->bottom_field ^= 1;
1510+ /* if not bottom field, do not output image yet */
1511+ if (s->bottom_field == !s->interlace_polarity)
1512+ goto not_the_end;
15291513 }
1530− break;
1514+ *picture = *s->picture_ptr;
1515+ *data_size = sizeof(AVFrame);
1516+
1517+ if(!s->lossless){
1518+ picture->quality= FFMAX3(s->qscale[0], s->qscale[1], s->qscale[2]);
1519+ picture->qstride= 0;
1520+ picture->qscale_table= s->qscale_table;
1521+ memset(picture->qscale_table, picture->quality, (s->width+15)/16);
1522+ if(avctx->debug & FF_DEBUG_QP)
1523+ av_log(avctx, AV_LOG_DEBUG, "QP: %d\n", picture->quality);
1524+ picture->quality*= FF_QP2LAMBDA;
1525+ }
1526+
1527+ goto the_end;
15311528 case SOS:
15321529 if (!s->got_picture) {
15331530 av_log(avctx, AV_LOG_WARNING, "Can not process SOS before SOF, skipping\n");
libavcodec/motion_est_template.c+1−1
@@ -993,7 +993,7 @@ static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dm · 992 unmodified lines
993993 }
994994
995995 /**
996− @param P[10][2] a list of candidate mvs to check before starting the
996+ @param P a list of candidate mvs to check before starting the
997997 iterative search. If one of the candidates is close to the optimal mv, then
998998 it takes fewer iterations. And it increases the chance that we find the
999999 optimal mv.
libavcodec/mpeg12.c+0−2
@@ -1965,8 +1965,6 @@ static int slice_decode_thread(AVCodecContext *c, void *arg){ · 1964 unmodified lines
19651965 if(mb_y < 0 || mb_y >= s->end_mb_y)
19661966 return -1;
19671967 }
1968−
1969− return 0; //not reached
19701968 }
19711969
19721970 /**
libavcodec/mpegvideo_enc.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 */
2929
3030 #include "libavutil/intmath.h"
31+#include "libavutil/mathematics.h"
3132 #include "avcodec.h"
3233 #include "dsputil.h"
3334 #include "mpegvideo.h"
libavcodec/pcm.c+0−1
@@ -440,7 +440,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, · 439 unmodified lines
440440 default:
441441 av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
442442 return -1;
443− break;
444443 }
445444 samples = (short *) dst_int32_t;
446445 break;
libavcodec/shorten.c+0−3
@@ -471,7 +471,6 @@ static int shorten_decode_frame(AVCodecContext *avctx, · 470 unmodified lines
471471 s->cur_chan = 0;
472472 goto frame_done;
473473 }
474− break;
475474 }
476475 break;
477476 case FN_VERBATIM:
@@ -489,11 +488,9 @@ static int shorten_decode_frame(AVCodecContext *avctx, · 11 unmodified lines
489488 case FN_QUIT:
490489 *data_size = 0;
491490 return buf_size;
492− break;
493491 default:
494492 av_log(avctx, AV_LOG_ERROR, "unknown shorten function %d\n", cmd);
495493 return -1;
496− break;
497494 }
498495 }
499496 frame_done:
libavcodec/snow.c+1−342
@@ -33,42 +33,6 @@ · 32 unmodified lines
3333 #undef NDEBUG
3434 #include <assert.h>
3535
36−static const int8_t quant3[256]={
37− 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
38− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
39− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
40− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
41− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
42− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
43− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
44− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
45−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
46−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
47−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
48−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
49−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
50−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
51−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
52−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,
53−};
54−static const int8_t quant3b[256]={
55− 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
56− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
57− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
58− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
59− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
60− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
61− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
62− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
63−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
64−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
65−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
66−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
67−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
68−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
69−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
70−-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
71−};
7236 static const int8_t quant3bA[256]={
7337 0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
7438 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
@@ -87,153 +51,7 @@ static const int8_t quant3bA[256]={ · 12 unmodified lines
8751 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
8852 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
8953 };
90−static const int8_t quant5[256]={
91− 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
92− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
93− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
94− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
95− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
96− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
97− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
98− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
99−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
100−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
101−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
102−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
103−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
104−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
105−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
106−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,
107−};
108−static const int8_t quant7[256]={
109− 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
110− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
111− 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
112− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
113− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
114− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
115− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
116− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
117−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
118−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
119−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
120−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
121−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,
122−-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-2,
123−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,
124−-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,
125−};
126−static const int8_t quant9[256]={
127− 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
128− 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
129− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
130− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
131− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
132− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
133− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
134− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
135−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
136−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
137−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
138−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
139−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
140−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
141−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,
142−-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-1,-1,
143−};
144−static const int8_t quant11[256]={
145− 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
146− 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
147− 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
148− 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
149− 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
150− 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
151− 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
152− 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
153−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
154−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
155−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
156−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
157−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
158−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-4,-4,
159−-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
160−-4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,
161−};
162−static const int8_t quant13[256]={
163− 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
164− 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
165− 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
166− 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
167− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
168− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
169− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
170− 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
171−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
172−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
173−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
174−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,
175−-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-5,
176−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
177−-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
178−-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-3,-3,-3,-2,-2,-1,
179−};
18054
181−#if 0 //64*cubic
182−static const uint8_t obmc32[1024]={
183− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
184− 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
185− 0, 0, 0, 4, 4, 4, 4, 8, 8, 12, 12, 12, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 8, 8, 4, 4, 4, 4, 0, 0, 0,
186− 0, 0, 4, 4, 8, 8, 12, 16, 16, 20, 24, 24, 28, 28, 32, 32, 32, 32, 28, 28, 24, 24, 20, 16, 16, 12, 8, 8, 4, 4, 0, 0,
187− 0, 0, 4, 8, 8, 12, 16, 24, 28, 32, 36, 40, 44, 48, 48, 48, 48, 48, 48, 44, 40, 36, 32, 28, 24, 16, 12, 8, 8, 4, 0, 0,
188− 0, 4, 4, 8, 12, 20, 24, 32, 40, 44, 52, 56, 60, 64, 68, 72, 72, 68, 64, 60, 56, 52, 44, 40, 32, 24, 20, 12, 8, 4, 4, 0,
189− 0, 4, 4, 12, 16, 24, 32, 40, 52, 60, 68, 76, 80, 88, 88, 92, 92, 88, 88, 80, 76, 68, 60, 52, 40, 32, 24, 16, 12, 4, 4, 0,
190− 0, 4, 8, 16, 24, 32, 40, 52, 64, 76, 84, 92,100,108,112,116,116,112,108,100, 92, 84, 76, 64, 52, 40, 32, 24, 16, 8, 4, 0,
191− 0, 4, 8, 16, 28, 40, 52, 64, 76, 88,100,112,124,132,136,140,140,136,132,124,112,100, 88, 76, 64, 52, 40, 28, 16, 8, 4, 0,
192− 0, 4, 12, 20, 32, 44, 60, 76, 88,104,120,132,144,152,160,164,164,160,152,144,132,120,104, 88, 76, 60, 44, 32, 20, 12, 4, 0,
193− 0, 4, 12, 24, 36, 48, 68, 84,100,120,136,152,164,176,180,184,184,180,176,164,152,136,120,100, 84, 68, 48, 36, 24, 12, 4, 0,
194− 0, 4, 12, 24, 40, 56, 76, 92,112,132,152,168,180,192,204,208,208,204,192,180,168,152,132,112, 92, 76, 56, 40, 24, 12, 4, 0,
195− 0, 4, 16, 28, 44, 60, 80,100,124,144,164,180,196,208,220,224,224,220,208,196,180,164,144,124,100, 80, 60, 44, 28, 16, 4, 0,
196− 0, 8, 16, 28, 48, 64, 88,108,132,152,176,192,208,224,232,240,240,232,224,208,192,176,152,132,108, 88, 64, 48, 28, 16, 8, 0,
197− 0, 4, 16, 32, 48, 68, 88,112,136,160,180,204,220,232,244,248,248,244,232,220,204,180,160,136,112, 88, 68, 48, 32, 16, 4, 0,
198− 1, 8, 16, 32, 48, 72, 92,116,140,164,184,208,224,240,248,255,255,248,240,224,208,184,164,140,116, 92, 72, 48, 32, 16, 8, 1,
199− 1, 8, 16, 32, 48, 72, 92,116,140,164,184,208,224,240,248,255,255,248,240,224,208,184,164,140,116, 92, 72, 48, 32, 16, 8, 1,
200− 0, 4, 16, 32, 48, 68, 88,112,136,160,180,204,220,232,244,248,248,244,232,220,204,180,160,136,112, 88, 68, 48, 32, 16, 4, 0,
201− 0, 8, 16, 28, 48, 64, 88,108,132,152,176,192,208,224,232,240,240,232,224,208,192,176,152,132,108, 88, 64, 48, 28, 16, 8, 0,
202− 0, 4, 16, 28, 44, 60, 80,100,124,144,164,180,196,208,220,224,224,220,208,196,180,164,144,124,100, 80, 60, 44, 28, 16, 4, 0,
203− 0, 4, 12, 24, 40, 56, 76, 92,112,132,152,168,180,192,204,208,208,204,192,180,168,152,132,112, 92, 76, 56, 40, 24, 12, 4, 0,
204− 0, 4, 12, 24, 36, 48, 68, 84,100,120,136,152,164,176,180,184,184,180,176,164,152,136,120,100, 84, 68, 48, 36, 24, 12, 4, 0,
205− 0, 4, 12, 20, 32, 44, 60, 76, 88,104,120,132,144,152,160,164,164,160,152,144,132,120,104, 88, 76, 60, 44, 32, 20, 12, 4, 0,
206− 0, 4, 8, 16, 28, 40, 52, 64, 76, 88,100,112,124,132,136,140,140,136,132,124,112,100, 88, 76, 64, 52, 40, 28, 16, 8, 4, 0,
207− 0, 4, 8, 16, 24, 32, 40, 52, 64, 76, 84, 92,100,108,112,116,116,112,108,100, 92, 84, 76, 64, 52, 40, 32, 24, 16, 8, 4, 0,
208− 0, 4, 4, 12, 16, 24, 32, 40, 52, 60, 68, 76, 80, 88, 88, 92, 92, 88, 88, 80, 76, 68, 60, 52, 40, 32, 24, 16, 12, 4, 4, 0,
209− 0, 4, 4, 8, 12, 20, 24, 32, 40, 44, 52, 56, 60, 64, 68, 72, 72, 68, 64, 60, 56, 52, 44, 40, 32, 24, 20, 12, 8, 4, 4, 0,
210− 0, 0, 4, 8, 8, 12, 16, 24, 28, 32, 36, 40, 44, 48, 48, 48, 48, 48, 48, 44, 40, 36, 32, 28, 24, 16, 12, 8, 8, 4, 0, 0,
211− 0, 0, 4, 4, 8, 8, 12, 16, 16, 20, 24, 24, 28, 28, 32, 32, 32, 32, 28, 28, 24, 24, 20, 16, 16, 12, 8, 8, 4, 4, 0, 0,
212− 0, 0, 0, 4, 4, 4, 4, 8, 8, 12, 12, 12, 16, 16, 16, 16, 16, 16, 16, 16, 12, 12, 12, 8, 8, 4, 4, 4, 4, 0, 0, 0,
213− 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
214− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
215−//error:0.000022
216−};
217−static const uint8_t obmc16[256]={
218− 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0,
219− 0, 4, 4, 8, 16, 20, 20, 24, 24, 20, 20, 16, 8, 4, 4, 0,
220− 0, 4, 16, 24, 36, 44, 52, 60, 60, 52, 44, 36, 24, 16, 4, 0,
221− 0, 8, 24, 44, 60, 80, 96,104,104, 96, 80, 60, 44, 24, 8, 0,
222− 0, 16, 36, 60, 92,116,136,152,152,136,116, 92, 60, 36, 16, 0,
223− 0, 20, 44, 80,116,152,180,196,196,180,152,116, 80, 44, 20, 0,
224− 4, 20, 52, 96,136,180,212,228,228,212,180,136, 96, 52, 20, 4,
225− 4, 24, 60,104,152,196,228,248,248,228,196,152,104, 60, 24, 4,
226− 4, 24, 60,104,152,196,228,248,248,228,196,152,104, 60, 24, 4,
227− 4, 20, 52, 96,136,180,212,228,228,212,180,136, 96, 52, 20, 4,
228− 0, 20, 44, 80,116,152,180,196,196,180,152,116, 80, 44, 20, 0,
229− 0, 16, 36, 60, 92,116,136,152,152,136,116, 92, 60, 36, 16, 0,
230− 0, 8, 24, 44, 60, 80, 96,104,104, 96, 80, 60, 44, 24, 8, 0,
231− 0, 4, 16, 24, 36, 44, 52, 60, 60, 52, 44, 36, 24, 16, 4, 0,
232− 0, 4, 4, 8, 16, 20, 20, 24, 24, 20, 20, 16, 8, 4, 4, 0,
233− 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0,
234−//error:0.000033
235−};
236−#elif 1 // 64*linear
23755 static const uint8_t obmc32[1024]={
23856 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0,
23957 0, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 16, 20, 20, 20, 24, 24, 20, 20, 20, 16, 16, 16, 12, 12, 8, 8, 8, 4, 4, 4, 0,
@@ -288,62 +106,6 @@ static const uint8_t obmc16[256]={ · 48 unmodified lines
288106 0, 4, 4, 8, 8, 12, 12, 16, 16, 12, 12, 8, 8, 4, 4, 0,
289107 //error:0.000015
290108 };
291−#else //64*cos
292−static const uint8_t obmc32[1024]={
293− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
294− 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0,
295− 0, 0, 0, 4, 4, 4, 4, 8, 8, 12, 12, 12, 12, 16, 16, 16, 16, 16, 16, 12, 12, 12, 12, 8, 8, 4, 4, 4, 4, 0, 0, 0,
296− 0, 0, 4, 4, 4, 8, 8, 12, 16, 20, 20, 24, 28, 28, 28, 28, 28, 28, 28, 28, 24, 20, 20, 16, 12, 8, 8, 4, 4, 4, 0, 0,
297− 0, 0, 4, 4, 8, 12, 16, 20, 24, 28, 36, 40, 44, 44, 48, 48, 48, 48, 44, 44, 40, 36, 28, 24, 20, 16, 12, 8, 4, 4, 0, 0,
298− 0, 0, 4, 8, 12, 20, 24, 32, 36, 44, 48, 56, 60, 64, 68, 68, 68, 68, 64, 60, 56, 48, 44, 36, 32, 24, 20, 12, 8, 4, 0, 0,
299− 0, 4, 4, 8, 16, 24, 32, 40, 48, 60, 68, 76, 80, 84, 88, 92, 92, 88, 84, 80, 76, 68, 60, 48, 40, 32, 24, 16, 8, 4, 4, 0,
300− 0, 4, 8, 12, 20, 32, 40, 52, 64, 76, 84, 96,104,108,112,116,116,112,108,104, 96, 84, 76, 64, 52, 40, 32, 20, 12, 8, 4, 0,
301− 0, 4, 8, 16, 24, 36, 48, 64, 76, 92,104,116,124,132,136,140,140,136,132,124,116,104, 92, 76, 64, 48, 36, 24, 16, 8, 4, 0,
302− 0, 4, 12, 20, 28, 44, 60, 76, 92,104,120,136,148,156,160,164,164,160,156,148,136,120,104, 92, 76, 60, 44, 28, 20, 12, 4, 0,
303− 0, 4, 12, 20, 36, 48, 68, 84,104,120,140,152,168,176,184,188,188,184,176,168,152,140,120,104, 84, 68, 48, 36, 20, 12, 4, 0,
304− 0, 4, 12, 24, 36, 56, 76, 96,116,136,152,172,184,196,204,208,208,204,196,184,172,152,136,116, 96, 76, 56, 36, 24, 12, 4, 0,
305− 0, 4, 12, 24, 44, 60, 80,104,124,148,168,184,200,212,224,228,228,224,212,200,184,168,148,124,104, 80, 60, 44, 24, 12, 4, 0,
306− 0, 4, 12, 28, 44, 64, 84,108,132,156,176,196,212,228,236,240,240,236,228,212,196,176,156,132,108, 84, 64, 44, 28, 12, 4, 0,
307− 0, 4, 16, 28, 48, 68, 88,112,136,160,184,204,224,236,244,252,252,244,236,224,204,184,160,136,112, 88, 68, 48, 28, 16, 4, 0,
308− 1, 4, 16, 28, 48, 68, 92,116,140,164,188,208,228,240,252,255,255,252,240,228,208,188,164,140,116, 92, 68, 48, 28, 16, 4, 1,
309− 1, 4, 16, 28, 48, 68, 92,116,140,164,188,208,228,240,252,255,255,252,240,228,208,188,164,140,116, 92, 68, 48, 28, 16, 4, 1,
310− 0, 4, 16, 28, 48, 68, 88,112,136,160,184,204,224,236,244,252,252,244,236,224,204,184,160,136,112, 88, 68, 48, 28, 16, 4, 0,
311− 0, 4, 12, 28, 44, 64, 84,108,132,156,176,196,212,228,236,240,240,236,228,212,196,176,156,132,108, 84, 64, 44, 28, 12, 4, 0,
312− 0, 4, 12, 24, 44, 60, 80,104,124,148,168,184,200,212,224,228,228,224,212,200,184,168,148,124,104, 80, 60, 44, 24, 12, 4, 0,
313− 0, 4, 12, 24, 36, 56, 76, 96,116,136,152,172,184,196,204,208,208,204,196,184,172,152,136,116, 96, 76, 56, 36, 24, 12, 4, 0,
314− 0, 4, 12, 20, 36, 48, 68, 84,104,120,140,152,168,176,184,188,188,184,176,168,152,140,120,104, 84, 68, 48, 36, 20, 12, 4, 0,
315− 0, 4, 12, 20, 28, 44, 60, 76, 92,104,120,136,148,156,160,164,164,160,156,148,136,120,104, 92, 76, 60, 44, 28, 20, 12, 4, 0,
316− 0, 4, 8, 16, 24, 36, 48, 64, 76, 92,104,116,124,132,136,140,140,136,132,124,116,104, 92, 76, 64, 48, 36, 24, 16, 8, 4, 0,
317− 0, 4, 8, 12, 20, 32, 40, 52, 64, 76, 84, 96,104,108,112,116,116,112,108,104, 96, 84, 76, 64, 52, 40, 32, 20, 12, 8, 4, 0,
318− 0, 4, 4, 8, 16, 24, 32, 40, 48, 60, 68, 76, 80, 84, 88, 92, 92, 88, 84, 80, 76, 68, 60, 48, 40, 32, 24, 16, 8, 4, 4, 0,
319− 0, 0, 4, 8, 12, 20, 24, 32, 36, 44, 48, 56, 60, 64, 68, 68, 68, 68, 64, 60, 56, 48, 44, 36, 32, 24, 20, 12, 8, 4, 0, 0,
320− 0, 0, 4, 4, 8, 12, 16, 20, 24, 28, 36, 40, 44, 44, 48, 48, 48, 48, 44, 44, 40, 36, 28, 24, 20, 16, 12, 8, 4, 4, 0, 0,
321− 0, 0, 4, 4, 4, 8, 8, 12, 16, 20, 20, 24, 28, 28, 28, 28, 28, 28, 28, 28, 24, 20, 20, 16, 12, 8, 8, 4, 4, 4, 0, 0,
322− 0, 0, 0, 4, 4, 4, 4, 8, 8, 12, 12, 12, 12, 16, 16, 16, 16, 16, 16, 12, 12, 12, 12, 8, 8, 4, 4, 4, 4, 0, 0, 0,
323− 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0,
324− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
325−//error:0.000022
326−};
327−static const uint8_t obmc16[256]={
328− 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
329− 0, 0, 4, 8, 12, 16, 20, 20, 20, 20, 16, 12, 8, 4, 0, 0,
330− 0, 4, 12, 24, 32, 44, 52, 56, 56, 52, 44, 32, 24, 12, 4, 0,
331− 0, 8, 24, 40, 60, 80, 96,104,104, 96, 80, 60, 40, 24, 8, 0,
332− 0, 12, 32, 64, 92,120,140,152,152,140,120, 92, 64, 32, 12, 0,
333− 4, 16, 44, 80,120,156,184,196,196,184,156,120, 80, 44, 16, 4,
334− 4, 20, 52, 96,140,184,216,232,232,216,184,140, 96, 52, 20, 4,
335− 0, 20, 56,104,152,196,232,252,252,232,196,152,104, 56, 20, 0,
336− 0, 20, 56,104,152,196,232,252,252,232,196,152,104, 56, 20, 0,
337− 4, 20, 52, 96,140,184,216,232,232,216,184,140, 96, 52, 20, 4,
338− 4, 16, 44, 80,120,156,184,196,196,184,156,120, 80, 44, 16, 4,
339− 0, 12, 32, 64, 92,120,140,152,152,140,120, 92, 64, 32, 12, 0,
340− 0, 8, 24, 40, 60, 80, 96,104,104, 96, 80, 60, 40, 24, 8, 0,
341− 0, 4, 12, 24, 32, 44, 52, 56, 56, 52, 44, 32, 24, 12, 4, 0,
342− 0, 0, 4, 8, 12, 16, 20, 20, 20, 20, 16, 12, 8, 4, 0, 0,
343− 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
344−//error:0.000022
345−};
346−#endif /* 0 */
347109
348110 //linear *64
349111 static const uint8_t obmc8[64]={
@@ -509,7 +271,6 @@ static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signe · 159 unmodified lines
509271 if(v){
510272 const int a= FFABS(v);
511273 const int e= av_log2(a);
512−#if 1
513274 const int el= FFMIN(e, 10);
514275 put_rac(c, state+0, 0);
515276
@@ -530,35 +291,6 @@ static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signe · 14 unmodified lines
530291
531292 if(is_signed)
532293 put_rac(c, state+11 + el, v < 0); //11..21
533−#else
534−
535− put_rac(c, state+0, 0);
536− if(e<=9){
537− for(i=0; i<e; i++){
538− put_rac(c, state+1+i, 1); //1..10
539− }
540− put_rac(c, state+1+i, 0);
541−
542− for(i=e-1; i>=0; i--){
543− put_rac(c, state+22+i, (a>>i)&1); //22..31
544− }
545−
546− if(is_signed)
547− put_rac(c, state+11 + e, v < 0); //11..21
548− }else{
549− for(i=0; i<e; i++){
550− put_rac(c, state+1+FFMIN(i,9), 1); //1..10
551− }
552− put_rac(c, state+1+9, 0);
553−
554− for(i=e-1; i>=0; i--){
555− put_rac(c, state+22+FFMIN(i,9), (a>>i)&1); //22..31
556− }
557−
558− if(is_signed)
559− put_rac(c, state+11 + 10, v < 0); //11..21
560− }
561−#endif /* 1 */
562294 }else{
563295 put_rac(c, state+0, 1);
564296 }
@@ -789,14 +521,6 @@ static int alloc_blocks(SnowContext *s){ · 224 unmodified lines
789521 return 0;
790522 }
791523
792−static inline void copy_rac_state(RangeCoder *d, RangeCoder *s){
793− uint8_t *bytestream= d->bytestream;
794− uint8_t *bytestream_start= d->bytestream_start;
795− *d= *s;
796− d->bytestream= bytestream;
797− d->bytestream_start= bytestream_start;
798−}
799−
800524 static inline void set_blocks(SnowContext *s, int level, int x, int y, int l, int cb, int cr, int mx, int my, int ref, int type){
801525 const int w= s->b_width << s->block_max_depth;
802526 const int rem_depth= s->block_max_depth - level;
@@ -1323,40 +1047,6 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer · 520 unmodified lines
13231047 block[3]= ptmp;
13241048 pred_block(s, block[3], tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);
13251049 }
1326−#if 0
1327− for(y=0; y<b_h; y++){
1328− for(x=0; x<b_w; x++){
1329− int v= obmc [x + y*obmc_stride] * block[3][x + y*src_stride] * (256/OBMC_MAX);
1330− if(add) dst[x + y*dst_stride] += v;
1331− else dst[x + y*dst_stride] -= v;
1332− }
1333− }
1334− for(y=0; y<b_h; y++){
1335− uint8_t *obmc2= obmc + (obmc_stride>>1);
1336− for(x=0; x<b_w; x++){
1337− int v= obmc2[x + y*obmc_stride] * block[2][x + y*src_stride] * (256/OBMC_MAX);
1338− if(add) dst[x + y*dst_stride] += v;
1339− else dst[x + y*dst_stride] -= v;
1340− }
1341− }
1342− for(y=0; y<b_h; y++){
1343− uint8_t *obmc3= obmc + obmc_stride*(obmc_stride>>1);
1344− for(x=0; x<b_w; x++){
1345− int v= obmc3[x + y*obmc_stride] * block[1][x + y*src_stride] * (256/OBMC_MAX);
1346− if(add) dst[x + y*dst_stride] += v;
1347− else dst[x + y*dst_stride] -= v;
1348− }
1349− }
1350− for(y=0; y<b_h; y++){
1351− uint8_t *obmc3= obmc + obmc_stride*(obmc_stride>>1);
1352− uint8_t *obmc4= obmc3+ (obmc_stride>>1);
1353− for(x=0; x<b_w; x++){
1354− int v= obmc4[x + y*obmc_stride] * block[0][x + y*src_stride] * (256/OBMC_MAX);
1355− if(add) dst[x + y*dst_stride] += v;
1356− else dst[x + y*dst_stride] -= v;
1357− }
1358− }
1359−#else
13601050 if(sliced){
13611051 s->dwt.inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
13621052 }else{
@@ -1387,7 +1077,6 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer · 24 unmodified lines
13871077 }
13881078 }
13891079 }
1390−#endif /* 0 */
13911080 }
13921081
13931082 static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, IDWTELEM * old_buffer, int plane_index, int add, int mb_y){
@@ -4008,6 +3697,7 @@ AVCodec ff_snow_encoder = { · 2614 unmodified lines
40083697 #undef printf
40093698
40103699 #include "libavutil/lfg.h"
3700+#include "libavutil/mathematics.h"
40113701
40123702 int main(void){
40133703 int width=256;
@@ -4042,27 +3732,6 @@ int main(void){ · 28 unmodified lines
40423732 for(i=0; i<width*height; i++)
40433733 if(FFABS(buffer[0][i] - buffer[1][i])>20) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]);
40443734
4045−#if 0
4046− printf("testing AC coder\n");
4047− memset(s.header_state, 0, sizeof(s.header_state));
4048− ff_init_range_encoder(&s.c, buffer[0], 256*256);
4049− ff_init_cabac_states(&s.c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
4050−
4051− for(i=-256; i<256; i++){
4052− put_symbol(&s.c, s.header_state, i*i*i/3*FFABS(i), 1);
4053− }
4054− ff_rac_terminate(&s.c);
4055−
4056− memset(s.header_state, 0, sizeof(s.header_state));
4057− ff_init_range_decoder(&s.c, buffer[0], 256*256);
4058− ff_init_cabac_states(&s.c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
4059−
4060− for(i=-256; i<256; i++){
4061− int j;
4062− j= get_symbol(&s.c, s.header_state, 1);
4063− if(j!=i*i*i/3*FFABS(i)) printf("fsck: %d != %d\n", i, j);
4064− }
4065−#endif
40663735 {
40673736 int level, orientation, x, y;
40683737 int64_t errors[8][4];
@@ -4120,7 +3789,6 @@ int main(void){ · 51 unmodified lines
41203789 buf+=stride>>1;
41213790
41223791 memset(buffer[0], 0, sizeof(int)*width*height);
4123−#if 1
41243792 for(y=0; y<height; y++){
41253793 for(x=0; x<width; x++){
41263794 int tab[4]={0,2,3,1};
@@ -4128,15 +3796,6 @@ int main(void){ · 1 unmodified line
41283796 }
41293797 }
41303798 ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
4131−#else
4132− for(y=0; y<h; y++){
4133− for(x=0; x<w; x++){
4134− buf[x + y*stride ]=169;
4135− buf[x + y*stride-w]=64;
4136− }
4137− }
4138− ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
4139−#endif
41403799 for(y=0; y<height; y++){
41413800 for(x=0; x<width; x++){
41423801 int64_t d= buffer[0][x + y*width];
libavcodec/svq3.c+1−1
@@ -591,7 +591,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type) · 590 unmodified lines
591591 }
592592 }
593593
594− ff_h264_write_back_intra_pred_mode(h);
594+ write_back_intra_pred_mode(h);
595595
596596 if (mb_type == 8) {
597597 ff_h264_check_intra4x4_pred_mode(h);
libavcodec/utils.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727
2828 #include "libavutil/avstring.h"
2929 #include "libavutil/crc.h"
30+#include "libavutil/mathematics.h"
3031 #include "libavutil/pixdesc.h"
3132 #include "libavutil/audioconvert.h"
3233 #include "libavutil/imgutils.h"
libavcodec/vp8.c+1−1
@@ -1039,7 +1039,7 @@ static const uint8_t subpel_idx[3][8] = { · 1038 unmodified lines
10391039 * @param s VP8 decoding context
10401040 * @param luma 1 for luma (Y) planes, 0 for chroma (Cb/Cr) planes
10411041 * @param dst target buffer for block data at block position
1042− * @param src reference picture buffer at origin (0, 0)
1042+ * @param ref reference picture buffer at origin (0, 0)
10431043 * @param mv motion vector (relative to block position) to get pixel data from
10441044 * @param x_off horizontal position of block from origin (0, 0)
10451045 * @param y_off vertical position of block from origin (0, 0)
libavcodec/x86/Makefile+1−0
@@ -47,6 +47,7 @@ MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \ · 46 unmodified lines
4747 x86/fmtconvert.o \
4848 x86/h264_chromamc.o \
4949 x86/h264_chromamc_10bit.o \
50+ x86/h264_qpel_10bit.o \
5051 $(YASM-OBJS-yes)
5152
5253 MMX-OBJS-$(CONFIG_FFT) += x86/fft.o
libavcodec/x86/dsputil_mmx.c+86−50
@@ -2530,44 +2530,56 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) · 2529 unmodified lines
25302530 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_mmx2;
25312531 }
25322532
2533−#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU) \
2534− c->PFX ## _pixels_tab[IDX][ 0] = PFX ## SIZE ## _mc00_ ## CPU; \
2535− c->PFX ## _pixels_tab[IDX][ 1] = PFX ## SIZE ## _mc10_ ## CPU; \
2536− c->PFX ## _pixels_tab[IDX][ 2] = PFX ## SIZE ## _mc20_ ## CPU; \
2537− c->PFX ## _pixels_tab[IDX][ 3] = PFX ## SIZE ## _mc30_ ## CPU; \
2538− c->PFX ## _pixels_tab[IDX][ 4] = PFX ## SIZE ## _mc01_ ## CPU; \
2539− c->PFX ## _pixels_tab[IDX][ 5] = PFX ## SIZE ## _mc11_ ## CPU; \
2540− c->PFX ## _pixels_tab[IDX][ 6] = PFX ## SIZE ## _mc21_ ## CPU; \
2541− c->PFX ## _pixels_tab[IDX][ 7] = PFX ## SIZE ## _mc31_ ## CPU; \
2542− c->PFX ## _pixels_tab[IDX][ 8] = PFX ## SIZE ## _mc02_ ## CPU; \
2543− c->PFX ## _pixels_tab[IDX][ 9] = PFX ## SIZE ## _mc12_ ## CPU; \
2544− c->PFX ## _pixels_tab[IDX][10] = PFX ## SIZE ## _mc22_ ## CPU; \
2545− c->PFX ## _pixels_tab[IDX][11] = PFX ## SIZE ## _mc32_ ## CPU; \
2546− c->PFX ## _pixels_tab[IDX][12] = PFX ## SIZE ## _mc03_ ## CPU; \
2547− c->PFX ## _pixels_tab[IDX][13] = PFX ## SIZE ## _mc13_ ## CPU; \
2548− c->PFX ## _pixels_tab[IDX][14] = PFX ## SIZE ## _mc23_ ## CPU; \
2549− c->PFX ## _pixels_tab[IDX][15] = PFX ## SIZE ## _mc33_ ## CPU
2550−
2551− SET_QPEL_FUNCS(put_qpel, 0, 16, mmx2);
2552− SET_QPEL_FUNCS(put_qpel, 1, 8, mmx2);
2553− SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmx2);
2554− SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmx2);
2555− SET_QPEL_FUNCS(avg_qpel, 0, 16, mmx2);
2556− SET_QPEL_FUNCS(avg_qpel, 1, 8, mmx2);
2533+#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX) \
2534+ c->PFX ## _pixels_tab[IDX][ 0] = PREFIX ## PFX ## SIZE ## _mc00_ ## CPU; \
2535+ c->PFX ## _pixels_tab[IDX][ 1] = PREFIX ## PFX ## SIZE ## _mc10_ ## CPU; \
2536+ c->PFX ## _pixels_tab[IDX][ 2] = PREFIX ## PFX ## SIZE ## _mc20_ ## CPU; \
2537+ c->PFX ## _pixels_tab[IDX][ 3] = PREFIX ## PFX ## SIZE ## _mc30_ ## CPU; \
2538+ c->PFX ## _pixels_tab[IDX][ 4] = PREFIX ## PFX ## SIZE ## _mc01_ ## CPU; \
2539+ c->PFX ## _pixels_tab[IDX][ 5] = PREFIX ## PFX ## SIZE ## _mc11_ ## CPU; \
2540+ c->PFX ## _pixels_tab[IDX][ 6] = PREFIX ## PFX ## SIZE ## _mc21_ ## CPU; \
2541+ c->PFX ## _pixels_tab[IDX][ 7] = PREFIX ## PFX ## SIZE ## _mc31_ ## CPU; \
2542+ c->PFX ## _pixels_tab[IDX][ 8] = PREFIX ## PFX ## SIZE ## _mc02_ ## CPU; \
2543+ c->PFX ## _pixels_tab[IDX][ 9] = PREFIX ## PFX ## SIZE ## _mc12_ ## CPU; \
2544+ c->PFX ## _pixels_tab[IDX][10] = PREFIX ## PFX ## SIZE ## _mc22_ ## CPU; \
2545+ c->PFX ## _pixels_tab[IDX][11] = PREFIX ## PFX ## SIZE ## _mc32_ ## CPU; \
2546+ c->PFX ## _pixels_tab[IDX][12] = PREFIX ## PFX ## SIZE ## _mc03_ ## CPU; \
2547+ c->PFX ## _pixels_tab[IDX][13] = PREFIX ## PFX ## SIZE ## _mc13_ ## CPU; \
2548+ c->PFX ## _pixels_tab[IDX][14] = PREFIX ## PFX ## SIZE ## _mc23_ ## CPU; \
2549+ c->PFX ## _pixels_tab[IDX][15] = PREFIX ## PFX ## SIZE ## _mc33_ ## CPU
2550+
2551+ SET_QPEL_FUNCS(put_qpel, 0, 16, mmx2, );
2552+ SET_QPEL_FUNCS(put_qpel, 1, 8, mmx2, );
2553+ SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmx2, );
2554+ SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmx2, );
2555+ SET_QPEL_FUNCS(avg_qpel, 0, 16, mmx2, );
2556+ SET_QPEL_FUNCS(avg_qpel, 1, 8, mmx2, );
25572557
25582558 if (!high_bit_depth) {
2559− SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmx2);
2560− SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmx2);
2561− SET_QPEL_FUNCS(put_h264_qpel, 2, 4, mmx2);
2562− SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmx2);
2563− SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2);
2564− SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2);
2559+ SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmx2, );
2560+ SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmx2, );
2561+ SET_QPEL_FUNCS(put_h264_qpel, 2, 4, mmx2, );
2562+ SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmx2, );
2563+ SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2, );
2564+ SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2, );
25652565 }
2566+#if HAVE_YASM
2567+ else if (bit_depth == 10) {
2568+#if !ARCH_X86_64
2569+ SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 10_mmxext, ff_);
2570+ SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 10_mmxext, ff_);
2571+ SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 10_mmxext, ff_);
2572+ SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 10_mmxext, ff_);
2573+#endif
2574+ SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 10_mmxext, ff_);
2575+ SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 10_mmxext, ff_);
2576+ }
2577+#endif
25662578
2567− SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2);
2568− SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2);
2569− SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmx2);
2570− SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmx2);
2579+ SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2, );
2580+ SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2, );
2581+ SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmx2, );
2582+ SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmx2, );
25712583
25722584 #if HAVE_YASM
25732585 c->avg_rv40_chroma_pixels_tab[0]= ff_avg_rv40_chroma_mc8_mmx2;
@@ -2627,26 +2639,26 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) · 53 unmodified lines
26272639 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_3dnow;
26282640 }
26292641
2630− SET_QPEL_FUNCS(put_qpel, 0, 16, 3dnow);
2631− SET_QPEL_FUNCS(put_qpel, 1, 8, 3dnow);
2632− SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, 3dnow);
2633− SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, 3dnow);
2634− SET_QPEL_FUNCS(avg_qpel, 0, 16, 3dnow);
2635− SET_QPEL_FUNCS(avg_qpel, 1, 8, 3dnow);
2642+ SET_QPEL_FUNCS(put_qpel, 0, 16, 3dnow, );
2643+ SET_QPEL_FUNCS(put_qpel, 1, 8, 3dnow, );
2644+ SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, 3dnow, );
2645+ SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, 3dnow, );
2646+ SET_QPEL_FUNCS(avg_qpel, 0, 16, 3dnow, );
2647+ SET_QPEL_FUNCS(avg_qpel, 1, 8, 3dnow, );
26362648
26372649 if (!high_bit_depth) {
2638− SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 3dnow);
2639− SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 3dnow);
2640− SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 3dnow);
2641− SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 3dnow);
2642− SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 3dnow);
2643− SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 3dnow);
2650+ SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 3dnow, );
2651+ SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 3dnow, );
2652+ SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 3dnow, );
2653+ SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 3dnow, );
2654+ SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 3dnow, );
2655+ SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 3dnow, );
26442656 }
26452657
2646− SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, 3dnow);
2647− SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, 3dnow);
2648− SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, 3dnow);
2649− SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, 3dnow);
2658+ SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, 3dnow, );
2659+ SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, 3dnow, );
2660+ SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, 3dnow, );
2661+ SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, 3dnow, );
26502662
26512663 #if HAVE_YASM
26522664 if (!high_bit_depth) {
@@ -2690,7 +2702,20 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) · 37 unmodified lines
26902702 H264_QPEL_FUNCS(3, 3, sse2);
26912703 }
26922704 #if HAVE_YASM
2705+#define H264_QPEL_FUNCS_10(x, y, CPU)\
2706+ c->put_h264_qpel_pixels_tab[0][x+y*4] = ff_put_h264_qpel16_mc##x##y##_10_##CPU;\
2707+ c->put_h264_qpel_pixels_tab[1][x+y*4] = ff_put_h264_qpel8_mc##x##y##_10_##CPU;\
2708+ c->avg_h264_qpel_pixels_tab[0][x+y*4] = ff_avg_h264_qpel16_mc##x##y##_10_##CPU;\
2709+ c->avg_h264_qpel_pixels_tab[1][x+y*4] = ff_avg_h264_qpel8_mc##x##y##_10_##CPU;
26932710 if (bit_depth == 10) {
2711+ SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 10_sse2, ff_);
2712+ SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 10_sse2, ff_);
2713+ SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 10_sse2, ff_);
2714+ SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 10_sse2, ff_);
2715+ H264_QPEL_FUNCS_10(1, 0, sse2_cache64)
2716+ H264_QPEL_FUNCS_10(2, 0, sse2_cache64)
2717+ H264_QPEL_FUNCS_10(3, 0, sse2_cache64)
2718+
26942719 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_10_sse2;
26952720 c->avg_h264_chroma_pixels_tab[0]= ff_avg_h264_chroma_mc8_10_sse2;
26962721 }
@@ -2712,6 +2737,11 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) · 15 unmodified lines
27122737 H264_QPEL_FUNCS(3, 2, ssse3);
27132738 H264_QPEL_FUNCS(3, 3, ssse3);
27142739 }
2740+ else if (bit_depth == 10) {
2741+ H264_QPEL_FUNCS_10(1, 0, ssse3_cache64)
2742+ H264_QPEL_FUNCS_10(2, 0, ssse3_cache64)
2743+ H264_QPEL_FUNCS_10(3, 0, ssse3_cache64)
2744+ }
27152745 #if HAVE_YASM
27162746 if (!high_bit_depth) {
27172747 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_ssse3_rnd;
@@ -2807,6 +2837,12 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) · 89 unmodified lines
28072837 #if HAVE_AVX && HAVE_YASM
28082838 if (mm_flags & AV_CPU_FLAG_AVX) {
28092839 if (bit_depth == 10) {
2840+ //AVX implies !cache64.
2841+ //TODO: Port cache(32|64) detection from x264.
2842+ H264_QPEL_FUNCS_10(1, 0, sse2)
2843+ H264_QPEL_FUNCS_10(2, 0, sse2)
2844+ H264_QPEL_FUNCS_10(3, 0, sse2)
2845+
28102846 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_10_avx;
28112847 c->avg_h264_chroma_pixels_tab[0]= ff_avg_h264_chroma_mc8_10_avx;
28122848 }
libavcodec/x86/h264_qpel_10bit.asm+891−0
@@ -0,0 +1,891 @@
1+;*****************************************************************************
2+;* MMX/SSE2/AVX-optimized 10-bit H.264 qpel code
3+;*****************************************************************************
4+;* Copyright (C) 2011 x264 project
5+;*
6+;* Authors: Daniel Kang <daniel.d.kang@gmail.com>
7+;*
8+;* This file is part of Libav.
9+;*
10+;* Libav is free software; you can redistribute it and/or
11+;* modify it under the terms of the GNU Lesser General Public
12+;* License as published by the Free Software Foundation; either
13+;* version 2.1 of the License, or (at your option) any later version.
14+;*
15+;* Libav is distributed in the hope that it will be useful,
16+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+;* Lesser General Public License for more details.
19+;*
20+;* You should have received a copy of the GNU Lesser General Public
21+;* License along with Libav; if not, write to the Free Software
22+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23+;******************************************************************************
24+
25+%include "x86inc.asm"
26+%include "x86util.asm"
27+
28+SECTION_RODATA 32
29+
30+cextern pw_16
31+cextern pw_1
32+cextern pb_0
33+
34+pw_pixel_max: times 8 dw ((1 << 10)-1)
35+
36+pad10: times 8 dw 10*1023
37+pad20: times 8 dw 20*1023
38+pad30: times 8 dw 30*1023
39+depad: times 4 dd 32*20*1023 + 512
40+depad2: times 8 dw 20*1023 + 16*1022 + 16
41+unpad: times 8 dw 16*1022/32 ; needs to be mod 16
42+
43+tap1: times 4 dw 1, -5
44+tap2: times 4 dw 20, 20
45+tap3: times 4 dw -5, 1
46+pd_0f: times 4 dd 0xffff
47+
48+SECTION .text
49+
50+
51+%macro AVG_MOV 2
52+ pavgw %2, %1
53+ mova %1, %2
54+%endmacro
55+
56+%macro ADDW 3
57+%if mmsize == 8
58+ paddw %1, %2
59+%else
60+ movu %3, %2
61+ paddw %1, %3
62+%endif
63+%endmacro
64+
65+%macro FILT_H 4
66+ paddw %1, %4
67+ psubw %1, %2 ; a-b
68+ psraw %1, 2 ; (a-b)/4
69+ psubw %1, %2 ; (a-b)/4-b
70+ paddw %1, %3 ; (a-b)/4-b+c
71+ psraw %1, 2 ; ((a-b)/4-b+c)/4
72+ paddw %1, %3 ; ((a-b)/4-b+c)/4+c = (a-5*b+20*c)/16
73+%endmacro
74+
75+%macro PRELOAD_V 0
76+ lea r3, [r2*3]
77+ sub r1, r3
78+ movu m0, [r1+r2]
79+ movu m1, [r1+r2*2]
80+ add r1, r3
81+ movu m2, [r1]
82+ movu m3, [r1+r2]
83+ movu m4, [r1+r2*2]
84+ add r1, r3
85+%endmacro
86+
87+%macro FILT_V 8
88+ movu %6, [r1]
89+ paddw %1, %6
90+ mova %7, %2
91+ paddw %7, %5
92+ mova %8, %3
93+ paddw %8, %4
94+ FILT_H %1, %7, %8, [pw_16]
95+ psraw %1, 1
96+ CLIPW %1, [pb_0], [pw_pixel_max]
97+%endmacro
98+
99+%macro MC 1
100+%define OP_MOV mova
101+INIT_MMX
102+%1 mmxext, put, 4
103+INIT_XMM
104+%1 sse2 , put, 8
105+
106+%define OP_MOV AVG_MOV
107+INIT_MMX
108+%1 mmxext, avg, 4
109+INIT_XMM
110+%1 sse2 , avg, 8
111+%endmacro
112+
113+%macro MCAxA 8
114+%ifdef ARCH_X86_64
115+%ifnidn %1,mmxext
116+MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8
117+%endif
118+%else
119+MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8
120+%endif
121+%endmacro
122+
123+%macro MCAxA_OP 8
124+cglobal %2_h264_qpel%5_%3_10_%1, %6,%7,%8
125+%ifdef ARCH_X86_32
126+ call stub_%2_h264_qpel%4_%3_10_%1
127+ mov r0, r0m
128+ mov r1, r1m
129+ add r0, %4*2
130+ add r1, %4*2
131+ call stub_%2_h264_qpel%4_%3_10_%1
132+ mov r0, r0m
133+ mov r1, r1m
134+ lea r0, [r0+r2*%4]
135+ lea r1, [r1+r2*%4]
136+ call stub_%2_h264_qpel%4_%3_10_%1
137+ mov r0, r0m
138+ mov r1, r1m
139+ lea r0, [r0+r2*%4+%4*2]
140+ lea r1, [r1+r2*%4+%4*2]
141+ call stub_%2_h264_qpel%4_%3_10_%1
142+ RET
143+%else ; ARCH_X86_64
144+ mov r10, r0
145+ mov r11, r1
146+ call stub_%2_h264_qpel%4_%3_10_%1
147+ lea r0, [r10+%4*2]
148+ lea r1, [r11+%4*2]
149+ call stub_%2_h264_qpel%4_%3_10_%1
150+ lea r0, [r10+r2*%4]
151+ lea r1, [r11+r2*%4]
152+ call stub_%2_h264_qpel%4_%3_10_%1
153+ lea r0, [r10+r2*%4+%4*2]
154+ lea r1, [r11+r2*%4+%4*2]
155+%ifndef UNIX64 ; fall through to function
156+ call stub_%2_h264_qpel%4_%3_10_%1
157+ RET
158+%endif
159+%endif
160+%endmacro
161+
162+;cpu, put/avg, mc, 4/8, ...
163+%macro cglobal_mc 7
164+%assign i %4*2
165+MCAxA %1, %2, %3, %4, i, %5,%6,%7
166+
167+cglobal %2_h264_qpel%4_%3_10_%1, %5,%6,%7
168+%ifndef UNIX64 ; no prologue or epilogue for UNIX64
169+ call stub_%2_h264_qpel%4_%3_10_%1
170+ RET
171+%endif
172+
173+stub_%2_h264_qpel%4_%3_10_%1:
174+%endmacro
175+
176+;-----------------------------------------------------------------------------
177+; void h264_qpel_mc00(uint8_t *dst, uint8_t *src, int stride)
178+;-----------------------------------------------------------------------------
179+%macro COPY4 0
180+ movu m0, [r1 ]
181+ OP_MOV [r0 ], m0
182+ movu m0, [r1+r2 ]
183+ OP_MOV [r0+r2 ], m0
184+ movu m0, [r1+r2*2]
185+ OP_MOV [r0+r2*2], m0
186+ movu m0, [r1+r3 ]
187+ OP_MOV [r0+r3 ], m0
188+%endmacro
189+
190+%macro MC00 1
191+INIT_MMX
192+cglobal_mc mmxext, %1, mc00, 4, 3,4,0
193+ lea r3, [r2*3]
194+ COPY4
195+ ret
196+
197+INIT_XMM
198+cglobal %1_h264_qpel8_mc00_10_sse2, 3,4
199+ lea r3, [r2*3]
200+ COPY4
201+ lea r0, [r0+r2*4]
202+ lea r1, [r1+r2*4]
203+ COPY4
204+ RET
205+
206+cglobal %1_h264_qpel16_mc00_10_sse2, 3,4
207+ mov r3d, 8
208+.loop:
209+ movu m0, [r1 ]
210+ movu m1, [r1 +16]
211+ OP_MOV [r0 ], m0
212+ OP_MOV [r0 +16], m1
213+ movu m0, [r1+r2 ]
214+ movu m1, [r1+r2+16]
215+ OP_MOV [r0+r2 ], m0
216+ OP_MOV [r0+r2+16], m1
217+ lea r0, [r0+r2*2]
218+ lea r1, [r1+r2*2]
219+ dec r3d
220+ jg .loop
221+ REP_RET
222+%endmacro
223+
224+%define OP_MOV mova
225+MC00 put
226+
227+%define OP_MOV AVG_MOV
228+MC00 avg
229+
230+;-----------------------------------------------------------------------------
231+; void h264_qpel_mc20(uint8_t *dst, uint8_t *src, int stride)
232+;-----------------------------------------------------------------------------
233+%macro MC_CACHE 1
234+%define OP_MOV mova
235+%define PALIGNR PALIGNR_MMX
236+INIT_MMX
237+%1 mmxext , put, 4
238+INIT_XMM
239+%1 sse2_cache64 , put, 8
240+%define PALIGNR PALIGNR_SSSE3
241+%1 ssse3_cache64, put, 8
242+%1 sse2 , put, 8, 0
243+
244+%define OP_MOV AVG_MOV
245+%define PALIGNR PALIGNR_MMX
246+INIT_MMX
247+%1 mmxext , avg, 4
248+INIT_XMM
249+%1 sse2_cache64 , avg, 8
250+%define PALIGNR PALIGNR_SSSE3
251+%1 ssse3_cache64, avg, 8
252+%1 sse2 , avg, 8, 0
253+%endmacro
254+
255+%macro MC20 3-4
256+cglobal_mc %1, %2, mc20, %3, 3,4,9
257+ mov r3d, %3
258+ mova m1, [pw_pixel_max]
259+%if num_mmregs > 8
260+ mova m8, [pw_16]
261+ %define p16 m8
262+%else
263+ %define p16 [pw_16]
264+%endif
265+.nextrow
266+%if %0 == 4
267+ movu m2, [r1-4]
268+ movu m3, [r1-2]
269+ movu m4, [r1+0]
270+ ADDW m2, [r1+6], m5
271+ ADDW m3, [r1+4], m5
272+ ADDW m4, [r1+2], m5
273+%else ; movu is slow on these processors
274+%if mmsize==16
275+ movu m2, [r1-4]
276+ movu m0, [r1+6]
277+ mova m6, m0
278+ psrldq m0, 6
279+
280+ paddw m6, m2
281+ PALIGNR m3, m0, m2, 2, m5
282+ PALIGNR m7, m0, m2, 8, m5
283+ paddw m3, m7
284+ PALIGNR m4, m0, m2, 4, m5
285+ PALIGNR m7, m0, m2, 6, m5
286+ paddw m4, m7
287+ SWAP 2, 6
288+%else
289+ movu m2, [r1-4]
290+ movu m6, [r1+4]
291+ PALIGNR m3, m6, m2, 2, m5
292+ paddw m3, m6
293+ PALIGNR m4, m6, m2, 4, m5
294+ PALIGNR m7, m6, m2, 6, m5
295+ paddw m4, m7
296+ paddw m2, [r1+6]
297+%endif
298+%endif
299+
300+ FILT_H m2, m3, m4, p16
301+ psraw m2, 1
302+ pxor m0, m0
303+ CLIPW m2, m0, m1
304+ OP_MOV [r0], m2
305+ add r0, r2
306+ add r1, r2
307+ dec r3d
308+ jg .nextrow
309+ rep ret
310+%endmacro
311+
312+MC_CACHE MC20
313+
314+;-----------------------------------------------------------------------------
315+; void h264_qpel_mc30(uint8_t *dst, uint8_t *src, int stride)
316+;-----------------------------------------------------------------------------
317+%macro MC30 3-4
318+cglobal_mc %1, %2, mc30, %3, 3,5,9
319+ lea r4, [r1+2]
320+ jmp stub_%2_h264_qpel%3_mc10_10_%1.body
321+%endmacro
322+
323+MC_CACHE MC30
324+
325+;-----------------------------------------------------------------------------
326+; void h264_qpel_mc10(uint8_t *dst, uint8_t *src, int stride)
327+;-----------------------------------------------------------------------------
328+%macro MC10 3-4
329+cglobal_mc %1, %2, mc10, %3, 3,5,9
330+ mov r4, r1
331+.body
332+ mov r3d, %3
333+ mova m1, [pw_pixel_max]
334+%if num_mmregs > 8
335+ mova m8, [pw_16]
336+ %define p16 m8
337+%else
338+ %define p16 [pw_16]
339+%endif
340+.nextrow
341+%if %0 == 4
342+ movu m2, [r1-4]
343+ movu m3, [r1-2]
344+ movu m4, [r1+0]
345+ ADDW m2, [r1+6], m5
346+ ADDW m3, [r1+4], m5
347+ ADDW m4, [r1+2], m5
348+%else ; movu is slow on these processors
349+%if mmsize==16
350+ movu m2, [r1-4]
351+ movu m0, [r1+6]
352+ mova m6, m0
353+ psrldq m0, 6
354+
355+ paddw m6, m2
356+ PALIGNR m3, m0, m2, 2, m5
357+ PALIGNR m7, m0, m2, 8, m5
358+ paddw m3, m7
359+ PALIGNR m4, m0, m2, 4, m5
360+ PALIGNR m7, m0, m2, 6, m5
361+ paddw m4, m7
362+ SWAP 2, 6
363+%else
364+ movu m2, [r1-4]
365+ movu m6, [r1+4]
366+ PALIGNR m3, m6, m2, 2, m5
367+ paddw m3, m6
368+ PALIGNR m4, m6, m2, 4, m5
369+ PALIGNR m7, m6, m2, 6, m5
370+ paddw m4, m7
371+ paddw m2, [r1+6]
372+%endif
373+%endif
374+
375+ FILT_H m2, m3, m4, p16
376+ psraw m2, 1
377+ pxor m0, m0
378+ CLIPW m2, m0, m1
379+ movu m3, [r4]
380+ pavgw m2, m3
381+ OP_MOV [r0], m2
382+ add r0, r2
383+ add r1, r2
384+ add r4, r2
385+ dec r3d
386+ jg .nextrow
387+ rep ret
388+%endmacro
389+
390+MC_CACHE MC10
391+
392+;-----------------------------------------------------------------------------
393+; void h264_qpel_mc02(uint8_t *dst, uint8_t *src, int stride)
394+;-----------------------------------------------------------------------------
395+%macro V_FILT 11
396+v_filt%9_%10_10_%11:
397+ add r4, r2
398+.no_addr4:
399+ FILT_V m0, m1, m2, m3, m4, m5, m6, m7
400+ add r1, r2
401+ add r0, r2
402+ ret
403+%endmacro
404+
405+INIT_MMX
406+RESET_MM_PERMUTATION
407+%assign i 0
408+%rep 4
409+V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 4, i, mmxext
410+SWAP 0,1,2,3,4,5
411+%assign i i+1
412+%endrep
413+
414+INIT_XMM
415+RESET_MM_PERMUTATION
416+%assign i 0
417+%rep 6
418+V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 8, i, sse2
419+SWAP 0,1,2,3,4,5
420+%assign i i+1
421+%endrep
422+
423+%macro MC02 3
424+cglobal_mc %1, %2, mc02, %3, 3,4,8
425+ PRELOAD_V
426+
427+ sub r0, r2
428+%assign j 0
429+%rep %3
430+ %assign i (j % 6)
431+ call v_filt%3_ %+ i %+ _10_%1.no_addr4
432+ OP_MOV [r0], m0
433+ SWAP 0,1,2,3,4,5
434+ %assign j j+1
435+%endrep
436+ ret
437+%endmacro
438+
439+MC MC02
440+
441+;-----------------------------------------------------------------------------
442+; void h264_qpel_mc01(uint8_t *dst, uint8_t *src, int stride)
443+;-----------------------------------------------------------------------------
444+%macro MC01 3
445+cglobal_mc %1, %2, mc01, %3, 3,5,8
446+ mov r4, r1
447+.body
448+ PRELOAD_V
449+
450+ sub r4, r2
451+ sub r0, r2
452+%assign j 0
453+%rep %3
454+ %assign i (j % 6)
455+ call v_filt%3_ %+ i %+ _10_%1
456+ movu m7, [r4]
457+ pavgw m0, m7
458+ OP_MOV [r0], m0
459+ SWAP 0,1,2,3,4,5
460+ %assign j j+1
461+%endrep
462+ ret
463+%endmacro
464+
465+MC MC01
466+
467+;-----------------------------------------------------------------------------
468+; void h264_qpel_mc03(uint8_t *dst, uint8_t *src, int stride)
469+;-----------------------------------------------------------------------------
470+%macro MC03 3
471+cglobal_mc %1, %2, mc03, %3, 3,5,8
472+ lea r4, [r1+r2]
473+ jmp stub_%2_h264_qpel%3_mc01_10_%1.body
474+%endmacro
475+
476+MC MC03
477+
478+;-----------------------------------------------------------------------------
479+; void h264_qpel_mc11(uint8_t *dst, uint8_t *src, int stride)
480+;-----------------------------------------------------------------------------
481+%macro H_FILT_AVG 3-4
482+h_filt%2_%3_10_%1:
483+;FILT_H with fewer registers and averaged with the FILT_V result
484+;m6,m7 are tmp registers, m0 is the FILT_V result, the rest are to be used next in the next iteration
485+;unfortunately I need three registers, so m5 will have to be re-read from memory
486+ movu m5, [r4-4]
487+ ADDW m5, [r4+6], m7
488+ movu m6, [r4-2]
489+ ADDW m6, [r4+4], m7
490+ paddw m5, [pw_16]
491+ psubw m5, m6 ; a-b
492+ psraw m5, 2 ; (a-b)/4
493+ psubw m5, m6 ; (a-b)/4-b
494+ movu m6, [r4+0]
495+ ADDW m6, [r4+2], m7
496+ paddw m5, m6 ; (a-b)/4-b+c
497+ psraw m5, 2 ; ((a-b)/4-b+c)/4
498+ paddw m5, m6 ; ((a-b)/4-b+c)/4+c = (a-5*b+20*c)/16
499+ psraw m5, 1
500+ CLIPW m5, [pb_0], [pw_pixel_max]
501+;avg FILT_V, FILT_H
502+ pavgw m0, m5
503+%if %0!=4
504+ movu m5, [r1+r5]
505+%endif
506+ ret
507+%endmacro
508+
509+INIT_MMX
510+RESET_MM_PERMUTATION
511+%assign i 0
512+%rep 3
513+H_FILT_AVG mmxext, 4, i
514+SWAP 0,1,2,3,4,5
515+%assign i i+1
516+%endrep
517+H_FILT_AVG mmxext, 4, i, 0
518+
519+INIT_XMM
520+RESET_MM_PERMUTATION
521+%assign i 0
522+%rep 6
523+%if i==1
524+H_FILT_AVG sse2, 8, i, 0
525+%else
526+H_FILT_AVG sse2, 8, i
527+%endif
528+SWAP 0,1,2,3,4,5
529+%assign i i+1
530+%endrep
531+
532+%macro MC11 3
533+; this REALLY needs x86_64
534+cglobal_mc %1, %2, mc11, %3, 3,6,8
535+ mov r4, r1
536+.body
537+ PRELOAD_V
538+
539+ sub r0, r2
540+ sub r4, r2
541+ mov r5, r2
542+ neg r5
543+%assign j 0
544+%rep %3
545+ %assign i (j % 6)
546+ call v_filt%3_ %+ i %+ _10_%1
547+ call h_filt%3_ %+ i %+ _10_%1
548+%if %3==8 && i==1
549+ movu m5, [r1+r5]
550+%endif
551+ OP_MOV [r0], m0
552+ SWAP 0,1,2,3,4,5
553+ %assign j j+1
554+%endrep
555+ ret
556+%endmacro
557+
558+MC MC11
559+
560+;-----------------------------------------------------------------------------
561+; void h264_qpel_mc31(uint8_t *dst, uint8_t *src, int stride)
562+;-----------------------------------------------------------------------------
563+%macro MC31 3
564+cglobal_mc %1, %2, mc31, %3, 3,6,8
565+ mov r4, r1
566+ add r1, 2
567+ jmp stub_%2_h264_qpel%3_mc11_10_%1.body
568+%endmacro
569+
570+MC MC31
571+
572+;-----------------------------------------------------------------------------
573+; void h264_qpel_mc13(uint8_t *dst, uint8_t *src, int stride)
574+;-----------------------------------------------------------------------------
575+%macro MC13 3
576+cglobal_mc %1, %2, mc13, %3, 3,7,12
577+ lea r4, [r1+r2]
578+ jmp stub_%2_h264_qpel%3_mc11_10_%1.body
579+%endmacro
580+
581+MC MC13
582+
583+;-----------------------------------------------------------------------------
584+; void h264_qpel_mc33(uint8_t *dst, uint8_t *src, int stride)
585+;-----------------------------------------------------------------------------
586+%macro MC33 3
587+cglobal_mc %1, %2, mc33, %3, 3,6,8
588+ lea r4, [r1+r2]
589+ add r1, 2
590+ jmp stub_%2_h264_qpel%3_mc11_10_%1.body
591+%endmacro
592+
593+MC MC33
594+
595+;-----------------------------------------------------------------------------
596+; void h264_qpel_mc22(uint8_t *dst, uint8_t *src, int stride)
597+;-----------------------------------------------------------------------------
598+%macro FILT_H2 3
599+ psubw %1, %2 ; a-b
600+ psubw %2, %3 ; b-c
601+ psllw %2, 2
602+ psubw %1, %2 ; a-5*b+4*c
603+ psllw %3, 4
604+ paddw %1, %3 ; a-5*b+20*c
605+%endmacro
606+
607+%macro FILT_VNRD 8
608+ movu %6, [r1]
609+ paddw %1, %6
610+ mova %7, %2
611+ paddw %7, %5
612+ mova %8, %3
613+ paddw %8, %4
614+ FILT_H2 %1, %7, %8
615+%endmacro
616+
617+%macro HV 2
618+%ifidn %1,sse2
619+%define PAD 12
620+%define COUNT 2
621+%else
622+%define PAD 0
623+%define COUNT 3
624+%endif
625+put_hv%2_10_%1:
626+ neg r2 ; This actually saves instructions
627+ lea r1, [r1+r2*2-mmsize+PAD]
628+ lea r4, [rsp+PAD+gprsize]
629+ mov r3d, COUNT
630+.v_loop:
631+ movu m0, [r1]
632+ sub r1, r2
633+ movu m1, [r1]
634+ sub r1, r2
635+ movu m2, [r1]
636+ sub r1, r2
637+ movu m3, [r1]
638+ sub r1, r2
639+ movu m4, [r1]
640+ sub r1, r2
641+%assign i 0
642+%rep %2-1
643+ FILT_VNRD m0, m1, m2, m3, m4, m5, m6, m7
644+ psubw m0, [pad20]
645+ movu [r4+i*mmsize*3], m0
646+ sub r1, r2
647+ SWAP 0,1,2,3,4,5
648+%assign i i+1
649+%endrep
650+ FILT_VNRD m0, m1, m2, m3, m4, m5, m6, m7
651+ psubw m0, [pad20]
652+ movu [r4+i*mmsize*3], m0
653+ add r4, mmsize
654+ lea r1, [r1+r2*8+mmsize]
655+%if %2==8
656+ lea r1, [r1+r2*4]
657+%endif
658+ dec r3d
659+ jg .v_loop
660+ neg r2
661+ ret
662+%endmacro
663+
664+INIT_MMX
665+HV mmxext, 4
666+INIT_XMM
667+HV sse2 , 8
668+
669+%macro H_LOOP 2
670+%if num_mmregs > 8
671+ %define s1 m8
672+ %define s2 m9
673+ %define s3 m10
674+ %define d1 m11
675+%else
676+ %define s1 [tap1]
677+ %define s2 [tap2]
678+ %define s3 [tap3]
679+ %define d1 [depad]
680+%endif
681+h%2_loop_op_%1:
682+ movu m1, [r1+mmsize-4]
683+ movu m2, [r1+mmsize-2]
684+ mova m3, [r1+mmsize+0]
685+ movu m4, [r1+mmsize+2]
686+ movu m5, [r1+mmsize+4]
687+ movu m6, [r1+mmsize+6]
688+%if num_mmregs > 8
689+ pmaddwd m1, s1
690+ pmaddwd m2, s1
691+ pmaddwd m3, s2
692+ pmaddwd m4, s2
693+ pmaddwd m5, s3
694+ pmaddwd m6, s3
695+ paddd m1, d1
696+ paddd m2, d1
697+%else
698+ mova m0, s1
699+ pmaddwd m1, m0
700+ pmaddwd m2, m0
701+ mova m0, s2
702+ pmaddwd m3, m0
703+ pmaddwd m4, m0
704+ mova m0, s3
705+ pmaddwd m5, m0
706+ pmaddwd m6, m0
707+ mova m0, d1
708+ paddd m1, m0
709+ paddd m2, m0
710+%endif
711+ paddd m3, m5
712+ paddd m4, m6
713+ paddd m1, m3
714+ paddd m2, m4
715+ psrad m1, 10
716+ psrad m2, 10
717+ pslld m2, 16
718+ pand m1, [pd_0f]
719+ por m1, m2
720+%if num_mmregs <= 8
721+ pxor m0, m0
722+%endif
723+ CLIPW m1, m0, m7
724+ add r1, mmsize*3
725+ ret
726+%endmacro
727+
728+INIT_MMX
729+H_LOOP mmxext, 4
730+INIT_XMM
731+H_LOOP sse2 , 8
732+
733+%macro MC22 3
734+cglobal_mc %1, %2, mc22, %3, 3,7,12
735+%define PAD mmsize*8*4*2 ; SIZE*16*4*sizeof(pixel)
736+ mov r6, rsp ; backup stack pointer
737+ and rsp, ~(mmsize-1) ; align stack
738+ sub rsp, PAD
739+
740+ call put_hv%3_10_%1
741+
742+ mov r3d, %3
743+ mova m7, [pw_pixel_max]
744+%if num_mmregs > 8
745+ pxor m0, m0
746+ mova m8, [tap1]
747+ mova m9, [tap2]
748+ mova m10, [tap3]
749+ mova m11, [depad]
750+%endif
751+ mov r1, rsp
752+.h_loop:
753+ call h%3_loop_op_%1
754+
755+ OP_MOV [r0], m1
756+ add r0, r2
757+ dec r3d
758+ jg .h_loop
759+
760+ mov rsp, r6 ; restore stack pointer
761+ ret
762+%endmacro
763+
764+MC MC22
765+
766+;-----------------------------------------------------------------------------
767+; void h264_qpel_mc12(uint8_t *dst, uint8_t *src, int stride)
768+;-----------------------------------------------------------------------------
769+%macro MC12 3
770+cglobal_mc %1, %2, mc12, %3, 3,7,12
771+%define PAD mmsize*8*4*2 ; SIZE*16*4*sizeof(pixel)
772+ mov r6, rsp ; backup stack pointer
773+ and rsp, ~(mmsize-1) ; align stack
774+ sub rsp, PAD
775+
776+ call put_hv%3_10_%1
777+
778+ xor r4d, r4d
779+.body
780+ mov r3d, %3
781+ pxor m0, m0
782+ mova m7, [pw_pixel_max]
783+%if num_mmregs > 8
784+ mova m8, [tap1]
785+ mova m9, [tap2]
786+ mova m10, [tap3]
787+ mova m11, [depad]
788+%endif
789+ mov r1, rsp
790+.h_loop:
791+ call h%3_loop_op_%1
792+
793+ movu m3, [r1+r4-2*mmsize] ; movu needed for mc32, etc
794+ paddw m3, [depad2]
795+ psrlw m3, 5
796+ psubw m3, [unpad]
797+ CLIPW m3, m0, m7
798+ pavgw m1, m3
799+
800+ OP_MOV [r0], m1
801+ add r0, r2
802+ dec r3d
803+ jg .h_loop
804+
805+ mov rsp, r6 ; restore stack pointer
806+ ret
807+%endmacro
808+
809+MC MC12
810+
811+;-----------------------------------------------------------------------------
812+; void h264_qpel_mc32(uint8_t *dst, uint8_t *src, int stride)
813+;-----------------------------------------------------------------------------
814+%macro MC32 3
815+cglobal_mc %1, %2, mc32, %3, 3,7,12
816+%define PAD mmsize*8*3*2 ; SIZE*16*4*sizeof(pixel)
817+ mov r6, rsp ; backup stack pointer
818+ and rsp, ~(mmsize-1) ; align stack
819+ sub rsp, PAD
820+
821+ call put_hv%3_10_%1
822+
823+ mov r4d, 2 ; sizeof(pixel)
824+ jmp stub_%2_h264_qpel%3_mc12_10_%1.body
825+%endmacro
826+
827+MC MC32
828+
829+;-----------------------------------------------------------------------------
830+; void h264_qpel_mc21(uint8_t *dst, uint8_t *src, int stride)
831+;-----------------------------------------------------------------------------
832+%macro H_NRD 2
833+put_h%2_10_%1:
834+ add rsp, gprsize
835+ mov r3d, %2
836+ xor r4d, r4d
837+ mova m6, [pad20]
838+.nextrow
839+ movu m2, [r5-4]
840+ movu m3, [r5-2]
841+ movu m4, [r5+0]
842+ ADDW m2, [r5+6], m5
843+ ADDW m3, [r5+4], m5
844+ ADDW m4, [r5+2], m5
845+
846+ FILT_H2 m2, m3, m4
847+ psubw m2, m6
848+ mova [rsp+r4], m2
849+ add r4d, mmsize*3
850+ add r5, r2
851+ dec r3d
852+ jg .nextrow
853+ sub rsp, gprsize
854+ ret
855+%endmacro
856+
857+INIT_MMX
858+H_NRD mmxext, 4
859+INIT_XMM
860+H_NRD sse2 , 8
861+
862+%macro MC21 3
863+cglobal_mc %1, %2, mc21, %3, 3,7,12
864+ mov r5, r1
865+.body
866+%define PAD mmsize*8*3*2 ; SIZE*16*4*sizeof(pixel)
867+ mov r6, rsp ; backup stack pointer
868+ and rsp, ~(mmsize-1) ; align stack
869+
870+ sub rsp, PAD
871+ call put_h%3_10_%1
872+
873+ sub rsp, PAD
874+ call put_hv%3_10_%1
875+
876+ mov r4d, PAD-mmsize ; H buffer
877+ jmp stub_%2_h264_qpel%3_mc12_10_%1.body
878+%endmacro
879+
880+MC MC21
881+
882+;-----------------------------------------------------------------------------
883+; void h264_qpel_mc23(uint8_t *dst, uint8_t *src, int stride)
884+;-----------------------------------------------------------------------------
885+%macro MC23 3
886+cglobal_mc %1, %2, mc23, %3, 3,7,12
887+ lea r5, [r1+r2]
888+ jmp stub_%2_h264_qpel%3_mc21_10_%1.body
889+%endmacro
890+
891+MC MC23
libavcodec/x86/h264_qpel_mmx.c+98−0
@@ -1,5 +1,6 @@
11 /*
22 * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
3+ * Copyright (c) 2011 Daniel Kang
34 *
45 * This file is part of FFmpeg.
56 *
@@ -1199,3 +1200,100 @@ H264_MC_816(H264_MC_HV, sse2) · 1193 unmodified lines
11991200 H264_MC_816(H264_MC_H, ssse3)
12001201 H264_MC_816(H264_MC_HV, ssse3)
12011202 #endif
1203+
1204+
1205+
1206+//10bit
1207+#define LUMA_MC_OP(OP, NUM, DEPTH, TYPE, OPT) \
1208+void ff_ ## OP ## _h264_qpel ## NUM ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT \
1209+ (uint8_t *dst, uint8_t *src, int stride);
1210+
1211+#define LUMA_MC_ALL(DEPTH, TYPE, OPT) \
1212+ LUMA_MC_OP(put, 4, DEPTH, TYPE, OPT) \
1213+ LUMA_MC_OP(avg, 4, DEPTH, TYPE, OPT) \
1214+ LUMA_MC_OP(put, 8, DEPTH, TYPE, OPT) \
1215+ LUMA_MC_OP(avg, 8, DEPTH, TYPE, OPT) \
1216+ LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
1217+ LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
1218+
1219+#define LUMA_MC_816(DEPTH, TYPE, OPT) \
1220+ LUMA_MC_OP(put, 8, DEPTH, TYPE, OPT) \
1221+ LUMA_MC_OP(avg, 8, DEPTH, TYPE, OPT) \
1222+ LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
1223+ LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
1224+
1225+LUMA_MC_ALL(10, mc00, mmxext)
1226+LUMA_MC_ALL(10, mc10, mmxext)
1227+LUMA_MC_ALL(10, mc20, mmxext)
1228+LUMA_MC_ALL(10, mc30, mmxext)
1229+LUMA_MC_ALL(10, mc01, mmxext)
1230+LUMA_MC_ALL(10, mc11, mmxext)
1231+LUMA_MC_ALL(10, mc21, mmxext)
1232+LUMA_MC_ALL(10, mc31, mmxext)
1233+LUMA_MC_ALL(10, mc02, mmxext)
1234+LUMA_MC_ALL(10, mc12, mmxext)
1235+LUMA_MC_ALL(10, mc22, mmxext)
1236+LUMA_MC_ALL(10, mc32, mmxext)
1237+LUMA_MC_ALL(10, mc03, mmxext)
1238+LUMA_MC_ALL(10, mc13, mmxext)
1239+LUMA_MC_ALL(10, mc23, mmxext)
1240+LUMA_MC_ALL(10, mc33, mmxext)
1241+
1242+LUMA_MC_816(10, mc00, sse2)
1243+LUMA_MC_816(10, mc10, sse2)
1244+LUMA_MC_816(10, mc10, sse2_cache64)
1245+LUMA_MC_816(10, mc10, ssse3_cache64)
1246+LUMA_MC_816(10, mc20, sse2)
1247+LUMA_MC_816(10, mc20, sse2_cache64)
1248+LUMA_MC_816(10, mc20, ssse3_cache64)
1249+LUMA_MC_816(10, mc30, sse2)
1250+LUMA_MC_816(10, mc30, sse2_cache64)
1251+LUMA_MC_816(10, mc30, ssse3_cache64)
1252+LUMA_MC_816(10, mc01, sse2)
1253+LUMA_MC_816(10, mc11, sse2)
1254+LUMA_MC_816(10, mc21, sse2)
1255+LUMA_MC_816(10, mc31, sse2)
1256+LUMA_MC_816(10, mc02, sse2)
1257+LUMA_MC_816(10, mc12, sse2)
1258+LUMA_MC_816(10, mc22, sse2)
1259+LUMA_MC_816(10, mc32, sse2)
1260+LUMA_MC_816(10, mc03, sse2)
1261+LUMA_MC_816(10, mc13, sse2)
1262+LUMA_MC_816(10, mc23, sse2)
1263+LUMA_MC_816(10, mc33, sse2)
1264+
1265+#define QPEL16_OPMC(OP, MC, MMX)\
1266+void ff_ ## OP ## _h264_qpel16_ ## MC ## _10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
1267+ ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst , src , stride);\
1268+ ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
1269+ src += 8*stride;\
1270+ dst += 8*stride;\
1271+ ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst , src , stride);\
1272+ ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
1273+}
1274+
1275+#define QPEL16_OP(MC, MMX)\
1276+QPEL16_OPMC(put, MC, MMX)\
1277+QPEL16_OPMC(avg, MC, MMX)
1278+
1279+#define QPEL16(MMX)\
1280+QPEL16_OP(mc00, MMX)\
1281+QPEL16_OP(mc01, MMX)\
1282+QPEL16_OP(mc02, MMX)\
1283+QPEL16_OP(mc03, MMX)\
1284+QPEL16_OP(mc10, MMX)\
1285+QPEL16_OP(mc11, MMX)\
1286+QPEL16_OP(mc12, MMX)\
1287+QPEL16_OP(mc13, MMX)\
1288+QPEL16_OP(mc20, MMX)\
1289+QPEL16_OP(mc21, MMX)\
1290+QPEL16_OP(mc22, MMX)\
1291+QPEL16_OP(mc23, MMX)\
1292+QPEL16_OP(mc30, MMX)\
1293+QPEL16_OP(mc31, MMX)\
1294+QPEL16_OP(mc32, MMX)\
1295+QPEL16_OP(mc33, MMX)
1296+
1297+#if ARCH_X86_32 // ARCH_X86_64 implies sse2+
1298+QPEL16(mmxext)
1299+#endif
libavcodec/xsubdec.c+2−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 * License along with FFmpeg; if not, write to the Free Software
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
21+
22+#include "libavutil/mathematics.h"
2123 #include "libavutil/imgutils.h"
2224 #include "avcodec.h"
2325 #include "get_bits.h"
libavdevice/alsa-audio-dec.c+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747
4848 #include <alsa/asoundlib.h>
4949 #include "libavutil/opt.h"
50+#include "libavutil/mathematics.h"
5051
5152 #include "avdevice.h"
5253 #include "alsa-audio.h"
libavfilter/avfilter.h+3−0
@@ -23,7 +23,10 @@ · 22 unmodified lines
2323 #define AVFILTER_AVFILTER_H
2424
2525 #include "libavutil/avutil.h"
26+#include "libavutil/log.h"
2627 #include "libavutil/samplefmt.h"
28+#include "libavutil/pixfmt.h"
29+#include "libavutil/rational.h"
2730
2831 #define LIBAVFILTER_VERSION_MAJOR 2
2932 #define LIBAVFILTER_VERSION_MINOR 24
libavfilter/graphparser.c+1−1
@@ -83,8 +83,8 @@ static char *parse_link_name(const char **buf, void *log_ctx) · 82 unmodified lines
8383 * Create an instance of a filter, initialize and insert it in the
8484 * filtergraph in *ctx.
8585 *
86+ * @param filt_ctx put here a filter context in case of successful creation and configuration, NULL otherwise.
8687 * @param ctx the filtergraph context
87− * @param put here a filter context in case of successful creation and configuration, NULL otherwise.
8888 * @param index an index which is supposed to be unique for each filter instance added to the filtergraph
8989 * @param filt_name the name of the filter to create
9090 * @param args the arguments provided to the filter during its initialization
libavfilter/vf_aspect.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 * aspect ratio modification video filters
2424 */
2525
26+#include "libavutil/mathematics.h"
2627 #include "avfilter.h"
2728
2829 typedef struct {
libavfilter/vf_crop.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include "libavutil/avstring.h"
3131 #include "libavutil/libm.h"
3232 #include "libavutil/imgutils.h"
33+#include "libavutil/mathematics.h"
3334
3435 static const char *var_names[] = {
3536 "E",
libavfilter/vf_overlay.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include "libavutil/avstring.h"
3131 #include "libavutil/pixdesc.h"
3232 #include "libavutil/imgutils.h"
33+#include "libavutil/mathematics.h"
3334 #include "internal.h"
3435
3536 static const char *var_names[] = {
libavfilter/vf_pad.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "libavutil/avassert.h"
3333 #include "libavutil/imgutils.h"
3434 #include "libavutil/parseutils.h"
35+#include "libavutil/mathematics.h"
3536 #include "drawutils.h"
3637
3738 static const char *var_names[] = {
libavfilter/vf_scale.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include "avfilter.h"
2727 #include "libavutil/avstring.h"
2828 #include "libavutil/eval.h"
29+#include "libavutil/mathematics.h"
2930 #include "libavutil/pixdesc.h"
3031 #include "libavutil/avassert.h"
3132 #include "libswscale/swscale.h"
libavfilter/vf_setpts.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 /* #define DEBUG */
2828
2929 #include "libavutil/eval.h"
30+#include "libavutil/mathematics.h"
3031 #include "avfilter.h"
3132
3233 static const char *var_names[] = {
libavfilter/vf_settb.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #include "libavutil/avstring.h"
2727 #include "libavutil/eval.h"
28+#include "libavutil/mathematics.h"
2829 #include "libavutil/rational.h"
2930 #include "avfilter.h"
3031 #include "internal.h"
libavfilter/vsrc_color.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include "libavutil/pixdesc.h"
2828 #include "libavutil/colorspace.h"
2929 #include "libavutil/imgutils.h"
30+#include "libavutil/mathematics.h"
3031 #include "libavutil/parseutils.h"
3132 #include "drawutils.h"
3233
libavfilter/vsrc_nullsrc.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #include "libavutil/avstring.h"
2525 #include "libavutil/eval.h"
26+#include "libavutil/mathematics.h"
2627 #include "libavutil/parseutils.h"
2728 #include "avfilter.h"
2829
libavformat/4xm.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 */
2929
3030 #include "libavutil/intreadwrite.h"
31+#include "libavutil/intfloat_readwrite.h"
3132 #include "avformat.h"
3233
3334 #define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
libavformat/a64.c+0−1
@@ -55,7 +55,6 @@ static int a64_write_header(struct AVFormatContext *s) · 54 unmodified lines
5555 break;
5656 default:
5757 return AVERROR(EINVAL);
58− break;
5958 }
6059 avio_write(s->pb, header, 2);
6160 c->prev_pkt.size = 0;
libavformat/aiffenc.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/intfloat_readwrite.h"
2223 #include "avformat.h"
2324 #include "aiff.h"
2425 #include "avio_internal.h"
libavformat/applehttp.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727
2828 #include "libavutil/avstring.h"
2929 #include "libavutil/intreadwrite.h"
30+#include "libavutil/mathematics.h"
3031 #include "libavutil/opt.h"
3132 #include "libavutil/dict.h"
3233 #include "avformat.h"
libavformat/asfdec.c+2−5
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include "libavutil/common.h"
2626 #include "libavutil/avstring.h"
2727 #include "libavutil/dict.h"
28+#include "libavutil/mathematics.h"
2829 #include "libavcodec/mpegaudio.h"
2930 #include "avformat.h"
3031 #include "avio_internal.h"
@@ -84,13 +85,11 @@ static const ff_asf_guid index_guid = { · 53 unmodified lines
8485 0x90, 0x08, 0x00, 0x33, 0xb1, 0xe5, 0xcf, 0x11, 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb
8586 };
8687
88+#ifdef DEBUG
8789 static const ff_asf_guid stream_bitrate_guid = { /* (http://get.to/sdp) */
8890 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2
8991 };
90−/**********************************/
91−/* decoding */
9292
93−#ifdef DEBUG
9493 #define PRINT_IF_GUID(g,cmp) \
9594 if (!ff_guidcmp(g, &cmp)) \
9695 av_dlog(NULL, "(GUID: %s) ", #cmp)
@@ -1094,8 +1093,6 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) · 997 unmodified lines
10941093 assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1);
10951094 asf->packet_time_start = 0;
10961095 }
1097−
1098− return 0;
10991096 }
11001097
11011098 // Added to support seeking after packets have been read
libavformat/assdec.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/mathematics.h"
2223 #include "avformat.h"
2324 #include "internal.h"
2425
libavformat/audiointerleave.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 */
2222
2323 #include "libavutil/fifo.h"
24+#include "libavutil/mathematics.h"
2425 #include "avformat.h"
2526 #include "audiointerleave.h"
2627 #include "internal.h"
libavformat/avformat.h+1−0
@@ -41,6 +41,7 @@ const char *avformat_license(void); · 40 unmodified lines
4141 #include <stdio.h> /* FILE */
4242 #include "libavcodec/avcodec.h"
4343 #include "libavutil/dict.h"
44+#include "libavutil/log.h"
4445
4546 #include "avio.h"
4647 #include "libavformat/version.h"
libavformat/avidec.c+8−11
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 #include <strings.h>
2323 #include "libavutil/intreadwrite.h"
24+#include "libavutil/mathematics.h"
2425 #include "libavutil/bswap.h"
2526 #include "libavutil/opt.h"
2627 #include "libavutil/dict.h"
@@ -1289,20 +1290,16 @@ static int avi_load_index(AVFormatContext *s) · 1262 unmodified lines
12891290 (tag >> 16) & 0xff,
12901291 (tag >> 24) & 0xff,
12911292 size);
1292− switch(tag) {
1293− case MKTAG('i', 'd', 'x', '1'):
1294− if (avi_read_idx1(s, size) < 0)
1295− goto skip;
1293+
1294+ if (tag == MKTAG('i', 'd', 'x', '1') &&
1295+ avi_read_idx1(s, size) >= 0) {
12961296 ret = 0;
1297− goto the_end;
1298− break;
1299− default:
1300− skip:
1301− size += (size & 1);
1302− if (avio_skip(pb, size) < 0)
1303− goto the_end; // something is wrong here
13041297 break;
13051298 }
1299+
1300+ size += (size & 1);
1301+ if (avio_skip(pb, size) < 0)
1302+ break; // something is wrong here
13061303 }
13071304 the_end:
13081305 avio_seek(pb, pos, SEEK_SET);
libavformat/bethsoftvid.c+0−2
@@ -220,8 +220,6 @@ static int vid_read_packet(AVFormatContext *s, · 219 unmodified lines
220220 av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
221221 block_type, block_type, block_type); return -1;
222222 }
223−
224− return 0;
225223 }
226224
227225 AVInputFormat ff_bethsoftvid_demuxer = {
libavformat/cafdec.c+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include "riff.h"
3030 #include "isom.h"
3131 #include "libavutil/intreadwrite.h"
32+#include "libavutil/intfloat_readwrite.h"
3233 #include "libavutil/dict.h"
3334 #include "caf.h"
3435
libavformat/cafenc.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include "riff.h"
2525 #include "isom.h"
2626 #include "avio_internal.h"
27+#include "libavutil/intfloat_readwrite.h"
2728
2829 typedef struct {
2930 int64_t data;
libavformat/dv.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "avformat.h"
3333 #include "libavcodec/dvdata.h"
3434 #include "libavutil/intreadwrite.h"
35+#include "libavutil/mathematics.h"
3536 #include "dv.h"
3637
3738 struct DVDemuxContext {
libavformat/dvenc.c+1−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 #include "libavcodec/dvdata.h"
3636 #include "dv.h"
3737 #include "libavutil/fifo.h"
38+#include "libavutil/mathematics.h"
3839
3940 struct DVMuxContext {
4041 const DVprofile* sys; /* current DV profile, e.g.: 525/60, 625/50 */
libavformat/ffmdec.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "libavutil/intreadwrite.h"
23+#include "libavutil/intfloat_readwrite.h"
2324 #include "avformat.h"
2425 #include "ffm.h"
2526 #if CONFIG_FFSERVER
libavformat/ffmenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "libavutil/intreadwrite.h"
23+#include "libavutil/intfloat_readwrite.h"
2324 #include "avformat.h"
2425 #include "ffm.h"
2526
libavformat/ffmetadec.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/mathematics.h"
2223 #include "avformat.h"
2324 #include "ffmeta.h"
2425 #include "internal.h"
libavformat/flvdec.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626
2727 #include "libavutil/avstring.h"
2828 #include "libavutil/dict.h"
29+#include "libavutil/intfloat_readwrite.h"
2930 #include "libavcodec/bytestream.h"
3031 #include "libavcodec/mpeg4audio.h"
3132 #include "avformat.h"
libavformat/flvenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "libavutil/intreadwrite.h"
23+#include "libavutil/intfloat_readwrite.h"
2324 #include "avformat.h"
2425 #include "flv.h"
2526 #include "internal.h"
libavformat/gxfenc.c+2−0
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/intfloat_readwrite.h"
23+#include "libavutil/mathematics.h"
2224 #include "avformat.h"
2325 #include "gxf.h"
2426 #include "riff.h"
libavformat/idroqdec.c+0−1
@@ -209,7 +209,6 @@ static int roq_read_packet(AVFormatContext *s, · 208 unmodified lines
209209 default:
210210 av_log(s, AV_LOG_ERROR, " unknown RoQ chunk (%04X)\n", chunk_type);
211211 return AVERROR_INVALIDDATA;
212− break;
213212 }
214213 }
215214
libavformat/internal.h+2−2
@@ -155,14 +155,14 @@ void ff_put_v(AVIOContext *bc, uint64_t val); · 154 unmodified lines
155155
156156 /**
157157 * Read a whole line of text from AVIOContext. Stop reading after reaching
158− * either a \n, a \0 or EOF. The returned string is always \0 terminated,
158+ * either a \\n, a \\0 or EOF. The returned string is always \\0-terminated,
159159 * and may be truncated if the buffer is too small.
160160 *
161161 * @param s the read-only AVIOContext
162162 * @param buf buffer to store the read line
163163 * @param maxlen size of the buffer
164164 * @return the length of the string written in the buffer, not including the
165− * final \0
165+ * final \\0
166166 */
167167 int ff_get_line(AVIOContext *s, char *buf, int maxlen);
168168
libavformat/matroskaenc.c+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 #include "avlanguage.h"
2929 #include "libavutil/samplefmt.h"
3030 #include "libavutil/intreadwrite.h"
31+#include "libavutil/intfloat_readwrite.h"
32+#include "libavutil/mathematics.h"
3133 #include "libavutil/random_seed.h"
3234 #include "libavutil/lfg.h"
3335 #include "libavutil/dict.h"
libavformat/mm.c+0−2
@@ -184,8 +184,6 @@ static int read_packet(AVFormatContext *s, · 183 unmodified lines
184184 avio_skip(pb, length);
185185 }
186186 }
187−
188− return 0;
189187 }
190188
191189 AVInputFormat ff_mm_demuxer = {
libavformat/mmsh.c+0−1
@@ -208,7 +208,6 @@ static int get_http_header_data(MMSHContext *mmsh) · 207 unmodified lines
208208 }
209209 }
210210 }
211− return 0;
212211 }
213212
214213 static int mmsh_open(URLContext *h, const char *uri, int flags)
libavformat/mov.c+2−1
@@ -26,6 +26,8 @@ · 25 unmodified lines
2626 //#define MOV_EXPORT_ALL_METADATA
2727
2828 #include "libavutil/intreadwrite.h"
29+#include "libavutil/intfloat_readwrite.h"
30+#include "libavutil/mathematics.h"
2931 #include "libavutil/avstring.h"
3032 #include "libavutil/dict.h"
3133 #include "avformat.h"
@@ -2327,7 +2329,6 @@ static int mov_probe(AVProbeData *p) · 2295 unmodified lines
23272329 return score;
23282330 }
23292331 }
2330− return score;
23312332 }
23322333
23332334 // must be done after parsing all trak because there's no order requirement
libavformat/movenc.c+2−0
@@ -32,6 +32,8 @@ · 31 unmodified lines
3232 #include "libavcodec/put_bits.h"
3333 #include "internal.h"
3434 #include "libavutil/avstring.h"
35+#include "libavutil/intfloat_readwrite.h"
36+#include "libavutil/mathematics.h"
3537 #include "libavutil/opt.h"
3638 #include "libavutil/dict.h"
3739 #include "rtpenc.h"
libavformat/mp3dec.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include "libavutil/avstring.h"
2323 #include "libavutil/intreadwrite.h"
2424 #include "libavutil/dict.h"
25+#include "libavutil/mathematics.h"
2526 #include "avformat.h"
2627 #include "id3v2.h"
2728 #include "id3v1.h"
libavformat/mpegenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "libavutil/fifo.h"
23+#include "libavutil/mathematics.h"
2324 #include "libavcodec/put_bits.h"
2425 #include "avformat.h"
2526 #include "mpeg.h"
libavformat/mpegtsenc.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include "libavutil/bswap.h"
2323 #include "libavutil/crc.h"
2424 #include "libavutil/dict.h"
25+#include "libavutil/mathematics.h"
2526 #include "libavutil/opt.h"
2627 #include "libavcodec/mpegvideo.h"
2728 #include "avformat.h"
libavformat/mxfdec.c+1−0
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 //#define DEBUG
4747
4848 #include "libavutil/aes.h"
49+#include "libavutil/mathematics.h"
4950 #include "libavcodec/bytestream.h"
5051 #include "avformat.h"
5152 #include "mxf.h"
libavformat/nsvdec.c+2−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 * License along with FFmpeg; if not, write to the Free Software
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
21+
22+#include "libavutil/mathematics.h"
2123 #include "avformat.h"
2224 #include "riff.h"
2325 #include "libavutil/dict.h"
libavformat/nut.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/mathematics.h"
2223 #include "libavutil/tree.h"
2324 #include "nut.h"
2425 #include "internal.h"
libavformat/nutdec.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include "libavutil/avstring.h"
2525 #include "libavutil/bswap.h"
2626 #include "libavutil/dict.h"
27+#include "libavutil/mathematics.h"
2728 #include "libavutil/tree.h"
2829 #include "avio_internal.h"
2930 #include "nut.h"
libavformat/nutenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "libavutil/intreadwrite.h"
23+#include "libavutil/mathematics.h"
2324 #include "libavutil/tree.h"
2425 #include "libavutil/dict.h"
2526 #include "libavcodec/mpegaudiodata.h"
libavformat/nuv.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "libavutil/intreadwrite.h"
23+#include "libavutil/intfloat_readwrite.h"
2324 #include "avformat.h"
2425 #include "riff.h"
2526
libavformat/oggenc.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 #include "libavutil/crc.h"
2323 #include "libavutil/opt.h"
24+#include "libavutil/mathematics.h"
2425 #include "libavutil/random_seed.h"
2526 #include "libavcodec/xiph.h"
2627 #include "libavcodec/bytestream.h"
libavformat/oma.c+0−1
@@ -149,7 +149,6 @@ static int oma_read_header(AVFormatContext *s, · 148 unmodified lines
149149 default:
150150 av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n",buf[32]);
151151 return -1;
152− break;
153152 }
154153
155154 st->codec->block_align = framesize;
libavformat/pcm.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/mathematics.h"
2223 #include "avformat.h"
2324 #include "pcm.h"
2425
libavformat/psxstr.c+0−1
@@ -234,7 +234,6 @@ static int str_read_packet(AVFormatContext *s, · 233 unmodified lines
234234 pkt->stream_index =
235235 str->channels[channel].audio_stream_index;
236236 return 0;
237− break;
238237 default:
239238 av_log(s, AV_LOG_WARNING, "Unknown sector type %02X\n", sector[0x12]);
240239 /* drop the sector and move on */
libavformat/r3d.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #include "libavutil/intreadwrite.h"
2525 #include "libavutil/dict.h"
26+#include "libavutil/mathematics.h"
2627 #include "avformat.h"
2728
2829 typedef struct {
libavformat/riff.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/mathematics.h"
2223 #include "libavcodec/avcodec.h"
2324 #include "avformat.h"
2425 #include "avio_internal.h"
libavformat/rl2.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 */
3535
3636 #include "libavutil/intreadwrite.h"
37+#include "libavutil/mathematics.h"
3738 #include "avformat.h"
3839
3940 #define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr, palette
libavformat/rtmppkt.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 #include "libavcodec/bytestream.h"
2323 #include "libavutil/avstring.h"
24+#include "libavutil/intfloat_readwrite.h"
2425 #include "avformat.h"
2526
2627 #include "rtmppkt.h"
libavformat/rtmpproto.c+1−1
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626
2727 #include "libavcodec/bytestream.h"
2828 #include "libavutil/avstring.h"
29+#include "libavutil/intfloat_readwrite.h"
2930 #include "libavutil/lfg.h"
3031 #include "libavutil/sha.h"
3132 #include "avformat.h"
@@ -761,7 +762,6 @@ static int get_packet(URLContext *s, int for_header) · 729 unmodified lines
761762 }
762763 ff_rtmp_packet_destroy(&rpkt);
763764 }
764− return 0;
765765 }
766766
767767 static int rtmp_close(URLContext *h)
libavformat/rtpdec.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/mathematics.h"
2223 #include "libavcodec/get_bits.h"
2324 #include "avformat.h"
2425 #include "mpegts.h"
libavformat/rtpenc.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include "avformat.h"
2323 #include "mpegts.h"
2424 #include "internal.h"
25+#include "libavutil/mathematics.h"
2526 #include "libavutil/random_seed.h"
2627 #include "libavutil/opt.h"
2728
libavformat/rtsp.c+6−13
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include "libavutil/base64.h"
2323 #include "libavutil/avstring.h"
2424 #include "libavutil/intreadwrite.h"
25+#include "libavutil/mathematics.h"
2526 #include "libavutil/parseutils.h"
2627 #include "libavutil/random_seed.h"
2728 #include "libavutil/dict.h"
@@ -428,11 +429,6 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, · 400 unmodified lines
428429 }
429430 }
430431
431−/**
432− * Parse the sdp description and allocate the rtp streams and the
433− * pollfd array used for udp ones.
434− */
435−
436432 int ff_sdp_parse(AVFormatContext *s, const char *content)
437433 {
438434 RTSPState *rt = s->priv_data;
@@ -1050,9 +1046,6 @@ retry: · 611 unmodified lines
10501046 return 0;
10511047 }
10521048
1053−/**
1054− * @return 0 on success, <0 on error, 1 if protocol is unavailable.
1055− */
10561049 int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
10571050 int lower_transport, const char *real_challenge)
10581051 {
@@ -1078,7 +1071,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 19 unmodified lines
10781071 for (j = RTSP_RTP_PORT_MIN, i = 0; i < rt->nb_rtsp_streams; ++i) {
10791072 char transport[2048];
10801073
1081− /**
1074+ /*
10821075 * WMS serves all UDP data over a single connection, the RTX, which
10831076 * isn't necessarily the first in the SDP but has to be the first
10841077 * to be set up, else the second/third SETUP will fail with a 461.
@@ -1151,7 +1144,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 66 unmodified lines
11511144
11521145 /* RTP/TCP */
11531146 else if (lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
1154− /** For WMS streams, the application streams are only used for
1147+ /* For WMS streams, the application streams are only used for
11551148 * UDP. When trying to set it up for TCP streams, the server
11561149 * will return an error. Therefore, we skip those streams. */
11571150 if (rt->server_type == RTSP_SERVER_WMS &&
@@ -1482,14 +1475,14 @@ redirect: · 324 unmodified lines
14821475 cmd[0] = 0;
14831476 if (rt->server_type == RTSP_SERVER_REAL)
14841477 av_strlcat(cmd,
1485− /**
1478+ /*
14861479 * The following entries are required for proper
14871480 * streaming from a Realmedia server. They are
14881481 * interdependent in some way although we currently
14891482 * don't quite understand how. Values were copied
14901483 * from mplayer SVN r23589.
1491− * @param CompanyID is a 16-byte ID in base64
1492− * @param ClientChallenge is a 16-byte ID in hex
1484+ * ClientChallenge is a 16-byte ID in hex
1485+ * CompanyID is a 16-byte ID in base64
14931486 */
14941487 "ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n"
14951488 "PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n"
libavformat/rtsp.h+4−2
@@ -505,8 +505,9 @@ int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply); · 504 unmodified lines
505505 int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr);
506506
507507 /**
508− * Parse a SDP description of streams by populating an RTSPState struct
509− * within the AVFormatContext.
508+ * Parse an SDP description of streams by populating an RTSPState struct
509+ * within the AVFormatContext; also allocate the RTP streams and the
510+ * pollfd array used for UDP streams.
510511 */
511512 int ff_sdp_parse(AVFormatContext *s, const char *content);
512513
@@ -525,6 +526,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt); · 12 unmodified lines
525526 /**
526527 * Do the SETUP requests for each stream for the chosen
527528 * lower transport mode.
529+ * @return 0 on success, <0 on error, 1 if protocol is unavailable
528530 */
529531 int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
530532 int lower_transport, const char *real_challenge);
libavformat/rtspdec.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121
2222 #include "libavutil/avstring.h"
2323 #include "libavutil/intreadwrite.h"
24+#include "libavutil/mathematics.h"
2425 #include "libavutil/opt.h"
2526 #include "avformat.h"
2627
libavformat/seek.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 */
2222
2323 #include "seek.h"
24+#include "libavutil/mathematics.h"
2425 #include "libavutil/mem.h"
2526 #include "internal.h"
2627
libavformat/soxdec.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 */
3131
3232 #include "libavutil/intreadwrite.h"
33+#include "libavutil/intfloat_readwrite.h"
3334 #include "libavutil/dict.h"
3435 #include "avformat.h"
3536 #include "pcm.h"
libavformat/soxenc.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 */
3131
3232 #include "libavutil/intreadwrite.h"
33+#include "libavutil/intfloat_readwrite.h"
3334 #include "libavutil/dict.h"
3435 #include "avformat.h"
3536 #include "avio_internal.h"
libavformat/swfdec.c+0−1
@@ -204,7 +204,6 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) · 203 unmodified lines
204204 skip:
205205 avio_skip(pb, len);
206206 }
207− return 0;
208207 }
209208
210209 AVInputFormat ff_swf_demuxer = {
libavformat/thp.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include "libavutil/intreadwrite.h"
23+#include "libavutil/intfloat_readwrite.h"
2324 #include "avformat.h"
2425
2526 typedef struct ThpDemuxContext {
libavformat/utils.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "metadata.h"
3333 #include "id3v2.h"
3434 #include "libavutil/avstring.h"
35+#include "libavutil/mathematics.h"
3536 #include "riff.h"
3637 #include "audiointerleave.h"
3738 #include "url.h"
libavformat/vqf.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include "avformat.h"
2323 #include "libavutil/intreadwrite.h"
2424 #include "libavutil/dict.h"
25+#include "libavutil/mathematics.h"
2526
2627 typedef struct VqfContext {
2728 int frame_bit_len;
libavformat/wav.c+2−0
@@ -22,6 +22,8 @@ · 21 unmodified lines
2222 * License along with FFmpeg; if not, write to the Free Software
2323 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2424 */
25+
26+#include "libavutil/mathematics.h"
2527 #include "avformat.h"
2628 #include "avio_internal.h"
2729 #include "pcm.h"
libavformat/wc3movie.c+0−1
@@ -152,7 +152,6 @@ static int wc3_read_header(AVFormatContext *s, · 151 unmodified lines
152152 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24),
153153 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24));
154154 return AVERROR_INVALIDDATA;
155− break;
156155 }
157156
158157 fourcc_tag = avio_rl32(pb);
libavformat/wtvdec.c+1−1
@@ -716,7 +716,7 @@ enum { · 715 unmodified lines
716716 * Parse WTV chunks
717717 * @param mode SEEK_TO_DATA or SEEK_TO_PTS
718718 * @param seekts timestamp
719− * @param[out] len Length of data chunk
719+ * @param[out] len_ptr Length of data chunk
720720 * @return stream index of data chunk, or <0 on error
721721 */
722722 static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_ptr)
libavutil/aes.c+31−20
@@ -54,6 +54,12 @@ static uint32_t enc_multbl[4][256]; · 53 unmodified lines
5454 static uint32_t dec_multbl[4][256];
5555 #endif
5656
57+#if HAVE_BIGENDIAN
58+# define ROT(x, s) ((x >> s) | (x << (32-s)))
59+#else
60+# define ROT(x, s) ((x << s) | (x >> (32-s)))
61+#endif
62+
5763 static inline void addkey(av_aes_block *dst, const av_aes_block *src,
5864 const av_aes_block *round_key)
5965 {
@@ -86,7 +92,6 @@ static void subshift(av_aes_block s0[2], int s, const uint8_t *box) · 26 unmodified lines
8692
8793 static inline int mix_core(uint32_t multbl[][256], int a, int b, int c, int d){
8894 #if CONFIG_SMALL
89−#define ROT(x,s) ((x<<s)|(x>>(32-s)))
9095 return multbl[0][a] ^ ROT(multbl[0][b], 8) ^ ROT(multbl[0][c], 16) ^ ROT(multbl[0][d], 24);
9196 #else
9297 return multbl[0][a] ^ multbl[1][b] ^ multbl[2][c] ^ multbl[3][d];
@@ -127,7 +132,7 @@ void av_aes_crypt(AVAES *a, uint8_t *dst_, const uint8_t *src_, · 34 unmodified lines
127132 crypt(a, 0, inv_sbox, dec_multbl);
128133 if (iv) {
129134 addkey(&a->state[0], &a->state[0], iv);
130− memcpy(iv, src, 16);
135+ *iv = *src;
131136 }
132137 addkey(dst, &a->state[0], &a->round_key[0]);
133138 } else {
@@ -136,29 +141,36 @@ void av_aes_crypt(AVAES *a, uint8_t *dst_, const uint8_t *src_, · 2 unmodified lines
136141 crypt(a, 2, sbox, enc_multbl);
137142 addkey(dst, &a->state[0], &a->round_key[0]);
138143 if (iv)
139− memcpy(iv, dst, 16);
144+ *iv = *dst;
140145 }
141146 src++;
142147 dst++;
143148 }
144149 }
145150
146−static void init_multbl2(uint8_t tbl[1024], const int c[4],
151+static void init_multbl2(uint32_t tbl[][256], const int c[4],
147152 const uint8_t *log8, const uint8_t *alog8,
148153 const uint8_t *sbox)
149154 {
150− int i, j;
151−
152− for (i = 0; i < 1024; i++) {
153− int x = sbox[i >> 2];
154− if (x)
155− tbl[i] = alog8[log8[x] + log8[c[i & 3]]];
156− }
155+ int i;
156+
157+ for (i = 0; i < 256; i++) {
158+ int x = sbox[i];
159+ if (x) {
160+ int k, l, m, n;
161+ x = log8[x];
162+ k = alog8[x + log8[c[0]]];
163+ l = alog8[x + log8[c[1]]];
164+ m = alog8[x + log8[c[2]]];
165+ n = alog8[x + log8[c[3]]];
166+ tbl[0][i] = AV_NE(MKBETAG(k,l,m,n), MKTAG(k,l,m,n));
157167 #if !CONFIG_SMALL
158− for (j = 256; j < 1024; j++)
159− for (i = 0; i < 4; i++)
160− tbl[4*j + i] = tbl[4*j + ((i - 1) & 3) - 1024];
168+ tbl[1][i] = ROT(tbl[0][i], 8);
169+ tbl[2][i] = ROT(tbl[0][i], 16);
170+ tbl[3][i] = ROT(tbl[0][i], 24);
161171 #endif
172+ }
173+ }
162174 }
163175
164176 // this is based on the reference AES code by Paulo Barreto and Vincent Rijmen
@@ -187,9 +199,9 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt) · 22 unmodified lines
187199 inv_sbox[j] = i;
188200 sbox[i] = j;
189201 }
190− init_multbl2(dec_multbl[0], (const int[4]) { 0xe, 0x9, 0xd, 0xb },
202+ init_multbl2(dec_multbl, (const int[4]) { 0xe, 0x9, 0xd, 0xb },
191203 log8, alog8, inv_sbox);
192− init_multbl2(enc_multbl[0], (const int[4]) { 0x2, 0x1, 0x1, 0x3 },
204+ init_multbl2(enc_multbl, (const int[4]) { 0x2, 0x1, 0x1, 0x3 },
193205 log8, alog8, sbox);
194206 }
195207
@@ -221,15 +233,14 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt) · 25 unmodified lines
221233 if (decrypt) {
222234 for (i = 1; i < rounds; i++) {
223235 av_aes_block tmp[3];
224− memcpy(&tmp[2], &a->round_key[i], 16);
236+ tmp[2] = a->round_key[i];
225237 subshift(&tmp[1], 0, sbox);
226238 mix(tmp, dec_multbl, 1, 3);
227− memcpy(&a->round_key[i], &tmp[0], 16);
239+ a->round_key[i] = tmp[0];
228240 }
229241 } else {
230242 for (i = 0; i < (rounds + 1) >> 1; i++) {
231− for (j = 0; j < 16; j++)
232− FFSWAP(int, a->round_key[i].u8[j], a->round_key[rounds-i].u8[j]);
243+ FFSWAP(av_aes_block, a->round_key[i], a->round_key[rounds-i]);
233244 }
234245 }
235246
libavutil/avutil.h+0−4
@@ -126,9 +126,5 @@ char av_get_picture_type_char(enum AVPictureType pict_type); · 125 unmodified lines
126126 #include "common.h"
127127 #include "error.h"
128128 #include "mathematics.h"
129−#include "rational.h"
130−#include "intfloat_readwrite.h"
131−#include "log.h"
132−#include "pixfmt.h"
133129
134130 #endif /* AVUTIL_AVUTIL_H */
libavutil/des.c+3−1
@@ -39,6 +39,7 @@ static const uint8_t IP_shuffle[] = { · 38 unmodified lines
3939 };
4040 #undef T
4141
42+#if defined(CONFIG_SMALL) || defined(GENTABLES)
4243 #define T(a, b, c, d) 32-a,32-b,32-c,32-d
4344 static const uint8_t P_shuffle[] = {
4445 T(16, 7, 20, 21),
@@ -51,6 +52,7 @@ static const uint8_t P_shuffle[] = { · 6 unmodified lines
5152 T(22, 11, 4, 25)
5253 };
5354 #undef T
55+#endif
5456
5557 #define T(a, b, c, d, e, f, g) 64-a,64-b,64-c,64-d,64-e,64-f,64-g
5658 static const uint8_t PC1_shuffle[] = {
@@ -402,7 +404,7 @@ int main(void) { · 345 unmodified lines
402404 printf("Partial Monte-Carlo test failed\n");
403405 return 1;
404406 }
405− for (i = 0; i < 1000000; i++) {
407+ for (i = 0; i < 1000; i++) {
406408 key[0] = rand64(); key[1] = rand64(); key[2] = rand64();
407409 data = rand64();
408410 av_des_init(&d, key, 192, 0);
libavutil/eval.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828
2929 #include "avutil.h"
3030 #include "eval.h"
31+#include "log.h"
3132
3233 typedef struct Parser {
3334 const AVClass *class;
libavutil/file.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 */
1818
1919 #include "file.h"
20+#include "log.h"
2021 #include <fcntl.h>
2122 #include <sys/stat.h>
2223 #include <unistd.h>
libavutil/imgutils.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #include "imgutils.h"
2525 #include "internal.h"
26+#include "log.h"
2627 #include "pixdesc.h"
2728
2829 void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
libavutil/imgutils.h+3−3
@@ -69,7 +69,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt · 68 unmodified lines
6969 *
7070 * @param data pointers array to be filled with the pointer for each image plane
7171 * @param ptr the pointer to a buffer which will contain the image
72− * @param linesizes[4] the array containing the linesize for each
72+ * @param linesizes the array containing the linesize for each
7373 * plane, should be filled by av_image_fill_linesizes()
7474 * @return the size in bytes required for the image buffer, a negative
7575 * error code in case of failure
@@ -106,8 +106,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, · 30 unmodified lines
106106 /**
107107 * Copy image in src_data to dst_data.
108108 *
109− * @param dst_linesize linesizes for the image in dst_data
110− * @param src_linesize linesizes for the image in src_data
109+ * @param dst_linesizes linesizes for the image in dst_data
110+ * @param src_linesizes linesizes for the image in src_data
111111 */
112112 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
113113 const uint8_t *src_data[4], const int src_linesizes[4],
libavutil/lfg.h+1−1
@@ -55,7 +55,7 @@ static inline unsigned int av_mlfg_get(AVLFG *c){ · 54 unmodified lines
5555 * Get the next two numbers generated by a Box-Muller Gaussian
5656 * generator using the random numbers issued by lfg.
5757 *
58− * @param out[2] array where the two generated numbers are placed
58+ * @param out array where the two generated numbers are placed
5959 */
6060 void av_bmg_get(AVLFG *lfg, double out[2]);
6161
libavutil/md5.c+79−57
@@ -30,8 +30,9 @@ · 29 unmodified lines
3030 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
3131 */
3232
33−#include <string.h>
33+#include <stdint.h>
3434 #include "bswap.h"
35+#include "intreadwrite.h"
3536 #include "md5.h"
3637
3738 typedef struct AVMD5{
@@ -40,7 +41,7 @@ typedef struct AVMD5{ · 2 unmodified lines
4041 uint32_t ABCD[4];
4142 } AVMD5;
4243
43−const int av_md5_size= sizeof(AVMD5);
44+const int av_md5_size = sizeof(AVMD5);
4445
4546 static const uint8_t S[4][4] = {
4647 { 7, 12, 17, 22 }, /* round 1 */
@@ -71,42 +72,49 @@ static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32) · 24 unmodified lines
7172 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
7273 };
7374
74−#define CORE(i, a, b, c, d) \
75− t = S[i>>4][i&3];\
76− a += T[i];\
77−\
78− if(i<32){\
79− if(i<16) a += (d ^ (b&(c^d))) + X[ i &15 ];\
80− else a += (c ^ (d&(c^b))) + X[ (1+5*i)&15 ];\
81− }else{\
82− if(i<48) a += (b^c^d) + X[ (5+3*i)&15 ];\
83− else a += (c^(b|~d)) + X[ ( 7*i)&15 ];\
84− }\
85− a = b + (( a << t ) | ( a >> (32 - t) ));
86−
87−static void body(uint32_t ABCD[4], uint32_t X[16]){
88−
75+#define CORE(i, a, b, c, d) do { \
76+ t = S[i >> 4][i & 3]; \
77+ a += T[i]; \
78+ \
79+ if (i < 32) { \
80+ if (i < 16) a += (d ^ (b & (c ^ d))) + X[ i & 15]; \
81+ else a += (c ^ (d & (c ^ b))) + X[(1 + 5*i) & 15]; \
82+ } else { \
83+ if (i < 48) a += (b ^ c ^ d) + X[(5 + 3*i) & 15]; \
84+ else a += (c ^ (b | ~d)) + X[( 7*i) & 15]; \
85+ } \
86+ a = b + (a << t | a >> (32 - t)); \
87+ } while (0)
88+
89+static void body(uint32_t ABCD[4], uint32_t X[16])
90+{
8991 int t;
9092 int i av_unused;
91− unsigned int a= ABCD[3];
92− unsigned int b= ABCD[2];
93− unsigned int c= ABCD[1];
94− unsigned int d= ABCD[0];
93+ unsigned int a = ABCD[3];
94+ unsigned int b = ABCD[2];
95+ unsigned int c = ABCD[1];
96+ unsigned int d = ABCD[0];
9597
9698 #if HAVE_BIGENDIAN
97− for(i=0; i<16; i++)
98− X[i]= av_bswap32(X[i]);
99+ for (i = 0; i < 16; i++)
100+ X[i] = av_bswap32(X[i]);
99101 #endif
100102
101103 #if CONFIG_SMALL
102− for( i = 0; i < 64; i++ ){
103− CORE(i,a,b,c,d)
104− t=d; d=c; c=b; b=a; a=t;
104+ for (i = 0; i < 64; i++) {
105+ CORE(i, a, b, c, d);
106+ t = d;
107+ d = c;
108+ c = b;
109+ b = a;
110+ a = t;
105111 }
106112 #else
107−#define CORE2(i) CORE(i,a,b,c,d) CORE((i+1),d,a,b,c) CORE((i+2),c,d,a,b) CORE((i+3),b,c,d,a)
108−#define CORE4(i) CORE2(i) CORE2((i+4)) CORE2((i+8)) CORE2((i+12))
109−CORE4(0) CORE4(16) CORE4(32) CORE4(48)
113+#define CORE2(i) \
114+ CORE( i, a,b,c,d); CORE((i+1),d,a,b,c); \
115+ CORE((i+2),c,d,a,b); CORE((i+3),b,c,d,a)
116+#define CORE4(i) CORE2(i); CORE2((i+4)); CORE2((i+8)); CORE2((i+12))
117+ CORE4(0); CORE4(16); CORE4(32); CORE4(48);
110118 #endif
111119
112120 ABCD[0] += d;
@@ -115,8 +123,9 @@ CORE4(0) CORE4(16) CORE4(32) CORE4(48) · 2 unmodified lines
115123 ABCD[3] += a;
116124 }
117125
118−void av_md5_init(AVMD5 *ctx){
119− ctx->len = 0;
126+void av_md5_init(AVMD5 *ctx)
127+{
128+ ctx->len = 0;
120129
121130 ctx->ABCD[0] = 0x10325476;
122131 ctx->ABCD[1] = 0x98badcfe;
@@ -124,59 +133,72 @@ void av_md5_init(AVMD5 *ctx){ · 1 unmodified line
124133 ctx->ABCD[3] = 0x67452301;
125134 }
126135
127−void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len){
136+void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len)
137+{
128138 int i, j;
129139
130− j= ctx->len & 63;
140+ j = ctx->len & 63;
131141 ctx->len += len;
132142
133− for( i = 0; i < len; i++ ){
143+ for (i = 0; i < len; i++) {
134144 ctx->block[j++] = src[i];
135− if( 64 == j ){
136− body(ctx->ABCD, (uint32_t*) ctx->block);
145+ if (j == 64) {
146+ body(ctx->ABCD, (uint32_t *) ctx->block);
137147 j = 0;
138148 }
139149 }
140150 }
141151
142−void av_md5_final(AVMD5 *ctx, uint8_t *dst){
152+void av_md5_final(AVMD5 *ctx, uint8_t *dst)
153+{
143154 int i;
144− uint64_t finalcount= av_le2ne64(ctx->len<<3);
155+ uint64_t finalcount = av_le2ne64(ctx->len << 3);
145156
146157 av_md5_update(ctx, "\200", 1);
147− while((ctx->len & 63)!=56)
158+ while ((ctx->len & 63) != 56)
148159 av_md5_update(ctx, "", 1);
149160
150− av_md5_update(ctx, (uint8_t*)&finalcount, 8);
161+ av_md5_update(ctx, (uint8_t *)&finalcount, 8);
151162
152− for(i=0; i<4; i++)
153− ((uint32_t*)dst)[i]= av_le2ne32(ctx->ABCD[3-i]);
163+ for (i = 0; i < 4; i++)
164+ AV_WL32(dst + 4*i, ctx->ABCD[3 - i]);
154165 }
155166
156−void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){
157− AVMD5 ctx[1];
167+void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len)
168+{
169+ AVMD5 ctx;
158170
159− av_md5_init(ctx);
160− av_md5_update(ctx, src, len);
161− av_md5_final(ctx, dst);
171+ av_md5_init(&ctx);
172+ av_md5_update(&ctx, src, len);
173+ av_md5_final(&ctx, dst);
162174 }
163175
164176 #ifdef TEST
165−#include <stdio.h>
166−#include <inttypes.h>
167177 #undef printf
178+#include <stdio.h>
179+
180+static void print_md5(uint8_t *md5)
181+{
182+ int i;
183+ for (i = 0; i < 16; i++)
184+ printf("%02x", md5[i]);
185+ printf("\n");
186+}
187+
168188 int main(void){
169− uint64_t md5val;
189+ uint8_t md5val[16];
170190 int i;
171191 uint8_t in[1000];
172192
173− for(i=0; i<1000; i++) in[i]= i*i;
174− av_md5_sum( (uint8_t*)&md5val, in, 1000); printf("%"PRId64"\n", md5val);
175− av_md5_sum( (uint8_t*)&md5val, in, 63); printf("%"PRId64"\n", md5val);
176− av_md5_sum( (uint8_t*)&md5val, in, 64); printf("%"PRId64"\n", md5val);
177− av_md5_sum( (uint8_t*)&md5val, in, 65); printf("%"PRId64"\n", md5val);
178− for(i=0; i<1000; i++) in[i]= i % 127;
179− av_md5_sum( (uint8_t*)&md5val, in, 999); printf("%"PRId64"\n", md5val);
193+ for (i = 0; i < 1000; i++)
194+ in[i] = i * i;
195+ av_md5_sum(md5val, in, 1000); print_md5(md5val);
196+ av_md5_sum(md5val, in, 63); print_md5(md5val);
197+ av_md5_sum(md5val, in, 64); print_md5(md5val);
198+ av_md5_sum(md5val, in, 65); print_md5(md5val);
199+ for (i = 0; i < 1000; i++)
200+ in[i] = i % 127;
201+ av_md5_sum(md5val, in, 999); print_md5(md5val);
180202
181203 return 0;
182204 }
libavutil/opt.c+1−1
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include "opt.h"
3131 #include "eval.h"
3232 #include "dict.h"
33+#include "log.h"
3334
3435 #if FF_API_FIND_OPT
3536 //FIXME order them and do a bin search
@@ -195,7 +196,6 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons · 159 unmodified lines
195196 return 0;
196197 notfirst=1;
197198 }
198− return AVERROR(EINVAL);
199199 }
200200
201201 if (alloc) {
libavutil/parseutils.c+1−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include "avstring.h"
2929 #include "avutil.h"
3030 #include "eval.h"
31+#include "log.h"
3132 #include "random_seed.h"
3233 #include "parseutils.h"
3334
@@ -462,7 +463,6 @@ const char *small_strptime(const char *p, const char *fmt, · 428 unmodified lines
462463 p++;
463464 }
464465 }
465− return p;
466466 }
467467
468468 static time_t mktimegm(struct tm *tm)
libpostproc/postprocess_internal.h+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828
2929 #include <string.h>
3030 #include "libavutil/avutil.h"
31+#include "libavutil/log.h"
3132 #include "postprocess.h"
3233
3334 #define V_DEBLOCK 0x01
libswscale/swscale.h+2−1
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 */
2929
3030 #include "libavutil/avutil.h"
31+#include "libavutil/log.h"
32+#include "libavutil/pixfmt.h"
3133
3234 #define LIBSWSCALE_VERSION_MAJOR 2
3335 #define LIBSWSCALE_VERSION_MINOR 0
@@ -247,7 +249,6 @@ int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[], · 213 unmodified lines
247249
248250 /**
249251 * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
250− * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235
251252 * @return -1 if not supported
252253 */
253254 int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
libswscale/swscale_internal.h+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 #endif
2929
3030 #include "libavutil/avutil.h"
31+#include "libavutil/log.h"
32+#include "libavutil/pixfmt.h"
3133
3234 #define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long
3335
tests/Makefile+1−0
@@ -43,6 +43,7 @@ include $(SRC_PATH)/tests/fate/amrnb.mak · 42 unmodified lines
4343 include $(SRC_PATH)/tests/fate/amrwb.mak
4444 include $(SRC_PATH)/tests/fate/fft.mak
4545 include $(SRC_PATH)/tests/fate/h264.mak
46+include $(SRC_PATH)/tests/fate/libavutil.mak
4647 include $(SRC_PATH)/tests/fate/mp3.mak
4748 include $(SRC_PATH)/tests/fate/vorbis.mak
4849 include $(SRC_PATH)/tests/fate/vp8.mak
tests/fate/libavutil.mak+30−0
@@ -0,0 +1,30 @@
1+FATE_TESTS += fate-adler32
2+fate-adler32: libavutil/adler32-test$(EXESUF)
3+fate-adler32: CMD = run libavutil/adler32-test
4+fate-adler32: REF = /dev/null
5+
6+FATE_TESTS += fate-aes
7+fate-aes: libavutil/aes-test$(EXESUF)
8+fate-aes: CMD = run libavutil/aes-test
9+fate-aes: REF = /dev/null
10+
11+FATE_TESTS += fate-base64
12+fate-base64: libavutil/base64-test$(EXESUF)
13+fate-base64: CMD = run libavutil/base64-test
14+
15+FATE_TESTS += fate-crc
16+fate-crc: libavutil/crc-test$(EXESUF)
17+fate-crc: CMD = run libavutil/crc-test
18+
19+FATE_TESTS += fate-des
20+fate-des: libavutil/des-test$(EXESUF)
21+fate-des: CMD = run libavutil/des-test
22+fate-des: REF = /dev/null
23+
24+FATE_TESTS += fate-md5
25+fate-md5: libavutil/md5-test$(EXESUF)
26+fate-md5: CMD = run libavutil/md5-test
27+
28+FATE_TESTS += fate-sha
29+fate-sha: libavutil/sha-test$(EXESUF)
30+fate-sha: CMD = run libavutil/sha-test
tests/fate2.mak+0−18
@@ -213,24 +213,6 @@ fate-mjpegb: CMD = framecrc -idct simple -flags +bitexact -i $(SAMPLES)/mjpegb/m · 212 unmodified lines
213213 FATE_TESTS += fate-rv30
214214 fate-rv30: CMD = framecrc -flags +bitexact -dct fastint -idct simple -i $(SAMPLES)/real/rv30.rm -an
215215
216−FATE_TESTS += fate-sha
217−fate-sha: libavutil/sha-test$(EXESUF)
218−fate-sha: CMD = run libavutil/sha-test
219−
220−FATE_TESTS += fate-adler32
221−fate-adler32: libavutil/adler32-test$(EXESUF)
222−fate-adler32: CMD = run libavutil/adler32-test
223−fate-adler32: REF = /dev/null
224−
225−FATE_TESTS += fate-aes
226−fate-aes: libavutil/aes-test$(EXESUF)
227−fate-aes: CMD = run libavutil/aes-test
228−fate-aes: REF = /dev/null
229−
230−FATE_TESTS += fate-base64
231−fate-base64: libavutil/base64-test$(EXESUF)
232−fate-base64: CMD = run libavutil/base64-test
233−
234216 FATE_TESTS += fate-musepack7
235217 fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc
236218 fate-musepack7: CMP = oneoff
tests/ref/fate/crc+4−0
@@ -0,0 +1,4 @@
1+crc EDB88320 =3D5CDD04
2+crc 04C11DB7 =E0BAF5C0
3+crc 00008005 =BB1F
4+crc 00000007 =E3
tests/ref/fate/md5+5−0
@@ -0,0 +1,5 @@
1+0bf1bcc8a1d72e2cf58d42182b637e56
2+993a3eb298e52aca83ecfbb6a766b4d0
3+07c01ca7c733475fad38c84c56f305c1
4+9fc8404827cac26385f48f4f58fd32ce
5+a22bfef14302c5ca46e0ae91092bc0e0
tests/seek_test.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <string.h>
2626
2727 #include "libavutil/common.h"
28+#include "libavutil/mathematics.h"
2829 #include "libavformat/avformat.h"
2930
3031 #undef exit

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t