Compare commits
124 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cf82c5cd5b | ||
![]() |
cb8577a4da | ||
![]() |
b55b34f862 | ||
![]() |
609d299ed0 | ||
![]() |
01a0612c70 | ||
![]() |
dcf1830a15 | ||
![]() |
a8d89df367 | ||
![]() |
095946afa7 | ||
![]() |
6d75dbebc0 | ||
![]() |
f54b8f8482 | ||
![]() |
a05219d801 | ||
![]() |
c02b02d725 | ||
![]() |
5fab0ccd81 | ||
![]() |
20829cf8a2 | ||
![]() |
0b4840af0c | ||
![]() |
896f80f82c | ||
![]() |
b57c6d1a4c | ||
![]() |
3749066dd8 | ||
![]() |
c29c609e0f | ||
![]() |
9459390f29 | ||
![]() |
2bbd81fba3 | ||
![]() |
5e3578893a | ||
![]() |
dc1b670a2c | ||
![]() |
0156f4f9da | ||
![]() |
a52c615a42 | ||
![]() |
5c2d7c4dc8 | ||
![]() |
004194f465 | ||
![]() |
cd63c32ff6 | ||
![]() |
5a33a29a91 | ||
![]() |
683df9bf54 | ||
![]() |
64e2656f7c | ||
![]() |
8e3d264fb2 | ||
![]() |
46a2dc9175 | ||
![]() |
b9e126fbe2 | ||
![]() |
07dc4a79c7 | ||
![]() |
43de5c034f | ||
![]() |
2f0a10174e | ||
![]() |
0a48a67e57 | ||
![]() |
e8baa8eb7f | ||
![]() |
d32b2d4de1 | ||
![]() |
924b2ee8f2 | ||
![]() |
f95e5225fe | ||
![]() |
8f536408d1 | ||
![]() |
093f0f13e6 | ||
![]() |
c172eb7925 | ||
![]() |
154ea553f6 | ||
![]() |
d734d4ce6a | ||
![]() |
c445e9dc62 | ||
![]() |
c5c2654351 | ||
![]() |
2fe47b21c8 | ||
![]() |
b91ebb60d8 | ||
![]() |
f1d1ef810a | ||
![]() |
b263e94f77 | ||
![]() |
9da3063e1c | ||
![]() |
b6fe44b9db | ||
![]() |
72ac64544f | ||
![]() |
8f7f3f0453 | ||
![]() |
376dfd07ab | ||
![]() |
b62c0c0bce | ||
![]() |
00498a7e59 | ||
![]() |
cb66b55270 | ||
![]() |
9482dd0d17 | ||
![]() |
87eedf6943 | ||
![]() |
f239b91596 | ||
![]() |
06107e9605 | ||
![]() |
d052370c1e | ||
![]() |
ce993ce791 | ||
![]() |
e54fd33848 | ||
![]() |
9b69efc02b | ||
![]() |
1bf80a9a14 | ||
![]() |
c0b90d4088 | ||
![]() |
9c709f0534 | ||
![]() |
4ad56612f9 | ||
![]() |
acb62e998f | ||
![]() |
180faac637 | ||
![]() |
13c943ffb1 | ||
![]() |
18052f1df9 | ||
![]() |
4c8b14c37f | ||
![]() |
e4071fa04c | ||
![]() |
bf5ed476ba | ||
![]() |
fcd26ebc8f | ||
![]() |
6a34f5d447 | ||
![]() |
26f48752fb | ||
![]() |
1aef8de6d7 | ||
![]() |
9ac3e32b29 | ||
![]() |
5254285636 | ||
![]() |
137838945f | ||
![]() |
6cef3ddbdc | ||
![]() |
403eee165c | ||
![]() |
523b57b331 | ||
![]() |
a3589cce81 | ||
![]() |
0820593e64 | ||
![]() |
4db2b966be | ||
![]() |
b7b61ff6a3 | ||
![]() |
7a6e47b99d | ||
![]() |
f84c349b3b | ||
![]() |
26f732e21d | ||
![]() |
82b2dd5ee4 | ||
![]() |
e82ddde05a | ||
![]() |
07f5da6128 | ||
![]() |
e845455225 | ||
![]() |
3fedb3e65c | ||
![]() |
0b5c261212 | ||
![]() |
680e473643 | ||
![]() |
44e83d0c97 | ||
![]() |
1986380df2 | ||
![]() |
df3850db49 | ||
![]() |
082b4f8348 | ||
![]() |
788c313b50 | ||
![]() |
779d7610c7 | ||
![]() |
56629aa012 | ||
![]() |
33651e3edf | ||
![]() |
d46aada5c2 | ||
![]() |
66b1f210c0 | ||
![]() |
d4b98d475f | ||
![]() |
8d8962ca3e | ||
![]() |
329559ae50 | ||
![]() |
0b3a88fe15 | ||
![]() |
563fe360c3 | ||
![]() |
73a502dd43 | ||
![]() |
ea189b77eb | ||
![]() |
2ebd47841f | ||
![]() |
9d7244c4c6 | ||
![]() |
7aee089978 |
32
Changelog
32
Changelog
@@ -2,6 +2,20 @@ Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
|
||||
version 0.7.1:
|
||||
|
||||
- added various additional FOURCC codec identifiers
|
||||
- H.264 4:4:4 fixes
|
||||
- build system and compilation fixes
|
||||
- Doxygen and general documentation corrections and improvements
|
||||
- fixed segfault in ffprobe
|
||||
- behavioral fix in av_open_input_stream()
|
||||
- Licensing clarification for LGPL'ed vf_gradfun
|
||||
- bugfixes while seeking in multithreaded decoding
|
||||
- support newer versions of OpenCV
|
||||
- ffmpeg: fix operation with --disable-avfilter
|
||||
- fixed integer underflow in matroska decoder
|
||||
|
||||
version 0.7:
|
||||
|
||||
- many many things we forgot because we rather write code than changelogs
|
||||
@@ -11,22 +25,22 @@ version 0.7:
|
||||
- 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
|
||||
- floating-point sample format support for (E-)AC-3, DCA, AAC, Vorbis decoders
|
||||
- H.264/MPEG frame-level multithreading
|
||||
- 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
|
||||
- bump libswscale for recently reported ABI break
|
||||
|
||||
|
||||
version 0.7_beta2:
|
||||
|
||||
- VP8 frame-multithreading
|
||||
- VP8 frame-level multithreading
|
||||
- NEON optimizations for VP8
|
||||
- Lots of deprecated API cruft removed
|
||||
- fft and imdct optimizations for AVX (Sandy Bridge) processors
|
||||
- removed a lot of deprecated API cruft
|
||||
- FFT and IMDCT optimizations for AVX (Sandy Bridge) processors
|
||||
- showinfo filter added
|
||||
- DPX image encoder
|
||||
- SMPTE 302M AES3 audio decoder
|
||||
@@ -88,10 +102,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
|
||||
|
349
Doxyfile
349
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
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 0.8.1
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
@@ -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,22 @@ 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
|
||||
|
||||
# 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 +1400,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 +1472,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 +1491,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 +1613,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 +1638,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
|
||||
|
2
Makefile
2
Makefile
@@ -178,7 +178,7 @@ testclean:
|
||||
clean:: testclean
|
||||
$(RM) $(ALLPROGS) $(ALLPROGS_G)
|
||||
$(RM) $(CLEANSUFFIXES)
|
||||
$(RM) doc/*.html doc/*.pod doc/*.1
|
||||
$(RM) doc/*.html doc/*.pod doc/*.1 doc/*.d doc/*~
|
||||
$(RM) $(TOOLS)
|
||||
$(RM) $(CLEANSUFFIXES:%=tools/%)
|
||||
|
||||
|
8
configure
vendored
8
configure
vendored
@@ -1512,7 +1512,7 @@ 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"
|
||||
ffprobe_deps="avcodec avformat"
|
||||
@@ -3064,7 +3064,6 @@ fi
|
||||
|
||||
if enabled small; then
|
||||
add_cflags $size_cflags
|
||||
optimizations="small"
|
||||
elif enabled optimizations; then
|
||||
add_cflags $speed_cflags
|
||||
else
|
||||
@@ -3118,6 +3117,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
|
||||
@@ -3204,6 +3205,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}"
|
||||
@@ -3270,6 +3272,7 @@ if enabled source_path_used; then
|
||||
doc
|
||||
libavcodec
|
||||
libavcodec/$arch
|
||||
libavcodec/mlib
|
||||
libavdevice
|
||||
libavfilter
|
||||
libavfilter/$arch
|
||||
@@ -3281,6 +3284,7 @@ if enabled source_path_used; then
|
||||
libpostproc
|
||||
libswscale
|
||||
libswscale/$arch
|
||||
libswscale/mlib
|
||||
tests
|
||||
tools
|
||||
"
|
||||
|
@@ -2,7 +2,7 @@ Release Notes
|
||||
=============
|
||||
|
||||
* 0.8 "Love" June, 2011
|
||||
* 0.7 "Peace" June, 2011 (identical to 0.8 but using 0.6 ABI/API)
|
||||
* 0.7.1 "Peace" June, 2011 (identical to 0.8 but using 0.6 ABI/API)
|
||||
|
||||
|
||||
General notes
|
||||
|
@@ -54,10 +54,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
|
||||
|
@@ -479,7 +479,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* open the output file, if needed */
|
||||
if (!(fmt->flags & AVFMT_NOFILE)) {
|
||||
if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
|
||||
if (avio_open(&oc->pb, filename, AVIO_WRONLY) < 0) {
|
||||
fprintf(stderr, "Could not open '%s'\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
@@ -961,7 +961,7 @@ MSVC++-compatible import libraries.
|
||||
@item Build FFmpeg with
|
||||
|
||||
@example
|
||||
./configure --enable-shared --enable-memalign-hack
|
||||
./configure --enable-shared
|
||||
make
|
||||
make install
|
||||
@end example
|
||||
@@ -998,9 +998,11 @@ 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}.
|
||||
|
||||
@subsection Cross compilation for Windows with Linux
|
||||
|
||||
@@ -1036,7 +1038,7 @@ diffutils
|
||||
Then run
|
||||
|
||||
@example
|
||||
./configure --enable-static --disable-shared
|
||||
./configure
|
||||
@end example
|
||||
|
||||
to make a static build.
|
||||
@@ -1083,12 +1085,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
|
||||
|
32
ffmpeg.c
32
ffmpeg.c
@@ -31,7 +31,7 @@
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavdevice/avdevice.h"
|
||||
#include "libswscale/swscale.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/opt.h"
|
||||
#include "libavcodec/audioconvert.h"
|
||||
#include "libavutil/audioconvert.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
@@ -113,7 +113,9 @@ typedef struct AVChapterMap {
|
||||
static const OptionDef options[];
|
||||
|
||||
#define MAX_FILES 100
|
||||
#if !FF_API_MAX_STREAMS
|
||||
#define MAX_STREAMS 1024 /* arbitrary sanity check value */
|
||||
#endif
|
||||
|
||||
static const char *last_asked_format = NULL;
|
||||
static int64_t input_files_ts_offset[MAX_FILES];
|
||||
@@ -711,7 +713,6 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename)
|
||||
return err;
|
||||
/* copy stream format */
|
||||
s->nb_streams = 0;
|
||||
s->streams = av_mallocz(sizeof(AVStream *) * ic->nb_streams);
|
||||
for(i=0;i<ic->nb_streams;i++) {
|
||||
AVStream *st;
|
||||
AVCodec *codec;
|
||||
@@ -1859,7 +1860,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
|
||||
ret = 0;
|
||||
/* encode any samples remaining in fifo */
|
||||
if (fifo_bytes > 0) {
|
||||
int osize = av_get_bits_per_sample_fmt(enc->sample_fmt) >> 3;
|
||||
int osize = av_get_bytes_per_sample(enc->sample_fmt);
|
||||
int fs_tmp = enc->frame_size;
|
||||
|
||||
av_fifo_generic_read(ost->fifo, audio_buf, fifo_bytes, NULL);
|
||||
@@ -2303,16 +2304,19 @@ static int transcode(AVFormatContext **output_files,
|
||||
fprintf(stderr, "Video pixel format is unknown, stream cannot be encoded\n");
|
||||
ffmpeg_exit(1);
|
||||
}
|
||||
|
||||
if (!codec->width || !codec->height) {
|
||||
codec->width = icodec->width;
|
||||
codec->height = icodec->height;
|
||||
}
|
||||
|
||||
ost->video_resample = codec->width != icodec->width ||
|
||||
codec->height != icodec->height ||
|
||||
codec->pix_fmt != icodec->pix_fmt;
|
||||
if (ost->video_resample) {
|
||||
codec->bits_per_raw_sample= frame_bits_per_raw_sample;
|
||||
}
|
||||
if (!codec->width || !codec->height) {
|
||||
codec->width = icodec->width;
|
||||
codec->height = icodec->height;
|
||||
}
|
||||
|
||||
ost->resample_height = icodec->height;
|
||||
ost->resample_width = icodec->width;
|
||||
ost->resample_pix_fmt= icodec->pix_fmt;
|
||||
@@ -3952,7 +3956,7 @@ static int opt_output_file(const char *opt, const char *filename)
|
||||
/* check filename in case of an image number is expected */
|
||||
if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
|
||||
if (!av_filename_number_test(oc->filename)) {
|
||||
print_error(oc->filename, AVERROR(EINVAL));
|
||||
print_error(oc->filename, AVERROR_NUMEXPECTED);
|
||||
ffmpeg_exit(1);
|
||||
}
|
||||
}
|
||||
@@ -3963,7 +3967,7 @@ static int opt_output_file(const char *opt, const char *filename)
|
||||
(strchr(filename, ':') == NULL ||
|
||||
filename[1] == ':' ||
|
||||
av_strstart(filename, "file:", NULL))) {
|
||||
if (avio_check(filename, 0) == 0) {
|
||||
if (url_exist(filename)) {
|
||||
if (!using_stdin) {
|
||||
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
|
||||
fflush(stderr);
|
||||
@@ -3980,7 +3984,7 @@ static int opt_output_file(const char *opt, const char *filename)
|
||||
}
|
||||
|
||||
/* open the file */
|
||||
if ((err = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE)) < 0) {
|
||||
if ((err = avio_open(&oc->pb, filename, AVIO_WRONLY)) < 0) {
|
||||
print_error(filename, err);
|
||||
ffmpeg_exit(1);
|
||||
}
|
||||
@@ -4071,13 +4075,13 @@ static void parse_matrix_coeffs(uint16_t *dest, const char *str)
|
||||
}
|
||||
}
|
||||
|
||||
static void opt_inter_matrix(const char *arg)
|
||||
static void opt_inter_matrix(const char *opt, const char *arg)
|
||||
{
|
||||
inter_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||
parse_matrix_coeffs(inter_matrix, arg);
|
||||
}
|
||||
|
||||
static void opt_intra_matrix(const char *arg)
|
||||
static void opt_intra_matrix(const char *opt, const char *arg)
|
||||
{
|
||||
intra_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||
parse_matrix_coeffs(intra_matrix, arg);
|
||||
@@ -4375,10 +4379,12 @@ static void log_callback_null(void* ptr, int level, const char* fmt, va_list vl)
|
||||
{
|
||||
}
|
||||
|
||||
static void opt_passlogfile(const char *arg)
|
||||
static void opt_passlogfile(const char *opt, const char *arg)
|
||||
{
|
||||
pass_logfilename_prefix = arg;
|
||||
#if CONFIG_LIBX264_ENCODER
|
||||
opt_default("passlogfile", arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
static const OptionDef options[] = {
|
||||
|
34
ffplay.c
34
ffplay.c
@@ -27,6 +27,7 @@
|
||||
#include "libavutil/colorspace.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"
|
||||
@@ -34,7 +35,7 @@
|
||||
#include "libavdevice/avdevice.h"
|
||||
#include "libswscale/swscale.h"
|
||||
#include "libavcodec/audioconvert.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/opt.h"
|
||||
#include "libavcodec/avfft.h"
|
||||
|
||||
#if CONFIG_AVFILTER
|
||||
@@ -2295,15 +2296,13 @@ 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;
|
||||
|
||||
memset(st_index, -1, sizeof(st_index));
|
||||
is->video_stream = -1;
|
||||
@@ -2313,30 +2312,17 @@ 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)
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/opt.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavdevice/avdevice.h"
|
||||
|
42
ffserver.c
42
ffserver.c
@@ -39,7 +39,7 @@
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/random_seed.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/opt.h"
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
@@ -94,7 +94,9 @@ static const char *http_state[] = {
|
||||
"RTSP_SEND_PACKET",
|
||||
};
|
||||
|
||||
#if !FF_API_MAX_STREAMS
|
||||
#define MAX_STREAMS 20
|
||||
#endif
|
||||
|
||||
#define IOBUFFER_INIT_SIZE 8192
|
||||
|
||||
@@ -2229,11 +2231,11 @@ static int http_prepare_data(HTTPContext *c)
|
||||
av_dict_set(&c->fmt_ctx.metadata, "copyright", c->stream->copyright, 0);
|
||||
av_dict_set(&c->fmt_ctx.metadata, "title" , c->stream->title , 0);
|
||||
|
||||
c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * c->stream->nb_streams);
|
||||
|
||||
for(i=0;i<c->stream->nb_streams;i++) {
|
||||
AVStream *st;
|
||||
AVStream *src;
|
||||
c->fmt_ctx.streams[i] = av_mallocz(sizeof(AVStream));
|
||||
st = av_mallocz(sizeof(AVStream));
|
||||
c->fmt_ctx.streams[i] = st;
|
||||
/* if file or feed, then just take streams from FFStream struct */
|
||||
if (!c->stream->feed ||
|
||||
c->stream->feed == c->stream)
|
||||
@@ -2241,9 +2243,9 @@ static int http_prepare_data(HTTPContext *c)
|
||||
else
|
||||
src = c->stream->feed->streams[c->stream->feed_streams[i]];
|
||||
|
||||
*(c->fmt_ctx.streams[i]) = *src;
|
||||
c->fmt_ctx.streams[i]->priv_data = 0;
|
||||
c->fmt_ctx.streams[i]->codec->frame_number = 0; /* XXX: should be done in
|
||||
*st = *src;
|
||||
st->priv_data = 0;
|
||||
st->codec->frame_number = 0; /* XXX: should be done in
|
||||
AVStream, not in codec */
|
||||
}
|
||||
/* set output format parameters */
|
||||
@@ -2941,9 +2943,11 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
|
||||
snprintf(avc->filename, 1024, "rtp://0.0.0.0");
|
||||
}
|
||||
|
||||
#if !FF_API_MAX_STREAMS
|
||||
if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) ||
|
||||
!(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams))))
|
||||
goto sdp_done;
|
||||
#endif
|
||||
if (avc->nb_streams >= INT_MAX/sizeof(*avs) ||
|
||||
!(avs = av_malloc(avc->nb_streams * sizeof(*avs))))
|
||||
goto sdp_done;
|
||||
@@ -2956,8 +2960,10 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
|
||||
av_sdp_create(&avc, 1, *pbuffer, 2048);
|
||||
|
||||
sdp_done:
|
||||
#if !FF_API_MAX_STREAMS
|
||||
av_free(avc->streams);
|
||||
av_dict_free(&avc->metadata);
|
||||
#endif
|
||||
av_metadata_free(&avc->metadata);
|
||||
av_free(avc);
|
||||
av_free(avs);
|
||||
|
||||
@@ -3385,9 +3391,6 @@ static int rtp_new_av_stream(HTTPContext *c,
|
||||
if (!st)
|
||||
goto fail;
|
||||
ctx->nb_streams = 1;
|
||||
ctx->streams = av_mallocz(sizeof(AVStream *) * ctx->nb_streams);
|
||||
if (!ctx->streams)
|
||||
goto fail;
|
||||
ctx->streams[0] = st;
|
||||
|
||||
if (!c->stream->feed ||
|
||||
@@ -3421,7 +3424,7 @@ static int rtp_new_av_stream(HTTPContext *c,
|
||||
"rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
|
||||
}
|
||||
|
||||
if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0)
|
||||
if (url_open(&h, ctx->filename, AVIO_WRONLY) < 0)
|
||||
goto fail;
|
||||
c->rtp_handles[stream_index] = h;
|
||||
max_packet_size = url_get_max_packet_size(h);
|
||||
@@ -3674,7 +3677,7 @@ static void build_feed_streams(void)
|
||||
for(feed = first_feed; feed != NULL; feed = feed->next_feed) {
|
||||
int fd;
|
||||
|
||||
if (avio_check(feed->feed_filename, AVIO_FLAG_READ) > 0) {
|
||||
if (url_exist(feed->feed_filename)) {
|
||||
/* See if it matches */
|
||||
AVFormatContext *s = NULL;
|
||||
int matches = 0;
|
||||
@@ -3747,7 +3750,7 @@ static void build_feed_streams(void)
|
||||
unlink(feed->feed_filename);
|
||||
}
|
||||
}
|
||||
if (avio_check(feed->feed_filename, AVIO_FLAG_WRITE) <= 0) {
|
||||
if (!url_exist(feed->feed_filename)) {
|
||||
AVFormatContext s1 = {0}, *s = &s1;
|
||||
|
||||
if (feed->readonly) {
|
||||
@@ -3757,15 +3760,20 @@ static void build_feed_streams(void)
|
||||
}
|
||||
|
||||
/* only write the header of the ffm file */
|
||||
if (avio_open(&s->pb, feed->feed_filename, AVIO_FLAG_WRITE) < 0) {
|
||||
if (avio_open(&s->pb, feed->feed_filename, AVIO_WRONLY) < 0) {
|
||||
http_log("Could not open output feed file '%s'\n",
|
||||
feed->feed_filename);
|
||||
exit(1);
|
||||
}
|
||||
s->oformat = feed->fmt;
|
||||
s->nb_streams = feed->nb_streams;
|
||||
s->streams = feed->streams;
|
||||
if (avformat_write_header(s, NULL) < 0) {
|
||||
for(i=0;i<s->nb_streams;i++) {
|
||||
AVStream *st;
|
||||
st = feed->streams[i];
|
||||
s->streams[i] = st;
|
||||
}
|
||||
av_set_parameters(s, NULL);
|
||||
if (av_write_header(s) < 0) {
|
||||
http_log("Container doesn't supports the required parameters\n");
|
||||
exit(1);
|
||||
}
|
||||
|
@@ -50,8 +50,6 @@ typedef struct EightBpsContext {
|
||||
|
||||
unsigned char planes;
|
||||
unsigned char planemap[4];
|
||||
|
||||
uint32_t pal[256];
|
||||
} EightBpsContext;
|
||||
|
||||
|
||||
@@ -131,16 +129,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
||||
}
|
||||
}
|
||||
|
||||
if (avctx->bits_per_coded_sample <= 8) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt,
|
||||
AV_PKT_DATA_PALETTE,
|
||||
NULL);
|
||||
if (pal) {
|
||||
if (avctx->palctrl) {
|
||||
memcpy (c->pic.data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (avctx->palctrl->palette_changed) {
|
||||
c->pic.palette_has_changed = 1;
|
||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
memcpy (c->pic.data[1], c->pal, AVPALETTE_SIZE);
|
||||
avctx->palctrl->palette_changed = 0;
|
||||
} else
|
||||
c->pic.palette_has_changed = 0;
|
||||
}
|
||||
|
||||
*data_size = sizeof(AVFrame);
|
||||
@@ -170,6 +165,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||
c->planes = 1;
|
||||
c->planemap[0] = 0; // 1st plane is palette indexes
|
||||
if (avctx->palctrl == NULL) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error: PAL8 format but no palette from demuxer.\n");
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24);
|
||||
|
@@ -15,6 +15,7 @@ OBJS = allcodecs.o \
|
||||
fmtconvert.o \
|
||||
imgconvert.o \
|
||||
jrevdct.o \
|
||||
opt.o \
|
||||
options.o \
|
||||
parser.o \
|
||||
raw.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).
|
||||
|
@@ -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;
|
||||
|
@@ -69,7 +69,7 @@ typedef struct {
|
||||
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 +87,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 +97,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 +110,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 +126,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 +141,27 @@ typedef struct {
|
||||
int out_channels; ///< number of output channels
|
||||
///@}
|
||||
|
||||
///@defgroup dynrng dynamic range
|
||||
///@name Dynamic range
|
||||
float dynamic_range[2]; ///< dynamic range
|
||||
///@}
|
||||
|
||||
///@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 +177,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
|
||||
|
@@ -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
|
||||
/// @{
|
||||
|
||||
/**
|
||||
|
@@ -217,7 +217,7 @@ static av_cold int ape_decode_close(AVCodecContext * avctx)
|
||||
}
|
||||
|
||||
/**
|
||||
* @defgroup rangecoder APE range decoder
|
||||
* @name APE range decoding functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@@ -25,8 +25,7 @@
|
||||
#include "avcodec.h"
|
||||
|
||||
/**
|
||||
* Default values for ASS style.
|
||||
* @defgroup ass_default
|
||||
* @name Default values for ASS style
|
||||
* @{
|
||||
*/
|
||||
#define ASS_DEFAULT_FONT "Arial"
|
||||
|
@@ -33,6 +33,12 @@
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
# define FF_INTERNALC_MEM_TYPE unsigned int
|
||||
#else
|
||||
# define FF_INTERNALC_MEM_TYPE size_t
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Identify the syntax and semantics of the bitstream.
|
||||
* The principle is roughly:
|
||||
@@ -111,6 +117,9 @@ enum CodecID {
|
||||
CODEC_ID_QDRAW,
|
||||
CODEC_ID_VIXL,
|
||||
CODEC_ID_QPEG,
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
CODEC_ID_XVID,
|
||||
#endif
|
||||
CODEC_ID_PNG,
|
||||
CODEC_ID_PPM,
|
||||
CODEC_ID_PBM,
|
||||
@@ -359,6 +368,18 @@ enum CodecID {
|
||||
CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information.
|
||||
};
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
#define CodecType AVMediaType
|
||||
|
||||
#define CODEC_TYPE_UNKNOWN AVMEDIA_TYPE_UNKNOWN
|
||||
#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
|
||||
#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
|
||||
#define CODEC_TYPE_DATA AVMEDIA_TYPE_DATA
|
||||
#define CODEC_TYPE_SUBTITLE AVMEDIA_TYPE_SUBTITLE
|
||||
#define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
|
||||
#define CODEC_TYPE_NB AVMEDIA_TYPE_NB
|
||||
#endif
|
||||
|
||||
#if FF_API_OLD_SAMPLE_FMT
|
||||
#define SampleFormat AVSampleFormat
|
||||
|
||||
@@ -1070,10 +1091,6 @@ typedef struct AVPanScan{
|
||||
#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
|
||||
#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
|
||||
|
||||
enum AVPacketSideDataType {
|
||||
AV_PKT_DATA_PALETTE,
|
||||
};
|
||||
|
||||
typedef struct AVPacket {
|
||||
/**
|
||||
* Presentation timestamp in AVStream->time_base units; the time at which
|
||||
@@ -1095,17 +1112,6 @@ typedef struct AVPacket {
|
||||
int size;
|
||||
int stream_index;
|
||||
int flags;
|
||||
/**
|
||||
* Additional packet data that can be provided by the container.
|
||||
* Packet can contain several types of side information.
|
||||
*/
|
||||
struct {
|
||||
uint8_t *data;
|
||||
int size;
|
||||
enum AVPacketSideDataType type;
|
||||
} *side_data;
|
||||
int side_data_elems;
|
||||
|
||||
/**
|
||||
* Duration of this packet in AVStream->time_base units, 0 if unknown.
|
||||
* Equals next_pts - this_pts in presentation order.
|
||||
@@ -1135,6 +1141,9 @@ typedef struct AVPacket {
|
||||
int64_t convergence_duration;
|
||||
} AVPacket;
|
||||
#define AV_PKT_FLAG_KEY 0x0001
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Audio Video Frame.
|
||||
@@ -1255,6 +1264,16 @@ typedef struct AVCodecContext {
|
||||
*/
|
||||
enum PixelFormat pix_fmt;
|
||||
|
||||
#if FF_API_RATE_EMU
|
||||
/**
|
||||
* Frame rate emulation. If not zero, the lower layer (i.e. format handler)
|
||||
* has to read frames at native frame rate.
|
||||
* - encoding: Set by user.
|
||||
* - decoding: unused
|
||||
*/
|
||||
attribute_deprecated int rate_emu;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* If non NULL, 'draw_horiz_band' is called by the libavcodec
|
||||
* decoder to draw a horizontal band. It improves cache usage. Not
|
||||
@@ -1299,6 +1318,9 @@ typedef struct AVCodecContext {
|
||||
*/
|
||||
int frame_size;
|
||||
int frame_number; ///< audio or video frame number
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
int real_pict_num; ///< Returns the real picture number of previous encoded frame.
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Number of frames the decoded output will be delayed relative to
|
||||
@@ -1356,6 +1378,16 @@ typedef struct AVCodecContext {
|
||||
|
||||
int b_frame_strategy;
|
||||
|
||||
#if FF_API_HURRY_UP
|
||||
/**
|
||||
* hurry up amount
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user. 1-> Skip B-frames, 2-> Skip IDCT/dequant too, 5-> Skip everything except header
|
||||
* @deprecated Deprecated in favor of skip_idct and skip_frame.
|
||||
*/
|
||||
attribute_deprecated int hurry_up;
|
||||
#endif
|
||||
|
||||
struct AVCodec *codec;
|
||||
|
||||
void *priv_data;
|
||||
@@ -1473,6 +1505,9 @@ typedef struct AVCodecContext {
|
||||
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
|
||||
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
|
||||
#define FF_COMPLIANCE_NORMAL 0
|
||||
#if FF_API_INOFFICIAL
|
||||
#define FF_COMPLIANCE_INOFFICIAL -1 ///< Allow inofficial extensions (deprecated - use FF_COMPLIANCE_UNOFFICIAL instead).
|
||||
#endif
|
||||
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
|
||||
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
|
||||
|
||||
@@ -1746,6 +1781,25 @@ typedef struct AVCodecContext {
|
||||
*/
|
||||
unsigned dsp_mask;
|
||||
|
||||
#if FF_API_MM_FLAGS
|
||||
#define FF_MM_FORCE AV_CPU_FLAG_FORCE
|
||||
#define FF_MM_MMX AV_CPU_FLAG_MMX
|
||||
#define FF_MM_3DNOW AV_CPU_FLAG_3DNOW
|
||||
#define FF_MM_MMXEXT AV_CPU_FLAG_MMX2
|
||||
#define FF_MM_MMX2 AV_CPU_FLAG_MMX2
|
||||
#define FF_MM_SSE AV_CPU_FLAG_SSE
|
||||
#define FF_MM_SSE2 AV_CPU_FLAG_SSE2
|
||||
#define FF_MM_SSE2SLOW AV_CPU_FLAG_SSE2SLOW
|
||||
#define FF_MM_3DNOWEXT AV_CPU_FLAG_3DNOWEXT
|
||||
#define FF_MM_SSE3 AV_CPU_FLAG_SSE3
|
||||
#define FF_MM_SSE3SLOW AV_CPU_FLAG_SSE3SLOW
|
||||
#define FF_MM_SSSE3 AV_CPU_FLAG_SSSE3
|
||||
#define FF_MM_SSE4 AV_CPU_FLAG_SSE4
|
||||
#define FF_MM_SSE42 AV_CPU_FLAG_SSE42
|
||||
#define FF_MM_IWMMXT AV_CPU_FLAG_IWMMXT
|
||||
#define FF_MM_ALTIVEC AV_CPU_FLAG_ALTIVEC
|
||||
#endif
|
||||
|
||||
/**
|
||||
* bits per sample/pixel from the demuxer (needed for huffyuv).
|
||||
* - encoding: Set by libavcodec.
|
||||
@@ -1820,6 +1874,22 @@ typedef struct AVCodecContext {
|
||||
*/
|
||||
uint64_t error[4];
|
||||
|
||||
#if FF_API_MB_Q
|
||||
/**
|
||||
* minimum MB quantizer
|
||||
* - encoding: unused
|
||||
* - decoding: unused
|
||||
*/
|
||||
attribute_deprecated int mb_qmin;
|
||||
|
||||
/**
|
||||
* maximum MB quantizer
|
||||
* - encoding: unused
|
||||
* - decoding: unused
|
||||
*/
|
||||
attribute_deprecated int mb_qmax;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* motion estimation comparison function
|
||||
* - encoding: Set by user.
|
||||
@@ -2521,6 +2591,23 @@ typedef struct AVCodecContext {
|
||||
int compression_level;
|
||||
#define FF_COMPRESSION_DEFAULT -1
|
||||
|
||||
#if FF_API_USE_LPC
|
||||
/**
|
||||
* Sets whether to use LPC mode - used by FLAC encoder.
|
||||
* - encoding: Set by user.
|
||||
* - decoding: unused
|
||||
* @deprecated Deprecated in favor of lpc_type and lpc_passes.
|
||||
*/
|
||||
int use_lpc;
|
||||
|
||||
/**
|
||||
* LPC coefficient precision - used by FLAC encoder
|
||||
* - encoding: Set by user.
|
||||
* - decoding: unused
|
||||
*/
|
||||
int lpc_coeff_precision;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* - encoding: Set by user.
|
||||
* - decoding: unused
|
||||
@@ -2535,18 +2622,11 @@ typedef struct AVCodecContext {
|
||||
|
||||
#if FF_API_FLAC_GLOBAL_OPTS
|
||||
/**
|
||||
* @defgroup flac_opts FLAC options
|
||||
* @name FLAC options
|
||||
* @deprecated Use FLAC encoder private options instead.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* LPC coefficient precision - used by FLAC encoder
|
||||
* - encoding: Set by user.
|
||||
* - decoding: unused
|
||||
*/
|
||||
attribute_deprecated int lpc_coeff_precision;
|
||||
|
||||
/**
|
||||
* search method for selecting prediction order
|
||||
* - encoding: Set by user.
|
||||
@@ -2957,7 +3037,7 @@ typedef struct AVCodec {
|
||||
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
|
||||
|
||||
/**
|
||||
* @defgroup framethreading Frame-level threading support functions.
|
||||
* @name Frame-level threading support functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
@@ -3211,33 +3291,6 @@ int av_dup_packet(AVPacket *pkt);
|
||||
*/
|
||||
void av_free_packet(AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Allocate new information of a packet.
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param type side information type
|
||||
* @param size side information size
|
||||
* @return pointer to fresh allocated data or NULL otherwise
|
||||
*/
|
||||
uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
int size);
|
||||
|
||||
/**
|
||||
* Get side information from packet.
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param type desired side information type
|
||||
* @param size pointer for side information size to store (optional)
|
||||
* @return pointer to data if present or NULL otherwise
|
||||
*/
|
||||
uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
int *size);
|
||||
|
||||
int av_packet_merge_side_data(AVPacket *pkt);
|
||||
|
||||
int av_packet_split_side_data(AVPacket *pkt);
|
||||
|
||||
|
||||
/* resample.c */
|
||||
|
||||
struct ReSampleContext;
|
||||
@@ -3245,6 +3298,14 @@ struct AVResampleContext;
|
||||
|
||||
typedef struct ReSampleContext ReSampleContext;
|
||||
|
||||
#if FF_API_AUDIO_OLD
|
||||
/**
|
||||
* @deprecated Use av_audio_resample_init() instead.
|
||||
*/
|
||||
attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
|
||||
int output_rate, int input_rate);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initialize audio resampling context.
|
||||
*
|
||||
@@ -3408,6 +3469,23 @@ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
|
||||
|
||||
void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* Return the pixel format corresponding to the name name.
|
||||
*
|
||||
* If there is no pixel format with name name, then look for a
|
||||
* pixel format with the name corresponding to the native endian
|
||||
* format of name.
|
||||
* For example in a little-endian system, first look for "gray16",
|
||||
* then for "gray16le".
|
||||
*
|
||||
* Finally if no pixel format has been found, return PIX_FMT_NONE.
|
||||
*
|
||||
* @deprecated Deprecated in favor of av_get_pix_fmt().
|
||||
*/
|
||||
attribute_deprecated enum PixelFormat avcodec_get_pix_fmt(const char* name);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return a value representing the fourCC code associated to the
|
||||
* pixel format pix_fmt, or 0 if no associated fourCC code can be
|
||||
@@ -3476,6 +3554,14 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
|
||||
enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
|
||||
int has_alpha, int *loss_ptr);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* @deprecated Use av_get_pix_fmt_string() instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
|
||||
#endif
|
||||
|
||||
#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
|
||||
#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
|
||||
|
||||
@@ -3526,6 +3612,13 @@ const char *avcodec_license(void);
|
||||
*/
|
||||
void avcodec_init(void);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* @deprecated Deprecated in favor of avcodec_register().
|
||||
*/
|
||||
attribute_deprecated void register_avcodec(AVCodec *codec);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Register the codec codec and initialize libavcodec.
|
||||
*
|
||||
@@ -3670,6 +3763,14 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
|
||||
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||
int linesize_align[4]);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* @deprecated Deprecated in favor of av_check_image_size().
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
|
||||
#endif
|
||||
|
||||
enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
|
||||
|
||||
#if FF_API_THREAD_INIT
|
||||
@@ -3678,8 +3779,8 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avcodec_thread_init(AVCodecContext *s, int thread_count);
|
||||
void avcodec_thread_free(AVCodecContext *s);
|
||||
#endif
|
||||
|
||||
int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
|
||||
int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
|
||||
//FIXME func typedef
|
||||
@@ -3713,6 +3814,25 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
|
||||
*/
|
||||
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
|
||||
|
||||
#if FF_API_AUDIO_OLD
|
||||
/**
|
||||
* Decode an audio frame from buf into samples.
|
||||
* Wrapper function which calls avcodec_decode_audio3.
|
||||
*
|
||||
* @deprecated Use avcodec_decode_audio3 instead.
|
||||
* @param avctx the codec context
|
||||
* @param[out] samples the output buffer
|
||||
* @param[in,out] frame_size_ptr the output buffer size in bytes
|
||||
* @param[in] buf the input buffer
|
||||
* @param[in] buf_size the input buffer size in bytes
|
||||
* @return On error a negative value is returned, otherwise the number of bytes
|
||||
* used or zero if no frame could be decompressed.
|
||||
*/
|
||||
attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
|
||||
int *frame_size_ptr,
|
||||
const uint8_t *buf, int buf_size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Decode the audio frame of size avpkt->size from avpkt->data into samples.
|
||||
* Some decoders may support multiple frames in a single AVPacket, such
|
||||
@@ -3756,6 +3876,25 @@ int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
|
||||
int *frame_size_ptr,
|
||||
AVPacket *avpkt);
|
||||
|
||||
#if FF_API_VIDEO_OLD
|
||||
/**
|
||||
* Decode a video frame from buf into picture.
|
||||
* Wrapper function which calls avcodec_decode_video2.
|
||||
*
|
||||
* @deprecated Use avcodec_decode_video2 instead.
|
||||
* @param avctx the codec context
|
||||
* @param[out] picture The AVFrame in which the decoded video frame will be stored.
|
||||
* @param[in] buf the input buffer
|
||||
* @param[in] buf_size the size of the input buffer in bytes
|
||||
* @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
|
||||
* @return On error a negative value is returned, otherwise the number of bytes
|
||||
* used or zero if no frame could be decompressed.
|
||||
*/
|
||||
attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
|
||||
int *got_picture_ptr,
|
||||
const uint8_t *buf, int buf_size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Decode the video frame of size avpkt->size from avpkt->data into picture.
|
||||
* Some decoders may support multiple frames in a single AVPacket, such
|
||||
@@ -3800,6 +3939,15 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
|
||||
int *got_picture_ptr,
|
||||
AVPacket *avpkt);
|
||||
|
||||
#if FF_API_SUBTITLE_OLD
|
||||
/* Decode a subtitle message. Return -1 if error, otherwise return the
|
||||
* number of bytes used. If no subtitle could be decompressed,
|
||||
* got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
|
||||
attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
|
||||
int *got_sub_ptr,
|
||||
const uint8_t *buf, int buf_size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Decode a subtitle message.
|
||||
* Return a negative value on error, otherwise return the number of bytes used.
|
||||
@@ -3915,7 +4063,7 @@ int av_get_bits_per_sample(enum CodecID codec_id);
|
||||
|
||||
#if FF_API_OLD_SAMPLE_FMT
|
||||
/**
|
||||
* @deprecated Use av_get_bits_per_sample_fmt() instead.
|
||||
* @deprecated Use av_get_bytes_per_sample() instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt);
|
||||
@@ -4068,6 +4216,15 @@ AVCodecParser *av_parser_next(AVCodecParser *c);
|
||||
void av_register_codec_parser(AVCodecParser *parser);
|
||||
AVCodecParserContext *av_parser_init(int codec_id);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
attribute_deprecated
|
||||
int av_parser_parse(AVCodecParserContext *s,
|
||||
AVCodecContext *avctx,
|
||||
uint8_t **poutbuf, int *poutbuf_size,
|
||||
const uint8_t *buf, int buf_size,
|
||||
int64_t pts, int64_t dts);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Parse a packet.
|
||||
*
|
||||
@@ -4146,7 +4303,7 @@ AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
|
||||
*
|
||||
* @see av_realloc
|
||||
*/
|
||||
void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
|
||||
void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size);
|
||||
|
||||
/**
|
||||
* Allocate a buffer, reusing the given one if large enough.
|
||||
@@ -4160,7 +4317,17 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
|
||||
* @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
|
||||
* *size 0 if an error occurred.
|
||||
*/
|
||||
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
|
||||
void av_fast_malloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* @deprecated Deprecated in favor of av_image_copy().
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
|
||||
uint8_t *src_data[4], int src_linesize[4],
|
||||
enum PixelFormat pix_fmt, int width, int height);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Copy image src to dst. Wraps av_picture_data_copy() above.
|
||||
@@ -4189,6 +4356,22 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
|
||||
*/
|
||||
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* Parse str and put in width_ptr and height_ptr the detected values.
|
||||
*
|
||||
* @deprecated Deprecated in favor of av_parse_video_size().
|
||||
*/
|
||||
attribute_deprecated int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
|
||||
|
||||
/**
|
||||
* Parse str and store the detected values in *frame_rate.
|
||||
*
|
||||
* @deprecated Deprecated in favor of av_parse_video_rate().
|
||||
*/
|
||||
attribute_deprecated int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Logs a generic warning message about a missing feature. This function is
|
||||
* intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
|
||||
|
@@ -26,21 +26,12 @@
|
||||
void av_destruct_packet_nofree(AVPacket *pkt)
|
||||
{
|
||||
pkt->data = NULL; pkt->size = 0;
|
||||
pkt->side_data = NULL;
|
||||
pkt->side_data_elems = 0;
|
||||
}
|
||||
|
||||
void av_destruct_packet(AVPacket *pkt)
|
||||
{
|
||||
int i;
|
||||
|
||||
av_free(pkt->data);
|
||||
pkt->data = NULL; pkt->size = 0;
|
||||
|
||||
for (i = 0; i < pkt->side_data_elems; i++)
|
||||
av_free(pkt->side_data[i].data);
|
||||
av_freep(&pkt->side_data);
|
||||
pkt->side_data_elems = 0;
|
||||
}
|
||||
|
||||
void av_init_packet(AVPacket *pkt)
|
||||
@@ -53,8 +44,6 @@ void av_init_packet(AVPacket *pkt)
|
||||
pkt->flags = 0;
|
||||
pkt->stream_index = 0;
|
||||
pkt->destruct= NULL;
|
||||
pkt->side_data = NULL;
|
||||
pkt->side_data_elems = 0;
|
||||
}
|
||||
|
||||
int av_new_packet(AVPacket *pkt, int size)
|
||||
@@ -100,52 +89,23 @@ int av_grow_packet(AVPacket *pkt, int grow_by)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define DUP_DATA(dst, src, size, padding) \
|
||||
do { \
|
||||
void *data; \
|
||||
if (padding) { \
|
||||
if ((unsigned)(size) > (unsigned)(size) + FF_INPUT_BUFFER_PADDING_SIZE) \
|
||||
goto failed_alloc; \
|
||||
data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); \
|
||||
} else { \
|
||||
data = av_malloc(size); \
|
||||
} \
|
||||
if (!data) \
|
||||
goto failed_alloc; \
|
||||
memcpy(data, src, size); \
|
||||
if (padding) \
|
||||
memset((uint8_t*)data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); \
|
||||
dst = data; \
|
||||
} while(0)
|
||||
|
||||
int av_dup_packet(AVPacket *pkt)
|
||||
{
|
||||
AVPacket tmp_pkt;
|
||||
|
||||
if (((pkt->destruct == av_destruct_packet_nofree) || (pkt->destruct == NULL)) && pkt->data) {
|
||||
tmp_pkt = *pkt;
|
||||
|
||||
pkt->data = NULL;
|
||||
pkt->side_data = NULL;
|
||||
DUP_DATA(pkt->data, tmp_pkt.data, pkt->size, 1);
|
||||
pkt->destruct = av_destruct_packet;
|
||||
|
||||
if (pkt->side_data_elems) {
|
||||
int i;
|
||||
|
||||
DUP_DATA(pkt->side_data, tmp_pkt.side_data,
|
||||
pkt->side_data_elems * sizeof(*pkt->side_data), 0);
|
||||
memset(pkt->side_data, 0, pkt->side_data_elems * sizeof(*pkt->side_data));
|
||||
for (i = 0; i < pkt->side_data_elems; i++) {
|
||||
DUP_DATA(pkt->side_data[i].data, tmp_pkt.side_data[i].data,
|
||||
pkt->side_data[i].size, 1);
|
||||
}
|
||||
uint8_t *data;
|
||||
/* We duplicate the packet and don't forget to add the padding again. */
|
||||
if((unsigned)pkt->size > (unsigned)pkt->size + FF_INPUT_BUFFER_PADDING_SIZE)
|
||||
return AVERROR(ENOMEM);
|
||||
data = av_malloc(pkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!data) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(data, pkt->data, pkt->size);
|
||||
memset(data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->data = data;
|
||||
pkt->destruct = av_destruct_packet;
|
||||
}
|
||||
return 0;
|
||||
failed_alloc:
|
||||
av_destruct_packet(pkt);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
void av_free_packet(AVPacket *pkt)
|
||||
@@ -153,125 +113,6 @@ void av_free_packet(AVPacket *pkt)
|
||||
if (pkt) {
|
||||
if (pkt->destruct) pkt->destruct(pkt);
|
||||
pkt->data = NULL; pkt->size = 0;
|
||||
pkt->side_data = NULL;
|
||||
pkt->side_data_elems = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
int size)
|
||||
{
|
||||
int elems = pkt->side_data_elems;
|
||||
|
||||
if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
|
||||
return NULL;
|
||||
if ((unsigned)size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
|
||||
return NULL;
|
||||
|
||||
pkt->side_data = av_realloc(pkt->side_data, (elems + 1) * sizeof(*pkt->side_data));
|
||||
if (!pkt->side_data)
|
||||
return NULL;
|
||||
|
||||
pkt->side_data[elems].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!pkt->side_data[elems].data)
|
||||
return NULL;
|
||||
pkt->side_data[elems].size = size;
|
||||
pkt->side_data[elems].type = type;
|
||||
pkt->side_data_elems++;
|
||||
|
||||
return pkt->side_data[elems].data;
|
||||
}
|
||||
|
||||
uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
int *size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < pkt->side_data_elems; i++) {
|
||||
if (pkt->side_data[i].type == type) {
|
||||
if (size)
|
||||
*size = pkt->side_data[i].size;
|
||||
return pkt->side_data[i].data;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define FF_MERGE_MARKER 0x8c4d9d108e25e9feULL
|
||||
|
||||
int av_packet_merge_side_data(AVPacket *pkt){
|
||||
if(pkt->side_data_elems){
|
||||
int i;
|
||||
uint8_t *p;
|
||||
uint64_t size= pkt->size + 8LL + FF_INPUT_BUFFER_PADDING_SIZE;
|
||||
AVPacket old= *pkt;
|
||||
for (i=0; i<old.side_data_elems; i++) {
|
||||
size += old.side_data[i].size + 5LL;
|
||||
}
|
||||
if (size > INT_MAX)
|
||||
return AVERROR(EINVAL);
|
||||
p = av_malloc(size);
|
||||
if (!p)
|
||||
return AVERROR(ENOMEM);
|
||||
pkt->data = p;
|
||||
pkt->destruct = av_destruct_packet;
|
||||
pkt->size = size - FF_INPUT_BUFFER_PADDING_SIZE;
|
||||
bytestream_put_buffer(&p, old.data, old.size);
|
||||
for (i=old.side_data_elems-1; i>=0; i--) {
|
||||
bytestream_put_buffer(&p, old.side_data[i].data, old.side_data[i].size);
|
||||
bytestream_put_be32(&p, old.side_data[i].size);
|
||||
*p++ = old.side_data[i].type | ((i==old.side_data_elems-1)*128);
|
||||
}
|
||||
bytestream_put_be64(&p, FF_MERGE_MARKER);
|
||||
av_assert0(p-pkt->data == pkt->size);
|
||||
memset(p, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
av_free_packet(&old);
|
||||
pkt->side_data_elems = 0;
|
||||
pkt->side_data = NULL;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int av_packet_split_side_data(AVPacket *pkt){
|
||||
if (!pkt->side_data_elems && pkt->size >12 && AV_RB64(pkt->data + pkt->size - 8) == FF_MERGE_MARKER){
|
||||
int i;
|
||||
unsigned int size;
|
||||
uint8_t *p= pkt->data + pkt->size - 8 - 5;
|
||||
|
||||
av_dup_packet(pkt);
|
||||
|
||||
for (i=1; ; i++){
|
||||
size = AV_RB32(p);
|
||||
if (size>INT_MAX || p - pkt->data <= size)
|
||||
return 0;
|
||||
if (p[4]&128)
|
||||
break;
|
||||
p-= size+5;
|
||||
}
|
||||
|
||||
pkt->side_data = av_malloc(i * sizeof(*pkt->side_data));
|
||||
if (!pkt->side_data)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
p= pkt->data + pkt->size - 8 - 5;
|
||||
for (i=0; ; i++){
|
||||
size= AV_RB32(p);
|
||||
av_assert0(size<=INT_MAX && p - pkt->data > size);
|
||||
pkt->side_data[i].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->side_data[i].size = size;
|
||||
pkt->side_data[i].type = p[4]&127;
|
||||
if (!pkt->side_data[i].data)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(pkt->side_data[i].data, p-size, size);
|
||||
pkt->size -= size + 5;
|
||||
if(p[4]&128)
|
||||
break;
|
||||
p-= size+5;
|
||||
}
|
||||
pkt->size -= 8;
|
||||
pkt->side_data_elems = i+1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -67,7 +67,6 @@ typedef struct CinepakContext {
|
||||
|
||||
int sega_film_skip_bytes;
|
||||
|
||||
uint32_t pal[256];
|
||||
} CinepakContext;
|
||||
|
||||
static void cinepak_decode_codebook (cvid_codebook *codebook,
|
||||
@@ -396,7 +395,7 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx)
|
||||
s->sega_film_skip_bytes = -1; /* uninitialized state */
|
||||
|
||||
// check for paletted data
|
||||
if (avctx->bits_per_coded_sample != 8) {
|
||||
if ((avctx->palctrl == NULL) || (avctx->bits_per_coded_sample == 40)) {
|
||||
s->palette_video = 0;
|
||||
avctx->pix_fmt = PIX_FMT_YUV420P;
|
||||
} else {
|
||||
@@ -429,18 +428,16 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (s->palette_video) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
if (pal) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
cinepak_decode(s);
|
||||
|
||||
if (s->palette_video)
|
||||
memcpy (s->frame.data[1], s->pal, AVPALETTE_SIZE);
|
||||
if (s->palette_video) {
|
||||
memcpy (s->frame.data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (avctx->palctrl->palette_changed) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
avctx->palctrl->palette_changed = 0;
|
||||
} else
|
||||
s->frame.palette_has_changed = 0;
|
||||
}
|
||||
|
||||
*data_size = sizeof(AVFrame);
|
||||
*(AVFrame*)data = s->frame;
|
||||
|
@@ -335,7 +335,7 @@ static av_cold int cook_decode_close(AVCodecContext *avctx)
|
||||
* Fill the gain array for the timedomain quantization.
|
||||
*
|
||||
* @param gb pointer to the GetBitContext
|
||||
* @param gaininfo[9] array of gain indexes
|
||||
* @param gaininfo array[9] of gain indexes
|
||||
*/
|
||||
|
||||
static void decode_gain_info(GetBitContext *gb, int *gaininfo)
|
||||
|
@@ -120,6 +120,14 @@ void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
|
||||
void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
|
||||
|
||||
/* 1/2^n downscaling functions from imgconvert.c */
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* @deprecated Use av_image_copy_plane() instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
|
||||
#endif
|
||||
|
||||
void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
|
||||
void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
|
||||
void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
|
||||
|
@@ -296,6 +296,17 @@ static av_cold int flac_encode_init(AVCodecContext *avctx)
|
||||
s->options.max_partition_order = ((int[]){ 2, 2, 3, 3, 3, 8, 8, 8, 8, 8, 8, 8, 8})[level];
|
||||
|
||||
/* set compression option overrides from AVCodecContext */
|
||||
#if FF_API_USE_LPC
|
||||
/* for compatibility with deprecated AVCodecContext.use_lpc */
|
||||
if (avctx->use_lpc == 0) {
|
||||
s->options.lpc_type = AV_LPC_TYPE_FIXED;
|
||||
} else if (avctx->use_lpc == 1) {
|
||||
s->options.lpc_type = AV_LPC_TYPE_LEVINSON;
|
||||
} else if (avctx->use_lpc > 1) {
|
||||
s->options.lpc_type = AV_LPC_TYPE_CHOLESKY;
|
||||
s->options.lpc_passes = avctx->use_lpc - 1;
|
||||
}
|
||||
#endif
|
||||
#if FF_API_FLAC_GLOBAL_OPTS
|
||||
if (avctx->lpc_type > FF_LPC_TYPE_DEFAULT) {
|
||||
if (avctx->lpc_type > FF_LPC_TYPE_CHOLESKY) {
|
||||
|
@@ -599,6 +599,10 @@ retry:
|
||||
s->current_picture.pict_type= s->pict_type;
|
||||
s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
|
||||
|
||||
#if FF_API_HURRY_UP
|
||||
/* skip everything if we are in a hurry>=5 */
|
||||
if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
|
||||
#endif
|
||||
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
|
||||
||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
|
||||
|| avctx->skip_frame >= AVDISCARD_ALL)
|
||||
|
@@ -598,10 +598,18 @@ retry:
|
||||
|
||||
/* skip B-frames if we don't have reference frames */
|
||||
if(s->last_picture_ptr==NULL && (s->pict_type==AV_PICTURE_TYPE_B || s->dropable)) return get_consumed_bytes(s, buf_size);
|
||||
#if FF_API_HURRY_UP
|
||||
/* skip b frames if we are in a hurry */
|
||||
if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return get_consumed_bytes(s, buf_size);
|
||||
#endif
|
||||
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
|
||||
|| (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
|
||||
|| avctx->skip_frame >= AVDISCARD_ALL)
|
||||
return get_consumed_bytes(s, buf_size);
|
||||
#if FF_API_HURRY_UP
|
||||
/* skip everything if we are in a hurry>=5 */
|
||||
if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
|
||||
#endif
|
||||
|
||||
if(s->next_p_frame_damaged){
|
||||
if(s->pict_type==AV_PICTURE_TYPE_B)
|
||||
|
@@ -1682,7 +1682,7 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_ty
|
||||
uint64_t tr_high;
|
||||
if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
|
||||
const int topright_avail= (h->topright_samples_available<<i)&0x8000;
|
||||
assert(mb_y || linesize <= block_offset[i]);
|
||||
assert(s->mb_y || linesize <= block_offset[i]);
|
||||
if(!topright_avail){
|
||||
if (pixel_shift) {
|
||||
tr_high= ((uint16_t*)ptr)[3 - linesize/2]*0x0001000100010001ULL;
|
||||
@@ -2488,7 +2488,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
|
||||
|
||||
s->dropable= h->nal_ref_idc == 0;
|
||||
|
||||
if((s->avctx->flags2 & CODEC_FLAG2_FAST) && !h->nal_ref_idc){
|
||||
/* FIXME: 2tap qpel isn't implemented for high bit depth. */
|
||||
if((s->avctx->flags2 & CODEC_FLAG2_FAST) && !h->nal_ref_idc && !h->pixel_shift){
|
||||
s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
|
||||
s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
|
||||
}else{
|
||||
@@ -3303,8 +3304,8 @@ static void loop_filter(H264Context *h, int start_x, int end_x){
|
||||
uvlinesize = h->mb_uvlinesize = s->uvlinesize * 2;
|
||||
if(mb_y&1){ //FIXME move out of this function?
|
||||
dest_y -= s->linesize*15;
|
||||
dest_cb-= s->uvlinesize*7;
|
||||
dest_cr-= s->uvlinesize*7;
|
||||
dest_cb-= s->uvlinesize*((8 << CHROMA444)-1);
|
||||
dest_cr-= s->uvlinesize*((8 << CHROMA444)-1);
|
||||
}
|
||||
} else {
|
||||
linesize = h->mb_linesize = s->linesize;
|
||||
@@ -3698,7 +3699,11 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
||||
}
|
||||
|
||||
//FIXME do not discard SEI id
|
||||
if(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0)
|
||||
if(
|
||||
#if FF_API_HURRY_UP
|
||||
(s->hurry_up == 1 && h->nal_ref_idc == 0) ||
|
||||
#endif
|
||||
(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
|
||||
continue;
|
||||
|
||||
again:
|
||||
@@ -3735,6 +3740,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
||||
}
|
||||
|
||||
if(hx->redundant_pic_count==0
|
||||
#if FF_API_HURRY_UP
|
||||
&& hx->s.hurry_up < 5
|
||||
#endif
|
||||
&& (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
|
||||
&& (avctx->skip_frame < AVDISCARD_BIDIR || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
|
||||
&& (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I)
|
||||
@@ -3772,6 +3780,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
||||
|
||||
if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning
|
||||
&& s->context_initialized
|
||||
#if FF_API_HURRY_UP
|
||||
&& s->hurry_up < 5
|
||||
#endif
|
||||
&& (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
|
||||
&& (avctx->skip_frame < AVDISCARD_BIDIR || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
|
||||
&& (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I)
|
||||
@@ -3910,7 +3921,11 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
|
||||
if (avctx->skip_frame >= AVDISCARD_NONREF)
|
||||
if (avctx->skip_frame >= AVDISCARD_NONREF
|
||||
#if FF_API_HURRY_UP
|
||||
|| s->hurry_up
|
||||
#endif
|
||||
)
|
||||
return 0;
|
||||
av_log(avctx, AV_LOG_ERROR, "no frame!\n");
|
||||
return -1;
|
||||
|
@@ -507,7 +507,7 @@ typedef struct H264Context{
|
||||
int cabac_init_idc;
|
||||
|
||||
/**
|
||||
* @defgroup multithreading Members for slice based multithreading
|
||||
* @name Members for slice based multithreading
|
||||
* @{
|
||||
*/
|
||||
struct H264Context *thread_context[MAX_THREADS];
|
||||
|
@@ -393,10 +393,10 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u
|
||||
AV_WN64A(bS, 0x0003000300030003ULL);
|
||||
} else {
|
||||
if(!CABAC && IS_8x8DCT(s->current_picture.mb_type[mbn_xy])){
|
||||
bS[0]= 1+((h->cbp_table[mbn_xy] & 4)||h->non_zero_count_cache[scan8[0]+0]);
|
||||
bS[1]= 1+((h->cbp_table[mbn_xy] & 4)||h->non_zero_count_cache[scan8[0]+1]);
|
||||
bS[2]= 1+((h->cbp_table[mbn_xy] & 8)||h->non_zero_count_cache[scan8[0]+2]);
|
||||
bS[3]= 1+((h->cbp_table[mbn_xy] & 8)||h->non_zero_count_cache[scan8[0]+3]);
|
||||
bS[0]= 1+((h->cbp_table[mbn_xy] & 0x4000)||h->non_zero_count_cache[scan8[0]+0]);
|
||||
bS[1]= 1+((h->cbp_table[mbn_xy] & 0x4000)||h->non_zero_count_cache[scan8[0]+1]);
|
||||
bS[2]= 1+((h->cbp_table[mbn_xy] & 0x8000)||h->non_zero_count_cache[scan8[0]+2]);
|
||||
bS[3]= 1+((h->cbp_table[mbn_xy] & 0x8000)||h->non_zero_count_cache[scan8[0]+3]);
|
||||
}else{
|
||||
const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy] + 3*4;
|
||||
int i;
|
||||
@@ -635,7 +635,7 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
|
||||
else{
|
||||
bS[i] = 1 + !!(h->non_zero_count_cache[12+8*(i>>1)] |
|
||||
((!h->pps.cabac && IS_8x8DCT(mbn_type)) ?
|
||||
(h->cbp_table[mbn_xy] & ((MB_FIELD ? (i&2) : (mb_y&1)) ? 8 : 2))
|
||||
(h->cbp_table[mbn_xy] & (((MB_FIELD ? (i&2) : (mb_y&1)) ? 8 : 2) << 12))
|
||||
:
|
||||
h->non_zero_count[mbn_xy][ off[i] ]));
|
||||
}
|
||||
@@ -663,19 +663,33 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
|
||||
filter_mb_mbaff_edgev ( h, img_y , linesize, bS , 1, qp [0] );
|
||||
filter_mb_mbaff_edgev ( h, img_y + 8* linesize, linesize, bS+4, 1, qp [1] );
|
||||
if (chroma){
|
||||
filter_mb_mbaff_edgecv( h, img_cb, uvlinesize, bS , 1, bqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr, uvlinesize, bS , 1, rqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr + 4*uvlinesize, uvlinesize, bS+4, 1, rqp[1] );
|
||||
if (CHROMA444) {
|
||||
filter_mb_mbaff_edgev ( h, img_cb, uvlinesize, bS , 1, bqp[0] );
|
||||
filter_mb_mbaff_edgev ( h, img_cb + 8*uvlinesize, uvlinesize, bS+4, 1, bqp[1] );
|
||||
filter_mb_mbaff_edgev ( h, img_cr, uvlinesize, bS , 1, rqp[0] );
|
||||
filter_mb_mbaff_edgev ( h, img_cr + 8*uvlinesize, uvlinesize, bS+4, 1, rqp[1] );
|
||||
}else{
|
||||
filter_mb_mbaff_edgecv( h, img_cb, uvlinesize, bS , 1, bqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr, uvlinesize, bS , 1, rqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr + 4*uvlinesize, uvlinesize, bS+4, 1, rqp[1] );
|
||||
}
|
||||
}
|
||||
}else{
|
||||
filter_mb_mbaff_edgev ( h, img_y , 2* linesize, bS , 2, qp [0] );
|
||||
filter_mb_mbaff_edgev ( h, img_y + linesize, 2* linesize, bS+1, 2, qp [1] );
|
||||
if (chroma){
|
||||
filter_mb_mbaff_edgecv( h, img_cb, 2*uvlinesize, bS , 2, bqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr, 2*uvlinesize, bS , 2, rqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1] );
|
||||
if (CHROMA444) {
|
||||
filter_mb_mbaff_edgev ( h, img_cb, 2*uvlinesize, bS , 2, bqp[0] );
|
||||
filter_mb_mbaff_edgev ( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1] );
|
||||
filter_mb_mbaff_edgev ( h, img_cr, 2*uvlinesize, bS , 2, rqp[0] );
|
||||
filter_mb_mbaff_edgev ( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1] );
|
||||
}else{
|
||||
filter_mb_mbaff_edgecv( h, img_cb, 2*uvlinesize, bS , 2, bqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr, 2*uvlinesize, bS , 2, rqp[0] );
|
||||
filter_mb_mbaff_edgecv( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -281,12 +281,12 @@ static void decode_scaling_matrices(H264Context *h, SPS *sps, PPS *pps, int is_s
|
||||
decode_scaling_list(h,scaling_matrix4[5],16,default_scaling4[1],scaling_matrix4[4]); // Inter, Cb
|
||||
if(is_sps || pps->transform_8x8_mode){
|
||||
decode_scaling_list(h,scaling_matrix8[0],64,default_scaling8[0],fallback[2]); // Intra, Y
|
||||
if(h->sps.chroma_format_idc == 3){
|
||||
if(sps->chroma_format_idc == 3){
|
||||
decode_scaling_list(h,scaling_matrix8[1],64,default_scaling8[0],scaling_matrix8[0]); // Intra, Cr
|
||||
decode_scaling_list(h,scaling_matrix8[2],64,default_scaling8[0],scaling_matrix8[1]); // Intra, Cb
|
||||
}
|
||||
decode_scaling_list(h,scaling_matrix8[3],64,default_scaling8[1],fallback[3]); // Inter, Y
|
||||
if(h->sps.chroma_format_idc == 3){
|
||||
if(sps->chroma_format_idc == 3){
|
||||
decode_scaling_list(h,scaling_matrix8[4],64,default_scaling8[1],scaling_matrix8[3]); // Inter, Cr
|
||||
decode_scaling_list(h,scaling_matrix8[5],64,default_scaling8[1],scaling_matrix8[4]); // Inter, Cb
|
||||
}
|
||||
@@ -396,6 +396,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
|
||||
#endif
|
||||
sps->crop= get_bits1(&s->gb);
|
||||
if(sps->crop){
|
||||
int crop_limit = sps->chroma_format_idc == 3 ? 16 : 8;
|
||||
sps->crop_left = get_ue_golomb(&s->gb);
|
||||
sps->crop_right = get_ue_golomb(&s->gb);
|
||||
sps->crop_top = get_ue_golomb(&s->gb);
|
||||
@@ -403,7 +404,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
|
||||
if(sps->crop_left || sps->crop_top){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
|
||||
}
|
||||
if(sps->crop_right >= (8<<CHROMA444) || sps->crop_bottom >= (8<<CHROMA444)){
|
||||
if(sps->crop_right >= crop_limit || sps->crop_bottom >= crop_limit){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "brainfart cropping not supported, this could look slightly wrong ...\n");
|
||||
}
|
||||
}else{
|
||||
|
@@ -237,7 +237,6 @@ void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM *
|
||||
}
|
||||
/**
|
||||
* IDCT transforms the 16 dc values and dequantizes them.
|
||||
* @param qp quantization parameter
|
||||
*/
|
||||
void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){
|
||||
#define stride 16
|
||||
|
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* This file is part of Libav.
|
||||
*
|
||||
* Libav 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.
|
||||
*
|
||||
* Libav 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 Libav; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "dsputil.h"
|
||||
|
||||
#ifndef BIT_DEPTH
|
||||
|
@@ -72,7 +72,6 @@ typedef struct IdcinContext {
|
||||
hnode huff_nodes[256][HUF_TOKENS*2];
|
||||
int num_huff_nodes[256];
|
||||
|
||||
uint32_t pal[256];
|
||||
} IdcinContext;
|
||||
|
||||
/*
|
||||
@@ -215,7 +214,7 @@ static int idcin_decode_frame(AVCodecContext *avctx,
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
IdcinContext *s = avctx->priv_data;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
AVPaletteControl *palette_control = avctx->palctrl;
|
||||
|
||||
s->buf = buf;
|
||||
s->size = buf_size;
|
||||
@@ -230,12 +229,13 @@ static int idcin_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
idcin_decode_vlcs(s);
|
||||
|
||||
if (pal) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
/* make the palette available on the way out */
|
||||
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
|
||||
memcpy(s->frame.data[1], palette_control->palette, PALETTE_COUNT * 4);
|
||||
/* If palette changed inform application*/
|
||||
if (palette_control->palette_changed) {
|
||||
palette_control->palette_changed = 0;
|
||||
s->frame.palette_has_changed = 1;
|
||||
}
|
||||
|
||||
*data_size = sizeof(AVFrame);
|
||||
*(AVFrame*)data = s->frame;
|
||||
|
@@ -424,11 +424,40 @@ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
enum PixelFormat avcodec_get_pix_fmt(const char *name)
|
||||
{
|
||||
return av_get_pix_fmt(name);
|
||||
}
|
||||
|
||||
void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
|
||||
{
|
||||
av_get_pix_fmt_string(buf, buf_size, pix_fmt);
|
||||
}
|
||||
#endif
|
||||
|
||||
int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt)
|
||||
{
|
||||
return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL;
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt){
|
||||
return ff_set_systematic_pal2(pal, pix_fmt);
|
||||
}
|
||||
|
||||
int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width)
|
||||
{
|
||||
return av_image_fill_linesizes(picture->linesize, pix_fmt, width);
|
||||
}
|
||||
|
||||
int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
|
||||
int height)
|
||||
{
|
||||
return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
|
||||
}
|
||||
#endif
|
||||
|
||||
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
|
||||
enum PixelFormat pix_fmt, int width, int height)
|
||||
{
|
||||
@@ -663,6 +692,28 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
|
||||
return dst_pix_fmt;
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
void ff_img_copy_plane(uint8_t *dst, int dst_wrap,
|
||||
const uint8_t *src, int src_wrap,
|
||||
int width, int height)
|
||||
{
|
||||
av_image_copy_plane(dst, dst_wrap, src, src_wrap, width, height);
|
||||
}
|
||||
|
||||
int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
|
||||
{
|
||||
return av_image_get_linesize(pix_fmt, width, plane);
|
||||
}
|
||||
|
||||
void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
|
||||
uint8_t *src_data[4], int src_linesize[4],
|
||||
enum PixelFormat pix_fmt, int width, int height)
|
||||
{
|
||||
av_image_copy(dst_data, dst_linesize, src_data, src_linesize,
|
||||
pix_fmt, width, height);
|
||||
}
|
||||
#endif
|
||||
|
||||
void av_picture_copy(AVPicture *dst, const AVPicture *src,
|
||||
enum PixelFormat pix_fmt, int width, int height)
|
||||
{
|
||||
|
@@ -69,7 +69,6 @@ typedef struct IpvideoContext {
|
||||
int stride;
|
||||
int upper_motion_limit_offset;
|
||||
|
||||
uint32_t pal[256];
|
||||
} IpvideoContext;
|
||||
|
||||
#define CHECK_STREAM_PTR(stream_ptr, stream_end, n) \
|
||||
@@ -962,7 +961,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s)
|
||||
|
||||
if (!s->is_16bpp) {
|
||||
/* this is PAL8, so make the palette available */
|
||||
memcpy(s->current_frame.data[1], s->pal, AVPALETTE_SIZE);
|
||||
memcpy(s->current_frame.data[1], s->avctx->palctrl->palette, PALETTE_COUNT * 4);
|
||||
|
||||
s->stride = s->current_frame.linesize[0];
|
||||
s->stream_ptr = s->buf + 14; /* data starts 14 bytes in */
|
||||
@@ -1016,6 +1015,10 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
|
||||
|
||||
s->is_16bpp = avctx->bits_per_coded_sample == 16;
|
||||
avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8;
|
||||
if (!s->is_16bpp && s->avctx->palctrl == NULL) {
|
||||
av_log(avctx, AV_LOG_ERROR, " Interplay video: palette expected.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
dsputil_init(&s->dsp, avctx);
|
||||
|
||||
@@ -1038,6 +1041,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
IpvideoContext *s = avctx->priv_data;
|
||||
AVPaletteControl *palette_control = avctx->palctrl;
|
||||
|
||||
/* compressed buffer needs to be large enough to at least hold an entire
|
||||
* decoding map */
|
||||
@@ -1054,16 +1058,13 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!s->is_16bpp) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
if (pal) {
|
||||
s->current_frame.palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
ipvideo_decode_opcodes(s);
|
||||
|
||||
if (!s->is_16bpp && palette_control->palette_changed) {
|
||||
palette_control->palette_changed = 0;
|
||||
s->current_frame.palette_has_changed = 1;
|
||||
}
|
||||
|
||||
*data_size = sizeof(AVFrame);
|
||||
*(AVFrame*)data = s->current_frame;
|
||||
|
||||
|
@@ -233,7 +233,6 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
|
||||
int i;
|
||||
int header;
|
||||
int blocksize;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
if (ctx->pic.data[0])
|
||||
avctx->release_buffer(avctx, &ctx->pic);
|
||||
@@ -265,6 +264,13 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
|
||||
ctx->pic.pict_type = AV_PICTURE_TYPE_P;
|
||||
}
|
||||
|
||||
/* if palette has been changed, copy it from palctrl */
|
||||
if (ctx->avctx->palctrl && ctx->avctx->palctrl->palette_changed) {
|
||||
memcpy(ctx->pal, ctx->avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
ctx->setpal = 1;
|
||||
ctx->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
|
||||
if (header & KMVC_PALETTE) {
|
||||
ctx->pic.palette_has_changed = 1;
|
||||
// palette starts from index 1 and has 127 entries
|
||||
@@ -273,11 +279,6 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
|
||||
}
|
||||
}
|
||||
|
||||
if (pal) {
|
||||
ctx->pic.palette_has_changed = 1;
|
||||
memcpy(ctx->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
if (ctx->setpal) {
|
||||
ctx->setpal = 0;
|
||||
ctx->pic.palette_has_changed = 1;
|
||||
@@ -373,6 +374,9 @@ static av_cold int decode_init(AVCodecContext * avctx)
|
||||
src += 4;
|
||||
}
|
||||
c->setpal = 1;
|
||||
if (c->avctx->palctrl) {
|
||||
c->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
avcodec_get_frame_defaults(&c->pic);
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "bytestream.h"
|
||||
#include "vorbis.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "libavutil/base64.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
|
||||
/**
|
||||
* Portion of struct vpx_codec_cx_pkt from vpx_encoder.h.
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libxvid_internal.h"
|
||||
#if !HAVE_MKSTEMP
|
||||
#include <fcntl.h>
|
||||
@@ -528,6 +529,7 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) {
|
||||
if( x->twopassbuffer != NULL ) {
|
||||
av_free(x->twopassbuffer);
|
||||
av_free(x->old_twopassbuffer);
|
||||
avctx->stats_out = NULL;
|
||||
}
|
||||
av_free(x->twopassfile);
|
||||
av_free(x->intra_matrix);
|
||||
|
@@ -992,8 +992,8 @@ static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dm
|
||||
return var_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
|
||||
}
|
||||
|
||||
/*!
|
||||
\param P[10][2] a list of candidate mvs to check before starting the
|
||||
/**
|
||||
@param P a list of candidate mvs to check before starting the
|
||||
iterative search. If one of the candidates is close to the optimal mv, then
|
||||
it takes fewer iterations. And it increases the chance that we find the
|
||||
optimal mv.
|
||||
|
@@ -2475,10 +2475,18 @@ static int decode_chunks(AVCodecContext *avctx,
|
||||
/* Skip P-frames if we do not have a reference frame or we have an invalid header. */
|
||||
if(s2->pict_type==AV_PICTURE_TYPE_P && !s->sync) break;
|
||||
}
|
||||
#if FF_API_HURRY_UP
|
||||
/* Skip B-frames if we are in a hurry. */
|
||||
if(avctx->hurry_up && s2->pict_type==FF_B_TYPE) break;
|
||||
#endif
|
||||
if( (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==AV_PICTURE_TYPE_B)
|
||||
||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=AV_PICTURE_TYPE_I)
|
||||
|| avctx->skip_frame >= AVDISCARD_ALL)
|
||||
break;
|
||||
#if FF_API_HURRY_UP
|
||||
/* Skip everything if we are in a hurry>=5. */
|
||||
if(avctx->hurry_up>=5) break;
|
||||
#endif
|
||||
|
||||
if (!s->mpeg_enc_ctx_allocated) break;
|
||||
|
||||
|
@@ -1138,6 +1138,9 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
}
|
||||
}
|
||||
|
||||
#if FF_API_HURRY_UP
|
||||
s->hurry_up= s->avctx->hurry_up;
|
||||
#endif
|
||||
s->error_recognition= avctx->error_recognition;
|
||||
|
||||
/* set dequantizer, we can't do it during init as it might change for mpeg4
|
||||
@@ -2147,6 +2150,9 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
|
||||
}
|
||||
|
||||
/* skip dequant / idct if we are really late ;) */
|
||||
#if FF_API_HURRY_UP
|
||||
if(s->hurry_up>1) goto skip_idct;
|
||||
#endif
|
||||
if(s->avctx->skip_idct){
|
||||
if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B)
|
||||
||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I)
|
||||
|
@@ -391,6 +391,11 @@ typedef struct MpegEncContext {
|
||||
int no_rounding; /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
|
||||
for b-frames rounding mode is always 0 */
|
||||
|
||||
#if FF_API_HURRY_UP
|
||||
int hurry_up; /**< when set to 1 during decoding, b frames will be skipped
|
||||
when set to 2 idct/dequant will be skipped too */
|
||||
#endif
|
||||
|
||||
/* macroblock layer */
|
||||
int mb_x, mb_y;
|
||||
int mb_skip_run;
|
||||
|
@@ -26,6 +26,9 @@
|
||||
* http://www.pcisys.net/~melanson/codecs/
|
||||
*
|
||||
* The MS RLE decoder outputs PAL8 colorspace data.
|
||||
*
|
||||
* Note that this decoder expects the palette colors from the end of the
|
||||
* BITMAPINFO header passed through palctrl.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -43,7 +46,6 @@ typedef struct MsrleContext {
|
||||
const unsigned char *buf;
|
||||
int size;
|
||||
|
||||
uint32_t pal[256];
|
||||
} MsrleContext;
|
||||
|
||||
static av_cold int msrle_decode_init(AVCodecContext *avctx)
|
||||
@@ -93,16 +95,13 @@ static int msrle_decode_frame(AVCodecContext *avctx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
if (pal) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
if (s->avctx->palctrl) {
|
||||
/* make the palette available */
|
||||
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
|
||||
memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (s->avctx->palctrl->palette_changed) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
s->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME how to correctly detect RLE ??? */
|
||||
|
@@ -25,6 +25,9 @@
|
||||
* For more information about the MS Video-1 format, visit:
|
||||
* http://www.pcisys.net/~melanson/codecs/
|
||||
*
|
||||
* This decoder outputs either PAL8 or RGB555 data, depending on the
|
||||
* whether a RGB palette was passed through palctrl;
|
||||
* if it's present, then the data is PAL8; RGB555 otherwise.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -52,7 +55,6 @@ typedef struct Msvideo1Context {
|
||||
|
||||
int mode_8bit; /* if it's not 8-bit, it's 16-bit */
|
||||
|
||||
uint32_t pal[256];
|
||||
} Msvideo1Context;
|
||||
|
||||
static av_cold int msvideo1_decode_init(AVCodecContext *avctx)
|
||||
@@ -62,7 +64,7 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx)
|
||||
s->avctx = avctx;
|
||||
|
||||
/* figure out the colorspace based on the presence of a palette */
|
||||
if (s->avctx->bits_per_coded_sample == 8) {
|
||||
if (s->avctx->palctrl) {
|
||||
s->mode_8bit = 1;
|
||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||
} else {
|
||||
@@ -172,8 +174,13 @@ static void msvideo1_decode_8bit(Msvideo1Context *s)
|
||||
}
|
||||
|
||||
/* make the palette available on the way out */
|
||||
if (s->avctx->pix_fmt == PIX_FMT_PAL8)
|
||||
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
|
||||
if (s->avctx->pix_fmt == PIX_FMT_PAL8) {
|
||||
memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (s->avctx->palctrl->palette_changed) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
s->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void msvideo1_decode_16bit(Msvideo1Context *s)
|
||||
@@ -303,15 +310,6 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (s->mode_8bit) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
if (pal) {
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
s->frame.palette_has_changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (s->mode_8bit)
|
||||
msvideo1_decode_8bit(s);
|
||||
else
|
||||
|
89
libavcodec/opt.c
Normal file
89
libavcodec/opt.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* AVOptions ABI compatibility wrapper
|
||||
* Copyright (c) 2010 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of Libav.
|
||||
*
|
||||
* Libav 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.
|
||||
*
|
||||
* Libav 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 Libav; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "opt.h"
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53 && CONFIG_SHARED && HAVE_SYMVER
|
||||
|
||||
FF_SYMVER(const AVOption *, av_find_opt, (void *obj, const char *name, const char *unit, int mask, int flags), "LIBAVCODEC_52"){
|
||||
return av_find_opt(obj, name, unit, mask, flags);
|
||||
}
|
||||
FF_SYMVER(int, av_set_string3, (void *obj, const char *name, const char *val, int alloc, const AVOption **o_out), "LIBAVCODEC_52"){
|
||||
return av_set_string3(obj, name, val, alloc, o_out);
|
||||
}
|
||||
FF_SYMVER(const AVOption *, av_set_double, (void *obj, const char *name, double n), "LIBAVCODEC_52"){
|
||||
return av_set_double(obj, name, n);
|
||||
}
|
||||
FF_SYMVER(const AVOption *, av_set_q, (void *obj, const char *name, AVRational n), "LIBAVCODEC_52"){
|
||||
return av_set_q(obj, name, n);
|
||||
}
|
||||
FF_SYMVER(const AVOption *, av_set_int, (void *obj, const char *name, int64_t n), "LIBAVCODEC_52"){
|
||||
return av_set_int(obj, name, n);
|
||||
}
|
||||
FF_SYMVER(double, av_get_double, (void *obj, const char *name, const AVOption **o_out), "LIBAVCODEC_52"){
|
||||
return av_get_double(obj, name, o_out);
|
||||
}
|
||||
FF_SYMVER(AVRational, av_get_q, (void *obj, const char *name, const AVOption **o_out), "LIBAVCODEC_52"){
|
||||
return av_get_q(obj, name, o_out);
|
||||
}
|
||||
FF_SYMVER(int64_t, av_get_int, (void *obj, const char *name, const AVOption **o_out), "LIBAVCODEC_52"){
|
||||
return av_get_int(obj, name, o_out);
|
||||
}
|
||||
FF_SYMVER(const char *, av_get_string, (void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len), "LIBAVCODEC_52"){
|
||||
return av_get_string(obj, name, o_out, buf, buf_len);
|
||||
}
|
||||
FF_SYMVER(const AVOption *, av_next_option, (void *obj, const AVOption *last), "LIBAVCODEC_52"){
|
||||
return av_next_option(obj, last);
|
||||
}
|
||||
FF_SYMVER(int, av_opt_show2, (void *obj, void *av_log_obj, int req_flags, int rej_flags), "LIBAVCODEC_52"){
|
||||
return av_opt_show2(obj, av_log_obj, req_flags, rej_flags);
|
||||
}
|
||||
FF_SYMVER(void, av_opt_set_defaults, (void *s), "LIBAVCODEC_52"){
|
||||
return av_opt_set_defaults(s);
|
||||
}
|
||||
FF_SYMVER(void, av_opt_set_defaults2, (void *s, int mask, int flags), "LIBAVCODEC_52"){
|
||||
return av_opt_set_defaults2(s, mask, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if FF_API_SET_STRING_OLD
|
||||
const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc){
|
||||
const AVOption *o;
|
||||
if (av_set_string3(obj, name, val, alloc, &o) < 0)
|
||||
return NULL;
|
||||
return o;
|
||||
}
|
||||
|
||||
const AVOption *av_set_string(void *obj, const char *name, const char *val){
|
||||
const AVOption *o;
|
||||
if (av_set_string3(obj, name, val, 0, &o) < 0)
|
||||
return NULL;
|
||||
return o;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if FF_API_OPT_SHOW
|
||||
int av_opt_show(void *obj, void *av_log_obj){
|
||||
return av_opt_show2(obj, av_log_obj,
|
||||
AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||
}
|
||||
#endif
|
@@ -1,3 +1,24 @@
|
||||
/*
|
||||
* AVOptions
|
||||
* copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This header is provided for compatibility only and will be removed
|
||||
@@ -7,10 +28,34 @@
|
||||
#ifndef AVCODEC_OPT_H
|
||||
#define AVCODEC_OPT_H
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
/**
|
||||
* @file
|
||||
* AVOptions
|
||||
*/
|
||||
|
||||
#if FF_API_OPT_H
|
||||
#include "libavutil/rational.h"
|
||||
#include "avcodec.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#if FF_API_SET_STRING_OLD
|
||||
/**
|
||||
* @see av_set_string2()
|
||||
*/
|
||||
attribute_deprecated const AVOption *av_set_string(void *obj, const char *name, const char *val);
|
||||
|
||||
/**
|
||||
* @return a pointer to the AVOption corresponding to the field set or
|
||||
* NULL if no matching AVOption exists, or if the value val is not
|
||||
* valid
|
||||
* @see av_set_string3()
|
||||
*/
|
||||
attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
|
||||
#endif
|
||||
#if FF_API_OPT_SHOW
|
||||
/**
|
||||
* @deprecated Use av_opt_show2() instead.
|
||||
*/
|
||||
attribute_deprecated int av_opt_show(void *obj, void *av_log_obj);
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_OPT_H */
|
||||
|
@@ -438,6 +438,7 @@ static const AVOption options[]={
|
||||
{"crf_max", "in crf mode, prevents vbv from lowering quality beyond this point", OFFSET(crf_max), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E},
|
||||
{"log_level_offset", "set the log level offset", OFFSET(log_level_offset), FF_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX },
|
||||
#if FF_API_FLAC_GLOBAL_OPTS
|
||||
{"use_lpc", "sets whether to use LPC mode (FLAC)", OFFSET(use_lpc), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
|
||||
{"lpc_type", "deprecated, use flac-specific options", OFFSET(lpc_type), FF_OPT_TYPE_INT, {.dbl = AV_LPC_TYPE_DEFAULT }, AV_LPC_TYPE_DEFAULT, AV_LPC_TYPE_NB-1, A|E},
|
||||
{"none", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_NONE }, INT_MIN, INT_MAX, A|E, "lpc_type"},
|
||||
{"fixed", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_FIXED }, INT_MIN, INT_MAX, A|E, "lpc_type"},
|
||||
|
@@ -105,6 +105,43 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){
|
||||
}
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
*
|
||||
* @param buf input
|
||||
* @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output)
|
||||
* @param pts input presentation timestamp
|
||||
* @param dts input decoding timestamp
|
||||
* @param poutbuf will contain a pointer to the first byte of the output frame
|
||||
* @param poutbuf_size will contain the length of the output frame
|
||||
* @return the number of bytes of the input bitstream used
|
||||
*
|
||||
* Example:
|
||||
* @code
|
||||
* while(in_len){
|
||||
* len = av_parser_parse(myparser, AVCodecContext, &data, &size,
|
||||
* in_data, in_len,
|
||||
* pts, dts);
|
||||
* in_data += len;
|
||||
* in_len -= len;
|
||||
*
|
||||
* if(size)
|
||||
* decode_frame(data, size);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @deprecated Use av_parser_parse2() instead.
|
||||
*/
|
||||
int av_parser_parse(AVCodecParserContext *s,
|
||||
AVCodecContext *avctx,
|
||||
uint8_t **poutbuf, int *poutbuf_size,
|
||||
const uint8_t *buf, int buf_size,
|
||||
int64_t pts, int64_t dts)
|
||||
{
|
||||
return av_parser_parse2(s, avctx, poutbuf, poutbuf_size, buf, buf_size, pts, dts, AV_NOPTS_VALUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
int av_parser_parse2(AVCodecParserContext *s,
|
||||
AVCodecContext *avctx,
|
||||
uint8_t **poutbuf, int *poutbuf_size,
|
||||
|
@@ -380,6 +380,9 @@ static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
|
||||
dst->release_buffer = src->release_buffer;
|
||||
|
||||
dst->opaque = src->opaque;
|
||||
#if FF_API_HURRY_UP
|
||||
dst->hurry_up = src->hurry_up;
|
||||
#endif
|
||||
dst->dsp_mask = src->dsp_mask;
|
||||
dst->debug = src->debug;
|
||||
dst->debug_mv = src->debug_mv;
|
||||
@@ -408,9 +411,10 @@ static void release_delayed_buffers(PerThreadContext *p)
|
||||
FrameThreadContext *fctx = p->parent;
|
||||
|
||||
while (p->num_released_buffers > 0) {
|
||||
AVFrame *f = &p->released_buffers[--p->num_released_buffers];
|
||||
AVFrame *f;
|
||||
|
||||
pthread_mutex_lock(&fctx->buffer_mutex);
|
||||
f = &p->released_buffers[--p->num_released_buffers];
|
||||
free_progress(f);
|
||||
f->thread_opaque = NULL;
|
||||
|
||||
@@ -746,9 +750,12 @@ void ff_thread_flush(AVCodecContext *avctx)
|
||||
if (!avctx->thread_opaque) return;
|
||||
|
||||
park_frame_worker_threads(fctx, avctx->thread_count);
|
||||
|
||||
if (fctx->prev_thread)
|
||||
update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0);
|
||||
if (fctx->prev_thread) {
|
||||
if (fctx->prev_thread != &fctx->threads[0])
|
||||
update_context_from_thread(fctx->threads[0].avctx, fctx->prev_thread->avctx, 0);
|
||||
if (avctx->codec->flush)
|
||||
avctx->codec->flush(fctx->threads[0].avctx);
|
||||
}
|
||||
|
||||
fctx->next_decoding = fctx->next_finished = 0;
|
||||
fctx->delaying = 1;
|
||||
@@ -836,6 +843,7 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
|
||||
void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
|
||||
{
|
||||
PerThreadContext *p = avctx->thread_opaque;
|
||||
FrameThreadContext *fctx;
|
||||
|
||||
if (!(avctx->active_thread_type&FF_THREAD_FRAME)) {
|
||||
avctx->release_buffer(avctx, f);
|
||||
@@ -851,7 +859,10 @@ void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
|
||||
av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p, %d buffers used\n",
|
||||
f, f->owner->internal_buffer_count);
|
||||
|
||||
fctx = p->parent;
|
||||
pthread_mutex_lock(&fctx->buffer_mutex);
|
||||
p->released_buffers[p->num_released_buffers++] = *f;
|
||||
pthread_mutex_unlock(&fctx->buffer_mutex);
|
||||
memset(f->data, 0, sizeof(f->data));
|
||||
}
|
||||
|
||||
|
@@ -38,14 +38,14 @@
|
||||
* QCELP unpacked data frame
|
||||
*/
|
||||
typedef struct {
|
||||
/// @defgroup qcelp_codebook_parameters QCELP excitation codebook parameters
|
||||
/// @name QCELP excitation codebook parameters
|
||||
/// @{
|
||||
uint8_t cbsign[16]; ///!< sign of the codebook gain for each codebook subframe
|
||||
uint8_t cbgain[16]; ///!< unsigned codebook gain for each codebook subframe
|
||||
uint8_t cindex[16]; ///!< codebook index for each codebook subframe
|
||||
/// @}
|
||||
|
||||
/// @defgroup qcelp_pitch_parameters QCELP pitch prediction parameters
|
||||
/// @name QCELP pitch prediction parameters
|
||||
/// @{
|
||||
uint8_t plag[4]; ///!< pitch lag for each pitch subframe
|
||||
uint8_t pfrac[4]; ///!< fractional pitch lag for each pitch subframe
|
||||
|
@@ -260,7 +260,6 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
AVFrame * ref= (AVFrame*)&a->ref;
|
||||
uint8_t* outdata;
|
||||
int delta;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
if(ref->data[0])
|
||||
avctx->release_buffer(avctx, ref);
|
||||
@@ -280,11 +279,11 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
/* make the palette available on the way out */
|
||||
if (pal) {
|
||||
memcpy(a->pic.data[1], a->avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (a->avctx->palctrl->palette_changed) {
|
||||
a->pic.palette_has_changed = 1;
|
||||
memcpy(a->pal, pal, AVPALETTE_SIZE);
|
||||
a->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
memcpy(a->pic.data[1], a->pal, AVPALETTE_SIZE);
|
||||
|
||||
*data_size = sizeof(AVFrame);
|
||||
*(AVFrame*)data = a->pic;
|
||||
@@ -295,6 +294,10 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
static av_cold int decode_init(AVCodecContext *avctx){
|
||||
QpegContext * const a = avctx->priv_data;
|
||||
|
||||
if (!avctx->palctrl) {
|
||||
av_log(avctx, AV_LOG_FATAL, "Missing required palette via palctrl\n");
|
||||
return -1;
|
||||
}
|
||||
avcodec_get_frame_defaults(&a->pic);
|
||||
avcodec_get_frame_defaults(&a->ref);
|
||||
a->avctx = avctx;
|
||||
|
@@ -46,7 +46,6 @@ typedef struct QtrleContext {
|
||||
const unsigned char *buf;
|
||||
int size;
|
||||
|
||||
uint32_t pal[256];
|
||||
} QtrleContext;
|
||||
|
||||
#define CHECK_STREAM_PTR(n) \
|
||||
@@ -513,15 +512,12 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
if(has_palette) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
if (pal) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
/* make the palette available on the way out */
|
||||
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
|
||||
memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (s->avctx->palctrl->palette_changed) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
s->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
@@ -184,13 +184,9 @@ static int raw_decode(AVCodecContext *avctx,
|
||||
(av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PAL))){
|
||||
frame->data[1]= context->palette;
|
||||
}
|
||||
if (avctx->pix_fmt == PIX_FMT_PAL8) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
if (pal) {
|
||||
memcpy(frame->data[1], pal, AVPALETTE_SIZE);
|
||||
frame->palette_has_changed = 1;
|
||||
}
|
||||
if (avctx->palctrl && avctx->palctrl->palette_changed) {
|
||||
memcpy(frame->data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
if(avctx->pix_fmt==PIX_FMT_BGR24 && ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)
|
||||
frame->linesize[0] = (frame->linesize[0]+3)&~3;
|
||||
|
@@ -275,6 +275,17 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
|
||||
return s;
|
||||
}
|
||||
|
||||
#if FF_API_AUDIO_OLD
|
||||
ReSampleContext *audio_resample_init(int output_channels, int input_channels,
|
||||
int output_rate, int input_rate)
|
||||
{
|
||||
return av_audio_resample_init(output_channels, input_channels,
|
||||
output_rate, input_rate,
|
||||
AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
|
||||
TAPS, 10, 0, 0.8);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* resample audio. 'nb_samples' is the number of input samples */
|
||||
/* XXX: optimize it ! */
|
||||
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples)
|
||||
|
@@ -62,8 +62,10 @@ static const int rv34_mb_type_to_lavc[12] = {
|
||||
|
||||
static RV34VLC intra_vlcs[NUM_INTRA_TABLES], inter_vlcs[NUM_INTER_TABLES];
|
||||
|
||||
static int rv34_decode_mv(RV34DecContext *r, int block_type);
|
||||
|
||||
/**
|
||||
* @defgroup vlc RV30/40 VLC generating functions
|
||||
* @name RV30/40 VLC generating functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -171,7 +173,7 @@ static av_cold void rv34_init_tables(void)
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup transform RV30/40 inverse transform functions
|
||||
* @name RV30/40 inverse transform functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -246,7 +248,7 @@ static void rv34_inv_transform_noround(DCTELEM *block){
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup block RV30/40 4x4 block decoding functions
|
||||
* @name RV30/40 4x4 block decoding functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -393,7 +395,7 @@ static inline void rv34_dequant4x4_16x16(DCTELEM *block, int Qdc, int Q)
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup rv3040_bitstream RV30/40 bitstream parsing
|
||||
* @name RV30/40 bitstream parsing
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -432,10 +434,76 @@ static inline int rv34_decode_dquant(GetBitContext *gb, int quant)
|
||||
return get_bits(gb, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode macroblock header and return CBP in case of success, -1 otherwise.
|
||||
*/
|
||||
static int rv34_decode_mb_header(RV34DecContext *r, int8_t *intra_types)
|
||||
{
|
||||
MpegEncContext *s = &r->s;
|
||||
GetBitContext *gb = &s->gb;
|
||||
int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
|
||||
int i, t;
|
||||
|
||||
if(!r->si.type){
|
||||
r->is16 = get_bits1(gb);
|
||||
if(!r->is16 && !r->rv30){
|
||||
if(!get_bits1(gb))
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n");
|
||||
}
|
||||
s->current_picture_ptr->mb_type[mb_pos] = r->is16 ? MB_TYPE_INTRA16x16 : MB_TYPE_INTRA;
|
||||
r->block_type = r->is16 ? RV34_MB_TYPE_INTRA16x16 : RV34_MB_TYPE_INTRA;
|
||||
}else{
|
||||
r->block_type = r->decode_mb_info(r);
|
||||
if(r->block_type == -1)
|
||||
return -1;
|
||||
s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type];
|
||||
r->mb_type[mb_pos] = r->block_type;
|
||||
if(r->block_type == RV34_MB_SKIP){
|
||||
if(s->pict_type == AV_PICTURE_TYPE_P)
|
||||
r->mb_type[mb_pos] = RV34_MB_P_16x16;
|
||||
if(s->pict_type == AV_PICTURE_TYPE_B)
|
||||
r->mb_type[mb_pos] = RV34_MB_B_DIRECT;
|
||||
}
|
||||
r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]);
|
||||
rv34_decode_mv(r, r->block_type);
|
||||
if(r->block_type == RV34_MB_SKIP){
|
||||
fill_rectangle(intra_types, 4, 4, r->intra_types_stride, 0, sizeof(intra_types[0]));
|
||||
return 0;
|
||||
}
|
||||
r->chroma_vlc = 1;
|
||||
r->luma_vlc = 0;
|
||||
}
|
||||
if(IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){
|
||||
if(r->is16){
|
||||
t = get_bits(gb, 2);
|
||||
fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0]));
|
||||
r->luma_vlc = 2;
|
||||
}else{
|
||||
if(r->decode_intra_types(r, gb, intra_types) < 0)
|
||||
return -1;
|
||||
r->luma_vlc = 1;
|
||||
}
|
||||
r->chroma_vlc = 0;
|
||||
r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
|
||||
}else{
|
||||
for(i = 0; i < 16; i++)
|
||||
intra_types[(i & 3) + (i>>2) * r->intra_types_stride] = 0;
|
||||
r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);
|
||||
if(r->mb_type[mb_pos] == RV34_MB_P_MIX16x16){
|
||||
r->is16 = 1;
|
||||
r->chroma_vlc = 1;
|
||||
r->luma_vlc = 2;
|
||||
r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return rv34_decode_cbp(gb, r->cur_vlcs, r->is16);
|
||||
}
|
||||
|
||||
/** @} */ //bitstream functions
|
||||
|
||||
/**
|
||||
* @defgroup mv motion vector related code (prediction, reconstruction, motion compensation)
|
||||
* @name motion vector related code (prediction, reconstruction, motion compensation)
|
||||
* @{
|
||||
*/
|
||||
|
||||
@@ -885,7 +953,7 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type)
|
||||
/** @} */ // mv group
|
||||
|
||||
/**
|
||||
* @defgroup recons Macroblock reconstruction functions
|
||||
* @name Macroblock reconstruction functions
|
||||
* @{
|
||||
*/
|
||||
/** mapping of RV30/40 intra prediction types to standard H.264 types */
|
||||
@@ -1027,79 +1095,6 @@ static void rv34_output_macroblock(RV34DecContext *r, int8_t *intra_types, int c
|
||||
}
|
||||
}
|
||||
|
||||
/** @} */ // recons group
|
||||
|
||||
/**
|
||||
* @addtogroup bitstream
|
||||
* Decode macroblock header and return CBP in case of success, -1 otherwise.
|
||||
*/
|
||||
static int rv34_decode_mb_header(RV34DecContext *r, int8_t *intra_types)
|
||||
{
|
||||
MpegEncContext *s = &r->s;
|
||||
GetBitContext *gb = &s->gb;
|
||||
int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
|
||||
int i, t;
|
||||
|
||||
if(!r->si.type){
|
||||
r->is16 = get_bits1(gb);
|
||||
if(!r->is16 && !r->rv30){
|
||||
if(!get_bits1(gb))
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n");
|
||||
}
|
||||
s->current_picture_ptr->mb_type[mb_pos] = r->is16 ? MB_TYPE_INTRA16x16 : MB_TYPE_INTRA;
|
||||
r->block_type = r->is16 ? RV34_MB_TYPE_INTRA16x16 : RV34_MB_TYPE_INTRA;
|
||||
}else{
|
||||
r->block_type = r->decode_mb_info(r);
|
||||
if(r->block_type == -1)
|
||||
return -1;
|
||||
s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type];
|
||||
r->mb_type[mb_pos] = r->block_type;
|
||||
if(r->block_type == RV34_MB_SKIP){
|
||||
if(s->pict_type == AV_PICTURE_TYPE_P)
|
||||
r->mb_type[mb_pos] = RV34_MB_P_16x16;
|
||||
if(s->pict_type == AV_PICTURE_TYPE_B)
|
||||
r->mb_type[mb_pos] = RV34_MB_B_DIRECT;
|
||||
}
|
||||
r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]);
|
||||
rv34_decode_mv(r, r->block_type);
|
||||
if(r->block_type == RV34_MB_SKIP){
|
||||
fill_rectangle(intra_types, 4, 4, r->intra_types_stride, 0, sizeof(intra_types[0]));
|
||||
return 0;
|
||||
}
|
||||
r->chroma_vlc = 1;
|
||||
r->luma_vlc = 0;
|
||||
}
|
||||
if(IS_INTRA(s->current_picture_ptr->mb_type[mb_pos])){
|
||||
if(r->is16){
|
||||
t = get_bits(gb, 2);
|
||||
fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0]));
|
||||
r->luma_vlc = 2;
|
||||
}else{
|
||||
if(r->decode_intra_types(r, gb, intra_types) < 0)
|
||||
return -1;
|
||||
r->luma_vlc = 1;
|
||||
}
|
||||
r->chroma_vlc = 0;
|
||||
r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
|
||||
}else{
|
||||
for(i = 0; i < 16; i++)
|
||||
intra_types[(i & 3) + (i>>2) * r->intra_types_stride] = 0;
|
||||
r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);
|
||||
if(r->mb_type[mb_pos] == RV34_MB_P_MIX16x16){
|
||||
r->is16 = 1;
|
||||
r->chroma_vlc = 1;
|
||||
r->luma_vlc = 2;
|
||||
r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return rv34_decode_cbp(gb, r->cur_vlcs, r->is16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @addtogroup recons
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* mask for retrieving all bits in coded block pattern
|
||||
* corresponding to one 8x8 block
|
||||
@@ -1109,6 +1104,8 @@ static int rv34_decode_mb_header(RV34DecContext *r, int8_t *intra_types)
|
||||
#define U_CBP_MASK 0x0F0000
|
||||
#define V_CBP_MASK 0xF00000
|
||||
|
||||
/** @} */ // recons group
|
||||
|
||||
|
||||
static void rv34_apply_differences(RV34DecContext *r, int cbp)
|
||||
{
|
||||
@@ -1454,10 +1451,19 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == AV_PICTURE_TYPE_B)
|
||||
return -1;
|
||||
#if FF_API_HURRY_UP
|
||||
/* skip b frames if we are in a hurry */
|
||||
if(avctx->hurry_up && si.type==FF_B_TYPE) return buf_size;
|
||||
#endif
|
||||
if( (avctx->skip_frame >= AVDISCARD_NONREF && si.type==AV_PICTURE_TYPE_B)
|
||||
|| (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=AV_PICTURE_TYPE_I)
|
||||
|| avctx->skip_frame >= AVDISCARD_ALL)
|
||||
return buf_size;
|
||||
#if FF_API_HURRY_UP
|
||||
/* skip everything if we are in a hurry>=5 */
|
||||
if(avctx->hurry_up>=5)
|
||||
return buf_size;
|
||||
#endif
|
||||
|
||||
for(i=0; i<slice_count; i++){
|
||||
int offset= get_slice_offset(avctx, slices_hdr, i);
|
||||
|
@@ -65,7 +65,7 @@ static const uint8_t rv40_luma_dc_quant[2][32] = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @defgroup loopfilter coefficients used by the RV40 loop filter
|
||||
* @name Coefficients used by the RV40 loop filter
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
|
@@ -42,7 +42,7 @@ typedef struct {
|
||||
uint8_t bs_xover_band;
|
||||
|
||||
/**
|
||||
* @defgroup bs_header_extra_1 Variables associated with bs_header_extra_1
|
||||
* @name Variables associated with bs_header_extra_1
|
||||
* @{
|
||||
*/
|
||||
uint8_t bs_freq_scale;
|
||||
@@ -58,7 +58,7 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @defgroup aac_bitstream Main bitstream data variables
|
||||
* @name Main bitstream data variables
|
||||
* @{
|
||||
*/
|
||||
unsigned bs_frame_class;
|
||||
@@ -74,7 +74,7 @@ typedef struct {
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @defgroup state State variables
|
||||
* @name State variables
|
||||
* @{
|
||||
*/
|
||||
DECLARE_ALIGNED(16, float, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE];
|
||||
@@ -116,7 +116,7 @@ typedef struct {
|
||||
SpectrumParameters spectrum_params;
|
||||
int bs_amp_res_header;
|
||||
/**
|
||||
* @defgroup bs_header_extra_2 variables associated with bs_header_extra_2
|
||||
* @name Variables associated with bs_header_extra_2
|
||||
* @{
|
||||
*/
|
||||
unsigned bs_limiter_bands;
|
||||
|
@@ -54,7 +54,6 @@ typedef struct SmcContext {
|
||||
unsigned char color_quads[COLORS_PER_TABLE * CQUAD];
|
||||
unsigned char color_octets[COLORS_PER_TABLE * COCTET];
|
||||
|
||||
uint32_t pal[256];
|
||||
} SmcContext;
|
||||
|
||||
#define GET_BLOCK_COUNT() \
|
||||
@@ -111,7 +110,11 @@ static void smc_decode_stream(SmcContext *s)
|
||||
int color_octet_index = 0;
|
||||
|
||||
/* make the palette available */
|
||||
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
|
||||
memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (s->avctx->palctrl->palette_changed) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
s->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
|
||||
chunk_size = AV_RB32(&s->buf[stream_ptr]) & 0x00FFFFFF;
|
||||
stream_ptr += 4;
|
||||
@@ -438,7 +441,6 @@ static int smc_decode_frame(AVCodecContext *avctx,
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
SmcContext *s = avctx->priv_data;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
s->buf = buf;
|
||||
s->size = buf_size;
|
||||
@@ -451,11 +453,6 @@ static int smc_decode_frame(AVCodecContext *avctx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pal) {
|
||||
s->frame.palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
smc_decode_stream(s);
|
||||
|
||||
*data_size = sizeof(AVFrame);
|
||||
|
@@ -663,6 +663,9 @@ static int svq1_decode_frame(AVCodecContext *avctx,
|
||||
//this should be removed after libavcodec can handle more flexible picture types & ordering
|
||||
if(s->pict_type==AV_PICTURE_TYPE_B && s->last_picture_ptr==NULL) return buf_size;
|
||||
|
||||
#if FF_API_HURRY_UP
|
||||
if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return buf_size;
|
||||
#endif
|
||||
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
|
||||
||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
|
||||
|| avctx->skip_frame >= AVDISCARD_ALL)
|
||||
|
@@ -986,6 +986,14 @@ static int svq3_decode_frame(AVCodecContext *avctx,
|
||||
/* Skip B-frames if we do not have reference frames. */
|
||||
if (s->last_picture_ptr == NULL && s->pict_type == AV_PICTURE_TYPE_B)
|
||||
return 0;
|
||||
#if FF_API_HURRY_UP
|
||||
/* Skip B-frames if we are in a hurry. */
|
||||
if (avctx->hurry_up && s->pict_type == FF_B_TYPE)
|
||||
return 0;
|
||||
/* Skip everything if we are in a hurry >= 5. */
|
||||
if (avctx->hurry_up >= 5)
|
||||
return 0;
|
||||
#endif
|
||||
if ( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B)
|
||||
||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I)
|
||||
|| avctx->skip_frame >= AVDISCARD_ALL)
|
||||
|
@@ -56,8 +56,7 @@ void write_##type##_2d_array(const void *arg, int len, int len2)\
|
||||
}
|
||||
|
||||
/**
|
||||
* \defgroup printfuncs Predefined functions for printing tables
|
||||
*
|
||||
* @name Predefined functions for printing tables
|
||||
* \{
|
||||
*/
|
||||
void write_int8_t_array (const int8_t *, int);
|
||||
|
@@ -171,6 +171,13 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
stride = -p->linesize[0];
|
||||
}
|
||||
|
||||
if(avctx->pix_fmt == PIX_FMT_PAL8 && avctx->palctrl){
|
||||
memcpy(p->data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if(avctx->palctrl->palette_changed){
|
||||
p->palette_has_changed = 1;
|
||||
avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
}
|
||||
if(colors){
|
||||
size_t pal_size;
|
||||
if((colors + first_clr) > 256){
|
||||
|
@@ -60,8 +60,6 @@ typedef struct TsccContext {
|
||||
unsigned char* decomp_buf;
|
||||
int height;
|
||||
z_stream zstream;
|
||||
|
||||
uint32_t pal[256];
|
||||
} CamtasiaContext;
|
||||
|
||||
/*
|
||||
@@ -110,13 +108,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
||||
|
||||
/* make the palette available on the way out */
|
||||
if (c->avctx->pix_fmt == PIX_FMT_PAL8) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
|
||||
if (pal) {
|
||||
memcpy(c->pic.data[1], c->avctx->palctrl->palette, AVPALETTE_SIZE);
|
||||
if (c->avctx->palctrl->palette_changed) {
|
||||
c->pic.palette_has_changed = 1;
|
||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
||||
c->avctx->palctrl->palette_changed = 0;
|
||||
}
|
||||
memcpy(c->pic.data[1], c->pal, AVPALETTE_SIZE);
|
||||
}
|
||||
|
||||
*data_size = sizeof(AVFrame);
|
||||
|
@@ -48,7 +48,7 @@ static int volatile entangled_thread_counter=0;
|
||||
static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op);
|
||||
static void *codec_mutex;
|
||||
|
||||
void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
|
||||
void *av_fast_realloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size)
|
||||
{
|
||||
if(min_size < *size)
|
||||
return ptr;
|
||||
@@ -64,7 +64,7 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
|
||||
void av_fast_malloc(void *ptr, unsigned int *size, FF_INTERNALC_MEM_TYPE min_size)
|
||||
{
|
||||
void **p = ptr;
|
||||
if (min_size < *size)
|
||||
@@ -94,6 +94,13 @@ void avcodec_register(AVCodec *codec)
|
||||
codec->next = NULL;
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
void register_avcodec(AVCodec *codec)
|
||||
{
|
||||
avcodec_register(codec);
|
||||
}
|
||||
#endif
|
||||
|
||||
unsigned avcodec_get_edge_width(void)
|
||||
{
|
||||
return EDGE_WIDTH;
|
||||
@@ -142,6 +149,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
|
||||
case PIX_FMT_YUV420P10BE:
|
||||
case PIX_FMT_YUV422P10LE:
|
||||
case PIX_FMT_YUV422P10BE:
|
||||
case PIX_FMT_YUV444P9LE:
|
||||
case PIX_FMT_YUV444P9BE:
|
||||
case PIX_FMT_YUV444P10LE:
|
||||
case PIX_FMT_YUV444P10BE:
|
||||
w_align= 16; //FIXME check for non mpeg style codecs and use less alignment
|
||||
h_align= 16;
|
||||
if(s->codec_id == CODEC_ID_MPEG2VIDEO || s->codec_id == CODEC_ID_MJPEG || s->codec_id == CODEC_ID_AMV || s->codec_id == CODEC_ID_THP || s->codec_id == CODEC_ID_H264)
|
||||
@@ -219,6 +230,12 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
|
||||
*width=FFALIGN(*width, align);
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
|
||||
return av_image_check_size(w, h, 0, av_log_ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
|
||||
int i;
|
||||
int w= s->width;
|
||||
@@ -572,6 +589,8 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
|
||||
if (avctx->codec->encode) {
|
||||
int i;
|
||||
if (avctx->codec->sample_fmts) {
|
||||
if (avctx->sample_fmt == AV_SAMPLE_FMT_NONE)
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++)
|
||||
if (avctx->sample_fmt == avctx->codec->sample_fmts[i])
|
||||
break;
|
||||
@@ -723,6 +742,22 @@ static int64_t guess_correct_pts(AVCodecContext *ctx,
|
||||
return pts;
|
||||
}
|
||||
|
||||
#if FF_API_VIDEO_OLD
|
||||
int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
|
||||
int *got_picture_ptr,
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
AVPacket avpkt;
|
||||
av_init_packet(&avpkt);
|
||||
avpkt.data = buf;
|
||||
avpkt.size = buf_size;
|
||||
// HACK for CorePNG to decode as normal PNG by default
|
||||
avpkt.flags = AV_PKT_FLAG_KEY;
|
||||
|
||||
return avcodec_decode_video2(avctx, picture, got_picture_ptr, &avpkt);
|
||||
}
|
||||
#endif
|
||||
|
||||
int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
|
||||
int *got_picture_ptr,
|
||||
AVPacket *avpkt)
|
||||
@@ -734,7 +769,6 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
|
||||
return -1;
|
||||
|
||||
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type&FF_THREAD_FRAME)){
|
||||
av_packet_split_side_data(avpkt);
|
||||
avctx->pkt = avpkt;
|
||||
if (HAVE_PTHREADS && avctx->active_thread_type&FF_THREAD_FRAME)
|
||||
ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
|
||||
@@ -773,6 +807,20 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if FF_API_AUDIO_OLD
|
||||
int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
|
||||
int *frame_size_ptr,
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
AVPacket avpkt;
|
||||
av_init_packet(&avpkt);
|
||||
avpkt.data = buf;
|
||||
avpkt.size = buf_size;
|
||||
|
||||
return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt);
|
||||
}
|
||||
#endif
|
||||
|
||||
int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
|
||||
int *frame_size_ptr,
|
||||
AVPacket *avpkt)
|
||||
@@ -802,6 +850,20 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if FF_API_SUBTITLE_OLD
|
||||
int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
|
||||
int *got_sub_ptr,
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
AVPacket avpkt;
|
||||
av_init_packet(&avpkt);
|
||||
avpkt.data = buf;
|
||||
avpkt.size = buf_size;
|
||||
|
||||
return avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, &avpkt);
|
||||
}
|
||||
#endif
|
||||
|
||||
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
|
||||
int *got_sub_ptr,
|
||||
AVPacket *avpkt)
|
||||
@@ -1133,7 +1195,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
|
||||
{
|
||||
if(HAVE_PTHREADS && avctx->active_thread_type&FF_THREAD_FRAME)
|
||||
ff_thread_flush(avctx);
|
||||
if(avctx->codec->flush)
|
||||
else if(avctx->codec->flush)
|
||||
avctx->codec->flush(avctx);
|
||||
}
|
||||
|
||||
@@ -1234,6 +1296,20 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
|
||||
return n;
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
#include "libavutil/parseutils.h"
|
||||
|
||||
int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str)
|
||||
{
|
||||
return av_parse_video_size(width_ptr, height_ptr, str);
|
||||
}
|
||||
|
||||
int av_parse_video_frame_rate(AVRational *frame_rate, const char *arg)
|
||||
{
|
||||
return av_parse_video_rate(frame_rate, arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b){
|
||||
int i;
|
||||
for(i=0; i<size && !(tab[i][0]==a && tab[i][1]==b); i++);
|
||||
@@ -1350,4 +1426,12 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count)
|
||||
s->thread_count = thread_count;
|
||||
return ff_thread_init(s);
|
||||
}
|
||||
|
||||
void avcodec_thread_free(AVCodecContext *s)
|
||||
{
|
||||
#if HAVE_THREADS
|
||||
ff_thread_free(s);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
/***********************************************************************/
|
||||
/**
|
||||
* @defgroup vc1bitplane VC-1 Bitplane decoding
|
||||
* @name VC-1 Bitplane decoding
|
||||
* @see 8.7, p56
|
||||
* @{
|
||||
*/
|
||||
|
@@ -137,7 +137,7 @@ static int vc1_init_common(VC1Context *v)
|
||||
|
||||
/***********************************************************************/
|
||||
/**
|
||||
* @defgroup vc1bitplane VC-1 Bitplane decoding
|
||||
* @name VC-1 Bitplane decoding
|
||||
* @see 8.7, p56
|
||||
* @{
|
||||
*/
|
||||
@@ -774,7 +774,7 @@ static void vc1_mc_4mv_chroma(VC1Context *v)
|
||||
|
||||
/***********************************************************************/
|
||||
/**
|
||||
* @defgroup vc1block VC-1 Block-level functions
|
||||
* @name VC-1 Block-level functions
|
||||
* @see 7.1.4, p91 and 8.1.1.7, p(1)04
|
||||
* @{
|
||||
*/
|
||||
@@ -1512,7 +1512,7 @@ static inline int vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
|
||||
/** @} */ // Block group
|
||||
|
||||
/**
|
||||
* @defgroup vc1_std_mb VC1 Macroblock-level functions in Simple/Main Profiles
|
||||
* @name VC1 Macroblock-level functions in Simple/Main Profiles
|
||||
* @see 7.1.4, p91 and 8.1.1.7, p(1)04
|
||||
* @{
|
||||
*/
|
||||
@@ -3716,11 +3716,21 @@ static int vc1_decode_frame(AVCodecContext *avctx,
|
||||
if(s->last_picture_ptr==NULL && (s->pict_type==AV_PICTURE_TYPE_B || s->dropable)){
|
||||
goto err;
|
||||
}
|
||||
#if FF_API_HURRY_UP
|
||||
/* skip b frames if we are in a hurry */
|
||||
if(avctx->hurry_up && s->pict_type==FF_B_TYPE) return -1;//buf_size;
|
||||
#endif
|
||||
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
|
||||
|| (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
|
||||
|| avctx->skip_frame >= AVDISCARD_ALL) {
|
||||
goto end;
|
||||
}
|
||||
#if FF_API_HURRY_UP
|
||||
/* skip everything if we are in a hurry>=5 */
|
||||
if(avctx->hurry_up>=5) {
|
||||
goto err;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(s->next_p_frame_damaged){
|
||||
if(s->pict_type==AV_PICTURE_TYPE_B)
|
||||
|
@@ -183,7 +183,8 @@ void ff_vdpau_h264_picture_complete(MpegEncContext *s)
|
||||
render->info.h264.deblocking_filter_control_present_flag = h->pps.deblocking_filter_parameters_present;
|
||||
render->info.h264.redundant_pic_cnt_present_flag = h->pps.redundant_pic_cnt_present;
|
||||
memcpy(render->info.h264.scaling_lists_4x4, h->pps.scaling_matrix4, sizeof(render->info.h264.scaling_lists_4x4));
|
||||
memcpy(render->info.h264.scaling_lists_8x8, h->pps.scaling_matrix8, sizeof(render->info.h264.scaling_lists_8x8));
|
||||
memcpy(render->info.h264.scaling_lists_8x8[0], h->pps.scaling_matrix8[0], sizeof(render->info.h264.scaling_lists_8x8[0]));
|
||||
memcpy(render->info.h264.scaling_lists_8x8[1], h->pps.scaling_matrix8[3], sizeof(render->info.h264.scaling_lists_8x8[0]));
|
||||
|
||||
ff_draw_horiz_band(s, 0, s->avctx->height);
|
||||
render->bitstream_buffers_used = 0;
|
||||
|
@@ -67,13 +67,6 @@ struct vdpau_render_state {
|
||||
|
||||
int state; ///< Holds FF_VDPAU_STATE_* values.
|
||||
|
||||
/** Describe size/location of the compressed video data.
|
||||
Set to 0 when freeing bitstream_buffers. */
|
||||
int bitstream_buffers_allocated;
|
||||
int bitstream_buffers_used;
|
||||
/** The user is responsible for freeing this buffer using av_freep(). */
|
||||
VdpBitstreamBuffer *bitstream_buffers;
|
||||
|
||||
/** picture parameter information for all supported codecs */
|
||||
union VdpPictureInfo {
|
||||
VdpPictureInfoH264 h264;
|
||||
@@ -81,6 +74,13 @@ struct vdpau_render_state {
|
||||
VdpPictureInfoVC1 vc1;
|
||||
VdpPictureInfoMPEG4Part2 mpeg4;
|
||||
} info;
|
||||
|
||||
/** Describe size/location of the compressed video data.
|
||||
Set to 0 when freeing bitstream_buffers. */
|
||||
int bitstream_buffers_allocated;
|
||||
int bitstream_buffers_used;
|
||||
/** The user is responsible for freeing this buffer using av_freep(). */
|
||||
VdpBitstreamBuffer *bitstream_buffers;
|
||||
};
|
||||
|
||||
/* @}*/
|
||||
|
@@ -20,8 +20,8 @@
|
||||
#ifndef AVCODEC_VERSION_H
|
||||
#define AVCODEC_VERSION_H
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 53
|
||||
#define LIBAVCODEC_VERSION_MINOR 7
|
||||
#define LIBAVCODEC_VERSION_MAJOR 52
|
||||
#define LIBAVCODEC_VERSION_MINOR 122
|
||||
#define LIBAVCODEC_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
@@ -41,12 +41,45 @@
|
||||
#ifndef FF_API_PALETTE_CONTROL
|
||||
#define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_MM_FLAGS
|
||||
#define FF_API_MM_FLAGS (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_OPT_SHOW
|
||||
#define FF_API_OPT_SHOW (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_AUDIO_OLD
|
||||
#define FF_API_AUDIO_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_VIDEO_OLD
|
||||
#define FF_API_VIDEO_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_SUBTITLE_OLD
|
||||
#define FF_API_SUBTITLE_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_USE_LPC
|
||||
#define FF_API_USE_LPC (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_SET_STRING_OLD
|
||||
#define FF_API_SET_STRING_OLD (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_INOFFICIAL
|
||||
#define FF_API_INOFFICIAL (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_SAMPLE_FMT
|
||||
#define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_AUDIOCONVERT
|
||||
#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_HURRY_UP
|
||||
#define FF_API_HURRY_UP (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_RATE_EMU
|
||||
#define FF_API_RATE_EMU (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_MB_Q
|
||||
#define FF_API_MB_Q (LIBAVCODEC_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_ANTIALIAS_ALGO
|
||||
#define FF_API_ANTIALIAS_ALGO (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
|
@@ -641,8 +641,6 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_
|
||||
* @param block destination for block coefficients
|
||||
* @param probs probabilities to use when reading trees from the bitstream
|
||||
* @param i initial coeff index, 0 unless a separate DC block is coded
|
||||
* @param zero_nhood the initial prediction context for number of surrounding
|
||||
* all-zero blocks (only left/top, so 0-2)
|
||||
* @param qmul array holding the dc/ac dequant factor at position 0/1
|
||||
* @return 0 if no coeffs were decoded
|
||||
* otherwise, the index of the last coeff decoded plus one
|
||||
@@ -701,6 +699,17 @@ skip_eob:
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @param c arithmetic bitstream reader context
|
||||
* @param block destination for block coefficients
|
||||
* @param probs probabilities to use when reading trees from the bitstream
|
||||
* @param i initial coeff index, 0 unless a separate DC block is coded
|
||||
* @param zero_nhood the initial prediction context for number of surrounding
|
||||
* all-zero blocks (only left/top, so 0-2)
|
||||
* @param qmul array holding the dc/ac dequant factor at position 0/1
|
||||
* @return 0 if no coeffs were decoded
|
||||
* otherwise, the index of the last coeff decoded plus one
|
||||
*/
|
||||
static av_always_inline
|
||||
int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16],
|
||||
uint8_t probs[16][3][NUM_DCT_TOKENS-1],
|
||||
@@ -1034,10 +1043,9 @@ static const uint8_t subpel_idx[3][8] = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Generic MC function.
|
||||
* luma MC function
|
||||
*
|
||||
* @param s VP8 decoding context
|
||||
* @param luma 1 for luma (Y) planes, 0 for chroma (Cb/Cr) planes
|
||||
* @param dst target buffer for block data at block position
|
||||
* @param src reference picture buffer at origin (0, 0)
|
||||
* @param mv motion vector (relative to block position) to get pixel data from
|
||||
@@ -1083,6 +1091,23 @@ void vp8_mc_luma(VP8Context *s, uint8_t *dst, AVFrame *ref, const VP56mv *mv,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* chroma MC function
|
||||
*
|
||||
* @param s VP8 decoding context
|
||||
* @param dst1 target buffer for block data at block position (U plane)
|
||||
* @param dst2 target buffer for block data at block position (V plane)
|
||||
* @param ref reference picture buffer at origin (0, 0)
|
||||
* @param mv motion vector (relative to block position) to get pixel data from
|
||||
* @param x_off horizontal position of block from origin (0, 0)
|
||||
* @param y_off vertical position of block from origin (0, 0)
|
||||
* @param block_w width of block (16, 8 or 4)
|
||||
* @param block_h height of block (always same as block_w)
|
||||
* @param width width of src/dst plane data
|
||||
* @param height height of src/dst plane data
|
||||
* @param linesize size of a single line of plane data, including padding
|
||||
* @param mc_func motion compensation function pointers (bilinear or sixtap MC)
|
||||
*/
|
||||
static av_always_inline
|
||||
void vp8_mc_chroma(VP8Context *s, uint8_t *dst1, uint8_t *dst2, AVFrame *ref,
|
||||
const VP56mv *mv, int x_off, int y_off,
|
||||
|
@@ -128,9 +128,7 @@ static const struct frame_type_desc {
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @defgroup struct_global Global values
|
||||
* Global values, specified in the stream header / extradata or used
|
||||
* all over.
|
||||
* @name Global values specified in the stream header / extradata or used all over.
|
||||
* @{
|
||||
*/
|
||||
GetBitContext gb; ///< packet bitreader. During decoder init,
|
||||
@@ -182,8 +180,9 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup struct_packet Packet values
|
||||
* Packet values, specified in the packet header or related to a packet.
|
||||
*
|
||||
* @name Packet values specified in the packet header or related to a packet.
|
||||
*
|
||||
* A packet is considered to be a single unit of data provided to this
|
||||
* decoder by the demuxer.
|
||||
* @{
|
||||
@@ -213,7 +212,8 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup struct_frame Frame and superframe values
|
||||
*
|
||||
* @name Frame and superframe values
|
||||
* Superframe and frame data - these can change from frame to frame,
|
||||
* although some of them do in that case serve as a cache / history for
|
||||
* the next frame or superframe.
|
||||
@@ -256,7 +256,9 @@ typedef struct {
|
||||
float synth_history[MAX_LSPS]; ///< see #excitation_history
|
||||
/**
|
||||
* @}
|
||||
* @defgroup post_filter Postfilter values
|
||||
*
|
||||
* @name Postfilter values
|
||||
*
|
||||
* Variables used for postfilter implementation, mostly history for
|
||||
* smoothing and so on, and context variables for FFT/iFFT.
|
||||
* @{
|
||||
@@ -432,7 +434,7 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
|
||||
}
|
||||
|
||||
/**
|
||||
* @defgroup postfilter Postfilter functions
|
||||
* @name Postfilter functions
|
||||
* Postfilter functions (gain control, wiener denoise filter, DC filter,
|
||||
* kalman smoothening, plus surrounding code to wrap it)
|
||||
* @{
|
||||
@@ -825,7 +827,7 @@ static void dequant_lsps(double *lsps, int num,
|
||||
}
|
||||
|
||||
/**
|
||||
* @defgroup lsp_dequant LSP dequantization routines
|
||||
* @name LSP dequantization routines
|
||||
* LSP dequantization routines, for 10/16LSPs and independent/residual coding.
|
||||
* @note we assume enough bits are available, caller should check.
|
||||
* lsp10i() consumes 24 bits; lsp10r() consumes an additional 24 bits;
|
||||
@@ -969,7 +971,7 @@ static void dequant_lsp16r(GetBitContext *gb,
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup aw Pitch-adaptive window coding functions
|
||||
* @name Pitch-adaptive window coding functions
|
||||
* The next few functions are for pitch-adaptive window coding.
|
||||
* @{
|
||||
*/
|
||||
|
@@ -675,14 +675,14 @@ static void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM
|
||||
|
||||
#define snow_inner_add_yblock_sse2_end_8\
|
||||
"sal $1, %%"REG_c" \n\t"\
|
||||
"add $"PTR_SIZE"*2, %1 \n\t"\
|
||||
"add"OPSIZE" $"PTR_SIZE"*2, %1 \n\t"\
|
||||
snow_inner_add_yblock_sse2_end_common1\
|
||||
"sar $1, %%"REG_c" \n\t"\
|
||||
"sub $2, %2 \n\t"\
|
||||
snow_inner_add_yblock_sse2_end_common2
|
||||
|
||||
#define snow_inner_add_yblock_sse2_end_16\
|
||||
"add $"PTR_SIZE"*1, %1 \n\t"\
|
||||
"add"OPSIZE" $"PTR_SIZE"*1, %1 \n\t"\
|
||||
snow_inner_add_yblock_sse2_end_common1\
|
||||
"dec %2 \n\t"\
|
||||
snow_inner_add_yblock_sse2_end_common2
|
||||
|
@@ -25,6 +25,11 @@
|
||||
|
||||
#include "avcodec.h"
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
#define AV_XVMC_STATE_DISPLAY_PENDING 1 /** the surface should be shown, the video driver manipulates this */
|
||||
#define AV_XVMC_STATE_PREDICTION 2 /** the surface is needed for prediction, the codec manipulates this */
|
||||
#define AV_XVMC_STATE_OSD_SOURCE 4 /** the surface is needed for subpicture rendering */
|
||||
#endif
|
||||
#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
|
||||
the number is 1337 speak for the letters IDCT MCo (motion compensation) */
|
||||
|
||||
@@ -146,6 +151,22 @@ struct xvmc_pix_fmt {
|
||||
of coded blocks it contains.
|
||||
*/
|
||||
int next_free_data_block_num;
|
||||
|
||||
/** extensions may be placed here */
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
//@{
|
||||
/** State flags used to work around limitations in the MPlayer video system.
|
||||
0 - Surface is not used.
|
||||
1 - Surface is still held in application to be displayed or is
|
||||
still visible.
|
||||
2 - Surface is still held in libavcodec buffer for prediction.
|
||||
*/
|
||||
int state;
|
||||
|
||||
/** pointer to the surface where the subpicture is rendered */
|
||||
void* p_osd_target_surface_render;
|
||||
//}@
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_XVMC_H */
|
||||
|
@@ -22,9 +22,9 @@
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavformat/avformat.h"
|
||||
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 53
|
||||
#define LIBAVDEVICE_VERSION_MINOR 1
|
||||
#define LIBAVDEVICE_VERSION_MICRO 1
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 52
|
||||
#define LIBAVDEVICE_VERSION_MINOR 5
|
||||
#define LIBAVDEVICE_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
#define LIBAVFILTER_VERSION_MAJOR 2
|
||||
#define LIBAVFILTER_VERSION_MINOR 23
|
||||
#define LIBAVFILTER_VERSION_MAJOR 1
|
||||
#define LIBAVFILTER_VERSION_MINOR 80
|
||||
#define LIBAVFILTER_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
|
||||
|
@@ -158,7 +158,7 @@ static int read_shape_from_file(int *cols, int *rows, int **values, const char *
|
||||
}
|
||||
w++;
|
||||
}
|
||||
if (*rows > (SIZE_MAX / sizeof(int) / *cols)) {
|
||||
if (*rows > (FF_INTERNAL_MEM_TYPE_MAX_VALUE / (sizeof(int)) / *cols)) {
|
||||
av_log(log_ctx, AV_LOG_ERROR, "File with size %dx%d is too big\n",
|
||||
*rows, *cols);
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
@@ -41,6 +41,7 @@
|
||||
|
||||
|
||||
//FIXME maybe link the orig in
|
||||
//XXX: identical pix_fmt must be following with each others
|
||||
static const struct {
|
||||
int fmt;
|
||||
enum PixelFormat pix_fmt;
|
||||
@@ -785,13 +786,17 @@ static int query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
AVFilterFormats *avfmts=NULL;
|
||||
MPContext *m = ctx->priv;
|
||||
enum PixelFormat lastpixfmt = PIX_FMT_NONE;
|
||||
int i;
|
||||
|
||||
for(i=0; conversion_map[i].fmt; i++){
|
||||
av_log(ctx, AV_LOG_DEBUG, "query: %X\n", conversion_map[i].fmt);
|
||||
if(m->vf.query_format(&m->vf, conversion_map[i].fmt)){
|
||||
av_log(ctx, AV_LOG_DEBUG, "supported,adding\n");
|
||||
avfilter_add_format(&avfmts, conversion_map[i].pix_fmt);
|
||||
if (conversion_map[i].pix_fmt != lastpixfmt) {
|
||||
avfilter_add_format(&avfmts, conversion_map[i].pix_fmt);
|
||||
lastpixfmt = conversion_map[i].pix_fmt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,19 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Loren Merritt <lorenm@u.washignton.edu>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* 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 General Public License for more details.
|
||||
* 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 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.
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavutil/cpu.h"
|
||||
|
@@ -10,6 +10,7 @@ OBJS = allformats.o \
|
||||
id3v1.o \
|
||||
id3v2.o \
|
||||
metadata.o \
|
||||
metadata_compat.o \
|
||||
options.o \
|
||||
os_support.o \
|
||||
sdp.o \
|
||||
|
@@ -208,7 +208,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
|
||||
|
||||
if (!in) {
|
||||
close_in = 1;
|
||||
if ((ret = avio_open(&in, url, AVIO_FLAG_READ)) < 0)
|
||||
if ((ret = avio_open(&in, url, AVIO_RDONLY)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -321,13 +321,13 @@ static int open_input(struct variant *var)
|
||||
{
|
||||
struct segment *seg = var->segments[var->cur_seq_no - var->start_seq_no];
|
||||
if (seg->key_type == KEY_NONE) {
|
||||
return ffurl_open(&var->input, seg->url, AVIO_FLAG_READ);
|
||||
return ffurl_open(&var->input, seg->url, AVIO_RDONLY);
|
||||
} else if (seg->key_type == KEY_AES_128) {
|
||||
char iv[33], key[33], url[MAX_URL_SIZE];
|
||||
int ret;
|
||||
if (strcmp(seg->key, var->key_url)) {
|
||||
URLContext *uc;
|
||||
if (ffurl_open(&uc, seg->key, AVIO_FLAG_READ) == 0) {
|
||||
if (ffurl_open(&uc, seg->key, AVIO_RDONLY) == 0) {
|
||||
if (ffurl_read_complete(uc, var->key, sizeof(var->key))
|
||||
!= sizeof(var->key)) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
|
||||
@@ -347,7 +347,7 @@ static int open_input(struct variant *var)
|
||||
snprintf(url, sizeof(url), "crypto+%s", seg->url);
|
||||
else
|
||||
snprintf(url, sizeof(url), "crypto:%s", seg->url);
|
||||
if ((ret = ffurl_alloc(&var->input, url, AVIO_FLAG_READ)) < 0)
|
||||
if ((ret = ffurl_alloc(&var->input, url, AVIO_RDONLY)) < 0)
|
||||
return ret;
|
||||
av_set_string3(var->input->priv_data, "key", key, 0, NULL);
|
||||
av_set_string3(var->input->priv_data, "iv", iv, 0, NULL);
|
||||
@@ -395,7 +395,9 @@ reload:
|
||||
goto reload;
|
||||
}
|
||||
|
||||
ret = open_input(v);
|
||||
ret = ffurl_open(&v->input,
|
||||
v->segments[v->cur_seq_no - v->start_seq_no]->url,
|
||||
AVIO_RDONLY);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ static int parse_playlist(URLContext *h, const char *url)
|
||||
char line[1024];
|
||||
const char *ptr;
|
||||
|
||||
if ((ret = avio_open(&in, url, AVIO_FLAG_READ)) < 0)
|
||||
if ((ret = avio_open(&in, url, AVIO_RDONLY)) < 0)
|
||||
return ret;
|
||||
|
||||
read_chomp_line(in, line, sizeof(line));
|
||||
@@ -179,7 +179,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
|
||||
int ret, i;
|
||||
const char *nested_url;
|
||||
|
||||
if (flags & AVIO_FLAG_WRITE)
|
||||
if (flags & (AVIO_WRONLY | AVIO_RDWR))
|
||||
return AVERROR(ENOSYS);
|
||||
|
||||
s = av_mallocz(sizeof(AppleHTTPContext));
|
||||
@@ -194,7 +194,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
|
||||
av_strlcpy(s->playlisturl, "http://", sizeof(s->playlisturl));
|
||||
av_strlcat(s->playlisturl, nested_url, sizeof(s->playlisturl));
|
||||
} else {
|
||||
av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
|
||||
av_log(NULL, AV_LOG_ERROR, "Unsupported url %s\n", uri);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
@@ -217,7 +217,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
|
||||
}
|
||||
|
||||
if (s->n_segments == 0) {
|
||||
av_log(h, AV_LOG_WARNING, "Empty playlist\n");
|
||||
av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
|
||||
ret = AVERROR(EIO);
|
||||
goto fail;
|
||||
}
|
||||
@@ -257,7 +257,7 @@ retry:
|
||||
return ret;
|
||||
}
|
||||
if (s->cur_seq_no < s->start_seq_no) {
|
||||
av_log(h, AV_LOG_WARNING,
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"skipping %d segments ahead, expired from playlist\n",
|
||||
s->start_seq_no - s->cur_seq_no);
|
||||
s->cur_seq_no = s->start_seq_no;
|
||||
@@ -273,12 +273,12 @@ retry:
|
||||
goto retry;
|
||||
}
|
||||
url = s->segments[s->cur_seq_no - s->start_seq_no]->url,
|
||||
av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
|
||||
ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ);
|
||||
av_log(NULL, AV_LOG_DEBUG, "opening %s\n", url);
|
||||
ret = ffurl_open(&s->seg_hd, url, AVIO_RDONLY);
|
||||
if (ret < 0) {
|
||||
if (url_interrupt_cb())
|
||||
return AVERROR_EXIT;
|
||||
av_log(h, AV_LOG_WARNING, "Unable to open %s\n", url);
|
||||
av_log(NULL, AV_LOG_WARNING, "Unable to open %s\n", url);
|
||||
s->cur_seq_no++;
|
||||
goto retry;
|
||||
}
|
||||
|
@@ -45,8 +45,6 @@ typedef struct {
|
||||
|
||||
uint16_t stream_language_index;
|
||||
|
||||
int palette_changed;
|
||||
uint32_t palette[256];
|
||||
} ASFStream;
|
||||
|
||||
typedef struct {
|
||||
|
@@ -359,14 +359,15 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
|
||||
/* This is true for all paletted codecs implemented in ffmpeg */
|
||||
if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
||||
int av_unused i;
|
||||
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
|
||||
#if HAVE_BIGENDIAN
|
||||
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
|
||||
asf_st->palette[i] = av_bswap32(((uint32_t*)st->codec->extradata)[i]);
|
||||
st->codec->palctrl->palette[i] = av_bswap32(((uint32_t*)st->codec->extradata)[i]);
|
||||
#else
|
||||
memcpy(asf_st->palette, st->codec->extradata,
|
||||
FFMIN(st->codec->extradata_size, AVPALETTE_SIZE));
|
||||
memcpy(st->codec->palctrl->palette, st->codec->extradata,
|
||||
FFMIN(st->codec->extradata_size, AVPALETTE_SIZE));
|
||||
#endif
|
||||
asf_st->palette_changed = 1;
|
||||
st->codec->palctrl->palette_changed = 1;
|
||||
}
|
||||
|
||||
st->codec->codec_tag = tag1;
|
||||
@@ -970,17 +971,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
|
||||
asf_st->pkt.stream_index = asf->stream_index;
|
||||
asf_st->pkt.pos =
|
||||
asf_st->packet_pos= asf->packet_pos;
|
||||
if (asf_st->pkt.data && asf_st->palette_changed) {
|
||||
uint8_t *pal;
|
||||
pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
|
||||
AVPALETTE_SIZE);
|
||||
if (!pal) {
|
||||
av_log(s, AV_LOG_ERROR, "Cannot append palette to packet\n");
|
||||
} else {
|
||||
memcpy(pal, asf_st->palette, AVPALETTE_SIZE);
|
||||
asf_st->palette_changed = 0;
|
||||
}
|
||||
}
|
||||
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
|
||||
//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & AV_PKT_FLAG_KEY,
|
||||
//s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, asf->packet_obj_size);
|
||||
@@ -1137,8 +1127,14 @@ static void asf_reset_header(AVFormatContext *s)
|
||||
|
||||
static int asf_read_close(AVFormatContext *s)
|
||||
{
|
||||
int i;
|
||||
asf_reset_header(s);
|
||||
|
||||
for(i=0;i<s->nb_streams;i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
av_free(st->codec->palctrl);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -48,63 +48,70 @@ const char *avformat_license(void);
|
||||
struct AVFormatContext;
|
||||
|
||||
|
||||
/*
|
||||
* Public Metadata API.
|
||||
/**
|
||||
* @defgroup metadata_api Public Metadata API
|
||||
* @{
|
||||
* The metadata API allows libavformat to export metadata tags to a client
|
||||
* application using a sequence of key/value pairs. Like all strings in FFmpeg,
|
||||
* metadata must be stored as UTF-8 encoded Unicode. Note that metadata
|
||||
* exported by demuxers isn't checked to be valid UTF-8 in most cases.
|
||||
* Important concepts to keep in mind:
|
||||
* 1. Keys are unique; there can never be 2 tags with the same key. This is
|
||||
* - Keys are unique; there can never be 2 tags with the same key. This is
|
||||
* also meant semantically, i.e., a demuxer should not knowingly produce
|
||||
* several keys that are literally different but semantically identical.
|
||||
* E.g., key=Author5, key=Author6. In this example, all authors must be
|
||||
* placed in the same tag.
|
||||
* 2. Metadata is flat, not hierarchical; there are no subtags. If you
|
||||
* - Metadata is flat, not hierarchical; there are no subtags. If you
|
||||
* want to store, e.g., the email address of the child of producer Alice
|
||||
* and actor Bob, that could have key=alice_and_bobs_childs_email_address.
|
||||
* 3. Several modifiers can be applied to the tag name. This is done by
|
||||
* - Several modifiers can be applied to the tag name. This is done by
|
||||
* appending a dash character ('-') and the modifier name in the order
|
||||
* they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
|
||||
* a) language -- a tag whose value is localized for a particular language
|
||||
* - language -- a tag whose value is localized for a particular language
|
||||
* is appended with the ISO 639-2/B 3-letter language code.
|
||||
* For example: Author-ger=Michael, Author-eng=Mike
|
||||
* The original/default language is in the unqualified "Author" tag.
|
||||
* A demuxer should set a default if it sets any translated tag.
|
||||
* b) sorting -- a modified version of a tag that should be used for
|
||||
* - sorting -- a modified version of a tag that should be used for
|
||||
* sorting will have '-sort' appended. E.g. artist="The Beatles",
|
||||
* artist-sort="Beatles, The".
|
||||
*
|
||||
* 4. Demuxers attempt to export metadata in a generic format, however tags
|
||||
* - Demuxers attempt to export metadata in a generic format, however tags
|
||||
* with no generic equivalents are left as they are stored in the container.
|
||||
* Follows a list of generic tag names:
|
||||
*
|
||||
* album -- name of the set this work belongs to
|
||||
* album_artist -- main creator of the set/album, if different from artist.
|
||||
* e.g. "Various Artists" for compilation albums.
|
||||
* artist -- main creator of the work
|
||||
* comment -- any additional description of the file.
|
||||
* composer -- who composed the work, if different from artist.
|
||||
* copyright -- name of copyright holder.
|
||||
* creation_time-- date when the file was created, preferably in ISO 8601.
|
||||
* date -- date when the work was created, preferably in ISO 8601.
|
||||
* disc -- number of a subset, e.g. disc in a multi-disc collection.
|
||||
* encoder -- name/settings of the software/hardware that produced the file.
|
||||
* encoded_by -- person/group who created the file.
|
||||
* filename -- original name of the file.
|
||||
* genre -- <self-evident>.
|
||||
* language -- main language in which the work is performed, preferably
|
||||
* in ISO 639-2 format. Multiple languages can be specified by
|
||||
* separating them with commas.
|
||||
* performer -- artist who performed the work, if different from artist.
|
||||
* E.g for "Also sprach Zarathustra", artist would be "Richard
|
||||
* Strauss" and performer "London Philharmonic Orchestra".
|
||||
* publisher -- name of the label/publisher.
|
||||
* service_name -- name of the service in broadcasting (channel name).
|
||||
* service_provider -- name of the service provider in broadcasting.
|
||||
* title -- name of the work.
|
||||
* track -- number of this work in the set, can be in form current/total.
|
||||
* variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
|
||||
@verbatim
|
||||
album -- name of the set this work belongs to
|
||||
album_artist -- main creator of the set/album, if different from artist.
|
||||
e.g. "Various Artists" for compilation albums.
|
||||
artist -- main creator of the work
|
||||
comment -- any additional description of the file.
|
||||
composer -- who composed the work, if different from artist.
|
||||
copyright -- name of copyright holder.
|
||||
creation_time-- date when the file was created, preferably in ISO 8601.
|
||||
date -- date when the work was created, preferably in ISO 8601.
|
||||
disc -- number of a subset, e.g. disc in a multi-disc collection.
|
||||
encoder -- name/settings of the software/hardware that produced the file.
|
||||
encoded_by -- person/group who created the file.
|
||||
filename -- original name of the file.
|
||||
genre -- <self-evident>.
|
||||
language -- main language in which the work is performed, preferably
|
||||
in ISO 639-2 format. Multiple languages can be specified by
|
||||
separating them with commas.
|
||||
performer -- artist who performed the work, if different from artist.
|
||||
E.g for "Also sprach Zarathustra", artist would be "Richard
|
||||
Strauss" and performer "London Philharmonic Orchestra".
|
||||
publisher -- name of the label/publisher.
|
||||
service_name -- name of the service in broadcasting (channel name).
|
||||
service_provider -- name of the service provider in broadcasting.
|
||||
title -- name of the work.
|
||||
track -- number of this work in the set, can be in form current/total.
|
||||
variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
|
||||
@endverbatim
|
||||
*
|
||||
* Look in the examples section for an application example how to use the Metadata API.
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#if FF_API_OLD_METADATA2
|
||||
@@ -137,6 +144,20 @@ typedef struct AVMetadataConv AVMetadataConv;
|
||||
attribute_deprecated AVDictionaryEntry *
|
||||
av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
|
||||
|
||||
#if FF_API_OLD_METADATA
|
||||
/**
|
||||
* Set the given tag in *pm, overwriting an existing tag.
|
||||
*
|
||||
* @param pm pointer to a pointer to a metadata struct. If *pm is NULL
|
||||
* a metadata struct is allocated and put in *pm.
|
||||
* @param key tag key to add to *pm (will be av_strduped)
|
||||
* @param value tag value to add to *pm (will be av_strduped)
|
||||
* @return >= 0 on success otherwise an error code <0
|
||||
* @deprecated Use av_metadata_set2() instead.
|
||||
*/
|
||||
attribute_deprecated int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set the given tag in *pm, overwriting an existing tag.
|
||||
*
|
||||
@@ -249,6 +270,10 @@ typedef struct AVFormatParameters {
|
||||
immediately (RTSP only). */
|
||||
attribute_deprecated unsigned int prealloced_context:1;
|
||||
#endif
|
||||
#if FF_API_PARAMETERS_CODEC_ID
|
||||
attribute_deprecated enum CodecID video_codec_id;
|
||||
attribute_deprecated enum CodecID audio_codec_id;
|
||||
#endif
|
||||
} AVFormatParameters;
|
||||
|
||||
//! Demuxer will use avio_open, no opened file should be provided by the caller.
|
||||
@@ -541,6 +566,10 @@ typedef struct AVStream {
|
||||
*/
|
||||
int64_t duration;
|
||||
|
||||
#if FF_API_OLD_METADATA
|
||||
attribute_deprecated char language[4]; /**< ISO 639-2/B 3-letter language code (empty string if undefined) */
|
||||
#endif
|
||||
|
||||
/* av_read_frame() support */
|
||||
enum AVStreamParseType need_parsing;
|
||||
struct AVCodecParserContext *parser;
|
||||
@@ -556,6 +585,14 @@ typedef struct AVStream {
|
||||
|
||||
int64_t nb_frames; ///< number of frames in this stream if known or 0
|
||||
|
||||
#if FF_API_LAVF_UNUSED
|
||||
attribute_deprecated int64_t unused[4+1];
|
||||
#endif
|
||||
|
||||
#if FF_API_OLD_METADATA
|
||||
attribute_deprecated char *filename; /**< source filename of the stream */
|
||||
#endif
|
||||
|
||||
int disposition; /**< AV_DISPOSITION_* bit field */
|
||||
|
||||
AVProbeData probe_data;
|
||||
@@ -646,6 +683,10 @@ typedef struct AVStream {
|
||||
*/
|
||||
typedef struct AVProgram {
|
||||
int id;
|
||||
#if FF_API_OLD_METADATA
|
||||
attribute_deprecated char *provider_name; ///< network name for DVB streams
|
||||
attribute_deprecated char *name; ///< service name for DVB streams
|
||||
#endif
|
||||
int flags;
|
||||
enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller
|
||||
unsigned int *stream_index;
|
||||
@@ -664,9 +705,16 @@ typedef struct AVChapter {
|
||||
int id; ///< unique ID to identify the chapter
|
||||
AVRational time_base; ///< time base in which the start/end timestamps are specified
|
||||
int64_t start, end; ///< chapter start/end time in time_base units
|
||||
#if FF_API_OLD_METADATA
|
||||
attribute_deprecated char *title; ///< chapter title
|
||||
#endif
|
||||
AVDictionary *metadata;
|
||||
} AVChapter;
|
||||
|
||||
#if FF_API_MAX_STREAMS
|
||||
#define MAX_STREAMS 20
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Format I/O context.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
@@ -682,10 +730,24 @@ typedef struct AVFormatContext {
|
||||
void *priv_data;
|
||||
AVIOContext *pb;
|
||||
unsigned int nb_streams;
|
||||
#if FF_API_MAX_STREAMS
|
||||
AVStream *streams[MAX_STREAMS];
|
||||
#else
|
||||
AVStream **streams;
|
||||
#endif
|
||||
char filename[1024]; /**< input or output filename */
|
||||
/* stream info */
|
||||
int64_t timestamp;
|
||||
#if FF_API_OLD_METADATA
|
||||
attribute_deprecated char title[512];
|
||||
attribute_deprecated char author[512];
|
||||
attribute_deprecated char copyright[512];
|
||||
attribute_deprecated char comment[512];
|
||||
attribute_deprecated char album[512];
|
||||
attribute_deprecated int year; /**< ID3 year, 0 if none */
|
||||
attribute_deprecated int track; /**< track number, 0 if none */
|
||||
attribute_deprecated char genre[32]; /**< ID3 genre */
|
||||
#endif
|
||||
|
||||
int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
|
||||
/* private data for pts handling (do not modify directly). */
|
||||
@@ -725,9 +787,17 @@ typedef struct AVFormatContext {
|
||||
|
||||
/* av_read_frame() support */
|
||||
AVStream *cur_st;
|
||||
#if FF_API_LAVF_UNUSED
|
||||
const uint8_t *cur_ptr_deprecated;
|
||||
int cur_len_deprecated;
|
||||
AVPacket cur_pkt_deprecated;
|
||||
#endif
|
||||
|
||||
/* av_seek_frame() support */
|
||||
int64_t data_offset; /**< offset of the first packet */
|
||||
#if FF_API_INDEX_BUILT
|
||||
attribute_deprecated int index_built;
|
||||
#endif
|
||||
|
||||
int mux_rate;
|
||||
unsigned int packet_size;
|
||||
@@ -867,6 +937,11 @@ typedef struct AVPacketList {
|
||||
struct AVPacketList *next;
|
||||
} AVPacketList;
|
||||
|
||||
#if FF_API_FIRST_FORMAT
|
||||
attribute_deprecated extern AVInputFormat *first_iformat;
|
||||
attribute_deprecated extern AVOutputFormat *first_oformat;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* If f is NULL, returns the first registered input format,
|
||||
* if f is non-NULL, returns the next registered input format after f
|
||||
@@ -891,6 +966,18 @@ attribute_deprecated enum CodecID av_guess_image2_codec(const char *filename);
|
||||
/* utils.c */
|
||||
void av_register_input_format(AVInputFormat *format);
|
||||
void av_register_output_format(AVOutputFormat *format);
|
||||
#if FF_API_GUESS_FORMAT
|
||||
attribute_deprecated AVOutputFormat *guess_stream_format(const char *short_name,
|
||||
const char *filename,
|
||||
const char *mime_type);
|
||||
|
||||
/**
|
||||
* @deprecated Use av_guess_format() instead.
|
||||
*/
|
||||
attribute_deprecated AVOutputFormat *guess_format(const char *short_name,
|
||||
const char *filename,
|
||||
const char *mime_type);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return the output format in the list of registered output formats
|
||||
@@ -1107,6 +1194,12 @@ attribute_deprecated int av_open_input_file(AVFormatContext **ic_ptr, const char
|
||||
*/
|
||||
int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
|
||||
|
||||
#if FF_API_ALLOC_FORMAT_CONTEXT
|
||||
/**
|
||||
* @deprecated Use avformat_alloc_context() instead.
|
||||
*/
|
||||
attribute_deprecated AVFormatContext *av_alloc_format_context(void);
|
||||
#endif
|
||||
int av_demuxer_open(AVFormatContext *ic, AVFormatParameters *ap);
|
||||
|
||||
/**
|
||||
@@ -1533,6 +1626,22 @@ void av_dump_format(AVFormatContext *ic,
|
||||
const char *url,
|
||||
int is_output);
|
||||
|
||||
#if FF_API_PARSE_FRAME_PARAM
|
||||
/**
|
||||
* Parse width and height out of string str.
|
||||
* @deprecated Use av_parse_video_frame_size instead.
|
||||
*/
|
||||
attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr,
|
||||
const char *str);
|
||||
|
||||
/**
|
||||
* Convert framerate from a string to a fraction.
|
||||
* @deprecated Use av_parse_video_frame_rate instead.
|
||||
*/
|
||||
attribute_deprecated int parse_frame_rate(int *frame_rate, int *frame_rate_base,
|
||||
const char *arg);
|
||||
#endif
|
||||
|
||||
#if FF_API_PARSE_DATE
|
||||
/**
|
||||
* Parse datestr and return a corresponding number of microseconds.
|
||||
|
@@ -606,18 +606,15 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
/* This code assumes that extradata contains only palette. */
|
||||
/* This is true for all paletted codecs implemented in FFmpeg. */
|
||||
if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
||||
int pal_size = (1 << st->codec->bits_per_coded_sample) << 2;
|
||||
const uint8_t *pal_src;
|
||||
|
||||
pal_size = FFMIN(pal_size, st->codec->extradata_size);
|
||||
pal_src = st->codec->extradata + st->codec->extradata_size - pal_size;
|
||||
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
|
||||
#if HAVE_BIGENDIAN
|
||||
for (i = 0; i < pal_size/4; i++)
|
||||
ast->pal[i] = AV_RL32(pal_src+4*i);
|
||||
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
|
||||
st->codec->palctrl->palette[i] = av_bswap32(((uint32_t*)st->codec->extradata)[i]);
|
||||
#else
|
||||
memcpy(ast->pal, pal_src, pal_size);
|
||||
memcpy(st->codec->palctrl->palette, st->codec->extradata,
|
||||
FFMIN(st->codec->extradata_size, AVPALETTE_SIZE));
|
||||
#endif
|
||||
ast->has_pal = 1;
|
||||
st->codec->palctrl->palette_changed = 1;
|
||||
}
|
||||
|
||||
print_tag("video", tag1, 0);
|
||||
@@ -959,14 +956,14 @@ resync:
|
||||
return err;
|
||||
|
||||
if(ast->has_pal && pkt->data && pkt->size<(unsigned)INT_MAX/2){
|
||||
uint8_t *pal;
|
||||
pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, AVPALETTE_SIZE);
|
||||
if(!pal){
|
||||
av_log(s, AV_LOG_ERROR, "Failed to allocate data for palette\n");
|
||||
}else{
|
||||
memcpy(pal, ast->pal, AVPALETTE_SIZE);
|
||||
ast->has_pal = 0;
|
||||
}
|
||||
void *ptr= av_realloc(pkt->data, pkt->size + 4*256 + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if(ptr){
|
||||
ast->has_pal=0;
|
||||
pkt->size += 4*256;
|
||||
pkt->data= ptr;
|
||||
memcpy(pkt->data + pkt->size - 4*256, ast->pal, 4*256);
|
||||
}else
|
||||
av_log(s, AV_LOG_ERROR, "Failed to append palette\n");
|
||||
}
|
||||
|
||||
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
|
||||
@@ -1393,6 +1390,7 @@ static int avi_read_close(AVFormatContext *s)
|
||||
for(i=0;i<s->nb_streams;i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
AVIStream *ast = st->priv_data;
|
||||
av_free(st->codec->palctrl);
|
||||
if (ast) {
|
||||
if (ast->sub_ctx) {
|
||||
av_freep(&ast->sub_ctx->pb);
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#endif
|
||||
#include "url.h"
|
||||
|
||||
#if FF_API_URL_CLASS
|
||||
/** @name Logging context. */
|
||||
/*@{*/
|
||||
static const char *urlcontext_to_name(void *ptr)
|
||||
@@ -46,6 +47,7 @@ static const AVClass urlcontext_class = {
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
/*@}*/
|
||||
#endif
|
||||
|
||||
static int default_interrupt_cb(void);
|
||||
|
||||
@@ -83,6 +85,29 @@ int ffurl_register_protocol(URLProtocol *protocol, int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if FF_API_REGISTER_PROTOCOL
|
||||
/* The layout of URLProtocol as of when major was bumped to 52 */
|
||||
struct URLProtocol_compat {
|
||||
const char *name;
|
||||
int (*url_open)(URLContext *h, const char *filename, int flags);
|
||||
int (*url_read)(URLContext *h, unsigned char *buf, int size);
|
||||
int (*url_write)(URLContext *h, unsigned char *buf, int size);
|
||||
int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
|
||||
int (*url_close)(URLContext *h);
|
||||
struct URLProtocol *next;
|
||||
};
|
||||
|
||||
int av_register_protocol(URLProtocol *protocol)
|
||||
{
|
||||
return ffurl_register_protocol(protocol, sizeof(struct URLProtocol_compat));
|
||||
}
|
||||
|
||||
int register_protocol(URLProtocol *protocol)
|
||||
{
|
||||
return ffurl_register_protocol(protocol, sizeof(struct URLProtocol_compat));
|
||||
}
|
||||
#endif
|
||||
|
||||
static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up,
|
||||
const char *filename, int flags)
|
||||
{
|
||||
@@ -98,7 +123,9 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up,
|
||||
err = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
#if FF_API_URL_CLASS
|
||||
uc->av_class = &urlcontext_class;
|
||||
#endif
|
||||
uc->filename = (char *) &uc[1];
|
||||
strcpy(uc->filename, filename);
|
||||
uc->prot = up;
|
||||
@@ -130,7 +157,7 @@ int ffurl_connect(URLContext* uc)
|
||||
return err;
|
||||
uc->is_connected = 1;
|
||||
//We must be careful here as ffurl_seek() could be slow, for example for http
|
||||
if( (uc->flags & AVIO_FLAG_WRITE)
|
||||
if( (uc->flags & (AVIO_WRONLY | AVIO_RDWR))
|
||||
|| !strcmp(uc->prot->name, "file"))
|
||||
if(!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0)
|
||||
uc->is_streamed= 1;
|
||||
@@ -290,21 +317,21 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
|
||||
|
||||
int ffurl_read(URLContext *h, unsigned char *buf, int size)
|
||||
{
|
||||
if (!(h->flags & AVIO_FLAG_READ))
|
||||
if (h->flags & AVIO_WRONLY)
|
||||
return AVERROR(EIO);
|
||||
return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
|
||||
}
|
||||
|
||||
int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
|
||||
{
|
||||
if (!(h->flags & AVIO_FLAG_READ))
|
||||
if (h->flags & AVIO_WRONLY)
|
||||
return AVERROR(EIO);
|
||||
return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read);
|
||||
}
|
||||
|
||||
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
|
||||
{
|
||||
if (!(h->flags & AVIO_FLAG_WRITE))
|
||||
if (!(h->flags & (AVIO_WRONLY | AVIO_RDWR)))
|
||||
return AVERROR(EIO);
|
||||
/* avoid sending too big packets */
|
||||
if (h->max_packet_size && size > h->max_packet_size)
|
||||
@@ -343,7 +370,7 @@ int ffurl_close(URLContext *h)
|
||||
int url_exist(const char *filename)
|
||||
{
|
||||
URLContext *h;
|
||||
if (ffurl_open(&h, filename, AVIO_FLAG_READ) < 0)
|
||||
if (ffurl_open(&h, filename, AVIO_RDONLY) < 0)
|
||||
return 0;
|
||||
ffurl_close(h);
|
||||
return 1;
|
||||
|
@@ -101,7 +101,9 @@ typedef struct {
|
||||
* @deprecated This struct will be made private
|
||||
*/
|
||||
typedef struct URLContext {
|
||||
#if FF_API_URL_CLASS
|
||||
const AVClass *av_class; ///< information for av_log(). Set by url_open().
|
||||
#endif
|
||||
struct URLProtocol *prot;
|
||||
int flags;
|
||||
int is_streamed; /**< true if streamed (no seek possible), default = false */
|
||||
@@ -145,14 +147,14 @@ typedef struct URLPollEntry {
|
||||
attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
|
||||
|
||||
/**
|
||||
* @defgroup open_modes URL open modes
|
||||
* @name URL open modes
|
||||
* The flags argument to url_open and cosins must be one of the following
|
||||
* constants, optionally ORed with other flags.
|
||||
* @{
|
||||
*/
|
||||
#define URL_RDONLY 1 /**< read-only */
|
||||
#define URL_WRONLY 2 /**< write-only */
|
||||
#define URL_RDWR (URL_RDONLY|URL_WRONLY) /**< read-write */
|
||||
#define URL_RDONLY 0 /**< read-only */
|
||||
#define URL_WRONLY 1 /**< write-only */
|
||||
#define URL_RDWR 2 /**< read-write */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -176,7 +178,7 @@ extern URLInterruptCB *url_interrupt_cb;
|
||||
|
||||
/**
|
||||
* @defgroup old_url_funcs Old url_* functions
|
||||
* @deprecated use the buffered API based on AVIOContext instead
|
||||
* The following functions are deprecated. Use the buffered API based on #AVIOContext instead.
|
||||
* @{
|
||||
*/
|
||||
attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
||||
@@ -236,7 +238,7 @@ attribute_deprecated AVIOContext *av_alloc_put_byte(
|
||||
|
||||
/**
|
||||
* @defgroup old_avio_funcs Old put_/get_*() functions
|
||||
* @deprecated use the avio_ -prefixed functions instead.
|
||||
* The following functions are deprecated. Use the "avio_"-prefixed functions instead.
|
||||
* @{
|
||||
*/
|
||||
attribute_deprecated int get_buffer(AVIOContext *s, unsigned char *buf, int size);
|
||||
@@ -273,7 +275,7 @@ attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h, int stream_in
|
||||
|
||||
/**
|
||||
* @defgroup old_url_f_funcs Old url_f* functions
|
||||
* @deprecated use the avio_ -prefixed functions instead.
|
||||
* The following functions are deprecated, use the "avio_"-prefixed functions instead.
|
||||
* @{
|
||||
*/
|
||||
attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
|
||||
@@ -344,7 +346,7 @@ attribute_deprecated int url_exist(const char *url);
|
||||
#endif // FF_API_OLD_AVIO
|
||||
|
||||
/**
|
||||
* Return AVIO_FLAG_* access flags corresponding to the access permissions
|
||||
* Return AVIO_* access flags corresponding to the access permissions
|
||||
* of the resource in url, or a negative value corresponding to an
|
||||
* AVERROR code in case of failure. The returned access flags are
|
||||
* masked by the value in flags.
|
||||
@@ -354,6 +356,9 @@ attribute_deprecated int url_exist(const char *url);
|
||||
* one call to another. Thus you should not trust the returned value,
|
||||
* unless you are sure that no other processes are accessing the
|
||||
* checked resource.
|
||||
*
|
||||
* @note This function is slightly broken until next major bump
|
||||
* because of AVIO_RDONLY == 0. Don't use it until then.
|
||||
*/
|
||||
int avio_check(const char *url, int flags);
|
||||
|
||||
@@ -365,6 +370,22 @@ int avio_check(const char *url, int flags);
|
||||
*/
|
||||
void avio_set_interrupt_cb(int (*interrupt_cb)(void));
|
||||
|
||||
#if FF_API_REGISTER_PROTOCOL
|
||||
extern URLProtocol *first_protocol;
|
||||
#endif
|
||||
|
||||
#if FF_API_REGISTER_PROTOCOL
|
||||
/**
|
||||
* @deprecated Use av_register_protocol() instead.
|
||||
*/
|
||||
attribute_deprecated int register_protocol(URLProtocol *protocol);
|
||||
|
||||
/**
|
||||
* @deprecated Use av_register_protocol2() instead.
|
||||
*/
|
||||
attribute_deprecated int av_register_protocol(URLProtocol *protocol);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
|
||||
* freed with av_free().
|
||||
@@ -479,7 +500,7 @@ void avio_flush(AVIOContext *s);
|
||||
int avio_read(AVIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* @defgroup avio_read Functions for reading from AVIOContext.
|
||||
* @name Functions for reading from AVIOContext
|
||||
* @{
|
||||
*
|
||||
* @note return 0 if EOF, so you cannot use it if EOF handling is
|
||||
@@ -522,15 +543,29 @@ int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
|
||||
|
||||
#if FF_API_URL_RESETBUF
|
||||
/** Reset the buffer for reading or writing.
|
||||
* @note Will drop any data currently in the buffer without transmitting it.
|
||||
* @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
|
||||
* to set up the buffer for writing. */
|
||||
int url_resetbuf(AVIOContext *s, int flags);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup open_modes URL open modes
|
||||
* @name URL open modes
|
||||
* The flags argument to avio_open must be one of the following
|
||||
* constants, optionally ORed with other flags.
|
||||
* @{
|
||||
*/
|
||||
#define AVIO_FLAG_READ 1 /**< read-only */
|
||||
#define AVIO_FLAG_WRITE 2 /**< write-only */
|
||||
#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
||||
#define AVIO_RDONLY 0 /**< read-only */
|
||||
#define AVIO_WRONLY 1 /**< write-only */
|
||||
#define AVIO_RDWR 2 /**< read-write */
|
||||
#else
|
||||
#define AVIO_RDONLY 1 /**< read-only */
|
||||
#define AVIO_WRONLY 2 /**< write-only */
|
||||
#define AVIO_RDWR 4 /**< read-write */
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -547,7 +582,11 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
* Warning: non-blocking protocols is work-in-progress; this flag may be
|
||||
* silently ignored.
|
||||
*/
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
||||
#define AVIO_FLAG_NONBLOCK 4
|
||||
#else
|
||||
#define AVIO_FLAG_NONBLOCK 8
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Create and initialize a AVIOContext for accessing the
|
||||
@@ -591,6 +630,10 @@ int avio_open_dyn_buf(AVIOContext **s);
|
||||
*/
|
||||
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
|
||||
|
||||
#if FF_API_UDP_GET_FILE
|
||||
int udp_get_file_handle(URLContext *h);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Iterate through names of available protocols.
|
||||
* @note it is recommanded to use av_protocol_next() instead of this
|
||||
|
@@ -38,7 +38,9 @@
|
||||
#define SHORT_SEEK_THRESHOLD 4096
|
||||
|
||||
static void fill_buffer(AVIOContext *s);
|
||||
#if !FF_API_URL_RESETBUF
|
||||
static int url_resetbuf(AVIOContext *s, int flags);
|
||||
#endif
|
||||
|
||||
int ffio_init_context(AVIOContext *s,
|
||||
unsigned char *buffer,
|
||||
@@ -53,7 +55,7 @@ int ffio_init_context(AVIOContext *s,
|
||||
s->buffer_size = buffer_size;
|
||||
s->buf_ptr = buffer;
|
||||
s->opaque = opaque;
|
||||
url_resetbuf(s, write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ);
|
||||
url_resetbuf(s, write_flag ? AVIO_WRONLY : AVIO_RDONLY);
|
||||
s->write_packet = write_packet;
|
||||
s->read_packet = read_packet;
|
||||
s->seek = seek;
|
||||
@@ -854,7 +856,7 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
|
||||
}
|
||||
|
||||
if (ffio_init_context(*s, buffer, buffer_size,
|
||||
h->flags & AVIO_FLAG_WRITE, h,
|
||||
(h->flags & AVIO_WRONLY || h->flags & AVIO_RDWR), h,
|
||||
(void*)ffurl_read, (void*)ffurl_write, (void*)ffurl_seek) < 0) {
|
||||
av_free(buffer);
|
||||
av_freep(s);
|
||||
@@ -883,15 +885,24 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size)
|
||||
s->buffer = buffer;
|
||||
s->buffer_size = buf_size;
|
||||
s->buf_ptr = buffer;
|
||||
url_resetbuf(s, s->write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ);
|
||||
url_resetbuf(s, s->write_flag ? AVIO_WRONLY : AVIO_RDONLY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if FF_API_URL_RESETBUF
|
||||
int url_resetbuf(AVIOContext *s, int flags)
|
||||
#else
|
||||
static int url_resetbuf(AVIOContext *s, int flags)
|
||||
#endif
|
||||
{
|
||||
assert(flags == AVIO_FLAG_WRITE || flags == AVIO_FLAG_READ);
|
||||
#if FF_API_URL_RESETBUF
|
||||
if (flags & AVIO_RDWR)
|
||||
return AVERROR(EINVAL);
|
||||
#else
|
||||
assert(flags == AVIO_WRONLY || flags == AVIO_RDONLY);
|
||||
#endif
|
||||
|
||||
if (flags & AVIO_FLAG_WRITE) {
|
||||
if (flags & AVIO_WRONLY) {
|
||||
s->buf_end = s->buffer + s->buffer_size;
|
||||
s->write_flag = 1;
|
||||
} else {
|
||||
@@ -1049,7 +1060,7 @@ int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags)
|
||||
if(!*s)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = ffio_init_context(*s, buf, buf_size,
|
||||
flags & AVIO_FLAG_WRITE,
|
||||
(flags & AVIO_WRONLY || flags & AVIO_RDWR),
|
||||
NULL, NULL, NULL, NULL);
|
||||
if(ret != 0)
|
||||
av_freep(s);
|
||||
|
@@ -76,12 +76,12 @@ static int crypto_open(URLContext *h, const char *uri, int flags)
|
||||
ret = AVERROR(EINVAL);
|
||||
goto err;
|
||||
}
|
||||
if (flags & AVIO_FLAG_WRITE) {
|
||||
if (flags == AVIO_WRONLY) {
|
||||
av_log(h, AV_LOG_ERROR, "Only decryption is supported currently\n");
|
||||
ret = AVERROR(ENOSYS);
|
||||
goto err;
|
||||
}
|
||||
if ((ret = ffurl_open(&c->hd, nested_url, AVIO_FLAG_READ)) < 0) {
|
||||
if ((ret = ffurl_open(&c->hd, nested_url, AVIO_RDONLY)) < 0) {
|
||||
av_log(h, AV_LOG_ERROR, "Unable to open input\n");
|
||||
goto err;
|
||||
}
|
||||
|
@@ -58,8 +58,9 @@ static int file_check(URLContext *h, int mask)
|
||||
if (ret < 0)
|
||||
return AVERROR(errno);
|
||||
|
||||
ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0;
|
||||
ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0;
|
||||
ret |= st.st_mode&S_IRUSR ? mask&AVIO_RDONLY : 0;
|
||||
ret |= st.st_mode&S_IWUSR ? mask&AVIO_WRONLY : 0;
|
||||
ret |= st.st_mode&S_IWUSR && st.st_mode&S_IRUSR ? mask&AVIO_RDWR : 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -73,9 +74,9 @@ static int file_open(URLContext *h, const char *filename, int flags)
|
||||
|
||||
av_strstart(filename, "file:", &filename);
|
||||
|
||||
if (flags & AVIO_FLAG_WRITE && flags & AVIO_FLAG_READ) {
|
||||
if (flags & AVIO_RDWR) {
|
||||
access = O_CREAT | O_TRUNC | O_RDWR;
|
||||
} else if (flags & AVIO_FLAG_WRITE) {
|
||||
} else if (flags & AVIO_WRONLY) {
|
||||
access = O_CREAT | O_TRUNC | O_WRONLY;
|
||||
} else {
|
||||
access = O_RDONLY;
|
||||
@@ -131,7 +132,7 @@ static int pipe_open(URLContext *h, const char *filename, int flags)
|
||||
|
||||
fd = strtol(filename, &final, 10);
|
||||
if((filename == final) || *final ) {/* No digits found, or something like 10ab */
|
||||
if (flags & AVIO_FLAG_WRITE) {
|
||||
if (flags & AVIO_WRONLY) {
|
||||
fd = 1;
|
||||
} else {
|
||||
fd = 0;
|
||||
|
@@ -50,7 +50,7 @@ static int gopher_connect(URLContext *h, const char *path)
|
||||
if (!path) return AVERROR(EINVAL);
|
||||
break;
|
||||
default:
|
||||
av_log(h, AV_LOG_WARNING,
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"Gopher protocol type '%c' not supported yet!\n",
|
||||
*path);
|
||||
return AVERROR(EINVAL);
|
||||
@@ -100,7 +100,7 @@ static int gopher_open(URLContext *h, const char *uri, int flags)
|
||||
ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
|
||||
|
||||
s->hd = NULL;
|
||||
err = ffurl_open(&s->hd, buf, AVIO_FLAG_READ_WRITE);
|
||||
err = ffurl_open(&s->hd, buf, AVIO_RDWR);
|
||||
if (err < 0)
|
||||
goto fail;
|
||||
|
||||
|
@@ -73,7 +73,7 @@ void ff_http_set_headers(URLContext *h, const char *headers)
|
||||
int len = strlen(headers);
|
||||
|
||||
if (len && strcmp("\r\n", headers + len - 2))
|
||||
av_log(h, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n");
|
||||
av_log(NULL, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n");
|
||||
|
||||
av_strlcpy(s->headers, headers, sizeof(s->headers));
|
||||
}
|
||||
@@ -127,7 +127,7 @@ static int http_open_cnx(URLContext *h)
|
||||
port = 80;
|
||||
|
||||
ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
|
||||
err = ffurl_open(&hd, buf, AVIO_FLAG_READ_WRITE);
|
||||
err = ffurl_open(&hd, buf, AVIO_RDWR);
|
||||
if (err < 0)
|
||||
goto fail;
|
||||
|
||||
@@ -235,7 +235,7 @@ static int process_line(URLContext *h, char *line, int line_count,
|
||||
* don't abort until all headers have been parsed. */
|
||||
if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) {
|
||||
end += strspn(end, SPACE_CHARS);
|
||||
av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n",
|
||||
av_log(NULL, AV_LOG_WARNING, "HTTP error %d %s\n",
|
||||
s->http_code, end);
|
||||
return -1;
|
||||
}
|
||||
@@ -299,7 +299,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
|
||||
|
||||
|
||||
/* send http header */
|
||||
post = h->flags & AVIO_FLAG_WRITE;
|
||||
post = h->flags & AVIO_WRONLY;
|
||||
authstr = ff_http_auth_create_response(&s->auth_state, auth, path,
|
||||
post ? "POST" : "GET");
|
||||
|
||||
@@ -454,7 +454,7 @@ static int http_close(URLContext *h)
|
||||
HTTPContext *s = h->priv_data;
|
||||
|
||||
/* signal end of chunked encoding if used */
|
||||
if ((h->flags & AVIO_FLAG_WRITE) && s->chunksize != -1) {
|
||||
if ((h->flags & AVIO_WRONLY) && s->chunksize != -1) {
|
||||
ret = ffurl_write(s->hd, footer, sizeof(footer) - 1);
|
||||
ret = ret > 0 ? 0 : ret;
|
||||
}
|
||||
|
@@ -86,6 +86,8 @@ typedef struct IdcinDemuxContext {
|
||||
int audio_present;
|
||||
|
||||
int64_t pts;
|
||||
|
||||
AVPaletteControl palctrl;
|
||||
} IdcinDemuxContext;
|
||||
|
||||
static int idcin_probe(AVProbeData *p)
|
||||
@@ -170,6 +172,8 @@ static int idcin_read_header(AVFormatContext *s,
|
||||
if (avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE) !=
|
||||
HUFFMAN_TABLE_SIZE)
|
||||
return AVERROR(EIO);
|
||||
/* save a reference in order to transport the palette */
|
||||
st->codec->palctrl = &idcin->palctrl;
|
||||
|
||||
/* if sample rate is 0, assume no audio */
|
||||
if (sample_rate) {
|
||||
@@ -222,7 +226,6 @@ static int idcin_read_packet(AVFormatContext *s,
|
||||
int palette_scale;
|
||||
unsigned char r, g, b;
|
||||
unsigned char palette_buffer[768];
|
||||
uint32_t palette[256];
|
||||
|
||||
if (url_feof(s->pb))
|
||||
return AVERROR(EIO);
|
||||
@@ -233,6 +236,7 @@ static int idcin_read_packet(AVFormatContext *s,
|
||||
return AVERROR(EIO);
|
||||
} else if (command == 1) {
|
||||
/* trigger a palette change */
|
||||
idcin->palctrl.palette_changed = 1;
|
||||
if (avio_read(pb, palette_buffer, 768) != 768)
|
||||
return AVERROR(EIO);
|
||||
/* scale the palette as necessary */
|
||||
@@ -247,7 +251,7 @@ static int idcin_read_packet(AVFormatContext *s,
|
||||
r = palette_buffer[i * 3 ] << palette_scale;
|
||||
g = palette_buffer[i * 3 + 1] << palette_scale;
|
||||
b = palette_buffer[i * 3 + 2] << palette_scale;
|
||||
palette[i] = (r << 16) | (g << 8) | (b);
|
||||
idcin->palctrl.palette[i] = (r << 16) | (g << 8) | (b);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,15 +262,6 @@ static int idcin_read_packet(AVFormatContext *s,
|
||||
ret= av_get_packet(pb, pkt, chunk_size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (command == 1) {
|
||||
uint8_t *pal;
|
||||
|
||||
pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
|
||||
AVPALETTE_SIZE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
memcpy(pal, palette, AVPALETTE_SIZE);
|
||||
}
|
||||
pkt->stream_index = idcin->video_stream_index;
|
||||
pkt->pts = idcin->pts;
|
||||
} else {
|
||||
|
@@ -143,11 +143,11 @@ static int find_image_range(int *pfirst_index, int *plast_index,
|
||||
if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0){
|
||||
*pfirst_index =
|
||||
*plast_index = 1;
|
||||
if (avio_check(buf, AVIO_FLAG_READ) > 0)
|
||||
if(url_exist(buf))
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
if (avio_check(buf, AVIO_FLAG_READ) > 0)
|
||||
if (url_exist(buf))
|
||||
break;
|
||||
}
|
||||
if (first_index == 5)
|
||||
@@ -165,7 +165,7 @@ static int find_image_range(int *pfirst_index, int *plast_index,
|
||||
if (av_get_frame_filename(buf, sizeof(buf), path,
|
||||
last_index + range1) < 0)
|
||||
goto fail;
|
||||
if (avio_check(buf, AVIO_FLAG_READ) <= 0)
|
||||
if (!url_exist(buf))
|
||||
break;
|
||||
range = range1;
|
||||
/* just in case... */
|
||||
@@ -314,7 +314,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
|
||||
s->path, s->img_number)<0 && s->img_number > 1)
|
||||
return AVERROR(EIO);
|
||||
for(i=0; i<3; i++){
|
||||
if (avio_open(&f[i], filename, AVIO_FLAG_READ) < 0) {
|
||||
if (avio_open(&f[i], filename, AVIO_RDONLY) < 0) {
|
||||
if(i==1)
|
||||
break;
|
||||
av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",filename);
|
||||
@@ -401,7 +401,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
for(i=0; i<3; i++){
|
||||
if (avio_open(&pb[i], filename, AVIO_FLAG_WRITE) < 0) {
|
||||
if (avio_open(&pb[i], filename, AVIO_WRONLY) < 0) {
|
||||
av_log(s, AV_LOG_ERROR, "Could not open file : %s\n",filename);
|
||||
return AVERROR(EIO);
|
||||
}
|
||||
|
@@ -83,6 +83,18 @@ void ff_read_frame_flush(AVFormatContext *s);
|
||||
/** Get the current time since NTP epoch in microseconds. */
|
||||
uint64_t ff_ntp_time(void);
|
||||
|
||||
#if FF_API_URL_SPLIT
|
||||
/**
|
||||
* @deprecated use av_url_split() instead
|
||||
*/
|
||||
void ff_url_split(char *proto, int proto_size,
|
||||
char *authorization, int authorization_size,
|
||||
char *hostname, int hostname_size,
|
||||
int *port_ptr,
|
||||
char *path, int path_size,
|
||||
const char *url);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Assemble a URL string from components. This is the reverse operation
|
||||
* of av_url_split.
|
||||
@@ -155,14 +167,14 @@ void ff_put_v(AVIOContext *bc, uint64_t val);
|
||||
|
||||
/**
|
||||
* Read a whole line of text from AVIOContext. Stop reading after reaching
|
||||
* either a \n, a \0 or EOF. The returned string is always \0 terminated,
|
||||
* either a \\n, a \\0 or EOF. The returned string is always \\0-terminated,
|
||||
* and may be truncated if the buffer is too small.
|
||||
*
|
||||
* @param s the read-only AVIOContext
|
||||
* @param buf buffer to store the read line
|
||||
* @param maxlen size of the buffer
|
||||
* @return the length of the string written in the buffer, not including the
|
||||
* final \0
|
||||
* final \\0
|
||||
*/
|
||||
int ff_get_line(AVIOContext *s, char *buf, int maxlen);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user