Compare commits
262 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b00fc80d40 | ||
![]() |
056e9efc8e | ||
![]() |
cf43508eb3 | ||
![]() |
c9c6e5f4e8 | ||
![]() |
a5a02ea3f2 | ||
![]() |
69b6248327 | ||
![]() |
533dbaa55b | ||
![]() |
ec7f0b527c | ||
![]() |
f36cea2673 | ||
![]() |
bf7dc6b29d | ||
![]() |
596762f058 | ||
![]() |
d2c5904cab | ||
![]() |
3899b3be0c | ||
![]() |
5163de0873 | ||
![]() |
738c17b3a6 | ||
![]() |
27128d82fa | ||
![]() |
ed288c0edd | ||
![]() |
9442f50c33 | ||
![]() |
89bd2307f5 | ||
![]() |
60a1384013 | ||
![]() |
b59919afe2 | ||
![]() |
764ffdd0ec | ||
![]() |
ed9e561490 | ||
![]() |
24e0a9e451 | ||
![]() |
4d8330d095 | ||
![]() |
30d7dce94f | ||
![]() |
6e21f03547 | ||
![]() |
fa3f7391be | ||
![]() |
b7000d0517 | ||
![]() |
169e634457 | ||
![]() |
053bc4ce8b | ||
![]() |
56634b2328 | ||
![]() |
1072498081 | ||
![]() |
e952ff6981 | ||
![]() |
9cee26dfde | ||
![]() |
605f89ffc9 | ||
![]() |
21587509ec | ||
![]() |
ad6177e52c | ||
![]() |
b1ceca016a | ||
![]() |
85b1e265c9 | ||
![]() |
8449cebc90 | ||
![]() |
4a721b18ed | ||
![]() |
f0869d3721 | ||
![]() |
be82df9e12 | ||
![]() |
b70a37f854 | ||
![]() |
812a4a5813 | ||
![]() |
c9316b7c6d | ||
![]() |
8511c141e0 | ||
![]() |
2bf9a09a2c | ||
![]() |
4601765ee8 | ||
![]() |
54544100a3 | ||
![]() |
97437dada6 | ||
![]() |
c8736de331 | ||
![]() |
92f1b5df32 | ||
![]() |
82e4fd193f | ||
![]() |
3a0649ddeb | ||
![]() |
9f05400ea8 | ||
![]() |
09cfd6f597 | ||
![]() |
b2af83a9ed | ||
![]() |
f38b2a6be8 | ||
![]() |
db93a5a0c8 | ||
![]() |
b5fe6bee01 | ||
![]() |
57571f348e | ||
![]() |
ab2ea6415b | ||
![]() |
7181adab80 | ||
![]() |
bac822025e | ||
![]() |
8a8aafd2b9 | ||
![]() |
a13ef61051 | ||
![]() |
4fbc35cd53 | ||
![]() |
1ec29b2da5 | ||
![]() |
5cc5152e80 | ||
![]() |
558cf502ac | ||
![]() |
b0da6a744a | ||
![]() |
d99613bad6 | ||
![]() |
64556c200e | ||
![]() |
c026f336b9 | ||
![]() |
5c2d684986 | ||
![]() |
77dafced71 | ||
![]() |
9c96b1efb1 | ||
![]() |
30442fa217 | ||
![]() |
e7d10f5a90 | ||
![]() |
ca5dfd1550 | ||
![]() |
1979a9b4f2 | ||
![]() |
d805b8f454 | ||
![]() |
a01387bb35 | ||
![]() |
11b72c073c | ||
![]() |
bb6702f206 | ||
![]() |
dd606be909 | ||
![]() |
8c987d8291 | ||
![]() |
6ddb12b688 | ||
![]() |
c34968c6d4 | ||
![]() |
a5107aab98 | ||
![]() |
bc2dd37e4f | ||
![]() |
4482ee9d9c | ||
![]() |
2ac3aa129e | ||
![]() |
1486e99b90 | ||
![]() |
dc6ee18363 | ||
![]() |
bb0c352ec5 | ||
![]() |
1125f26f83 | ||
![]() |
c11d360ebc | ||
![]() |
dd6334a1e4 | ||
![]() |
6b1af6a328 | ||
![]() |
1656dd7a4e | ||
![]() |
144c80042b | ||
![]() |
a460d9e1f7 | ||
![]() |
94af9cf46b | ||
![]() |
46d9dd6980 | ||
![]() |
a652bb2857 | ||
![]() |
7850a9b384 | ||
![]() |
de33e8675c | ||
![]() |
fe9dae6df8 | ||
![]() |
a7d35b2f99 | ||
![]() |
526f24e3fd | ||
![]() |
a8edc1cbc7 | ||
![]() |
f45cfb4751 | ||
![]() |
566d26923e | ||
![]() |
767efcb46e | ||
![]() |
cb9ccc89c5 | ||
![]() |
5925e25218 | ||
![]() |
303e48e6a2 | ||
![]() |
e30e0a16af | ||
![]() |
210d8f4ca2 | ||
![]() |
cc4718196a | ||
![]() |
f629fcd308 | ||
![]() |
b8fa424ce2 | ||
![]() |
3af3a871af | ||
![]() |
82d7ad3344 | ||
![]() |
c5388d680e | ||
![]() |
8abaa83d2c | ||
![]() |
8e0a53bd34 | ||
![]() |
ba19cb6885 | ||
![]() |
3b80fb50d8 | ||
![]() |
fe7deb7cc4 | ||
![]() |
44b3f05309 | ||
![]() |
dc3ab8ca43 | ||
![]() |
e308a91c9c | ||
![]() |
207db36a4f | ||
![]() |
9bf76932e5 | ||
![]() |
91f9c7917c | ||
![]() |
fa75093381 | ||
![]() |
baec70e16f | ||
![]() |
2649439bbd | ||
![]() |
266ec41f77 | ||
![]() |
694279bfd2 | ||
![]() |
0ab69793fc | ||
![]() |
fa38ed8ac0 | ||
![]() |
acf2d3293c | ||
![]() |
48ba48fb13 | ||
![]() |
e1baba3ddb | ||
![]() |
399f7e0e75 | ||
![]() |
90edd5df3d | ||
![]() |
e6df35b3be | ||
![]() |
b2c9e9be87 | ||
![]() |
076a8dfd41 | ||
![]() |
a9a8e5ca99 | ||
![]() |
c2a2ad133e | ||
![]() |
b6187e48db | ||
![]() |
8af11e51f2 | ||
![]() |
f597825052 | ||
![]() |
7d704f5127 | ||
![]() |
eb975b1c8b | ||
![]() |
84648d33ba | ||
![]() |
4b8a0b058d | ||
![]() |
1de90fd375 | ||
![]() |
20ca827019 | ||
![]() |
c8b37fd03d | ||
![]() |
b37131f798 | ||
![]() |
878a7d1573 | ||
![]() |
bd968d260a | ||
![]() |
00c5cf4beb | ||
![]() |
6a57021cf9 | ||
![]() |
f20f79307b | ||
![]() |
d1bc77d86c | ||
![]() |
91d5da9321 | ||
![]() |
08ddfb77a1 | ||
![]() |
a0352d01e9 | ||
![]() |
2ff36ef521 | ||
![]() |
7e33a66c0e | ||
![]() |
893cf1b1ae | ||
![]() |
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 | ||
![]() |
e8baa8eb7f | ||
![]() |
d32b2d4de1 | ||
![]() |
924b2ee8f2 | ||
![]() |
f95e5225fe | ||
![]() |
8f536408d1 | ||
![]() |
093f0f13e6 | ||
![]() |
c172eb7925 | ||
![]() |
154ea553f6 | ||
![]() |
d734d4ce6a | ||
![]() |
c445e9dc62 | ||
![]() |
c5c2654351 | ||
![]() |
2fe47b21c8 | ||
![]() |
b91ebb60d8 | ||
![]() |
f1d1ef810a | ||
![]() |
b263e94f77 | ||
![]() |
9da3063e1c | ||
![]() |
b6fe44b9db | ||
![]() |
8f7f3f0453 | ||
![]() |
376dfd07ab | ||
![]() |
cb66b55270 | ||
![]() |
9482dd0d17 | ||
![]() |
87eedf6943 | ||
![]() |
f239b91596 | ||
![]() |
d052370c1e | ||
![]() |
e54fd33848 | ||
![]() |
9b69efc02b | ||
![]() |
1bf80a9a14 | ||
![]() |
9c709f0534 | ||
![]() |
4ad56612f9 | ||
![]() |
acb62e998f | ||
![]() |
180faac637 | ||
![]() |
13c943ffb1 | ||
![]() |
18052f1df9 | ||
![]() |
4c8b14c37f | ||
![]() |
e4071fa04c | ||
![]() |
bf5ed476ba | ||
![]() |
fcd26ebc8f | ||
![]() |
6a34f5d447 | ||
![]() |
26f48752fb | ||
![]() |
1aef8de6d7 | ||
![]() |
9ac3e32b29 | ||
![]() |
5254285636 | ||
![]() |
137838945f | ||
![]() |
6cef3ddbdc | ||
![]() |
403eee165c | ||
![]() |
523b57b331 | ||
![]() |
a3589cce81 | ||
![]() |
0820593e64 | ||
![]() |
4db2b966be | ||
![]() |
0b5c261212 | ||
![]() |
680e473643 | ||
![]() |
44e83d0c97 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,6 +7,10 @@
|
||||
*-example
|
||||
*-test
|
||||
*_g
|
||||
*.def
|
||||
*.dll
|
||||
*.lib
|
||||
*.exp
|
||||
config.*
|
||||
doc/*.1
|
||||
doc/*.html
|
||||
|
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.4
|
||||
|
||||
# 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
|
||||
|
@@ -373,6 +373,7 @@ Ben Littler 3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C
|
||||
Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
|
||||
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
|
||||
Diego Biurrun 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
|
||||
Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
|
||||
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
|
||||
Justin Ruggles 3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF
|
||||
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
|
||||
|
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/%)
|
||||
|
||||
|
24
cmdutils.c
24
cmdutils.c
@@ -574,12 +574,13 @@ void show_banner(void)
|
||||
print_all_libs_info(stderr, INDENT|SHOW_VERSION);
|
||||
}
|
||||
|
||||
void show_version(void) {
|
||||
int opt_version(const char *opt, const char *arg) {
|
||||
printf("%s " FFMPEG_VERSION "\n", program_name);
|
||||
print_all_libs_info(stdout, SHOW_VERSION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_license(void)
|
||||
int opt_license(const char *opt, const char *arg)
|
||||
{
|
||||
printf(
|
||||
#if CONFIG_NONFREE
|
||||
@@ -646,9 +647,10 @@ void show_license(void)
|
||||
program_name, program_name, program_name
|
||||
#endif
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_formats(void)
|
||||
int opt_formats(const char *opt, const char *arg)
|
||||
{
|
||||
AVInputFormat *ifmt=NULL;
|
||||
AVOutputFormat *ofmt=NULL;
|
||||
@@ -695,9 +697,10 @@ void show_formats(void)
|
||||
name,
|
||||
long_name ? long_name:" ");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_codecs(void)
|
||||
int opt_codecs(const char *opt, const char *arg)
|
||||
{
|
||||
AVCodec *p=NULL, *p2;
|
||||
const char *last_name;
|
||||
@@ -771,9 +774,10 @@ void show_codecs(void)
|
||||
"even though both encoding and decoding are supported. For example, the h263\n"
|
||||
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
|
||||
"worse.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_bsfs(void)
|
||||
int opt_bsfs(const char *opt, const char *arg)
|
||||
{
|
||||
AVBitStreamFilter *bsf=NULL;
|
||||
|
||||
@@ -781,9 +785,10 @@ void show_bsfs(void)
|
||||
while((bsf = av_bitstream_filter_next(bsf)))
|
||||
printf("%s\n", bsf->name);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_protocols(void)
|
||||
int opt_protocols(const char *opt, const char *arg)
|
||||
{
|
||||
URLProtocol *up=NULL;
|
||||
|
||||
@@ -799,9 +804,10 @@ void show_protocols(void)
|
||||
up->url_write ? 'O' : '.',
|
||||
up->url_seek ? 'S' : '.',
|
||||
up->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_filters(void)
|
||||
int opt_filters(const char *opt, const char *arg)
|
||||
{
|
||||
AVFilter av_unused(**filter) = NULL;
|
||||
|
||||
@@ -810,9 +816,10 @@ void show_filters(void)
|
||||
while ((filter = av_filter_next(filter)) && *filter)
|
||||
printf("%-16s %s\n", (*filter)->name, (*filter)->description);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void show_pix_fmts(void)
|
||||
int opt_pix_fmts(const char *opt, const char *arg)
|
||||
{
|
||||
enum PixelFormat pix_fmt;
|
||||
|
||||
@@ -843,6 +850,7 @@ void show_pix_fmts(void)
|
||||
pix_desc->nb_components,
|
||||
av_get_bits_per_pixel(pix_desc));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int read_yesno(void)
|
||||
|
26
cmdutils.h
26
cmdutils.h
@@ -62,7 +62,7 @@ void uninit_opts(void);
|
||||
|
||||
/**
|
||||
* Trivial log callback.
|
||||
* Only suitable for show_help and similar since it lacks prefix handling.
|
||||
* Only suitable for opt_help and similar since it lacks prefix handling.
|
||||
*/
|
||||
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
|
||||
|
||||
@@ -177,50 +177,58 @@ void show_banner(void);
|
||||
* Print the version of the program to stdout. The version message
|
||||
* depends on the current versions of the repository and of the libav*
|
||||
* libraries.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_version(void);
|
||||
int opt_version(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print the license of the program to stdout. The license depends on
|
||||
* the license of the libraries compiled into the program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_license(void);
|
||||
int opt_license(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the formats supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_formats(void);
|
||||
int opt_formats(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the codecs supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_codecs(void);
|
||||
int opt_codecs(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the filters supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_filters(void);
|
||||
int opt_filters(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the bit stream filters supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_bsfs(void);
|
||||
int opt_bsfs(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the protocols supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_protocols(void);
|
||||
int opt_protocols(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing all the pixel formats supported by the
|
||||
* program.
|
||||
* This option processing function does not utilize the arguments.
|
||||
*/
|
||||
void show_pix_fmts(void);
|
||||
int opt_pix_fmts(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Return a positive value if a line read from standard input
|
||||
|
@@ -1,13 +1,13 @@
|
||||
{ "L", OPT_EXIT, {(void*)show_license}, "show license" },
|
||||
{ "h", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "?", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "-help", OPT_EXIT, {(void*)show_help}, "show help" },
|
||||
{ "version", OPT_EXIT, {(void*)show_version}, "show version" },
|
||||
{ "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" },
|
||||
{ "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" },
|
||||
{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" },
|
||||
{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" },
|
||||
{ "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" },
|
||||
{ "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" },
|
||||
{ "L", OPT_EXIT, {(void*)opt_license}, "show license" },
|
||||
{ "h", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "?", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "-help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||
{ "version", OPT_EXIT, {(void*)opt_version}, "show version" },
|
||||
{ "formats" , OPT_EXIT, {(void*)opt_formats }, "show available formats" },
|
||||
{ "codecs" , OPT_EXIT, {(void*)opt_codecs }, "show available codecs" },
|
||||
{ "bsfs" , OPT_EXIT, {(void*)opt_bsfs }, "show available bit stream filters" },
|
||||
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
|
||||
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
|
||||
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
|
||||
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
||||
|
12
configure
vendored
12
configure
vendored
@@ -177,7 +177,7 @@ External library support:
|
||||
--enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]
|
||||
--enable-librtmp enable RTMP[E] support via librtmp [no]
|
||||
--enable-libschroedinger enable Dirac support via libschroedinger [no]
|
||||
--enable-libspeex enable Speex decoding via libspeex [no]
|
||||
--enable-libspeex enable Speex encoding and decoding via libspeex [no]
|
||||
--enable-libtheora enable Theora encoding via libtheora [no]
|
||||
--enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
|
||||
--enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
|
||||
@@ -1417,6 +1417,7 @@ libopenjpeg_decoder_deps="libopenjpeg"
|
||||
libschroedinger_decoder_deps="libschroedinger"
|
||||
libschroedinger_encoder_deps="libschroedinger"
|
||||
libspeex_decoder_deps="libspeex"
|
||||
libspeex_encoder_deps="libspeex"
|
||||
libtheora_encoder_deps="libtheora"
|
||||
libvo_aacenc_encoder_deps="libvo_aacenc"
|
||||
libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
|
||||
@@ -1512,7 +1513,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"
|
||||
@@ -2537,6 +2538,7 @@ case $target_os in
|
||||
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
|
||||
;;
|
||||
gnu)
|
||||
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||
;;
|
||||
qnx)
|
||||
add_cppflags -D_QNX_SOURCE
|
||||
@@ -3064,7 +3066,6 @@ fi
|
||||
|
||||
if enabled small; then
|
||||
add_cflags $size_cflags
|
||||
optimizations="small"
|
||||
elif enabled optimizations; then
|
||||
add_cflags $speed_cflags
|
||||
else
|
||||
@@ -3118,6 +3119,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 +3207,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 +3274,7 @@ if enabled source_path_used; then
|
||||
doc
|
||||
libavcodec
|
||||
libavcodec/$arch
|
||||
libavcodec/mlib
|
||||
libavdevice
|
||||
libavfilter
|
||||
libavfilter/$arch
|
||||
@@ -3281,6 +3286,7 @@ if enabled source_path_used; then
|
||||
libpostproc
|
||||
libswscale
|
||||
libswscale/$arch
|
||||
libswscale/mlib
|
||||
tests
|
||||
tools
|
||||
"
|
||||
|
@@ -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
|
||||
|
@@ -447,6 +447,11 @@ encompassing your FFmpeg includes using @code{extern "C"}.
|
||||
|
||||
See @url{http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3}
|
||||
|
||||
@section I'm using libavutil from within my C++ application but the compiler complains about 'UINT64_C' was not declared in this scope
|
||||
|
||||
Libav is a pure C project using C99 math features, in order to enable C++
|
||||
to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
|
||||
|
||||
@section I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?
|
||||
|
||||
You have to implement a URLProtocol, see @file{libavformat/file.c} in
|
||||
|
@@ -713,8 +713,39 @@ ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
|
||||
Copy chapters from @var{infile} to @var{outfile}. If no chapter mapping is specified,
|
||||
then chapters are copied from the first input file with at least one chapter to all
|
||||
output files. Use a negative file index to disable any chapter copying.
|
||||
@item -debug
|
||||
@item -debug @var{category}
|
||||
Print specific debug info.
|
||||
@var{category} is a number or a string containing one of the following values:
|
||||
@table @samp
|
||||
@item bitstream
|
||||
@item buffers
|
||||
picture buffer allocations
|
||||
@item bugs
|
||||
@item dct_coeff
|
||||
@item er
|
||||
error recognition
|
||||
@item mb_type
|
||||
macroblock (MB) type
|
||||
@item mmco
|
||||
memory management control operations (H.264)
|
||||
@item mv
|
||||
motion vector
|
||||
@item pict
|
||||
picture info
|
||||
@item pts
|
||||
@item qp
|
||||
per-block quantization parameter (QP)
|
||||
@item rc
|
||||
rate control
|
||||
@item skip
|
||||
@item startcode
|
||||
@item thread_ops
|
||||
threading operations
|
||||
@item vis_mb_type
|
||||
visualize block types
|
||||
@item vis_qp
|
||||
visualize quantization parameter (QP), lower QP are tinted greener
|
||||
@end table
|
||||
@item -benchmark
|
||||
Show benchmarking information at the end of an encode.
|
||||
Shows CPU time used and maximum memory consumption.
|
||||
|
@@ -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
|
||||
|
40
ffmpeg.c
40
ffmpeg.c
@@ -343,6 +343,7 @@ typedef struct AVInputFile {
|
||||
int eof_reached; /* true if eof reached */
|
||||
int ist_index; /* index of first stream in ist_table */
|
||||
int buffer_size; /* current total buffer size */
|
||||
int nb_streams; /* nb streams we are aware of */
|
||||
} AVInputFile;
|
||||
|
||||
#if HAVE_TERMIOS_H
|
||||
@@ -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);
|
||||
@@ -2045,7 +2046,7 @@ static int transcode(AVFormatContext **output_files,
|
||||
int si = stream_maps[i].stream_index;
|
||||
|
||||
if (fi < 0 || fi > nb_input_files - 1 ||
|
||||
si < 0 || si > input_files[fi].ctx->nb_streams - 1) {
|
||||
si < 0 || si > input_files[fi].nb_streams - 1) {
|
||||
fprintf(stderr,"Could not find input stream #%d.%d\n", fi, si);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
@@ -2053,7 +2054,7 @@ static int transcode(AVFormatContext **output_files,
|
||||
fi = stream_maps[i].sync_file_index;
|
||||
si = stream_maps[i].sync_stream_index;
|
||||
if (fi < 0 || fi > nb_input_files - 1 ||
|
||||
si < 0 || si > input_files[fi].ctx->nb_streams - 1) {
|
||||
si < 0 || si > input_files[fi].nb_streams - 1) {
|
||||
fprintf(stderr,"Could not find sync stream #%d.%d\n", fi, si);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
@@ -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;
|
||||
@@ -2728,7 +2732,7 @@ static int transcode(AVFormatContext **output_files,
|
||||
}
|
||||
/* the following test is needed in case new streams appear
|
||||
dynamically in stream : we ignore them */
|
||||
if (pkt.stream_index >= input_files[file_index].ctx->nb_streams)
|
||||
if (pkt.stream_index >= input_files[file_index].nb_streams)
|
||||
goto discard_packet;
|
||||
ist_index = input_files[file_index].ist_index + pkt.stream_index;
|
||||
ist = &input_streams[ist_index];
|
||||
@@ -2941,7 +2945,7 @@ static int opt_frame_pix_fmt(const char *opt, const char *arg)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
} else {
|
||||
show_pix_fmts();
|
||||
opt_pix_fmts(NULL, NULL);
|
||||
ffmpeg_exit(0);
|
||||
}
|
||||
return 0;
|
||||
@@ -3465,6 +3469,7 @@ static int opt_input_file(const char *opt, const char *filename)
|
||||
input_files = grow_array(input_files, sizeof(*input_files), &nb_input_files, nb_input_files + 1);
|
||||
input_files[nb_input_files - 1].ctx = ic;
|
||||
input_files[nb_input_files - 1].ist_index = nb_input_streams - ic->nb_streams;
|
||||
input_files[nb_input_files - 1].nb_streams = ic->nb_streams;
|
||||
|
||||
top_field_first = -1;
|
||||
video_channel = 0;
|
||||
@@ -4071,16 +4076,18 @@ static void parse_matrix_coeffs(uint16_t *dest, const char *str)
|
||||
}
|
||||
}
|
||||
|
||||
static void opt_inter_matrix(const char *arg)
|
||||
static int opt_inter_matrix(const char *opt, const char *arg)
|
||||
{
|
||||
inter_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||
parse_matrix_coeffs(inter_matrix, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void opt_intra_matrix(const char *arg)
|
||||
static int opt_intra_matrix(const char *opt, const char *arg)
|
||||
{
|
||||
intra_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||
parse_matrix_coeffs(intra_matrix, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void show_usage(void)
|
||||
@@ -4090,7 +4097,7 @@ static void show_usage(void)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
AVCodec *c;
|
||||
AVOutputFormat *oformat = NULL;
|
||||
@@ -4145,6 +4152,7 @@ static void show_help(void)
|
||||
}
|
||||
|
||||
av_opt_show2(sws_opts, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int opt_target(const char *opt, const char *arg)
|
||||
@@ -4375,10 +4383,14 @@ static void log_callback_null(void* ptr, int level, const char* fmt, va_list vl)
|
||||
{
|
||||
}
|
||||
|
||||
static void opt_passlogfile(const char *arg)
|
||||
static int opt_passlogfile(const char *opt, const char *arg)
|
||||
{
|
||||
pass_logfilename_prefix = arg;
|
||||
opt_default("passlogfile", arg);
|
||||
#if CONFIG_LIBX264_ENCODER
|
||||
return opt_default("passlogfile", arg);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const OptionDef options[] = {
|
||||
|
39
ffplay.c
39
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"
|
||||
@@ -211,7 +212,7 @@ typedef struct VideoState {
|
||||
int refresh;
|
||||
} VideoState;
|
||||
|
||||
static void show_help(void);
|
||||
static int opt_help(const char *opt, const char *arg);
|
||||
|
||||
/* options specified by the user */
|
||||
static AVInputFormat *file_iformat;
|
||||
@@ -1778,8 +1779,10 @@ static int video_thread(void *arg)
|
||||
|
||||
if (ret < 0) goto the_end;
|
||||
|
||||
#if CONFIG_AVFILTER
|
||||
if (!picref)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
pts = pts_int*av_q2d(is->video_st->time_base);
|
||||
|
||||
@@ -2295,15 +2298,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 +2314,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)
|
||||
@@ -2964,7 +2952,7 @@ static void show_usage(void)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
av_log_set_callback(log_callback_help);
|
||||
show_usage();
|
||||
@@ -2996,6 +2984,7 @@ static void show_help(void)
|
||||
"down/up seek backward/forward 1 minute\n"
|
||||
"mouse click seek to percentage in file corresponding to fraction of width\n"
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Called from the main */
|
||||
|
@@ -353,7 +353,7 @@ static int opt_input_file(const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
av_log_set_callback(log_callback_help);
|
||||
show_usage();
|
||||
@@ -361,6 +361,7 @@ static void show_help(void)
|
||||
printf("\n");
|
||||
av_opt_show2(avformat_opts, NULL,
|
||||
AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void opt_pretty(void)
|
||||
|
@@ -4654,12 +4654,13 @@ static void opt_debug(void)
|
||||
logfilename[0] = '-';
|
||||
}
|
||||
|
||||
static void show_help(void)
|
||||
static int opt_help(const char *opt, const char *arg)
|
||||
{
|
||||
printf("usage: ffserver [options]\n"
|
||||
"Hyper fast multi format Audio/Video streaming server\n");
|
||||
printf("\n");
|
||||
show_help_options(options, "Main options:\n", 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const OptionDef options[] = {
|
||||
|
@@ -587,6 +587,7 @@ OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
|
||||
libschroedinger.o \
|
||||
libdirac_libschro.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.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).
|
||||
|
@@ -72,7 +72,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
||||
int pce_size = 0;
|
||||
uint8_t pce_data[MAX_PCE_SIZE];
|
||||
if (!hdr.chan_config) {
|
||||
init_get_bits(&gb, buf, buf_size);
|
||||
init_get_bits(&gb, buf, buf_size * 8);
|
||||
if (get_bits(&gb, 3) != 5) {
|
||||
av_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element is", 0);
|
||||
return -1;
|
||||
|
@@ -1755,12 +1755,10 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
|
||||
} else {
|
||||
memset(in, 0, 448 * sizeof(float));
|
||||
ac->dsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
|
||||
memcpy(in + 576, in + 576, 448 * sizeof(float));
|
||||
}
|
||||
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
|
||||
ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
} else {
|
||||
memcpy(in + 1024, in + 1024, 448 * sizeof(float));
|
||||
ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
memset(in + 1024 + 576, 0, 448 * sizeof(float));
|
||||
}
|
||||
@@ -2078,7 +2076,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
ChannelElement *che = NULL, *che_prev = NULL;
|
||||
enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
|
||||
int err, elem_id, data_size_tmp;
|
||||
int samples = 0, multiplier;
|
||||
int samples = 0, multiplier, audio_found = 0;
|
||||
|
||||
if (show_bits(gb, 12) == 0xfff) {
|
||||
if (parse_adts_frame_header(ac, gb) < 0) {
|
||||
@@ -2109,10 +2107,12 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
|
||||
case TYPE_SCE:
|
||||
err = decode_ics(ac, &che->ch[0], gb, 0, 0);
|
||||
audio_found = 1;
|
||||
break;
|
||||
|
||||
case TYPE_CPE:
|
||||
err = decode_cpe(ac, gb, che);
|
||||
audio_found = 1;
|
||||
break;
|
||||
|
||||
case TYPE_CCE:
|
||||
@@ -2121,6 +2121,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
|
||||
case TYPE_LFE:
|
||||
err = decode_ics(ac, &che->ch[0], gb, 0, 0);
|
||||
audio_found = 1;
|
||||
break;
|
||||
|
||||
case TYPE_DSE:
|
||||
@@ -2197,7 +2198,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
samples, avctx->channels);
|
||||
}
|
||||
|
||||
if (ac->output_configured)
|
||||
if (ac->output_configured && audio_found)
|
||||
ac->output_configured = OC_LOCKED;
|
||||
|
||||
return 0;
|
||||
|
@@ -813,14 +813,17 @@ static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2
|
||||
const float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
|
||||
|
||||
//Remapping
|
||||
memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
|
||||
memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
|
||||
memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
|
||||
memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
|
||||
memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
|
||||
memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
|
||||
memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
|
||||
memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
|
||||
if (ps->num_env_old) {
|
||||
memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
|
||||
memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
|
||||
memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
|
||||
memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
|
||||
memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
|
||||
memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
|
||||
memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
|
||||
memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
|
||||
}
|
||||
|
||||
if (is34) {
|
||||
remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
|
||||
remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
|
||||
|
@@ -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
|
||||
|
@@ -380,7 +380,7 @@ void avcodec_register_all(void)
|
||||
REGISTER_DECODER (LIBOPENCORE_AMRWB, libopencore_amrwb);
|
||||
REGISTER_DECODER (LIBOPENJPEG, libopenjpeg);
|
||||
REGISTER_ENCDEC (LIBSCHROEDINGER, libschroedinger);
|
||||
REGISTER_DECODER (LIBSPEEX, libspeex);
|
||||
REGISTER_ENCDEC (LIBSPEEX, libspeex);
|
||||
REGISTER_ENCODER (LIBTHEORA, libtheora);
|
||||
REGISTER_ENCODER (LIBVO_AACENC, libvo_aacenc);
|
||||
REGISTER_ENCODER (LIBVO_AMRWBENC, libvo_amrwbenc);
|
||||
|
@@ -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
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
@@ -56,7 +56,7 @@
|
||||
vhsub.s16 \r0, \d0, \d1 @ t3, t4, t8, t7
|
||||
vhsub.s16 \r1, \d1, \d0
|
||||
vhadd.s16 \d0, \d0, \d1 @ t1, t2, t6, t5
|
||||
vmov.i64 \d1, #0xffff<<32
|
||||
vmov.i64 \d1, #0xffff00000000
|
||||
vbit \r0, \r1, \d1
|
||||
vrev64.16 \r1, \r0 @ t7, t8, t4, t3
|
||||
vtrn.32 \r0, \r1 @ t3, t4, t7, t8
|
||||
|
@@ -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"
|
||||
|
@@ -2535,7 +2535,7 @@ typedef struct AVCodecContext {
|
||||
|
||||
#if FF_API_FLAC_GLOBAL_OPTS
|
||||
/**
|
||||
* @defgroup flac_opts FLAC options
|
||||
* @name FLAC options
|
||||
* @deprecated Use FLAC encoder private options instead.
|
||||
* @{
|
||||
*/
|
||||
@@ -2606,7 +2606,6 @@ typedef struct AVCodecContext {
|
||||
|
||||
/**
|
||||
* Bits per sample/pixel of internal libavcodec pixel/sample format.
|
||||
* This field is applicable only when sample_fmt is AV_SAMPLE_FMT_S32.
|
||||
* - encoding: set by user.
|
||||
* - decoding: set by libavcodec.
|
||||
*/
|
||||
@@ -2957,7 +2956,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
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
@@ -3915,7 +3914,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);
|
||||
|
@@ -117,7 +117,7 @@ avs_decode_frame(AVCodecContext * avctx,
|
||||
table = buf + (256 * vect_w * vect_h);
|
||||
if (sub_type != AVS_I_FRAME) {
|
||||
int map_size = ((318 / vect_w + 7) / 8) * (198 / vect_h);
|
||||
init_get_bits(&change_map, table, map_size);
|
||||
init_get_bits(&change_map, table, map_size * 8);
|
||||
table += map_size;
|
||||
}
|
||||
|
||||
|
@@ -571,6 +571,22 @@ static inline int binkb_get_value(BinkContext *c, int bundle_num)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline DCTELEM dequant(DCTELEM in, uint32_t quant, int dc)
|
||||
{
|
||||
/* Note: multiplication is unsigned but we want signed shift
|
||||
* otherwise clipping breaks.
|
||||
* TODO: The official decoder does not use clipping at all
|
||||
* but instead uses the full 32-bit result.
|
||||
* However clipping at least gets rid of the case that a
|
||||
* half-black half-white intra block gets black and white swapped
|
||||
* and should cause at most minor differences (except for DC). */
|
||||
int32_t res = in * quant;
|
||||
res >>= 11;
|
||||
if (!dc)
|
||||
res = av_clip_int16(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read 8x8 block of DCT coefficients.
|
||||
*
|
||||
@@ -669,10 +685,10 @@ static int read_dct_coeffs(GetBitContext *gb, DCTELEM block[64], const uint8_t *
|
||||
|
||||
quant = quant_matrices[quant_idx];
|
||||
|
||||
block[0] = (block[0] * quant[0]) >> 11;
|
||||
block[0] = dequant(block[0], quant[0], 1);
|
||||
for (i = 0; i < coef_count; i++) {
|
||||
int idx = coef_idx[i];
|
||||
block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;
|
||||
block[scan[idx]] = dequant(block[scan[idx]], quant[idx], 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -161,10 +161,14 @@ void ff_init_cabac_states(CABACContext *c){
|
||||
ff_h264_mps_state[2*i+1]= 2*mps_state[i]+1;
|
||||
|
||||
if( i ){
|
||||
ff_h264_lps_state[2*i+0]=
|
||||
ff_h264_mlps_state[128-2*i-1]= 2*lps_state[i]+0;
|
||||
ff_h264_lps_state[2*i+1]=
|
||||
ff_h264_mlps_state[128-2*i-2]= 2*lps_state[i]+1;
|
||||
}else{
|
||||
ff_h264_lps_state[2*i+0]=
|
||||
ff_h264_mlps_state[128-2*i-1]= 1;
|
||||
ff_h264_lps_state[2*i+1]=
|
||||
ff_h264_mlps_state[128-2*i-2]= 0;
|
||||
}
|
||||
}
|
||||
@@ -190,7 +194,8 @@ int main(void){
|
||||
ff_init_cabac_states(&c);
|
||||
|
||||
for(i=0; i<SIZE; i++){
|
||||
r[i] = av_lfg_get(&prng) % 7;
|
||||
if(2*i<SIZE) r[i] = av_lfg_get(&prng) % 7;
|
||||
else r[i] = (i>>8)&1;
|
||||
}
|
||||
|
||||
for(i=0; i<SIZE; i++){
|
||||
@@ -205,6 +210,7 @@ START_TIMER
|
||||
STOP_TIMER("put_cabac")
|
||||
}
|
||||
|
||||
#if 0
|
||||
for(i=0; i<SIZE; i++){
|
||||
START_TIMER
|
||||
put_cabac_u(&c, state, r[i], 6, 3, i&1);
|
||||
@@ -216,7 +222,7 @@ START_TIMER
|
||||
put_cabac_ueg(&c, state, r[i], 3, 0, 1, 2);
|
||||
STOP_TIMER("put_cabac_ueg")
|
||||
}
|
||||
|
||||
#endif
|
||||
put_cabac_terminate(&c, 1);
|
||||
|
||||
ff_init_cabac_decoder(&c, b, SIZE);
|
||||
|
@@ -115,7 +115,8 @@ static inline int get_ue_code(GetBitContext *gb, int order) {
|
||||
static int decode_residual_block(AVSContext *h, GetBitContext *gb,
|
||||
const struct dec_2dvlc *r, int esc_golomb_order,
|
||||
int qp, uint8_t *dst, int stride) {
|
||||
int i, level_code, esc_code, level, run, mask;
|
||||
int i, esc_code, level, mask;
|
||||
unsigned int level_code, run;
|
||||
DCTELEM level_buf[65];
|
||||
uint8_t run_buf[65];
|
||||
DCTELEM *block = h->block;
|
||||
@@ -124,6 +125,8 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
|
||||
level_code = get_ue_code(gb,r->golomb_order);
|
||||
if(level_code >= ESCAPE_CODE) {
|
||||
run = ((level_code - ESCAPE_CODE) >> 1) + 1;
|
||||
if(run > 64)
|
||||
return -1;
|
||||
esc_code = get_ue_code(gb,esc_golomb_order);
|
||||
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
|
||||
while(level > r->inc_limit)
|
||||
@@ -163,7 +166,7 @@ static inline int decode_residual_inter(AVSContext *h) {
|
||||
|
||||
/* get coded block pattern */
|
||||
int cbp= get_ue_golomb(&h->s.gb);
|
||||
if(cbp > 63){
|
||||
if(cbp > 63U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -189,7 +192,8 @@ static inline int decode_residual_inter(AVSContext *h) {
|
||||
|
||||
static int decode_mb_i(AVSContext *h, int cbp_code) {
|
||||
GetBitContext *gb = &h->s.gb;
|
||||
int block, pred_mode_uv;
|
||||
unsigned pred_mode_uv;
|
||||
int block;
|
||||
uint8_t top[18];
|
||||
uint8_t *left = NULL;
|
||||
uint8_t *d;
|
||||
@@ -222,7 +226,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
|
||||
/* get coded block pattern */
|
||||
if(h->pic_type == AV_PICTURE_TYPE_I)
|
||||
cbp_code = get_ue_golomb(gb);
|
||||
if(cbp_code > 63){
|
||||
if(cbp_code > 63U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -445,6 +449,8 @@ static inline int check_for_slice(AVSContext *h) {
|
||||
if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
|
||||
skip_bits_long(gb,24+align);
|
||||
h->stc = get_bits(gb,8);
|
||||
if (h->stc >= h->mb_height)
|
||||
return 0;
|
||||
decode_slice_header(h,gb);
|
||||
return 1;
|
||||
}
|
||||
@@ -659,7 +665,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
|
||||
buf_end = buf + buf_size;
|
||||
for(;;) {
|
||||
buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc);
|
||||
if(stc & 0xFFFFFE00)
|
||||
if((stc & 0xFFFFFE00) || buf_ptr == buf_end)
|
||||
return FFMAX(0, buf_ptr - buf - s->parse_context.last_index);
|
||||
input_size = (buf_end - buf_ptr)*8;
|
||||
switch(stc) {
|
||||
|
@@ -336,7 +336,8 @@ static int cinepak_decode (CinepakContext *s)
|
||||
* If the frame header is followed by the bytes FE 00 00 06 00 00 then
|
||||
* this is probably one of the two known files that have 6 extra bytes
|
||||
* after the frame header. Else, assume 2 extra bytes. */
|
||||
if ((s->data[10] == 0xFE) &&
|
||||
if (s->size >= 16 &&
|
||||
(s->data[10] == 0xFE) &&
|
||||
(s->data[11] == 0x00) &&
|
||||
(s->data[12] == 0x00) &&
|
||||
(s->data[13] == 0x06) &&
|
||||
|
@@ -67,7 +67,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
p->pict_type= AV_PICTURE_TYPE_I;
|
||||
p->key_frame= 1;
|
||||
|
||||
init_get_bits(&a->gb, buf, buf_size);
|
||||
init_get_bits(&a->gb, buf, buf_size * 8);
|
||||
|
||||
for(y=0; y<avctx->height; y++){
|
||||
uint8_t *luma= &a->picture.data[0][ y*a->picture.linesize[0] ];
|
||||
|
@@ -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)
|
||||
@@ -1175,8 +1175,9 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((q->subpacket[s].js_vlc_bits > 6) || (q->subpacket[s].js_vlc_bits < 0)) {
|
||||
av_log(avctx,AV_LOG_ERROR,"js_vlc_bits = %d, only >= 0 and <= 6 allowed!\n",q->subpacket[s].js_vlc_bits);
|
||||
if ((q->subpacket[s].js_vlc_bits > 6) || (q->subpacket[s].js_vlc_bits < 2*q->subpacket[s].joint_stereo)) {
|
||||
av_log(avctx,AV_LOG_ERROR,"js_vlc_bits = %d, only >= %d and <= 6 allowed!\n",
|
||||
q->subpacket[s].js_vlc_bits, 2*q->subpacket[s].joint_stereo);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@@ -1650,6 +1650,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
|
||||
//set AVCodec values with parsed data
|
||||
avctx->sample_rate = s->sample_rate;
|
||||
avctx->bit_rate = s->bit_rate;
|
||||
avctx->frame_size = s->sample_blocks * 32;
|
||||
|
||||
s->profile = FF_PROFILE_DTS;
|
||||
|
||||
|
@@ -120,7 +120,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
||||
// chroma subsampling
|
||||
if (get_bits1(gb))
|
||||
source->chroma_format = svq3_get_ue_golomb(gb);
|
||||
if (source->chroma_format > 2) {
|
||||
if (source->chroma_format > 2U) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unknown chroma format %d\n",
|
||||
source->chroma_format);
|
||||
return -1;
|
||||
@@ -128,14 +128,14 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
||||
|
||||
if (get_bits1(gb))
|
||||
source->interlaced = svq3_get_ue_golomb(gb);
|
||||
if (source->interlaced > 1)
|
||||
if (source->interlaced > 1U)
|
||||
return -1;
|
||||
|
||||
// frame rate
|
||||
if (get_bits1(gb)) {
|
||||
source->frame_rate_index = svq3_get_ue_golomb(gb);
|
||||
|
||||
if (source->frame_rate_index > 10)
|
||||
if (source->frame_rate_index > 10U)
|
||||
return -1;
|
||||
|
||||
if (!source->frame_rate_index) {
|
||||
@@ -156,7 +156,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
||||
if (get_bits1(gb)) {
|
||||
source->aspect_ratio_index = svq3_get_ue_golomb(gb);
|
||||
|
||||
if (source->aspect_ratio_index > 6)
|
||||
if (source->aspect_ratio_index > 6U)
|
||||
return -1;
|
||||
|
||||
if (!source->aspect_ratio_index) {
|
||||
@@ -179,7 +179,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
||||
if (get_bits1(gb)) {
|
||||
source->pixel_range_index = svq3_get_ue_golomb(gb);
|
||||
|
||||
if (source->pixel_range_index > 4)
|
||||
if (source->pixel_range_index > 4U)
|
||||
return -1;
|
||||
|
||||
// This assumes either fullrange or MPEG levels only
|
||||
@@ -207,7 +207,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
||||
if (get_bits1(gb)) {
|
||||
idx = source->color_spec_index = svq3_get_ue_golomb(gb);
|
||||
|
||||
if (source->color_spec_index > 4)
|
||||
if (source->color_spec_index > 4U)
|
||||
return -1;
|
||||
|
||||
avctx->color_primaries = dirac_color_presets[idx].color_primaries;
|
||||
@@ -217,7 +217,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
||||
if (!source->color_spec_index) {
|
||||
if (get_bits1(gb)) {
|
||||
idx = svq3_get_ue_golomb(gb);
|
||||
if (idx < 3)
|
||||
if (idx < 3U)
|
||||
avctx->color_primaries = dirac_primaries[idx];
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
|
||||
else if (version_major > 2)
|
||||
av_log(avctx, AV_LOG_WARNING, "Stream may have unhandled features\n");
|
||||
|
||||
if (video_format > 20)
|
||||
if (video_format > 20U)
|
||||
return -1;
|
||||
|
||||
// Fill in defaults for the source parameters.
|
||||
|
@@ -1360,7 +1360,7 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
|
||||
rect->y = display->y_pos + offset_y;
|
||||
rect->w = region->width;
|
||||
rect->h = region->height;
|
||||
rect->nb_colors = 16;
|
||||
rect->nb_colors = (1 << region->depth);
|
||||
rect->type = SUBTITLE_BITMAP;
|
||||
rect->pict.linesize[0] = region->width;
|
||||
|
||||
|
@@ -158,9 +158,10 @@ static void fill_scaling_lists(const H264Context *h, DXVA_Qmatrix_H264 *qm)
|
||||
for (j = 0; j < 16; j++)
|
||||
qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][zigzag_scan[j]];
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
for (j = 0; j < 64; j++)
|
||||
qm->bScalingLists8x8[i][j] = h->pps.scaling_matrix8[i][ff_zigzag_direct[j]];
|
||||
for (j = 0; j < 64; j++) {
|
||||
qm->bScalingLists8x8[0][j] = h->pps.scaling_matrix8[0][ff_zigzag_direct[j]];
|
||||
qm->bScalingLists8x8[1][j] = h->pps.scaling_matrix8[3][ff_zigzag_direct[j]];
|
||||
}
|
||||
}
|
||||
|
||||
static int is_slice_short(struct dxva_context *ctx)
|
||||
|
@@ -1805,7 +1805,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
||||
bytes_read = c->bytestream - c->bytestream_start - 1;
|
||||
if(bytes_read ==0) av_log(avctx, AV_LOG_ERROR, "error at end of AC stream\n"); //FIXME
|
||||
//printf("pos=%d\n", bytes_read);
|
||||
init_get_bits(&f->slice_context[0]->gb, buf + bytes_read, buf_size - bytes_read);
|
||||
init_get_bits(&f->slice_context[0]->gb, buf + bytes_read, (buf_size - bytes_read) * 8);
|
||||
} else {
|
||||
bytes_read = 0; /* avoid warning */
|
||||
}
|
||||
@@ -1822,7 +1822,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
||||
if(fs->ac){
|
||||
ff_init_range_decoder(&fs->c, buf_p, v);
|
||||
}else{
|
||||
init_get_bits(&fs->gb, buf_p, v);
|
||||
init_get_bits(&fs->gb, buf_p, v * 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -380,7 +380,7 @@ uint64_t time= rdtsc();
|
||||
|
||||
|
||||
retry:
|
||||
if(s->divx_packed && s->xvid_build>=0 && s->bitstream_buffer_size){
|
||||
if(s->divx_packed && s->bitstream_buffer_size){
|
||||
int i;
|
||||
for(i=0; i<buf_size-3; i++){
|
||||
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1){
|
||||
@@ -681,7 +681,7 @@ frame_end:
|
||||
int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3);
|
||||
int startcode_found=0;
|
||||
|
||||
if(buf_size - current_pos > 5){
|
||||
if(buf_size - current_pos > 7){
|
||||
int i;
|
||||
for(i=current_pos; i<buf_size-4; i++){
|
||||
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
|
||||
|
@@ -183,20 +183,28 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_l
|
||||
i-= RS;
|
||||
}
|
||||
|
||||
if(i>=length-1){ //no escaped 0
|
||||
*dst_length= length;
|
||||
*consumed= length+1; //+1 for the header
|
||||
return src;
|
||||
}
|
||||
|
||||
bufidx = h->nal_unit_type == NAL_DPC ? 1 : 0; // use second escape buffer for inter data
|
||||
av_fast_malloc(&h->rbsp_buffer[bufidx], &h->rbsp_buffer_size[bufidx], length+FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
si=h->rbsp_buffer_size[bufidx];
|
||||
av_fast_malloc(&h->rbsp_buffer[bufidx], &h->rbsp_buffer_size[bufidx], length+FF_INPUT_BUFFER_PADDING_SIZE+MAX_MBPAIR_SIZE);
|
||||
dst= h->rbsp_buffer[bufidx];
|
||||
if(si != h->rbsp_buffer_size[bufidx])
|
||||
memset(dst + length, 0, FF_INPUT_BUFFER_PADDING_SIZE+MAX_MBPAIR_SIZE);
|
||||
|
||||
if (dst == NULL){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(i>=length-1){ //no escaped 0
|
||||
*dst_length= length;
|
||||
*consumed= length+1; //+1 for the header
|
||||
if(h->s.avctx->flags2 & CODEC_FLAG2_FAST){
|
||||
return src;
|
||||
}else{
|
||||
memcpy(dst, src, length);
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
|
||||
//printf("decoding esc\n");
|
||||
memcpy(dst, src, i);
|
||||
si=di=i;
|
||||
@@ -1165,7 +1173,10 @@ static int decode_update_thread_context(AVCodecContext *dst, const AVCodecContex
|
||||
memcpy(&h->s + 1, &h1->s + 1, sizeof(H264Context) - sizeof(MpegEncContext)); //copy all fields after MpegEnc
|
||||
memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
|
||||
memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
|
||||
ff_h264_alloc_tables(h);
|
||||
if (ff_h264_alloc_tables(h) < 0) {
|
||||
av_log(dst, AV_LOG_ERROR, "Could not allocate memory for h264\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
context_init(h);
|
||||
|
||||
for(i=0; i<2; i++){
|
||||
@@ -1403,7 +1414,7 @@ static void decode_postinit(H264Context *h, int setup_finished){
|
||||
pics = 0;
|
||||
while(h->delayed_pic[pics]) pics++;
|
||||
|
||||
assert(pics <= MAX_DELAYED_PIC_COUNT);
|
||||
av_assert0(pics <= MAX_DELAYED_PIC_COUNT);
|
||||
|
||||
h->delayed_pic[pics++] = cur;
|
||||
if(cur->reference == 0)
|
||||
@@ -1682,7 +1693,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;
|
||||
@@ -1848,15 +1859,30 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, i
|
||||
tmp_y[j] = get_bits(&gb, bit_depth);
|
||||
}
|
||||
if(simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
|
||||
for (i = 0; i < 8; i++) {
|
||||
uint16_t *tmp_cb = (uint16_t*)(dest_cb + i*uvlinesize);
|
||||
for (j = 0; j < 8; j++)
|
||||
tmp_cb[j] = get_bits(&gb, bit_depth);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
uint16_t *tmp_cr = (uint16_t*)(dest_cr + i*uvlinesize);
|
||||
for (j = 0; j < 8; j++)
|
||||
tmp_cr[j] = get_bits(&gb, bit_depth);
|
||||
if (!h->sps.chroma_format_idc) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
uint16_t *tmp_cb = (uint16_t*)(dest_cb + i*uvlinesize);
|
||||
for (j = 0; j < 8; j++) {
|
||||
tmp_cb[j] = 1 << (bit_depth - 1);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
uint16_t *tmp_cr = (uint16_t*)(dest_cr + i*uvlinesize);
|
||||
for (j = 0; j < 8; j++) {
|
||||
tmp_cr[j] = 1 << (bit_depth - 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 8; i++) {
|
||||
uint16_t *tmp_cb = (uint16_t*)(dest_cb + i*uvlinesize);
|
||||
for (j = 0; j < 8; j++)
|
||||
tmp_cb[j] = get_bits(&gb, bit_depth);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
uint16_t *tmp_cr = (uint16_t*)(dest_cr + i*uvlinesize);
|
||||
for (j = 0; j < 8; j++)
|
||||
tmp_cr[j] = get_bits(&gb, bit_depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1864,9 +1890,16 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, i
|
||||
memcpy(dest_y + i* linesize, h->mb + i*8, 16);
|
||||
}
|
||||
if(simple || !CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
|
||||
for (i=0; i<8; i++) {
|
||||
memcpy(dest_cb+ i*uvlinesize, h->mb + 128 + i*4, 8);
|
||||
memcpy(dest_cr+ i*uvlinesize, h->mb + 160 + i*4, 8);
|
||||
if (!h->sps.chroma_format_idc) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
memset(dest_cb + i*uvlinesize, 128, 8);
|
||||
memset(dest_cr + i*uvlinesize, 128, 8);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 8; i++) {
|
||||
memcpy(dest_cb + i*uvlinesize, h->mb + 128 + i*4, 8);
|
||||
memcpy(dest_cr + i*uvlinesize, h->mb + 160 + i*4, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2198,15 +2231,17 @@ static void implicit_weight_table(H264Context *h, int field){
|
||||
for(ref0=ref_start; ref0 < ref_count0; ref0++){
|
||||
int poc0 = h->ref_list[0][ref0].poc;
|
||||
for(ref1=ref_start; ref1 < ref_count1; ref1++){
|
||||
int poc1 = h->ref_list[1][ref1].poc;
|
||||
int td = av_clip(poc1 - poc0, -128, 127);
|
||||
int w= 32;
|
||||
if(td){
|
||||
int tb = av_clip(cur_poc - poc0, -128, 127);
|
||||
int tx = (16384 + (FFABS(td) >> 1)) / td;
|
||||
int dist_scale_factor = (tb*tx + 32) >> 8;
|
||||
if(dist_scale_factor >= -64 && dist_scale_factor <= 128)
|
||||
w = 64 - dist_scale_factor;
|
||||
int w = 32;
|
||||
if (!h->ref_list[0][ref0].long_ref && !h->ref_list[1][ref1].long_ref) {
|
||||
int poc1 = h->ref_list[1][ref1].poc;
|
||||
int td = av_clip(poc1 - poc0, -128, 127);
|
||||
if(td){
|
||||
int tb = av_clip(cur_poc - poc0, -128, 127);
|
||||
int tx = (16384 + (FFABS(td) >> 1)) / td;
|
||||
int dist_scale_factor = (tb*tx + 32) >> 8;
|
||||
if(dist_scale_factor >= -64 && dist_scale_factor <= 128)
|
||||
w = 64 - dist_scale_factor;
|
||||
}
|
||||
}
|
||||
if(field<0){
|
||||
h->implicit_weight[ref0][ref1][0]=
|
||||
@@ -2233,7 +2268,7 @@ static void idr(H264Context *h){
|
||||
static void flush_dpb(AVCodecContext *avctx){
|
||||
H264Context *h= avctx->priv_data;
|
||||
int i;
|
||||
for(i=0; i<MAX_DELAYED_PIC_COUNT; i++) {
|
||||
for(i=0; i<=MAX_DELAYED_PIC_COUNT; i++) {
|
||||
if(h->delayed_pic[i])
|
||||
h->delayed_pic[i]->reference= 0;
|
||||
h->delayed_pic[i]= NULL;
|
||||
@@ -2488,7 +2523,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{
|
||||
@@ -2637,7 +2673,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
|
||||
h->prev_interlaced_frame = 1;
|
||||
|
||||
init_scan_tables(h);
|
||||
ff_h264_alloc_tables(h);
|
||||
if (ff_h264_alloc_tables(h) < 0) {
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "Could not allocate memory for h264\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_SLICE)) {
|
||||
if (context_init(h) < 0) {
|
||||
@@ -3303,8 +3342,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;
|
||||
@@ -3667,7 +3706,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
||||
s->workaround_bugs |= FF_BUG_TRUNCATED;
|
||||
|
||||
if(!(s->workaround_bugs & FF_BUG_TRUNCATED)){
|
||||
while(ptr[dst_length - 1] == 0 && dst_length > 0)
|
||||
while(dst_length > 0 && ptr[dst_length - 1] == 0)
|
||||
dst_length--;
|
||||
}
|
||||
bit_length= !dst_length ? 0 : (8*dst_length - ff_h264_decode_rbsp_trailing(h, ptr + dst_length - 1));
|
||||
|
@@ -53,6 +53,8 @@
|
||||
|
||||
#define MAX_DELAYED_PIC_COUNT 16
|
||||
|
||||
#define MAX_MBPAIR_SIZE (256*1024) // a tighter bound could be calculated if someone cares about a few bytes
|
||||
|
||||
/* Compiling in interlaced support reduces the speed
|
||||
* of progressive decoding by about 2%. */
|
||||
#define ALLOW_INTERLACE
|
||||
@@ -507,7 +509,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{
|
||||
|
@@ -678,7 +678,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){
|
||||
}
|
||||
if(opcode==MMCO_SHORT2LONG || opcode==MMCO_LONG2UNUSED || opcode==MMCO_LONG || opcode==MMCO_SET_MAX_LONG){
|
||||
unsigned int long_arg= get_ue_golomb_31(gb);
|
||||
if(long_arg >= 32 || (long_arg >= 16 && !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
|
||||
if(long_arg >= 32 || (long_arg >= 16 && !(opcode == MMCO_SET_MAX_LONG && long_arg == 16) && !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal long ref in memory management control operation %d\n", opcode);
|
||||
return -1;
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -153,6 +153,13 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
start = 48; /* hardcoded for now */
|
||||
|
||||
if (start >= buf_size) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "input buffer size too small (%d)\n", buf_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->decode_delta = buf[18];
|
||||
|
||||
/* decide whether frame uses deltas or not */
|
||||
@@ -160,9 +167,8 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
for (i = 0; i < buf_size; i++)
|
||||
buf[i] = av_reverse[buf[i]];
|
||||
#endif
|
||||
start = 48; /* hardcoded for now */
|
||||
|
||||
init_get_bits(&s->gb, buf + start, buf_size - start);
|
||||
init_get_bits(&s->gb, buf + start, (buf_size - start) * 8);
|
||||
|
||||
if (s->decode_delta) { /* intraframe */
|
||||
ir2_decode_plane(s, avctx->width, avctx->height,
|
||||
|
@@ -86,6 +86,8 @@ static inline void ff_jpegls_downscale_state(JLSState *state, int Q){
|
||||
}
|
||||
|
||||
static inline int ff_jpegls_update_state_regular(JLSState *state, int Q, int err){
|
||||
if(FFABS(err) > 0xFFFF)
|
||||
return -0x10000;
|
||||
state->A[Q] += FFABS(err);
|
||||
err *= state->twonear;
|
||||
state->B[Q] += err;
|
||||
|
@@ -150,7 +150,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
|
||||
if (video_type == 0 || video_type == 1) {
|
||||
GetBitContext gb;
|
||||
init_get_bits(&gb, buf, FFMIN(video_size, buf_end - buf));
|
||||
init_get_bits(&gb, buf, FFMIN(video_size, (buf_end - buf) * 8));
|
||||
|
||||
for (j = 0; j < avctx->height; j += 8)
|
||||
for (i = 0; i < avctx->width; i += 8)
|
||||
|
@@ -174,6 +174,5 @@ AVCodec ff_kgv1_decoder = {
|
||||
NULL,
|
||||
decode_end,
|
||||
decode_frame,
|
||||
.max_lowres = 1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"),
|
||||
};
|
||||
|
178
libavcodec/libspeexenc.c
Normal file
178
libavcodec/libspeexenc.c
Normal file
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* Copyright (c) 2009 by Xuggle Incorporated. All rights reserved.
|
||||
* 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
|
||||
*/
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <speex/speex.h>
|
||||
#include <speex/speex_header.h>
|
||||
#include <speex/speex_stereo.h>
|
||||
|
||||
typedef struct {
|
||||
SpeexBits bits;
|
||||
void *enc_state;
|
||||
SpeexHeader header;
|
||||
} LibSpeexEncContext;
|
||||
|
||||
|
||||
static av_cold int libspeex_encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
LibSpeexEncContext *s = (LibSpeexEncContext*)avctx->priv_data;
|
||||
const SpeexMode *mode;
|
||||
|
||||
if ((avctx->sample_fmt != SAMPLE_FMT_S16 && avctx->sample_fmt != SAMPLE_FMT_FLT) ||
|
||||
avctx->sample_rate <= 0 ||
|
||||
avctx->channels <= 0 ||
|
||||
avctx->channels > 2)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR, "Unsupported sample format, rate, or channels for speex");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (avctx->sample_rate <= 8000)
|
||||
mode = &speex_nb_mode;
|
||||
else if (avctx->sample_rate <= 16000)
|
||||
mode = &speex_wb_mode;
|
||||
else
|
||||
mode = &speex_uwb_mode;
|
||||
|
||||
speex_bits_init(&s->bits);
|
||||
s->enc_state = speex_encoder_init(mode);
|
||||
if (!s->enc_state)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR, "could not initialize speex encoder");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// initialize the header
|
||||
speex_init_header(&s->header, avctx->sample_rate,
|
||||
avctx->channels, mode);
|
||||
|
||||
// TODO: It'd be nice to support VBR here, but
|
||||
// I'm uncertain what AVCodecContext options to use
|
||||
// to signal whether to turn it on.
|
||||
if (avctx->flags & CODEC_FLAG_QSCALE) {
|
||||
spx_int32_t quality = 0;
|
||||
// Map global_quality's mpeg 1/2/4 scale into Speex's 0-10 scale
|
||||
if (avctx->global_quality > FF_LAMBDA_MAX)
|
||||
quality = 0; // lowest possible quality
|
||||
else
|
||||
quality = (spx_int32_t)((FF_LAMBDA_MAX-avctx->global_quality)*10.0/FF_LAMBDA_MAX);
|
||||
speex_encoder_ctl(s->enc_state, SPEEX_SET_QUALITY, &quality);
|
||||
} else {
|
||||
// default to CBR
|
||||
if (avctx->bit_rate > 0)
|
||||
speex_encoder_ctl(s->enc_state, SPEEX_SET_BITRATE, &avctx->bit_rate);
|
||||
// otherwise just take the default quality setting
|
||||
}
|
||||
// reset the bit-rate to the actual bit rate speex will use
|
||||
speex_encoder_ctl(s->enc_state, SPEEX_GET_BITRATE, &s->header.bitrate);
|
||||
avctx->bit_rate = s->header.bitrate;
|
||||
|
||||
// get the actual sample rate
|
||||
speex_encoder_ctl(s->enc_state, SPEEX_GET_SAMPLING_RATE, &s->header.rate);
|
||||
avctx->sample_rate = s->header.rate;
|
||||
|
||||
// get the frame-size. To align with FLV, we're going to put 2 frames
|
||||
// per packet. If someone can tell me how to make this configurable
|
||||
// from the avcodec contents, I'll mod this so it's not hard-coded.
|
||||
// but without this, FLV files with speex data won't play correctly
|
||||
// in flash player 10.
|
||||
speex_encoder_ctl(s->enc_state, SPEEX_GET_FRAME_SIZE, &s->header.frame_size);
|
||||
s->header.frames_per_packet = 2; // Need for FLV container support
|
||||
avctx->frame_size = s->header.frame_size*s->header.frames_per_packet;
|
||||
|
||||
// and we'll put a speex header packet into extradata so that muxers
|
||||
// can use it.
|
||||
avctx->extradata = speex_header_to_packet(&s->header, &avctx->extradata_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold int libspeex_encode_frame(
|
||||
AVCodecContext *avctx, uint8_t *frame,
|
||||
int buf_size, void *data)
|
||||
{
|
||||
LibSpeexEncContext *s = (LibSpeexEncContext*)avctx->priv_data;
|
||||
int i = 0;
|
||||
|
||||
if (!data)
|
||||
// nothing to flush
|
||||
return 0;
|
||||
|
||||
speex_bits_reset(&s->bits);
|
||||
for(i = 0; i < s->header.frames_per_packet; i++)
|
||||
{
|
||||
if (avctx->sample_fmt == SAMPLE_FMT_FLT)
|
||||
{
|
||||
if (avctx->channels == 2) {
|
||||
speex_encode_stereo(
|
||||
(float*)data+i*s->header.frame_size,
|
||||
s->header.frame_size,
|
||||
&s->bits);
|
||||
}
|
||||
speex_encode(s->enc_state,
|
||||
(float*)data+i*s->header.frame_size, &s->bits);
|
||||
} else {
|
||||
if (avctx->channels == 2) {
|
||||
speex_encode_stereo_int(
|
||||
(spx_int16_t*)data+i*s->header.frame_size,
|
||||
s->header.frame_size,
|
||||
&s->bits);
|
||||
}
|
||||
speex_encode_int(s->enc_state,
|
||||
(spx_int16_t*)data+i*s->header.frame_size, &s->bits);
|
||||
}
|
||||
}
|
||||
// put in a terminator so this will fit in a OGG or FLV packet
|
||||
speex_bits_insert_terminator(&s->bits);
|
||||
|
||||
if (buf_size >= speex_bits_nbytes(&s->bits)) {
|
||||
return speex_bits_write(&s->bits, frame, buf_size);
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_ERROR, "output buffer too small");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static av_cold int libspeex_encode_close(AVCodecContext *avctx)
|
||||
{
|
||||
LibSpeexEncContext *s = (LibSpeexEncContext*)avctx->priv_data;
|
||||
|
||||
speex_bits_destroy(&s->bits);
|
||||
speex_encoder_destroy(s->enc_state);
|
||||
s->enc_state = 0;
|
||||
if (avctx->extradata)
|
||||
speex_header_free(avctx->extradata);
|
||||
avctx->extradata = 0;
|
||||
avctx->extradata_size = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodec ff_libspeex_encoder = {
|
||||
"libspeex",
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
CODEC_ID_SPEEX,
|
||||
sizeof(LibSpeexEncContext),
|
||||
libspeex_encode_init,
|
||||
libspeex_encode_frame,
|
||||
libspeex_encode_close,
|
||||
0,
|
||||
.capabilities = CODEC_CAP_DELAY,
|
||||
.supported_samplerates = (const int[]){8000, 16000, 32000, 0},
|
||||
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_FLT,SAMPLE_FMT_NONE},
|
||||
.long_name = NULL_IF_CONFIG_SMALL("libspeex Speex Encoder"),
|
||||
};
|
@@ -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);
|
||||
|
@@ -318,8 +318,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
case 0x11111100:
|
||||
if(s->rgb){
|
||||
s->avctx->pix_fmt = PIX_FMT_BGRA;
|
||||
}else
|
||||
}else{
|
||||
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P;
|
||||
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||
}
|
||||
assert(s->nb_components==3);
|
||||
break;
|
||||
case 0x11000000:
|
||||
@@ -327,12 +329,15 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
break;
|
||||
case 0x12111100:
|
||||
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV440P : PIX_FMT_YUVJ440P;
|
||||
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||
break;
|
||||
case 0x21111100:
|
||||
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P;
|
||||
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||
break;
|
||||
case 0x22111100:
|
||||
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420P;
|
||||
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||
break;
|
||||
default:
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);
|
||||
@@ -881,14 +886,19 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, i
|
||||
}
|
||||
}
|
||||
|
||||
if (s->restart_interval && show_bits(&s->gb, 8) == 0xFF){/* skip RSTn */
|
||||
--s->restart_count;
|
||||
if (s->restart_interval) --s->restart_count;
|
||||
i= 8+((-get_bits_count(&s->gb))&7);
|
||||
if (s->restart_interval && show_bits(&s->gb, i) == (1<<i)-1){ /* skip RSTn */
|
||||
int pos= get_bits_count(&s->gb);
|
||||
align_get_bits(&s->gb);
|
||||
while(show_bits(&s->gb, 8) == 0xFF)
|
||||
skip_bits(&s->gb, 8);
|
||||
skip_bits(&s->gb, 8);
|
||||
for (i=0; i<nb_components; i++) /* reset dc */
|
||||
s->last_dc[i] = 1024;
|
||||
if((get_bits(&s->gb, 8)&0xF8) == 0xD0){
|
||||
for (i=0; i<nb_components; i++) /* reset dc */
|
||||
s->last_dc[i] = 1024;
|
||||
}else{
|
||||
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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.
|
||||
|
@@ -279,7 +279,8 @@ static int mp_decode_frame(AVCodecContext *avctx,
|
||||
if (sz == 0)
|
||||
goto end;
|
||||
|
||||
init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0);
|
||||
if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0))
|
||||
goto end;
|
||||
mp_decode_frame_helper(mp, &gb);
|
||||
free_vlc(&mp->vlc);
|
||||
|
||||
|
@@ -898,8 +898,8 @@ static void mpeg4_encode_gop_header(MpegEncContext * s){
|
||||
s->last_time_base= FFUDIV(time, s->avctx->time_base.den);
|
||||
|
||||
seconds= FFUDIV(time, s->avctx->time_base.den);
|
||||
minutes= FFUDIV(seconds, 60); FFUMOD(seconds, 60);
|
||||
hours = FFUDIV(minutes, 60); FFUMOD(minutes, 60);
|
||||
minutes= FFUDIV(seconds, 60); seconds = FFUMOD(seconds, 60);
|
||||
hours = FFUDIV(minutes, 60); minutes = FFUMOD(minutes, 60);
|
||||
hours = FFUMOD(hours , 24);
|
||||
|
||||
put_bits(&s->pb, 5, hours);
|
||||
|
@@ -1809,7 +1809,7 @@ static int decode_frame(AVCodecContext * avctx,
|
||||
av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
|
||||
return -1;
|
||||
}else if(s->frame_size < buf_size){
|
||||
av_log(avctx, AV_LOG_ERROR, "incorrect frame size\n");
|
||||
av_log(avctx, AV_LOG_DEBUG, "incorrect frame size - multiple frames in buffer?\n");
|
||||
buf_size= s->frame_size;
|
||||
}
|
||||
|
||||
|
@@ -285,9 +285,10 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){
|
||||
}
|
||||
|
||||
FF_ALLOCZ_OR_GOTO(s->avctx, pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2, fail) //the +2 is for the slice end check
|
||||
FF_ALLOCZ_OR_GOTO(s->avctx, pic->qscale_table , mb_array_size * sizeof(uint8_t) , fail)
|
||||
FF_ALLOCZ_OR_GOTO(s->avctx, pic->qscale_table_base , (big_mb_num + s->mb_stride) * sizeof(uint8_t) , fail)
|
||||
FF_ALLOCZ_OR_GOTO(s->avctx, pic->mb_type_base , (big_mb_num + s->mb_stride) * sizeof(uint32_t), fail)
|
||||
pic->mb_type= pic->mb_type_base + 2*s->mb_stride+1;
|
||||
pic->qscale_table = pic->qscale_table_base + 2*s->mb_stride + 1;
|
||||
if(s->out_format == FMT_H264){
|
||||
for(i=0; i<2; i++){
|
||||
FF_ALLOCZ_OR_GOTO(s->avctx, pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t), fail)
|
||||
@@ -339,7 +340,7 @@ static void free_picture(MpegEncContext *s, Picture *pic){
|
||||
av_freep(&pic->mc_mb_var);
|
||||
av_freep(&pic->mb_mean);
|
||||
av_freep(&pic->mbskip_table);
|
||||
av_freep(&pic->qscale_table);
|
||||
av_freep(&pic->qscale_table_base);
|
||||
av_freep(&pic->mb_type_base);
|
||||
av_freep(&pic->dct_coeff);
|
||||
av_freep(&pic->pan_scan);
|
||||
|
@@ -88,6 +88,7 @@ typedef struct Picture{
|
||||
* halfpel luma planes.
|
||||
*/
|
||||
uint8_t *interpolated[3];
|
||||
int8_t *qscale_table_base;
|
||||
int16_t (*motion_val_base[2])[2];
|
||||
uint32_t *mb_type_base;
|
||||
#define MB_TYPE_INTRA MB_TYPE_INTRA4x4 //default mb_type if there is just one type
|
||||
|
@@ -156,6 +156,7 @@ static int decode_tag(AVCodecContext * avctx,
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
NellyMoserDecodeContext *s = avctx->priv_data;
|
||||
int data_max = *data_size;
|
||||
int blocks, i;
|
||||
int16_t* samples;
|
||||
*data_size = 0;
|
||||
@@ -178,6 +179,8 @@ static int decode_tag(AVCodecContext * avctx,
|
||||
*/
|
||||
|
||||
for (i=0 ; i<blocks ; i++) {
|
||||
if ((i + 1) * NELLY_SAMPLES * sizeof(int16_t) > data_max)
|
||||
return i > 0 ? i * NELLY_BLOCK_LEN : -1;
|
||||
nelly_decode_block(s, &buf[i*NELLY_BLOCK_LEN], s->float_buf);
|
||||
s->fmt_conv.float_to_int16(&samples[i*NELLY_SAMPLES], s->float_buf, NELLY_SAMPLES);
|
||||
*data_size += NELLY_SAMPLES*sizeof(int16_t);
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This header is provided for compatibility only and will be removed
|
||||
|
@@ -446,10 +446,9 @@ static const AVOption options[]={
|
||||
{"lpc_passes", "deprecated, use flac-specific options", OFFSET(lpc_passes), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
|
||||
#endif
|
||||
{"slices", "number of slices, used in parallelized decoding", OFFSET(slices), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|E},
|
||||
{"thread_type", "select multithreading type", OFFSET(thread_type), FF_OPT_TYPE_INT, {.dbl = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|E|D, "thread_type"},
|
||||
{"thread_type", "select multithreading type", OFFSET(thread_type), FF_OPT_TYPE_FLAGS, {.dbl = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|E|D, "thread_type"},
|
||||
{"slice", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
|
||||
{"frame", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_THREAD_FRAME }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
|
||||
{"vbv_delay", "initial buffer fill time in periods of 27Mhz clock", 0, FF_OPT_TYPE_INT64, {.dbl = 0 }, 0, INT64_MAX},
|
||||
{"audio_service_type", "audio service type", OFFSET(audio_service_type), FF_OPT_TYPE_INT, {.dbl = AV_AUDIO_SERVICE_TYPE_MAIN }, 0, AV_AUDIO_SERVICE_TYPE_NB-1, A|E, "audio_service_type"},
|
||||
{"ma", "Main Audio Service", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_MAIN }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
|
||||
{"ef", "Effects", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_EFFECTS }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
|
||||
|
@@ -408,9 +408,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 +747,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 +840,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 +856,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
|
||||
|
@@ -839,7 +839,7 @@ erasure:
|
||||
|
||||
*data_size = 160 * sizeof(*outbuffer);
|
||||
|
||||
return *data_size;
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
AVCodec ff_qcelp_decoder =
|
||||
|
@@ -866,6 +866,12 @@ static int init_pass2(MpegEncContext *s)
|
||||
assert(filter_size%2==1);
|
||||
|
||||
/* fixed I/B QP relative to P mode */
|
||||
for(i=FFMAX(0, rcc->num_entries-300); i<rcc->num_entries; i++){
|
||||
RateControlEntry *rce= &rcc->entry[i];
|
||||
|
||||
qscale[i]= get_diff_limited_q(s, rce, qscale[i]);
|
||||
}
|
||||
|
||||
for(i=rcc->num_entries-1; i>=0; i--){
|
||||
RateControlEntry *rce= &rcc->entry[i];
|
||||
|
||||
|
@@ -559,8 +559,14 @@ static int rv10_decode_packet(AVCodecContext *avctx,
|
||||
if(MPV_frame_start(s, avctx) < 0)
|
||||
return -1;
|
||||
ff_er_frame_start(s);
|
||||
} else {
|
||||
if (s->current_picture_ptr->pict_type != s->pict_type) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
av_dlog(avctx, "qscale=%d\n", s->qscale);
|
||||
|
||||
/* default quantization values */
|
||||
|
@@ -51,6 +51,11 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
|
||||
skip_bits1(gb);
|
||||
si->pts = get_bits(gb, 13);
|
||||
rpr = get_bits(gb, r->rpr);
|
||||
if (r->s.avctx->extradata_size < 8 + rpr*2) {
|
||||
av_log(r->s.avctx, AV_LOG_WARNING,
|
||||
"Extradata does not contain selected resolution\n");
|
||||
rpr = 0;
|
||||
}
|
||||
if(rpr){
|
||||
w = r->s.avctx->extradata[6 + rpr*2] << 2;
|
||||
h = r->s.avctx->extradata[7 + rpr*2] << 2;
|
||||
@@ -74,7 +79,7 @@ static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t
|
||||
for(i = 0; i < 4; i++, dst += r->intra_types_stride - 4){
|
||||
for(j = 0; j < 4; j+= 2){
|
||||
int code = svq3_get_ue_golomb(gb) << 1;
|
||||
if(code >= 81*2){
|
||||
if(code >= 81U*2U){
|
||||
av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -103,7 +108,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
|
||||
GetBitContext *gb = &s->gb;
|
||||
int code = svq3_get_ue_golomb(gb);
|
||||
|
||||
if(code > 11){
|
||||
if(code > 11U){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -256,6 +261,7 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
|
||||
if(avctx->extradata_size - 8 < (r->rpr - 1) * 2){
|
||||
av_log(avctx, AV_LOG_ERROR, "Insufficient extradata - need at least %d bytes, got %d\n",
|
||||
6 + r->rpr * 2, avctx->extradata_size);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
r->parse_slice_header = rv30_parse_slice_header;
|
||||
r->decode_intra_types = rv30_decode_intra_types;
|
||||
|
@@ -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)
|
||||
{
|
||||
@@ -1308,6 +1305,17 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
|
||||
r->next_pts = r->cur_pts;
|
||||
}
|
||||
s->mb_x = s->mb_y = 0;
|
||||
} else {
|
||||
int slice_type = r->si.type ? r->si.type : AV_PICTURE_TYPE_I;
|
||||
|
||||
if (slice_type != s->pict_type) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->width != r->si.width || s->height != r->si.height) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Size mismatch\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
r->si.end = end;
|
||||
@@ -1439,15 +1447,17 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
|
||||
slice_count = (*buf++) + 1;
|
||||
slices_hdr = buf + 4;
|
||||
buf += 8 * slice_count;
|
||||
buf_size -= 1 + 8 * slice_count;
|
||||
}else
|
||||
slice_count = avctx->slice_count;
|
||||
|
||||
//parse first slice header to check whether this frame can be decoded
|
||||
if(get_slice_offset(avctx, slices_hdr, 0) > buf_size){
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice offset is greater than frame size\n");
|
||||
if(get_slice_offset(avctx, slices_hdr, 0) < 0 ||
|
||||
get_slice_offset(avctx, slices_hdr, 0) > buf_size){
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
|
||||
return -1;
|
||||
}
|
||||
init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, 0), buf_size-get_slice_offset(avctx, slices_hdr, 0));
|
||||
init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, 0), (buf_size-get_slice_offset(avctx, slices_hdr, 0))*8);
|
||||
if(r->parse_slice_header(r, &r->s.gb, &si) < 0 || si.start){
|
||||
av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n");
|
||||
return -1;
|
||||
@@ -1457,7 +1467,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
|
||||
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;
|
||||
return avpkt->size;
|
||||
|
||||
for(i=0; i<slice_count; i++){
|
||||
int offset= get_slice_offset(avctx, slices_hdr, i);
|
||||
@@ -1467,13 +1477,18 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
|
||||
else
|
||||
size= get_slice_offset(avctx, slices_hdr, i+1) - offset;
|
||||
|
||||
if(offset > buf_size){
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice offset is greater than frame size\n");
|
||||
if(offset < 0 || offset > buf_size){
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
|
||||
break;
|
||||
}
|
||||
|
||||
r->si.end = s->mb_width * s->mb_height;
|
||||
if(i+1 < slice_count){
|
||||
if (get_slice_offset(avctx, slices_hdr, i+1) < 0 ||
|
||||
get_slice_offset(avctx, slices_hdr, i+1) > buf_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice offset is invalid\n");
|
||||
break;
|
||||
}
|
||||
init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, i+1), (buf_size-get_slice_offset(avctx, slices_hdr, i+1))*8);
|
||||
if(r->parse_slice_header(r, &r->s.gb, &si) < 0){
|
||||
if(i+2 < slice_count)
|
||||
@@ -1483,13 +1498,17 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
|
||||
}else
|
||||
r->si.end = si.start;
|
||||
}
|
||||
if (size < 0 || size > buf_size - offset) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice size is invalid\n");
|
||||
break;
|
||||
}
|
||||
last = rv34_decode_slice(r, r->si.end, buf + offset, size);
|
||||
s->mb_num_left = r->s.mb_x + r->s.mb_y*r->s.mb_width - r->si.start;
|
||||
if(last)
|
||||
break;
|
||||
}
|
||||
|
||||
if(last){
|
||||
if(last && s->current_picture_ptr){
|
||||
if(r->loop_filter)
|
||||
r->loop_filter(r, s->mb_height - 1);
|
||||
ff_er_frame_end(s);
|
||||
@@ -1506,7 +1525,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
|
||||
}
|
||||
return buf_size;
|
||||
return avpkt->size;
|
||||
}
|
||||
|
||||
av_cold int ff_rv34_decode_end(AVCodecContext *avctx)
|
||||
|
@@ -231,8 +231,11 @@ static int rv40_decode_mb_info(RV34DecContext *r)
|
||||
int blocks[RV34_MB_TYPES] = {0};
|
||||
int count = 0;
|
||||
|
||||
if(!r->s.mb_skip_run)
|
||||
if(!r->s.mb_skip_run) {
|
||||
r->s.mb_skip_run = svq3_get_ue_golomb(gb) + 1;
|
||||
if(r->s.mb_skip_run > (unsigned)s->mb_num)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(--r->s.mb_skip_run)
|
||||
return RV34_MB_SKIP;
|
||||
|
@@ -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;
|
||||
|
@@ -134,11 +134,13 @@ static int smacker_decode_bigtree(GetBitContext *gb, HuffContext *hc, DBCtx *ctx
|
||||
return -1;
|
||||
}
|
||||
b1 = get_bits_count(gb);
|
||||
i1 = get_vlc2(gb, ctx->v1->table, SMKTREE_BITS, 3);
|
||||
i1 = ctx->v1->table ? get_vlc2(gb, ctx->v1->table, SMKTREE_BITS, 3) : 0;
|
||||
b1 = get_bits_count(gb) - b1;
|
||||
b2 = get_bits_count(gb);
|
||||
i2 = get_vlc2(gb, ctx->v2->table, SMKTREE_BITS, 3);
|
||||
i2 = ctx->v2->table ? get_vlc2(gb, ctx->v2->table, SMKTREE_BITS, 3) : 0;
|
||||
b2 = get_bits_count(gb) - b2;
|
||||
if (i1 < 0 || i2 < 0)
|
||||
return -1;
|
||||
val = ctx->recode1[i1] | (ctx->recode2[i2] << 8);
|
||||
if(val == ctx->escapes[0]) {
|
||||
ctx->last[0] = hc->current;
|
||||
@@ -290,7 +292,8 @@ static int decode_header_trees(SmackVContext *smk) {
|
||||
smk->mmap_tbl[0] = 0;
|
||||
smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
|
||||
} else {
|
||||
smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size);
|
||||
if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size))
|
||||
return -1;
|
||||
}
|
||||
if(!get_bits1(&gb)) {
|
||||
av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
|
||||
@@ -298,7 +301,8 @@ static int decode_header_trees(SmackVContext *smk) {
|
||||
smk->mclr_tbl[0] = 0;
|
||||
smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
|
||||
} else {
|
||||
smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size);
|
||||
if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size))
|
||||
return -1;
|
||||
}
|
||||
if(!get_bits1(&gb)) {
|
||||
av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
|
||||
@@ -306,7 +310,8 @@ static int decode_header_trees(SmackVContext *smk) {
|
||||
smk->full_tbl[0] = 0;
|
||||
smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
|
||||
} else {
|
||||
smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size);
|
||||
if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size))
|
||||
return -1;
|
||||
}
|
||||
if(!get_bits1(&gb)) {
|
||||
av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
|
||||
@@ -314,7 +319,8 @@ static int decode_header_trees(SmackVContext *smk) {
|
||||
smk->type_tbl[0] = 0;
|
||||
smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
|
||||
} else {
|
||||
smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size);
|
||||
if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -523,8 +529,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
decode_header_trees(c);
|
||||
|
||||
if (decode_header_trees(c))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -619,9 +625,9 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||
if(bits) { //decode 16-bit data
|
||||
for(i = stereo; i >= 0; i--)
|
||||
pred[i] = av_bswap16(get_bits(&gb, 16));
|
||||
for(i = 0; i < stereo; i++)
|
||||
for(i = 0; i <= stereo; i++)
|
||||
*samples++ = pred[i];
|
||||
for(i = 0; i < unp_size / 2; i++) {
|
||||
for(; i < unp_size / 2; i++) {
|
||||
if(i & stereo) {
|
||||
if(vlc[2].table)
|
||||
res = get_vlc2(&gb, vlc[2].table, SMKTREE_BITS, 3);
|
||||
@@ -653,9 +659,9 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||
} else { //8-bit data
|
||||
for(i = stereo; i >= 0; i--)
|
||||
pred[i] = get_bits(&gb, 8);
|
||||
for(i = 0; i < stereo; i++)
|
||||
for(i = 0; i <= stereo; i++)
|
||||
*samples8++ = pred[i];
|
||||
for(i = 0; i < unp_size; i++) {
|
||||
for(; i < unp_size; i++) {
|
||||
if(i & stereo){
|
||||
if(vlc[1].table)
|
||||
res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
|
||||
|
@@ -221,7 +221,7 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
|
||||
for (limit = (16 >> intra); index < 16; index = limit, limit += 8) {
|
||||
for (; (vlc = svq3_get_ue_golomb(gb)) != 0; index++) {
|
||||
|
||||
if (vlc == INVALID_VLC)
|
||||
if (vlc < 0)
|
||||
return -1;
|
||||
|
||||
sign = (vlc & 0x1) - 1;
|
||||
@@ -239,7 +239,7 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
|
||||
level = ((vlc + 9) >> 2) - run;
|
||||
}
|
||||
} else {
|
||||
if (vlc < 16) {
|
||||
if (vlc < 16U) {
|
||||
run = svq3_dct_tables[intra][vlc].run;
|
||||
level = svq3_dct_tables[intra][vlc].level;
|
||||
} else if (intra) {
|
||||
@@ -569,7 +569,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
|
||||
for (i = 0; i < 16; i+=2) {
|
||||
vlc = svq3_get_ue_golomb(&s->gb);
|
||||
|
||||
if (vlc >= 25){
|
||||
if (vlc >= 25U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc);
|
||||
return -1;
|
||||
}
|
||||
@@ -641,7 +641,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
|
||||
}
|
||||
|
||||
if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == AV_PICTURE_TYPE_B)) {
|
||||
if ((vlc = svq3_get_ue_golomb(&s->gb)) >= 48){
|
||||
if ((vlc = svq3_get_ue_golomb(&s->gb)) >= 48U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
|
||||
return -1;
|
||||
}
|
||||
@@ -651,7 +651,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
|
||||
if (IS_INTRA16x16(mb_type) || (s->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) {
|
||||
s->qscale += svq3_get_se_golomb(&s->gb);
|
||||
|
||||
if (s->qscale > 31){
|
||||
if (s->qscale > 31U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "qscale:%d\n", s->qscale);
|
||||
return -1;
|
||||
}
|
||||
@@ -755,7 +755,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
|
||||
skip_bits_long(&s->gb, 0);
|
||||
}
|
||||
|
||||
if ((i = svq3_get_ue_golomb(&s->gb)) == INVALID_VLC || i >= 3){
|
||||
if ((i = svq3_get_ue_golomb(&s->gb)) >= 3U){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal slice type %d \n", i);
|
||||
return -1;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -226,7 +226,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
|
||||
if (avctx->extradata_size < 30)
|
||||
return -1;
|
||||
|
||||
init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size);
|
||||
init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size * 8);
|
||||
if (show_bits_long(&s->gb, 32) == AV_RL32("TTA1"))
|
||||
{
|
||||
/* signature */
|
||||
|
@@ -142,6 +142,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)
|
||||
@@ -1133,7 +1137,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);
|
||||
}
|
||||
|
||||
|
@@ -281,7 +281,8 @@ static int start_frame(AVCodecContext *avctx,
|
||||
if (!iq_matrix)
|
||||
return -1;
|
||||
memcpy(iq_matrix->ScalingList4x4, h->pps.scaling_matrix4, sizeof(iq_matrix->ScalingList4x4));
|
||||
memcpy(iq_matrix->ScalingList8x8, h->pps.scaling_matrix8, sizeof(iq_matrix->ScalingList8x8));
|
||||
memcpy(iq_matrix->ScalingList8x8[0], h->pps.scaling_matrix8[0], sizeof(iq_matrix->ScalingList8x8[0]));
|
||||
memcpy(iq_matrix->ScalingList8x8[1], h->pps.scaling_matrix8[3], sizeof(iq_matrix->ScalingList8x8[0]));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
/***********************************************************************/
|
||||
/**
|
||||
* @defgroup vc1bitplane VC-1 Bitplane decoding
|
||||
* @name VC-1 Bitplane decoding
|
||||
* @see 8.7, p56
|
||||
* @{
|
||||
*/
|
||||
@@ -485,8 +485,8 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
|
||||
if(ar && ar < 14){
|
||||
v->s.avctx->sample_aspect_ratio = ff_vc1_pixel_aspect[ar];
|
||||
}else if(ar == 15){
|
||||
w = get_bits(gb, 8);
|
||||
h = get_bits(gb, 8);
|
||||
w = get_bits(gb, 8) + 1;
|
||||
h = get_bits(gb, 8) + 1;
|
||||
v->s.avctx->sample_aspect_ratio = (AVRational){w, h};
|
||||
}
|
||||
av_log(v->s.avctx, AV_LOG_DEBUG, "Aspect: %i:%i\n", v->s.avctx->sample_aspect_ratio.num, v->s.avctx->sample_aspect_ratio.den);
|
||||
|
@@ -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
|
||||
* @{
|
||||
*/
|
||||
@@ -243,7 +243,7 @@ static void vc1_loop_filter_iblk(VC1Context *v, int pq)
|
||||
}
|
||||
v->vc1dsp.vc1_v_loop_filter16(s->dest[0] + 8*s->linesize, s->linesize, pq);
|
||||
|
||||
if (s->mb_y == s->mb_height-1) {
|
||||
if (s->mb_y == s->end_mb_y-1) {
|
||||
if (s->mb_x) {
|
||||
v->vc1dsp.vc1_h_loop_filter16(s->dest[0], s->linesize, pq);
|
||||
v->vc1dsp.vc1_h_loop_filter8(s->dest[1], s->uvlinesize, pq);
|
||||
@@ -295,7 +295,7 @@ static void vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
|
||||
v->vc1dsp.vc1_v_loop_filter16(s->dest[0] - 8 * s->linesize, s->linesize, pq);
|
||||
}
|
||||
|
||||
if (s->mb_y == s->mb_height) {
|
||||
if (s->mb_y == s->end_mb_y) {
|
||||
if (s->mb_x) {
|
||||
if (s->mb_x >= 2)
|
||||
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize - 16, s->linesize, pq);
|
||||
@@ -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
|
||||
* @{
|
||||
*/
|
||||
@@ -2330,7 +2330,7 @@ static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_
|
||||
} else {
|
||||
dst = s->dest[0] + (block_num & 1) * 8 + ((block_num & 2) * 4 - 8) * linesize;
|
||||
}
|
||||
if (s->mb_y != s->mb_height || block_num < 2) {
|
||||
if (s->mb_y != s->end_mb_y || block_num < 2) {
|
||||
int16_t (*mv)[2];
|
||||
int mv_stride;
|
||||
|
||||
@@ -3020,7 +3020,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
|
||||
s->mb_x = 0;
|
||||
ff_init_block_index(s);
|
||||
memset(&s->coded_block[s->block_index[0]-s->b8_stride], 0,
|
||||
s->b8_stride * sizeof(*s->coded_block));
|
||||
(1 + s->b8_stride) * sizeof(*s->coded_block));
|
||||
}
|
||||
for(; s->mb_y < s->end_mb_y; s->mb_y++) {
|
||||
s->mb_x = 0;
|
||||
@@ -3096,7 +3096,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
|
||||
if(v->s.loop_filter) vc1_loop_filter_iblk_delayed(v, v->pq);
|
||||
}
|
||||
if (v->s.loop_filter)
|
||||
ff_draw_horiz_band(s, (s->mb_height-1)*16, 16);
|
||||
ff_draw_horiz_band(s, (s->end_mb_y-1)*16, 16);
|
||||
ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, (AC_END|DC_END|MV_END));
|
||||
}
|
||||
|
||||
@@ -3219,7 +3219,7 @@ static void vc1_decode_b_blocks(VC1Context *v)
|
||||
s->first_slice_line = 0;
|
||||
}
|
||||
if (v->s.loop_filter)
|
||||
ff_draw_horiz_band(s, (s->mb_height-1)*16, 16);
|
||||
ff_draw_horiz_band(s, (s->end_mb_y-1)*16, 16);
|
||||
ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, (AC_END|DC_END|MV_END));
|
||||
}
|
||||
|
||||
@@ -3227,9 +3227,9 @@ static void vc1_decode_skip_blocks(VC1Context *v)
|
||||
{
|
||||
MpegEncContext *s = &v->s;
|
||||
|
||||
ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
|
||||
ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, (AC_END|DC_END|MV_END));
|
||||
s->first_slice_line = 1;
|
||||
for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
|
||||
for(s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) {
|
||||
s->mb_x = 0;
|
||||
ff_init_block_index(s);
|
||||
ff_update_block_index(s);
|
||||
|
@@ -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;
|
||||
|
@@ -2321,6 +2321,26 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
|
||||
return vp3_decode_init(avctx);
|
||||
}
|
||||
|
||||
static void vp3_decode_flush(AVCodecContext *avctx)
|
||||
{
|
||||
Vp3DecodeContext *s = avctx->priv_data;
|
||||
|
||||
if (s->golden_frame.data[0]) {
|
||||
if (s->golden_frame.data[0] == s->last_frame.data[0])
|
||||
memset(&s->last_frame, 0, sizeof(AVFrame));
|
||||
if (s->current_frame.data[0] == s->golden_frame.data[0])
|
||||
memset(&s->current_frame, 0, sizeof(AVFrame));
|
||||
ff_thread_release_buffer(avctx, &s->golden_frame);
|
||||
}
|
||||
if (s->last_frame.data[0]) {
|
||||
if (s->current_frame.data[0] == s->last_frame.data[0])
|
||||
memset(&s->current_frame, 0, sizeof(AVFrame));
|
||||
ff_thread_release_buffer(avctx, &s->last_frame);
|
||||
}
|
||||
if (s->current_frame.data[0])
|
||||
ff_thread_release_buffer(avctx, &s->current_frame);
|
||||
}
|
||||
|
||||
AVCodec ff_theora_decoder = {
|
||||
"theora",
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
@@ -2332,6 +2352,7 @@ AVCodec ff_theora_decoder = {
|
||||
vp3_decode_frame,
|
||||
CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
|
||||
NULL,
|
||||
.flush = vp3_decode_flush,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Theora"),
|
||||
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
|
||||
};
|
||||
@@ -2348,6 +2369,7 @@ AVCodec ff_vp3_decoder = {
|
||||
vp3_decode_frame,
|
||||
CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
|
||||
NULL,
|
||||
.flush = vp3_decode_flush,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("On2 VP3"),
|
||||
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
|
||||
};
|
||||
|
@@ -116,7 +116,7 @@ static void vp5_parse_vector_models(VP56Context *s)
|
||||
model->vector_pdv[comp][node] = vp56_rac_gets_nn(c, 7);
|
||||
}
|
||||
|
||||
static void vp5_parse_coeff_models(VP56Context *s)
|
||||
static int vp5_parse_coeff_models(VP56Context *s)
|
||||
{
|
||||
VP56RangeCoder *c = &s->c;
|
||||
VP56Model *model = s->modelp;
|
||||
@@ -160,6 +160,7 @@ static void vp5_parse_coeff_models(VP56Context *s)
|
||||
for (ctx=0; ctx<6; ctx++)
|
||||
for (node=0; node<5; node++)
|
||||
model->coeff_acct[pt][ct][cg][ctx][node] = av_clip(((model->coeff_ract[pt][ct][cg][node] * vp5_ract_lc[ct][cg][node][ctx][0] + 128) >> 8) + vp5_ract_lc[ct][cg][node][ctx][1], 1, 254);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vp5_parse_coeff(VP56Context *s)
|
||||
|
@@ -399,6 +399,8 @@ static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
|
||||
|
||||
frame_current = s->framep[VP56_FRAME_CURRENT];
|
||||
frame_ref = s->framep[ref_frame];
|
||||
if (mb_type != VP56_MB_INTRA && !frame_ref->data[0])
|
||||
return;
|
||||
|
||||
ab = 6*is_alpha;
|
||||
b_max = 6 - 2*is_alpha;
|
||||
@@ -511,6 +513,16 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||
if (!res)
|
||||
return -1;
|
||||
|
||||
if (res == 2) {
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (s->frames[i].data[0])
|
||||
avctx->release_buffer(avctx, &s->frames[i]);
|
||||
}
|
||||
if (is_alpha)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!is_alpha) {
|
||||
p->reference = 1;
|
||||
if (avctx->get_buffer(avctx, p) < 0) {
|
||||
@@ -537,7 +549,8 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||
s->mb_type = VP56_MB_INTER_NOVEC_PF;
|
||||
}
|
||||
|
||||
s->parse_coeff_models(s);
|
||||
if (s->parse_coeff_models(s))
|
||||
goto next;
|
||||
|
||||
memset(s->prev_dc, 0, sizeof(s->prev_dc));
|
||||
s->prev_dc[1][VP56_FRAME_CURRENT] = 128;
|
||||
@@ -601,6 +614,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||
}
|
||||
}
|
||||
|
||||
next:
|
||||
if (p->key_frame || golden_frame) {
|
||||
if (s->framep[VP56_FRAME_GOLDEN]->data[0] &&
|
||||
s->framep[VP56_FRAME_GOLDEN] != s->framep[VP56_FRAME_GOLDEN2])
|
||||
|
@@ -46,7 +46,7 @@ typedef void (*VP56Filter)(VP56Context *s, uint8_t *dst, uint8_t *src,
|
||||
typedef void (*VP56ParseCoeff)(VP56Context *s);
|
||||
typedef void (*VP56DefaultModelsInit)(VP56Context *s);
|
||||
typedef void (*VP56ParseVectorModels)(VP56Context *s);
|
||||
typedef void (*VP56ParseCoeffModels)(VP56Context *s);
|
||||
typedef int (*VP56ParseCoeffModels)(VP56Context *s);
|
||||
typedef int (*VP56ParseHeader)(VP56Context *s, const uint8_t *buf,
|
||||
int buf_size, int *golden_frame);
|
||||
|
||||
|
@@ -213,8 +213,8 @@ static int vp6_huff_cmp(const void *va, const void *vb)
|
||||
return (a->count - b->count)*16 + (b->sym - a->sym);
|
||||
}
|
||||
|
||||
static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],
|
||||
const uint8_t *map, unsigned size, VLC *vlc)
|
||||
static int vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],
|
||||
const uint8_t *map, unsigned size, VLC *vlc)
|
||||
{
|
||||
Node nodes[2*VP6_MAX_HUFF_SIZE], *tmp = &nodes[size];
|
||||
int a, b, i;
|
||||
@@ -229,12 +229,12 @@ static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],
|
||||
}
|
||||
|
||||
free_vlc(vlc);
|
||||
/* then build the huffman tree accodring to probabilities */
|
||||
ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,
|
||||
FF_HUFFMAN_FLAG_HNODE_FIRST);
|
||||
/* then build the huffman tree according to probabilities */
|
||||
return ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,
|
||||
FF_HUFFMAN_FLAG_HNODE_FIRST);
|
||||
}
|
||||
|
||||
static void vp6_parse_coeff_models(VP56Context *s)
|
||||
static int vp6_parse_coeff_models(VP56Context *s)
|
||||
{
|
||||
VP56RangeCoder *c = &s->c;
|
||||
VP56Model *model = s->modelp;
|
||||
@@ -279,15 +279,18 @@ static void vp6_parse_coeff_models(VP56Context *s)
|
||||
|
||||
if (s->use_huffman) {
|
||||
for (pt=0; pt<2; pt++) {
|
||||
vp6_build_huff_tree(s, model->coeff_dccv[pt],
|
||||
vp6_huff_coeff_map, 12, &s->dccv_vlc[pt]);
|
||||
vp6_build_huff_tree(s, model->coeff_runv[pt],
|
||||
vp6_huff_run_map, 9, &s->runv_vlc[pt]);
|
||||
if (vp6_build_huff_tree(s, model->coeff_dccv[pt],
|
||||
vp6_huff_coeff_map, 12, &s->dccv_vlc[pt]))
|
||||
return -1;
|
||||
if (vp6_build_huff_tree(s, model->coeff_runv[pt],
|
||||
vp6_huff_run_map, 9, &s->runv_vlc[pt]))
|
||||
return -1;
|
||||
for (ct=0; ct<3; ct++)
|
||||
for (cg = 0; cg < 6; cg++)
|
||||
vp6_build_huff_tree(s, model->coeff_ract[pt][ct][cg],
|
||||
vp6_huff_coeff_map, 12,
|
||||
&s->ract_vlc[pt][ct][cg]);
|
||||
if (vp6_build_huff_tree(s, model->coeff_ract[pt][ct][cg],
|
||||
vp6_huff_coeff_map, 12,
|
||||
&s->ract_vlc[pt][ct][cg]))
|
||||
return -1;
|
||||
}
|
||||
memset(s->nb_null, 0, sizeof(s->nb_null));
|
||||
} else {
|
||||
@@ -297,6 +300,7 @@ static void vp6_parse_coeff_models(VP56Context *s)
|
||||
for (node=0; node<5; node++)
|
||||
model->coeff_dcct[pt][ctx][node] = av_clip(((model->coeff_dccv[pt][node] * vp6_dccv_lc[ctx][node][0] + 128) >> 8) + vp6_dccv_lc[ctx][node][1], 1, 255);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vp6_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
|
||||
|
@@ -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,
|
||||
|
@@ -292,7 +292,14 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, int channel
|
||||
}
|
||||
}else{
|
||||
t = get_unary_0_33(gb);
|
||||
if(t >= 2) t = get_bits(gb, t - 1) | (1 << (t-1));
|
||||
if(t >= 2){
|
||||
if(get_bits_left(gb) < t-1)
|
||||
goto error;
|
||||
t = get_bits(gb, t - 1) | (1 << (t-1));
|
||||
}else{
|
||||
if(get_bits_left(gb) < 0)
|
||||
goto error;
|
||||
}
|
||||
ctx->zeroes = t;
|
||||
if(ctx->zeroes){
|
||||
memset(ctx->ch[0].median, 0, sizeof(ctx->ch[0].median));
|
||||
@@ -303,24 +310,24 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, int channel
|
||||
}
|
||||
}
|
||||
|
||||
if(get_bits_count(gb) >= ctx->data_size){
|
||||
*last = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(ctx->zero){
|
||||
t = 0;
|
||||
ctx->zero = 0;
|
||||
}else{
|
||||
t = get_unary_0_33(gb);
|
||||
if(get_bits_count(gb) >= ctx->data_size){
|
||||
*last = 1;
|
||||
return 0;
|
||||
}
|
||||
if(get_bits_left(gb) < 0)
|
||||
goto error;
|
||||
if(t == 16) {
|
||||
t2 = get_unary_0_33(gb);
|
||||
if(t2 < 2) t += t2;
|
||||
else t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
|
||||
if(t2 < 2){
|
||||
if(get_bits_left(gb) < 0)
|
||||
goto error;
|
||||
t += t2;
|
||||
}else{
|
||||
if(get_bits_left(gb) < t2 - 1)
|
||||
goto error;
|
||||
t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
|
||||
}
|
||||
}
|
||||
|
||||
if(ctx->one){
|
||||
@@ -360,9 +367,13 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, int channel
|
||||
}
|
||||
if(!c->error_limit){
|
||||
ret = base + get_tail(gb, add);
|
||||
if (get_bits_left(gb) <= 0)
|
||||
goto error;
|
||||
}else{
|
||||
int mid = (base*2 + add + 1) >> 1;
|
||||
while(add > c->error_limit){
|
||||
if(get_bits_left(gb) <= 0)
|
||||
goto error;
|
||||
if(get_bits1(gb)){
|
||||
add -= (mid - base);
|
||||
base = mid;
|
||||
@@ -376,6 +387,10 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, int channel
|
||||
if(ctx->hybrid_bitrate)
|
||||
c->slow_level += wp_log2(ret) - LEVEL_DECAY(c->slow_level);
|
||||
return sign ? ~ret : ret;
|
||||
|
||||
error:
|
||||
*last = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc, int S)
|
||||
@@ -385,7 +400,7 @@ static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc, in
|
||||
if(s->extra_bits){
|
||||
S <<= s->extra_bits;
|
||||
|
||||
if(s->got_extra_bits){
|
||||
if(s->got_extra_bits && get_bits_left(&s->gb_extra_bits) >= s->extra_bits){
|
||||
S |= get_bits(&s->gb_extra_bits, s->extra_bits);
|
||||
*crc = *crc * 9 + (S&0xffff) * 3 + ((unsigned)S>>16);
|
||||
}
|
||||
@@ -580,7 +595,10 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, vo
|
||||
count++;
|
||||
}while(!last && count < s->max_samples);
|
||||
|
||||
s->samples_left -= count;
|
||||
if (last)
|
||||
s->samples_left = 0;
|
||||
else
|
||||
s->samples_left -= count;
|
||||
if(!s->samples_left){
|
||||
if(crc != s->CRC){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");
|
||||
@@ -658,7 +676,10 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, void
|
||||
count++;
|
||||
}while(!last && count < s->max_samples);
|
||||
|
||||
s->samples_left -= count;
|
||||
if (last)
|
||||
s->samples_left = 0;
|
||||
else
|
||||
s->samples_left -= count;
|
||||
if(!s->samples_left){
|
||||
if(crc != s->CRC){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "CRC error\n");
|
||||
@@ -779,7 +800,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
|
||||
s->samples = AV_RL32(buf); buf += 4;
|
||||
if(!s->samples){
|
||||
*data_size = 0;
|
||||
return buf_size;
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
s->samples = wc->samples;
|
||||
@@ -841,12 +862,13 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
|
||||
}
|
||||
switch(id & WP_IDF_MASK){
|
||||
case WP_ID_DECTERMS:
|
||||
s->terms = size;
|
||||
if(s->terms > MAX_TERMS){
|
||||
if(size > MAX_TERMS){
|
||||
av_log(avctx, AV_LOG_ERROR, "Too many decorrelation terms\n");
|
||||
s->terms = 0;
|
||||
buf += ssize;
|
||||
continue;
|
||||
}
|
||||
s->terms = size;
|
||||
for(i = 0; i < s->terms; i++) {
|
||||
s->decorr[s->terms - i - 1].value = (*buf & 0x1F) - 5;
|
||||
s->decorr[s->terms - i - 1].delta = *buf >> 5;
|
||||
@@ -1098,6 +1120,10 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
|
||||
samplecount = wv_unpack_stereo(s, &s->gb, samples, AV_SAMPLE_FMT_S32);
|
||||
else
|
||||
samplecount = wv_unpack_stereo(s, &s->gb, samples, AV_SAMPLE_FMT_FLT);
|
||||
|
||||
if (samplecount < 0)
|
||||
return -1;
|
||||
|
||||
samplecount >>= 1;
|
||||
}else{
|
||||
const int channel_stride = avctx->channels;
|
||||
@@ -1109,6 +1135,9 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
|
||||
else
|
||||
samplecount = wv_unpack_mono(s, &s->gb, samples, AV_SAMPLE_FMT_FLT);
|
||||
|
||||
if (samplecount < 0)
|
||||
return -1;
|
||||
|
||||
if(s->stereo && avctx->sample_fmt == AV_SAMPLE_FMT_S16){
|
||||
int16_t *dst = (int16_t*)samples + 1;
|
||||
int16_t *src = (int16_t*)samples;
|
||||
|
@@ -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
|
||||
|
@@ -97,17 +97,21 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xan_huffman_decode(unsigned char *dest, const unsigned char *src,
|
||||
int dest_len)
|
||||
static int xan_huffman_decode(unsigned char *dest, int dest_len,
|
||||
const unsigned char *src, int src_len)
|
||||
{
|
||||
unsigned char byte = *src++;
|
||||
unsigned char ival = byte + 0x16;
|
||||
const unsigned char * ptr = src + byte*2;
|
||||
int ptr_len = src_len - 1 - byte*2;
|
||||
unsigned char val = ival;
|
||||
unsigned char *dest_end = dest + dest_len;
|
||||
GetBitContext gb;
|
||||
|
||||
init_get_bits(&gb, ptr, 0); // FIXME: no src size available
|
||||
if (ptr_len < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
init_get_bits(&gb, ptr, ptr_len * 8);
|
||||
|
||||
while ( val != 0x16 ) {
|
||||
val = src[val - 0x17 + get_bits1(&gb) * byte];
|
||||
@@ -246,7 +250,7 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s,
|
||||
}
|
||||
}
|
||||
|
||||
static void xan_wc3_decode_frame(XanContext *s) {
|
||||
static int xan_wc3_decode_frame(XanContext *s) {
|
||||
|
||||
int width = s->avctx->width;
|
||||
int height = s->avctx->height;
|
||||
@@ -266,13 +270,30 @@ static void xan_wc3_decode_frame(XanContext *s) {
|
||||
const unsigned char *size_segment;
|
||||
const unsigned char *vector_segment;
|
||||
const unsigned char *imagedata_segment;
|
||||
int huffman_offset, size_offset, vector_offset, imagedata_offset;
|
||||
|
||||
huffman_segment = s->buf + AV_RL16(&s->buf[0]);
|
||||
size_segment = s->buf + AV_RL16(&s->buf[2]);
|
||||
vector_segment = s->buf + AV_RL16(&s->buf[4]);
|
||||
imagedata_segment = s->buf + AV_RL16(&s->buf[6]);
|
||||
if (s->size < 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
xan_huffman_decode(opcode_buffer, huffman_segment, opcode_buffer_size);
|
||||
huffman_offset = AV_RL16(&s->buf[0]);
|
||||
size_offset = AV_RL16(&s->buf[2]);
|
||||
vector_offset = AV_RL16(&s->buf[4]);
|
||||
imagedata_offset = AV_RL16(&s->buf[6]);
|
||||
|
||||
if (huffman_offset >= s->size ||
|
||||
size_offset >= s->size ||
|
||||
vector_offset >= s->size ||
|
||||
imagedata_offset >= s->size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
huffman_segment = s->buf + huffman_offset;
|
||||
size_segment = s->buf + size_offset;
|
||||
vector_segment = s->buf + vector_offset;
|
||||
imagedata_segment = s->buf + imagedata_offset;
|
||||
|
||||
if (xan_huffman_decode(opcode_buffer, opcode_buffer_size,
|
||||
huffman_segment, s->size - huffman_offset) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (imagedata_segment[0] == 2)
|
||||
xan_unpack(s->buffer2, &imagedata_segment[1], s->buffer2_size);
|
||||
@@ -358,6 +379,7 @@ static void xan_wc3_decode_frame(XanContext *s) {
|
||||
y += (x + size) / width;
|
||||
x = (x + size) % width;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if RUNTIME_GAMMA
|
||||
@@ -519,7 +541,8 @@ static int xan_decode_frame(AVCodecContext *avctx,
|
||||
s->buf = buf;
|
||||
s->size = buf_size;
|
||||
|
||||
xan_wc3_decode_frame(s);
|
||||
if (xan_wc3_decode_frame(s) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* release the last frame if it is allocated */
|
||||
if (s->last_frame.data[0])
|
||||
@@ -564,4 +587,3 @@ AVCodec ff_xan_wc3_decoder = {
|
||||
CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"),
|
||||
};
|
||||
|
||||
|
@@ -245,6 +245,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
|
||||
}
|
||||
|
||||
snd_pcm_hw_params_get_buffer_size_max(hw_params, &buffer_size);
|
||||
buffer_size = FFMIN(buffer_size, ALSA_BUFFER_SIZE_MAX);
|
||||
/* TODO: maybe use ctx->max_picture_buffer somehow */
|
||||
res = snd_pcm_hw_params_set_buffer_size_near(h, hw_params, &buffer_size);
|
||||
if (res < 0) {
|
||||
@@ -254,6 +255,8 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
|
||||
}
|
||||
|
||||
snd_pcm_hw_params_get_period_size_min(hw_params, &period_size, NULL);
|
||||
if (!period_size)
|
||||
period_size = buffer_size / 4;
|
||||
res = snd_pcm_hw_params_set_period_size_near(h, hw_params, &period_size, NULL);
|
||||
if (res < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR, "cannot set ALSA period size (%s)\n",
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user