Merge branch 'master' into oldabi
* master: (780 commits) ffmpeg: Fix doxygen comments for MetadataMap filters.texi: fix wrong references in the "Filtergraph syntax" section yadif: correct documentation on the parity parameter mpegvideo.h: remove the 1 line difference to qatar applehttp: fix variant discard logic Fix possible crash when decoding mpeg streams. h263dec: Fix asserts broken by the elimination of FF_COMMON_FRAME. avidec: skip seek pos adjustment for non interleaved files. Fixes Ticket327 lsws: remove deprecated and unused stuff after the 0->1 major bump cosmetics: remove some stray comments from AVCodec declarations cosmetics: fix indentation/alignment in AVCodec declarations Abort if command offset decreases, avoids potential endless loop. Warn when falling back to unreliable UMF fps tag. Detect NI-avi at playtime like mplayer. Fixes Ticket333 avidec: Fix XAN DPCM demuxing. Fix a possible miscompilation of cabac with old (broken) compilers. Fix -loop_input. Set bits_per_coded_sample when encoding ADPCM. vf_boxblur: call avfilter_draw_slice() at the end of draw_slice() vf_boxblur: fix out-of-buffer access when h > w ... Conflicts: ffmpeg.c libavcodec/avcodec.h libavcodec/opt.h libavcodec/version.h libavdevice/avdevice.h libavfilter/avfilter.h libavformat/avformat.h libavformat/aviobuf.c libavformat/rtsp.c libavformat/udp.c libavformat/utils.c libavformat/version.h libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
22d841becd
783 changed files with 22599 additions and 17510 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -32,7 +32,6 @@ tests/audiogen
|
|||
tests/base64
|
||||
tests/data
|
||||
tests/rotozoom
|
||||
tests/seek_test
|
||||
tests/tiny_psnr
|
||||
tests/videogen
|
||||
tests/vsynth1
|
||||
|
|
@ -44,5 +43,4 @@ tools/pktdumper
|
|||
tools/probetest
|
||||
tools/qt-faststart
|
||||
tools/trasher
|
||||
tools/trasher*.d
|
||||
version.h
|
||||
|
|
|
|||
82
Changelog
82
Changelog
|
|
@ -1,45 +1,18 @@
|
|||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version next:
|
||||
|
||||
- openal input device added
|
||||
- boxblur filter added
|
||||
- BWF muxer
|
||||
- Flash Screen Video 2 decoder
|
||||
|
||||
|
||||
version 0.8:
|
||||
|
||||
version 0.7:
|
||||
|
||||
- many many things we forgot because we rather write code than changelogs
|
||||
- libmpcodecs video filter support (3 times as many filters than before)
|
||||
- mpeg2 aspect ratio dection fixed
|
||||
- libxvid aspect pickiness fixed
|
||||
- Frame multithreaded decoding
|
||||
- E-AC-3 audio encoder
|
||||
- ac3enc: add channel coupling support
|
||||
- floating-point sample format support to the ac3, eac3, dca, aac, and vorbis decoders.
|
||||
- H264/MPEG frame-level multi-threading
|
||||
- All av_metadata_* functions renamed to av_dict_* and moved to libavutil
|
||||
- 4:4:4 H.264 decoding support
|
||||
- 10-bit H.264 optimizations for x86
|
||||
- lut, lutrgb, and lutyuv filters added
|
||||
- buffersink libavfilter sink added
|
||||
- Bump libswscale for recently reported ABI break
|
||||
|
||||
|
||||
version 0.7_beta2:
|
||||
|
||||
- VP8 frame-multithreading
|
||||
- NEON optimizations for VP8
|
||||
- Lots of deprecated API cruft removed
|
||||
- fft and imdct optimizations for AVX (Sandy Bridge) processors
|
||||
- showinfo filter added
|
||||
- DPX image encoder
|
||||
- SMPTE 302M AES3 audio decoder
|
||||
- Apple Core Audio Format muxer
|
||||
- 9bit and 10bit per sample support in the H.264 decoder
|
||||
- 9bit and 10bit FFV1 encoding / decoding
|
||||
- split filter added
|
||||
- select filter added
|
||||
- sdl output device added
|
||||
|
||||
|
||||
version 0.7_beta1:
|
||||
|
||||
- WebM support in Matroska de/muxer
|
||||
- low overhead Ogg muxing
|
||||
- MMS-TCP support
|
||||
|
|
@ -58,7 +31,7 @@ version 0.7_beta1:
|
|||
- RTP depacketization of QDM2
|
||||
- ANSI/ASCII art playback system
|
||||
- Lego Mindstorms RSO de/muxer
|
||||
- libavcore added
|
||||
- libavcore added (and subsequently removed)
|
||||
- SubRip subtitle file muxer and demuxer
|
||||
- Chinese AVS encoding via libxavs
|
||||
- ffprobe -show_packets option added
|
||||
|
|
@ -88,10 +61,10 @@ version 0.7_beta1:
|
|||
- demuxer for receiving raw rtp:// URLs without an SDP description
|
||||
- single stream LATM/LOAS decoder
|
||||
- setpts filter added
|
||||
- Win64 support for optimized asm functions
|
||||
- Win64 support for optimized x86 assembly functions
|
||||
- MJPEG/AVI1 to JPEG/JFIF bitstream filter
|
||||
- ASS subtitle encoder and decoder
|
||||
- IEC 61937 encapsulation for E-AC3, TrueHD, DTS-HD (for HDMI passthrough)
|
||||
- IEC 61937 encapsulation for E-AC-3, TrueHD, DTS-HD (for HDMI passthrough)
|
||||
- overlay filter added
|
||||
- rename aspect filter to setdar, and pixelaspect to setsar
|
||||
- IEC 61937 demuxer
|
||||
|
|
@ -126,6 +99,37 @@ version 0.7_beta1:
|
|||
- AMR-WB encoding via libvo-amrwbenc
|
||||
- xWMA demuxer
|
||||
- Mobotix MxPEG decoder
|
||||
- VP8 frame-multithreading
|
||||
- NEON optimizations for VP8
|
||||
- Lots of deprecated API cruft removed
|
||||
- fft and imdct optimizations for AVX (Sandy Bridge) processors
|
||||
- showinfo filter added
|
||||
- SMPTE 302M AES3 audio decoder
|
||||
- Apple Core Audio Format muxer
|
||||
- 9bit and 10bit per sample support in the H.264 decoder
|
||||
- 9bit and 10bit FFV1 encoding / decoding
|
||||
- split filter added
|
||||
- select filter added
|
||||
- sdl output device added
|
||||
- libmpcodecs video filter support (3 times as many filters than before)
|
||||
- mpeg2 aspect ratio dection fixed
|
||||
- libxvid aspect pickiness fixed
|
||||
- Frame multithreaded decoding
|
||||
- E-AC-3 audio encoder
|
||||
- ac3enc: add channel coupling support
|
||||
- floating-point sample format support to the ac3, eac3, dca, aac, and vorbis decoders.
|
||||
- H264/MPEG frame-level multi-threading
|
||||
- All av_metadata_* functions renamed to av_dict_* and moved to libavutil
|
||||
- 4:4:4 H.264 decoding support
|
||||
- 10-bit H.264 optimizations for x86
|
||||
- lut, lutrgb, and lutyuv filters added
|
||||
- buffersink libavfilter sink added
|
||||
- Bump libswscale for recently reported ABI break
|
||||
|
||||
|
||||
version 0.7:
|
||||
|
||||
- all the changes for 0.8, but keeping API/ABI compatibility with the 0.6 release
|
||||
|
||||
|
||||
version 0.6:
|
||||
|
|
|
|||
348
Doxyfile
348
Doxyfile
|
|
@ -1,4 +1,4 @@
|
|||
# Doxyfile 1.5.6
|
||||
# Doxyfile 1.7.1
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for a project
|
||||
|
|
@ -54,11 +54,11 @@ CREATE_SUBDIRS = NO
|
|||
# information to generate all constant output in the proper language.
|
||||
# The default language is English, other supported languages are:
|
||||
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
|
||||
# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
|
||||
# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
|
||||
# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
|
||||
# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,
|
||||
# and Ukrainian.
|
||||
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
|
||||
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
|
||||
# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
|
||||
# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
|
||||
# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
|
||||
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
|
|
@ -155,13 +155,6 @@ QT_AUTOBRIEF = NO
|
|||
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
|
||||
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
|
||||
# will output the detailed description near the top, like JavaDoc.
|
||||
# If set to NO, the detailed description appears after the member
|
||||
# documentation.
|
||||
|
||||
DETAILS_AT_TOP = NO
|
||||
|
||||
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
|
||||
# member inherits the documentation from any documented member that it
|
||||
# re-implements.
|
||||
|
|
@ -214,6 +207,18 @@ OPTIMIZE_FOR_FORTRAN = NO
|
|||
|
||||
OPTIMIZE_OUTPUT_VHDL = NO
|
||||
|
||||
# Doxygen selects the parser to use depending on the extension of the files it
|
||||
# parses. With this tag you can assign which parser to use for a given extension.
|
||||
# Doxygen has a built-in mapping, but you can override or extend it using this
|
||||
# tag. The format is ext=language, where ext is a file extension, and language
|
||||
# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
|
||||
# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
|
||||
# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
|
||||
# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
|
||||
# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
|
||||
|
||||
EXTENSION_MAPPING =
|
||||
|
||||
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
|
||||
# to include (a tag file for) the STL sources as input, then you should
|
||||
# set this tag to YES in order to let doxygen match functions declarations and
|
||||
|
|
@ -268,6 +273,22 @@ SUBGROUPING = YES
|
|||
|
||||
TYPEDEF_HIDES_STRUCT = NO
|
||||
|
||||
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
|
||||
# determine which symbols to keep in memory and which to flush to disk.
|
||||
# When the cache is full, less often used symbols will be written to disk.
|
||||
# For small to medium size projects (<1000 input files) the default value is
|
||||
# probably good enough. For larger projects a too small cache size can cause
|
||||
# doxygen to be busy swapping symbols to and from disk most of the time
|
||||
# causing a significant performance penality.
|
||||
# If the system has enough physical memory increasing the cache will improve the
|
||||
# performance by keeping more symbols in memory. Note that the value works on
|
||||
# a logarithmic scale so increasing the size by one will rougly double the
|
||||
# memory usage. The cache size is given by this formula:
|
||||
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols
|
||||
|
||||
SYMBOL_CACHE_SIZE = 0
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
@ -366,6 +387,12 @@ HIDE_SCOPE_NAMES = NO
|
|||
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
|
||||
# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
|
||||
# will list include files with double quotes in the documentation
|
||||
# rather than with sharp brackets.
|
||||
|
||||
FORCE_LOCAL_INCLUDES = NO
|
||||
|
||||
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
|
||||
# is inserted in the documentation for inline members.
|
||||
|
||||
|
|
@ -385,6 +412,16 @@ SORT_MEMBER_DOCS = YES
|
|||
|
||||
SORT_BRIEF_DOCS = NO
|
||||
|
||||
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
|
||||
# will sort the (brief and detailed) documentation of class members so that
|
||||
# constructors and destructors are listed first. If set to NO (the default)
|
||||
# the constructors will appear in the respective orders defined by
|
||||
# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
|
||||
# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
|
||||
# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
|
||||
|
||||
SORT_MEMBERS_CTORS_1ST = NO
|
||||
|
||||
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
|
||||
# hierarchy of group names into alphabetical order. If set to NO (the default)
|
||||
# the group names will appear in their defined order.
|
||||
|
|
@ -459,7 +496,8 @@ SHOW_DIRECTORIES = NO
|
|||
SHOW_FILES = YES
|
||||
|
||||
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
|
||||
# Namespaces page. This will remove the Namespaces entry from the Quick Index
|
||||
# Namespaces page.
|
||||
# This will remove the Namespaces entry from the Quick Index
|
||||
# and from the Folder Tree View (if specified). The default is YES.
|
||||
|
||||
SHOW_NAMESPACES = YES
|
||||
|
|
@ -474,6 +512,15 @@ SHOW_NAMESPACES = YES
|
|||
|
||||
FILE_VERSION_FILTER =
|
||||
|
||||
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
|
||||
# by doxygen. The layout file controls the global structure of the generated
|
||||
# output files in an output format independent way. The create the layout file
|
||||
# that represents doxygen's defaults, run doxygen with the -l option.
|
||||
# You can optionally specify a file name after the option, if omitted
|
||||
# DoxygenLayout.xml will be used as the name of the layout file.
|
||||
|
||||
LAYOUT_FILE =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
@ -577,7 +624,8 @@ EXCLUDE_SYMLINKS = NO
|
|||
# against the file with absolute path, so to exclude all test directories
|
||||
# for example use the pattern */test/*
|
||||
|
||||
EXCLUDE_PATTERNS = *.git *.d
|
||||
EXCLUDE_PATTERNS = *.git \
|
||||
*.d
|
||||
|
||||
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||
|
|
@ -591,14 +639,15 @@ EXCLUDE_SYMBOLS =
|
|||
# directories that contain example code fragments that are included (see
|
||||
# the \include command).
|
||||
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATH = libavcodec/ \
|
||||
libavformat/
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
# and *.h) to filter out the source-files in the directories. If left
|
||||
# blank all files are included.
|
||||
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_PATTERNS = *-example.c
|
||||
|
||||
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
|
||||
# searched for input files to be used with the \include or \dontinclude
|
||||
|
|
@ -618,14 +667,17 @@ IMAGE_PATH =
|
|||
# by executing (via popen()) the command <filter> <input-file>, where <filter>
|
||||
# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
|
||||
# input file. Doxygen will then use the output that the filter program writes
|
||||
# to standard output. If FILTER_PATTERNS is specified, this tag will be
|
||||
# to standard output.
|
||||
# If FILTER_PATTERNS is specified, this tag will be
|
||||
# ignored.
|
||||
|
||||
INPUT_FILTER =
|
||||
|
||||
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
|
||||
# basis. Doxygen will compare the file name with each pattern and apply the
|
||||
# filter if there is a match. The filters are a list of the form:
|
||||
# basis.
|
||||
# Doxygen will compare the file name with each pattern and apply the
|
||||
# filter if there is a match.
|
||||
# The filters are a list of the form:
|
||||
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
|
||||
# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
|
||||
# is applied to all files.
|
||||
|
|
@ -675,7 +727,8 @@ REFERENCES_RELATION = NO
|
|||
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
|
||||
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
|
||||
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
|
||||
# link to the source code. Otherwise they will link to the documentstion.
|
||||
# link to the source code.
|
||||
# Otherwise they will link to the documentation.
|
||||
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
|
||||
|
|
@ -758,18 +811,50 @@ HTML_FOOTER =
|
|||
|
||||
HTML_STYLESHEET =
|
||||
|
||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
|
||||
# Doxygen will adjust the colors in the stylesheet and background images
|
||||
# according to this color. Hue is specified as an angle on a colorwheel,
|
||||
# see http://en.wikipedia.org/wiki/Hue for more information.
|
||||
# For instance the value 0 represents red, 60 is yellow, 120 is green,
|
||||
# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
|
||||
# The allowed range is 0 to 359.
|
||||
|
||||
HTML_COLORSTYLE_HUE = 220
|
||||
|
||||
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
|
||||
# the colors in the HTML output. For a value of 0 the output will use
|
||||
# grayscales only. A value of 255 will produce the most vivid colors.
|
||||
|
||||
HTML_COLORSTYLE_SAT = 100
|
||||
|
||||
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
|
||||
# the luminance component of the colors in the HTML output. Values below
|
||||
# 100 gradually make the output lighter, whereas values above 100 make
|
||||
# the output darker. The value divided by 100 is the actual gamma applied,
|
||||
# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
|
||||
# and 100 does not change the gamma.
|
||||
|
||||
HTML_COLORSTYLE_GAMMA = 80
|
||||
|
||||
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
|
||||
# page will contain the date and time when the page was generated. Setting
|
||||
# this to NO can help when comparing the output of multiple runs.
|
||||
|
||||
HTML_TIMESTAMP = YES
|
||||
|
||||
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
|
||||
# files or namespaces will be aligned in HTML using tables. If set to
|
||||
# NO a bullet list will be used.
|
||||
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
||||
# will be generated that can be used as input for tools like the
|
||||
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
|
||||
# of the generated HTML documentation.
|
||||
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
|
||||
# documentation will contain sections that can be hidden and shown after the
|
||||
# page has loaded. For this to work a browser that supports
|
||||
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
|
||||
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
|
||||
|
||||
GENERATE_HTMLHELP = NO
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
|
||||
# If the GENERATE_DOCSET tag is set to YES, additional index files
|
||||
# will be generated that can be used as input for Apple's Xcode 3
|
||||
|
|
@ -779,6 +864,8 @@ GENERATE_HTMLHELP = NO
|
|||
# directory and running "make install" will install the docset in
|
||||
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
|
||||
# it at startup.
|
||||
# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
|
||||
# for more information.
|
||||
|
||||
GENERATE_DOCSET = NO
|
||||
|
||||
|
|
@ -796,13 +883,22 @@ DOCSET_FEEDNAME = "Doxygen generated docs"
|
|||
|
||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
||||
|
||||
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
|
||||
# documentation will contain sections that can be hidden and shown after the
|
||||
# page has loaded. For this to work a browser that supports
|
||||
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
|
||||
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
|
||||
# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
|
||||
# the documentation publisher. This should be a reverse domain-name style
|
||||
# string, e.g. com.mycompany.MyDocSet.documentation.
|
||||
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
|
||||
|
||||
# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
|
||||
|
||||
DOCSET_PUBLISHER_NAME = Publisher
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
||||
# will be generated that can be used as input for tools like the
|
||||
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
|
||||
# of the generated HTML documentation.
|
||||
|
||||
GENERATE_HTMLHELP = NO
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
|
||||
# be used to specify the file name of the resulting .chm file. You
|
||||
|
|
@ -841,6 +937,76 @@ BINARY_TOC = NO
|
|||
|
||||
TOC_EXPAND = NO
|
||||
|
||||
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
|
||||
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
|
||||
# that can be used as input for Qt's qhelpgenerator to generate a
|
||||
# Qt Compressed Help (.qch) of the generated HTML documentation.
|
||||
|
||||
GENERATE_QHP = NO
|
||||
|
||||
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
|
||||
# be used to specify the file name of the resulting .qch file.
|
||||
# The path specified is relative to the HTML output folder.
|
||||
|
||||
QCH_FILE =
|
||||
|
||||
# The QHP_NAMESPACE tag specifies the namespace to use when generating
|
||||
# Qt Help Project output. For more information please see
|
||||
# http://doc.trolltech.com/qthelpproject.html#namespace
|
||||
|
||||
QHP_NAMESPACE = org.doxygen.Project
|
||||
|
||||
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
|
||||
# Qt Help Project output. For more information please see
|
||||
# http://doc.trolltech.com/qthelpproject.html#virtual-folders
|
||||
|
||||
QHP_VIRTUAL_FOLDER = doc
|
||||
|
||||
# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
|
||||
# add. For more information please see
|
||||
# http://doc.trolltech.com/qthelpproject.html#custom-filters
|
||||
|
||||
QHP_CUST_FILTER_NAME =
|
||||
|
||||
# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
|
||||
# custom filter to add. For more information please see
|
||||
# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
|
||||
# Qt Help Project / Custom Filters</a>.
|
||||
|
||||
QHP_CUST_FILTER_ATTRS =
|
||||
|
||||
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
|
||||
# project's
|
||||
# filter section matches.
|
||||
# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
|
||||
# Qt Help Project / Filter Attributes</a>.
|
||||
|
||||
QHP_SECT_FILTER_ATTRS =
|
||||
|
||||
# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
|
||||
# be used to specify the location of Qt's qhelpgenerator.
|
||||
# If non-empty doxygen will try to run qhelpgenerator on the generated
|
||||
# .qhp file.
|
||||
|
||||
QHG_LOCATION =
|
||||
|
||||
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
|
||||
# will be generated, which together with the HTML files, form an Eclipse help
|
||||
# plugin. To install this plugin and make it available under the help contents
|
||||
# menu in Eclipse, the contents of the directory containing the HTML and XML
|
||||
# files needs to be copied into the plugins directory of eclipse. The name of
|
||||
# the directory within the plugins directory should be the same as
|
||||
# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
|
||||
# the help appears.
|
||||
|
||||
GENERATE_ECLIPSEHELP = NO
|
||||
|
||||
# A unique identifier for the eclipse help plugin. When installing the plugin
|
||||
# the directory name containing the HTML and XML files should also have
|
||||
# this name.
|
||||
|
||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
||||
|
||||
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
|
||||
# top of each HTML page. The value NO (the default) enables the index and
|
||||
# the value YES disables it.
|
||||
|
|
@ -854,27 +1020,30 @@ ENUM_VALUES_PER_LINE = 4
|
|||
|
||||
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
|
||||
# structure should be generated to display hierarchical information.
|
||||
# If the tag value is set to FRAME, a side panel will be generated
|
||||
# If the tag value is set to YES, a side panel will be generated
|
||||
# containing a tree-like index structure (just like the one that
|
||||
# is generated for HTML Help). For this to work a browser that supports
|
||||
# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
|
||||
# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
|
||||
# probably better off using the HTML help feature. Other possible values
|
||||
# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
|
||||
# and Class Hiererachy pages using a tree view instead of an ordered list;
|
||||
# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
|
||||
# disables this behavior completely. For backwards compatibility with previous
|
||||
# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
|
||||
# respectively.
|
||||
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
|
||||
# Windows users are probably better off using the HTML help feature.
|
||||
|
||||
GENERATE_TREEVIEW = NO
|
||||
|
||||
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
|
||||
# and Class Hierarchy pages using a tree view instead of an ordered list.
|
||||
|
||||
USE_INLINE_TREES = NO
|
||||
|
||||
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
|
||||
# used to set the initial width (in pixels) of the frame in which the tree
|
||||
# is shown.
|
||||
|
||||
TREEVIEW_WIDTH = 250
|
||||
|
||||
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
|
||||
# links to external symbols imported via tag files in a separate window.
|
||||
|
||||
EXT_LINKS_IN_WINDOW = NO
|
||||
|
||||
# Use this tag to change the font size of Latex formulas included
|
||||
# as images in the HTML documentation. The default is 10. Note that
|
||||
# when you change the font size after a successful doxygen run you need
|
||||
|
|
@ -883,6 +1052,34 @@ TREEVIEW_WIDTH = 250
|
|||
|
||||
FORMULA_FONTSIZE = 10
|
||||
|
||||
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
|
||||
# generated for formulas are transparent PNGs. Transparent PNGs are
|
||||
# not supported properly for IE 6.0, but are supported on all modern browsers.
|
||||
# Note that when changing this option you need to delete any form_*.png files
|
||||
# in the HTML output before the changes have effect.
|
||||
|
||||
FORMULA_TRANSPARENT = YES
|
||||
|
||||
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
|
||||
# for the HTML output. The underlying search engine uses javascript
|
||||
# and DHTML and should work on any modern browser. Note that when using
|
||||
# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
|
||||
# (GENERATE_DOCSET) there is already a search function so this one should
|
||||
# typically be disabled. For large projects the javascript based search engine
|
||||
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
|
||||
|
||||
SEARCHENGINE = NO
|
||||
|
||||
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
||||
# implemented using a PHP enabled web server instead of at the web client
|
||||
# using Javascript. Doxygen will generate the search PHP script and index
|
||||
# file to put on the web server. The advantage of the server
|
||||
# based approach is that it scales better to large projects and allows
|
||||
# full text search. The disadvances is that it is more difficult to setup
|
||||
# and does not have live searching capabilities.
|
||||
|
||||
SERVER_BASED_SEARCH = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
@ -900,6 +1097,9 @@ LATEX_OUTPUT = latex
|
|||
|
||||
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
|
||||
# invoked. If left blank `latex' will be used as the default command name.
|
||||
# Note that when enabling USE_PDFLATEX this option is only used for
|
||||
# generating bitmaps for formulas in the HTML output, but not in the
|
||||
# Makefile that is written to the output directory.
|
||||
|
||||
LATEX_CMD_NAME = latex
|
||||
|
||||
|
|
@ -959,6 +1159,13 @@ LATEX_BATCHMODE = NO
|
|||
|
||||
LATEX_HIDE_INDICES = NO
|
||||
|
||||
# If LATEX_SOURCE_CODE is set to YES then doxygen will include
|
||||
# source code with syntax highlighting in the LaTeX output.
|
||||
# Note that which sources are shown also depends on other settings
|
||||
# such as SOURCE_BROWSER.
|
||||
|
||||
LATEX_SOURCE_CODE = NO
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
|
|
@ -1095,8 +1302,10 @@ GENERATE_PERLMOD = NO
|
|||
PERLMOD_LATEX = NO
|
||||
|
||||
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
|
||||
# nicely formatted so it can be parsed by a human reader. This is useful
|
||||
# if you want to understand what is going on. On the other hand, if this
|
||||
# nicely formatted so it can be parsed by a human reader.
|
||||
# This is useful
|
||||
# if you want to understand what is going on.
|
||||
# On the other hand, if this
|
||||
# tag is set to NO the size of the Perl module output will be much smaller
|
||||
# and Perl will parse it just the same.
|
||||
|
||||
|
|
@ -1158,16 +1367,23 @@ INCLUDE_FILE_PATTERNS =
|
|||
# undefined via #undef or recursively expanded use the := operator
|
||||
# instead of the = operator.
|
||||
|
||||
PREDEFINED = __attribute__(x)="" "RENAME(x)=x ## _TMPL" "DEF(x)=x ## _TMPL" \
|
||||
HAVE_AV_CONFIG_H HAVE_MMX HAVE_MMX2 HAVE_AMD3DNOW \
|
||||
PREDEFINED = "__attribute__(x)=" \
|
||||
"RENAME(x)=x ## _TMPL" \
|
||||
"DEF(x)=x ## _TMPL" \
|
||||
HAVE_AV_CONFIG_H \
|
||||
HAVE_MMX \
|
||||
HAVE_MMX2 \
|
||||
HAVE_AMD3DNOW \
|
||||
"DECLARE_ALIGNED(a,t,n)=t n" \
|
||||
"offsetof(x,y)=0x42"
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
||||
# The macro definition that is found in the sources will be used.
|
||||
# Use the PREDEFINED tag if you want to use a different macro definition.
|
||||
|
||||
#EXPAND_AS_DEFINED = FF_COMMON_FRAME
|
||||
EXPAND_AS_DEFINED = declare_idct(idct, table, idct_row_head, idct_row, idct_row_tail, idct_row_mid)
|
||||
EXPAND_AS_DEFINED = declare_idct \
|
||||
READ_PAR_DATA \
|
||||
|
||||
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
||||
# doxygen's preprocessor will remove all function-like macros that are alone
|
||||
|
|
@ -1185,9 +1401,11 @@ SKIP_FUNCTION_MACROS = YES
|
|||
# Optionally an initial location of the external documentation
|
||||
# can be added for each tagfile. The format of a tag file without
|
||||
# this location is as follows:
|
||||
# TAGFILES = file1 file2 ...
|
||||
#
|
||||
# TAGFILES = file1 file2 ...
|
||||
# Adding location for the tag files is done as follows:
|
||||
# TAGFILES = file1=loc1 "file2 = loc2" ...
|
||||
#
|
||||
# TAGFILES = file1=loc1 "file2 = loc2" ...
|
||||
# where "loc1" and "loc2" can be relative or absolute paths or
|
||||
# URLs. If a location is present for each tag, the installdox tool
|
||||
# does not have to be run to correct the links.
|
||||
|
|
@ -1255,6 +1473,14 @@ HIDE_UNDOC_RELATIONS = YES
|
|||
|
||||
HAVE_DOT = NO
|
||||
|
||||
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
|
||||
# allowed to run in parallel. When set to 0 (the default) doxygen will
|
||||
# base this on the number of processors available in the system. You can set it
|
||||
# explicitly to a value larger than 0 to get control over the balance
|
||||
# between CPU load and processing speed.
|
||||
|
||||
DOT_NUM_THREADS = 0
|
||||
|
||||
# By default doxygen will write a font called FreeSans.ttf to the output
|
||||
# directory and reference it in all dot files that doxygen generates. This
|
||||
# font does not include all possible unicode characters however, so when you need
|
||||
|
|
@ -1266,6 +1492,11 @@ HAVE_DOT = NO
|
|||
|
||||
DOT_FONTNAME = FreeSans
|
||||
|
||||
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
|
||||
# The default size is 10pt.
|
||||
|
||||
DOT_FONTSIZE = 10
|
||||
|
||||
# By default doxygen will tell dot to use the output directory to look for the
|
||||
# FreeSans.ttf font (which doxygen will put there itself). If you specify a
|
||||
# different font using DOT_FONTNAME you can set the path where dot
|
||||
|
|
@ -1383,10 +1614,10 @@ DOT_GRAPH_MAX_NODES = 50
|
|||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
|
||||
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
|
||||
# background. This is enabled by default, which results in a transparent
|
||||
# background. Warning: Depending on the platform used, enabling this option
|
||||
# may lead to badly anti-aliased labels on the edges of a graph (i.e. they
|
||||
# become hard to read).
|
||||
# background. This is disabled by default, because dot on Windows does not
|
||||
# seem to support this out of the box. Warning: Depending on the platform used,
|
||||
# enabling this option may lead to badly anti-aliased labels on the edges of
|
||||
# a graph (i.e. they become hard to read).
|
||||
|
||||
DOT_TRANSPARENT = YES
|
||||
|
||||
|
|
@ -1408,12 +1639,3 @@ GENERATE_LEGEND = YES
|
|||
# the various graphs.
|
||||
|
||||
DOT_CLEANUP = YES
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# The SEARCHENGINE tag specifies whether or not a search engine should be
|
||||
# used. If set to NO the values of all tags below this one will be ignored.
|
||||
|
||||
SEARCHENGINE = NO
|
||||
|
|
|
|||
10
MAINTAINERS
10
MAINTAINERS
|
|
@ -362,6 +362,16 @@ Sparc Roman Shaposhnik
|
|||
x86 Michael Niedermayer
|
||||
|
||||
|
||||
Releases
|
||||
========
|
||||
|
||||
0.5 *Deprecated/Unmaintained*
|
||||
0.6 Stefano Sabatini
|
||||
0.7 Michael Niedermayer
|
||||
0.8 Michael Niedermayer
|
||||
|
||||
|
||||
|
||||
GnuPG Fingerprints of maintainers and others who have svn write access
|
||||
======================================================================
|
||||
|
||||
|
|
|
|||
224
Makefile
224
Makefile
|
|
@ -1,13 +1,13 @@
|
|||
MAIN_MAKEFILE=1
|
||||
include config.mak
|
||||
|
||||
SRC_DIR = $(SRC_PATH_BARE)
|
||||
vpath %.c $(SRC_PATH)
|
||||
vpath %.h $(SRC_PATH)
|
||||
vpath %.S $(SRC_PATH)
|
||||
vpath %.asm $(SRC_PATH)
|
||||
vpath %.v $(SRC_PATH)
|
||||
vpath %.texi $(SRC_PATH)
|
||||
|
||||
vpath %.c $(SRC_DIR)
|
||||
vpath %.h $(SRC_DIR)
|
||||
vpath %.S $(SRC_DIR)
|
||||
vpath %.asm $(SRC_DIR)
|
||||
vpath %.v $(SRC_DIR)
|
||||
vpath %.texi $(SRC_PATH_BARE)
|
||||
|
||||
PROGS-$(CONFIG_FFMPEG) += ffmpeg
|
||||
PROGS-$(CONFIG_FFPLAY) += ffplay
|
||||
|
|
@ -17,20 +17,16 @@ PROGS-$(CONFIG_FFSERVER) += ffserver
|
|||
PROGS := $(PROGS-yes:%=%$(EXESUF))
|
||||
PROGS_G = $(PROGS-yes:%=%_g$(EXESUF))
|
||||
OBJS = $(PROGS-yes:%=%.o) cmdutils.o
|
||||
MANPAGES = $(PROGS-yes:%=doc/%.1)
|
||||
PODPAGES = $(PROGS-yes:%=doc/%.pod)
|
||||
HTMLPAGES = $(PROGS-yes:%=doc/%.html)
|
||||
TOOLS = $(addprefix tools/, $(addsuffix $(EXESUF), cws2fws graph2dot lavfi-showfiltfmts pktdumper probetest qt-faststart trasher))
|
||||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64
|
||||
HOSTPROGS := $(TESTTOOLS:%=tests/%)
|
||||
TOOLS = qt-faststart trasher
|
||||
TOOLS-$(CONFIG_ZLIB) += cws2fws
|
||||
|
||||
BASENAMES = ffmpeg ffplay ffprobe ffserver
|
||||
ALLPROGS = $(BASENAMES:%=%$(EXESUF))
|
||||
ALLPROGS_G = $(BASENAMES:%=%_g$(EXESUF))
|
||||
ALLMANPAGES = $(BASENAMES:%=%.1)
|
||||
|
||||
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
|
||||
|
||||
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
|
||||
FFLIBS-$(CONFIG_AVFILTER) += avfilter
|
||||
FFLIBS-$(CONFIG_AVFORMAT) += avformat
|
||||
|
|
@ -40,33 +36,35 @@ FFLIBS-$(CONFIG_SWSCALE) += swscale
|
|||
|
||||
FFLIBS := avutil
|
||||
|
||||
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
|
||||
DATA_FILES := $(wildcard $(SRC_PATH)/ffpresets/*.ffpreset)
|
||||
|
||||
SKIPHEADERS = cmdutils_common_opts.h
|
||||
|
||||
include common.mak
|
||||
include $(SRC_PATH)/common.mak
|
||||
|
||||
FF_LDFLAGS := $(FFLDFLAGS)
|
||||
FF_EXTRALIBS := $(FFEXTRALIBS)
|
||||
FF_DEP_LIBS := $(DEP_LIBS)
|
||||
|
||||
all-$(CONFIG_DOC): documentation
|
||||
|
||||
all: $(FF_DEP_LIBS) $(PROGS)
|
||||
all: $(PROGS)
|
||||
|
||||
$(PROGS): %$(EXESUF): %_g$(EXESUF)
|
||||
$(CP) $< $@
|
||||
$(STRIP) $@
|
||||
|
||||
$(TOOLS): %$(EXESUF): %.o
|
||||
$(LD) $(LDFLAGS) -o $@ $< $(ELIBS)
|
||||
|
||||
tools/cws2fws$(EXESUF): ELIBS = -lz
|
||||
|
||||
config.h: .config
|
||||
.config: $(wildcard $(FFLIBS:%=$(SRC_DIR)/lib%/all*.c))
|
||||
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
|
||||
@-tput bold 2>/dev/null
|
||||
@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
|
||||
@-tput sgr0 2>/dev/null
|
||||
|
||||
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
|
||||
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
|
||||
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS
|
||||
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS TOOLS
|
||||
|
||||
define RESET
|
||||
$(1) :=
|
||||
|
|
@ -76,31 +74,24 @@ endef
|
|||
define DOSUBDIR
|
||||
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
|
||||
SUBDIR := $(1)/
|
||||
include $(1)/Makefile
|
||||
include $(SRC_PATH)/$(1)/Makefile
|
||||
endef
|
||||
|
||||
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
|
||||
|
||||
ffplay.o: CFLAGS += $(SDL_CFLAGS)
|
||||
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
|
||||
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
|
||||
ffserver_g$(EXESUF): LDFLAGS += $(FFSERVERLDFLAGS)
|
||||
|
||||
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
|
||||
$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
|
||||
|
||||
alltools: $(TOOLS)
|
||||
|
||||
tools/%$(EXESUF): tools/%.o
|
||||
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
|
||||
tools/%.o: tools/%.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(CC_O) $<
|
||||
OBJDIRS += tools
|
||||
|
||||
-include $(wildcard tools/*.d)
|
||||
-include $(wildcard tests/*.d)
|
||||
|
||||
VERSION_SH = $(SRC_PATH_BARE)/version.sh
|
||||
GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD
|
||||
VERSION_SH = $(SRC_PATH)/version.sh
|
||||
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
|
||||
|
||||
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
|
||||
.version: M=@
|
||||
|
|
@ -112,28 +103,6 @@ version.h .version:
|
|||
# force version.sh to run whenever version might have changed
|
||||
-include .version
|
||||
|
||||
DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
|
||||
|
||||
documentation: $(DOCS)
|
||||
|
||||
-include $(wildcard $(DOCS:%=%.d))
|
||||
|
||||
TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
|
||||
|
||||
doc/%.html: TAG = HTML
|
||||
doc/%.html: doc/%.texi $(SRC_PATH_BARE)/doc/t2h.init
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)texi2html -monolithic --init-file $(SRC_PATH_BARE)/doc/t2h.init --output $@ $<
|
||||
|
||||
doc/%.pod: TAG = POD
|
||||
doc/%.pod: doc/%.texi
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)doc/texi2pod.pl $< $@
|
||||
|
||||
doc/%.1: TAG = MAN
|
||||
doc/%.1: doc/%.pod
|
||||
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
|
||||
|
||||
ifdef PROGS
|
||||
install: install-progs install-data
|
||||
endif
|
||||
|
|
@ -143,7 +112,6 @@ install: install-libs install-headers
|
|||
install-libs: install-libs-yes
|
||||
|
||||
install-progs-yes:
|
||||
install-progs-$(CONFIG_DOC): install-man
|
||||
install-progs-$(CONFIG_SHARED): install-libs
|
||||
|
||||
install-progs: install-progs-yes $(PROGS)
|
||||
|
|
@ -154,11 +122,7 @@ install-data: $(DATA_FILES)
|
|||
$(Q)mkdir -p "$(DATADIR)"
|
||||
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
|
||||
|
||||
install-man: $(MANPAGES)
|
||||
$(Q)mkdir -p "$(MANDIR)/man1"
|
||||
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
||||
|
||||
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data uninstall-man
|
||||
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
|
||||
|
||||
uninstall-progs:
|
||||
$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
|
||||
|
|
@ -166,19 +130,9 @@ uninstall-progs:
|
|||
uninstall-data:
|
||||
$(RM) -r "$(DATADIR)"
|
||||
|
||||
uninstall-man:
|
||||
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
||||
|
||||
testclean:
|
||||
$(RM) -r tests/vsynth1 tests/vsynth2 tests/data
|
||||
$(RM) $(addprefix tests/,$(CLEANSUFFIXES))
|
||||
$(RM) tests/seek_test$(EXESUF) tests/seek_test.o
|
||||
$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
|
||||
|
||||
clean:: testclean
|
||||
clean::
|
||||
$(RM) $(ALLPROGS) $(ALLPROGS_G)
|
||||
$(RM) $(CLEANSUFFIXES)
|
||||
$(RM) doc/*.html doc/*.pod doc/*.1
|
||||
$(RM) $(TOOLS)
|
||||
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
||||
|
||||
|
|
@ -189,119 +143,19 @@ distclean::
|
|||
config:
|
||||
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
|
||||
|
||||
# regression tests
|
||||
include $(SRC_PATH)/doc/Makefile
|
||||
include $(SRC_PATH)/tests/Makefile
|
||||
|
||||
check: test
|
||||
$(sort $(OBJDIRS)):
|
||||
$(Q)mkdir -p $@
|
||||
|
||||
fulltest test: codectest lavftest lavfitest seektest
|
||||
# Dummy rule to stop make trying to rebuild removed or renamed headers
|
||||
%.h:
|
||||
@:
|
||||
|
||||
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
|
||||
# Disable suffix rules. Most of the builtin rules are suffix rules,
|
||||
# so this saves some time on slow systems.
|
||||
.SUFFIXES:
|
||||
|
||||
codectest: fate-codec
|
||||
lavftest: fate-lavf
|
||||
lavfitest: fate-lavfi
|
||||
seektest: fate-seek
|
||||
|
||||
AREF = fate-acodec-aref
|
||||
VREF = fate-vsynth1-vref fate-vsynth2-vref
|
||||
REFS = $(AREF) $(VREF)
|
||||
|
||||
$(VREF): ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm
|
||||
$(AREF): ffmpeg$(EXESUF) tests/data/asynth1.sw
|
||||
|
||||
ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
|
||||
@echo
|
||||
@echo "Unfortunately ffserver is broken and therefore its regression"
|
||||
@echo "test fails randomly. Treat the results accordingly."
|
||||
@echo
|
||||
$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
|
||||
|
||||
tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
|
||||
@mkdir -p tests/vsynth1
|
||||
$(M)./$< 'tests/vsynth1/'
|
||||
|
||||
tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
|
||||
@mkdir -p tests/vsynth2
|
||||
$(M)./$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
|
||||
|
||||
tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
|
||||
@mkdir -p tests/data
|
||||
$(M)./$< $@
|
||||
|
||||
tests/data/asynth1.sw tests/vsynth%/00.pgm: TAG = GEN
|
||||
|
||||
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
|
||||
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
|
||||
tools/lavfi-showfiltfmts$(EXESUF): tools/lavfi-showfiltfmts.o $(FF_DEP_LIBS)
|
||||
$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
|
||||
|
||||
include $(SRC_PATH_BARE)/tests/fate.mak
|
||||
include $(SRC_PATH_BARE)/tests/fate2.mak
|
||||
|
||||
include $(SRC_PATH_BARE)/tests/fate/aac.mak
|
||||
include $(SRC_PATH_BARE)/tests/fate/als.mak
|
||||
include $(SRC_PATH_BARE)/tests/fate/fft.mak
|
||||
include $(SRC_PATH_BARE)/tests/fate/h264.mak
|
||||
include $(SRC_PATH_BARE)/tests/fate/mp3.mak
|
||||
include $(SRC_PATH_BARE)/tests/fate/vorbis.mak
|
||||
include $(SRC_PATH_BARE)/tests/fate/vp8.mak
|
||||
|
||||
FATE_ACODEC = $(ACODEC_TESTS:%=fate-acodec-%)
|
||||
FATE_VSYNTH1 = $(VCODEC_TESTS:%=fate-vsynth1-%)
|
||||
FATE_VSYNTH2 = $(VCODEC_TESTS:%=fate-vsynth2-%)
|
||||
FATE_VCODEC = $(FATE_VSYNTH1) $(FATE_VSYNTH2)
|
||||
FATE_LAVF = $(LAVF_TESTS:%=fate-lavf-%)
|
||||
FATE_LAVFI = $(LAVFI_TESTS:%=fate-lavfi-%)
|
||||
FATE_SEEK = $(SEEK_TESTS:seek_%=fate-seek-%)
|
||||
|
||||
FATE = $(FATE_ACODEC) \
|
||||
$(FATE_VCODEC) \
|
||||
$(FATE_LAVF) \
|
||||
$(FATE_LAVFI) \
|
||||
$(FATE_SEEK) \
|
||||
|
||||
$(filter-out %-aref,$(FATE_ACODEC)): $(AREF)
|
||||
$(filter-out %-vref,$(FATE_VCODEC)): $(VREF)
|
||||
$(FATE_LAVF): $(REFS)
|
||||
$(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
|
||||
$(FATE_SEEK): fate-codec fate-lavf tests/seek_test$(EXESUF)
|
||||
|
||||
$(FATE_ACODEC): CMD = codectest acodec
|
||||
$(FATE_VSYNTH1): CMD = codectest vsynth1
|
||||
$(FATE_VSYNTH2): CMD = codectest vsynth2
|
||||
$(FATE_LAVF): CMD = lavftest
|
||||
$(FATE_LAVFI): CMD = lavfitest
|
||||
$(FATE_SEEK): CMD = seektest
|
||||
|
||||
fate-codec: fate-acodec fate-vcodec
|
||||
fate-acodec: $(FATE_ACODEC)
|
||||
fate-vcodec: $(FATE_VCODEC)
|
||||
fate-lavf: $(FATE_LAVF)
|
||||
fate-lavfi: $(FATE_LAVFI)
|
||||
fate-seek: $(FATE_SEEK)
|
||||
|
||||
ifdef SAMPLES
|
||||
FATE += $(FATE_TESTS)
|
||||
fate-rsync:
|
||||
rsync -vaLW rsync://fate-suite.libav.org/fate-suite/ $(SAMPLES)
|
||||
else
|
||||
fate-rsync:
|
||||
@echo "use 'make fate-rsync SAMPLES=/path/to/samples' to sync the fate suite"
|
||||
$(FATE_TESTS):
|
||||
@echo "SAMPLES not specified, cannot run FATE. See doc/fate.txt for more information."
|
||||
endif
|
||||
|
||||
FATE_UTILS = base64 tiny_psnr
|
||||
|
||||
fate: $(FATE)
|
||||
|
||||
$(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
|
||||
@echo "TEST $(@:fate-%=%)"
|
||||
$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)'
|
||||
|
||||
fate-list:
|
||||
@printf '%s\n' $(sort $(FATE))
|
||||
|
||||
.PHONY: all alltools *clean check config documentation examples install*
|
||||
.PHONY: *test testprogs uninstall*
|
||||
.PHONY: all all-yes alltools *clean config examples install*
|
||||
.PHONY: testprogs uninstall*
|
||||
|
|
|
|||
2
RELEASE
2
RELEASE
|
|
@ -1 +1 @@
|
|||
0.7
|
||||
0.8.git
|
||||
|
|
|
|||
241
cmdutils.c
241
cmdutils.c
|
|
@ -49,13 +49,10 @@
|
|||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
const char **opt_names;
|
||||
const char **opt_values;
|
||||
static int opt_name_count;
|
||||
AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||
AVFormatContext *avformat_opts;
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *format_opts, *video_opts, *audio_opts, *sub_opts;
|
||||
AVDictionary *format_opts, *codec_opts;
|
||||
|
||||
static const int this_year = 2011;
|
||||
|
||||
|
|
@ -63,7 +60,7 @@ void init_opts(void)
|
|||
{
|
||||
int i;
|
||||
for (i = 0; i < AVMEDIA_TYPE_NB; i++)
|
||||
avcodec_opts[i] = avcodec_alloc_context2(i);
|
||||
avcodec_opts[i] = avcodec_alloc_context3(NULL);
|
||||
avformat_opts = avformat_alloc_context();
|
||||
#if CONFIG_SWSCALE
|
||||
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC, NULL, NULL, NULL);
|
||||
|
|
@ -81,17 +78,8 @@ void uninit_opts(void)
|
|||
sws_freeContext(sws_opts);
|
||||
sws_opts = NULL;
|
||||
#endif
|
||||
for (i = 0; i < opt_name_count; i++) {
|
||||
av_freep(&opt_names[i]);
|
||||
av_freep(&opt_values[i]);
|
||||
}
|
||||
av_freep(&opt_names);
|
||||
av_freep(&opt_values);
|
||||
opt_name_count = 0;
|
||||
av_dict_free(&format_opts);
|
||||
av_dict_free(&video_opts);
|
||||
av_dict_free(&audio_opts);
|
||||
av_dict_free(&sub_opts);
|
||||
av_dict_free(&codec_opts);
|
||||
}
|
||||
|
||||
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl)
|
||||
|
|
@ -281,7 +269,7 @@ unknown_opt:
|
|||
*po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
|
||||
} else if (po->u.func_arg) {
|
||||
if (po->u.func_arg(opt, arg) < 0) {
|
||||
fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
|
||||
fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg ? arg : "[null]", opt);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
|
@ -297,20 +285,14 @@ unknown_opt:
|
|||
}
|
||||
|
||||
#define FLAGS (o->type == FF_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
|
||||
#define SET_PREFIXED_OPTS(ch, flag, output) \
|
||||
if (opt[0] == ch && avcodec_opts[0] && (o = av_opt_find(avcodec_opts[0], opt+1, NULL, flag, 0)))\
|
||||
av_dict_set(&output, opt+1, arg, FLAGS);
|
||||
static int opt_default2(const char *opt, const char *arg)
|
||||
int opt_default(const char *opt, const char *arg)
|
||||
{
|
||||
const AVOption *o;
|
||||
if ((o = av_opt_find(avcodec_opts[0], opt, NULL, 0, AV_OPT_SEARCH_CHILDREN))) {
|
||||
if (o->flags & AV_OPT_FLAG_VIDEO_PARAM)
|
||||
av_dict_set(&video_opts, opt, arg, FLAGS);
|
||||
if (o->flags & AV_OPT_FLAG_AUDIO_PARAM)
|
||||
av_dict_set(&audio_opts, opt, arg, FLAGS);
|
||||
if (o->flags & AV_OPT_FLAG_SUBTITLE_PARAM)
|
||||
av_dict_set(&sub_opts, opt, arg, FLAGS);
|
||||
} else if ((o = av_opt_find(avformat_opts, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN)))
|
||||
if ((o = av_opt_find(avcodec_opts[0], opt, NULL, 0, AV_OPT_SEARCH_CHILDREN)) ||
|
||||
((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
|
||||
(o = av_opt_find(avcodec_opts[0], opt+1, NULL, 0, 0))))
|
||||
av_dict_set(&codec_opts, opt, arg, FLAGS);
|
||||
else if ((o = av_opt_find(avformat_opts, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN)))
|
||||
av_dict_set(&format_opts, opt, arg, FLAGS);
|
||||
else if ((o = av_opt_find(sws_opts, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN))) {
|
||||
// XXX we only support sws_flags, not arbitrary sws options
|
||||
|
|
@ -321,93 +303,12 @@ static int opt_default2(const char *opt, const char *arg)
|
|||
}
|
||||
}
|
||||
|
||||
if (!o) {
|
||||
SET_PREFIXED_OPTS('v', AV_OPT_FLAG_VIDEO_PARAM, video_opts)
|
||||
SET_PREFIXED_OPTS('a', AV_OPT_FLAG_AUDIO_PARAM, audio_opts)
|
||||
SET_PREFIXED_OPTS('s', AV_OPT_FLAG_SUBTITLE_PARAM, sub_opts)
|
||||
}
|
||||
|
||||
if (o)
|
||||
return 0;
|
||||
fprintf(stderr, "Unrecognized option '%s'\n", opt);
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
int opt_default(const char *opt, const char *arg){
|
||||
int type;
|
||||
int ret= 0;
|
||||
const AVOption *o= NULL;
|
||||
int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
|
||||
AVCodec *p = NULL;
|
||||
AVOutputFormat *oformat = NULL;
|
||||
AVInputFormat *iformat = NULL;
|
||||
|
||||
while ((p = av_codec_next(p))) {
|
||||
const AVClass *c = p->priv_class;
|
||||
if (c && av_find_opt(&c, opt, NULL, 0, 0))
|
||||
break;
|
||||
}
|
||||
if (p)
|
||||
goto out;
|
||||
while ((oformat = av_oformat_next(oformat))) {
|
||||
const AVClass *c = oformat->priv_class;
|
||||
if (c && av_find_opt(&c, opt, NULL, 0, 0))
|
||||
break;
|
||||
}
|
||||
if (oformat)
|
||||
goto out;
|
||||
while ((iformat = av_iformat_next(iformat))) {
|
||||
const AVClass *c = iformat->priv_class;
|
||||
if (c && av_find_opt(&c, opt, NULL, 0, 0))
|
||||
break;
|
||||
}
|
||||
if (iformat)
|
||||
goto out;
|
||||
|
||||
for(type=0; *avcodec_opts && type<AVMEDIA_TYPE_NB && ret>= 0; type++){
|
||||
const AVOption *o2 = av_opt_find(avcodec_opts[0], opt, NULL, opt_types[type], 0);
|
||||
if(o2)
|
||||
ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o);
|
||||
}
|
||||
if(!o && avformat_opts)
|
||||
ret = av_set_string3(avformat_opts, opt, arg, 1, &o);
|
||||
if(!o && sws_opts)
|
||||
ret = av_set_string3(sws_opts, opt, arg, 1, &o);
|
||||
if(!o){
|
||||
if (opt[0] == 'a' && avcodec_opts[AVMEDIA_TYPE_AUDIO])
|
||||
ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o);
|
||||
else if(opt[0] == 'v' && avcodec_opts[AVMEDIA_TYPE_VIDEO])
|
||||
ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o);
|
||||
else if(opt[0] == 's' && avcodec_opts[AVMEDIA_TYPE_SUBTITLE])
|
||||
ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
|
||||
if (ret >= 0)
|
||||
opt += 1;
|
||||
}
|
||||
if (o && ret < 0) {
|
||||
fprintf(stderr, "Invalid value '%s' for option '%s'\n", arg, opt);
|
||||
exit(1);
|
||||
}
|
||||
if (!o) {
|
||||
fprintf(stderr, "Unrecognized option '%s'\n", opt);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
out:
|
||||
if ((ret = opt_default2(opt, arg)) < 0)
|
||||
return ret;
|
||||
|
||||
// av_log(NULL, AV_LOG_ERROR, "%s:%s: %f 0x%0X\n", opt, arg, av_get_double(avcodec_opts, opt, NULL), (int)av_get_int(avcodec_opts, opt, NULL));
|
||||
|
||||
opt_values= av_realloc(opt_values, sizeof(void*)*(opt_name_count+1));
|
||||
opt_values[opt_name_count] = av_strdup(arg);
|
||||
opt_names= av_realloc(opt_names, sizeof(void*)*(opt_name_count+1));
|
||||
opt_names[opt_name_count++] = av_strdup(opt);
|
||||
|
||||
if ((*avcodec_opts && avcodec_opts[0]->debug) || (avformat_opts && avformat_opts->debug))
|
||||
av_log_set_level(AV_LOG_DEBUG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_loglevel(const char *opt, const char *arg)
|
||||
{
|
||||
const struct { const char *name; int level; } log_levels[] = {
|
||||
|
|
@ -456,59 +357,6 @@ int opt_timelimit(const char *opt, const char *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void *alloc_priv_context(int size, const AVClass *class)
|
||||
{
|
||||
void *p = av_mallocz(size);
|
||||
if (p) {
|
||||
*(const AVClass **)p = class;
|
||||
av_opt_set_defaults(p);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec)
|
||||
{
|
||||
int i;
|
||||
void *priv_ctx=NULL;
|
||||
if(!strcmp("AVCodecContext", (*(AVClass**)ctx)->class_name)){
|
||||
AVCodecContext *avctx= ctx;
|
||||
if(codec && codec->priv_class){
|
||||
if(!avctx->priv_data && codec->priv_data_size)
|
||||
avctx->priv_data= alloc_priv_context(codec->priv_data_size, codec->priv_class);
|
||||
priv_ctx= avctx->priv_data;
|
||||
}
|
||||
} else if (!strcmp("AVFormatContext", (*(AVClass**)ctx)->class_name)) {
|
||||
AVFormatContext *avctx = ctx;
|
||||
if (avctx->oformat && avctx->oformat->priv_class) {
|
||||
priv_ctx = avctx->priv_data;
|
||||
} else if (avctx->iformat && avctx->iformat->priv_class) {
|
||||
priv_ctx = avctx->priv_data;
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0; i<opt_name_count; i++){
|
||||
char buf[256];
|
||||
const AVOption *opt;
|
||||
const char *str;
|
||||
if (priv_ctx) {
|
||||
if (av_find_opt(priv_ctx, opt_names[i], NULL, flags, flags)) {
|
||||
if (av_set_string3(priv_ctx, opt_names[i], opt_values[i], 1, NULL) < 0) {
|
||||
fprintf(stderr, "Invalid value '%s' for option '%s'\n",
|
||||
opt_names[i], opt_values[i]);
|
||||
exit(1);
|
||||
}
|
||||
} else
|
||||
goto global;
|
||||
} else {
|
||||
global:
|
||||
str = av_get_string(opts_ctx, opt_names[i], &opt, buf, sizeof(buf));
|
||||
/* if an option with name opt_names[i] is present in opts_ctx then str is non-NULL */
|
||||
if (str && ((opt->flags & flags) == flags))
|
||||
av_set_string3(ctx, opt_names[i], str, 1, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void print_error(const char *filename, int err)
|
||||
{
|
||||
char errbuf[128];
|
||||
|
|
@ -574,12 +422,13 @@ void show_banner(void)
|
|||
print_all_libs_info(stderr, INDENT|SHOW_VERSION);
|
||||
}
|
||||
|
||||
void show_version(void) {
|
||||
int opt_version(const char *opt, const char *arg) {
|
||||
printf("%s " FFMPEG_VERSION "\n", program_name);
|
||||
print_all_libs_info(stdout, SHOW_VERSION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_license(void)
|
||||
int opt_license(const char *opt, const char *arg)
|
||||
{
|
||||
printf(
|
||||
#if CONFIG_NONFREE
|
||||
|
|
@ -646,9 +495,10 @@ void show_license(void)
|
|||
program_name, program_name, program_name
|
||||
#endif
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_formats(void)
|
||||
int opt_formats(const char *opt, const char *arg)
|
||||
{
|
||||
AVInputFormat *ifmt=NULL;
|
||||
AVOutputFormat *ofmt=NULL;
|
||||
|
|
@ -695,9 +545,10 @@ void show_formats(void)
|
|||
name,
|
||||
long_name ? long_name:" ");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_codecs(void)
|
||||
int opt_codecs(const char *opt, const char *arg)
|
||||
{
|
||||
AVCodec *p=NULL, *p2;
|
||||
const char *last_name;
|
||||
|
|
@ -771,9 +622,10 @@ void show_codecs(void)
|
|||
"even though both encoding and decoding are supported. For example, the h263\n"
|
||||
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
|
||||
"worse.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_bsfs(void)
|
||||
int opt_bsfs(const char *opt, const char *arg)
|
||||
{
|
||||
AVBitStreamFilter *bsf=NULL;
|
||||
|
||||
|
|
@ -781,9 +633,10 @@ void show_bsfs(void)
|
|||
while((bsf = av_bitstream_filter_next(bsf)))
|
||||
printf("%s\n", bsf->name);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_protocols(void)
|
||||
int opt_protocols(const char *opt, const char *arg)
|
||||
{
|
||||
URLProtocol *up=NULL;
|
||||
|
||||
|
|
@ -799,9 +652,10 @@ void show_protocols(void)
|
|||
up->url_write ? 'O' : '.',
|
||||
up->url_seek ? 'S' : '.',
|
||||
up->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_filters(void)
|
||||
int opt_filters(const char *opt, const char *arg)
|
||||
{
|
||||
AVFilter av_unused(**filter) = NULL;
|
||||
|
||||
|
|
@ -810,9 +664,10 @@ void show_filters(void)
|
|||
while ((filter = av_filter_next(filter)) && *filter)
|
||||
printf("%-16s %s\n", (*filter)->name, (*filter)->description);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_pix_fmts(void)
|
||||
int opt_pix_fmts(const char *opt, const char *arg)
|
||||
{
|
||||
enum PixelFormat pix_fmt;
|
||||
|
||||
|
|
@ -843,6 +698,7 @@ void show_pix_fmts(void)
|
|||
pix_desc->nb_components,
|
||||
av_get_bits_per_pixel(pix_desc));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int read_yesno(void)
|
||||
|
|
@ -926,3 +782,48 @@ FILE *get_preset_file(char *filename, size_t filename_size,
|
|||
|
||||
return f;
|
||||
}
|
||||
|
||||
AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, int encoder)
|
||||
{
|
||||
AVDictionary *ret = NULL;
|
||||
AVDictionaryEntry *t = NULL;
|
||||
AVCodec *codec = encoder ? avcodec_find_encoder(codec_id) : avcodec_find_decoder(codec_id);
|
||||
int flags = encoder ? AV_OPT_FLAG_ENCODING_PARAM : AV_OPT_FLAG_DECODING_PARAM;
|
||||
char prefix = 0;
|
||||
|
||||
if (!codec)
|
||||
return NULL;
|
||||
|
||||
switch (codec->type) {
|
||||
case AVMEDIA_TYPE_VIDEO: prefix = 'v'; flags |= AV_OPT_FLAG_VIDEO_PARAM; break;
|
||||
case AVMEDIA_TYPE_AUDIO: prefix = 'a'; flags |= AV_OPT_FLAG_AUDIO_PARAM; break;
|
||||
case AVMEDIA_TYPE_SUBTITLE: prefix = 's'; flags |= AV_OPT_FLAG_SUBTITLE_PARAM; break;
|
||||
}
|
||||
|
||||
while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) {
|
||||
if (av_opt_find(avcodec_opts[0], t->key, NULL, flags, 0) ||
|
||||
(codec && codec->priv_class && av_opt_find(&codec->priv_class, t->key, NULL, flags, 0)))
|
||||
av_dict_set(&ret, t->key, t->value, 0);
|
||||
else if (t->key[0] == prefix && av_opt_find(avcodec_opts[0], t->key+1, NULL, flags, 0))
|
||||
av_dict_set(&ret, t->key+1, t->value, 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts)
|
||||
{
|
||||
int i;
|
||||
AVDictionary **opts;
|
||||
|
||||
if (!s->nb_streams)
|
||||
return NULL;
|
||||
opts = av_mallocz(s->nb_streams * sizeof(*opts));
|
||||
if (!opts) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Could not alloc memory for stream options.\n");
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; i < s->nb_streams; i++)
|
||||
opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codec->codec_id, 0);
|
||||
return opts;
|
||||
}
|
||||
|
||||
|
|
|
|||
53
cmdutils.h
53
cmdutils.h
|
|
@ -43,11 +43,10 @@ extern const char program_name[];
|
|||
*/
|
||||
extern const int program_birth_year;
|
||||
|
||||
extern const char **opt_names;
|
||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
|
||||
extern AVFormatContext *avformat_opts;
|
||||
extern struct SwsContext *sws_opts;
|
||||
extern AVDictionary *format_opts, *video_opts, *audio_opts, *sub_opts;
|
||||
extern AVDictionary *format_opts, *codec_opts;
|
||||
|
||||
/**
|
||||
* Initialize the cmdutils option system, in particular
|
||||
|
|
@ -62,7 +61,7 @@ void uninit_opts(void);
|
|||
|
||||
/**
|
||||
* Trivial log callback.
|
||||
* Only suitable for show_help and similar since it lacks prefix handling.
|
||||
* Only suitable for opt_help and similar since it lacks prefix handling.
|
||||
*/
|
||||
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
|
||||
|
||||
|
|
@ -153,7 +152,29 @@ void show_help_options(const OptionDef *options, const char *msg, int mask, int
|
|||
void parse_options(int argc, char **argv, const OptionDef *options,
|
||||
int (* parse_arg_function)(const char *opt, const char *arg));
|
||||
|
||||
void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec);
|
||||
/**
|
||||
* Filter out options for given codec.
|
||||
*
|
||||
* Create a new options dictionary containing only the options from
|
||||
* opts which apply to the codec with ID codec_id.
|
||||
*
|
||||
* @param encoder if non-zero the codec is an encoder, otherwise is a decoder
|
||||
* @return a pointer to the created dictionary
|
||||
*/
|
||||
AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, int encoder);
|
||||
|
||||
/**
|
||||
* Setup AVCodecContext options for avformat_find_stream_info().
|
||||
*
|
||||
* Create an array of dictionaries, one dictionary for each stream
|
||||
* contained in s.
|
||||
* Each dictionary will contain the options from codec_opts which can
|
||||
* be applied to the corresponding stream codec context.
|
||||
*
|
||||
* @return pointer to the created array of dictionaries, NULL if it
|
||||
* cannot be created
|
||||
*/
|
||||
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts);
|
||||
|
||||
/**
|
||||
* Print an error message to stderr, indicating filename and a human
|
||||
|
|
@ -177,50 +198,58 @@ void show_banner(void);
|
|||
* Print the version of the program to stdout. The version message
|
||||
* depends on the current versions of the repository and of the libav*
|
||||
* libraries.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_version(void);
|
||||
int opt_version(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print the license of the program to stdout. The license depends on
|
||||
* the license of the libraries compiled into the program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_license(void);
|
||||
int opt_license(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the formats supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_formats(void);
|
||||
int opt_formats(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the codecs supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_codecs(void);
|
||||
int opt_codecs(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the filters supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_filters(void);
|
||||
int opt_filters(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the bit stream filters supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_bsfs(void);
|
||||
int opt_bsfs(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the protocols supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_protocols(void);
|
||||
int opt_protocols(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the pixel formats supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_pix_fmts(void);
|
||||
int opt_pix_fmts(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Return a positive value if a line read from standard input
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
{ "L", OPT_EXIT, {(void*)show_license}, "show license" },
|
||||
{ "h", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "?", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "-help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "version", OPT_EXIT, {(void*)show_version}, "show version" },
|
||||
{ "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" },
|
||||
{ "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" },
|
||||
{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" },
|
||||
{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" },
|
||||
{ "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" },
|
||||
{ "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" },
|
||||
{ "L", OPT_EXIT, {(void*)opt_license}, "show license" },
|
||||
{ "h", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "?", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "-help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "version", OPT_EXIT, {(void*)opt_version}, "show version" },
|
||||
{ "formats" , OPT_EXIT, {(void*)opt_formats }, "show available formats" },
|
||||
{ "codecs" , OPT_EXIT, {(void*)opt_codecs }, "show available codecs" },
|
||||
{ "bsfs" , OPT_EXIT, {(void*)opt_bsfs }, "show available bit stream filters" },
|
||||
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
|
||||
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
|
||||
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
|
||||
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
||||
|
|
|
|||
57
common.mak
57
common.mak
|
|
@ -20,20 +20,30 @@ $(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
|
|||
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
|
||||
endif
|
||||
|
||||
IFLAGS := -I. -I$(SRC_PATH)
|
||||
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
|
||||
CFLAGS += $(ECFLAGS)
|
||||
YASMFLAGS += $(IFLAGS) -Pconfig.asm
|
||||
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
|
||||
|
||||
# NASM requires -I path terminated with /
|
||||
IFLAGS := -I. -I$(SRC_PATH)/
|
||||
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
|
||||
CFLAGS += $(ECFLAGS)
|
||||
CCFLAGS = $(CFLAGS)
|
||||
YASMFLAGS += $(IFLAGS) -Pconfig.asm
|
||||
HOSTCFLAGS += $(IFLAGS)
|
||||
LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
|
||||
|
||||
define COMPILE
|
||||
$($(1)DEP)
|
||||
$($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
|
||||
endef
|
||||
|
||||
COMPILE_C = $(call COMPILE,CC)
|
||||
COMPILE_S = $(call COMPILE,AS)
|
||||
|
||||
%.o: %.c
|
||||
$(CCDEP)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
|
||||
$(COMPILE_C)
|
||||
|
||||
%.o: %.S
|
||||
$(ASDEP)
|
||||
$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
|
||||
$(COMPILE_S)
|
||||
|
||||
%.ho: %.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
|
||||
|
|
@ -61,29 +71,40 @@ OBJS += $(OBJS-yes)
|
|||
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
|
||||
TESTPROGS += $(TESTPROGS-yes)
|
||||
|
||||
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
|
||||
FFLDFLAGS := $(addprefix -Llib,$(ALLFFLIBS)) $(LDFLAGS)
|
||||
FFEXTRALIBS := $(FFLIBS:%=-l%$(BUILDSUF)) $(EXTRALIBS)
|
||||
|
||||
EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
|
||||
OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS)))
|
||||
TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS) $(TESTPROGS:%=%-test.o))
|
||||
TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
|
||||
HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS)))
|
||||
HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS)))
|
||||
EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
|
||||
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
|
||||
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
|
||||
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
|
||||
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
|
||||
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
|
||||
TOOLS += $(TOOLS-yes)
|
||||
TOOLOBJS := $(TOOLS:%=tools/%.o)
|
||||
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
|
||||
|
||||
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
|
||||
|
||||
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
|
||||
SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS))
|
||||
SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS))
|
||||
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
|
||||
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
|
||||
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
|
||||
|
||||
alltools: $(TOOLS)
|
||||
|
||||
$(HOSTOBJS): %.o: %.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
|
||||
|
||||
$(HOSTPROGS): %$(HOSTEXESUF): %.o
|
||||
$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
|
||||
|
||||
$(OBJS): | $(sort $(dir $(OBJS)))
|
||||
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
|
||||
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
|
||||
$(TOOLOBJS): | tools
|
||||
|
||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS))
|
||||
|
||||
CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
|
||||
DISTCLEANSUFFIXES = *.pc
|
||||
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
|
||||
|
|
|
|||
175
configure
vendored
175
configure
vendored
|
|
@ -106,8 +106,8 @@ Configuration options:
|
|||
--disable-lpc disable LPC code
|
||||
--disable-mdct disable MDCT code
|
||||
--disable-rdft disable RDFT code
|
||||
--enable-vaapi enable VAAPI code
|
||||
--enable-vdpau enable VDPAU code
|
||||
--enable-vaapi enable VAAPI code [autodetect]
|
||||
--enable-vdpau enable VDPAU code [autodetect]
|
||||
--disable-dxva2 disable DXVA2 code
|
||||
--enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
|
||||
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
|
||||
|
|
@ -188,6 +188,7 @@ External library support:
|
|||
--enable-libxavs enable AVS encoding via xavs [no]
|
||||
--enable-libxvid enable Xvid encoding via xvidcore,
|
||||
native MPEG-4/Xvid encoder exists [no]
|
||||
--enable-openal enable OpenAL 1.1 capture support [no]
|
||||
--enable-mlib enable Sun medialib [no]
|
||||
--enable-zlib enable zlib [autodetect]
|
||||
|
||||
|
|
@ -238,6 +239,7 @@ Advanced options (experts only):
|
|||
--malloc-prefix=PFX prefix malloc and related names with PFX
|
||||
--enable-sram allow use of on-chip SRAM
|
||||
--disable-symver disable symbol versioning
|
||||
--optflags override optimization-related compiler flags
|
||||
|
||||
Developer options (useful when working on FFmpeg itself):
|
||||
--disable-debug disable debugging symbols
|
||||
|
|
@ -876,9 +878,9 @@ apply(){
|
|||
}
|
||||
|
||||
cp_if_changed(){
|
||||
cmp -s "$1" "$2" &&
|
||||
echo "$2 is unchanged" ||
|
||||
cp -f "$1" "$2"
|
||||
cmp -s "$1" "$2" && echo "$2 is unchanged" && return
|
||||
mkdir -p "$(dirname $2)"
|
||||
cp -f "$1" "$2"
|
||||
}
|
||||
|
||||
# CONFIG_LIST contains configurable options, while HAVE_LIST is for
|
||||
|
|
@ -958,6 +960,7 @@ CONFIG_LIST="
|
|||
mpegaudiodsp
|
||||
network
|
||||
nonfree
|
||||
openal
|
||||
pic
|
||||
postproc
|
||||
rdft
|
||||
|
|
@ -970,6 +973,7 @@ CONFIG_LIST="
|
|||
static
|
||||
swscale
|
||||
swscale_alpha
|
||||
thumb
|
||||
vaapi
|
||||
vdpau
|
||||
version3
|
||||
|
|
@ -1094,7 +1098,6 @@ HAVE_LIST="
|
|||
memalign
|
||||
mkstemp
|
||||
mmap
|
||||
pld
|
||||
posix_memalign
|
||||
round
|
||||
roundf
|
||||
|
|
@ -1107,6 +1110,7 @@ HAVE_LIST="
|
|||
poll_h
|
||||
setrlimit
|
||||
strerror_r
|
||||
strptime
|
||||
strtok_r
|
||||
struct_addrinfo
|
||||
struct_ipv6_mreq
|
||||
|
|
@ -1121,7 +1125,6 @@ HAVE_LIST="
|
|||
sys_select_h
|
||||
sys_soundcard_h
|
||||
sys_videoio_h
|
||||
ten_operands
|
||||
termios_h
|
||||
threads
|
||||
trunc
|
||||
|
|
@ -1187,6 +1190,7 @@ CMDLINE_SET="
|
|||
logfile
|
||||
malloc_prefix
|
||||
nm
|
||||
optflags
|
||||
pkg_config
|
||||
samples
|
||||
strip
|
||||
|
|
@ -1276,6 +1280,7 @@ flac_encoder_select="golomb lpc"
|
|||
flashsv_decoder_select="zlib"
|
||||
flashsv_encoder_select="zlib"
|
||||
flashsv2_encoder_select="zlib"
|
||||
flashsv2_decoder_select="zlib"
|
||||
flv_decoder_select="h263_decoder"
|
||||
flv_encoder_select="h263_encoder"
|
||||
fraps_decoder_select="huffman"
|
||||
|
|
@ -1468,6 +1473,7 @@ dv1394_indev_deps="dv1394 dv_demuxer"
|
|||
fbdev_indev_deps="linux_fb_h"
|
||||
jack_indev_deps="jack_jack_h sem_timedwait"
|
||||
libdc1394_indev_deps="libdc1394"
|
||||
openal_indev_deps="openal"
|
||||
oss_indev_deps_any="soundcard_h sys_soundcard_h"
|
||||
oss_outdev_deps_any="soundcard_h sys_soundcard_h"
|
||||
sdl_outdev_deps="sdl"
|
||||
|
|
@ -1493,6 +1499,7 @@ udp_protocol_deps="network"
|
|||
|
||||
# filters
|
||||
blackframe_filter_deps="gpl"
|
||||
boxblur_filter_deps="gpl"
|
||||
cropdetect_filter_deps="gpl"
|
||||
drawtext_filter_deps="libfreetype"
|
||||
frei0r_filter_deps="frei0r dlopen strtok_r"
|
||||
|
|
@ -1512,9 +1519,9 @@ postproc_deps="gpl"
|
|||
|
||||
# programs
|
||||
ffmpeg_deps="avcodec avformat swscale"
|
||||
ffmpeg_select="buffer_filter"
|
||||
ffmpeg_select="buffer_filter buffersink_filter"
|
||||
ffplay_deps="avcodec avformat swscale sdl"
|
||||
ffplay_select="rdft"
|
||||
ffplay_select="buffersink_filter rdft"
|
||||
ffprobe_deps="avcodec avformat"
|
||||
ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
|
||||
ffserver_extralibs='$ldl'
|
||||
|
|
@ -1536,11 +1543,6 @@ test_deps(){
|
|||
done
|
||||
}
|
||||
|
||||
set_ne_test_deps(){
|
||||
eval ${1}_be_test_deps="bigendian"
|
||||
eval ${1}_le_test_deps="!bigendian"
|
||||
}
|
||||
|
||||
test_deps _encoder _decoder \
|
||||
adpcm_g726=g726 \
|
||||
adpcm_ima_qt \
|
||||
|
|
@ -1603,7 +1605,7 @@ test_deps _muxer _demuxer \
|
|||
mmf \
|
||||
mov \
|
||||
pcm_mulaw=mulaw \
|
||||
mxf \
|
||||
mxf="mxf mxf_d10" \
|
||||
nut \
|
||||
ogg \
|
||||
rawvideo=pixfmt \
|
||||
|
|
@ -1617,15 +1619,6 @@ test_deps _muxer _demuxer \
|
|||
ac3_fixed_test_deps="ac3_fixed_encoder ac3_decoder rm_muxer rm_demuxer"
|
||||
mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
|
||||
|
||||
set_ne_test_deps pixdesc
|
||||
set_ne_test_deps pixfmts_copy
|
||||
set_ne_test_deps pixfmts_crop
|
||||
set_ne_test_deps pixfmts_hflip
|
||||
set_ne_test_deps pixfmts_null
|
||||
set_ne_test_deps pixfmts_pad
|
||||
set_ne_test_deps pixfmts_scale
|
||||
set_ne_test_deps pixfmts_vflip
|
||||
|
||||
# default parameters
|
||||
|
||||
logfile="config.log"
|
||||
|
|
@ -1700,7 +1693,10 @@ SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
|
|||
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
|
||||
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
|
||||
LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
|
||||
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
|
||||
SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
|
||||
|
||||
AS_O='-o $@'
|
||||
CC_O='-o $@'
|
||||
|
||||
host_cflags='-D_ISOC99_SOURCE -O3 -g'
|
||||
|
|
@ -1715,11 +1711,9 @@ DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
|
|||
|
||||
# find source path
|
||||
if test -f configure; then
|
||||
source_path="$(pwd)"
|
||||
disable source_path_used
|
||||
source_path=.
|
||||
else
|
||||
source_path=$(cd $(dirname "$0"); pwd)
|
||||
enable source_path_used
|
||||
echo "$source_path" | grep -q '[[:blank:]]' &&
|
||||
die "Out of tree builds are impossible with whitespace in source path."
|
||||
test -e "$source_path/config.h" &&
|
||||
|
|
@ -2056,6 +2050,7 @@ elif $cc -V 2>&1 | grep -q Sun; then
|
|||
cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
|
||||
DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
|
||||
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
|
||||
add_ldflags -xc99
|
||||
speed_cflags='-O5'
|
||||
size_cflags='-O5 -xspace'
|
||||
filter_cflags=suncc_flags
|
||||
|
|
@ -2146,7 +2141,7 @@ if test "$cpu" = host; then
|
|||
gcc|llvm_gcc)
|
||||
check_native(){
|
||||
$cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
|
||||
sed -n "/$1=/{
|
||||
sed -n "/cc1.*$1=/{
|
||||
s/.*$1=\\([^ ]*\\).*/\\1/
|
||||
p
|
||||
q
|
||||
|
|
@ -2261,7 +2256,7 @@ elif enabled x86; then
|
|||
disable cmov
|
||||
;;
|
||||
# targets that do support conditional mov (cmov)
|
||||
i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10|barcelona|atom)
|
||||
i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom)
|
||||
cpuflags="-march=$cpu"
|
||||
enable cmov
|
||||
enable fast_cmov
|
||||
|
|
@ -2298,7 +2293,7 @@ elif enabled arm; then
|
|||
case $cpu in
|
||||
cortex-a*) subarch=armv7a ;;
|
||||
cortex-r*) subarch=armv7r ;;
|
||||
cortex-m*) subarch=armv7m ;;
|
||||
cortex-m*) enable thumb; subarch=armv7m ;;
|
||||
arm11*) subarch=armv6 ;;
|
||||
arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
|
||||
armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
|
||||
|
|
@ -2466,12 +2461,11 @@ case $target_os in
|
|||
SLIBSUF=".dll"
|
||||
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
|
||||
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
|
||||
SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
|
||||
SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
|
||||
install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
|
||||
install -d "$(LIBDIR)"; \
|
||||
install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
|
||||
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
|
||||
SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
|
||||
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
|
||||
SLIB_INSTALL_LINKS=
|
||||
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
|
||||
SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
|
||||
SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
|
||||
objformat="win32"
|
||||
enable dos_paths
|
||||
|
|
@ -2529,8 +2523,7 @@ case $target_os in
|
|||
emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
|
||||
SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
|
||||
emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
|
||||
SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
|
||||
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
|
||||
SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
|
||||
enable dos_paths
|
||||
;;
|
||||
gnu/kfreebsd)
|
||||
|
|
@ -2545,7 +2538,14 @@ case $target_os in
|
|||
symbian)
|
||||
SLIBSUF=".dll"
|
||||
enable dos_paths
|
||||
add_cflags --include=$sysinclude/gcce/gcce.h
|
||||
add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
|
||||
add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
|
||||
add_ldflags -Wl,--target1-abs,--no-undefined \
|
||||
-Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
|
||||
-Wl,--entry=_E32Startup -Wl,-u,_E32Startup
|
||||
add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
|
||||
-l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
|
||||
-l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
|
||||
;;
|
||||
none)
|
||||
;;
|
||||
|
|
@ -2571,8 +2571,6 @@ EOF
|
|||
exit 1;
|
||||
fi
|
||||
|
||||
disabled static && LIBNAME=""
|
||||
|
||||
die_license_disabled() {
|
||||
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
|
||||
}
|
||||
|
|
@ -2638,7 +2636,7 @@ if enabled alpha; then
|
|||
|
||||
elif enabled arm; then
|
||||
|
||||
check_cflags -marm
|
||||
enabled thumb && check_cflags -mthumb || check_cflags -marm
|
||||
nogas=die
|
||||
|
||||
if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
|
||||
|
|
@ -2654,9 +2652,6 @@ EOF
|
|||
warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
|
||||
fi
|
||||
|
||||
# We have to check if pld is a nop and disable it.
|
||||
check_asm pld '"pld [r0]"'
|
||||
|
||||
enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
|
||||
enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
|
||||
enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
|
||||
|
|
@ -2733,18 +2728,6 @@ EOF
|
|||
# check whether xmm clobbers are supported
|
||||
check_asm xmm_clobbers '"":::"%xmm0"'
|
||||
|
||||
# check whether more than 10 operands are supported
|
||||
check_cc <<EOF && enable ten_operands
|
||||
int main(void) {
|
||||
int x=0;
|
||||
__asm__ volatile(
|
||||
""
|
||||
:"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
# check whether binutils is new enough to compile SSSE3/MMX2
|
||||
enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
|
||||
enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
|
||||
|
|
@ -2839,6 +2822,7 @@ check_func mmap
|
|||
check_func ${malloc_prefix}posix_memalign && enable posix_memalign
|
||||
check_func setrlimit
|
||||
check_func strerror_r
|
||||
check_func strptime
|
||||
check_func strtok_r
|
||||
check_func_headers conio.h kbhit
|
||||
check_func_headers io.h setmode
|
||||
|
|
@ -2944,6 +2928,11 @@ enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
|
|||
die "ERROR: libx264 version must be >= 0.115."; }
|
||||
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
|
||||
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
|
||||
enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
|
||||
check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
|
||||
die "ERROR: openal not found"; } &&
|
||||
{ check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
|
||||
die "ERROR: openal version must be 1.1 or compatible"; }
|
||||
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
|
||||
|
||||
SDL_CONFIG="${cross_prefix}sdl-config"
|
||||
|
|
@ -3032,6 +3021,7 @@ check_cflags -Wdeclaration-after-statement
|
|||
check_cflags -Wall
|
||||
check_cflags -Wno-parentheses
|
||||
check_cflags -Wno-switch
|
||||
check_cflags -Wno-format-zero-length
|
||||
check_cflags -Wdisabled-optimization
|
||||
check_cflags -Wpointer-arith
|
||||
check_cflags -Wredundant-decls
|
||||
|
|
@ -3046,7 +3036,7 @@ enabled extra_warnings && check_cflags -Winline
|
|||
|
||||
# add some linker flags
|
||||
check_ldflags -Wl,--warn-common
|
||||
check_ldflags -Wl,-rpath-link,libpostproc -Wl,-rpath-link,libswscale -Wl,-rpath-link,libavfilter -Wl,-rpath-link,libavdevice -Wl,-rpath-link,libavformat -Wl,-rpath-link,libavcodec -Wl,-rpath-link,libavutil
|
||||
check_ldflags -Wl,-rpath-link=libpostproc:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
|
||||
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
|
||||
|
||||
echo "X{};" > $TMPV
|
||||
|
|
@ -3062,9 +3052,10 @@ void ff_foo(void) {}
|
|||
EOF
|
||||
fi
|
||||
|
||||
if enabled small; then
|
||||
if [ -n "$optflags" ]; then
|
||||
add_cflags $optflags
|
||||
elif enabled small; then
|
||||
add_cflags $size_cflags
|
||||
optimizations="small"
|
||||
elif enabled optimizations; then
|
||||
add_cflags $speed_cflags
|
||||
else
|
||||
|
|
@ -3118,6 +3109,8 @@ elif enabled armcc; then
|
|||
add_cflags -W${armcc_opt},--diag_suppress=1207
|
||||
add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
|
||||
add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
|
||||
add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
|
||||
add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
|
||||
elif enabled tms470; then
|
||||
add_cflags -pds=824 -pds=837
|
||||
elif enabled pathscale; then
|
||||
|
|
@ -3181,7 +3174,6 @@ if enabled x86; then
|
|||
echo "CMOV is fast ${fast_cmov-no}"
|
||||
echo "EBX available ${ebx_available-no}"
|
||||
echo "EBP available ${ebp_available-no}"
|
||||
echo "10 operands supported ${ten_operands-no}"
|
||||
fi
|
||||
if enabled arm; then
|
||||
echo "ARMv5TE enabled ${armv5te-no}"
|
||||
|
|
@ -3204,6 +3196,7 @@ if enabled sparc; then
|
|||
fi
|
||||
echo "debug symbols ${debug-no}"
|
||||
echo "strip symbols ${stripping-no}"
|
||||
echo "optimize for size ${small-no}"
|
||||
echo "optimizations ${optimizations-no}"
|
||||
echo "static ${static-no}"
|
||||
echo "shared ${shared-no}"
|
||||
|
|
@ -3213,6 +3206,9 @@ echo "network support ${network-no}"
|
|||
echo "threading support ${thread_type-no}"
|
||||
echo "SDL support ${sdl-no}"
|
||||
echo "Sun medialib support ${mlib-no}"
|
||||
echo "libdxva2 enabled ${dxva2-no}"
|
||||
echo "libva enabled ${vaapi-no}"
|
||||
echo "libvdpau enabled ${vdpau-no}"
|
||||
echo "AVISynth enabled ${avisynth-no}"
|
||||
echo "libcelt enabled ${libcelt-no}"
|
||||
echo "frei0r enabled ${frei0r-no}"
|
||||
|
|
@ -3230,7 +3226,6 @@ echo "librtmp enabled ${librtmp-no}"
|
|||
echo "libschroedinger enabled ${libschroedinger-no}"
|
||||
echo "libspeex enabled ${libspeex-no}"
|
||||
echo "libtheora enabled ${libtheora-no}"
|
||||
echo "libva enabled ${vaapi-no}"
|
||||
echo "libvo-aacenc support ${libvo_aacenc-no}"
|
||||
echo "libvo-amrwbenc support ${libvo_amrwbenc-no}"
|
||||
echo "libvorbis enabled ${libvorbis-no}"
|
||||
|
|
@ -3238,6 +3233,7 @@ echo "libvpx enabled ${libvpx-no}"
|
|||
echo "libx264 enabled ${libx264-no}"
|
||||
echo "libxavs enabled ${libxavs-no}"
|
||||
echo "libxvid enabled ${libxvid-no}"
|
||||
echo "openal enabled ${openal-no}"
|
||||
echo "zlib enabled ${zlib-no}"
|
||||
echo "bzlib enabled ${bzlib-no}"
|
||||
echo
|
||||
|
|
@ -3264,44 +3260,7 @@ echo "License: $license"
|
|||
|
||||
echo "Creating config.mak and config.h..."
|
||||
|
||||
# build tree in object directory if source path is different from current one
|
||||
if enabled source_path_used; then
|
||||
DIRS="
|
||||
doc
|
||||
libavcodec
|
||||
libavcodec/$arch
|
||||
libavdevice
|
||||
libavfilter
|
||||
libavfilter/$arch
|
||||
libavfilter/libmpcodecs
|
||||
libavfilter/libmpcodecs/libvo
|
||||
libavformat
|
||||
libavutil
|
||||
libavutil/$arch
|
||||
libpostproc
|
||||
libswscale
|
||||
libswscale/$arch
|
||||
tests
|
||||
tools
|
||||
"
|
||||
FILES="
|
||||
Makefile
|
||||
common.mak
|
||||
subdir.mak
|
||||
doc/texi2pod.pl
|
||||
libavcodec/Makefile
|
||||
libavcodec/${arch}/Makefile
|
||||
libavdevice/Makefile
|
||||
libavfilter/Makefile
|
||||
libavfilter/${arch}/Makefile
|
||||
libavformat/Makefile
|
||||
libavutil/Makefile
|
||||
libpostproc/Makefile
|
||||
libswscale/Makefile
|
||||
"
|
||||
map 'mkdir -p $v' $DIRS;
|
||||
map 'test -f "$source_path/$v" && $ln_s "$source_path/$v" $v' $FILES
|
||||
fi
|
||||
test -e Makefile || $ln_s "$source_path/Makefile" .
|
||||
|
||||
enabled stripping || strip="echo skipping strip"
|
||||
|
||||
|
|
@ -3319,8 +3278,10 @@ INCDIR=\$(DESTDIR)$incdir
|
|||
BINDIR=\$(DESTDIR)$bindir
|
||||
DATADIR=\$(DESTDIR)$datadir
|
||||
MANDIR=\$(DESTDIR)$mandir
|
||||
SRC_PATH="$source_path"
|
||||
SRC_PATH_BARE=$source_path
|
||||
SRC_PATH=$source_path
|
||||
ifndef MAIN_MAKEFILE
|
||||
SRC_PATH:=\$(SRC_PATH:.%=..%)
|
||||
endif
|
||||
CC_IDENT=$cc_ident
|
||||
ARCH=$arch
|
||||
CC=$cc
|
||||
|
|
@ -3337,6 +3298,7 @@ STRIP=$strip
|
|||
CPPFLAGS=$CPPFLAGS
|
||||
CFLAGS=$CFLAGS
|
||||
ASFLAGS=$ASFLAGS
|
||||
AS_O=$CC_O
|
||||
CC_O=$CC_O
|
||||
LDFLAGS=$LDFLAGS
|
||||
FFSERVERLDFLAGS=$FFSERVERLDFLAGS
|
||||
|
|
@ -3374,8 +3336,10 @@ SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
|
|||
SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
|
||||
SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
|
||||
SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
|
||||
SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
|
||||
SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
|
||||
SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
|
||||
SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
|
||||
SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
|
||||
SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
|
||||
SAMPLES:=${samples:-\$(FATE_SAMPLES)}
|
||||
EOF
|
||||
|
||||
|
|
@ -3486,6 +3450,7 @@ version=$3
|
|||
libs=$4
|
||||
requires=$5
|
||||
enabled ${name#lib} || return 0
|
||||
mkdir -p $name
|
||||
cat <<EOF > $name/$name.pc
|
||||
prefix=$prefix
|
||||
exec_prefix=\${prefix}
|
||||
|
|
@ -3523,5 +3488,5 @@ pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$ext
|
|||
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
|
||||
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
|
||||
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
|
||||
pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
|
||||
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,29 @@ libavutil: 2011-04-18
|
|||
|
||||
API changes, most recent first:
|
||||
|
||||
2011-08-02 - 9d39cbf - lavc 53.7.1
|
||||
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
|
||||
|
||||
2011-07-16 - xxxxxx - lavfi 2.27.0
|
||||
Add audio packing negotiation fields and helper functions.
|
||||
|
||||
In particular, add AVFilterPacking enum, planar, in_packings and
|
||||
out_packings fields to AVFilterLink, and the functions:
|
||||
avfilter_set_common_packing_formats()
|
||||
avfilter_all_packing_formats()
|
||||
|
||||
2011-07-10 - a67c061 - lavf 53.3.0
|
||||
Add avformat_find_stream_info(), deprecate av_find_stream_info().
|
||||
|
||||
2011-07-10 - 0b950fe - lavc 53.6.0
|
||||
Add avcodec_open2(), deprecate avcodec_open().
|
||||
|
||||
2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h
|
||||
Add function av_get_output_timestamp().
|
||||
|
||||
2011-06-28 - 5129336 - lavu 51.11.0 - avutil.h
|
||||
Define the AV_PICTURE_TYPE_NONE value in AVPictureType enum.
|
||||
|
||||
2011-06-19 - xxxxxxx - lavfi 2.23.0 - avfilter.h
|
||||
Add layout negotiation fields and helper functions.
|
||||
|
||||
|
|
@ -43,17 +66,20 @@ API changes, most recent first:
|
|||
2011-06-12 - xxxxxxx - lavfi 2.16.0 - avfilter_graph_parse()
|
||||
Change avfilter_graph_parse() signature.
|
||||
|
||||
2011-06-xx - xxxxxxx - lavf 53.2.0 - avformat.h
|
||||
2011-06-23 - 67e9ae1 - lavu 51.8.0 - attributes.h
|
||||
Add av_printf_format().
|
||||
|
||||
2011-06-16 - 05e84c9, 25de595 - lavf 53.2.0 - avformat.h
|
||||
Add avformat_open_input and avformat_write_header().
|
||||
Deprecate av_open_input_stream, av_open_input_file,
|
||||
AVFormatParameters and av_write_header.
|
||||
|
||||
2011-06-xx - xxxxxxx - lavu 51.7.0 - opt.h
|
||||
2011-06-16 - 7e83e1c, dc59ec5 - lavu 51.7.0 - opt.h
|
||||
Add av_opt_set_dict() and av_opt_find().
|
||||
Deprecate av_find_opt().
|
||||
Add AV_DICT_APPEND flag.
|
||||
|
||||
2011-06-xx - xxxxxxx - lavu 51.6.0 - opt.h
|
||||
2011-06-10 - cb7c11c - lavu 51.6.0 - opt.h
|
||||
Add av_opt_flag_is_set().
|
||||
|
||||
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
|
||||
|
|
|
|||
46
doc/Makefile
Normal file
46
doc/Makefile
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
MANPAGES = $(PROGS-yes:%=doc/%.1)
|
||||
PODPAGES = $(PROGS-yes:%=doc/%.pod)
|
||||
HTMLPAGES = $(PROGS-yes:%=doc/%.html)
|
||||
|
||||
DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
|
||||
|
||||
all-$(CONFIG_DOC): documentation
|
||||
|
||||
documentation: $(DOCS)
|
||||
|
||||
TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
|
||||
|
||||
doc/%.html: TAG = HTML
|
||||
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
||||
|
||||
doc/%.pod: TAG = POD
|
||||
doc/%.pod: doc/%.texi
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)$(SRC_PATH)/doc/texi2pod.pl $< $@
|
||||
|
||||
doc/%.1: TAG = MAN
|
||||
doc/%.1: doc/%.pod
|
||||
$(M)pod2man --section=1 --center=" " --release=" " $< > $@
|
||||
|
||||
$(DOCS): | doc
|
||||
OBJDIRS += doc
|
||||
|
||||
install-progs-$(CONFIG_DOC): install-man
|
||||
|
||||
install-man: $(MANPAGES)
|
||||
$(Q)mkdir -p "$(MANDIR)/man1"
|
||||
$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
|
||||
|
||||
uninstall: uninstall-man
|
||||
|
||||
uninstall-man:
|
||||
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
||||
|
||||
clean::
|
||||
$(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%)
|
||||
|
||||
-include $(wildcard $(DOCS:%=%.d))
|
||||
|
||||
.PHONY: documentation
|
||||
82
doc/TODO
82
doc/TODO
|
|
@ -1,82 +0,0 @@
|
|||
ffmpeg TODO list:
|
||||
----------------
|
||||
|
||||
Fabrice's TODO list: (unordered)
|
||||
-------------------
|
||||
Short term:
|
||||
|
||||
- use AVFMTCTX_DISCARD_PKT in ffplay so that DV has a chance to work
|
||||
- add RTSP regression test (both client and server)
|
||||
- make ffserver allocate AVFormatContext
|
||||
- clean up (incompatible change, for 0.5.0):
|
||||
* AVStream -> AVComponent
|
||||
* AVFormatContext -> AVInputStream/AVOutputStream
|
||||
* suppress rate_emu from AVCodecContext
|
||||
- add new float/integer audio filterting and conversion : suppress
|
||||
CODEC_ID_PCM_xxc and use CODEC_ID_RAWAUDIO.
|
||||
- fix telecine and frame rate conversion
|
||||
|
||||
Long term (ask me if you want to help):
|
||||
|
||||
- commit new imgconvert API and new PIX_FMT_xxx alpha formats
|
||||
- commit new LGPL'ed float and integer-only AC3 decoder
|
||||
- add WMA integer-only decoder
|
||||
- add new MPEG4-AAC audio decoder (both integer-only and float version)
|
||||
|
||||
Michael's TODO list: (unordered) (if anyone wanna help with sth, just ask)
|
||||
-------------------
|
||||
- optimize H264 CABAC
|
||||
- more optimizations
|
||||
- simper rate control
|
||||
|
||||
Philip'a TODO list: (alphabetically ordered) (please help)
|
||||
------------------
|
||||
- Add a multi-ffm filetype so that feeds can be recorded into multiple files rather
|
||||
than one big file.
|
||||
- Authenticated users support -- where the authentication is in the URL
|
||||
- Change ASF files so that the embedded timestamp in the frames is right rather
|
||||
than being an offset from the start of the stream
|
||||
- Make ffm files more resilient to changes in the codec structures so that you
|
||||
can play old ffm files.
|
||||
|
||||
Baptiste's TODO list:
|
||||
-----------------
|
||||
- mov edit list support (AVEditList)
|
||||
- YUV 10 bit per component support "2vuy"
|
||||
- mxf muxer
|
||||
- mpeg2 non linear quantizer
|
||||
|
||||
unassigned TODO: (unordered)
|
||||
---------------
|
||||
- use AVFrame for audio codecs too
|
||||
- rework aviobuf.c buffering strategy and fix url_fskip
|
||||
- generate optimal huffman tables for mjpeg encoding
|
||||
- fix ffserver regression tests
|
||||
- support xvids motion estimation
|
||||
- support x264s motion estimation
|
||||
- support x264s rate control
|
||||
- SNOW: non translational motion compensation
|
||||
- SNOW: more optimal quantization
|
||||
- SNOW: 4x4 block support
|
||||
- SNOW: 1/8 pel motion compensation support
|
||||
- SNOW: iterative motion estimation based on subsampled images
|
||||
- SNOW: try B frames and MCTF and see how their PSNR/bitrate/complexity behaves
|
||||
- SNOW: try to use the wavelet transformed MC-ed reference frame as context for the entropy coder
|
||||
- SNOW: think about/analyize how to make snow use multiple cpus/threads
|
||||
- SNOW: finish spec
|
||||
- FLAC: lossy encoding (viterbi and naive scalar quantization)
|
||||
- libavfilter
|
||||
- JPEG2000 decoder & encoder
|
||||
- MPEG4 GMC encoding support
|
||||
- macroblock based pixel format (better cache locality, somewhat complex, one paper claimed it faster for high res)
|
||||
- regression tests for codecs which do not have an encoder (I+P-frame bitstream in the 'master' branch)
|
||||
- add support for using mplayers video filters to ffmpeg
|
||||
- H264 encoder
|
||||
- per MB ratecontrol (so VCD and such do work better)
|
||||
- write a script which iteratively changes all functions between always_inline and noinline and benchmarks the result to find the best set of inlined functions
|
||||
- convert all the non SIMD asm into small asm vs. C testcases and submit them to the gcc devels so they can improve gcc
|
||||
- generic audio mixing API
|
||||
- extract PES packetizer from PS muxer and use it for new TS muxer
|
||||
- implement automatic AVBistreamFilter activation
|
||||
- make cabac encoder use bytestream (see http://trac.videolan.org/x264/changeset/?format=diff&new=651)
|
||||
- merge imdct and windowing, the current code does considerable amounts of redundant work
|
||||
|
|
@ -34,6 +34,7 @@ You can use libavcodec or libavformat in your commercial program, but
|
|||
@emph{any patch you make must be published}. The best way to proceed is
|
||||
to send your patches to the FFmpeg mailing list.
|
||||
|
||||
|
||||
@anchor{Coding Rules}
|
||||
@section Coding Rules
|
||||
|
||||
|
|
@ -54,10 +55,8 @@ These features are supported by all compilers we care about, so we will not
|
|||
accept patches to remove their use unless they absolutely do not impair
|
||||
clarity and performance.
|
||||
|
||||
All code must compile with GCC 2.95 and GCC 3.3. Currently, FFmpeg also
|
||||
compiles with several other compilers, such as the Compaq ccc compiler
|
||||
or Sun Studio 9, and we would like to keep it that way unless it would
|
||||
be exceedingly involved. To ensure compatibility, please do not use any
|
||||
All code must compile with recent versions of GCC and a number of other
|
||||
currently supported compilers. To ensure compatibility, please do not use
|
||||
additional C99 features or GCC extensions. Especially watch out for:
|
||||
@itemize @bullet
|
||||
@item
|
||||
|
|
@ -86,7 +85,7 @@ above them explaining what the function does, even if it is just one sentence.
|
|||
All structures and their member variables should be documented, too.
|
||||
@example
|
||||
/**
|
||||
* @@file mpeg.c
|
||||
* @@file
|
||||
* MPEG codec.
|
||||
* @@author ...
|
||||
*/
|
||||
|
|
@ -244,7 +243,8 @@ Note, these rules are mostly borrowed from the MPlayer project.
|
|||
|
||||
@section Submitting patches
|
||||
|
||||
First, read the (@pxref{Coding Rules}) above if you did not yet.
|
||||
First, read the @ref{Coding Rules} above if you did not yet, in particular
|
||||
the rules regarding patch submission.
|
||||
|
||||
When you submit your patch, please use @code{git format-patch} or
|
||||
@code{git send-email}. We cannot read other diffs :-)
|
||||
|
|
@ -259,8 +259,8 @@ for us and greatly increases your chances of getting your patch applied.
|
|||
Use the patcheck tool of FFmpeg to check your patch.
|
||||
The tool is located in the tools directory.
|
||||
|
||||
Run the regression tests before submitting a patch so that you can
|
||||
verify that there are no big problems.
|
||||
Run the @ref{Regression Tests} before submitting a patch in order to verify
|
||||
it does not cause unexpected problems.
|
||||
|
||||
Patches should be posted as base64 encoded attachments (or any other
|
||||
encoding which ensures that the patch will not be trashed during
|
||||
|
|
@ -339,7 +339,7 @@ send a reminder by email. Your patch should eventually be dealt with.
|
|||
@item
|
||||
Is the patch against latest FFmpeg git master branch?
|
||||
@item
|
||||
Are you subscribed to ffmpeg-dev?
|
||||
Are you subscribed to ffmpeg-devel?
|
||||
(the list is subscribers only due to spam)
|
||||
@item
|
||||
Have you checked that the changes are minimal, so that the same cannot be
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ FFMPEG_LIBS=libavdevice libavformat libavfilter libavcodec libswscale libavutil
|
|||
CFLAGS+=$(shell pkg-config --cflags $(FFMPEG_LIBS))
|
||||
LDFLAGS+=$(shell pkg-config --libs $(FFMPEG_LIBS))
|
||||
|
||||
EXAMPLES=encoding-example muxing-example
|
||||
EXAMPLES=encoding filtering metadata muxing
|
||||
|
||||
OBJS=$(addsuffix .o,$(EXAMPLES))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2001 Fabrice Bellard
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* avcodec API use example.
|
||||
* libavcodec API use example.
|
||||
*
|
||||
* Note that this library only handles codecs (mpeg, mpeg4, etc...),
|
||||
* Note that libavcodec only handles codecs (mpeg, mpeg4, etc...),
|
||||
* not file formats (avi, vob, etc...). See library 'libavformat' for the
|
||||
* format handling
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
#undef HAVE_AV_CONFIG_H
|
||||
#endif
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
|
||||
|
|
@ -64,12 +58,13 @@ static void audio_encode_example(const char *filename)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
c= avcodec_alloc_context();
|
||||
c = avcodec_alloc_context3(codec);
|
||||
|
||||
/* put sample parameters */
|
||||
c->bit_rate = 64000;
|
||||
c->sample_rate = 44100;
|
||||
c->channels = 2;
|
||||
c->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
|
||||
/* open it */
|
||||
if (avcodec_open(c, codec) < 0) {
|
||||
|
|
@ -134,7 +129,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
c= avcodec_alloc_context();
|
||||
c = avcodec_alloc_context3(codec);
|
||||
|
||||
/* open it */
|
||||
if (avcodec_open(c, codec) < 0) {
|
||||
|
|
@ -204,7 +199,7 @@ static void video_encode_example(const char *filename)
|
|||
int i, out_size, size, x, y, outbuf_size;
|
||||
FILE *f;
|
||||
AVFrame *picture;
|
||||
uint8_t *outbuf, *picture_buf;
|
||||
uint8_t *outbuf;
|
||||
|
||||
printf("Video encoding\n");
|
||||
|
||||
|
|
@ -215,7 +210,7 @@ static void video_encode_example(const char *filename)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
c= avcodec_alloc_context();
|
||||
c = avcodec_alloc_context3(codec);
|
||||
picture= avcodec_alloc_frame();
|
||||
|
||||
/* put sample parameters */
|
||||
|
|
@ -244,15 +239,11 @@ static void video_encode_example(const char *filename)
|
|||
/* alloc image and output buffer */
|
||||
outbuf_size = 100000;
|
||||
outbuf = malloc(outbuf_size);
|
||||
size = c->width * c->height;
|
||||
picture_buf = malloc((size * 3) / 2); /* size for YUV 420 */
|
||||
|
||||
picture->data[0] = picture_buf;
|
||||
picture->data[1] = picture->data[0] + size;
|
||||
picture->data[2] = picture->data[1] + size / 4;
|
||||
picture->linesize[0] = c->width;
|
||||
picture->linesize[1] = c->width / 2;
|
||||
picture->linesize[2] = c->width / 2;
|
||||
/* the image can be allocated by any means and av_image_alloc() is
|
||||
* just the most convenient way if av_malloc() is to be used */
|
||||
av_image_alloc(picture->data, picture->linesize,
|
||||
c->width, c->height, c->pix_fmt, 1);
|
||||
|
||||
/* encode 1 second of video */
|
||||
for(i=0;i<25;i++) {
|
||||
|
|
@ -295,11 +286,11 @@ static void video_encode_example(const char *filename)
|
|||
outbuf[3] = 0xb7;
|
||||
fwrite(outbuf, 1, 4, f);
|
||||
fclose(f);
|
||||
free(picture_buf);
|
||||
free(outbuf);
|
||||
|
||||
avcodec_close(c);
|
||||
av_free(c);
|
||||
av_free(picture->data[0]);
|
||||
av_free(picture);
|
||||
printf("\n");
|
||||
}
|
||||
|
|
@ -346,7 +337,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
c= avcodec_alloc_context();
|
||||
c = avcodec_alloc_context3(codec);
|
||||
picture= avcodec_alloc_frame();
|
||||
|
||||
if(codec->capabilities&CODEC_CAP_TRUNCATED)
|
||||
230
doc/examples/filtering.c
Normal file
230
doc/examples/filtering.c
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
/*
|
||||
* Copyright (c) 2010 Nicolas George
|
||||
* Copyright (c) 2011 Stefano Sabatini
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* API example for decoding and filtering
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 600 /* for usleep */
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/avfiltergraph.h>
|
||||
#include <libavfilter/vsink_buffer.h>
|
||||
#include <libavfilter/vsrc_buffer.h>
|
||||
|
||||
const char *filter_descr = "scale=78:24";
|
||||
|
||||
static AVFormatContext *fmt_ctx;
|
||||
static AVCodecContext *dec_ctx;
|
||||
AVFilterContext *buffersink_ctx;
|
||||
AVFilterContext *buffersrc_ctx;
|
||||
AVFilterGraph *filter_graph;
|
||||
static int video_stream_index = -1;
|
||||
static int64_t last_pts = AV_NOPTS_VALUE;
|
||||
|
||||
static int open_input_file(const char *filename)
|
||||
{
|
||||
int ret, i;
|
||||
AVCodec *dec;
|
||||
|
||||
if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = av_find_stream_info(fmt_ctx)) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* select the video stream */
|
||||
ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &dec, 0);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n");
|
||||
return ret;
|
||||
}
|
||||
video_stream_index = ret;
|
||||
dec_ctx = fmt_ctx->streams[video_stream_index]->codec;
|
||||
|
||||
/* init the video decoder */
|
||||
if ((ret = avcodec_open(dec_ctx, dec)) < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int init_filters(const char *filters_descr)
|
||||
{
|
||||
char args[512];
|
||||
int ret;
|
||||
AVFilter *buffersrc = avfilter_get_by_name("buffer");
|
||||
AVFilter *buffersink = avfilter_get_by_name("buffersink");
|
||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
||||
enum PixelFormat pix_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE };
|
||||
filter_graph = avfilter_graph_alloc();
|
||||
|
||||
/* buffer video source: the decoded frames from the decoder will be inserted here. */
|
||||
snprintf(args, sizeof(args), "%d:%d:%d:%d:%d:%d:%d",
|
||||
dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
|
||||
dec_ctx->time_base.num, dec_ctx->time_base.den,
|
||||
dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
|
||||
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
|
||||
args, NULL, filter_graph);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* buffer video sink: to terminate the filter chain. */
|
||||
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
|
||||
NULL, pix_fmts, filter_graph);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Endpoints for the filter graph. */
|
||||
outputs->name = av_strdup("in");
|
||||
outputs->filter_ctx = buffersrc_ctx;
|
||||
outputs->pad_idx = 0;
|
||||
outputs->next = NULL;
|
||||
|
||||
inputs->name = av_strdup("out");
|
||||
inputs->filter_ctx = buffersink_ctx;
|
||||
inputs->pad_idx = 0;
|
||||
inputs->next = NULL;
|
||||
|
||||
if ((ret = avfilter_graph_parse(filter_graph, filter_descr,
|
||||
&inputs, &outputs, NULL)) < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void display_picref(AVFilterBufferRef *picref, AVRational time_base)
|
||||
{
|
||||
int x, y;
|
||||
uint8_t *p0, *p;
|
||||
int64_t delay;
|
||||
|
||||
if (picref->pts != AV_NOPTS_VALUE) {
|
||||
if (last_pts != AV_NOPTS_VALUE) {
|
||||
/* sleep roughly the right amount of time;
|
||||
* usleep is in microseconds, just like AV_TIME_BASE. */
|
||||
delay = av_rescale_q(picref->pts - last_pts,
|
||||
time_base, AV_TIME_BASE_Q);
|
||||
if (delay > 0 && delay < 1000000)
|
||||
usleep(delay);
|
||||
}
|
||||
last_pts = picref->pts;
|
||||
}
|
||||
|
||||
/* Trivial ASCII grayscale display. */
|
||||
p0 = picref->data[0];
|
||||
puts("\033c");
|
||||
for (y = 0; y < picref->video->h; y++) {
|
||||
p = p0;
|
||||
for (x = 0; x < picref->video->w; x++)
|
||||
putchar(" .-+#"[*(p++) / 52]);
|
||||
putchar('\n');
|
||||
p0 += picref->linesize[0];
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
AVPacket packet;
|
||||
AVFrame frame;
|
||||
int got_frame;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s file\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
avcodec_register_all();
|
||||
av_register_all();
|
||||
avfilter_register_all();
|
||||
|
||||
if ((ret = open_input_file(argv[1]) < 0))
|
||||
goto end;
|
||||
if ((ret = init_filters(filter_descr)) < 0)
|
||||
goto end;
|
||||
|
||||
/* read all packets */
|
||||
while (1) {
|
||||
AVFilterBufferRef *picref;
|
||||
if ((ret = av_read_frame(fmt_ctx, &packet)) < 0)
|
||||
break;
|
||||
|
||||
if (packet.stream_index == video_stream_index) {
|
||||
avcodec_get_frame_defaults(&frame);
|
||||
got_frame = 0;
|
||||
ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
|
||||
av_free_packet(&packet);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (got_frame) {
|
||||
if (frame.pts == AV_NOPTS_VALUE)
|
||||
frame.pts = frame.pkt_dts == AV_NOPTS_VALUE ?
|
||||
frame.pkt_dts : frame.pkt_pts;
|
||||
/* push the decoded frame into the filtergraph */
|
||||
av_vsrc_buffer_add_frame(buffersrc_ctx, &frame);
|
||||
|
||||
/* pull filtered pictures from the filtergraph */
|
||||
while (avfilter_poll_frame(buffersink_ctx->inputs[0])) {
|
||||
av_vsink_buffer_get_video_buffer_ref(buffersink_ctx, &picref, 0);
|
||||
if (picref) {
|
||||
display_picref(picref, buffersink_ctx->inputs[0]->time_base);
|
||||
avfilter_unref_buffer(picref);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end:
|
||||
avfilter_graph_free(&filter_graph);
|
||||
if (dec_ctx)
|
||||
avcodec_close(dec_ctx);
|
||||
av_close_input_file(fmt_ctx);
|
||||
|
||||
if (ret < 0 && ret != AVERROR_EOF) {
|
||||
char buf[1024];
|
||||
av_strerror(ret, buf, sizeof(buf));
|
||||
fprintf(stderr, "Error occurred: %s\n", buf);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
55
doc/examples/metadata.c
Normal file
55
doc/examples/metadata.c
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (c) 2011 Reinhard Tartler
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Shows how the metadata API can be used in application programs.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavutil/dict.h>
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
AVFormatContext *fmt_ctx = NULL;
|
||||
AVDictionaryEntry *tag = NULL;
|
||||
int ret;
|
||||
|
||||
if (argc != 2) {
|
||||
printf("usage: %s <input_file>\n"
|
||||
"example program to demonstrate the use of the libavformat metadata API.\n"
|
||||
"\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
av_register_all();
|
||||
if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL)))
|
||||
return ret;
|
||||
|
||||
while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
|
||||
printf("%s=%s\n", tag->key, tag->value);
|
||||
|
||||
avformat_free_context(fmt_ctx);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -22,8 +22,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Libavformat API example: Output a media file in any supported
|
||||
* libavformat format. The default codecs are used.
|
||||
* libavformat API example.
|
||||
*
|
||||
* Output a media file in any supported libavformat format.
|
||||
* The default codecs are used.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -31,6 +33,7 @@
|
|||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libswscale/swscale.h"
|
||||
|
||||
|
|
@ -78,7 +81,7 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id)
|
|||
c->channels = 2;
|
||||
|
||||
// some formats want stream headers to be separate
|
||||
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
return st;
|
||||
|
|
@ -141,7 +144,7 @@ static void get_audio_frame(int16_t *samples, int frame_size, int nb_channels)
|
|||
int16_t *q;
|
||||
|
||||
q = samples;
|
||||
for(j=0;j<frame_size;j++) {
|
||||
for (j = 0; j < frame_size; j++) {
|
||||
v = (int)(sin(t) * 10000);
|
||||
for(i = 0; i < nb_channels; i++)
|
||||
*q++ = v;
|
||||
|
|
@ -160,13 +163,13 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st)
|
|||
|
||||
get_audio_frame(samples, audio_input_frame_size, c->channels);
|
||||
|
||||
pkt.size= avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);
|
||||
pkt.size = avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples);
|
||||
|
||||
if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE)
|
||||
pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
|
||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||
pkt.stream_index= st->index;
|
||||
pkt.data= audio_outbuf;
|
||||
pkt.stream_index = st->index;
|
||||
pkt.data = audio_outbuf;
|
||||
|
||||
/* write the compressed frame in the media file */
|
||||
if (av_interleaved_write_frame(oc, &pkt) != 0) {
|
||||
|
|
@ -230,7 +233,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
|
|||
c->mb_decision=2;
|
||||
}
|
||||
// some formats want stream headers to be separate
|
||||
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
||||
|
||||
return st;
|
||||
|
|
@ -316,15 +319,15 @@ static void fill_yuv_image(AVFrame *pict, int frame_index, int width, int height
|
|||
i = frame_index;
|
||||
|
||||
/* Y */
|
||||
for(y=0;y<height;y++) {
|
||||
for(x=0;x<width;x++) {
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++) {
|
||||
pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* Cb and Cr */
|
||||
for(y=0;y<height/2;y++) {
|
||||
for(x=0;x<width/2;x++) {
|
||||
for (y = 0; y < height/2; y++) {
|
||||
for (x = 0; x < width/2; x++) {
|
||||
pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;
|
||||
pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;
|
||||
}
|
||||
|
|
@ -369,14 +372,14 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
|
|||
|
||||
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
|
||||
/* raw video case. The API will change slightly in the near
|
||||
futur for that */
|
||||
future for that. */
|
||||
AVPacket pkt;
|
||||
av_init_packet(&pkt);
|
||||
|
||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||
pkt.stream_index= st->index;
|
||||
pkt.data= (uint8_t *)picture;
|
||||
pkt.size= sizeof(AVPicture);
|
||||
pkt.stream_index = st->index;
|
||||
pkt.data = (uint8_t *)picture;
|
||||
pkt.size = sizeof(AVPicture);
|
||||
|
||||
ret = av_interleaved_write_frame(oc, &pkt);
|
||||
} else {
|
||||
|
|
@ -391,9 +394,9 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
|
|||
pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
|
||||
if(c->coded_frame->key_frame)
|
||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||
pkt.stream_index= st->index;
|
||||
pkt.data= video_outbuf;
|
||||
pkt.size= out_size;
|
||||
pkt.stream_index = st->index;
|
||||
pkt.data = video_outbuf;
|
||||
pkt.size = out_size;
|
||||
|
||||
/* write the compressed frame in the media file */
|
||||
ret = av_interleaved_write_frame(oc, &pkt);
|
||||
|
|
@ -455,7 +458,7 @@ int main(int argc, char **argv)
|
|||
if (!oc) {
|
||||
exit(1);
|
||||
}
|
||||
fmt= oc->oformat;
|
||||
fmt = oc->oformat;
|
||||
|
||||
/* add the audio and video streams using the default format codecs
|
||||
and initialize the codecs */
|
||||
10
doc/faq.texi
10
doc/faq.texi
|
|
@ -47,7 +47,7 @@ Likely reasons
|
|||
@item We are busy and haven't had time yet to read your report or
|
||||
investigate the issue.
|
||||
@item You didn't follow @url{http://ffmpeg.org/bugreports.html}.
|
||||
@item You didn't use git HEAD.
|
||||
@item You didn't use git master.
|
||||
@item You reported a segmentation fault without gdb output.
|
||||
@item You describe a problem but not how to reproduce it.
|
||||
@item It's unclear if you use ffmpeg as command line tool or use
|
||||
|
|
@ -123,7 +123,8 @@ problem and an NP-hard problem...
|
|||
|
||||
@section ffmpeg does not work; what is wrong?
|
||||
|
||||
Try a @code{make distclean} in the ffmpeg source directory before the build. If this does not help see
|
||||
Try a @code{make distclean} in the ffmpeg source directory before the build.
|
||||
If this does not help see
|
||||
(@url{http://ffmpeg.org/bugreports.html}).
|
||||
|
||||
@section How do I encode single pictures into movies?
|
||||
|
|
@ -285,7 +286,8 @@ Just create an "input.avs" text file with this single line ...
|
|||
ffmpeg -i input.avs
|
||||
@end example
|
||||
|
||||
For ANY other help on Avisynth, please visit @url{http://www.avisynth.org/}.
|
||||
For ANY other help on Avisynth, please visit the
|
||||
@uref{http://www.avisynth.org/, Avisynth homepage}.
|
||||
|
||||
@section How can I join video files?
|
||||
|
||||
|
|
@ -417,7 +419,7 @@ No. These tools are too bloated and they complicate the build.
|
|||
FFmpeg is already organized in a highly modular manner and does not need to
|
||||
be rewritten in a formal object language. Further, many of the developers
|
||||
favor straight C; it works for them. For more arguments on this matter,
|
||||
read "Programming Religion" at (@url{http://www.tux.org/lkml/#s15}).
|
||||
read @uref{http://www.tux.org/lkml/#s15, "Programming Religion"}.
|
||||
|
||||
@section Why are the ffmpeg programs devoid of debugging symbols?
|
||||
|
||||
|
|
|
|||
|
|
@ -159,8 +159,6 @@ Set the ISO 639 language code (3 letters) of the current subtitle stream.
|
|||
@section Video Options
|
||||
|
||||
@table @option
|
||||
@item -b @var{bitrate}
|
||||
Set the video bitrate in bit/s (default = 200 kb/s).
|
||||
@item -vframes @var{number}
|
||||
Set the number of video frames to record.
|
||||
@item -r @var{fps}
|
||||
|
|
@ -476,7 +474,7 @@ FF_ER_COMPLIANT
|
|||
@item 3
|
||||
FF_ER_AGGRESSIVE
|
||||
@item 4
|
||||
FF_ER_VERY_AGGRESSIVE
|
||||
FF_ER_EXPLODE
|
||||
@end table
|
||||
|
||||
@item -ec @var{bit_mask}
|
||||
|
|
@ -556,16 +554,17 @@ The timestamps must be specified in ascending order.
|
|||
@item -aframes @var{number}
|
||||
Set the number of audio frames to record.
|
||||
@item -ar @var{freq}
|
||||
Set the audio sampling frequency. there is no default for input streams,
|
||||
for output streams it is set by default to the frequency of the input stream.
|
||||
@item -ab @var{bitrate}
|
||||
Set the audio bitrate in bit/s (default = 64k).
|
||||
Set the audio sampling frequency. For output streams it is set by
|
||||
default to the frequency of the corresponding input stream. For input
|
||||
streams this option only makes sense for audio grabbing devices and raw
|
||||
demuxers and is mapped to the corresponding demuxer options.
|
||||
@item -aq @var{q}
|
||||
Set the audio quality (codec-specific, VBR).
|
||||
@item -ac @var{channels}
|
||||
Set the number of audio channels. For input streams it is set by
|
||||
default to 1, for output streams it is set by default to the same
|
||||
number of audio channels in input.
|
||||
Set the number of audio channels. For output streams it is set by
|
||||
default to the number of input audio channels. For input streams
|
||||
this option only makes sense for audio grabbing devices and raw demuxers
|
||||
and is mapped to the corresponding demuxer options.
|
||||
@item -an
|
||||
Disable audio recording.
|
||||
@item -acodec @var{codec}
|
||||
|
|
@ -733,9 +732,11 @@ Read input at native frame rate. Mainly used to simulate a grab device.
|
|||
@item -loop_input
|
||||
Loop over the input stream. Currently it works only for image
|
||||
streams. This option is used for automatic FFserver testing.
|
||||
This option is deprecated, use -loop 1.
|
||||
@item -loop_output @var{number_of_times}
|
||||
Repeatedly loop output for formats that support looping such as animated GIF
|
||||
(0 will loop the output infinitely).
|
||||
This option is deprecated, use -loop.
|
||||
@item -threads @var{count}
|
||||
Thread count.
|
||||
@item -vsync @var{parameter}
|
||||
|
|
@ -883,8 +884,8 @@ ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
|
|||
@end example
|
||||
|
||||
Note that you must activate the right video source and channel before
|
||||
launching ffmpeg with any TV viewer such as xawtv
|
||||
(@url{http://linux.bytesex.org/xawtv/}) by Gerd Knorr. You also
|
||||
launching ffmpeg with any TV viewer such as
|
||||
@uref{http://linux.bytesex.org/xawtv/, xawtv} by Gerd Knorr. You also
|
||||
have to set the audio recording levels correctly with a
|
||||
standard mixer.
|
||||
|
||||
|
|
@ -903,8 +904,34 @@ the DISPLAY environment variable.
|
|||
ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
|
||||
@end example
|
||||
|
||||
0.0 is display.screen number of your X11 server, same as the DISPLAY environment
|
||||
variable. 10 is the x-offset and 20 the y-offset for the grabbing.
|
||||
10 is the x-offset and 20 the y-offset for the grabbing.
|
||||
|
||||
@example
|
||||
ffmpeg -f x11grab -follow_mouse centered -s cif -r 25 -i :0.0 /tmp/out.mpg
|
||||
@end example
|
||||
|
||||
The grabbing region follows the mouse pointer, which stays at the center of
|
||||
region.
|
||||
|
||||
@example
|
||||
ffmpeg -f x11grab -follow_mouse 100 -s cif -r 25 -i :0.0 /tmp/out.mpg
|
||||
@end example
|
||||
|
||||
Only follows when mouse pointer reaches within 100 pixels to the edge of
|
||||
region.
|
||||
|
||||
@example
|
||||
ffmpeg -f x11grab -show_region 1 -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
|
||||
@end example
|
||||
|
||||
The grabbing region will be indicated on screen.
|
||||
|
||||
@example
|
||||
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -s cif -r 25 -i :0.0 /tmp/out.mpg
|
||||
@end example
|
||||
|
||||
The grabbing region indication will follow the mouse pointer.
|
||||
|
||||
|
||||
@section Video and Audio file format conversion
|
||||
|
||||
|
|
|
|||
|
|
@ -38,8 +38,9 @@ Force displayed width.
|
|||
@item -y @var{height}
|
||||
Force displayed height.
|
||||
@item -s @var{size}
|
||||
Set frame size (WxH or abbreviation), needed for videos which don't
|
||||
contain a header with the frame size like raw YUV.
|
||||
Set frame size (WxH or abbreviation), needed for videos which do
|
||||
not contain a header with the frame size like raw YUV. This option
|
||||
has been deprecated in favor of private options, try -video_size.
|
||||
@item -an
|
||||
Disable audio.
|
||||
@item -vn
|
||||
|
|
@ -90,6 +91,7 @@ Read @var{input_file}.
|
|||
@table @option
|
||||
@item -pix_fmt @var{format}
|
||||
Set pixel format.
|
||||
This option has been deprecated in favor of private options, try -pixel_format.
|
||||
@item -stats
|
||||
Show the stream duration, the codec parameters, the current position in
|
||||
the stream and the audio/video synchronisation drift.
|
||||
|
|
|
|||
|
|
@ -91,3 +91,28 @@ The use of the environment variable @env{NO_COLOR} is deprecated and
|
|||
will be dropped in a following FFmpeg version.
|
||||
|
||||
@end table
|
||||
|
||||
@section AVOptions
|
||||
|
||||
These options are provided directly by the libavformat, libavdevice and
|
||||
libavcodec libraries. To see the list of available AVOptions, use the
|
||||
@option{-help} option. They are separated into two categories:
|
||||
@table @option
|
||||
@item generic
|
||||
These options can be set for any container, codec or device. Generic options are
|
||||
listed under AVFormatContext options for containers/devices and under
|
||||
AVCodecContext options for codecs.
|
||||
@item private
|
||||
These options are specific to the given container, device or codec. Private
|
||||
options are listed under their corresponding containers/devices/codecs.
|
||||
@end table
|
||||
|
||||
For example to write an ID3v2.3 header instead of a default ID3v2.4 to
|
||||
an MP3 file, use the @option{id3v2_version} private option of the MP3
|
||||
muxer:
|
||||
@example
|
||||
ffmpeg -i input.flac -id3v2_version 3 out.mp3
|
||||
@end example
|
||||
|
||||
Note -nooption syntax cannot be used for boolean AVOptions, use -option
|
||||
0/-option 1.
|
||||
|
|
|
|||
176
doc/filters.texi
176
doc/filters.texi
|
|
@ -18,8 +18,8 @@ output pads is called a "sink".
|
|||
|
||||
A filtergraph can be represented using a textual representation, which
|
||||
is recognized by the @code{-vf} and @code{-af} options of the ff*
|
||||
tools, and by the @code{av_parse_graph()} function defined in
|
||||
@file{libavfilter/avfiltergraph}.
|
||||
tools, and by the @code{avfilter_graph_parse()} function defined in
|
||||
@file{libavfilter/avfiltergraph.h}.
|
||||
|
||||
A filterchain consists of a sequence of connected filters, each one
|
||||
connected to the previous one in the sequence. A filterchain is
|
||||
|
|
@ -183,6 +183,66 @@ threshold, and defaults to 98.
|
|||
@var{threshold} is the threshold below which a pixel value is
|
||||
considered black, and defaults to 32.
|
||||
|
||||
@section boxblur
|
||||
|
||||
Apply boxblur algorithm to the input video.
|
||||
|
||||
This filter accepts the parameters:
|
||||
@var{luma_power}:@var{luma_radius}:@var{chroma_radius}:@var{chroma_power}:@var{alpha_radius}:@var{alpha_power}
|
||||
|
||||
Chroma and alpha parameters are optional, if not specified they default
|
||||
to the corresponding values set for @var{luma_radius} and
|
||||
@var{luma_power}.
|
||||
|
||||
@var{luma_radius}, @var{chroma_radius}, and @var{alpha_radius} represent
|
||||
the radius in pixels of the box used for blurring the corresponding
|
||||
input plane. They are expressions, and can contain the following
|
||||
constants:
|
||||
@table @option
|
||||
@item w, h
|
||||
the input width and heigth in pixels
|
||||
|
||||
@item cw, ch
|
||||
the input chroma image width and height in pixels
|
||||
|
||||
@item hsub, vsub
|
||||
horizontal and vertical chroma subsample values. For example for the
|
||||
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
|
||||
@end table
|
||||
|
||||
The radius must be a non-negative number, and must be not greater than
|
||||
the value of the expression @code{min(w,h)/2} for the luma and alpha planes,
|
||||
and of @code{min(cw,ch)/2} for the chroma planes.
|
||||
|
||||
@var{luma_power}, @var{chroma_power}, and @var{alpha_power} represent
|
||||
how many times the boxblur filter is applied to the corresponding
|
||||
plane.
|
||||
|
||||
Some examples follow:
|
||||
|
||||
@itemize
|
||||
|
||||
@item
|
||||
Apply a boxblur filter with luma, chroma, and alpha radius
|
||||
set to 2:
|
||||
@example
|
||||
boxblur=2:1
|
||||
@end example
|
||||
|
||||
@item
|
||||
Set luma radius to 2, alpha and chroma radius to 0
|
||||
@example
|
||||
boxblur=2:1:0:0:0:0
|
||||
@end example
|
||||
|
||||
@item
|
||||
Set luma and chroma radius to a fraction of the video dimension
|
||||
@example
|
||||
boxblur=min(h\,w)/10:1:min(cw\,ch)/10:1
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section copy
|
||||
|
||||
Copy the input source unchanged to the output. Mainly useful for
|
||||
|
|
@ -215,6 +275,19 @@ the output (cropped) width and heigth
|
|||
@item ow, oh
|
||||
same as @var{out_w} and @var{out_h}
|
||||
|
||||
@item a
|
||||
same as @var{iw} / @var{ih}
|
||||
|
||||
@item sar
|
||||
input sample aspect ratio
|
||||
|
||||
@item dar
|
||||
input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
|
||||
|
||||
@item hsub, vsub
|
||||
horizontal and vertical chroma subsample values. For example for the
|
||||
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
|
||||
|
||||
@item n
|
||||
the number of input frame, starting from 0
|
||||
|
||||
|
|
@ -835,9 +908,6 @@ the named filter.
|
|||
The list of the currently supported filters follows:
|
||||
@table @var
|
||||
@item 2xsai
|
||||
@item blackframe
|
||||
@item boxblur
|
||||
@item cropdetect
|
||||
@item decimate
|
||||
@item delogo
|
||||
@item denoise3d
|
||||
|
|
@ -874,7 +944,6 @@ The list of the currently supported filters follows:
|
|||
@item qp
|
||||
@item rectangle
|
||||
@item remove-logo
|
||||
@item rgbtest
|
||||
@item rotate
|
||||
@item sab
|
||||
@item screenshot
|
||||
|
|
@ -1013,8 +1082,7 @@ Erode an image by using a specific structuring element.
|
|||
This filter corresponds to the libopencv function @code{cvErode}.
|
||||
|
||||
The filter accepts the parameters: @var{struct_el}:@var{nb_iterations},
|
||||
with the same meaning and use of those of the dilate filter
|
||||
(@pxref{dilate}).
|
||||
with the same syntax and semantics as the @ref{dilate} filter.
|
||||
|
||||
@subsection smooth
|
||||
|
||||
|
|
@ -1130,7 +1198,13 @@ x and y offsets as specified by the @var{x} and @var{y}
|
|||
expressions, or NAN if not yet specified
|
||||
|
||||
@item a
|
||||
input display aspect ratio, same as @var{iw} / @var{ih}
|
||||
same as @var{iw} / @var{ih}
|
||||
|
||||
@item sar
|
||||
input sample aspect ratio
|
||||
|
||||
@item dar
|
||||
input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
|
||||
|
||||
@item hsub, vsub
|
||||
horizontal and vertical chroma subsample values. For example for the
|
||||
|
|
@ -1190,6 +1264,12 @@ pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
|
|||
# pad the input to get a final w/h ratio of 16:9
|
||||
pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
|
||||
|
||||
# for anamorphic video, in order to set the output display aspect ratio,
|
||||
# it is necessary to use sar in the expression, according to the relation:
|
||||
# (ih * X / ih) * sar = output_dar
|
||||
# X = output_dar / sar
|
||||
pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
|
||||
|
||||
# double output size and put the input video in the bottom-right
|
||||
# corner of the output padded area
|
||||
pad="2*iw:2*ih:ow-iw:oh-ih"
|
||||
|
|
@ -1232,7 +1312,13 @@ the output (cropped) width and heigth
|
|||
same as @var{out_w} and @var{out_h}
|
||||
|
||||
@item a
|
||||
input display aspect ratio, same as @var{iw} / @var{ih}
|
||||
same as @var{iw} / @var{ih}
|
||||
|
||||
@item sar
|
||||
input sample aspect ratio
|
||||
|
||||
@item dar
|
||||
input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
|
||||
|
||||
@item hsub, vsub
|
||||
horizontal and vertical chroma subsample values. For example for the
|
||||
|
|
@ -1426,7 +1512,7 @@ setdar=16:9
|
|||
setdar=1.77777
|
||||
@end example
|
||||
|
||||
See also the "setsar" filter documentation (@pxref{setsar}).
|
||||
See also the @ref{setsar} filter documentation.
|
||||
|
||||
@section setpts
|
||||
|
||||
|
|
@ -1737,7 +1823,7 @@ Flip the input video vertically.
|
|||
Deinterlace the input video ("yadif" means "yet another deinterlacing
|
||||
filter").
|
||||
|
||||
It accepts the optional parameters: @var{mode}:@var{parity}.
|
||||
It accepts the optional parameters: @var{mode}:@var{parity}:@var{auto}.
|
||||
|
||||
@var{mode} specifies the interlacing mode to adopt, accepts one of the
|
||||
following values:
|
||||
|
|
@ -1760,9 +1846,9 @@ interlaced video, accepts one of the following values:
|
|||
|
||||
@table @option
|
||||
@item 0
|
||||
assume bottom field first
|
||||
@item 1
|
||||
assume top field first
|
||||
@item 1
|
||||
assume bottom field first
|
||||
@item -1
|
||||
enable automatic detection
|
||||
@end table
|
||||
|
|
@ -1771,6 +1857,18 @@ Default value is -1.
|
|||
If interlacing is unknown or decoder does not export this information,
|
||||
top field first will be assumed.
|
||||
|
||||
@var{auto} specifies if deinterlacer should trust the interlaced flag
|
||||
and only deinterlace frames marked as interlaced
|
||||
|
||||
@table @option
|
||||
@item 0
|
||||
deinterlace all frames
|
||||
@item 1
|
||||
only deinterlace frames marked as interlaced
|
||||
@end table
|
||||
|
||||
Default value is 0.
|
||||
|
||||
@c man end VIDEO FILTERS
|
||||
|
||||
@chapter Video Sources
|
||||
|
|
@ -1960,8 +2058,7 @@ form @var{width}x@var{height} or a frame size abbreviation.
|
|||
the form @var{num}/@var{den} or a frame rate abbreviation.
|
||||
@var{src_name} is the name to the frei0r source to load. For more
|
||||
information regarding frei0r and how to set the parameters read the
|
||||
section "frei0r" (@pxref{frei0r}) in the description of the video
|
||||
filters.
|
||||
section @ref{frei0r} in the description of the video filters.
|
||||
|
||||
Some examples follow:
|
||||
@example
|
||||
|
|
@ -1970,6 +2067,53 @@ Some examples follow:
|
|||
frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
|
||||
@end example
|
||||
|
||||
@section rgbtestsrc, testsrc
|
||||
|
||||
The @code{rgbtestsrc} source generates an RGB test pattern useful for
|
||||
detecting RGB vs BGR issues. You should see a red, green and blue
|
||||
stripe from top to bottom.
|
||||
|
||||
The @code{testsrc} source generates a test video pattern, showing a
|
||||
color pattern, a scrolling gradient and a timestamp. This is mainly
|
||||
intended for testing purposes.
|
||||
|
||||
Both sources accept an optional sequence of @var{key}=@var{value} pairs,
|
||||
separated by ":". The description of the accepted options follows.
|
||||
|
||||
@table @option
|
||||
|
||||
@item size, s
|
||||
Specify the size of the sourced video, it may be a string of the form
|
||||
@var{width}x@var{heigth}, or the name of a size abbreviation. The
|
||||
default value is "320x240".
|
||||
|
||||
@item rate, r
|
||||
Specify the frame rate of the sourced video, as the number of frames
|
||||
generated per second. It has to be a string in the format
|
||||
@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
|
||||
number or a valid video frame rate abbreviation. The default value is
|
||||
"25".
|
||||
|
||||
@item duration
|
||||
Set the video duration of the sourced video. The accepted syntax is:
|
||||
@example
|
||||
[-]HH[:MM[:SS[.m...]]]
|
||||
[-]S+[.m...]
|
||||
@end example
|
||||
See also the function @code{av_parse_time()}.
|
||||
|
||||
If not specified, or the expressed duration is negative, the video is
|
||||
supposed to be generated forever.
|
||||
@end table
|
||||
|
||||
For example the following:
|
||||
@example
|
||||
testsrc=duration=5.3:size=qcif:rate=10
|
||||
@end example
|
||||
|
||||
will generate a video with a duration of 5.3 seconds, with size
|
||||
176x144 and a framerate of 10 frames per second.
|
||||
|
||||
@c man end VIDEO SOURCES
|
||||
|
||||
@chapter Video Sinks
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ library:
|
|||
@tab Used in Z and Z95 games.
|
||||
@item Brute Force & Ignorance @tab @tab X
|
||||
@tab Used in the game Flash Traffic: City of Angels.
|
||||
@item BWF @tab X @tab X
|
||||
@item Interplay C93 @tab @tab X
|
||||
@tab Used in the game Cyberia from Interplay.
|
||||
@item Delphine Software International CIN @tab @tab X
|
||||
|
|
@ -400,7 +401,7 @@ following image formats are supported:
|
|||
@tab experimental lossless codec (fourcc: FFV1)
|
||||
@item Flash Screen Video v1 @tab X @tab X
|
||||
@tab fourcc: FSV1
|
||||
@item Flash Screen Video v2 @tab X
|
||||
@item Flash Screen Video v2 @tab X @tab X
|
||||
@item Flash Video (FLV) @tab X @tab X
|
||||
@tab Sorenson H.263 used in Flash
|
||||
@item Fraps @tab @tab X
|
||||
|
|
@ -819,8 +820,8 @@ the FFmpeg Windows Help Forum at
|
|||
|
||||
FFmpeg can be built to run natively on Windows using the MinGW tools. Install
|
||||
the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
|
||||
You can find detailed installation
|
||||
instructions in the download section and the FAQ.
|
||||
You can find detailed installation instructions in the download
|
||||
section and the FAQ.
|
||||
|
||||
FFmpeg does not build out-of-the-box with the packages the automated MinGW
|
||||
installer provides. It also requires coreutils to be installed and many other
|
||||
|
|
@ -848,13 +849,14 @@ noticeable when running make for a second time (for example in
|
|||
@code{make install}).
|
||||
|
||||
@item In order to compile FFplay, you must have the MinGW development library
|
||||
of SDL. Get it from @url{http://www.libsdl.org}.
|
||||
of @uref{http://www.libsdl.org/, SDL}.
|
||||
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
|
||||
where SDL was installed. Verify that @file{sdl-config} can be launched from
|
||||
the MSYS command line.
|
||||
|
||||
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
|
||||
you can build libavutil, libavcodec and libavformat as DLLs.
|
||||
you can build the FFmpeg libraries (e.g. libavutil, libavcodec,
|
||||
libavformat) as DLLs.
|
||||
|
||||
@end itemize
|
||||
|
||||
|
|
@ -961,7 +963,7 @@ MSVC++-compatible import libraries.
|
|||
@item Build FFmpeg with
|
||||
|
||||
@example
|
||||
./configure --enable-shared --enable-memalign-hack
|
||||
./configure --enable-shared
|
||||
make
|
||||
make install
|
||||
@end example
|
||||
|
|
@ -969,7 +971,8 @@ make install
|
|||
Your install path (@file{/usr/local/} by default) should now have the
|
||||
necessary DLL and LIB files under the @file{bin} directory.
|
||||
|
||||
@end enumerate
|
||||
Alternatively, build the libraries with a cross compiler, according to
|
||||
the instructions below in @ref{Cross compilation for Windows with Linux}.
|
||||
|
||||
To use those files with MSVC++, do the same as you would do with
|
||||
the static libraries, as described above. But in Step 4,
|
||||
|
|
@ -982,10 +985,7 @@ libraries (@file{libxxx.a} files) you should add the MSVC import libraries
|
|||
libraries (@file{libxxx.dll.a} files), as these will give you undefined
|
||||
reference errors. There should be no need for @file{libmingwex.a},
|
||||
@file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
|
||||
statically linked into the DLLs. The @file{bin} directory contains a bunch
|
||||
of DLL files, but the ones that are actually used to run your application
|
||||
are the ones with a major version number in their filenames
|
||||
(i.e. @file{avcodec-51.dll}).
|
||||
statically linked into the DLLs.
|
||||
|
||||
FFmpeg headers do not declare global data for Windows DLLs through the usual
|
||||
dllexport/dllimport interface. Such data will be exported properly while
|
||||
|
|
@ -998,10 +998,41 @@ extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
|
|||
|
||||
Note that using import libraries created by dlltool requires
|
||||
the linker optimization option to be set to
|
||||
"References: Keep Unreferenced Data (/OPT:NOREF)", otherwise
|
||||
"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise
|
||||
the resulting binaries will fail during runtime. This isn't
|
||||
required when using import libraries generated by lib.exe.
|
||||
This issue is reported upstream at
|
||||
@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}.
|
||||
|
||||
To create import libraries that work with the @code{/OPT:REF} option
|
||||
(which is enabled by default in Release mode), follow these steps:
|
||||
|
||||
@enumerate
|
||||
|
||||
@item Open @file{Visual Studio 2005 Command Prompt}.
|
||||
|
||||
Alternatively, in a normal command line prompt, call @file{vcvars32.bat}
|
||||
which sets up the environment variables for the Visual C++ tools
|
||||
(the standard location for this file is
|
||||
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat}).
|
||||
|
||||
@item Enter the @file{bin} directory where the created LIB and DLL files
|
||||
are stored.
|
||||
|
||||
@item Generate new import libraries with @file{lib.exe}:
|
||||
|
||||
@example
|
||||
lib /machine:i386 /def:..\lib\avcodec-53.def /out:avcodec.lib
|
||||
lib /machine:i386 /def:..\lib\avdevice-53.def /out:avdevice.lib
|
||||
lib /machine:i386 /def:..\lib\avfilter-2.def /out:avfilter.lib
|
||||
lib /machine:i386 /def:..\lib\avformat-53.def /out:avformat.lib
|
||||
lib /machine:i386 /def:..\lib\avutil-51.def /out:avutil.lib
|
||||
lib /machine:i386 /def:..\lib\swscale-2.def /out:swscale.lib
|
||||
@end example
|
||||
|
||||
@end enumerate
|
||||
|
||||
@anchor{Cross compilation for Windows with Linux}
|
||||
@subsection Cross compilation for Windows with Linux
|
||||
|
||||
You must use the MinGW cross compilation tools available at
|
||||
|
|
@ -1014,8 +1045,7 @@ Then configure FFmpeg with the following options:
|
|||
(you can change the cross-prefix according to the prefix chosen for the
|
||||
MinGW tools).
|
||||
|
||||
Then you can easily test FFmpeg with Wine
|
||||
(@url{http://www.winehq.com/}).
|
||||
Then you can easily test FFmpeg with @uref{http://www.winehq.com/, Wine}.
|
||||
|
||||
@subsection Compilation under Cygwin
|
||||
|
||||
|
|
@ -1036,7 +1066,7 @@ diffutils
|
|||
Then run
|
||||
|
||||
@example
|
||||
./configure --enable-static --disable-shared
|
||||
./configure
|
||||
@end example
|
||||
|
||||
to make a static build.
|
||||
|
|
@ -1054,8 +1084,8 @@ If you want to build FFmpeg with additional libraries, download Cygwin
|
|||
libogg-devel, libvorbis-devel
|
||||
@end example
|
||||
|
||||
These library packages are only available from Cygwin Ports
|
||||
(@url{http://sourceware.org/cygwinports/}) :
|
||||
These library packages are only available from
|
||||
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
|
||||
|
||||
@example
|
||||
yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel,
|
||||
|
|
@ -1083,12 +1113,12 @@ and add some special flags to your configure invocation.
|
|||
|
||||
For a static build run
|
||||
@example
|
||||
./configure --target-os=mingw32 --enable-memalign-hack --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
@end example
|
||||
|
||||
and for a build with shared libraries
|
||||
@example
|
||||
./configure --target-os=mingw32 --enable-memalign-hack --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
@end example
|
||||
|
||||
@bye
|
||||
|
|
|
|||
130
doc/indevs.texi
130
doc/indevs.texi
|
|
@ -137,6 +137,95 @@ For more information read:
|
|||
|
||||
IIDC1394 input device, based on libdc1394 and libraw1394.
|
||||
|
||||
@section openal
|
||||
|
||||
The OpenAL input device provides audio capture on all systems with a
|
||||
working OpenAL 1.1 implementation.
|
||||
|
||||
To enable this input device during configuration, you need OpenAL
|
||||
headers and libraries installed on your system, and need to configure
|
||||
FFmpeg with @code{--enable-openal}.
|
||||
|
||||
OpenAL headers and libraries should be provided as part of your OpenAL
|
||||
implementation, or as an additional download (an SDK). Depending on your
|
||||
installation you may need to specify additional flags via the
|
||||
@code{--extra-cflags} and @code{--extra-ldflags} for allowing the build
|
||||
system to locate the OpenAL headers and libraries.
|
||||
|
||||
An incomplete list of OpenAL implementations follows:
|
||||
|
||||
@table @strong
|
||||
@item Creative
|
||||
The official Windows implementation, providing hardware acceleration
|
||||
with supported devices and software fallback.
|
||||
See @url{http://openal.org/}.
|
||||
@item OpenAL Soft
|
||||
Portable, open source (LGPL) software implementation. Includes
|
||||
backends for the most common sound APIs on the Windows, Linux,
|
||||
Solaris, and BSD operating systems.
|
||||
See @url{http://kcat.strangesoft.net/openal.html}.
|
||||
@item Apple
|
||||
OpenAL is part of Core Audio, the official Mac OS X Audio interface.
|
||||
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
|
||||
@end table
|
||||
|
||||
This device allows to capture from an audio input device handled
|
||||
through OpenAL.
|
||||
|
||||
You need to specify the name of the device to capture in the provided
|
||||
filename. If the empty string is provided, the device will
|
||||
automatically select the default device. You can get the list of the
|
||||
supported devices by using the option @var{list_devices}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item channels
|
||||
Set the number of channels in the captured audio. Only the values
|
||||
@option{1} (monaural) and @option{2} (stereo) are currently supported.
|
||||
Defaults to @option{2}.
|
||||
|
||||
@item sample_size
|
||||
Set the sample size (in bits) of the captured audio. Only the values
|
||||
@option{8} and @option{16} are currently supported. Defaults to
|
||||
@option{16}.
|
||||
|
||||
@item sample_rate
|
||||
Set the sample rate (in Hz) of the captured audio.
|
||||
Defaults to @option{44.1k}.
|
||||
|
||||
@item list_devices
|
||||
If set to @option{true}, print a list of devices and exit.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
Print the list of OpenAL supported devices and exit:
|
||||
@example
|
||||
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
|
||||
@end example
|
||||
|
||||
Capture from the OpenAL device @file{DR-BT101 via PulseAudio}:
|
||||
@example
|
||||
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
|
||||
@end example
|
||||
|
||||
Capture from the default device (note the empty string '' as filename):
|
||||
@example
|
||||
$ ffmpeg -f openal -i '' out.ogg
|
||||
@end example
|
||||
|
||||
Capture from two devices simultaneously, writing to two different files,
|
||||
within the same @file{ffmpeg} command:
|
||||
@example
|
||||
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
|
||||
@end example
|
||||
Note: not all OpenAL implementations support multiple simultaneous capture -
|
||||
try the latest OpenAL Soft if the above does not work.
|
||||
|
||||
@section oss
|
||||
|
||||
Open Sound System input device.
|
||||
|
|
@ -248,7 +337,46 @@ For example to grab from @file{:0.0} using @file{ffmpeg}:
|
|||
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
|
||||
|
||||
# Grab at position 10,20.
|
||||
ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
|
||||
ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
|
||||
@end example
|
||||
|
||||
@subsection @var{follow_mouse} AVOption
|
||||
|
||||
The syntax is:
|
||||
@example
|
||||
-follow_mouse centered|@var{PIXELS}
|
||||
@end example
|
||||
|
||||
When it is specified with "centered", the grabbing region follows the mouse
|
||||
pointer and keeps the pointer at the center of region; otherwise, the region
|
||||
follows only when the mouse pointer reaches within @var{PIXELS} (greater than
|
||||
zero) to the edge of region.
|
||||
|
||||
For example:
|
||||
@example
|
||||
ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
|
||||
|
||||
# Follows only when the mouse pointer reaches within 100 pixels to edge
|
||||
ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
|
||||
@end example
|
||||
|
||||
@subsection @var{show_region} AVOption
|
||||
|
||||
The syntax is:
|
||||
@example
|
||||
-show_region 1
|
||||
@end example
|
||||
|
||||
If @var{show_region} AVOption is specified with @var{1}, then the grabbing
|
||||
region will be indicated on screen. With this option, it's easy to know what is
|
||||
being grabbed if only a portion of the screen is grabbed.
|
||||
|
||||
For example:
|
||||
@example
|
||||
ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
|
||||
|
||||
# With follow_mouse
|
||||
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
|
||||
@end example
|
||||
|
||||
@c man end INPUT DEVICES
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ and the input video converted to MPEG-2 video, use the command:
|
|||
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
|
||||
@end example
|
||||
|
||||
See also the @code{framecrc} muxer (@pxref{framecrc}).
|
||||
See also the @ref{framecrc} muxer.
|
||||
|
||||
@anchor{framecrc}
|
||||
@section framecrc
|
||||
|
|
@ -88,7 +88,7 @@ MPEG-2 video, use the command:
|
|||
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
|
||||
@end example
|
||||
|
||||
See also the @code{crc} muxer (@pxref{crc}).
|
||||
See also the @ref{crc} muxer.
|
||||
|
||||
@section image2
|
||||
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ data transferred over RDT).
|
|||
|
||||
The muxer can be used to send a stream using RTSP ANNOUNCE to a server
|
||||
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
|
||||
RTSP server, @url{http://github.com/revmischa/rtsp-server}).
|
||||
@uref{http://github.com/revmischa/rtsp-server, RTSP server}).
|
||||
|
||||
The required syntax for a RTSP url is:
|
||||
@example
|
||||
|
|
|
|||
|
|
@ -352,6 +352,7 @@ sub postprocess
|
|||
s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
|
||||
s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
|
||||
s/;\s+\@pxref\{(?:[^\}]*)\}//g;
|
||||
s/\@ref\{([^\}]*)\}/$1/g;
|
||||
s/\@noindent\s*//g;
|
||||
s/\@refill//g;
|
||||
s/\@gol//g;
|
||||
|
|
|
|||
111
ffplay.c
111
ffplay.c
|
|
@ -25,8 +25,10 @@
|
|||
#include <limits.h>
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/colorspace.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
#include "libavutil/avassert.h"
|
||||
|
|
@ -211,7 +213,7 @@ typedef struct VideoState {
|
|||
int refresh;
|
||||
} VideoState;
|
||||
|
||||
static void show_help(void);
|
||||
static int opt_help(const char *opt, const char *arg);
|
||||
|
||||
/* options specified by the user */
|
||||
static AVInputFormat *file_iformat;
|
||||
|
|
@ -221,9 +223,6 @@ static int fs_screen_width;
|
|||
static int fs_screen_height;
|
||||
static int screen_width = 0;
|
||||
static int screen_height = 0;
|
||||
static int frame_width = 0;
|
||||
static int frame_height = 0;
|
||||
static enum PixelFormat frame_pix_fmt = PIX_FMT_NONE;
|
||||
static int audio_disable;
|
||||
static int video_disable;
|
||||
static int wanted_stream[AVMEDIA_TYPE_NB]={
|
||||
|
|
@ -1429,7 +1428,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
|
|||
|
||||
static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt)
|
||||
{
|
||||
int len1 av_unused, got_picture, i;
|
||||
int got_picture, i;
|
||||
|
||||
if (packet_queue_get(&is->videoq, pkt, 1) < 0)
|
||||
return -1;
|
||||
|
|
@ -1456,9 +1455,7 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
|
|||
return 0;
|
||||
}
|
||||
|
||||
len1 = avcodec_decode_video2(is->video_st->codec,
|
||||
frame, &got_picture,
|
||||
pkt);
|
||||
avcodec_decode_video2(is->video_st->codec, frame, &got_picture, pkt);
|
||||
|
||||
if (got_picture) {
|
||||
if (decoder_reorder_pts == -1) {
|
||||
|
|
@ -1655,6 +1652,7 @@ static int input_config_props(AVFilterLink *link)
|
|||
|
||||
link->w = c->width;
|
||||
link->h = c->height;
|
||||
link->sample_aspect_ratio = priv->is->video_st->sample_aspect_ratio;
|
||||
link->time_base = priv->is->video_st->time_base;
|
||||
|
||||
return 0;
|
||||
|
|
@ -1690,10 +1688,10 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
|
|||
|
||||
if ((ret = avfilter_graph_create_filter(&filt_src, &input_filter, "src",
|
||||
NULL, is, graph)) < 0)
|
||||
goto the_end;
|
||||
return ret;
|
||||
if ((ret = avfilter_graph_create_filter(&filt_out, avfilter_get_by_name("buffersink"), "out",
|
||||
NULL, pix_fmts, graph)) < 0)
|
||||
goto the_end;
|
||||
return ret;
|
||||
|
||||
if(vfilters) {
|
||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||
|
|
@ -1710,18 +1708,18 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
|
|||
inputs->next = NULL;
|
||||
|
||||
if ((ret = avfilter_graph_parse(graph, vfilters, &inputs, &outputs, NULL)) < 0)
|
||||
goto the_end;
|
||||
return ret;
|
||||
av_freep(&vfilters);
|
||||
} else {
|
||||
if ((ret = avfilter_link(filt_src, 0, filt_out, 0)) < 0)
|
||||
goto the_end;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = avfilter_graph_config(graph, NULL)) < 0)
|
||||
goto the_end;
|
||||
return ret;
|
||||
|
||||
is->out_video_filter = filt_out;
|
||||
the_end:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1805,7 +1803,7 @@ static int subtitle_thread(void *arg)
|
|||
VideoState *is = arg;
|
||||
SubPicture *sp;
|
||||
AVPacket pkt1, *pkt = &pkt1;
|
||||
int len1 av_unused, got_subtitle;
|
||||
int got_subtitle;
|
||||
double pts;
|
||||
int i, j;
|
||||
int r, g, b, y, u, v, a;
|
||||
|
|
@ -1829,7 +1827,7 @@ static int subtitle_thread(void *arg)
|
|||
SDL_UnlockMutex(is->subpq_mutex);
|
||||
|
||||
if (is->subtitleq.abort_request)
|
||||
goto the_end;
|
||||
return 0;
|
||||
|
||||
sp = &is->subpq[is->subpq_windex];
|
||||
|
||||
|
|
@ -1839,9 +1837,9 @@ static int subtitle_thread(void *arg)
|
|||
if (pkt->pts != AV_NOPTS_VALUE)
|
||||
pts = av_q2d(is->subtitle_st->time_base)*pkt->pts;
|
||||
|
||||
len1 = avcodec_decode_subtitle2(is->subtitle_st->codec,
|
||||
&sp->sub, &got_subtitle,
|
||||
pkt);
|
||||
avcodec_decode_subtitle2(is->subtitle_st->codec, &sp->sub,
|
||||
&got_subtitle, pkt);
|
||||
|
||||
if (got_subtitle && sp->sub.format == 0) {
|
||||
sp->pts = pts;
|
||||
|
||||
|
|
@ -1866,7 +1864,6 @@ static int subtitle_thread(void *arg)
|
|||
}
|
||||
av_free_packet(pkt);
|
||||
}
|
||||
the_end:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -2112,11 +2109,15 @@ static int stream_component_open(VideoState *is, int stream_index)
|
|||
AVCodecContext *avctx;
|
||||
AVCodec *codec;
|
||||
SDL_AudioSpec wanted_spec, spec;
|
||||
AVDictionary *opts;
|
||||
AVDictionaryEntry *t = NULL;
|
||||
|
||||
if (stream_index < 0 || stream_index >= ic->nb_streams)
|
||||
return -1;
|
||||
avctx = ic->streams[stream_index]->codec;
|
||||
|
||||
opts = filter_codec_opts(codec_opts, avctx->codec_id, 0);
|
||||
|
||||
/* prepare audio output */
|
||||
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
if (avctx->channels > 0) {
|
||||
|
|
@ -2142,13 +2143,16 @@ static int stream_component_open(VideoState *is, int stream_index)
|
|||
avctx->error_concealment= error_concealment;
|
||||
avctx->thread_count= thread_count;
|
||||
|
||||
set_context_opts(avctx, avcodec_opts[avctx->codec_type], 0, codec);
|
||||
|
||||
if(codec->capabilities & CODEC_CAP_DR1)
|
||||
avctx->flags |= CODEC_FLAG_EMU_EDGE;
|
||||
|
||||
if (avcodec_open(avctx, codec) < 0)
|
||||
if (!codec ||
|
||||
avcodec_open2(avctx, codec, &opts) < 0)
|
||||
return -1;
|
||||
if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* prepare audio output */
|
||||
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
|
|
@ -2295,15 +2299,15 @@ static int decode_interrupt_cb(void)
|
|||
static int read_thread(void *arg)
|
||||
{
|
||||
VideoState *is = arg;
|
||||
AVFormatContext *ic;
|
||||
AVFormatContext *ic = NULL;
|
||||
int err, i, ret;
|
||||
int st_index[AVMEDIA_TYPE_NB];
|
||||
AVPacket pkt1, *pkt = &pkt1;
|
||||
AVFormatParameters params, *ap = ¶ms;
|
||||
int eof=0;
|
||||
int pkt_in_play_range = 0;
|
||||
|
||||
ic = avformat_alloc_context();
|
||||
AVDictionaryEntry *t;
|
||||
AVDictionary **opts;
|
||||
int orig_nb_streams;
|
||||
|
||||
memset(st_index, -1, sizeof(st_index));
|
||||
is->video_stream = -1;
|
||||
|
|
@ -2313,41 +2317,35 @@ static int read_thread(void *arg)
|
|||
global_video_state = is;
|
||||
avio_set_interrupt_cb(decode_interrupt_cb);
|
||||
|
||||
memset(ap, 0, sizeof(*ap));
|
||||
|
||||
ap->prealloced_context = 1;
|
||||
ap->width = frame_width;
|
||||
ap->height= frame_height;
|
||||
ap->time_base= (AVRational){1, 25};
|
||||
ap->pix_fmt = frame_pix_fmt;
|
||||
ic->flags |= AVFMT_FLAG_PRIV_OPT;
|
||||
|
||||
|
||||
err = av_open_input_file(&ic, is->filename, is->iformat, 0, ap);
|
||||
if (err >= 0) {
|
||||
set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL);
|
||||
err = av_demuxer_open(ic, ap);
|
||||
if(err < 0){
|
||||
avformat_free_context(ic);
|
||||
ic= NULL;
|
||||
}
|
||||
}
|
||||
err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);
|
||||
if (err < 0) {
|
||||
print_error(is->filename, err);
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
|
||||
ret = AVERROR_OPTION_NOT_FOUND;
|
||||
goto fail;
|
||||
}
|
||||
is->ic = ic;
|
||||
|
||||
if(genpts)
|
||||
ic->flags |= AVFMT_FLAG_GENPTS;
|
||||
|
||||
err = av_find_stream_info(ic);
|
||||
opts = setup_find_stream_info_opts(ic, codec_opts);
|
||||
orig_nb_streams = ic->nb_streams;
|
||||
|
||||
err = avformat_find_stream_info(ic, opts);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "%s: could not find codec parameters\n", is->filename);
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
for (i = 0; i < orig_nb_streams; i++)
|
||||
av_dict_free(&opts[i]);
|
||||
av_freep(&opts);
|
||||
|
||||
if(ic->pb)
|
||||
ic->pb->eof_reached= 0; //FIXME hack, ffplay maybe should not use url_feof() to test for the end
|
||||
|
||||
|
|
@ -2813,15 +2811,8 @@ static void event_loop(void)
|
|||
|
||||
static int opt_frame_size(const char *opt, const char *arg)
|
||||
{
|
||||
if (av_parse_video_size(&frame_width, &frame_height, arg) < 0) {
|
||||
fprintf(stderr, "Incorrect frame size\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if ((frame_width % 2) != 0 || (frame_height % 2) != 0) {
|
||||
fprintf(stderr, "Frame size must be a multiple of 2\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
return 0;
|
||||
av_log(NULL, AV_LOG_WARNING, "Option -s is deprecated, use -video_size.\n");
|
||||
return opt_default("video_size", arg);
|
||||
}
|
||||
|
||||
static int opt_width(const char *opt, const char *arg)
|
||||
|
|
@ -2848,8 +2839,8 @@ static int opt_format(const char *opt, const char *arg)
|
|||
|
||||
static int opt_frame_pix_fmt(const char *opt, const char *arg)
|
||||
{
|
||||
frame_pix_fmt = av_get_pix_fmt(arg);
|
||||
return 0;
|
||||
av_log(NULL, AV_LOG_WARNING, "Option -pix_fmt is deprecated, use -pixel_format.\n");
|
||||
return opt_default("pixel_format", arg);
|
||||
}
|
||||
|
||||
static int opt_sync(const char *opt, const char *arg)
|
||||
|
|
@ -2964,7 +2955,7 @@ static void show_usage(void)
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
av_log_set_callback(log_callback_help);
|
||||
show_usage();
|
||||
|
|
@ -2996,6 +2987,7 @@ static void show_help(void)
|
|||
"down/up seek backward/forward 1 minute\n"
|
||||
"mouse click seek to percentage in file corresponding to fraction of width\n"
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Called from the main */
|
||||
|
|
@ -3039,6 +3031,7 @@ int main(int argc, char **argv)
|
|||
#endif
|
||||
if (SDL_Init (flags)) {
|
||||
fprintf(stderr, "Could not initialize SDL - %s\n", SDL_GetError());
|
||||
fprintf(stderr, "(Did you set the DISPLAY variable?)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
coder=0
|
||||
bf=0
|
||||
flags2=-wpred-dct8x8
|
||||
wpredp=0
|
||||
12
ffprobe.c
12
ffprobe.c
|
|
@ -143,6 +143,7 @@ static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)
|
|||
printf("pos=%"PRId64"\n" , pkt->pos);
|
||||
printf("flags=%c\n" , pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_');
|
||||
printf("[/PACKET]\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static void show_packets(AVFormatContext *fmt_ctx)
|
||||
|
|
@ -201,6 +202,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
|
|||
}
|
||||
printf("pix_fmt=%s\n", dec_ctx->pix_fmt != PIX_FMT_NONE ?
|
||||
av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
|
||||
printf("level=%d\n", dec_ctx->level);
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
|
|
@ -231,6 +233,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
|
|||
printf("TAG:%s=%s\n", tag->key, tag->value);
|
||||
|
||||
printf("[/STREAM]\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static void show_format(AVFormatContext *fmt_ctx)
|
||||
|
|
@ -257,6 +260,7 @@ static void show_format(AVFormatContext *fmt_ctx)
|
|||
printf("TAG:%s=%s\n", tag->key, tag->value);
|
||||
|
||||
printf("[/FORMAT]\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
|
||||
|
|
@ -291,7 +295,7 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
|
|||
if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
|
||||
fprintf(stderr, "Unsupported codec with id %d for input stream %d\n",
|
||||
stream->codec->codec_id, stream->index);
|
||||
} else if (avcodec_open(stream->codec, codec) < 0) {
|
||||
} else if (avcodec_open2(stream->codec, codec, NULL) < 0) {
|
||||
fprintf(stderr, "Error while opening codec for input stream %d\n",
|
||||
stream->index);
|
||||
}
|
||||
|
|
@ -353,7 +357,7 @@ static int opt_input_file(const char *opt, const char *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
av_log_set_callback(log_callback_help);
|
||||
show_usage();
|
||||
|
|
@ -361,14 +365,16 @@ static void show_help(void)
|
|||
printf("\n");
|
||||
av_opt_show2(avformat_opts, NULL,
|
||||
AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void opt_pretty(void)
|
||||
static int opt_pretty(const char *opt, const char *arg)
|
||||
{
|
||||
show_value_unit = 1;
|
||||
use_value_prefix = 1;
|
||||
use_byte_value_binary_prefix = 1;
|
||||
use_value_sexagesimal_format = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const OptionDef options[] = {
|
||||
|
|
|
|||
36
ffserver.c
36
ffserver.c
|
|
@ -37,6 +37,7 @@
|
|||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/lfg.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/random_seed.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavcodec/opt.h"
|
||||
|
|
@ -2118,7 +2119,7 @@ static void open_parser(AVFormatContext *s, int i)
|
|||
codec = avcodec_find_decoder(st->codec->codec_id);
|
||||
if (codec && (codec->capabilities & CODEC_CAP_PARSE_ONLY)) {
|
||||
st->codec->parse_only = 1;
|
||||
if (avcodec_open(st->codec, codec) < 0)
|
||||
if (avcodec_open2(st->codec, codec, NULL) < 0)
|
||||
st->codec->parse_only = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -2129,13 +2130,12 @@ static int open_input_stream(HTTPContext *c, const char *info)
|
|||
char buf[128];
|
||||
char input_filename[1024];
|
||||
AVFormatContext *s = NULL;
|
||||
int buf_size, i, ret;
|
||||
int i, ret;
|
||||
int64_t stream_pos;
|
||||
|
||||
/* find file name */
|
||||
if (c->stream->feed) {
|
||||
strcpy(input_filename, c->stream->feed->feed_filename);
|
||||
buf_size = FFM_PACKET_SIZE;
|
||||
/* compute position (absolute time) */
|
||||
if (av_find_info_tag(buf, sizeof(buf), "date", info)) {
|
||||
if ((ret = av_parse_time(&stream_pos, buf, 0)) < 0)
|
||||
|
|
@ -2147,7 +2147,6 @@ static int open_input_stream(HTTPContext *c, const char *info)
|
|||
stream_pos = av_gettime() - c->stream->prebuffer * (int64_t)1000;
|
||||
} else {
|
||||
strcpy(input_filename, c->stream->feed_filename);
|
||||
buf_size = 0;
|
||||
/* compute position (relative time) */
|
||||
if (av_find_info_tag(buf, sizeof(buf), "date", info)) {
|
||||
if ((ret = av_parse_time(&stream_pos, buf, 1)) < 0)
|
||||
|
|
@ -3472,7 +3471,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop
|
|||
if (!fst)
|
||||
return NULL;
|
||||
if (copy) {
|
||||
fst->codec= avcodec_alloc_context();
|
||||
fst->codec = avcodec_alloc_context3(NULL);
|
||||
memcpy(fst->codec, codec, sizeof(AVCodecContext));
|
||||
if (codec->extradata_size) {
|
||||
fst->codec->extradata = av_malloc(codec->extradata_size);
|
||||
|
|
@ -3512,7 +3511,7 @@ static int add_av_stream(FFStream *feed, AVStream *st)
|
|||
case AVMEDIA_TYPE_AUDIO:
|
||||
if (av1->channels == av->channels &&
|
||||
av1->sample_rate == av->sample_rate)
|
||||
goto found;
|
||||
return i;
|
||||
break;
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
if (av1->width == av->width &&
|
||||
|
|
@ -3520,7 +3519,7 @@ static int add_av_stream(FFStream *feed, AVStream *st)
|
|||
av1->time_base.den == av->time_base.den &&
|
||||
av1->time_base.num == av->time_base.num &&
|
||||
av1->gop_size == av->gop_size)
|
||||
goto found;
|
||||
return i;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
|
|
@ -3532,8 +3531,6 @@ static int add_av_stream(FFStream *feed, AVStream *st)
|
|||
if (!fst)
|
||||
return -1;
|
||||
return feed->nb_streams - 1;
|
||||
found:
|
||||
return i;
|
||||
}
|
||||
|
||||
static void remove_stream(FFStream *stream)
|
||||
|
|
@ -3650,18 +3647,6 @@ static void build_feed_streams(void)
|
|||
FFStream *stream, *feed;
|
||||
int i;
|
||||
|
||||
/* gather all streams */
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
feed = stream->feed;
|
||||
if (feed) {
|
||||
if (!stream->is_feed) {
|
||||
/* we handle a stream coming from a feed */
|
||||
for(i=0;i<stream->nb_streams;i++)
|
||||
stream->feed_streams[i] = add_av_stream(feed, stream->streams[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* gather all streams */
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
feed = stream->feed;
|
||||
|
|
@ -3669,6 +3654,10 @@ static void build_feed_streams(void)
|
|||
if (stream->is_feed) {
|
||||
for(i=0;i<stream->nb_streams;i++)
|
||||
stream->feed_streams[i] = i;
|
||||
} else {
|
||||
/* we handle a stream coming from a feed */
|
||||
for(i=0;i<stream->nb_streams;i++)
|
||||
stream->feed_streams[i] = add_av_stream(feed, stream->streams[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3894,7 +3883,7 @@ static void add_codec(FFStream *stream, AVCodecContext *av)
|
|||
st = av_mallocz(sizeof(AVStream));
|
||||
if (!st)
|
||||
return;
|
||||
st->codec = avcodec_alloc_context();
|
||||
st->codec = avcodec_alloc_context3(NULL);
|
||||
stream->streams[stream->nb_streams++] = st;
|
||||
memcpy(st->codec, av, sizeof(AVCodecContext));
|
||||
}
|
||||
|
|
@ -4662,12 +4651,13 @@ static void opt_debug(void)
|
|||
logfilename[0] = '-';
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
printf("usage: ffserver [options]\n"
|
||||
"Hyper fast multi format Audio/Video streaming server\n");
|
||||
printf("\n");
|
||||
show_help_options(options, "Main options:\n", 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const OptionDef options[] = {
|
||||
|
|
|
|||
28
ffserver.h
28
ffserver.h
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Multiple format streaming server
|
||||
* copyright (c) 2002 Fabrice Bellard
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#ifndef FFMPEG_FFSERVER_H
|
||||
#define FFMPEG_FFSERVER_H
|
||||
|
||||
/* interface between ffserver and modules */
|
||||
|
||||
void ffserver_module_init(void);
|
||||
|
||||
#endif /* FFMPEG_FFSERVER_H */
|
||||
|
|
@ -865,15 +865,14 @@ static av_cold int decode_end(AVCodecContext *avctx){
|
|||
}
|
||||
|
||||
AVCodec ff_fourxm_decoder = {
|
||||
"4xm",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
CODEC_ID_4XM,
|
||||
sizeof(FourXContext),
|
||||
decode_init,
|
||||
NULL,
|
||||
decode_end,
|
||||
decode_frame,
|
||||
CODEC_CAP_DR1,
|
||||
.name = "4xm",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = CODEC_ID_4XM,
|
||||
.priv_data_size = sizeof(FourXContext),
|
||||
.init = decode_init,
|
||||
.close = decode_end,
|
||||
.decode = decode_frame,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("4X Movie"),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -221,14 +221,13 @@ static av_cold int decode_end(AVCodecContext *avctx)
|
|||
|
||||
|
||||
AVCodec ff_eightbps_decoder = {
|
||||
"8bps",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
CODEC_ID_8BPS,
|
||||
sizeof(EightBpsContext),
|
||||
decode_init,
|
||||
NULL,
|
||||
decode_end,
|
||||
decode_frame,
|
||||
CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
|
||||
.name = "8bps",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = CODEC_ID_8BPS,
|
||||
.priv_data_size = sizeof(EightBpsContext),
|
||||
.init = decode_init,
|
||||
.close = decode_end,
|
||||
.decode = decode_frame,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
/**
|
||||
* @file
|
||||
* 8svx audio decoder
|
||||
* @author Jaikrishnan Menon
|
||||
*
|
||||
* supports: fibonacci delta encoding
|
||||
* : exponential encoding
|
||||
*
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ OBJS-$(CONFIG_AURA2_DECODER) += aura.o
|
|||
OBJS-$(CONFIG_AVS_DECODER) += avs.o
|
||||
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
|
||||
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
|
||||
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkidct.o
|
||||
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkdsp.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER) += binkaudio.o wma.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER) += binkaudio.o wma.o
|
||||
OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
|
||||
|
|
@ -128,9 +128,9 @@ OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
|
|||
OBJS-$(CONFIG_DVVIDEO_DECODER) += dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3dec_data.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
|
||||
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o ac3enc.o ac3enc_float.o \
|
||||
ac3tab.o ac3.o kbdwin.o
|
||||
ac3tab.o ac3.o kbdwin.o eac3_data.o
|
||||
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
|
||||
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
|
||||
mpeg12data.o mpegvideo.o \
|
||||
|
|
@ -154,6 +154,7 @@ OBJS-$(CONFIG_FLAC_ENCODER) += flacenc.o flacdata.o flac.o vorbis_dat
|
|||
OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
|
||||
OBJS-$(CONFIG_FLASHSV_ENCODER) += flashsvenc.o
|
||||
OBJS-$(CONFIG_FLASHSV2_ENCODER) += flashsv2enc.o
|
||||
OBJS-$(CONFIG_FLASHSV2_DECODER) += flashsv.o
|
||||
OBJS-$(CONFIG_FLIC_DECODER) += flicvideo.o
|
||||
OBJS-$(CONFIG_FOURXM_DECODER) += 4xm.o
|
||||
OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
|
||||
|
|
@ -551,6 +552,7 @@ OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
|||
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
|
||||
flacdec.o flacdata.o flac.o \
|
||||
mpegaudiodata.o vorbis_data.o
|
||||
OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
|
||||
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o
|
||||
|
|
@ -667,7 +669,7 @@ OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
|
|||
# well.
|
||||
OBJS-$(!CONFIG_SMALL) += inverse.o
|
||||
|
||||
-include $(SUBDIR)$(ARCH)/Makefile
|
||||
-include $(SRC_PATH)/$(SUBDIR)$(ARCH)/Makefile
|
||||
|
||||
SKIPHEADERS += %_tablegen.h \
|
||||
%_tables.h \
|
||||
|
|
@ -694,7 +696,7 @@ DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
|
|||
|
||||
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
|
||||
|
||||
include $(SUBDIR)../subdir.mak
|
||||
include $(SRC_PATH)/subdir.mak
|
||||
|
||||
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
|
||||
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ typedef struct {
|
|||
DynamicRangeControl che_drc;
|
||||
|
||||
/**
|
||||
* @defgroup elements Channel element related data.
|
||||
* @name Channel element related data
|
||||
* @{
|
||||
*/
|
||||
enum ChannelPosition che_pos[4][MAX_ELEM_ID]; /**< channel element channel mapping with the
|
||||
|
|
@ -270,14 +270,15 @@ typedef struct {
|
|||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup temporary aligned temporary buffers (We do not want to have these on the stack.)
|
||||
* @name temporary aligned temporary buffers
|
||||
* (We do not want to have these on the stack.)
|
||||
* @{
|
||||
*/
|
||||
DECLARE_ALIGNED(32, float, buf_mdct)[1024];
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup tables Computed / set up during initialization.
|
||||
* @name Computed / set up during initialization
|
||||
* @{
|
||||
*/
|
||||
FFTContext mdct;
|
||||
|
|
@ -289,7 +290,7 @@ typedef struct {
|
|||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup output Members used for output interleaving.
|
||||
* @name Members used for output interleaving
|
||||
* @{
|
||||
*/
|
||||
float *output_data[MAX_CHANNELS]; ///< Points to each element's 'ret' buffer (PCM output).
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce
|
|||
float cost_stay_here, cost_get_here;
|
||||
float rd = 0.0f;
|
||||
for (w = 0; w < group_len; w++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(win+w)*16+swb];
|
||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(win+w)*16+swb];
|
||||
rd += quantize_band_cost(s, sce->coeffs + start + w*128,
|
||||
s->scoefs + start + w*128, size,
|
||||
sce->sf_idx[(win+w)*16+swb], cb,
|
||||
|
|
@ -433,10 +433,26 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
|
|||
for (swb = 0; swb < max_sfb; swb++) {
|
||||
size = sce->ics.swb_sizes[swb];
|
||||
if (sce->zeroes[win*16 + swb]) {
|
||||
for (cb = 0; cb < 12; cb++) {
|
||||
path[swb+1][cb].prev_idx = cb;
|
||||
path[swb+1][cb].cost = path[swb][cb].cost;
|
||||
path[swb+1][cb].run = path[swb][cb].run + 1;
|
||||
float cost_stay_here = path[swb][0].cost;
|
||||
float cost_get_here = next_minrd + run_bits + 4;
|
||||
if ( run_value_bits[sce->ics.num_windows == 8][path[swb][0].run]
|
||||
!= run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1])
|
||||
cost_stay_here += run_bits;
|
||||
if (cost_get_here < cost_stay_here) {
|
||||
path[swb+1][0].prev_idx = next_mincb;
|
||||
path[swb+1][0].cost = cost_get_here;
|
||||
path[swb+1][0].run = 1;
|
||||
} else {
|
||||
path[swb+1][0].prev_idx = 0;
|
||||
path[swb+1][0].cost = cost_stay_here;
|
||||
path[swb+1][0].run = path[swb][0].run + 1;
|
||||
}
|
||||
next_minrd = path[swb+1][0].cost;
|
||||
next_mincb = 0;
|
||||
for (cb = 1; cb < 12; cb++) {
|
||||
path[swb+1][cb].cost = 61450;
|
||||
path[swb+1][cb].prev_idx = -1;
|
||||
path[swb+1][cb].run = 0;
|
||||
}
|
||||
} else {
|
||||
float minrd = next_minrd;
|
||||
|
|
@ -610,7 +626,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
|||
qmin = INT_MAX;
|
||||
qmax = 0.0f;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
||||
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
||||
sce->zeroes[(w+w2)*16+g] = 1;
|
||||
continue;
|
||||
|
|
@ -639,7 +655,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
|||
float dist = 0;
|
||||
int cb = find_min_book(maxval, sce->sf_idx[w*16+g]);
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
||||
dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g],
|
||||
q + q0, cb, lambda / band->threshold, INFINITY, NULL);
|
||||
}
|
||||
|
|
@ -712,7 +728,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
|
|||
int nz = 0;
|
||||
float uplim = 0.0f;
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
||||
uplim += band->threshold;
|
||||
if (band->energy <= band->threshold || band->threshold == 0.0f) {
|
||||
sce->zeroes[(w+w2)*16+g] = 1;
|
||||
|
|
@ -1012,7 +1028,7 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s,
|
|||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g];
|
||||
if (band->energy <= band->threshold) {
|
||||
sce->sf_idx[(w+w2)*16+g] = 218;
|
||||
sce->zeroes[(w+w2)*16+g] = 1;
|
||||
|
|
@ -1050,8 +1066,8 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
|
|||
if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) {
|
||||
float dist1 = 0.0f, dist2 = 0.0f;
|
||||
for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) {
|
||||
FFPsyBand *band0 = &s->psy.psy_bands[(s->cur_channel+0)*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
FFPsyBand *band1 = &s->psy.psy_bands[(s->cur_channel+1)*PSY_MAX_BANDS+(w+w2)*16+g];
|
||||
FFPsyBand *band0 = &s->psy.ch[s->cur_channel+0].psy_bands[(w+w2)*16+g];
|
||||
FFPsyBand *band1 = &s->psy.ch[s->cur_channel+1].psy_bands[(w+w2)*16+g];
|
||||
float minthr = FFMIN(band0->threshold, band1->threshold);
|
||||
float maxthr = FFMAX(band0->threshold, band1->threshold);
|
||||
for (i = 0; i < sce0->ics.swb_sizes[g]; i++) {
|
||||
|
|
|
|||
|
|
@ -532,6 +532,22 @@ static void reset_all_predictors(PredictorState *ps)
|
|||
reset_predict_state(&ps[i]);
|
||||
}
|
||||
|
||||
static int sample_rate_idx (int rate)
|
||||
{
|
||||
if (92017 <= rate) return 0;
|
||||
else if (75132 <= rate) return 1;
|
||||
else if (55426 <= rate) return 2;
|
||||
else if (46009 <= rate) return 3;
|
||||
else if (37566 <= rate) return 4;
|
||||
else if (27713 <= rate) return 5;
|
||||
else if (23004 <= rate) return 6;
|
||||
else if (18783 <= rate) return 7;
|
||||
else if (13856 <= rate) return 8;
|
||||
else if (11502 <= rate) return 9;
|
||||
else if (9391 <= rate) return 10;
|
||||
else return 11;
|
||||
}
|
||||
|
||||
static void reset_predictor_group(PredictorState *ps, int group_num)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -558,6 +574,26 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
|||
avctx->extradata,
|
||||
avctx->extradata_size) < 0)
|
||||
return -1;
|
||||
} else {
|
||||
int sr, i;
|
||||
enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];
|
||||
|
||||
sr = sample_rate_idx(avctx->sample_rate);
|
||||
ac->m4ac.sampling_index = sr;
|
||||
ac->m4ac.channels = avctx->channels;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(ff_mpeg4audio_channels); i++)
|
||||
if (ff_mpeg4audio_channels[i] == avctx->channels)
|
||||
break;
|
||||
if (i == FF_ARRAY_ELEMS(ff_mpeg4audio_channels)) {
|
||||
i = 0;
|
||||
}
|
||||
ac->m4ac.chan_config = i;
|
||||
|
||||
if (ac->m4ac.chan_config) {
|
||||
set_default_channel_config(avctx, new_che_pos, ac->m4ac.chan_config);
|
||||
output_configure(ac, ac->che_pos, new_che_pos, ac->m4ac.chan_config, OC_GLOBAL_HDR);
|
||||
}
|
||||
}
|
||||
|
||||
if (avctx->request_sample_fmt == AV_SAMPLE_FMT_FLT) {
|
||||
|
|
@ -1755,12 +1791,10 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
|
|||
} else {
|
||||
memset(in, 0, 448 * sizeof(float));
|
||||
ac->dsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
|
||||
memcpy(in + 576, in + 576, 448 * sizeof(float));
|
||||
}
|
||||
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
|
||||
ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
} else {
|
||||
memcpy(in + 1024, in + 1024, 448 * sizeof(float));
|
||||
ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
memset(in + 1024 + 576, 0, 448 * sizeof(float));
|
||||
}
|
||||
|
|
@ -2049,6 +2083,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
|
|||
if (output_configure(ac, ac->che_pos, new_che_pos, hdr_info.chan_config, OC_TRIAL_FRAME))
|
||||
return -7;
|
||||
} else if (ac->output_configured != OC_LOCKED) {
|
||||
ac->m4ac.chan_config = 0;
|
||||
ac->output_configured = OC_NONE;
|
||||
}
|
||||
if (ac->output_configured != OC_LOCKED) {
|
||||
|
|
@ -2504,18 +2539,18 @@ av_cold static int latm_decode_init(AVCodecContext *avctx)
|
|||
|
||||
|
||||
AVCodec ff_aac_decoder = {
|
||||
"aac",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_AAC,
|
||||
sizeof(AACContext),
|
||||
aac_decode_init,
|
||||
NULL,
|
||||
aac_decode_close,
|
||||
aac_decode_frame,
|
||||
.name = "aac",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_AAC,
|
||||
.priv_data_size = sizeof(AACContext),
|
||||
.init = aac_decode_init,
|
||||
.close = aac_decode_close,
|
||||
.decode = aac_decode_frame,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
|
||||
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
.capabilities = CODEC_CAP_CHANNEL_CONF,
|
||||
.channel_layouts = aac_channel_layout,
|
||||
};
|
||||
|
||||
|
|
@ -2536,5 +2571,6 @@ AVCodec ff_aac_latm_decoder = {
|
|||
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
.capabilities = CODEC_CAP_CHANNEL_CONF,
|
||||
.channel_layouts = aac_channel_layout,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -208,8 +208,9 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
|||
ff_init_ff_sine_windows(10);
|
||||
ff_init_ff_sine_windows(7);
|
||||
|
||||
s->chan_map = aac_chan_configs[avctx->channels-1];
|
||||
s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));
|
||||
s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);
|
||||
s->cpe = av_mallocz(sizeof(ChannelElement) * s->chan_map[0]);
|
||||
avctx->extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
avctx->extradata_size = 5;
|
||||
put_audio_specific_config(avctx);
|
||||
|
|
@ -218,7 +219,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
|||
sizes[1] = swb_size_128[i];
|
||||
lengths[0] = ff_aac_num_swb_1024[i];
|
||||
lengths[1] = ff_aac_num_swb_128[i];
|
||||
ff_psy_init(&s->psy, avctx, 2, sizes, lengths);
|
||||
ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], &s->chan_map[1]);
|
||||
s->psypp = ff_psy_preprocess_init(avctx);
|
||||
s->coder = &ff_aac_coders[2];
|
||||
|
||||
|
|
@ -372,7 +373,7 @@ static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, in
|
|||
if (msc == 0 || ics0->max_sfb == 0)
|
||||
cpe->ms_mode = 0;
|
||||
else
|
||||
cpe->ms_mode = msc < ics0->max_sfb ? 1 : 2;
|
||||
cpe->ms_mode = msc < ics0->max_sfb * ics0->num_windows ? 1 : 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -500,7 +501,6 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||
int16_t *samples = s->samples, *samples2, *la;
|
||||
ChannelElement *cpe;
|
||||
int i, ch, w, g, chans, tag, start_ch;
|
||||
const uint8_t *chan_map = aac_chan_configs[avctx->channels-1];
|
||||
int chan_el_counter[4];
|
||||
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
|
||||
|
||||
|
|
@ -521,8 +521,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||
} else {
|
||||
start_ch = 0;
|
||||
samples2 = s->samples + 1024 * avctx->channels;
|
||||
for (i = 0; i < chan_map[0]; i++) {
|
||||
tag = chan_map[i+1];
|
||||
for (i = 0; i < s->chan_map[0]; i++) {
|
||||
tag = s->chan_map[i+1];
|
||||
chans = tag == TYPE_CPE ? 2 : 1;
|
||||
ff_psy_preprocess(s->psypp,
|
||||
(uint16_t*)data + channel_maps[avctx->channels-1][start_ch],
|
||||
|
|
@ -538,9 +538,9 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||
}
|
||||
|
||||
start_ch = 0;
|
||||
for (i = 0; i < chan_map[0]; i++) {
|
||||
for (i = 0; i < s->chan_map[0]; i++) {
|
||||
FFPsyWindowInfo* wi = windows + start_ch;
|
||||
tag = chan_map[i+1];
|
||||
tag = s->chan_map[i+1];
|
||||
chans = tag == TYPE_CPE ? 2 : 1;
|
||||
cpe = &s->cpe[i];
|
||||
for (ch = 0; ch < chans; ch++) {
|
||||
|
|
@ -580,16 +580,19 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||
put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
|
||||
start_ch = 0;
|
||||
memset(chan_el_counter, 0, sizeof(chan_el_counter));
|
||||
for (i = 0; i < chan_map[0]; i++) {
|
||||
for (i = 0; i < s->chan_map[0]; i++) {
|
||||
FFPsyWindowInfo* wi = windows + start_ch;
|
||||
tag = chan_map[i+1];
|
||||
const float *coeffs[2];
|
||||
tag = s->chan_map[i+1];
|
||||
chans = tag == TYPE_CPE ? 2 : 1;
|
||||
cpe = &s->cpe[i];
|
||||
put_bits(&s->pb, 3, tag);
|
||||
put_bits(&s->pb, 4, chan_el_counter[tag]++);
|
||||
for (ch = 0; ch < chans; ch++)
|
||||
coeffs[ch] = cpe->ch[ch].coeffs;
|
||||
s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
|
||||
for (ch = 0; ch < chans; ch++) {
|
||||
s->cur_channel = start_ch + ch;
|
||||
s->psy.model->analyze(&s->psy, s->cur_channel, cpe->ch[ch].coeffs, &wi[ch]);
|
||||
s->cur_channel = start_ch * 2 + ch;
|
||||
s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
|
||||
}
|
||||
cpe->common_window = 0;
|
||||
|
|
@ -605,7 +608,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
|
|||
}
|
||||
}
|
||||
}
|
||||
s->cur_channel = start_ch;
|
||||
s->cur_channel = start_ch * 2;
|
||||
if (s->options.stereo_mode && cpe->common_window) {
|
||||
if (s->options.stereo_mode > 0) {
|
||||
IndividualChannelStream *ics = &cpe->ch[0].ics;
|
||||
|
|
@ -689,13 +692,13 @@ static const AVClass aacenc_class = {
|
|||
};
|
||||
|
||||
AVCodec ff_aac_encoder = {
|
||||
"aac",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_AAC,
|
||||
sizeof(AACEncContext),
|
||||
aac_encode_init,
|
||||
aac_encode_frame,
|
||||
aac_encode_end,
|
||||
.name = "aac",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_AAC,
|
||||
.priv_data_size = sizeof(AACEncContext),
|
||||
.init = aac_encode_init,
|
||||
.encode = aac_encode_frame,
|
||||
.close = aac_encode_end,
|
||||
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
|
||||
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ typedef struct AACEncContext {
|
|||
int16_t *samples; ///< saved preprocessed input
|
||||
|
||||
int samplerate_index; ///< MPEG-4 samplerate index
|
||||
const uint8_t *chan_map; ///< channel configuration map
|
||||
|
||||
ChannelElement *cpe; ///< channel elements
|
||||
FFPsyContext psy;
|
||||
|
|
|
|||
|
|
@ -69,19 +69,19 @@ static const int huff_iid[] = {
|
|||
|
||||
static VLC vlc_ps[10];
|
||||
|
||||
/**
|
||||
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/
|
||||
* Inter-channel Phase Difference/Overall Phase Difference parameters from the
|
||||
* bitstream.
|
||||
*
|
||||
* @param avctx contains the current codec context
|
||||
* @param gb pointer to the input bitstream
|
||||
* @param ps pointer to the Parametric Stereo context
|
||||
* @param par pointer to the parameter to be read
|
||||
* @param e envelope to decode
|
||||
* @param dt 1: time delta-coded, 0: frequency delta-coded
|
||||
*/
|
||||
#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \
|
||||
/** \
|
||||
* Read Inter-channel Intensity Difference/Inter-Channel Coherence/ \
|
||||
* Inter-channel Phase Difference/Overall Phase Difference parameters from the \
|
||||
* bitstream. \
|
||||
* \
|
||||
* @param avctx contains the current codec context \
|
||||
* @param gb pointer to the input bitstream \
|
||||
* @param ps pointer to the Parametric Stereo context \
|
||||
* @param PAR pointer to the parameter to be read \
|
||||
* @param e envelope to decode \
|
||||
* @param dt 1: time delta-coded, 0: frequency delta-coded \
|
||||
*/ \
|
||||
static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
|
||||
int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
|
||||
{ \
|
||||
|
|
@ -813,14 +813,17 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
|
|||
const float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
|
||||
|
||||
//Remapping
|
||||
memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
|
||||
memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
|
||||
memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
|
||||
memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
|
||||
memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
|
||||
memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
|
||||
memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
|
||||
memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
|
||||
if (ps->num_env_old) {
|
||||
memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
|
||||
memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
|
||||
memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
|
||||
memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
|
||||
memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
|
||||
memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
|
||||
memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
|
||||
memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
|
||||
}
|
||||
|
||||
if (is34) {
|
||||
remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
|
||||
remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
|
||||
|
|
|
|||
|
|
@ -377,9 +377,10 @@ static const uint8_t window_grouping[9] = {
|
|||
* Tell encoder which window types to use.
|
||||
* @see 3GPP TS26.403 5.4.1 "Blockswitching"
|
||||
*/
|
||||
static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
||||
const int16_t *audio, const int16_t *la,
|
||||
int channel, int prev_type)
|
||||
static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
|
||||
const int16_t *audio,
|
||||
const int16_t *la,
|
||||
int channel, int prev_type)
|
||||
{
|
||||
int i, j;
|
||||
int br = ctx->avctx->bit_rate / ctx->avctx->channels;
|
||||
|
|
@ -556,8 +557,8 @@ static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
|
|||
/**
|
||||
* Calculate band thresholds as suggested in 3GPP TS26.403
|
||||
*/
|
||||
static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
||||
const float *coefs, const FFPsyWindowInfo *wi)
|
||||
static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
||||
const float *coefs, const FFPsyWindowInfo *wi)
|
||||
{
|
||||
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
|
||||
AacPsyChannel *pch = &pctx->ch[channel];
|
||||
|
|
@ -626,7 +627,7 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
|||
}
|
||||
|
||||
/* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
|
||||
ctx->pe[channel] = pe;
|
||||
ctx->ch[channel].entropy = pe;
|
||||
desired_bits = calc_bit_demand(pctx, pe, ctx->bitres.bits, ctx->bitres.size, wi->num_windows == 8);
|
||||
desired_pe = PSY_3GPP_BITS_TO_PE(desired_bits);
|
||||
/* NOTE: PE correction is kept simple. During initial testing it had very
|
||||
|
|
@ -730,7 +731,7 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
|||
for (w = 0; w < wi->num_windows*16; w += 16) {
|
||||
for (g = 0; g < num_bands; g++) {
|
||||
AacPsyBand *band = &pch->band[w+g];
|
||||
FFPsyBand *psy_band = &ctx->psy_bands[channel*PSY_MAX_BANDS+w+g];
|
||||
FFPsyBand *psy_band = &ctx->ch[channel].psy_bands[w+g];
|
||||
|
||||
psy_band->threshold = band->thr;
|
||||
psy_band->energy = band->energy;
|
||||
|
|
@ -740,6 +741,16 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
|||
memcpy(pch->prev_band, pch->band, sizeof(pch->band));
|
||||
}
|
||||
|
||||
static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
|
||||
const float **coeffs, const FFPsyWindowInfo *wi)
|
||||
{
|
||||
int ch;
|
||||
FFPsyChannelGroup *group = ff_psy_find_group(ctx, channel);
|
||||
|
||||
for (ch = 0; ch < group->num_ch; ch++)
|
||||
psy_3gpp_analyze_channel(ctx, channel + ch, coeffs[ch], &wi[ch]);
|
||||
}
|
||||
|
||||
static av_cold void psy_3gpp_end(FFPsyContext *apc)
|
||||
{
|
||||
AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;
|
||||
|
|
|
|||
|
|
@ -110,14 +110,13 @@ static av_cold int aasc_decode_end(AVCodecContext *avctx)
|
|||
}
|
||||
|
||||
AVCodec ff_aasc_decoder = {
|
||||
"aasc",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
CODEC_ID_AASC,
|
||||
sizeof(AascContext),
|
||||
aasc_decode_init,
|
||||
NULL,
|
||||
aasc_decode_end,
|
||||
aasc_decode_frame,
|
||||
CODEC_CAP_DR1,
|
||||
.name = "aasc",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = CODEC_ID_AASC,
|
||||
.priv_data_size = sizeof(AascContext),
|
||||
.init = aasc_decode_init,
|
||||
.close = aasc_decode_end,
|
||||
.decode = aasc_decode_frame,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ typedef struct AC3BitAllocParameters {
|
|||
* Coded AC-3 header values up to the lfeon element, plus derived values.
|
||||
*/
|
||||
typedef struct {
|
||||
/** @defgroup coded Coded elements
|
||||
/** @name Coded elements
|
||||
* @{
|
||||
*/
|
||||
uint16_t sync_word;
|
||||
|
|
@ -112,7 +112,7 @@ typedef struct {
|
|||
int num_blocks; ///< number of audio blocks
|
||||
/** @} */
|
||||
|
||||
/** @defgroup derived Derived values
|
||||
/** @name Derived values
|
||||
* @{
|
||||
*/
|
||||
uint8_t sr_shift;
|
||||
|
|
@ -156,6 +156,8 @@ typedef struct AC3EncOptions {
|
|||
int dolby_surround_ex_mode;
|
||||
int dolby_headphone_mode;
|
||||
int ad_converter_type;
|
||||
int eac3_mixing_metadata;
|
||||
int eac3_info_metadata;
|
||||
|
||||
/* other encoding options */
|
||||
int allow_per_frame_metadata;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "libavutil/crc.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "internal.h"
|
||||
#include "aac_ac3_parser.h"
|
||||
#include "ac3_parser.h"
|
||||
|
|
@ -1438,6 +1439,20 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(AC3DecodeContext, x)
|
||||
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
|
||||
static const AVOption options[] = {
|
||||
{ "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {1.0}, 0.0, 1.0, PAR },
|
||||
{ NULL},
|
||||
};
|
||||
|
||||
static const AVClass ac3_decoder_class = {
|
||||
.class_name = "(E-)AC3 decoder",
|
||||
.item_name = av_default_item_name,
|
||||
.option = options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
AVCodec ff_ac3_decoder = {
|
||||
.name = "ac3",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
|
|
@ -1450,6 +1465,7 @@ AVCodec ff_ac3_decoder = {
|
|||
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
.priv_class = &ac3_decoder_class,
|
||||
};
|
||||
|
||||
#if CONFIG_EAC3_DECODER
|
||||
|
|
@ -1465,5 +1481,6 @@ AVCodec ff_eac3_decoder = {
|
|||
.sample_fmts = (const enum AVSampleFormat[]) {
|
||||
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
|
||||
},
|
||||
.priv_class = &ac3_decoder_class,
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -66,10 +66,11 @@
|
|||
#define AC3_FRAME_BUFFER_SIZE 32768
|
||||
|
||||
typedef struct {
|
||||
AVClass *class; ///< class for AVOptions
|
||||
AVCodecContext *avctx; ///< parent context
|
||||
GetBitContext gbc; ///< bitstream reader
|
||||
|
||||
///@defgroup bsi bit stream information
|
||||
///@name Bit stream information
|
||||
///@{
|
||||
int frame_type; ///< frame type (strmtyp)
|
||||
int substreamid; ///< substream identification
|
||||
|
|
@ -87,7 +88,7 @@ typedef struct {
|
|||
int eac3; ///< indicates if current frame is E-AC-3
|
||||
///@}
|
||||
|
||||
///@defgroup audfrm frame syntax parameters
|
||||
///@name Frame syntax parameters
|
||||
int snr_offset_strategy; ///< SNR offset strategy (snroffststr)
|
||||
int block_switch_syntax; ///< block switch syntax enabled (blkswe)
|
||||
int dither_flag_syntax; ///< dither flag syntax enabled (dithflage)
|
||||
|
|
@ -97,7 +98,7 @@ typedef struct {
|
|||
int skip_syntax; ///< skip field syntax enabled (skipflde)
|
||||
///@}
|
||||
|
||||
///@defgroup cpl standard coupling
|
||||
///@name Standard coupling
|
||||
int cpl_in_use[AC3_MAX_BLOCKS]; ///< coupling in use (cplinu)
|
||||
int cpl_strategy_exists[AC3_MAX_BLOCKS];///< coupling strategy exists (cplstre)
|
||||
int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl)
|
||||
|
|
@ -110,7 +111,7 @@ typedef struct {
|
|||
int cpl_coords[AC3_MAX_CHANNELS][AC3_MAX_CPL_BANDS]; ///< coupling coordinates (cplco)
|
||||
///@}
|
||||
|
||||
///@defgroup spx spectral extension
|
||||
///@name Spectral extension
|
||||
///@{
|
||||
int spx_in_use; ///< spectral extension in use (spxinu)
|
||||
uint8_t channel_uses_spx[AC3_MAX_CHANNELS]; ///< channel uses spectral extension (chinspx)
|
||||
|
|
@ -126,12 +127,12 @@ typedef struct {
|
|||
float spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS];///< spx signal blending factor (sblendfact)
|
||||
///@}
|
||||
|
||||
///@defgroup aht adaptive hybrid transform
|
||||
///@name Adaptive hybrid transform
|
||||
int channel_uses_aht[AC3_MAX_CHANNELS]; ///< channel AHT in use (chahtinu)
|
||||
int pre_mantissa[AC3_MAX_CHANNELS][AC3_MAX_COEFS][AC3_MAX_BLOCKS]; ///< pre-IDCT mantissas
|
||||
///@}
|
||||
|
||||
///@defgroup channel channel
|
||||
///@name Channel
|
||||
int fbw_channels; ///< number of full-bandwidth channels
|
||||
int channels; ///< number of total channels
|
||||
int lfe_ch; ///< index of LFE channel
|
||||
|
|
@ -141,27 +142,28 @@ typedef struct {
|
|||
int out_channels; ///< number of output channels
|
||||
///@}
|
||||
|
||||
///@defgroup dynrng dynamic range
|
||||
///@name Dynamic range
|
||||
float dynamic_range[2]; ///< dynamic range
|
||||
float drc_scale; ///< percentage of dynamic range compression to be applied
|
||||
///@}
|
||||
|
||||
///@defgroup bandwidth bandwidth
|
||||
///@name Bandwidth
|
||||
int start_freq[AC3_MAX_CHANNELS]; ///< start frequency bin (strtmant)
|
||||
int end_freq[AC3_MAX_CHANNELS]; ///< end frequency bin (endmant)
|
||||
///@}
|
||||
|
||||
///@defgroup rematrixing rematrixing
|
||||
///@name Rematrixing
|
||||
int num_rematrixing_bands; ///< number of rematrixing bands (nrematbnd)
|
||||
int rematrixing_flags[4]; ///< rematrixing flags (rematflg)
|
||||
///@}
|
||||
|
||||
///@defgroup exponents exponents
|
||||
///@name Exponents
|
||||
int num_exp_groups[AC3_MAX_CHANNELS]; ///< Number of exponent groups (nexpgrp)
|
||||
int8_t dexps[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< decoded exponents
|
||||
int exp_strategy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS]; ///< exponent strategies (expstr)
|
||||
///@}
|
||||
|
||||
///@defgroup bitalloc bit allocation
|
||||
///@name Bit allocation
|
||||
AC3BitAllocParameters bit_alloc_params; ///< bit allocation parameters
|
||||
int first_cpl_leak; ///< first coupling leak state (firstcplleak)
|
||||
int snr_offset[AC3_MAX_CHANNELS]; ///< signal-to-noise ratio offsets (snroffst)
|
||||
|
|
@ -177,25 +179,25 @@ typedef struct {
|
|||
uint8_t dba_values[AC3_MAX_CHANNELS][8]; ///< delta values for each segment
|
||||
///@}
|
||||
|
||||
///@defgroup dithering zero-mantissa dithering
|
||||
///@name Zero-mantissa dithering
|
||||
int dither_flag[AC3_MAX_CHANNELS]; ///< dither flags (dithflg)
|
||||
AVLFG dith_state; ///< for dither generation
|
||||
///@}
|
||||
|
||||
///@defgroup imdct IMDCT
|
||||
///@name IMDCT
|
||||
int block_switch[AC3_MAX_CHANNELS]; ///< block switch flags (blksw)
|
||||
FFTContext imdct_512; ///< for 512 sample IMDCT
|
||||
FFTContext imdct_256; ///< for 256 sample IMDCT
|
||||
///@}
|
||||
|
||||
///@defgroup opt optimization
|
||||
///@name Optimization
|
||||
DSPContext dsp; ///< for optimization
|
||||
AC3DSPContext ac3dsp;
|
||||
FmtConvertContext fmt_conv; ///< optimized conversion functions
|
||||
float mul_bias; ///< scaling for float_to_int16 conversion
|
||||
///@}
|
||||
|
||||
///@defgroup arrays aligned arrays
|
||||
///@name Aligned arrays
|
||||
DECLARE_ALIGNED(16, int, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< fixed-point transform coefficients
|
||||
DECLARE_ALIGNED(32, float, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients
|
||||
DECLARE_ALIGNED(32, float, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block
|
||||
|
|
|
|||
|
|
@ -164,21 +164,8 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < nb_coefs; i++) {
|
||||
int e;
|
||||
int v = abs(coef[i]);
|
||||
if (v == 0)
|
||||
e = 24;
|
||||
else {
|
||||
e = 23 - av_log2(v);
|
||||
if (e >= 24) {
|
||||
e = 24;
|
||||
coef[i] = 0;
|
||||
} else if (e < 0) {
|
||||
e = 0;
|
||||
coef[i] = av_clip(coef[i], -16777215, 16777215);
|
||||
}
|
||||
}
|
||||
exp[i] = e;
|
||||
exp[i] = v ? 23 - av_log2(v) : 24;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -50,22 +50,22 @@
|
|||
#if CONFIG_AC3ENC_FLOAT
|
||||
#define AC3_NAME(x) ff_ac3_float_ ## x
|
||||
#define MAC_COEF(d,a,b) ((d)+=(a)*(b))
|
||||
#define COEF_MIN (-16777215.0/16777216.0)
|
||||
#define COEF_MAX ( 16777215.0/16777216.0)
|
||||
typedef float SampleType;
|
||||
typedef float CoefType;
|
||||
typedef float CoefSumType;
|
||||
#else
|
||||
#define AC3_NAME(x) ff_ac3_fixed_ ## x
|
||||
#define MAC_COEF(d,a,b) MAC64(d,a,b)
|
||||
#define COEF_MIN -16777215
|
||||
#define COEF_MAX 16777215
|
||||
typedef int16_t SampleType;
|
||||
typedef int32_t CoefType;
|
||||
typedef int64_t CoefSumType;
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct AC3MDCTContext {
|
||||
const SampleType *window; ///< MDCT window function
|
||||
FFTContext fft; ///< FFT context for MDCT calculation
|
||||
} AC3MDCTContext;
|
||||
#if 0
|
||||
/**
|
||||
* Encoding Options used by AVOption.
|
||||
|
|
@ -92,6 +92,8 @@ typedef struct AC3EncOptions {
|
|||
int dolby_surround_ex_mode;
|
||||
int dolby_headphone_mode;
|
||||
int ad_converter_type;
|
||||
int eac3_mixing_metadata;
|
||||
int eac3_info_metadata;
|
||||
|
||||
/* other encoding options */
|
||||
int allow_per_frame_metadata;
|
||||
|
|
@ -139,7 +141,8 @@ typedef struct AC3EncodeContext {
|
|||
PutBitContext pb; ///< bitstream writer context
|
||||
DSPContext dsp;
|
||||
AC3DSPContext ac3dsp; ///< AC-3 optimized functions
|
||||
AC3MDCTContext *mdct; ///< MDCT context
|
||||
FFTContext mdct; ///< FFT context for MDCT calculation
|
||||
const SampleType *mdct_window; ///< MDCT window function array
|
||||
|
||||
AC3Block blocks[AC3_MAX_BLOCKS]; ///< per-block info
|
||||
|
||||
|
|
@ -151,6 +154,8 @@ typedef struct AC3EncodeContext {
|
|||
int bit_rate; ///< target bit rate, in bits-per-second
|
||||
int sample_rate; ///< sampling frequency, in Hz
|
||||
|
||||
int num_blks_code; ///< number of blocks code (numblkscod)
|
||||
int num_blocks; ///< number of blocks per frame
|
||||
int frame_size_min; ///< minimum frame size in case rounding is necessary
|
||||
int frame_size; ///< current frame size in bytes
|
||||
int frame_size_code; ///< frame size code (frmsizecod)
|
||||
|
|
@ -212,31 +217,23 @@ typedef struct AC3EncodeContext {
|
|||
int16_t *psd_buffer;
|
||||
int16_t *band_psd_buffer;
|
||||
int16_t *mask_buffer;
|
||||
uint16_t *qmant_buffer;
|
||||
int16_t *qmant_buffer;
|
||||
uint8_t *cpl_coord_exp_buffer;
|
||||
uint8_t *cpl_coord_mant_buffer;
|
||||
|
||||
uint8_t exp_strategy[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< exponent strategies
|
||||
uint8_t frame_exp_strategy[AC3_MAX_CHANNELS]; ///< frame exp strategy index
|
||||
int use_frame_exp_strategy; ///< indicates use of frame exp strategy
|
||||
uint8_t exp_ref_block[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< reference blocks for EXP_REUSE
|
||||
uint8_t *ref_bap [AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< bit allocation pointers (bap)
|
||||
int ref_bap_set; ///< indicates if ref_bap pointers have been set
|
||||
|
||||
/* fixed vs. float function pointers */
|
||||
void (*mdct_end)(AC3MDCTContext *mdct);
|
||||
int (*mdct_init)(AVCodecContext *avctx, AC3MDCTContext *mdct, int nbits);
|
||||
void (*apply_window)(DSPContext *dsp, SampleType *output,
|
||||
const SampleType *input, const SampleType *window,
|
||||
unsigned int len);
|
||||
int (*normalize_samples)(struct AC3EncodeContext *s);
|
||||
void (*scale_coefficients)(struct AC3EncodeContext *s);
|
||||
void (*mdct_end)(struct AC3EncodeContext *s);
|
||||
int (*mdct_init)(struct AC3EncodeContext *s);
|
||||
|
||||
/* fixed vs. float templated function pointers */
|
||||
int (*allocate_sample_buffers)(struct AC3EncodeContext *s);
|
||||
void (*deinterleave_input_samples)(struct AC3EncodeContext *s,
|
||||
const SampleType *samples);
|
||||
void (*apply_mdct)(struct AC3EncodeContext *s);
|
||||
void (*apply_channel_coupling)(struct AC3EncodeContext *s);
|
||||
void (*compute_rematrixing_strategy)(struct AC3EncodeContext *s);
|
||||
|
||||
/* AC-3 vs. E-AC-3 function pointers */
|
||||
void (*output_frame_header)(struct AC3EncodeContext *s);
|
||||
|
|
@ -245,33 +242,32 @@ typedef struct AC3EncodeContext {
|
|||
|
||||
int ff_ac3_encode_init(AVCodecContext *avctx);
|
||||
|
||||
int ff_ac3_encode_frame(AVCodecContext *avctx, unsigned char *frame,
|
||||
int buf_size, void *data);
|
||||
|
||||
int ff_ac3_encode_close(AVCodecContext *avctx);
|
||||
|
||||
int ff_ac3_validate_metadata(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_adjust_frame_size(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_compute_coupling_strategy(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_apply_rematrixing(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_process_exponents(AC3EncodeContext *s);
|
||||
|
||||
int ff_ac3_compute_bit_allocation(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_quantize_mantissas(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_output_frame(AC3EncodeContext *s, unsigned char *frame);
|
||||
|
||||
|
||||
/* prototypes for functions in ac3enc_fixed.c and ac3enc_float.c */
|
||||
|
||||
void ff_ac3_fixed_mdct_end(AC3MDCTContext *mdct);
|
||||
void ff_ac3_float_mdct_end(AC3MDCTContext *mdct);
|
||||
void ff_ac3_fixed_mdct_end(AC3EncodeContext *s);
|
||||
void ff_ac3_float_mdct_end(AC3EncodeContext *s);
|
||||
|
||||
int ff_ac3_fixed_mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
|
||||
int nbits);
|
||||
int ff_ac3_float_mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
|
||||
int nbits);
|
||||
|
||||
void ff_ac3_fixed_apply_window(DSPContext *dsp, SampleType *output,
|
||||
const SampleType *input,
|
||||
const SampleType *window, unsigned int len);
|
||||
void ff_ac3_float_apply_window(DSPContext *dsp, SampleType *output,
|
||||
const SampleType *input,
|
||||
const SampleType *window, unsigned int len);
|
||||
|
||||
int ff_ac3_fixed_normalize_samples(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_fixed_scale_coefficients(AC3EncodeContext *s);
|
||||
void ff_ac3_float_scale_coefficients(AC3EncodeContext *s);
|
||||
int ff_ac3_fixed_mdct_init(AC3EncodeContext *s);
|
||||
int ff_ac3_float_mdct_init(AC3EncodeContext *s);
|
||||
|
||||
|
||||
/* prototypes for functions in ac3enc_template.c */
|
||||
|
|
@ -279,18 +275,9 @@ void ff_ac3_float_scale_coefficients(AC3EncodeContext *s);
|
|||
int ff_ac3_fixed_allocate_sample_buffers(AC3EncodeContext *s);
|
||||
int ff_ac3_float_allocate_sample_buffers(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_fixed_deinterleave_input_samples(AC3EncodeContext *s,
|
||||
const SampleType *samples);
|
||||
void ff_ac3_float_deinterleave_input_samples(AC3EncodeContext *s,
|
||||
const SampleType *samples);
|
||||
|
||||
void ff_ac3_fixed_apply_mdct(AC3EncodeContext *s);
|
||||
void ff_ac3_float_apply_mdct(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_fixed_apply_channel_coupling(AC3EncodeContext *s);
|
||||
void ff_ac3_float_apply_channel_coupling(AC3EncodeContext *s);
|
||||
|
||||
void ff_ac3_fixed_compute_rematrixing_strategy(AC3EncodeContext *s);
|
||||
void ff_ac3_float_compute_rematrixing_strategy(AC3EncodeContext *s);
|
||||
int ff_ac3_fixed_encode_frame(AVCodecContext *avctx, unsigned char *frame,
|
||||
int buf_size, void *data);
|
||||
int ff_ac3_float_encode_frame(AVCodecContext *avctx, unsigned char *frame,
|
||||
int buf_size, void *data);
|
||||
|
||||
#endif /* AVCODEC_AC3ENC_H */
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
#define AC3ENC_TYPE AC3ENC_TYPE_AC3_FIXED
|
||||
#include "ac3enc_opts_template.c"
|
||||
static AVClass ac3enc_class = { "Fixed-Point AC-3 Encoder", av_default_item_name,
|
||||
ac3fixed_options, LIBAVUTIL_VERSION_INT };
|
||||
static const AVClass ac3enc_class = { "Fixed-Point AC-3 Encoder", av_default_item_name,
|
||||
ac3fixed_options, LIBAVUTIL_VERSION_INT };
|
||||
|
||||
#include "ac3enc_template.c"
|
||||
|
||||
|
|
@ -41,9 +41,9 @@ static AVClass ac3enc_class = { "Fixed-Point AC-3 Encoder", av_default_item_name
|
|||
/**
|
||||
* Finalize MDCT and free allocated memory.
|
||||
*/
|
||||
av_cold void AC3_NAME(mdct_end)(AC3MDCTContext *mdct)
|
||||
av_cold void AC3_NAME(mdct_end)(AC3EncodeContext *s)
|
||||
{
|
||||
ff_mdct_end(&mdct->fft);
|
||||
ff_mdct_end(&s->mdct);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -51,11 +51,10 @@ av_cold void AC3_NAME(mdct_end)(AC3MDCTContext *mdct)
|
|||
* Initialize MDCT tables.
|
||||
* @param nbits log2(MDCT size)
|
||||
*/
|
||||
av_cold int AC3_NAME(mdct_init)(AVCodecContext *avctx, AC3MDCTContext *mdct,
|
||||
int nbits)
|
||||
av_cold int AC3_NAME(mdct_init)(AC3EncodeContext *s)
|
||||
{
|
||||
int ret = ff_mdct_init(&mdct->fft, nbits, 0, -1.0);
|
||||
mdct->window = ff_ac3_window;
|
||||
int ret = ff_mdct_init(&s->mdct, 9, 0, -1.0);
|
||||
s->mdct_window = ff_ac3_window;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -63,36 +62,23 @@ av_cold int AC3_NAME(mdct_init)(AVCodecContext *avctx, AC3MDCTContext *mdct,
|
|||
/**
|
||||
* Apply KBD window to input samples prior to MDCT.
|
||||
*/
|
||||
void AC3_NAME(apply_window)(DSPContext *dsp, int16_t *output,
|
||||
const int16_t *input, const int16_t *window,
|
||||
unsigned int len)
|
||||
static void apply_window(DSPContext *dsp, int16_t *output, const int16_t *input,
|
||||
const int16_t *window, unsigned int len)
|
||||
{
|
||||
dsp->apply_window_int16(output, input, window, len);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculate the log2() of the maximum absolute value in an array.
|
||||
* @param tab input array
|
||||
* @param n number of values in the array
|
||||
* @return log2(max(abs(tab[])))
|
||||
*/
|
||||
static int log2_tab(AC3EncodeContext *s, int16_t *src, int len)
|
||||
{
|
||||
int v = s->ac3dsp.ac3_max_msb_abs_int16(src, len);
|
||||
return av_log2(v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Normalize the input samples to use the maximum available precision.
|
||||
* This assumes signed 16-bit input samples.
|
||||
*
|
||||
* @return exponent shift
|
||||
*/
|
||||
int AC3_NAME(normalize_samples)(AC3EncodeContext *s)
|
||||
static int normalize_samples(AC3EncodeContext *s)
|
||||
{
|
||||
int v = 14 - log2_tab(s, s->windowed_samples, AC3_WINDOW_SIZE);
|
||||
int v = s->ac3dsp.ac3_max_msb_abs_int16(s->windowed_samples, AC3_WINDOW_SIZE);
|
||||
v = 14 - av_log2(v);
|
||||
if (v > 0)
|
||||
s->ac3dsp.ac3_lshift_int16(s->windowed_samples, AC3_WINDOW_SIZE, v);
|
||||
/* +6 to right-shift from 31-bit to 25-bit */
|
||||
|
|
@ -103,11 +89,11 @@ int AC3_NAME(normalize_samples)(AC3EncodeContext *s)
|
|||
/**
|
||||
* Scale MDCT coefficients to 25-bit signed fixed-point.
|
||||
*/
|
||||
void AC3_NAME(scale_coefficients)(AC3EncodeContext *s)
|
||||
static void scale_coefficients(AC3EncodeContext *s)
|
||||
{
|
||||
int blk, ch;
|
||||
|
||||
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
for (ch = 1; ch <= s->channels; ch++) {
|
||||
s->ac3dsp.ac3_rshift_int32(block->mdct_coef[ch], AC3_MAX_COEFS,
|
||||
|
|
@ -117,6 +103,15 @@ void AC3_NAME(scale_coefficients)(AC3EncodeContext *s)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clip MDCT coefficients to allowable range.
|
||||
*/
|
||||
static void clip_coefficients(DSPContext *dsp, int32_t *coef, unsigned int len)
|
||||
{
|
||||
dsp->vector_clip_int32(coef, coef, COEF_MIN, COEF_MAX, len);
|
||||
}
|
||||
|
||||
|
||||
static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
AC3EncodeContext *s = avctx->priv_data;
|
||||
|
|
@ -126,14 +121,13 @@ static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
|
|||
|
||||
|
||||
AVCodec ff_ac3_fixed_encoder = {
|
||||
"ac3_fixed",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_AC3,
|
||||
sizeof(AC3EncodeContext),
|
||||
ac3_fixed_encode_init,
|
||||
ff_ac3_encode_frame,
|
||||
ff_ac3_encode_close,
|
||||
NULL,
|
||||
.name = "ac3_fixed",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_AC3,
|
||||
.priv_data_size = sizeof(AC3EncodeContext),
|
||||
.init = ac3_fixed_encode_init,
|
||||
.encode = ff_ac3_fixed_encode_frame,
|
||||
.close = ff_ac3_encode_close,
|
||||
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
|
||||
.priv_class = &ac3enc_class,
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
#if CONFIG_AC3_ENCODER
|
||||
#define AC3ENC_TYPE AC3ENC_TYPE_AC3
|
||||
#include "ac3enc_opts_template.c"
|
||||
static AVClass ac3enc_class = { "AC-3 Encoder", av_default_item_name,
|
||||
ac3_options, LIBAVUTIL_VERSION_INT };
|
||||
static const AVClass ac3enc_class = { "AC-3 Encoder", av_default_item_name,
|
||||
ac3_options, LIBAVUTIL_VERSION_INT };
|
||||
#endif
|
||||
|
||||
#include "ac3enc_template.c"
|
||||
|
|
@ -45,10 +45,10 @@ static AVClass ac3enc_class = { "AC-3 Encoder", av_default_item_name,
|
|||
/**
|
||||
* Finalize MDCT and free allocated memory.
|
||||
*/
|
||||
av_cold void ff_ac3_float_mdct_end(AC3MDCTContext *mdct)
|
||||
av_cold void ff_ac3_float_mdct_end(AC3EncodeContext *s)
|
||||
{
|
||||
ff_mdct_end(&mdct->fft);
|
||||
av_freep(&mdct->window);
|
||||
ff_mdct_end(&s->mdct);
|
||||
av_freep(&s->mdct_window);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -56,62 +56,78 @@ av_cold void ff_ac3_float_mdct_end(AC3MDCTContext *mdct)
|
|||
* Initialize MDCT tables.
|
||||
* @param nbits log2(MDCT size)
|
||||
*/
|
||||
av_cold int ff_ac3_float_mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
|
||||
int nbits)
|
||||
av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
|
||||
{
|
||||
float *window;
|
||||
int i, n, n2;
|
||||
|
||||
n = 1 << nbits;
|
||||
n = 1 << 9;
|
||||
n2 = n >> 1;
|
||||
|
||||
window = av_malloc(n * sizeof(*window));
|
||||
if (!window) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Cannot allocate memory.\n");
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Cannot allocate memory.\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
ff_kbd_window_init(window, 5.0, n2);
|
||||
for (i = 0; i < n2; i++)
|
||||
window[n-1-i] = window[i];
|
||||
mdct->window = window;
|
||||
s->mdct_window = window;
|
||||
|
||||
return ff_mdct_init(&mdct->fft, nbits, 0, -2.0 / n);
|
||||
return ff_mdct_init(&s->mdct, 9, 0, -2.0 / n);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Apply KBD window to input samples prior to MDCT.
|
||||
*/
|
||||
void ff_ac3_float_apply_window(DSPContext *dsp, float *output,
|
||||
const float *input, const float *window,
|
||||
unsigned int len)
|
||||
static void apply_window(DSPContext *dsp, float *output, const float *input,
|
||||
const float *window, unsigned int len)
|
||||
{
|
||||
dsp->vector_fmul(output, input, window, len);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Normalize the input samples.
|
||||
* Not needed for the floating-point encoder.
|
||||
*/
|
||||
static int normalize_samples(AC3EncodeContext *s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Scale MDCT coefficients from float to 24-bit fixed-point.
|
||||
*/
|
||||
void ff_ac3_float_scale_coefficients(AC3EncodeContext *s)
|
||||
static void scale_coefficients(AC3EncodeContext *s)
|
||||
{
|
||||
int chan_size = AC3_MAX_COEFS * AC3_MAX_BLOCKS;
|
||||
int chan_size = AC3_MAX_COEFS * s->num_blocks;
|
||||
s->ac3dsp.float_to_fixed24(s->fixed_coef_buffer + chan_size,
|
||||
s->mdct_coef_buffer + chan_size,
|
||||
chan_size * s->channels);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clip MDCT coefficients to allowable range.
|
||||
*/
|
||||
static void clip_coefficients(DSPContext *dsp, float *coef, unsigned int len)
|
||||
{
|
||||
dsp->vector_clipf(coef, coef, COEF_MIN, COEF_MAX, len);
|
||||
}
|
||||
|
||||
|
||||
#if CONFIG_AC3_ENCODER
|
||||
AVCodec ff_ac3_float_encoder = {
|
||||
"ac3_float",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_AC3,
|
||||
sizeof(AC3EncodeContext),
|
||||
ff_ac3_encode_init,
|
||||
ff_ac3_encode_frame,
|
||||
ff_ac3_encode_close,
|
||||
NULL,
|
||||
.name = "ac3 float",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_AC3,
|
||||
.priv_data_size = sizeof(AC3EncodeContext),
|
||||
.init = ff_ac3_encode_init,
|
||||
.encode = ff_ac3_float_encode_frame,
|
||||
.close = ff_ac3_encode_close,
|
||||
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_FLT,AV_SAMPLE_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
|
||||
.priv_class = &ac3enc_class,
|
||||
|
|
|
|||
|
|
@ -29,12 +29,13 @@ static const AVOption ac3_options[] = {
|
|||
#else /* AC3ENC_TYPE_EAC3 */
|
||||
static const AVOption eac3_options[] = {
|
||||
#endif
|
||||
#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3
|
||||
/* Metadata Options */
|
||||
{"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, 1, AC3ENC_PARAM},
|
||||
/* downmix levels */
|
||||
#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3
|
||||
/* AC-3 downmix levels */
|
||||
{"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM},
|
||||
{"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM},
|
||||
#endif
|
||||
/* audio production information */
|
||||
{"mixing_level", "Mixing Level", OFFSET(mixing_level), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 111, AC3ENC_PARAM},
|
||||
{"room_type", "Room Type", OFFSET(room_type), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 2, AC3ENC_PARAM, "room_type"},
|
||||
|
|
@ -42,15 +43,13 @@ static const AVOption eac3_options[] = {
|
|||
{"large", "Large Room", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
|
||||
{"small", "Small Room", 0, FF_OPT_TYPE_CONST, {.dbl = 2 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
|
||||
/* other metadata options */
|
||||
{"copyright", "Copyright Bit", OFFSET(copyright), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, 1, AC3ENC_PARAM},
|
||||
#endif
|
||||
{"copyright", "Copyright Bit", OFFSET(copyright), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 1, AC3ENC_PARAM},
|
||||
{"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), FF_OPT_TYPE_INT, {.dbl = -31 }, -31, -1, AC3ENC_PARAM},
|
||||
#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3
|
||||
{"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, 2, AC3ENC_PARAM, "dsur_mode"},
|
||||
{"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 2, AC3ENC_PARAM, "dsur_mode"},
|
||||
{"notindicated", "Not Indicated (default)", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
|
||||
{"on", "Dolby Surround Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
|
||||
{"off", "Not Dolby Surround Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = 2 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
|
||||
{"original", "Original Bit Stream", OFFSET(original), FF_OPT_TYPE_INT, {.dbl = 1 }, 0, 1, AC3ENC_PARAM},
|
||||
{"original", "Original Bit Stream", OFFSET(original), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 1, AC3ENC_PARAM},
|
||||
/* extended bitstream information */
|
||||
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 2, AC3ENC_PARAM, "dmix_mode"},
|
||||
{"notindicated", "Not Indicated (default)", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
|
||||
|
|
@ -71,7 +70,6 @@ static const AVOption eac3_options[] = {
|
|||
{"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 1, AC3ENC_PARAM, "ad_conv_type"},
|
||||
{"standard", "Standard (default)", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
|
||||
{"hdcd", "HDCD", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
|
||||
#endif
|
||||
/* Other Encoding Options */
|
||||
{"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), FF_OPT_TYPE_INT, {.dbl = 1 }, 0, 1, AC3ENC_PARAM},
|
||||
#if AC3ENC_TYPE != AC3ENC_TYPE_AC3_FIXED
|
||||
|
|
|
|||
|
|
@ -31,6 +31,19 @@
|
|||
#include "ac3enc.h"
|
||||
|
||||
|
||||
/* prototypes for static functions in ac3enc_fixed.c and ac3enc_float.c */
|
||||
|
||||
static void scale_coefficients(AC3EncodeContext *s);
|
||||
|
||||
static void apply_window(DSPContext *dsp, SampleType *output,
|
||||
const SampleType *input, const SampleType *window,
|
||||
unsigned int len);
|
||||
|
||||
static int normalize_samples(AC3EncodeContext *s);
|
||||
|
||||
static void clip_coefficients(DSPContext *dsp, CoefType *coef, unsigned int len);
|
||||
|
||||
|
||||
int AC3_NAME(allocate_sample_buffers)(AC3EncodeContext *s)
|
||||
{
|
||||
int ch;
|
||||
|
|
@ -55,8 +68,8 @@ alloc_fail:
|
|||
* Deinterleave input samples.
|
||||
* Channels are reordered from Libav's default order to AC-3 order.
|
||||
*/
|
||||
void AC3_NAME(deinterleave_input_samples)(AC3EncodeContext *s,
|
||||
const SampleType *samples)
|
||||
static void deinterleave_input_samples(AC3EncodeContext *s,
|
||||
const SampleType *samples)
|
||||
{
|
||||
int ch, i;
|
||||
|
||||
|
|
@ -66,13 +79,13 @@ void AC3_NAME(deinterleave_input_samples)(AC3EncodeContext *s,
|
|||
int sinc;
|
||||
|
||||
/* copy last 256 samples of previous frame to the start of the current frame */
|
||||
memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][AC3_FRAME_SIZE],
|
||||
memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][AC3_BLOCK_SIZE * s->num_blocks],
|
||||
AC3_BLOCK_SIZE * sizeof(s->planar_samples[0][0]));
|
||||
|
||||
/* deinterleave */
|
||||
sinc = s->channels;
|
||||
sptr = samples + s->channel_map[ch];
|
||||
for (i = AC3_BLOCK_SIZE; i < AC3_FRAME_SIZE+AC3_BLOCK_SIZE; i++) {
|
||||
for (i = AC3_BLOCK_SIZE; i < AC3_BLOCK_SIZE * (s->num_blocks + 1); i++) {
|
||||
s->planar_samples[ch][i] = *sptr;
|
||||
sptr += sinc;
|
||||
}
|
||||
|
|
@ -85,23 +98,23 @@ void AC3_NAME(deinterleave_input_samples)(AC3EncodeContext *s,
|
|||
* This applies the KBD window and normalizes the input to reduce precision
|
||||
* loss due to fixed-point calculations.
|
||||
*/
|
||||
void AC3_NAME(apply_mdct)(AC3EncodeContext *s)
|
||||
static void apply_mdct(AC3EncodeContext *s)
|
||||
{
|
||||
int blk, ch;
|
||||
|
||||
for (ch = 0; ch < s->channels; ch++) {
|
||||
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
const SampleType *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];
|
||||
|
||||
s->apply_window(&s->dsp, s->windowed_samples, input_samples,
|
||||
s->mdct->window, AC3_WINDOW_SIZE);
|
||||
apply_window(&s->dsp, s->windowed_samples, input_samples,
|
||||
s->mdct_window, AC3_WINDOW_SIZE);
|
||||
|
||||
if (s->fixed_point)
|
||||
block->coeff_shift[ch+1] = s->normalize_samples(s);
|
||||
block->coeff_shift[ch+1] = normalize_samples(s);
|
||||
|
||||
s->mdct->fft.mdct_calcw(&s->mdct->fft, block->mdct_coef[ch+1],
|
||||
s->windowed_samples);
|
||||
s->mdct.mdct_calcw(&s->mdct, block->mdct_coef[ch+1],
|
||||
s->windowed_samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,7 +140,7 @@ static inline float calc_cpl_coord(float energy_ch, float energy_cpl)
|
|||
* adaptive coupling strategy were to be implemented it might be useful
|
||||
* at that time to use coupling for the fixed-point encoder as well.
|
||||
*/
|
||||
void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
||||
static void apply_channel_coupling(AC3EncodeContext *s)
|
||||
{
|
||||
#if CONFIG_AC3ENC_FLOAT
|
||||
LOCAL_ALIGNED_16(float, cpl_coords, [AC3_MAX_BLOCKS], [AC3_MAX_CHANNELS][16]);
|
||||
|
|
@ -146,7 +159,7 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
cpl_start = FFMIN(256, cpl_start + num_cpl_coefs) - num_cpl_coefs;
|
||||
|
||||
/* calculate coupling channel from fbw channels */
|
||||
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
CoefType *cpl_coef = &block->mdct_coef[CPL_CH][cpl_start];
|
||||
if (!block->cpl_in_use)
|
||||
|
|
@ -160,8 +173,8 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
cpl_coef[i] += ch_coef[i];
|
||||
}
|
||||
|
||||
/* coefficients must be clipped to +/- 1.0 in order to be encoded */
|
||||
s->dsp.vector_clipf(cpl_coef, cpl_coef, -1.0f, 1.0f, num_cpl_coefs);
|
||||
/* coefficients must be clipped in order to be encoded */
|
||||
clip_coefficients(&s->dsp, cpl_coef, num_cpl_coefs);
|
||||
|
||||
/* scale coupling coefficients from float to 24-bit fixed-point */
|
||||
s->ac3dsp.float_to_fixed24(&block->fixed_coef[CPL_CH][cpl_start],
|
||||
|
|
@ -175,7 +188,7 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
while (i < s->cpl_end_freq) {
|
||||
int band_size = s->cpl_band_sizes[bnd];
|
||||
for (ch = CPL_CH; ch <= s->fbw_channels; ch++) {
|
||||
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
if (!block->cpl_in_use || (ch > CPL_CH && !block->channel_in_cpl[ch]))
|
||||
continue;
|
||||
|
|
@ -190,7 +203,7 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
}
|
||||
|
||||
/* determine which blocks to send new coupling coordinates for */
|
||||
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
AC3Block *block0 = blk ? &s->blocks[blk-1] : NULL;
|
||||
int new_coords = 0;
|
||||
|
|
@ -248,7 +261,7 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
coordinates in successive blocks */
|
||||
for (bnd = 0; bnd < s->num_cpl_bands; bnd++) {
|
||||
blk = 0;
|
||||
while (blk < AC3_MAX_BLOCKS) {
|
||||
while (blk < s->num_blocks) {
|
||||
int blk1;
|
||||
CoefSumType energy_cpl;
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
|
|
@ -260,7 +273,7 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
|
||||
energy_cpl = energy[blk][CPL_CH][bnd];
|
||||
blk1 = blk+1;
|
||||
while (!s->blocks[blk1].new_cpl_coords && blk1 < AC3_MAX_BLOCKS) {
|
||||
while (!s->blocks[blk1].new_cpl_coords && blk1 < s->num_blocks) {
|
||||
if (s->blocks[blk1].cpl_in_use)
|
||||
energy_cpl += energy[blk1][CPL_CH][bnd];
|
||||
blk1++;
|
||||
|
|
@ -272,7 +285,7 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
continue;
|
||||
energy_ch = energy[blk][ch][bnd];
|
||||
blk1 = blk+1;
|
||||
while (!s->blocks[blk1].new_cpl_coords && blk1 < AC3_MAX_BLOCKS) {
|
||||
while (!s->blocks[blk1].new_cpl_coords && blk1 < s->num_blocks) {
|
||||
if (s->blocks[blk1].cpl_in_use)
|
||||
energy_ch += energy[blk1][ch][bnd];
|
||||
blk1++;
|
||||
|
|
@ -284,11 +297,12 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
}
|
||||
|
||||
/* calculate exponents/mantissas for coupling coordinates */
|
||||
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
if (!block->cpl_in_use || !block->new_cpl_coords)
|
||||
continue;
|
||||
|
||||
clip_coefficients(&s->dsp, cpl_coords[blk][1], s->fbw_channels * 16);
|
||||
s->ac3dsp.float_to_fixed24(fixed_cpl_coords[blk][1],
|
||||
cpl_coords[blk][1],
|
||||
s->fbw_channels * 16);
|
||||
|
|
@ -339,7 +353,7 @@ void AC3_NAME(apply_channel_coupling)(AC3EncodeContext *s)
|
|||
/**
|
||||
* Determine rematrixing flags for each block and band.
|
||||
*/
|
||||
void AC3_NAME(compute_rematrixing_strategy)(AC3EncodeContext *s)
|
||||
static void compute_rematrixing_strategy(AC3EncodeContext *s)
|
||||
{
|
||||
int nb_coefs;
|
||||
int blk, bnd, i;
|
||||
|
|
@ -348,7 +362,7 @@ void AC3_NAME(compute_rematrixing_strategy)(AC3EncodeContext *s)
|
|||
if (s->channel_mode != AC3_CHMODE_STEREO)
|
||||
return;
|
||||
|
||||
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
block = &s->blocks[blk];
|
||||
block->new_rematrixing_strategy = !blk;
|
||||
|
||||
|
|
@ -397,3 +411,61 @@ void AC3_NAME(compute_rematrixing_strategy)(AC3EncodeContext *s)
|
|||
block0 = block;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encode a single AC-3 frame.
|
||||
*/
|
||||
int AC3_NAME(encode_frame)(AVCodecContext *avctx, unsigned char *frame,
|
||||
int buf_size, void *data)
|
||||
{
|
||||
AC3EncodeContext *s = avctx->priv_data;
|
||||
const SampleType *samples = data;
|
||||
int ret;
|
||||
|
||||
if (s->options.allow_per_frame_metadata) {
|
||||
ret = ff_ac3_validate_metadata(s);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (s->bit_alloc.sr_code == 1 || s->eac3)
|
||||
ff_ac3_adjust_frame_size(s);
|
||||
|
||||
deinterleave_input_samples(s, samples);
|
||||
|
||||
apply_mdct(s);
|
||||
|
||||
if (s->fixed_point)
|
||||
scale_coefficients(s);
|
||||
|
||||
clip_coefficients(&s->dsp, s->blocks[0].mdct_coef[1],
|
||||
AC3_MAX_COEFS * s->num_blocks * s->channels);
|
||||
|
||||
s->cpl_on = s->cpl_enabled;
|
||||
ff_ac3_compute_coupling_strategy(s);
|
||||
|
||||
if (s->cpl_on)
|
||||
apply_channel_coupling(s);
|
||||
|
||||
compute_rematrixing_strategy(s);
|
||||
|
||||
if (!s->fixed_point)
|
||||
scale_coefficients(s);
|
||||
|
||||
ff_ac3_apply_rematrixing(s);
|
||||
|
||||
ff_ac3_process_exponents(s);
|
||||
|
||||
ret = ff_ac3_compute_bit_allocation(s);
|
||||
if (ret) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Bit allocation failed. Try increasing the bitrate.\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ff_ac3_quantize_mantissas(s);
|
||||
|
||||
ff_ac3_output_frame(s, frame);
|
||||
|
||||
return s->frame_size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "acelp_pitch_delay.h"
|
||||
|
|
@ -104,20 +105,9 @@ int16_t ff_acelp_decode_gain_code(
|
|||
for(i=0; i<ma_pred_order; i++)
|
||||
mr_energy += quant_energy[i] * ma_prediction_coeff[i];
|
||||
|
||||
#ifdef G729_BITEXACT
|
||||
mr_energy += (((-6165LL * ff_log2(dsp->scalarproduct_int16(fc_v, fc_v, subframe_size, 0))) >> 3) & ~0x3ff);
|
||||
|
||||
mr_energy = (5439 * (mr_energy >> 15)) >> 8; // (0.15) = (0.15) * (7.23)
|
||||
|
||||
return bidir_sal(
|
||||
((ff_exp2(mr_energy & 0x7fff) + 16) >> 5) * (gain_corr_factor >> 1),
|
||||
(mr_energy >> 15) - 25
|
||||
);
|
||||
#else
|
||||
mr_energy = gain_corr_factor * exp(M_LN10 / (20 << 23) * mr_energy) /
|
||||
sqrt(dsp->scalarproduct_int16(fc_v, fc_v, subframe_size, 0));
|
||||
return mr_energy >> 12;
|
||||
#endif
|
||||
}
|
||||
|
||||
float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@
|
|||
#define PITCH_DELAY_MAX 143
|
||||
|
||||
/**
|
||||
* \brief Decode pitch delay of the first subframe encoded by 8 bits with 1/3
|
||||
* @brief Decode pitch delay of the first subframe encoded by 8 bits with 1/3
|
||||
* resolution.
|
||||
* \param ac_index adaptive codebook index (8 bits)
|
||||
* @param ac_index adaptive codebook index (8 bits)
|
||||
*
|
||||
* \return pitch delay in 1/3 units
|
||||
* @return pitch delay in 1/3 units
|
||||
*
|
||||
* Pitch delay is coded:
|
||||
* with 1/3 resolution, 19 < pitch_delay < 85
|
||||
|
|
@ -43,18 +43,18 @@
|
|||
int ff_acelp_decode_8bit_to_1st_delay3(int ac_index);
|
||||
|
||||
/**
|
||||
* \brief Decode pitch delay of the second subframe encoded by 5 or 6 bits
|
||||
* @brief Decode pitch delay of the second subframe encoded by 5 or 6 bits
|
||||
* with 1/3 precision.
|
||||
* \param ac_index adaptive codebook index (5 or 6 bits)
|
||||
* \param pitch_delay_min lower bound (integer) of pitch delay interval
|
||||
* @param ac_index adaptive codebook index (5 or 6 bits)
|
||||
* @param pitch_delay_min lower bound (integer) of pitch delay interval
|
||||
* for second subframe
|
||||
*
|
||||
* \return pitch delay in 1/3 units
|
||||
* @return pitch delay in 1/3 units
|
||||
*
|
||||
* Pitch delay is coded:
|
||||
* with 1/3 resolution, -6 < pitch_delay - int(prev_pitch_delay) < 5
|
||||
*
|
||||
* \remark The routine is used in G.729 @@8k, AMR @@10.2k, AMR @@7.95k,
|
||||
* @remark The routine is used in G.729 @@8k, AMR @@10.2k, AMR @@7.95k,
|
||||
* AMR @@7.4k for the second subframe.
|
||||
*/
|
||||
int ff_acelp_decode_5_6_bit_to_2nd_delay3(
|
||||
|
|
@ -62,19 +62,19 @@ int ff_acelp_decode_5_6_bit_to_2nd_delay3(
|
|||
int pitch_delay_min);
|
||||
|
||||
/**
|
||||
* \brief Decode pitch delay with 1/3 precision.
|
||||
* \param ac_index adaptive codebook index (4 bits)
|
||||
* \param pitch_delay_min lower bound (integer) of pitch delay interval for
|
||||
* @brief Decode pitch delay with 1/3 precision.
|
||||
* @param ac_index adaptive codebook index (4 bits)
|
||||
* @param pitch_delay_min lower bound (integer) of pitch delay interval for
|
||||
* second subframe
|
||||
*
|
||||
* \return pitch delay in 1/3 units
|
||||
* @return pitch delay in 1/3 units
|
||||
*
|
||||
* Pitch delay is coded:
|
||||
* integers only, -6 < pitch_delay - int(prev_pitch_delay) <= -2
|
||||
* with 1/3 resolution, -2 < pitch_delay - int(prev_pitch_delay) < 1
|
||||
* integers only, 1 <= pitch_delay - int(prev_pitch_delay) < 5
|
||||
*
|
||||
* \remark The routine is used in G.729 @@6.4k, AMR @@6.7k, AMR @@5.9k,
|
||||
* @remark The routine is used in G.729 @@6.4k, AMR @@6.7k, AMR @@5.9k,
|
||||
* AMR @@5.15k, AMR @@4.75k for the second subframe.
|
||||
*/
|
||||
int ff_acelp_decode_4bit_to_2nd_delay3(
|
||||
|
|
@ -82,44 +82,44 @@ int ff_acelp_decode_4bit_to_2nd_delay3(
|
|||
int pitch_delay_min);
|
||||
|
||||
/**
|
||||
* \brief Decode pitch delay of the first subframe encoded by 9 bits
|
||||
* @brief Decode pitch delay of the first subframe encoded by 9 bits
|
||||
* with 1/6 precision.
|
||||
* \param ac_index adaptive codebook index (9 bits)
|
||||
* @param ac_index adaptive codebook index (9 bits)
|
||||
*
|
||||
* \return pitch delay in 1/6 units
|
||||
* @return pitch delay in 1/6 units
|
||||
*
|
||||
* Pitch delay is coded:
|
||||
* with 1/6 resolution, 17 < pitch_delay < 95
|
||||
* integers only, 95 <= pitch_delay <= 143
|
||||
*
|
||||
* \remark The routine is used in AMR @@12.2k for the first and third subframes.
|
||||
* @remark The routine is used in AMR @@12.2k for the first and third subframes.
|
||||
*/
|
||||
int ff_acelp_decode_9bit_to_1st_delay6(int ac_index);
|
||||
|
||||
/**
|
||||
* \brief Decode pitch delay of the second subframe encoded by 6 bits
|
||||
* @brief Decode pitch delay of the second subframe encoded by 6 bits
|
||||
* with 1/6 precision.
|
||||
* \param ac_index adaptive codebook index (6 bits)
|
||||
* \param pitch_delay_min lower bound (integer) of pitch delay interval for
|
||||
* @param ac_index adaptive codebook index (6 bits)
|
||||
* @param pitch_delay_min lower bound (integer) of pitch delay interval for
|
||||
* second subframe
|
||||
*
|
||||
* \return pitch delay in 1/6 units
|
||||
* @return pitch delay in 1/6 units
|
||||
*
|
||||
* Pitch delay is coded:
|
||||
* with 1/6 resolution, -6 < pitch_delay - int(prev_pitch_delay) < 5
|
||||
*
|
||||
* \remark The routine is used in AMR @@12.2k for the second and fourth subframes.
|
||||
* @remark The routine is used in AMR @@12.2k for the second and fourth subframes.
|
||||
*/
|
||||
int ff_acelp_decode_6bit_to_2nd_delay6(
|
||||
int ac_index,
|
||||
int pitch_delay_min);
|
||||
|
||||
/**
|
||||
* \brief Update past quantized energies
|
||||
* \param[in,out] quant_energy past quantized energies (5.10)
|
||||
* \param gain_corr_factor gain correction factor
|
||||
* \param log2_ma_pred_order log2() of MA prediction order
|
||||
* \param erasure frame erasure flag
|
||||
* @brief Update past quantized energies
|
||||
* @param[in,out] quant_energy past quantized energies (5.10)
|
||||
* @param gain_corr_factor gain correction factor
|
||||
* @param log2_ma_pred_order log2() of MA prediction order
|
||||
* @param erasure frame erasure flag
|
||||
*
|
||||
* If frame erasure flag is not equal to zero, memory is updated with
|
||||
* averaged energy, attenuated by 4dB:
|
||||
|
|
@ -128,7 +128,7 @@ int ff_acelp_decode_6bit_to_2nd_delay6(
|
|||
* In normal mode memory is updated with
|
||||
* Er - Ep = 20 * log10(gain_corr_factor)
|
||||
*
|
||||
* \remark The routine is used in G.729 and AMR (all modes).
|
||||
* @remark The routine is used in G.729 and AMR (all modes).
|
||||
*/
|
||||
void ff_acelp_update_past_gain(
|
||||
int16_t* quant_energy,
|
||||
|
|
@ -137,16 +137,16 @@ void ff_acelp_update_past_gain(
|
|||
int erasure);
|
||||
|
||||
/**
|
||||
* \brief Decode the adaptive codebook gain and add
|
||||
* @brief Decode the adaptive codebook gain and add
|
||||
* correction (4.1.5 and 3.9.1 of G.729).
|
||||
* \param dsp initialized dsputil context
|
||||
* \param gain_corr_factor gain correction factor (2.13)
|
||||
* \param fc_v fixed-codebook vector (2.13)
|
||||
* \param mr_energy mean innovation energy and fixed-point correction (7.13)
|
||||
* \param[in,out] quant_energy past quantized energies (5.10)
|
||||
* \param subframe_size length of subframe
|
||||
* @param dsp initialized dsputil context
|
||||
* @param gain_corr_factor gain correction factor (2.13)
|
||||
* @param fc_v fixed-codebook vector (2.13)
|
||||
* @param mr_energy mean innovation energy and fixed-point correction (7.13)
|
||||
* @param[in,out] quant_energy past quantized energies (5.10)
|
||||
* @param subframe_size length of subframe
|
||||
*
|
||||
* \return quantized fixed-codebook gain (14.1)
|
||||
* @return quantized fixed-codebook gain (14.1)
|
||||
*
|
||||
* The routine implements equations 69, 66 and 71 of the G.729 specification (3.9.1)
|
||||
*
|
||||
|
|
@ -205,7 +205,7 @@ void ff_acelp_update_past_gain(
|
|||
*
|
||||
* mr_energy = Em + 10log(N) + 10log(2^26)
|
||||
*
|
||||
* \remark The routine is used in G.729 and AMR (all modes).
|
||||
* @remark The routine is used in G.729 and AMR (all modes).
|
||||
*/
|
||||
int16_t ff_acelp_decode_gain_code(
|
||||
DSPContext *dsp,
|
||||
|
|
|
|||
|
|
@ -48,26 +48,6 @@ const uint8_t ff_fc_2pulses_9bits_track1_gray[16] =
|
|||
28, 26,
|
||||
};
|
||||
|
||||
const uint8_t ff_fc_2pulses_9bits_track2_gray[32] =
|
||||
{
|
||||
0, 2,
|
||||
5, 4,
|
||||
12, 10,
|
||||
7, 9,
|
||||
25, 24,
|
||||
20, 22,
|
||||
14, 15,
|
||||
19, 17,
|
||||
36, 31,
|
||||
21, 26,
|
||||
1, 6,
|
||||
16, 11,
|
||||
27, 29,
|
||||
32, 30,
|
||||
39, 37,
|
||||
34, 35,
|
||||
};
|
||||
|
||||
const uint8_t ff_fc_4pulses_8bits_tracks_13[16] =
|
||||
{
|
||||
0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75,
|
||||
|
|
|
|||
|
|
@ -81,37 +81,6 @@ extern const uint8_t ff_fc_4pulses_8bits_track_4[32];
|
|||
extern const uint8_t ff_fc_2pulses_9bits_track1[16];
|
||||
extern const uint8_t ff_fc_2pulses_9bits_track1_gray[16];
|
||||
|
||||
/**
|
||||
* Track|Pulse| Positions
|
||||
* -----------------------------------------
|
||||
* 2 | 1 | 0, 7, 14, 20, 27, 34, 1, 21
|
||||
* | | 2, 9, 15, 22, 29, 35, 6, 26
|
||||
* | | 4,10, 17, 24, 30, 37, 11, 31
|
||||
* | | 5,12, 19, 25, 32, 39, 16, 36
|
||||
* -----------------------------------------
|
||||
*
|
||||
* @remark Track in the table should be read top-to-bottom, left-to-right.
|
||||
*
|
||||
* @note (EE.1) This table (from the reference code) does not comply with
|
||||
* the specification.
|
||||
* The specification contains the following table:
|
||||
*
|
||||
* Track|Pulse| Positions
|
||||
* -----------------------------------------
|
||||
* 2 | 1 | 0, 5, 10, 15, 20, 25, 30, 35
|
||||
* | | 1, 6, 11, 16, 21, 26, 31, 36
|
||||
* | | 2, 7, 12, 17, 22, 27, 32, 37
|
||||
* | | 4, 9, 14, 19, 24, 29, 34, 39
|
||||
*
|
||||
* -----------------------------------------
|
||||
*
|
||||
* @note (EE.2) Reference G.729D code also uses gray decoding for each
|
||||
* pulse index before looking up the value in the table.
|
||||
*
|
||||
* Used in G.729 @@6.4k (with gray coding)
|
||||
*/
|
||||
extern const uint8_t ff_fc_2pulses_9bits_track2_gray[32];
|
||||
|
||||
/**
|
||||
* b60 hamming windowed sinc function coefficients
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
|
|||
avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */
|
||||
/* and we have 4 bytes per channel overhead */
|
||||
avctx->block_align = BLKSIZE;
|
||||
avctx->bits_per_coded_sample = 4;
|
||||
/* seems frame_size isn't taken into account... have to buffer the samples :-( */
|
||||
break;
|
||||
case CODEC_ID_ADPCM_IMA_QT:
|
||||
|
|
@ -208,6 +209,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
|
|||
avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; /* each 16 bits sample gives one nibble */
|
||||
/* and we have 7 bytes per channel overhead */
|
||||
avctx->block_align = BLKSIZE;
|
||||
avctx->bits_per_coded_sample = 4;
|
||||
avctx->extradata_size = 32;
|
||||
extradata = avctx->extradata = av_malloc(avctx->extradata_size);
|
||||
if (!extradata)
|
||||
|
|
|
|||
|
|
@ -167,14 +167,12 @@ static int adx_decode_frame(AVCodecContext *avctx,
|
|||
}
|
||||
|
||||
AVCodec ff_adpcm_adx_decoder = {
|
||||
"adpcm_adx",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_ADPCM_ADX,
|
||||
sizeof(ADXContext),
|
||||
adx_decode_init,
|
||||
NULL,
|
||||
NULL,
|
||||
adx_decode_frame,
|
||||
.name = "adpcm_adx",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_ADPCM_ADX,
|
||||
.priv_data_size = sizeof(ADXContext),
|
||||
.init = adx_decode_init,
|
||||
.decode = adx_decode_frame,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -184,14 +184,13 @@ static int adx_encode_frame(AVCodecContext *avctx,
|
|||
}
|
||||
|
||||
AVCodec ff_adpcm_adx_encoder = {
|
||||
"adpcm_adx",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_ADPCM_ADX,
|
||||
sizeof(ADXContext),
|
||||
adx_encode_init,
|
||||
adx_encode_frame,
|
||||
adx_encode_close,
|
||||
NULL,
|
||||
.name = "adpcm_adx",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_ADPCM_ADX,
|
||||
.priv_data_size = sizeof(ADXContext),
|
||||
.init = adx_encode_init,
|
||||
.encode = adx_encode_frame,
|
||||
.close = adx_encode_close,
|
||||
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@
|
|||
* @file
|
||||
* ALAC (Apple Lossless Audio Codec) decoder
|
||||
* @author 2005 David Hammerton
|
||||
*
|
||||
* For more information on the ALAC format, visit:
|
||||
* http://crazney.net/programs/itunes/alac.html
|
||||
* @see http://crazney.net/programs/itunes/alac.html
|
||||
*
|
||||
* Note: This decoder expects a 36- (0x24-)byte QuickTime atom to be
|
||||
* passed through the extradata[_size] fields. This atom is tacked onto
|
||||
|
|
@ -286,20 +284,9 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
|
|||
buffer_out[i+1] = val;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* 4 and 8 are very common cases (the only ones i've seen). these
|
||||
* should be unrolled and optimized
|
||||
*/
|
||||
if (predictor_coef_num == 4) {
|
||||
/* FIXME: optimized general case */
|
||||
return;
|
||||
}
|
||||
|
||||
if (predictor_coef_table == 8) {
|
||||
/* FIXME: optimized general case */
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* general case */
|
||||
if (predictor_coef_num > 0) {
|
||||
|
|
@ -692,13 +679,12 @@ static av_cold int alac_decode_close(AVCodecContext *avctx)
|
|||
}
|
||||
|
||||
AVCodec ff_alac_decoder = {
|
||||
"alac",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_ALAC,
|
||||
sizeof(ALACContext),
|
||||
alac_decode_init,
|
||||
NULL,
|
||||
alac_decode_close,
|
||||
alac_decode_frame,
|
||||
.name = "alac",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_ALAC,
|
||||
.priv_data_size = sizeof(ALACContext),
|
||||
.init = alac_decode_init,
|
||||
.close = alac_decode_close,
|
||||
.decode = alac_decode_frame,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -529,13 +529,13 @@ static av_cold int alac_encode_close(AVCodecContext *avctx)
|
|||
}
|
||||
|
||||
AVCodec ff_alac_encoder = {
|
||||
"alac",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_ALAC,
|
||||
sizeof(AlacEncodeContext),
|
||||
alac_encode_init,
|
||||
alac_encode_frame,
|
||||
alac_encode_close,
|
||||
.name = "alac",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_ALAC,
|
||||
.priv_data_size = sizeof(AlacEncodeContext),
|
||||
.init = alac_encode_init,
|
||||
.encode = alac_encode_frame,
|
||||
.close = alac_encode_close,
|
||||
.capabilities = CODEC_CAP_SMALL_LAST_FRAME,
|
||||
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ void avcodec_register_all(void)
|
|||
REGISTER_ENCDEC (FFV1, ffv1);
|
||||
REGISTER_ENCDEC (FFVHUFF, ffvhuff);
|
||||
REGISTER_ENCDEC (FLASHSV, flashsv);
|
||||
REGISTER_ENCODER (FLASHSV2, flashsv2);
|
||||
REGISTER_ENCDEC (FLASHSV2, flashsv2);
|
||||
REGISTER_DECODER (FLIC, flic);
|
||||
REGISTER_ENCDEC (FLV, flv);
|
||||
REGISTER_DECODER (FOURXM, fourxm);
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ static void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels,
|
|||
|
||||
void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->codec_id == CODEC_ID_H264 && avctx->bits_per_raw_sample > 8;
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
if (!high_bit_depth) {
|
||||
c->put_pixels_tab[0][0] = put_pixels16_axp_asm;
|
||||
|
|
@ -321,7 +321,8 @@ void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
|
|||
c->put_pixels_clamped = put_pixels_clamped_mvi_asm;
|
||||
c->add_pixels_clamped = add_pixels_clamped_mvi_asm;
|
||||
|
||||
c->get_pixels = get_pixels_mvi;
|
||||
if (!high_bit_depth)
|
||||
c->get_pixels = get_pixels_mvi;
|
||||
c->diff_pixels = diff_pixels_mvi;
|
||||
c->sad[0] = pix_abs16x16_mvi_asm;
|
||||
c->sad[1] = pix_abs8x8_mvi;
|
||||
|
|
@ -335,7 +336,7 @@ void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
|
|||
put_pixels_clamped_axp_p = c->put_pixels_clamped;
|
||||
add_pixels_clamped_axp_p = c->add_pixels_clamped;
|
||||
|
||||
if (!avctx->lowres &&
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
|
||||
(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEALPHA)) {
|
||||
c->idct_put = ff_simple_idct_put_axp;
|
||||
|
|
|
|||
|
|
@ -1739,14 +1739,13 @@ static av_cold void flush(AVCodecContext *avctx)
|
|||
|
||||
|
||||
AVCodec ff_als_decoder = {
|
||||
"als",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_MP4ALS,
|
||||
sizeof(ALSDecContext),
|
||||
decode_init,
|
||||
NULL,
|
||||
decode_end,
|
||||
decode_frame,
|
||||
.name = "als",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_MP4ALS,
|
||||
.priv_data_size = sizeof(ALSDecContext),
|
||||
.init = decode_init,
|
||||
.close = decode_end,
|
||||
.decode = decode_frame,
|
||||
.flush = flush,
|
||||
.capabilities = CODEC_CAP_SUBFRAMES,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"),
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
/** Maximum sharpening factor
|
||||
*
|
||||
* The specification says 0.8, which should be 13107, but the reference C code
|
||||
* uses 13017 instead. (Amusingly the same applies to SHARP_MAX in g729dec.c.)
|
||||
* uses 13017 instead. (Amusingly the same applies to SHARP_MAX in bitexact G.729.)
|
||||
*/
|
||||
#define SHARP_MAX 0.79449462890625
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ static enum Mode unpack_bitstream(AMRContext *p, const uint8_t *buf,
|
|||
}
|
||||
|
||||
|
||||
/// @defgroup amr_lpc_decoding AMR pitch LPC coefficient decoding functions
|
||||
/// @name AMR pitch LPC coefficient decoding functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -341,7 +341,7 @@ static void lsf2lsp_3(AMRContext *p)
|
|||
/// @}
|
||||
|
||||
|
||||
/// @defgroup amr_pitch_vector_decoding AMR pitch vector decoding functions
|
||||
/// @name AMR pitch vector decoding functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -403,7 +403,7 @@ static void decode_pitch_vector(AMRContext *p,
|
|||
/// @}
|
||||
|
||||
|
||||
/// @defgroup amr_algebraic_code_book AMR algebraic code book (fixed) vector decoding functions
|
||||
/// @name AMR algebraic code book (fixed) vector decoding functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -547,7 +547,7 @@ static void pitch_sharpening(AMRContext *p, int subframe, enum Mode mode,
|
|||
/// @}
|
||||
|
||||
|
||||
/// @defgroup amr_gain_decoding AMR gain decoding functions
|
||||
/// @name AMR gain decoding functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -633,7 +633,7 @@ static void decode_gains(AMRContext *p, const AMRNBSubframe *amr_subframe,
|
|||
/// @}
|
||||
|
||||
|
||||
/// @defgroup amr_pre_processing AMR pre-processing functions
|
||||
/// @name AMR preprocessing functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -751,7 +751,7 @@ static const float *anti_sparseness(AMRContext *p, AMRFixed *fixed_sparse,
|
|||
/// @}
|
||||
|
||||
|
||||
/// @defgroup amr_synthesis AMR synthesis functions
|
||||
/// @name AMR synthesis functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -812,7 +812,7 @@ static int synthesis(AMRContext *p, float *lpc,
|
|||
/// @}
|
||||
|
||||
|
||||
/// @defgroup amr_update AMR update functions
|
||||
/// @name AMR update functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -837,7 +837,7 @@ static void update_state(AMRContext *p)
|
|||
/// @}
|
||||
|
||||
|
||||
/// @defgroup amr_postproc AMR Post processing functions
|
||||
/// @name AMR Postprocessing functions
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
|
@ -936,7 +936,8 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||
|
||||
p->cur_frame_mode = unpack_bitstream(p, buf, buf_size);
|
||||
if (p->cur_frame_mode == MODE_DTX) {
|
||||
av_log_missing_feature(avctx, "dtx mode", 1);
|
||||
av_log_missing_feature(avctx, "dtx mode", 0);
|
||||
av_log(avctx, AV_LOG_INFO, "Note: libopencore_amrnb supports dtx\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,14 +184,13 @@ static av_cold int decode_end(AVCodecContext *avctx)
|
|||
}
|
||||
|
||||
AVCodec ff_anm_decoder = {
|
||||
"anm",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
CODEC_ID_ANM,
|
||||
sizeof(AnmContext),
|
||||
decode_init,
|
||||
NULL,
|
||||
decode_end,
|
||||
decode_frame,
|
||||
CODEC_CAP_DR1,
|
||||
.name = "anm",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.id = CODEC_ID_ANM,
|
||||
.priv_data_size = sizeof(AnmContext),
|
||||
.init = decode_init,
|
||||
.close = decode_end,
|
||||
.decode = decode_frame,
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ static void draw_char(AVCodecContext *avctx, int c)
|
|||
|
||||
/**
|
||||
* Execute ANSI escape code
|
||||
* @param <0 error
|
||||
* @return 0 on success, negative on error
|
||||
*/
|
||||
static int execute_code(AVCodecContext * avctx, int c)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ static av_cold int ape_decode_close(AVCodecContext * avctx)
|
|||
}
|
||||
|
||||
/**
|
||||
* @defgroup rangecoder APE range decoder
|
||||
* @name APE range decoding functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
@ -885,14 +885,13 @@ static void ape_flush(AVCodecContext *avctx)
|
|||
}
|
||||
|
||||
AVCodec ff_ape_decoder = {
|
||||
"ape",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_APE,
|
||||
sizeof(APEContext),
|
||||
ape_decode_init,
|
||||
NULL,
|
||||
ape_decode_close,
|
||||
ape_decode_frame,
|
||||
.name = "ape",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
.id = CODEC_ID_APE,
|
||||
.priv_data_size = sizeof(APEContext),
|
||||
.init = ape_decode_init,
|
||||
.close = ape_decode_close,
|
||||
.decode = ape_decode_frame,
|
||||
.capabilities = CODEC_CAP_SUBFRAMES,
|
||||
.flush = ape_flush,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
|
||||
|
|
|
|||
|
|
@ -114,12 +114,15 @@ static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
|
|||
"vmov d1, %2, %3 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %0, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %1, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %2, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"vmov d4, %0, %1 \n\t"
|
||||
"and %3, %5, #1<<31 \n\t"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ function ff_ac3_update_bap_counts_arm, export=1
|
|||
lsl r3, lr, #1
|
||||
ldrh r12, [r0, r3]
|
||||
subs r2, r2, #1
|
||||
it gt
|
||||
ldrbgt lr, [r1], #1
|
||||
add r12, r12, #1
|
||||
strh r12, [r0, r3]
|
||||
|
|
|
|||
|
|
@ -37,14 +37,16 @@ function ff_ac3_bit_alloc_calc_bap_armv6, export=1
|
|||
ldrb r10, [r4], #1
|
||||
1:
|
||||
ldrsh r9, [r0], #2 @ mask[band]
|
||||
ldr r8, =0x1fe0
|
||||
mov r8, #0xff0
|
||||
sub r9, r9, r12 @ - snr_offset
|
||||
mov r11, r10
|
||||
ldrb r10, [r4], #1 @ band_start_tab[band++]
|
||||
subs r9, r9, r5 @ - floor
|
||||
it lt
|
||||
movlt r9, #0
|
||||
cmp r10, r3 @ - end
|
||||
and r9, r9, r8 @ & 0x1fe0
|
||||
and r9, r9, r8, lsl #1 @ & 0x1fe0
|
||||
ite gt
|
||||
subgt r8, r3, r11
|
||||
suble r8, r10, r11
|
||||
add r9, r9, r5 @ + floor => m
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ endfunc
|
|||
|
||||
function ff_ac3_exponent_min_neon, export=1
|
||||
cmp r1, #0
|
||||
it eq
|
||||
bxeq lr
|
||||
push {lr}
|
||||
mov r12, #256
|
||||
|
|
@ -94,19 +95,14 @@ function ff_float_to_fixed24_neon, export=1
|
|||
endfunc
|
||||
|
||||
function ff_ac3_extract_exponents_neon, export=1
|
||||
vmov.i32 q14, #24
|
||||
vmov.i32 q15, #8
|
||||
1:
|
||||
vld1.32 {q0}, [r1,:128]
|
||||
vld1.32 {q0}, [r1,:128]!
|
||||
vabs.s32 q1, q0
|
||||
vclz.i32 q3, q1
|
||||
vsub.i32 q3, q3, q15
|
||||
vcge.s32 q2, q3, q14
|
||||
vbit q3, q14, q2
|
||||
vbic q0, q0, q2
|
||||
vmovn.i32 d6, q3
|
||||
vmovn.i16 d6, q3
|
||||
vst1.32 {q0}, [r1,:128]!
|
||||
vst1.32 {d6[0]}, [r0,:32]!
|
||||
subs r2, r2, #4
|
||||
bgt 1b
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@
|
|||
#endif
|
||||
|
||||
/* MpegEncContext */
|
||||
#define Y_DC_SCALE 0xb4
|
||||
#define C_DC_SCALE 0xb8
|
||||
#define AC_PRED 0xbc
|
||||
#define BLOCK_LAST_INDEX 0xc0
|
||||
#define H263_AIC 0xf0
|
||||
#define INTER_SCANTAB_RASTER_END 0x138
|
||||
#define Y_DC_SCALE 0xa8
|
||||
#define C_DC_SCALE 0xac
|
||||
#define AC_PRED 0xb0
|
||||
#define BLOCK_LAST_INDEX 0xb4
|
||||
#define H263_AIC 0xe4
|
||||
#define INTER_SCANTAB_RASTER_END 0x12c
|
||||
|
||||
#endif /* AVCODEC_ARM_ASM_OFFSETS_H */
|
||||
|
|
|
|||
|
|
@ -24,9 +24,18 @@
|
|||
# define ELF
|
||||
#else
|
||||
# define ELF @
|
||||
#endif
|
||||
|
||||
#if CONFIG_THUMB
|
||||
# define A @
|
||||
# define T
|
||||
#else
|
||||
# define A
|
||||
# define T @
|
||||
#endif
|
||||
|
||||
.syntax unified
|
||||
T .thumb
|
||||
|
||||
.macro require8 val=1
|
||||
ELF .eabi_attribute 24, \val
|
||||
|
|
@ -82,6 +91,90 @@ ELF .size \name, . - \name
|
|||
#endif
|
||||
.endm
|
||||
|
||||
.macro ldr_pre rt, rn, rm:vararg
|
||||
A ldr \rt, [\rn, \rm]!
|
||||
T add \rn, \rn, \rm
|
||||
T ldr \rt, [\rn]
|
||||
.endm
|
||||
|
||||
.macro ldr_post rt, rn, rm:vararg
|
||||
A ldr \rt, [\rn], \rm
|
||||
T ldr \rt, [\rn]
|
||||
T add \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
.macro ldrd_reg rt, rt2, rn, rm
|
||||
A ldrd \rt, \rt2, [\rn, \rm]
|
||||
T add \rt, \rn, \rm
|
||||
T ldrd \rt, \rt2, [\rt]
|
||||
.endm
|
||||
|
||||
.macro ldrd_post rt, rt2, rn, rm
|
||||
A ldrd \rt, \rt2, [\rn], \rm
|
||||
T ldrd \rt, \rt2, [\rn]
|
||||
T add \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
.macro ldrh_pre rt, rn, rm
|
||||
A ldrh \rt, [\rn, \rm]!
|
||||
T add \rn, \rn, \rm
|
||||
T ldrh \rt, [\rn]
|
||||
.endm
|
||||
|
||||
.macro ldrh_dpre rt, rn, rm
|
||||
A ldrh \rt, [\rn, -\rm]!
|
||||
T sub \rn, \rn, \rm
|
||||
T ldrh \rt, [\rn]
|
||||
.endm
|
||||
|
||||
.macro ldrh_post rt, rn, rm
|
||||
A ldrh \rt, [\rn], \rm
|
||||
T ldrh \rt, [\rn]
|
||||
T add \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
.macro str_post rt, rn, rm:vararg
|
||||
A str \rt, [\rn], \rm
|
||||
T str \rt, [\rn]
|
||||
T add \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
.macro strb_post rt, rn, rm:vararg
|
||||
A strb \rt, [\rn], \rm
|
||||
T strb \rt, [\rn]
|
||||
T add \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
.macro strd_post rt, rt2, rn, rm
|
||||
A strd \rt, \rt2, [\rn], \rm
|
||||
T strd \rt, \rt2, [\rn]
|
||||
T add \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
.macro strh_pre rt, rn, rm
|
||||
A strh \rt, [\rn, \rm]!
|
||||
T add \rn, \rn, \rm
|
||||
T strh \rt, [\rn]
|
||||
.endm
|
||||
|
||||
.macro strh_dpre rt, rn, rm
|
||||
A strh \rt, [\rn, -\rm]!
|
||||
T sub \rn, \rn, \rm
|
||||
T strh \rt, [\rn]
|
||||
.endm
|
||||
|
||||
.macro strh_post rt, rn, rm
|
||||
A strh \rt, [\rn], \rm
|
||||
T strh \rt, [\rn]
|
||||
T add \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
.macro strh_dpost rt, rn, rm
|
||||
A strh \rt, [\rn], -\rm
|
||||
T strh \rt, [\rn]
|
||||
T sub \rn, \rn, \rm
|
||||
.endm
|
||||
|
||||
#if HAVE_VFP_ARGS
|
||||
.eabi_attribute 28, 1
|
||||
# define VFP
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ function ff_dca_lfe_fir_neon, export=1
|
|||
add r5, r2, #256*4-16 @ cf1
|
||||
sub r1, r1, #12
|
||||
cmp r3, #32
|
||||
ite eq
|
||||
moveq r6, #256/32
|
||||
movne r6, #256/64
|
||||
NOVFP vldr s0, [sp, #16] @ scale
|
||||
|
|
|
|||
|
|
@ -24,11 +24,6 @@
|
|||
|
||||
preserve8
|
||||
|
||||
#if !HAVE_PLD
|
||||
.macro pld reg
|
||||
.endm
|
||||
#endif
|
||||
|
||||
#if HAVE_ARMV5TE
|
||||
function ff_prefetch_arm, export=1
|
||||
subs r2, r2, #1
|
||||
|
|
@ -37,6 +32,8 @@ function ff_prefetch_arm, export=1
|
|||
bne ff_prefetch_arm
|
||||
bx lr
|
||||
endfunc
|
||||
#else
|
||||
#define pld @
|
||||
#endif
|
||||
|
||||
.macro ALIGN_QWORD_D shift, Rd0, Rd1, Rd2, Rd3, Rn0, Rn1, Rn2, Rn3, Rn4
|
||||
|
|
@ -554,10 +551,12 @@ endfunc
|
|||
and r9, r5, r14
|
||||
and r10, r6, r14
|
||||
and r11, r7, r14
|
||||
it eq
|
||||
andeq r14, r14, r14, \rnd #1
|
||||
add r8, r8, r10
|
||||
add r9, r9, r11
|
||||
ldr r12, =0xfcfcfcfc >> 2
|
||||
itt eq
|
||||
addeq r8, r8, r14
|
||||
addeq r9, r9, r14
|
||||
and r4, r12, r4, lsr #2
|
||||
|
|
@ -638,8 +637,10 @@ function ff_add_pixels_clamped_arm, export=1
|
|||
mvn r5, r5
|
||||
mvn r7, r7
|
||||
tst r6, #0x100
|
||||
it ne
|
||||
movne r6, r5, lsr #24
|
||||
tst r8, #0x100
|
||||
it ne
|
||||
movne r8, r7, lsr #24
|
||||
mov r9, r6
|
||||
ldrsh r5, [r0, #4] /* moved form [A] */
|
||||
|
|
@ -654,8 +655,10 @@ function ff_add_pixels_clamped_arm, export=1
|
|||
mvn r5, r5
|
||||
mvn r7, r7
|
||||
tst r6, #0x100
|
||||
it ne
|
||||
movne r6, r5, lsr #24
|
||||
tst r8, #0x100
|
||||
it ne
|
||||
movne r8, r7, lsr #24
|
||||
orr r9, r9, r6, lsl #16
|
||||
ldr r4, [r1, #4] /* moved form [B] */
|
||||
|
|
@ -676,8 +679,10 @@ function ff_add_pixels_clamped_arm, export=1
|
|||
mvn r5, r5
|
||||
mvn r7, r7
|
||||
tst r6, #0x100
|
||||
it ne
|
||||
movne r6, r5, lsr #24
|
||||
tst r8, #0x100
|
||||
it ne
|
||||
movne r8, r7, lsr #24
|
||||
mov r9, r6
|
||||
ldrsh r5, [r0, #12] /* moved from [D] */
|
||||
|
|
@ -692,8 +697,10 @@ function ff_add_pixels_clamped_arm, export=1
|
|||
mvn r5, r5
|
||||
mvn r7, r7
|
||||
tst r6, #0x100
|
||||
it ne
|
||||
movne r6, r5, lsr #24
|
||||
tst r8, #0x100
|
||||
it ne
|
||||
movne r8, r7, lsr #24
|
||||
orr r9, r9, r6, lsl #16
|
||||
add r0, r0, #16 /* moved from [E] */
|
||||
|
|
|
|||
|
|
@ -47,16 +47,16 @@ function ff_put_pixels16_armv6, export=1
|
|||
ldr r5, [r1, #4]
|
||||
ldr r6, [r1, #8]
|
||||
ldr r7, [r1, #12]
|
||||
ldr r4, [r1], r2
|
||||
ldr_post r4, r1, r2
|
||||
strd r6, r7, [r0, #8]
|
||||
ldr r9, [r1, #4]
|
||||
strd r4, r5, [r0], r2
|
||||
strd_post r4, r5, r0, r2
|
||||
ldr r10, [r1, #8]
|
||||
ldr r11, [r1, #12]
|
||||
ldr r8, [r1], r2
|
||||
ldr_post r8, r1, r2
|
||||
strd r10, r11, [r0, #8]
|
||||
subs r3, r3, #2
|
||||
strd r8, r9, [r0], r2
|
||||
strd_post r8, r9, r0, r2
|
||||
bne 1b
|
||||
|
||||
pop {r4-r11}
|
||||
|
|
@ -67,12 +67,12 @@ function ff_put_pixels8_armv6, export=1
|
|||
push {r4-r7}
|
||||
1:
|
||||
ldr r5, [r1, #4]
|
||||
ldr r4, [r1], r2
|
||||
ldr_post r4, r1, r2
|
||||
ldr r7, [r1, #4]
|
||||
strd r4, r5, [r0], r2
|
||||
ldr r6, [r1], r2
|
||||
strd_post r4, r5, r0, r2
|
||||
ldr_post r6, r1, r2
|
||||
subs r3, r3, #2
|
||||
strd r6, r7, [r0], r2
|
||||
strd_post r6, r7, r0, r2
|
||||
bne 1b
|
||||
|
||||
pop {r4-r7}
|
||||
|
|
@ -90,7 +90,7 @@ function ff_put_pixels8_x2_armv6, export=1
|
|||
ldr r5, [r1, #4]
|
||||
ldr r7, [r1, #5]
|
||||
lsr r6, r4, #8
|
||||
ldr r8, [r1, r2]!
|
||||
ldr_pre r8, r1, r2
|
||||
orr r6, r6, r5, lsl #24
|
||||
ldr r9, [r1, #4]
|
||||
ldr r11, [r1, #5]
|
||||
|
|
@ -112,9 +112,9 @@ function ff_put_pixels8_x2_armv6, export=1
|
|||
uhadd8 r9, r9, r11
|
||||
and r6, r6, r12
|
||||
uadd8 r8, r8, r14
|
||||
strd r4, r5, [r0], r2
|
||||
strd_post r4, r5, r0, r2
|
||||
uadd8 r9, r9, r6
|
||||
strd r8, r9, [r0], r2
|
||||
strd_post r8, r9, r0, r2
|
||||
bne 1b
|
||||
|
||||
pop {r4-r11, pc}
|
||||
|
|
@ -127,7 +127,7 @@ function ff_put_pixels8_y2_armv6, export=1
|
|||
orr r12, r12, r12, lsl #16
|
||||
ldr r4, [r1]
|
||||
ldr r5, [r1, #4]
|
||||
ldr r6, [r1, r2]!
|
||||
ldr_pre r6, r1, r2
|
||||
ldr r7, [r1, #4]
|
||||
1:
|
||||
subs r3, r3, #2
|
||||
|
|
@ -136,7 +136,7 @@ function ff_put_pixels8_y2_armv6, export=1
|
|||
uhadd8 r9, r5, r7
|
||||
eor r11, r5, r7
|
||||
and r10, r10, r12
|
||||
ldr r4, [r1, r2]!
|
||||
ldr_pre r4, r1, r2
|
||||
uadd8 r8, r8, r10
|
||||
and r11, r11, r12
|
||||
uadd8 r9, r9, r11
|
||||
|
|
@ -148,11 +148,11 @@ function ff_put_pixels8_y2_armv6, export=1
|
|||
eor r7, r5, r7
|
||||
uadd8 r10, r10, r6
|
||||
and r7, r7, r12
|
||||
ldr r6, [r1, r2]!
|
||||
ldr_pre r6, r1, r2
|
||||
uadd8 r11, r11, r7
|
||||
strd r8, r9, [r0], r2
|
||||
strd_post r8, r9, r0, r2
|
||||
ldr r7, [r1, #4]
|
||||
strd r10, r11, [r0], r2
|
||||
strd_post r10, r11, r0, r2
|
||||
bne 1b
|
||||
|
||||
pop {r4-r11}
|
||||
|
|
@ -166,7 +166,7 @@ function ff_put_pixels8_x2_no_rnd_armv6, export=1
|
|||
ldr r4, [r1]
|
||||
ldr r5, [r1, #4]
|
||||
ldr r7, [r1, #5]
|
||||
ldr r8, [r1, r2]!
|
||||
ldr_pre r8, r1, r2
|
||||
ldr r9, [r1, #4]
|
||||
ldr r14, [r1, #5]
|
||||
add r1, r1, r2
|
||||
|
|
@ -191,16 +191,16 @@ function ff_put_pixels8_y2_no_rnd_armv6, export=1
|
|||
push {r4-r9, lr}
|
||||
ldr r4, [r1]
|
||||
ldr r5, [r1, #4]
|
||||
ldr r6, [r1, r2]!
|
||||
ldr_pre r6, r1, r2
|
||||
ldr r7, [r1, #4]
|
||||
1:
|
||||
subs r3, r3, #2
|
||||
uhadd8 r8, r4, r6
|
||||
ldr r4, [r1, r2]!
|
||||
ldr_pre r4, r1, r2
|
||||
uhadd8 r9, r5, r7
|
||||
ldr r5, [r1, #4]
|
||||
uhadd8 r12, r4, r6
|
||||
ldr r6, [r1, r2]!
|
||||
ldr_pre r6, r1, r2
|
||||
uhadd8 r14, r5, r7
|
||||
ldr r7, [r1, #4]
|
||||
stm r0, {r8,r9}
|
||||
|
|
@ -220,44 +220,44 @@ function ff_avg_pixels8_armv6, export=1
|
|||
orr lr, lr, lr, lsl #16
|
||||
ldrd r4, r5, [r0]
|
||||
ldr r10, [r1, #4]
|
||||
ldr r9, [r1], r2
|
||||
ldr_post r9, r1, r2
|
||||
subs r3, r3, #2
|
||||
1:
|
||||
pld [r1, r2]
|
||||
eor r8, r4, r9
|
||||
uhadd8 r4, r4, r9
|
||||
eor r12, r5, r10
|
||||
ldrd r6, r7, [r0, r2]
|
||||
ldrd_reg r6, r7, r0, r2
|
||||
uhadd8 r5, r5, r10
|
||||
and r8, r8, lr
|
||||
ldr r10, [r1, #4]
|
||||
and r12, r12, lr
|
||||
uadd8 r4, r4, r8
|
||||
ldr r9, [r1], r2
|
||||
ldr_post r9, r1, r2
|
||||
eor r8, r6, r9
|
||||
uadd8 r5, r5, r12
|
||||
pld [r1, r2, lsl #1]
|
||||
eor r12, r7, r10
|
||||
uhadd8 r6, r6, r9
|
||||
strd r4, r5, [r0], r2
|
||||
strd_post r4, r5, r0, r2
|
||||
uhadd8 r7, r7, r10
|
||||
beq 2f
|
||||
and r8, r8, lr
|
||||
ldrd r4, r5, [r0, r2]
|
||||
ldrd_reg r4, r5, r0, r2
|
||||
uadd8 r6, r6, r8
|
||||
ldr r10, [r1, #4]
|
||||
and r12, r12, lr
|
||||
subs r3, r3, #2
|
||||
uadd8 r7, r7, r12
|
||||
ldr r9, [r1], r2
|
||||
strd r6, r7, [r0], r2
|
||||
ldr_post r9, r1, r2
|
||||
strd_post r6, r7, r0, r2
|
||||
b 1b
|
||||
2:
|
||||
and r8, r8, lr
|
||||
and r12, r12, lr
|
||||
uadd8 r6, r6, r8
|
||||
uadd8 r7, r7, r12
|
||||
strd r6, r7, [r0], r2
|
||||
strd_post r6, r7, r0, r2
|
||||
|
||||
pop {r4-r10, pc}
|
||||
endfunc
|
||||
|
|
@ -284,7 +284,7 @@ function ff_add_pixels_clamped_armv6, export=1
|
|||
orr r6, r8, r5, lsl #8
|
||||
orr r7, r4, lr, lsl #8
|
||||
subs r3, r3, #1
|
||||
strd r6, r7, [r1], r2
|
||||
strd_post r6, r7, r1, r2
|
||||
bgt 1b
|
||||
pop {r4-r8,pc}
|
||||
endfunc
|
||||
|
|
@ -294,7 +294,7 @@ function ff_get_pixels_armv6, export=1
|
|||
push {r4-r8, lr}
|
||||
mov lr, #8
|
||||
1:
|
||||
ldrd r4, r5, [r1], r2
|
||||
ldrd_post r4, r5, r1, r2
|
||||
subs lr, lr, #1
|
||||
uxtb16 r6, r4
|
||||
uxtb16 r4, r4, ror #8
|
||||
|
|
@ -317,8 +317,8 @@ function ff_diff_pixels_armv6, export=1
|
|||
push {r4-r9, lr}
|
||||
mov lr, #8
|
||||
1:
|
||||
ldrd r4, r5, [r1], r3
|
||||
ldrd r6, r7, [r2], r3
|
||||
ldrd_post r4, r5, r1, r3
|
||||
ldrd_post r6, r7, r2, r3
|
||||
uxtb16 r8, r4
|
||||
uxtb16 r4, r4, ror #8
|
||||
uxtb16 r9, r6
|
||||
|
|
@ -492,19 +492,19 @@ function ff_pix_abs8_armv6, export=1
|
|||
push {r4-r9, lr}
|
||||
mov r0, #0
|
||||
mov lr, #0
|
||||
ldrd r4, r5, [r1], r3
|
||||
ldrd_post r4, r5, r1, r3
|
||||
1:
|
||||
subs r12, r12, #2
|
||||
ldr r7, [r2, #4]
|
||||
ldr r6, [r2], r3
|
||||
ldrd r8, r9, [r1], r3
|
||||
ldr_post r6, r2, r3
|
||||
ldrd_post r8, r9, r1, r3
|
||||
usada8 r0, r4, r6, r0
|
||||
pld [r2, r3]
|
||||
usada8 lr, r5, r7, lr
|
||||
ldr r7, [r2, #4]
|
||||
ldr r6, [r2], r3
|
||||
ldr_post r6, r2, r3
|
||||
beq 2f
|
||||
ldrd r4, r5, [r1], r3
|
||||
ldrd_post r4, r5, r1, r3
|
||||
usada8 r0, r8, r6, r0
|
||||
pld [r2, r3]
|
||||
usada8 lr, r9, r7, lr
|
||||
|
|
@ -613,7 +613,7 @@ function ff_pix_sum_armv6, export=1
|
|||
ldr r7, [r0, #12]
|
||||
usada8 r2, r6, lr, r2
|
||||
beq 2f
|
||||
ldr r4, [r0, r1]!
|
||||
ldr_pre r4, r0, r1
|
||||
usada8 r3, r7, lr, r3
|
||||
bgt 1b
|
||||
2:
|
||||
|
|
|
|||
|
|
@ -75,12 +75,12 @@ static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
|
|||
|
||||
void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->codec_id == CODEC_ID_H264 && avctx->bits_per_raw_sample > 8;
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
ff_put_pixels_clamped = c->put_pixels_clamped;
|
||||
ff_add_pixels_clamped = c->add_pixels_clamped;
|
||||
|
||||
if (!avctx->lowres) {
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
|
||||
if(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_ARM){
|
||||
c->idct_put = j_rev_dct_arm_put;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ void ff_prefetch_arm(void *mem, int stride, int h);
|
|||
|
||||
void av_cold ff_dsputil_init_armv5te(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
if (!avctx->lowres && (avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
|
||||
(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
|
||||
c->idct_put = ff_simple_idct_put_armv5te;
|
||||
c->idct_add = ff_simple_idct_add_armv5te;
|
||||
c->idct = ff_simple_idct_armv5te;
|
||||
|
|
|
|||
|
|
@ -72,10 +72,11 @@ int ff_pix_sum_armv6(uint8_t *pix, int line_size);
|
|||
|
||||
void av_cold ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->codec_id == CODEC_ID_H264 && avctx->bits_per_raw_sample > 8;
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
if (!avctx->lowres && (avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
|
||||
(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
|
||||
c->idct_put = ff_simple_idct_put_armv6;
|
||||
c->idct_add = ff_simple_idct_add_armv6;
|
||||
c->idct = ff_simple_idct_armv6;
|
||||
|
|
@ -105,8 +106,9 @@ void av_cold ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx)
|
|||
c->avg_pixels_tab[1][0] = ff_avg_pixels8_armv6;
|
||||
}
|
||||
|
||||
if (!high_bit_depth)
|
||||
c->get_pixels = ff_get_pixels_armv6;
|
||||
c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
|
||||
c->get_pixels = ff_get_pixels_armv6;
|
||||
c->diff_pixels = ff_diff_pixels_armv6;
|
||||
|
||||
c->pix_abs[0][0] = ff_pix_abs16_armv6;
|
||||
|
|
|
|||
|
|
@ -143,14 +143,6 @@ void ff_vector_fmul_window_neon(float *dst, const float *src0,
|
|||
const float *src1, const float *win, int len);
|
||||
void ff_vector_fmul_scalar_neon(float *dst, const float *src, float mul,
|
||||
int len);
|
||||
void ff_vector_fmul_sv_scalar_2_neon(float *dst, const float *src,
|
||||
const float **vp, float mul, int len);
|
||||
void ff_vector_fmul_sv_scalar_4_neon(float *dst, const float *src,
|
||||
const float **vp, float mul, int len);
|
||||
void ff_sv_fmul_scalar_2_neon(float *dst, const float **vp, float mul,
|
||||
int len);
|
||||
void ff_sv_fmul_scalar_4_neon(float *dst, const float **vp, float mul,
|
||||
int len);
|
||||
void ff_butterflies_float_neon(float *v1, float *v2, int len);
|
||||
float ff_scalarproduct_float_neon(const float *v1, const float *v2, int len);
|
||||
void ff_vector_fmul_reverse_neon(float *dst, const float *src0,
|
||||
|
|
@ -160,6 +152,8 @@ void ff_vector_fmul_add_neon(float *dst, const float *src0, const float *src1,
|
|||
|
||||
void ff_vector_clipf_neon(float *dst, const float *src, float min, float max,
|
||||
int len);
|
||||
void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
|
||||
int32_t max, unsigned int len);
|
||||
|
||||
void ff_vorbis_inverse_coupling_neon(float *mag, float *ang, int blocksize);
|
||||
|
||||
|
|
@ -173,9 +167,9 @@ void ff_apply_window_int16_neon(int16_t *dst, const int16_t *src,
|
|||
|
||||
void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->codec_id == CODEC_ID_H264 && avctx->bits_per_raw_sample > 8;
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
if (!avctx->lowres) {
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
|
||||
if (avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLENEON) {
|
||||
c->idct_put = ff_simple_idct_put_neon;
|
||||
|
|
@ -316,12 +310,7 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
|
|||
c->vector_fmul_reverse = ff_vector_fmul_reverse_neon;
|
||||
c->vector_fmul_add = ff_vector_fmul_add_neon;
|
||||
c->vector_clipf = ff_vector_clipf_neon;
|
||||
|
||||
c->vector_fmul_sv_scalar[0] = ff_vector_fmul_sv_scalar_2_neon;
|
||||
c->vector_fmul_sv_scalar[1] = ff_vector_fmul_sv_scalar_4_neon;
|
||||
|
||||
c->sv_fmul_scalar[0] = ff_sv_fmul_scalar_2_neon;
|
||||
c->sv_fmul_scalar[1] = ff_sv_fmul_scalar_4_neon;
|
||||
c->vector_clip_int32 = ff_vector_clip_int32_neon;
|
||||
|
||||
if (CONFIG_VORBIS_DECODER)
|
||||
c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_neon;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ static void nop(uint8_t *block, const uint8_t *pixels, int line_size, int h)
|
|||
void ff_dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
int mm_flags = AV_CPU_FLAG_IWMMXT; /* multimedia extension flags */
|
||||
const int high_bit_depth = avctx->codec_id == CODEC_ID_H264 && avctx->bits_per_raw_sample > 8;
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
if (avctx->dsp_mask) {
|
||||
if (avctx->dsp_mask & AV_CPU_FLAG_FORCE)
|
||||
|
|
|
|||
|
|
@ -531,6 +531,7 @@ function ff_vorbis_inverse_coupling_neon, export=1
|
|||
|
||||
2: vst1.32 {d2-d3}, [r3, :128]!
|
||||
vst1.32 {d0-d1}, [r12,:128]!
|
||||
it lt
|
||||
bxlt lr
|
||||
|
||||
3: vld1.32 {d2-d3}, [r1,:128]
|
||||
|
|
@ -575,6 +576,7 @@ NOVFP vdup.32 q8, r2
|
|||
2: vst1.32 {q2},[r0,:128]!
|
||||
vst1.32 {q3},[r0,:128]!
|
||||
ands len, len, #15
|
||||
it eq
|
||||
bxeq lr
|
||||
3: vld1.32 {q0},[r1,:128]!
|
||||
vmul.f32 q0, q0, q8
|
||||
|
|
@ -585,109 +587,6 @@ NOVFP vdup.32 q8, r2
|
|||
.unreq len
|
||||
endfunc
|
||||
|
||||
function ff_vector_fmul_sv_scalar_2_neon, export=1
|
||||
VFP vdup.32 d16, d0[0]
|
||||
NOVFP vdup.32 d16, r3
|
||||
NOVFP ldr r3, [sp]
|
||||
vld1.32 {d0},[r1,:64]!
|
||||
vld1.32 {d1},[r1,:64]!
|
||||
1: subs r3, r3, #4
|
||||
vmul.f32 d4, d0, d16
|
||||
vmul.f32 d5, d1, d16
|
||||
ldr r12, [r2], #4
|
||||
vld1.32 {d2},[r12,:64]
|
||||
ldr r12, [r2], #4
|
||||
vld1.32 {d3},[r12,:64]
|
||||
vmul.f32 d4, d4, d2
|
||||
vmul.f32 d5, d5, d3
|
||||
beq 2f
|
||||
vld1.32 {d0},[r1,:64]!
|
||||
vld1.32 {d1},[r1,:64]!
|
||||
vst1.32 {d4},[r0,:64]!
|
||||
vst1.32 {d5},[r0,:64]!
|
||||
b 1b
|
||||
2: vst1.32 {d4},[r0,:64]!
|
||||
vst1.32 {d5},[r0,:64]!
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function ff_vector_fmul_sv_scalar_4_neon, export=1
|
||||
VFP vdup.32 q10, d0[0]
|
||||
NOVFP vdup.32 q10, r3
|
||||
NOVFP ldr r3, [sp]
|
||||
push {lr}
|
||||
bics lr, r3, #7
|
||||
beq 3f
|
||||
vld1.32 {q0},[r1,:128]!
|
||||
vld1.32 {q2},[r1,:128]!
|
||||
1: ldr r12, [r2], #4
|
||||
vld1.32 {q1},[r12,:128]
|
||||
ldr r12, [r2], #4
|
||||
vld1.32 {q3},[r12,:128]
|
||||
vmul.f32 q8, q0, q10
|
||||
vmul.f32 q8, q8, q1
|
||||
vmul.f32 q9, q2, q10
|
||||
vmul.f32 q9, q9, q3
|
||||
subs lr, lr, #8
|
||||
beq 2f
|
||||
vld1.32 {q0},[r1,:128]!
|
||||
vld1.32 {q2},[r1,:128]!
|
||||
vst1.32 {q8},[r0,:128]!
|
||||
vst1.32 {q9},[r0,:128]!
|
||||
b 1b
|
||||
2: vst1.32 {q8},[r0,:128]!
|
||||
vst1.32 {q9},[r0,:128]!
|
||||
ands r3, r3, #7
|
||||
popeq {pc}
|
||||
3: vld1.32 {q0},[r1,:128]!
|
||||
ldr r12, [r2], #4
|
||||
vld1.32 {q1},[r12,:128]
|
||||
vmul.f32 q0, q0, q10
|
||||
vmul.f32 q0, q0, q1
|
||||
vst1.32 {q0},[r0,:128]!
|
||||
subs r3, r3, #4
|
||||
bgt 3b
|
||||
pop {pc}
|
||||
endfunc
|
||||
|
||||
function ff_sv_fmul_scalar_2_neon, export=1
|
||||
VFP len .req r2
|
||||
NOVFP len .req r3
|
||||
VFP vdup.32 q8, d0[0]
|
||||
NOVFP vdup.32 q8, r2
|
||||
ldr r12, [r1], #4
|
||||
vld1.32 {d0},[r12,:64]
|
||||
ldr r12, [r1], #4
|
||||
vld1.32 {d1},[r12,:64]
|
||||
1: vmul.f32 q1, q0, q8
|
||||
subs len, len, #4
|
||||
beq 2f
|
||||
ldr r12, [r1], #4
|
||||
vld1.32 {d0},[r12,:64]
|
||||
ldr r12, [r1], #4
|
||||
vld1.32 {d1},[r12,:64]
|
||||
vst1.32 {q1},[r0,:128]!
|
||||
b 1b
|
||||
2: vst1.32 {q1},[r0,:128]!
|
||||
bx lr
|
||||
.unreq len
|
||||
endfunc
|
||||
|
||||
function ff_sv_fmul_scalar_4_neon, export=1
|
||||
VFP len .req r2
|
||||
NOVFP len .req r3
|
||||
VFP vdup.32 q8, d0[0]
|
||||
NOVFP vdup.32 q8, r2
|
||||
1: ldr r12, [r1], #4
|
||||
vld1.32 {q0},[r12,:128]
|
||||
vmul.f32 q0, q0, q8
|
||||
vst1.32 {q0},[r0,:128]!
|
||||
subs len, len, #4
|
||||
bgt 1b
|
||||
bx lr
|
||||
.unreq len
|
||||
endfunc
|
||||
|
||||
function ff_butterflies_float_neon, export=1
|
||||
1: vld1.32 {q0},[r0,:128]
|
||||
vld1.32 {q1},[r1,:128]
|
||||
|
|
@ -812,3 +711,19 @@ function ff_apply_window_int16_neon, export=1
|
|||
|
||||
pop {r4,pc}
|
||||
endfunc
|
||||
|
||||
function ff_vector_clip_int32_neon, export=1
|
||||
vdup.32 q0, r2
|
||||
vdup.32 q1, r3
|
||||
ldr r2, [sp]
|
||||
1:
|
||||
vld1.32 {q2-q3}, [r1,:128]!
|
||||
vmin.s32 q2, q2, q1
|
||||
vmin.s32 q3, q3, q1
|
||||
vmax.s32 q2, q2, q0
|
||||
vmax.s32 q3, q3, q0
|
||||
vst1.32 {q2-q3}, [r0,:128]!
|
||||
subs r2, r2, #8
|
||||
bgt 1b
|
||||
bx lr
|
||||
endfunc
|
||||
|
|
|
|||
|
|
@ -55,18 +55,23 @@ function ff_vector_fmul_vfp, export=1
|
|||
1:
|
||||
subs r3, r3, #16
|
||||
vmul.f32 s12, s4, s12
|
||||
itttt ge
|
||||
vldmiage r1!, {s16-s19}
|
||||
vldmiage r2!, {s24-s27}
|
||||
vldmiage r1!, {s20-s23}
|
||||
vldmiage r2!, {s28-s31}
|
||||
it ge
|
||||
vmulge.f32 s24, s16, s24
|
||||
vstmia r0!, {s8-s11}
|
||||
vstmia r0!, {s12-s15}
|
||||
it ge
|
||||
vmulge.f32 s28, s20, s28
|
||||
itttt gt
|
||||
vldmiagt r1!, {s0-s3}
|
||||
vldmiagt r2!, {s8-s11}
|
||||
vldmiagt r1!, {s4-s7}
|
||||
vldmiagt r2!, {s12-s15}
|
||||
ittt ge
|
||||
vmulge.f32 s8, s0, s8
|
||||
vstmiage r0!, {s24-s27}
|
||||
vstmiage r0!, {s28-s31}
|
||||
|
|
@ -97,33 +102,49 @@ function ff_vector_fmul_reverse_vfp, export=1
|
|||
vmul.f32 s11, s0, s11
|
||||
1:
|
||||
subs r3, r3, #16
|
||||
it ge
|
||||
vldmdbge r2!, {s16-s19}
|
||||
vmul.f32 s12, s7, s12
|
||||
it ge
|
||||
vldmiage r1!, {s24-s27}
|
||||
vmul.f32 s13, s6, s13
|
||||
it ge
|
||||
vldmdbge r2!, {s20-s23}
|
||||
vmul.f32 s14, s5, s14
|
||||
it ge
|
||||
vldmiage r1!, {s28-s31}
|
||||
vmul.f32 s15, s4, s15
|
||||
it ge
|
||||
vmulge.f32 s24, s19, s24
|
||||
it gt
|
||||
vldmdbgt r2!, {s0-s3}
|
||||
it ge
|
||||
vmulge.f32 s25, s18, s25
|
||||
vstmia r0!, {s8-s13}
|
||||
it ge
|
||||
vmulge.f32 s26, s17, s26
|
||||
it gt
|
||||
vldmiagt r1!, {s8-s11}
|
||||
itt ge
|
||||
vmulge.f32 s27, s16, s27
|
||||
vmulge.f32 s28, s23, s28
|
||||
it gt
|
||||
vldmdbgt r2!, {s4-s7}
|
||||
it ge
|
||||
vmulge.f32 s29, s22, s29
|
||||
vstmia r0!, {s14-s15}
|
||||
ittt ge
|
||||
vmulge.f32 s30, s21, s30
|
||||
vmulge.f32 s31, s20, s31
|
||||
vmulge.f32 s8, s3, s8
|
||||
it gt
|
||||
vldmiagt r1!, {s12-s15}
|
||||
itttt ge
|
||||
vmulge.f32 s9, s2, s9
|
||||
vmulge.f32 s10, s1, s10
|
||||
vstmiage r0!, {s24-s27}
|
||||
vmulge.f32 s11, s0, s11
|
||||
it ge
|
||||
vstmiage r0!, {s28-s31}
|
||||
bgt 1b
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
vhsub.s16 \r0, \d0, \d1 @ t3, t4, t8, t7
|
||||
vhsub.s16 \r1, \d1, \d0
|
||||
vhadd.s16 \d0, \d0, \d1 @ t1, t2, t6, t5
|
||||
vmov.i64 \d1, #0xffff<<32
|
||||
vmov.i64 \d1, #0xffff00000000
|
||||
vbit \r0, \r1, \d1
|
||||
vrev64.16 \r1, \r0 @ t7, t8, t4, t3
|
||||
vtrn.32 \r0, \r1 @ t3, t4, t7, t8
|
||||
|
|
@ -75,9 +75,9 @@
|
|||
.endm
|
||||
|
||||
function fft4_neon
|
||||
vld1.16 {d0-d1}, [r0,:128]
|
||||
vld1.16 {d0-d1}, [r0]
|
||||
fft4 d0, d1, d2, d3
|
||||
vst1.16 {d0-d1}, [r0,:128]
|
||||
vst1.16 {d0-d1}, [r0]
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
|
|
|
|||
|
|
@ -349,9 +349,7 @@ function ff_fft_permute_neon, export=1
|
|||
pop {r4,pc}
|
||||
endfunc
|
||||
|
||||
.section .rodata
|
||||
.align 4
|
||||
fft_tab_neon:
|
||||
const fft_tab_neon
|
||||
.word fft4_neon
|
||||
.word fft8_neon
|
||||
.word fft16_neon
|
||||
|
|
@ -367,8 +365,12 @@ fft_tab_neon:
|
|||
.word fft16384_neon
|
||||
.word fft32768_neon
|
||||
.word fft65536_neon
|
||||
ELF .size fft_tab_neon, . - fft_tab_neon
|
||||
endconst
|
||||
|
||||
.align 4
|
||||
pmmp: .float +1.0, -1.0, -1.0, +1.0
|
||||
mppm: .float -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2
|
||||
const pmmp, align=4
|
||||
.float +1.0, -1.0, -1.0, +1.0
|
||||
endconst
|
||||
|
||||
const mppm, align=4
|
||||
.float -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2
|
||||
endconst
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ endfunc
|
|||
|
||||
function ff_float_to_int16_interleave_neon, export=1
|
||||
cmp r3, #2
|
||||
itt lt
|
||||
ldrlt r1, [r1]
|
||||
blt ff_float_to_int16_neon
|
||||
bne 4f
|
||||
|
|
@ -196,6 +197,7 @@ function ff_float_to_int16_interleave_neon, export=1
|
|||
vst1.64 {d3}, [r8], ip
|
||||
vst1.64 {d7}, [r8], ip
|
||||
subs r3, r3, #4
|
||||
it eq
|
||||
popeq {r4-r8,pc}
|
||||
cmp r3, #4
|
||||
add r0, r0, #8
|
||||
|
|
@ -305,6 +307,7 @@ function ff_float_to_int16_interleave_neon, export=1
|
|||
vst1.32 {d23[1]}, [r8], ip
|
||||
8: subs r3, r3, #2
|
||||
add r0, r0, #4
|
||||
it eq
|
||||
popeq {r4-r8,pc}
|
||||
|
||||
@ 1 channel
|
||||
|
|
@ -354,6 +357,7 @@ function ff_float_to_int16_interleave_neon, export=1
|
|||
vst1.16 {d2[3]}, [r5,:16], ip
|
||||
vst1.16 {d3[1]}, [r5,:16], ip
|
||||
vst1.16 {d3[3]}, [r5,:16], ip
|
||||
it eq
|
||||
popeq {r4-r8,pc}
|
||||
vld1.64 {d0-d1}, [r4,:128]!
|
||||
vcvt.s32.f32 q0, q0, #16
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ function ff_float_to_int16_vfp, export=1
|
|||
vmov r5, r6, s2, s3
|
||||
vmov r7, r8, s4, s5
|
||||
vmov ip, lr, s6, s7
|
||||
it gt
|
||||
vldmiagt r1!, {s16-s23}
|
||||
ssat r4, #16, r4
|
||||
ssat r3, #16, r3
|
||||
|
|
@ -53,10 +54,12 @@ function ff_float_to_int16_vfp, export=1
|
|||
ssat r5, #16, r5
|
||||
pkhbt r3, r3, r4, lsl #16
|
||||
pkhbt r4, r5, r6, lsl #16
|
||||
itttt gt
|
||||
vcvtgt.s32.f32 s0, s16
|
||||
vcvtgt.s32.f32 s1, s17
|
||||
vcvtgt.s32.f32 s2, s18
|
||||
vcvtgt.s32.f32 s3, s19
|
||||
itttt gt
|
||||
vcvtgt.s32.f32 s4, s20
|
||||
vcvtgt.s32.f32 s5, s21
|
||||
vcvtgt.s32.f32 s6, s22
|
||||
|
|
|
|||
|
|
@ -71,7 +71,9 @@ function ff_\type\()_h264_chroma_mc8_neon, export=1
|
|||
pld [r1]
|
||||
pld [r1, r2]
|
||||
|
||||
muls r7, r4, r5
|
||||
A muls r7, r4, r5
|
||||
T mul r7, r4, r5
|
||||
T cmp r7, #0
|
||||
rsb r6, r7, r5, lsl #3
|
||||
rsb ip, r7, r4, lsl #3
|
||||
sub r4, r7, r4, lsl #3
|
||||
|
|
@ -197,7 +199,9 @@ function ff_\type\()_h264_chroma_mc4_neon, export=1
|
|||
pld [r1]
|
||||
pld [r1, r2]
|
||||
|
||||
muls r7, r4, r5
|
||||
A muls r7, r4, r5
|
||||
T mul r7, r4, r5
|
||||
T cmp r7, #0
|
||||
rsb r6, r7, r5, lsl #3
|
||||
rsb ip, r7, r4, lsl #3
|
||||
sub r4, r7, r4, lsl #3
|
||||
|
|
@ -368,10 +372,10 @@ function ff_\type\()_h264_chroma_mc2_neon, export=1
|
|||
pop {r4-r6, pc}
|
||||
2:
|
||||
.ifc \type,put
|
||||
ldrh r5, [r1], r2
|
||||
strh r5, [r0], r2
|
||||
ldrh r6, [r1], r2
|
||||
strh r6, [r0], r2
|
||||
ldrh_post r5, r1, r2
|
||||
strh_post r5, r0, r2
|
||||
ldrh_post r6, r1, r2
|
||||
strh_post r6, r0, r2
|
||||
.else
|
||||
vld1.16 {d16[0]}, [r1], r2
|
||||
vld1.16 {d16[1]}, [r1], r2
|
||||
|
|
@ -404,28 +408,17 @@ endfunc
|
|||
ldr ip, [sp]
|
||||
tst r2, r2
|
||||
ldr ip, [ip]
|
||||
it ne
|
||||
tstne r3, r3
|
||||
vmov.32 d24[0], ip
|
||||
and ip, ip, ip, lsl #16
|
||||
it eq
|
||||
bxeq lr
|
||||
ands ip, ip, ip, lsl #8
|
||||
it lt
|
||||
bxlt lr
|
||||
.endm
|
||||
|
||||
.macro align_push_regs
|
||||
and ip, sp, #15
|
||||
add ip, ip, #32
|
||||
sub sp, sp, ip
|
||||
vst1.64 {d12-d15}, [sp,:128]
|
||||
sub sp, sp, #32
|
||||
vst1.64 {d8-d11}, [sp,:128]
|
||||
.endm
|
||||
|
||||
.macro align_pop_regs
|
||||
vld1.64 {d8-d11}, [sp,:128]!
|
||||
vld1.64 {d12-d15}, [sp,:128], ip
|
||||
.endm
|
||||
|
||||
.macro h264_loop_filter_luma
|
||||
vdup.8 q11, r2 @ alpha
|
||||
vmovl.u8 q12, d24
|
||||
|
|
@ -506,7 +499,7 @@ function ff_h264_v_loop_filter_luma_neon, export=1
|
|||
vld1.64 {d18,d19}, [r0,:128], r1
|
||||
vld1.64 {d16,d17}, [r0,:128], r1
|
||||
|
||||
align_push_regs
|
||||
vpush {d8-d15}
|
||||
|
||||
h264_loop_filter_luma
|
||||
|
||||
|
|
@ -516,7 +509,7 @@ function ff_h264_v_loop_filter_luma_neon, export=1
|
|||
vst1.64 {d0, d1}, [r0,:128], r1
|
||||
vst1.64 {d10,d11}, [r0,:128]
|
||||
|
||||
align_pop_regs
|
||||
vpop {d8-d15}
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
|
|
@ -543,7 +536,7 @@ function ff_h264_h_loop_filter_luma_neon, export=1
|
|||
|
||||
transpose_8x8 q3, q10, q9, q8, q0, q1, q2, q13
|
||||
|
||||
align_push_regs
|
||||
vpush {d8-d15}
|
||||
|
||||
h264_loop_filter_luma
|
||||
|
||||
|
|
@ -568,7 +561,7 @@ function ff_h264_h_loop_filter_luma_neon, export=1
|
|||
vst1.32 {d1[1]}, [r0], r1
|
||||
vst1.32 {d11[1]}, [r0], r1
|
||||
|
||||
align_pop_regs
|
||||
vpop {d8-d15}
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
|
|
@ -1116,6 +1109,7 @@ function \type\()_h264_qpel8_hv_lowpass_neon
|
|||
vrhadd.u8 d11, d11, d7
|
||||
sub r0, r0, r2, lsl #3
|
||||
.endif
|
||||
|
||||
vst1.64 {d12}, [r0,:64], r2
|
||||
vst1.64 {d13}, [r0,:64], r2
|
||||
vst1.64 {d14}, [r0,:64], r2
|
||||
|
|
@ -1263,7 +1257,9 @@ function ff_\type\()_h264_qpel8_mc11_neon, export=1
|
|||
\type\()_h264_qpel8_mc11:
|
||||
lowpass_const r3
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r0, r11, #15
|
||||
T mov sp, r0
|
||||
sub sp, sp, #64
|
||||
mov r0, sp
|
||||
sub r1, r1, #2
|
||||
|
|
@ -1271,14 +1267,14 @@ function ff_\type\()_h264_qpel8_mc11_neon, export=1
|
|||
mov ip, #8
|
||||
vpush {d8-d15}
|
||||
bl put_h264_qpel8_h_lowpass_neon
|
||||
ldrd r0, [r11]
|
||||
ldrd r0, [r11], #8
|
||||
mov r3, r2
|
||||
add ip, sp, #64
|
||||
sub r1, r1, r2, lsl #1
|
||||
mov r2, #8
|
||||
bl \type\()_h264_qpel8_v_lowpass_l2_neon
|
||||
vpop {d8-d15}
|
||||
add sp, r11, #8
|
||||
mov sp, r11
|
||||
pop {r11, pc}
|
||||
endfunc
|
||||
|
||||
|
|
@ -1287,7 +1283,9 @@ function ff_\type\()_h264_qpel8_mc21_neon, export=1
|
|||
\type\()_h264_qpel8_mc21:
|
||||
lowpass_const r3
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r0, r11, #15
|
||||
T mov sp, r0
|
||||
sub sp, sp, #(8*8+16*12)
|
||||
sub r1, r1, #2
|
||||
mov r3, #8
|
||||
|
|
@ -1296,14 +1294,14 @@ function ff_\type\()_h264_qpel8_mc21_neon, export=1
|
|||
vpush {d8-d15}
|
||||
bl put_h264_qpel8_h_lowpass_neon
|
||||
mov r4, r0
|
||||
ldrd r0, [r11]
|
||||
ldrd r0, [r11], #8
|
||||
sub r1, r1, r2, lsl #1
|
||||
sub r1, r1, #2
|
||||
mov r3, r2
|
||||
sub r2, r4, #64
|
||||
bl \type\()_h264_qpel8_hv_lowpass_l2_neon
|
||||
vpop {d8-d15}
|
||||
add sp, r11, #8
|
||||
mov sp, r11
|
||||
pop {r4, r10, r11, pc}
|
||||
endfunc
|
||||
|
||||
|
|
@ -1330,7 +1328,9 @@ function ff_\type\()_h264_qpel8_mc12_neon, export=1
|
|||
\type\()_h264_qpel8_mc12:
|
||||
lowpass_const r3
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r0, r11, #15
|
||||
T mov sp, r0
|
||||
sub sp, sp, #(8*8+16*12)
|
||||
sub r1, r1, r2, lsl #1
|
||||
mov r3, r2
|
||||
|
|
@ -1339,20 +1339,22 @@ function ff_\type\()_h264_qpel8_mc12_neon, export=1
|
|||
vpush {d8-d15}
|
||||
bl put_h264_qpel8_v_lowpass_neon
|
||||
mov r4, r0
|
||||
ldrd r0, [r11]
|
||||
ldrd r0, [r11], #8
|
||||
sub r1, r1, r3, lsl #1
|
||||
sub r1, r1, #2
|
||||
sub r2, r4, #64
|
||||
bl \type\()_h264_qpel8_hv_lowpass_l2_neon
|
||||
vpop {d8-d15}
|
||||
add sp, r11, #8
|
||||
mov sp, r11
|
||||
pop {r4, r10, r11, pc}
|
||||
endfunc
|
||||
|
||||
function ff_\type\()_h264_qpel8_mc22_neon, export=1
|
||||
push {r4, r10, r11, lr}
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r4, r11, #15
|
||||
T mov sp, r4
|
||||
sub r1, r1, r2, lsl #1
|
||||
sub r1, r1, #2
|
||||
mov r3, r2
|
||||
|
|
@ -1441,21 +1443,23 @@ function ff_\type\()_h264_qpel16_mc11_neon, export=1
|
|||
\type\()_h264_qpel16_mc11:
|
||||
lowpass_const r3
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r0, r11, #15
|
||||
T mov sp, r0
|
||||
sub sp, sp, #256
|
||||
mov r0, sp
|
||||
sub r1, r1, #2
|
||||
mov r3, #16
|
||||
vpush {d8-d15}
|
||||
bl put_h264_qpel16_h_lowpass_neon
|
||||
ldrd r0, [r11]
|
||||
ldrd r0, [r11], #8
|
||||
mov r3, r2
|
||||
add ip, sp, #64
|
||||
sub r1, r1, r2, lsl #1
|
||||
mov r2, #16
|
||||
bl \type\()_h264_qpel16_v_lowpass_l2_neon
|
||||
vpop {d8-d15}
|
||||
add sp, r11, #8
|
||||
mov sp, r11
|
||||
pop {r4, r11, pc}
|
||||
endfunc
|
||||
|
||||
|
|
@ -1464,20 +1468,22 @@ function ff_\type\()_h264_qpel16_mc21_neon, export=1
|
|||
\type\()_h264_qpel16_mc21:
|
||||
lowpass_const r3
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r0, r11, #15
|
||||
T mov sp, r0
|
||||
sub sp, sp, #(16*16+16*12)
|
||||
sub r1, r1, #2
|
||||
mov r0, sp
|
||||
vpush {d8-d15}
|
||||
bl put_h264_qpel16_h_lowpass_neon_packed
|
||||
mov r4, r0
|
||||
ldrd r0, [r11]
|
||||
ldrd r0, [r11], #8
|
||||
sub r1, r1, r2, lsl #1
|
||||
sub r1, r1, #2
|
||||
mov r3, r2
|
||||
bl \type\()_h264_qpel16_hv_lowpass_l2_neon
|
||||
vpop {d8-d15}
|
||||
add sp, r11, #8
|
||||
mov sp, r11
|
||||
pop {r4-r5, r9-r11, pc}
|
||||
endfunc
|
||||
|
||||
|
|
@ -1504,7 +1510,9 @@ function ff_\type\()_h264_qpel16_mc12_neon, export=1
|
|||
\type\()_h264_qpel16_mc12:
|
||||
lowpass_const r3
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r0, r11, #15
|
||||
T mov sp, r0
|
||||
sub sp, sp, #(16*16+16*12)
|
||||
sub r1, r1, r2, lsl #1
|
||||
mov r0, sp
|
||||
|
|
@ -1512,13 +1520,13 @@ function ff_\type\()_h264_qpel16_mc12_neon, export=1
|
|||
vpush {d8-d15}
|
||||
bl put_h264_qpel16_v_lowpass_neon_packed
|
||||
mov r4, r0
|
||||
ldrd r0, [r11]
|
||||
ldrd r0, [r11], #8
|
||||
sub r1, r1, r3, lsl #1
|
||||
sub r1, r1, #2
|
||||
mov r2, r3
|
||||
bl \type\()_h264_qpel16_hv_lowpass_l2_neon
|
||||
vpop {d8-d15}
|
||||
add sp, r11, #8
|
||||
mov sp, r11
|
||||
pop {r4-r5, r9-r11, pc}
|
||||
endfunc
|
||||
|
||||
|
|
@ -1526,7 +1534,9 @@ function ff_\type\()_h264_qpel16_mc22_neon, export=1
|
|||
push {r4, r9-r11, lr}
|
||||
lowpass_const r3
|
||||
mov r11, sp
|
||||
bic sp, sp, #15
|
||||
A bic sp, sp, #15
|
||||
T bic r4, r11, #15
|
||||
T mov sp, r4
|
||||
sub r1, r1, r2, lsl #1
|
||||
sub r1, r1, #2
|
||||
mov r3, r2
|
||||
|
|
|
|||
|
|
@ -106,10 +106,12 @@ function ff_h264_idct_add16_neon, export=1
|
|||
blt 2f
|
||||
ldrsh lr, [r1]
|
||||
add r0, r0, r4
|
||||
it ne
|
||||
movne lr, #0
|
||||
cmp lr, #0
|
||||
adrne lr, ff_h264_idct_dc_add_neon
|
||||
adreq lr, ff_h264_idct_add_neon
|
||||
ite ne
|
||||
adrne lr, ff_h264_idct_dc_add_neon + CONFIG_THUMB
|
||||
adreq lr, ff_h264_idct_add_neon + CONFIG_THUMB
|
||||
blx lr
|
||||
2: subs ip, ip, #1
|
||||
add r1, r1, #32
|
||||
|
|
@ -132,8 +134,9 @@ function ff_h264_idct_add16intra_neon, export=1
|
|||
add r0, r0, r4
|
||||
cmp r8, #0
|
||||
ldrsh r8, [r1]
|
||||
adrne lr, ff_h264_idct_add_neon
|
||||
adreq lr, ff_h264_idct_dc_add_neon
|
||||
iteet ne
|
||||
adrne lr, ff_h264_idct_add_neon + CONFIG_THUMB
|
||||
adreq lr, ff_h264_idct_dc_add_neon + CONFIG_THUMB
|
||||
cmpeq r8, #0
|
||||
blxne lr
|
||||
subs ip, ip, #1
|
||||
|
|
@ -159,12 +162,14 @@ function ff_h264_idct_add8_neon, export=1
|
|||
add r1, r3, r12, lsl #5
|
||||
cmp r8, #0
|
||||
ldrsh r8, [r1]
|
||||
adrne lr, ff_h264_idct_add_neon
|
||||
adreq lr, ff_h264_idct_dc_add_neon
|
||||
iteet ne
|
||||
adrne lr, ff_h264_idct_add_neon + CONFIG_THUMB
|
||||
adreq lr, ff_h264_idct_dc_add_neon + CONFIG_THUMB
|
||||
cmpeq r8, #0
|
||||
blxne lr
|
||||
add r12, r12, #1
|
||||
cmp r12, #4
|
||||
itt eq
|
||||
moveq r12, #16
|
||||
moveq r4, r9
|
||||
cmp r12, #20
|
||||
|
|
@ -365,10 +370,12 @@ function ff_h264_idct8_add4_neon, export=1
|
|||
blt 2f
|
||||
ldrsh lr, [r1]
|
||||
add r0, r0, r4
|
||||
it ne
|
||||
movne lr, #0
|
||||
cmp lr, #0
|
||||
adrne lr, ff_h264_idct8_dc_add_neon
|
||||
adreq lr, ff_h264_idct8_add_neon
|
||||
ite ne
|
||||
adrne lr, ff_h264_idct8_dc_add_neon + CONFIG_THUMB
|
||||
adreq lr, ff_h264_idct8_add_neon + CONFIG_THUMB
|
||||
blx lr
|
||||
2: subs r12, r12, #4
|
||||
add r1, r1, #128
|
||||
|
|
@ -376,8 +383,8 @@ function ff_h264_idct8_add4_neon, export=1
|
|||
pop {r4-r8,pc}
|
||||
endfunc
|
||||
|
||||
.section .rodata
|
||||
scan8: .byte 4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8
|
||||
const scan8
|
||||
.byte 4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8
|
||||
.byte 6+ 1*8, 7+ 1*8, 6+ 2*8, 7+ 2*8
|
||||
.byte 4+ 3*8, 5+ 3*8, 4+ 4*8, 5+ 4*8
|
||||
.byte 6+ 3*8, 7+ 3*8, 6+ 4*8, 7+ 4*8
|
||||
|
|
@ -389,3 +396,4 @@ scan8: .byte 4+ 1*8, 5+ 1*8, 4+ 2*8, 5+ 2*8
|
|||
.byte 6+11*8, 7+11*8, 6+12*8, 7+12*8
|
||||
.byte 4+13*8, 5+13*8, 4+14*8, 5+14*8
|
||||
.byte 6+13*8, 7+13*8, 6+14*8, 7+14*8
|
||||
endconst
|
||||
|
|
|
|||
|
|
@ -166,12 +166,9 @@ function ff_pred16x16_plane_neon, export=1
|
|||
bx lr
|
||||
endfunc
|
||||
|
||||
.section .rodata
|
||||
.align 4
|
||||
p16weight:
|
||||
const p16weight, align=4
|
||||
.short 1,2,3,4,5,6,7,8
|
||||
|
||||
.text
|
||||
endconst
|
||||
|
||||
function ff_pred8x8_hor_neon, export=1
|
||||
sub r2, r0, #1
|
||||
|
|
|
|||
|
|
@ -64,11 +64,14 @@ static inline av_const int mid_pred(int a, int b, int c)
|
|||
__asm__ (
|
||||
"mov %0, %2 \n\t"
|
||||
"cmp %1, %2 \n\t"
|
||||
"itt gt \n\t"
|
||||
"movgt %0, %1 \n\t"
|
||||
"movgt %1, %2 \n\t"
|
||||
"cmp %1, %3 \n\t"
|
||||
"it le \n\t"
|
||||
"movle %1, %3 \n\t"
|
||||
"cmp %0, %1 \n\t"
|
||||
"it gt \n\t"
|
||||
"movgt %0, %1 \n\t"
|
||||
: "=&r"(m), "+r"(a)
|
||||
: "r"(b), "r"(c)
|
||||
|
|
|
|||
|
|
@ -191,7 +191,9 @@ function ff_mdct_calc_neon, export=1
|
|||
vadd.f32 d17, d17, d3 @ in2u+in1d -I
|
||||
1:
|
||||
vmul.f32 d7, d0, d21 @ I*s
|
||||
ldr r10, [r3, lr, lsr #1]
|
||||
A ldr r10, [r3, lr, lsr #1]
|
||||
T lsr r10, lr, #1
|
||||
T ldr r10, [r3, r10]
|
||||
vmul.f32 d6, d1, d20 @ -R*c
|
||||
ldr r6, [r3, #4]!
|
||||
vmul.f32 d4, d1, d21 @ -R*s
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ function ff_mpadsp_apply_window_fixed_armv6, export=1
|
|||
sum8 r8, r9, r1, r0, r10, r11, r12, lr
|
||||
sum8 r8, r9, r1, r2, r10, r11, r12, lr, rsb, 32
|
||||
round r10, r8, r9
|
||||
strh r10, [r3], r4
|
||||
strh_post r10, r3, r4
|
||||
|
||||
mov lr, #15
|
||||
1:
|
||||
|
|
@ -127,10 +127,10 @@ function ff_mpadsp_apply_window_fixed_armv6, export=1
|
|||
round r10, r8, r9
|
||||
adds r8, r8, r4
|
||||
adc r9, r9, r7
|
||||
strh r10, [r3], r12
|
||||
strh_post r10, r3, r12
|
||||
round r11, r8, r9
|
||||
subs lr, lr, #1
|
||||
strh r11, [r5], -r12
|
||||
strh_dpost r11, r5, r12
|
||||
bgt 1b
|
||||
|
||||
sum8 r8, r9, r1, r0, r10, r11, r12, lr, rsb, 33
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue