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.61# Doxyfile 1.7.1
2 2
3# This file describes the settings to be used by the documentation system3# This file describes the settings to be used by the documentation system
4# doxygen (www.doxygen.org) for a project4# doxygen (www.doxygen.org) for a project
@@ -54,11 +54,11 @@ CREATE_SUBDIRS = NO · 49 unmodified lines
54# information to generate all constant output in the proper language.54# information to generate all constant output in the proper language.
55# The default language is English, other supported languages are:55# The default language is English, other supported languages are:
56# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,56# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
57# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,57# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
58# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),58# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
59# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,59# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
60# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,60# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
61# and Ukrainian.61# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
62 62
63OUTPUT_LANGUAGE = English63OUTPUT_LANGUAGE = English
64 64
@@ -155,13 +155,6 @@ QT_AUTOBRIEF = NO · 90 unmodified lines
155 155
156MULTILINE_CPP_IS_BRIEF = NO156MULTILINE_CPP_IS_BRIEF = NO
157 157
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
163DETAILS_AT_TOP = NO
164
165# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented158# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
166# member inherits the documentation from any documented member that it159# member inherits the documentation from any documented member that it
167# re-implements.160# re-implements.
@@ -214,6 +207,18 @@ OPTIMIZE_FOR_FORTRAN = NO · 46 unmodified lines
214 207
215OPTIMIZE_OUTPUT_VHDL = NO208OPTIMIZE_OUTPUT_VHDL = NO
216 209
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
220EXTENSION_MAPPING =
221
217# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want222# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
218# to include (a tag file for) the STL sources as input, then you should223# to include (a tag file for) the STL sources as input, then you should
219# set this tag to YES in order to let doxygen match functions declarations and224# set this tag to YES in order to let doxygen match functions declarations and
@@ -268,6 +273,22 @@ SUBGROUPING = YES · 48 unmodified lines
268 273
269TYPEDEF_HIDES_STRUCT = NO274TYPEDEF_HIDES_STRUCT = NO
270 275
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
290SYMBOL_CACHE_SIZE = 0
291
271#---------------------------------------------------------------------------292#---------------------------------------------------------------------------
272# Build related configuration options293# Build related configuration options
273#---------------------------------------------------------------------------294#---------------------------------------------------------------------------
@@ -366,6 +387,12 @@ HIDE_SCOPE_NAMES = NO · 92 unmodified lines
366 387
367SHOW_INCLUDE_FILES = YES388SHOW_INCLUDE_FILES = YES
368 389
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
394FORCE_LOCAL_INCLUDES = NO
395
369# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]396# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
370# is inserted in the documentation for inline members.397# is inserted in the documentation for inline members.
371 398
@@ -385,6 +412,16 @@ SORT_MEMBER_DOCS = YES · 13 unmodified lines
385 412
386SORT_BRIEF_DOCS = NO413SORT_BRIEF_DOCS = NO
387 414
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
423SORT_MEMBERS_CTORS_1ST = NO
424
388# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the425# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
389# hierarchy of group names into alphabetical order. If set to NO (the default)426# hierarchy of group names into alphabetical order. If set to NO (the default)
390# the group names will appear in their defined order.427# the group names will appear in their defined order.
@@ -459,7 +496,8 @@ SHOW_DIRECTORIES = NO · 68 unmodified lines
459SHOW_FILES = YES496SHOW_FILES = YES
460 497
461# Set the SHOW_NAMESPACES tag to NO to disable the generation of the498# 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 Index499# Namespaces page.
500# This will remove the Namespaces entry from the Quick Index
463# and from the Folder Tree View (if specified). The default is YES.501# and from the Folder Tree View (if specified). The default is YES.
464 502
465SHOW_NAMESPACES = YES503SHOW_NAMESPACES = YES
@@ -474,6 +512,15 @@ SHOW_NAMESPACES = YES · 8 unmodified lines
474 512
475FILE_VERSION_FILTER =513FILE_VERSION_FILTER =
476 514
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
522LAYOUT_FILE =
523
477#---------------------------------------------------------------------------524#---------------------------------------------------------------------------
478# configuration options related to warning and progress messages525# configuration options related to warning and progress messages
479#---------------------------------------------------------------------------526#---------------------------------------------------------------------------
@@ -577,7 +624,8 @@ EXCLUDE_SYMLINKS = NO · 97 unmodified lines
577# against the file with absolute path, so to exclude all test directories624# against the file with absolute path, so to exclude all test directories
578# for example use the pattern */test/*625# for example use the pattern */test/*
579 626
580EXCLUDE_PATTERNS = *.git *.d627EXCLUDE_PATTERNS = *.git \
628 *.d
581 629
582# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names630# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
583# (namespaces, classes, functions, etc.) that should be excluded from the631# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -591,7 +639,8 @@ EXCLUDE_SYMBOLS = · 7 unmodified lines
591# directories that contain example code fragments that are included (see639# directories that contain example code fragments that are included (see
592# the \include command).640# the \include command).
593 641
594EXAMPLE_PATH = libavcodec/ libavformat/642EXAMPLE_PATH = libavcodec/ \
643 libavformat/
595 644
596# If the value of the EXAMPLE_PATH tag contains directories, you can use the645# If the value of the EXAMPLE_PATH tag contains directories, you can use the
597# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp646# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -618,14 +667,17 @@ IMAGE_PATH = · 20 unmodified lines
618# by executing (via popen()) the command <filter> <input-file>, where <filter>667# by executing (via popen()) the command <filter> <input-file>, where <filter>
619# is the value of the INPUT_FILTER tag, and <input-file> is the name of an668# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
620# input file. Doxygen will then use the output that the filter program writes669# 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 be670# to standard output.
671# If FILTER_PATTERNS is specified, this tag will be
622# ignored.672# ignored.
623 673
624INPUT_FILTER =674INPUT_FILTER =
625 675
626# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern676# 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 the677# basis.
628# filter if there is a match. The filters are a list of the form: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:
629# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further681# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
630# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER682# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
631# is applied to all files.683# is applied to all files.
@@ -675,7 +727,8 @@ REFERENCES_RELATION = NO · 43 unmodified lines
675# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)727# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
676# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from728# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
677# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will729# 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.
679 732
680REFERENCES_LINK_SOURCE = YES733REFERENCES_LINK_SOURCE = YES
681 734
@@ -758,18 +811,50 @@ HTML_FOOTER = · 76 unmodified lines
758 811
759HTML_STYLESHEET =812HTML_STYLESHEET =
760 813
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
822HTML_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
828HTML_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
837HTML_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
843HTML_TIMESTAMP = YES
844
761# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,845# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
762# files or namespaces will be aligned in HTML using tables. If set to846# files or namespaces will be aligned in HTML using tables. If set to
763# NO a bullet list will be used.847# NO a bullet list will be used.
764 848
765HTML_ALIGN_MEMBERS = YES849HTML_ALIGN_MEMBERS = YES
766 850
767# If the GENERATE_HTMLHELP tag is set to YES, additional index files851# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
768# will be generated that can be used as input for tools like the852# documentation will contain sections that can be hidden and shown after the
769# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)853# page has loaded. For this to work a browser that supports
770# of the generated HTML documentation.854# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
855# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
771 856
772GENERATE_HTMLHELP = NO857HTML_DYNAMIC_SECTIONS = NO
773 858
774# If the GENERATE_DOCSET tag is set to YES, additional index files859# If the GENERATE_DOCSET tag is set to YES, additional index files
775# will be generated that can be used as input for Apple's Xcode 3860# will be generated that can be used as input for Apple's Xcode 3
@@ -779,6 +864,8 @@ GENERATE_HTMLHELP = NO · 3 unmodified lines
779# directory and running "make install" will install the docset in864# directory and running "make install" will install the docset in
780# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find865# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
781# it at startup.866# it at startup.
867# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
868# for more information.
782 869
783GENERATE_DOCSET = NO870GENERATE_DOCSET = NO
784 871
@@ -796,13 +883,22 @@ DOCSET_FEEDNAME = "Doxygen generated docs" · 11 unmodified lines
796 883
797DOCSET_BUNDLE_ID = org.doxygen.Project884DOCSET_BUNDLE_ID = org.doxygen.Project
798 885
799# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML886# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
800# documentation will contain sections that can be hidden and shown after the887# the documentation publisher. This should be a reverse domain-name style
801# page has loaded. For this to work a browser that supports888# string, e.g. com.mycompany.MyDocSet.documentation.
802# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
803# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
804 889
805HTML_DYNAMIC_SECTIONS = NO890DOCSET_PUBLISHER_ID = org.doxygen.Publisher
891
892# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
893
894DOCSET_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
901GENERATE_HTMLHELP = NO
806 902
807# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can903# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
808# be used to specify the file name of the resulting .chm file. You904# be used to specify the file name of the resulting .chm file. You
@@ -841,6 +937,76 @@ BINARY_TOC = NO · 32 unmodified lines
841 937
842TOC_EXPAND = NO938TOC_EXPAND = NO
843 939
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
945GENERATE_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
951QCH_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
957QHP_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
963QHP_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
969QHP_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
976QHP_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
984QHP_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
991QHG_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
1002GENERATE_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
1008ECLIPSE_DOC_ID = org.doxygen.Project
1009
844# The DISABLE_INDEX tag can be used to turn on/off the condensed index at1010# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
845# top of each HTML page. The value NO (the default) enables the index and1011# top of each HTML page. The value NO (the default) enables the index and
846# the value YES disables it.1012# the value YES disables it.
@@ -854,27 +1020,30 @@ ENUM_VALUES_PER_LINE = 4 · 7 unmodified lines
854 1020
855# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index1021# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
856# structure should be generated to display hierarchical information.1022# structure should be generated to display hierarchical information.
857# If the tag value is set to FRAME, a side panel will be generated1023# If the tag value is set to YES, a side panel will be generated
858# containing a tree-like index structure (just like the one that1024# containing a tree-like index structure (just like the one that
859# is generated for HTML Help). For this to work a browser that supports1025# 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+,1026# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
861# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are1027# Windows users are probably better off using the HTML help feature.
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.
869 1028
870GENERATE_TREEVIEW = NO1029GENERATE_TREEVIEW = NO
871 1030
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
1034USE_INLINE_TREES = NO
1035
872# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be1036# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
873# used to set the initial width (in pixels) of the frame in which the tree1037# used to set the initial width (in pixels) of the frame in which the tree
874# is shown.1038# is shown.
875 1039
876TREEVIEW_WIDTH = 2501040TREEVIEW_WIDTH = 250
877 1041
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
1045EXT_LINKS_IN_WINDOW = NO
1046
878# Use this tag to change the font size of Latex formulas included1047# Use this tag to change the font size of Latex formulas included
879# as images in the HTML documentation. The default is 10. Note that1048# as images in the HTML documentation. The default is 10. Note that
880# when you change the font size after a successful doxygen run you need1049# when you change the font size after a successful doxygen run you need
@@ -883,6 +1052,34 @@ TREEVIEW_WIDTH = 250 · 2 unmodified lines
883 1052
884FORMULA_FONTSIZE = 101053FORMULA_FONTSIZE = 10
885 1054
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
1061FORMULA_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
1071SEARCHENGINE = 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
1081SERVER_BASED_SEARCH = NO
1082
886#---------------------------------------------------------------------------1083#---------------------------------------------------------------------------
887# configuration options related to the LaTeX output1084# configuration options related to the LaTeX output
888#---------------------------------------------------------------------------1085#---------------------------------------------------------------------------
@@ -900,6 +1097,9 @@ LATEX_OUTPUT = latex · 11 unmodified lines
900 1097
901# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be1098# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
902# invoked. If left blank `latex' will be used as the default command name.1099# 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.
903 1103
904LATEX_CMD_NAME = latex1104LATEX_CMD_NAME = latex
905 1105
@@ -959,6 +1159,13 @@ LATEX_BATCHMODE = NO · 53 unmodified lines
959 1159
960LATEX_HIDE_INDICES = NO1160LATEX_HIDE_INDICES = NO
961 1161
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
1167LATEX_SOURCE_CODE = NO
1168
962#---------------------------------------------------------------------------1169#---------------------------------------------------------------------------
963# configuration options related to the RTF output1170# configuration options related to the RTF output
964#---------------------------------------------------------------------------1171#---------------------------------------------------------------------------
@@ -1095,8 +1302,10 @@ GENERATE_PERLMOD = NO · 130 unmodified lines
1095PERLMOD_LATEX = NO1302PERLMOD_LATEX = NO
1096 1303
1097# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be1304# 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 useful1305# nicely formatted so it can be parsed by a human reader.
1099# if you want to understand what is going on. On the other hand, if this1306# This is useful
1307# if you want to understand what is going on.
1308# On the other hand, if this
1100# tag is set to NO the size of the Perl module output will be much smaller1309# tag is set to NO the size of the Perl module output will be much smaller
1101# and Perl will parse it just the same.1310# and Perl will parse it just the same.
1102 1311
@@ -1158,17 +1367,22 @@ INCLUDE_FILE_PATTERNS = · 55 unmodified lines
1158# undefined via #undef or recursively expanded use the := operator1367# undefined via #undef or recursively expanded use the := operator
1159# instead of the = operator.1368# instead of the = operator.
1160 1369
1161PREDEFINED = __attribute__(x)="" "RENAME(x)=x ## _TMPL" "DEF(x)=x ## _TMPL" \1370PREDEFINED = "__attribute__(x)=" \
1162 HAVE_AV_CONFIG_H HAVE_MMX HAVE_MMX2 HAVE_AMD3DNOW \1371 "RENAME(x)=x ## _TMPL" \
1163 "DECLARE_ALIGNED(a,t,n)=t n" "offsetof(x,y)=0x42" \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"
1164 1379
1165# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then1380# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
1166# this tag can be used to specify a list of macro names that should be expanded.1381# this tag can be used to specify a list of macro names that should be expanded.
1167# The macro definition that is found in the sources will be used.1382# The macro definition that is found in the sources will be used.
1168# Use the PREDEFINED tag if you want to use a different macro definition.1383# Use the PREDEFINED tag if you want to use a different macro definition.
1169 1384
1170#EXPAND_AS_DEFINED = FF_COMMON_FRAME1385EXPAND_AS_DEFINED = declare_idct
1171EXPAND_AS_DEFINED = declare_idct(idct, table, idct_row_head, idct_row, idct_row_tail, idct_row_mid)
1172 1386
1173# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then1387# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
1174# doxygen's preprocessor will remove all function-like macros that are alone1388# doxygen's preprocessor will remove all function-like macros that are alone
@@ -1186,9 +1400,11 @@ SKIP_FUNCTION_MACROS = YES · 11 unmodified lines
1186# Optionally an initial location of the external documentation1400# Optionally an initial location of the external documentation
1187# can be added for each tagfile. The format of a tag file without1401# can be added for each tagfile. The format of a tag file without
1188# this location is as follows:1402# this location is as follows:
1189# TAGFILES = file1 file2 ...1403#
1404# TAGFILES = file1 file2 ...
1190# Adding location for the tag files is done as follows:1405# Adding location for the tag files is done as follows:
1191# TAGFILES = file1=loc1 "file2 = loc2" ...1406#
1407# TAGFILES = file1=loc1 "file2 = loc2" ...
1192# where "loc1" and "loc2" can be relative or absolute paths or1408# where "loc1" and "loc2" can be relative or absolute paths or
1193# URLs. If a location is present for each tag, the installdox tool1409# URLs. If a location is present for each tag, the installdox tool
1194# does not have to be run to correct the links.1410# does not have to be run to correct the links.
@@ -1256,6 +1472,14 @@ HIDE_UNDOC_RELATIONS = YES · 61 unmodified lines
1256 1472
1257HAVE_DOT = NO1473HAVE_DOT = NO
1258 1474
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
1481DOT_NUM_THREADS = 0
1482
1259# By default doxygen will write a font called FreeSans.ttf to the output1483# By default doxygen will write a font called FreeSans.ttf to the output
1260# directory and reference it in all dot files that doxygen generates. This1484# directory and reference it in all dot files that doxygen generates. This
1261# font does not include all possible unicode characters however, so when you need1485# font does not include all possible unicode characters however, so when you need
@@ -1267,6 +1491,11 @@ HAVE_DOT = NO · 5 unmodified lines
1267 1491
1268DOT_FONTNAME = FreeSans1492DOT_FONTNAME = FreeSans
1269 1493
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
1497DOT_FONTSIZE = 10
1498
1270# By default doxygen will tell dot to use the output directory to look for the1499# By default doxygen will tell dot to use the output directory to look for the
1271# FreeSans.ttf font (which doxygen will put there itself). If you specify a1500# FreeSans.ttf font (which doxygen will put there itself). If you specify a
1272# different font using DOT_FONTNAME you can set the path where dot1501# different font using DOT_FONTNAME you can set the path where dot
@@ -1384,10 +1613,10 @@ DOT_GRAPH_MAX_NODES = 50 · 111 unmodified lines
1384MAX_DOT_GRAPH_DEPTH = 01613MAX_DOT_GRAPH_DEPTH = 0
1385 1614
1386# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent1615# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
1387# background. This is enabled by default, which results in a transparent1616# background. This is disabled by default, because dot on Windows does not
1388# background. Warning: Depending on the platform used, enabling this option1617# seem to support this out of the box. Warning: Depending on the platform used,
1389# may lead to badly anti-aliased labels on the edges of a graph (i.e. they1618# enabling this option may lead to badly anti-aliased labels on the edges of
1390# become hard to read).1619# a graph (i.e. they become hard to read).
1391 1620
1392DOT_TRANSPARENT = YES1621DOT_TRANSPARENT = YES
1393 1622
@@ -1409,12 +1638,3 @@ GENERATE_LEGEND = YES · 15 unmodified lines
1409# the various graphs.1638# the various graphs.
1410 1639
1411DOT_CLEANUP = YES1640DOT_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
1420SEARCHENGINE = NO
configure+0−2
@@ -2560,8 +2560,6 @@ EOF · 2559 unmodified lines
2560 exit 1;2560 exit 1;
2561fi2561fi
2562 2562
2563disabled static && LIBNAME=""
2564
2565die_license_disabled() {2563die_license_disabled() {
2566 enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }2564 enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
2567}2565}
doc/examples/muxing-example.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
34#include <string.h>34#include <string.h>
35#include <math.h>35#include <math.h>
36 36
37#include "libavutil/mathematics.h"
37#include "libavformat/avformat.h"38#include "libavformat/avformat.h"
38#include "libswscale/swscale.h"39#include "libswscale/swscale.h"
39 40
ffmpeg.c+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
40#include "libavutil/fifo.h"40#include "libavutil/fifo.h"
41#include "libavutil/intreadwrite.h"41#include "libavutil/intreadwrite.h"
42#include "libavutil/dict.h"42#include "libavutil/dict.h"
43#include "libavutil/mathematics.h"
43#include "libavutil/pixdesc.h"44#include "libavutil/pixdesc.h"
44#include "libavutil/avstring.h"45#include "libavutil/avstring.h"
45#include "libavutil/libm.h"46#include "libavutil/libm.h"
ffplay.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
25#include <limits.h>25#include <limits.h>
26#include "libavutil/avstring.h"26#include "libavutil/avstring.h"
27#include "libavutil/colorspace.h"27#include "libavutil/colorspace.h"
28#include "libavutil/mathematics.h"
28#include "libavutil/pixdesc.h"29#include "libavutil/pixdesc.h"
29#include "libavutil/imgutils.h"30#include "libavutil/imgutils.h"
30#include "libavutil/dict.h"31#include "libavutil/dict.h"
ffserver.c+1−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
37#include "libavutil/avstring.h"37#include "libavutil/avstring.h"
38#include "libavutil/lfg.h"38#include "libavutil/lfg.h"
39#include "libavutil/dict.h"39#include "libavutil/dict.h"
40#include "libavutil/mathematics.h"
40#include "libavutil/random_seed.h"41#include "libavutil/random_seed.h"
41#include "libavutil/parseutils.h"42#include "libavutil/parseutils.h"
42#include "libavutil/opt.h"43#include "libavutil/opt.h"
libavcodec/aacps.c+1−1
@@ -77,7 +77,7 @@ static VLC vlc_ps[10]; · 76 unmodified lines
77 * @param avctx contains the current codec context77 * @param avctx contains the current codec context
78 * @param gb pointer to the input bitstream78 * @param gb pointer to the input bitstream
79 * @param ps pointer to the Parametric Stereo context79 * @param ps pointer to the Parametric Stereo context
80 * @param par pointer to the parameter to be read80 * @param PAR pointer to the parameter to be read
81 * @param e envelope to decode81 * @param e envelope to decode
82 * @param dt 1: time delta-coded, 0: frequency delta-coded82 * @param dt 1: time delta-coded, 0: frequency delta-coded
83 */83 */
libavcodec/acelp_pitch_delay.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */21 */
22 22
23#include "libavutil/mathematics.h"
23#include "avcodec.h"24#include "avcodec.h"
24#include "dsputil.h"25#include "dsputil.h"
25#include "acelp_pitch_delay.h"26#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
154 154
155/**155/**
156 * Execute ANSI escape code156 * Execute ANSI escape code
157 * @param <0 error157 * @return 0 on success, negative on error
158 */158 */
159static int execute_code(AVCodecContext * avctx, int c)159static int execute_code(AVCodecContext * avctx, int c)
160{160{
libavcodec/avcodec.h+3−0
@@ -30,6 +30,9 @@ · 29 unmodified lines
30#include "libavutil/samplefmt.h"30#include "libavutil/samplefmt.h"
31#include "libavutil/avutil.h"31#include "libavutil/avutil.h"
32#include "libavutil/cpu.h"32#include "libavutil/cpu.h"
33#include "libavutil/log.h"
34#include "libavutil/pixfmt.h"
35#include "libavutil/rational.h"
33 36
34#include "libavcodec/version.h"37#include "libavcodec/version.h"
35 38
libavcodec/cook.c+1−2
@@ -335,7 +335,7 @@ static av_cold int cook_decode_close(AVCodecContext *avctx) · 334 unmodified lines
335 * Fill the gain array for the timedomain quantization.335 * Fill the gain array for the timedomain quantization.
336 *336 *
337 * @param gb pointer to the GetBitContext337 * @param gb pointer to the GetBitContext
338 * @param gaininfo[9] array of gain indexes338 * @param gaininfo array[9] of gain indexes
339 */339 */
340 340
341static void decode_gain_info(GetBitContext *gb, int *gaininfo)341static void decode_gain_info(GetBitContext *gb, int *gaininfo)
@@ -1156,7 +1156,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) · 814 unmodified lines
1156 default:1156 default:
1157 av_log_ask_for_sample(avctx, "Unknown Cook version.\n");1157 av_log_ask_for_sample(avctx, "Unknown Cook version.\n");
1158 return -1;1158 return -1;
1159 break;
1160 }1159 }
1161 1160
1162 if(s > 1 && q->subpacket[s].samples_per_channel != q->samples_per_channel) {1161 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
42 42
43extern const uint8_t ff_log2_run[41];43extern const uint8_t ff_log2_run[41];
44 44
45static 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
64static const int8_t quant5_10bit[256]={45static const int8_t quant5_10bit[256]={
65 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,46 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
66 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,
@@ -98,42 +79,7 @@ static const int8_t quant5[256]={ · 31 unmodified lines
98-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,79-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,-1,-1,-1,80-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,
100};81};
101static const int8_t quant7[256]={82
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};
119static 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};
137static const int8_t quant9_10bit[256]={83static const int8_t quant9_10bit[256]={
138 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,84 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
139 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,85 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
171-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,117-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,
172-4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,118-4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-3,-2,-2,-2,-1,
173};119};
174static 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};
192 120
193static const uint8_t ver2_state[256]= {121static const uint8_t ver2_state[256]= {
194 0, 10, 10, 10, 10, 16, 16, 16, 28, 16, 16, 29, 42, 49, 20, 49,122 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
112 case 24 : avctx->pix_fmt = PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */112 case 24 : avctx->pix_fmt = PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */
113 av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");113 av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");
114 return -1;114 return -1;
115 break;
116 default :115 default :
117 av_log(avctx, AV_LOG_ERROR, "Unknown FLC/FLX depth of %d Bpp is unsupported.\n",depth);116 av_log(avctx, AV_LOG_ERROR, "Unknown FLC/FLX depth of %d Bpp is unsupported.\n",depth);
118 return -1;117 return -1;
libavcodec/h264.c+134−152
@@ -60,15 +60,6 @@ static const enum PixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = { · 59 unmodified lines
60 PIX_FMT_NONE60 PIX_FMT_NONE
61};61};
62 62
63void 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
72/**63/**
73 * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.64 * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
74 */65 */
@@ -3057,6 +3048,82 @@ int ff_h264_get_slice_type(const H264Context *h) · 2982 unmodified lines
3057 }3048 }
3058}3049}
3059 3050
3051static 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
3060/**3127/**
3061 *3128 *
3062 * @return non zero if the loop filter can be skiped3129 * @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
3064static int fill_filter_caches(H264Context *h, int mb_type){3131static int fill_filter_caches(H264Context *h, int mb_type){
3065 MpegEncContext * const s = &h->s;3132 MpegEncContext * const s = &h->s;
3066 const int mb_xy= h->mb_xy;3133 const int mb_xy= h->mb_xy;
3067 int top_xy, left_xy[2];3134 int top_xy, left_xy[LEFT_MBS];
3068 int top_type, left_type[2];3135 int top_type, left_type[LEFT_MBS];
3136 uint8_t *nnz;
3137 uint8_t *nnz_cache;
3069 3138
3070 top_xy = mb_xy - (s->mb_stride << MB_FIELD);3139 top_xy = mb_xy - (s->mb_stride << MB_FIELD);
3071 3140
3072 //FIXME deblocking could skip the intra and nnz parts.
3073
3074 /* Wow, what a mess, why didn't they simplify the interlacing & intra3141 /* Wow, what a mess, why didn't they simplify the interlacing & intra
3075 * stuff, I can't imagine that these complex rules are worth it. */3142 * stuff, I can't imagine that these complex rules are worth it. */
3076 3143
3077 left_xy[1] = left_xy[0] = mb_xy-1;3144 left_xy[LBOT] = left_xy[LTOP] = mb_xy-1;
3078 if(FRAME_MBAFF){3145 if(FRAME_MBAFF){
3079 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);3146 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);
3080 const int curr_mb_field_flag = IS_INTERLACED(mb_type);3147 const int curr_mb_field_flag = IS_INTERLACED(mb_type);
3081 if(s->mb_y&1){3148 if(s->mb_y&1){
3082 if (left_mb_field_flag != curr_mb_field_flag) {3149 if (left_mb_field_flag != curr_mb_field_flag) {
3083 left_xy[0] -= s->mb_stride;3150 left_xy[LTOP] -= s->mb_stride;
3084 }3151 }
3085 }else{3152 }else{
3086 if(curr_mb_field_flag){3153 if(curr_mb_field_flag){
3087 top_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy ]>>7)&1)-1);3154 top_xy += s->mb_stride & (((s->current_picture.mb_type[top_xy ]>>7)&1)-1);
3088 }3155 }
3089 if (left_mb_field_flag != curr_mb_field_flag) {3156 if (left_mb_field_flag != curr_mb_field_flag) {
3090 left_xy[1] += s->mb_stride;3157 left_xy[LBOT] += s->mb_stride;
3091 }3158 }
3092 }3159 }
3093 }3160 }
3094 3161
3095 h->top_mb_xy = top_xy;3162 h->top_mb_xy = top_xy;
3096 h->left_mb_xy[0] = left_xy[0];3163 h->left_mb_xy[LTOP] = left_xy[LTOP];
3097 h->left_mb_xy[1] = left_xy[1];3164 h->left_mb_xy[LBOT] = left_xy[LBOT];
3098 {3165 {
3099 //for sufficiently low qp, filtering wouldn't do anything3166 //for sufficiently low qp, filtering wouldn't do anything
3100 //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp3167 //this is a conservative estimate: could also check beta_offset and more accurate chroma_qp
3101 int qp_thresh = h->qp_thresh; //FIXME strictly we should store qp_thresh for each mb of a slice3168 int qp_thresh = h->qp_thresh; //FIXME strictly we should store qp_thresh for each mb of a slice
3102 int qp = s->current_picture.qscale_table[mb_xy];3169 int qp = s->current_picture.qscale_table[mb_xy];
3103 if(qp <= qp_thresh3170 if(qp <= qp_thresh
3104 && (left_xy[0]<0 || ((qp + s->current_picture.qscale_table[left_xy[0]] + 1)>>1) <= qp_thresh)3171 && (left_xy[LTOP]<0 || ((qp + s->current_picture.qscale_table[left_xy[LTOP]] + 1)>>1) <= qp_thresh)
3105 && (top_xy < 0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){3172 && (top_xy <0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){
3106 if(!FRAME_MBAFF)3173 if(!FRAME_MBAFF)
3107 return 1;3174 return 1;
3108 if( (left_xy[0]< 0 || ((qp + s->current_picture.qscale_table[left_xy[1] ] + 1)>>1) <= qp_thresh)3175 if( (left_xy[LTOP]< 0 || ((qp + s->current_picture.qscale_table[left_xy[LBOT] ] + 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))3176 && (top_xy < s->mb_stride || ((qp + s->current_picture.qscale_table[top_xy -s->mb_stride] + 1)>>1) <= qp_thresh))
3110 return 1;3177 return 1;
3111 }3178 }
3112 }3179 }
3113 3180
3114 top_type = s->current_picture.mb_type[top_xy] ;3181 top_type = s->current_picture.mb_type[top_xy];
3115 left_type[0] = s->current_picture.mb_type[left_xy[0]];3182 left_type[LTOP] = s->current_picture.mb_type[left_xy[LTOP]];
3116 left_type[1] = s->current_picture.mb_type[left_xy[1]];3183 left_type[LBOT] = s->current_picture.mb_type[left_xy[LBOT]];
3117 if(h->deblocking_filter == 2){3184 if(h->deblocking_filter == 2){
3118 if(h->slice_table[top_xy ] != h->slice_num) top_type= 0;3185 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;3186 if(h->slice_table[left_xy[LBOT]] != h->slice_num) left_type[LTOP]= left_type[LBOT]= 0;
3120 }else{3187 }else{
3121 if(h->slice_table[top_xy ] == 0xFFFF) top_type= 0;3188 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;3189 if(h->slice_table[left_xy[LBOT]] == 0xFFFF) left_type[LTOP]= left_type[LBOT] =0;
3123 }3190 }
3124 h->top_type = top_type ;3191 h->top_type = top_type;
3125 h->left_type[0]= left_type[0];3192 h->left_type[LTOP]= left_type[LTOP];
3126 h->left_type[1]= left_type[1];3193 h->left_type[LBOT]= left_type[LBOT];
3127 3194
3128 if(IS_INTRA(mb_type))3195 if(IS_INTRA(mb_type))
3129 return 0;3196 return 0;
3130 3197
3131 AV_COPY32(&h->non_zero_count_cache[4+8* 1], &h->non_zero_count[mb_xy][ 0]);3198 fill_filter_caches_inter(h, s, mb_type, top_xy, left_xy, top_type, left_type, mb_xy, 0);
3132 AV_COPY32(&h->non_zero_count_cache[4+8* 2], &h->non_zero_count[mb_xy][ 4]);3199 if(h->list_count == 2)
3133 AV_COPY32(&h->non_zero_count_cache[4+8* 3], &h->non_zero_count[mb_xy][ 8]);3200 fill_filter_caches_inter(h, s, mb_type, top_xy, left_xy, top_type, left_type, mb_xy, 1);
3134 AV_COPY32(&h->non_zero_count_cache[4+8* 4], &h->non_zero_count[mb_xy][12]);
3135 3201
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]);
3136 h->cbp= h->cbp_table[mb_xy];3208 h->cbp= h->cbp_table[mb_xy];
3137 3209
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/*
31770 . T T. T T T T
31781 L . .L . . . .
31792 L . .L . . . .
31803 . T TL . . . .
31814 L . .L . . . .
31825 L . .. . . . .
3183*/
3184//FIXME constraint_intra_pred & partitioning & nnz (let us hope this is just a typo in the spec)
3185 if(top_type){3210 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]);
3187 }3213 }
3188 3214
3189 if(left_type[0]){3215 if(left_type[LTOP]){
3190 h->non_zero_count_cache[3+8*1]= h->non_zero_count[left_xy[0]][3+0*4];3216 nnz = h->non_zero_count[left_xy[LTOP]];
3191 h->non_zero_count_cache[3+8*2]= h->non_zero_count[left_xy[0]][3+1*4];3217 nnz_cache[3+8*1]= nnz[3+0*4];
3192 h->non_zero_count_cache[3+8*3]= h->non_zero_count[left_xy[0]][3+2*4];3218 nnz_cache[3+8*2]= nnz[3+1*4];
3193 h->non_zero_count_cache[3+8*4]= h->non_zero_count[left_xy[0]][3+3*4];3219 nnz_cache[3+8*3]= nnz[3+2*4];
3220 nnz_cache[3+8*4]= nnz[3+3*4];
3194 }3221 }
3195 3222
3196 // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs3223 // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs
3197 if(!CABAC && h->pps.transform_8x8_mode){3224 if(!CABAC && h->pps.transform_8x8_mode){
3198 if(IS_8x8DCT(top_type)){3225 if(IS_8x8DCT(top_type)){
3199 h->non_zero_count_cache[4+8*0]=3226 nnz_cache[4+8*0]=
3200 h->non_zero_count_cache[5+8*0]= (h->cbp_table[top_xy] & 0x4000) >> 12;3227 nnz_cache[5+8*0]= (h->cbp_table[top_xy] & 0x4000) >> 12;
3201 h->non_zero_count_cache[6+8*0]=3228 nnz_cache[6+8*0]=
3202 h->non_zero_count_cache[7+8*0]= (h->cbp_table[top_xy] & 0x8000) >> 12;3229 nnz_cache[7+8*0]= (h->cbp_table[top_xy] & 0x8000) >> 12;
3203 }3230 }
3204 if(IS_8x8DCT(left_type[0])){3231 if(IS_8x8DCT(left_type[LTOP])){
3205 h->non_zero_count_cache[3+8*1]=3232 nnz_cache[3+8*1]=
3206 h->non_zero_count_cache[3+8*2]= (h->cbp_table[left_xy[0]]&0x2000) >> 12; //FIXME check MBAFF3233 nnz_cache[3+8*2]= (h->cbp_table[left_xy[LTOP]]&0x2000) >> 12; //FIXME check MBAFF
3207 }3234 }
3208 if(IS_8x8DCT(left_type[1])){3235 if(IS_8x8DCT(left_type[LBOT])){
3209 h->non_zero_count_cache[3+8*3]=3236 nnz_cache[3+8*3]=
3210 h->non_zero_count_cache[3+8*4]= (h->cbp_table[left_xy[1]]&0x8000) >> 12; //FIXME check MBAFF3237 nnz_cache[3+8*4]= (h->cbp_table[left_xy[LBOT]]&0x8000) >> 12; //FIXME check MBAFF
3211 }3238 }
3212 3239
3213 if(IS_8x8DCT(mb_type)){3240 if(IS_8x8DCT(mb_type)){
3214 h->non_zero_count_cache[scan8[0 ]]= h->non_zero_count_cache[scan8[1 ]]=3241 nnz_cache[scan8[0 ]]= nnz_cache[scan8[1 ]]=
3215 h->non_zero_count_cache[scan8[2 ]]= h->non_zero_count_cache[scan8[3 ]]= (h->cbp & 0x1000) >> 12;3242 nnz_cache[scan8[2 ]]= nnz_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;
3219 3243
3220 h->non_zero_count_cache[scan8[0+ 8]]= h->non_zero_count_cache[scan8[1+ 8]]=3244 nnz_cache[scan8[0+ 4]]= nnz_cache[scan8[1+ 4]]=
3221 h->non_zero_count_cache[scan8[2+ 8]]= h->non_zero_count_cache[scan8[3+ 8]]= (h->cbp & 0x4000) >> 12;3245 nnz_cache[scan8[2+ 4]]= nnz_cache[scan8[3+ 4]]= (h->cbp & 0x2000) >> 12;
3222 3246
3223 h->non_zero_count_cache[scan8[0+12]]= h->non_zero_count_cache[scan8[1+12]]=3247 nnz_cache[scan8[0+ 8]]= nnz_cache[scan8[1+ 8]]=
3224 h->non_zero_count_cache[scan8[2+12]]= h->non_zero_count_cache[scan8[3+12]]= (h->cbp & 0x8000) >> 12;3248 nnz_cache[scan8[2+ 8]]= nnz_cache[scan8[3+ 8]]= (h->cbp & 0x4000) >> 12;
3225 }
3226 }
3227 3249
3228 if(IS_INTER(mb_type) || IS_DIRECT(mb_type)){3250 nnz_cache[scan8[0+12]]= nnz_cache[scan8[1+12]]=
3229 int list;3251 nnz_cache[scan8[2+12]]= nnz_cache[scan8[3+12]]= (h->cbp & 0x8000) >> 12;
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 }
3269 }3252 }
3270 }3253 }
3271 3254
@@ -3556,7 +3539,6 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){ · 284 unmodified lines
3556 ff_draw_horiz_band(s, 16*s->mb_y, 16);3539 ff_draw_horiz_band(s, 16*s->mb_y, 16);
3557 }3540 }
3558#endif3541#endif
3559 return -1; //not reached
3560}3542}
3561 3543
3562/**3544/**
libavcodec/h264.h+255−233
@@ -70,6 +70,10 @@ · 69 unmodified lines
70#define MB_FIELD h->mb_field_decoding_flag70#define MB_FIELD h->mb_field_decoding_flag
71#define FRAME_MBAFF h->mb_aff_frame71#define FRAME_MBAFF h->mb_aff_frame
72#define FIELD_PICTURE (s->picture_structure != PICT_FRAME)72#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)
73#else77#else
74#define MB_MBAFF 078#define MB_MBAFF 0
75#define MB_FIELD 079#define MB_FIELD 0
@@ -77,6 +81,10 @@ · 1 unmodified line
77#define FIELD_PICTURE 081#define FIELD_PICTURE 0
78#undef IS_INTERLACED82#undef IS_INTERLACED
79#define IS_INTERLACED(mb_type) 083#define IS_INTERLACED(mb_type) 0
84#define LEFT_MBS 1
85#define LTOP 0
86#define LBOT 0
87#define LEFT(i) 0
80#endif88#endif
81#define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF || FIELD_PICTURE)89#define FIELD_OR_MBAFF_PICTURE (FRAME_MBAFF || FIELD_PICTURE)
82 90
@@ -272,12 +280,12 @@ typedef struct H264Context{ · 189 unmodified lines
272 int topleft_mb_xy;280 int topleft_mb_xy;
273 int top_mb_xy;281 int top_mb_xy;
274 int topright_mb_xy;282 int topright_mb_xy;
275 int left_mb_xy[2];283 int left_mb_xy[LEFT_MBS];
276 284
277 int topleft_type;285 int topleft_type;
278 int top_type;286 int top_type;
279 int topright_type;287 int topright_type;
280 int left_type[2];288 int left_type[LEFT_MBS];
281 289
282 const uint8_t * left_block;290 const uint8_t * left_block;
283 int topleft_partition;291 int topleft_partition;
@@ -307,11 +315,6 @@ typedef struct H264Context{ · 23 unmodified lines
307#define LIST_NOT_USED -1 //FIXME rename?315#define LIST_NOT_USED -1 //FIXME rename?
308#define PART_NOT_AVAILABLE -2316#define PART_NOT_AVAILABLE -2
309 317
310 /**
311 * is 1 if the specific list MV&references are set to 0,0,-2.
312 */
313 int mv_cache_clean[2];
314
315 /**318 /**
316 * number of neighbors (top and/or left) that used 8x8 dct319 * number of neighbors (top and/or left) that used 8x8 dct
317 */320 */
@@ -658,7 +661,6 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h); · 340 unmodified lines
658 */661 */
659int ff_h264_check_intra_pred_mode(H264Context *h, int mode);662int ff_h264_check_intra_pred_mode(H264Context *h, int mode);
660 663
661void ff_h264_write_back_intra_pred_mode(H264Context *h);
662void ff_h264_hl_decode_mb(H264Context *h);664void ff_h264_hl_decode_mb(H264Context *h);
663int ff_h264_frame_start(H264Context *h);665int ff_h264_frame_start(H264Context *h);
664int ff_h264_decode_extradata(H264Context *h);666int 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
773static void fill_decode_neighbors(H264Context *h, int mb_type){775static void fill_decode_neighbors(H264Context *h, int mb_type){
774 MpegEncContext * const s = &h->s;776 MpegEncContext * const s = &h->s;
775 const int mb_xy= h->mb_xy;777 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];
777 static const uint8_t left_block_options[4][32]={779 static const uint8_t left_block_options[4][32]={
778 {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},780 {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},
779 {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},781 {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
790 792
791 topleft_xy = top_xy - 1;793 topleft_xy = top_xy - 1;
792 topright_xy= top_xy + 1;794 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;
794 h->left_block = left_block_options[0];796 h->left_block = left_block_options[0];
795 if(FRAME_MBAFF){797 if(FRAME_MBAFF){
796 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);798 const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]);
797 const int curr_mb_field_flag = IS_INTERLACED(mb_type);799 const int curr_mb_field_flag = IS_INTERLACED(mb_type);
798 if(s->mb_y&1){800 if(s->mb_y&1){
799 if (left_mb_field_flag != curr_mb_field_flag) {801 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;
801 if (curr_mb_field_flag) {803 if (curr_mb_field_flag) {
802 left_xy[1] += s->mb_stride;804 left_xy[LBOT] += s->mb_stride;
803 h->left_block = left_block_options[3];805 h->left_block = left_block_options[3];
804 } else {806 } else {
805 topleft_xy += s->mb_stride;807 topleft_xy += s->mb_stride;
@@ -816,7 +818,7 @@ static void fill_decode_neighbors(H264Context *h, int mb_type){ · 10 unmodified lines
816 }818 }
817 if (left_mb_field_flag != curr_mb_field_flag) {819 if (left_mb_field_flag != curr_mb_field_flag) {
818 if (curr_mb_field_flag) {820 if (curr_mb_field_flag) {
819 left_xy[1] += s->mb_stride;821 left_xy[LBOT] += s->mb_stride;
820 h->left_block = left_block_options[3];822 h->left_block = left_block_options[3];
821 } else {823 } else {
822 h->left_block = left_block_options[2];824 h->left_block = left_block_options[2];
@@ -828,25 +830,25 @@ static void fill_decode_neighbors(H264Context *h, int mb_type){ · 5 unmodified lines
828 h->topleft_mb_xy = topleft_xy;830 h->topleft_mb_xy = topleft_xy;
829 h->top_mb_xy = top_xy;831 h->top_mb_xy = top_xy;
830 h->topright_mb_xy= topright_xy;832 h->topright_mb_xy= topright_xy;
831 h->left_mb_xy[0] = left_xy[0];833 h->left_mb_xy[LTOP] = left_xy[LTOP];
832 h->left_mb_xy[1] = left_xy[1];834 h->left_mb_xy[LBOT] = left_xy[LBOT];
833 //FIXME do we need all in the context?835 //FIXME do we need all in the context?
834 836
835 h->topleft_type = s->current_picture.mb_type[topleft_xy] ;837 h->topleft_type = s->current_picture.mb_type[topleft_xy] ;
836 h->top_type = s->current_picture.mb_type[top_xy] ;838 h->top_type = s->current_picture.mb_type[top_xy] ;
837 h->topright_type= s->current_picture.mb_type[topright_xy];839 h->topright_type= s->current_picture.mb_type[topright_xy];
838 h->left_type[0] = s->current_picture.mb_type[left_xy[0]] ;840 h->left_type[LTOP] = s->current_picture.mb_type[left_xy[LTOP]] ;
839 h->left_type[1] = s->current_picture.mb_type[left_xy[1]] ;841 h->left_type[LBOT] = s->current_picture.mb_type[left_xy[LBOT]] ;
840 842
841 if(FMO){843 if(FMO){
842 if(h->slice_table[topleft_xy ] != h->slice_num) h->topleft_type = 0;844 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;845 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;846 if(h->slice_table[left_xy[LTOP] ] != h->slice_num) h->left_type[LTOP] = h->left_type[LBOT] = 0;
845 }else{847 }else{
846 if(h->slice_table[topleft_xy ] != h->slice_num){848 if(h->slice_table[topleft_xy ] != h->slice_num){
847 h->topleft_type = 0;849 h->topleft_type = 0;
848 if(h->slice_table[top_xy ] != h->slice_num) h->top_type = 0;850 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;851 if(h->slice_table[left_xy[LTOP] ] != h->slice_num) h->left_type[LTOP] = h->left_type[LBOT] = 0;
850 }852 }
851 }853 }
852 if(h->slice_table[topright_xy] != h->slice_num) h->topright_type= 0;854 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
854 856
855static void fill_decode_caches(H264Context *h, int mb_type){857static void fill_decode_caches(H264Context *h, int mb_type){
856 MpegEncContext * const s = &h->s;858 MpegEncContext * const s = &h->s;
857 int topleft_xy, top_xy, topright_xy, left_xy[2];859 int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS];
858 int topleft_type, top_type, topright_type, left_type[2];860 int topleft_type, top_type, topright_type, left_type[LEFT_MBS];
859 const uint8_t * left_block= h->left_block;861 const uint8_t * left_block= h->left_block;
860 int i;862 int i;
861 863 uint8_t *nnz;
862 topleft_xy = h->topleft_mb_xy ;864 uint8_t *nnz_cache;
863 top_xy = h->top_mb_xy ;865
864 topright_xy = h->topright_mb_xy;866 topleft_xy = h->topleft_mb_xy;
865 left_xy[0] = h->left_mb_xy[0] ;867 top_xy = h->top_mb_xy;
866 left_xy[1] = h->left_mb_xy[1] ;868 topright_xy = h->topright_mb_xy;
867 topleft_type = h->topleft_type ;869 left_xy[LTOP] = h->left_mb_xy[LTOP];
868 top_type = h->top_type ;870 left_xy[LBOT] = h->left_mb_xy[LBOT];
869 topright_type= h->topright_type ;871 topleft_type = h->topleft_type;
870 left_type[0] = h->left_type[0] ;872 top_type = h->top_type;
871 left_type[1] = h->left_type[1] ;873 topright_type = h->topright_type;
874 left_type[LTOP]= h->left_type[LTOP];
875 left_type[LBOT]= h->left_type[LBOT];
872 876
873 if(!IS_SKIP(mb_type)){877 if(!IS_SKIP(mb_type)){
874 if(IS_INTRA(mb_type)){878 if(IS_INTRA(mb_type)){
@@ -883,27 +887,27 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 8 unmodified lines
883 h->top_samples_available= 0x33FF;887 h->top_samples_available= 0x33FF;
884 h->topright_samples_available= 0x26EA;888 h->topright_samples_available= 0x26EA;
885 }889 }
886 if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[0])){890 if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[LTOP])){
887 if(IS_INTERLACED(mb_type)){891 if(IS_INTERLACED(mb_type)){
888 if(!(left_type[0] & type_mask)){892 if(!(left_type[LTOP] & type_mask)){
889 h->topleft_samples_available&= 0xDFFF;893 h->topleft_samples_available&= 0xDFFF;
890 h->left_samples_available&= 0x5FFF;894 h->left_samples_available&= 0x5FFF;
891 }895 }
892 if(!(left_type[1] & type_mask)){896 if(!(left_type[LBOT] & type_mask)){
893 h->topleft_samples_available&= 0xFF5F;897 h->topleft_samples_available&= 0xFF5F;
894 h->left_samples_available&= 0xFF5F;898 h->left_samples_available&= 0xFF5F;
895 }899 }
896 }else{900 }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];
898 902
899 assert(left_xy[0] == left_xy[1]);903 assert(left_xy[LTOP] == left_xy[LBOT]);
900 if(!((left_typei & type_mask) && (left_type[0] & type_mask))){904 if(!((left_typei & type_mask) && (left_type[LTOP] & type_mask))){
901 h->topleft_samples_available&= 0xDF5F;905 h->topleft_samples_available&= 0xDF5F;
902 h->left_samples_available&= 0x5F5F;906 h->left_samples_available&= 0x5F5F;
903 }907 }
904 }908 }
905 }else{909 }else{
906 if(!(left_type[0] & type_mask)){910 if(!(left_type[LTOP] & type_mask)){
907 h->topleft_samples_available&= 0xDF5F;911 h->topleft_samples_available&= 0xDF5F;
908 h->left_samples_available&= 0x5F5F;912 h->left_samples_available&= 0x5F5F;
909 }913 }
@@ -925,13 +929,13 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 15 unmodified lines
925 h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask);929 h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask);
926 }930 }
927 for(i=0; i<2; i++){931 for(i=0; i<2; i++){
928 if(IS_INTRA4x4(left_type[i])){932 if(IS_INTRA4x4(left_type[LEFT(i)])){
929 int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]];933 int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[LEFT(i)]];
930 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[6-left_block[0+2*i]];934 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[6-left_block[0+2*i]];
931 h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[6-left_block[1+2*i]];935 h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[6-left_block[1+2*i]];
932 }else{936 }else{
933 h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]=937 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);
935 }939 }
936 }940 }
937 }941 }
@@ -947,42 +951,45 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 9 unmodified lines
9475 L . .. . . . .9515 L . .. . . . .
948*/952*/
949//FIXME constraint_intra_pred & partitioning & nnz (let us hope this is just a typo in the spec)953//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;
950 if(top_type){955 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]);
952 if(CHROMA444){958 if(CHROMA444){
953 AV_COPY32(&h->non_zero_count_cache[4+8* 5], &h->non_zero_count[top_xy][4* 7]);959 AV_COPY32(&nnz_cache[4+8* 5], &nnz[4* 7]);
954 AV_COPY32(&h->non_zero_count_cache[4+8*10], &h->non_zero_count[top_xy][4*11]);960 AV_COPY32(&nnz_cache[4+8*10], &nnz[4*11]);
955 }else{961 }else{
956 AV_COPY32(&h->non_zero_count_cache[4+8* 5], &h->non_zero_count[top_xy][4* 5]);962 AV_COPY32(&nnz_cache[4+8* 5], &nnz[4* 5]);
957 AV_COPY32(&h->non_zero_count_cache[4+8*10], &h->non_zero_count[top_xy][4* 9]);963 AV_COPY32(&nnz_cache[4+8*10], &nnz[4* 9]);
958 }964 }
959 }else{965 }else{
960 uint32_t top_empty = CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040;966 uint32_t top_empty = CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040;
961 AV_WN32A(&h->non_zero_count_cache[4+8* 0], top_empty);967 AV_WN32A(&nnz_cache[4+8* 0], top_empty);
962 AV_WN32A(&h->non_zero_count_cache[4+8* 5], top_empty);968 AV_WN32A(&nnz_cache[4+8* 5], top_empty);
963 AV_WN32A(&h->non_zero_count_cache[4+8*10], top_empty);969 AV_WN32A(&nnz_cache[4+8*10], top_empty);
964 }970 }
965 971
966 for (i=0; i<2; i++) {972 for (i=0; i<2; i++) {
967 if(left_type[i]){973 if(left_type[LEFT(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]];974 nnz = h->non_zero_count[left_xy[LEFT(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]];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]];
970 if(CHROMA444){977 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];978 nnz_cache[3+8* 6 + 2*8*i]= nnz[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];979 nnz_cache[3+8* 7 + 2*8*i]= nnz[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];980 nnz_cache[3+8*11 + 2*8*i]= nnz[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];981 nnz_cache[3+8*12 + 2*8*i]= nnz[left_block[8+1+2*i]+8*4];
975 }else{982 }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]];983 nnz_cache[3+8* 6 + 8*i]= nnz[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]];984 nnz_cache[3+8*11 + 8*i]= nnz[left_block[8+5+2*i]];
978 }985 }
979 }else{986 }else{
980 h->non_zero_count_cache[3+8* 1 + 2*8*i]=987 nnz_cache[3+8* 1 + 2*8*i]=
981 h->non_zero_count_cache[3+8* 2 + 2*8*i]=988 nnz_cache[3+8* 2 + 2*8*i]=
982 h->non_zero_count_cache[3+8* 6 + 2*8*i]=989 nnz_cache[3+8* 6 + 2*8*i]=
983 h->non_zero_count_cache[3+8* 7 + 2*8*i]=990 nnz_cache[3+8* 7 + 2*8*i]=
984 h->non_zero_count_cache[3+8*11 + 2*8*i]=991 nnz_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;992 nnz_cache[3+8*12 + 2*8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64;
986 }993 }
987 }994 }
988 995
@@ -994,10 +1001,10 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 5 unmodified lines
994 h->top_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;1001 h->top_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
995 }1002 }
996 // left_cbp1003 // left_cbp
997 if (left_type[0]) {1004 if (left_type[LTOP]) {
998 h->left_cbp = (h->cbp_table[left_xy[0]] & 0x7F0)1005 h->left_cbp = (h->cbp_table[left_xy[LTOP]] & 0x7F0)
999 | ((h->cbp_table[left_xy[0]]>>(left_block[0]&(~1)))&2)1006 | ((h->cbp_table[left_xy[LTOP]]>>(left_block[0]&(~1)))&2)
1000 | (((h->cbp_table[left_xy[1]]>>(left_block[2]&(~1)))&2) << 2);1007 | (((h->cbp_table[left_xy[LBOT]]>>(left_block[2]&(~1)))&2) << 2);
1001 } else {1008 } else {
1002 h->left_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;1009 h->left_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F;
1003 }1010 }
@@ -1006,144 +1013,145 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 2 unmodified lines
1006 1013
1007 if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){1014 if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){
1008 int list;1015 int list;
1016 int b_stride = h->b_stride;
1009 for(list=0; list<h->list_count; list++){1017 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];
1010 if(!USES_LIST(mb_type, list)){1022 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 }*/
1016 continue;1023 continue;
1017 }1024 }
1018 assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred));1025 assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred));
1019 1026
1020 h->mv_cache_clean[list]= 0;
1021
1022 if(USES_LIST(top_type, list)){1027 if(USES_LIST(top_type, list)){
1023 const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;1028 const int b_xy= h->mb2b_xy[top_xy] + 3*b_stride;
1024 AV_COPY128(h->mv_cache[list][scan8[0] + 0 - 1*8], s->current_picture.motion_val[list][b_xy + 0]);1029 AV_COPY128(mv_cache[0 - 1*8], mv[b_xy + 0]);
1025 h->ref_cache[list][scan8[0] + 0 - 1*8]=1030 ref_cache[0 - 1*8]=
1026 h->ref_cache[list][scan8[0] + 1 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 2];1031 ref_cache[1 - 1*8]= ref[4*top_xy + 2];
1027 h->ref_cache[list][scan8[0] + 2 - 1*8]=1032 ref_cache[2 - 1*8]=
1028 h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][4*top_xy + 3];1033 ref_cache[3 - 1*8]= ref[4*top_xy + 3];
1029 }else{1034 }else{
1030 AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]);1035 AV_ZERO128(mv_cache[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);1036 AV_WN32A(&ref_cache[0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
1032 }1037 }
1033 1038
1034 if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){1039 if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){
1035 for(i=0; i<2; i++){1040 for(i=0; i<2; i++){
1036 int cache_idx = scan8[0] - 1 + i*2*8;1041 int cache_idx = -1 + i*2*8;
1037 if(USES_LIST(left_type[i], list)){1042 if(USES_LIST(left_type[LEFT(i)], list)){
1038 const int b_xy= h->mb2b_xy[left_xy[i]] + 3;1043 const int b_xy= h->mb2b_xy[left_xy[LEFT(i)]] + 3;
1039 const int b8_xy= 4*left_xy[i] + 1;1044 const int b8_xy= 4*left_xy[LEFT(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]]);1045 AV_COPY32(mv_cache[cache_idx ], mv[b_xy + 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]]);1046 AV_COPY32(mv_cache[cache_idx+8], mv[b_xy + 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)];1047 ref_cache[cache_idx ]= ref[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)];1048 ref_cache[cache_idx+8]= ref[b8_xy + (left_block[1+i*2]&~1)];
1044 }else{1049 }else{
1045 AV_ZERO32(h->mv_cache [list][cache_idx ]);1050 AV_ZERO32(mv_cache[cache_idx ]);
1046 AV_ZERO32(h->mv_cache [list][cache_idx+8]);1051 AV_ZERO32(mv_cache[cache_idx+8]);
1047 h->ref_cache[list][cache_idx ]=1052 ref_cache[cache_idx ]=
1048 h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;1053 ref_cache[cache_idx+8]= (left_type[LEFT(i)]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1049 }1054 }
1050 }1055 }
1051 }else{1056 }else{
1052 if(USES_LIST(left_type[0], list)){1057 if(USES_LIST(left_type[LTOP], list)){
1053 const int b_xy= h->mb2b_xy[left_xy[0]] + 3;1058 const int b_xy= h->mb2b_xy[left_xy[LTOP]] + 3;
1054 const int b8_xy= 4*left_xy[0] + 1;1059 const int b8_xy= 4*left_xy[LTOP] + 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]]);1060 AV_COPY32(mv_cache[-1], mv[b_xy + 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)];1061 ref_cache[-1]= ref[b8_xy + (left_block[0]&~1)];
1057 }else{1062 }else{
1058 AV_ZERO32(h->mv_cache [list][scan8[0] - 1]);1063 AV_ZERO32(mv_cache[-1]);
1059 h->ref_cache[list][scan8[0] - 1]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;1064 ref_cache[-1]= left_type[LTOP] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1060 }1065 }
1061 }1066 }
1062 1067
1063 if(USES_LIST(topright_type, list)){1068 if(USES_LIST(topright_type, list)){
1064 const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;1069 const int b_xy= h->mb2b_xy[topright_xy] + 3*b_stride;
1065 AV_COPY32(h->mv_cache[list][scan8[0] + 4 - 1*8], s->current_picture.motion_val[list][b_xy]);1070 AV_COPY32(mv_cache[4 - 1*8], mv[b_xy]);
1066 h->ref_cache[list][scan8[0] + 4 - 1*8]= s->current_picture.ref_index[list][4*topright_xy + 2];1071 ref_cache[4 - 1*8]= ref[4*topright_xy + 2];
1067 }else{1072 }else{
1068 AV_ZERO32(h->mv_cache [list][scan8[0] + 4 - 1*8]);1073 AV_ZERO32(mv_cache[4 - 1*8]);
1069 h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;1074 ref_cache[4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1070 }1075 }
1071 if(h->ref_cache[list][scan8[0] + 4 - 1*8] < 0){1076 if(ref_cache[4 - 1*8] < 0){
1072 if(USES_LIST(topleft_type, list)){1077 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);
1074 const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2);1079 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]);1080 AV_COPY32(mv_cache[-1 - 1*8], mv[b_xy]);
1076 h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy];1081 ref_cache[-1 - 1*8]= ref[b8_xy];
1077 }else{1082 }else{
1078 AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]);1083 AV_ZERO32(mv_cache[-1 - 1*8]);
1079 h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;1084 ref_cache[-1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1080 }1085 }
1081 }1086 }
1082 1087
1083 if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF)1088 if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF)
1084 continue;1089 continue;
1085 1090
1086 if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))) {1091 if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))){
1087 h->ref_cache[list][scan8[4 ]] =1092 uint8_t (*mvd_cache)[2] = &h->mvd_cache[list][scan8[0]];
1088 h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE;1093 uint8_t (*mvd)[2] = h->mvd_table[list];
1089 AV_ZERO32(h->mv_cache [list][scan8[4 ]]);1094 ref_cache[2+8*0] =
1090 AV_ZERO32(h->mv_cache [list][scan8[12]]);1095 ref_cache[2+8*2] = PART_NOT_AVAILABLE;
1091 1096 AV_ZERO32(mv_cache[2+8*0]);
1092 if( CABAC ) {1097 AV_ZERO32(mv_cache[2+8*2]);
1093 /* XXX beurk, Load mvd */1098
1094 if(USES_LIST(top_type, list)){1099 if( CABAC ) {
1095 const int b_xy= h->mb2br_xy[top_xy];1100 if(USES_LIST(top_type, list)){
1096 AV_COPY64(h->mvd_cache[list][scan8[0] + 0 - 1*8], h->mvd_table[list][b_xy + 0]);1101 const int b_xy= h->mb2br_xy[top_xy];
1097 }else{1102 AV_COPY64(mvd_cache[0 - 1*8], mvd[b_xy + 0]);
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];
1127 }else{1103 }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;
1129 }1152 }
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;
1144 }1153 }
1145 }1154 }
1146 }
1147 if(FRAME_MBAFF){1155 if(FRAME_MBAFF){
1148#define MAP_MVS\1156#define MAP_MVS\
1149 MAP_F2F(scan8[0] - 1 - 1*8, topleft_type)\1157 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
1152 MAP_F2F(scan8[0] + 2 - 1*8, top_type)\1160 MAP_F2F(scan8[0] + 2 - 1*8, top_type)\
1153 MAP_F2F(scan8[0] + 3 - 1*8, top_type)\1161 MAP_F2F(scan8[0] + 3 - 1*8, top_type)\
1154 MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\1162 MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\
1155 MAP_F2F(scan8[0] - 1 + 0*8, left_type[0])\1163 MAP_F2F(scan8[0] - 1 + 0*8, left_type[LTOP])\
1156 MAP_F2F(scan8[0] - 1 + 1*8, left_type[0])\1164 MAP_F2F(scan8[0] - 1 + 1*8, left_type[LTOP])\
1157 MAP_F2F(scan8[0] - 1 + 2*8, left_type[1])\1165 MAP_F2F(scan8[0] - 1 + 2*8, left_type[LBOT])\
1158 MAP_F2F(scan8[0] - 1 + 3*8, left_type[1])1166 MAP_F2F(scan8[0] - 1 + 3*8, left_type[LBOT])
1159 if(MB_FIELD){1167 if(MB_FIELD){
1160#define MAP_F2F(idx, mb_type)\1168#define MAP_F2F(idx, mb_type)\
1161 if(!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\1169 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
1179 }1187 }
1180 }1188 }
1181 1189
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]);
1183}1191}
1184 1192
1185/**1193/**
1186 * gets the predicted intra4x4 prediction mode.1194 * gets the predicted intra4x4 prediction mode.
1187 */1195 */
1188static inline int pred_intra_mode(H264Context *h, int n){1196static av_always_inline int pred_intra_mode(H264Context *h, int n){
1189 const int index8= scan8[n];1197 const int index8= scan8[n];
1190 const int left= h->intra4x4_pred_mode_cache[index8 - 1];1198 const int left= h->intra4x4_pred_mode_cache[index8 - 1];
1191 const int top = h->intra4x4_pred_mode_cache[index8 - 8];1199 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
1197 else return min;1205 else return min;
1198}1206}
1199 1207
1200static inline void write_back_non_zero_count(H264Context *h){1208static av_always_inline void write_back_intra_pred_mode(H264Context *h){
1201 const int mb_xy= h->mb_xy;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}
1202 1217
1203 AV_COPY32(&h->non_zero_count[mb_xy][ 0], &h->non_zero_count_cache[4+8* 1]);1218static av_always_inline void write_back_non_zero_count(H264Context *h){
1204 AV_COPY32(&h->non_zero_count[mb_xy][ 4], &h->non_zero_count_cache[4+8* 2]);1219 const int mb_xy= h->mb_xy;
1205 AV_COPY32(&h->non_zero_count[mb_xy][ 8], &h->non_zero_count_cache[4+8* 3]);1220 uint8_t *nnz = h->non_zero_count[mb_xy];
1206 AV_COPY32(&h->non_zero_count[mb_xy][12], &h->non_zero_count_cache[4+8* 4]);1221 uint8_t *nnz_cache = h->non_zero_count_cache;
1207 AV_COPY32(&h->non_zero_count[mb_xy][16], &h->non_zero_count_cache[4+8* 6]);1222
1208 AV_COPY32(&h->non_zero_count[mb_xy][20], &h->non_zero_count_cache[4+8* 7]);1223 AV_COPY32(&nnz[ 0], &nnz_cache[4+8* 1]);
1209 AV_COPY32(&h->non_zero_count[mb_xy][32], &h->non_zero_count_cache[4+8*11]);1224 AV_COPY32(&nnz[ 4], &nnz_cache[4+8* 2]);
1210 AV_COPY32(&h->non_zero_count[mb_xy][36], &h->non_zero_count_cache[4+8*12]);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]);
1211 1231
1212 if(CHROMA444){1232 if(CHROMA444){
1213 AV_COPY32(&h->non_zero_count[mb_xy][24], &h->non_zero_count_cache[4+8* 8]);1233 AV_COPY32(&nnz[24], &nnz_cache[4+8* 8]);
1214 AV_COPY32(&h->non_zero_count[mb_xy][28], &h->non_zero_count_cache[4+8* 9]);1234 AV_COPY32(&nnz[28], &nnz_cache[4+8* 9]);
1215 AV_COPY32(&h->non_zero_count[mb_xy][40], &h->non_zero_count_cache[4+8*13]);1235 AV_COPY32(&nnz[40], &nnz_cache[4+8*13]);
1216 AV_COPY32(&h->non_zero_count[mb_xy][44], &h->non_zero_count_cache[4+8*14]);1236 AV_COPY32(&nnz[44], &nnz_cache[4+8*14]);
1217 }1237 }
1218}1238}
1219 1239
1220static inline void write_back_motion(H264Context *h, int mb_type){1240static 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
1272static av_always_inline void write_back_motion(H264Context *h, int mb_type){
1221 MpegEncContext * const s = &h->s;1273 MpegEncContext * const s = &h->s;
1274 const int b_stride = h->b_stride;
1222 const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; //try mb2b(8)_xy1275 const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; //try mb2b(8)_xy
1223 const int b8_xy= 4*h->mb_xy;1276 const int b8_xy= 4*h->mb_xy;
1224 int list;
1225 1277
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{
1227 fill_rectangle(&s->current_picture.ref_index[0][b8_xy], 2, 2, 2, (uint8_t)LIST_NOT_USED, 1);1281 fill_rectangle(&s->current_picture.ref_index[0][b8_xy], 2, 2, 2, (uint8_t)LIST_NOT_USED, 1);
1228 1282 }
1229 for(list=0; list<h->list_count; list++){1283 if(USES_LIST(mb_type, 1)){
1230 int y, b_stride;1284 write_back_motion_list(h, s, b_stride, b_xy, b8_xy, mb_type, 1);
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 }
1263 }1285 }
1264 1286
1265 if(h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC){1287 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
1272 }1294 }
1273}1295}
1274 1296
1275static inline int get_dct8x8_allowed(H264Context *h){1297static av_always_inline int get_dct8x8_allowed(H264Context *h){
1276 if(h->sps.direct_8x8_inference_flag)1298 if(h->sps.direct_8x8_inference_flag)
1277 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8 )*0x0001000100010001ULL));1299 return !(AV_RN64A(h->sub_mb_type) & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8 )*0x0001000100010001ULL));
1278 else1300 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
1296 1296
1297 if(intra_slice){1297 if(intra_slice){
1298 int ctx=0;1298 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))
1300 ctx++;1300 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))
1302 ctx++;1302 ctx++;
1303 if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 )1303 if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 )
1304 return 0; /* I4x4 */1304 return 0; /* I4x4 */
@@ -1376,10 +1376,10 @@ static int decode_cabac_mb_chroma_pre_mode( H264Context *h) { · 71 unmodified lines
1376 int ctx = 0;1376 int ctx = 0;
1377 1377
1378 /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */1378 /* 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 )
1380 ctx++;1380 ctx++;
1381 1381
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 )
1383 ctx++;1383 ctx++;
1384 1384
1385 if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 )1385 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
1881 int ctx = 0;1881 int ctx = 0;
1882 assert(h->slice_type_nos == AV_PICTURE_TYPE_B);1882 assert(h->slice_type_nos == AV_PICTURE_TYPE_B);
1883 1883
1884 if( !IS_DIRECT( h->left_type[0]-1 ) )1884 if( !IS_DIRECT( h->left_type[LTOP]-1 ) )
1885 ctx++;1885 ctx++;
1886 if( !IS_DIRECT( h->top_type-1 ) )1886 if( !IS_DIRECT( h->top_type-1 ) )
1887 ctx++;1887 ctx++;
@@ -2000,7 +2000,7 @@ decode_intra_mb: · 112 unmodified lines
2000 //av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] );2000 //av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] );
2001 }2001 }
2002 }2002 }
2003 ff_h264_write_back_intra_pred_mode(h);2003 write_back_intra_pred_mode(h);
2004 if( ff_h264_check_intra4x4_pred_mode(h) < 0 ) return -1;2004 if( ff_h264_check_intra4x4_pred_mode(h) < 0 ) return -1;
2005 } else {2005 } else {
2006 h->intra16x16_pred_mode= ff_h264_check_intra_pred_mode( h, h->intra16x16_pred_mode );2006 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
2249 * the transform mode of the current macroblock there. */2249 * the transform mode of the current macroblock there. */
2250 if (CHROMA444 && IS_8x8DCT(mb_type)){2250 if (CHROMA444 && IS_8x8DCT(mb_type)){
2251 int i;2251 int i;
2252 uint8_t *nnz_cache = h->non_zero_count_cache;
2252 for (i = 0; i < 2; i++){2253 for (i = 0; i < 2; i++){
2253 if (h->left_type[i] && !IS_8x8DCT(h->left_type[i])){2254 if (h->left_type[LEFT(i)] && !IS_8x8DCT(h->left_type[LEFT(i)])){
2254 h->non_zero_count_cache[3+8* 1 + 2*8*i]=2255 nnz_cache[3+8* 1 + 2*8*i]=
2255 h->non_zero_count_cache[3+8* 2 + 2*8*i]=2256 nnz_cache[3+8* 2 + 2*8*i]=
2256 h->non_zero_count_cache[3+8* 6 + 2*8*i]=2257 nnz_cache[3+8* 6 + 2*8*i]=
2257 h->non_zero_count_cache[3+8* 7 + 2*8*i]=2258 nnz_cache[3+8* 7 + 2*8*i]=
2258 h->non_zero_count_cache[3+8*11 + 2*8*i]=2259 nnz_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;2260 nnz_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0;
2260 }2261 }
2261 }2262 }
2262 if (h->top_type && !IS_8x8DCT(h->top_type)){2263 if (h->top_type && !IS_8x8DCT(h->top_type)){
2263 uint32_t top_empty = CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040;2264 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(&nnz_cache[4+8* 0], top_empty);
2265 AV_WN32A(&h->non_zero_count_cache[4+8* 5], top_empty);2266 AV_WN32A(&nnz_cache[4+8* 5], top_empty);
2266 AV_WN32A(&h->non_zero_count_cache[4+8*10], top_empty);2267 AV_WN32A(&nnz_cache[4+8*10], top_empty);
2267 }2268 }
2268 }2269 }
2269 s->current_picture.mb_type[mb_xy]= mb_type;2270 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
731 else731 else
732 h->intra4x4_pred_mode_cache[ scan8[i] ] = mode;732 h->intra4x4_pred_mode_cache[ scan8[i] ] = mode;
733 }733 }
734 ff_h264_write_back_intra_pred_mode(h);734 write_back_intra_pred_mode(h);
735 if( ff_h264_check_intra4x4_pred_mode(h) < 0)735 if( ff_h264_check_intra4x4_pred_mode(h) < 0)
736 return -1;736 return -1;
737 }else{737 }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
215void 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) {215void 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) {
216 MpegEncContext * const s = &h->s;216 MpegEncContext * const s = &h->s;
217 int mb_xy;217 int mb_xy;
218 int mb_type, left_type;218 int mb_type, left_type, top_type;
219 int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh;219 int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh;
220 int chroma = !(CONFIG_GRAY && (s->flags&CODEC_FLAG_GRAY));220 int chroma = !(CONFIG_GRAY && (s->flags&CODEC_FLAG_GRAY));
221 int chroma444 = CHROMA444;221 int chroma444 = CHROMA444;
222 222
223 mb_xy = h->mb_xy;223 mb_xy = h->mb_xy;
224 224
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) {
226 ff_h264_filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);226 ff_h264_filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);
227 return;227 return;
228 }228 }
229 assert(!FRAME_MBAFF);229 assert(!FRAME_MBAFF);
230 left_type= h->left_type[0];230 left_type= h->left_type[LTOP];
231 top_type= h->top_type;
231 232
232 mb_type = s->current_picture.mb_type[mb_xy];233 mb_type = s->current_picture.mb_type[mb_xy];
233 qp = s->current_picture.qscale_table[mb_xy];234 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
253 filter_mb_edgev( &img_y[4*0], linesize, bS4, qp0, h);254 filter_mb_edgev( &img_y[4*0], linesize, bS4, qp0, h);
254 if( IS_8x8DCT(mb_type) ) {255 if( IS_8x8DCT(mb_type) ) {
255 filter_mb_edgev( &img_y[4*2], linesize, bS3, qp, h);256 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 }
257 filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h);260 filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h);
258 } else {261 } else {
259 filter_mb_edgev( &img_y[4*1], linesize, bS3, qp, h);262 filter_mb_edgev( &img_y[4*1], linesize, bS3, qp, h);
260 filter_mb_edgev( &img_y[4*2], linesize, bS3, qp, h);263 filter_mb_edgev( &img_y[4*2], linesize, bS3, qp, h);
261 filter_mb_edgev( &img_y[4*3], linesize, bS3, qp, h);264 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 }
263 filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, h);268 filter_mb_edgeh( &img_y[4*1*linesize], linesize, bS3, qp, h);
264 filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h);269 filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h);
265 filter_mb_edgeh( &img_y[4*3*linesize], linesize, bS3, qp, h);270 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
273 if( IS_8x8DCT(mb_type) ) {278 if( IS_8x8DCT(mb_type) ) {
274 filter_mb_edgev( &img_cb[4*2], linesize, bS3, qpc, h);279 filter_mb_edgev( &img_cb[4*2], linesize, bS3, qpc, h);
275 filter_mb_edgev( &img_cr[4*2], linesize, bS3, qpc, h);280 filter_mb_edgev( &img_cr[4*2], linesize, bS3, qpc, h);
276 filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, h);281 if(top_type){
277 filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, h);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 }
278 filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, h);285 filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, h);
279 filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, h);286 filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, h);
280 } else {287 } 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
284 filter_mb_edgev( &img_cr[4*2], linesize, bS3, qpc, h);291 filter_mb_edgev( &img_cr[4*2], linesize, bS3, qpc, h);
285 filter_mb_edgev( &img_cb[4*3], linesize, bS3, qpc, h);292 filter_mb_edgev( &img_cb[4*3], linesize, bS3, qpc, h);
286 filter_mb_edgev( &img_cr[4*3], linesize, bS3, qpc, h);293 filter_mb_edgev( &img_cr[4*3], linesize, bS3, qpc, h);
287 filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, h);294 if(top_type){
288 filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, h);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 }
289 filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, h);298 filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, h);
290 filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, h);299 filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, h);
291 filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, h);300 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
300 }309 }
301 filter_mb_edgecv( &img_cb[2*2], uvlinesize, bS3, qpc, h);310 filter_mb_edgecv( &img_cb[2*2], uvlinesize, bS3, qpc, h);
302 filter_mb_edgecv( &img_cr[2*2], uvlinesize, bS3, qpc, h);311 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 }
304 filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, h);316 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);
306 filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, h);317 filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, h);
307 }318 }
308 }319 }
@@ -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
318 AV_WN64A(bS[1][2], 0x0002000200020002ULL);329 AV_WN64A(bS[1][2], 0x0002000200020002ULL);
319 } else {330 } else {
320 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;331 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;
322 int step = 1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1;333 int step = 1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1;
323 edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;334 edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
324 h->h264dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,335 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
326 }337 }
327 if( IS_INTRA(left_type) )338 if( IS_INTRA(left_type) )
328 AV_WN64A(bS[0][0], 0x0004000400040004ULL);339 AV_WN64A(bS[0][0], 0x0004000400040004ULL);
329 if( IS_INTRA(h->top_type) )340 if( IS_INTRA(top_type) )
330 AV_WN64A(bS[1][0], FIELD_PICTURE ? 0x0003000300030003ULL : 0x0004000400040004ULL);341 AV_WN64A(bS[1][0], FIELD_PICTURE ? 0x0003000300030003ULL : 0x0004000400040004ULL);
331 342
332#define FILTER(hv,dir,edge)\343#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
345 if(left_type)356 if(left_type)
346 FILTER(v,0,0);357 FILTER(v,0,0);
347 if( edges == 1 ) {358 if( edges == 1 ) {
348 FILTER(h,1,0);359 if(top_type)
360 FILTER(h,1,0);
349 } else if( IS_8x8DCT(mb_type) ) {361 } else if( IS_8x8DCT(mb_type) ) {
350 FILTER(v,0,2);362 FILTER(v,0,2);
351 FILTER(h,1,0);363 if(top_type)
364 FILTER(h,1,0);
352 FILTER(h,1,2);365 FILTER(h,1,2);
353 } else {366 } else {
354 FILTER(v,0,1);367 FILTER(v,0,1);
355 FILTER(v,0,2);368 FILTER(v,0,2);
356 FILTER(v,0,3);369 FILTER(v,0,3);
357 FILTER(h,1,0);370 if(top_type)
371 FILTER(h,1,0);
358 FILTER(h,1,1);372 FILTER(h,1,1);
359 FILTER(h,1,2);373 FILTER(h,1,2);
360 FILTER(h,1,3);374 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
397 int edge;411 int edge;
398 int chroma_qp_avg[2];412 int chroma_qp_avg[2];
399 const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;413 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;
401 415
402 // how often to recheck mv-based bS when iterating between edges416 // how often to recheck mv-based bS when iterating between edges
403 static const uint8_t mask_edge_tab[2][8]={{0,3,3,3,1,1,1,1},417 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
633 647
634 if (FRAME_MBAFF648 if (FRAME_MBAFF
635 // and current and left pair do not have the same interlaced type649 // 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])
637 // and left mb is in available to us651 // and left mb is in available to us
638 && h->left_type[0]) {652 && h->left_type[LTOP]) {
639 /* First vertical edge is different in MBAFF frames653 /* First vertical edge is different in MBAFF frames
640 * There are 8 different bS to compute and 2 different Qp654 * There are 8 different bS to compute and 2 different Qp
641 */655 */
@@ -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
663 const uint8_t *off= offset[MB_FIELD][mb_y&1];677 const uint8_t *off= offset[MB_FIELD][mb_y&1];
664 for( i = 0; i < 8; i++ ) {678 for( i = 0; i < 8; i++ ) {
665 int j= MB_FIELD ? i>>2 : i&1;679 int j= MB_FIELD ? i>>2 : i&1;
666 int mbn_xy = h->left_mb_xy[j];680 int mbn_xy = h->left_mb_xy[LEFT(j)];
667 int mbn_type= h->left_type[j];681 int mbn_type= h->left_type[LEFT(j)];
668 682
669 if( IS_INTRA( mbn_type ) )683 if( IS_INTRA( mbn_type ) )
670 bS[i] = 4;684 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
64 if(!MB_FIELD64 if(!MB_FIELD
65 && IS_INTERLACED(h->left_type[0])){65 && IS_INTERLACED(h->left_type[0])){
66 SET_DIAG_MV(*2, >>1, h->left_mb_xy[0]+s->mb_stride, (s->mb_y&1)*2+(i>>5));66 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]);
68 }67 }
69 if(MB_FIELD68 if(MB_FIELD
70 && !IS_INTERLACED(h->left_type[0])){69 && !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
237}237}
238/**238/**
239 * IDCT transforms the 16 dc values and dequantizes them.239 * IDCT transforms the 16 dc values and dequantizes them.
240 * @param qp quantization parameter
241 */240 */
242void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){241void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){
243#define stride 16242#define stride 16
libavcodec/ituh263dec.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30//#define DEBUG30//#define DEBUG
31#include <limits.h>31#include <limits.h>
32 32
33#include "libavutil/mathematics.h"
33#include "dsputil.h"34#include "dsputil.h"
34#include "avcodec.h"35#include "avcodec.h"
35#include "mpegvideo.h"36#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
149/**149/**
150 * Calculate LPC coefficients for multiple orders150 * Calculate LPC coefficients for multiple orders
151 *151 *
152 * @param use_lpc LPC method for determining coefficients152 * @param lpc_type LPC method for determining coefficients
153 * 0 = LPC with fixed pre-defined coeffs153 * 0 = LPC with fixed pre-defined coeffs
154 * 1 = LPC with coeffs determined by Levinson-Durbin recursion154 * 1 = LPC with coeffs determined by Levinson-Durbin recursion
155 * 2+ = LPC with coeffs determined by Cholesky factorization using (use_lpc-1) passes.155 * 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
1505 av_log(avctx, AV_LOG_WARNING, "Found EOI before any SOF, ignoring\n");1505 av_log(avctx, AV_LOG_WARNING, "Found EOI before any SOF, ignoring\n");
1506 break;1506 break;
1507 }1507 }
1508 {1508 if (s->interlaced) {
1509 if (s->interlaced) {1509 s->bottom_field ^= 1;
1510 s->bottom_field ^= 1;1510 /* if not bottom field, do not output image yet */
1511 /* if not bottom field, do not output image yet */1511 if (s->bottom_field == !s->interlace_polarity)
1512 if (s->bottom_field == !s->interlace_polarity)1512 goto not_the_end;
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;
1529 }1513 }
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;
1531 case SOS:1528 case SOS:
1532 if (!s->got_picture) {1529 if (!s->got_picture) {
1533 av_log(avctx, AV_LOG_WARNING, "Can not process SOS before SOF, skipping\n");1530 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
993}993}
994 994
995/**995/**
996 @param P[10][2] a list of candidate mvs to check before starting the996 @param P a list of candidate mvs to check before starting the
997 iterative search. If one of the candidates is close to the optimal mv, then997 iterative search. If one of the candidates is close to the optimal mv, then
998 it takes fewer iterations. And it increases the chance that we find the998 it takes fewer iterations. And it increases the chance that we find the
999 optimal mv.999 optimal mv.
libavcodec/mpeg12.c+0−2
@@ -1965,8 +1965,6 @@ static int slice_decode_thread(AVCodecContext *c, void *arg){ · 1964 unmodified lines
1965 if(mb_y < 0 || mb_y >= s->end_mb_y)1965 if(mb_y < 0 || mb_y >= s->end_mb_y)
1966 return -1;1966 return -1;
1967 }1967 }
1968
1969 return 0; //not reached
1970}1968}
1971 1969
1972/**1970/**
libavcodec/mpegvideo_enc.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
28 */28 */
29 29
30#include "libavutil/intmath.h"30#include "libavutil/intmath.h"
31#include "libavutil/mathematics.h"
31#include "avcodec.h"32#include "avcodec.h"
32#include "dsputil.h"33#include "dsputil.h"
33#include "mpegvideo.h"34#include "mpegvideo.h"
libavcodec/pcm.c+0−1
@@ -440,7 +440,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, · 439 unmodified lines
440 default:440 default:
441 av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");441 av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
442 return -1;442 return -1;
443 break;
444 }443 }
445 samples = (short *) dst_int32_t;444 samples = (short *) dst_int32_t;
446 break;445 break;
libavcodec/shorten.c+0−3
@@ -471,7 +471,6 @@ static int shorten_decode_frame(AVCodecContext *avctx, · 470 unmodified lines
471 s->cur_chan = 0;471 s->cur_chan = 0;
472 goto frame_done;472 goto frame_done;
473 }473 }
474 break;
475 }474 }
476 break;475 break;
477 case FN_VERBATIM:476 case FN_VERBATIM:
@@ -489,11 +488,9 @@ static int shorten_decode_frame(AVCodecContext *avctx, · 11 unmodified lines
489 case FN_QUIT:488 case FN_QUIT:
490 *data_size = 0;489 *data_size = 0;
491 return buf_size;490 return buf_size;
492 break;
493 default:491 default:
494 av_log(avctx, AV_LOG_ERROR, "unknown shorten function %d\n", cmd);492 av_log(avctx, AV_LOG_ERROR, "unknown shorten function %d\n", cmd);
495 return -1;493 return -1;
496 break;
497 }494 }
498 }495 }
499frame_done:496frame_done:
libavcodec/snow.c+1−342
@@ -33,42 +33,6 @@ · 32 unmodified lines
33#undef NDEBUG33#undef NDEBUG
34#include <assert.h>34#include <assert.h>
35 35
36static 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};
54static 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};
72static const int8_t quant3bA[256]={36static const int8_t quant3bA[256]={
73 0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,37 0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
74 1,-1, 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,
@@ -87,153 +51,7 @@ static const int8_t quant3bA[256]={ · 12 unmodified lines
87 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,
88 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,
89};53};
90static 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};
108static 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};
126static 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};
144static 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};
162static 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};
180 54
181#if 0 //64*cubic
182static 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};
217static 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
237static const uint8_t obmc32[1024]={55static const uint8_t obmc32[1024]={
238 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,56 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,
239 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,57 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
288 0, 4, 4, 8, 8, 12, 12, 16, 16, 12, 12, 8, 8, 4, 4, 0,106 0, 4, 4, 8, 8, 12, 12, 16, 16, 12, 12, 8, 8, 4, 4, 0,
289//error:0.000015107//error:0.000015
290};108};
291#else //64*cos
292static 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};
327static 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 */
347 109
348//linear *64110//linear *64
349static const uint8_t obmc8[64]={111static 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
509 if(v){271 if(v){
510 const int a= FFABS(v);272 const int a= FFABS(v);
511 const int e= av_log2(a);273 const int e= av_log2(a);
512#if 1
513 const int el= FFMIN(e, 10);274 const int el= FFMIN(e, 10);
514 put_rac(c, state+0, 0);275 put_rac(c, state+0, 0);
515 276
@@ -530,35 +291,6 @@ static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signe · 14 unmodified lines
530 291
531 if(is_signed)292 if(is_signed)
532 put_rac(c, state+11 + el, v < 0); //11..21293 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 */
562 }else{294 }else{
563 put_rac(c, state+0, 1);295 put_rac(c, state+0, 1);
564 }296 }
@@ -789,14 +521,6 @@ static int alloc_blocks(SnowContext *s){ · 224 unmodified lines
789 return 0;521 return 0;
790}522}
791 523
792static 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
800static 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){524static 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){
801 const int w= s->b_width << s->block_max_depth;525 const int w= s->b_width << s->block_max_depth;
802 const int rem_depth= s->block_max_depth - level;526 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
1323 block[3]= ptmp;1047 block[3]= ptmp;
1324 pred_block(s, block[3], tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);1048 pred_block(s, block[3], tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h);
1325 }1049 }
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
1360 if(sliced){1050 if(sliced){
1361 s->dwt.inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);1051 s->dwt.inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8);
1362 }else{1052 }else{
@@ -1387,7 +1077,6 @@ static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer · 24 unmodified lines
1387 }1077 }
1388 }1078 }
1389 }1079 }
1390#endif /* 0 */
1391}1080}
1392 1081
1393static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, IDWTELEM * old_buffer, int plane_index, int add, int mb_y){1082static 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
4008#undef printf3697#undef printf
4009 3698
4010#include "libavutil/lfg.h"3699#include "libavutil/lfg.h"
3700#include "libavutil/mathematics.h"
4011 3701
4012int main(void){3702int main(void){
4013 int width=256;3703 int width=256;
@@ -4042,27 +3732,6 @@ int main(void){ · 28 unmodified lines
4042 for(i=0; i<width*height; i++)3732 for(i=0; i<width*height; i++)
4043 if(FFABS(buffer[0][i] - buffer[1][i])>20) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]);3733 if(FFABS(buffer[0][i] - buffer[1][i])>20) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]);
4044 3734
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
4066 {3735 {
4067 int level, orientation, x, y;3736 int level, orientation, x, y;
4068 int64_t errors[8][4];3737 int64_t errors[8][4];
@@ -4120,7 +3789,6 @@ int main(void){ · 51 unmodified lines
4120 buf+=stride>>1;3789 buf+=stride>>1;
4121 3790
4122 memset(buffer[0], 0, sizeof(int)*width*height);3791 memset(buffer[0], 0, sizeof(int)*width*height);
4123#if 1
4124 for(y=0; y<height; y++){3792 for(y=0; y<height; y++){
4125 for(x=0; x<width; x++){3793 for(x=0; x<width; x++){
4126 int tab[4]={0,2,3,1};3794 int tab[4]={0,2,3,1};
@@ -4128,15 +3796,6 @@ int main(void){ · 1 unmodified line
4128 }3796 }
4129 }3797 }
4130 ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);3798 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
4140 for(y=0; y<height; y++){3799 for(y=0; y<height; y++){
4141 for(x=0; x<width; x++){3800 for(x=0; x<width; x++){
4142 int64_t d= buffer[0][x + y*width];3801 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
591 }591 }
592 }592 }
593 593
594 ff_h264_write_back_intra_pred_mode(h);594 write_back_intra_pred_mode(h);
595 595
596 if (mb_type == 8) {596 if (mb_type == 8) {
597 ff_h264_check_intra4x4_pred_mode(h);597 ff_h264_check_intra4x4_pred_mode(h);
libavcodec/utils.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
27 27
28#include "libavutil/avstring.h"28#include "libavutil/avstring.h"
29#include "libavutil/crc.h"29#include "libavutil/crc.h"
30#include "libavutil/mathematics.h"
30#include "libavutil/pixdesc.h"31#include "libavutil/pixdesc.h"
31#include "libavutil/audioconvert.h"32#include "libavutil/audioconvert.h"
32#include "libavutil/imgutils.h"33#include "libavutil/imgutils.h"
libavcodec/vp8.c+1−1
@@ -1039,7 +1039,7 @@ static const uint8_t subpel_idx[3][8] = { · 1038 unmodified lines
1039 * @param s VP8 decoding context1039 * @param s VP8 decoding context
1040 * @param luma 1 for luma (Y) planes, 0 for chroma (Cb/Cr) planes1040 * @param luma 1 for luma (Y) planes, 0 for chroma (Cb/Cr) planes
1041 * @param dst target buffer for block data at block position1041 * @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)
1043 * @param mv motion vector (relative to block position) to get pixel data from1043 * @param mv motion vector (relative to block position) to get pixel data from
1044 * @param x_off horizontal position of block from origin (0, 0)1044 * @param x_off horizontal position of block from origin (0, 0)
1045 * @param y_off vertical position of block from origin (0, 0)1045 * @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
47 x86/fmtconvert.o \47 x86/fmtconvert.o \
48 x86/h264_chromamc.o \48 x86/h264_chromamc.o \
49 x86/h264_chromamc_10bit.o \49 x86/h264_chromamc_10bit.o \
50 x86/h264_qpel_10bit.o \
50 $(YASM-OBJS-yes)51 $(YASM-OBJS-yes)
51 52
52MMX-OBJS-$(CONFIG_FFT) += x86/fft.o53MMX-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
2530 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_mmx2;2530 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_mmx2;
2531 }2531 }
2532 2532
2533#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU) \2533#define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX) \
2534 c->PFX ## _pixels_tab[IDX][ 0] = PFX ## SIZE ## _mc00_ ## CPU; \2534 c->PFX ## _pixels_tab[IDX][ 0] = PREFIX ## PFX ## SIZE ## _mc00_ ## CPU; \
2535 c->PFX ## _pixels_tab[IDX][ 1] = PFX ## SIZE ## _mc10_ ## CPU; \2535 c->PFX ## _pixels_tab[IDX][ 1] = PREFIX ## PFX ## SIZE ## _mc10_ ## CPU; \
2536 c->PFX ## _pixels_tab[IDX][ 2] = PFX ## SIZE ## _mc20_ ## CPU; \2536 c->PFX ## _pixels_tab[IDX][ 2] = PREFIX ## PFX ## SIZE ## _mc20_ ## CPU; \
2537 c->PFX ## _pixels_tab[IDX][ 3] = PFX ## SIZE ## _mc30_ ## CPU; \2537 c->PFX ## _pixels_tab[IDX][ 3] = PREFIX ## PFX ## SIZE ## _mc30_ ## CPU; \
2538 c->PFX ## _pixels_tab[IDX][ 4] = PFX ## SIZE ## _mc01_ ## CPU; \2538 c->PFX ## _pixels_tab[IDX][ 4] = PREFIX ## PFX ## SIZE ## _mc01_ ## CPU; \
2539 c->PFX ## _pixels_tab[IDX][ 5] = PFX ## SIZE ## _mc11_ ## CPU; \2539 c->PFX ## _pixels_tab[IDX][ 5] = PREFIX ## PFX ## SIZE ## _mc11_ ## CPU; \
2540 c->PFX ## _pixels_tab[IDX][ 6] = PFX ## SIZE ## _mc21_ ## CPU; \2540 c->PFX ## _pixels_tab[IDX][ 6] = PREFIX ## PFX ## SIZE ## _mc21_ ## CPU; \
2541 c->PFX ## _pixels_tab[IDX][ 7] = PFX ## SIZE ## _mc31_ ## CPU; \2541 c->PFX ## _pixels_tab[IDX][ 7] = PREFIX ## PFX ## SIZE ## _mc31_ ## CPU; \
2542 c->PFX ## _pixels_tab[IDX][ 8] = PFX ## SIZE ## _mc02_ ## CPU; \2542 c->PFX ## _pixels_tab[IDX][ 8] = PREFIX ## PFX ## SIZE ## _mc02_ ## CPU; \
2543 c->PFX ## _pixels_tab[IDX][ 9] = PFX ## SIZE ## _mc12_ ## CPU; \2543 c->PFX ## _pixels_tab[IDX][ 9] = PREFIX ## PFX ## SIZE ## _mc12_ ## CPU; \
2544 c->PFX ## _pixels_tab[IDX][10] = PFX ## SIZE ## _mc22_ ## CPU; \2544 c->PFX ## _pixels_tab[IDX][10] = PREFIX ## PFX ## SIZE ## _mc22_ ## CPU; \
2545 c->PFX ## _pixels_tab[IDX][11] = PFX ## SIZE ## _mc32_ ## CPU; \2545 c->PFX ## _pixels_tab[IDX][11] = PREFIX ## PFX ## SIZE ## _mc32_ ## CPU; \
2546 c->PFX ## _pixels_tab[IDX][12] = PFX ## SIZE ## _mc03_ ## CPU; \2546 c->PFX ## _pixels_tab[IDX][12] = PREFIX ## PFX ## SIZE ## _mc03_ ## CPU; \
2547 c->PFX ## _pixels_tab[IDX][13] = PFX ## SIZE ## _mc13_ ## CPU; \2547 c->PFX ## _pixels_tab[IDX][13] = PREFIX ## PFX ## SIZE ## _mc13_ ## CPU; \
2548 c->PFX ## _pixels_tab[IDX][14] = PFX ## SIZE ## _mc23_ ## CPU; \2548 c->PFX ## _pixels_tab[IDX][14] = PREFIX ## PFX ## SIZE ## _mc23_ ## CPU; \
2549 c->PFX ## _pixels_tab[IDX][15] = PFX ## SIZE ## _mc33_ ## CPU2549 c->PFX ## _pixels_tab[IDX][15] = PREFIX ## PFX ## SIZE ## _mc33_ ## CPU
2550 2550
2551 SET_QPEL_FUNCS(put_qpel, 0, 16, mmx2);2551 SET_QPEL_FUNCS(put_qpel, 0, 16, mmx2, );
2552 SET_QPEL_FUNCS(put_qpel, 1, 8, mmx2);2552 SET_QPEL_FUNCS(put_qpel, 1, 8, mmx2, );
2553 SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmx2);2553 SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmx2, );
2554 SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmx2);2554 SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmx2, );
2555 SET_QPEL_FUNCS(avg_qpel, 0, 16, mmx2);2555 SET_QPEL_FUNCS(avg_qpel, 0, 16, mmx2, );
2556 SET_QPEL_FUNCS(avg_qpel, 1, 8, mmx2);2556 SET_QPEL_FUNCS(avg_qpel, 1, 8, mmx2, );
2557 2557
2558 if (!high_bit_depth) {2558 if (!high_bit_depth) {
2559 SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmx2);2559 SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmx2, );
2560 SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmx2);2560 SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmx2, );
2561 SET_QPEL_FUNCS(put_h264_qpel, 2, 4, mmx2);2561 SET_QPEL_FUNCS(put_h264_qpel, 2, 4, mmx2, );
2562 SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmx2);2562 SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, mmx2, );
2563 SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2);2563 SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmx2, );
2564 SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2);2564 SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmx2, );
2565 }2565 }
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
2566 2578
2567 SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2);2579 SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, mmx2, );
2568 SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2);2580 SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, mmx2, );
2569 SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmx2);2581 SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, mmx2, );
2570 SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmx2);2582 SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, mmx2, );
2571 2583
2572#if HAVE_YASM2584#if HAVE_YASM
2573 c->avg_rv40_chroma_pixels_tab[0]= ff_avg_rv40_chroma_mc8_mmx2;2585 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
2627 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_3dnow;2639 c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_exact_3dnow;
2628 }2640 }
2629 2641
2630 SET_QPEL_FUNCS(put_qpel, 0, 16, 3dnow);2642 SET_QPEL_FUNCS(put_qpel, 0, 16, 3dnow, );
2631 SET_QPEL_FUNCS(put_qpel, 1, 8, 3dnow);2643 SET_QPEL_FUNCS(put_qpel, 1, 8, 3dnow, );
2632 SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, 3dnow);2644 SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, 3dnow, );
2633 SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, 3dnow);2645 SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, 3dnow, );
2634 SET_QPEL_FUNCS(avg_qpel, 0, 16, 3dnow);2646 SET_QPEL_FUNCS(avg_qpel, 0, 16, 3dnow, );
2635 SET_QPEL_FUNCS(avg_qpel, 1, 8, 3dnow);2647 SET_QPEL_FUNCS(avg_qpel, 1, 8, 3dnow, );
2636 2648
2637 if (!high_bit_depth) {2649 if (!high_bit_depth) {
2638 SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 3dnow);2650 SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 3dnow, );
2639 SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 3dnow);2651 SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 3dnow, );
2640 SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 3dnow);2652 SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 3dnow, );
2641 SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 3dnow);2653 SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 3dnow, );
2642 SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 3dnow);2654 SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 3dnow, );
2643 SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 3dnow);2655 SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 3dnow, );
2644 }2656 }
2645 2657
2646 SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, 3dnow);2658 SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, 3dnow, );
2647 SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, 3dnow);2659 SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, 3dnow, );
2648 SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, 3dnow);2660 SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, 3dnow, );
2649 SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, 3dnow);2661 SET_QPEL_FUNCS(avg_2tap_qpel, 1, 8, 3dnow, );
2650 2662
2651#if HAVE_YASM2663#if HAVE_YASM
2652 if (!high_bit_depth) {2664 if (!high_bit_depth) {
@@ -2690,7 +2702,20 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) · 37 unmodified lines
2690 H264_QPEL_FUNCS(3, 3, sse2);2702 H264_QPEL_FUNCS(3, 3, sse2);
2691 }2703 }
2692#if HAVE_YASM2704#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;
2693 if (bit_depth == 10) {2710 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
2694 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_10_sse2;2719 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_10_sse2;
2695 c->avg_h264_chroma_pixels_tab[0]= ff_avg_h264_chroma_mc8_10_sse2;2720 c->avg_h264_chroma_pixels_tab[0]= ff_avg_h264_chroma_mc8_10_sse2;
2696 }2721 }
@@ -2712,6 +2737,11 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) · 15 unmodified lines
2712 H264_QPEL_FUNCS(3, 2, ssse3);2737 H264_QPEL_FUNCS(3, 2, ssse3);
2713 H264_QPEL_FUNCS(3, 3, ssse3);2738 H264_QPEL_FUNCS(3, 3, ssse3);
2714 }2739 }
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 }
2715#if HAVE_YASM2745#if HAVE_YASM
2716 if (!high_bit_depth) {2746 if (!high_bit_depth) {
2717 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_ssse3_rnd;2747 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
2807#if HAVE_AVX && HAVE_YASM2837#if HAVE_AVX && HAVE_YASM
2808 if (mm_flags & AV_CPU_FLAG_AVX) {2838 if (mm_flags & AV_CPU_FLAG_AVX) {
2809 if (bit_depth == 10) {2839 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
2810 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_10_avx;2846 c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_10_avx;
2811 c->avg_h264_chroma_pixels_tab[0]= ff_avg_h264_chroma_mc8_10_avx;2847 c->avg_h264_chroma_pixels_tab[0]= ff_avg_h264_chroma_mc8_10_avx;
2812 }2848 }
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
28SECTION_RODATA 32
29
30cextern pw_16
31cextern pw_1
32cextern pb_0
33
34pw_pixel_max: times 8 dw ((1 << 10)-1)
35
36pad10: times 8 dw 10*1023
37pad20: times 8 dw 20*1023
38pad30: times 8 dw 30*1023
39depad: times 4 dd 32*20*1023 + 512
40depad2: times 8 dw 20*1023 + 16*1022 + 16
41unpad: times 8 dw 16*1022/32 ; needs to be mod 16
42
43tap1: times 4 dw 1, -5
44tap2: times 4 dw 20, 20
45tap3: times 4 dw -5, 1
46pd_0f: times 4 dd 0xffff
47
48SECTION .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
101INIT_MMX
102%1 mmxext, put, 4
103INIT_XMM
104%1 sse2 , put, 8
105
106%define OP_MOV AVG_MOV
107INIT_MMX
108%1 mmxext, avg, 4
109INIT_XMM
110%1 sse2 , avg, 8
111%endmacro
112
113%macro MCAxA 8
114%ifdef ARCH_X86_64
115%ifnidn %1,mmxext
116MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8
117%endif
118%else
119MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8
120%endif
121%endmacro
122
123%macro MCAxA_OP 8
124cglobal %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
165MCAxA %1, %2, %3, %4, i, %5,%6,%7
166
167cglobal %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
173stub_%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
191INIT_MMX
192cglobal_mc mmxext, %1, mc00, 4, 3,4,0
193 lea r3, [r2*3]
194 COPY4
195 ret
196
197INIT_XMM
198cglobal %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
206cglobal %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
225MC00 put
226
227%define OP_MOV AVG_MOV
228MC00 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
236INIT_MMX
237%1 mmxext , put, 4
238INIT_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
246INIT_MMX
247%1 mmxext , avg, 4
248INIT_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
256cglobal_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
312MC_CACHE MC20
313
314;-----------------------------------------------------------------------------
315; void h264_qpel_mc30(uint8_t *dst, uint8_t *src, int stride)
316;-----------------------------------------------------------------------------
317%macro MC30 3-4
318cglobal_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
323MC_CACHE MC30
324
325;-----------------------------------------------------------------------------
326; void h264_qpel_mc10(uint8_t *dst, uint8_t *src, int stride)
327;-----------------------------------------------------------------------------
328%macro MC10 3-4
329cglobal_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
390MC_CACHE MC10
391
392;-----------------------------------------------------------------------------
393; void h264_qpel_mc02(uint8_t *dst, uint8_t *src, int stride)
394;-----------------------------------------------------------------------------
395%macro V_FILT 11
396v_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
405INIT_MMX
406RESET_MM_PERMUTATION
407%assign i 0
408%rep 4
409V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 4, i, mmxext
410SWAP 0,1,2,3,4,5
411%assign i i+1
412%endrep
413
414INIT_XMM
415RESET_MM_PERMUTATION
416%assign i 0
417%rep 6
418V_FILT m0, m1, m2, m3, m4, m5, m6, m7, 8, i, sse2
419SWAP 0,1,2,3,4,5
420%assign i i+1
421%endrep
422
423%macro MC02 3
424cglobal_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
439MC MC02
440
441;-----------------------------------------------------------------------------
442; void h264_qpel_mc01(uint8_t *dst, uint8_t *src, int stride)
443;-----------------------------------------------------------------------------
444%macro MC01 3
445cglobal_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
465MC MC01
466
467;-----------------------------------------------------------------------------
468; void h264_qpel_mc03(uint8_t *dst, uint8_t *src, int stride)
469;-----------------------------------------------------------------------------
470%macro MC03 3
471cglobal_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
476MC MC03
477
478;-----------------------------------------------------------------------------
479; void h264_qpel_mc11(uint8_t *dst, uint8_t *src, int stride)
480;-----------------------------------------------------------------------------
481%macro H_FILT_AVG 3-4
482h_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
509INIT_MMX
510RESET_MM_PERMUTATION
511%assign i 0
512%rep 3
513H_FILT_AVG mmxext, 4, i
514SWAP 0,1,2,3,4,5
515%assign i i+1
516%endrep
517H_FILT_AVG mmxext, 4, i, 0
518
519INIT_XMM
520RESET_MM_PERMUTATION
521%assign i 0
522%rep 6
523%if i==1
524H_FILT_AVG sse2, 8, i, 0
525%else
526H_FILT_AVG sse2, 8, i
527%endif
528SWAP 0,1,2,3,4,5
529%assign i i+1
530%endrep
531
532%macro MC11 3
533; this REALLY needs x86_64
534cglobal_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
558MC MC11
559
560;-----------------------------------------------------------------------------
561; void h264_qpel_mc31(uint8_t *dst, uint8_t *src, int stride)
562;-----------------------------------------------------------------------------
563%macro MC31 3
564cglobal_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
570MC MC31
571
572;-----------------------------------------------------------------------------
573; void h264_qpel_mc13(uint8_t *dst, uint8_t *src, int stride)
574;-----------------------------------------------------------------------------
575%macro MC13 3
576cglobal_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
581MC MC13
582
583;-----------------------------------------------------------------------------
584; void h264_qpel_mc33(uint8_t *dst, uint8_t *src, int stride)
585;-----------------------------------------------------------------------------
586%macro MC33 3
587cglobal_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
593MC 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
625put_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
664INIT_MMX
665HV mmxext, 4
666INIT_XMM
667HV 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
681h%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
728INIT_MMX
729H_LOOP mmxext, 4
730INIT_XMM
731H_LOOP sse2 , 8
732
733%macro MC22 3
734cglobal_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
764MC MC22
765
766;-----------------------------------------------------------------------------
767; void h264_qpel_mc12(uint8_t *dst, uint8_t *src, int stride)
768;-----------------------------------------------------------------------------
769%macro MC12 3
770cglobal_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
809MC MC12
810
811;-----------------------------------------------------------------------------
812; void h264_qpel_mc32(uint8_t *dst, uint8_t *src, int stride)
813;-----------------------------------------------------------------------------
814%macro MC32 3
815cglobal_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
827MC MC32
828
829;-----------------------------------------------------------------------------
830; void h264_qpel_mc21(uint8_t *dst, uint8_t *src, int stride)
831;-----------------------------------------------------------------------------
832%macro H_NRD 2
833put_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
857INIT_MMX
858H_NRD mmxext, 4
859INIT_XMM
860H_NRD sse2 , 8
861
862%macro MC21 3
863cglobal_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
880MC MC21
881
882;-----------------------------------------------------------------------------
883; void h264_qpel_mc23(uint8_t *dst, uint8_t *src, int stride)
884;-----------------------------------------------------------------------------
885%macro MC23 3
886cglobal_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
891MC MC23
libavcodec/x86/h264_qpel_mmx.c+98−0
@@ -1,5 +1,6 @@
1/*1/*
2 * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt2 * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
3 * Copyright (c) 2011 Daniel Kang
3 *4 *
4 * This file is part of FFmpeg.5 * This file is part of FFmpeg.
5 *6 *
@@ -1199,3 +1200,100 @@ H264_MC_816(H264_MC_HV, sse2) · 1193 unmodified lines
1199H264_MC_816(H264_MC_H, ssse3)1200H264_MC_816(H264_MC_H, ssse3)
1200H264_MC_816(H264_MC_HV, ssse3)1201H264_MC_816(H264_MC_HV, ssse3)
1201#endif1202#endif
1203
1204
1205
1206//10bit
1207#define LUMA_MC_OP(OP, NUM, DEPTH, TYPE, OPT) \
1208void 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
1225LUMA_MC_ALL(10, mc00, mmxext)
1226LUMA_MC_ALL(10, mc10, mmxext)
1227LUMA_MC_ALL(10, mc20, mmxext)
1228LUMA_MC_ALL(10, mc30, mmxext)
1229LUMA_MC_ALL(10, mc01, mmxext)
1230LUMA_MC_ALL(10, mc11, mmxext)
1231LUMA_MC_ALL(10, mc21, mmxext)
1232LUMA_MC_ALL(10, mc31, mmxext)
1233LUMA_MC_ALL(10, mc02, mmxext)
1234LUMA_MC_ALL(10, mc12, mmxext)
1235LUMA_MC_ALL(10, mc22, mmxext)
1236LUMA_MC_ALL(10, mc32, mmxext)
1237LUMA_MC_ALL(10, mc03, mmxext)
1238LUMA_MC_ALL(10, mc13, mmxext)
1239LUMA_MC_ALL(10, mc23, mmxext)
1240LUMA_MC_ALL(10, mc33, mmxext)
1241
1242LUMA_MC_816(10, mc00, sse2)
1243LUMA_MC_816(10, mc10, sse2)
1244LUMA_MC_816(10, mc10, sse2_cache64)
1245LUMA_MC_816(10, mc10, ssse3_cache64)
1246LUMA_MC_816(10, mc20, sse2)
1247LUMA_MC_816(10, mc20, sse2_cache64)
1248LUMA_MC_816(10, mc20, ssse3_cache64)
1249LUMA_MC_816(10, mc30, sse2)
1250LUMA_MC_816(10, mc30, sse2_cache64)
1251LUMA_MC_816(10, mc30, ssse3_cache64)
1252LUMA_MC_816(10, mc01, sse2)
1253LUMA_MC_816(10, mc11, sse2)
1254LUMA_MC_816(10, mc21, sse2)
1255LUMA_MC_816(10, mc31, sse2)
1256LUMA_MC_816(10, mc02, sse2)
1257LUMA_MC_816(10, mc12, sse2)
1258LUMA_MC_816(10, mc22, sse2)
1259LUMA_MC_816(10, mc32, sse2)
1260LUMA_MC_816(10, mc03, sse2)
1261LUMA_MC_816(10, mc13, sse2)
1262LUMA_MC_816(10, mc23, sse2)
1263LUMA_MC_816(10, mc33, sse2)
1264
1265#define QPEL16_OPMC(OP, MC, MMX)\
1266void 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)\
1276QPEL16_OPMC(put, MC, MMX)\
1277QPEL16_OPMC(avg, MC, MMX)
1278
1279#define QPEL16(MMX)\
1280QPEL16_OP(mc00, MMX)\
1281QPEL16_OP(mc01, MMX)\
1282QPEL16_OP(mc02, MMX)\
1283QPEL16_OP(mc03, MMX)\
1284QPEL16_OP(mc10, MMX)\
1285QPEL16_OP(mc11, MMX)\
1286QPEL16_OP(mc12, MMX)\
1287QPEL16_OP(mc13, MMX)\
1288QPEL16_OP(mc20, MMX)\
1289QPEL16_OP(mc21, MMX)\
1290QPEL16_OP(mc22, MMX)\
1291QPEL16_OP(mc23, MMX)\
1292QPEL16_OP(mc30, MMX)\
1293QPEL16_OP(mc31, MMX)\
1294QPEL16_OP(mc32, MMX)\
1295QPEL16_OP(mc33, MMX)
1296
1297#if ARCH_X86_32 // ARCH_X86_64 implies sse2+
1298QPEL16(mmxext)
1299#endif
libavcodec/xsubdec.c+2−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
18 * License along with FFmpeg; if not, write to the Free Software18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21
22#include "libavutil/mathematics.h"
21#include "libavutil/imgutils.h"23#include "libavutil/imgutils.h"
22#include "avcodec.h"24#include "avcodec.h"
23#include "get_bits.h"25#include "get_bits.h"
libavdevice/alsa-audio-dec.c+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
47 47
48#include <alsa/asoundlib.h>48#include <alsa/asoundlib.h>
49#include "libavutil/opt.h"49#include "libavutil/opt.h"
50#include "libavutil/mathematics.h"
50 51
51#include "avdevice.h"52#include "avdevice.h"
52#include "alsa-audio.h"53#include "alsa-audio.h"
libavfilter/avfilter.h+3−0
@@ -23,7 +23,10 @@ · 22 unmodified lines
23#define AVFILTER_AVFILTER_H23#define AVFILTER_AVFILTER_H
24 24
25#include "libavutil/avutil.h"25#include "libavutil/avutil.h"
26#include "libavutil/log.h"
26#include "libavutil/samplefmt.h"27#include "libavutil/samplefmt.h"
28#include "libavutil/pixfmt.h"
29#include "libavutil/rational.h"
27 30
28#define LIBAVFILTER_VERSION_MAJOR 231#define LIBAVFILTER_VERSION_MAJOR 2
29#define LIBAVFILTER_VERSION_MINOR 2432#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
83 * Create an instance of a filter, initialize and insert it in the83 * Create an instance of a filter, initialize and insert it in the
84 * filtergraph in *ctx.84 * filtergraph in *ctx.
85 *85 *
86 * @param filt_ctx put here a filter context in case of successful creation and configuration, NULL otherwise.
86 * @param ctx the filtergraph context87 * @param ctx the filtergraph context
87 * @param put here a filter context in case of successful creation and configuration, NULL otherwise.
88 * @param index an index which is supposed to be unique for each filter instance added to the filtergraph88 * @param index an index which is supposed to be unique for each filter instance added to the filtergraph
89 * @param filt_name the name of the filter to create89 * @param filt_name the name of the filter to create
90 * @param args the arguments provided to the filter during its initialization90 * @param args the arguments provided to the filter during its initialization
libavfilter/vf_aspect.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
23 * aspect ratio modification video filters23 * aspect ratio modification video filters
24 */24 */
25 25
26#include "libavutil/mathematics.h"
26#include "avfilter.h"27#include "avfilter.h"
27 28
28typedef struct {29typedef struct {
libavfilter/vf_crop.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30#include "libavutil/avstring.h"30#include "libavutil/avstring.h"
31#include "libavutil/libm.h"31#include "libavutil/libm.h"
32#include "libavutil/imgutils.h"32#include "libavutil/imgutils.h"
33#include "libavutil/mathematics.h"
33 34
34static const char *var_names[] = {35static const char *var_names[] = {
35 "E",36 "E",
libavfilter/vf_overlay.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30#include "libavutil/avstring.h"30#include "libavutil/avstring.h"
31#include "libavutil/pixdesc.h"31#include "libavutil/pixdesc.h"
32#include "libavutil/imgutils.h"32#include "libavutil/imgutils.h"
33#include "libavutil/mathematics.h"
33#include "internal.h"34#include "internal.h"
34 35
35static const char *var_names[] = {36static const char *var_names[] = {
libavfilter/vf_pad.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
32#include "libavutil/avassert.h"32#include "libavutil/avassert.h"
33#include "libavutil/imgutils.h"33#include "libavutil/imgutils.h"
34#include "libavutil/parseutils.h"34#include "libavutil/parseutils.h"
35#include "libavutil/mathematics.h"
35#include "drawutils.h"36#include "drawutils.h"
36 37
37static const char *var_names[] = {38static const char *var_names[] = {
libavfilter/vf_scale.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
26#include "avfilter.h"26#include "avfilter.h"
27#include "libavutil/avstring.h"27#include "libavutil/avstring.h"
28#include "libavutil/eval.h"28#include "libavutil/eval.h"
29#include "libavutil/mathematics.h"
29#include "libavutil/pixdesc.h"30#include "libavutil/pixdesc.h"
30#include "libavutil/avassert.h"31#include "libavutil/avassert.h"
31#include "libswscale/swscale.h"32#include "libswscale/swscale.h"
libavfilter/vf_setpts.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
27/* #define DEBUG */27/* #define DEBUG */
28 28
29#include "libavutil/eval.h"29#include "libavutil/eval.h"
30#include "libavutil/mathematics.h"
30#include "avfilter.h"31#include "avfilter.h"
31 32
32static const char *var_names[] = {33static const char *var_names[] = {
libavfilter/vf_settb.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
25 25
26#include "libavutil/avstring.h"26#include "libavutil/avstring.h"
27#include "libavutil/eval.h"27#include "libavutil/eval.h"
28#include "libavutil/mathematics.h"
28#include "libavutil/rational.h"29#include "libavutil/rational.h"
29#include "avfilter.h"30#include "avfilter.h"
30#include "internal.h"31#include "internal.h"
libavfilter/vsrc_color.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
27#include "libavutil/pixdesc.h"27#include "libavutil/pixdesc.h"
28#include "libavutil/colorspace.h"28#include "libavutil/colorspace.h"
29#include "libavutil/imgutils.h"29#include "libavutil/imgutils.h"
30#include "libavutil/mathematics.h"
30#include "libavutil/parseutils.h"31#include "libavutil/parseutils.h"
31#include "drawutils.h"32#include "drawutils.h"
32 33
libavfilter/vsrc_nullsrc.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
23 23
24#include "libavutil/avstring.h"24#include "libavutil/avstring.h"
25#include "libavutil/eval.h"25#include "libavutil/eval.h"
26#include "libavutil/mathematics.h"
26#include "libavutil/parseutils.h"27#include "libavutil/parseutils.h"
27#include "avfilter.h"28#include "avfilter.h"
28 29
libavformat/4xm.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
28 */28 */
29 29
30#include "libavutil/intreadwrite.h"30#include "libavutil/intreadwrite.h"
31#include "libavutil/intfloat_readwrite.h"
31#include "avformat.h"32#include "avformat.h"
32 33
33#define RIFF_TAG MKTAG('R', 'I', 'F', 'F')34#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
55 break;55 break;
56 default:56 default:
57 return AVERROR(EINVAL);57 return AVERROR(EINVAL);
58 break;
59 }58 }
60 avio_write(s->pb, header, 2);59 avio_write(s->pb, header, 2);
61 c->prev_pkt.size = 0;60 c->prev_pkt.size = 0;
libavformat/aiffenc.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/intfloat_readwrite.h"
22#include "avformat.h"23#include "avformat.h"
23#include "aiff.h"24#include "aiff.h"
24#include "avio_internal.h"25#include "avio_internal.h"
libavformat/applehttp.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
27 27
28#include "libavutil/avstring.h"28#include "libavutil/avstring.h"
29#include "libavutil/intreadwrite.h"29#include "libavutil/intreadwrite.h"
30#include "libavutil/mathematics.h"
30#include "libavutil/opt.h"31#include "libavutil/opt.h"
31#include "libavutil/dict.h"32#include "libavutil/dict.h"
32#include "avformat.h"33#include "avformat.h"
libavformat/asfdec.c+2−5
@@ -25,6 +25,7 @@ · 24 unmodified lines
25#include "libavutil/common.h"25#include "libavutil/common.h"
26#include "libavutil/avstring.h"26#include "libavutil/avstring.h"
27#include "libavutil/dict.h"27#include "libavutil/dict.h"
28#include "libavutil/mathematics.h"
28#include "libavcodec/mpegaudio.h"29#include "libavcodec/mpegaudio.h"
29#include "avformat.h"30#include "avformat.h"
30#include "avio_internal.h"31#include "avio_internal.h"
@@ -84,13 +85,11 @@ static const ff_asf_guid index_guid = { · 53 unmodified lines
84 0x90, 0x08, 0x00, 0x33, 0xb1, 0xe5, 0xcf, 0x11, 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb85 0x90, 0x08, 0x00, 0x33, 0xb1, 0xe5, 0xcf, 0x11, 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb
85};86};
86 87
88#ifdef DEBUG
87static const ff_asf_guid stream_bitrate_guid = { /* (http://get.to/sdp) */89static const ff_asf_guid stream_bitrate_guid = { /* (http://get.to/sdp) */
88 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb290 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2
89};91};
90/**********************************/
91/* decoding */
92 92
93#ifdef DEBUG
94#define PRINT_IF_GUID(g,cmp) \93#define PRINT_IF_GUID(g,cmp) \
95if (!ff_guidcmp(g, &cmp)) \94if (!ff_guidcmp(g, &cmp)) \
96 av_dlog(NULL, "(GUID: %s) ", #cmp)95 av_dlog(NULL, "(GUID: %s) ", #cmp)
@@ -1094,8 +1093,6 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) · 997 unmodified lines
1094 assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1);1093 assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1);
1095 asf->packet_time_start = 0;1094 asf->packet_time_start = 0;
1096 }1095 }
1097
1098 return 0;
1099}1096}
1100 1097
1101// Added to support seeking after packets have been read1098// Added to support seeking after packets have been read
libavformat/assdec.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/mathematics.h"
22#include "avformat.h"23#include "avformat.h"
23#include "internal.h"24#include "internal.h"
24 25
libavformat/audiointerleave.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
21 */21 */
22 22
23#include "libavutil/fifo.h"23#include "libavutil/fifo.h"
24#include "libavutil/mathematics.h"
24#include "avformat.h"25#include "avformat.h"
25#include "audiointerleave.h"26#include "audiointerleave.h"
26#include "internal.h"27#include "internal.h"
libavformat/avformat.h+1−0
@@ -41,6 +41,7 @@ const char *avformat_license(void); · 40 unmodified lines
41#include <stdio.h> /* FILE */41#include <stdio.h> /* FILE */
42#include "libavcodec/avcodec.h"42#include "libavcodec/avcodec.h"
43#include "libavutil/dict.h"43#include "libavutil/dict.h"
44#include "libavutil/log.h"
44 45
45#include "avio.h"46#include "avio.h"
46#include "libavformat/version.h"47#include "libavformat/version.h"
libavformat/avidec.c+8−11
@@ -21,6 +21,7 @@ · 20 unmodified lines
21 21
22#include <strings.h>22#include <strings.h>
23#include "libavutil/intreadwrite.h"23#include "libavutil/intreadwrite.h"
24#include "libavutil/mathematics.h"
24#include "libavutil/bswap.h"25#include "libavutil/bswap.h"
25#include "libavutil/opt.h"26#include "libavutil/opt.h"
26#include "libavutil/dict.h"27#include "libavutil/dict.h"
@@ -1289,20 +1290,16 @@ static int avi_load_index(AVFormatContext *s) · 1262 unmodified lines
1289 (tag >> 16) & 0xff,1290 (tag >> 16) & 0xff,
1290 (tag >> 24) & 0xff,1291 (tag >> 24) & 0xff,
1291 size);1292 size);
1292 switch(tag) {1293
1293 case MKTAG('i', 'd', 'x', '1'):1294 if (tag == MKTAG('i', 'd', 'x', '1') &&
1294 if (avi_read_idx1(s, size) < 0)1295 avi_read_idx1(s, size) >= 0) {
1295 goto skip;
1296 ret = 0;1296 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
1304 break;1297 break;
1305 }1298 }
1299
1300 size += (size & 1);
1301 if (avio_skip(pb, size) < 0)
1302 break; // something is wrong here
1306 }1303 }
1307 the_end:1304 the_end:
1308 avio_seek(pb, pos, SEEK_SET);1305 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
220 av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n",220 av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
221 block_type, block_type, block_type); return -1;221 block_type, block_type, block_type); return -1;
222 }222 }
223
224 return 0;
225}223}
226 224
227AVInputFormat ff_bethsoftvid_demuxer = {225AVInputFormat ff_bethsoftvid_demuxer = {
libavformat/cafdec.c+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
29#include "riff.h"29#include "riff.h"
30#include "isom.h"30#include "isom.h"
31#include "libavutil/intreadwrite.h"31#include "libavutil/intreadwrite.h"
32#include "libavutil/intfloat_readwrite.h"
32#include "libavutil/dict.h"33#include "libavutil/dict.h"
33#include "caf.h"34#include "caf.h"
34 35
libavformat/cafenc.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
24#include "riff.h"24#include "riff.h"
25#include "isom.h"25#include "isom.h"
26#include "avio_internal.h"26#include "avio_internal.h"
27#include "libavutil/intfloat_readwrite.h"
27 28
28typedef struct {29typedef struct {
29 int64_t data;30 int64_t data;
libavformat/dv.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
32#include "avformat.h"32#include "avformat.h"
33#include "libavcodec/dvdata.h"33#include "libavcodec/dvdata.h"
34#include "libavutil/intreadwrite.h"34#include "libavutil/intreadwrite.h"
35#include "libavutil/mathematics.h"
35#include "dv.h"36#include "dv.h"
36 37
37struct DVDemuxContext {38struct DVDemuxContext {
libavformat/dvenc.c+1−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
35#include "libavcodec/dvdata.h"35#include "libavcodec/dvdata.h"
36#include "dv.h"36#include "dv.h"
37#include "libavutil/fifo.h"37#include "libavutil/fifo.h"
38#include "libavutil/mathematics.h"
38 39
39struct DVMuxContext {40struct DVMuxContext {
40 const DVprofile* sys; /* current DV profile, e.g.: 525/60, 625/50 */41 const DVprofile* sys; /* current DV profile, e.g.: 525/60, 625/50 */
libavformat/ffmdec.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/intreadwrite.h"22#include "libavutil/intreadwrite.h"
23#include "libavutil/intfloat_readwrite.h"
23#include "avformat.h"24#include "avformat.h"
24#include "ffm.h"25#include "ffm.h"
25#if CONFIG_FFSERVER26#if CONFIG_FFSERVER
libavformat/ffmenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/intreadwrite.h"22#include "libavutil/intreadwrite.h"
23#include "libavutil/intfloat_readwrite.h"
23#include "avformat.h"24#include "avformat.h"
24#include "ffm.h"25#include "ffm.h"
25 26
libavformat/ffmetadec.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/mathematics.h"
22#include "avformat.h"23#include "avformat.h"
23#include "ffmeta.h"24#include "ffmeta.h"
24#include "internal.h"25#include "internal.h"
libavformat/flvdec.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
26 26
27#include "libavutil/avstring.h"27#include "libavutil/avstring.h"
28#include "libavutil/dict.h"28#include "libavutil/dict.h"
29#include "libavutil/intfloat_readwrite.h"
29#include "libavcodec/bytestream.h"30#include "libavcodec/bytestream.h"
30#include "libavcodec/mpeg4audio.h"31#include "libavcodec/mpeg4audio.h"
31#include "avformat.h"32#include "avformat.h"
libavformat/flvenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/intreadwrite.h"22#include "libavutil/intreadwrite.h"
23#include "libavutil/intfloat_readwrite.h"
23#include "avformat.h"24#include "avformat.h"
24#include "flv.h"25#include "flv.h"
25#include "internal.h"26#include "internal.h"
libavformat/gxfenc.c+2−0
@@ -19,6 +19,8 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/intfloat_readwrite.h"
23#include "libavutil/mathematics.h"
22#include "avformat.h"24#include "avformat.h"
23#include "gxf.h"25#include "gxf.h"
24#include "riff.h"26#include "riff.h"
libavformat/idroqdec.c+0−1
@@ -209,7 +209,6 @@ static int roq_read_packet(AVFormatContext *s, · 208 unmodified lines
209 default:209 default:
210 av_log(s, AV_LOG_ERROR, " unknown RoQ chunk (%04X)\n", chunk_type);210 av_log(s, AV_LOG_ERROR, " unknown RoQ chunk (%04X)\n", chunk_type);
211 return AVERROR_INVALIDDATA;211 return AVERROR_INVALIDDATA;
212 break;
213 }212 }
214 }213 }
215 214
libavformat/internal.h+2−2
@@ -155,14 +155,14 @@ void ff_put_v(AVIOContext *bc, uint64_t val); · 154 unmodified lines
155 155
156/**156/**
157 * Read a whole line of text from AVIOContext. Stop reading after reaching157 * 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,
159 * and may be truncated if the buffer is too small.159 * and may be truncated if the buffer is too small.
160 *160 *
161 * @param s the read-only AVIOContext161 * @param s the read-only AVIOContext
162 * @param buf buffer to store the read line162 * @param buf buffer to store the read line
163 * @param maxlen size of the buffer163 * @param maxlen size of the buffer
164 * @return the length of the string written in the buffer, not including the164 * @return the length of the string written in the buffer, not including the
165 * final \0165 * final \\0
166 */166 */
167int ff_get_line(AVIOContext *s, char *buf, int maxlen);167int ff_get_line(AVIOContext *s, char *buf, int maxlen);
168 168
libavformat/matroskaenc.c+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
28#include "avlanguage.h"28#include "avlanguage.h"
29#include "libavutil/samplefmt.h"29#include "libavutil/samplefmt.h"
30#include "libavutil/intreadwrite.h"30#include "libavutil/intreadwrite.h"
31#include "libavutil/intfloat_readwrite.h"
32#include "libavutil/mathematics.h"
31#include "libavutil/random_seed.h"33#include "libavutil/random_seed.h"
32#include "libavutil/lfg.h"34#include "libavutil/lfg.h"
33#include "libavutil/dict.h"35#include "libavutil/dict.h"
libavformat/mm.c+0−2
@@ -184,8 +184,6 @@ static int read_packet(AVFormatContext *s, · 183 unmodified lines
184 avio_skip(pb, length);184 avio_skip(pb, length);
185 }185 }
186 }186 }
187
188 return 0;
189}187}
190 188
191AVInputFormat ff_mm_demuxer = {189AVInputFormat ff_mm_demuxer = {
libavformat/mmsh.c+0−1
@@ -208,7 +208,6 @@ static int get_http_header_data(MMSHContext *mmsh) · 207 unmodified lines
208 }208 }
209 }209 }
210 }210 }
211 return 0;
212}211}
213 212
214static int mmsh_open(URLContext *h, const char *uri, int flags)213static int mmsh_open(URLContext *h, const char *uri, int flags)
libavformat/mov.c+2−1
@@ -26,6 +26,8 @@ · 25 unmodified lines
26//#define MOV_EXPORT_ALL_METADATA26//#define MOV_EXPORT_ALL_METADATA
27 27
28#include "libavutil/intreadwrite.h"28#include "libavutil/intreadwrite.h"
29#include "libavutil/intfloat_readwrite.h"
30#include "libavutil/mathematics.h"
29#include "libavutil/avstring.h"31#include "libavutil/avstring.h"
30#include "libavutil/dict.h"32#include "libavutil/dict.h"
31#include "avformat.h"33#include "avformat.h"
@@ -2327,7 +2329,6 @@ static int mov_probe(AVProbeData *p) · 2295 unmodified lines
2327 return score;2329 return score;
2328 }2330 }
2329 }2331 }
2330 return score;
2331}2332}
2332 2333
2333// must be done after parsing all trak because there's no order requirement2334// 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
32#include "libavcodec/put_bits.h"32#include "libavcodec/put_bits.h"
33#include "internal.h"33#include "internal.h"
34#include "libavutil/avstring.h"34#include "libavutil/avstring.h"
35#include "libavutil/intfloat_readwrite.h"
36#include "libavutil/mathematics.h"
35#include "libavutil/opt.h"37#include "libavutil/opt.h"
36#include "libavutil/dict.h"38#include "libavutil/dict.h"
37#include "rtpenc.h"39#include "rtpenc.h"
libavformat/mp3dec.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include "libavutil/avstring.h"22#include "libavutil/avstring.h"
23#include "libavutil/intreadwrite.h"23#include "libavutil/intreadwrite.h"
24#include "libavutil/dict.h"24#include "libavutil/dict.h"
25#include "libavutil/mathematics.h"
25#include "avformat.h"26#include "avformat.h"
26#include "id3v2.h"27#include "id3v2.h"
27#include "id3v1.h"28#include "id3v1.h"
libavformat/mpegenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/fifo.h"22#include "libavutil/fifo.h"
23#include "libavutil/mathematics.h"
23#include "libavcodec/put_bits.h"24#include "libavcodec/put_bits.h"
24#include "avformat.h"25#include "avformat.h"
25#include "mpeg.h"26#include "mpeg.h"
libavformat/mpegtsenc.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include "libavutil/bswap.h"22#include "libavutil/bswap.h"
23#include "libavutil/crc.h"23#include "libavutil/crc.h"
24#include "libavutil/dict.h"24#include "libavutil/dict.h"
25#include "libavutil/mathematics.h"
25#include "libavutil/opt.h"26#include "libavutil/opt.h"
26#include "libavcodec/mpegvideo.h"27#include "libavcodec/mpegvideo.h"
27#include "avformat.h"28#include "avformat.h"
libavformat/mxfdec.c+1−0
@@ -46,6 +46,7 @@ · 45 unmodified lines
46//#define DEBUG46//#define DEBUG
47 47
48#include "libavutil/aes.h"48#include "libavutil/aes.h"
49#include "libavutil/mathematics.h"
49#include "libavcodec/bytestream.h"50#include "libavcodec/bytestream.h"
50#include "avformat.h"51#include "avformat.h"
51#include "mxf.h"52#include "mxf.h"
libavformat/nsvdec.c+2−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
18 * License along with FFmpeg; if not, write to the Free Software18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21
22#include "libavutil/mathematics.h"
21#include "avformat.h"23#include "avformat.h"
22#include "riff.h"24#include "riff.h"
23#include "libavutil/dict.h"25#include "libavutil/dict.h"
libavformat/nut.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/mathematics.h"
22#include "libavutil/tree.h"23#include "libavutil/tree.h"
23#include "nut.h"24#include "nut.h"
24#include "internal.h"25#include "internal.h"
libavformat/nutdec.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
24#include "libavutil/avstring.h"24#include "libavutil/avstring.h"
25#include "libavutil/bswap.h"25#include "libavutil/bswap.h"
26#include "libavutil/dict.h"26#include "libavutil/dict.h"
27#include "libavutil/mathematics.h"
27#include "libavutil/tree.h"28#include "libavutil/tree.h"
28#include "avio_internal.h"29#include "avio_internal.h"
29#include "nut.h"30#include "nut.h"
libavformat/nutenc.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/intreadwrite.h"22#include "libavutil/intreadwrite.h"
23#include "libavutil/mathematics.h"
23#include "libavutil/tree.h"24#include "libavutil/tree.h"
24#include "libavutil/dict.h"25#include "libavutil/dict.h"
25#include "libavcodec/mpegaudiodata.h"26#include "libavcodec/mpegaudiodata.h"
libavformat/nuv.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/intreadwrite.h"22#include "libavutil/intreadwrite.h"
23#include "libavutil/intfloat_readwrite.h"
23#include "avformat.h"24#include "avformat.h"
24#include "riff.h"25#include "riff.h"
25 26
libavformat/oggenc.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
21 21
22#include "libavutil/crc.h"22#include "libavutil/crc.h"
23#include "libavutil/opt.h"23#include "libavutil/opt.h"
24#include "libavutil/mathematics.h"
24#include "libavutil/random_seed.h"25#include "libavutil/random_seed.h"
25#include "libavcodec/xiph.h"26#include "libavcodec/xiph.h"
26#include "libavcodec/bytestream.h"27#include "libavcodec/bytestream.h"
libavformat/oma.c+0−1
@@ -149,7 +149,6 @@ static int oma_read_header(AVFormatContext *s, · 148 unmodified lines
149 default:149 default:
150 av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n",buf[32]);150 av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n",buf[32]);
151 return -1;151 return -1;
152 break;
153 }152 }
154 153
155 st->codec->block_align = framesize;154 st->codec->block_align = framesize;
libavformat/pcm.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/mathematics.h"
22#include "avformat.h"23#include "avformat.h"
23#include "pcm.h"24#include "pcm.h"
24 25
libavformat/psxstr.c+0−1
@@ -234,7 +234,6 @@ static int str_read_packet(AVFormatContext *s, · 233 unmodified lines
234 pkt->stream_index =234 pkt->stream_index =
235 str->channels[channel].audio_stream_index;235 str->channels[channel].audio_stream_index;
236 return 0;236 return 0;
237 break;
238 default:237 default:
239 av_log(s, AV_LOG_WARNING, "Unknown sector type %02X\n", sector[0x12]);238 av_log(s, AV_LOG_WARNING, "Unknown sector type %02X\n", sector[0x12]);
240 /* drop the sector and move on */239 /* drop the sector and move on */
libavformat/r3d.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
23 23
24#include "libavutil/intreadwrite.h"24#include "libavutil/intreadwrite.h"
25#include "libavutil/dict.h"25#include "libavutil/dict.h"
26#include "libavutil/mathematics.h"
26#include "avformat.h"27#include "avformat.h"
27 28
28typedef struct {29typedef struct {
libavformat/riff.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/mathematics.h"
22#include "libavcodec/avcodec.h"23#include "libavcodec/avcodec.h"
23#include "avformat.h"24#include "avformat.h"
24#include "avio_internal.h"25#include "avio_internal.h"
libavformat/rl2.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
34 */34 */
35 35
36#include "libavutil/intreadwrite.h"36#include "libavutil/intreadwrite.h"
37#include "libavutil/mathematics.h"
37#include "avformat.h"38#include "avformat.h"
38 39
39#define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr, palette40#define EXTRADATA1_SIZE (6 + 256 * 3) ///< video base, clr, palette
libavformat/rtmppkt.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
21 21
22#include "libavcodec/bytestream.h"22#include "libavcodec/bytestream.h"
23#include "libavutil/avstring.h"23#include "libavutil/avstring.h"
24#include "libavutil/intfloat_readwrite.h"
24#include "avformat.h"25#include "avformat.h"
25 26
26#include "rtmppkt.h"27#include "rtmppkt.h"
libavformat/rtmpproto.c+1−1
@@ -26,6 +26,7 @@ · 25 unmodified lines
26 26
27#include "libavcodec/bytestream.h"27#include "libavcodec/bytestream.h"
28#include "libavutil/avstring.h"28#include "libavutil/avstring.h"
29#include "libavutil/intfloat_readwrite.h"
29#include "libavutil/lfg.h"30#include "libavutil/lfg.h"
30#include "libavutil/sha.h"31#include "libavutil/sha.h"
31#include "avformat.h"32#include "avformat.h"
@@ -761,7 +762,6 @@ static int get_packet(URLContext *s, int for_header) · 729 unmodified lines
761 }762 }
762 ff_rtmp_packet_destroy(&rpkt);763 ff_rtmp_packet_destroy(&rpkt);
763 }764 }
764 return 0;
765}765}
766 766
767static int rtmp_close(URLContext *h)767static int rtmp_close(URLContext *h)
libavformat/rtpdec.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */20 */
21 21
22#include "libavutil/mathematics.h"
22#include "libavcodec/get_bits.h"23#include "libavcodec/get_bits.h"
23#include "avformat.h"24#include "avformat.h"
24#include "mpegts.h"25#include "mpegts.h"
libavformat/rtpenc.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include "avformat.h"22#include "avformat.h"
23#include "mpegts.h"23#include "mpegts.h"
24#include "internal.h"24#include "internal.h"
25#include "libavutil/mathematics.h"
25#include "libavutil/random_seed.h"26#include "libavutil/random_seed.h"
26#include "libavutil/opt.h"27#include "libavutil/opt.h"
27 28
libavformat/rtsp.c+6−13
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include "libavutil/base64.h"22#include "libavutil/base64.h"
23#include "libavutil/avstring.h"23#include "libavutil/avstring.h"
24#include "libavutil/intreadwrite.h"24#include "libavutil/intreadwrite.h"
25#include "libavutil/mathematics.h"
25#include "libavutil/parseutils.h"26#include "libavutil/parseutils.h"
26#include "libavutil/random_seed.h"27#include "libavutil/random_seed.h"
27#include "libavutil/dict.h"28#include "libavutil/dict.h"
@@ -428,11 +429,6 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, · 400 unmodified lines
428 }429 }
429}430}
430 431
431/**
432 * Parse the sdp description and allocate the rtp streams and the
433 * pollfd array used for udp ones.
434 */
435
436int ff_sdp_parse(AVFormatContext *s, const char *content)432int ff_sdp_parse(AVFormatContext *s, const char *content)
437{433{
438 RTSPState *rt = s->priv_data;434 RTSPState *rt = s->priv_data;
@@ -1050,9 +1046,6 @@ retry: · 611 unmodified lines
1050 return 0;1046 return 0;
1051}1047}
1052 1048
1053/**
1054 * @return 0 on success, <0 on error, 1 if protocol is unavailable.
1055 */
1056int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,1049int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
1057 int lower_transport, const char *real_challenge)1050 int lower_transport, const char *real_challenge)
1058{1051{
@@ -1078,7 +1071,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, · 19 unmodified lines
1078 for (j = RTSP_RTP_PORT_MIN, i = 0; i < rt->nb_rtsp_streams; ++i) {1071 for (j = RTSP_RTP_PORT_MIN, i = 0; i < rt->nb_rtsp_streams; ++i) {
1079 char transport[2048];1072 char transport[2048];
1080 1073
1081 /**1074 /*
1082 * WMS serves all UDP data over a single connection, the RTX, which1075 * WMS serves all UDP data over a single connection, the RTX, which
1083 * isn't necessarily the first in the SDP but has to be the first1076 * isn't necessarily the first in the SDP but has to be the first
1084 * to be set up, else the second/third SETUP will fail with a 461.1077 * 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
1151 1144
1152 /* RTP/TCP */1145 /* RTP/TCP */
1153 else if (lower_transport == RTSP_LOWER_TRANSPORT_TCP) {1146 else if (lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
1154 /** For WMS streams, the application streams are only used for1147 /* For WMS streams, the application streams are only used for
1155 * UDP. When trying to set it up for TCP streams, the server1148 * UDP. When trying to set it up for TCP streams, the server
1156 * will return an error. Therefore, we skip those streams. */1149 * will return an error. Therefore, we skip those streams. */
1157 if (rt->server_type == RTSP_SERVER_WMS &&1150 if (rt->server_type == RTSP_SERVER_WMS &&
@@ -1482,14 +1475,14 @@ redirect: · 324 unmodified lines
1482 cmd[0] = 0;1475 cmd[0] = 0;
1483 if (rt->server_type == RTSP_SERVER_REAL)1476 if (rt->server_type == RTSP_SERVER_REAL)
1484 av_strlcat(cmd,1477 av_strlcat(cmd,
1485 /**1478 /*
1486 * The following entries are required for proper1479 * The following entries are required for proper
1487 * streaming from a Realmedia server. They are1480 * streaming from a Realmedia server. They are
1488 * interdependent in some way although we currently1481 * interdependent in some way although we currently
1489 * don't quite understand how. Values were copied1482 * don't quite understand how. Values were copied
1490 * from mplayer SVN r23589.1483 * from mplayer SVN r23589.
1491 * @param CompanyID is a 16-byte ID in base641484 * ClientChallenge is a 16-byte ID in hex
1492 * @param ClientChallenge is a 16-byte ID in hex1485 * CompanyID is a 16-byte ID in base64
1493 */1486 */
1494 "ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n"1487 "ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n"
1495 "PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n"1488 "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
505int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr);505int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr);
506 506
507/**507/**
508 * Parse a SDP description of streams by populating an RTSPState struct508 * Parse an SDP description of streams by populating an RTSPState struct
509 * within the AVFormatContext.509 * within the AVFormatContext; also allocate the RTP streams and the
510 * pollfd array used for UDP streams.
510 */511 */
511int ff_sdp_parse(AVFormatContext *s, const char *content);512int ff_sdp_parse(AVFormatContext *s, const char *content);
512 513
@@ -525,6 +526,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt); · 12 unmodified lines
525/**526/**
526 * Do the SETUP requests for each stream for the chosen527 * Do the SETUP requests for each stream for the chosen
527 * lower transport mode.528 * lower transport mode.
529 * @return 0 on success, <0 on error, 1 if protocol is unavailable
528 */530 */
529int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,531int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
530 int lower_transport, const char *real_challenge);532 int lower_transport, const char *real_challenge);
libavformat/rtspdec.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
21 21
22#include "libavutil/avstring.h"22#include "libavutil/avstring.h"
23#include "libavutil/intreadwrite.h"23#include "libavutil/intreadwrite.h"
24#include "libavutil/mathematics.h"
24#include "libavutil/opt.h"25#include "libavutil/opt.h"
25#include "avformat.h"26#include "avformat.h"
26 27
libavformat/seek.c+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
21 */21 */
22 22
23#include "seek.h"23#include "seek.h"
24#include "libavutil/mathematics.h"
24#include "libavutil/mem.h"25#include "libavutil/mem.h"
25#include "internal.h"26#include "internal.h"
26 27
libavformat/soxdec.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30 */30 */
31 31
32#include "libavutil/intreadwrite.h"32#include "libavutil/intreadwrite.h"
33#include "libavutil/intfloat_readwrite.h"
33#include "libavutil/dict.h"34#include "libavutil/dict.h"
34#include "avformat.h"35#include "avformat.h"
35#include "pcm.h"36#include "pcm.h"
libavformat/soxenc.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30 */30 */
31 31
32#include "libavutil/intreadwrite.h"32#include "libavutil/intreadwrite.h"
33#include "libavutil/intfloat_readwrite.h"
33#include "libavutil/dict.h"34#include "libavutil/dict.h"
34#include "avformat.h"35#include "avformat.h"
35#include "avio_internal.h"36#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
204 skip:204 skip:
205 avio_skip(pb, len);205 avio_skip(pb, len);
206 }206 }
207 return 0;
208}207}
209 208
210AVInputFormat ff_swf_demuxer = {209AVInputFormat ff_swf_demuxer = {
libavformat/thp.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 */20 */
21 21
22#include "libavutil/intreadwrite.h"22#include "libavutil/intreadwrite.h"
23#include "libavutil/intfloat_readwrite.h"
23#include "avformat.h"24#include "avformat.h"
24 25
25typedef struct ThpDemuxContext {26typedef struct ThpDemuxContext {
libavformat/utils.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
32#include "metadata.h"32#include "metadata.h"
33#include "id3v2.h"33#include "id3v2.h"
34#include "libavutil/avstring.h"34#include "libavutil/avstring.h"
35#include "libavutil/mathematics.h"
35#include "riff.h"36#include "riff.h"
36#include "audiointerleave.h"37#include "audiointerleave.h"
37#include "url.h"38#include "url.h"
libavformat/vqf.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include "avformat.h"22#include "avformat.h"
23#include "libavutil/intreadwrite.h"23#include "libavutil/intreadwrite.h"
24#include "libavutil/dict.h"24#include "libavutil/dict.h"
25#include "libavutil/mathematics.h"
25 26
26typedef struct VqfContext {27typedef struct VqfContext {
27 int frame_bit_len;28 int frame_bit_len;
libavformat/wav.c+2−0
@@ -22,6 +22,8 @@ · 21 unmodified lines
22 * License along with FFmpeg; if not, write to the Free Software22 * License along with FFmpeg; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */24 */
25
26#include "libavutil/mathematics.h"
25#include "avformat.h"27#include "avformat.h"
26#include "avio_internal.h"28#include "avio_internal.h"
27#include "pcm.h"29#include "pcm.h"
libavformat/wc3movie.c+0−1
@@ -152,7 +152,6 @@ static int wc3_read_header(AVFormatContext *s, · 151 unmodified lines
152 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24),152 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24),
153 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24));153 (uint8_t)fourcc_tag, (uint8_t)(fourcc_tag >> 8), (uint8_t)(fourcc_tag >> 16), (uint8_t)(fourcc_tag >> 24));
154 return AVERROR_INVALIDDATA;154 return AVERROR_INVALIDDATA;
155 break;
156 }155 }
157 156
158 fourcc_tag = avio_rl32(pb);157 fourcc_tag = avio_rl32(pb);
libavformat/wtvdec.c+1−1
@@ -716,7 +716,7 @@ enum { · 715 unmodified lines
716 * Parse WTV chunks716 * Parse WTV chunks
717 * @param mode SEEK_TO_DATA or SEEK_TO_PTS717 * @param mode SEEK_TO_DATA or SEEK_TO_PTS
718 * @param seekts timestamp718 * @param seekts timestamp
719 * @param[out] len Length of data chunk719 * @param[out] len_ptr Length of data chunk
720 * @return stream index of data chunk, or <0 on error720 * @return stream index of data chunk, or <0 on error
721 */721 */
722static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_ptr)722static 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
54static uint32_t dec_multbl[4][256];54static uint32_t dec_multbl[4][256];
55#endif55#endif
56 56
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
57static inline void addkey(av_aes_block *dst, const av_aes_block *src,63static inline void addkey(av_aes_block *dst, const av_aes_block *src,
58 const av_aes_block *round_key)64 const av_aes_block *round_key)
59{65{
@@ -86,7 +92,6 @@ static void subshift(av_aes_block s0[2], int s, const uint8_t *box) · 26 unmodified lines
86 92
87static inline int mix_core(uint32_t multbl[][256], int a, int b, int c, int d){93static inline int mix_core(uint32_t multbl[][256], int a, int b, int c, int d){
88#if CONFIG_SMALL94#if CONFIG_SMALL
89#define ROT(x,s) ((x<<s)|(x>>(32-s)))
90 return multbl[0][a] ^ ROT(multbl[0][b], 8) ^ ROT(multbl[0][c], 16) ^ ROT(multbl[0][d], 24);95 return multbl[0][a] ^ ROT(multbl[0][b], 8) ^ ROT(multbl[0][c], 16) ^ ROT(multbl[0][d], 24);
91#else96#else
92 return multbl[0][a] ^ multbl[1][b] ^ multbl[2][c] ^ multbl[3][d];97 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
127 crypt(a, 0, inv_sbox, dec_multbl);132 crypt(a, 0, inv_sbox, dec_multbl);
128 if (iv) {133 if (iv) {
129 addkey(&a->state[0], &a->state[0], iv);134 addkey(&a->state[0], &a->state[0], iv);
130 memcpy(iv, src, 16);135 *iv = *src;
131 }136 }
132 addkey(dst, &a->state[0], &a->round_key[0]);137 addkey(dst, &a->state[0], &a->round_key[0]);
133 } else {138 } else {
@@ -136,29 +141,36 @@ void av_aes_crypt(AVAES *a, uint8_t *dst_, const uint8_t *src_, · 2 unmodified lines
136 crypt(a, 2, sbox, enc_multbl);141 crypt(a, 2, sbox, enc_multbl);
137 addkey(dst, &a->state[0], &a->round_key[0]);142 addkey(dst, &a->state[0], &a->round_key[0]);
138 if (iv)143 if (iv)
139 memcpy(iv, dst, 16);144 *iv = *dst;
140 }145 }
141 src++;146 src++;
142 dst++;147 dst++;
143 }148 }
144}149}
145 150
146static void init_multbl2(uint8_t tbl[1024], const int c[4],151static void init_multbl2(uint32_t tbl[][256], const int c[4],
147 const uint8_t *log8, const uint8_t *alog8,152 const uint8_t *log8, const uint8_t *alog8,
148 const uint8_t *sbox)153 const uint8_t *sbox)
149{154{
150 int i, j;155 int i;
151 156
152 for (i = 0; i < 1024; i++) {157 for (i = 0; i < 256; i++) {
153 int x = sbox[i >> 2];158 int x = sbox[i];
154 if (x)159 if (x) {
155 tbl[i] = alog8[log8[x] + log8[c[i & 3]]];160 int k, l, m, n;
156 }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));
157#if !CONFIG_SMALL167#if !CONFIG_SMALL
158 for (j = 256; j < 1024; j++)168 tbl[1][i] = ROT(tbl[0][i], 8);
159 for (i = 0; i < 4; i++)169 tbl[2][i] = ROT(tbl[0][i], 16);
160 tbl[4*j + i] = tbl[4*j + ((i - 1) & 3) - 1024];170 tbl[3][i] = ROT(tbl[0][i], 24);
161#endif171#endif
172 }
173 }
162}174}
163 175
164// this is based on the reference AES code by Paulo Barreto and Vincent Rijmen176// 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
187 inv_sbox[j] = i;199 inv_sbox[j] = i;
188 sbox[i] = j;200 sbox[i] = j;
189 }201 }
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 },
191 log8, alog8, inv_sbox);203 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 },
193 log8, alog8, sbox);205 log8, alog8, sbox);
194 }206 }
195 207
@@ -221,15 +233,14 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt) · 25 unmodified lines
221 if (decrypt) {233 if (decrypt) {
222 for (i = 1; i < rounds; i++) {234 for (i = 1; i < rounds; i++) {
223 av_aes_block tmp[3];235 av_aes_block tmp[3];
224 memcpy(&tmp[2], &a->round_key[i], 16);236 tmp[2] = a->round_key[i];
225 subshift(&tmp[1], 0, sbox);237 subshift(&tmp[1], 0, sbox);
226 mix(tmp, dec_multbl, 1, 3);238 mix(tmp, dec_multbl, 1, 3);
227 memcpy(&a->round_key[i], &tmp[0], 16);239 a->round_key[i] = tmp[0];
228 }240 }
229 } else {241 } else {
230 for (i = 0; i < (rounds + 1) >> 1; i++) {242 for (i = 0; i < (rounds + 1) >> 1; i++) {
231 for (j = 0; j < 16; j++)243 FFSWAP(av_aes_block, a->round_key[i], a->round_key[rounds-i]);
232 FFSWAP(int, a->round_key[i].u8[j], a->round_key[rounds-i].u8[j]);
233 }244 }
234 }245 }
235 246
libavutil/avutil.h+0−4
@@ -126,9 +126,5 @@ char av_get_picture_type_char(enum AVPictureType pict_type); · 125 unmodified lines
126#include "common.h"126#include "common.h"
127#include "error.h"127#include "error.h"
128#include "mathematics.h"128#include "mathematics.h"
129#include "rational.h"
130#include "intfloat_readwrite.h"
131#include "log.h"
132#include "pixfmt.h"
133 129
134#endif /* AVUTIL_AVUTIL_H */130#endif /* AVUTIL_AVUTIL_H */
libavutil/des.c+3−1
@@ -39,6 +39,7 @@ static const uint8_t IP_shuffle[] = { · 38 unmodified lines
39};39};
40#undef T40#undef T
41 41
42#if defined(CONFIG_SMALL) || defined(GENTABLES)
42#define T(a, b, c, d) 32-a,32-b,32-c,32-d43#define T(a, b, c, d) 32-a,32-b,32-c,32-d
43static const uint8_t P_shuffle[] = {44static const uint8_t P_shuffle[] = {
44 T(16, 7, 20, 21),45 T(16, 7, 20, 21),
@@ -51,6 +52,7 @@ static const uint8_t P_shuffle[] = { · 6 unmodified lines
51 T(22, 11, 4, 25)52 T(22, 11, 4, 25)
52};53};
53#undef T54#undef T
55#endif
54 56
55#define T(a, b, c, d, e, f, g) 64-a,64-b,64-c,64-d,64-e,64-f,64-g57#define T(a, b, c, d, e, f, g) 64-a,64-b,64-c,64-d,64-e,64-f,64-g
56static const uint8_t PC1_shuffle[] = {58static const uint8_t PC1_shuffle[] = {
@@ -402,7 +404,7 @@ int main(void) { · 345 unmodified lines
402 printf("Partial Monte-Carlo test failed\n");404 printf("Partial Monte-Carlo test failed\n");
403 return 1;405 return 1;
404 }406 }
405 for (i = 0; i < 1000000; i++) {407 for (i = 0; i < 1000; i++) {
406 key[0] = rand64(); key[1] = rand64(); key[2] = rand64();408 key[0] = rand64(); key[1] = rand64(); key[2] = rand64();
407 data = rand64();409 data = rand64();
408 av_des_init(&d, key, 192, 0);410 av_des_init(&d, key, 192, 0);
libavutil/eval.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
28 28
29#include "avutil.h"29#include "avutil.h"
30#include "eval.h"30#include "eval.h"
31#include "log.h"
31 32
32typedef struct Parser {33typedef struct Parser {
33 const AVClass *class;34 const AVClass *class;
libavutil/file.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
17 */17 */
18 18
19#include "file.h"19#include "file.h"
20#include "log.h"
20#include <fcntl.h>21#include <fcntl.h>
21#include <sys/stat.h>22#include <sys/stat.h>
22#include <unistd.h>23#include <unistd.h>
libavutil/imgutils.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
23 23
24#include "imgutils.h"24#include "imgutils.h"
25#include "internal.h"25#include "internal.h"
26#include "log.h"
26#include "pixdesc.h"27#include "pixdesc.h"
27 28
28void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],29void 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
69 *69 *
70 * @param data pointers array to be filled with the pointer for each image plane70 * @param data pointers array to be filled with the pointer for each image plane
71 * @param ptr the pointer to a buffer which will contain the image71 * @param ptr the pointer to a buffer which will contain the image
72 * @param linesizes[4] the array containing the linesize for each72 * @param linesizes the array containing the linesize for each
73 * plane, should be filled by av_image_fill_linesizes()73 * plane, should be filled by av_image_fill_linesizes()
74 * @return the size in bytes required for the image buffer, a negative74 * @return the size in bytes required for the image buffer, a negative
75 * error code in case of failure75 * error code in case of failure
@@ -106,8 +106,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, · 30 unmodified lines
106/**106/**
107 * Copy image in src_data to dst_data.107 * Copy image in src_data to dst_data.
108 *108 *
109 * @param dst_linesize linesizes for the image in dst_data109 * @param dst_linesizes linesizes for the image in dst_data
110 * @param src_linesize linesizes for the image in src_data110 * @param src_linesizes linesizes for the image in src_data
111 */111 */
112void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],112void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
113 const uint8_t *src_data[4], const int src_linesizes[4],113 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
55 * Get the next two numbers generated by a Box-Muller Gaussian55 * Get the next two numbers generated by a Box-Muller Gaussian
56 * generator using the random numbers issued by lfg.56 * generator using the random numbers issued by lfg.
57 *57 *
58 * @param out[2] array where the two generated numbers are placed58 * @param out array where the two generated numbers are placed
59 */59 */
60void av_bmg_get(AVLFG *lfg, double out[2]);60void av_bmg_get(AVLFG *lfg, double out[2]);
61 61
libavutil/md5.c+79−57
@@ -30,8 +30,9 @@ · 29 unmodified lines
30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 */31 */
32 32
33#include <string.h>33#include <stdint.h>
34#include "bswap.h"34#include "bswap.h"
35#include "intreadwrite.h"
35#include "md5.h"36#include "md5.h"
36 37
37typedef struct AVMD5{38typedef struct AVMD5{
@@ -40,7 +41,7 @@ typedef struct AVMD5{ · 2 unmodified lines
40 uint32_t ABCD[4];41 uint32_t ABCD[4];
41} AVMD5;42} AVMD5;
42 43
43const int av_md5_size= sizeof(AVMD5);44const int av_md5_size = sizeof(AVMD5);
44 45
45static const uint8_t S[4][4] = {46static const uint8_t S[4][4] = {
46 { 7, 12, 17, 22 }, /* round 1 */47 { 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
71 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,72 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
72};73};
73 74
74#define CORE(i, a, b, c, d) \75#define CORE(i, a, b, c, d) do { \
75 t = S[i>>4][i&3];\76 t = S[i >> 4][i & 3]; \
76 a += T[i];\77 a += T[i]; \
77\78 \
78 if(i<32){\79 if (i < 32) { \
79 if(i<16) a += (d ^ (b&(c^d))) + X[ i &15 ];\80 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 a += (c ^ (d & (c ^ b))) + X[(1 + 5*i) & 15]; \
81 }else{\82 } else { \
82 if(i<48) a += (b^c^d) + X[ (5+3*i)&15 ];\83 if (i < 48) a += (b ^ c ^ d) + X[(5 + 3*i) & 15]; \
83 else a += (c^(b|~d)) + X[ ( 7*i)&15 ];\84 else a += (c ^ (b | ~d)) + X[( 7*i) & 15]; \
84 }\85 } \
85 a = b + (( a << t ) | ( a >> (32 - t) ));86 a = b + (a << t | a >> (32 - t)); \
86 87 } while (0)
87static void body(uint32_t ABCD[4], uint32_t X[16]){88
88 89static void body(uint32_t ABCD[4], uint32_t X[16])
90{
89 int t;91 int t;
90 int i av_unused;92 int i av_unused;
91 unsigned int a= ABCD[3];93 unsigned int a = ABCD[3];
92 unsigned int b= ABCD[2];94 unsigned int b = ABCD[2];
93 unsigned int c= ABCD[1];95 unsigned int c = ABCD[1];
94 unsigned int d= ABCD[0];96 unsigned int d = ABCD[0];
95 97
96#if HAVE_BIGENDIAN98#if HAVE_BIGENDIAN
97 for(i=0; i<16; i++)99 for (i = 0; i < 16; i++)
98 X[i]= av_bswap32(X[i]);100 X[i] = av_bswap32(X[i]);
99#endif101#endif
100 102
101#if CONFIG_SMALL103#if CONFIG_SMALL
102 for( i = 0; i < 64; i++ ){104 for (i = 0; i < 64; i++) {
103 CORE(i,a,b,c,d)105 CORE(i, a, b, c, d);
104 t=d; d=c; c=b; b=a; a=t;106 t = d;
107 d = c;
108 c = b;
109 b = a;
110 a = t;
105 }111 }
106#else112#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)113#define CORE2(i) \
108#define CORE4(i) CORE2(i) CORE2((i+4)) CORE2((i+8)) CORE2((i+12))114 CORE( i, a,b,c,d); CORE((i+1),d,a,b,c); \
109CORE4(0) CORE4(16) CORE4(32) CORE4(48)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);
110#endif118#endif
111 119
112 ABCD[0] += d;120 ABCD[0] += d;
@@ -115,8 +123,9 @@ CORE4(0) CORE4(16) CORE4(32) CORE4(48) · 2 unmodified lines
115 ABCD[3] += a;123 ABCD[3] += a;
116}124}
117 125
118void av_md5_init(AVMD5 *ctx){126void av_md5_init(AVMD5 *ctx)
119 ctx->len = 0;127{
128 ctx->len = 0;
120 129
121 ctx->ABCD[0] = 0x10325476;130 ctx->ABCD[0] = 0x10325476;
122 ctx->ABCD[1] = 0x98badcfe;131 ctx->ABCD[1] = 0x98badcfe;
@@ -124,59 +133,72 @@ void av_md5_init(AVMD5 *ctx){ · 1 unmodified line
124 ctx->ABCD[3] = 0x67452301;133 ctx->ABCD[3] = 0x67452301;
125}134}
126 135
127void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len){136void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len)
137{
128 int i, j;138 int i, j;
129 139
130 j= ctx->len & 63;140 j = ctx->len & 63;
131 ctx->len += len;141 ctx->len += len;
132 142
133 for( i = 0; i < len; i++ ){143 for (i = 0; i < len; i++) {
134 ctx->block[j++] = src[i];144 ctx->block[j++] = src[i];
135 if( 64 == j ){145 if (j == 64) {
136 body(ctx->ABCD, (uint32_t*) ctx->block);146 body(ctx->ABCD, (uint32_t *) ctx->block);
137 j = 0;147 j = 0;
138 }148 }
139 }149 }
140}150}
141 151
142void av_md5_final(AVMD5 *ctx, uint8_t *dst){152void av_md5_final(AVMD5 *ctx, uint8_t *dst)
153{
143 int i;154 int i;
144 uint64_t finalcount= av_le2ne64(ctx->len<<3);155 uint64_t finalcount = av_le2ne64(ctx->len << 3);
145 156
146 av_md5_update(ctx, "\200", 1);157 av_md5_update(ctx, "\200", 1);
147 while((ctx->len & 63)!=56)158 while ((ctx->len & 63) != 56)
148 av_md5_update(ctx, "", 1);159 av_md5_update(ctx, "", 1);
149 160
150 av_md5_update(ctx, (uint8_t*)&finalcount, 8);161 av_md5_update(ctx, (uint8_t *)&finalcount, 8);
151 162
152 for(i=0; i<4; i++)163 for (i = 0; i < 4; i++)
153 ((uint32_t*)dst)[i]= av_le2ne32(ctx->ABCD[3-i]);164 AV_WL32(dst + 4*i, ctx->ABCD[3 - i]);
154}165}
155 166
156void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){167void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len)
157 AVMD5 ctx[1];168{
169 AVMD5 ctx;
158 170
159 av_md5_init(ctx);171 av_md5_init(&ctx);
160 av_md5_update(ctx, src, len);172 av_md5_update(&ctx, src, len);
161 av_md5_final(ctx, dst);173 av_md5_final(&ctx, dst);
162}174}
163 175
164#ifdef TEST176#ifdef TEST
165#include <stdio.h>
166#include <inttypes.h>
167#undef printf177#undef printf
178#include <stdio.h>
179
180static 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
168int main(void){188int main(void){
169 uint64_t md5val;189 uint8_t md5val[16];
170 int i;190 int i;
171 uint8_t in[1000];191 uint8_t in[1000];
172 192
173 for(i=0; i<1000; i++) in[i]= i*i;193 for (i = 0; i < 1000; i++)
174 av_md5_sum( (uint8_t*)&md5val, in, 1000); printf("%"PRId64"\n", md5val);194 in[i] = i * i;
175 av_md5_sum( (uint8_t*)&md5val, in, 63); printf("%"PRId64"\n", md5val);195 av_md5_sum(md5val, in, 1000); print_md5(md5val);
176 av_md5_sum( (uint8_t*)&md5val, in, 64); printf("%"PRId64"\n", md5val);196 av_md5_sum(md5val, in, 63); print_md5(md5val);
177 av_md5_sum( (uint8_t*)&md5val, in, 65); printf("%"PRId64"\n", md5val);197 av_md5_sum(md5val, in, 64); print_md5(md5val);
178 for(i=0; i<1000; i++) in[i]= i % 127;198 av_md5_sum(md5val, in, 65); print_md5(md5val);
179 av_md5_sum( (uint8_t*)&md5val, in, 999); printf("%"PRId64"\n", md5val);199 for (i = 0; i < 1000; i++)
200 in[i] = i % 127;
201 av_md5_sum(md5val, in, 999); print_md5(md5val);
180 202
181 return 0;203 return 0;
182}204}
libavutil/opt.c+1−1
@@ -30,6 +30,7 @@ · 29 unmodified lines
30#include "opt.h"30#include "opt.h"
31#include "eval.h"31#include "eval.h"
32#include "dict.h"32#include "dict.h"
33#include "log.h"
33 34
34#if FF_API_FIND_OPT35#if FF_API_FIND_OPT
35//FIXME order them and do a bin search36//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
195 return 0;196 return 0;
196 notfirst=1;197 notfirst=1;
197 }198 }
198 return AVERROR(EINVAL);
199 }199 }
200 200
201 if (alloc) {201 if (alloc) {
libavutil/parseutils.c+1−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
28#include "avstring.h"28#include "avstring.h"
29#include "avutil.h"29#include "avutil.h"
30#include "eval.h"30#include "eval.h"
31#include "log.h"
31#include "random_seed.h"32#include "random_seed.h"
32#include "parseutils.h"33#include "parseutils.h"
33 34
@@ -462,7 +463,6 @@ const char *small_strptime(const char *p, const char *fmt, · 428 unmodified lines
462 p++;463 p++;
463 }464 }
464 }465 }
465 return p;
466}466}
467 467
468static time_t mktimegm(struct tm *tm)468static time_t mktimegm(struct tm *tm)
libpostproc/postprocess_internal.h+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
28 28
29#include <string.h>29#include <string.h>
30#include "libavutil/avutil.h"30#include "libavutil/avutil.h"
31#include "libavutil/log.h"
31#include "postprocess.h"32#include "postprocess.h"
32 33
33#define V_DEBLOCK 0x0134#define V_DEBLOCK 0x01
libswscale/swscale.h+2−1
@@ -28,6 +28,8 @@ · 27 unmodified lines
28 */28 */
29 29
30#include "libavutil/avutil.h"30#include "libavutil/avutil.h"
31#include "libavutil/log.h"
32#include "libavutil/pixfmt.h"
31 33
32#define LIBSWSCALE_VERSION_MAJOR 234#define LIBSWSCALE_VERSION_MAJOR 2
33#define LIBSWSCALE_VERSION_MINOR 035#define LIBSWSCALE_VERSION_MINOR 0
@@ -247,7 +249,6 @@ int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[], · 213 unmodified lines
247 249
248/**250/**
249 * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]251 * @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
251 * @return -1 if not supported252 * @return -1 if not supported
252 */253 */
253int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],254int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
libswscale/swscale_internal.h+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
28#endif28#endif
29 29
30#include "libavutil/avutil.h"30#include "libavutil/avutil.h"
31#include "libavutil/log.h"
32#include "libavutil/pixfmt.h"
31 33
32#define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long34#define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long
33 35
tests/Makefile+1−0
@@ -43,6 +43,7 @@ include $(SRC_PATH)/tests/fate/amrnb.mak · 42 unmodified lines
43include $(SRC_PATH)/tests/fate/amrwb.mak43include $(SRC_PATH)/tests/fate/amrwb.mak
44include $(SRC_PATH)/tests/fate/fft.mak44include $(SRC_PATH)/tests/fate/fft.mak
45include $(SRC_PATH)/tests/fate/h264.mak45include $(SRC_PATH)/tests/fate/h264.mak
46include $(SRC_PATH)/tests/fate/libavutil.mak
46include $(SRC_PATH)/tests/fate/mp3.mak47include $(SRC_PATH)/tests/fate/mp3.mak
47include $(SRC_PATH)/tests/fate/vorbis.mak48include $(SRC_PATH)/tests/fate/vorbis.mak
48include $(SRC_PATH)/tests/fate/vp8.mak49include $(SRC_PATH)/tests/fate/vp8.mak
tests/fate/libavutil.mak+30−0
@@ -0,0 +1,30 @@
1FATE_TESTS += fate-adler32
2fate-adler32: libavutil/adler32-test$(EXESUF)
3fate-adler32: CMD = run libavutil/adler32-test
4fate-adler32: REF = /dev/null
5
6FATE_TESTS += fate-aes
7fate-aes: libavutil/aes-test$(EXESUF)
8fate-aes: CMD = run libavutil/aes-test
9fate-aes: REF = /dev/null
10
11FATE_TESTS += fate-base64
12fate-base64: libavutil/base64-test$(EXESUF)
13fate-base64: CMD = run libavutil/base64-test
14
15FATE_TESTS += fate-crc
16fate-crc: libavutil/crc-test$(EXESUF)
17fate-crc: CMD = run libavutil/crc-test
18
19FATE_TESTS += fate-des
20fate-des: libavutil/des-test$(EXESUF)
21fate-des: CMD = run libavutil/des-test
22fate-des: REF = /dev/null
23
24FATE_TESTS += fate-md5
25fate-md5: libavutil/md5-test$(EXESUF)
26fate-md5: CMD = run libavutil/md5-test
27
28FATE_TESTS += fate-sha
29fate-sha: libavutil/sha-test$(EXESUF)
30fate-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
213FATE_TESTS += fate-rv30213FATE_TESTS += fate-rv30
214fate-rv30: CMD = framecrc -flags +bitexact -dct fastint -idct simple -i $(SAMPLES)/real/rv30.rm -an214fate-rv30: CMD = framecrc -flags +bitexact -dct fastint -idct simple -i $(SAMPLES)/real/rv30.rm -an
215 215
216FATE_TESTS += fate-sha
217fate-sha: libavutil/sha-test$(EXESUF)
218fate-sha: CMD = run libavutil/sha-test
219
220FATE_TESTS += fate-adler32
221fate-adler32: libavutil/adler32-test$(EXESUF)
222fate-adler32: CMD = run libavutil/adler32-test
223fate-adler32: REF = /dev/null
224
225FATE_TESTS += fate-aes
226fate-aes: libavutil/aes-test$(EXESUF)
227fate-aes: CMD = run libavutil/aes-test
228fate-aes: REF = /dev/null
229
230FATE_TESTS += fate-base64
231fate-base64: libavutil/base64-test$(EXESUF)
232fate-base64: CMD = run libavutil/base64-test
233
234FATE_TESTS += fate-musepack7216FATE_TESTS += fate-musepack7
235fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc217fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc
236fate-musepack7: CMP = oneoff218fate-musepack7: CMP = oneoff
tests/ref/fate/crc+4−0
@@ -0,0 +1,4 @@
1crc EDB88320 =3D5CDD04
2crc 04C11DB7 =E0BAF5C0
3crc 00008005 =BB1F
4crc 00000007 =E3
tests/ref/fate/md5+5−0
@@ -0,0 +1,5 @@
10bf1bcc8a1d72e2cf58d42182b637e56
2993a3eb298e52aca83ecfbb6a766b4d0
307c01ca7c733475fad38c84c56f305c1
49fc8404827cac26385f48f4f58fd32ce
5a22bfef14302c5ca46e0ae91092bc0e0
tests/seek_test.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
25#include <string.h>25#include <string.h>
26 26
27#include "libavutil/common.h"27#include "libavutil/common.h"
28#include "libavutil/mathematics.h"
28#include "libavformat/avformat.h"29#include "libavformat/avformat.h"
29 30
30#undef exit31#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