on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
-
+
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
- Nullsoft Video (NSV) file demuxer
- Shorten audio decoder
- LOCO video decoder
-- Apple Lossless Audio Codec (ALAC) decoder
+- Apple Lossless Audio Codec (ALAC) decoder
- Winnov WNV1 video decoder
- Autodesk Animator Studio Codec (AASC) decoder
- Indeo 2 video decoder
# General configuration options
#---------------------------------------------------------------------------
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = ffmpeg
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER =
+PROJECT_NUMBER =
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doxy
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
-# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
-# (Japanese with english messages), Korean, Norwegian, Polish, Portuguese,
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
+# (Japanese with english messages), Korean, Norwegian, Polish, Portuguese,
# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish and Ukrainian.
OUTPUT_LANGUAGE = English
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = YES
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = YES
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these class will be included in the various
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these class will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
# function's detailed documentation block.
HIDE_IN_BODY_DOCS = NO
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
-# members of a class in the documentation of that class as if those members were
-# ordinary class members. Constructors, destructors and assignment operators of
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
+# members of a class in the documentation of that class as if those members were
+# ordinary class members. Constructors, destructors and assignment operators of
# the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = YES
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
# the path. It is allowed to use relative paths in the argument list.
STRIP_FROM_PATH = .
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower case letters. If set to YES upper case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower case letters. If set to YES upper case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
CASE_SENSE_NAMES = YES
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put list of the files that are included by a file in the documentation
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like the Qt-style comments (thus requiring an
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
# explict @brief command for a brief description.
JAVADOC_AUTOBRIEF = YES
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# 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
+# 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
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
# reimplements.
INHERIT_DOCS = YES
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
# \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST= YES
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user defined paragraph with heading "Side Effects:".
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
-ALIASES =
+ALIASES =
-# The ENABLED_SECTIONS tag can be used to enable conditional
+# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
-ENABLED_SECTIONS =
+ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consist of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consist of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C.
-# For instance some of the names that are used will be different. The list
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = YES
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
-# only. Doxygen will then generate output that is more tailored for Java.
-# For instance namespaces will be presented as packages, qualified scopes
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
+# only. Doxygen will then generate output that is more tailored for Java.
+# For instance namespaces will be presented as packages, qualified scopes
# will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
+# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
# to stderr.
-WARN_LOGFILE =
+WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT =
+INPUT =
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_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 the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_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 the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
# *.h++ *.idl *.odl
-FILE_PATTERNS =
+FILE_PATTERNS =
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
-EXCLUDE =
+EXCLUDE =
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
# that are symbolic links (a Unix filesystem feature) are excluded from the input.
EXCLUDE_SYMLINKS = NO
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS =
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
# the \include command).
-EXAMPLE_PATH =
+EXAMPLE_PATH =
-# 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
+# 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 =
-# 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
-# commands irrespective of the value of the RECURSIVE tag.
+# 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
+# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
# the \image command).
-IMAGE_PATH =
+IMAGE_PATH =
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# 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
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# 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.
-INPUT_FILTER =
+INPUT_FILTER =
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
# configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
SOURCE_BROWSER = YES
-# Setting the INLINE_SOURCES tag to YES will include the body
+# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES (the default)
-# then for each documented function all documented
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = YES
-# If the REFERENCES_RELATION tag is set to YES (the default)
-# then for each documented function all documented entities
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = NO
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = YES
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
-IGNORE_PREFIX =
+IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
-HTML_HEADER =
+HTML_HEADER =
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
-HTML_FOOTER =
+HTML_FOOTER =
-# The HTML_STYLESHEET tag can be used to specify a user defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
-HTML_STYLESHEET =
+HTML_STYLESHEET =
-# 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
+# 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 compressed HTML help file (.chm)
+# 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 compressed 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
-# can add a path in front of the file if the result should not be
+# 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
+# can add a path in front of the file if the result should not be
# written to the html output dir.
-CHM_FILE =
+CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non empty doxygen will try to run
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non empty doxygen will try to run
# the html help compiler on the generated index.hhp.
-HHC_LOCATION =
+HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the Html help documentation and to the tree view.
TOC_EXPAND = NO
-# 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 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.
DISABLE_INDEX = NO
-# This tag can be used to set the number of enum values (range [1..20])
+# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# If the GENERATE_TREEVIEW tag 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 and frames is required (for instance Mozilla, Netscape 4.0+,
-# or Internet explorer 4.0+). Note that for large projects the tree generation
-# can take a very long time. In such cases it is better to disable this feature.
+# 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 and frames is required (for instance Mozilla, Netscape 4.0+,
+# or Internet explorer 4.0+). Note that for large projects the tree generation
+# can take a very long time. In such cases it is better to disable this feature.
# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = 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
+# 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
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = YES
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# 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.
LATEX_CMD_NAME = latex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
-EXTRA_PACKAGES =
+EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
-LATEX_HEADER =
+LATEX_HEADER =
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
# configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimised for Word 97 and may not look very pretty with
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assigments. You only have to provide
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
# replacements, missing definitions are set to their default value.
-RTF_STYLESHEET_FILE =
+RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
+# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
-RTF_EXTENSIONS_FILE =
+RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
+# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
# configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
# moment.
GENERATE_XML = NO
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
# syntax of the XML files.
-XML_SCHEMA =
+XML_SCHEMA =
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
# syntax of the XML files.
-XML_DTD =
+XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
# moment.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
# to generate PDF and DVI output from the Perl module output.
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
-# tag is set to NO the size of the Perl module output will be much smaller
+# 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
+# tag is set to NO the size of the Perl module output will be much smaller
# and Perl will parse it just the same.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
# Makefile don't overwrite each other's variables.
-PERLMOD_MAKEVAR_PREFIX =
+PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
+# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = YES
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
EXPAND_ONLY_PREDEF = YES
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
# the preprocessor.
-INCLUDE_PATH =
+INCLUDE_PATH =
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
-INCLUDE_FILE_PATTERNS =
+INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED = __attribute__(x)="" "RENAME(x)=x ## _TMPL" "DEF(x)=x ## _TMPL" \
HAVE_BUILTIN_VECTOR HAVE_AV_CONFIG_H HAVE_MMX HAVE_MMX2 HAVE_3DNOW \
ATTR_ALIGN(x)=""
-# 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.
+# 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)
-# 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
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse the
+# 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
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse the
# parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
+# Configuration::addtions related to external references
#---------------------------------------------------------------------------
# The TAGFILES tag can be used to specify one or more tagfiles.
-TAGFILES =
+TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
-GENERATE_TAGFILE =
+GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
-# The PERL_PATH should be the absolute path and name of the perl script
+# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
+# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
-# super classes. Setting the tag to NO turns the diagrams off. Note that this
-# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off. Note that this
+# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
# recommended to install and use dot, since it yield more powerful graphs.
CLASS_DIAGRAMS = YES
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
-# If set to YES, the inheritance and collaboration graphs will show the
+# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used.
DOT_IMAGE_FORMAT = png
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found on the path.
-DOT_PATH =
+DOT_PATH =
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
# \dotfile command).
-DOTFILE_DIRS =
+DOTFILE_DIRS =
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_WIDTH = 1024
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermedate dot files that are used to generate
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermedate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
+# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
-# The SEARCHENGINE tag specifies whether or not a search engine should be
+# 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
-# The CGI_NAME tag should be the name of the CGI script that
-# starts the search engine (doxysearch) with the correct parameters.
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
# A script with this name will be generated by doxygen.
CGI_NAME = search.cgi
-# The CGI_URL tag should be the absolute URL to the directory where the
-# cgi binaries are located. See the documentation of your http daemon for
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
# details.
-CGI_URL =
+CGI_URL =
-# The DOC_URL tag should be the absolute URL to the directory where the
-# documentation is located. If left blank the absolute path to the
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
# documentation, with file:// prepended to it, will be used.
-DOC_URL =
+DOC_URL =
-# The DOC_ABSPATH tag should be the absolute path to the directory where the
-# documentation is located. If left blank the directory on the local machine
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
# will be used.
-DOC_ABSPATH =
+DOC_ABSPATH =
-# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
# is installed.
BIN_ABSPATH = /usr/local/bin/
-# The EXT_DOC_PATHS tag can be used to specify one or more paths to
-# documentation generated for other projects. This allows doxysearch to search
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
# the documentation for these projects as well.
-EXT_DOC_PATHS =
+EXT_DOC_PATHS =
1) Type './configure' create the configuration (use './configure
---help' to have the configure options).
+--help' to have the configure options).
'configure' can be launched from another directory than the ffmpeg
sources to put the objects at that place. In that case, use an
VPATH=$(SRC_PATH)
CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavutil -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-LDFLAGS+= -g
+LDFLAGS+= -g
ifeq ($(TARGET_GPROF),yes)
CFLAGS+=-p
$(STRIP) $@
ffserver$(EXESUF): ffserver.o .libs
- $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
+ $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
$(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
$(CC) $(SRC_PATH)/cws2fws.c -o cws2fws$(EXESUF) -lz
ffplay.o: ffplay.c
- $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
%.o: %.c
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
videohook: .libs
$(MAKE) -C vhook all
* Read the file COPYING. ffmpeg and the associated libraries EXCEPT
liba52 and libpostproc are licensed under the Lesser GNU General
- Public License.
+ Public License.
* liba52 and libpostproc are distributed under the GNU General Public
License and their compilation and use is optional in ffmpeg.
#ifdef ENOENT
#undef ENOENT
-#endif
+#endif
#define ENOENT 2
#ifdef EINTR
#undef EINTR
-#endif
+#endif
#define EINTR 4
#ifdef EIO
#undef EIO
-#endif
+#endif
#define EIO 5
#ifdef EAGAIN
#undef EAGAIN
-#endif
+#endif
#define EAGAIN 11
#ifdef ENOMEM
#undef ENOMEM
-#endif
+#endif
#define ENOMEM 12
#ifdef EINVAL
#undef EINVAL
-#endif
+#endif
#define EINVAL 22
#ifdef EPIPE
#undef EPIPE
-#endif
+#endif
#define EPIPE 32
#endif /* BERRNO_H */
sed 's/TYPE_AVRATIONAL/TYPE_RATIONAL/g'|\
sed 's/FLOAT_M/FLT_M/g'|\
sed 's/FF_OPT_TYPE_CHAR/FF_OPT_TYPE_STRING/g'
-
\ No newline at end of file
optindex = 1;
while (optindex < argc) {
opt = argv[optindex++];
-
+
if (opt[0] == '-' && opt[1] != '\0') {
po= find_option(options, opt + 1);
if (!po->name)
fprintf(stderr, "%s: Incorrect image filename syntax.\n"
"Use '%%d' to specify the image number:\n"
" for img1.jpg, img2.jpg, ..., use 'img%%d.jpg';\n"
- " for img001.jpg, img002.jpg, ..., use 'img%%03d.jpg'.\n",
+ " for img001.jpg, img002.jpg, ..., use 'img%%03d.jpg'.\n",
filename);
break;
case AVERROR_INVALIDDATA:
--enable-amr_nb-fixed) amr_nb_fixed="yes"
;;
--enable-amr_wb) amr_wb="yes"
- ;;
+ ;;
--enable-amr_if2) amr_if2="yes"
;;
--enable-sunmlib) sunmlib="yes"
echo "libdts is under GPL and --enable-gpl is not specified."
fail="yes"
fi
-
+
if test "$faad" != "no" -o "$faadbin" != "no"; then
cat > $TMPC << EOF
#include <faad.h>
int main( void ) { return 0; }
EOF
-
+
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
cat > $TMPC << EOF
#include <faad.h>
echo "FAAD test failed."
fi
fi
-
+
if test "$fail" = "yes"; then
exit 1
# check iwmmxt support
if test $iwmmxt = "default" -a $cpu = "armv4l"; then
cat > $TMPC << EOF
- int main(void) {
+ int main(void) {
__asm__ __volatile__ ("wunpckelub wr6, wr4");
}
EOF
else
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
case "$gcc_version" in
- *2.95*)
+ *2.95*)
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
;;
*[34].*)
esac
fi
-# AltiVec flags: The FSF version of GCC differs from the Apple version
+# AltiVec flags: The FSF version of GCC differs from the Apple version
if test $cpu = "powerpc"; then
if test $altivec = "yes"; then
if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
# currently only used on i386 for MMX builtins
cat > $TMPC << EOF
#include <xmmintrin.h>
-int main(void) {
+int main(void) {
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
return 0;
#else
Name: libavutil
Description: FFmpeg utility library
Version: $lavu_version
-Requires:
+Requires:
Conflicts:
Libs: -L\${libdir} -lavutil
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
Name: libavutil
Description: FFmpeg utility library
Version: $lavu_version
-Requires:
+Requires:
Conflicts:
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
Cflags: -I\${includedir}
Name: libpostproc
Description: FFmpeg post processing library
Version: $lavc_version
-Requires:
+Requires:
Conflicts:
Libs: -L\${libdir} -lpostproc
Cflags: -I\${includedir} -I\${includedir}/postproc
Name: libpostproc
Description: FFmpeg post processing library
Version: $lavc_version
-Requires:
+Requires:
Conflicts:
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
Cflags: -I\${includedir}
printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
exit(1);
}
-
+
fd_in = open(argv[1], O_RDONLY);
if (fd_in < 0)
{
close(fd_in);
exit(1);
}
-
+
if (read(fd_in, &buf_in, 8) != 8)
{
printf("Header error\n");
close(fd_out);
exit(1);
}
-
+
if (buf_in[0] != 'C' || buf_in[1] != 'W' || buf_in[2] != 'S')
{
printf("Not a compressed flash file\n");
fstat(fd_in, &statbuf);
comp_len = statbuf.st_size;
uncomp_len = buf_in[4] | (buf_in[5] << 8) | (buf_in[6] << 16) | (buf_in[7] << 24);
-
+
printf("Compressed size: %d Uncompressed size: %d\n", comp_len-4, uncomp_len-4);
// write out modified header
zstream.zfree = NULL;
zstream.opaque = NULL;
inflateInit(&zstream);
-
+
for (i = 0; i < comp_len-4;)
{
int ret, len = read(fd_in, &buf_in, 1024);
dbgprintf("read %d bytes\n", len);
-
+
last_out = zstream.total_out;
-
+
zstream.next_in = &buf_in[0];
zstream.avail_in = len;
zstream.next_out = &buf_out[0];
zstream.avail_out = 1024;
-
+
ret = inflate(&zstream, Z_SYNC_FLUSH);
if (ret == Z_STREAM_END || ret == Z_BUF_ERROR)
break;
inflateEnd(&zstream);
exit(1);
}
-
+
dbgprintf("a_in: %d t_in: %d a_out: %d t_out: %d -- %d out\n",
zstream.avail_in, zstream.total_in, zstream.avail_out, zstream.total_out,
zstream.total_out-last_out);
-
+
write(fd_out, &buf_out, zstream.total_out-last_out);
i += len;
}
-
+
if (zstream.total_out != uncomp_len-8)
{
printf("Size mismatch (%d != %d), updating header...\n",
buf_in[1] = (zstream.total_out+8 >> 8) & 0xff;
buf_in[2] = (zstream.total_out+8 >> 16) & 0xff;
buf_in[3] = (zstream.total_out+8 >> 24) & 0xff;
-
+
lseek(fd_out, 4, SEEK_SET);
write(fd_out, &buf_in, 4);
}
-
+
inflateEnd(&zstream);
close(fd_in);
close(fd_out);
-------------------
Short term:
-- av_read_frame() API
+- av_read_frame() API
- seeking API and example in ffplay
- parse_only mode
- use AVFMTCTX_DISCARD_PKT in ffplay so that DV has a chance to work
- add RTSP regression test (both client and server)
- make ffserver allocate AVFormatContext
-- clean up (incompatible change, for 0.5.0):
+- clean up (incompatible change, for 0.5.0):
* AVStream -> AVComponent
* AVFormatContext -> AVInputStream/AVOutputStream
* suppress rate_emu from AVCodecContext
Philip'a TODO list: (alphabetically ordered) (please help)
------------------
- Add a multi-ffm filetype so that feeds can be recorded into multiple files rather
- than one big file.
+ than one big file.
- Authenticated users support -- where the authentication is in the URL
- Change ASF files so that the embedded timestamp in the frames is right rather
than being an offset from the start of the stream
@section Why does ffmpeg not decode audio in VOB files ?
The audio is AC3 (a.k.a. A/52). AC3 decoding is an optional component in ffmpeg
-as the component that handles AC3 decoding (liba52) is currently released under
+as the component that handles AC3 decoding (liba52) is currently released under
the GPL. If you have liba52 installed on your system, enable AC3 decoding
with @code{./configure --enable-a52}. Take care: by
enabling AC3, you automatically change the license of libavcodec from
@section Which codecs are supported by Windows ?
-Windows does not support standard formats like MPEG very well, unless you
+Windows does not support standard formats like MPEG very well, unless you
install some additional codecs
The following list of video codecs should work on most Windows systems:
@item mpeg1
.mpg only
@end table
-Note, ASF files often have .wmv or .wma extensions in Windows. It should also
-be mentioned that Microsoft claims a patent on the ASF format, and may sue
+Note, ASF files often have .wmv or .wma extensions in Windows. It should also
+be mentioned that Microsoft claims a patent on the ASF format, and may sue
or threaten users who create ASF files with non-Microsoft software. It is
strongly advised to avoid ASF where possible.
@section Why does the chrominance data seem to be sampled at a different time from the luminance data on bt8x8 captures on Linux?
-This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at
+This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at
(@url{http://www.mplayerhq.hu/~michael/bttv-420-2.4.26.patch}). This may also
apply cleanly to other 2.4-series kernels.
standard (note that there are many other coding formats that use this
same standard). Thus, use '-vcodec mpeg4' to encode these formats. The
default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
-a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
-force the fourcc 'xvid' to be stored as the video fourcc rather than the
+a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
+force the fourcc 'xvid' to be stored as the video fourcc rather than the
default.
@chapter Development
@section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat ?
Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively,
-examine the source code for one of the many open source projects that
+examine the source code for one of the many open source projects that
already incorporate ffmpeg at (@url{projects.php}).
@section Can you support my C compiler XXX ?
@section Why not rewrite ffmpeg in object-oriented C++ ?
ffmpeg is already organized in a highly modular manner and does not need to
-be rewritten in a formal object language. Further, many of the developers
+be rewritten in a formal object language. Further, many of the developers
favor straight C; it works for them. For more arguments on this matter,
read "Programming Religion" at (@url{http://lkml.org/faq/lkmlfaq-15.html}).
FFmpeg is a very fast video and audio converter. It can also grab from
a live audio/video source.
-
+
The command line interface is designed to be intuitive, in the sense
that FFmpeg tries to figure out all parameters that can possibly be
derived automatically. You usually only have to specify the target
System audio source:
@example
-ffmpeg /tmp/out.mpg
+ffmpeg /tmp/out.mpg
@end example
Note that you must activate the right video source and channel before
* You can use YUV files as input:
@example
-ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
+ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
@end example
-It will use the files:
+It will use the files:
@example
/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
The generic syntax is:
-@example
+@example
@c man begin SYNOPSIS
ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
@c man end
@item -formats
Show available formats, codecs, protocols, ...
-@item -f fmt
+@item -f fmt
Force format.
-@item -i filename
+@item -i filename
input filename
-@item -y
+@item -y
Overwrite output files.
-@item -t duration
+@item -t duration
Set the recording time in seconds.
@code{hh:mm:ss[.xxx]} syntax is also supported.
Seek to given time position in seconds.
@code{hh:mm:ss[.xxx]} syntax is also supported.
-@item -title string
+@item -title string
Set the title.
-@item -author string
+@item -author string
Set the author.
-@item -copyright string
+@item -copyright string
Set the copyright.
-@item -comment string
+@item -comment string
Set the comment.
@item -target type
@table @option
@item -b bitrate
Set the video bitrate in kbit/s (default = 200 kb/s).
-@item -r fps
+@item -r fps
Set frame rate (default = 25).
-@item -s size
+@item -s size
Set frame size. The format is @samp{wxh} (default = 160x128).
The following abbreviations are recognized:
@table @samp
blue (default = 000000 (black)).
@item -vn
Disable video recording.
-@item -bt tolerance
+@item -bt tolerance
Set video bitrate tolerance (in kbit/s).
@item -maxrate bitrate
Set max video bitrate tolerance (in kbit/s).
Set min video bitrate tolerance (in kbit/s).
@item -bufsize size
Set rate control buffer size (in kbit).
-@item -vcodec codec
+@item -vcodec codec
Force video codec to @var{codec}. Use the @code{copy} special value to
tell that the raw codec data must be copied as is.
@item -sameq
Use same video quality as source (implies VBR).
-@item -pass n
+@item -pass n
Select the pass number (1 or 2). It is useful to do two pass
encoding. The statistics of the video are recorded in the first
pass and the video is generated at the exact requested bitrate
in the second pass.
-@item -passlogfile file
+@item -passlogfile file
Set two pass logfile name to @var{file}.
@end table
@section Advanced Video Options
@table @option
-@item -g gop_size
+@item -g gop_size
Set the group of pictures size.
-@item -intra
+@item -intra
Use only intra frames.
-@item -qscale q
+@item -qscale q
Use fixed video quantiser scale (VBR).
-@item -qmin q
+@item -qmin q
minimum video quantiser scale (VBR)
-@item -qmax q
+@item -qmax q
maximum video quantiser scale (VBR)
-@item -qdiff q
+@item -qdiff q
maximum difference between the quantiser scales (VBR)
-@item -qblur blur
+@item -qblur blur
video quantiser scale blur (VBR)
-@item -qcomp compression
+@item -qcomp compression
video quantiser scale compression (VBR)
@item -rc_init_cplx complexity
@item 0
FF_IDCT_AUTO (default)
@item 1
-FF_IDCT_INT
+FF_IDCT_INT
@item 2
-FF_IDCT_SIMPLE
+FF_IDCT_SIMPLE
@item 3
-FF_IDCT_SIMPLEMMX
+FF_IDCT_SIMPLEMMX
@item 4
-FF_IDCT_LIBMPEG2MMX
+FF_IDCT_LIBMPEG2MMX
@item 5
-FF_IDCT_PS2
+FF_IDCT_PS2
@item 6
-FF_IDCT_MLIB
+FF_IDCT_MLIB
@item 7
-FF_IDCT_ARM
+FF_IDCT_ARM
@item 8
-FF_IDCT_ALTIVEC
+FF_IDCT_ALTIVEC
@item 9
-FF_IDCT_SH4
+FF_IDCT_SH4
@item 10
-FF_IDCT_SIMPLEARM
+FF_IDCT_SIMPLEARM
@end table
@item -er n
Set error resilience to @var{n}.
@table @samp
-@item 1
+@item 1
FF_ER_CAREFUL (default)
@item 2
FF_ER_COMPLIANT
@section Audio Options
@table @option
-@item -ar freq
+@item -ar freq
Set the audio sampling frequency (default = 44100 Hz).
-@item -ab bitrate
+@item -ab bitrate
Set the audio bitrate in kbit/s (default = 64).
@item -ac channels
Set the number of audio channels (default = 1).
@section Advanced options
@table @option
-@item -map file:stream
+@item -map file:stream
Set input stream mapping.
@item -debug
Print specific debug info.
-@item -benchmark
+@item -benchmark
Add timings for benchmarking.
-@item -hex
+@item -hex
Dump each input packet.
@item -bitexact
Only use bit exact algorithms (for codec testing).
@section FFmpeg formula evaluator
When evaluating a rate control string, FFmpeg uses an internal formula
-evaluator.
+evaluator.
The following binary operators are available: @code{+}, @code{-},
@code{*}, @code{/}, @code{^}.
@tab also known as @code{VOB} file
@item MPEG-2 TS @tab @tab X
@tab also known as DVB Transport Stream
-@item ASF@tab X @tab X
-@item AVI@tab X @tab X
-@item WAV@tab X @tab X
+@item ASF@tab X @tab X
+@item AVI@tab X @tab X
+@item WAV@tab X @tab X
@item Macromedia Flash@tab X @tab X
@tab Only embedded audio is decoded.
@item FLV @tab X @tab X
@tab Macromedia Flash video files
-@item Real Audio and Video @tab X @tab X
-@item Raw AC3 @tab X @tab X
-@item Raw MJPEG @tab X @tab X
-@item Raw MPEG video @tab X @tab X
-@item Raw PCM8/16 bits, mulaw/Alaw@tab X @tab X
-@item Raw CRI ADX audio @tab X @tab X
-@item Raw Shorten audio @tab @tab X
-@item SUN AU format @tab X @tab X
+@item Real Audio and Video @tab X @tab X
+@item Raw AC3 @tab X @tab X
+@item Raw MJPEG @tab X @tab X
+@item Raw MPEG video @tab X @tab X
+@item Raw PCM8/16 bits, mulaw/Alaw@tab X @tab X
+@item Raw CRI ADX audio @tab X @tab X
+@item Raw Shorten audio @tab @tab X
+@item SUN AU format @tab X @tab X
@item NUT @tab X @tab X @tab NUT Open Container Format
-@item QuickTime @tab X @tab X
+@item QuickTime @tab X @tab X
@item MPEG-4 @tab X @tab X
@tab MPEG-4 is a variant of QuickTime.
-@item Raw MPEG4 video @tab X @tab X
+@item Raw MPEG4 video @tab X @tab X
@item DV @tab X @tab X
@item 4xm @tab @tab X
@tab 4X Technologies format, used in some games.
@multitable @columnfractions .4 .1 .1 .4
@item Supported Image Format @tab Encoding @tab Decoding @tab Comments
-@item PGM, PPM @tab X @tab X
+@item PGM, PPM @tab X @tab X
@item PAM @tab X @tab X @tab PAM is a PNM extension with alpha support.
@item PGMYUV @tab X @tab X @tab PGM with U and V components in YUV 4:2:0
@item JPEG @tab X @tab X @tab Progressive JPEG is not supported.
@item H.261 @tab X @tab X
@item H.263(+) @tab X @tab X @tab also known as RealVideo 1.0
@item H.264 @tab @tab X
-@item MJPEG @tab X @tab X
+@item MJPEG @tab X @tab X
@item lossless MJPEG @tab X @tab X
@item Apple MJPEG-B @tab @tab X
@item Sunplus MJPEG @tab @tab X @tab fourcc: SP5X
-@item DV @tab X @tab X
+@item DV @tab X @tab X
@item HuffYUV @tab X @tab X
@item FFmpeg Video 1 @tab X @tab X @tab experimental lossless codec (fourcc: FFV1)
@item FFmpeg Snow @tab X @tab X @tab experimental wavelet codec (fourcc: SNOW)
@item ATI VCR2 @tab @tab X @tab fourcc: VCR2
@item Cirrus Logic AccuPak @tab @tab X @tab fourcc: CLJR
@item 4X Video @tab @tab X @tab Used in certain computer games.
-@item Sony Playstation MDEC @tab @tab X
+@item Sony Playstation MDEC @tab @tab X
@item Id RoQ @tab @tab X @tab Used in Quake III, Jedi Knight 2, other computer games.
@item Xan/WC3 @tab @tab X @tab Used in Wing Commander III .MVE files.
@item Interplay Video @tab @tab X @tab Used in Interplay .MVE files.
@item IBM Ultimotion @tab @tab X @tab fourcc: ULTI
@item Miro VideoXL @tab @tab X @tab fourcc: VIXL
@item QPEG @tab @tab X @tab fourccs: QPEG, Q1.0, Q1.1
-@item LOCO @tab @tab X @tab
-@item Winnov WNV1 @tab @tab X @tab
+@item LOCO @tab @tab X @tab
+@item Winnov WNV1 @tab @tab X @tab
@item Autodesk Animator Studio Codec @tab @tab X @tab fourcc: AASC
-@item Fraps FPS1 @tab @tab X @tab
+@item Fraps FPS1 @tab @tab X @tab
@end multitable
@code{X} means that encoding (resp. decoding) is supported.
@multitable @columnfractions .4 .1 .1 .1 .7
@item Supported Codec @tab Encoding @tab Decoding @tab Comments
-@item MPEG audio layer 2 @tab IX @tab IX
+@item MPEG audio layer 2 @tab IX @tab IX
@item MPEG audio layer 1/3 @tab IX @tab IX
@tab MP3 encoding is supported through the external library LAME.
@item AC3 @tab IX @tab IX
correct SDL directory when invoked.
@item Extract the current version of FFmpeg.
-
+
@item Start the MSYS shell (file @file{msys.bat}).
@item Change to the FFmpeg directory and follow
@end itemize
-Notes:
+Notes:
@itemize
@item The target @file{make wininstaller} can be used to create a
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
you can build @file{avcodec.dll} and @file{avformat.dll}. With
@code{make install} you install the FFmpeg DLLs and the associated
-headers in @file{Program Files/FFmpeg}.
+headers in @file{Program Files/FFmpeg}.
@item Visual C++ compatibility: If you used @code{./configure --enable-shared}
when configuring FFmpeg, FFmpeg tries to use the Microsoft Visual
François Revol - revol at free dot fr - April 2002
-The configure script should guess the configuration itself,
+The configure script should guess the configuration itself,
however I still didn't test building on the net_server version of BeOS.
FFserver is broken (needs poll() implementation).
There are still issues with errno codes, which are negative in BeOS, and
-that FFmpeg negates when returning. This ends up turning errors into
+that FFmpeg negates when returning. This ends up turning errors into
valid results, then crashes.
(To be fixed)
...
@end example
-fprintf and printf are forbidden in libavformat and libavcodec,
+fprintf and printf are forbidden in libavformat and libavcodec,
please use av_log() instead.
@node CVS Policy
@section CVS Policy
@enumerate
-@item
+@item
You must not commit code which breaks FFmpeg! (Meaning unfinished but
enabled code which breaks compilation or compiles but does not work or
breaks the regression tests)
You can commit unfinished stuff (for testing etc), but it must be disabled
(#ifdef etc) by default so it does not interfere with other developers'
work.
-@item
+@item
You don't have to over-test things. If it works for you, and you think it
should work for others, then commit. If your code has problems
(portability, triggers compiler bugs, unusual environment etc) they will be
reported and eventually fixed.
-@item
+@item
Do not commit unrelated changes together, split them into self-contained
pieces.
@item
Do not change behavior of the program (renaming options etc) without
first discussing it on the ffmpeg-devel mailing list. Do not remove
functionality from the code. Just improve!
-
+
Note: Redundant code can be removed.
@item
Do not commit changes to the build system (Makefiles, configure script)
changes.
NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
- then either do NOT change the indentation of the inner part within (don't
+ then either do NOT change the indentation of the inner part within (don't
move it to the right)! or do so in a separate commit
@item
Always fill out the commit log message. Describe in a few lines what you
option). I cannot read other diffs :-)
Also please do not submit patches which contain several unrelated changes.
-Split them into individual self-contained patches; this makes reviewing
+Split them into individual self-contained patches; this makes reviewing
them much easier.
Run the regression tests before submitting a patch so that you can
Patches should be posted as base64 encoded attachments (or any other
encoding which ensures that the patch won't be trashed during
-transmission) to the ffmpeg-devel mailing list, see
+transmission) to the ffmpeg-devel mailing list, see
@url{http://www1.mplayerhq.hu/mailman/listinfo/ffmpeg-devel}
It also helps quite a bit if you tell us what the patch does (for example
I don't know how to do it, sorry :-) Any idea very much welcome.
---
+--
Romain Dolbeau
<romain@dolbeau.org>
@chapter Invocation
@section Syntax
-@example
+@example
@c man begin SYNOPSIS
ffplay [options] @file{input_file}
@c man end
@end example
At this point you should be able to go to your Windows machine and fire up
-Windows Media Player (WMP). Go to Open URL and enter
+Windows Media Player (WMP). Go to Open URL and enter
@example
http://<linuxbox>:8090/test.asf
@end example
-You should (after a short delay) see video and hear audio.
+You should (after a short delay) see video and hear audio.
WARNING: trying to stream test1.mpg doesn't work with WMP as it tries to
transfer the entire file before starting to play.
@section What happens next?
-You should edit the ffserver.conf file to suit your needs (in terms of
+You should edit the ffserver.conf file to suit your needs (in terms of
frame rates etc). Then install ffserver and ffmpeg, write a script to start
them up, and off you go.
Maybe you didn't install LAME, or got your ./configure statement wrong. Check
the ffmpeg output to see if a line referring to MP3 is present. If not, then
your configuration was incorrect. If it is, then maybe your wiring is not
-set up correctly. Maybe the sound card is not getting data from the right
+set up correctly. Maybe the sound card is not getting data from the right
input source. Maybe you have a really awful audio interface (like I do)
-that only captures in stereo and also requires that one channel be flipped.
-If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
+that only captures in stereo and also requires that one channel be flipped.
+If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
starting ffmpeg.
@subsection The audio and video loose sync after a while.
@section What else can it do?
You can replay video from .ffm files that was recorded earlier.
-However, there are a number of caveats, including the fact that the
+However, there are a number of caveats, including the fact that the
ffserver parameters must match the original parameters used to record the
file. If they do not, then ffserver deletes the file before recording into it.
(Now that I write this, it seems broken).
or RM file. The reason for this is that the browser often fetches the
entire file before starting up the external viewer. The redirection files
are very small and can be transferred quickly. [The stream itself is
-often 'infinite' and thus the browser tries to download it and never
+often 'infinite' and thus the browser tries to download it and never
finishes.]
@section Tips
in realtime. This means that there is a pause of a few seconds while the
buffering is being done by the player. The good news is that this can be
cured by adding a '?buffer=5' to the end of the URL. This means that the
-stream should start 5 seconds in the past -- and so the first 5 seconds
+stream should start 5 seconds in the past -- and so the first 5 seconds
of the stream are sent as fast as the network will allow. It will then
slow down to real time. This noticeably improves the startup experience.
This means that if you say 'Preroll 10', then when the stream gets 10
or more seconds behind, there is no Preroll left.
-Fixing this requires a change in the internals of how timestamps are
+Fixing this requires a change in the internals of how timestamps are
handled.
@section Does the @code{?date=} stuff work.
Yes (subject to the limitation outlined above). Also note that whenever you
start ffserver, it deletes the ffm file (if any parameters have changed),
-thus wiping out what you had recorded before.
+thus wiping out what you had recorded before.
The format of the @code{?date=xxxxxx} is fairly flexible. You should use one
of the following formats (the 'T' is literal):
* YYYY-MM-DDTHH:MM:SSZ (UTC)
@end example
-You can omit the YYYY-MM-DD, and then it refers to the current day. However
+You can omit the YYYY-MM-DD, and then it refers to the current day. However
note that @samp{?date=16:00:00} refers to 16:00 on the current day -- this
may be in the future and so is unlikely to be useful.
@chapter Invocation
@section Syntax
-@example
+@example
@c man begin SYNOPSIS
ffserver [options]
@c man end
# You must use 'ffmpeg' to send a live feed to ffserver. In this
# example, you can type:
-#
+#
# ffmpeg http://localhost:8090/feed1.ffm
# ffserver can also do time shifting. It means that it can stream any
Format mpeg
# Bitrate for the audio stream. Codecs usually support only a few
-# different bitrates.
+# different bitrates.
AudioBitRate 32
# Number of audio channels: 1 = mono, 2 = stereo
# VideoHighQuality
# Video4MotionVector
-# Choose your codecs:
+# Choose your codecs:
#AudioCodec mp2
#VideoCodec mpeg1video
# stream basis. The first match defines the action. If there are no matches,
# then the default is the inverse of the last ACL statement.
#
-# Thus 'ACL allow localhost' only allows access from localhost.
+# Thus 'ACL allow localhost' only allows access from localhost.
# 'ACL deny 1.0.0.0 1.255.255.255' would deny the whole of network 1 and
# allow everybody else.
#<Stream test.jpg>
#Feed feed1.ffm
#Format jpeg
-#VideoFrameRate 2
+#VideoFrameRate 2
#VideoIntraOnly
##VideoSize 352x240
#NoAudio
</Stream>
-# MP3 audio
+# MP3 audio
#<Stream test.mp3>
#Feed feed1.ffm
# 'sdp' extension to the stream name (here
# http://localhost:8090/test1-sdp.sdp). You should usually give this
# file to your player to play the stream.
-#
+#
# The 'NoLoop' option can be used to avoid looping when the stream is
# terminated.
order that they were specified on the ffmpeg command line.
Three modules are provided and are described below. They are all intended to
-be used as a base for your own modules.
+be used as a base for your own modules.
Modules are loaded using the -vhook option to ffmpeg. The value of this parameter
is a space separated list of arguments. The first is the module name, and the rest
$inf = gensym();
# Try cwd and $ibase.
- open($inf, "<" . $1)
+ open($inf, "<" . $1)
or open($inf, "<" . $ibase . "/" . $1)
or die "cannot open $1 or $ibase/$1: $!\n";
next;
/*
- * FFmpeg main
+ * FFmpeg main
* Copyright (c) 2000-2003 Fabrice Bellard
*
* This library is free software; you can redistribute it and/or
int video_crop; /* video_resample and video_crop are mutually exclusive */
int topBand; /* cropping area sizes */
int leftBand;
-
+
int video_pad; /* video_resample and video_pad are mutually exclusive */
int padtop; /* padding area sizes */
int padbottom;
int padleft;
int padright;
-
+
/* audio only */
int audio_resample;
ReSampleContext *resample; /* for audio resampling */
tty.c_cflag |= CS8;
tty.c_cc[VMIN] = 1;
tty.c_cc[VTIME] = 0;
-
+
tcsetattr (0, TCSANOW, &tty);
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
#define MAX_AUDIO_PACKET_SIZE (128 * 1024)
-static void do_audio_out(AVFormatContext *s,
- AVOutputStream *ost,
+static void do_audio_out(AVFormatContext *s,
+ AVOutputStream *ost,
AVInputStream *ist,
unsigned char *buf, int size)
{
return; /* Should signal an error ! */
if(audio_sync_method){
- double delta = get_sync_ipts(ost) * enc->sample_rate - ost->sync_opts
+ double delta = get_sync_ipts(ost) * enc->sample_rate - ost->sync_opts
- fifo_size(&ost->fifo, ost->fifo.rptr)/(ost->st->codec->channels * 2);
double idelta= delta*ist->st->codec->sample_rate / enc->sample_rate;
int byte_delta= ((int)idelta)*2*ist->st->codec->channels;
// fprintf(stderr, "drift:%f len:%d opts:%lld ipts:%lld fifo:%d\n", delta, -1, ost->sync_opts, (int64_t)(get_sync_ipts(ost) * enc->sample_rate), fifo_size(&ost->fifo, ost->fifo.rptr)/(ost->st->codec->channels * 2));
av_resample_compensate(*(struct AVResampleContext**)ost->resample, comp, enc->sample_rate);
}
- }
+ }
}else
ost->sync_opts= lrintf(get_sync_ipts(ost) * enc->sample_rate)
- fifo_size(&ost->fifo, ost->fifo.rptr)/(ost->st->codec->channels * 2); //FIXME wrong
if (ost->audio_resample) {
buftmp = audio_buf;
- size_out = audio_resample(ost->resample,
+ size_out = audio_resample(ost->resample,
(short *)buftmp, (short *)buf,
size / (ist->st->codec->channels * 2));
size_out = size_out * enc->channels * 2;
/* now encode as many frames as possible */
if (enc->frame_size > 1) {
/* output resampled raw samples */
- fifo_write(&ost->fifo, buftmp, size_out,
+ fifo_write(&ost->fifo, buftmp, size_out,
&ost->fifo.wptr);
frame_bytes = enc->frame_size * 2 * enc->channels;
-
- while (fifo_read(&ost->fifo, audio_buf, frame_bytes,
+
+ while (fifo_read(&ost->fifo, audio_buf, frame_bytes,
&ost->fifo.rptr) == 0) {
AVPacket pkt;
av_init_packet(&pkt);
- ret = avcodec_encode_audio(enc, audio_out, audio_out_size,
+ ret = avcodec_encode_audio(enc, audio_out, audio_out_size,
(short *)audio_buf);
audio_size += ret;
pkt.stream_index= ost->index;
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
pkt.flags |= PKT_FLAG_KEY;
av_interleaved_write_frame(s, &pkt);
-
+
ost->sync_opts += enc->frame_size;
}
} else {
size_out = size_out >> 1;
break;
}
- ret = avcodec_encode_audio(enc, audio_out, size_out,
+ ret = avcodec_encode_audio(enc, audio_out, size_out,
(short *)buftmp);
audio_size += ret;
pkt.stream_index= ost->index;
buf = av_malloc(size);
if (!buf)
return;
-
+
picture2 = &picture_tmp;
avpicture_fill(picture2, buf, dec->pix_fmt, dec->width, dec->height);
if (do_deinterlace){
- if(avpicture_deinterlace(picture2, picture,
+ if(avpicture_deinterlace(picture2, picture,
dec->pix_fmt, dec->width, dec->height) < 0) {
/* if error, do not deinterlace */
av_free(buf);
picture2 = picture;
}
} else {
- if (img_convert(picture2, dec->pix_fmt, picture,
+ if (img_convert(picture2, dec->pix_fmt, picture,
dec->pix_fmt, dec->width, dec->height) < 0) {
/* if error, do not copy */
av_free(buf);
/* Expects img to be yuv420 */
static void fill_pad_region(AVPicture* img, int height, int width,
int padtop, int padbottom, int padleft, int padright, int *color) {
-
+
int i, y, shift;
uint8_t *optr;
-
+
for (i = 0; i < 3; i++) {
shift = (i == 0) ? 0 : 1;
-
+
if (padtop || padleft) {
- memset(img->data[i], color[i], (((img->linesize[i] * padtop) +
+ memset(img->data[i], color[i], (((img->linesize[i] * padtop) +
padleft) >> shift));
}
optr += img->linesize[i];
}
}
-
+
if (padbottom || padright) {
optr = img->data[i] + (((img->linesize[i] * (height - padbottom)) - padright) >> shift);
memset(optr, color[i], (((img->linesize[i] * padbottom) + padright) >> shift));
}
}
-static void do_subtitle_out(AVFormatContext *s,
- AVOutputStream *ost,
+static void do_subtitle_out(AVFormatContext *s,
+ AVOutputStream *ost,
AVInputStream *ist,
AVSubtitle *sub,
int64_t pts)
nb = 1;
for(i = 0; i < nb; i++) {
- subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
+ subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
subtitle_out_max_size, sub);
-
+
av_init_packet(&pkt);
pkt.stream_index = ost->index;
pkt.data = subtitle_out;
static int bit_buffer_size= 1024*256;
static uint8_t *bit_buffer= NULL;
-static void do_video_out(AVFormatContext *s,
- AVOutputStream *ost,
+static void do_video_out(AVFormatContext *s,
+ AVOutputStream *ost,
AVInputStream *ist,
AVFrame *in_picture,
int *frame_size)
uint8_t *buf = NULL, *buf1 = NULL;
AVCodecContext *enc, *dec;
enum PixelFormat target_pixfmt;
-
+
avcodec_get_frame_defaults(&picture_format_temp);
avcodec_get_frame_defaults(&picture_crop_temp);
ost->sync_opts= lrintf(get_sync_ipts(ost) / av_q2d(enc->time_base));
nb_frames= FFMIN(nb_frames, max_frames[CODEC_TYPE_VIDEO] - ost->frame_number);
- if (nb_frames <= 0)
+ if (nb_frames <= 0)
return;
/* convert pixel format if needed */
return;
formatted_picture = &picture_format_temp;
avpicture_fill((AVPicture*)formatted_picture, buf, target_pixfmt, dec->width, dec->height);
-
- if (img_convert((AVPicture*)formatted_picture, target_pixfmt,
- (AVPicture *)in_picture, dec->pix_fmt,
+
+ if (img_convert((AVPicture*)formatted_picture, target_pixfmt,
+ (AVPicture *)in_picture, dec->pix_fmt,
dec->width, dec->height) < 0) {
if (verbose >= 0)
if (ost->video_resample) {
final_picture = &ost->pict_tmp;
img_resample(ost->img_resample_ctx, (AVPicture*)final_picture, (AVPicture*)formatted_picture);
-
+
if (ost->padtop || ost->padbottom || ost->padleft || ost->padright) {
fill_pad_region((AVPicture*)final_picture, enc->height, enc->width,
ost->padtop, ost->padbottom, ost->padleft, ost->padright,
padcolor);
}
-
+
if (enc->pix_fmt != PIX_FMT_YUV420P) {
int size;
-
+
av_free(buf);
/* create temporary picture */
size = avpicture_get_size(enc->pix_fmt, enc->width, enc->height);
return;
final_picture = &picture_format_temp;
avpicture_fill((AVPicture*)final_picture, buf, enc->pix_fmt, enc->width, enc->height);
-
- if (img_convert((AVPicture*)final_picture, enc->pix_fmt,
- (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P,
+
+ if (img_convert((AVPicture*)final_picture, enc->pix_fmt,
+ (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P,
enc->width, enc->height) < 0) {
if (verbose >= 0)
uint8_t *optr, *iptr;
int shift = (i == 0) ? 0 : 1;
int y, yheight;
-
+
/* set offset to start writing image into */
- optr = final_picture->data[i] + (((final_picture->linesize[i] *
+ optr = final_picture->data[i] + (((final_picture->linesize[i] *
ost->padtop) + ost->padleft) >> shift);
iptr = formatted_picture->data[i];
fill_pad_region((AVPicture*)final_picture, enc->height, enc->width,
ost->padtop, ost->padbottom, ost->padleft, ost->padright,
padcolor);
-
+
if (enc->pix_fmt != PIX_FMT_YUV420P) {
int size;
final_picture = &picture_format_temp;
avpicture_fill((AVPicture*)final_picture, buf, enc->pix_fmt, enc->width, enc->height);
- if (img_convert((AVPicture*)final_picture, enc->pix_fmt,
- (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P,
+ if (img_convert((AVPicture*)final_picture, enc->pix_fmt,
+ (AVPicture*)&ost->pict_tmp, PIX_FMT_YUV420P,
enc->width, enc->height) < 0) {
if (verbose >= 0)
big_picture.pts= ost->sync_opts;
// big_picture.pts= av_rescale(ost->sync_opts, AV_TIME_BASE*(int64_t)enc->time_base.num, enc->time_base.den);
//av_log(NULL, AV_LOG_DEBUG, "%lld -> encoder\n", ost->sync_opts);
- ret = avcodec_encode_video(enc,
+ ret = avcodec_encode_video(enc,
bit_buffer, bit_buffer_size,
&big_picture);
//enc->frame_number = enc->real_pict_num;
pkt.size= ret;
if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
-/*av_log(NULL, AV_LOG_DEBUG, "encoder -> %lld/%lld\n",
+/*av_log(NULL, AV_LOG_DEBUG, "encoder -> %lld/%lld\n",
pkt.pts != AV_NOPTS_VALUE ? av_rescale(pkt.pts, enc->time_base.den, AV_TIME_BASE*(int64_t)enc->time_base.num) : -1,
pkt.dts != AV_NOPTS_VALUE ? av_rescale(pkt.dts, enc->time_base.den, AV_TIME_BASE*(int64_t)enc->time_base.num) : -1);*/
return -10.0*log(d)/log(10.0);
}
-static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
+static void do_video_stats(AVFormatContext *os, AVOutputStream *ost,
int frame_size)
{
static FILE *fvstats=NULL;
int frame_number;
int64_t ti;
double ti1, bitrate, avg_bitrate;
-
+
if (!fvstats) {
today2 = time(NULL);
today = localtime(&today2);
exit(1);
}
}
-
+
ti = MAXINT64;
enc = ost->st->codec;
if (enc->codec_type == CODEC_TYPE_VIDEO) {
fprintf(fvstats, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
if (enc->flags&CODEC_FLAG_PSNR)
fprintf(fvstats, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
-
+
fprintf(fvstats,"f_size= %6d ", frame_size);
/* compute pts value */
ti1 = ost->sync_opts * av_q2d(enc->time_base);
if (ti1 < 0.01)
ti1 = 0.01;
-
+
bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0;
avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0;
fprintf(fvstats, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
(double)video_size / 1024, ti1, bitrate, avg_bitrate);
- fprintf(fvstats,"type= %c\n", av_get_pict_type_char(enc->coded_frame->pict_type));
+ fprintf(fvstats,"type= %c\n", av_get_pict_type_char(enc->coded_frame->pict_type));
}
}
int frame_number, vid, i;
double bitrate, ti1, pts;
static int64_t last_time = -1;
-
+
if (!is_last_report) {
int64_t cur_time;
/* display the report every 0.5 seconds */
if (last_time == -1) {
last_time = cur_time;
return;
- }
+ }
if ((cur_time - last_time) < 500000)
return;
last_time = cur_time;
oc = output_files[0];
total_size = url_ftell(&oc->pb);
-
+
buf[0] = '\0';
ti1 = 1e10;
vid = 0;
}
if (ti1 < 0.01)
ti1 = 0.01;
-
+
if (verbose || is_last_report) {
bitrate = (double)(total_size * 8) / ti1 / 1000.0;
-
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
+
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"size=%8.0fkB time=%0.1f bitrate=%6.1fkbits/s",
(double)total_size / 1024, ti1, bitrate);
if (verbose > 1)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
nb_frames_dup, nb_frames_drop);
-
+
if (verbose >= 0)
fprintf(stderr, "%s \r", buf);
fflush(stderr);
}
-
+
if (is_last_report && verbose >= 0){
int64_t raw= audio_size + video_size + extra_size;
fprintf(stderr, "\n");
static short *samples= NULL;
AVSubtitle subtitle, *subtitle_to_free;
int got_subtitle;
-
+
if(!pkt){
ist->pts= ist->next_pts; // needed for last packet if vsync=0
} else if (pkt->dts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too
} else {
// assert(ist->pts == ist->next_pts);
}
-
+
if (pkt == NULL) {
/* EOF handling */
ptr = NULL;
if (ist->decoding_needed) {
switch(ist->st->codec->codec_type) {
case CODEC_TYPE_AUDIO:{
- if(pkt)
+ if(pkt)
samples= av_fast_realloc(samples, &samples_size, FFMAX(pkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE));
/* XXX: could avoid copy if PCM 16 bits with same
endianness as CPU */
continue;
}
data_buf = (uint8_t *)samples;
- ist->next_pts += ((int64_t)AV_TIME_BASE/2 * data_size) /
+ ist->next_pts += ((int64_t)AV_TIME_BASE/2 * data_size) /
(ist->st->codec->sample_rate * ist->st->codec->channels);
break;}
case CODEC_TYPE_VIDEO:
/* XXX: allocate picture correctly */
avcodec_get_frame_defaults(&picture);
- ret = avcodec_decode_video(ist->st->codec,
+ ret = avcodec_decode_video(ist->st->codec,
&picture, &got_picture, ptr, len);
ist->st->quality= picture.quality;
- if (ret < 0)
+ if (ret < 0)
goto fail_decode;
if (!got_picture) {
/* no picture yet */
goto discard_packet;
}
if (ist->st->codec->time_base.num != 0) {
- ist->next_pts += ((int64_t)AV_TIME_BASE *
+ ist->next_pts += ((int64_t)AV_TIME_BASE *
ist->st->codec->time_base.num) /
ist->st->codec->time_base.den;
}
len = 0;
break;
case CODEC_TYPE_SUBTITLE:
- ret = avcodec_decode_subtitle(ist->st->codec,
+ ret = avcodec_decode_subtitle(ist->st->codec,
&subtitle, &got_subtitle, ptr, len);
if (ret < 0)
goto fail_decode;
} else {
switch(ist->st->codec->codec_type) {
case CODEC_TYPE_AUDIO:
- ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) /
+ ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) /
(ist->st->codec->sample_rate * ist->st->codec->channels);
break;
case CODEC_TYPE_VIDEO:
if (ist->st->codec->time_base.num != 0) {
- ist->next_pts += ((int64_t)AV_TIME_BASE *
+ ist->next_pts += ((int64_t)AV_TIME_BASE *
ist->st->codec->time_base.num) /
ist->st->codec->time_base.den;
}
buffer_to_free = NULL;
if (ist->st->codec->codec_type == CODEC_TYPE_VIDEO) {
- pre_process_video_frame(ist, (AVPicture *)&picture,
+ pre_process_video_frame(ist, (AVPicture *)&picture,
&buffer_to_free);
}
}
}
#endif
- /* if output time reached then transcode raw format,
+ /* if output time reached then transcode raw format,
encode packets and output them */
if (start_time == 0 || ist->pts >= start_time)
for(i=0;i<nb_ostreams;i++) {
os = output_files[ost->file_index];
#if 0
- printf("%d: got pts=%0.3f %0.3f\n", i,
- (double)pkt->pts / AV_TIME_BASE,
- ((double)ist->pts / AV_TIME_BASE) -
+ printf("%d: got pts=%0.3f %0.3f\n", i,
+ (double)pkt->pts / AV_TIME_BASE,
+ ((double)ist->pts / AV_TIME_BASE) -
((double)ost->st->pts.val * ost->st->time_base.num / ost->st->time_base.den));
#endif
/* set the input output pts pairs */
/* no reencoding needed : output the packet directly */
/* force the input stream PTS */
-
+
avcodec_get_frame_defaults(&avframe);
ost->st->codec->coded_frame= &avframe;
- avframe.key_frame = pkt->flags & PKT_FLAG_KEY;
+ avframe.key_frame = pkt->flags & PKT_FLAG_KEY;
if(ost->st->codec->codec_type == CODEC_TYPE_AUDIO)
audio_size += data_size;
discard_packet:
if (pkt == NULL) {
/* EOF handling */
-
+
for(i=0;i<nb_ostreams;i++) {
ost = ost_table[i];
if (ost->source_index == ist_index) {
AVCodecContext *enc= ost->st->codec;
os = output_files[ost->file_index];
-
+
if(ost->st->codec->codec_type == CODEC_TYPE_AUDIO && enc->frame_size <=1)
continue;
if(ost->st->codec->codec_type == CODEC_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE))
AVPacket pkt;
av_init_packet(&pkt);
pkt.stream_index= ost->index;
-
+
switch(ost->st->codec->codec_type) {
- case CODEC_TYPE_AUDIO:
+ case CODEC_TYPE_AUDIO:
ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, NULL);
audio_size += ret;
pkt.flags |= PKT_FLAG_KEY;
default:
ret=-1;
}
-
+
if(ret<=0)
break;
pkt.data= bit_buffer;
}
}
}
-
+
return 0;
fail_decode:
return -1;
file_table= (AVInputFile*) av_mallocz(nb_input_files * sizeof(AVInputFile));
if (!file_table)
goto fail;
-
+
/* input stream init */
j = 0;
for(i=0;i<nb_input_files;i++) {
ist_table = av_mallocz(nb_istreams * sizeof(AVInputStream *));
if (!ist_table)
goto fail;
-
+
for(i=0;i<nb_istreams;i++) {
ist = av_mallocz(sizeof(AVInputStream));
if (!ist)
for(i=0;i<nb_stream_maps;i++) {
int fi = stream_maps[i].file_index;
int si = stream_maps[i].stream_index;
-
+
if (fi < 0 || fi > nb_input_files - 1 ||
si < 0 || si > file_table[fi].nb_streams - 1) {
fprintf(stderr,"Could not find input stream #%d.%d\n", fi, si);
exit(1);
}
}
-
+
ost_table = av_mallocz(sizeof(AVOutputStream *) * nb_ostreams);
if (!ost_table)
goto fail;
goto fail;
ost_table[i] = ost;
}
-
+
n = 0;
for(k=0;k<nb_output_files;k++) {
os = output_files[k];
ost->index = i;
ost->st = os->streams[i];
if (nb_stream_maps > 0) {
- ost->source_index = file_table[stream_maps[n-1].file_index].ist_index +
+ ost->source_index = file_table[stream_maps[n-1].file_index].ist_index +
stream_maps[n-1].stream_index;
-
+
/* Sanity check that the stream types match */
if (ist_table[ost->source_index]->st->codec->codec_type != ost->st->codec->codec_type) {
fprintf(stderr, "Codec type mismatch for mapping #%d.%d -> #%d.%d\n",
ost->file_index, ost->index);
exit(1);
}
-
+
} else {
/* get corresponding input stream index : we select the first one with the right type */
found = 0;
for(j=0;j<nb_istreams;j++) {
ist = ist_table[j];
- if (ist->discard &&
+ if (ist->discard &&
ist->st->codec->codec_type == ost->st->codec->codec_type) {
ost->source_index = j;
found = 1;
break;
}
}
-
+
if (!found) {
/* try again and reuse existing stream */
for(j=0;j<nb_istreams;j++) {
case CODEC_TYPE_AUDIO:
if (fifo_init(&ost->fifo, 2 * MAX_AUDIO_PACKET_SIZE))
goto fail;
-
+
if (codec->channels == icodec->channels &&
codec->sample_rate == icodec->sample_rate) {
ost->audio_resample = 0;
ost->audio_resample = 1;
}
} else {
- ost->audio_resample = 1;
+ ost->audio_resample = 1;
}
}
if(audio_sync_method>1)
frame_topBand == 0 &&
frame_bottomBand == 0 &&
frame_leftBand == 0 &&
- frame_rightBand == 0 &&
+ frame_rightBand == 0 &&
frame_padtop == 0 &&
frame_padbottom == 0 &&
frame_padleft == 0 &&
ost->video_crop = 1;
ost->topBand = frame_topBand;
ost->leftBand = frame_leftBand;
- } else if ((codec->width == icodec->width +
+ } else if ((codec->width == icodec->width +
(frame_padleft + frame_padright)) &&
(codec->height == icodec->height +
(frame_padtop + frame_padbottom))) {
codec->width, codec->height ) )
goto fail;
- ost->img_resample_ctx = img_resample_full_init(
+ ost->img_resample_ctx = img_resample_full_init(
codec->width, codec->height,
icodec->width, icodec->height,
frame_topBand, frame_bottomBand,
- frame_leftBand, frame_rightBand,
- frame_padtop, frame_padbottom,
+ frame_leftBand, frame_rightBand,
+ frame_padtop, frame_padbottom,
frame_padleft, frame_padright);
-
+
ost->padtop = frame_padtop;
ost->padleft = frame_padleft;
ost->padbottom = frame_padbottom;
ost->padright = frame_padright;
-
+
}
ost->encoding_needed = 1;
ist->decoding_needed = 1;
break;
}
/* two pass mode */
- if (ost->encoding_needed &&
+ if (ost->encoding_needed &&
(codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2))) {
char logfilename[1024];
FILE *f;
int size;
char *logbuffer;
-
- snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
- pass_logfilename ?
+
+ snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
+ pass_logfilename ?
pass_logfilename : DEFAULT_PASS_LOGFILENAME, i);
if (codec->flags & CODEC_FLAG_PASS1) {
f = fopen(logfilename, "w");
fprintf(stderr, " Stream #%d.%d -> #%d.%d",
ist_table[ost->source_index]->file_index,
ist_table[ost->source_index]->index,
- ost->file_index,
+ ost->file_index,
ost->index);
if (ost->sync_ist != ist_table[ost->source_index])
fprintf(stderr, " [sync #%d.%d]",
AVCodec *codec;
codec = avcodec_find_encoder(ost->st->codec->codec_id);
if (!codec) {
- fprintf(stderr, "Unsupported codec for output stream #%d.%d\n",
+ fprintf(stderr, "Unsupported codec for output stream #%d.%d\n",
ost->file_index, ost->index);
exit(1);
}
if (avcodec_open(ost->st->codec, codec) < 0) {
- fprintf(stderr, "Error while opening codec for output stream #%d.%d - maybe incorrect parameters such as bit_rate, rate, width or height\n",
+ fprintf(stderr, "Error while opening codec for output stream #%d.%d - maybe incorrect parameters such as bit_rate, rate, width or height\n",
ost->file_index, ost->index);
exit(1);
}
AVCodec *codec;
codec = avcodec_find_decoder(ist->st->codec->codec_id);
if (!codec) {
- fprintf(stderr, "Unsupported codec (id=%d) for input stream #%d.%d\n",
+ fprintf(stderr, "Unsupported codec (id=%d) for input stream #%d.%d\n",
ist->st->codec->codec_id, ist->file_index, ist->index);
exit(1);
}
if (avcodec_open(ist->st->codec, codec) < 0) {
- fprintf(stderr, "Error while opening codec for input stream #%d.%d\n",
+ fprintf(stderr, "Error while opening codec for input stream #%d.%d\n",
ist->file_index, ist->index);
exit(1);
}
is = input_files[ist->file_index];
ist->pts = 0;
ist->next_pts = av_rescale_q(ist->st->start_time, ist->st->time_base, AV_TIME_BASE_Q);
- if(ist->st->start_time == AV_NOPTS_VALUE)
+ if(ist->st->start_time == AV_NOPTS_VALUE)
ist->next_pts=0;
if(input_files_ts_offset[ist->file_index])
ist->next_pts= AV_NOPTS_VALUE;
fprintf(stderr, "Invalid input file index %d map_meta_data(%d,%d)\n", in_file_index, out_file_index, in_file_index);
ret = -EINVAL;
goto fail;
- }
-
+ }
+
out_file = output_files[out_file_index];
in_file = input_files[in_file_index];
out_file->track = in_file->track;
strcpy(out_file->genre, in_file->genre);
}
-
+
/* open files and write file headers */
for(i=0;i<nb_output_files;i++) {
os = output_files[i];
discard_packet:
av_free_packet(&pkt);
-
+
/* dump report by using the output first video and audio streams */
print_report(output_files, ost_table, nb_ostreams, 0);
}
avcodec_close(ost->st->codec);
}
}
-
+
/* close each decoder */
for(i=0;i<nb_istreams;i++) {
ist = ist_table[i];
}
/* finished ! */
-
+
ret = 0;
fail1:
av_freep(&bit_buffer);
static void opt_image_format(const char *arg)
{
AVImageFormat *f;
-
+
for(f = first_image_format; f != NULL; f = f->next) {
if (!strcmp(arg, f->name))
break;
static void opt_frame_crop_top(const char *arg)
{
- frame_topBand = atoi(arg);
+ frame_topBand = atoi(arg);
if (frame_topBand < 0) {
fprintf(stderr, "Incorrect top crop size\n");
exit(1);
}
if ((frame_bottomBand % 2) != 0) {
fprintf(stderr, "Bottom crop size must be a multiple of 2\n");
- exit(1);
+ exit(1);
}
if ((frame_bottomBand) >= frame_height){
fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
}
if ((frame_rightBand % 2) != 0) {
fprintf(stderr, "Right crop size must be a multiple of 2\n");
- exit(1);
+ exit(1);
}
if ((frame_rightBand) >= frame_width){
fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
how colors are expressed in html tags (but without the #) */
int rgb = strtol(arg, NULL, 16);
int r,g,b;
-
- r = (rgb >> 16);
+
+ r = (rgb >> 16);
g = ((rgb >> 8) & 255);
b = (rgb & 255);
static void opt_frame_pad_top(const char *arg)
{
- frame_padtop = atoi(arg);
+ frame_padtop = atoi(arg);
if (frame_padtop < 0) {
fprintf(stderr, "Incorrect top pad size\n");
exit(1);
static void opt_frame_pad_bottom(const char *arg)
{
- frame_padbottom = atoi(arg);
+ frame_padbottom = atoi(arg);
if (frame_padbottom < 0) {
fprintf(stderr, "Incorrect bottom pad size\n");
exit(1);
static void opt_frame_pad_left(const char *arg)
{
- frame_padleft = atoi(arg);
+ frame_padleft = atoi(arg);
if (frame_padleft < 0) {
fprintf(stderr, "Incorrect left pad size\n");
exit(1);
static void opt_frame_pad_right(const char *arg)
{
- frame_padright = atoi(arg);
+ frame_padright = atoi(arg);
if (frame_padright < 0) {
fprintf(stderr, "Incorrect right pad size\n");
exit(1);
int x = 0, y = 0;
double ar = 0;
const char *p;
-
+
p = strchr(arg, ':');
if (p) {
x = strtol(arg, (char **)&arg, 10);
{
AVMetaDataMap *m;
const char *p;
-
+
p = arg;
m = &meta_data_maps[nb_meta_data_maps++];
if (!strcmp(filename, "-"))
filename = "pipe:";
- using_stdin |= !strncmp(filename, "pipe:", 5) ||
+ using_stdin |= !strncmp(filename, "pipe:", 5) ||
!strcmp( filename, "/dev/stdin" );
/* get default parameters from command line */
if(genpts)
ic->flags|= AVFMT_FLAG_GENPTS;
-
+
/* If not enough info to get the stream parameters, we decode the
first frames to get it. (used in mpeg case for example) */
ret = av_find_stream_info(ic);
if (start_time != 0) {
ret = av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD);
if (ret < 0) {
- fprintf(stderr, "%s: could not seek to position %0.3f\n",
+ fprintf(stderr, "%s: could not seek to position %0.3f\n",
filename, (double)timestamp / AV_TIME_BASE);
}
/* reset seek info */
if(me_threshold)
enc->debug |= FF_DEBUG_MV;
- if (enc->time_base.den != rfps || enc->time_base.num != rfps_base) {
+ if (enc->time_base.den != rfps || enc->time_base.num != rfps_base) {
if (verbose >= 0)
fprintf(stderr,"\nSeems that stream %d comes from film source: %2.2f (%d/%d) -> %2.2f (%d/%d)\n",
av_abort();
}
}
-
+
input_files[nb_input_files] = ic;
input_files_ts_offset[nb_input_files] = input_ts_offset - (copy_ts ? 0 : timestamp);
/* dump the file content */
grab_device = NULL;
video_channel = 0;
-
+
rate_emu = 0;
}
AVStream *st;
AVCodecContext *video_enc;
int codec_id;
-
+
st = av_new_stream(oc, oc->nb_streams);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
if(thread_count>1)
avcodec_thread_init(st->codec, thread_count);
#endif
-
+
video_enc = st->codec;
-
+
if(video_codec_tag)
video_enc->codec_tag= video_codec_tag;
-
+
if( (video_global_header&1)
|| (video_global_header==0 && (oc->oformat->flags & AVFMT_GLOBALHEADER))){
video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
char *p;
int i;
AVCodec *codec;
-
+
codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO);
if (video_codec_id != CODEC_ID_NONE)
codec_id = video_codec_id;
-
+
video_enc->codec_id = codec_id;
codec = avcodec_find_encoder(codec_id);
-
+
for(i=0; i<opt_name_count; i++){
AVOption *opt;
double d= av_get_double(avctx_opts, opt_names[i], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_VIDEO_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM))
av_set_double(video_enc, opt_names[i], d);
}
-
+
video_enc->bit_rate = video_bit_rate;
video_enc->bit_rate_tolerance = video_bit_rate_tolerance;
- video_enc->time_base.den = frame_rate;
- video_enc->time_base.num = frame_rate_base;
+ video_enc->time_base.den = frame_rate;
+ video_enc->time_base.num = frame_rate_base;
if(codec && codec->supported_framerates){
const AVRational *p= codec->supported_framerates;
AVRational req= (AVRational){frame_rate, frame_rate_base};
video_enc->time_base.den= best->num;
video_enc->time_base.num= best->den;
}
-
+
video_enc->width = frame_width + frame_padright + frame_padleft;
video_enc->height = frame_height + frame_padtop + frame_padbottom;
video_enc->sample_aspect_ratio = av_d2q(frame_aspect_ratio*frame_height/frame_width, 255);
video_enc->gop_size = 0;
if (video_qscale || same_quality) {
video_enc->flags |= CODEC_FLAG_QSCALE;
- video_enc->global_quality=
+ video_enc->global_quality=
st->quality = FF_QP2LAMBDA * video_qscale;
}
video_enc->inter_matrix = inter_matrix;
video_enc->pre_me = pre_me;
-
+
if (b_frames) {
video_enc->max_b_frames = b_frames;
video_enc->b_frame_strategy = b_strategy;
fprintf(stderr, "error parsing rc_override\n");
exit(1);
}
- video_enc->rc_override=
- av_realloc(video_enc->rc_override,
+ video_enc->rc_override=
+ av_realloc(video_enc->rc_override,
sizeof(RcOverride)*(i+1));
video_enc->rc_override[i].start_frame= start;
video_enc->rc_override[i].end_frame = end;
video_enc->rtp_mode= 1;
video_enc->rtp_payload_size= packet_size;
}
-
+
if (do_psnr)
video_enc->flags|= CODEC_FLAG_PSNR;
-
+
video_enc->me_method = me_method;
/* two pass mode */
AVStream *st;
AVCodecContext *audio_enc;
int codec_id, i;
-
+
st = av_new_stream(oc, oc->nb_streams);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
if(thread_count>1)
avcodec_thread_init(st->codec, thread_count);
#endif
-
+
audio_enc = st->codec;
audio_enc->codec_type = CODEC_TYPE_AUDIO;
-
+
if(audio_codec_tag)
audio_enc->codec_tag= audio_codec_tag;
-
+
if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
avctx_opts->flags|= CODEC_FLAG_GLOBAL_HEADER;
audio_enc->channels = audio_channels;
} else {
codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_AUDIO);
-
+
for(i=0; i<opt_name_count; i++){
AVOption *opt;
double d= av_get_double(avctx_opts, opt_names[i], &opt);
if(d==d && (opt->flags&AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags&AV_OPT_FLAG_ENCODING_PARAM))
av_set_double(audio_enc, opt_names[i], d);
}
-
+
if (audio_codec_id != CODEC_ID_NONE)
codec_id = audio_codec_id;
audio_enc->codec_id = codec_id;
-
+
audio_enc->bit_rate = audio_bit_rate;
if (audio_qscale > QSCALE_NONE) {
audio_enc->flags |= CODEC_FLAG_QSCALE;
AVStream *st;
AVCodecContext *subtitle_enc;
int i;
-
+
if (nb_output_files <= 0) {
fprintf(stderr, "At least one output file must be specified\n");
exit(1);
exit(1);
}
}
-
+
oc->oformat = file_oformat;
pstrcpy(oc->filename, sizeof(oc->filename), filename);
- if (!strcmp(file_oformat->name, "ffm") &&
+ if (!strcmp(file_oformat->name, "ffm") &&
strstart(filename, "http:", NULL)) {
/* special case for files sent to ffserver: we get the stream
parameters from ffserver */
if (video_disable) {
use_video = 0;
}
-
+
if (use_video) {
new_video_stream(oc);
}
-
+
if (use_audio) {
new_audio_stream(oc);
}
}
oc->timestamp = rec_timestamp;
-
+
if (str_title)
pstrcpy(oc->title, sizeof(oc->title), str_title);
if (str_author)
if (!(oc->oformat->flags & AVFMT_NOFILE)) {
/* test if it already exists to avoid loosing precious files */
- if (!file_overwrite &&
+ if (!file_overwrite &&
(strchr(filename, ':') == NULL ||
strstart(filename, "file:", NULL))) {
if (url_exist(filename)) {
int c;
-
+
if ( !using_stdin ) {
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
fflush(stderr);
}
}
}
-
+
/* open the file */
if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
fprintf(stderr, "Could not open '%s'\n", filename);
AVFormatContext *ic;
AVFormatParameters vp1, *vp = &vp1;
AVFormatParameters ap1, *ap = &ap1;
-
+
/* see if audio/video inputs are needed */
has_video = 0;
has_audio = 0;
vp->width = enc->width;
if (enc->height > vp->height)
vp->height = enc->height;
-
+
if (vp->time_base.num*(int64_t)enc->time_base.den > enc->time_base.num*(int64_t)vp->time_base.den){
vp->time_base = enc->time_base;
}
}
}
}
-
+
if (has_video == 0 && has_audio == 0) {
fprintf(stderr, "Output file must have at least one audio or video stream\n");
exit(1);
}
-
+
if (has_video) {
AVInputFormat *fmt1;
fmt1 = av_find_input_format(video_grab_format);
if(name==NULL)
break;
last_name= name;
-
+
printf(
- " %s%s %-15s %s\n",
- decode ? "D":" ",
- encode ? "E":" ",
+ " %s%s %-15s %s\n",
+ decode ? "D":" ",
+ encode ? "E":" ",
name,
long_name ? long_name:" ");
}
printf("\n");
printf("Image formats (filename extensions, if any, follow):\n");
- for(image_fmt = first_image_format; image_fmt != NULL;
+ for(image_fmt = first_image_format; image_fmt != NULL;
image_fmt = image_fmt->next) {
printf(
" %s%s %-6s %s\n",
if(p2==NULL)
break;
last_name= p2->name;
-
+
switch(p2->type) {
case CODEC_TYPE_VIDEO:
type_str = "V";
break;
}
printf(
- " %s%s%s%s%s%s %s",
- decode ? "D": (/*p2->decoder ? "d":*/" "),
- encode ? "E":" ",
+ " %s%s%s%s%s%s %s",
+ decode ? "D": (/*p2->decoder ? "d":*/" "),
+ encode ? "E":" ",
type_str,
cap & CODEC_CAP_DRAW_HORIZ_BAND ? "S":" ",
cap & CODEC_CAP_DR1 ? "D":" ",
for(up = first_protocol; up != NULL; up = up->next)
printf(" %s:", up->name);
printf("\n");
-
+
printf("Frame size, frame rate abbreviations:\n ntsc pal qntsc qpal sntsc spal film ntsc-film sqcif qcif cif 4cif\n");
printf("Motion estimation methods:\n");
pp = motion_str;
while (*pp) {
printf(" %s", *pp);
- if ((pp - motion_str + 1) == ME_ZERO)
+ if ((pp - motion_str + 1) == ME_ZERO)
printf("(fastest)");
- else if ((pp - motion_str + 1) == ME_FULL)
+ else if ((pp - motion_str + 1) == ME_FULL)
printf("(slowest)");
- else if ((pp - motion_str + 1) == ME_EPZS)
+ else if ((pp - motion_str + 1) == ME_EPZS)
printf("(default)");
pp++;
}
audio_bit_rate = 224000;
audio_sample_rate = 44100;
-
+
mux_packet_size= 2324;
mux_rate= 2352 * 75 * 8;
{
fprintf(stderr, "ffmpeg " FFMPEG_VERSION "\n"
"libavcodec %d\n"
- "libavformat %d\n",
+ "libavformat %d\n",
avcodec_build(), LIBAVFORMAT_BUILD);
exit(1);
}
AVOption *o= av_set_string(avctx_opts, opt, arg);
if(!o)
return -1;
-
+
// av_log(NULL, AV_LOG_ERROR, "%s:%s: %f 0x%0X\n", opt, arg, av_get_double(avctx_opts, opt, NULL), (int)av_get_int(avctx_opts, opt, NULL));
//FIXME we should always use avctx_opts, ... for storing options so there wont be any need to keep track of whats set over this
opt_names= av_realloc(opt_names, sizeof(void*)*(opt_name_count+1));
opt_names[opt_name_count++]= o->name;
-
+
/* disable generate of real time pts in ffm (need to be supressed anyway) */
if(avctx_opts->flags & CODEC_FLAG_BITEXACT)
ffm_nopts = 1;
{ "author", HAS_ARG | OPT_STRING, {(void*)&str_author}, "set the author", "string" },
{ "copyright", HAS_ARG | OPT_STRING, {(void*)&str_copyright}, "set the copyright", "string" },
{ "comment", HAS_ARG | OPT_STRING, {(void*)&str_comment}, "set the comment", "string" },
- { "benchmark", OPT_BOOL | OPT_EXPERT, {(void*)&do_benchmark},
+ { "benchmark", OPT_BOOL | OPT_EXPERT, {(void*)&do_benchmark},
"add timings for benchmarking" },
- { "dump", OPT_BOOL | OPT_EXPERT, {(void*)&do_pkt_dump},
+ { "dump", OPT_BOOL | OPT_EXPERT, {(void*)&do_pkt_dump},
"dump each input packet" },
- { "hex", OPT_BOOL | OPT_EXPERT, {(void*)&do_hex_dump},
+ { "hex", OPT_BOOL | OPT_EXPERT, {(void*)&do_hex_dump},
"when dumping packets, also dump the payload" },
{ "re", OPT_BOOL | OPT_EXPERT, {(void*)&rate_emu}, "read input at native frame rate", "" },
{ "loop", OPT_BOOL | OPT_EXPERT, {(void*)&loop_input}, "loop (current only works with images)" },
{ "minrate", HAS_ARG | OPT_VIDEO, {(void*)opt_video_bitrate_min}, "set min video bitrate tolerance (in kbit/s)", "bitrate" },
{ "bufsize", HAS_ARG | OPT_VIDEO, {(void*)opt_video_buffer_size}, "set ratecontrol buffer size (in kByte)", "size" },
{ "vcodec", HAS_ARG | OPT_VIDEO, {(void*)opt_video_codec}, "force video codec ('copy' to copy stream)", "codec" },
- { "me", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_motion_estimation}, "set motion estimation method",
+ { "me", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_motion_estimation}, "set motion estimation method",
"method" },
{ "me_threshold", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_me_threshold}, "motion estimaton threshold", "" },
{ "mb_threshold", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_mb_threshold}, "macroblock threshold", "" },
{ "ps", HAS_ARG | OPT_EXPERT, {(void*)opt_packet_size}, "set packet size in bits", "size" },
{ "error", HAS_ARG | OPT_EXPERT, {(void*)opt_error_rate}, "error rate", "rate" },
{ "strict", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_strict}, "how strictly to follow the standards", "strictness" },
- { "sameq", OPT_BOOL | OPT_VIDEO, {(void*)&same_quality},
+ { "sameq", OPT_BOOL | OPT_VIDEO, {(void*)&same_quality},
"use same video quality as source (implies VBR)" },
{ "pass", HAS_ARG | OPT_VIDEO, {(void*)&opt_pass}, "select the pass number (1 or 2)", "n" },
{ "passlogfile", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void*)&pass_logfilename}, "select two pass log file name", "file" },
- { "deinterlace", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_deinterlace},
+ { "deinterlace", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_deinterlace},
"deinterlace pictures" },
{ "psnr", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_psnr}, "calculate PSNR of compressed frames" },
- { "vstats", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_vstats}, "dump video coding statistics to file" },
+ { "vstats", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_vstats}, "dump video coding statistics to file" },
{ "vhook", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)add_frame_hooker}, "insert video processing module", "module" },
{ "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_intra_matrix}, "specify intra matrix coeffs", "matrix" },
{ "inter_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_inter_matrix}, "specify inter matrix coeffs", "matrix" },
{ "scodec", HAS_ARG | OPT_SUBTITLE, {(void*)opt_subtitle_codec}, "force subtitle codec ('copy' to copy stream)", "codec" },
{ "newsubtitle", OPT_SUBTITLE, {(void*)opt_new_subtitle_stream}, "add a new subtitle stream to the current output stream" },
{ "slang", HAS_ARG | OPT_STRING | OPT_SUBTITLE, {(void *)&subtitle_language}, "set the ISO 639 language code (3 letters) of the current subtitle stream" , "code" },
-
+
/* grab options */
{ "vd", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_device}, "set video grab device", "device" },
{ "vc", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_channel}, "set video grab channel (DV1394 only)", "channel" },
{ "tvstd", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_standard}, "set television standard (NTSC, PAL (SECAM))", "standard" },
{ "ad", HAS_ARG | OPT_EXPERT | OPT_AUDIO | OPT_GRAB, {(void*)opt_audio_device}, "set audio device", "device" },
- /* G.2 grab options */
+ /* G.2 grab options */
{ "grab", HAS_ARG | OPT_EXPERT | OPT_GRAB, {(void*)opt_grab}, "request grabbing using", "format" },
{ "gd", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_grab_device}, "set grab device", "device" },
-
- /* muxer options */
+
+ /* muxer options */
{ "muxrate", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&mux_rate}, "set mux rate", "rate" },
{ "packetsize", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&mux_packet_size}, "set packet size", "size" },
{ "muxdelay", OPT_FLOAT | HAS_ARG | OPT_EXPERT, {(void*)&mux_max_delay}, "set the maximum demux-decode delay", "seconds" },
show_banner();
#ifdef CONFIG_GPL
printf(
- "This program is free software; you can redistribute it and/or modify\n"
+ "This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"
"the Free Software Foundation; either version 2 of the License, or\n"
"(at your option) any later version.\n"
show_help_options(options, "Main options:\n",
OPT_EXPERT | OPT_AUDIO | OPT_VIDEO, 0);
show_help_options(options, "\nVideo options:\n",
- OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
+ OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
OPT_VIDEO);
show_help_options(options, "\nAdvanced Video options:\n",
- OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
+ OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
OPT_VIDEO | OPT_EXPERT);
show_help_options(options, "\nAudio options:\n",
- OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
+ OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
OPT_AUDIO);
show_help_options(options, "\nAdvanced Audio options:\n",
- OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
+ OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
OPT_AUDIO | OPT_EXPERT);
show_help_options(options, "\nSubtitle options:\n",
- OPT_SUBTITLE | OPT_GRAB,
+ OPT_SUBTITLE | OPT_GRAB,
OPT_SUBTITLE);
show_help_options(options, "\nAudio/Video grab options:\n",
- OPT_GRAB,
+ OPT_GRAB,
OPT_GRAB);
show_help_options(options, "\nAdvanced options:\n",
- OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
+ OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB,
OPT_EXPERT);
av_opt_show(avctx_opts, NULL);
-
+
exit(1);
}
int64_t ti;
av_register_all();
-
+
avctx_opts= avcodec_alloc_context();
if (argc <= 1)
show_help();
else
show_banner();
-
+
/* parse options */
parse_options(argc, argv, options);
fprintf(stderr, "Must supply at least one output file\n");
exit(1);
}
-
+
if (nb_input_files == 0) {
input_sync = 1;
prepare_grab();
}
ti = getutime();
- av_encode(output_files, nb_output_files, input_files, nb_input_files,
+ av_encode(output_files, nb_output_files, input_files, nb_input_files,
stream_maps, nb_stream_maps);
ti = getutime() - ti;
if (do_benchmark) {
av_free(intra_matrix);
if(inter_matrix)
av_free(inter_matrix);
-
+
#ifdef POWERPC_PERFORMANCE_REPORT
extern void powerpc_display_perf_report(void);
powerpc_display_perf_report();
#define INCL_DOS
#include <os2.h>
#include <stdio.h>
-
+
void MorphToPM()
{
PPIB pib;
PTIB tib;
-
+
DosGetInfoBlocks(&tib, &pib);
-
+
// Change flag from VIO to PM:
if (pib->pib_ultype==2) pib->pib_ultype = 3;
}
int dtg_active_format;
int audio_stream;
-
+
int av_sync_type;
double external_clock; /* external clock base */
int64_t external_clock_time;
-
+
double audio_clock;
double audio_diff_cum; /* used for AV difference average computation */
double audio_diff_avg_coef;
int audio_hw_buf_size;
/* samples output by the codec. we reserve more space for avsync
compensation */
- uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
+ uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2];
unsigned int audio_buf_size; /* in bytes */
int audio_buf_index; /* in bytes */
AVPacket audio_pkt;
uint8_t *audio_pkt_data;
int audio_pkt_size;
-
+
int show_audio; /* if true, display audio samples */
int16_t sample_array[SAMPLE_ARRAY_SIZE];
int sample_array_index;
int last_i_start;
-
+
SDL_Thread *subtitle_tid;
int subtitle_stream;
int subtitle_stream_changed;
int subpq_size, subpq_rindex, subpq_windex;
SDL_mutex *subpq_mutex;
SDL_cond *subpq_cond;
-
+
double frame_timer;
double frame_last_pts;
double frame_last_delay;
- double video_clock; ///<pts of last decoded frame / predicted pts of next decoded frame
+ double video_clock; ///<pts of last decoded frame / predicted pts of next decoded frame
int video_stream;
AVStream *video_st;
PacketQueue videoq;
int pictq_size, pictq_rindex, pictq_windex;
SDL_mutex *pictq_mutex;
SDL_cond *pictq_cond;
-
+
SDL_mutex *video_decoder_mutex;
SDL_mutex *audio_decoder_mutex;
SDL_mutex *subtitle_decoder_mutex;
/* duplicate the packet */
if (av_dup_packet(pkt) < 0)
return -1;
-
+
pkt1 = av_malloc(sizeof(AVPacketList));
if (!pkt1)
return -1;
SDL_LockMutex(q->mutex);
q->abort_request = 1;
-
+
SDL_CondSignal(q->cond);
SDL_UnlockMutex(q->mutex);
ret = -1;
break;
}
-
+
pkt1 = q->first_pkt;
if (pkt1) {
q->first_pkt = pkt1->next;
return ret;
}
-static inline void fill_rectangle(SDL_Surface *screen,
+static inline void fill_rectangle(SDL_Surface *screen,
int x, int y, int w, int h, int color)
{
SDL_Rect rect;
h2 = s->height - (y + h);
if (h2 < 0)
h2 = 0;
- fill_rectangle(screen,
- s->xleft, s->ytop,
- w1, s->height,
+ fill_rectangle(screen,
+ s->xleft, s->ytop,
+ w1, s->height,
color);
- fill_rectangle(screen,
- s->xleft + s->width - w2, s->ytop,
- w2, s->height,
+ fill_rectangle(screen,
+ s->xleft + s->width - w2, s->ytop,
+ w2, s->height,
color);
- fill_rectangle(screen,
- s->xleft + w1, s->ytop,
- s->width - w1 - w2, h1,
+ fill_rectangle(screen,
+ s->xleft + w1, s->ytop,
+ s->width - w1 - w2, h1,
color);
- fill_rectangle(screen,
+ fill_rectangle(screen,
s->xleft + w1, s->ytop + s->height - h2,
s->width - w1 - w2, h2,
color);
wrap3 = rect->linesize;
p = rect->bitmap;
pal = rect->rgba_palette; /* Now in YCrCb! */
-
+
if (rect->y & 1) {
lum += rect->x;
cb += skip2;
cr += skip2;
-
+
if (rect->x & 1) {
YUVA_IN(y, u, v, a, p, pal);
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
lum += rect->x;
cb += skip2;
cr += skip2;
-
+
if (rect->x & 1) {
YUVA_IN(y, u, v, a, p, pal);
u1 = u;
lum += rect->x;
cb += skip2;
cr += skip2;
-
+
if (rect->x & 1) {
YUVA_IN(y, u, v, a, p, pal);
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
static void free_subpicture(SubPicture *sp)
{
int i;
-
+
for (i = 0; i < sp->sub.num_rects; i++)
{
av_free(sp->sub.rects[i].bitmap);
av_free(sp->sub.rects[i].rgba_palette);
}
-
+
av_free(sp->sub.rects);
-
+
memset(&sp->sub, 0, sizeof(AVSubtitle));
}
vp = &is->pictq[is->pictq_rindex];
if (vp->bmp) {
/* XXX: use variable in the frame */
- if (is->video_st->codec->sample_aspect_ratio.num == 0)
+ if (is->video_st->codec->sample_aspect_ratio.num == 0)
aspect_ratio = 0;
else
- aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio)
+ aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio)
* is->video_st->codec->width / is->video_st->codec->height;;
if (aspect_ratio <= 0.0)
- aspect_ratio = (float)is->video_st->codec->width /
+ aspect_ratio = (float)is->video_st->codec->width /
(float)is->video_st->codec->height;
/* if an active format is indicated, then it overrides the
mpeg format */
SDL_DisplayYUVOverlay(vp->bmp, &rect);
} else {
#if 0
- fill_rectangle(screen,
- is->xleft, is->ytop, is->width, is->height,
+ fill_rectangle(screen,
+ is->xleft, is->ytop, is->width, is->height,
QERGB(0x00, 0x00, 0x00));
#endif
}
static inline int compute_mod(int a, int b)
{
a = a % b;
- if (a >= 0)
+ if (a >= 0)
return a;
else
return a + b;
int i, i_start, x, y1, y, ys, delay, n, nb_display_channels;
int ch, channels, h, h2, bgcolor, fgcolor;
int16_t time_diff;
-
+
/* compute display index : center on currently output samples */
channels = s->audio_st->codec->channels;
nb_display_channels = channels;
n = 2 * channels;
delay = audio_write_get_buf_size(s);
delay /= n;
-
+
/* to be more precise, we take into account the time spent since
the last buffer computation */
if (audio_callback_time) {
time_diff = av_gettime() - audio_callback_time;
delay += (time_diff * s->audio_st->codec->sample_rate) / 1000000;
}
-
+
delay -= s->width / 2;
if (delay < s->width)
delay = s->width;
}
bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
- fill_rectangle(screen,
- s->xleft, s->ytop, s->width, s->height,
+ fill_rectangle(screen,
+ s->xleft, s->ytop, s->width, s->height,
bgcolor);
fgcolor = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
} else {
ys = y1;
}
- fill_rectangle(screen,
- s->xleft + x, ys, 1, y,
+ fill_rectangle(screen,
+ s->xleft + x, ys, 1, y,
fgcolor);
i += channels;
if (i >= SAMPLE_ARRAY_SIZE)
for(ch = 1;ch < nb_display_channels; ch++) {
y = s->ytop + ch * h;
- fill_rectangle(screen,
- s->xleft, y, s->width, 1,
+ fill_rectangle(screen,
+ s->xleft, y, s->width, 1,
fgcolor);
}
SDL_UpdateRect(screen, s->xleft, s->ytop, s->width, s->height);
/* display the current picture, if any */
static void video_display(VideoState *is)
{
- if (is->audio_st && is->show_audio)
+ if (is->audio_st && is->show_audio)
video_audio_display(is);
else if (is->video_st)
video_image_display(is);
hw_buf_size = audio_write_get_buf_size(is);
bytes_per_sec = 0;
if (is->audio_st) {
- bytes_per_sec = is->audio_st->codec->sample_rate *
+ bytes_per_sec = is->audio_st->codec->sample_rate *
2 * is->audio_st->codec->channels;
}
if (bytes_per_sec)
duplicating or deleting a frame */
ref_clock = get_master_clock(is);
diff = vp->pts - ref_clock;
-
+
/* skip or repeat frame. We take into account the
delay to compute the threshold. I still don't know
if it is the best guess */
schedule_refresh(is, (int)(actual_delay * 1000 + 0.5));
#if defined(DEBUG_SYNC)
- printf("video: delay=%0.3f actual_delay=%0.3f pts=%0.3f A-V=%f\n",
+ printf("video: delay=%0.3f actual_delay=%0.3f pts=%0.3f A-V=%f\n",
delay, actual_delay, vp->pts, -diff);
#endif
if(is->subtitle_st) {
if (is->subtitle_stream_changed) {
SDL_LockMutex(is->subpq_mutex);
-
+
while (is->subpq_size) {
free_subpicture(&is->subpq[is->subpq_rindex]);
-
+
/* update queue size and signal for next picture */
if (++is->subpq_rindex == SUBPICTURE_QUEUE_SIZE)
is->subpq_rindex = 0;
-
+
is->subpq_size--;
}
is->subtitle_stream_changed = 0;
/* display picture */
video_display(is);
-
+
/* update queue size and signal for next picture */
if (++is->pictq_rindex == VIDEO_PICTURE_QUEUE_SIZE)
is->pictq_rindex = 0;
-
+
SDL_LockMutex(is->pictq_mutex);
is->pictq_size--;
SDL_CondSignal(is->pictq_cond);
/* if only audio stream, then display the audio bars (better
than nothing, just to test the implementation */
-
+
/* display picture */
video_display(is);
} else {
int64_t cur_time;
int aqsize, vqsize, sqsize;
double av_diff;
-
+
cur_time = av_gettime();
if (!last_time || (cur_time - last_time) >= 500 * 1000) {
aqsize = 0;
av_diff = 0;
if (is->audio_st && is->video_st)
av_diff = get_audio_clock(is) - get_video_clock(is);
- printf("%7.2f A-V:%7.3f aq=%5dKB vq=%5dKB sq=%5dB \r",
+ printf("%7.2f A-V:%7.3f aq=%5dKB vq=%5dKB sq=%5dB \r",
get_master_clock(is), av_diff, aqsize / 1024, vqsize / 1024, sqsize);
fflush(stdout);
last_time = cur_time;
#endif
vp->bmp = SDL_CreateYUVOverlay(is->video_st->codec->width,
is->video_st->codec->height,
- SDL_YV12_OVERLAY,
+ SDL_YV12_OVERLAY,
screen);
vp->width = is->video_st->codec->width;
vp->height = is->video_st->codec->height;
VideoPicture *vp;
int dst_pix_fmt;
AVPicture pict;
-
+
/* wait until we have space to put a new picture */
SDL_LockMutex(is->pictq_mutex);
while (is->pictq_size >= VIDEO_PICTURE_QUEUE_SIZE &&
SDL_CondWait(is->pictq_cond, is->pictq_mutex);
}
SDL_UnlockMutex(is->pictq_mutex);
-
+
if (is->videoq.abort_request)
return -1;
vp = &is->pictq[is->pictq_windex];
/* alloc or resize hardware picture buffer */
- if (!vp->bmp ||
+ if (!vp->bmp ||
vp->width != is->video_st->codec->width ||
vp->height != is->video_st->codec->height) {
SDL_Event event;
event.type = FF_ALLOC_EVENT;
event.user.data1 = is;
SDL_PushEvent(&event);
-
+
/* wait until the picture is allocated */
SDL_LockMutex(is->pictq_mutex);
while (!vp->allocated && !is->videoq.abort_request) {
pict.linesize[0] = vp->bmp->pitches[0];
pict.linesize[1] = vp->bmp->pitches[2];
pict.linesize[2] = vp->bmp->pitches[1];
- img_convert(&pict, dst_pix_fmt,
- (AVPicture *)src_frame, is->video_st->codec->pix_fmt,
+ img_convert(&pict, dst_pix_fmt,
+ (AVPicture *)src_frame, is->video_st->codec->pix_fmt,
is->video_st->codec->width, is->video_st->codec->height);
/* update the bitmap content */
SDL_UnlockYUVOverlay(vp->bmp);
return 0;
}
-/**
- * compute the exact PTS for the picture if it is omitted in the stream
+/**
+ * compute the exact PTS for the picture if it is omitted in the stream
* @param pts1 the dts of the pkt / pts of the frame
*/
static int output_picture2(VideoState *is, AVFrame *src_frame, double pts1)
{
double frame_delay, pts;
-
+
pts = pts1;
if (pts != 0) {
ftype = 'I';
else
ftype = 'P';
- printf("frame_type=%c clock=%0.3f pts=%0.3f\n",
+ printf("frame_type=%c clock=%0.3f pts=%0.3f\n",
ftype, pts, pts1);
}
#endif
pts = av_q2d(is->video_st->time_base)*pkt->dts;
SDL_LockMutex(is->video_decoder_mutex);
- len1 = avcodec_decode_video(is->video_st->codec,
- frame, &got_picture,
+ len1 = avcodec_decode_video(is->video_st->codec,
+ frame, &got_picture,
pkt->data, pkt->size);
SDL_UnlockMutex(is->video_decoder_mutex);
// if (len1 < 0)
goto the_end;
}
av_free_packet(pkt);
- if (step)
+ if (step)
if (cur_stream)
stream_pause(cur_stream);
}
}
if (packet_queue_get(&is->subtitleq, pkt, 1) < 0)
break;
-
+
SDL_LockMutex(is->subpq_mutex);
while (is->subpq_size >= SUBPICTURE_QUEUE_SIZE &&
!is->subtitleq.abort_request) {
SDL_CondWait(is->subpq_cond, is->subpq_mutex);
}
SDL_UnlockMutex(is->subpq_mutex);
-
+
if (is->subtitleq.abort_request)
goto the_end;
-
+
sp = &is->subpq[is->subpq_windex];
/* NOTE: ipts is the PTS of the _first_ picture beginning in
pts = av_q2d(is->subtitle_st->time_base)*pkt->pts;
SDL_LockMutex(is->subtitle_decoder_mutex);
- len1 = avcodec_decode_subtitle(is->subtitle_st->codec,
- &sp->sub, &got_subtitle,
+ len1 = avcodec_decode_subtitle(is->subtitle_st->codec,
+ &sp->sub, &got_subtitle,
pkt->data, pkt->size);
SDL_UnlockMutex(is->subtitle_decoder_mutex);
// if (len1 < 0)
// break;
if (got_subtitle && sp->sub.format == 0) {
sp->pts = pts;
-
+
for (i = 0; i < sp->sub.num_rects; i++)
{
for (j = 0; j < sp->sub.rects[i].nb_colors; j++)
SDL_UnlockMutex(is->subpq_mutex);
}
av_free_packet(pkt);
-// if (step)
+// if (step)
// if (cur_stream)
// stream_pause(cur_stream);
}
/* return the new audio buffer size (samples can be added or deleted
to get better sync if video or external master clock) */
-static int synchronize_audio(VideoState *is, short *samples,
+static int synchronize_audio(VideoState *is, short *samples,
int samples_size1, double pts)
{
int n, samples_size;
double ref_clock;
-
+
n = 2 * is->audio_st->codec->channels;
samples_size = samples_size1;
is->av_sync_type == AV_SYNC_EXTERNAL_CLOCK)) {
double diff, avg_diff;
int wanted_size, min_size, max_size, nb_samples;
-
+
ref_clock = get_master_clock(is);
diff = get_audio_clock(is) - ref_clock;
-
+
if (diff < AV_NOSYNC_THRESHOLD) {
is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum;
if (is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {
if (fabs(avg_diff) >= is->audio_diff_threshold) {
wanted_size = samples_size + ((int)(diff * is->audio_st->codec->sample_rate) * n);
nb_samples = samples_size / n;
-
+
min_size = ((nb_samples * (100 - SAMPLE_CORRECTION_PERCENT_MAX)) / 100) * n;
max_size = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX)) / 100) * n;
if (wanted_size < min_size)
wanted_size = min_size;
else if (wanted_size > max_size)
wanted_size = max_size;
-
+
/* add or remove samples to correction the synchro */
if (wanted_size < samples_size) {
/* remove samples */
} else if (wanted_size > samples_size) {
uint8_t *samples_end, *q;
int nb;
-
+
/* add samples */
nb = (samples_size - wanted_size);
samples_end = (uint8_t *)samples + samples_size - n;
}
}
#if 0
- printf("diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
- diff, avg_diff, samples_size - samples_size1,
+ printf("diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
+ diff, avg_diff, samples_size - samples_size1,
is->audio_clock, is->video_clock, is->audio_diff_threshold);
#endif
}
/* NOTE: the audio packet can contain several frames */
while (is->audio_pkt_size > 0) {
SDL_LockMutex(is->audio_decoder_mutex);
- len1 = avcodec_decode_audio(is->audio_st->codec,
- (int16_t *)audio_buf, &data_size,
+ len1 = avcodec_decode_audio(is->audio_st->codec,
+ (int16_t *)audio_buf, &data_size,
is->audio_pkt_data, is->audio_pkt_size);
SDL_UnlockMutex(is->audio_decoder_mutex);
if (len1 < 0) {
is->audio_pkt_size = 0;
break;
}
-
+
is->audio_pkt_data += len1;
is->audio_pkt_size -= len1;
if (data_size <= 0)
pts = is->audio_clock;
*pts_ptr = pts;
n = 2 * is->audio_st->codec->channels;
- is->audio_clock += (double)data_size /
+ is->audio_clock += (double)data_size /
(double)(n * is->audio_st->codec->sample_rate);
#if defined(DEBUG_SYNC)
{
/* free the current packet */
if (pkt->data)
av_free_packet(pkt);
-
+
if (is->paused || is->audioq.abort_request) {
return -1;
}
-
+
/* read next packet */
if (packet_queue_get(&is->audioq, pkt, 1) < 0)
return -1;
is->audio_pkt_data = pkt->data;
is->audio_pkt_size = pkt->size;
-
+
/* if update the audio clock with the pts */
if (pkt->pts != AV_NOPTS_VALUE) {
is->audio_clock = av_q2d(is->audio_st->time_base)*pkt->pts;
double pts;
audio_callback_time = av_gettime();
-
+
while (len > 0) {
if (is->audio_buf_index >= is->audio_buf_size) {
audio_size = audio_decode_frame(is, is->audio_buf, &pts);
} else {
if (is->show_audio)
update_sample_display(is, (int16_t *)is->audio_buf, audio_size);
- audio_size = synchronize_audio(is, (int16_t *)is->audio_buf, audio_size,
+ audio_size = synchronize_audio(is, (int16_t *)is->audio_buf, audio_size,
pts);
is->audio_buf_size = audio_size;
}
if (stream_index < 0 || stream_index >= ic->nb_streams)
return -1;
enc = ic->streams[stream_index]->codec;
-
+
/* prepare audio output */
if (enc->codec_type == CODEC_TYPE_AUDIO) {
wanted_spec.freq = enc->sample_rate;
is->subtitle_stream = stream_index;
is->subtitle_st = ic->streams[stream_index];
packet_queue_init(&is->subtitleq);
-
+
is->subtitle_tid = SDL_CreateThread(subtitle_thread, is);
break;
default:
{
AVFormatContext *ic = is->ic;
AVCodecContext *enc;
-
+
if (stream_index < 0 || stream_index >= ic->nb_streams)
return;
enc = ic->streams[stream_index]->codec;
break;
case CODEC_TYPE_SUBTITLE:
packet_queue_abort(&is->subtitleq);
-
+
/* note: we also signal this mutex to make sure we deblock the
video thread in all cases */
SDL_LockMutex(is->subpq_mutex);
is->subtitle_stream_changed = 1;
-
+
SDL_CondSignal(is->subpq_cond);
SDL_UnlockMutex(is->subpq_mutex);
ap->image_format = image_format;
ap->initial_pause = 1; /* we force a pause when starting an RTSP
stream */
-
+
err = av_open_input_file(&ic, is->filename, is->iformat, 0, ap);
if (err < 0) {
print_error(is->filename, err);
timestamp += ic->start_time;
ret = av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD);
if (ret < 0) {
- fprintf(stderr, "%s: could not seek to position %0.3f\n",
+ fprintf(stderr, "%s: could not seek to position %0.3f\n",
is->filename, (double)timestamp / AV_TIME_BASE);
}
}
/* if the queue are full, no need to read more */
if (is->audioq.size > MAX_AUDIOQ_SIZE ||
- is->videoq.size > MAX_VIDEOQ_SIZE ||
- is->subtitleq.size > MAX_SUBTITLEQ_SIZE ||
+ is->videoq.size > MAX_VIDEOQ_SIZE ||
+ is->subtitleq.size > MAX_SUBTITLEQ_SIZE ||
url_feof(&ic->pb)) {
/* wait 10 ms */
SDL_Delay(10);
if (ret != 0) {
SDL_Event event;
-
+
event.type = FF_QUIT_EVENT;
event.user.data1 = is;
SDL_PushEvent(&event);
/* start video display */
is->pictq_mutex = SDL_CreateMutex();
is->pictq_cond = SDL_CreateCond();
-
+
is->subpq_mutex = SDL_CreateMutex();
is->subpq_cond = SDL_CreateCond();
-
+
is->subtitle_decoder_mutex = SDL_CreateMutex();
is->audio_decoder_mutex = SDL_CreateMutex();
is->video_decoder_mutex = SDL_CreateMutex();
step_to_next_frame();
break;
case SDLK_a:
- if (cur_stream)
+ if (cur_stream)
stream_cycle_channel(cur_stream, CODEC_TYPE_AUDIO);
break;
case SDLK_v:
- if (cur_stream)
+ if (cur_stream)
stream_cycle_channel(cur_stream, CODEC_TYPE_VIDEO);
break;
case SDLK_t:
- if (cur_stream)
+ if (cur_stream)
stream_cycle_channel(cur_stream, CODEC_TYPE_SUBTITLE);
break;
case SDLK_w:
break;
case SDL_VIDEORESIZE:
if (cur_stream) {
- screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
+ screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
cur_stream->width = event.resize.w;
cur_stream->height = event.resize.h;
static void opt_image_format(const char *arg)
{
AVImageFormat *f;
-
+
for(f = first_image_format; f != NULL; f = f->next) {
if (!strcmp(arg, f->name))
break;
{
debug = atoi(arg);
}
-
+
static void opt_vismv(const char *arg)
{
debug_mv = atoi(arg);
fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n");
#endif
}
-
+
const OptionDef options[] = {
- { "h", 0, {(void*)show_help}, "show help" },
+ { "h", 0, {(void*)show_help}, "show help" },
{ "x", HAS_ARG, {(void*)opt_width}, "force displayed width", "width" },
{ "y", HAS_ARG, {(void*)opt_height}, "force displayed height", "height" },
#if 0
int main(int argc, char **argv)
{
int flags, w, h;
-
+
/* register all codecs, demux and protocols */
av_register_all();
#ifdef CONFIG_OS2
MorphToPM(); // Morph the VIO application to a PM one to be able to use Win* functions
-
+
// Make stdout and stderr unbuffered
setbuf( stdout, NULL );
setbuf( stderr, NULL );
HTTPSTATE_SEND_DATA_HEADER,
HTTPSTATE_SEND_DATA, /* sending TCP or UDP data */
HTTPSTATE_SEND_DATA_TRAILER,
- HTTPSTATE_RECEIVE_DATA,
+ HTTPSTATE_RECEIVE_DATA,
HTTPSTATE_WAIT_FEED, /* wait for data from the feed */
HTTPSTATE_READY,
uint8_t *buffer;
int is_packetized; /* if true, the stream is packetized */
int packet_stream_index; /* current stream for output in state machine */
-
+
/* RTSP state specific */
uint8_t *pb_buffer; /* XXX: use that in all the code */
ByteIOContext *pb;
int seq; /* RTSP sequence number */
-
+
/* RTP state specific */
enum RTSPProtocol rtp_protocol;
char session_id[32]; /* session id */
static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h);
/* SDP handling */
-static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
+static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
struct in_addr my_ip);
/* RTP handling */
-static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
+static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
FFStream *stream, const char *session_id,
enum RTSPProtocol rtp_protocol);
-static int rtp_new_av_stream(HTTPContext *c,
+static int rtp_new_av_stream(HTTPContext *c,
int stream_index, struct sockaddr_in *dest_addr,
HTTPContext *rtsp_c);
static FILE *logfile = NULL;
-static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ...)
+static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
-
+
if (logfile) {
vfprintf(logfile, fmt, ap);
fflush(logfile);
{
char buf2[32];
- if (c->suppress_log)
+ if (c->suppress_log)
return;
- http_log("%s - - [%s] \"%s %s %s\" %d %"PRId64"\n",
- inet_ntoa(c->from_addr.sin_addr),
- ctime1(buf2), c->method, c->url,
+ http_log("%s - - [%s] \"%s %s %s\" %d %"PRId64"\n",
+ inet_ntoa(c->from_addr.sin_addr),
+ ctime1(buf2), c->method, c->url,
c->protocol, (c->http_error ? c->http_error : 200), c->data_count);
}
{
if (cur_time == drd->time1)
return 0;
-
+
return ((count - drd->count1) * 1000) / (cur_time - drd->time1);
}
perror ("socket");
return -1;
}
-
+
tmp = 1;
setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
close(server_fd);
return -1;
}
-
+
if (listen (server_fd, 5) < 0) {
perror ("listen");
close(server_fd);
for(stream = first_stream; stream != NULL; stream = stream->next) {
if (stream->is_multicast) {
/* open the RTP connection */
- snprintf(session_id, sizeof(session_id),
+ snprintf(session_id, sizeof(session_id),
"%08x%08x", (int)random(), (int)random());
/* choose a port if none given */
dest_addr.sin_addr = stream->multicast_ip;
dest_addr.sin_port = htons(stream->multicast_port);
- rtp_c = rtp_new_connection(&dest_addr, stream, session_id,
+ rtp_c = rtp_new_connection(&dest_addr, stream, session_id,
RTSP_PROTOCOL_RTP_UDP_MULTICAST);
if (!rtp_c) {
continue;
}
if (open_input_stream(rtp_c, "") < 0) {
- fprintf(stderr, "Could not open input stream for stream '%s'\n",
+ fprintf(stderr, "Could not open input stream for stream '%s'\n",
stream->filename);
continue;
}
/* open each RTP stream */
- for(stream_index = 0; stream_index < stream->nb_streams;
+ for(stream_index = 0; stream_index < stream->nb_streams;
stream_index++) {
- dest_addr.sin_port = htons(stream->multicast_port +
+ dest_addr.sin_port = htons(stream->multicast_port +
2 * stream_index);
if (rtp_new_av_stream(rtp_c, stream_index, &dest_addr, NULL) < 0) {
- fprintf(stderr, "Could not open output stream '%s/streamid=%d'\n",
+ fprintf(stderr, "Could not open output stream '%s/streamid=%d'\n",
stream->filename, stream_index);
exit(1);
}
rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
if (rtsp_server_fd < 0)
return -1;
-
+
http_log("ffserver started.\n");
start_children(first_feed);
if (ret < 0 && errno != EAGAIN && errno != EINTR)
return -1;
} while (ret <= 0);
-
+
cur_time = gettime_ms();
if (need_to_start_children) {
HTTPContext *c = NULL;
len = sizeof(from_addr);
- fd = accept(server_fd, (struct sockaddr *)&from_addr,
+ fd = accept(server_fd, (struct sockaddr *)&from_addr,
&len);
if (fd < 0)
return;
close to the connection limit */
if (nb_connections >= nb_max_connections)
goto fail;
-
+
/* add a new connection */
c = av_mallocz(sizeof(HTTPContext));
if (!c)
goto fail;
-
+
c->fd = fd;
c->poll_entry = NULL;
c->from_addr = from_addr;
c->next = first_http_ctx;
first_http_ctx = c;
nb_connections++;
-
+
start_wait_request(c, is_rtsp);
return;
/* free RTP output streams if any */
nb_streams = 0;
- if (c->stream)
+ if (c->stream)
nb_streams = c->stream->nb_streams;
-
+
for(i=0;i<nb_streams;i++) {
ctx = c->rtp_ctx[i];
if (ctx) {
url_close(h);
}
}
-
+
ctx = &c->fmt_ctx;
if (!c->last_packet_sent) {
}
}
- for(i=0; i<ctx->nb_streams; i++)
- av_free(ctx->streams[i]) ;
+ for(i=0; i<ctx->nb_streams; i++)
+ av_free(ctx->streams[i]) ;
if (c->stream && !c->post && c->stream->stream_type == STREAM_TYPE_LIVE)
current_bandwidth -= c->stream->bandwidth;
static int handle_connection(HTTPContext *c)
{
int len, ret;
-
+
switch(c->state) {
case HTTPSTATE_WAIT_REQUEST:
case RTSPSTATE_WAIT_REQUEST:
if (!c->is_packetized) {
if (c->poll_entry->revents & (POLLERR | POLLHUP))
return -1;
-
+
/* no need to read if no events */
if (!(c->poll_entry->revents & POLLOUT))
return 0;
/* no need to write if no events */
if (!(c->poll_entry->revents & POLLOUT))
return 0;
- len = write(c->fd, c->packet_buffer_ptr,
+ len = write(c->fd, c->packet_buffer_ptr,
c->packet_buffer_end - c->packet_buffer_ptr);
if (len < 0) {
if (errno != EAGAIN && errno != EINTR) {
/* Potential stream */
- /* We want the fastest stream less than bit_rate, or the slowest
+ /* We want the fastest stream less than bit_rate, or the slowest
* faster than bit_rate
*/
static void do_switch_stream(HTTPContext *c, int i)
{
if (c->switch_feed_streams[i] >= 0) {
-#ifdef PHILIP
+#ifdef PHILIP
c->feed_streams[i] = c->switch_feed_streams[i];
#endif
if (ffserver_debug)
http_log("New connection: %s %s\n", cmd, url);
-
+
/* find the filename and the optional info string in the request */
p = url;
if (*p == '/')
redir_type = REDIR_SDP;
compute_real_filename(filename, sizeof(url) - 1);
}
-
+
stream = first_stream;
while (stream != NULL) {
if (!strcmp(stream->filename, filename) && validate_acl(stream, c))
if (c->post == 0 && stream->stream_type == STREAM_TYPE_LIVE) {
current_bandwidth += stream->bandwidth;
}
-
+
if (c->post == 0 && max_bandwidth < current_bandwidth) {
c->http_error = 200;
q = c->buffer;
c->state = HTTPSTATE_SEND_HEADER;
return 0;
}
-
+
if (redir_type != REDIR_NONE) {
char *hostinfo = 0;
-
+
for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
if (strncasecmp(p, "Host:", 5) == 0) {
hostinfo = p + 5;
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ASX Version=\"3\">\r\n");
//q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<!-- Autogenerated by ffserver -->\r\n");
- q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ENTRY><REF HREF=\"http://%s/%s%s\"/></ENTRY>\r\n",
+ q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ENTRY><REF HREF=\"http://%s/%s%s\"/></ENTRY>\r\n",
hostbuf, filename, info);
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</ASX>\r\n");
break;
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: audio/x-pn-realaudio\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "# Autogenerated by ffserver\r\n");
- q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "http://%s/%s%s\r\n",
+ q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "http://%s/%s%s\r\n",
hostbuf, filename, info);
break;
case REDIR_ASF:
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: video/x-ms-asf\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "[Reference]\r\n");
- q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Ref1=http://%s/%s%s\r\n",
+ q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Ref1=http://%s/%s%s\r\n",
hostbuf, filename, info);
break;
case REDIR_RTSP:
/* XXX: incorrect mime type ? */
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: application/x-rtsp\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
- q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "rtsp://%s:%d/%s\r\n",
- hostname, ntohs(my_rtsp_addr.sin_port),
+ q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "rtsp://%s:%d/%s\r\n",
+ hostname, ntohs(my_rtsp_addr.sin_port),
filename);
}
break;
len = sizeof(my_addr);
getsockname(c->fd, (struct sockaddr *)&my_addr, &len);
-
+
/* XXX: should use a dynamic buffer */
- sdp_data_size = prepare_sdp_description(stream,
- &sdp_data,
+ sdp_data_size = prepare_sdp_description(stream,
+ &sdp_data,
my_addr.sin_addr);
if (sdp_data_size > 0) {
memcpy(q, sdp_data, sdp_data_size);
*/
char *logline = 0;
int client_id = 0;
-
+
for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) {
if (strncasecmp(p, "Pragma: log-line=", 17) == 0) {
logline = p;
}
}
}
-
+
snprintf(msg, sizeof(msg), "POST command not handled");
c->stream = 0;
goto send_error;
}
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-Type: %s\r\n", mime_type);
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
-
+
/* prepare output buffer */
c->http_error = 0;
c->buffer_ptr = c->buffer;
url_fprintf(pb, "Content-type: %s\r\n", "text/html");
url_fprintf(pb, "Pragma: no-cache\r\n");
url_fprintf(pb, "\r\n");
-
+
url_fprintf(pb, "<HEAD><TITLE>FFServer Status</TITLE>\n");
if (c->stream->feed_filename) {
url_fprintf(pb, "<link rel=\"shortcut icon\" href=\"%s\">\n", c->stream->feed_filename);
strcpy(eosf, ".rtsp");
}
}
-
- url_fprintf(pb, "<TR><TD><A HREF=\"/%s\">%s</A> ",
+
+ url_fprintf(pb, "<TR><TD><A HREF=\"/%s\">%s</A> ",
sfilename, stream->filename);
url_fprintf(pb, "<td align=right> %d <td align=right> ",
stream->conns_served);
av_abort();
}
}
- url_fprintf(pb, "<TD align=center> %s <TD align=right> %d <TD align=right> %d <TD> %s %s <TD align=right> %d <TD> %s %s",
+ url_fprintf(pb, "<TD align=center> %s <TD align=right> %d <TD align=right> %d <TD> %s %s <TD align=right> %d <TD> %s %s",
stream->fmt->name,
stream->bandwidth,
video_bit_rate / 1000, video_codec_name, video_codec_name_extra,
char ps_cmd[64];
/* This is somewhat linux specific I guess */
- snprintf(ps_cmd, sizeof(ps_cmd),
- "ps -o \"%%cpu,cputime\" --no-headers %d",
+ snprintf(ps_cmd, sizeof(ps_cmd),
+ "ps -o \"%%cpu,cputime\" --no-headers %d",
stream->pid);
-
+
pid_stat = popen(ps_cmd, "r");
if (pid_stat) {
char cpuperc[10];
char cpuused[64];
-
- if (fscanf(pid_stat, "%10s %64s", cpuperc,
+
+ if (fscanf(pid_stat, "%10s %64s", cpuperc,
cpuused) == 2) {
url_fprintf(pb, "Currently using %s%% of the cpu. Total time used %s.\n",
cpuperc, cpuused);
}
url_fprintf(pb, "</table>\n");
- }
+ }
stream = stream->next;
}
-
+
#if 0
{
float avg;
AVCodecContext *enc;
char buf[1024];
-
+
/* feed status */
stream = first_feed;
while (stream != NULL) {
AVStream *st = stream->streams[i];
FeedData *fdata = st->priv_data;
enc = st->codec;
-
+
avcodec_string(buf, sizeof(buf), enc);
avg = fdata->avg_frame_size * (float)enc->rate * 8.0;
if (enc->codec->type == CODEC_TYPE_AUDIO && enc->frame_size > 0)
avg /= enc->frame_size;
- url_fprintf(pb, "<TR><TD>%s <TD> %d <TD> %Ld <TD> %0.1f\n",
+ url_fprintf(pb, "<TR><TD>%s <TD> %d <TD> %Ld <TD> %0.1f\n",
buf, enc->frame_number, fdata->data_count, avg / 1000.0);
}
url_fprintf(pb, "</TABLE>\n");
i++;
p = inet_ntoa(c1->from_addr.sin_addr);
- url_fprintf(pb, "<TR><TD><B>%d</B><TD>%s%s<TD>%s<TD>%s<TD>%s<td align=right>",
- i,
- c1->stream ? c1->stream->filename : "",
+ url_fprintf(pb, "<TR><TD><B>%d</B><TD>%s%s<TD>%s<TD>%s<TD>%s<td align=right>",
+ i,
+ c1->stream ? c1->stream->filename : "",
c1->state == HTTPSTATE_RECEIVE_DATA ? "(input)" : "",
- p,
+ p,
c1->protocol,
http_state[c1->state]);
fmt_bytecount(pb, bitrate);
c1 = c1->next;
}
url_fprintf(pb, "</TABLE>\n");
-
+
/* date */
ti = time(NULL);
p = ctime(&ti);
#endif
/* open stream */
- if (av_open_input_file(&s, input_filename, c->stream->ifmt,
+ if (av_open_input_file(&s, input_filename, c->stream->ifmt,
buf_size, c->stream->ap_in) < 0) {
http_log("%s not found", input_filename);
return -1;
}
c->fmt_in = s;
-
+
/* open each parser */
for(i=0;i<s->nb_streams;i++)
open_parser(s, i);
present) for packet sending */
c->pts_stream_index = 0;
for(i=0;i<c->stream->nb_streams;i++) {
- if (c->pts_stream_index == 0 &&
+ if (c->pts_stream_index == 0 &&
c->stream->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) {
c->pts_stream_index = i;
}
static int64_t get_packet_send_clock(HTTPContext *c)
{
int bytes_left, bytes_sent, frame_bytes;
-
+
frame_bytes = c->cur_frame_bytes;
if (frame_bytes <= 0) {
return c->cur_pts;
switch(c->state) {
case HTTPSTATE_SEND_DATA_HEADER:
memset(&c->fmt_ctx, 0, sizeof(c->fmt_ctx));
- pstrcpy(c->fmt_ctx.author, sizeof(c->fmt_ctx.author),
+ pstrcpy(c->fmt_ctx.author, sizeof(c->fmt_ctx.author),
c->stream->author);
- pstrcpy(c->fmt_ctx.comment, sizeof(c->fmt_ctx.comment),
+ pstrcpy(c->fmt_ctx.comment, sizeof(c->fmt_ctx.comment),
c->stream->comment);
- pstrcpy(c->fmt_ctx.copyright, sizeof(c->fmt_ctx.copyright),
+ pstrcpy(c->fmt_ctx.copyright, sizeof(c->fmt_ctx.copyright),
c->stream->copyright);
- pstrcpy(c->fmt_ctx.title, sizeof(c->fmt_ctx.title),
+ pstrcpy(c->fmt_ctx.title, sizeof(c->fmt_ctx.title),
c->stream->title);
/* open output stream by using specified codecs */
st->codec= avcodec_alloc_context();
c->fmt_ctx.streams[i] = st;
/* if file or feed, then just take streams from FFStream struct */
- if (!c->stream->feed ||
+ if (!c->stream->feed ||
c->stream->feed == c->stream)
src = c->stream->streams[i];
else
/* find a new packet */
{
AVPacket pkt;
-
+
/* read a packet from the input stream */
if (c->stream->feed) {
- ffm_set_write_index(c->fmt_in,
+ ffm_set_write_index(c->fmt_in,
c->stream->feed->feed_write_index,
c->stream->feed->feed_size);
}
- if (c->stream->max_time &&
+ if (c->stream->max_time &&
c->stream->max_time + c->start_time - cur_time < 0) {
/* We have timed out */
c->state = HTTPSTATE_SEND_DATA_TRAILER;
if (pkt.flags & PKT_FLAG_KEY) {
c->got_key_frame |= 1 << i;
}
- /* See if we have all the key frames, then
+ /* See if we have all the key frames, then
* we start to send. This logic is not quite
- * right, but it works for the case of a
+ * right, but it works for the case of a
* single video stream with one or more
- * audio streams (for which every frame is
- * typically a key frame).
+ * audio streams (for which every frame is
+ * typically a key frame).
*/
- if (!c->stream->send_on_key ||
+ if (!c->stream->send_on_key ||
((c->got_key_frame + 1) >> c->stream->nb_streams)) {
goto send_it;
}
}
} else {
AVCodecContext *codec;
-
+
send_it:
/* specific handling for RTP: we use several
output stream (one for each RTP
#if 0
printf("index=%d pts=%0.3f duration=%0.6f\n",
pkt.stream_index,
- (double)c->cur_pts /
+ (double)c->cur_pts /
AV_TIME_BASE,
- (double)c->cur_frame_duration /
+ (double)c->cur_frame_duration /
AV_TIME_BASE);
#endif
/* find RTP context */
/* Fudge here */
codec = ctx->streams[pkt.stream_index]->codec;
}
-
+
codec->coded_frame->key_frame = ((pkt.flags & PKT_FLAG_KEY) != 0);
if (c->is_packetized) {
int max_packet_size;
if (av_write_frame(ctx, &pkt)) {
c->state = HTTPSTATE_SEND_DATA_TRAILER;
}
-
+
len = url_close_dyn_buf(&ctx->pb, &c->pb_buffer);
c->cur_frame_bytes = len;
c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len;
-
+
codec->frame_number++;
if (len == 0)
goto redo;
int interleaved_index, size;
uint8_t header[4];
HTTPContext *rtsp_c;
-
+
rtsp_c = c->rtsp_c;
/* if no RTSP connection left, error */
if (!rtsp_c)
rtsp_c->packet_buffer_ptr = c->packet_buffer;
rtsp_c->packet_buffer_end = c->packet_buffer + size;
c->buffer_ptr += len;
-
+
/* send everything we can NOW */
- len = write(rtsp_c->fd, rtsp_c->packet_buffer_ptr,
+ len = write(rtsp_c->fd, rtsp_c->packet_buffer_ptr,
rtsp_c->packet_buffer_end - rtsp_c->packet_buffer_ptr);
if (len > 0) {
rtsp_c->packet_buffer_ptr += len;
} else {
/* send RTP packet directly in UDP */
c->buffer_ptr += 4;
- url_write(c->rtp_handles[c->packet_stream_index],
+ url_write(c->rtp_handles[c->packet_stream_index],
c->buffer_ptr, len);
c->buffer_ptr += len;
/* here we continue as we can send several packets per 10 ms slot */
if (fd < 0)
return -1;
c->feed_fd = fd;
-
+
c->stream->feed_write_index = ffm_read_write_index(fd);
c->stream->feed_size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
c->stream->feed_opened = 1;
return 0;
}
-
+
static int http_receive_data(HTTPContext *c)
{
HTTPContext *c1;
/* a packet has been received : write it in the store, except
if header */
if (c->data_count > FFM_PACKET_SIZE) {
-
+
// printf("writing pos=0x%Lx size=0x%Lx\n", feed->feed_write_index, feed->feed_size);
/* XXX: use llseek or url_seek */
lseek(c->feed_fd, feed->feed_write_index, SEEK_SET);
write(c->feed_fd, c->buffer, FFM_PACKET_SIZE);
-
+
feed->feed_write_index += FFM_PACKET_SIZE;
/* update file size */
if (feed->feed_write_index > c->stream->feed_size)
/* wake up any waiting connections */
for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) {
- if (c1->state == HTTPSTATE_WAIT_FEED &&
+ if (c1->state == HTTPSTATE_WAIT_FEED &&
c1->stream->feed == c->stream->feed) {
c1->state = HTTPSTATE_SEND_DATA;
}
goto fail;
}
for (i = 0; i < s.nb_streams; i++) {
- memcpy(feed->streams[i]->codec,
+ memcpy(feed->streams[i]->codec,
s.streams[i]->codec, sizeof(AVCodecContext));
- }
+ }
av_freep(&s.priv_data);
}
c->buffer_ptr = c->buffer;
char buf2[32];
switch(error_number) {
-#define DEF(n, c, s) case c: str = s; break;
+#define DEF(n, c, s) case c: str = s; break;
#include "rtspcodes.h"
#undef DEF
default:
str = "Unknown Error";
break;
}
-
+
url_fprintf(c->pb, "RTSP/1.0 %d %s\r\n", error_number, str);
url_fprintf(c->pb, "CSeq: %d\r\n", c->seq);
ByteIOContext pb1;
int len;
RTSPHeader header1, *header = &header1;
-
+
c->buffer_ptr[0] = '\0';
p = c->buffer;
-
+
get_word(cmd, sizeof(cmd), &p);
get_word(url, sizeof(url), &p);
get_word(protocol, sizeof(protocol), &p);
/* XXX: move that to rtsp.c, but would need to replace FFStream by
AVFormatContext */
-static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
+static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
struct in_addr my_ip)
{
ByteIOContext pb1, *pb = &pb1;
int i, payload_type, port, private_payload_type, j;
const char *ipstr, *title, *mediatype;
AVStream *st;
-
+
if (url_open_dyn_buf(pb) < 0)
return -1;
-
+
/* general media info */
url_fprintf(pb, "v=0\n");
} else {
port = 0;
}
- url_fprintf(pb, "m=%s %d RTP/AVP %d\n",
+ url_fprintf(pb, "m=%s %d RTP/AVP %d\n",
mediatype, port, payload_type);
if (payload_type >= RTP_PT_PRIVATE) {
/* for private payload type, we need to give more info */
case CODEC_ID_MPEG4:
{
uint8_t *data;
- url_fprintf(pb, "a=rtpmap:%d MP4V-ES/%d\n",
+ url_fprintf(pb, "a=rtpmap:%d MP4V-ES/%d\n",
payload_type, 90000);
/* we must also add the mpeg4 header */
data = st->codec->extradata;
uint8_t *content;
int content_length, len;
struct sockaddr_in my_addr;
-
+
/* find which url is asked */
url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
return NULL;
}
-static void rtsp_cmd_setup(HTTPContext *c, const char *url,
+static void rtsp_cmd_setup(HTTPContext *c, const char *url,
RTSPHeader *h)
{
FFStream *stream;
RTSPTransportField *th;
struct sockaddr_in dest_addr;
RTSPActionServerSetup setup;
-
+
/* find which url is asked */
url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
stream_index = 0;
goto found;
}
-
+
for(stream_index = 0; stream_index < stream->nb_streams;
stream_index++) {
- snprintf(buf, sizeof(buf), "%s/streamid=%d",
+ snprintf(buf, sizeof(buf), "%s/streamid=%d",
stream->filename, stream_index);
if (!strcmp(path, buf))
goto found;
/* generate session id if needed */
if (h->session_id[0] == '\0') {
- snprintf(h->session_id, sizeof(h->session_id),
+ snprintf(h->session_id, sizeof(h->session_id),
"%08x%08x", (int)random(), (int)random());
}
return;
}
}
-
+
/* test if stream is OK (test needed because several SETUP needs
to be done for a given file) */
if (rtp_c->stream != stream) {
rtsp_reply_error(c, RTSP_STATUS_SERVICE);
return;
}
-
+
/* test if stream is already set up */
if (rtp_c->rtp_ctx[stream_index]) {
rtsp_reply_error(c, RTSP_STATUS_STATE);
/* check transport */
th = find_transport(h, rtp_c->rtp_protocol);
- if (!th || (th->protocol == RTSP_PROTOCOL_RTP_UDP &&
+ if (!th || (th->protocol == RTSP_PROTOCOL_RTP_UDP &&
th->client_port_min <= 0)) {
rtsp_reply_error(c, RTSP_STATUS_TRANSPORT);
return;
setup.transport_option[0] = '\0';
dest_addr = rtp_c->from_addr;
dest_addr.sin_port = htons(th->client_port_min);
-
+
/* add transport option if needed */
if (ff_rtsp_callback) {
setup.ipaddr = ntohl(dest_addr.sin_addr.s_addr);
- if (ff_rtsp_callback(RTSP_ACTION_SERVER_SETUP, rtp_c->session_id,
+ if (ff_rtsp_callback(RTSP_ACTION_SERVER_SETUP, rtp_c->session_id,
(char *)&setup, sizeof(setup),
stream->rtsp_option) < 0) {
rtsp_reply_error(c, RTSP_STATUS_TRANSPORT);
}
dest_addr.sin_addr.s_addr = htonl(setup.ipaddr);
}
-
+
/* setup stream */
if (rtp_new_av_stream(rtp_c, stream_index, &dest_addr, c) < 0) {
rtsp_reply_error(c, RTSP_STATUS_TRANSPORT);
url_fprintf(c->pb, ";%s", setup.transport_option);
}
url_fprintf(c->pb, "\r\n");
-
+
url_fprintf(c->pb, "\r\n");
}
/* find an rtp connection by using the session ID. Check consistency
with filename */
-static HTTPContext *find_rtp_session_with_url(const char *url,
+static HTTPContext *find_rtp_session_with_url(const char *url,
const char *session_id)
{
HTTPContext *rtp_c;
rtsp_reply_error(c, RTSP_STATUS_SESSION);
return;
}
-
+
if (rtp_c->state != HTTPSTATE_SEND_DATA &&
rtp_c->state != HTTPSTATE_WAIT_FEED &&
rtp_c->state != HTTPSTATE_READY) {
#endif
rtp_c->state = HTTPSTATE_SEND_DATA;
-
+
/* now everything is OK, so we can send the connection parameters */
rtsp_reply_header(c, RTSP_STATUS_OK);
/* session ID */
rtsp_reply_error(c, RTSP_STATUS_SESSION);
return;
}
-
+
if (rtp_c->state != HTTPSTATE_SEND_DATA &&
rtp_c->state != HTTPSTATE_WAIT_FEED) {
rtsp_reply_error(c, RTSP_STATUS_STATE);
return;
}
-
+
rtp_c->state = HTTPSTATE_READY;
rtp_c->first_pts = AV_NOPTS_VALUE;
/* now everything is OK, so we can send the connection parameters */
rtsp_reply_error(c, RTSP_STATUS_SESSION);
return;
}
-
+
/* abort the session */
close_connection(rtp_c);
if (ff_rtsp_callback) {
- ff_rtsp_callback(RTSP_ACTION_SERVER_TEARDOWN, rtp_c->session_id,
+ ff_rtsp_callback(RTSP_ACTION_SERVER_TEARDOWN, rtp_c->session_id,
NULL, 0,
rtp_c->stream->rtsp_option);
}
/********************************************************************/
/* RTP handling */
-static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
+static HTTPContext *rtp_new_connection(struct sockaddr_in *from_addr,
FFStream *stream, const char *session_id,
enum RTSPProtocol rtp_protocol)
{
HTTPContext *c = NULL;
const char *proto_str;
-
+
/* XXX: should output a warning page when coming
close to the connection limit */
if (nb_connections >= nb_max_connections)
goto fail;
-
+
/* add a new connection */
c = av_mallocz(sizeof(HTTPContext));
if (!c)
goto fail;
-
+
c->fd = -1;
c->poll_entry = NULL;
c->from_addr = *from_addr;
c->next = first_http_ctx;
first_http_ctx = c;
return c;
-
+
fail:
if (c) {
av_free(c->buffer);
/* add a new RTP stream in an RTP connection (used in RTSP SETUP
command). If RTP/TCP protocol is used, TCP connection 'rtsp_c' is
used. */
-static int rtp_new_av_stream(HTTPContext *c,
+static int rtp_new_av_stream(HTTPContext *c,
int stream_index, struct sockaddr_in *dest_addr,
HTTPContext *rtsp_c)
{
uint8_t *dummy_buf;
char buf2[32];
int max_packet_size;
-
+
/* now we can open the relevant output stream */
ctx = av_alloc_format_context();
if (!ctx)
ctx->nb_streams = 1;
ctx->streams[0] = st;
- if (!c->stream->feed ||
+ if (!c->stream->feed ||
c->stream->feed == c->stream) {
memcpy(st, c->stream->streams[stream_index], sizeof(AVStream));
} else {
- memcpy(st,
+ memcpy(st,
c->stream->feed->streams[c->stream->feed_streams[stream_index]],
sizeof(AVStream));
}
-
+
/* build destination RTP address */
ipaddr = inet_ntoa(dest_addr->sin_addr);
case RTSP_PROTOCOL_RTP_UDP:
case RTSP_PROTOCOL_RTP_UDP_MULTICAST:
/* RTP/UDP case */
-
+
/* XXX: also pass as parameter to function ? */
if (c->stream->is_multicast) {
int ttl;
if (!ttl)
ttl = 16;
snprintf(ctx->filename, sizeof(ctx->filename),
- "rtp://%s:%d?multicast=1&ttl=%d",
+ "rtp://%s:%d?multicast=1&ttl=%d",
ipaddr, ntohs(dest_addr->sin_port), ttl);
} else {
snprintf(ctx->filename, sizeof(ctx->filename),
}
http_log("%s:%d - - [%s] \"PLAY %s/streamid=%d %s\"\n",
- ipaddr, ntohs(dest_addr->sin_port),
- ctime1(buf2),
+ ipaddr, ntohs(dest_addr->sin_port),
+ ctime1(buf2),
c->stream->filename, stream_index, c->protocol);
/* normally, no packets should be output here, but the packet size may be checked */
}
url_close_dyn_buf(&ctx->pb, &dummy_buf);
av_free(dummy_buf);
-
+
c->rtp_ctx[stream_index] = ctx;
return 0;
}
}
}
}
-
+
fst = add_av_stream1(feed, av);
if (!fst)
return -1;
p = pkt.data;
while (p < pkt.data + pkt.size - 4) {
/* stop when vop header is found */
- if (p[0] == 0x00 && p[1] == 0x00 &&
+ if (p[0] == 0x00 && p[1] == 0x00 &&
p[2] == 0x01 && p[3] == 0xb6) {
size = p - pkt.data;
// av_hex_dump(pkt.data, size);
stream->ap_in->mpeg2ts_raw = 1;
stream->ap_in->mpeg2ts_compute_pcr = 1;
}
-
- if (av_open_input_file(&infile, stream->feed_filename,
+
+ if (av_open_input_file(&infile, stream->feed_filename,
stream->ifmt, 0, stream->ap_in) < 0) {
http_log("%s not found", stream->feed_filename);
/* remove stream (no need to spend more time on it) */
/* find all the AVStreams inside and reference them in
'stream' */
if (av_find_stream_info(infile) < 0) {
- http_log("Could not find codec parameters from '%s'",
+ http_log("Could not find codec parameters from '%s'",
stream->feed_filename);
av_close_input_file(infile);
goto fail;
if (sf->index != ss->index ||
sf->id != ss->id) {
- printf("Index & Id do not match for stream %d (%s)\n",
+ printf("Index & Id do not match for stream %d (%s)\n",
i, feed->feed_filename);
matches = 0;
} else {
{
int bandwidth, i;
FFStream *stream;
-
+
for(stream = first_stream; stream != NULL; stream = stream->next) {
bandwidth = 0;
for(i=0;i<stream->nb_streams;i++) {
av->qcompress = 0.5;
av->qblur = 0.5;
- if (!av->nsse_weight)
+ if (!av->nsse_weight)
av->nsse_weight = 8;
av->frame_skip_cmp = FF_CMP_DCTMAX;
filename, dlerror());
return;
}
-
+
init_func = dlsym(dll, "ffserver_module_init");
if (!init_func) {
- fprintf(stderr,
+ fprintf(stderr,
"%s: init function 'ffserver_module_init()' not found\n",
filename);
dlclose(dll);
perror(filename);
return -1;
}
-
+
errors = 0;
line_num = 0;
first_stream = NULL;
break;
line_num++;
p = line;
- while (isspace(*p))
+ while (isspace(*p))
p++;
if (*p == '\0' || *p == '#')
continue;
get_arg(cmd, sizeof(cmd), &p);
-
+
if (!strcasecmp(cmd, "Port")) {
get_arg(arg, sizeof(arg), &p);
my_http_addr.sin_port = htons (atoi(arg));
} else if (!strcasecmp(cmd, "BindAddress")) {
get_arg(arg, sizeof(arg), &p);
if (!inet_aton(arg, &my_http_addr.sin_addr)) {
- fprintf(stderr, "%s:%d: Invalid IP address: %s\n",
+ fprintf(stderr, "%s:%d: Invalid IP address: %s\n",
filename, line_num, arg);
errors++;
}
} else if (!strcasecmp(cmd, "RTSPBindAddress")) {
get_arg(arg, sizeof(arg), &p);
if (!inet_aton(arg, &my_rtsp_addr.sin_addr)) {
- fprintf(stderr, "%s:%d: Invalid IP address: %s\n",
+ fprintf(stderr, "%s:%d: Invalid IP address: %s\n",
filename, line_num, arg);
errors++;
}
get_arg(arg, sizeof(arg), &p);
val = atoi(arg);
if (val < 1 || val > HTTP_MAX_CONNECTIONS) {
- fprintf(stderr, "%s:%d: Invalid MaxClients: %s\n",
+ fprintf(stderr, "%s:%d: Invalid MaxClients: %s\n",
filename, line_num, arg);
errors++;
} else {
get_arg(arg, sizeof(arg), &p);
val = atoi(arg);
if (val < 10 || val > 100000) {
- fprintf(stderr, "%s:%d: Invalid MaxBandwidth: %s\n",
+ fprintf(stderr, "%s:%d: Invalid MaxBandwidth: %s\n",
filename, line_num, arg);
errors++;
} else {
/* add in feed list */
*last_feed = feed;
last_feed = &feed->next_feed;
-
+
get_arg(feed->filename, sizeof(feed->filename), &p);
q = strrchr(feed->filename, '>');
if (*q)
feed->child_argv[i] = av_malloc(30 + strlen(feed->filename));
snprintf(feed->child_argv[i], 30+strlen(feed->filename),
- "http://%s:%d/%s",
+ "http://%s:%d/%s",
(my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
inet_ntoa(my_http_addr.sin_addr),
ntohs(my_http_addr.sin_port), feed->filename);
-
+
if (ffserver_debug)
{
int j;
#if 0
} else {
/* Make sure that we start out clean */
- if (unlink(feed->feed_filename) < 0
+ if (unlink(feed->feed_filename) < 0
&& errno != ENOENT) {
fprintf(stderr, "%s:%d: Unable to clean old feed file '%s': %s\n",
filename, line_num, feed->feed_filename, strerror(errno));
get_arg(arg, sizeof(arg), &p);
if (stream) {
FFStream *sfeed;
-
+
sfeed = first_feed;
while (sfeed != NULL) {
if (!strcmp(sfeed->filename, arg))
strcpy(arg, "mjpeg");
stream->fmt = guess_stream_format(arg, NULL, NULL);
if (!stream->fmt) {
- fprintf(stderr, "%s:%d: Unknown Format: %s\n",
+ fprintf(stderr, "%s:%d: Unknown Format: %s\n",
filename, line_num, arg);
errors++;
}
} else if (!strcasecmp(cmd, "InputFormat")) {
stream->ifmt = av_find_input_format(arg);
if (!stream->ifmt) {
- fprintf(stderr, "%s:%d: Unknown input format: %s\n",
+ fprintf(stderr, "%s:%d: Unknown input format: %s\n",
filename, line_num, arg);
}
} else if (!strcasecmp(cmd, "FaviconURL")) {
if (stream && stream->stream_type == STREAM_TYPE_STATUS) {
get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
} else {
- fprintf(stderr, "%s:%d: FaviconURL only permitted for status streams\n",
+ fprintf(stderr, "%s:%d: FaviconURL only permitted for status streams\n",
filename, line_num);
errors++;
}
get_arg(arg, sizeof(arg), &p);
audio_id = opt_audio_codec(arg);
if (audio_id == CODEC_ID_NONE) {
- fprintf(stderr, "%s:%d: Unknown AudioCodec: %s\n",
+ fprintf(stderr, "%s:%d: Unknown AudioCodec: %s\n",
filename, line_num, arg);
errors++;
}
get_arg(arg, sizeof(arg), &p);
video_id = opt_video_codec(arg);
if (video_id == CODEC_ID_NONE) {
- fprintf(stderr, "%s:%d: Unknown VideoCodec: %s\n",
+ fprintf(stderr, "%s:%d: Unknown VideoCodec: %s\n",
filename, line_num, arg);
errors++;
}
video_enc.rc_min_rate = minrate * 1000;
video_enc.rc_max_rate = maxrate * 1000;
} else {
- fprintf(stderr, "%s:%d: Incorrect format for VideoBitRateRange -- should be <min>-<max>: %s\n",
+ fprintf(stderr, "%s:%d: Incorrect format for VideoBitRateRange -- should be <min>-<max>: %s\n",
filename, line_num, arg);
errors++;
}
get_arg(arg, sizeof(arg), &p);
if (stream) {
if (!inet_aton(arg, &stream->multicast_ip)) {
- fprintf(stderr, "%s:%d: Invalid IP address: %s\n",
+ fprintf(stderr, "%s:%d: Invalid IP address: %s\n",
filename, line_num, arg);
errors++;
}
#ifdef CONFIG_HAVE_DLOPEN
load_module(arg);
#else
- fprintf(stderr, "%s:%d: Module support not compiled into this version: '%s'\n",
+ fprintf(stderr, "%s:%d: Module support not compiled into this version: '%s'\n",
filename, line_num, arg);
errors++;
#endif
} else {
- fprintf(stderr, "%s:%d: Incorrect keyword: '%s'\n",
+ fprintf(stderr, "%s:%d: Incorrect keyword: '%s'\n",
filename, line_num, cmd);
errors++;
}
if (uptime < 30) {
/* Turn off any more restarts */
feed->child_argv = 0;
- }
+ }
}
}
}
my_program_name = argv[0];
my_program_dir = getcwd(0, 0);
ffserver_daemon = 1;
-
+
for(;;) {
c = getopt(argc, argv, "ndLh?f:");
if (c == -1)
my_rtsp_addr.sin_family = AF_INET;
my_rtsp_addr.sin_port = htons (5454);
my_rtsp_addr.sin_addr.s_addr = htonl (INADDR_ANY);
-
+
nb_max_connections = 5;
max_bandwidth = 1000;
first_stream = NULL;
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file 4xm.c
* 4XM codec.
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
int z5, z10, z11, z12, z13;
int i;
int temp[64];
-
+
for(i=0; i<8; i++){
tmp10 = block[8*0 + i] + block[8*4 + i];
tmp11 = block[8*0 + i] - block[8*4 + i];
tmp3 = tmp10 - tmp13;
tmp1 = tmp11 + tmp12;
tmp2 = tmp11 - tmp12;
-
+
z13 = block[8*5 + i] + block[8*3 + i];
z10 = block[8*5 + i] - block[8*3 + i];
z11 = block[8*1 + i] + block[8*7 + i];
temp[8*4 + i] = tmp3 + tmp4;
temp[8*3 + i] = tmp3 - tmp4;
}
-
+
for(i=0; i<8*8; i+=8){
tmp10 = temp[0 + i] + temp[4 + i];
tmp11 = temp[0 + i] - temp[4 + i];
int i;
for(i=0; i<4; i++){
- init_vlc(&block_type_vlc[i], BLOCK_TYPE_VLC_BITS, 7,
+ init_vlc(&block_type_vlc[i], BLOCK_TYPE_VLC_BITS, 7,
&block_type_tab[i][0][1], 2, 1,
&block_type_tab[i][0][0], 2, 1, 1);
}
const int index= size2index[log2h][log2w];
const int h= 1<<log2h;
int code= get_vlc2(&f->gb, block_type_vlc[index].table, BLOCK_TYPE_VLC_BITS, 1);
-
+
assert(code>=0 && code<=6);
if(code == 0){
const unsigned int bitstream_size= get32(buf+8);
const unsigned int bytestream_size= get32(buf+16);
const unsigned int wordstream_size= get32(buf+12);
-
+
if(bitstream_size+ bytestream_size+ wordstream_size + 20 != length
|| bitstream_size > (1<<26)
|| bytestream_size > (1<<26)
|| wordstream_size > (1<<26)
){
- av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
+ av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
bitstream_size+ bytestream_size+ wordstream_size - length);
return -1;
}
-
+
f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
f->dsp.bswap_buf((uint32_t*)f->bitstream_buffer, (uint32_t*)(buf + 20), bitstream_size/4);
init_get_bits(&f->gb, f->bitstream_buffer, 8*bitstream_size);
f->wordstream= (uint16_t*)(buf + 20 + bitstream_size);
f->bytestream= buf + 20 + bitstream_size + wordstream_size;
-
+
init_mv(f);
-
+
for(y=0; y<height; y+=8){
for(x=0; x<width; x+=8){
decode_p_block(f, dst + x, src + x, 3, 3, stride);
}
- src += 8*stride;
- dst += 8*stride;
+ src += 8*stride;
+ dst += 8*stride;
}
-
+
if(bitstream_size != (get_bits_count(&f->gb)+31)/32*4)
- av_log(f->avctx, AV_LOG_ERROR, " %d %td %td bytes left\n",
- bitstream_size - (get_bits_count(&f->gb)+31)/32*4,
+ av_log(f->avctx, AV_LOG_ERROR, " %d %td %td bytes left\n",
+ bitstream_size - (get_bits_count(&f->gb)+31)/32*4,
bytestream_size - (f->bytestream - (buf + 20 + bitstream_size + wordstream_size)),
wordstream_size - (((uint8_t*)f->wordstream) - (buf + 20 + bitstream_size))
);
-
+
return 0;
}
i = 1;
for(;;) {
code = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
-
+
/* EOB */
if (code == 0)
break;
int stride= f->current_picture.linesize[0]>>1;
int i;
uint16_t *dst = ((uint16_t*)f->current_picture.data[0]) + y * stride + x;
-
+
for(i=0; i<4; i++){
block[i][0] += 0x80*8*8;
idct(block[i]);
y= ( 1b + 4g + 2r)/14
cb=( 3b - 2g - 1r)/14
cr=(-1b - 4g + 5r)/14
-*/
+*/
for(y=0; y<8; y++){
for(x=0; x<8; x++){
DCTELEM *temp= block[(x>>2) + 2*(y>>2)] + 2*(x&3) + 2*8*(y&3); //FIXME optimize
int cr= block[5][x + 8*y];
int cg= (cb + cr)>>1;
int y;
-
+
cb+=cb;
-
+
y = temp[0];
dst[0 ]= ((y+cb)>>3) + (((y-cg)&0xFC)<<3) + (((y+cr)&0xF8)<<8);
y = temp[1];
static int decode_i_mb(FourXContext *f){
int i;
-
+
f->dsp.clear_blocks(f->block[0]);
-
+
for(i=0; i<6; i++){
if(decode_i_block(f, f->block[i]) < 0)
return -1;
}
-
+
return 0;
}
int start, end;
uint8_t *ptr= buf;
int j;
-
+
memset(frequency, 0, sizeof(frequency));
memset(up, -1, sizeof(up));
end= *ptr++;
for(;;){
int i;
-
+
for(i=start; i<=end; i++){
frequency[i]= *ptr++;
// printf("%d %d %d\n", start, end, frequency[i]);
}
start= *ptr++;
if(start==0) break;
-
+
end= *ptr++;
}
frequency[256]=1;
- while((ptr - buf)&3) ptr++; // 4byte align
+ while((ptr - buf)&3) ptr++; // 4byte align
// for(j=0; j<16; j++)
// printf("%2X", ptr[j]);
-
+
for(j=257; j<512; j++){
int min_freq[2]= {256*256, 256*256};
int smallest[2]= {0, 0};
}
}
if(min_freq[1] == 256*256) break;
-
+
frequency[j]= min_freq[0] + min_freq[1];
flag[ smallest[0] ]= 0;
flag[ smallest[1] ]= 1;
- up[ smallest[0] ]=
+ up[ smallest[0] ]=
up[ smallest[1] ]= j;
frequency[ smallest[0] ]= frequency[ smallest[1] ]= 0;
}
len++;
if(len > 31) av_log(f->avctx, AV_LOG_ERROR, "vlc length overflow\n"); //can this happen at all ?
}
-
+
bits_tab[j]= bits;
len_tab[j]= len;
}
-
- init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
+
+ init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
len_tab , 1, 1,
bits_tab, 4, 4, 0);
-
+
return ptr;
}
const int token_count __attribute__((unused)) = get32(buf + bitstream_size + 8);
unsigned int prestream_size= 4*get32(buf + bitstream_size + 4);
uint8_t *prestream= buf + bitstream_size + 12;
-
+
if(prestream_size + bitstream_size + 12 != length
|| bitstream_size > (1<<26)
|| prestream_size > (1<<26)){
av_log(f->avctx, AV_LOG_ERROR, "size mismatch %d %d %d\n", prestream_size, bitstream_size, length);
return -1;
}
-
+
prestream= read_huffman_tables(f, prestream);
init_get_bits(&f->gb, buf + 4, 8*bitstream_size);
init_get_bits(&f->pre_gb, f->bitstream_buffer, 8*prestream_size);
f->last_dc= 0*128*8*8;
-
+
for(y=0; y<height; y+=16){
for(x=0; x<width; x+=16){
if(decode_i_mb(f) < 0)
idct_put(f, x, y);
}
- dst += 16*stride;
+ dst += 16*stride;
}
if(get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
av_log(f->avctx, AV_LOG_ERROR, "end mismatch\n");
-
+
return 0;
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id);
}
-
+
for(i=0; i<CFRAME_BUFFER_COUNT; i++){
if(f->cfrm[i].id == id) break;
if(f->cfrm[i].size == 0 ) free_index= i;
f->cfrm[i].id= id;
}
cfrm= &f->cfrm[i];
-
+
cfrm->data= av_fast_realloc(cfrm->data, &cfrm->allocated_size, cfrm->size + data_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
+
memcpy(cfrm->data + cfrm->size, buf+20, data_size);
cfrm->size += data_size;
-
+
if(cfrm->size >= whole_size){
buf= cfrm->data;
frame_size= cfrm->size;
-
+
if(id != avctx->frame_number){
av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n", id, avctx->frame_number);
}
-
+
cfrm->size= cfrm->id= 0;
frame_4cc= ff_get_fourcc("pfrm");
}else
}else{
buf= buf + 12;
frame_size= buf_size - 12;
- }
+ }
temp= f->current_picture;
f->current_picture= f->last_picture;
*data_size = sizeof(AVPicture);
emms_c();
-
+
return buf_size;
}
static int decode_init(AVCodecContext *avctx){
FourXContext * const f = avctx->priv_data;
-
+
common_init(avctx);
init_vlcs(f);
f->cfrm[i].allocated_size= 0;
}
free_vlc(&f->pre_vlc);
-
+
return 0;
}
unsigned int px_inc;
unsigned int planes = c->planes;
unsigned char *planemap = c->planemap;
-
+
if(c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
ifeq ($(TARGET_ARCH_SPARC),yes)
OBJS+=sparc/dsputil_vis.o
sparc/%.o: sparc/%.c
- $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $<
+ $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $<
endif
ifeq ($(TARGET_ARCH_SPARC64),yes)
CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
$(MAKE) -C libpostproc
%.o: %.c
- $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
%.o: %.S
$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
int8_t *exp, int start, int end,
int snroffset, int fgain, int is_lfe,
- int deltbae,int deltnseg,
+ int deltbae,int deltnseg,
uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba);
#define HEADER_SIZE 7
-static int ac3_decode_frame(AVCodecContext *avctx,
+static int ac3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
short last_samples[AC3_MAX_CHANNELS][256];
unsigned int chbwcod[AC3_MAX_CHANNELS];
int nb_coefs[AC3_MAX_CHANNELS];
-
+
/* bitrate allocation control */
- int sgaincod, sdecaycod, fdecaycod, dbkneecod, floorcod;
+ int sgaincod, sdecaycod, fdecaycod, dbkneecod, floorcod;
AC3BitAllocParameters bit_alloc;
int csnroffst;
int fgaincod[AC3_MAX_CHANNELS];
v = (int)(a * (float)(1 << 15));
if (v < -32767)
v = -32767;
- else if (v > 32767)
+ else if (v > 32767)
v = 32767;
return v;
}
{
if ((b0 + 256) == b1) {
a = 384 ;
- } else if (b0 > b1) {
+ } else if (b0 > b1) {
a = a - 64;
if (a < 0) a=0;
}
if (bin < 7) {
if ((b0 + 256) == b1) {
a = 384 ;
- } else if (b0 > b1) {
+ } else if (b0 > b1) {
a = a - 64;
if (a < 0) a=0;
}
void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
int8_t *exp, int start, int end,
int snroffset, int fgain, int is_lfe,
- int deltbae,int deltnseg,
+ int deltbae,int deltnseg,
uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba)
{
int bin,i,j,k,end1,v,v1,bndstrt,bndend,lowcomp,begin;
/* excitation function */
bndstrt = masktab[start];
bndend = masktab[end-1] + 1;
-
+
if (bndstrt == 0) {
lowcomp = 0;
lowcomp = calc_lowcomp1(lowcomp, bndpsd[0], bndpsd[1]) ;
}
}
}
-
+
end1=bndend;
if (end1 > 22) end1=22;
-
+
for (bin = begin; bin < end1; bin++) {
if (!(is_lfe && bin == 6))
lowcomp = calc_lowcomp(lowcomp, bndpsd[bin], bndpsd[bin+1], bin) ;
-
+
fastleak -= s->fdecay ;
v = bndpsd[bin] - fgain;
if (fastleak < v) fastleak = v;
-
+
slowleak -= s->sdecay ;
v = bndpsd[bin] - s->sgain;
if (slowleak < v) slowleak = v;
-
+
v=fastleak - lowcomp;
if (slowleak > v) v=slowleak;
-
+
excite[bin] = v;
}
begin = 22;
} else {
/* coupling channel */
begin = bndstrt;
-
+
fastleak = (s->cplfleak << 8) + 768;
slowleak = (s->cplsleak << 8) + 768;
}
}
/* compute bit allocation */
-
+
i = start ;
j = masktab[start] ;
do {
p=&z[0];
j=(np >> 1);
do {
- BF(p[0].re, p[0].im, p[1].re, p[1].im,
+ BF(p[0].re, p[0].im, p[1].re, p[1].im,
p[0].re, p[0].im, p[1].re, p[1].im);
p+=2;
} while (--j != 0);
p=&z[0];
j=np >> 2;
do {
- BF(p[0].re, p[0].im, p[2].re, p[2].im,
+ BF(p[0].re, p[0].im, p[2].re, p[2].im,
p[0].re, p[0].im, p[2].re, p[2].im);
- BF(p[1].re, p[1].im, p[3].re, p[3].im,
+ BF(p[1].re, p[1].im, p[3].re, p[3].im,
p[1].re, p[1].im, p[3].im, -p[3].re);
p+=4;
} while (--j != 0);
BF(p->re, p->im, q->re, q->im,
p->re, p->im, q->re, q->im);
-
+
p++;
q++;
for(l = nblocks; l < np2; l += nblocks) {
static void mdct512(int32_t *out, int16_t *in)
{
int i, re, im, re1, im1;
- int16_t rot[N];
+ int16_t rot[N];
IComplex x[N/4];
/* shift to simplify computations */
rot[i] = -in[i + 3*N/4];
for(i=N/4;i<N;i++)
rot[i] = in[i - N/4];
-
+
/* pre rotation */
for(i=0;i<N/4;i++) {
re = ((int)rot[2*i] - (int)rot[N-1-2*i]) >> 1;
}
fft(x, MDCT_NBITS - 2);
-
+
/* post rotation */
for(i=0;i<N/4;i++) {
re = x[i].re;
{
int i, j;
int exp_diff;
-
+
/* estimate if the exponent variation & decide if they should be
reused in the next frame */
exp_strategy[0][ch] = EXP_NEW;
for(i=1;i<NB_BLOCKS;i++) {
exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2);
-#ifdef DEBUG
+#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "exp_diff=%d\n", exp_diff);
#endif
if (exp_diff > EXP_DIFF_THRESHOLD)
exp[i] = exp1[i];
}
}
-
+
/* update the exponents so that they are the ones the decoder will
decode. Return the number of bits used to code the exponents */
-static int encode_exp(uint8_t encoded_exp[N/2],
- uint8_t exp[N/2],
+static int encode_exp(uint8_t encoded_exp[N/2],
+ uint8_t exp[N/2],
int nb_exps,
int exp_strategy)
{
}
k += group_size;
}
-
+
#if defined(DEBUG)
av_log(NULL, AV_LOG_DEBUG, "exponents: strategy=%d\n", exp_strategy);
for(i=0;i<=nb_groups * group_size;i++) {
break;
case 1:
/* 3 mantissa in 5 bits */
- if (s->mant1_cnt == 0)
+ if (s->mant1_cnt == 0)
bits += 5;
if (++s->mant1_cnt == 3)
s->mant1_cnt = 0;
break;
case 2:
/* 3 mantissa in 7 bits */
- if (s->mant2_cnt == 0)
+ if (s->mant2_cnt == 0)
bits += 7;
if (++s->mant2_cnt == 3)
s->mant2_cnt = 0;
/* 2 mantissa in 7 bits */
if (s->mant4_cnt == 0)
bits += 7;
- if (++s->mant4_cnt == 2)
+ if (++s->mant4_cnt == 2)
s->mant4_cnt = 0;
break;
case 14:
s->mant2_cnt = 0;
s->mant4_cnt = 0;
for(ch=0;ch<s->nb_all_channels;ch++) {
- ac3_parametric_bit_allocation(&s->bit_alloc,
- bap[i][ch], (int8_t *)encoded_exp[i][ch],
- 0, s->nb_coefs[ch],
- (((csnroffst-15) << 4) +
- fsnroffst) << 2,
+ ac3_parametric_bit_allocation(&s->bit_alloc,
+ bap[i][ch], (int8_t *)encoded_exp[i][ch],
+ 0, s->nb_coefs[ch],
+ (((csnroffst-15) << 4) +
+ fsnroffst) << 2,
fgaintab[s->fgaincod[ch]],
ch == s->lfe_channel,
2, 0, NULL, NULL, NULL);
- frame_bits += compute_mantissa_size(s, bap[i][ch],
+ frame_bits += compute_mantissa_size(s, bap[i][ch],
s->nb_coefs[ch]);
}
}
#if 0
- printf("csnr=%d fsnr=%d frame_bits=%d diff=%d\n",
- csnroffst, fsnroffst, frame_bits,
+ printf("csnr=%d fsnr=%d frame_bits=%d diff=%d\n",
+ csnroffst, fsnroffst, frame_bits,
16 * s->frame_size - ((frame_bits + 7) & ~7));
#endif
return 16 * s->frame_size - frame_bits;
s->sgaincod = 1;
s->dbkneecod = 2;
s->floorcod = 4;
- for(ch=0;ch<s->nb_all_channels;ch++)
+ for(ch=0;ch<s->nb_all_channels;ch++)
s->fgaincod[ch] = 4;
-
+
/* compute real values */
s->bit_alloc.fscod = s->fscod;
s->bit_alloc.halfratecod = s->halfratecod;
s->bit_alloc.sgain = sgaintab[s->sgaincod];
s->bit_alloc.dbknee = dbkneetab[s->dbkneecod];
s->bit_alloc.floor = floortab[s->floorcod];
-
+
/* header size */
frame_bits += 65;
// if (s->acmod == 2)
offset until we can pack everything in the requested frame size */
csnroffst = s->csnroffst;
- while (csnroffst >= 0 &&
+ while (csnroffst >= 0 &&
bit_alloc(s, bap, encoded_exp, exp_strategy, frame_bits, csnroffst, 0) < 0)
csnroffst -= SNR_INC1;
if (csnroffst < 0) {
av_log(NULL, AV_LOG_ERROR, "Yack, Error !!!\n");
return -1;
}
- while ((csnroffst + SNR_INC1) <= 63 &&
- bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits,
+ while ((csnroffst + SNR_INC1) <= 63 &&
+ bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits,
csnroffst + SNR_INC1, 0) >= 0) {
csnroffst += SNR_INC1;
memcpy(bap, bap1, sizeof(bap1));
}
- while ((csnroffst + 1) <= 63 &&
+ while ((csnroffst + 1) <= 63 &&
bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits, csnroffst + 1, 0) >= 0) {
csnroffst++;
memcpy(bap, bap1, sizeof(bap1));
}
fsnroffst = 0;
- while ((fsnroffst + SNR_INC1) <= 15 &&
- bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits,
+ while ((fsnroffst + SNR_INC1) <= 15 &&
+ bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits,
csnroffst, fsnroffst + SNR_INC1) >= 0) {
fsnroffst += SNR_INC1;
memcpy(bap, bap1, sizeof(bap1));
}
- while ((fsnroffst + 1) <= 15 &&
- bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits,
+ while ((fsnroffst + 1) <= 15 &&
+ bit_alloc(s, bap1, encoded_exp, exp_strategy, frame_bits,
csnroffst, fsnroffst + 1) >= 0) {
fsnroffst++;
memcpy(bap, bap1, sizeof(bap1));
}
-
+
s->csnroffst = csnroffst;
for(ch=0;ch<s->nb_all_channels;ch++)
s->fsnroffst[ch] = fsnroffst;
};
avctx->frame_size = AC3_FRAME_SIZE;
-
+
/* number of channels */
if (channels < 1 || channels > 6)
return -1;
/* frequency */
for(i=0;i<3;i++) {
- for(j=0;j<3;j++)
+ for(j=0;j<3;j++)
if ((ac3_freqs[j] >> i) == freq)
goto found;
}
return -1;
- found:
+ found:
s->sample_rate = freq;
s->halfratecod = i;
s->fscod = j;
s->frame_size_min = (bitrate * 1000 * AC3_FRAME_SIZE) / (freq * 16);
/* for now we do not handle fractional sizes */
s->frame_size = s->frame_size_min;
-
+
/* bit allocation init */
for(ch=0;ch<s->nb_channels;ch++) {
/* bandwidth for each channel */
}
ac3_crc_init();
-
+
avctx->coded_frame= avcodec_alloc_frame();
avctx->coded_frame->key_frame= 1;
uint16_t *qmant1_ptr, *qmant2_ptr, *qmant4_ptr;
int delta0, delta1, delta2;
- for(ch=0;ch<s->nb_channels;ch++)
+ for(ch=0;ch<s->nb_channels;ch++)
put_bits(&s->pb, 1, 0); /* 512 point MDCT */
- for(ch=0;ch<s->nb_channels;ch++)
+ for(ch=0;ch<s->nb_channels;ch++)
put_bits(&s->pb, 1, 1); /* no dither */
put_bits(&s->pb, 1, 0); /* no dynamic range */
if (block_num == 0) {
if(block_num==0)
{
/* first block must define rematrixing (rematstr) */
- put_bits(&s->pb, 1, 1);
-
+ put_bits(&s->pb, 1, 1);
+
/* dummy rematrixing rematflg(1:4)=0 */
for (rbnd=0;rbnd<4;rbnd++)
- put_bits(&s->pb, 1, 0);
+ put_bits(&s->pb, 1, 0);
}
- else
+ else
{
/* no matrixing (but should be used in the future) */
put_bits(&s->pb, 1, 0);
- }
+ }
}
-#if defined(DEBUG)
+#if defined(DEBUG)
{
static int count = 0;
av_log(NULL, AV_LOG_DEBUG, "Block #%d (%d)\n", block_num, count++);
for(ch=0;ch<s->nb_channels;ch++) {
put_bits(&s->pb, 2, exp_strategy[ch]);
}
-
+
if (s->lfe) {
put_bits(&s->pb, 1, exp_strategy[s->lfe_channel]);
}
if (exp_strategy[ch] != EXP_REUSE)
put_bits(&s->pb, 6, s->chbwcod[ch]);
}
-
+
/* exponents */
for (ch = 0; ch < s->nb_all_channels; ch++) {
switch(exp_strategy[ch]) {
put_bits(&s->pb, 3, s->fgaincod[ch]);
}
}
-
+
put_bits(&s->pb, 1, 0); /* no delta bit allocation */
put_bits(&s->pb, 1, 0); /* no data to skip */
/* second pass : output the values */
for (ch = 0; ch < s->nb_all_channels; ch++) {
int b, q;
-
+
for(i=0;i<s->nb_coefs[ch];i++) {
q = qmant[ch][i];
b = bap[ch][i];
case 0:
break;
case 1:
- if (q != 128)
+ if (q != 128)
put_bits(&s->pb, 5, q);
break;
case 2:
- if (q != 128)
+ if (q != 128)
put_bits(&s->pb, 7, q);
break;
case 3:
for(n=0;n<256;n++) {
c = n << 8;
for (k = 0; k < 8; k++) {
- if (c & (1 << 15))
+ if (c & (1 << 15))
c = ((c << 1) & 0xffff) ^ (CRC16_POLY & 0xffff);
else
c = c << 1;
assert(n >= 0);
if(n>0)
memset(pbBufPtr(&s->pb), 0, n);
-
+
/* Now we must compute both crcs : this is not so easy for crc1
because it is at the beginning of the data... */
frame_size_58 = (frame_size >> 1) + (frame_size >> 3);
crc1 = mul_poly(crc_inv, crc1, CRC16_POLY);
frame[2] = crc1 >> 8;
frame[3] = crc1;
-
+
crc2 = ac3_crc(frame + 2 * frame_size_58, (frame_size - frame_size_58) * 2 - 2, 0);
frame[2*frame_size - 2] = crc2 >> 8;
frame[2*frame_size - 1] = crc2;
for(j=0;j<N/2;j++) {
v = *sptr;
input_samples[j + N/2] = v;
- s->last_samples[ch][j] = v;
+ s->last_samples[ch][j] = v;
sptr += sinc;
}
/* apply the MDCT window */
for(j=0;j<N/2;j++) {
- input_samples[j] = MUL16(input_samples[j],
+ input_samples[j] = MUL16(input_samples[j],
ac3_window[j]) >> 15;
- input_samples[N-j-1] = MUL16(input_samples[N-j-1],
+ input_samples[N-j-1] = MUL16(input_samples[N-j-1],
ac3_window[j]) >> 15;
}
-
+
/* Normalize the samples to use the maximum available
precision */
v = 14 - log2_tab(input_samples, N);
/* do the MDCT */
mdct512(mdct_coef[i][ch], input_samples);
-
+
/* compute "exponents". We take into account the
normalization there */
for(j=0;j<N/2;j++) {
exp[i][ch][j] = e;
}
}
-
+
compute_exp_strategy(exp_strategy, exp, ch, ch == s->lfe_channel);
/* compute the exponents as the decoder will see them. The
j++;
}
frame_bits += encode_exp(encoded_exp[i][ch],
- exp[i][ch], s->nb_coefs[ch],
+ exp[i][ch], s->nb_coefs[ch],
exp_strategy[i][ch]);
/* copy encoded exponents for reuse case */
for(k=i+1;k<j;k++) {
- memcpy(encoded_exp[k][ch], encoded_exp[i][ch],
+ memcpy(encoded_exp[k][ch], encoded_exp[i][ch],
s->nb_coefs[ch] * sizeof(uint8_t));
}
i = j;
compute_bit_allocation(s, bap, encoded_exp, exp_strategy, frame_bits);
/* everything is known... let's output the frame */
output_frame_header(s, frame);
-
+
for(i=0;i<NB_BLOCKS;i++) {
- output_audio_block(s, exp_strategy[i], encoded_exp[i],
+ output_audio_block(s, exp_strategy[i], encoded_exp[i],
bap[i], mdct_coef[i], exp_samples[i], i);
}
return output_frame_end(s);
sum_re += in1[n].re * cos(a) - in1[n].im * sin(a);
sum_im += in1[n].re * sin(a) + in1[n].im * cos(a);
}
- printf("%3d: %6d,%6d %6.0f,%6.0f\n",
- k, in[k].re, in[k].im, sum_re / FN, sum_im / FN);
+ printf("%3d: %6d,%6d %6.0f,%6.0f\n",
+ k, in[k].re, in[k].im, sum_re / FN, sum_im / FN);
}
}
}
mdct512(output, input);
-
+
/* do it by hand */
for(k=0;k<N/2;k++) {
s = 0;
}
output1[k] = -2 * s / N;
}
-
+
err = 0;
emax = 0;
for(i=0;i<N/2;i++) {
unsigned char frame[AC3_MAX_CODED_FRAME_SIZE];
short samples[AC3_FRAME_SIZE];
int ret, i;
-
+
AC3_encode_init(&ctx, 44100, 64000, 1);
fft_test();
/* possible bitrates */
static const uint16_t ac3_bitratetab[19] = {
- 32, 40, 48, 56, 64, 80, 96, 112, 128,
- 160, 192, 224, 256, 320, 384, 448, 512, 576, 640
+ 32, 40, 48, 56, 64, 80, 96, 112, 128,
+ 160, 192, 224, 256, 320, 384, 448, 512, 576, 640
};
/* AC3 MDCT window */
32760,32761,32762,32763,32764,32764,32765,32765,
32766,32766,32766,32766,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,
-32767,32767,32767,32767,32767,32767,32767,32767,
+32767,32767,32767,32767,32767,32767,32767,32767,
};
static uint8_t masktab[253];
};
static const uint8_t baptab[64]= {
- 0, 1, 1, 1, 1, 1, 2, 2, 3, 3,
- 3, 4, 4, 5, 5, 6, 6, 6, 6, 7,
- 7, 7, 7, 8, 8, 8, 8, 9, 9, 9,
- 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
- 12, 12, 12, 13, 13, 13, 13, 14, 14, 14,
- 14, 14, 14, 14, 14, 15, 15, 15, 15, 15,
+ 0, 1, 1, 1, 1, 1, 2, 2, 3, 3,
+ 3, 4, 4, 5, 5, 6, 6, 6, 6, 7,
+ 7, 7, 7, 8, 8, 8, 8, 9, 9, 9,
+ 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
+ 12, 12, 12, 13, 13, 13, 13, 14, 14, 14,
+ 14, 14, 14, 14, 14, 15, 15, 15, 15, 15,
15, 15, 15, 15,
};
-static const uint8_t sdecaytab[4]={
+static const uint8_t sdecaytab[4]={
0x0f, 0x11, 0x13, 0x15,
};
-static const uint8_t fdecaytab[4]={
- 0x3f, 0x53, 0x67, 0x7b,
+static const uint8_t fdecaytab[4]={
+ 0x3f, 0x53, 0x67, 0x7b,
};
-static const uint16_t sgaintab[4]= {
+static const uint16_t sgaintab[4]= {
0x540, 0x4d8, 0x478, 0x410,
};
-static const uint16_t dbkneetab[4]= {
+static const uint16_t dbkneetab[4]= {
0x000, 0x700, 0x900, 0xb00,
};
-static const uint16_t floortab[8]= {
+static const uint16_t floortab[8]= {
0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
};
};
static const uint8_t bndsz[50]={
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
- 3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
+ 3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24
};
-static uint8_t bndtab[51];
+static uint8_t bndtab[51];
/* fft & mdct sin cos tables */
static int16_t costab[64];
-1, -1, -1, -1, 2, 4, 6, 8,
};
-/**
+/**
* This is the step table. Note that many programs use slight deviations from
* this table, but such deviations are negligible:
*/
{
int step_index;
unsigned char nibble;
-
+
int sign = 0; /* sign bit of the nibble (MSB) */
int delta, predicted_delta;
CLAMP_TO_SHORT(c->prev_sample);
- nibble += sign << 3; /* sign * 8 */
+ nibble += sign << 3; /* sign * 8 */
/* save back */
c->step_index = step_index;
int predictor, nibble, bias;
predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 256;
-
+
nibble= sample - predictor;
if(nibble>=0) bias= c->idelta/2;
else bias=-c->idelta/2;
-
+
nibble= (nibble + bias) / c->idelta;
nibble= clip(nibble, -8, 7)&0x0F;
-
+
predictor += (signed)((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;
CLAMP_TO_SHORT(predictor);
*dst++ = 0;
samples++;
}
-
+
/* stereo: 4 bytes (8 samples) for left, 4 bytes for right, 4 bytes left, ... */
for (; n>0; n--) {
*dst = adpcm_ima_compress_sample(&c->status[0], samples[0]) & 0x0F;
c->status[i].coeff2 = AdaptCoeff2[predictor];
}
for(i=0; i<avctx->channels; i++){
- if (c->status[i].idelta < 16)
+ if (c->status[i].idelta < 16)
c->status[i].idelta = 16;
-
+
*dst++ = c->status[i].idelta & 0xFF;
*dst++ = c->status[i].idelta >> 8;
}
return c->predictor;
}
-static void xa_decode(short *out, const unsigned char *in,
+static void xa_decode(short *out, const unsigned char *in,
ADPCMChannelStatus *left, ADPCMChannelStatus *right, int inc)
{
int i, j;
c->status[0].coeff2 = AdaptCoeff2[block_predictor[0]];
c->status[1].coeff1 = AdaptCoeff1[block_predictor[1]];
c->status[1].coeff2 = AdaptCoeff2[block_predictor[1]];
-
+
c->status[0].sample1 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
src+=2;
if (st) c->status[1].sample1 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00));
while (src < buf + buf_size) {
/* take care of the top nibble (always left or mono channel) */
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ima_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F, 3);
/* take care of the bottom nibble, which is right sample for
* stereo, or another mono sample */
if (st)
- *samples++ = adpcm_ima_expand_nibble(&c->status[1],
+ *samples++ = adpcm_ima_expand_nibble(&c->status[1],
src[0] & 0x0F, 3);
else
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ima_expand_nibble(&c->status[0],
src[0] & 0x0F, 3);
src++;
while (src < buf + buf_size) {
if (st) {
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ima_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F, 3);
- *samples++ = adpcm_ima_expand_nibble(&c->status[1],
+ *samples++ = adpcm_ima_expand_nibble(&c->status[1],
src[0] & 0x0F, 3);
} else {
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ima_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F, 3);
- *samples++ = adpcm_ima_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ima_expand_nibble(&c->status[0],
src[0] & 0x0F, 3);
}
}
break;
case CODEC_ID_ADPCM_XA:
- c->status[0].sample1 = c->status[0].sample2 =
+ c->status[0].sample1 = c->status[0].sample2 =
c->status[1].sample1 = c->status[1].sample2 = 0;
while (buf_size >= 128) {
- xa_decode(samples, src, &c->status[0], &c->status[1],
+ xa_decode(samples, src, &c->status[0], &c->status[1],
avctx->channels);
src += 128;
samples += 28 * 8;
next_right_sample = (((*src & 0x0F) << 28) >> shift_right);
src++;
- next_left_sample = (next_left_sample +
- (current_left_sample * coeff1l) +
+ next_left_sample = (next_left_sample +
+ (current_left_sample * coeff1l) +
(previous_left_sample * coeff2l) + 0x80) >> 8;
- next_right_sample = (next_right_sample +
- (current_right_sample * coeff1r) +
+ next_right_sample = (next_right_sample +
+ (current_right_sample * coeff1r) +
(previous_right_sample * coeff2r) + 0x80) >> 8;
CLAMP_TO_SHORT(next_left_sample);
CLAMP_TO_SHORT(next_right_sample);
case CODEC_ID_ADPCM_CT:
while (src < buf + buf_size) {
if (st) {
- *samples++ = adpcm_ct_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ct_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F);
- *samples++ = adpcm_ct_expand_nibble(&c->status[1],
+ *samples++ = adpcm_ct_expand_nibble(&c->status[1],
src[0] & 0x0F);
} else {
- *samples++ = adpcm_ct_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ct_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F);
- *samples++ = adpcm_ct_expand_nibble(&c->status[0],
+ *samples++ = adpcm_ct_expand_nibble(&c->status[0],
src[0] & 0x0F);
}
src++;
const int *table;
int k0, signmask;
int size = buf_size*8;
-
+
init_get_bits(&gb, buf, size);
// first frame, read bits & inital values
c->nb_bits = get_bits(&gb, 2)+2;
// av_log(NULL,AV_LOG_INFO,"nb_bits: %d\n", c->nb_bits);
}
-
+
table = swf_index_tables[c->nb_bits-2];
k0 = 1 << (c->nb_bits-2);
signmask = 1 << (c->nb_bits-1);
-
+
while (get_bits_count(&gb) <= size)
{
int i;
int step = step_table[c->status[i].step_index];
long vpdiff = 0; // vpdiff = (delta+0.5)*step/4
int k = k0;
-
+
do {
if (delta & k)
vpdiff += step;
k >>= 1;
} while(k);
vpdiff += step;
-
+
if (delta & signmask)
c->status[i].predictor -= vpdiff;
else
c->status[i].predictor += vpdiff;
-
+
c->status[i].step_index += table[delta & (~signmask)];
-
+
c->status[i].step_index = clip(c->status[i].step_index, 0, 88);
c->status[i].predictor = clip(c->status[i].predictor, -32768, 32767);
-
+
*samples++ = c->status[i].predictor;
}
}
-
+
// src += get_bits_count(&gb)*8;
src += size;
-
+
break;
}
case CODEC_ID_ADPCM_YAMAHA:
long loop_start_byte;
long loop_end_sample;
long loop_end_byte;
- long
+ long
*/
} adxhdr; /* big endian */
/* offset-6 "(c)CRI" */
/* read k, that is bits as is */
k = 31 - rice_kmodifier - count_leading_zeros((history >> 9) + 3);
- if (k < 0)
+ if (k < 0)
k += rice_kmodifier;
- else
+ else
k = rice_kmodifier;
if (k != 1) {
/* initialize from the extradata */
if (!alac->context_initialized) {
if (alac->avctx->extradata_size != ALAC_EXTRADATA_SIZE) {
- av_log(NULL, AV_LOG_ERROR, "alac: expected %d extradata bytes\n",
+ av_log(NULL, AV_LOG_ERROR, "alac: expected %d extradata bytes\n",
ALAC_EXTRADATA_SIZE);
return input_buffer_size;
}
} else {
av_log(NULL, AV_LOG_ERROR, "FIXME: unhandled prediction type: %i\n", prediction_type_b);
}
- } else {
+ } else {
/* not compressed, easy case */
if (alac->setinfo_sample_size <= 16) {
int i;
formats you want to support */
/**
- * simple call to register all the codecs.
+ * simple call to register all the codecs.
*/
void avcodec_register_all(void)
{
static int inited = 0;
-
+
if (inited != 0)
return;
inited = 1;
register_avcodec(&dvbsub_encoder);
#endif
- /* parsers */
+ /* parsers */
av_register_codec_parser(&mpegvideo_parser);
av_register_codec_parser(&mpeg4video_parser);
#if defined(CONFIG_H261_DECODER) || defined(CONFIG_H261_ENCODER)
#define minsw4 __builtin_alpha_minsw4
#define maxub8 __builtin_alpha_maxub8
#define maxsb8 __builtin_alpha_maxsb8
-#define maxuw4 __builtin_alpha_maxuw4
+#define maxuw4 __builtin_alpha_maxuw4
#define maxsw4 __builtin_alpha_maxsw4
#define perr __builtin_alpha_perr
#define pklb __builtin_alpha_pklb
int line_size, int h);
void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
int line_size);
-void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
+void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
int line_size);
void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
-void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
+void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
void get_pixels_mvi(DCTELEM *restrict block,
#if 0
/* These functions were the base for the optimized assembler routines,
and remain here for documentation purposes. */
-static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
+static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
int line_size)
{
int i = 8;
} while (--i);
}
-void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
+void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
int line_size)
{
int h = 8;
shorts0 ^= signs0;
/* Clamp. */
shorts0 = maxsw4(shorts0, 0);
- shorts0 = minsw4(shorts0, clampmask);
+ shorts0 = minsw4(shorts0, clampmask);
/* Next 4. */
pix1 = unpkbw(ldl(pixels + 4));
static inline uint64_t avg2(uint64_t a, uint64_t b)
{
- return (a | b) - (((a ^ b) & BYTE_VEC(0xfe)) >> 1);
+ return (a | b) - (((a ^ b) & BYTE_VEC(0xfe)) >> 1);
}
#if 0
put_pixels_clamped_axp_p = c->put_pixels_clamped;
add_pixels_clamped_axp_p = c->add_pixels_clamped;
-
+
c->idct_put = simple_idct_put_axp;
c->idct_add = simple_idct_add_axp;
c->idct = simple_idct_axp;
#define tf a4
#define tg a3
#define th v0
-
+
.set noat
.set noreorder
.arch pca56
stq t2, 0(t5)
stq t3, 0(t6)
-
+
bne a3, $aligned
ret
.end put_pixels_axp_asm
/************************************************************************
- * void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
+ * void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
* int line_size)
*/
.align 6
addq a1, a2, ta
maxsw4 t3, zero, t3
minsw4 t0, t8, t0
-
+
minsw4 t1, t8, t1
minsw4 t2, t8, t2
minsw4 t3, t8, t3
pkwb t0, t0
-
+
pkwb t1, t1
pkwb t2, t2
pkwb t3, t3
stl t0, 0(a1)
-
+
stl t1, 4(a1)
addq ta, a2, a1
stl t2, 0(ta)
.end put_pixels_clamped_mvi_asm
/************************************************************************
- * void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
+ * void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
* int line_size)
*/
.align 6
bic t0, tg, t0 # 0 2
unpkbw t7, t7 # 2 0
and t3, tg, t5 # 1 1
- addq t0, t1, t0 # 0 3
+ addq t0, t1, t0 # 0 3
xor t0, t2, t0 # 0 4
unpkbw ta, ta # 3 0
and t6, tg, t8 # 2 1
maxsw4 t0, zero, t0 # 0 5
-
+
bic t3, tg, t3 # 1 2
bic t6, tg, t6 # 2 2
minsw4 t0, tf, t0 # 0 6
addq t3, t4, t3 # 1 3
-
+
pkwb t0, t0 # 0 7
xor t3, t5, t3 # 1 4
maxsw4 t3, zero, t3 # 1 5
maxsw4 t6, zero, t6 # 2 5
addq t9, ta, t9 # 3 3
- stl t0, 0(a1) # 0 8
+ stl t0, 0(a1) # 0 8
minsw4 t6, tf, t6 # 2 6
xor t9, tb, t9 # 3 4
maxsw4 t9, zero, t9 # 3 5
lda a0, 32(a0) # block += 16;
pkwb t3, t3 # 1 7
-
+
minsw4 t9, tf, t9 # 3 6
subq th, 2, th
pkwb t6, t6 # 2 7
stl t9, 4(te) # 3 8
bne th, 1b
- ret
+ ret
.end add_pixels_clamped_mvi_asm
p = ldq(pixels);
stq(unpkbw(p), block);
- stq(unpkbw(p >> 32), block + 4);
+ stq(unpkbw(p >> 32), block + 4);
pixels += line_size;
block += 8;
/* |.......l|lllllllr|rrrrrrr*|
This case is special because disalign1 would be 8, which
gets treated as 0 by extqh. At least it is a bit faster
- that way :) */
+ that way :) */
do {
uint64_t p1_l, p1_r, p2_l, p2_r;
uint64_t l, m, r;
p2_r = avg2(extql(m, disalign) | extqh(r, disalign), r);
pix1 += line_size;
pix2 += line_size;
-
+
result += perr(p1_l, p2_l)
+ perr(p1_r, p2_r);
} while (--h);
int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
int result = 0;
-
+
uint64_t p1_l, p1_r;
uint64_t p2_l, p2_r, p2_x;
#define tf a4
#define tg a3
#define th v0
-
+
.set noat
.set noreorder
.arch pca56
ldq t4, 8(a0) # ref right
addq a0, a2, a0 # pix1
addq a1, a2, a1 # pix2
- /* load line 1 */
+ /* load line 1 */
ldq_u t5, 0(a1) # left_u
ldq_u t6, 8(a1) # mid
ldq_u t7, 16(a1) # right_u
qadd = WORD_VEC((qscale - 1) | 1);
qmul = qscale << 1;
- /* This mask kills spill from negative subwords to the next subword. */
+ /* This mask kills spill from negative subwords to the next subword. */
correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
if (!s->h263_aic) {
- if (n < 4)
+ if (n < 4)
block0 = block[0] * s->y_dc_scale;
else
block0 = block[0] * s->c_dc_scale;
} else {
qadd = 0;
}
- n_coeffs = 63; // does not always use zigzag table
+ n_coeffs = 63; // does not always use zigzag table
for(i = 0; i <= n_coeffs; block += 4, i += 4) {
uint64_t levels, negmask, zeros, add;
qadd = WORD_VEC((qscale - 1) | 1);
qmul = qscale << 1;
- /* This mask kills spill from negative subwords to the next subword. */
+ /* This mask kills spill from negative subwords to the next subword. */
correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
n_coeffs = s->intra_scantable.raster_end[s->block_last_index[n]];
extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
-extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
+extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
int line_size);
// cos(i * M_PI / 16) * sqrt(2) * (1 << 14)
if (l == 0 && r == 0)
return 0;
-
+
a0 = W4 * sextw(l) + (1 << (ROW_SHIFT - 1));
if (((l & ~0xffffUL) | r) == 0) {
t2 = (uint16_t) a0;
t2 |= t2 << 16;
t2 |= t2 << 32;
-
+
stq(t2, row);
stq(t2, row + 4);
return 1;
b3 -= W5 * t;
}
-
+
t = extwl(r, 2); /* row[5] */
if (t) {
t = sextw(t);
atleast on a P4 1.5GHz (0.9s instead of 9.9s on a 30s audio clip at MR102).
Both float and fixed point is supported for amr-nb, but only float for
amr-wb.
-
+
--AMR-NB--
The fixed-point (TS26.073) can be downloaded from:
http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip
Extract the soure into ffmpeg/libavcodec/amr
To use the fixed version run "./configure" with "--enable-amr_nb-fixed"
-
+
The float version (default) can be downloaded from:
http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip
Extract the soure into ffmpeg/libavcodec/amr_float
The specification for amr-nb can be found in TS 26.071
(http://www.3gpp.org/ftp/Specs/html-info/26071.htm) and some other
info at http://www.3gpp.org/ftp/Specs/html-info/26-series.htm
-
+
--AMR-WB--
The reference code can be downloaded from:
http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip
It should be extracted to "libavcodec/amrwb_float". Enable it with
"--enable-amr_wb".
-
+
The specification for amr-wb can be downloaded from:
http://www.3gpp.org/ftp/Specs/archive/26_series/26.171/26171-500.zip
-
+
If someone want to use the fixed point version it can be downloaded
from: http://www.3gpp.org/ftp/Specs/archive/26_series/26.173/26173-571.zip
-
+
*/
#include "avcodec.h"
int startrate;
int stoprate;
enum Mode mode;
-
+
} AMR_bitrates;
/* Match desired bitrate with closest one*/
{7950,9999,MR795},//9
{10000,11999,MR102},//10
{12000,64000,MR122},//12
-
+
};
int i;
for(i=0;i<8;i++)
Speech_Encode_FrameState *enstate;
sid_syncState *sidstate;
enum TXFrameType tx_frametype;
-
+
} AMRContext;
s->mode= (enum Mode)0;
s->reset_flag=0;
s->reset_flag_old=1;
-
+
if(Speech_Decode_Frame_init(&s->speech_decoder_state, "Decoder"))
{
av_log(avctx, AV_LOG_ERROR, "Speech_Decode_Frame_init error\n");
s->mode= (enum Mode)0;
s->reset_flag=0;
s->reset_flag_old=1;
-
+
if(avctx->sample_rate!=8000)
{
if(avctx->debug)
int offset=0;
UWord8 toc, q, ft;
-
+
Word16 serial[SERIAL_FRAMESIZE]; /* coded bits */
Word16 *synth;
UWord8 *packed_bits;
//We have a new frame
s->frameCount++;
- if (s->rx_type == RX_NO_DATA)
+ if (s->rx_type == RX_NO_DATA)
{
s->mode = s->speech_decoder_state->prev_mode;
}
else {
s->speech_decoder_state->prev_mode = s->mode;
}
-
+
/* if homed: check if this frame is another homing frame */
if (s->reset_flag_old == 1)
{
}
}
else
- {
+ {
/* decode frame */
Speech_Decode_Frame(s->speech_decoder_state, s->mode, &serial[1], s->rx_type, synth);
}
//Each AMR-frame results in 160 16-bit samples
*data_size+=160*2;
synth+=160;
-
+
/* if not homed: check whether current frame is a homing frame */
if (s->reset_flag_old == 0)
{
Speech_Decode_Frame_reset(s->speech_decoder_state);
}
s->reset_flag_old = s->reset_flag;
-
+
}
return offset;
}
AMRContext *s = avctx->priv_data;
int written;
-
+
s->reset_flag = encoder_homing_frame_test(data);
-
- Speech_Encode_Frame(s->enstate, s->enc_bitrate, data, &serial_data[1], &s->mode);
-
+
+ Speech_Encode_Frame(s->enstate, s->enc_bitrate, data, &serial_data[1], &s->mode);
+
/* add frame type and mode */
sid_sync (s->sidstate, s->mode, &s->tx_frametype);
-
+
written = PackBits(s->mode, s->enc_bitrate, s->tx_frametype, &serial_data[1], frame);
-
+
if (s->reset_flag != 0)
{
Speech_Encode_Frame_reset(s->enstate);
{
AMRContext *s = avctx->priv_data;
s->frameCount=0;
-
+
if(avctx->sample_rate!=8000)
{
if(avctx->debug)
int packet_size;
/* av_log(NULL,AV_LOG_DEBUG,"amr_decode_frame buf=%p buf_size=%d frameCount=%d!!\n",buf,buf_size,s->frameCount); */
-
+
if(buf_size==0) {
/* nothing to do */
return 0;
av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size);
return -1;
}
-
+
s->frameCount++;
/* av_log(NULL,AV_LOG_DEBUG,"packet_size=%d amrData= 0x%X %X %X %X\n",packet_size,amrData[0],amrData[1],amrData[2],amrData[3]); */
/* call decoder */
Decoder_Interface_Decode(s->decState, amrData, data, 0);
*data_size=160*2;
-
+
return packet_size;
}
AMRContext *s = (AMRContext*)avctx->priv_data;
int written;
- written = Encoder_Interface_Encode(s->enstate,
- s->enc_bitrate,
- data,
- frame,
+ written = Encoder_Interface_Encode(s->enstate,
+ s->enc_bitrate,
+ data,
+ frame,
0);
/* av_log(NULL,AV_LOG_DEBUG,"amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",written, s->enc_bitrate, frame[0] ); */
int startrate;
int stoprate;
int mode;
-
+
} AMRWB_bitrates;
static int getWBBitrateMode(int bitrate)
{18001,22000,6},//19.85
{22001,23000,7},//23.05
{23001,24000,8},//23.85
-
+
};
int i;
{
AMRWBContext *s = (AMRWBContext*)avctx->priv_data;
s->frameCount=0;
-
+
if(avctx->sample_rate!=16000)
{
if(avctx->debug)
av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size+1);
return -1;
}
-
+
s->frameCount++;
D_IF_decode( s->state, amrData, data, _good_frame);
*data_size=320*2;
*
* Note that this library only handles codecs (mpeg, mpeg4, etc...),
* not file formats (avi, vob, etc...). See library 'libavformat' for the
- * format handling
+ * format handling
*/
#include <stdlib.h>
#define INBUF_SIZE 4096
/*
- * Audio encoding example
+ * Audio encoding example
*/
void audio_encode_example(const char *filename)
{
}
c= avcodec_alloc_context();
-
+
/* put sample parameters */
c->bit_rate = 64000;
c->sample_rate = 44100;
fprintf(stderr, "could not open codec\n");
exit(1);
}
-
+
/* the codec gives us the frame size, in samples */
frame_size = c->frame_size;
samples = malloc(frame_size * 2 * c->channels);
fprintf(stderr, "could not open %s\n", filename);
exit(1);
}
-
+
/* encode a single tone sound */
t = 0;
tincr = 2 * M_PI * 440.0 / c->sample_rate;
}
/*
- * Audio decoding.
+ * Audio decoding.
*/
void audio_decode_example(const char *outfilename, const char *filename)
{
uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE], *inbuf_ptr;
printf("Audio decoding\n");
-
+
/* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
fprintf(stderr, "could not open codec\n");
exit(1);
}
-
+
outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
f = fopen(filename, "rb");
av_free(c);
exit(1);
}
-
+
/* decode until eof */
inbuf_ptr = inbuf;
for(;;) {
inbuf_ptr = inbuf;
while (size > 0) {
- len = avcodec_decode_audio(c, (short *)outbuf, &out_size,
+ len = avcodec_decode_audio(c, (short *)outbuf, &out_size,
inbuf_ptr, size);
if (len < 0) {
fprintf(stderr, "Error while decoding\n");
}
/*
- * Video encoding example
+ * Video encoding example
*/
void video_encode_example(const char *filename)
{
c= avcodec_alloc_context();
picture= avcodec_alloc_frame();
-
+
/* put sample parameters */
c->bit_rate = 400000;
/* resolution must be a multiple of two */
- c->width = 352;
+ c->width = 352;
c->height = 288;
/* frames per second */
c->time_base= (AVRational){1,25};
fprintf(stderr, "could not open codec\n");
exit(1);
}
-
+
/* the codec gives us the frame size, in samples */
f = fopen(filename, "wb");
fprintf(stderr, "could not open %s\n", filename);
exit(1);
}
-
+
/* alloc image and output buffer */
outbuf_size = 100000;
outbuf = malloc(outbuf_size);
size = c->width * c->height;
picture_buf = malloc((size * 3) / 2); /* size for YUV 420 */
-
+
picture->data[0] = picture_buf;
picture->data[1] = picture->data[0] + size;
picture->data[2] = picture->data[1] + size / 4;
/* get the delayed frames */
for(; out_size; i++) {
fflush(stdout);
-
+
out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);
printf("write frame %3d (size=%5d)\n", i, out_size);
fwrite(outbuf, 1, out_size, f);
}
/*
- * Video decoding example
+ * Video decoding example
*/
-void pgm_save(unsigned char *buf,int wrap, int xsize,int ysize,char *filename)
+void pgm_save(unsigned char *buf,int wrap, int xsize,int ysize,char *filename)
{
FILE *f;
int i;
fprintf(stderr, "could not open codec\n");
exit(1);
}
-
+
/* the codec gives us the frame size, in samples */
f = fopen(filename, "rb");
fprintf(stderr, "could not open %s\n", filename);
exit(1);
}
-
+
frame = 0;
for(;;) {
size = fread(inbuf, 1, INBUF_SIZE, f);
/* NOTE1: some codecs are stream based (mpegvideo, mpegaudio)
and this is the only method to use them because you cannot
- know the compressed data size before analysing it.
+ know the compressed data size before analysing it.
BUT some other codecs (msmpeg4, mpeg4) are inherently frame
based, so you must call them with all the data for one
feed decoder and see if it could decode a frame */
inbuf_ptr = inbuf;
while (size > 0) {
- len = avcodec_decode_video(c, picture, &got_picture,
+ len = avcodec_decode_video(c, picture, &got_picture,
inbuf_ptr, size);
if (len < 0) {
fprintf(stderr, "Error while decoding frame %d\n", frame);
/* the picture is allocated by the decoder. no need to
free it */
snprintf(buf, sizeof(buf), outfilename, frame);
- pgm_save(picture->data[0], picture->linesize[0],
+ pgm_save(picture->data[0], picture->linesize[0],
c->width, c->height, buf);
frame++;
}
/* some codecs, such as MPEG, transmit the I and P frame with a
latency of one frame. You must do the following to have a
chance to get the last frame of the video */
- len = avcodec_decode_video(c, picture, &got_picture,
+ len = avcodec_decode_video(c, picture, &got_picture,
NULL, 0);
if (got_picture) {
printf("saving last frame %3d\n", frame);
fflush(stdout);
-
+
/* the picture is allocated by the decoder. no need to
free it */
snprintf(buf, sizeof(buf), outfilename, frame);
- pgm_save(picture->data[0], picture->linesize[0],
+ pgm_save(picture->data[0], picture->linesize[0],
c->width, c->height, buf);
frame++;
}
-
+
fclose(f);
avcodec_close(c);
.align 8
2:
RND_XY2_EXPAND 1, 1
-
+
.align 8
3:
RND_XY2_EXPAND 2, 1
-
+
.align 8
4:
RND_XY2_EXPAND 3, 1
-
+
5:
.word 0x03030303
.word 2b
.align 8
2:
RND_XY2_EXPAND 1, 0
-
+
.align 8
3:
RND_XY2_EXPAND 2, 0
-
+
.align 8
4:
RND_XY2_EXPAND 3, 0
-
+
5:
.word 0x03030303
.word 2b
-/*
+/*
C-like prototype :
void j_rev_dct_ARM(DCTBLOCK data)
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+
*/
#define FIX_0_298631336 2446
#define FIX_0_541196100 4433
#define FIX_M_1_847759065 -15137
#define FIX_M_1_961570560 -16069
#define FIX_M_2_562915447 -20995
-#define FIX_0xFFFF 0xFFFF
-
+#define FIX_0xFFFF 0xFFFF
+
#define FIX_0_298631336_ID 0
#define FIX_0_541196100_ID 4
#define FIX_0_765366865_ID 8
#define FIX_0xFFFF_ID 48
.text
.align
-
+
.global j_rev_dct_ARM
j_rev_dct_ARM:
stmdb sp!, { r4 - r12, lr } @ all callee saved regs
mov lr, r0 @ lr = pointer to the current row
mov r12, #8 @ r12 = row-counter
- add r11, pc, #(const_array-.-8) @ r11 = base pointer to the constants array
+ add r11, pc, #(const_array-.-8) @ r11 = base pointer to the constants array
row_loop:
ldrsh r0, [lr, # 0] @ r0 = 'd0'
ldrsh r1, [lr, # 8] @ r1 = 'd1'
beq end_of_row_loop @ nothing to be done as ALL of them are '0'
orrs r2, r3, r1
beq empty_row
-
+
ldrsh r2, [lr, # 2] @ r2 = 'd2'
ldrsh r4, [lr, # 4] @ r4 = 'd4'
ldrsh r6, [lr, # 6] @ r6 = 'd6'
-
+
ldr r3, [r11, #FIX_0_541196100_ID]
add r7, r2, r6
ldr r5, [r11, #FIX_M_1_847759065_ID]
rsb r3, r6, r3, lsl #13 @ r3 = tmp12
stmdb sp!, { r0, r2, r3, r4 } @ save on the stack tmp10, tmp13, tmp12, tmp11
-
+
ldrsh r3, [lr, #10] @ r3 = 'd3'
ldrsh r5, [lr, #12] @ r5 = 'd5'
ldrsh r7, [lr, #14] @ r7 = 'd7'
ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp12 / r6 = tmp11
@ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
-
+
@ Compute DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS)
add r8, r0, r1
add r8, r8, #(1<<10)
mov r8, r8, asr #11
strh r8, [lr, # 0]
-
+
@ Compute DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS)
sub r8, r0, r1
add r8, r8, #(1<<10)
mov r8, r8, asr #11
strh r8, [lr, #14]
-
+
@ Compute DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS)
add r8, r6, r3
add r8, r8, #(1<<10)
mov r8, r8, asr #11
strh r8, [lr, # 2]
-
+
@ Compute DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS)
sub r8, r6, r3
add r8, r8, #(1<<10)
mov r8, r8, asr #11
strh r8, [lr, #12]
-
+
@ Compute DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS)
add r8, r4, r5
add r8, r8, #(1<<10)
mov r8, r8, asr #11
strh r8, [lr, # 4]
-
+
@ Compute DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS)
sub r8, r4, r5
add r8, r8, #(1<<10)
mov r8, r8, asr #11
strh r8, [lr, #10]
-
+
@ Compute DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS)
add r8, r2, r7
add r8, r8, #(1<<10)
mov r8, r8, asr #11
strh r8, [lr, # 6]
-
+
@ Compute DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS)
sub r8, r2, r7
add r8, r8, #(1<<10)
subs r12, r12, #1
bne row_loop
beq start_column_loop
-
+
empty_row:
ldr r1, [r11, #FIX_0xFFFF_ID]
mov r0, r0, lsl #2
beq empty_odd_column
stmdb sp!, { r0, r2, r4, r6 } @ save on the stack tmp10, tmp13, tmp12, tmp11
-
+
add r0, r3, r5 @ r0 = 'z2'
add r2, r1, r7 @ r2 = 'z1'
add r4, r3, r7 @ r4 = 'z3'
mla r1, r9, r1, r2 @ r1 = tmp3 + z1
add r5, r5, r6 @ r5 = tmp1
add r3, r3, r4 @ r3 = tmp2
- add r1, r1, r6 @ r1 = tmp3
-
+ add r1, r1, r6 @ r1 = tmp3
+
ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp11 / r6 = tmp12
- @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
+ @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
@ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
add r8, r0, r1
add r8, r8, #(1<<17)
mov r8, r8, asr #18
strh r8, [lr, #( 0*8)]
-
+
@ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
sub r8, r0, r1
add r8, r8, #(1<<17)
mov r8, r8, asr #18
strh r8, [lr, #(14*8)]
-
+
@ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
add r8, r4, r3
add r8, r8, #(1<<17)
mov r8, r8, asr #18
strh r8, [lr, #( 2*8)]
-
+
@ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
sub r8, r4, r3
add r8, r8, #(1<<17)
mov r8, r8, asr #18
strh r8, [lr, #(12*8)]
-
+
@ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
add r8, r6, r5
add r8, r8, #(1<<17)
mov r8, r8, asr #18
strh r8, [lr, #( 4*8)]
-
+
@ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
sub r8, r6, r5
add r8, r8, #(1<<17)
mov r8, r8, asr #18
strh r8, [lr, #(10*8)]
-
+
@ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
add r8, r2, r7
add r8, r8, #(1<<17)
mov r8, r8, asr #18
strh r8, [lr, #( 6*8)]
-
+
@ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
sub r8, r2, r7
add r8, r8, #(1<<17)
subs r12, r12, #1
bne column_loop
beq the_end
-
+
empty_odd_column:
@ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
@ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
mov r0, r0, asr #18
strh r0, [lr, #( 0*8)]
strh r0, [lr, #(14*8)]
-
+
@ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
@ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
add r4, r4, #(1<<17)
mov r4, r4, asr #18
strh r4, [lr, #( 2*8)]
strh r4, [lr, #(12*8)]
-
+
@ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
@ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
add r6, r6, #(1<<17)
mov r6, r6, asr #18
strh r6, [lr, #( 4*8)]
strh r6, [lr, #(10*8)]
-
+
@ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
@ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
add r2, r2, #(1<<17)
add lr, lr, #2
subs r12, r12, #1
bne column_loop
-
-the_end:
+
+the_end:
@ The end....
add sp, sp, #4
ldmia sp!, { r4 - r12, pc } @ restore callee saved regs and return
-/*
+/*
* simple_idct_arm.S
* Copyright (C) 2002 Frederic 'dilb' Boulay.
* All Rights Reserved.
*
*
* The function defined in this file, is derived from the simple_idct function
- * from the libavcodec library part of the ffmpeg project.
+ * from the libavcodec library part of the ffmpeg project.
*/
/* useful constants for the algorithm, they are save in __constant_ptr__ at */
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file asv1.c
* ASUS V1/V2 codec.
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#define VLC_BITS 6
#define ASV2_LEVEL_VLC_BITS 10
-
+
typedef struct ASV1Context{
AVCodecContext *avctx;
DSPContext dsp;
static const uint8_t ccp_tab[17][2]={
{0x2,2}, {0x7,5}, {0xB,5}, {0x3,5},
{0xD,5}, {0x5,5}, {0x9,5}, {0x1,5},
- {0xE,5}, {0x6,5}, {0xA,5}, {0x2,5},
+ {0xE,5}, {0x6,5}, {0xA,5}, {0x2,5},
{0xC,5}, {0x4,5}, {0x8,5}, {0x3,2},
{0xF,5}, //EOB
};
if (!done) {
done = 1;
- init_vlc(&ccp_vlc, VLC_BITS, 17,
+ init_vlc(&ccp_vlc, VLC_BITS, 17,
&ccp_tab[0][1], 2, 1,
&ccp_tab[0][0], 2, 1, 1);
- init_vlc(&dc_ccp_vlc, VLC_BITS, 8,
+ init_vlc(&dc_ccp_vlc, VLC_BITS, 8,
&dc_ccp_tab[0][1], 2, 1,
&dc_ccp_tab[0][0], 2, 1, 1);
- init_vlc(&ac_ccp_vlc, VLC_BITS, 16,
+ init_vlc(&ac_ccp_vlc, VLC_BITS, 16,
&ac_ccp_tab[0][1], 2, 1,
&ac_ccp_tab[0][0], 2, 1, 1);
- init_vlc(&level_vlc, VLC_BITS, 7,
+ init_vlc(&level_vlc, VLC_BITS, 7,
&level_tab[0][1], 2, 1,
&level_tab[0][0], 2, 1, 1);
- init_vlc(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63,
+ init_vlc(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63,
&asv2_level_tab[0][1], 2, 1,
&asv2_level_tab[0][0], 2, 1, 1);
}
int i;
block[0]= 8*get_bits(&a->gb, 8);
-
+
for(i=0; i<11; i++){
const int ccp= get_vlc2(&a->gb, ccp_vlc.table, VLC_BITS, 1);
int i, count, ccp;
count= asv2_get_bits(&a->gb, 4);
-
+
block[0]= 8*asv2_get_bits(&a->gb, 8);
-
+
ccp= get_vlc2(&a->gb, dc_ccp_vlc.table, VLC_BITS, 1);
if(ccp){
if(ccp&4) block[a->scantable.permutated[1]]= (asv2_get_level(&a->gb) * a->intra_matrix[1])>>4;
if(ccp&1) block[a->scantable.permutated[4*i+3]]= (asv2_get_level(&a->gb) * a->intra_matrix[4*i+3])>>4;
}
}
-
+
return 0;
}
static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){
int i;
int nc_count=0;
-
+
put_bits(&a->pb, 8, (block[0] + 32)>>6);
block[0]= 0;
-
+
for(i=0; i<10; i++){
const int index= scantab[4*i];
int ccp=0;
if( (block[index + 9] = (block[index + 9]*a->q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
if(ccp){
- for(;nc_count; nc_count--)
+ for(;nc_count; nc_count--)
put_bits(&a->pb, ccp_tab[0][1], ccp_tab[0][0]);
put_bits(&a->pb, ccp_tab[ccp][1], ccp_tab[ccp][0]);
-
+
if(ccp&8) asv1_put_level(&a->pb, block[index + 0]);
if(ccp&4) asv1_put_level(&a->pb, block[index + 8]);
if(ccp&2) asv1_put_level(&a->pb, block[index + 1]);
static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){
int i;
int count=0;
-
+
for(count=63; count>3; count--){
const int index= scantab[count];
- if( (block[index]*a->q_intra_matrix[index] + (1<<15))>>16 )
+ if( (block[index]*a->q_intra_matrix[index] + (1<<15))>>16 )
break;
}
-
+
count >>= 2;
asv2_put_bits(&a->pb, 4, count);
asv2_put_bits(&a->pb, 8, (block[0] + 32)>>6);
block[0]= 0;
-
+
for(i=0; i<=count; i++){
const int index= scantab[4*i];
int ccp=0;
int i;
a->dsp.clear_blocks(block[0]);
-
+
if(a->avctx->codec_id == CODEC_ID_ASV1){
for(i=0; i<6; i++){
- if( asv1_decode_block(a, block[i]) < 0)
+ if( asv1_decode_block(a, block[i]) < 0)
return -1;
}
}else{
for(i=0; i<6; i++){
- if( asv2_decode_block(a, block[i]) < 0)
+ if( asv2_decode_block(a, block[i]) < 0)
return -1;
}
}
static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){
int i;
-
+
if(a->pb.buf_end - a->pb.buf - (put_bits_count(&a->pb)>>3) < 30*16*16*3/2/8){
av_log(a->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
static inline void idct_put(ASV1Context *a, int mb_x, int mb_y){
DCTELEM (*block)[64]= a->block;
int linesize= a->picture.linesize[0];
-
+
uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;
uint8_t *dest_cb = a->picture.data[1] + (mb_y * 8 * a->picture.linesize[1]) + mb_x * 8;
uint8_t *dest_cr = a->picture.data[2] + (mb_y * 8 * a->picture.linesize[2]) + mb_x * 8;
DCTELEM (*block)[64]= a->block;
int linesize= a->picture.linesize[0];
int i;
-
+
uint8_t *ptr_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;
uint8_t *ptr_cb = a->picture.data[1] + (mb_y * 8 * a->picture.linesize[1]) + mb_x * 8;
uint8_t *ptr_cr = a->picture.data[2] + (mb_y * 8 * a->picture.linesize[2]) + mb_x * 8;
a->dsp.get_pixels(block[3], ptr_y + 8*linesize + 8, linesize);
for(i=0; i<4; i++)
a->dsp.fdct(block[i]);
-
+
if(!(a->avctx->flags&CODEC_FLAG_GRAY)){
a->dsp.get_pixels(block[4], ptr_cb, a->picture.linesize[1]);
a->dsp.get_pixels(block[5], ptr_cr, a->picture.linesize[2]);
}
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
p->key_frame= 1;
a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
+
if(avctx->codec_id == CODEC_ID_ASV1)
a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (uint32_t*)buf, buf_size/4);
else{
for(mb_x=0; mb_x<a->mb_width2; mb_x++){
if( decode_mb(a, a->block) <0)
return -1;
-
+
idct_put(a, mb_x, mb_y);
}
}
for(mb_y=0; mb_y<a->mb_height2; mb_y++){
if( decode_mb(a, a->block) <0)
return -1;
-
+
idct_put(a, mb_x, mb_y);
}
}
for(mb_x=0; mb_x<a->mb_width; mb_x++){
if( decode_mb(a, a->block) <0)
return -1;
-
+
idct_put(a, mb_x, mb_y);
}
}
-#if 0
+#if 0
int i;
printf("%d %d\n", 8*buf_size, get_bits_count(&a->gb));
for(i=get_bits_count(&a->gb); i<8*buf_size; i++){
*data_size = sizeof(AVPicture);
emms_c();
-
+
return (get_bits_count(&a->gb)+31)/32*4;
}
int mb_x, mb_y;
init_put_bits(&a->pb, buf, buf_size);
-
+
*p = *pict;
p->pict_type= I_TYPE;
p->key_frame= 1;
}
}
emms_c();
-
+
align_put_bits(&a->pb);
while(put_bits_count(&a->pb)&31)
put_bits(&a->pb, 8, 0);
-
+
size= put_bits_count(&a->pb)/32;
-
+
if(avctx->codec_id == CODEC_ID_ASV1)
a->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size);
else{
for(i=0; i<4*size; i++)
buf[i]= ff_reverse[ buf[i] ];
}
-
+
return size*4;
}
AVFrame *p= (AVFrame*)&a->picture;
int i;
const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
-
+
common_init(avctx);
init_vlcs(a);
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);
const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
common_init(avctx);
-
+
if(avctx->global_quality == 0) avctx->global_quality= 4*FF_QUALITY_SCALE;
a->inv_qscale= (32*scale*FF_QUALITY_SCALE + avctx->global_quality/2) / avctx->global_quality;
-
+
avctx->extradata= av_mallocz(8);
avctx->extradata_size=8;
((uint32_t*)avctx->extradata)[0]= le2me_32(a->inv_qscale);
((uint32_t*)avctx->extradata)[1]= le2me_32(ff_get_fourcc("ASUS"));
-
+
for(i=0; i<64; i++){
int q= 32*scale*ff_mpeg1_default_intra_matrix[i];
a->q_intra_matrix[i]= ((a->inv_qscale<<16) + q/2) / q;
av_freep(&a->bitstream_buffer);
av_freep(&a->picture.qscale_table);
a->bitstream_buffer_size=0;
-
+
return 0;
}
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
enum CodecID {
- CODEC_ID_NONE,
+ CODEC_ID_NONE,
CODEC_ID_MPEG1VIDEO,
CODEC_ID_MPEG2VIDEO, /* prefered ID for MPEG Video 1 or 2 decoding */
CODEC_ID_MPEG2VIDEO_XVMC,
CODEC_ID_INTERPLAY_DPCM,
CODEC_ID_XAN_DPCM,
CODEC_ID_SOL_DPCM,
-
+
CODEC_ID_MP2= 0x15000,
CODEC_ID_MP3, /* prefered ID for MPEG Audio layer 1, 2 or3 decoding */
CODEC_ID_AAC,
CODEC_ID_SHORTEN,
CODEC_ID_ALAC,
CODEC_ID_WESTWOOD_SND1,
- CODEC_ID_GSM,
+ CODEC_ID_GSM,
CODEC_ID_QDM2,
CODEC_ID_COOK,
-
- CODEC_ID_OGGTHEORA= 0x16000,
+
+ CODEC_ID_OGGTHEORA= 0x16000,
/* subtitle codecs */
- CODEC_ID_DVD_SUBTITLE= 0x17000,
- CODEC_ID_DVB_SUBTITLE,
-
+ CODEC_ID_DVD_SUBTITLE= 0x17000,
+ CODEC_ID_DVB_SUBTITLE,
+
CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG2 transport
stream (only used by libavformat) */
};
};
/**
- * Pixel format. Notes:
+ * Pixel format. Notes:
*
* PIX_FMT_RGBA32 is handled in an endian-specific manner. A RGBA
* color is put together as:
enum PixelFormat {
PIX_FMT_NONE= -1,
PIX_FMT_YUV420P, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples)
- PIX_FMT_YUV422, ///< Packed pixel, Y0 Cb Y1 Cr
+ PIX_FMT_YUV422, ///< Packed pixel, Y0 Cb Y1 Cr
PIX_FMT_RGB24, ///< Packed pixel, 3 bytes per pixel, RGBRGB...
PIX_FMT_BGR24, ///< Packed pixel, 3 bytes per pixel, BGRBGR...
PIX_FMT_YUV422P, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples)
PIX_FMT_RGBA32, ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness
PIX_FMT_YUV410P, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples)
PIX_FMT_YUV411P, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples)
- PIX_FMT_RGB565, ///< always stored in cpu endianness
- PIX_FMT_RGB555, ///< always stored in cpu endianness, most significant bit to 1
+ PIX_FMT_RGB565, ///< always stored in cpu endianness
+ PIX_FMT_RGB555, ///< always stored in cpu endianness, most significant bit to 1
PIX_FMT_GRAY8,
- PIX_FMT_MONOWHITE, ///< 0 is white
- PIX_FMT_MONOBLACK, ///< 0 is black
- PIX_FMT_PAL8, ///< 8 bit with RGBA palette
+ PIX_FMT_MONOWHITE, ///< 0 is white
+ PIX_FMT_MONOBLACK, ///< 0 is black
+ PIX_FMT_PAL8, ///< 8 bit with RGBA palette
PIX_FMT_YUVJ420P, ///< Planar YUV 4:2:0 full scale (jpeg)
PIX_FMT_YUVJ422P, ///< Planar YUV 4:2:2 full scale (jpeg)
PIX_FMT_YUVJ444P, ///< Planar YUV 4:4:4 full scale (jpeg)
PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_UYVY422, ///< Packed pixel, Cb Y0 Cr Y1
+ PIX_FMT_UYVY422, ///< Packed pixel, Cb Y0 Cr Y1
PIX_FMT_UYVY411, ///< Packed pixel, Cb Y0 Y1 Cr Y2 Y3
PIX_FMT_NB,
};
/* currently unused, may be used if 24/32 bits samples ever supported */
enum SampleFormat {
- SAMPLE_FMT_S16 = 0, ///< signed 16 bits
- SAMPLE_FMT_S32, ///< signed 32 bits
+ SAMPLE_FMT_S16 = 0, ///< signed 16 bits
+ SAMPLE_FMT_S32, ///< signed 32 bits
SAMPLE_FMT_FLT, ///< float
SAMPLE_FMT_DBL, ///< double
};
/**
* Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * this is mainly needed because some optimized bitstream readers read
+ * this is mainly needed because some optimized bitstream readers read
* 32 or 64 bit at once and could read over the end<br>
* Note, if the first 23 bits of the additional bytes are not 0 then damaged
* MPEG bitstreams could cause overread and segfault
#define FF_MAX_B_FRAMES 8
/* encoding support
- these flags can be passed in AVCodecContext.flags before initing
+ these flags can be passed in AVCodecContext.flags before initing
Note: not everything is supported yet.
*/
-#define CODEC_FLAG_QSCALE 0x0002 ///< use fixed qscale
+#define CODEC_FLAG_QSCALE 0x0002 ///< use fixed qscale
#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / Advanced prediction for H263
-#define CODEC_FLAG_QPEL 0x0010 ///< use qpel MC
-#define CODEC_FLAG_GMC 0x0020 ///< use GMC
-#define CODEC_FLAG_MV0 0x0040 ///< always try a MB with MV=<0,0>
-#define CODEC_FLAG_PART 0x0080 ///< use data partitioning
-/* parent program gurantees that the input for b-frame containing streams is not written to
+#define CODEC_FLAG_QPEL 0x0010 ///< use qpel MC
+#define CODEC_FLAG_GMC 0x0020 ///< use GMC
+#define CODEC_FLAG_MV0 0x0040 ///< always try a MB with MV=<0,0>
+#define CODEC_FLAG_PART 0x0080 ///< use data partitioning
+/* parent program gurantees that the input for b-frame containing streams is not written to
for at least s->max_b_frames+1 frames, if this is not set than the input will be copied */
#define CODEC_FLAG_INPUT_PRESERVED 0x0100
-#define CODEC_FLAG_PASS1 0x0200 ///< use internal 2pass ratecontrol in first pass mode
-#define CODEC_FLAG_PASS2 0x0400 ///< use internal 2pass ratecontrol in second pass mode
-#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg)
-#define CODEC_FLAG_GRAY 0x2000 ///< only decode/encode grayscale
+#define CODEC_FLAG_PASS1 0x0200 ///< use internal 2pass ratecontrol in first pass mode
+#define CODEC_FLAG_PASS2 0x0400 ///< use internal 2pass ratecontrol in second pass mode
+#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg)
+#define CODEC_FLAG_GRAY 0x2000 ///< only decode/encode grayscale
#define CODEC_FLAG_EMU_EDGE 0x4000///< don't draw edges
-#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding
-#define CODEC_FLAG_TRUNCATED 0x00010000 /** input bitstream might be truncated at a random location instead
+#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding
+#define CODEC_FLAG_TRUNCATED 0x00010000 /** input bitstream might be truncated at a random location instead
of only at frame boundaries */
-#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< normalize adaptive quantization
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct
+#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< normalize adaptive quantization
+#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< use interlaced dct
#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< force low delay
-#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< use alternate scan
-#define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< use trellis quantization
-#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< place global headers in extradata instead of every keyframe
-#define CODEC_FLAG_BITEXACT 0x00800000 ///< use only bitexact stuff (except (i)dct)
+#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< use alternate scan
+#define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< use trellis quantization
+#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< place global headers in extradata instead of every keyframe
+#define CODEC_FLAG_BITEXACT 0x00800000 ///< use only bitexact stuff (except (i)dct)
/* Fx : Flag for h263+ extra options */
#define CODEC_FLAG_H263P_AIC 0x01000000 ///< H263 Advanced intra coding / MPEG4 AC prediction (remove this)
#define CODEC_FLAG_AC_PRED 0x01000000 ///< H263 Advanced intra coding / MPEG4 AC prediction
-#define CODEC_FLAG_H263P_UMV 0x02000000 ///< Unlimited motion vector
+#define CODEC_FLAG_H263P_UMV 0x02000000 ///< Unlimited motion vector
#define CODEC_FLAG_CBP_RD 0x04000000 ///< use rate distortion optimization for cbp
#define CODEC_FLAG_QP_RD 0x08000000 ///< use rate distortion optimization for qp selectioon
#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H263 Alternative inter vlc
/* /Fx */
/* codec capabilities */
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< decoder can use draw_horiz_band callback
+#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< decoder can use draw_horiz_band callback
/**
* Codec uses get_buffer() for allocating buffers.
* direct rendering method 1
#define CODEC_CAP_TRUNCATED 0x0008
/* codec can export data for HW decoding (XvMC) */
#define CODEC_CAP_HWACCEL 0x0010
-/**
+/**
* codec has a non zero delay and needs to be feeded with NULL at the end to get the delayed data.
* if this is not set, the codec is guranteed to never be feeded with NULL data
*/
/**
* the average bitrate.
* - encoding: set by user. unused for constant quantizer encoding
- * - decoding: set by lavc. 0 or some bitrate if this info is available in the stream
+ * - decoding: set by lavc. 0 or some bitrate if this info is available in the stream
*/
int bit_rate;
* - encoding: set by user. unused for constant quantizer encoding
* - decoding: unused
*/
- int bit_rate_tolerance;
+ int bit_rate_tolerance;
/**
* CODEC_FLAG_*.
/**
* some codecs needs additionnal format info. It is stored here
- * - encoding: set by user.
+ * - encoding: set by user.
* - decoding: set by lavc. (FIXME is this ok?)
*/
int sub_id;
*/
void *extradata;
int extradata_size;
-
+
/**
* this is the fundamental unit of time (in seconds) in terms
* of which frame timestamps are represented. for fixed-fps content,
* - decoding: set by lavc.
*/
AVRational time_base;
-
+
/* video only */
/**
* picture width / height.
- * - encoding: MUST be set by user.
+ * - encoding: MUST be set by user.
* - decoding: set by lavc.
- * Note, for compatibility its possible to set this instead of
+ * Note, for compatibility its possible to set this instead of
* coded_width/height before decoding
*/
int width, height;
-
+
#define FF_ASPECT_EXTENDED 15
/**
* - decoding: set by lavc.
*/
enum PixelFormat pix_fmt;
-
+
/**
- * Frame rate emulation. If not zero lower layer (i.e. format handler)
+ * Frame rate emulation. If not zero lower layer (i.e. format handler)
* has to read frames at native frame rate.
* - encoding: set by user.
* - decoding: unused.
*/
int rate_emu;
-
+
/**
* if non NULL, 'draw_horiz_band' is called by the libavcodec
* decoder to draw an horizontal band. It improve cache usage. Not
int y, int type, int height);
/* audio only */
- int sample_rate; ///< samples per sec
+ int sample_rate; ///< samples per sec
int channels;
/**
* - encoding: set by user.
* - decoding: set by lavc.
*/
- enum SampleFormat sample_fmt; ///< sample format, currenly unused
+ enum SampleFormat sample_fmt; ///< sample format, currenly unused
/* the following data should not be initialized */
/**
- * samples per packet. initialized when calling 'init'
+ * samples per packet. initialized when calling 'init'
*/
int frame_size;
- int frame_number; ///< audio or video frame number
- int real_pict_num; ///< returns the real picture number of previous encoded frame
-
+ int frame_number; ///< audio or video frame number
+ int real_pict_num; ///< returns the real picture number of previous encoded frame
+
/**
- * number of frames the decoded output will be delayed relative to
+ * number of frames the decoded output will be delayed relative to
* the encoded input.
* - encoding: set by lavc.
* - decoding: unused
*/
int delay;
-
+
/* - encoding parameters */
float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0)
- float qblur; ///< amount of qscale smoothing over time (0.0-1.0)
-
+ float qblur; ///< amount of qscale smoothing over time (0.0-1.0)
+
/**
* minimum quantizer.
* - encoding: set by user.
* - decoding: unused
*/
float b_quant_factor;
-
+
/** obsolete FIXME remove */
int rc_strategy;
int b_frame_strategy;
* - decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header
*/
int hurry_up;
-
+
struct AVCodec *codec;
-
+
void *priv_data;
/* unused, FIXME remove*/
int rtp_mode;
-
+
int rtp_payload_size; /* The size of the RTP payload: the coder will */
/* do it's best to deliver a chunk with size */
/* below rtp_payload_size, the chunk will start */
/* This doesn't take account of any particular */
/* headers inside the transmited RTP payload */
-
+
/* The RTP callback: This function is called */
/* every time the encoder has a packet to send */
/* Depends on the encoder if the data starts */
/* with a Start Code (it should) H.263 does. */
/* mb_nb contains the number of macroblocks */
/* encoded in the RTP payload */
- void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
+ void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
/* statistics, used for 2-pass encoding */
int mv_bits;
int p_count;
int skip_count;
int misc_bits;
-
+
/**
* number of bits used for the previously encoded frame.
* - encoding: set by lavc
char codec_name[32];
enum CodecType codec_type; /* see CODEC_TYPE_xxx */
enum CodecID codec_id; /* see CODEC_ID_xxx */
-
+
/**
* fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
* this is used to workaround some encoder bugs
* - decoding: set by user, will be converted to upper case by lavc during init
*/
unsigned int codec_tag;
-
+
/**
* workaround bugs in encoders which sometimes cannot be detected automatically.
* - encoding: set by user
#define FF_BUG_DC_CLIP 4096
#define FF_BUG_MS 8192 ///< workaround various bugs in microsofts broken decoders
//#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
-
+
/**
* luma single coeff elimination threshold.
* - encoding: set by user
* - decoding: unused
*/
int luma_elim_threshold;
-
+
/**
* chroma single coeff elimination threshold.
* - encoding: set by user
* - decoding: unused
*/
int chroma_elim_threshold;
-
+
/**
* strictly follow the std (MPEG4, ...).
* - encoding: set by user
* - decoding: unused
*/
float b_quant_offset;
-
+
/**
* error resilience higher values will detect more errors but may missdetect
* some more or less valid parts as errors.
#define FF_ER_COMPLIANT 2
#define FF_ER_AGGRESSIVE 3
#define FF_ER_VERY_AGGRESSIVE 4
-
+
/**
* called at the beginning of each frame to get a buffer for it.
* if pic.reference is set then the frame will be read later by lavc
* - decoding: set by lavc, user can override
*/
int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
+
/**
* called to release buffers which where allocated with get_buffer.
* a released buffer can be reused in get_buffer()
* used by some WAV based audio codecs
*/
int block_align;
-
+
int parse_only; /* - decoding only: if true, only parsing is done
(function avcodec_parse_frame()). The frame
data is returned. Only MPEG codecs support this now. */
-
+
/**
* 0-> h263 quant 1-> mpeg quant.
* - encoding: set by user.
* - decoding: unused
*/
int mpeg_quant;
-
+
/**
* pass1 encoding statistics output buffer.
* - encoding: set by lavc
* - decoding: unused
*/
char *stats_out;
-
+
/**
* pass2 encoding statistics input buffer.
* concatenated stuff from stats_out of pass1 should be placed here
* - decoding: unused
*/
char *stats_in;
-
+
/**
* ratecontrol qmin qmax limiting method.
* 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax
float rc_qmod_amp;
int rc_qmod_freq;
-
+
/**
* ratecontrol override, see RcOverride.
* - encoding: allocated/set/freed by user.
*/
RcOverride *rc_override;
int rc_override_count;
-
+
/**
* rate control equation.
* - encoding: set by user
* - decoding: unused
*/
char *rc_eq;
-
+
/**
* maximum bitrate.
* - encoding: set by user.
* - decoding: unused
*/
int rc_max_rate;
-
+
/**
* minimum bitrate.
* - encoding: set by user.
* - decoding: unused
*/
int rc_min_rate;
-
+
/**
* decoder bitstream buffer size.
* - encoding: set by user.
* - decoding: unused
*/
float i_quant_factor;
-
+
/**
* qscale offset between p and i frames.
* - encoding: set by user.
* - decoding: unused
*/
float i_quant_offset;
-
+
/**
* initial complexity for pass1 ratecontrol.
* - encoding: set by user.
#define FF_DCT_MLIB 4
#define FF_DCT_ALTIVEC 5
#define FF_DCT_FAAN 6
-
+
/**
* luminance masking (0-> disabled).
* - encoding: set by user
* - decoding: unused
*/
float lumi_masking;
-
+
/**
* temporary complexity masking (0-> disabled).
* - encoding: set by user
* - decoding: unused
*/
float temporal_cplx_masking;
-
+
/**
* spatial complexity masking (0-> disabled).
* - encoding: set by user
* - decoding: unused
*/
float spatial_cplx_masking;
-
+
/**
* p block masking (0-> disabled).
* - encoding: set by user
* - decoding: unused
*/
float dark_masking;
-
-
+
+
/* for binary compatibility */
int unused;
-
+
/**
* idct algorithm, see FF_IDCT_* below.
* - encoding: set by user
* - decoding: set by user
*/
int bits_per_sample;
-
+
/**
* prediction method (needed for huffyuv).
* - encoding: set by user
#define FF_PRED_LEFT 0
#define FF_PRED_PLANE 1
#define FF_PRED_MEDIAN 2
-
+
/**
* sample aspect ratio (0 if unknown).
* numerator and denominator must be relative prime and smaller then 256 for some video standards
#define FF_DEBUG_BUGS 0x00001000
#define FF_DEBUG_VIS_QP 0x00002000
#define FF_DEBUG_VIS_MB_TYPE 0x00004000
-
+
/**
* debug.
* - encoding: set by user.
* - decoding: unused
*/
uint64_t error[4];
-
+
/**
* minimum MB quantizer.
* - encoding: unused
* - decoding: unused
*/
int mb_qmax;
-
+
/**
* motion estimation compare function.
* - encoding: set by user.
#define FF_CMP_W97 12
#define FF_CMP_DCTMAX 13
#define FF_CMP_CHROMA 256
-
+
/**
* ME diamond size & shape.
* - encoding: set by user.
* DTG active format information (additionnal aspect ratio
* information only used in DVB MPEG2 transport streams). 0 if
* not set.
- *
+ *
* - encoding: unused.
- * - decoding: set by decoder
+ * - decoding: set by decoder
*/
int dtg_active_format;
#define FF_DTG_AFD_SAME 8
/**
* Maximum motion estimation search range in subpel units.
* if 0 then no limit
- *
+ *
* - encoding: set by user.
* - decoding: unused.
*/
*/
int intra_quant_bias;
#define FF_DEFAULT_QUANT_BIAS 999999
-
+
/**
* inter quantizer bias.
* - encoding: set by user.
* table have to be stored somewhere FIXME
*/
int color_table_id;
-
+
/**
- * internal_buffer count.
+ * internal_buffer count.
* Don't touch, used by lavc default_get_buffer()
*/
int internal_buffer_count;
-
+
/**
- * internal_buffers.
+ * internal_buffers.
* Don't touch, used by lavc default_get_buffer()
*/
void *internal_buffer;
* - decoding: unused
*/
int global_quality;
-
+
#define FF_CODER_TYPE_VLC 0
#define FF_CODER_TYPE_AC 1
/**
* - decoding: unused
*/
int context_model;
-
+
/**
* slice flags
* - encoding: unused
* - decoding: set by decoder
*/
int xvmc_acceleration;
-
+
/**
* macroblock decision mode
* - encoding: set by user.
* - decoding: set by lavc
*/
uint16_t *inter_matrix;
-
+
/**
* fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
* this is used to workaround some encoder bugs
* - decoding: unused
*/
int noise_reduction;
-
+
/**
* called at the beginning of a frame to get cr buffer for it.
* buffer type (size, hints) must be the same. lavc won't check it.
* - decoding: unused.
*/
int error_rate;
-
+
/**
* MP3 antialias algorithm, see FF_AA_* below.
* - encoding: unused
* - decoding: set by user
*/
int thread_count;
-
+
/**
* the codec may call this to execute several independant things. it will return only after
* finishing all tasks, the user may replace this with some multithreaded implementation, the
* - decoding: set by lavc, user can override
*/
int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void **arg2, int *ret, int count);
-
+
/**
* Thread opaque.
* can be used by execute() to store some per AVCodecContext stuff.
void *thread_opaque;
/**
- * Motion estimation threshold. under which no motion estimation is
+ * Motion estimation threshold. under which no motion estimation is
* performed, but instead the user specified motion vectors are used
- *
+ *
* - encoding: set by user
* - decoding: unused
*/
int mb_lmax;
/**
- *
+ *
* - encoding: set by user.
* - decoding: unused
*/
int me_penalty_compensation;
/**
- *
+ *
* - encoding: unused
* - decoding: set by user.
*/
enum AVDiscard skip_loop_filter;
/**
- *
+ *
* - encoding: unused
* - decoding: set by user.
*/
enum AVDiscard skip_idct;
/**
- *
+ *
* - encoding: unused
* - decoding: set by user.
*/
typedef struct ReSampleContext ReSampleContext;
-ReSampleContext *audio_resample_init(int output_channels, int input_channels,
+ReSampleContext *audio_resample_init(int output_channels, int input_channels,
int output_rate, int input_rate);
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
void audio_resample_close(ReSampleContext *s);
int padleft, int padright);
-void img_resample(ImgReSampleContext *s,
+void img_resample(ImgReSampleContext *s,
AVPicture *output, const AVPicture *input);
void img_resample_close(ImgReSampleContext *s);
/* convert among pixel formats */
int img_convert(AVPicture *dst, int dst_pix_fmt,
- const AVPicture *src, int pix_fmt,
+ const AVPicture *src, int pix_fmt,
int width, int height);
/* deinterlace a picture */
*/
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
-int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
+int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
uint8_t *buf, int buf_size);
-int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
+int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
uint8_t *buf, int buf_size);
int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
int *got_sub_ptr,
const uint8_t *buf, int buf_size);
-int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
+int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
int *data_size_ptr,
uint8_t *buf, int buf_size);
-int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const short *samples);
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVFrame *pict);
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVSubtitle *sub);
int avcodec_close(AVCodecContext *avctx);
void *priv_data;
struct AVCodecParser *parser;
int64_t frame_offset; /* offset of the current frame */
- int64_t cur_offset; /* current offset
+ int64_t cur_offset; /* current offset
(incremented by each av_parser_parse()) */
int64_t last_frame_offset; /* offset of the last frame */
/* video info */
int64_t cur_frame_offset[AV_PARSER_PTS_NB];
int64_t cur_frame_pts[AV_PARSER_PTS_NB];
int64_t cur_frame_dts[AV_PARSER_PTS_NB];
-
+
int flags;
#define PARSER_FLAG_COMPLETE_FRAMES 0x0001
} AVCodecParserContext;
int codec_ids[5]; /* several codec IDs are permitted */
int priv_data_size;
int (*parser_init)(AVCodecParserContext *s);
- int (*parser_parse)(AVCodecParserContext *s,
+ int (*parser_parse)(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size);
void (*parser_close)(AVCodecParserContext *s);
int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
void av_register_codec_parser(AVCodecParser *parser);
AVCodecParserContext *av_parser_init(int codec_id);
-int av_parser_parse(AVCodecParserContext *s,
+int av_parser_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int64_t pts, int64_t dts);
int av_parser_change(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size, int keyframe);
void av_parser_close(AVCodecParserContext *s);
//printf("thread_func %X signal complete\n", (int)v); fflush(stdout);
release_sem(c->done_sem);
}
-
+
return B_OK;
}
int32 ret;
for(i=0; i<s->thread_count; i++){
-
+
c[i].func= NULL;
release_sem(c[i].work_sem);
wait_for_thread(c[i].thread, &ret);
int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count){
ThreadContext *c= s->thread_opaque;
int i;
-
+
assert(s == c->avctx);
assert(count <= s->thread_count);
-
+
/* note, we can be certain that this is not called with the same AVCodecContext by different threads at the same time */
for(i=0; i<count; i++){
}
for(i=0; i<count; i++){
acquire_sem(c[i].done_sem);
-
+
c[i].func= NULL;
if(ret) ret[i]= c[i].ret;
}
assert(!s->thread_opaque);
c= av_mallocz(sizeof(ThreadContext)*thread_count);
s->thread_opaque= c;
-
+
for(i=0; i<thread_count; i++){
//printf("init semaphors %d\n", i); fflush(stdout);
c[i].avctx= s;
resume_thread(c[i].thread );
}
//printf("init done\n"); fflush(stdout);
-
+
s->execute= avcodec_thread_execute;
return 0;
* @file bitstream.c
* bitstream api.
*/
-
+
#include "avcodec.h"
#include "bitstream.h"
/* bit input functions */
-/**
+/**
* reads 0-32 bits.
*/
unsigned int get_bits_long(GetBitContext *s, int n){
}
}
-/**
+/**
* shows 0-32 bits.
*/
unsigned int show_bits_long(GetBitContext *s, int n){
'nb_bits' set thee decoding table size (2^nb_bits) entries. The
bigger it is, the faster is the decoding. But it should not be too
big to save memory and L1 cache. '9' is a good compromise.
-
+
'nb_codes' : number of vlcs codes
'bits' : table which gives the size (in bits) of each vlc code.
or 'codes' tables.
'wrap' and 'size' allows to use any memory configuration and types
- (byte/word/long) to store the 'bits' and 'codes' tables.
+ (byte/word/long) to store the 'bits' and 'codes' tables.
'use_static' should be set to 1 for tables, which should be freed
with av_free_static(), 0 if free_vlc() will be used.
//#define LIBMPEG2_BITSTREAM_READER
//#define A32_BITSTREAM_READER
#define LIBMPEG2_BITSTREAM_READER_HACK //add BERO
-
+
extern const uint8_t ff_reverse[256];
#if defined(ARCH_X86) || defined(ARCH_X86_64)
#endif
// printf("put_bits=%d %x\n", n, value);
assert(n == 32 || value < (1U << n));
-
+
bit_buf = s->bit_buf;
bit_left = s->bit_left;
# else
int index= s->index;
uint32_t *ptr= ((uint32_t *)s->buf)+(index>>5);
-
- value<<= 32-n;
-
+
+ value<<= 32-n;
+
ptr[0] |= be2me_32(value>>(index&31));
ptr[1] = be2me_32(value<<(32-(index&31)));
//if(n>24) printf("%d %d\n", n, value);
# else
int index= s->index;
uint32_t *ptr= (uint32_t*)(((uint8_t *)s->buf)+(index>>3));
-
+
ptr[0] |= be2me_32(value<<(32-n-(index&7) ));
ptr[1] = 0;
//if(n>24) printf("%d %d\n", n, value);
#else
assert(s->bit_left==32);
s->buf_ptr += n;
-#endif
+#endif
}
/**
s->bit_left -= n;
s->buf_ptr-= s->bit_left>>5;
s->bit_left &= 31;
-#endif
+#endif
}
/**
/**
* read mpeg1 dc style vlc (sign bit + mantisse with no MSB).
- * if MSB not set it is negative
+ * if MSB not set it is negative
* @param n length in bits
- * @author BERO
+ * @author BERO
*/
static inline int get_xbits(GetBitContext *s, int n){
register int tmp;
{
int code;
VLC_TYPE (*table)[2]= vlc->table;
-
+
OPEN_READER(re, s)
UPDATE_CACHE(re, s)
- GET_VLC(code, re, s, table, vlc->bits, 3)
+ GET_VLC(code, re, s, table, vlc->bits, 3)
CLOSE_READER(re, s)
return code;
/**
* parses a vlc code, faster then get_vlc()
- * @param bits is the number of bits which will be read at once, must be
+ * @param bits is the number of bits which will be read at once, must be
* identical to nb_bits in init_vlc()
* @param max_depth is the number of times bits bits must be readed to completly
- * read the longest vlc code
+ * read the longest vlc code
* = (max_vlc_length + bits - 1) / bits
*/
static always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
int bits, int max_depth)
{
int code;
-
+
OPEN_READER(re, s)
UPDATE_CACHE(re, s)
#include "avcodec.h"
static inline void print_bin(int bits, int n){
int i;
-
+
for(i=n-1; i>=0; i--){
av_log(NULL, AV_LOG_DEBUG, "%d", (bits>>i)&1);
}
static inline int get_bits_trace(GetBitContext *s, int n, char *file, const char *func, int line){
int r= get_bits(s, n);
-
+
print_bin(r, n);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d bit @%5d in %s %s:%d\n", r, n, r, get_bits_count(s)-n, file, func, line);
return r;
int r= get_vlc2(s, table, bits, max_depth);
int len= get_bits_count(s) - pos;
int bits2= show>>(24-len);
-
+
print_bin(bits2, len);
-
+
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d vlc @%5d in %s %s:%d\n", bits2, len, r, pos, file, func, line);
return r;
}
static inline int get_xbits_trace(GetBitContext *s, int n, char *file, const char *func, int line){
int show= show_bits(s, n);
int r= get_xbits(s, n);
-
+
print_bin(show, n);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d xbt @%5d in %s %s:%d\n", show, n, r, get_bits_count(s)-n, file, func, line);
return r;
return 0;
}
-static int bmp_decode_frame(AVCodecContext *avctx,
+static int bmp_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
/**
#ifdef STRICT_LIMITS
c->sym_count =0;
#endif
-
+
c->pb.bit_left++; //avoids firstBitFlag
}
* @param buf_size size of buf in bits
*/
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
- c->bytestream_start=
+ c->bytestream_start=
c->bytestream= buf;
c->bytestream_end= buf + buf_size;
c->range= 0x1FE<<(CABAC_BITS + 1);
}
-void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4],
+void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4],
uint8_t const *mps_state, uint8_t const *lps_state, int state_count){
int i, j;
-
+
for(i=0; i<state_count; i++){
for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift we save
c->lps_range[2*i+0][j+4]=
uint8_t r[9*SIZE];
int i;
uint8_t state[10]= {0};
-
+
ff_init_cabac_encoder(&c, b, SIZE);
ff_init_cabac_states(&c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
-
+
for(i=0; i<SIZE; i++){
r[i]= random()%7;
}
-
+
for(i=0; i<SIZE; i++){
START_TIMER
put_cabac_bypass(&c, r[i]&1);
STOP_TIMER("put_cabac_bypass")
}
-
+
for(i=0; i<SIZE; i++){
START_TIMER
put_cabac(&c, state, r[i]&1);
START_TIMER
put_cabac_u(&c, state, r[i], 6, 3, i&1);
STOP_TIMER("put_cabac_u")
- }
+ }
for(i=0; i<SIZE; i++){
START_TIMER
put_cabac_ueg(&c, state, r[i], 3, 0, 1, 2);
STOP_TIMER("put_cabac_ueg")
- }
-
+ }
+
put_cabac_terminate(&c, 1);
-
+
ff_init_cabac_decoder(&c, b, SIZE);
-
+
memset(state, 0, sizeof(state));
-
+
for(i=0; i<SIZE; i++){
START_TIMER
if( (r[i]&1) != get_cabac_bypass(&c) )
av_log(NULL, AV_LOG_ERROR, "CABAC bypass failure at %d\n", i);
STOP_TIMER("get_cabac_bypass")
}
-
+
for(i=0; i<SIZE; i++){
START_TIMER
if( (r[i]&1) != get_cabac(&c, state) )
#endif
if(!get_cabac_terminate(&c))
av_log(NULL, AV_LOG_ERROR, "where's the Terminator?\n");
-
+
return 0;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file cabac.h
* Context Adaptive Binary Arithmetic Coder.
void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
-void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4],
+void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4],
uint8_t const *mps_state, uint8_t const *lps_state, int state_count);
static inline void put_cabac_bit(CABACContext *c, int b){
- put_bits(&c->pb, 1, b);
- for(;c->outstanding_count; c->outstanding_count--){
+ put_bits(&c->pb, 1, b);
+ for(;c->outstanding_count; c->outstanding_count--){
put_bits(&c->pb, 1, 1-b);
}
}
put_cabac_bit(c, 1);
c->low -= 0x200;
}
-
+
c->range+= c->range;
c->low += c->low;
}
static inline void put_cabac(CABACContext *c, uint8_t * const state, int bit){
int RangeLPS= c->lps_range[*state][c->range>>6];
-
+
if(bit == ((*state)&1)){
c->range -= RangeLPS;
*state= c->mps_state[*state];
c->range = RangeLPS;
*state= c->lps_state[*state];
}
-
+
renorm_cabac_encoder(c);
#ifdef STRICT_LIMITS
put_cabac_bit(c, 1);
c->low -= 0x400;
}
-
+
#ifdef STRICT_LIMITS
c->symCount++;
#endif
}else{
c->low += c->range;
c->range= 2;
-
+
renorm_cabac_encoder(c);
assert(c->low <= 0x1FF);
put_cabac_bit(c, c->low>>9);
put_bits(&c->pb, 2, ((c->low>>7)&3)|1);
-
+
flush_put_bits(&c->pb); //FIXME FIXME FIXME XXX wrong
}
-
+
#ifdef STRICT_LIMITS
c->symCount++;
#endif
*/
static inline void put_cabac_u(CABACContext *c, uint8_t * state, int v, int max, int max_index, int truncated){
int i;
-
+
assert(v <= max);
-
+
#if 1
for(i=0; i<v; i++){
put_cabac(c, state, 1);
*/
static inline void put_cabac_ueg(CABACContext *c, uint8_t * state, int v, int max, int is_signed, int k, int max_index){
int i;
-
+
if(v==0)
put_cabac(c, state, 0);
else{
const int sign= v < 0;
-
+
if(is_signed) v= ABS(v);
-
+
if(v<max){
for(i=0; i<v; i++){
put_cabac(c, state, 1);
i= 8 - ff_h264_norm_shift[x>>(CABAC_BITS+1)];
x= -CABAC_MASK;
-
+
if(c->bytestream < c->bytestream_end)
#if CABAC_BITS == 16
x+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1);
#else
x+= c->bytestream[0]<<1;
#endif
-
+
c->low += x<<i;
c->bytestream+= CABAC_BITS/8;
}
static inline int get_cabac(CABACContext *c, uint8_t * const state){
int RangeLPS= c->lps_range[*state][c->range>>(CABAC_BITS+7)]<<(CABAC_BITS+1);
int bit, lps_mask attribute_unused;
-
+
c->range -= RangeLPS;
#if 1
if(c->low < c->range){
}
#else
lps_mask= (c->range - c->low)>>31;
-
+
c->low -= c->range & lps_mask;
c->range += (RangeLPS - c->range) & lps_mask;
-
+
bit= ((*state)^lps_mask)&1;
*state= c->mps_state[(*state) - (128&lps_mask)];
-
+
lps_mask= ff_h264_norm_shift[c->range>>(CABAC_BITS+2)];
c->range<<= lps_mask;
c->low <<= lps_mask;
refill2(c);
#endif
- return bit;
+ return bit;
}
static inline int get_cabac_bypass(CABACContext *c){
if(!(c->low & CABAC_MASK))
refill(c);
-
+
if(c->low < c->range){
return 0;
}else{
return 0;
}else{
return c->bytestream - c->bytestream_start;
- }
+ }
}
/**
*/
static inline int get_cabac_u(CABACContext *c, uint8_t * state, int max, int max_index, int truncated){
int i;
-
- for(i=0; i<max; i++){
+
+ for(i=0; i<max; i++){
if(get_cabac(c, state)==0)
return i;
-
+
if(i< max_index) state++;
}
static inline int get_cabac_ueg(CABACContext *c, uint8_t * state, int max, int is_signed, int k, int max_index){
int i, v;
int m= 1<<k;
-
- if(get_cabac(c, state)==0)
+
+ if(get_cabac(c, state)==0)
return 0;
-
+
if(0 < max_index) state++;
-
- for(i=1; i<max; i++){
+
+ for(i=1; i<max; i++){
if(get_cabac(c, state)==0){
if(is_signed && get_cabac_bypass(c)){
return -i;
if(i < max_index) state++;
}
-
+
while(get_cabac_bypass(c)){
i+= m;
m+= m;
}
-
+
v=0;
while(m>>=1){
v+= v + get_cabac_bypass(c);
codebook[i].u = 128 + *data++;
codebook[i].v = 128 + *data++;
} else {
- /* this codebook type indicates either greyscale or
+ /* this codebook type indicates either greyscale or
* palettized video; if palettized, U & V components will
* not be used so it is safe to set them to 128 for the
* benefit of greyscale rendering in YUV420P */
case 0x2100:
case 0x2400:
case 0x2500:
- cinepak_decode_codebook (strip->v4_codebook, chunk_id,
+ cinepak_decode_codebook (strip->v4_codebook, chunk_id,
chunk_size, data);
break;
case 0x2300:
case 0x2600:
case 0x2700:
- cinepak_decode_codebook (strip->v1_codebook, chunk_id,
+ cinepak_decode_codebook (strip->v1_codebook, chunk_id,
chunk_size, data);
break;
case 0x3000:
case 0x3100:
case 0x3200:
- return cinepak_decode_vectors (s, strip, chunk_id,
+ return cinepak_decode_vectors (s, strip, chunk_id,
chunk_size, data);
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file cljr.c
* Cirrus Logic AccuPak codec.
*/
-
+
#include "avcodec.h"
#include "mpegvideo.h"
GetBitContext gb;
} CLJRContext;
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
*data_size = sizeof(AVPicture);
emms_c();
-
+
return buf_size;
}
p->key_frame= 1;
emms_c();
-
+
align_put_bits(&a->pb);
while(get_bit_count(&a->pb)&31)
put_bits(&a->pb, 8, 0);
-
+
size= get_bit_count(&a->pb)/32;
-
+
return size*4;
}
#endif
static int decode_init(AVCodecContext *avctx){
common_init(avctx);
-
+
avctx->pix_fmt= PIX_FMT_YUV411P;
return 0;
static int encode_init(AVCodecContext *avctx){
common_init(avctx);
-
+
return 0;
}
#endif
*/
/**
- * @file cyuv.c
+ * @file cyuv.c
* Creative YUV (CYUV) Video Decoder.
*/
-
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
return 0;
}
-static int cyuv_decode_frame(AVCodecContext *avctx,
+static int cyuv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
/* iterate through each line in the height */
for (y_ptr = 0, u_ptr = 0, v_ptr = 0;
- y_ptr < (s->height * s->frame.linesize[0]);
+ y_ptr < (s->height * s->frame.linesize[0]);
y_ptr += s->frame.linesize[0] - s->width,
u_ptr += s->frame.linesize[1] - s->width / 4,
v_ptr += s->frame.linesize[2] - s->width / 4) {
/**
* @file dct-test.c
- * DCT test. (c) 2001 Fabrice Bellard.
+ * DCT test. (c) 2001 Fabrice Bellard.
* Started from sample code by Juan J. Sierralta P.
*/
static short idct_mmx_perm[64];
static short idct_simple_mmx_perm[64]={
- 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
- 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
- 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
- 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
- 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
- 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
- 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
+ 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
+ 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
+ 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
+ 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
+ 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
+ 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
+ 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
};
for(i=0;i<64;i++)
block1[i] = 0;
switch(test){
- case 0:
+ case 0:
for(i=0;i<64;i++)
block1[i] = (random() % 512) -256;
if (is_idct){
for(i=0;i<64;i++)
sum+=block1[i];
- if((sum&1)==0) block1[63]^=1;
+ if((sum&1)==0) block1[63]^=1;
}
#endif
for(i=0;i<64;i++)
sum+=block[i];
- if((sum&1)==0) block[63]^=1;
+ if((sum&1)==0) block[63]^=1;
}
#endif
fdct_func(block);
emms(); /* for ff_mmx_idct */
- if (fdct_func == fdct_ifast
-#ifndef FAAN_POSTSCALE
+ if (fdct_func == fdct_ifast
+#ifndef FAAN_POSTSCALE
|| fdct_func == ff_faandct
#endif
) {
#endif
}
for(i=0; i<64; i++) sysErrMax= MAX(sysErrMax, ABS(sysErr[i]));
-
+
#if 1 // dump systematic errors
for(i=0; i<64; i++){
if(i%8==0) printf("\n");
}
printf("\n");
#endif
-
+
printf("%s %s: err_inf=%d err2=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n",
is_idct ? "IDCT" : "DCT",
name, err_inf, (double)err2 / NB_ITS / 64.0, (double)sysErrMax / NB_ITS, maxout, blockSumErrMax);
for(i=0;i<64;i++)
block1[i] = 0;
switch(test){
- case 0:
+ case 0:
for(i=0;i<64;i++)
block1[i] = (random() % 512) -256;
if (is_idct){
sum += c8[i][j] * c8[i][j];
}
}
-
+
for(i=0;i<4;i++) {
sum = 0;
for(j=0;j<4;j++) {
}
}
-void idct248_error(const char *name,
+void idct248_error(const char *name,
void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block))
{
int it, i, it1, ti, ti1, err_max, v;
srandom(0);
-
+
/* just one test to see if code is correct (precision is less
important here) */
err_max = 0;
for(it=0;it<NB_ITS;it++) {
-
+
/* XXX: use forward transform to generate values */
for(i=0;i<64;i++)
block1[i] = (random() % 256) - 128;
for(i=0; i<64; i++)
block[i]= block1[i];
idct248_ref(img_dest1, 8, block);
-
+
for(i=0; i<64; i++)
block[i]= block1[i];
idct248_put(img_dest, 8, block);
-
+
for(i=0;i<64;i++) {
v = abs((int)img_dest[i] - (int)img_dest1[i]);
if (v == 255)
}
printf("\n");
}
-
+
printf("out=\n");
for(i=0;i<8;i++) {
int j;
cropTbl[i] = 0;
cropTbl[i + MAX_NEG_CROP + 256] = 255;
}
-
+
for(;;) {
c = getopt(argc, argv, "ih4");
if (c == -1)
break;
}
}
-
+
if(optind <argc) test= atoi(argv[optind]);
-
+
printf("ffmpeg DCT/IDCT test\n");
if (test_248_dct) {
static int sol_table_new[16] =
{ 0x0, 0x1, 0x2, 0x3, 0x6, 0xA, 0xF, 0x15,
0x0, -0x1, -0x2, -0x3, -0x6, -0xA, -0xF, -0x15};
-
+
static int sol_table_16[128] = {
0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120,
}
break;
-
+
case CODEC_ID_SOL_DPCM:
switch(avctx->codec_tag){
case 1:
return -1;
}
break;
-
+
default:
break;
}
*
* gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni@gmx.at>
*/
-
+
/**
* @file dsputil.c
* DSP utils
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
uint16_t __align8 inv_zigzag_direct16[64] = {0, };
const uint8_t ff_alternate_horizontal_scan[64] = {
- 0, 1, 2, 3, 8, 9, 16, 17,
+ 0, 1, 2, 3, 8, 9, 16, 17,
10, 11, 4, 5, 6, 7, 15, 14,
- 13, 12, 19, 18, 24, 25, 32, 33,
+ 13, 12, 19, 18, 24, 25, 32, 33,
26, 27, 20, 21, 22, 23, 28, 29,
- 30, 31, 34, 35, 40, 41, 48, 49,
+ 30, 31, 34, 35, 40, 41, 48, 49,
42, 43, 36, 37, 38, 39, 44, 45,
- 46, 47, 50, 51, 56, 57, 58, 59,
+ 46, 47, 50, 51, 56, 57, 58, 59,
52, 53, 54, 55, 60, 61, 62, 63,
};
const uint8_t ff_alternate_vertical_scan[64] = {
- 0, 8, 16, 24, 1, 9, 2, 10,
+ 0, 8, 16, 24, 1, 9, 2, 10,
17, 25, 32, 40, 48, 56, 57, 49,
- 41, 33, 26, 18, 3, 11, 4, 12,
+ 41, 33, 26, 18, 3, 11, 4, 12,
19, 27, 34, 42, 50, 58, 35, 43,
- 51, 59, 20, 28, 5, 13, 6, 14,
+ 51, 59, 20, 28, 5, 13, 6, 14,
21, 29, 36, 44, 52, 60, 37, 45,
- 53, 61, 22, 30, 7, 15, 23, 31,
+ 53, 61, 22, 30, 7, 15, 23, 31,
38, 46, 54, 62, 39, 47, 55, 63,
};
/* a*inverse[b]>>32 == a/b for all 0<=a<=65536 && 2<=b<=255 */
const uint32_t inverse[256]={
- 0, 4294967295U,2147483648U,1431655766, 1073741824, 858993460, 715827883, 613566757,
- 536870912, 477218589, 429496730, 390451573, 357913942, 330382100, 306783379, 286331154,
- 268435456, 252645136, 238609295, 226050911, 214748365, 204522253, 195225787, 186737709,
- 178956971, 171798692, 165191050, 159072863, 153391690, 148102321, 143165577, 138547333,
- 134217728, 130150525, 126322568, 122713352, 119304648, 116080198, 113025456, 110127367,
- 107374183, 104755300, 102261127, 99882961, 97612894, 95443718, 93368855, 91382283,
- 89478486, 87652394, 85899346, 84215046, 82595525, 81037119, 79536432, 78090315,
- 76695845, 75350304, 74051161, 72796056, 71582789, 70409300, 69273667, 68174085,
- 67108864, 66076420, 65075263, 64103990, 63161284, 62245903, 61356676, 60492498,
- 59652324, 58835169, 58040099, 57266231, 56512728, 55778797, 55063684, 54366675,
- 53687092, 53024288, 52377650, 51746594, 51130564, 50529028, 49941481, 49367441,
- 48806447, 48258060, 47721859, 47197443, 46684428, 46182445, 45691142, 45210183,
- 44739243, 44278014, 43826197, 43383509, 42949673, 42524429, 42107523, 41698712,
- 41297763, 40904451, 40518560, 40139882, 39768216, 39403370, 39045158, 38693400,
- 38347923, 38008561, 37675152, 37347542, 37025581, 36709123, 36398028, 36092163,
- 35791395, 35495598, 35204650, 34918434, 34636834, 34359739, 34087043, 33818641,
- 33554432, 33294321, 33038210, 32786010, 32537632, 32292988, 32051995, 31814573,
- 31580642, 31350127, 31122952, 30899046, 30678338, 30460761, 30246249, 30034737,
- 29826162, 29620465, 29417585, 29217465, 29020050, 28825284, 28633116, 28443493,
- 28256364, 28071682, 27889399, 27709467, 27531842, 27356480, 27183338, 27012373,
- 26843546, 26676816, 26512144, 26349493, 26188825, 26030105, 25873297, 25718368,
- 25565282, 25414008, 25264514, 25116768, 24970741, 24826401, 24683721, 24542671,
- 24403224, 24265352, 24129030, 23994231, 23860930, 23729102, 23598722, 23469767,
- 23342214, 23216040, 23091223, 22967740, 22845571, 22724695, 22605092, 22486740,
- 22369622, 22253717, 22139007, 22025474, 21913099, 21801865, 21691755, 21582751,
- 21474837, 21367997, 21262215, 21157475, 21053762, 20951060, 20849356, 20748635,
- 20648882, 20550083, 20452226, 20355296, 20259280, 20164166, 20069941, 19976593,
- 19884108, 19792477, 19701685, 19611723, 19522579, 19434242, 19346700, 19259944,
- 19173962, 19088744, 19004281, 18920561, 18837576, 18755316, 18673771, 18592933,
- 18512791, 18433337, 18354562, 18276457, 18199014, 18122225, 18046082, 17970575,
- 17895698, 17821442, 17747799, 17674763, 17602325, 17530479, 17459217, 17388532,
+ 0, 4294967295U,2147483648U,1431655766, 1073741824, 858993460, 715827883, 613566757,
+ 536870912, 477218589, 429496730, 390451573, 357913942, 330382100, 306783379, 286331154,
+ 268435456, 252645136, 238609295, 226050911, 214748365, 204522253, 195225787, 186737709,
+ 178956971, 171798692, 165191050, 159072863, 153391690, 148102321, 143165577, 138547333,
+ 134217728, 130150525, 126322568, 122713352, 119304648, 116080198, 113025456, 110127367,
+ 107374183, 104755300, 102261127, 99882961, 97612894, 95443718, 93368855, 91382283,
+ 89478486, 87652394, 85899346, 84215046, 82595525, 81037119, 79536432, 78090315,
+ 76695845, 75350304, 74051161, 72796056, 71582789, 70409300, 69273667, 68174085,
+ 67108864, 66076420, 65075263, 64103990, 63161284, 62245903, 61356676, 60492498,
+ 59652324, 58835169, 58040099, 57266231, 56512728, 55778797, 55063684, 54366675,
+ 53687092, 53024288, 52377650, 51746594, 51130564, 50529028, 49941481, 49367441,
+ 48806447, 48258060, 47721859, 47197443, 46684428, 46182445, 45691142, 45210183,
+ 44739243, 44278014, 43826197, 43383509, 42949673, 42524429, 42107523, 41698712,
+ 41297763, 40904451, 40518560, 40139882, 39768216, 39403370, 39045158, 38693400,
+ 38347923, 38008561, 37675152, 37347542, 37025581, 36709123, 36398028, 36092163,
+ 35791395, 35495598, 35204650, 34918434, 34636834, 34359739, 34087043, 33818641,
+ 33554432, 33294321, 33038210, 32786010, 32537632, 32292988, 32051995, 31814573,
+ 31580642, 31350127, 31122952, 30899046, 30678338, 30460761, 30246249, 30034737,
+ 29826162, 29620465, 29417585, 29217465, 29020050, 28825284, 28633116, 28443493,
+ 28256364, 28071682, 27889399, 27709467, 27531842, 27356480, 27183338, 27012373,
+ 26843546, 26676816, 26512144, 26349493, 26188825, 26030105, 25873297, 25718368,
+ 25565282, 25414008, 25264514, 25116768, 24970741, 24826401, 24683721, 24542671,
+ 24403224, 24265352, 24129030, 23994231, 23860930, 23729102, 23598722, 23469767,
+ 23342214, 23216040, 23091223, 22967740, 22845571, 22724695, 22605092, 22486740,
+ 22369622, 22253717, 22139007, 22025474, 21913099, 21801865, 21691755, 21582751,
+ 21474837, 21367997, 21262215, 21157475, 21053762, 20951060, 20849356, 20748635,
+ 20648882, 20550083, 20452226, 20355296, 20259280, 20164166, 20069941, 19976593,
+ 19884108, 19792477, 19701685, 19611723, 19522579, 19434242, 19346700, 19259944,
+ 19173962, 19088744, 19004281, 18920561, 18837576, 18755316, 18673771, 18592933,
+ 18512791, 18433337, 18354562, 18276457, 18199014, 18122225, 18046082, 17970575,
+ 17895698, 17821442, 17747799, 17674763, 17602325, 17530479, 17459217, 17388532,
17318417, 17248865, 17179870, 17111424, 17043522, 16976156, 16909321, 16843010,
};
/* Input permutation for the simple_idct_mmx */
static const uint8_t simple_mmx_permutation[64]={
- 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
- 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
- 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
- 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
- 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
- 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
- 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
+ 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
+ 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
+ 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
+ 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
+ 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
+ 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
+ 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
};
static void bswap_buf(uint32_t *dst, uint32_t *src, int w){
int i;
-
+
for(i=0; i+8<=w; i+=8){
dst[i+0]= bswap_32(src[i+0]);
dst[i+1]= bswap_32(src[i+1]);
int tmp[16*16];
#if 0
int level, ori;
- static const int scale[2][2][4][4]={
+ static const int scale[2][2][4][4]={
{
{
//8x8 dec=3
int stride= 16<<(dec_count-level);
int sy= (ori&2) ? stride>>1 : 0;
int size= 1<<level;
-
+
for(i=0; i<size; i++){
for(j=0; j<size; j++){
int v= tmp[sx + sy + i*stride + j] * scale[type][dec_count-3][level][ori];
s+= ABS(tmp[16*i+j+3]);
}
}
- assert(s>=0);
-
+ assert(s>=0);
+
return s>>2;
#endif
}
{
int i;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
-
+
/* read the pixels */
for(i=0;i<8;i++) {
pixels[0] = cm[block[0]];
{
int i;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
-
+
/* read the pixels */
for(i=0;i<4;i++) {
pixels[0] = cm[block[0]];
{
int i;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
-
+
/* read the pixels */
for(i=0;i<2;i++) {
pixels[0] = cm[block[0]];
}
}
-static void put_signed_pixels_clamped_c(const DCTELEM *block,
+static void put_signed_pixels_clamped_c(const DCTELEM *block,
uint8_t *restrict pixels,
int line_size)
{
{
int i;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
-
+
/* read the pixels */
for(i=0;i<8;i++) {
pixels[0] = cm[pixels[0] + block[0]];
{
int i;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
-
+
/* read the pixels */
for(i=0;i<4;i++) {
pixels[0] = cm[pixels[0] + block[0]];
{
int i;
uint8_t *cm = cropTbl + MAX_NEG_CROP;
-
+
/* read the pixels */
for(i=0;i<2;i++) {
pixels[0] = cm[pixels[0] + block[0]];
}
}
-static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
+static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
{
int y, vx, vy;
const int s= 1<<shift;
-
+
width--;
height--;
frac_y= src_y&(s-1);
src_x>>=shift;
src_y>>=shift;
-
+
if((unsigned)src_x < width){
if((unsigned)src_y < height){
index= src_x + src_y*stride;
+ src[index+stride+1]* frac_x )* frac_y
+ r)>>(shift*2);
}else{
- index= src_x + clip(src_y, 0, height)*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
+ index= src_x + clip(src_y, 0, height)*stride;
+ dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
+ src[index +1]* frac_x )*s
+ r)>>(shift*2);
}
}else{
if((unsigned)src_y < height){
- index= clip(src_x, 0, width) + src_y*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_y)
+ index= clip(src_x, 0, width) + src_y*stride;
+ dst[y*stride + x]= ( ( src[index ]*(s-frac_y)
+ src[index+stride ]* frac_y )*s
+ r)>>(shift*2);
}else{
- index= clip(src_x, 0, width) + clip(src_y, 0, height)*stride;
+ index= clip(src_x, 0, width) + clip(src_y, 0, height)*stride;
dst[y*stride + x]= src[index ];
}
}
-
+
vx+= dxx;
vy+= dyx;
}
dst += stride;
}
}
-
+
static inline void put_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
int i,j;
for (i=0; i < height; i++) {
dst += stride;
}
}
-
+
static inline void put_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
int i,j;
for (i=0; i < height; i++) {
dst += stride;
}
}
-
+
static inline void avg_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
int i,j;
for (i=0; i < height; i++) {
dst += stride;
}
}
-
+
static inline void avg_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
int i,j;
for (i=0; i < height; i++) {
dst[6]= cm[(9*(src[6] + src[7]) - (src[ 5] + src[8]) + 8)>>4];
dst[7]= cm[(9*(src[7] + src[8]) - (src[ 6] + src[9]) + 8)>>4];
dst+=dstStride;
- src+=srcStride;
+ src+=srcStride;
}
}
static void h263_v_loop_filter_c(uint8_t *src, int stride, int qscale){
int x;
const int strength= ff_h263_loop_filter_strength[qscale];
-
+
for(x=0; x<8; x++){
int d1, d2, ad1;
int p0= src[x-2*stride];
else if(d< strength) d1= d;
else if(d< 2*strength) d1= 2*strength - d;
else d1= 0;
-
+
p1 += d1;
p2 -= d1;
if(p1&256) p1= ~(p1>>31);
if(p2&256) p2= ~(p2>>31);
-
+
src[x-1*stride] = p1;
src[x+0*stride] = p2;
ad1= ABS(d1)>>1;
-
+
d2= clip((p0-p3)/4, -ad1, ad1);
-
+
src[x-2*stride] = p0 - d2;
src[x+ stride] = p3 + d2;
}
static void h263_h_loop_filter_c(uint8_t *src, int stride, int qscale){
int y;
const int strength= ff_h263_loop_filter_strength[qscale];
-
+
for(y=0; y<8; y++){
int d1, d2, ad1;
int p0= src[y*stride-2];
else if(d< strength) d1= d;
else if(d< 2*strength) d1= 2*strength - d;
else d1= 0;
-
+
p1 += d1;
p2 -= d1;
if(p1&256) p1= ~(p1>>31);
if(p2&256) p2= ~(p2>>31);
-
+
src[y*stride-1] = p1;
src[y*stride+0] = p2;
ad1= ABS(d1)>>1;
-
+
d2= clip((p0-p3)/4, -ad1, ad1);
-
+
src[y*stride-2] = p0 - d2;
src[y*stride+1] = p3 + d2;
}
temp[yz] = src[xy - stride] + 2*src[xy] + src[xy + stride];
}
}
-
+
for(y=0; y<8; y++){
src[ y*stride] = (temp[ y*8] + 2)>>2;
src[7+y*stride] = (temp[7+y*8] + 2)>>2;
const int q0 = pix[0];
const int q1 = pix[1*xstride];
const int q2 = pix[2*xstride];
-
+
if( ABS( p0 - q0 ) < alpha &&
ABS( p1 - p0 ) < beta &&
ABS( q1 - q0 ) < beta ) {
-
+
int tc = tc0[i];
int i_delta;
-
+
if( ABS( p2 - p0 ) < beta ) {
pix[-2*xstride] = p1 + clip( (( p2 + ( ( p0 + q0 + 1 ) >> 1 ) ) >> 1) - p1, -tc0[i], tc0[i] );
tc++;
pix[ xstride] = q1 + clip( (( q2 + ( ( p0 + q0 + 1 ) >> 1 ) ) >> 1) - q1, -tc0[i], tc0[i] );
tc++;
}
-
+
i_delta = clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
pix[-xstride] = clip_uint8( p0 + i_delta ); /* p0' */
pix[0] = clip_uint8( q0 - i_delta ); /* q0' */
int score1=0;
int score2=0;
int x,y;
-
+
for(y=0; y<h; y++){
for(x=0; x<8; x++){
score1+= (s1[x ] - s2[x ])*(s1[x ] - s2[x ]);
s1+= stride;
s2+= stride;
}
-
+
if(c) return score1 + ABS(score2)*c->avctx->nsse_weight;
else return score1 + ABS(score2)*8;
}
for(i=0; i<8*8; i++){
rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT);
- }
+ }
}
/**
* @param block the block which will be permuted according to the given permutation vector
* @param permutation the permutation vector
* @param last the last non zero coefficient in scantable order, used to speed the permutation up
- * @param scantable the used scantable, this is only used to speed the permutation up, the block is not
+ * @param scantable the used scantable, this is only used to speed the permutation up, the block is not
* (inverse) permutated to scantable order!
*/
void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)
{
int i;
DCTELEM temp[64];
-
+
if(last<=0) return;
//if(permutation[1]==1) return; //FIXME its ok but not clean and might fail for some perms
temp[j]= block[j];
block[j]=0;
}
-
+
for(i=0; i<=last; i++){
const int j= scantable[i];
const int perm_j= permutation[j];
void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){
int i;
-
+
memset(cmp, 0, sizeof(void*)*5);
-
+
for(i=0; i<5; i++){
switch(type&0xFF){
case FF_CMP_SAD:
lt= src1[i];
l= src2[i];
dst[i]= l - pred;
- }
+ }
*left= l;
*left_top= lt;
int i;
int temp[64];
int sum=0;
-
+
assert(h==8);
for(i=0; i<8; i++){
BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2]-dst[stride*i+2],src[stride*i+3]-dst[stride*i+3]);
BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4]-dst[stride*i+4],src[stride*i+5]-dst[stride*i+5]);
BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6]-dst[stride*i+6],src[stride*i+7]-dst[stride*i+7]);
-
+
BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
-
+
BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
-
+
BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
- sum +=
+ sum +=
BUTTERFLYA(temp[8*0+i], temp[8*4+i])
+BUTTERFLYA(temp[8*1+i], temp[8*5+i])
+BUTTERFLYA(temp[8*2+i], temp[8*6+i])
int i;
int temp[64];
int sum=0;
-
+
assert(h==8);
-
+
for(i=0; i<8; i++){
//FIXME try pointer walks
BUTTERFLY2(temp[8*i+0], temp[8*i+1], src[stride*i+0],src[stride*i+1]);
BUTTERFLY2(temp[8*i+2], temp[8*i+3], src[stride*i+2],src[stride*i+3]);
BUTTERFLY2(temp[8*i+4], temp[8*i+5], src[stride*i+4],src[stride*i+5]);
BUTTERFLY2(temp[8*i+6], temp[8*i+7], src[stride*i+6],src[stride*i+7]);
-
+
BUTTERFLY1(temp[8*i+0], temp[8*i+2]);
BUTTERFLY1(temp[8*i+1], temp[8*i+3]);
BUTTERFLY1(temp[8*i+4], temp[8*i+6]);
BUTTERFLY1(temp[8*i+5], temp[8*i+7]);
-
+
BUTTERFLY1(temp[8*i+0], temp[8*i+4]);
BUTTERFLY1(temp[8*i+1], temp[8*i+5]);
BUTTERFLY1(temp[8*i+2], temp[8*i+6]);
BUTTERFLY1(temp[8*2+i], temp[8*3+i]);
BUTTERFLY1(temp[8*4+i], temp[8*5+i]);
BUTTERFLY1(temp[8*6+i], temp[8*7+i]);
-
+
BUTTERFLY1(temp[8*0+i], temp[8*2+i]);
BUTTERFLY1(temp[8*1+i], temp[8*3+i]);
BUTTERFLY1(temp[8*4+i], temp[8*6+i]);
BUTTERFLY1(temp[8*5+i], temp[8*7+i]);
-
- sum +=
+
+ sum +=
BUTTERFLYA(temp[8*0+i], temp[8*4+i])
+BUTTERFLYA(temp[8*1+i], temp[8*5+i])
+BUTTERFLYA(temp[8*2+i], temp[8*6+i])
+BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
}
-
+
sum -= ABS(temp[8*0] + temp[8*4]); // -mean
-
+
return sum;
}
uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
DCTELEM * const temp= (DCTELEM*)aligned_temp;
int sum=0, i;
-
+
assert(h==8);
s->dsp.diff_pixels(temp, src1, src2, stride);
for(i=0; i<64; i++)
sum+= ABS(temp[i]);
-
+
return sum;
}
uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8];
DCTELEM * const temp= (DCTELEM*)aligned_temp;
int sum=0, i;
-
+
assert(h==8);
s->dsp.diff_pixels(temp, src1, src2, stride);
for(i=0; i<64; i++)
sum= FFMAX(sum, ABS(temp[i]));
-
+
return sum;
}
assert(h==8);
s->mb_intra=0;
-
+
s->dsp.diff_pixels(temp, src1, src2, stride);
-
+
memcpy(bak, temp, 64*sizeof(DCTELEM));
-
+
s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
s->dct_unquantize_inter(s, temp, 0, s->qscale);
- simple_idct(temp); //FIXME
-
+ simple_idct(temp); //FIXME
+
for(i=0; i<64; i++)
sum+= (temp[i]-bak[i])*(temp[i]-bak[i]);
-
+
return sum;
}
const int esc_length= s->ac_esc_length;
uint8_t * length;
uint8_t * last_length;
-
+
assert(h==8);
for(i=0; i<8; i++){
s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
bits=0;
-
+
if (s->mb_intra) {
- start_i = 1;
+ start_i = 1;
length = s->intra_ac_vlc_length;
last_length= s->intra_ac_vlc_last_length;
bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
length = s->inter_ac_vlc_length;
last_length= s->inter_ac_vlc_last_length;
}
-
+
if(last>=start_i){
run=0;
for(i=start_i; i<last; i++){
int j= scantable[i];
level= temp[j];
-
+
if(level){
level+=64;
if((level&(~127)) == 0){
run++;
}
i= scantable[last];
-
+
level= temp[i] + 64;
assert(level - 64);
-
+
if((level&(~127)) == 0){
bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
}else
bits+= esc_length;
-
+
}
if(last>=0){
else
s->dct_unquantize_inter(s, temp, 0, s->qscale);
}
-
+
s->dsp.idct_add(bak, stride, temp);
-
+
distoration= s->dsp.sse[1](NULL, bak, src1, stride, 8);
return distoration + ((bits*s->qscale*s->qscale*109 + 64)>>7);
uint8_t * last_length;
assert(h==8);
-
+
s->dsp.diff_pixels(temp, src1, src2, stride);
s->block_last_index[0/*FIXME*/]= last= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
bits=0;
-
+
if (s->mb_intra) {
- start_i = 1;
+ start_i = 1;
length = s->intra_ac_vlc_length;
last_length= s->intra_ac_vlc_last_length;
bits+= s->luma_dc_vlc_length[temp[0] + 256]; //FIXME chroma
length = s->inter_ac_vlc_length;
last_length= s->inter_ac_vlc_last_length;
}
-
+
if(last>=start_i){
run=0;
for(i=start_i; i<last; i++){
int j= scantable[i];
level= temp[j];
-
+
if(level){
level+=64;
if((level&(~127)) == 0){
run++;
}
i= scantable[last];
-
+
level= temp[i] + 64;
-
+
assert(level - 64);
-
+
if((level&(~127)) == 0){
bits+= last_length[UNI_AC_ENC_INDEX(run, level)];
}else
static int vsad_intra16_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){
int score=0;
int x,y;
-
+
for(y=1; y<h; y++){
for(x=0; x<16; x+=4){
- score+= ABS(s[x ] - s[x +stride]) + ABS(s[x+1] - s[x+1+stride])
+ score+= ABS(s[x ] - s[x +stride]) + ABS(s[x+1] - s[x+1+stride])
+ABS(s[x+2] - s[x+2+stride]) + ABS(s[x+3] - s[x+3+stride]);
}
s+= stride;
}
-
+
return score;
}
static int vsad16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
int score=0;
int x,y;
-
+
for(y=1; y<h; y++){
for(x=0; x<16; x++){
score+= ABS(s1[x ] - s2[x ] - s1[x +stride] + s2[x +stride]);
s1+= stride;
s2+= stride;
}
-
+
return score;
}
static int vsse_intra16_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){
int score=0;
int x,y;
-
+
for(y=1; y<h; y++){
for(x=0; x<16; x+=4){
- score+= SQ(s[x ] - s[x +stride]) + SQ(s[x+1] - s[x+1+stride])
+ score+= SQ(s[x ] - s[x +stride]) + SQ(s[x+1] - s[x+1+stride])
+SQ(s[x+2] - s[x+2+stride]) + SQ(s[x+3] - s[x+3+stride]);
}
s+= stride;
}
-
+
return score;
}
static int vsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
int score=0;
int x,y;
-
+
for(y=1; y<h; y++){
for(x=0; x<16; x++){
score+= SQ(s1[x ] - s2[x ] - s1[x +stride] + s2[x +stride]);
s1+= stride;
s2+= stride;
}
-
+
return score;
}
cropTbl[i] = 0;
cropTbl[i + MAX_NEG_CROP + 256] = 255;
}
-
+
for(i=0;i<512;i++) {
squareTbl[i] = (i - 256) * (i - 256);
}
-
+
for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1;
}
if(avctx->dct_algo==FF_DCT_FASTINT) {
c->fdct = fdct_ifast;
c->fdct248 = fdct_ifast248;
- }
+ }
else if(avctx->dct_algo==FF_DCT_FAAN) {
c->fdct = ff_faandct;
- c->fdct248 = ff_faandct248;
- }
+ c->fdct248 = ff_faandct248;
+ }
else {
c->fdct = ff_jpeg_fdct_islow; //slow/accurate/default
c->fdct248 = ff_fdct248_islow;
c->put_mspel_pixels_tab[5]= put_mspel8_mc12_c;
c->put_mspel_pixels_tab[6]= put_mspel8_mc22_c;
c->put_mspel_pixels_tab[7]= put_mspel8_mc32_c;
-
+
#define SET_CMP_FUNC(name) \
c->name[0]= name ## 16_c;\
c->name[1]= name ## 8x8_c;
-
+
SET_CMP_FUNC(hadamard8_diff)
c->hadamard8_diff[4]= hadamard8_intra16_c;
SET_CMP_FUNC(dct_sad)
c->h264_h_loop_filter_chroma= h264_h_loop_filter_chroma_c;
c->h264_v_loop_filter_chroma_intra= h264_v_loop_filter_chroma_intra_c;
c->h264_h_loop_filter_chroma_intra= h264_h_loop_filter_chroma_intra_c;
-
+
c->h263_h_loop_filter= h263_h_loop_filter_c;
c->h263_v_loop_filter= h263_v_loop_filter_c;
-
+
c->h261_loop_filter= h261_loop_filter_c;
-
+
c->try_8x8basis= try_8x8basis_c;
c->add_8x8basis= add_8x8basis_c;
int (*pix_sum)(uint8_t * pix, int line_size);
int (*pix_norm1)(uint8_t * pix, int line_size);
// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
-
+
me_cmp_func sad[5]; /* identical to pix_absAxA except additional void * */
me_cmp_func sse[5];
me_cmp_func hadamard8_diff[5];
/**
* Halfpel motion compensation with rounding (a+b+1)>>1.
- * this is an array[4][4] of motion compensation funcions for 4
+ * this is an array[4][4] of motion compensation funcions for 4
* horizontal blocksizes (8,16) and the 4 halfpel positions<br>
* *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
* @param block destination where the result is stored
/**
* Halfpel motion compensation with rounding (a+b+1)>>1.
- * This is an array[4][4] of motion compensation functions for 4
+ * This is an array[4][4] of motion compensation functions for 4
* horizontal blocksizes (8,16) and the 4 halfpel positions<br>
* *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
* @param block destination into which the result is averaged (a+b+1)>>1
/**
* Halfpel motion compensation with no rounding (a+b)>>1.
- * this is an array[2][4] of motion compensation funcions for 2
+ * this is an array[2][4] of motion compensation funcions for 2
* horizontal blocksizes (8,16) and the 4 halfpel positions<br>
* *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
* @param block destination where the result is stored
/**
* Halfpel motion compensation with no rounding (a+b)>>1.
- * this is an array[2][4] of motion compensation funcions for 2
+ * this is an array[2][4] of motion compensation funcions for 2
* horizontal blocksizes (8,16) and the 4 halfpel positions<br>
* *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
* @param block destination into which the result is averaged (a+b)>>1
* @param h height
*/
op_pixels_func avg_no_rnd_pixels_tab[4][4];
-
+
void (*put_no_rnd_pixels_l2[2])(uint8_t *block/*align width (8 or 16)*/, const uint8_t *a/*align 1*/, const uint8_t *b/*align 1*/, int line_size, int h);
-
+
/**
* Thirdpel motion compensation with rounding (a+b+1)>>1.
* this is an array[12] of motion compensation funcions for the 9 thirdpel positions<br>
qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
qpel_mc_func avg_no_rnd_qpel_pixels_tab[2][16];
qpel_mc_func put_mspel_pixels_tab[8];
-
+
/**
* h264 Chram MC
*/
qpel_mc_func put_h264_qpel_pixels_tab[3][16];
qpel_mc_func avg_h264_qpel_pixels_tab[3][16];
-
+
h264_weight_func weight_h264_pixels_tab[10];
h264_biweight_func biweight_h264_pixels_tab[10];
-
+
me_cmp_func pix_abs[2][4];
-
+
/* huffyuv specific */
void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w);
void (*h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta);
void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta);
-
+
void (*h263_v_loop_filter)(uint8_t *src, int stride, int qscale);
void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale);
/* (I)DCT */
void (*fdct)(DCTELEM *block/* align 16*/);
void (*fdct248)(DCTELEM *block/* align 16*/);
-
+
/* IDCT really*/
void (*idct)(DCTELEM *block/* align 16*/);
-
+
/**
* block -> idct -> clip to unsigned 8 bit -> dest.
* (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
* @param line_size size in bytes of a horizotal line of dest
*/
void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
-
+
/**
* block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
* @param line_size size in bytes of a horizotal line of dest
*/
void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
-
+
/**
* idct input permutation.
* several optimized IDCTs need a permutated input (relative to the normal order of the reference
void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
#define BASIS_SHIFT 16
#define RECON_SHIFT 6
-
+
void (*h264_idct_add)(uint8_t *dst, DCTELEM *block, int stride);
void (*h264_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
} DSPContext;
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
}
AVCodec dts_decoder = {
- "dts",
+ "dts",
CODEC_TYPE_AUDIO,
CODEC_ID_DTS,
sizeof (dts_state_t *),
* Copyright (c) 2002 Fabrice Bellard.
* Copyright (c) 2004 Roman Shaposhnik.
*
- * DV encoder
+ * DV encoder
* Copyright (c) 2003 Roman Shaposhnik.
*
* Many thanks to Dan Dennedy <dan@dennedy.org> for providing wealth
AVFrame picture;
AVCodecContext *avctx;
uint8_t *buf;
-
+
uint8_t dv_zigzag[2][64];
uint8_t dv_idct_shift[2][2][22][64];
-
+
void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size);
void (*fdct[2])(DCTELEM *block);
void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block);
#define DV_VLC_MAP_RUN_SIZE 15
#define DV_VLC_MAP_LEV_SIZE 23
#else
-#define DV_VLC_MAP_RUN_SIZE 64
+#define DV_VLC_MAP_RUN_SIZE 64
#define DV_VLC_MAP_LEV_SIZE 512 //FIXME sign was removed so this should be /2 but needs check
#endif
dv_quant_shifts[q][dv_88_areas[i]] + 1;
s->dv_idct_shift[1][0][q][j] = s->dv_idct_shift[0][0][q][j] + 1;
}
-
+
/* 248DCT */
for(i = 1; i < 64; i++) {
/* 248 table */
- s->dv_idct_shift[0][1][q][i] =
+ s->dv_idct_shift[0][1][q][i] =
dv_quant_shifts[q][dv_248_areas[i]] + 1;
s->dv_idct_shift[1][1][q][i] = s->dv_idct_shift[0][1][q][i] + 1;
}
new_dv_vlc_len[j] = dv_vlc_len[i];
new_dv_vlc_run[j] = dv_vlc_run[i];
new_dv_vlc_level[j] = dv_vlc_level[i];
-
+
if (dv_vlc_level[i]) {
new_dv_vlc_bits[j] <<= 1;
new_dv_vlc_len[j]++;
new_dv_vlc_level[j] = -dv_vlc_level[i];
}
}
-
+
/* NOTE: as a trick, we use the fact the no codes are unused
to accelerate the parsing of partial codes */
- init_vlc(&dv_vlc, TEX_VLC_BITS, j,
+ init_vlc(&dv_vlc, TEX_VLC_BITS, j,
new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0);
dv_rl_vlc = av_malloc(dv_vlc.table_size * sizeof(RL_VLC_ELEM));
int code= dv_vlc.table[i][0];
int len = dv_vlc.table[i][1];
int level, run;
-
+
if(len<0){ //more bits needed
run= 0;
level= code;
if (dv_vlc_level[i] >= DV_VLC_MAP_LEV_SIZE)
continue;
#endif
-
+
if (dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size != 0)
continue;
-
- dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc = dv_vlc_bits[i] <<
+
+ dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc = dv_vlc_bits[i] <<
(!!dv_vlc_level[i]);
- dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size = dv_vlc_len[i] +
+ dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size = dv_vlc_len[i] +
(!!dv_vlc_level[i]);
}
for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) {
if (dv_vlc_map[i][j].size == 0) {
dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
(dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
- dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
+ dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
dv_vlc_map[0][j].size;
}
}
if (dv_vlc_map[i][j].size == 0) {
dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
(dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
- dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
+ dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
dv_vlc_map[0][j].size;
}
- dv_vlc_map[i][((uint16_t)(-j))&0x1ff].vlc =
+ dv_vlc_map[i][((uint16_t)(-j))&0x1ff].vlc =
dv_vlc_map[i][j].vlc | 1;
- dv_vlc_map[i][((uint16_t)(-j))&0x1ff].size =
+ dv_vlc_map[i][((uint16_t)(-j))&0x1ff].size =
dv_vlc_map[i][j].size;
}
#endif
/* FIXME: I really don't think this should be here */
if (dv_codec_profile(avctx))
- avctx->pix_fmt = dv_codec_profile(avctx)->pix_fmt;
+ avctx->pix_fmt = dv_codec_profile(avctx)->pix_fmt;
avctx->coded_frame = &s->picture;
s->avctx= avctx;
-
+
return 0;
}
/* bit budget for AC only in 5 MBs */
static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
/* see dv_88_areas and dv_248_areas for details */
-static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
+static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
#ifndef ALT_BITSTREAM_READER
#warning only works with ALT_BITSTREAM_READER
int pos = mb->pos;
int partial_bit_count = mb->partial_bit_count;
int level, pos1, run, vlc_len, index;
-
+
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
-
+
/* if we must parse a partial vlc, we do it here */
if (partial_bit_count > 0) {
re_cache = ((unsigned)re_cache >> partial_bit_count) |
}
level = dv_rl_vlc[index].level;
run = dv_rl_vlc[index].run;
-
+
/* gotta check if we're still within gb boundaries */
if (re_index + vlc_len > last_index) {
/* should be < 16 bits otherwise a codeword could have been parsed */
#ifdef VLC_DEBUG
printf("run=%d level=%d\n", run, level);
#endif
- pos += run;
+ pos += run;
if (pos >= 64)
break;
-
+
assert(level);
pos1 = scan_table[pos];
block[pos1] = level << shift_table[pos1];
}
/* mb_x and mb_y are in units of 8 pixels */
-static inline void dv_decode_video_segment(DVVideoContext *s,
- uint8_t *buf_ptr1,
+static inline void dv_decode_video_segment(DVVideoContext *s,
+ uint8_t *buf_ptr1,
const uint16_t *mb_pos_ptr)
{
int quant, dc, dct_mode, class1, j;
uint8_t mb_bit_buffer[80 + 4] __align8; /* allow some slack */
uint8_t vs_bit_buffer[5 * 80 + 4] __align8; /* allow some slack */
const int log2_blocksize= 3-s->avctx->lowres;
-
+
assert((((int)mb_bit_buffer)&7)==0);
assert((((int)vs_bit_buffer)&7)==0);
-
+
memset(sblock, 0, sizeof(sblock));
/* pass 1 : read DC and AC coefficients in blocks */
for(j = 0;j < 6; j++) {
last_index = block_sizes[j];
init_get_bits(&gb, buf_ptr, last_index);
-
+
/* get the dc */
dc = get_sbits(&gb, 9);
dct_mode = get_bits1(&gb);
block is finished */
if (mb->pos >= 64)
bit_copy(&pb, &gb);
-
+
block += 64;
mb++;
}
-
+
/* pass 2 : we can do it just after */
#ifdef VLC_DEBUG
printf("***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
mb++;
}
}
-
+
/* compute idct and place blocks */
block = &sblock[0][0];
mb = mb_data;
}
} else {
/* don't ask me why they inverted Cb and Cr ! */
- idct_put(s->picture.data[6 - j] + c_offset,
+ idct_put(s->picture.data[6 - j] + c_offset,
s->picture.linesize[6 - j], block);
}
}
*vlc = dv_vlc_map[run][level].vlc | sign;
size = dv_vlc_map[run][level].size;
}
- else {
+ else {
if (level < DV_VLC_MAP_LEV_SIZE) {
*vlc = dv_vlc_map[0][level].vlc | sign;
size = dv_vlc_map[0][level].size;
size = 16;
}
if (run) {
- *vlc |= ((run < 16) ? dv_vlc_map[run-1][0].vlc :
+ *vlc |= ((run < 16) ? dv_vlc_map[run-1][0].vlc :
(0x1f80 | (run - 1))) << size;
size += (run < 16) ? dv_vlc_map[run-1][0].size : 13;
}
}
-
+
return size;
}
static always_inline int dv_rl2vlc_size(int run, int level)
{
int size;
-
+
if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) {
- size = dv_vlc_map[run][level].size;
+ size = dv_vlc_map[run][level].size;
}
- else {
+ else {
size = (level < DV_VLC_MAP_LEV_SIZE) ? dv_vlc_map[0][level].size : 16;
if (run) {
size += (run < 16) ? dv_vlc_map[run-1][0].size : 13;
uint32_t partial_bit_buffer; /* we can't use uint16_t here */
} EncBlockInfo;
-static always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool,
+static always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool,
PutBitContext* pb_end)
{
int prev;
return pb;
}
}
-
+
/* Store VLC */
put_bits(pb, size, vlc);
-
+
if(bi->cur_ac>=64)
break;
-
+
/* Construct the next VLC */
prev= bi->cur_ac;
bi->cur_ac = bi->next[prev];
return pb;
}
-static always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
+static always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
const uint8_t* zigzag_scan, int bias)
{
int i, area;
int max=12;
int prev=0;
- bi->mb[0] = blk[0];
-
+ bi->mb[0] = blk[0];
+
for (area = 0; area < 4; area++) {
bi->prev[area] = prev;
bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
for (i=mb_area_start[area]; i<mb_area_start[area+1]; i++) {
int level = blk[zigzag_scan[i]];
-
+
if (level+15 > 30U) {
bi->sign[i] = (level>>31)&1;
bi->mb[i] = level= ABS(level)>>4;
for(bi->cno = 0; max > classes[bi->cno]; bi->cno++);
bi->cno += bias;
-
+
if (bi->cno >= 3) {
bi->cno = 3;
prev=0;
bi->bit_size[area] = 1; // 4 areas 4 bits for EOB :)
for (; i<mb_area_start[area+1]; i= bi->next[i]) {
bi->mb[i] >>=1;
-
+
if (bi->mb[i]) {
bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, bi->mb[i]);
bi->next[prev]= i;
int score88 = 0;
int score248 = 0;
int i;
-
+
/* Compute 8-8 score (small values give a better chance for 8-8 DCT) */
s = blk;
for(i=0; i<7; i++) {
- score88 += SC(0, 8) + SC(1, 9) + SC(2, 10) + SC(3, 11) +
+ score88 += SC(0, 8) + SC(1, 9) + SC(2, 10) + SC(3, 11) +
SC(4, 12) + SC(5,13) + SC(6, 14) + SC(7, 15);
s += 8;
}
for (i=0; i<5; i++) {
if (!qnos[i])
continue;
-
+
qnos[i]--;
size[i] = 0;
for (j=0; j<6; j++, b++) {
}
}
}
- } while ((vs_total_ac_bits < size[0] + size[1] + size[2] + size[3] + size[4]) &&
+ } while ((vs_total_ac_bits < size[0] + size[1] + size[2] + size[3] + size[4]) &&
(qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]));
}
/*
* This is a very rough initial implementaion. The performance is
- * horrible and the weighting is missing. But it's missing from the
+ * horrible and the weighting is missing. But it's missing from the
* decoding step also -- so at least we're on the same page with decoder ;-)
*/
-static inline void dv_encode_video_segment(DVVideoContext *s,
- uint8_t *dif,
+static inline void dv_encode_video_segment(DVVideoContext *s,
+ uint8_t *dif,
const uint16_t *mb_pos_ptr)
{
int mb_index, i, j, v;
- int mb_x, mb_y, c_offset, linesize;
+ int mb_x, mb_y, c_offset, linesize;
uint8_t* y_ptr;
uint8_t* data;
uint8_t* ptr;
DCTELEM block[64] __align8;
EncBlockInfo enc_blks[5*6];
PutBitContext pbs[5*6];
- PutBitContext* pb;
+ PutBitContext* pb;
EncBlockInfo* enc_blk;
int vs_bit_size = 0;
int qnos[5];
-
+
assert((((int)block) & 7) == 0);
-
+
enc_blk = &enc_blks[0];
pb = &pbs[0];
for(mb_index = 0; mb_index < 5; mb_index++) {
linesize = s->picture.linesize[6 - j];
if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8))
do_edge_wrap = 1;
- }
-
+ }
+
/* Everything is set up -- now just copy data -> DCT block */
if (do_edge_wrap) { /* Edge wrap copy: 4x16 -> 8x8 */
uint8_t* d;
} else { /* Simple copy: 8x8 -> 8x8 */
s->get_pixels(block, data, linesize);
}
-
+
if(s->avctx->flags & CODEC_FLAG_INTERLACED_DCT)
enc_blk->dct_mode = dv_guess_dct_mode(block);
else
enc_blk->partial_bit_count = 0;
enc_blk->partial_bit_buffer = 0;
enc_blk->cur_ac = 0;
-
+
s->fdct[enc_blk->dct_mode](block);
-
- dv_set_class_number(block, enc_blk,
+
+ dv_set_class_number(block, enc_blk,
enc_blk->dct_mode ? ff_zigzag248_direct : ff_zigzag_direct, j/4);
-
+
init_put_bits(pb, ptr, block_sizes[j]/8);
put_bits(pb, 9, (uint16_t)(((enc_blk->mb[0] >> 3) - 1024 + 2) >> 2));
put_bits(pb, 1, enc_blk->dct_mode);
put_bits(pb, 2, enc_blk->cno);
-
+
vs_bit_size += enc_blk->bit_size[0] + enc_blk->bit_size[1] +
enc_blk->bit_size[2] + enc_blk->bit_size[3];
++enc_blk;
/* NOTE: exactly one frame must be given (120000 bytes for NTSC,
144000 bytes for PAL) */
-static int dvvideo_decode_frame(AVCodecContext *avctx,
+static int dvvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
DVVideoContext *s = avctx->priv_data;
-
+
s->sys = dv_frame_profile(buf);
if (!s->sys || buf_size < s->sys->frame_size)
return -1; /* NOTE: we only accept several full frames */
if(s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
-
+
s->picture.reference = 0;
s->picture.key_frame = 1;
s->picture.pict_type = FF_I_TYPE;
s->picture.top_field_first = 0;
s->buf = buf;
- avctx->execute(avctx, dv_decode_mt, (void**)&dv_anchor[0], NULL,
+ avctx->execute(avctx, dv_decode_mt, (void**)&dv_anchor[0], NULL,
s->sys->difseg_size * 27);
-
+
emms_c();
/* return image */
*data_size = sizeof(AVFrame);
*(AVFrame*)data= s->picture;
-
+
return s->sys->frame_size;
}
-static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
+static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
void *data)
{
DVVideoContext *s = c->priv_data;
s->picture.pict_type = FF_I_TYPE;
s->buf = buf;
- c->execute(c, dv_encode_mt, (void**)&dv_anchor[0], NULL,
+ c->execute(c, dv_encode_mt, (void**)&dv_anchor[0], NULL,
s->sys->difseg_size * 27);
emms_c();
int x, y, len, x1, v, color;
q = *pq;
-
+
for(y = 0; y < h; y++) {
*q++ = 0x10;
bitbuf = 0;
bitcnt = 6;
-
+
x = 0;
while (x < w) {
x1 = x;
int x, y, len, x1, v, color;
q = *pq;
-
+
for(y = 0; y < h; y++) {
*q++ = 0x11;
bitbuf = 0;
bitcnt = 4;
-
+
x = 0;
while (x < w) {
x1 = x;
*pq = q;
}
-static int encode_dvb_subtitles(DVBSubtitleContext *s,
+static int encode_dvb_subtitles(DVBSubtitleContext *s,
uint8_t *outbuf, AVSubtitle *h)
{
uint8_t *q, *pseg_len;
else
page_state = 2; /* mode change */
/* page_version = 0 + page_state */
- *q++ = s->object_version | (page_state << 2) | 3;
+ *q++ = s->object_version | (page_state << 2) | 3;
for (region_id = 0; region_id < h->num_rects; region_id++) {
*q++ = region_id;
for (region_id = 0; region_id < h->num_rects; region_id++) {
/* region composition segment */
-
+
if (h->rects[region_id].nb_colors <= 4) {
/* 2 bpp, some decoders do not support it correctly */
bpp_index = 0;
}
if (!s->hide_state) {
-
+
for (object_id = 0; object_id < h->num_rects; object_id++) {
/* Object Data segment */
FILE *f;
char fname[40], fname2[40];
char command[1024];
-
+
snprintf(fname, 40, "%s.ppm", filename);
f = fopen(fname, "w");
}
}
fclose(f);
-
-
+
+
snprintf(fname2, 40, "%s-a.pgm", filename);
f = fopen(fname2, "w");
}
}
fclose(f);
-
+
snprintf(command, 1024, "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
system(command);
-
+
snprintf(command, 1024, "rm %s %s", fname, fname2);
system(command);
}
FILE *f;
char fname[40], fname2[40];
char command[1024];
-
+
snprintf(fname, 40, "%s.ppm", filename);
f = fopen(fname, "w");
}
}
fclose(f);
-
-
+
+
snprintf(fname2, 40, "%s-a.pgm", filename);
f = fopen(fname2, "w");
}
}
fclose(f);
-
+
snprintf(command, 1024, "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
system(command);
-
+
snprintf(command, 1024, "rm %s %s", fname, fname2);
system(command);
}
uint32_t clut4[4];
uint32_t clut16[16];
uint32_t clut256[256];
-
+
struct DVBSubCLUT *next;
} DVBSubCLUT;
int fgcolour;
int bgcolour;
-
+
struct DVBSubObjectDisplay *region_list_next;
- struct DVBSubObjectDisplay *object_list_next;
+ struct DVBSubObjectDisplay *object_list_next;
} DVBSubObjectDisplay;
typedef struct DVBSubObject {
int id;
int type;
-
- DVBSubObjectDisplay *display_list;
-
+
+ DVBSubObjectDisplay *display_list;
+
struct DVBSubObject *next;
} DVBSubObject;
int width;
int height;
int depth;
-
+
int clut;
int bgcolour;
-
+
uint8_t *pbuf;
int buf_size;
DVBSubObjectDisplay *display_list;
-
+
struct DVBSubRegion *next;
} DVBSubRegion;
DVBSubRegion *region_list;
DVBSubCLUT *clut_list;
DVBSubObject *object_list;
-
+
int display_list_size;
DVBSubRegionDisplay *display_list;
} DVBSubContext;
while (ptr != NULL && ptr->id != object_id) {
ptr = ptr->next;
}
-
+
return ptr;
}
while (ptr != NULL && ptr->id != clut_id) {
ptr = ptr->next;
}
-
+
return ptr;
}
while (ptr != NULL && ptr->id != region_id) {
ptr = ptr->next;
}
-
+
return ptr;
}
while (region->display_list != NULL) {
display = region->display_list;
-
+
object = get_object(ctx, display->object_id);
-
+
if (object != NULL) {
obj_disp = object->display_list;
obj_disp_ptr = &object->display_list;
-
+
while (obj_disp != NULL && obj_disp != display) {
obj_disp_ptr = &obj_disp->object_list_next;
obj_disp = obj_disp->object_list_next;
}
-
+
if (obj_disp) {
*obj_disp_ptr = obj_disp->object_list_next;
-
+
if (object->display_list == NULL) {
obj2 = ctx->object_list;
obj2_ptr = &ctx->object_list;
obj2_ptr = &obj2->next;
obj2 = obj2->next;
}
-
+
*obj2_ptr = obj2->next;
-
+
av_free(obj2);
}
}
}
-
+
region->display_list = display->region_list_next;
-
+
av_free(display);
}
-
+
}
static void delete_state(DVBSubContext *ctx)
{
DVBSubRegion *region;
DVBSubCLUT *clut;
-
+
while (ctx->region_list != NULL)
{
region = ctx->region_list;
cm = cropTbl + MAX_NEG_CROP;
memset(avctx->priv_data, 0, sizeof(DVBSubContext));
-
+
ctx->composition_id = avctx->sub_id & 0xffff;
ctx->ancillary_id = avctx->sub_id >> 16;
r = (i & 1) ? 127 : 0;
g = (i & 2) ? 127 : 0;
b = (i & 4) ? 127 : 0;
- }
+ }
default_clut.clut16[i] = RGBA(r, g, b, 255);
}
a = 255;
break;
}
- }
+ }
default_clut.clut256[i] = RGBA(r, g, b, a);
}
DVBSubRegionDisplay *display;
delete_state(ctx);
-
+
while (ctx->display_list != NULL)
{
display = ctx->display_list;
ctx->display_list = display->next;
-
+
av_free(display);
}
return 0;
}
-static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
- uint8_t **srcbuf, int buf_size,
+static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
+ uint8_t **srcbuf, int buf_size,
int non_mod, uint8_t *map_table)
{
GetBitContext gb;
-
+
int bits;
int run_length;
int pixels_read = 0;
-
+
init_get_bits(&gb, *srcbuf, buf_size << 8);
-
+
while (get_bits_count(&gb) < (buf_size << 8) && pixels_read < dbuf_len) {
bits = get_bits(&gb, 2);
if (bits == 1) {
run_length = get_bits(&gb, 3) + 3;
bits = get_bits(&gb, 2);
-
+
if (non_mod == 1 && bits == 1)
pixels_read += run_length;
else {
}
}
}
-
+
if (get_bits(&gb, 6) != 0)
av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
return pixels_read;
}
-
-static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
- uint8_t **srcbuf, int buf_size,
+
+static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
+ uint8_t **srcbuf, int buf_size,
int non_mod, uint8_t *map_table)
{
GetBitContext gb;
-
+
int bits;
int run_length;
int pixels_read = 0;
-
- init_get_bits(&gb, *srcbuf, buf_size << 8);
-
+
+ init_get_bits(&gb, *srcbuf, buf_size << 8);
+
while (get_bits_count(&gb) < (buf_size << 8) && pixels_read < dbuf_len) {
bits = get_bits(&gb, 4);
bits = get_bits(&gb, 1);
if (bits == 0) {
run_length = get_bits(&gb, 3);
-
+
if (run_length == 0) {
(*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
return pixels_read;
}
-
+
run_length += 2;
-
+
if (map_table != NULL)
bits = map_table[0];
else
bits = 0;
-
+
while (run_length-- > 0 && pixels_read < dbuf_len) {
*destbuf++ = bits;
pixels_read++;
if (bits == 2) {
run_length = get_bits(&gb, 4) + 9;
bits = get_bits(&gb, 4);
-
+
if (non_mod == 1 && bits == 1)
pixels_read += run_length;
else {
}
}
}
-
+
if (get_bits(&gb, 8) != 0)
av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
-
+
(*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
return pixels_read;
}
-
-static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len,
- uint8_t **srcbuf, int buf_size,
+
+static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len,
+ uint8_t **srcbuf, int buf_size,
int non_mod, uint8_t *map_table)
{
uint8_t *sbuf_end = (*srcbuf) + buf_size;
int bits;
int run_length;
int pixels_read = 0;
-
+
while (*srcbuf < sbuf_end && pixels_read < dbuf_len) {
bits = *(*srcbuf)++;
-
+
if (bits != 0) {
if (non_mod != 1 || bits != 1) {
if (map_table != NULL)
if (run_length == 0) {
return pixels_read;
}
-
+
if (map_table != NULL)
bits = map_table[0];
else
}
}
}
-
+
if (*(*srcbuf)++ != 0)
av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
-
+
return pixels_read;
}
-
+
static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDisplay *display,
uint8_t *pbuf;
int x_pos, y_pos;
int i;
-
+
uint8_t map2to4[] = { 0x0, 0x7, 0x8, 0xf};
uint8_t map2to8[] = {0x00, 0x77, 0x88, 0xff};
- uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
uint8_t *map_table;
-
+
#ifdef DEBUG
av_log(avctx, AV_LOG_INFO, "DVB pixel block size %d, %s field:\n", buf_size,
top_bottom ? "bottom" : "top");
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
}
-
+
if (i % 16 != 0)
av_log(avctx, AV_LOG_INFO, "\n");
if (region == 0)
return;
-
+
pbuf = region->pbuf;
-
+
x_pos = display->x_pos;
y_pos = display->y_pos;
-
+
if ((y_pos & 1) != top_bottom)
y_pos++;
av_log(avctx, AV_LOG_ERROR, "Invalid object location!\n");
return;
}
-
+
switch (*buf++) {
case 0x10:
if (region->depth == 8)
map_table = map2to4;
else
map_table = NULL;
-
- x_pos += dvbsub_read_2bit_string(pbuf + (y_pos * region->width) + x_pos,
- region->width - x_pos, &buf, buf_size,
+
+ x_pos += dvbsub_read_2bit_string(pbuf + (y_pos * region->width) + x_pos,
+ region->width - x_pos, &buf, buf_size,
non_mod, map_table);
break;
case 0x11:
av_log(avctx, AV_LOG_ERROR, "4-bit pixel string in %d-bit region!\n", region->depth);
return;
}
-
+
if (region->depth == 8)
map_table = map4to8;
else
map_table = NULL;
-
- x_pos += dvbsub_read_4bit_string(pbuf + (y_pos * region->width) + x_pos,
- region->width - x_pos, &buf, buf_size,
+
+ x_pos += dvbsub_read_4bit_string(pbuf + (y_pos * region->width) + x_pos,
+ region->width - x_pos, &buf, buf_size,
non_mod, map_table);
break;
case 0x12:
av_log(avctx, AV_LOG_ERROR, "8-bit pixel string in %d-bit region!\n", region->depth);
return;
}
-
- x_pos += dvbsub_read_8bit_string(pbuf + (y_pos * region->width) + x_pos,
- region->width - x_pos, &buf, buf_size,
+
+ x_pos += dvbsub_read_8bit_string(pbuf + (y_pos * region->width) + x_pos,
+ region->width - x_pos, &buf, buf_size,
non_mod, NULL);
break;
-
+
case 0x20:
map2to4[0] = (*buf) >> 4;
map2to4[1] = (*buf++) & 0xf;
for (i = 0; i < 16; i++)
map4to8[i] = *buf++;
break;
-
+
case 0xf0:
x_pos = display->x_pos;
y_pos += 2;
av_log(avctx, AV_LOG_INFO, "Unknown/unsupported pixel block 0x%x\n", *(buf-1));
}
}
-
+
}
static void dvbsub_parse_object_segment(AVCodecContext *avctx,
uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
-
+
uint8_t *buf_end = buf + buf_size;
uint8_t *block;
int object_id;
DVBSubObject *object;
DVBSubObjectDisplay *display;
int top_field_len, bottom_field_len;
-
+
int coding_method, non_modifying_colour;
-
+
object_id = BE_16(buf);
buf += 2;
-
+
object = get_object(ctx, object_id);
- if (!object)
- return;
-
+ if (!object)
+ return;
+
coding_method = ((*buf) >> 2) & 3;
non_modifying_colour = ((*buf++) >> 1) & 1;
-
+
if (coding_method == 0) {
top_field_len = BE_16(buf);
buf += 2;
bottom_field_len = BE_16(buf);
buf += 2;
-
+
if (buf + top_field_len + bottom_field_len > buf_end) {
av_log(avctx, AV_LOG_ERROR, "Field data size too large\n");
return;
- }
-
+ }
+
for (display = object->display_list; display != 0; display = display->object_list_next) {
block = buf;
dvbsub_parse_pixel_data_block(avctx, display, block, bottom_field_len, 1,
non_modifying_colour);
}
-
+
/* } else if (coding_method == 1) {*/
-
+
} else {
av_log(avctx, AV_LOG_ERROR, "Unknown object coding %d\n", coding_method);
}
-
+
}
#define SCALEBITS 10
uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
-
+
uint8_t *buf_end = buf + buf_size;
int clut_id;
DVBSubCLUT *clut;
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
}
-
+
if (i % 16 != 0)
av_log(avctx, AV_LOG_INFO, "\n");
clut_id = *buf++;
buf += 1;
-
+
clut = get_clut(ctx, clut_id);
-
+
if (clut == NULL) {
clut = av_malloc(sizeof(DVBSubCLUT));
-
+
memcpy(clut, &default_clut, sizeof(DVBSubCLUT));
clut->id = clut_id;
-
- clut->next = ctx->clut_list;
+
+ clut->next = ctx->clut_list;
ctx->clut_list = clut;
}
-
+
while (buf + 4 < buf_end)
{
entry_id = *buf++;
-
+
depth = (*buf) & 0xe0;
-
+
if (depth == 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid clut depth 0x%x!\n", *buf);
return;
}
-
+
full_range = (*buf++) & 1;
-
+
if (full_range) {
y = *buf++;
cr = *buf++;
cr = (((buf[0] & 3) << 2) | ((buf[1] >> 6) & 3)) << 4;
cb = (buf[1] << 2) & 0xf0;
alpha = (buf[1] << 6) & 0xc0;
-
+
buf += 2;
}
-
+
if (y == 0)
alpha = 0xff;
-
+
YUV_TO_RGB1_CCIR(cb, cr);
YUV_TO_RGB2_CCIR(r, g, b, y);
-
+
#ifdef DEBUG
av_log(avctx, AV_LOG_INFO, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
#endif
-
+
if (depth & 0x80)
clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
if (depth & 0x40)
uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
-
+
uint8_t *buf_end = buf + buf_size;
int region_id, object_id;
DVBSubRegion *region;
DVBSubObject *object;
DVBSubObjectDisplay *display;
int fill;
-
+
if (buf_size < 10)
return;
-
+
region_id = *buf++;
-
+
region = get_region(ctx, region_id);
-
+
if (region == NULL)
{
region = av_mallocz(sizeof(DVBSubRegion));
-
+
region->id = region_id;
-
+
region->next = ctx->region_list;
ctx->region_list = region;
}
-
+
fill = ((*buf++) >> 3) & 1;
-
+
region->width = BE_16(buf);
buf += 2;
region->height = BE_16(buf);
buf += 2;
-
+
if (region->width * region->height != region->buf_size) {
if (region->pbuf != 0)
av_free(region->pbuf);
-
+
region->buf_size = region->width * region->height;
-
+
region->pbuf = av_malloc(region->buf_size);
-
+
fill = 1;
}
-
+
region->depth = 1 << (((*buf++) >> 2) & 7);
region->clut = *buf++;
-
+
if (region->depth == 8)
region->bgcolour = *buf++;
else {
buf += 1;
-
+
if (region->depth == 4)
region->bgcolour = (((*buf++) >> 4) & 15);
else
while (buf + 5 < buf_end) {
object_id = BE_16(buf);
buf += 2;
-
+
object = get_object(ctx, object_id);
if (object == NULL) {
object = av_mallocz(sizeof(DVBSubObject));
-
+
object->id = object_id;
object->next = ctx->object_list;
ctx->object_list = object;
}
-
+
object->type = (*buf) >> 6;
-
+
display = av_mallocz(sizeof(DVBSubObjectDisplay));
-
+
display->object_id = object_id;
display->region_id = region_id;
-
+
display->x_pos = BE_16(buf) & 0xfff;
buf += 2;
display->y_pos = BE_16(buf) & 0xfff;
buf += 2;
-
+
if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) {
display->fgcolour = *buf++;
display->bgcolour = *buf++;
}
-
+
display->region_list_next = region->display_list;
region->display_list = display;
-
+
display->object_list_next = object->display_list;
object->display_list = display;
}
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
DVBSubRegionDisplay *display;
DVBSubRegionDisplay *tmp_display_list, **tmp_ptr;
-
+
uint8_t *buf_end = buf + buf_size;
int region_id;
int page_state;
-
+
if (buf_size < 1)
return;
-
+
ctx->time_out = *buf++;
page_state = ((*buf++) >> 2) & 3;
-
+
#ifdef DEBUG
av_log(avctx, AV_LOG_INFO, "Page time out %ds, state %d\n", ctx->time_out, page_state);
#endif
{
delete_state(ctx);
}
-
+
tmp_display_list = ctx->display_list;
ctx->display_list = NULL;
ctx->display_list_size = 0;
-
+
while (buf + 5 < buf_end) {
region_id = *buf++;
buf += 1;
-
+
display = tmp_display_list;
tmp_ptr = &tmp_display_list;
-
+
while (display != NULL && display->region_id != region_id) {
tmp_ptr = &display->next;
display = display->next;
}
-
+
if (display == NULL)
display = av_mallocz(sizeof(DVBSubRegionDisplay));
-
+
display->region_id = region_id;
-
+
display->x_pos = BE_16(buf);
buf += 2;
display->y_pos = BE_16(buf);
buf += 2;
-
+
*tmp_ptr = display->next;
-
+
display->next = ctx->display_list;
ctx->display_list = display;
ctx->display_list_size++;
-
+
#ifdef DEBUG
av_log(avctx, AV_LOG_INFO, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
#endif
}
-
+
while (tmp_display_list != 0) {
display = tmp_display_list;
-
+
tmp_display_list = display->next;
-
+
av_free(display);
}
-
+
}
y_pos = -1;
width = 0;
height = 0;
-
+
for (display = ctx->display_list; display != NULL; display = display->next) {
region = get_region(ctx, display->region_id);
-
+
if (x_pos == -1) {
x_pos = display->x_pos;
y_pos = display->y_pos;
width += (x_pos - display->x_pos);
x_pos = display->x_pos;
}
-
+
if (display->y_pos < y_pos) {
height += (y_pos - display->y_pos);
y_pos = display->y_pos;
}
-
+
if (display->x_pos + region->width > x_pos + width) {
width = display->x_pos + region->width - x_pos;
}
-
+
if (display->y_pos + region->height > y_pos + height) {
height = display->y_pos + region->height - y_pos;
}
}
}
-
+
if (x_pos >= 0) {
-
+
pbuf = av_malloc(width * height * 4);
for (display = ctx->display_list; display != NULL; display = display->next) {
clut_table = clut->clut16;
break;
}
-
+
for (y = 0; y < region->height; y++) {
for (x = 0; x < region->width; x++) {
- pbuf[((y + y_off) * width) + x_off + x] =
+ pbuf[((y + y_off) * width) + x_off + x] =
clut_table[region->pbuf[y * region->width + x]];
}
}
- }
+ }
snprintf(filename, 32, "dvbs.%d", fileno_index);
av_free(pbuf);
}
-
+
fileno_index++;
}
#endif
-static int dvbsub_display_end_segment(AVCodecContext *avctx, uint8_t *buf,
+static int dvbsub_display_end_segment(AVCodecContext *avctx, uint8_t *buf,
int buf_size, AVSubtitle *sub)
{
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
DVBSubCLUT *clut;
uint32_t *clut_table;
int i;
-
+
sub->rects = NULL;
sub->start_display_time = 0;
sub->end_display_time = ctx->time_out * 1000;
sub->format = 0;
sub->num_rects = ctx->display_list_size;
-
+
if (sub->num_rects > 0)
sub->rects = av_mallocz(sizeof(AVSubtitleRect) * sub->num_rects);
for (display = ctx->display_list; display != NULL; display = display->next) {
region = get_region(ctx, display->region_id);
rect = &sub->rects[i];
-
+
if (region == NULL)
continue;
-
+
rect->x = display->x_pos;
rect->y = display->y_pos;
rect->w = region->width;
rect->linesize = region->width;
clut = get_clut(ctx, region->clut);
-
+
if (clut == NULL)
clut = &default_clut;
-
+
switch (region->depth) {
case 2:
clut_table = clut->clut4;
clut_table = clut->clut16;
break;
}
-
+
rect->rgba_palette = av_malloc((1 << region->depth) * sizeof(uint32_t));
memcpy(rect->rgba_palette, clut_table, (1 << region->depth) * sizeof(uint32_t));
-
+
rect->bitmap = av_malloc(region->buf_size);
memcpy(rect->bitmap, region->pbuf, region->buf_size);
-
+
i++;
}
-
+
sub->num_rects = i;
-
+
#ifdef DEBUG_SAVE_IMAGES
save_display_set(ctx);
#endif
-
+
return 1;
}
int segment_type;
int page_id;
int segment_length;
-
+
#ifdef DEBUG_PACKET_CONTENTS
int i;
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
}
-
+
if (i % 16 != 0)
av_log(avctx, AV_LOG_INFO, "\n");
if (buf_size <= 2)
return -1;
-
+
p = buf;
p_end = buf + buf_size;
-
+
while (p < p_end && *p == 0x0f)
{
p += 1;
p += 2;
segment_length = BE_16(p);
p += 2;
-
+
if (page_id == ctx->composition_id || page_id == ctx->ancillary_id) {
switch (segment_type) {
case DVBSUB_PAGE_SEGMENT:
break;
default:
#ifdef DEBUG
- av_log(avctx, AV_LOG_INFO, "Subtitling segment type 0x%x, page id %d, length %d\n",
+ av_log(avctx, AV_LOG_INFO, "Subtitling segment type 0x%x, page id %d, length %d\n",
segment_type, page_id, segment_length);
#endif
break;
p += segment_length;
}
-
+
if (p != p_end)
{
#ifdef DEBUG
static int dvbsub_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
DVBSubParseContext *pc = s->priv_data;
int len, buf_pos = 0;
#ifdef DEBUG
- av_log(avctx, AV_LOG_INFO, "DVB parse packet pts=%Lx, lpts=%Lx, cpts=%Lx:\n",
+ av_log(avctx, AV_LOG_INFO, "DVB parse packet pts=%Lx, lpts=%Lx, cpts=%Lx:\n",
s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
#endif
-
+
#ifdef DEBUG_PACKET_CONTENTS
int i;
if (i % 16 == 15)
av_log(avctx, AV_LOG_INFO, "\n");
}
-
+
if (i % 16 != 0)
av_log(avctx, AV_LOG_INFO, "\n");
*poutbuf = NULL;
*poutbuf_size = 0;
-
+
s->fetch_timestamp = 1;
-
+
if (s->last_pts != s->pts && s->last_pts != AV_NOPTS_VALUE) /* Start of a new packet */
{
if (pc->packet_index != pc->packet_start)
{
#ifdef DEBUG
- av_log(avctx, AV_LOG_INFO, "Discarding %d bytes\n",
+ av_log(avctx, AV_LOG_INFO, "Discarding %d bytes\n",
pc->packet_index - pc->packet_start);
#endif
}
-
+
pc->packet_start = 0;
- pc->packet_index = 0;
-
+ pc->packet_index = 0;
+
if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) {
#ifdef DEBUG
av_log(avctx, AV_LOG_INFO, "Bad packet header\n");
#endif
return -1;
}
-
+
buf_pos = 2;
-
+
pc->in_packet = 1;
} else {
if (pc->packet_start != 0)
}
}
}
-
+
if (buf_size - buf_pos + pc->packet_index > PARSE_BUF_SIZE)
return -1;
-
+
/* if not currently in a packet, discard data */
if (pc->in_packet == 0)
return buf_size;
-
+
memcpy(pc->packet_buf + pc->packet_index, buf + buf_pos, buf_size - buf_pos);
pc->packet_index += buf_size - buf_pos;
-
+
p = pc->packet_buf;
p_end = pc->packet_buf + pc->packet_index;
-
+
while (p < p_end)
{
- if (*p == 0x0f)
+ if (*p == 0x0f)
{
if (p + 6 <= p_end)
{
}
pc->packet_index = p - pc->packet_buf;
pc->in_packet = 0;
- break;
+ break;
} else {
av_log(avctx, AV_LOG_ERROR, "Junk in packet\n");
-
+
pc->packet_index = p - pc->packet_buf;
pc->in_packet = 0;
break;
*poutbuf = pc->packet_buf;
pc->packet_start = *poutbuf_size;
}
-
- if (s->last_pts == AV_NOPTS_VALUE)
+
+ if (s->last_pts == AV_NOPTS_VALUE)
s->last_pts = s->pts;
-
+
return buf_size;
}
* Constants for DV codec.
*/
-/*
- * DVprofile is used to express the differences between various
+/*
+ * DVprofile is used to express the differences between various
* DV flavors. For now it's primarily used for differentiating
* 525/60 and 625/50, but the plans are to use it for various
* DV specs as well (e.g. SMPTE314M vs. IEC 61834).
int dsf; /* value of the dsf in the DV header */
int frame_size; /* total size of one frame in bytes */
int difseg_size; /* number of DIF segments */
- int frame_rate;
+ int frame_rate;
int frame_rate_base;
int ltc_divisor; /* FPS from the LTS standpoint */
int height; /* picture height in pixels */
AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
const uint16_t *video_place; /* positions of all DV macro blocks */
enum PixelFormat pix_fmt; /* picture pixel format */
-
+
int audio_stride; /* size of audio_shuffle table */
int audio_min_samples[3];/* min ammount of audio samples */
/* for 48Khz, 44.1Khz and 32Khz */
#define NB_DV_VLC 409
-/*
+/*
* There's a catch about the following three tables: the mapping they establish
* between (run, level) and vlc is not 1-1. So you have to watch out for that
- * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82.
+ * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82.
*/
static const uint16_t dv_vlc_bits[409] = {
0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
};
static const uint8_t dv_quant_shifts[22][4] = {
- { 3,3,4,4 },
- { 3,3,4,4 },
- { 2,3,3,4 },
+ { 3,3,4,4 },
+ { 3,3,4,4 },
{ 2,3,3,4 },
- { 2,2,3,3 },
- { 2,2,3,3 },
- { 1,2,2,3 },
- { 1,2,2,3 },
- { 1,1,2,2 },
- { 1,1,2,2 },
- { 0,1,1,2 },
- { 0,1,1,2 },
- { 0,0,1,1 },
+ { 2,3,3,4 },
+ { 2,2,3,3 },
+ { 2,2,3,3 },
+ { 1,2,2,3 },
+ { 1,2,2,3 },
+ { 1,1,2,2 },
+ { 1,1,2,2 },
+ { 0,1,1,2 },
+ { 0,1,1,2 },
+ { 0,0,1,1 },
{ 0,0,1,1 },
- { 0,0,0,1 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
- { 0,0,0,0 },
+ { 0,0,0,1 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
{ 0,0,0,0 },
};
};
static const uint16_t dv_place_411P[1620] = {
- 0x0c24, 0x2710, 0x3334, 0x0000, 0x1848,
- 0x0d24, 0x2810, 0x3434, 0x0100, 0x1948,
- 0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48,
- 0x0f24, 0x2914, 0x3538, 0x0300, 0x1b48,
- 0x1024, 0x2814, 0x3438, 0x0400, 0x1c48,
- 0x1124, 0x2714, 0x3338, 0x0500, 0x1d48,
- 0x1128, 0x2614, 0x3238, 0x0504, 0x1d4c,
- 0x1028, 0x2514, 0x3138, 0x0404, 0x1c4c,
- 0x0f28, 0x2414, 0x3038, 0x0304, 0x1b4c,
- 0x0e28, 0x2418, 0x303c, 0x0204, 0x1a4c,
- 0x0d28, 0x2518, 0x313c, 0x0104, 0x194c,
- 0x0c28, 0x2618, 0x323c, 0x0004, 0x184c,
- 0x0c2c, 0x2718, 0x333c, 0x0008, 0x1850,
- 0x0d2c, 0x2818, 0x343c, 0x0108, 0x1950,
- 0x0e2c, 0x2918, 0x353c, 0x0208, 0x1a50,
- 0x0f2c, 0x291c, 0x3540, 0x0308, 0x1b50,
- 0x102c, 0x281c, 0x3440, 0x0408, 0x1c50,
- 0x112c, 0x271c, 0x3340, 0x0508, 0x1d50,
- 0x1130, 0x261c, 0x3240, 0x050c, 0x1d54,
- 0x1030, 0x251c, 0x3140, 0x040c, 0x1c54,
- 0x0f30, 0x241c, 0x3040, 0x030c, 0x1b54,
- 0x0e30, 0x2420, 0x3044, 0x020c, 0x1a54,
- 0x0d30, 0x2520, 0x3144, 0x010c, 0x1954,
- 0x0c30, 0x2620, 0x3244, 0x000c, 0x1854,
- 0x0c34, 0x2720, 0x3344, 0x0010, 0x1858,
- 0x0d34, 0x2820, 0x3444, 0x0110, 0x1a58,
- 0x0e34, 0x2920, 0x3544, 0x0210, 0x1c58,
- 0x1224, 0x2d10, 0x3934, 0x0600, 0x1e48,
- 0x1324, 0x2e10, 0x3a34, 0x0700, 0x1f48,
- 0x1424, 0x2f10, 0x3b34, 0x0800, 0x2048,
- 0x1524, 0x2f14, 0x3b38, 0x0900, 0x2148,
- 0x1624, 0x2e14, 0x3a38, 0x0a00, 0x2248,
- 0x1724, 0x2d14, 0x3938, 0x0b00, 0x2348,
- 0x1728, 0x2c14, 0x3838, 0x0b04, 0x234c,
- 0x1628, 0x2b14, 0x3738, 0x0a04, 0x224c,
- 0x1528, 0x2a14, 0x3638, 0x0904, 0x214c,
- 0x1428, 0x2a18, 0x363c, 0x0804, 0x204c,
- 0x1328, 0x2b18, 0x373c, 0x0704, 0x1f4c,
- 0x1228, 0x2c18, 0x383c, 0x0604, 0x1e4c,
- 0x122c, 0x2d18, 0x393c, 0x0608, 0x1e50,
- 0x132c, 0x2e18, 0x3a3c, 0x0708, 0x1f50,
- 0x142c, 0x2f18, 0x3b3c, 0x0808, 0x2050,
- 0x152c, 0x2f1c, 0x3b40, 0x0908, 0x2150,
- 0x162c, 0x2e1c, 0x3a40, 0x0a08, 0x2250,
- 0x172c, 0x2d1c, 0x3940, 0x0b08, 0x2350,
- 0x1730, 0x2c1c, 0x3840, 0x0b0c, 0x2354,
- 0x1630, 0x2b1c, 0x3740, 0x0a0c, 0x2254,
- 0x1530, 0x2a1c, 0x3640, 0x090c, 0x2154,
- 0x1430, 0x2a20, 0x3644, 0x080c, 0x2054,
- 0x1330, 0x2b20, 0x3744, 0x070c, 0x1f54,
- 0x1230, 0x2c20, 0x3844, 0x060c, 0x1e54,
- 0x1234, 0x2d20, 0x3944, 0x0610, 0x1e58,
- 0x1334, 0x2e20, 0x3a44, 0x0710, 0x2058,
- 0x1434, 0x2f20, 0x3b44, 0x0810, 0x2258,
- 0x1824, 0x3310, 0x3f34, 0x0c00, 0x2448,
- 0x1924, 0x3410, 0x4034, 0x0d00, 0x2548,
- 0x1a24, 0x3510, 0x4134, 0x0e00, 0x2648,
- 0x1b24, 0x3514, 0x4138, 0x0f00, 0x2748,
- 0x1c24, 0x3414, 0x4038, 0x1000, 0x2848,
- 0x1d24, 0x3314, 0x3f38, 0x1100, 0x2948,
- 0x1d28, 0x3214, 0x3e38, 0x1104, 0x294c,
- 0x1c28, 0x3114, 0x3d38, 0x1004, 0x284c,
- 0x1b28, 0x3014, 0x3c38, 0x0f04, 0x274c,
- 0x1a28, 0x3018, 0x3c3c, 0x0e04, 0x264c,
- 0x1928, 0x3118, 0x3d3c, 0x0d04, 0x254c,
- 0x1828, 0x3218, 0x3e3c, 0x0c04, 0x244c,
- 0x182c, 0x3318, 0x3f3c, 0x0c08, 0x2450,
- 0x192c, 0x3418, 0x403c, 0x0d08, 0x2550,
- 0x1a2c, 0x3518, 0x413c, 0x0e08, 0x2650,
- 0x1b2c, 0x351c, 0x4140, 0x0f08, 0x2750,
- 0x1c2c, 0x341c, 0x4040, 0x1008, 0x2850,
- 0x1d2c, 0x331c, 0x3f40, 0x1108, 0x2950,
- 0x1d30, 0x321c, 0x3e40, 0x110c, 0x2954,
- 0x1c30, 0x311c, 0x3d40, 0x100c, 0x2854,
- 0x1b30, 0x301c, 0x3c40, 0x0f0c, 0x2754,
- 0x1a30, 0x3020, 0x3c44, 0x0e0c, 0x2654,
- 0x1930, 0x3120, 0x3d44, 0x0d0c, 0x2554,
- 0x1830, 0x3220, 0x3e44, 0x0c0c, 0x2454,
- 0x1834, 0x3320, 0x3f44, 0x0c10, 0x2458,
- 0x1934, 0x3420, 0x4044, 0x0d10, 0x2658,
- 0x1a34, 0x3520, 0x4144, 0x0e10, 0x2858,
- 0x1e24, 0x3910, 0x4534, 0x1200, 0x2a48,
- 0x1f24, 0x3a10, 0x4634, 0x1300, 0x2b48,
- 0x2024, 0x3b10, 0x4734, 0x1400, 0x2c48,
- 0x2124, 0x3b14, 0x4738, 0x1500, 0x2d48,
- 0x2224, 0x3a14, 0x4638, 0x1600, 0x2e48,
- 0x2324, 0x3914, 0x4538, 0x1700, 0x2f48,
- 0x2328, 0x3814, 0x4438, 0x1704, 0x2f4c,
- 0x2228, 0x3714, 0x4338, 0x1604, 0x2e4c,
- 0x2128, 0x3614, 0x4238, 0x1504, 0x2d4c,
- 0x2028, 0x3618, 0x423c, 0x1404, 0x2c4c,
- 0x1f28, 0x3718, 0x433c, 0x1304, 0x2b4c,
- 0x1e28, 0x3818, 0x443c, 0x1204, 0x2a4c,
- 0x1e2c, 0x3918, 0x453c, 0x1208, 0x2a50,
- 0x1f2c, 0x3a18, 0x463c, 0x1308, 0x2b50,
- 0x202c, 0x3b18, 0x473c, 0x1408, 0x2c50,
- 0x212c, 0x3b1c, 0x4740, 0x1508, 0x2d50,
- 0x222c, 0x3a1c, 0x4640, 0x1608, 0x2e50,
- 0x232c, 0x391c, 0x4540, 0x1708, 0x2f50,
- 0x2330, 0x381c, 0x4440, 0x170c, 0x2f54,
- 0x2230, 0x371c, 0x4340, 0x160c, 0x2e54,
- 0x2130, 0x361c, 0x4240, 0x150c, 0x2d54,
- 0x2030, 0x3620, 0x4244, 0x140c, 0x2c54,
- 0x1f30, 0x3720, 0x4344, 0x130c, 0x2b54,
- 0x1e30, 0x3820, 0x4444, 0x120c, 0x2a54,
- 0x1e34, 0x3920, 0x4544, 0x1210, 0x2a58,
- 0x1f34, 0x3a20, 0x4644, 0x1310, 0x2c58,
- 0x2034, 0x3b20, 0x4744, 0x1410, 0x2e58,
- 0x2424, 0x3f10, 0x0334, 0x1800, 0x3048,
- 0x2524, 0x4010, 0x0434, 0x1900, 0x3148,
- 0x2624, 0x4110, 0x0534, 0x1a00, 0x3248,
- 0x2724, 0x4114, 0x0538, 0x1b00, 0x3348,
- 0x2824, 0x4014, 0x0438, 0x1c00, 0x3448,
- 0x2924, 0x3f14, 0x0338, 0x1d00, 0x3548,
- 0x2928, 0x3e14, 0x0238, 0x1d04, 0x354c,
- 0x2828, 0x3d14, 0x0138, 0x1c04, 0x344c,
- 0x2728, 0x3c14, 0x0038, 0x1b04, 0x334c,
- 0x2628, 0x3c18, 0x003c, 0x1a04, 0x324c,
- 0x2528, 0x3d18, 0x013c, 0x1904, 0x314c,
- 0x2428, 0x3e18, 0x023c, 0x1804, 0x304c,
- 0x242c, 0x3f18, 0x033c, 0x1808, 0x3050,
- 0x252c, 0x4018, 0x043c, 0x1908, 0x3150,
- 0x262c, 0x4118, 0x053c, 0x1a08, 0x3250,
- 0x272c, 0x411c, 0x0540, 0x1b08, 0x3350,
- 0x282c, 0x401c, 0x0440, 0x1c08, 0x3450,
- 0x292c, 0x3f1c, 0x0340, 0x1d08, 0x3550,
- 0x2930, 0x3e1c, 0x0240, 0x1d0c, 0x3554,
- 0x2830, 0x3d1c, 0x0140, 0x1c0c, 0x3454,
- 0x2730, 0x3c1c, 0x0040, 0x1b0c, 0x3354,
- 0x2630, 0x3c20, 0x0044, 0x1a0c, 0x3254,
- 0x2530, 0x3d20, 0x0144, 0x190c, 0x3154,
- 0x2430, 0x3e20, 0x0244, 0x180c, 0x3054,
- 0x2434, 0x3f20, 0x0344, 0x1810, 0x3058,
- 0x2534, 0x4020, 0x0444, 0x1910, 0x3258,
- 0x2634, 0x4120, 0x0544, 0x1a10, 0x3458,
- 0x2a24, 0x4510, 0x0934, 0x1e00, 0x3648,
- 0x2b24, 0x4610, 0x0a34, 0x1f00, 0x3748,
- 0x2c24, 0x4710, 0x0b34, 0x2000, 0x3848,
- 0x2d24, 0x4714, 0x0b38, 0x2100, 0x3948,
- 0x2e24, 0x4614, 0x0a38, 0x2200, 0x3a48,
- 0x2f24, 0x4514, 0x0938, 0x2300, 0x3b48,
- 0x2f28, 0x4414, 0x0838, 0x2304, 0x3b4c,
- 0x2e28, 0x4314, 0x0738, 0x2204, 0x3a4c,
- 0x2d28, 0x4214, 0x0638, 0x2104, 0x394c,
- 0x2c28, 0x4218, 0x063c, 0x2004, 0x384c,
- 0x2b28, 0x4318, 0x073c, 0x1f04, 0x374c,
- 0x2a28, 0x4418, 0x083c, 0x1e04, 0x364c,
- 0x2a2c, 0x4518, 0x093c, 0x1e08, 0x3650,
- 0x2b2c, 0x4618, 0x0a3c, 0x1f08, 0x3750,
- 0x2c2c, 0x4718, 0x0b3c, 0x2008, 0x3850,
- 0x2d2c, 0x471c, 0x0b40, 0x2108, 0x3950,
- 0x2e2c, 0x461c, 0x0a40, 0x2208, 0x3a50,
- 0x2f2c, 0x451c, 0x0940, 0x2308, 0x3b50,
- 0x2f30, 0x441c, 0x0840, 0x230c, 0x3b54,
- 0x2e30, 0x431c, 0x0740, 0x220c, 0x3a54,
- 0x2d30, 0x421c, 0x0640, 0x210c, 0x3954,
- 0x2c30, 0x4220, 0x0644, 0x200c, 0x3854,
- 0x2b30, 0x4320, 0x0744, 0x1f0c, 0x3754,
- 0x2a30, 0x4420, 0x0844, 0x1e0c, 0x3654,
- 0x2a34, 0x4520, 0x0944, 0x1e10, 0x3658,
- 0x2b34, 0x4620, 0x0a44, 0x1f10, 0x3858,
- 0x2c34, 0x4720, 0x0b44, 0x2010, 0x3a58,
- 0x3024, 0x0310, 0x0f34, 0x2400, 0x3c48,
- 0x3124, 0x0410, 0x1034, 0x2500, 0x3d48,
- 0x3224, 0x0510, 0x1134, 0x2600, 0x3e48,
- 0x3324, 0x0514, 0x1138, 0x2700, 0x3f48,
- 0x3424, 0x0414, 0x1038, 0x2800, 0x4048,
- 0x3524, 0x0314, 0x0f38, 0x2900, 0x4148,
- 0x3528, 0x0214, 0x0e38, 0x2904, 0x414c,
- 0x3428, 0x0114, 0x0d38, 0x2804, 0x404c,
- 0x3328, 0x0014, 0x0c38, 0x2704, 0x3f4c,
- 0x3228, 0x0018, 0x0c3c, 0x2604, 0x3e4c,
- 0x3128, 0x0118, 0x0d3c, 0x2504, 0x3d4c,
- 0x3028, 0x0218, 0x0e3c, 0x2404, 0x3c4c,
- 0x302c, 0x0318, 0x0f3c, 0x2408, 0x3c50,
- 0x312c, 0x0418, 0x103c, 0x2508, 0x3d50,
- 0x322c, 0x0518, 0x113c, 0x2608, 0x3e50,
- 0x332c, 0x051c, 0x1140, 0x2708, 0x3f50,
- 0x342c, 0x041c, 0x1040, 0x2808, 0x4050,
- 0x352c, 0x031c, 0x0f40, 0x2908, 0x4150,
- 0x3530, 0x021c, 0x0e40, 0x290c, 0x4154,
- 0x3430, 0x011c, 0x0d40, 0x280c, 0x4054,
- 0x3330, 0x001c, 0x0c40, 0x270c, 0x3f54,
- 0x3230, 0x0020, 0x0c44, 0x260c, 0x3e54,
- 0x3130, 0x0120, 0x0d44, 0x250c, 0x3d54,
- 0x3030, 0x0220, 0x0e44, 0x240c, 0x3c54,
- 0x3034, 0x0320, 0x0f44, 0x2410, 0x3c58,
- 0x3134, 0x0420, 0x1044, 0x2510, 0x3e58,
- 0x3234, 0x0520, 0x1144, 0x2610, 0x4058,
- 0x3624, 0x0910, 0x1534, 0x2a00, 0x4248,
- 0x3724, 0x0a10, 0x1634, 0x2b00, 0x4348,
- 0x3824, 0x0b10, 0x1734, 0x2c00, 0x4448,
- 0x3924, 0x0b14, 0x1738, 0x2d00, 0x4548,
- 0x3a24, 0x0a14, 0x1638, 0x2e00, 0x4648,
- 0x3b24, 0x0914, 0x1538, 0x2f00, 0x4748,
- 0x3b28, 0x0814, 0x1438, 0x2f04, 0x474c,
- 0x3a28, 0x0714, 0x1338, 0x2e04, 0x464c,
- 0x3928, 0x0614, 0x1238, 0x2d04, 0x454c,
- 0x3828, 0x0618, 0x123c, 0x2c04, 0x444c,
- 0x3728, 0x0718, 0x133c, 0x2b04, 0x434c,
- 0x3628, 0x0818, 0x143c, 0x2a04, 0x424c,
- 0x362c, 0x0918, 0x153c, 0x2a08, 0x4250,
- 0x372c, 0x0a18, 0x163c, 0x2b08, 0x4350,
- 0x382c, 0x0b18, 0x173c, 0x2c08, 0x4450,
- 0x392c, 0x0b1c, 0x1740, 0x2d08, 0x4550,
- 0x3a2c, 0x0a1c, 0x1640, 0x2e08, 0x4650,
- 0x3b2c, 0x091c, 0x1540, 0x2f08, 0x4750,
- 0x3b30, 0x081c, 0x1440, 0x2f0c, 0x4754,
- 0x3a30, 0x071c, 0x1340, 0x2e0c, 0x4654,
- 0x3930, 0x061c, 0x1240, 0x2d0c, 0x4554,
- 0x3830, 0x0620, 0x1244, 0x2c0c, 0x4454,
- 0x3730, 0x0720, 0x1344, 0x2b0c, 0x4354,
- 0x3630, 0x0820, 0x1444, 0x2a0c, 0x4254,
- 0x3634, 0x0920, 0x1544, 0x2a10, 0x4258,
- 0x3734, 0x0a20, 0x1644, 0x2b10, 0x4458,
- 0x3834, 0x0b20, 0x1744, 0x2c10, 0x4658,
- 0x3c24, 0x0f10, 0x1b34, 0x3000, 0x0048,
- 0x3d24, 0x1010, 0x1c34, 0x3100, 0x0148,
- 0x3e24, 0x1110, 0x1d34, 0x3200, 0x0248,
- 0x3f24, 0x1114, 0x1d38, 0x3300, 0x0348,
- 0x4024, 0x1014, 0x1c38, 0x3400, 0x0448,
- 0x4124, 0x0f14, 0x1b38, 0x3500, 0x0548,
- 0x4128, 0x0e14, 0x1a38, 0x3504, 0x054c,
- 0x4028, 0x0d14, 0x1938, 0x3404, 0x044c,
- 0x3f28, 0x0c14, 0x1838, 0x3304, 0x034c,
- 0x3e28, 0x0c18, 0x183c, 0x3204, 0x024c,
- 0x3d28, 0x0d18, 0x193c, 0x3104, 0x014c,
- 0x3c28, 0x0e18, 0x1a3c, 0x3004, 0x004c,
- 0x3c2c, 0x0f18, 0x1b3c, 0x3008, 0x0050,
- 0x3d2c, 0x1018, 0x1c3c, 0x3108, 0x0150,
- 0x3e2c, 0x1118, 0x1d3c, 0x3208, 0x0250,
- 0x3f2c, 0x111c, 0x1d40, 0x3308, 0x0350,
- 0x402c, 0x101c, 0x1c40, 0x3408, 0x0450,
- 0x412c, 0x0f1c, 0x1b40, 0x3508, 0x0550,
- 0x4130, 0x0e1c, 0x1a40, 0x350c, 0x0554,
- 0x4030, 0x0d1c, 0x1940, 0x340c, 0x0454,
- 0x3f30, 0x0c1c, 0x1840, 0x330c, 0x0354,
- 0x3e30, 0x0c20, 0x1844, 0x320c, 0x0254,
- 0x3d30, 0x0d20, 0x1944, 0x310c, 0x0154,
- 0x3c30, 0x0e20, 0x1a44, 0x300c, 0x0054,
- 0x3c34, 0x0f20, 0x1b44, 0x3010, 0x0058,
- 0x3d34, 0x1020, 0x1c44, 0x3110, 0x0258,
- 0x3e34, 0x1120, 0x1d44, 0x3210, 0x0458,
- 0x4224, 0x1510, 0x2134, 0x3600, 0x0648,
- 0x4324, 0x1610, 0x2234, 0x3700, 0x0748,
- 0x4424, 0x1710, 0x2334, 0x3800, 0x0848,
- 0x4524, 0x1714, 0x2338, 0x3900, 0x0948,
- 0x4624, 0x1614, 0x2238, 0x3a00, 0x0a48,
- 0x4724, 0x1514, 0x2138, 0x3b00, 0x0b48,
- 0x4728, 0x1414, 0x2038, 0x3b04, 0x0b4c,
- 0x4628, 0x1314, 0x1f38, 0x3a04, 0x0a4c,
- 0x4528, 0x1214, 0x1e38, 0x3904, 0x094c,
- 0x4428, 0x1218, 0x1e3c, 0x3804, 0x084c,
- 0x4328, 0x1318, 0x1f3c, 0x3704, 0x074c,
- 0x4228, 0x1418, 0x203c, 0x3604, 0x064c,
- 0x422c, 0x1518, 0x213c, 0x3608, 0x0650,
- 0x432c, 0x1618, 0x223c, 0x3708, 0x0750,
- 0x442c, 0x1718, 0x233c, 0x3808, 0x0850,
- 0x452c, 0x171c, 0x2340, 0x3908, 0x0950,
- 0x462c, 0x161c, 0x2240, 0x3a08, 0x0a50,
- 0x472c, 0x151c, 0x2140, 0x3b08, 0x0b50,
- 0x4730, 0x141c, 0x2040, 0x3b0c, 0x0b54,
- 0x4630, 0x131c, 0x1f40, 0x3a0c, 0x0a54,
- 0x4530, 0x121c, 0x1e40, 0x390c, 0x0954,
- 0x4430, 0x1220, 0x1e44, 0x380c, 0x0854,
- 0x4330, 0x1320, 0x1f44, 0x370c, 0x0754,
- 0x4230, 0x1420, 0x2044, 0x360c, 0x0654,
- 0x4234, 0x1520, 0x2144, 0x3610, 0x0658,
- 0x4334, 0x1620, 0x2244, 0x3710, 0x0858,
- 0x4434, 0x1720, 0x2344, 0x3810, 0x0a58,
- 0x0024, 0x1b10, 0x2734, 0x3c00, 0x0c48,
- 0x0124, 0x1c10, 0x2834, 0x3d00, 0x0d48,
- 0x0224, 0x1d10, 0x2934, 0x3e00, 0x0e48,
- 0x0324, 0x1d14, 0x2938, 0x3f00, 0x0f48,
- 0x0424, 0x1c14, 0x2838, 0x4000, 0x1048,
- 0x0524, 0x1b14, 0x2738, 0x4100, 0x1148,
- 0x0528, 0x1a14, 0x2638, 0x4104, 0x114c,
- 0x0428, 0x1914, 0x2538, 0x4004, 0x104c,
- 0x0328, 0x1814, 0x2438, 0x3f04, 0x0f4c,
- 0x0228, 0x1818, 0x243c, 0x3e04, 0x0e4c,
- 0x0128, 0x1918, 0x253c, 0x3d04, 0x0d4c,
- 0x0028, 0x1a18, 0x263c, 0x3c04, 0x0c4c,
- 0x002c, 0x1b18, 0x273c, 0x3c08, 0x0c50,
- 0x012c, 0x1c18, 0x283c, 0x3d08, 0x0d50,
- 0x022c, 0x1d18, 0x293c, 0x3e08, 0x0e50,
- 0x032c, 0x1d1c, 0x2940, 0x3f08, 0x0f50,
- 0x042c, 0x1c1c, 0x2840, 0x4008, 0x1050,
- 0x052c, 0x1b1c, 0x2740, 0x4108, 0x1150,
- 0x0530, 0x1a1c, 0x2640, 0x410c, 0x1154,
- 0x0430, 0x191c, 0x2540, 0x400c, 0x1054,
- 0x0330, 0x181c, 0x2440, 0x3f0c, 0x0f54,
- 0x0230, 0x1820, 0x2444, 0x3e0c, 0x0e54,
- 0x0130, 0x1920, 0x2544, 0x3d0c, 0x0d54,
- 0x0030, 0x1a20, 0x2644, 0x3c0c, 0x0c54,
- 0x0034, 0x1b20, 0x2744, 0x3c10, 0x0c58,
- 0x0134, 0x1c20, 0x2844, 0x3d10, 0x0e58,
- 0x0234, 0x1d20, 0x2944, 0x3e10, 0x1058,
- 0x0624, 0x2110, 0x2d34, 0x4200, 0x1248,
- 0x0724, 0x2210, 0x2e34, 0x4300, 0x1348,
- 0x0824, 0x2310, 0x2f34, 0x4400, 0x1448,
- 0x0924, 0x2314, 0x2f38, 0x4500, 0x1548,
- 0x0a24, 0x2214, 0x2e38, 0x4600, 0x1648,
- 0x0b24, 0x2114, 0x2d38, 0x4700, 0x1748,
- 0x0b28, 0x2014, 0x2c38, 0x4704, 0x174c,
- 0x0a28, 0x1f14, 0x2b38, 0x4604, 0x164c,
- 0x0928, 0x1e14, 0x2a38, 0x4504, 0x154c,
- 0x0828, 0x1e18, 0x2a3c, 0x4404, 0x144c,
- 0x0728, 0x1f18, 0x2b3c, 0x4304, 0x134c,
- 0x0628, 0x2018, 0x2c3c, 0x4204, 0x124c,
- 0x062c, 0x2118, 0x2d3c, 0x4208, 0x1250,
- 0x072c, 0x2218, 0x2e3c, 0x4308, 0x1350,
- 0x082c, 0x2318, 0x2f3c, 0x4408, 0x1450,
- 0x092c, 0x231c, 0x2f40, 0x4508, 0x1550,
- 0x0a2c, 0x221c, 0x2e40, 0x4608, 0x1650,
- 0x0b2c, 0x211c, 0x2d40, 0x4708, 0x1750,
- 0x0b30, 0x201c, 0x2c40, 0x470c, 0x1754,
- 0x0a30, 0x1f1c, 0x2b40, 0x460c, 0x1654,
- 0x0930, 0x1e1c, 0x2a40, 0x450c, 0x1554,
- 0x0830, 0x1e20, 0x2a44, 0x440c, 0x1454,
- 0x0730, 0x1f20, 0x2b44, 0x430c, 0x1354,
- 0x0630, 0x2020, 0x2c44, 0x420c, 0x1254,
- 0x0634, 0x2120, 0x2d44, 0x4210, 0x1258,
- 0x0734, 0x2220, 0x2e44, 0x4310, 0x1458,
+ 0x0c24, 0x2710, 0x3334, 0x0000, 0x1848,
+ 0x0d24, 0x2810, 0x3434, 0x0100, 0x1948,
+ 0x0e24, 0x2910, 0x3534, 0x0200, 0x1a48,
+ 0x0f24, 0x2914, 0x3538, 0x0300, 0x1b48,
+ 0x1024, 0x2814, 0x3438, 0x0400, 0x1c48,
+ 0x1124, 0x2714, 0x3338, 0x0500, 0x1d48,
+ 0x1128, 0x2614, 0x3238, 0x0504, 0x1d4c,
+ 0x1028, 0x2514, 0x3138, 0x0404, 0x1c4c,
+ 0x0f28, 0x2414, 0x3038, 0x0304, 0x1b4c,
+ 0x0e28, 0x2418, 0x303c, 0x0204, 0x1a4c,
+ 0x0d28, 0x2518, 0x313c, 0x0104, 0x194c,
+ 0x0c28, 0x2618, 0x323c, 0x0004, 0x184c,
+ 0x0c2c, 0x2718, 0x333c, 0x0008, 0x1850,
+ 0x0d2c, 0x2818, 0x343c, 0x0108, 0x1950,
+ 0x0e2c, 0x2918, 0x353c, 0x0208, 0x1a50,
+ 0x0f2c, 0x291c, 0x3540, 0x0308, 0x1b50,
+ 0x102c, 0x281c, 0x3440, 0x0408, 0x1c50,
+ 0x112c, 0x271c, 0x3340, 0x0508, 0x1d50,
+ 0x1130, 0x261c, 0x3240, 0x050c, 0x1d54,
+ 0x1030, 0x251c, 0x3140, 0x040c, 0x1c54,
+ 0x0f30, 0x241c, 0x3040, 0x030c, 0x1b54,
+ 0x0e30, 0x2420, 0x3044, 0x020c, 0x1a54,
+ 0x0d30, 0x2520, 0x3144, 0x010c, 0x1954,
+ 0x0c30, 0x2620, 0x3244, 0x000c, 0x1854,
+ 0x0c34, 0x2720, 0x3344, 0x0010, 0x1858,
+ 0x0d34, 0x2820, 0x3444, 0x0110, 0x1a58,
+ 0x0e34, 0x2920, 0x3544, 0x0210, 0x1c58,
+ 0x1224, 0x2d10, 0x3934, 0x0600, 0x1e48,
+ 0x1324, 0x2e10, 0x3a34, 0x0700, 0x1f48,
+ 0x1424, 0x2f10, 0x3b34, 0x0800, 0x2048,
+ 0x1524, 0x2f14, 0x3b38, 0x0900, 0x2148,
+ 0x1624, 0x2e14, 0x3a38, 0x0a00, 0x2248,
+ 0x1724, 0x2d14, 0x3938, 0x0b00, 0x2348,
+ 0x1728, 0x2c14, 0x3838, 0x0b04, 0x234c,
+ 0x1628, 0x2b14, 0x3738, 0x0a04, 0x224c,
+ 0x1528, 0x2a14, 0x3638, 0x0904, 0x214c,
+ 0x1428, 0x2a18, 0x363c, 0x0804, 0x204c,
+ 0x1328, 0x2b18, 0x373c, 0x0704, 0x1f4c,
+ 0x1228, 0x2c18, 0x383c, 0x0604, 0x1e4c,
+ 0x122c, 0x2d18, 0x393c, 0x0608, 0x1e50,
+ 0x132c, 0x2e18, 0x3a3c, 0x0708, 0x1f50,
+ 0x142c, 0x2f18, 0x3b3c, 0x0808, 0x2050,
+ 0x152c, 0x2f1c, 0x3b40, 0x0908, 0x2150,
+ 0x162c, 0x2e1c, 0x3a40, 0x0a08, 0x2250,
+ 0x172c, 0x2d1c, 0x3940, 0x0b08, 0x2350,
+ 0x1730, 0x2c1c, 0x3840, 0x0b0c, 0x2354,
+ 0x1630, 0x2b1c, 0x3740, 0x0a0c, 0x2254,
+ 0x1530, 0x2a1c, 0x3640, 0x090c, 0x2154,
+ 0x1430, 0x2a20, 0x3644, 0x080c, 0x2054,
+ 0x1330, 0x2b20, 0x3744, 0x070c, 0x1f54,
+ 0x1230, 0x2c20, 0x3844, 0x060c, 0x1e54,
+ 0x1234, 0x2d20, 0x3944, 0x0610, 0x1e58,
+ 0x1334, 0x2e20, 0x3a44, 0x0710, 0x2058,
+ 0x1434, 0x2f20, 0x3b44, 0x0810, 0x2258,
+ 0x1824, 0x3310, 0x3f34, 0x0c00, 0x2448,
+ 0x1924, 0x3410, 0x4034, 0x0d00, 0x2548,
+ 0x1a24, 0x3510, 0x4134, 0x0e00, 0x2648,
+ 0x1b24, 0x3514, 0x4138, 0x0f00, 0x2748,
+ 0x1c24, 0x3414, 0x4038, 0x1000, 0x2848,
+ 0x1d24, 0x3314, 0x3f38, 0x1100, 0x2948,
+ 0x1d28, 0x3214, 0x3e38, 0x1104, 0x294c,
+ 0x1c28, 0x3114, 0x3d38, 0x1004, 0x284c,
+ 0x1b28, 0x3014, 0x3c38, 0x0f04, 0x274c,
+ 0x1a28, 0x3018, 0x3c3c, 0x0e04, 0x264c,
+ 0x1928, 0x3118, 0x3d3c, 0x0d04, 0x254c,
+ 0x1828, 0x3218, 0x3e3c, 0x0c04, 0x244c,
+ 0x182c, 0x3318, 0x3f3c, 0x0c08, 0x2450,
+ 0x192c, 0x3418, 0x403c, 0x0d08, 0x2550,
+ 0x1a2c, 0x3518, 0x413c, 0x0e08, 0x2650,
+ 0x1b2c, 0x351c, 0x4140, 0x0f08, 0x2750,
+ 0x1c2c, 0x341c, 0x4040, 0x1008, 0x2850,
+ 0x1d2c, 0x331c, 0x3f40, 0x1108, 0x2950,
+ 0x1d30, 0x321c, 0x3e40, 0x110c, 0x2954,
+ 0x1c30, 0x311c, 0x3d40, 0x100c, 0x2854,
+ 0x1b30, 0x301c, 0x3c40, 0x0f0c, 0x2754,
+ 0x1a30, 0x3020, 0x3c44, 0x0e0c, 0x2654,
+ 0x1930, 0x3120, 0x3d44, 0x0d0c, 0x2554,
+ 0x1830, 0x3220, 0x3e44, 0x0c0c, 0x2454,
+ 0x1834, 0x3320, 0x3f44, 0x0c10, 0x2458,
+ 0x1934, 0x3420, 0x4044, 0x0d10, 0x2658,
+ 0x1a34, 0x3520, 0x4144, 0x0e10, 0x2858,
+ 0x1e24, 0x3910, 0x4534, 0x1200, 0x2a48,
+ 0x1f24, 0x3a10, 0x4634, 0x1300, 0x2b48,
+ 0x2024, 0x3b10, 0x4734, 0x1400, 0x2c48,
+ 0x2124, 0x3b14, 0x4738, 0x1500, 0x2d48,
+ 0x2224, 0x3a14, 0x4638, 0x1600, 0x2e48,
+ 0x2324, 0x3914, 0x4538, 0x1700, 0x2f48,
+ 0x2328, 0x3814, 0x4438, 0x1704, 0x2f4c,
+ 0x2228, 0x3714, 0x4338, 0x1604, 0x2e4c,
+ 0x2128, 0x3614, 0x4238, 0x1504, 0x2d4c,
+ 0x2028, 0x3618, 0x423c, 0x1404, 0x2c4c,
+ 0x1f28, 0x3718, 0x433c, 0x1304, 0x2b4c,
+ 0x1e28, 0x3818, 0x443c, 0x1204, 0x2a4c,
+ 0x1e2c, 0x3918, 0x453c, 0x1208, 0x2a50,
+ 0x1f2c, 0x3a18, 0x463c, 0x1308, 0x2b50,
+ 0x202c, 0x3b18, 0x473c, 0x1408, 0x2c50,
+ 0x212c, 0x3b1c, 0x4740, 0x1508, 0x2d50,
+ 0x222c, 0x3a1c, 0x4640, 0x1608, 0x2e50,
+ 0x232c, 0x391c, 0x4540, 0x1708, 0x2f50,
+ 0x2330, 0x381c, 0x4440, 0x170c, 0x2f54,
+ 0x2230, 0x371c, 0x4340, 0x160c, 0x2e54,
+ 0x2130, 0x361c, 0x4240, 0x150c, 0x2d54,
+ 0x2030, 0x3620, 0x4244, 0x140c, 0x2c54,
+ 0x1f30, 0x3720, 0x4344, 0x130c, 0x2b54,
+ 0x1e30, 0x3820, 0x4444, 0x120c, 0x2a54,
+ 0x1e34, 0x3920, 0x4544, 0x1210, 0x2a58,
+ 0x1f34, 0x3a20, 0x4644, 0x1310, 0x2c58,
+ 0x2034, 0x3b20, 0x4744, 0x1410, 0x2e58,
+ 0x2424, 0x3f10, 0x0334, 0x1800, 0x3048,
+ 0x2524, 0x4010, 0x0434, 0x1900, 0x3148,
+ 0x2624, 0x4110, 0x0534, 0x1a00, 0x3248,
+ 0x2724, 0x4114, 0x0538, 0x1b00, 0x3348,
+ 0x2824, 0x4014, 0x0438, 0x1c00, 0x3448,
+ 0x2924, 0x3f14, 0x0338, 0x1d00, 0x3548,
+ 0x2928, 0x3e14, 0x0238, 0x1d04, 0x354c,
+ 0x2828, 0x3d14, 0x0138, 0x1c04, 0x344c,
+ 0x2728, 0x3c14, 0x0038, 0x1b04, 0x334c,
+ 0x2628, 0x3c18, 0x003c, 0x1a04, 0x324c,
+ 0x2528, 0x3d18, 0x013c, 0x1904, 0x314c,
+ 0x2428, 0x3e18, 0x023c, 0x1804, 0x304c,
+ 0x242c, 0x3f18, 0x033c, 0x1808, 0x3050,
+ 0x252c, 0x4018, 0x043c, 0x1908, 0x3150,
+ 0x262c, 0x4118, 0x053c, 0x1a08, 0x3250,
+ 0x272c, 0x411c, 0x0540, 0x1b08, 0x3350,
+ 0x282c, 0x401c, 0x0440, 0x1c08, 0x3450,
+ 0x292c, 0x3f1c, 0x0340, 0x1d08, 0x3550,
+ 0x2930, 0x3e1c, 0x0240, 0x1d0c, 0x3554,
+ 0x2830, 0x3d1c, 0x0140, 0x1c0c, 0x3454,
+ 0x2730, 0x3c1c, 0x0040, 0x1b0c, 0x3354,
+ 0x2630, 0x3c20, 0x0044, 0x1a0c, 0x3254,
+ 0x2530, 0x3d20, 0x0144, 0x190c, 0x3154,
+ 0x2430, 0x3e20, 0x0244, 0x180c, 0x3054,
+ 0x2434, 0x3f20, 0x0344, 0x1810, 0x3058,
+ 0x2534, 0x4020, 0x0444, 0x1910, 0x3258,
+ 0x2634, 0x4120, 0x0544, 0x1a10, 0x3458,
+ 0x2a24, 0x4510, 0x0934, 0x1e00, 0x3648,
+ 0x2b24, 0x4610, 0x0a34, 0x1f00, 0x3748,
+ 0x2c24, 0x4710, 0x0b34, 0x2000, 0x3848,
+ 0x2d24, 0x4714, 0x0b38, 0x2100, 0x3948,
+ 0x2e24, 0x4614, 0x0a38, 0x2200, 0x3a48,
+ 0x2f24, 0x4514, 0x0938, 0x2300, 0x3b48,
+ 0x2f28, 0x4414, 0x0838, 0x2304, 0x3b4c,
+ 0x2e28, 0x4314, 0x0738, 0x2204, 0x3a4c,
+ 0x2d28, 0x4214, 0x0638, 0x2104, 0x394c,
+ 0x2c28, 0x4218, 0x063c, 0x2004, 0x384c,
+ 0x2b28, 0x4318, 0x073c, 0x1f04, 0x374c,
+ 0x2a28, 0x4418, 0x083c, 0x1e04, 0x364c,
+ 0x2a2c, 0x4518, 0x093c, 0x1e08, 0x3650,
+ 0x2b2c, 0x4618, 0x0a3c, 0x1f08, 0x3750,
+ 0x2c2c, 0x4718, 0x0b3c, 0x2008, 0x3850,
+ 0x2d2c, 0x471c, 0x0b40, 0x2108, 0x3950,
+ 0x2e2c, 0x461c, 0x0a40, 0x2208, 0x3a50,
+ 0x2f2c, 0x451c, 0x0940, 0x2308, 0x3b50,
+ 0x2f30, 0x441c, 0x0840, 0x230c, 0x3b54,
+ 0x2e30, 0x431c, 0x0740, 0x220c, 0x3a54,
+ 0x2d30, 0x421c, 0x0640, 0x210c, 0x3954,
+ 0x2c30, 0x4220, 0x0644, 0x200c, 0x3854,
+ 0x2b30, 0x4320, 0x0744, 0x1f0c, 0x3754,
+ 0x2a30, 0x4420, 0x0844, 0x1e0c, 0x3654,
+ 0x2a34, 0x4520, 0x0944, 0x1e10, 0x3658,
+ 0x2b34, 0x4620, 0x0a44, 0x1f10, 0x3858,
+ 0x2c34, 0x4720, 0x0b44, 0x2010, 0x3a58,
+ 0x3024, 0x0310, 0x0f34, 0x2400, 0x3c48,
+ 0x3124, 0x0410, 0x1034, 0x2500, 0x3d48,
+ 0x3224, 0x0510, 0x1134, 0x2600, 0x3e48,
+ 0x3324, 0x0514, 0x1138, 0x2700, 0x3f48,
+ 0x3424, 0x0414, 0x1038, 0x2800, 0x4048,
+ 0x3524, 0x0314, 0x0f38, 0x2900, 0x4148,
+ 0x3528, 0x0214, 0x0e38, 0x2904, 0x414c,
+ 0x3428, 0x0114, 0x0d38, 0x2804, 0x404c,
+ 0x3328, 0x0014, 0x0c38, 0x2704, 0x3f4c,
+ 0x3228, 0x0018, 0x0c3c, 0x2604, 0x3e4c,
+ 0x3128, 0x0118, 0x0d3c, 0x2504, 0x3d4c,
+ 0x3028, 0x0218, 0x0e3c, 0x2404, 0x3c4c,
+ 0x302c, 0x0318, 0x0f3c, 0x2408, 0x3c50,
+ 0x312c, 0x0418, 0x103c, 0x2508, 0x3d50,
+ 0x322c, 0x0518, 0x113c, 0x2608, 0x3e50,
+ 0x332c, 0x051c, 0x1140, 0x2708, 0x3f50,
+ 0x342c, 0x041c, 0x1040, 0x2808, 0x4050,
+ 0x352c, 0x031c, 0x0f40, 0x2908, 0x4150,
+ 0x3530, 0x021c, 0x0e40, 0x290c, 0x4154,
+ 0x3430, 0x011c, 0x0d40, 0x280c, 0x4054,
+ 0x3330, 0x001c, 0x0c40, 0x270c, 0x3f54,
+ 0x3230, 0x0020, 0x0c44, 0x260c, 0x3e54,
+ 0x3130, 0x0120, 0x0d44, 0x250c, 0x3d54,
+ 0x3030, 0x0220, 0x0e44, 0x240c, 0x3c54,
+ 0x3034, 0x0320, 0x0f44, 0x2410, 0x3c58,
+ 0x3134, 0x0420, 0x1044, 0x2510, 0x3e58,
+ 0x3234, 0x0520, 0x1144, 0x2610, 0x4058,
+ 0x3624, 0x0910, 0x1534, 0x2a00, 0x4248,
+ 0x3724, 0x0a10, 0x1634, 0x2b00, 0x4348,
+ 0x3824, 0x0b10, 0x1734, 0x2c00, 0x4448,
+ 0x3924, 0x0b14, 0x1738, 0x2d00, 0x4548,
+ 0x3a24, 0x0a14, 0x1638, 0x2e00, 0x4648,
+ 0x3b24, 0x0914, 0x1538, 0x2f00, 0x4748,
+ 0x3b28, 0x0814, 0x1438, 0x2f04, 0x474c,
+ 0x3a28, 0x0714, 0x1338, 0x2e04, 0x464c,
+ 0x3928, 0x0614, 0x1238, 0x2d04, 0x454c,
+ 0x3828, 0x0618, 0x123c, 0x2c04, 0x444c,
+ 0x3728, 0x0718, 0x133c, 0x2b04, 0x434c,
+ 0x3628, 0x0818, 0x143c, 0x2a04, 0x424c,
+ 0x362c, 0x0918, 0x153c, 0x2a08, 0x4250,
+ 0x372c, 0x0a18, 0x163c, 0x2b08, 0x4350,
+ 0x382c, 0x0b18, 0x173c, 0x2c08, 0x4450,
+ 0x392c, 0x0b1c, 0x1740, 0x2d08, 0x4550,
+ 0x3a2c, 0x0a1c, 0x1640, 0x2e08, 0x4650,
+ 0x3b2c, 0x091c, 0x1540, 0x2f08, 0x4750,
+ 0x3b30, 0x081c, 0x1440, 0x2f0c, 0x4754,
+ 0x3a30, 0x071c, 0x1340, 0x2e0c, 0x4654,
+ 0x3930, 0x061c, 0x1240, 0x2d0c, 0x4554,
+ 0x3830, 0x0620, 0x1244, 0x2c0c, 0x4454,
+ 0x3730, 0x0720, 0x1344, 0x2b0c, 0x4354,
+ 0x3630, 0x0820, 0x1444, 0x2a0c, 0x4254,
+ 0x3634, 0x0920, 0x1544, 0x2a10, 0x4258,
+ 0x3734, 0x0a20, 0x1644, 0x2b10, 0x4458,
+ 0x3834, 0x0b20, 0x1744, 0x2c10, 0x4658,
+ 0x3c24, 0x0f10, 0x1b34, 0x3000, 0x0048,
+ 0x3d24, 0x1010, 0x1c34, 0x3100, 0x0148,
+ 0x3e24, 0x1110, 0x1d34, 0x3200, 0x0248,
+ 0x3f24, 0x1114, 0x1d38, 0x3300, 0x0348,
+ 0x4024, 0x1014, 0x1c38, 0x3400, 0x0448,
+ 0x4124, 0x0f14, 0x1b38, 0x3500, 0x0548,
+ 0x4128, 0x0e14, 0x1a38, 0x3504, 0x054c,
+ 0x4028, 0x0d14, 0x1938, 0x3404, 0x044c,
+ 0x3f28, 0x0c14, 0x1838, 0x3304, 0x034c,
+ 0x3e28, 0x0c18, 0x183c, 0x3204, 0x024c,
+ 0x3d28, 0x0d18, 0x193c, 0x3104, 0x014c,
+ 0x3c28, 0x0e18, 0x1a3c, 0x3004, 0x004c,
+ 0x3c2c, 0x0f18, 0x1b3c, 0x3008, 0x0050,
+ 0x3d2c, 0x1018, 0x1c3c, 0x3108, 0x0150,
+ 0x3e2c, 0x1118, 0x1d3c, 0x3208, 0x0250,
+ 0x3f2c, 0x111c, 0x1d40, 0x3308, 0x0350,
+ 0x402c, 0x101c, 0x1c40, 0x3408, 0x0450,
+ 0x412c, 0x0f1c, 0x1b40, 0x3508, 0x0550,
+ 0x4130, 0x0e1c, 0x1a40, 0x350c, 0x0554,
+ 0x4030, 0x0d1c, 0x1940, 0x340c, 0x0454,
+ 0x3f30, 0x0c1c, 0x1840, 0x330c, 0x0354,
+ 0x3e30, 0x0c20, 0x1844, 0x320c, 0x0254,
+ 0x3d30, 0x0d20, 0x1944, 0x310c, 0x0154,
+ 0x3c30, 0x0e20, 0x1a44, 0x300c, 0x0054,
+ 0x3c34, 0x0f20, 0x1b44, 0x3010, 0x0058,
+ 0x3d34, 0x1020, 0x1c44, 0x3110, 0x0258,
+ 0x3e34, 0x1120, 0x1d44, 0x3210, 0x0458,
+ 0x4224, 0x1510, 0x2134, 0x3600, 0x0648,
+ 0x4324, 0x1610, 0x2234, 0x3700, 0x0748,
+ 0x4424, 0x1710, 0x2334, 0x3800, 0x0848,
+ 0x4524, 0x1714, 0x2338, 0x3900, 0x0948,
+ 0x4624, 0x1614, 0x2238, 0x3a00, 0x0a48,
+ 0x4724, 0x1514, 0x2138, 0x3b00, 0x0b48,
+ 0x4728, 0x1414, 0x2038, 0x3b04, 0x0b4c,
+ 0x4628, 0x1314, 0x1f38, 0x3a04, 0x0a4c,
+ 0x4528, 0x1214, 0x1e38, 0x3904, 0x094c,
+ 0x4428, 0x1218, 0x1e3c, 0x3804, 0x084c,
+ 0x4328, 0x1318, 0x1f3c, 0x3704, 0x074c,
+ 0x4228, 0x1418, 0x203c, 0x3604, 0x064c,
+ 0x422c, 0x1518, 0x213c, 0x3608, 0x0650,
+ 0x432c, 0x1618, 0x223c, 0x3708, 0x0750,
+ 0x442c, 0x1718, 0x233c, 0x3808, 0x0850,
+ 0x452c, 0x171c, 0x2340, 0x3908, 0x0950,
+ 0x462c, 0x161c, 0x2240, 0x3a08, 0x0a50,
+ 0x472c, 0x151c, 0x2140, 0x3b08, 0x0b50,
+ 0x4730, 0x141c, 0x2040, 0x3b0c, 0x0b54,
+ 0x4630, 0x131c, 0x1f40, 0x3a0c, 0x0a54,
+ 0x4530, 0x121c, 0x1e40, 0x390c, 0x0954,
+ 0x4430, 0x1220, 0x1e44, 0x380c, 0x0854,
+ 0x4330, 0x1320, 0x1f44, 0x370c, 0x0754,
+ 0x4230, 0x1420, 0x2044, 0x360c, 0x0654,
+ 0x4234, 0x1520, 0x2144, 0x3610, 0x0658,
+ 0x4334, 0x1620, 0x2244, 0x3710, 0x0858,
+ 0x4434, 0x1720, 0x2344, 0x3810, 0x0a58,
+ 0x0024, 0x1b10, 0x2734, 0x3c00, 0x0c48,
+ 0x0124, 0x1c10, 0x2834, 0x3d00, 0x0d48,
+ 0x0224, 0x1d10, 0x2934, 0x3e00, 0x0e48,
+ 0x0324, 0x1d14, 0x2938, 0x3f00, 0x0f48,
+ 0x0424, 0x1c14, 0x2838, 0x4000, 0x1048,
+ 0x0524, 0x1b14, 0x2738, 0x4100, 0x1148,
+ 0x0528, 0x1a14, 0x2638, 0x4104, 0x114c,
+ 0x0428, 0x1914, 0x2538, 0x4004, 0x104c,
+ 0x0328, 0x1814, 0x2438, 0x3f04, 0x0f4c,
+ 0x0228, 0x1818, 0x243c, 0x3e04, 0x0e4c,
+ 0x0128, 0x1918, 0x253c, 0x3d04, 0x0d4c,
+ 0x0028, 0x1a18, 0x263c, 0x3c04, 0x0c4c,
+ 0x002c, 0x1b18, 0x273c, 0x3c08, 0x0c50,
+ 0x012c, 0x1c18, 0x283c, 0x3d08, 0x0d50,
+ 0x022c, 0x1d18, 0x293c, 0x3e08, 0x0e50,
+ 0x032c, 0x1d1c, 0x2940, 0x3f08, 0x0f50,
+ 0x042c, 0x1c1c, 0x2840, 0x4008, 0x1050,
+ 0x052c, 0x1b1c, 0x2740, 0x4108, 0x1150,
+ 0x0530, 0x1a1c, 0x2640, 0x410c, 0x1154,
+ 0x0430, 0x191c, 0x2540, 0x400c, 0x1054,
+ 0x0330, 0x181c, 0x2440, 0x3f0c, 0x0f54,
+ 0x0230, 0x1820, 0x2444, 0x3e0c, 0x0e54,
+ 0x0130, 0x1920, 0x2544, 0x3d0c, 0x0d54,
+ 0x0030, 0x1a20, 0x2644, 0x3c0c, 0x0c54,
+ 0x0034, 0x1b20, 0x2744, 0x3c10, 0x0c58,
+ 0x0134, 0x1c20, 0x2844, 0x3d10, 0x0e58,
+ 0x0234, 0x1d20, 0x2944, 0x3e10, 0x1058,
+ 0x0624, 0x2110, 0x2d34, 0x4200, 0x1248,
+ 0x0724, 0x2210, 0x2e34, 0x4300, 0x1348,
+ 0x0824, 0x2310, 0x2f34, 0x4400, 0x1448,
+ 0x0924, 0x2314, 0x2f38, 0x4500, 0x1548,
+ 0x0a24, 0x2214, 0x2e38, 0x4600, 0x1648,
+ 0x0b24, 0x2114, 0x2d38, 0x4700, 0x1748,
+ 0x0b28, 0x2014, 0x2c38, 0x4704, 0x174c,
+ 0x0a28, 0x1f14, 0x2b38, 0x4604, 0x164c,
+ 0x0928, 0x1e14, 0x2a38, 0x4504, 0x154c,
+ 0x0828, 0x1e18, 0x2a3c, 0x4404, 0x144c,
+ 0x0728, 0x1f18, 0x2b3c, 0x4304, 0x134c,
+ 0x0628, 0x2018, 0x2c3c, 0x4204, 0x124c,
+ 0x062c, 0x2118, 0x2d3c, 0x4208, 0x1250,
+ 0x072c, 0x2218, 0x2e3c, 0x4308, 0x1350,
+ 0x082c, 0x2318, 0x2f3c, 0x4408, 0x1450,
+ 0x092c, 0x231c, 0x2f40, 0x4508, 0x1550,
+ 0x0a2c, 0x221c, 0x2e40, 0x4608, 0x1650,
+ 0x0b2c, 0x211c, 0x2d40, 0x4708, 0x1750,
+ 0x0b30, 0x201c, 0x2c40, 0x470c, 0x1754,
+ 0x0a30, 0x1f1c, 0x2b40, 0x460c, 0x1654,
+ 0x0930, 0x1e1c, 0x2a40, 0x450c, 0x1554,
+ 0x0830, 0x1e20, 0x2a44, 0x440c, 0x1454,
+ 0x0730, 0x1f20, 0x2b44, 0x430c, 0x1354,
+ 0x0630, 0x2020, 0x2c44, 0x420c, 0x1254,
+ 0x0634, 0x2120, 0x2d44, 0x4210, 0x1258,
+ 0x0734, 0x2220, 0x2e44, 0x4310, 0x1458,
0x0834, 0x2320, 0x2f44, 0x4410, 0x1658,
};
{ 12, 42, 72, 2, 32, 62, 22, 52, 82 },
{ 18, 48, 78, 8, 38, 68, 28, 58, 88 },
{ 24, 54, 84, 14, 44, 74, 4, 34, 64 },
-
+
{ 1, 31, 61, 21, 51, 81, 11, 41, 71 }, /* 2nd channel */
{ 7, 37, 67, 27, 57, 87, 17, 47, 77 },
{ 13, 43, 73, 3, 33, 63, 23, 53, 83 },
{ 6, 42, 78, 32, 68, 104, 22, 58, 94},
{ 12, 48, 84, 2, 38, 74, 28, 64, 100},
{ 18, 54, 90, 8, 44, 80, 34, 70, 106},
- { 24, 60, 96, 14, 50, 86, 4, 40, 76},
+ { 24, 60, 96, 14, 50, 86, 4, 40, 76},
{ 30, 66, 102, 20, 56, 92, 10, 46, 82},
-
+
{ 1, 37, 73, 27, 63, 99, 17, 53, 89}, /* 2nd channel */
{ 7, 43, 79, 33, 69, 105, 23, 59, 95},
{ 13, 49, 85, 3, 39, 75, 29, 65, 101},
{ 19, 55, 91, 9, 45, 81, 35, 71, 107},
- { 25, 61, 97, 15, 51, 87, 5, 41, 77},
+ { 25, 61, 97, 15, 51, 87, 5, 41, 77},
{ 31, 67, 103, 21, 57, 93, 11, 47, 83},
};
static const __attribute__((unused)) int dv_audio_frequency[3] = {
48000, 44100, 32000,
};
-
+
static const DVprofile dv_profiles[] = {
{ .dsf = 0,
.frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
.audio_min_samples = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32Khz */
.audio_samples_dist = { 1602, 1601, 1602, 1601, 1602 },
.audio_shuffle = dv_audio_shuffle525,
- },
+ },
{ .dsf = 1,
.frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */
.difseg_size = 12,
else if ((frame[5] & 0x07) == 0) { /* APT flag */
return &dv_profiles[1];
}
- else
+ else
return &dv_profiles[2];
}
{
if (codec->width != 720) {
return NULL;
- }
+ }
else if (codec->height == 480) {
return &dv_profiles[0];
- }
- else
+ }
+ else
return &dv_profiles[1];
}
return (buf[nibble_offset >> 1] >> ((1 - (nibble_offset & 1)) << 2)) & 0xf;
}
-static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
+static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
const uint8_t *buf, int nibble_offset, int buf_size)
{
unsigned int v;
{
uint8_t color_used[16];
int nb_opaque_colors, i, level, j, r, g, b;
-
+
for(i = 0; i < 4; i++)
rgba_palette[i] = 0;
nb_opaque_colors++;
}
}
-
+
if (nb_opaque_colors == 0)
return;
-
+
j = nb_opaque_colors;
memset(color_used, 0, 16);
for(i = 0; i < 4; i++) {
}
}
-static int decode_dvd_subtitles(AVSubtitle *sub_header,
+static int decode_dvd_subtitles(AVSubtitle *sub_header,
const uint8_t *buf, int buf_size)
{
int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
int date;
int i;
int is_menu = 0;
-
+
if (buf_size < 4)
return -1;
sub_header->rects = NULL;
date = getbe16(buf + cmd_pos);
next_cmd_pos = getbe16(buf + cmd_pos + 2);
#ifdef DEBUG
- av_log(NULL, AV_LOG_INFO, "cmd_pos=0x%04x next=0x%04x date=%d\n",
+ av_log(NULL, AV_LOG_INFO, "cmd_pos=0x%04x next=0x%04x date=%d\n",
cmd_pos, next_cmd_pos, date);
#endif
pos = cmd_pos + 4;
if (offset1 >= 0) {
int w, h;
uint8_t *bitmap;
-
+
/* decode the bitmap */
w = x2 - x1 + 1;
if (w < 0)
return -1;
}
-static int is_transp(const uint8_t *buf, int pitch, int n,
+static int is_transp(const uint8_t *buf, int pitch, int n,
const uint8_t *transp_color)
{
int i;
goto no_subtitle;
#if defined(DEBUG)
- av_log(NULL, AV_LOG_INFO, "start=%d ms end =%d ms\n",
+ av_log(NULL, AV_LOG_INFO, "start=%d ms end =%d ms\n",
sub->start_display_time,
sub->end_display_time);
ppm_save("/tmp/a.ppm", sub->rects[0].bitmap,
static int dvdsub_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
DVDSubParseContext *pc = s->priv_data;
-
+
if (pc->packet_index == 0) {
if (buf_size < 2)
return 0;
*q++ = h->rects[object_id].y >> 4;
*q++ = (h->rects[object_id].y << 4) | ((y2 >> 8) & 0xf);
*q++ = y2;
-
+
*q++ = 0x06;
// offset1, offset2
putbe16(&q, offset1[object_id]);
qq = outbuf;
putbe16(&qq, q - outbuf);
-
+
av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%td\n", q - outbuf);
return q - outbuf;
}
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file error_resilience.c
* Error resilience / concealment.
*/
#include <limits.h>
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
s->dest[1] = s->current_picture.data[1] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8;
s->dest[2] = s->current_picture.data[2] + (s->mb_y * 8 * s->uvlinesize) + s->mb_x * 8;
- MPV_decode_mb(s, s->block);
+ MPV_decode_mb(s, s->block);
}
/**
for(x=1; x<width-1; x++){
int dc;
-
- dc= - prev_dc
+
+ dc= - prev_dc
+ data[x + y*stride]*8
- data[x + 1 + y*stride];
dc= (dc*10923 + 32768)>>16;
data[x + y*stride]= dc;
}
}
-
+
/* vertical filter */
for(x=1; x<width-1; x++){
int prev_dc= data[x];
for(y=1; y<height-1; y++){
int dc;
-
- dc= - prev_dc
+
+ dc= - prev_dc
+ data[x + y *stride]*8
- data[x + (y+1)*stride];
dc= (dc*10923 + 32768)>>16;
int distance[4]={9999,9999,9999,9999};
int mb_index, error, j;
int64_t guess, weight_sum;
-
+
mb_index= (b_x>>is_luma) + (b_y>>is_luma)*s->mb_stride;
-
+
error= s->error_status_table[mb_index];
-
+
if(IS_INTER(s->current_picture.mb_type[mb_index])) continue; //inter
if(!(error&DC_ERROR)) continue; //dc-ok
-
+
/* right block */
for(j=b_x+1; j<w; j++){
int mb_index_j= (j>>is_luma) + (b_y>>is_luma)*s->mb_stride;
break;
}
}
-
+
/* left block */
for(j=b_x-1; j>=0; j--){
int mb_index_j= (j>>is_luma) + (b_y>>is_luma)*s->mb_stride;
break;
}
}
-
+
weight_sum=0;
guess=0;
for(j=0; j<4; j++){
int offset= b_x*8 + b_y*stride*8;
int16_t *left_mv= s->current_picture.motion_val[0][s->b8_stride*(b_y<<(1-is_luma)) + ( b_x <<(1-is_luma))];
int16_t *right_mv= s->current_picture.motion_val[0][s->b8_stride*(b_y<<(1-is_luma)) + ((b_x+1)<<(1-is_luma))];
-
+
if(!(left_damage||right_damage)) continue; // both undamaged
-
- if( (!left_intra) && (!right_intra)
+
+ if( (!left_intra) && (!right_intra)
&& ABS(left_mv[0]-right_mv[0]) + ABS(left_mv[1]+right_mv[1]) < 2) continue;
-
+
for(y=0; y<8; y++){
int a,b,c,d;
-
+
a= dst[offset + 7 + y*stride] - dst[offset + 6 + y*stride];
b= dst[offset + 8 + y*stride] - dst[offset + 7 + y*stride];
c= dst[offset + 9 + y*stride] - dst[offset + 8 + y*stride];
-
+
d= ABS(b) - ((ABS(a) + ABS(c) + 1)>>1);
d= FFMAX(d, 0);
if(b<0) d= -d;
-
+
if(d==0) continue;
if(!(left_damage && right_damage))
d= d*16/9;
-
+
if(left_damage){
dst[offset + 7 + y*stride] = cm[dst[offset + 7 + y*stride] + ((d*7)>>4)];
dst[offset + 6 + y*stride] = cm[dst[offset + 6 + y*stride] + ((d*5)>>4)];
int offset= b_x*8 + b_y*stride*8;
int16_t *top_mv= s->current_picture.motion_val[0][s->b8_stride*( b_y <<(1-is_luma)) + (b_x<<(1-is_luma))];
int16_t *bottom_mv= s->current_picture.motion_val[0][s->b8_stride*((b_y+1)<<(1-is_luma)) + (b_x<<(1-is_luma))];
-
+
if(!(top_damage||bottom_damage)) continue; // both undamaged
-
- if( (!top_intra) && (!bottom_intra)
+
+ if( (!top_intra) && (!bottom_intra)
&& ABS(top_mv[0]-bottom_mv[0]) + ABS(top_mv[1]+bottom_mv[1]) < 2) continue;
-
+
for(x=0; x<8; x++){
int a,b,c,d;
-
+
a= dst[offset + x + 7*stride] - dst[offset + x + 6*stride];
b= dst[offset + x + 8*stride] - dst[offset + x + 7*stride];
c= dst[offset + x + 9*stride] - dst[offset + x + 8*stride];
-
+
d= ABS(b) - ((ABS(a) + ABS(c)+1)>>1);
d= FFMAX(d, 0);
if(b<0) d= -d;
-
+
if(d==0) continue;
if(!(top_damage && bottom_damage))
d= d*16/9;
-
+
if(top_damage){
dst[offset + x + 7*stride] = cm[dst[offset + x + 7*stride] + ((d*7)>>4)];
dst[offset + x + 6*stride] = cm[dst[offset + x + 6*stride] + ((d*5)>>4)];
const int mb_height= s->mb_height;
int i, depth, num_avail;
int mb_x, mb_y;
-
+
num_avail=0;
for(i=0; i<s->mb_num; i++){
const int mb_xy= s->mb_index2xy[ i ];
if(IS_INTRA(s->current_picture.mb_type[mb_xy])) f=MV_FROZEN; //intra //FIXME check
if(!(error&MV_ERROR)) f=MV_FROZEN; //inter with undamaged MV
-
+
fixed[mb_xy]= f;
if(f==MV_FROZEN)
num_avail++;
}
-
+
if((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) || num_avail <= mb_width/2){
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
const int mb_xy= mb_x + mb_y*s->mb_stride;
-
+
if(IS_INTRA(s->current_picture.mb_type[mb_xy])) continue;
if(!(s->error_status_table[mb_xy]&MV_ERROR)) continue;
}
return;
}
-
+
for(depth=0;; depth++){
int changed, pass, none_left;
for(pass=0; (changed || pass<2) && pass<10; pass++){
int mb_x, mb_y;
int score_sum=0;
-
+
changed=0;
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
int prev_y= s->current_picture.motion_val[0][mot_index][1];
if((mb_x^mb_y^pass)&1) continue;
-
+
if(fixed[mb_xy]==MV_FROZEN) continue;
assert(!IS_INTRA(s->current_picture.mb_type[mb_xy]));
assert(s->last_picture_ptr && s->last_picture_ptr->data[0]);
-
+
j=0;
if(mb_x>0 && fixed[mb_xy-1 ]==MV_FROZEN) j=1;
if(mb_x+1<mb_width && fixed[mb_xy+1 ]==MV_FROZEN) j=1;
if(mb_y>0 && fixed[mb_xy-mb_stride]==MV_CHANGED) j=1;
if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]==MV_CHANGED) j=1;
if(j==0 && pass>1) continue;
-
+
none_left=0;
-
+
if(mb_x>0 && fixed[mb_xy-1]){
mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - 2][0];
mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - 2][1];
pred_count++;
}
if(pred_count==0) continue;
-
+
if(pred_count>1){
int sum_x=0, sum_y=0;
int max_x, max_y, min_x, min_y;
sum_x+= mv_predictor[j][0];
sum_y+= mv_predictor[j][1];
}
-
+
/* mean */
mv_predictor[pred_count][0] = sum_x/j;
mv_predictor[pred_count][1] = sum_y/j;
-
+
/* median */
if(pred_count>=3){
min_y= min_x= 99999;
}
mv_predictor[pred_count+1][0] = sum_x - max_x - min_x;
mv_predictor[pred_count+1][1] = sum_y - max_y - min_y;
-
+
if(pred_count==4){
mv_predictor[pred_count+1][0] /= 2;
mv_predictor[pred_count+1][1] /= 2;
}
pred_count+=2;
}
-
+
/* zero MV */
pred_count++;
/* last MV */
mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index][0];
mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index][1];
- pred_count++;
-
+ pred_count++;
+
s->mv_dir = MV_DIR_FORWARD;
s->mb_intra=0;
s->mv_type = MV_TYPE_16X16;
s->current_picture.motion_val[0][mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1];
decode_mb(s);
-
+
if(mb_x>0 && fixed[mb_xy-1]){
int k;
for(k=0; k<16; k++)
for(k=0; k<16; k++)
score += ABS(src[k+s->linesize*15]-src[k+s->linesize*16]);
}
-
+
if(score <= best_score){ // <= will favor the last MV
best_score= score;
best_pred= j;
decode_mb(s);
-
+
if(s->mv[0][0][0] != prev_x || s->mv[0][0][1] != prev_y){
fixed[mb_xy]=MV_CHANGED;
changed++;
// printf(".%d/%d", changed, score_sum); fflush(stdout);
}
-
- if(none_left)
+
+ if(none_left)
return;
-
+
for(i=0; i<s->mb_num; i++){
int mb_xy= s->mb_index2xy[i];
if(fixed[mb_xy])
// printf(":"); fflush(stdout);
}
}
-
+
static int is_intra_more_likely(MpegEncContext *s){
int is_intra_likely, i, j, undamaged_count, skip_amount, mb_x, mb_y;
-
+
if(s->last_picture_ptr==NULL) return 1; //no previous frame available -> use spatial prediction
undamaged_count=0;
if(!((error&DC_ERROR) && (error&MV_ERROR)))
undamaged_count++;
}
-
+
if(undamaged_count < 5) return 0; //allmost all MBs damaged -> use temporal prediction
-
- skip_amount= FFMAX(undamaged_count/50, 1); //check only upto 50 MBs
+
+ skip_amount= FFMAX(undamaged_count/50, 1); //check only upto 50 MBs
is_intra_likely=0;
j=0;
error= s->error_status_table[mb_xy];
if((error&DC_ERROR) && (error&MV_ERROR))
continue; //skip damaged
-
- j++;
+
+ j++;
if((j%skip_amount) != 0) continue; //skip a few to speed things up
-
+
if(s->pict_type==I_TYPE){
uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
-
+
is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16);
is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16);
}else{
}
}
//printf("is_intra_likely: %d type:%d\n", is_intra_likely, s->pict_type);
- return is_intra_likely > 0;
+ return is_intra_likely > 0;
}
void ff_er_frame_start(MpegEncContext *s){
const int start_xy= s->mb_index2xy[start_i];
const int end_xy = s->mb_index2xy[end_i];
int mask= -1;
-
+
if(!s->error_resilience) return;
mask &= ~VP_START;
}
}
- if(end_i == s->mb_num)
+ if(end_i == s->mb_num)
s->error_count= INT_MAX;
else{
s->error_status_table[end_xy] &= mask;
s->error_status_table[end_xy] |= status;
}
-
+
s->error_status_table[start_xy] |= VP_START;
if(start_xy > 0 && s->avctx->thread_count <= 1 && s->avctx->skip_top*s->mb_width < start_i){
int prev_status= s->error_status_table[ s->mb_index2xy[start_i - 1] ];
-
+
prev_status &= ~ VP_START;
if(prev_status != (MV_END|DC_END|AC_END)) s->error_count= INT_MAX;
}
int is_intra_likely;
int size = s->b8_stride * 2 * s->mb_height;
Picture *pic= s->current_picture_ptr;
-
- if(!s->error_resilience || s->error_count==0 ||
+
+ if(!s->error_resilience || s->error_count==0 ||
s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
if(s->current_picture.motion_val[0] == NULL){
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
-
+
for(i=0; i<2; i++){
pic->ref_index[i]= av_mallocz(size * sizeof(uint8_t));
pic->motion_val_base[i]= av_mallocz((size+4) * 2 * sizeof(uint16_t));
pic->motion_subsample_log2= 3;
s->current_picture= *s->current_picture_ptr;
}
-
+
for(i=0; i<2; i++){
if(pic->ref_index[i])
memset(pic->ref_index[i], 0, size * sizeof(uint8_t));
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
int status= s->error_status_table[mb_x + mb_y*s->mb_stride];
-
- av_log(s->avctx, AV_LOG_DEBUG, "%2X ", status);
+
+ av_log(s->avctx, AV_LOG_DEBUG, "%2X ", status);
}
av_log(s->avctx, AV_LOG_DEBUG, "\n");
}
}
-
+
#if 1
/* handle overlapping slices */
for(error_type=1; error_type<=3; error_type++){
for(i=s->mb_num-1; i>=0; i--){
const int mb_xy= s->mb_index2xy[i];
int error= s->error_status_table[mb_xy];
-
+
if(error&(1<<error_type))
end_ok=1;
if(error&(8<<error_type))
for(i=s->mb_num-1; i>=0; i--){
const int mb_xy= s->mb_index2xy[i];
int error= s->error_status_table[mb_xy];
-
+
if(error&AC_END)
end_ok=0;
if((error&MV_END) || (error&DC_END) || (error&AC_ERROR))
/* handle missing slices */
if(s->error_resilience>=4){
int end_ok=1;
-
+
for(i=s->mb_num-2; i>=s->mb_width+100; i--){ //FIXME +100 hack
const int mb_xy= s->mb_index2xy[i];
int error1= s->error_status_table[mb_xy ];
int error2= s->error_status_table[s->mb_index2xy[i+1]];
-
+
if(error1&VP_START)
end_ok=1;
-
+
if( error2==(VP_START|DC_ERROR|AC_ERROR|MV_ERROR|AC_END|DC_END|MV_END)
- && error1!=(VP_START|DC_ERROR|AC_ERROR|MV_ERROR|AC_END|DC_END|MV_END)
+ && error1!=(VP_START|DC_ERROR|AC_ERROR|MV_ERROR|AC_END|DC_END|MV_END)
&& ((error1&AC_END) || (error1&DC_END) || (error1&MV_END))){ //end & uninited
end_ok=0;
}
-
+
if(!end_ok)
s->error_status_table[mb_xy]|= DC_ERROR|AC_ERROR|MV_ERROR;
}
}
-
+
#if 1
/* backward mark errors */
distance=9999999;
for(i=s->mb_num-1; i>=0; i--){
const int mb_xy= s->mb_index2xy[i];
int error= s->error_status_table[mb_xy];
-
+
if(!s->mbskip_table[mb_xy]) //FIXME partition specific
- distance++;
+ distance++;
if(error&(1<<error_type))
distance= 0;
for(i=0; i<s->mb_num; i++){
const int mb_xy= s->mb_index2xy[i];
int old_error= s->error_status_table[mb_xy];
-
+
if(old_error&VP_START)
error= old_error& (DC_ERROR|AC_ERROR|MV_ERROR);
else{
else
s->current_picture.mb_type[mb_xy]= MB_TYPE_16x16 | MB_TYPE_L0;
}
-
+
/* handle inter blocks with damaged AC */
for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
if(IS_INTRA(mb_type)) continue; //intra
if(error&MV_ERROR) continue; //inter with damaged MV
if(!(error&AC_ERROR)) continue; //undamaged inter
-
+
s->mv_dir = MV_DIR_FORWARD;
s->mb_intra=0;
s->mb_skipped=0;
s->mv[0][0][0] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][0];
s->mv[0][0][1] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][1];
}
-
+
s->dsp.clear_blocks(s->block[0]);
s->mb_x= mb_x;
if(IS_INTRA(mb_type)) continue;
if(!(error&MV_ERROR)) continue; //inter with undamaged MV
if(!(error&AC_ERROR)) continue; //undamaged inter
-
+
s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD;
s->mb_intra=0;
s->mv_type = MV_TYPE_16X16;
s->mb_skipped=0;
-
+
if(s->pp_time){
int time_pp= s->pp_time;
int time_pb= s->pb_time;
-
+
s->mv[0][0][0] = s->next_picture.motion_val[0][xy][0]*time_pb/time_pp;
s->mv[0][0][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp;
s->mv[1][0][0] = s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp;
uint8_t *dest_y, *dest_cb, *dest_cr;
const int mb_xy= mb_x + mb_y * s->mb_stride;
const int mb_type= s->current_picture.mb_type[mb_xy];
-
+
error= s->error_status_table[mb_xy];
if(IS_INTRA(mb_type) && s->partitioned_frame) continue;
// if(error&MV_ERROR) continue; //inter data damaged FIXME is this good?
-
+
dest_y = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
dest_cb= s->current_picture.data[1] + mb_x*8 + mb_y*8 *s->uvlinesize;
dest_cr= s->current_picture.data[2] + mb_x*8 + mb_y*8 *s->uvlinesize;
-
+
dc_ptr= &s->dc_val[0][mb_x*2 + mb_y*2*s->b8_stride];
for(n=0; n<4; n++){
dc=0;
}
}
s->dc_val[1][mb_x + mb_y*s->mb_stride]= (dcu+4)>>3;
- s->dc_val[2][mb_x + mb_y*s->mb_stride]= (dcv+4)>>3;
+ s->dc_val[2][mb_x + mb_y*s->mb_stride]= (dcv+4)>>3;
}
}
#if 1
guess_dc(s, s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride, 1);
guess_dc(s, s->dc_val[1], s->mb_width , s->mb_height , s->mb_stride, 0);
guess_dc(s, s->dc_val[2], s->mb_width , s->mb_height , s->mb_stride, 0);
-#endif
+#endif
/* filter luma DC */
filter181(s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride);
-
+
#if 1
/* render DC only intra */
for(mb_y=0; mb_y<s->mb_height; mb_y++){
if(IS_INTER(mb_type)) continue;
if(!(error&AC_ERROR)) continue; //undamaged
-
+
dest_y = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
dest_cb= s->current_picture.data[1] + mb_x*8 + mb_y*8 *s->uvlinesize;
dest_cr= s->current_picture.data[2] + mb_x*8 + mb_y*8 *s->uvlinesize;
-
+
put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y);
}
}
#endif
-
+
if(s->avctx->error_concealment&FF_EC_DEBLOCK){
/* filter horizontal block boundaries */
h_block_filter(s, s->current_picture.data[0], s->mb_width*2, s->mb_height*2, s->linesize , 1);
for(i=0; i<s->mb_num; i++){
const int mb_xy= s->mb_index2xy[i];
int error= s->error_status_table[mb_xy];
-
+
if(s->pict_type!=B_TYPE && (error&(DC_ERROR|MV_ERROR|AC_ERROR))){
s->mbskip_table[mb_xy]=0;
}
s->mbintra_table[mb_xy]=1;
- }
+ }
}
p->s= next;
return d;
}
-
+
/* named constants */
for(i=0; p->const_name && p->const_name[i]; i++){
if(strmatch(p->s, p->const_name[i])){
return p->const_value[i];
}
}
-
+
p->s= strchr(p->s, '(');
if(p->s==NULL){
av_log(NULL, AV_LOG_ERROR, "Parser: missing ( in \"%s\"\n", next);
return NAN;
}
p->s++; // ")"
-
+
if( strmatch(next, "sinh" ) ) d= sinh(d);
else if( strmatch(next, "cosh" ) ) d= cosh(d);
else if( strmatch(next, "tanh" ) ) d= tanh(d);
}
return d;
-}
+}
static double evalPow(Parser *p){
int sign= (*p->s == '+') - (*p->s == '-');
double (**func2)(void *, double, double), char **func2_name,
void *opaque){
Parser p;
-
+
p.stack_index=100;
p.s= s;
p.const_value= const_value;
p.func2 = func2;
p.func2_name = func2_name;
p.opaque = opaque;
-
+
return evalExpression(&p);
}
#ifdef TEST
-#undef printf
+#undef printf
static double const_values[]={
M_PI,
M_E,
main(){
int i;
printf("%f == 12.7\n", ff_eval("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL));
-
+
for(i=0; i<1050; i++){
START_TIMER
ff_eval("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL);
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file faacaudio.c
* Interface to libfaac for aac encoding.
unsigned long buffer_size);
char* FAADAPI (*faacDecGetErrorMessage)(unsigned char errcode);
#endif
-
+
void FAADAPI (*faacDecClose)(faacDecHandle hDecoder);
-
-
+
+
} FAACContext;
static const unsigned long faac_srates[] =
if(buf_size == 0)
return 0;
#ifndef FAAD2_VERSION
- out = s->faacDecDecode(s->faac_handle,
- (unsigned char*)buf,
- &bytesconsumed,
- data,
+ out = s->faacDecDecode(s->faac_handle,
+ (unsigned char*)buf,
+ &bytesconsumed,
+ data,
&samples);
samples *= s->sample_size;
if (data_size)
return (buf_size < (int)bytesconsumed)
? buf_size : (int)bytesconsumed;
#else
-
+
out = s->faacDecDecode(s->faac_handle, &frame_info, (unsigned char*)buf, (unsigned long)buf_size);
if (frame_info.error > 0) {
/**
* @file faandct.c
- * @brief
+ * @brief
* Floating point AAN DCT
* @author Michael Niedermayer <michaelni@gmx.at>
*/
tmp5= data[2 + i] - data[5 + i];
tmp3= data[3 + i] + data[4 + i];
tmp4= data[3 + i] - data[4 + i];
-
+
tmp10= tmp0 + tmp3;
tmp13= tmp0 - tmp3;
tmp11= tmp1 + tmp2;
tmp12= tmp1 - tmp2;
-
+
temp[0 + i]= tmp10 + tmp11;
temp[4 + i]= tmp10 - tmp11;
-
+
z1= (tmp12 + tmp13)*A1;
temp[2 + i]= tmp13 + z1;
temp[6 + i]= tmp13 - z1;
-
+
tmp10= tmp4 + tmp5;
tmp11= tmp5 + tmp6;
tmp12= tmp6 + tmp7;
temp[3 + i]= z13 - z2;
temp[1 + i]= z11 + z4;
temp[7 + i]= z11 - z4;
- }
+ }
}
void ff_faandct(DCTELEM * data)
tmp5= temp[8*2 + i] - temp[8*5 + i];
tmp3= temp[8*3 + i] + temp[8*4 + i];
tmp4= temp[8*3 + i] - temp[8*4 + i];
-
+
tmp10= tmp0 + tmp3;
tmp13= tmp0 - tmp3;
tmp11= tmp1 + tmp2;
tmp12= tmp1 - tmp2;
-
+
data[8*0 + i]= lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
data[8*4 + i]= lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
-
+
z1= (tmp12 + tmp13)* A1;
data[8*2 + i]= lrintf(SCALE(8*2 + i) * (tmp13 + z1));
data[8*6 + i]= lrintf(SCALE(8*6 + i) * (tmp13 - z1));
-
+
tmp10= tmp4 + tmp5;
tmp11= tmp5 + tmp6;
tmp12= tmp6 + tmp7;
tmp5 = temp[8*2 + i] - temp[8*3 + i];
tmp6 = temp[8*4 + i] - temp[8*5 + i];
tmp7 = temp[8*6 + i] - temp[8*7 + i];
-
+
tmp10 = tmp0 + tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
tmp13 = tmp0 - tmp3;
-
+
data[8*0 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
data[8*4 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
-
+
z1 = (tmp12 + tmp13)* A1;
data[8*2 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + z1));
data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - z1));
-
+
tmp10 = tmp4 + tmp7;
tmp11 = tmp5 + tmp6;
tmp12 = tmp5 - tmp6;
/**
* @file faandct.h
- * @brief
+ * @brief
* Floating point AAN DCT
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-
+
#define FAAN_POSTSCALE
-
+
void ff_faandct(DCTELEM * data);
void ff_faandct248(DCTELEM * data);
tmp[8*i+j] = partial_product;
}
- /* Transpose operation is integrated into address mapping by switching
+ /* Transpose operation is integrated into address mapping by switching
loop order of i and j */
for (j=0; j<8; j++)
for(i=0;i<n;i++) {
if (fabsf(tab1[i] - tab2[i]) >= 1e-3) {
- av_log(NULL, AV_LOG_ERROR, "ERROR %d: %f %f\n",
+ av_log(NULL, AV_LOG_ERROR, "ERROR %d: %f %f\n",
i, tab1[i], tab2[i]);
}
}
check_diff((float *)tab_ref, tab2, fft_size);
} else {
mdct_ref((float *)tab_ref, (float *)tab1, fft_size);
-
+
ff_mdct_calc(m, tab2, (float *)tab1, tabtmp);
check_diff((float *)tab_ref, tab2, fft_size / 2);
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
ff_fft_permute(s, tab);
ff_fft_calc(s, tab);
-
+
fft_ref(tab_ref, tab1, fft_nbits);
check_diff((float *)tab_ref, (float *)tab, fft_size * 2);
}
break;
nb_its *= 2;
}
- av_log(NULL, AV_LOG_INFO,"time: %0.1f us/transform [total time=%0.2f s its=%d]\n",
- (double)duration / nb_its,
+ av_log(NULL, AV_LOG_INFO,"time: %0.1f us/transform [total time=%0.2f s its=%d]\n",
+ (double)duration / nb_its,
(double)duration / 1000000.0,
nb_its);
}
-
+
if (do_mdct) {
ff_mdct_end(m);
} else {
/**
* The size of the FFT is 2^nbits. If inverse is TRUE, inverse FFT is
- * done
+ * done
*/
int ff_fft_init(FFTContext *s, int nbits, int inverse)
{
int i, j, m, n;
float alpha, c1, s1, s2;
-
+
s->nbits = nbits;
n = 1 << nbits;
s->inverse = inverse;
s2 = inverse ? 1.0 : -1.0;
-
+
for(i=0;i<(n/2);i++) {
alpha = 2 * M_PI * (float)i / (float)n;
c1 = cos(alpha);
if (has_vectors) {
int np, nblocks, np2, l;
FFTComplex *q;
-
+
np = 1 << nbits;
nblocks = np >> 3;
np2 = np >> 1;
/**
* Do a complex FFT with the parameters defined in ff_fft_init(). The
* input data must be permuted before with s->revtab table. No
- * 1.0/sqrt(n) normalization is done.
+ * 1.0/sqrt(n) normalization is done.
*/
void ff_fft_calc_c(FFTContext *s, FFTComplex *z)
{
p=&z[0];
j=(np >> 1);
do {
- BF(p[0].re, p[0].im, p[1].re, p[1].im,
+ BF(p[0].re, p[0].im, p[1].re, p[1].im,
p[0].re, p[0].im, p[1].re, p[1].im);
p+=2;
} while (--j != 0);
/* pass 1 */
-
+
p=&z[0];
j=np >> 2;
if (s->inverse) {
do {
- BF(p[0].re, p[0].im, p[2].re, p[2].im,
+ BF(p[0].re, p[0].im, p[2].re, p[2].im,
p[0].re, p[0].im, p[2].re, p[2].im);
- BF(p[1].re, p[1].im, p[3].re, p[3].im,
+ BF(p[1].re, p[1].im, p[3].re, p[3].im,
p[1].re, p[1].im, -p[3].im, p[3].re);
p+=4;
} while (--j != 0);
} else {
do {
- BF(p[0].re, p[0].im, p[2].re, p[2].im,
+ BF(p[0].re, p[0].im, p[2].re, p[2].im,
p[0].re, p[0].im, p[2].re, p[2].im);
- BF(p[1].re, p[1].im, p[3].re, p[3].im,
+ BF(p[1].re, p[1].im, p[3].re, p[3].im,
p[1].re, p[1].im, p[3].im, -p[3].re);
p+=4;
} while (--j != 0);
for (j = 0; j < nblocks; ++j) {
BF(p->re, p->im, q->re, q->im,
p->re, p->im, q->re, q->im);
-
+
p++;
q++;
for(l = nblocks; l < np2; l += nblocks) {
int j, k, np;
FFTComplex tmp;
const uint16_t *revtab = s->revtab;
-
+
/* reverse */
np = 1 << s->nbits;
for(j=0;j<np;j++) {
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file ffv1.c
* FF Video Codec 1 (an experimental lossless codec)
};
static const uint8_t log2_run[32]={
- 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 5, 5, 6, 6, 7, 7,
+ 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
+ 4, 4, 5, 5, 6, 6, 7, 7,
8, 9,10,11,12,13,14,15,
};
int16_t quant_table[5][256];
int run_index;
int colorspace;
-
- DSPContext dsp;
+
+ DSPContext dsp;
}FFV1Context;
static always_inline int fold(int diff, int bits){
const int a= ABS(v);
const int e= av_log2(a);
put_rac(c, state+0, 0);
-
+
assert(e<=9);
for(i=0; i<e; i++){
if(drift <= -count){
if(state->bias > -128) state->bias--;
-
+
drift += count;
if(drift <= -count)
drift= -count + 1;
}else if(drift > 0){
if(state->bias < 127) state->bias++;
-
+
drift -= count;
- if(drift > 0)
+ if(drift > 0)
drift= 0;
}
#else
code= v ^ ((2*state->drift + state->count)>>31);
#endif
-
+
//printf("v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code, state->bias, state->error_sum, state->drift, state->count, k);
set_sr_golomb(pb, code, k, 12, bits);
#endif
ret= fold(v + state->bias, bits);
-
+
update_vlc_state(state, v);
//printf("final: %d\n", ret);
return ret;
for(x=0; x<w; x++){
int diff, context;
-
+
context= get_context(s, sample[0]+x, sample[1]+x, sample[2]+x);
diff= sample[0][x] - predict(sample[0]+x, sample[1]+x);
}
diff= fold(diff, bits);
-
+
if(s->ac){
put_symbol(c, p->state[context], diff, 1);
}else{
if(context == 0) run_mode=1;
-
+
if(run_mode){
if(diff){
run_index++;
put_bits(&s->pb, 1, 1);
}
-
+
put_bits(&s->pb, 1 + log2_run[run_index], run_count);
if(run_index) run_index--;
run_count=0;
run_count++;
}
}
-
+
// printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, (int)put_bits_count(&s->pb));
if(run_mode == 0)
put_bits(&s->pb, 1, 1);
}
s->run_index= run_index;
-
+
return 0;
}
const int ring_size= s->avctx->context_model ? 3 : 2;
int_fast16_t sample_buffer[ring_size][w+6], *sample[ring_size];
s->run_index=0;
-
+
memset(sample_buffer, 0, sizeof(sample_buffer));
-
+
for(y=0; y<h; y++){
for(i=0; i<ring_size; i++)
sample[i]= sample_buffer[(h+i-y)%ring_size]+3;
-
+
sample[0][-1]= sample[1][0 ];
sample[1][ w]= sample[1][w-1];
//{START_TIMER
const int ring_size= s->avctx->context_model ? 3 : 2;
int_fast16_t sample_buffer[3][ring_size][w+6], *sample[3][ring_size];
s->run_index=0;
-
+
memset(sample_buffer, 0, sizeof(sample_buffer));
-
+
for(y=0; y<h; y++){
for(i=0; i<ring_size; i++)
for(p=0; p<3; p++)
int b= v&0xFF;
int g= (v>>8)&0xFF;
int r= (v>>16)&0xFF;
-
+
b -= g;
r -= g;
g += (b + r)>>2;
b += 0x100;
r += 0x100;
-
+
// assert(g>=0 && b>=0 && r>=0);
// assert(g<256 && b<512 && r<512);
sample[0][0][x]= g;
RangeCoder * const c= &f->c;
memset(state, 128, sizeof(state));
-
+
put_symbol(c, state, f->version, 0);
put_symbol(c, state, f->avctx->coder_type, 0);
- put_symbol(c, state, f->colorspace, 0); //YUV cs type
+ put_symbol(c, state, f->colorspace, 0); //YUV cs type
put_rac(c, state, 1); //chroma planes
put_symbol(c, state, f->chroma_h_shift, 0);
put_symbol(c, state, f->chroma_v_shift, 0);
s->avctx= avctx;
s->flags= avctx->flags;
-
+
dsputil_init(&s->dsp, avctx);
-
+
width= s->width= avctx->width;
height= s->height= avctx->height;
-
+
assert(width && height);
return 0;
"use vstrict=-2 / -strict -2 to use it anyway\n");
return -1;
}
-
+
common_init(avctx);
-
+
s->version=0;
s->ac= avctx->coder_type;
-
+
s->plane_count=2;
for(i=0; i<256; i++){
s->quant_table[0][i]= quant11[i];
for(i=0; i<s->plane_count; i++){
PlaneContext * const p= &s->plane[i];
-
+
if(avctx->context_model==0){
p->context_count= (11*11*11+1)/2;
- }else{
+ }else{
p->context_count= (11*11*5*5*5+1)/2;
}
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
s->picture_number=0;
-
+
return 0;
}
p->interlace_bit_state[0]= 128;
p->interlace_bit_state[1]= 128;
-
+
for(j=0; j<p->context_count; j++){
if(f->ac){
memset(p->state[j], 128, sizeof(uint8_t)*CONTEXT_SIZE);
*p = *pict;
p->pict_type= FF_I_TYPE;
-
+
if(avctx->gop_size==0 || f->picture_number % avctx->gop_size == 0){
put_rac(c, &keystate, 1);
p->key_frame= 1;
//printf("pos=%d\n", used_count);
init_put_bits(&f->pb, buf + used_count, buf_size - used_count);
}
-
+
if(f->colorspace==0){
const int chroma_width = -((-width )>>f->chroma_h_shift);
const int chroma_height= -((-height)>>f->chroma_v_shift);
encode_rgb_frame(f, (uint32_t*)(p->data[0]), width, height, p->linesize[0]/4);
}
emms_c();
-
+
f->picture_number++;
if(f->ac){
}
static void common_end(FFV1Context *s){
- int i;
+ int i;
for(i=0; i<s->plane_count; i++){
PlaneContext *p= &s->plane[i];
for(x=0; x<w; x++){
int diff, context, sign;
-
+
context= get_context(s, sample[1] + x, sample[0] + x, sample[1] + x);
if(context < 0){
context= -context;
sign=1;
}else
sign=0;
-
+
if(s->ac){
diff= get_symbol(c, p->state[context], 1);
}else{
if(context == 0 && run_mode==0) run_mode=1;
-
+
if(run_mode){
if(run_count==0 && run_mode==1){
if(get_bits1(&s->gb)){
diff=0;
}else
diff= get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);
-
+
// printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, get_bits_count(&s->gb));
}
sample[1][x]= (predict(sample[1] + x, sample[0] + x) + diff) & ((1<<bits)-1);
}
- s->run_index= run_index;
+ s->run_index= run_index;
}
static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
int_fast16_t *sample[2]= {sample_buffer[0]+3, sample_buffer[1]+3};
s->run_index=0;
-
+
memset(sample_buffer, 0, sizeof(sample_buffer));
-
+
for(y=0; y<h; y++){
int_fast16_t *temp= sample[0]; //FIXME try a normal buffer
sample[1][-1]= sample[0][0 ];
sample[0][ w]= sample[0][w-1];
-
+
//{START_TIMER
decode_line(s, w, sample, plane_index, 8);
for(x=0; x<w; x++){
{sample_buffer[2][0]+3, sample_buffer[2][1]+3}};
s->run_index=0;
-
+
memset(sample_buffer, 0, sizeof(sample_buffer));
-
+
for(y=0; y<h; y++){
for(p=0; p<3; p++){
int_fast16_t *temp= sample[p][0]; //FIXME try a normal buffer
// assert(g>=0 && b>=0 && r>=0);
// assert(g<256 && b<512 && r<512);
-
+
b -= 0x100;
r -= 0x100;
g -= (b + r)>>2;
b += g;
r += g;
-
+
src[x + stride*y]= b + (g<<8) + (r<<16);
}
}
int len= get_symbol(c, state, 0) + 1;
if(len + i > 128) return -1;
-
+
while(len--){
quant_table[i] = scale*v;
i++;
quant_table[256-i]= -quant_table[i];
}
quant_table[128]= -quant_table[127];
-
+
return 2*v - 1;
}
uint8_t state[CONTEXT_SIZE];
int i, context_count;
RangeCoder * const c= &f->c;
-
+
memset(state, 128, sizeof(state));
f->version= get_symbol(c, state, 0);
}
}
context_count= (context_count+1)/2;
-
+
for(i=0; i<f->plane_count; i++){
PlaneContext * const p= &f->plane[i];
if(!p->vlc_state) p->vlc_state= av_malloc(p->context_count*sizeof(VlcState));
}
}
-
+
return 0;
}
// FFV1Context *s = avctx->priv_data;
common_init(avctx);
-
+
return 0;
}
if(avctx->debug&FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_ERROR, "keyframe:%d coder:%d\n", p->key_frame, f->ac);
-
+
if(!f->ac){
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
} else {
bytes_read = 0; /* avoid warning */
}
-
+
if(f->colorspace==0){
const int chroma_width = -((-width )>>f->chroma_h_shift);
const int chroma_height= -((-height)>>f->chroma_v_shift);
decode_plane(f, p->data[0], width, height, p->linesize[0], 0);
-
+
decode_plane(f, p->data[1], chroma_width, chroma_height, p->linesize[1], 1);
decode_plane(f, p->data[2], chroma_width, chroma_height, p->linesize[2], 1);
}else{
decode_rgb_frame(f, (uint32_t*)p->data[0], width, height, p->linesize[0]/4);
}
-
+
emms_c();
f->picture_number++;
*picture= *p;
-
+
avctx->release_buffer(avctx, p); //FIXME
*data_size = sizeof(AVFrame);
-
+
if(f->ac){
bytes_read= c->bytestream - c->bytestream_start - 1;
if(bytes_read ==0) av_log(f->avctx, AV_LOG_ERROR, "error at end of frame\n");
* 34-byte streaminfo structure through avctx->extradata[_size] followed
* by data starting with the 0xFFF8 marker.
*/
-
+
#include <limits.h>
-
+
#include "avcodec.h"
#include "bitstream.h"
#include "golomb.h"
static int sample_rate_table[] =
{ 0, 0, 0, 0,
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
- 0, 0, 0, 0 };
+ 0, 0, 0, 0 };
-static int sample_size_table[] =
+static int sample_size_table[] =
{ 0, 8, 12, 0, 16, 20, 24, 0 };
static int blocksize_table[] = {
- 0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
-256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
+ 0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
+256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
};
static const uint8_t table_crc8[256] = {
{
uint64_t val;
int ones=0, bytes;
-
+
while(get_bits1(gb))
ones++;
if (ones==0) bytes=0;
else if(ones==1) return -1;
else bytes= ones - 1;
-
+
val= get_bits(gb, 7-ones);
while(bytes--){
const int tmp = get_bits(gb, 8);
-
+
if((tmp>>6) != 2)
return -1;
val<<=6;
static int skip_utf8(GetBitContext *gb)
{
int ones=0, bytes;
-
+
while(get_bits1(gb))
ones++;
if (ones==0) bytes=0;
else if(ones==1) return -1;
else bytes= ones - 1;
-
+
skip_bits(gb, 7-ones);
while(bytes--){
const int tmp = get_bits(gb, 8);
-
+
if((tmp>>6) != 2)
return -1;
}
static int get_crc8(const uint8_t *buf, int count){
int crc=0;
int i;
-
+
for(i=0; i<count; i++){
crc = table_crc8[crc ^ buf[i]];
}
s->min_framesize = get_bits_long(&s->gb, 24);
s->max_framesize = get_bits_long(&s->gb, 24);
-
+
s->samplerate = get_bits_long(&s->gb, 20);
s->channels = get_bits(&s->gb, 3) + 1;
s->bps = get_bits(&s->gb, 5) + 1;
-
+
s->avctx->channels = s->channels;
s->avctx->sample_rate = s->samplerate;
skip_bits(&s->gb, 36); /* total num of samples */
-
+
skip_bits(&s->gb, 64); /* md5 sum */
skip_bits(&s->gb, 64); /* md5 sum */
-
+
allocate_buffers(s);
}
av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);
return -1;
}
-
+
rice_order = get_bits(&s->gb, 4);
samples= s->blocksize >> rice_order;
- sample=
+ sample=
i= pred_order;
for (partition = 0; partition < (1 << rice_order); partition++)
{
// av_log(s->avctx, AV_LOG_DEBUG, "partitions: %d, samples: %d\n", 1 << rice_order, sample);
return 0;
-}
+}
static int decode_subframe_fixed(FLACContext *s, int channel, int pred_order)
{
int i;
-
+
// av_log(s->avctx, AV_LOG_DEBUG, " SUBFRAME FIXED\n");
-
+
/* warm up samples */
// av_log(s->avctx, AV_LOG_DEBUG, " warm up samples: %d\n", pred_order);
-
+
for (i = 0; i < pred_order; i++)
{
s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps);
// av_log(s->avctx, AV_LOG_DEBUG, " %d: %d\n", i, s->decoded[channel][i]);
}
-
+
if (decode_residuals(s, channel, pred_order) < 0)
return -1;
break;
case 3:
for (i = pred_order; i < s->blocksize; i++)
- s->decoded[channel][i] += 3*s->decoded[channel][i-1]
+ s->decoded[channel][i] += 3*s->decoded[channel][i-1]
- 3*s->decoded[channel][i-2]
+ s->decoded[channel][i-3];
break;
case 4:
for (i = pred_order; i < s->blocksize; i++)
- s->decoded[channel][i] += 4*s->decoded[channel][i-1]
+ s->decoded[channel][i] += 4*s->decoded[channel][i-1]
- 6*s->decoded[channel][i-2]
+ 4*s->decoded[channel][i-3]
- s->decoded[channel][i-4];
int sum, i, j;
int coeff_prec, qlevel;
int coeffs[pred_order];
-
+
// av_log(s->avctx, AV_LOG_DEBUG, " SUBFRAME LPC\n");
-
+
/* warm up samples */
// av_log(s->avctx, AV_LOG_DEBUG, " warm up samples: %d\n", pred_order);
-
+
for (i = 0; i < pred_order; i++)
{
s->decoded[channel][i] = get_sbits(&s->gb, s->curr_bps);
// av_log(s->avctx, AV_LOG_DEBUG, " %d: %d\n", i, s->decoded[channel][i]);
}
-
+
coeff_prec = get_bits(&s->gb, 4) + 1;
if (coeff_prec == 16)
{
coeffs[i] = get_sbits(&s->gb, coeff_prec);
// av_log(s->avctx, AV_LOG_DEBUG, " %d: %d\n", i, coeffs[i]);
}
-
+
if (decode_residuals(s, channel, pred_order) < 0)
return -1;
sum += coeffs[j] * s->decoded[channel][i-j-1];
s->decoded[channel][i] += sum >> qlevel;
}
-
+
return 0;
}
{
int type, wasted = 0;
int i, tmp;
-
+
s->curr_bps = s->bps;
if(channel == 0){
if(s->decorrelation == RIGHT_SIDE)
}
type = get_bits(&s->gb, 6);
// wasted = get_bits1(&s->gb);
-
+
// if (wasted)
// {
// while (!get_bits1(&s->gb))
av_log(s->avctx, AV_LOG_ERROR, "invalid coding type\n");
return -1;
}
-
+
if (wasted)
{
int i;
{
int blocksize_code, sample_rate_code, sample_size_code, assignment, i, crc8;
int decorrelation, bps, blocksize, samplerate;
-
+
blocksize_code = get_bits(&s->gb, 4);
sample_rate_code = get_bits(&s->gb, 4);
-
+
assignment = get_bits(&s->gb, 4); /* channel assignment */
if (assignment < 8 && s->channels == assignment+1)
decorrelation = INDEPENDENT;
av_log(s->avctx, AV_LOG_ERROR, "unsupported channel assignment %d (channels=%d)\n", assignment, s->channels);
return -1;
}
-
+
sample_size_code = get_bits(&s->gb, 3);
if(sample_size_code == 0)
bps= s->bps;
else if((sample_size_code != 3) && (sample_size_code != 7))
bps = sample_size_table[sample_size_code];
- else
+ else
{
av_log(s->avctx, AV_LOG_ERROR, "invalid sample size code (%d)\n", sample_size_code);
return -1;
av_log(s->avctx, AV_LOG_ERROR, "broken stream, invalid padding\n");
return -1;
}
-
+
if(get_utf8(&s->gb) < 0){
av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n");
return -1;
}
-#if 0
+#if 0
if (/*((blocksize_code == 6) || (blocksize_code == 7)) &&*/
(s->min_blocksize != s->max_blocksize)){
}else{
}
#endif
-
+
if (blocksize_code == 0)
blocksize = s->min_blocksize;
else if (blocksize_code == 6)
blocksize = get_bits(&s->gb, 8)+1;
else if (blocksize_code == 7)
blocksize = get_bits(&s->gb, 16)+1;
- else
+ else
blocksize = blocksize_table[blocksize_code];
if(blocksize > s->max_blocksize){
av_log(s->avctx, AV_LOG_ERROR, "header crc mismatch crc=%2X\n", crc8);
return -1;
}
-
+
s->blocksize = blocksize;
s->samplerate = samplerate;
s->bps = bps;
if (decode_subframe(s, i) < 0)
return -1;
}
-
+
align_get_bits(&s->gb);
/* frame footer */
buf= &s->bitstream[s->bitstream_index];
buf_size += s->bitstream_size;
s->bitstream_size= buf_size;
-
+
if(buf_size < s->max_framesize){
// printf("wanna more data ...\n");
return input_buf_size;
}
init_get_bits(&s->gb, buf, buf_size*8);
-
+
/* fLaC signature (be) */
if (show_bits_long(&s->gb, 32) == bswap_32(ff_get_fourcc("fLaC")))
{
metadata_last = get_bits(&s->gb, 1);
metadata_type = get_bits(&s->gb, 7);
metadata_size = get_bits_long(&s->gb, 24);
-
+
av_log(s->avctx, AV_LOG_DEBUG, " metadata block: flag = %d, type = %d, size = %d\n",
metadata_last, metadata_type,
metadata_size);
init_get_bits(&s->gb, buf, buf_size*8);
skip_bits(&s->gb, bits_count);
}
-
+
dump_headers(s);
break;}
default:
}
else
{
-
+
tmp = show_bits(&s->gb, 16);
if(tmp != 0xFFF8){
av_log(s->avctx, AV_LOG_ERROR, "FRAME HEADER not here\n");
}
}
-
+
#if 0
/* fix the channel order here */
if (s->order == MID_SIDE)
*(samples++) = mid + side;
*(samples++) = mid;
#else
-
+
mid <<= 1;
if (side & 1)
mid++;
s->bitstream_index += i;
s->bitstream_size -= i;
return input_buf_size;
- }else
+ }else
return i;
}
{
FLACContext *s = avctx->priv_data;
int i;
-
+
for (i = 0; i < s->channels; i++)
{
av_freep(&s->decoded[i]);
}
av_freep(&s->bitstream);
-
+
return 0;
}
NULL,
flac_decode_close,
flac_decode_frame,
- .flush= flac_flush,
+ .flush= flac_flush,
};
s->fli_type = LE_16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
depth = LE_16(&fli_header[12]);
-
+
if (depth == 0) {
depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
}
default :
av_log(avctx, AV_LOG_ERROR, "Unkown FLC/FLX depth of %d Bpp is unsupported.\n",depth);
return -1;
- }
+ }
s->frame.data[0] = NULL;
s->new_palette = 0;
int pixel_countdown;
unsigned char *pixels;
int pixel_limit;
-
+
s->frame.reference = 1;
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
if (avctx->reget_buffer(avctx, &s->frame) < 0) {
stream_ptr_after_color_chunk = stream_ptr + chunk_size - 6;
s->new_palette = 1;
- /* check special case: If this file is from the Magic Carpet
- * game and uses 6-bit colors even though it reports 256-color
+ /* check special case: If this file is from the Magic Carpet
+ * game and uses 6-bit colors even though it reports 256-color
* chunks in a 0xAF12-type file (fli_type is set to 0xAF13 during
* initialization) */
if ((chunk_type == FLI_256_COLOR) && (s->fli_type != FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE))
* pixels on a row */
stream_ptr++;
pixel_countdown = (s->avctx->width * 2);
-
+
while (pixel_countdown > 0) {
byte_run = buf[stream_ptr++];
if (byte_run > 0) {
/* Now FLX is strange, in that it is "byte" as opposed to "pixel" run length compressed.
* This doesnt give us any good oportunity to perform word endian conversion
- * during decompression. So if its requried (ie, this isnt a LE target, we do
+ * during decompression. So if its requried (ie, this isnt a LE target, we do
* a second pass over the line here, swapping the bytes.
*/
- pixel = 0xFF00;
+ pixel = 0xFF00;
if (0xFF00 != LE_16(&pixel)) /* Check if its not an LE Target */
{
pixel_ptr = y_ptr;
*((signed short*)(&pixels[pixel_ptr])) = LE_16(&buf[pixel_ptr]);
pixel_ptr += 2;
}
- }
+ }
y_ptr += s->frame.linesize[0];
}
break;
* pixels on a row */
stream_ptr++;
pixel_countdown = s->avctx->width; /* Width is in pixels, not bytes */
-
+
while (pixel_countdown > 0) {
byte_run = buf[stream_ptr++];
if (byte_run > 0) {
CHECK_PIXEL_PTR(byte_run);
for (j = 0; j < byte_run; j++) {
*((signed short*)(&pixels[pixel_ptr])) = pixel;
- pixel_ptr += 2;
+ pixel_ptr += 2;
pixel_countdown--;
if (pixel_countdown < 0)
av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d)\n",
"bigger than image, skipping chunk\n", chunk_size - 6);
stream_ptr += chunk_size - 6;
} else {
-
+
for (y_ptr = 0; y_ptr < s->frame.linesize[0] * s->avctx->height;
y_ptr += s->frame.linesize[0]) {
*((signed short*)(&pixels[y_ptr + pixel_ptr])) = LE_16(&buf[stream_ptr+pixel_ptr]);
pixel_ptr += 2;
pixel_countdown--;
- }
+ }
stream_ptr += s->avctx->width*2;
}
}
(avctx->pix_fmt == PIX_FMT_RGB565)) {
return flic_decode_frame_15_16BPP(avctx, data, data_size,
buf, buf_size);
- }
+ }
else if (avctx->pix_fmt == PIX_FMT_BGR24) {
return flic_decode_frame_24BPP(avctx, data, data_size,
buf, buf_size);
/* Shouldnt get here, ever as the pix_fmt is processed */
/* in flic_decode_init and the above if should deal with */
/* the finite set of possibilites allowable by here. */
- /* but in case we do, just error out. */
+ /* but in case we do, just error out. */
av_log(avctx, AV_LOG_ERROR, "Unknown Format of FLC. My Science cant explain how this happened\n");
return -1;
-}
+}
static int flic_decode_end(AVCodecContext *avctx)
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file fraps.c
* Lossless Fraps 'FPS1' decoder
* @author Roine Gustafsson <roine at users sf net>
- *
+ *
* Only decodes version 0 and 1 files.
* Codec algorithm for version 0 is taken from Transcode <www.transcoding.org>
*
* Version 2 files, which are the most commonly found Fraps files, cannot be
* decoded yet.
*/
-
+
#include "avcodec.h"
#define FPS_TAG MKTAG('F', 'P', 'S', 'x')
avctx->pix_fmt= PIX_FMT_NONE; /* set in decode_frame */
s->avctx = avctx;
- s->frame.data[0] = NULL;
+ s->frame.data[0] = NULL;
return 0;
}
* @param buf_size size of input data frame
* @return number of consumed bytes on success or negative if decode fails
*/
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
header_size = (header & (1<<30))? 8 : 4; /* bit 30 means pad to 8 bytes */
if (version > 1) {
- av_log(avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"This file is encoded with Fraps version %d. " \
"This codec can only decode version 0 and 1.\n", version);
return -1;
buf+=4;
if (header_size == 8)
buf+=4;
-
+
switch(version) {
case 0:
default:
/* Fraps v0 is a reordered YUV420 */
avctx->pix_fmt = PIX_FMT_YUV420P;
- if ( (buf_size != avctx->width*avctx->height*3/2+header_size) &&
+ if ( (buf_size != avctx->width*avctx->height*3/2+header_size) &&
(buf_size != header_size) ) {
av_log(avctx, AV_LOG_ERROR,
- "Invalid frame length %d (should be %d)\n",
+ "Invalid frame length %d (should be %d)\n",
buf_size, avctx->width*avctx->height*3/2+header_size);
return -1;
}
-
+
if (( (avctx->width % 8) != 0) || ( (avctx->height % 2) != 0 )) {
- av_log(avctx, AV_LOG_ERROR, "Invalid frame size %dx%d\n",
+ av_log(avctx, AV_LOG_ERROR, "Invalid frame size %dx%d\n",
avctx->width, avctx->height);
return -1;
}
- f->reference = 1;
- f->buffer_hints = FF_BUFFER_HINTS_VALID |
- FF_BUFFER_HINTS_PRESERVE |
+ f->reference = 1;
+ f->buffer_hints = FF_BUFFER_HINTS_VALID |
+ FF_BUFFER_HINTS_PRESERVE |
FF_BUFFER_HINTS_REUSABLE;
if (avctx->reget_buffer(avctx, f)) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return -1;
- }
+ }
/* bit 31 means same as previous pic */
- f->pict_type = (header & (1<<31))? FF_P_TYPE : FF_I_TYPE;
+ f->pict_type = (header & (1<<31))? FF_P_TYPE : FF_I_TYPE;
f->key_frame = f->pict_type == FF_I_TYPE;
- if (f->pict_type == FF_I_TYPE) {
+ if (f->pict_type == FF_I_TYPE) {
buf32=(uint32_t*)buf;
for(y=0; y<avctx->height/2; y++){
luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ];
/* Fraps v1 is an upside-down BGR24 */
avctx->pix_fmt = PIX_FMT_BGR24;
- if ( (buf_size != avctx->width*avctx->height*3+header_size) &&
+ if ( (buf_size != avctx->width*avctx->height*3+header_size) &&
(buf_size != header_size) ) {
- av_log(avctx, AV_LOG_ERROR,
+ av_log(avctx, AV_LOG_ERROR,
"Invalid frame length %d (should be %d)\n",
buf_size, avctx->width*avctx->height*3+header_size);
return -1;
/*
- * G.726 ADPCM audio codec
+ * G.726 ADPCM audio codec
* Copyright (c) 2004 Roman Shaposhnik.
*
* This is a very straightforward rendition of the G.726
- * Section 4 "Computational Details".
+ * Section 4 "Computational Details".
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
/**
* G.726 11bit float.
- * G.726 Standard uses rather odd 11bit floating point arithmentic for
+ * G.726 Standard uses rather odd 11bit floating point arithmentic for
* numerous occasions. It's a mistery to me why they did it this way
* instead of simply using 32bit integer arithmetic.
*/
if (f->sign)
i = -i;
f->exp = av_log2_16bit(i) + !!i;
- f->mant = i? (i<<6) >> f->exp :
+ f->mant = i? (i<<6) >> f->exp :
1<<5;
return f;
}
typedef struct G726Context {
G726Tables* tbls; /**< static tables needed for computation */
-
+
Float11 sr[2]; /**< prev. reconstructed samples */
Float11 dq[6]; /**< prev. difference */
int a[2]; /**< second order predictor coeffs */
int b[6]; /**< sixth order predictor coeffs */
int pk[2]; /**< signs of prev. 2 sez + dq */
-
+
int ap; /**< scale factor control */
int yu; /**< fast scale factor */
int yl; /**< slow scale factor */
} G726Context;
static int quant_tbl16[] = /**< 16kbit/s 2bits per sample */
- { 260, INT_MAX };
+ { 260, INT_MAX };
static int iquant_tbl16[] =
{ 116, 365, 365, 116 };
-static int W_tbl16[] =
+static int W_tbl16[] =
{ -22, 439, 439, -22 };
static int F_tbl16[] =
{ 0, 7, 7, 0 };
-
+
static int quant_tbl24[] = /**< 24kbit/s 3bits per sample */
{ 7, 217, 330, INT_MAX };
static int iquant_tbl24[] =
{ INT_MIN, 135, 273, 373, 373, 273, 135, INT_MIN };
-static int W_tbl24[] =
- { -4, 30, 137, 582, 582, 137, 30, -4 };
+static int W_tbl24[] =
+ { -4, 30, 137, 582, 582, 137, 30, -4 };
static int F_tbl24[] =
{ 0, 1, 2, 7, 7, 2, 1, 0 };
-
+
static int quant_tbl32[] = /**< 32kbit/s 4bits per sample */
{ -125, 79, 177, 245, 299, 348, 399, INT_MAX };
static int iquant_tbl32[] =
- { INT_MIN, 4, 135, 213, 273, 323, 373, 425,
+ { INT_MIN, 4, 135, 213, 273, 323, 373, 425,
425, 373, 323, 273, 213, 135, 4, INT_MIN };
-static int W_tbl32[] =
+static int W_tbl32[] =
{ -12, 18, 41, 64, 112, 198, 355, 1122,
1122, 355, 198, 112, 64, 41, 18, -12};
-static int F_tbl32[] =
+static int F_tbl32[] =
{ 0, 0, 0, 1, 1, 1, 3, 7, 7, 3, 1, 1, 1, 0, 0, 0 };
-
+
static int quant_tbl40[] = /**< 40kbit/s 5bits per sample */
{ -122, -16, 67, 138, 197, 249, 297, 338,
377, 412, 444, 474, 501, 527, 552, INT_MAX };
static int iquant_tbl40[] =
- { INT_MIN, -66, 28, 104, 169, 224, 274, 318,
+ { INT_MIN, -66, 28, 104, 169, 224, 274, 318,
358, 395, 429, 459, 488, 514, 539, 566,
566, 539, 514, 488, 459, 429, 395, 358,
318, 274, 224, 169, 104, 28, -66, INT_MIN };
-static int W_tbl40[] =
+static int W_tbl40[] =
{ 14, 14, 24, 39, 40, 41, 58, 100,
- 141, 179, 219, 280, 358, 440, 529, 696,
+ 141, 179, 219, 280, 358, 440, 529, 696,
696, 529, 440, 358, 280, 219, 179, 141,
100, 58, 41, 40, 39, 24, 14, 14 };
-static int F_tbl40[] =
+static int F_tbl40[] =
{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 6,
6, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
-static G726Tables G726Tables_pool[] =
+static G726Tables G726Tables_pool[] =
{{ 2, quant_tbl16, iquant_tbl16, W_tbl16, F_tbl16 },
{ 3, quant_tbl24, iquant_tbl24, W_tbl24, F_tbl24 },
{ 4, quant_tbl32, iquant_tbl32, W_tbl32, F_tbl32 },
{ 5, quant_tbl40, iquant_tbl40, W_tbl40, F_tbl40 }};
-
+
/**
- * Para 4.2.2 page 18: Adaptive quantizer.
+ * Para 4.2.2 page 18: Adaptive quantizer.
*/
static inline uint8_t quant(G726Context* c, int d)
{
int sign, exp, i, dln;
-
+
sign = i = 0;
if (d < 0) {
sign = 1;
}
exp = av_log2_16bit(d);
dln = ((exp<<7) + (((d<<7)>>exp)&0x7f)) - (c->y>>2);
-
+
while (c->tbls->quant[i] < INT_MAX && c->tbls->quant[i] < dln)
++i;
-
+
if (sign)
i = ~i;
if (c->tbls->bits != 2 && i == 0) /* I'm not sure this is a good idea */
i = 0xff;
- return i;
+ return i;
}
/**
static inline int16_t inverse_quant(G726Context* c, int i)
{
int dql, dex, dqt;
-
+
dql = c->tbls->iquant[i] + (c->y >> 2);
dex = (dql>>7) & 0xf; /* 4bit exponent */
dqt = (1<<7) + (dql & 0x7f); /* log2 -> linear */
- return (dql < 0) ? 0 : ((dqt<<7) >> (14-dex));
+ return (dql < 0) ? 0 : ((dqt<<7) >> (14-dex));
}
static inline int16_t g726_iterate(G726Context* c, int16_t I)
{
int dq, re_signal, pk0, fa1, i, tr, ylint, ylfrac, thr2, al, dq0;
Float11 f;
-
+
dq = inverse_quant(c, I);
if (I >> (c->tbls->bits - 1)) /* get the sign */
dq = -dq;
tr = 1;
else
tr = 0;
-
+
/* Update second order predictor coefficient A2 and A1 */
pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;
dq0 = dq ? sgn(dq) : 0;
} else {
/* This is a bit crazy, but it really is +255 not +256 */
fa1 = clip((-c->a[0]*c->pk[0]*pk0)>>5, -256, 255);
-
+
c->a[1] += 128*pk0*c->pk[1] + fa1 - (c->a[1]>>7);
c->a[1] = clip(c->a[1], -12288, 12288);
c->a[0] += 64*3*pk0*c->pk[0] - (c->a[0] >> 8);
c->dq[i] = c->dq[i-1];
i2f(dq, &c->dq[0]);
c->dq[0].sign = I >> (c->tbls->bits - 1); /* Isn't it crazy ?!?! */
-
+
/* Update tone detect [I'm not sure 'tr == 0' is really needed] */
- c->td = (tr == 0 && c->a[1] < -11776);
-
+ c->td = (tr == 0 && c->a[1] < -11776);
+
/* Update Ap */
c->dms += ((c->tbls->F[I]<<9) - c->dms) >> 5;
c->dml += ((c->tbls->F[I]<<11) - c->dml) >> 7;
- if (tr)
+ if (tr)
c->ap = 256;
else if (c->y > 1535 && !c->td && (abs((c->dms << 2) - c->dml) < (c->dml >> 3)))
c->ap += (-c->ap) >> 4;
else
- c->ap += (0x200 - c->ap) >> 4;
+ c->ap += (0x200 - c->ap) >> 4;
/* Update Yu and Yl */
c->yu = clip(c->y + (((c->tbls->W[I] << 5) - c->y) >> 5), 544, 5120);
c->yl += c->yu + ((-c->yl)>>6);
-
+
/* Next iteration for Y */
al = (c->ap >= 256) ? 1<<6 : c->ap >> 2;
c->y = (c->yl + (c->yu - (c->yl>>6))*al) >> 6;
-
+
/* Next iteration for SE and SEZ */
c->se = 0;
for (i=0; i<6; i++)
static int16_t g726_encode(G726Context* c, int16_t sig)
{
uint8_t i;
-
+
i = quant(c, sig/4 - c->se) & ((1<<c->tbls->bits) - 1);
g726_iterate(c, i);
return i;
static int g726_init(AVCodecContext * avctx)
{
AVG726Context* c = (AVG726Context*)avctx->priv_data;
-
+
if (avctx->channels != 1 ||
(avctx->bit_rate != 16000 && avctx->bit_rate != 24000 &&
avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {
flush_put_bits(&pb);
- return put_bits_count(&pb)>>3;
-}
+ return put_bits_count(&pb)>>3;
+}
static int g726_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
short *samples = data;
uint8_t code;
uint8_t mask;
- GetBitContext gb;
-
+ GetBitContext gb;
+
if (!buf_size)
goto out;
-
+
mask = (1<<c->code_size) - 1;
init_get_bits(&gb, buf, buf_size * 8);
if (c->bits_left) {
code = (c->bit_buffer << s) | get_bits(&gb, s);
*samples++ = g726_decode(&c->c, code & mask);
}
-
+
while (get_bits_count(&gb) + c->code_size <= buf_size*8)
*samples++ = g726_decode(&c->c, get_bits(&gb, c->code_size) & mask);
-
+
c->bits_left = buf_size*8 - get_bits_count(&gb);
c->bit_buffer = get_bits(&gb, c->bits_left);
-
+
out:
*data_size = (uint8_t*)samples - (uint8_t*)data;
return buf_size;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file golomb.c
- * @brief
+ * @brief
* exp golomb vlc stuff
* @author Michael Niedermayer <michaelni@gmx.at>
*/
#include "common.h"
-
+
const uint8_t ff_golomb_vlc_len[512]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
};
-const uint8_t ff_ue_golomb_vlc_code[512]={
+const uint8_t ff_ue_golomb_vlc_code[512]={
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-const int8_t ff_se_golomb_vlc_code[512]={
+const int8_t ff_se_golomb_vlc_code[512]={
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, -8, 9, -9, 10,-10, 11,-11, 12,-12, 13,-13, 14,-14, 15,-15,
4, 4, 4, 4, -4, -4, -4, -4, 5, 5, 5, 5, -5, -5, -5, -5, 6, 6, 6, 6, -6, -6, -6, -6, 7, 7, 7, 7, -7, -7, -7, -7,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
};
-const uint8_t ff_ue_golomb_len[256]={
+const uint8_t ff_ue_golomb_len[256]={
1, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,11,
11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,
13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
};
-const uint8_t ff_interleaved_ue_golomb_vlc_code[256]={
+const uint8_t ff_interleaved_ue_golomb_vlc_code[256]={
15,16,7, 7, 17,18,8, 8, 3, 3, 3, 3, 3, 3, 3, 3,
- 19,20,9, 9, 21,22,10,10,4, 4, 4, 4, 4, 4, 4, 4,
+ 19,20,9, 9, 21,22,10,10,4, 4, 4, 4, 4, 4, 4, 4,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 23,24,11,11,25,26,12,12,5, 5, 5, 5, 5, 5, 5, 5,
+ 23,24,11,11,25,26,12,12,5, 5, 5, 5, 5, 5, 5, 5,
27,28,13,13,29,30,14,14,6, 6, 6, 6, 6, 6, 6, 6,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
-const int8_t ff_interleaved_se_golomb_vlc_code[256]={
+const int8_t ff_interleaved_se_golomb_vlc_code[256]={
8, -8, 4, 4, 9, -9, -4, -4, 2, 2, 2, 2, 2, 2, 2, 2,
10,-10, 5, 5, 11,-11, -5, -5, -2, -2, -2, -2, -2, -2, -2, -2,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file golomb.h
- * @brief
+ * @brief
* exp golomb vlc stuff
* @author Michael Niedermayer <michaelni@gmx.at> and Alex Beregszaszi
*/
extern const uint8_t ff_interleaved_ue_golomb_vlc_code[256];
extern const int8_t ff_interleaved_se_golomb_vlc_code[256];
-
+
/**
* read unsigned exp golomb code.
*/
static inline int get_ue_golomb(GetBitContext *gb){
unsigned int buf;
int log;
-
+
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
buf=GET_CACHE(re, gb);
-
+
if(buf >= (1<<27)){
buf >>= 32 - 9;
LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
CLOSE_READER(re, gb);
-
+
return ff_ue_golomb_vlc_code[buf];
}else{
log= 2*av_log2(buf) - 31;
buf--;
LAST_SKIP_BITS(re, gb, 32 - log);
CLOSE_READER(re, gb);
-
+
return buf;
}
}
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
buf=GET_CACHE(re, gb);
-
+
if(buf&0xAA800000){
buf >>= 32 - 8;
LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
CLOSE_READER(re, gb);
-
+
return ff_interleaved_ue_golomb_vlc_code[buf];
}else{
LAST_SKIP_BITS(re, gb, 8);
*/
static inline int get_te0_golomb(GetBitContext *gb, int range){
assert(range >= 1);
-
+
if(range==1) return 0;
else if(range==2) return get_bits1(gb)^1;
else return get_ue_golomb(gb);
*/
static inline int get_te_golomb(GetBitContext *gb, int range){
assert(range >= 1);
-
+
if(range==2) return get_bits1(gb)^1;
else return get_ue_golomb(gb);
}
static inline int get_se_golomb(GetBitContext *gb){
unsigned int buf;
int log;
-
+
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
buf=GET_CACHE(re, gb);
-
+
if(buf >= (1<<27)){
buf >>= 32 - 9;
LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
CLOSE_READER(re, gb);
-
+
return ff_se_golomb_vlc_code[buf];
}else{
log= 2*av_log2(buf) - 31;
buf>>= log;
-
+
LAST_SKIP_BITS(re, gb, 32 - log);
CLOSE_READER(re, gb);
-
+
if(buf&1) buf= -(buf>>1);
else buf= (buf>>1);
buf >>= 32 - 8;
LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
CLOSE_READER(re, gb);
-
+
return ff_interleaved_se_golomb_vlc_code[buf];
}else{
LAST_SKIP_BITS(re, gb, 8);
static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, int esc_len){
unsigned int buf;
int log;
-
+
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
buf=GET_CACHE(re, gb);
buf += (30-log)<<k;
LAST_SKIP_BITS(re, gb, 32 + k - log);
CLOSE_READER(re, gb);
-
+
return buf;
}else{
buf >>= 32 - limit - esc_len;
LAST_SKIP_BITS(re, gb, esc_len + limit);
CLOSE_READER(re, gb);
-
+
return buf + limit - 1;
}
}
static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len){
unsigned int buf;
int log;
-
+
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
buf=GET_CACHE(re, gb);
log= av_log2(buf);
-
+
if(log > 31-11){
buf >>= log - k;
buf += (30-log)<<k;
LAST_SKIP_BITS(re, gb, 32 + k - log);
CLOSE_READER(re, gb);
-
+
return buf;
}else{
int i;
buf = SHOW_UBITS(re, gb, esc_len);
LAST_SKIP_BITS(re, gb, esc_len);
CLOSE_READER(re, gb);
-
+
return buf + 1;
}else
return -1;
*/
static inline int get_sr_golomb(GetBitContext *gb, int k, int limit, int esc_len){
int v= get_ur_golomb(gb, k, limit, esc_len);
-
+
v++;
if (v&1) return v>>1;
else return -(v>>1);
-
+
// return (v>>1) ^ -(v&1);
}
int i= get_ue_golomb(s);
int len= get_bits_count(s) - pos;
int bits= show>>(24-len);
-
+
print_bin(bits, len);
-
+
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d ue @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
-
+
return i;
}
int i= get_se_golomb(s);
int len= get_bits_count(s) - pos;
int bits= show>>(24-len);
-
+
print_bin(bits, len);
-
+
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d se @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
-
+
return i;
}
int i= get_te0_golomb(s, r);
int len= get_bits_count(s) - pos;
int bits= show>>(24-len);
-
+
print_bin(bits, len);
-
+
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d te @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
-
+
return i;
}
*/
static inline void set_ue_golomb(PutBitContext *pb, int i){
int e;
-
+
assert(i>=0);
#if 0
put_bits(pb, ff_ue_golomb_len[i], i+1);
else{
e= av_log2(i+1);
-
+
put_bits(pb, 2*e+1, i+1);
}
}
static inline void set_se_golomb(PutBitContext *pb, int i){
// if (i>32767 || i<-32767)
// av_log(NULL,AV_LOG_ERROR,"value out of range %d\n", i);
-#if 0
+#if 0
if(i<=0) i= -2*i;
else i= 2*i-1;
#elif 1
*/
static inline void set_ur_golomb(PutBitContext *pb, int i, int k, int limit, int esc_len){
int e;
-
+
assert(i>=0);
-
+
e= i>>k;
if(e<limit){
put_bits(pb, e + k + 1, (1<<k) + (i&((1<<k)-1)));
*/
static inline void set_ur_golomb_jpegls(PutBitContext *pb, int i, int k, int limit, int esc_len){
int e;
-
+
assert(i>=0);
-
+
e= (i>>k) + 1;
if(e<limit){
put_bits(pb, e, 1);
put_bits(&s->pb, 20, 0x10); /* PSC */
- temp_ref= s->picture_number * (int64_t)30000 * s->avctx->time_base.num /
+ temp_ref= s->picture_number * (int64_t)30000 * s->avctx->time_base.num /
(1001 * (int64_t)s->avctx->time_base.den); //FIXME maybe this should use a timestamp
put_bits(&s->pb, 5, temp_ref & 0x1f); /* TemporalReference */
put_bits(&s->pb, 1, 0); /* split screen off */
put_bits(&s->pb, 1, 0); /* camera off */
put_bits(&s->pb, 1, 0); /* freeze picture release off */
-
+
format = ff_h261_get_picture_format(s->width, s->height);
-
+
put_bits(&s->pb, 1, format); /* 0 == QCIF, 1 == CIF */
put_bits(&s->pb, 1, 0); /* still image mode */
put_bits(&s->pb, 1, 0); /* reserved */
- put_bits(&s->pb, 1, 0); /* no PEI */
+ put_bits(&s->pb, 1, 0); /* no PEI */
if(format == 0)
h->gob_number = -1;
else
s->mb_y = index % 3 ; index /= 3;
s->mb_x+= 11*(index % 2); index /= 2;
s->mb_y+= 3*index;
-
+
ff_init_block_index(s);
ff_update_block_index(s);
}
if(val==0){
code = 0;
put_bits(&s->pb,h261_mv_tab[code][1],h261_mv_tab[code][0]);
- }
+ }
else{
if(val > 15)
val -=32;
if(val < -16)
val+=32;
sign = val < 0;
- code = sign ? -val : val;
+ code = sign ? -val : val;
put_bits(&s->pb,h261_mv_tab[code][1],h261_mv_tab[code][0]);
put_bits(&s->pb,1,sign);
}
int mvd, mv_diff_x, mv_diff_y, i, cbp;
cbp = 63; // avoid warning
mvd = 0;
-
+
h->current_mba++;
h->mtype = 0;
-
+
if (!s->mb_intra){
/* compute cbp */
cbp= get_cbp(s, block);
-
+
/* mvd indicates if this block is motion compensated */
mvd = motion_x | motion_y;
/* MB is not skipped, encode MBA */
put_bits(&s->pb, h261_mba_bits[(h->current_mba-h->previous_mba)-1], h261_mba_code[(h->current_mba-h->previous_mba)-1]);
-
+
/* calculate MTYPE */
if(!s->mb_intra){
h->mtype++;
-
+
if(mvd || s->loop_filter)
h->mtype+=3;
if(s->loop_filter)
assert(h->mtype > 1);
}
- if(s->dquant)
+ if(s->dquant)
h->mtype++;
put_bits(&s->pb, h261_mtype_bits[h->mtype], h261_mtype_code[h->mtype]);
-
+
h->mtype = h261_mtype_map[h->mtype];
-
+
if(IS_QUANT(h->mtype)){
ff_set_qscale(s,s->qscale+s->dquant);
put_bits(&s->pb, 5, s->qscale);
}
-
+
if(IS_16X16(h->mtype)){
mv_diff_x = (motion_x >> 1) - h->current_mv_x;
mv_diff_y = (motion_y >> 1) - h->current_mv_y;
h261_encode_motion(h,mv_diff_x);
h261_encode_motion(h,mv_diff_y);
}
-
+
h->previous_mba = h->current_mba;
-
+
if(HAS_CBP(h->mtype)){
- put_bits(&s->pb,h261_cbp_tab[cbp-1][1],h261_cbp_tab[cbp-1][0]);
+ put_bits(&s->pb,h261_cbp_tab[cbp-1][1],h261_cbp_tab[cbp-1][0]);
}
for(i=0; i<6; i++) {
/* encode each block */
void ff_h261_encode_init(MpegEncContext *s){
static int done = 0;
-
+
if (!done) {
done = 1;
init_rl(&h261_rl_tcoeff, 1);
} else {
i = 0;
}
-
+
/* AC coefs */
last_index = s->block_last_index[n];
last_non_zero = i - 1;
h261_decode_init_vlc(h);
h->gob_start_code_skipped = 0;
-
+
return 0;
}
static int h261_decode_gob_header(H261Context *h){
unsigned int val;
MpegEncContext * const s = &h->s;
-
+
if ( !h->gob_start_code_skipped ){
/* Check for GOB Start Code */
val = show_bits(&s->gb, 15);
{
MpegEncContext * const s = &h->s;
int i;
-
+
s->mb_intra = 0;
for(i=mba1; i<mba2; i++){
if(mv_diff && !get_bits1(gb))
mv_diff= -mv_diff;
-
+
v += mv_diff;
if (v <=-16) v+= 32;
else if(v >= 16) v-= 32;
if ( h->current_mba > MBA_STUFFING )
return SLICE_ERROR;
-
+
s->mb_x= ((h->gob_number-1) % 2) * 11 + ((h->current_mba-1) % 11);
s->mb_y= ((h->gob_number-1) / 2) * 3 + ((h->current_mba-1) / 11);
xy = s->mb_x + s->mb_y * s->mb_stride;
int code, level, i, j, run;
RLTable *rl = &h261_rl_tcoeff;
const uint8_t *scan_table;
-
+
// For the variable length encoding there are two code tables, one being used for
// the first transmitted LEVEL in INTER, INTER+MC and INTER+MC+FIL blocks, the second
// for all other LEVELs except the first one in INTRA blocks which is fixed length
skip_bits(&s->gb, 8);
}
- // h261 has no I-FRAMES, but if we pass I_TYPE for the first frame, the codec crashes if it does
+ // h261 has no I-FRAMES, but if we pass I_TYPE for the first frame, the codec crashes if it does
// not contain all I-blocks (e.g. when a packet is lost)
s->pict_type = P_TYPE;
static int h261_decode_gob(H261Context *h){
MpegEncContext * const s = &h->s;
-
+
ff_set_qscale(s, s->qscale);
/* decode mb's */
ret= h261_decode_mb(h);
if(ret<0){
if(ret==SLICE_END){
- h261_decode_mb_skipped(h, h->current_mba, 33);
+ h261_decode_mb_skipped(h, h->current_mba, 33);
return 0;
}
av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", s->mb_x + s->mb_y*s->mb_stride);
return -1;
}
-
+
h261_decode_mb_skipped(h, h->current_mba-h->mba_diff, h->current_mba-1);
}
-
+
return -1;
}
vop_found= pc->frame_start_found;
state= pc->state;
-
+
for(i=0; i<buf_size && !vop_found; i++){
state= (state<<8) | buf[i];
for(j=0; j<8; j++){
static int h261_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext *pc = s->priv_data;
int next;
-
+
next= h261_find_frame_end(pc,avctx, buf, buf_size);
if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
*poutbuf = NULL;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ac prediction encoding, b-frame support, error resilience, optimizations,
- * qpel decoding, gmc decoding, interlaced decoding,
+ * qpel decoding, gmc decoding, interlaced decoding,
* by Michael Niedermayer <michaelni@gmx.at>
*/
* @file h263.c
* h263/mpeg4 codec.
*/
-
+
//#define DEBUG
#include <limits.h>
int n);
static void h263p_encode_umotion(MpegEncContext * s, int val);
static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block,
- int n, int dc, uint8_t *scan_table,
+ int n, int dc, uint8_t *scan_table,
PutBitContext *dc_pb, PutBitContext *ac_pb);
#endif
static inline int mpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int n, int coded, int intra, int rvlc);
-static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
+static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
uint8_t *scan_table);
static int h263_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr);
#ifdef CONFIG_ENCODERS
#if 0 //3IV1 is quite rare and it slows things down a tiny bit
#define IS_3IV1 s->avctx->codec_tag == ff_get_fourcc("3IV1")
-#else
+#else
#define IS_3IV1 0
#endif
return;
}
}
-
+
s->aspect_ratio_info= FF_ASPECT_EXTENDED;
}
put_bits(&s->pb, 1, 0); /* ExtraInformation */
if(s->h263_aic){
- s->y_dc_scale_table=
+ s->y_dc_scale_table=
s->c_dc_scale_table= ff_aic_dc_scale_table;
}else{
s->y_dc_scale_table=
int best_clock_code=1;
int best_divisor=60;
int best_error= INT_MAX;
-
+
if(s->h263_plus){
for(i=0; i<2; i++){
int div, error;
put_bits(&s->pb, 1, 0); /* split screen off */
put_bits(&s->pb, 1, 0); /* camera off */
put_bits(&s->pb, 1, 0); /* freeze picture release off */
-
+
format = h263_get_picture_format(s->width, s->height);
if (!s->h263_plus) {
/* H.263v1 */
int ufep=1;
/* H.263v2 */
/* H.263 Plus PTYPE */
-
+
put_bits(&s->pb, 3, 7);
put_bits(&s->pb,3,ufep); /* Update Full Extended PTYPE */
if (format == 7)
put_bits(&s->pb,3,6); /* Custom Source Format */
else
put_bits(&s->pb, 3, format);
-
+
put_bits(&s->pb,1, s->custom_pcf);
put_bits(&s->pb,1, s->umvplus); /* Unrestricted Motion Vector */
put_bits(&s->pb,1,0); /* SAC: off */
put_bits(&s->pb,1,s->modified_quant); /* Modified Quantization: */
put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
put_bits(&s->pb,3,0); /* Reserved */
-
+
put_bits(&s->pb, 3, s->pict_type == P_TYPE);
-
+
put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */
put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */
put_bits(&s->pb,1,s->no_rounding); /* Rounding Type */
put_bits(&s->pb,2,0); /* Reserved */
put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
-
+
/* This should be here if PLUSPTYPE */
put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */
-
+
if (format == 7) {
/* Custom Picture Format (CPFMT) */
aspect_to_info(s, s->avctx->sample_aspect_ratio);
}
put_bits(&s->pb, 2, (temp_ref>>8)&3);
}
-
+
/* Unlimited Unrestricted Motion Vectors Indicator (UUI) */
if (s->umvplus)
// put_bits(&s->pb,1,1); /* Limited according tables of Annex D */
if(s->h263_slice_structured){
put_bits(&s->pb, 1, 1);
-
+
assert(s->mb_x == 0 && s->mb_y == 0);
ff_h263_encode_mba(s);
}
if(s->h263_aic){
- s->y_dc_scale_table=
+ s->y_dc_scale_table=
s->c_dc_scale_table= ff_aic_dc_scale_table;
}else{
s->y_dc_scale_table=
last= j;
}
}
-
+
return rate;
}
int8_t * const qscale_table= s->current_picture.qscale_table;
memcpy(zigzag_last_index, s->block_last_index, sizeof(int)*6);
-
+
for(n=0; n<6; n++){
int16_t *ac_val, *ac_val1;
-
+
score -= get_block_rate(s, block[n], s->block_last_index[n], s->intra_scantable.permutated);
ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
void ff_clean_h263_qscales(MpegEncContext *s){
int i;
int8_t * const qscale_table= s->current_picture.qscale_table;
-
+
for(i=1; i<s->mb_num; i++){
if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i-1] ] >2)
qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i-1] ]+2;
if(s->codec_id != CODEC_ID_H263P){
for(i=1; i<s->mb_num; i++){
int mb_xy= s->mb_index2xy[i];
-
+
if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTER4V)){
s->mb_type[mb_xy]&= ~CANDIDATE_MB_TYPE_INTER4V;
s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_INTER;
int8_t * const qscale_table= s->current_picture.qscale_table;
ff_clean_h263_qscales(s);
-
+
if(s->pict_type== B_TYPE){
int odd=0;
/* ok, come on, this isn't funny anymore, there's more code for handling this mpeg4 mess than for the actual adaptive quantization */
-
+
for(i=0; i<s->mb_num; i++){
int mb_xy= s->mb_index2xy[i];
odd += qscale_table[mb_xy]&1;
}
-
+
if(2*odd > s->mb_num) odd=1;
else odd=0;
-
+
for(i=0; i<s->mb_num; i++){
int mb_xy= s->mb_index2xy[i];
if((qscale_table[mb_xy]&1) != odd)
qscale_table[mb_xy]++;
if(qscale_table[mb_xy] > 31)
qscale_table[mb_xy]= 31;
- }
-
+ }
+
for(i=1; i<s->mb_num; i++){
int mb_xy= s->mb_index2xy[i];
if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_DIRECT)){
uint16_t time_pp= s->pp_time;
uint16_t time_pb= s->pb_time;
int i;
-
+
//FIXME avoid divides
-
+
if(IS_8X8(colocated_mb_type)){
s->mv_type = MV_TYPE_8X8;
for(i=0; i<4; i++){
s->mv[0][i][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp + my;
s->mv[1][i][0] = mx ? s->mv[0][i][0] - s->next_picture.motion_val[0][xy][0]
: s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp;
- s->mv[1][i][1] = my ? s->mv[0][i][1] - s->next_picture.motion_val[0][xy][1]
+ s->mv[1][i][1] = my ? s->mv[0][i][1] - s->next_picture.motion_val[0][xy][1]
: s->next_picture.motion_val[0][xy][1]*(time_pb - time_pp)/time_pp;
}
return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1;
s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my;
s->mv[1][i][0] = mx ? s->mv[0][i][0] - s->p_field_mv_table[i][0][mb_index][0]
: s->p_field_mv_table[i][0][mb_index][0]*(time_pb - time_pp)/time_pp;
- s->mv[1][i][1] = my ? s->mv[0][i][1] - s->p_field_mv_table[i][0][mb_index][1]
+ s->mv[1][i][1] = my ? s->mv[0][i][1] - s->p_field_mv_table[i][0][mb_index][1]
: s->p_field_mv_table[i][0][mb_index][1]*(time_pb - time_pp)/time_pp;
}
return MB_TYPE_DIRECT2 | MB_TYPE_16x8 | MB_TYPE_L0L1 | MB_TYPE_INTERLACED;
s->mv[0][0][1] = s->mv[0][1][1] = s->mv[0][2][1] = s->mv[0][3][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp + my;
s->mv[1][0][0] = s->mv[1][1][0] = s->mv[1][2][0] = s->mv[1][3][0] = mx ? s->mv[0][0][0] - s->next_picture.motion_val[0][xy][0]
: s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp;
- s->mv[1][0][1] = s->mv[1][1][1] = s->mv[1][2][1] = s->mv[1][3][1] = my ? s->mv[0][0][1] - s->next_picture.motion_val[0][xy][1]
+ s->mv[1][0][1] = s->mv[1][1][1] = s->mv[1][2][1] = s->mv[1][3][1] = my ? s->mv[0][0][1] - s->next_picture.motion_val[0][xy][1]
: s->next_picture.motion_val[0][xy][1]*(time_pb - time_pp)/time_pp;
if((s->avctx->workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE) || !s->quarter_sample)
s->mv_type= MV_TYPE_16X16;
//FIXME a lot of that is only needed for !low_delay
const int wrap = s->b8_stride;
const int xy = s->block_index[0];
-
- s->current_picture.mbskip_table[mb_xy]= s->mb_skipped;
+
+ s->current_picture.mbskip_table[mb_xy]= s->mb_skipped;
if(s->mv_type != MV_TYPE_8X8){
int motion_x, motion_y;
}
if(s->encoding){ //FIXME encoding MUST be cleaned up
- if (s->mv_type == MV_TYPE_8X8)
+ if (s->mv_type == MV_TYPE_8X8)
s->current_picture.mb_type[mb_xy]= MB_TYPE_L0 | MB_TYPE_8x8;
else if(s->mb_intra)
s->current_picture.mb_type[mb_xy]= MB_TYPE_INTRA;
static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y, int f_code){
if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){
- skip_put_bits(&s->pb,
+ skip_put_bits(&s->pb,
h263_get_motion_length(s, x, f_code)
+h263_get_motion_length(s, y, f_code));
}else{
if(s->flags & CODEC_FLAG_CBP_RD){
int score=0;
const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
+
for(i=0; i<6; i++){
if(s->coded_score[i] < 0){
score += s->coded_score[i];
cbp |= 1 << (5 - i);
}
}
-
+
if(cbp){
int zero_score= -6;
if ((motion_x | motion_y | s->dquant | mb_type) == 0){
return cbp;
}
-static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6],
+static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6],
uint8_t **scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb){
int i;
-
+
if(scan_table){
if(s->flags2 & CODEC_FLAG2_NO_OUTPUT){
for (i = 0; i < 6; i++) {
PutBitContext * const dc_pb = s->data_partitioning && s->pict_type!=I_TYPE ? &s->pb2 : &s->pb;
const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0;
const int dquant_code[5]= {1,0,9,2,3};
-
+
// printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
if (!s->mb_intra) {
int i, cbp;
-
+
if(s->pict_type==B_TYPE){
static const int mb_type_table[8]= {-1, 2, 3, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
int mb_type= mb_type_table[s->mv_dir];
if(s->mb_x==0){
for(i=0; i<2; i++){
- s->last_mv[i][0][0]=
- s->last_mv[i][0][1]=
- s->last_mv[i][1][0]=
+ s->last_mv[i][0][0]=
+ s->last_mv[i][0][1]=
+ s->last_mv[i][1][0]=
s->last_mv[i][1][1]= 0;
}
}
-
+
assert(s->dquant>=-2 && s->dquant<=2);
assert((s->dquant&1)==0);
assert(mb_type>=0);
/* nothing to do if this MB was skipped in the next P Frame */
if(s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]){ //FIXME avoid DCT & ...
s->skip_count++;
- s->mv[0][0][0]=
- s->mv[0][0][1]=
- s->mv[1][0][0]=
+ s->mv[0][0][0]=
+ s->mv[0][0][1]=
+ s->mv[1][0][0]=
s->mv[1][0][1]= 0;
s->mv_dir= MV_DIR_FORWARD; //doesn't matter
s->qscale -= s->dquant;
return;
}
-
+
cbp= get_b_cbp(s, block, motion_x, motion_y, mb_type);
-
+
if ((cbp | motion_x | motion_y | mb_type) ==0) {
/* direct MB with MV={0,0} */
assert(s->dquant==0);
-
+
put_bits(&s->pb, 1, 1); /* mb not coded modb1=1 */
if(interleaved_stats){
s->skip_count++;
return;
}
-
+
put_bits(&s->pb, 1, 0); /* mb coded modb1=0 */
put_bits(&s->pb, 1, cbp ? 0 : 1); /* modb2 */ //FIXME merge
put_bits(&s->pb, mb_type+1, 1); // this table is so simple that we don't need it :)
if(cbp) put_bits(&s->pb, 6, cbp);
-
+
if(cbp && mb_type){
if(s->dquant)
put_bits(&s->pb, 2, (s->dquant>>2)+3);
put_bits(&s->pb, 1, 0);
}else
s->qscale -= s->dquant;
-
+
if(!s->progressive_sequence){
if(cbp)
put_bits(&s->pb, 1, s->interlaced_dct);
}else{ /* s->pict_type==B_TYPE */
cbp= get_p_cbp(s, block, motion_x, motion_y);
-
+
if ((cbp | motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16) {
- /* check if the B frames can skip it too, as we must skip it if we skip here
+ /* check if the B frames can skip it too, as we must skip it if we skip here
why didn't they just compress the skip-mb bits instead of reusing them ?! */
if(s->max_b_frames>0){
int i;
offset= x + y*s->linesize;
p_pic= s->new_picture.data[0] + offset;
-
+
s->mb_skipped=1;
for(i=0; i<s->max_b_frames; i++){
uint8_t *b_pic;
}
}
}else
- s->mb_skipped=1;
+ s->mb_skipped=1;
if(s->mb_skipped==1){
/* skip macroblock */
s->last_bits++;
}
s->skip_count++;
-
+
return;
}
}
put_bits(pb2, 1, s->interlaced_dct);
put_bits(pb2, 1, 0);
}
-
+
if(interleaved_stats){
s->misc_bits+= get_bits_diff(s);
}
/* motion vectors: 16x16 mode */
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
+
ff_h263_encode_motion_vector(s, motion_x - pred_x,
motion_y - pred_y, s->f_code);
}else if(s->mv_type==MV_TYPE_FIELD){
if(cbp)
put_bits(pb2, 1, s->interlaced_dct);
put_bits(pb2, 1, 1);
-
+
if(interleaved_stats){
s->misc_bits+= get_bits_diff(s);
}
/* motion vectors: 16x8 interlaced mode */
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
pred_y /=2;
-
+
put_bits(&s->pb, 1, s->field_select[0][0]);
put_bits(&s->pb, 1, s->field_select[0][1]);
-
+
ff_h263_encode_motion_vector(s, s->mv[0][0][0] - pred_x,
s->mv[0][0][1] - pred_y, s->f_code);
ff_h263_encode_motion_vector(s, s->mv[0][1][0] - pred_x,
if(cbp)
put_bits(pb2, 1, s->interlaced_dct);
}
-
+
if(interleaved_stats){
s->misc_bits+= get_bits_diff(s);
}
}
}
- if(interleaved_stats){
+ if(interleaved_stats){
s->mv_bits+= get_bits_diff(s);
}
}
} else {
int cbp;
- int dc_diff[6]; //dc values with the dc prediction subtracted
+ int dc_diff[6]; //dc values with the dc prediction subtracted
int dir[6]; //prediction direction
int zigzag_last_index[6];
uint8_t *scan_table[6];
uint16_t *dc_ptr[6];
const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1);
const int dquant_code[5]= {1,0,9,2,3};
-
+
//printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
if (!s->mb_intra) {
/* compute cbp */
return;
}
put_bits(&s->pb, 1, 0); /* mb coded */
-
+
cbpc = cbp & 3;
cbpy = cbp >> 2;
if(s->alt_inter_vlc==0 || cbpc!=3)
put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
if(s->dquant)
put_bits(&s->pb, 2, dquant_code[s->dquant+2]);
-
+
if(interleaved_stats){
s->misc_bits+= get_bits_diff(s);
}
/* motion vectors: 16x16 mode */
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
- if (!s->umvplus) {
+
+ if (!s->umvplus) {
ff_h263_encode_motion_vector(s, motion_x - pred_x,
motion_y - pred_y, 1);
}
motion_x= s->current_picture.motion_val[0][ s->block_index[i] ][0];
motion_y= s->current_picture.motion_val[0][ s->block_index[i] ][1];
- if (!s->umvplus) {
+ if (!s->umvplus) {
ff_h263_encode_motion_vector(s, motion_x - pred_x,
motion_y - pred_y, 1);
}
}
} else {
assert(s->mb_intra);
-
+
cbp = 0;
if (s->h263_aic) {
/* Predict DC */
for(i=0; i<6; i++) {
int16_t level = block[i][0];
int scale;
-
+
if(i<4) scale= s->y_dc_scale;
else scale= s->c_dc_scale;
level = (level + (scale>>1))/scale;
else
level = (level - (scale>>1))/scale;
-
+
/* AIC can change CBP */
if (level == 0 && s->block_last_index[i] == 0)
s->block_last_index[i] = -1;
}
block[i][0] = level;
- /* Reconstruction */
+ /* Reconstruction */
rec_intradc[i] = scale*level + pred_dc;
/* Oddify */
rec_intradc[i] |= 1;
rec_intradc[i] = 0;
else if (rec_intradc[i] > 2047)
rec_intradc[i] = 2047;
-
+
/* Update AC/DC tables */
*dc_ptr[i] = rec_intradc[i];
if (s->block_last_index[i] >= 0)
for(i=0; i<6; i++) {
/* encode each block */
h263_encode_block(s, block[i], i);
-
+
/* Update INTRADC for decoding */
if (s->h263_aic && s->mb_intra) {
block[i][0] = rec_intradc[i];
-
+
}
}
uint8_t *dest_y = s->dest[0];
uint8_t *dest_cb= s->dest[1];
uint8_t *dest_cr= s->dest[2];
-
+
// if(s->pict_type==B_TYPE && !s->readable) return;
/*
if(IS_SKIP(s->current_picture.mb_type[xy-s->mb_stride]))
qp_t=0;
- else
+ else
qp_t= s->current_picture.qscale_table[xy-s->mb_stride];
- if(qp_c)
+ if(qp_c)
qp_tc= qp_c;
else
qp_tc= qp_t;
-
+
if(qp_tc){
const int chroma_qp= s->chroma_qscale_table[qp_tc];
s->dsp.h263_v_loop_filter(dest_y , linesize, qp_tc);
s->dsp.h263_v_loop_filter(dest_y+8, linesize, qp_tc);
-
+
s->dsp.h263_v_loop_filter(dest_cb , uvlinesize, chroma_qp);
s->dsp.h263_v_loop_filter(dest_cr , uvlinesize, chroma_qp);
}
-
+
if(qp_t)
s->dsp.h263_h_loop_filter(dest_y-8*linesize+8 , linesize, qp_t);
-
+
if(s->mb_x){
if(qp_t || IS_SKIP(s->current_picture.mb_type[xy-1-s->mb_stride]))
qp_dt= qp_t;
else
qp_dt= s->current_picture.qscale_table[xy-1-s->mb_stride];
-
+
if(qp_dt){
const int chroma_qp= s->chroma_qscale_table[qp_dt];
s->dsp.h263_h_loop_filter(dest_y -8*linesize , linesize, qp_dt);
if(s->mb_y + 1 == s->mb_height)
s->dsp.h263_h_loop_filter(dest_y+8*linesize+8, linesize, qp_c);
}
-
+
if(s->mb_x){
int qp_lc;
if(qp_c || IS_SKIP(s->current_picture.mb_type[xy-1]))
qp_lc= qp_c;
else
qp_lc= s->current_picture.qscale_table[xy-1];
-
+
if(qp_lc){
s->dsp.h263_h_loop_filter(dest_y, linesize, qp_lc);
if(s->mb_y + 1 == s->mb_height){
scale = s->c_dc_scale;
}
/* B C
- * A X
+ * A X
*/
a = dc_val[(x - 1) + (y) * wrap];
c = dc_val[(x) + (y - 1) * wrap];
-
+
/* No prediction outside GOB boundary */
if(s->first_slice_line && n!=3){
if(n!=2) c= 1024;
pred_dc = a;
else
pred_dc = c;
-
+
/* we assume pred is positive */
//pred_dc = (pred_dc + (scale >> 1)) / scale;
*dc_val_ptr = &dc_val[x + y * wrap];
ac_val = s->ac_val[n - 4 + 1][0];
scale = s->c_dc_scale;
}
-
+
ac_val += ((y) * wrap + (x)) * 16;
ac_val1 = ac_val;
-
+
/* B C
- * A X
+ * A X
*/
a = dc_val[(x - 1) + (y) * wrap];
c = dc_val[(x) + (y - 1) * wrap];
-
+
/* No prediction outside GOB boundary */
if(s->first_slice_line && n!=3){
if(n!=2) c= 1024;
if(n!=1 && s->mb_x == s->resync_mb_x) a= 1024;
}
-
+
if (s->ac_pred) {
pred_dc = 1024;
if (s->h263_aic_dir) {
else
pred_dc = c;
}
-
+
/* we assume pred is positive */
block[0]=block[0]*scale + pred_dc;
-
+
if (block[0] < 0)
block[0] = 0;
- else
+ else
block[0] |= 1;
-
+
/* Update AC/DC tables */
dc_val[(x) + (y) * wrap] = block[0];
-
+
/* left copy */
for(i=1;i<8;i++)
ac_val1[i ] = block[s->dsp.idct_permutation[i<<3]];
C = mot_val[off[block] - wrap];
if(s->mb_x == s->resync_mb_x) //rare
A[0]=A[1]=0;
-
+
*px = mid_pred(A[0], B[0], C[0]);
*py = mid_pred(A[1], B[1], C[1]);
}
code = (val >> bit_size) + 1;
bits = val & (range - 1);
- put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
+ put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
if (bit_size > 0) {
put_bits(&s->pb, bit_size, bits);
}
/* Encode MV differences on H.263+ with Unrestricted MV mode */
static void h263p_encode_umotion(MpegEncContext * s, int val)
{
- short sval = 0;
+ short sval = 0;
short i = 0;
short n_bits = 0;
short temp_val;
int code = 0;
int tcode;
-
+
if ( val == 0)
put_bits(&s->pb, 1, 1);
else if (val == 1)
else if (val == -1)
put_bits(&s->pb, 3, 2);
else {
-
+
sval = ((val < 0) ? (short)(-val):(short)val);
temp_val = sval;
-
+
while (temp_val != 0) {
temp_val = temp_val >> 1;
n_bits++;
}
-
+
i = n_bits - 1;
while (i > 0) {
tcode = (sval & (1 << (i-1))) >> (i-1);
{
int f_code;
int mv;
-
+
if(mv_penalty==NULL)
mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
-
+
for(f_code=1; f_code<=MAX_FCODE; f_code++){
for(mv=-MAX_MV; mv<=MAX_MV; mv++){
int len;
range = 1 << bit_size;
val=mv;
- if (val < 0)
+ if (val < 0)
val = -val;
val--;
code = (val >> bit_size) + 1;
/* chrominance */
uni_code= DCtab_chrom[size][0];
uni_len = DCtab_chrom[size][1];
-
+
if (size > 0) {
uni_code<<=size; uni_code|=l;
uni_len+=size;
#ifdef CONFIG_ENCODERS
static void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){
int slevel, run, last;
-
+
assert(MAX_LEVEL >= 64);
assert(MAX_RUN >= 63);
int sign= slevel < 0 ? 1 : 0;
int bits, len, code;
int level1, run1;
-
+
len_tab[index]= 100;
-
+
/* ESC0 */
code= get_rl_index(rl, last, run, level);
bits= rl->table_vlc[code][0];
len= rl->table_vlc[code][1];
bits=bits*2+sign; len++;
-
+
if(code!=rl->n && len < len_tab[index]){
bits_tab[index]= bits;
len_tab [index]= len;
len += rl->table_vlc[code][1];
bits += rl->table_vlc[code][0];
bits=bits*2+sign; len++;
-
+
if(code!=rl->n && len < len_tab[index]){
bits_tab[index]= bits;
len_tab [index]= len;
}
}
-#endif
+#endif
#if 1
/* ESC2 */
bits= rl->table_vlc[rl->n][0];
len += rl->table_vlc[code][1];
bits += rl->table_vlc[code][0];
bits=bits*2+sign; len++;
-
+
if(code!=rl->n && len < len_tab[index]){
bits_tab[index]= bits;
len_tab [index]= len;
}
}
-#endif
- /* ESC3 */
+#endif
+ /* ESC3 */
bits= rl->table_vlc[rl->n][0];
len = rl->table_vlc[rl->n][1];
bits=bits*4+3; len+=2; //esc3
bits=bits*2+1; len++; //marker
bits=bits*4096+(slevel&0xfff); len+=12;
bits=bits*2+1; len++; //marker
-
+
if(len < len_tab[index]){
bits_tab[index]= bits;
len_tab [index]= len;
static void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){
int slevel, run, last;
-
+
assert(MAX_LEVEL >= 64);
assert(MAX_RUN >= 63);
int level= slevel < 0 ? -slevel : slevel;
int sign= slevel < 0 ? 1 : 0;
int bits, len, code;
-
+
len_tab[index]= 100;
-
+
/* ESC0 */
code= get_rl_index(rl, last, run, level);
bits= rl->table_vlc[code][0];
len= rl->table_vlc[code][1];
bits=bits*2+sign; len++;
-
+
if(code!=rl->n && len < len_tab[index]){
if(bits_tab) bits_tab[index]= bits;
len_tab [index]= len;
bits=bits*2+last; len++;
bits=bits*64+run; len+=6;
bits=bits*256+(level&0xff); len+=8;
-
+
if(len < len_tab[index]){
if(bits_tab) bits_tab[index]= bits;
len_tab [index]= len;
init_rl(&rl_inter, 1);
init_rl(&rl_intra, 1);
init_rl(&rl_intra_aic, 1);
-
+
init_uni_mpeg4_rl_tab(&rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len);
init_uni_mpeg4_rl_tab(&rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len);
init_mv_penalty_and_fcode(s);
}
s->me.mv_penalty= mv_penalty; //FIXME exact table for msmpeg4 & h263p
-
+
s->intra_ac_vlc_length =s->inter_ac_vlc_length = uni_h263_inter_rl_len;
s->intra_ac_vlc_last_length=s->inter_ac_vlc_last_length= uni_h263_inter_rl_len + 128*64;
if(s->h263_aic){
s->avctx->extradata= av_malloc(1024);
init_put_bits(&s->pb, s->avctx->extradata, 1024);
-
+
if(!(s->workaround_bugs & FF_BUG_MS))
mpeg4_encode_visual_object_header(s);
mpeg4_encode_vol_header(s, 0, 0);
flush_put_bits(&s->pb);
s->avctx->extradata_size= (put_bits_count(&s->pb)+7)>>3;
}
-
+
break;
case CODEC_ID_H263P:
if(s->umvplus)
s->max_qcoeff= 127;
}
break;
- //Note for mpeg4 & h263 the dc-scale table will be set per frame as needed later
+ //Note for mpeg4 & h263 the dc-scale table will be set per frame as needed later
case CODEC_ID_FLV1:
if (s->h263_flv > 1) {
s->min_qcoeff= -1023;
i = 0;
if (s->h263_aic && s->mb_intra)
rl = &rl_intra_aic;
-
+
if(s->alt_inter_vlc && !s->mb_intra){
int aic_vlc_bits=0;
int inter_vlc_bits=0;
int wrong_pos=-1;
int aic_code;
-
+
last_index = s->block_last_index[n];
last_non_zero = i - 1;
for (; i <= last_index; i++) {
if (level) {
run = i - last_non_zero - 1;
last = (i == last_index);
-
+
if(level<0) level= -level;
-
+
code = get_rl_index(rl, last, run, level);
aic_code = get_rl_index(&rl_intra_aic, last, run, level);
inter_vlc_bits += rl->table_vlc[code][1]+1;
if (code == rl->n) {
inter_vlc_bits += 1+6+8-1;
- }
+ }
if (aic_code == rl_intra_aic.n) {
aic_vlc_bits += 1+6+8-1;
wrong_pos += run + 1;
}else
wrong_pos += wrong_run[aic_code];
last_non_zero = i;
- }
+ }
}
i = 0;
if(aic_vlc_bits < inter_vlc_bits && wrong_pos > 63)
rl = &rl_intra_aic;
}
}
-
+
/* AC coefs */
last_index = s->block_last_index[n];
last_non_zero = i - 1;
if(s->h263_flv <= 1){
put_bits(&s->pb, 1, last);
put_bits(&s->pb, 6, run);
-
+
assert(slevel != 0);
- if(level < 128)
+ if(level < 128)
put_bits(&s->pb, 8, slevel & 0xff);
else{
put_bits(&s->pb, 8, 128);
static void mpeg4_encode_gop_header(MpegEncContext * s){
int hours, minutes, seconds;
int64_t time;
-
+
put_bits(&s->pb, 16, 0);
put_bits(&s->pb, 16, GOP_STARTCODE);
-
+
time= s->current_picture_ptr->pts;
if(s->reordered_input_picture[1])
time= FFMIN(time, s->reordered_input_picture[1]->pts);
put_bits(&s->pb, 6, minutes);
put_bits(&s->pb, 1, 1);
put_bits(&s->pb, 6, seconds);
-
- put_bits(&s->pb, 1, !!(s->flags&CODEC_FLAG_CLOSED_GOP));
+
+ put_bits(&s->pb, 1, !!(s->flags&CODEC_FLAG_CLOSED_GOP));
put_bits(&s->pb, 1, 0); //broken link == NO
-
- s->last_time_base= time / s->avctx->time_base.den;
+
+ s->last_time_base= time / s->avctx->time_base.den;
ff_mpeg4_stuffing(&s->pb);
}
static void mpeg4_encode_visual_object_header(MpegEncContext * s){
int profile_and_level_indication;
int vo_ver_id;
-
+
if(s->avctx->profile != FF_PROFILE_UNKNOWN){
profile_and_level_indication = s->avctx->profile << 4;
}else if(s->max_b_frames || s->quarter_sample){
put_bits(&s->pb, 16, 0);
put_bits(&s->pb, 16, VISUAL_OBJ_STARTCODE);
-
+
put_bits(&s->pb, 1, 1);
put_bits(&s->pb, 4, vo_ver_id);
put_bits(&s->pb, 3, 1); //priority
-
+
put_bits(&s->pb, 4, 1); //visual obj type== video obj
-
+
put_bits(&s->pb, 1, 0); //video signal type == no clue //FIXME
ff_mpeg4_stuffing(&s->pb);
put_bits(&s->pb, 4, vo_ver_id); /* is obj layer ver id */
put_bits(&s->pb, 3, 1); /* is obj layer priority */
}
-
+
aspect_to_info(s, s->avctx->sample_aspect_ratio);
put_bits(&s->pb, 4, s->aspect_ratio_info);/* aspect ratio info */
put_bits(&s->pb, 2, RECT_SHAPE); /* vol shape= rectangle */
put_bits(&s->pb, 1, 1); /* marker bit */
-
+
put_bits(&s->pb, 16, s->avctx->time_base.den);
if (s->time_increment_bits < 1)
s->time_increment_bits = 1;
}else{
put_bits(&s->pb, 2, s->vol_sprite_usage); /* sprite enable */
}
-
+
put_bits(&s->pb, 1, 0); /* not 8 bit == false */
put_bits(&s->pb, 1, s->mpeg_quant); /* quant type= (0=h263 style)*/
put_bits(&s->pb, 1, 0); /* reduced res vop */
}
put_bits(&s->pb, 1, 0); /* scalability */
-
+
ff_mpeg4_stuffing(&s->pb);
/* user data */
{
int time_incr;
int time_div, time_mod;
-
+
if(s->pict_type==I_TYPE){
if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){
if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy
if(!(s->workaround_bugs & FF_BUG_MS))
mpeg4_encode_gop_header(s);
}
-
+
s->partitioned_frame= s->data_partitioning && s->pict_type!=B_TYPE;
//printf("num:%d rate:%d base:%d\n", s->picture_number, s->time_base.den, FRAME_RATE_BASE);
-
+
put_bits(&s->pb, 16, 0); /* vop header */
put_bits(&s->pb, 16, VOP_STARTCODE); /* vop header */
put_bits(&s->pb, 2, s->pict_type - 1); /* pict type: I = 0 , P = 1 */
assert(time_incr >= 0);
while(time_incr--)
put_bits(&s->pb, 1, 1);
-
+
put_bits(&s->pb, 1, 0);
put_bits(&s->pb, 1, 1); /* marker */
put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */
put_bits(&s->pb, 1, 1); /* marker */
put_bits(&s->pb, 1, 1); /* vop coded */
- if ( s->pict_type == P_TYPE
+ if ( s->pict_type == P_TYPE
|| (s->pict_type == S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
put_bits(&s->pb, 1, s->no_rounding); /* rounding type */
}
qscale = 1;
else if (qscale > 31)
qscale = 31;
-
+
s->qscale = qscale;
s->chroma_qscale= s->chroma_qscale_table[qscale];
/**
* predicts the dc.
* encoding quantized level -> quantized diff
- * decoding quantized diff -> quantized level
+ * decoding quantized diff -> quantized level
* @param n block index (0-3 are luma, 4-5 are chroma)
* @param dir_ptr pointer to an integer where the prediction direction will be stored
*/
dc_val = s->dc_val[0] + s->block_index[n];
/* B C
- * A X
+ * A X
*/
a = dc_val[ - 1];
b = dc_val[ - 1 - wrap];
}
level *=scale;
if(level&(~2047)){
- if(level<0)
+ if(level<0)
level=0;
else if(!(s->workaround_bugs&FF_BUG_DC_CLIP))
level=2047;
const int xy= s->mb_x-1 + s->mb_y*s->mb_stride;
/* left prediction */
ac_val -= 16;
-
+
if(s->mb_x==0 || s->qscale == qscale_table[xy] || n==1 || n==3){
/* same qscale */
for(i=1;i<8;i++) {
* encodes a 8x8 block
* @param n block index (0-3 are luma, 4-5 are chroma)
*/
-static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
+static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
{
int i, last_non_zero;
if (code == rl->n) {
int level1, run1;
level1 = level - rl->max_level[last][run];
- if (level1 < 1)
+ if (level1 < 1)
goto esc2;
code = get_rl_index(rl, last, run, level1);
if (code == rl->n) {
#endif
}
-static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
+static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
uint8_t *scan_table)
{
int i, last_non_zero;
len += 7+2+1+6+1+12+1;
}
}
-
+
return len;
}
void init_vlc_rl(RLTable *rl, int use_static)
{
int i, q;
-
+
/* Return if static table is already initialized */
if(use_static && rl->rl_vlc[0])
- return;
+ return;
- init_vlc(&rl->vlc, 9, rl->n + 1,
+ init_vlc(&rl->vlc, 9, rl->n + 1,
&rl->table_vlc[0][1], 4, 2,
&rl->table_vlc[0][0], 4, 2, use_static);
-
+
for(q=0; q<32; q++){
int qmul= q*2;
int qadd= (q-1)|1;
-
+
if(q==0){
qmul=1;
qadd=0;
}
- if(use_static)
+ if(use_static)
rl->rl_vlc[q]= av_mallocz_static(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
else
rl->rl_vlc[q]= av_malloc(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
int code= rl->vlc.table[i][0];
int len = rl->vlc.table[i][1];
int level, run;
-
+
if(len==0){ // illegal code
run= 66;
level= MAX_LEVEL;
if (!done) {
done = 1;
- init_vlc(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
+ init_vlc(&intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9,
intra_MCBPC_bits, 1, 1,
intra_MCBPC_code, 1, 1, 1);
- init_vlc(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
+ init_vlc(&inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28,
inter_MCBPC_bits, 1, 1,
inter_MCBPC_code, 1, 1, 1);
init_vlc(&cbpy_vlc, CBPY_VLC_BITS, 16,
{
unsigned int val, gfid, gob_number;
int left;
-
+
/* Check for GOB Start Code */
val = show_bits(&s->gb, 16);
if(val)
for(;left>13; left--){
if(get_bits1(&s->gb)) break; /* Seek the '1' bit */
}
- if(left<=13)
+ if(left<=13)
return -1;
if(s->h263_slice_structured){
if(s->mb_num > 1583)
if(get_bits1(&s->gb)==0)
return -1;
-
+
s->qscale = get_bits(&s->gb, 5); /* SQUANT */
if(get_bits1(&s->gb)==0)
return -1;
gfid = get_bits(&s->gb, 2); /* GFID */
s->qscale = get_bits(&s->gb, 5); /* GQUANT */
}
-
- if(s->mb_y >= s->mb_height)
+
+ if(s->mb_y >= s->mb_height)
return -1;
- if(s->qscale==0)
+ if(s->qscale==0)
return -1;
return 0;
int size= end - start;
int pb_size = (((long)start + size/3)&(~3)) - (long)start;
int tex_size= (size - 2*pb_size)&(~3);
-
+
set_put_bits_buffer_size(&s->pb, pb_size);
init_put_bits(&s->tex_pb, start + pb_size , tex_size);
init_put_bits(&s->pb2 , start + pb_size + tex_size, pb_size);
put_bits(&s->pb, ff_mpeg4_get_video_packet_prefix_length(s), 0);
put_bits(&s->pb, 1, 1);
-
+
put_bits(&s->pb, mb_num_bits, s->mb_x + s->mb_y*s->mb_width);
put_bits(&s->pb, s->quant_precision, s->qscale);
put_bits(&s->pb, 1, 0); /* no HEC */
*/
static inline int mpeg4_is_resync(MpegEncContext *s){
const int bits_count= get_bits_count(&s->gb);
-
+
if(s->workaround_bugs&FF_BUG_NO_PADDING){
return 0;
}
if(bits_count + 8 >= s->gb.size_in_bits){
int v= show_bits(&s->gb, 8);
v|= 0x7F >> (7-(bits_count&7));
-
+
if(v==0x7F)
return 1;
}else{
if(show_bits(&s->gb, 16) == ff_mpeg4_resync_prefix[bits_count&7]){
int len;
GetBitContext gb= s->gb;
-
+
skip_bits(&s->gb, 1);
align_get_bits(&s->gb);
-
+
for(len=0; len<32; len++){
if(get_bits1(&s->gb)) break;
}
{
int mb_num_bits= av_log2(s->mb_num - 1) + 1;
int header_extension=0, mb_num, len;
-
+
/* is there enough space left for a video packet + header */
if( get_bits_count(&s->gb) > s->gb.size_in_bits-20) return -1;
av_log(s->avctx, AV_LOG_ERROR, "marker does not match f_code\n");
return -1;
}
-
+
if(s->shape != RECT_SHAPE){
header_extension= get_bits1(&s->gb);
//FIXME more stuff here
while(s->next_picture.mbskip_table[ s->mb_index2xy[ mb_num ] ]) mb_num++;
if(mb_num >= s->mb_num) return -1; // slice contains just skipped MBs which where allready decoded
}
-
+
s->mb_x= mb_num % s->mb_width;
s->mb_y= mb_num / s->mb_width;
if(s->shape != BIN_ONLY_SHAPE){
- int qscale= get_bits(&s->gb, s->quant_precision);
+ int qscale= get_bits(&s->gb, s->quant_precision);
if(qscale)
s->chroma_qscale=s->qscale= qscale;
}
int time_increment;
int time_incr=0;
- while (get_bits1(&s->gb) != 0)
+ while (get_bits1(&s->gb) != 0)
time_incr++;
check_marker(&s->gb, "before time_increment in video packed header");
time_increment= get_bits(&s->gb, s->time_increment_bits);
check_marker(&s->gb, "before vop_coding_type in video packed header");
-
+
skip_bits(&s->gb, 2); /* vop coding type */
//FIXME not rect stuff here
}
//FIXME reduced res stuff here
-
+
if (s->pict_type != I_TYPE) {
int f_code = get_bits(&s->gb, 3); /* fcode_for */
if(f_code==0){
if(b_code==0){
av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (b_code=0)\n");
}
- }
+ }
}
}
//FIXME new-pred stuff
-
+
//printf("parse ok %d %d %d %d\n", mb_num, s->mb_x + s->mb_y*s->mb_width, get_bits_count(gb), get_bits_count(&s->gb));
return 0;
*/
int ff_h263_resync(MpegEncContext *s){
int left, ret;
-
+
if(s->codec_id==CODEC_ID_MPEG4){
skip_bits1(&s->gb);
align_get_bits(&s->gb);
s->gb= s->last_resync_gb;
align_get_bits(&s->gb);
left= s->gb.size_in_bits - get_bits_count(&s->gb);
-
- for(;left>16+1+5+5; left-=8){
+
+ for(;left>16+1+5+5; left-=8){
if(show_bits(&s->gb, 16)==0){
GetBitContext bak= s->gb;
}
skip_bits(&s->gb, 8);
}
-
+
return -1;
}
int x, y, mb_v, sum, dx, dy, shift;
int len = 1 << (s->f_code + 4);
const int a= s->sprite_warping_accuracy;
-
+
if(s->workaround_bugs & FF_BUG_AMV)
len >>= s->quarter_sample;
sum=0;
for(y=0; y<16; y++){
int v;
-
+
v= mb_v + dy*y;
//XXX FIXME optimize
for(x=0; x<16; x++){
static int mpeg4_decode_partition_a(MpegEncContext *s){
int mb_num;
static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
-
+
/* decode first partition */
mb_num=0;
s->first_slice_line=1;
const int xy= s->mb_x + s->mb_y*s->mb_stride;
int cbpc;
int dir=0;
-
+
mb_num++;
ff_update_block_index(s);
if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
s->first_slice_line=0;
-
+
if(s->pict_type==I_TYPE){
int i;
return -1;
}
}while(cbpc == 8);
-
+
s->cbp_table[xy]= cbpc & 3;
s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
s->mb_intra = 1;
s->mbintra_table[xy]= 1;
for(i=0; i<6; i++){
int dc_pred_dir;
- int dc= mpeg4_decode_dc(s, i, &dc_pred_dir);
+ int dc= mpeg4_decode_dc(s, i, &dc_pred_dir);
if(dc < 0){
av_log(s->avctx, AV_LOG_ERROR, "DC corrupted at %d %d\n", s->mb_x, s->mb_y);
return -1;
goto try_again;
s->cbp_table[xy]= cbpc&(8+3); //8 is dquant
-
+
s->mb_intra = ((cbpc & 4) != 0);
-
+
if(s->mb_intra){
s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
s->mbintra_table[xy]= 1;
- mot_val[0 ]= mot_val[2 ]=
+ mot_val[0 ]= mot_val[2 ]=
mot_val[0+stride]= mot_val[2+stride]= 0;
mot_val[1 ]= mot_val[3 ]=
mot_val[1+stride]= mot_val[3+stride]= 0;
if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
s->mcsel= get_bits1(&s->gb);
else s->mcsel= 0;
-
+
if ((cbpc & 16) == 0) {
/* 16x16 motion prediction */
mx = h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
-
+
my = h263_decode_motion(s, pred_y, s->f_code);
if (my >= 0xffff)
return -1;
ff_update_block_index(s);
if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
s->first_slice_line=0;
-
+
if(s->pict_type==I_TYPE){
int ac_pred= get_bits1(&s->gb);
int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
av_log(s->avctx, AV_LOG_ERROR, "cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
s->cbp_table[xy]|= cbpy<<2;
- s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED;
+ s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED;
}else{ /* P || S_TYPE */
- if(IS_INTRA(s->current_picture.mb_type[xy])){
+ if(IS_INTRA(s->current_picture.mb_type[xy])){
int dir=0,i;
int ac_pred = get_bits1(&s->gb);
int cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
av_log(s->avctx, AV_LOG_ERROR, "I cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
if(s->cbp_table[xy] & 8) {
ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
}
for(i=0; i<6; i++){
int dc_pred_dir;
- int dc= mpeg4_decode_dc(s, i, &dc_pred_dir);
+ int dc= mpeg4_decode_dc(s, i, &dc_pred_dir);
if(dc < 0){
av_log(s->avctx, AV_LOG_ERROR, "DC corrupted at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
s->cbp_table[xy]&= 3; //remove dquant
s->cbp_table[xy]|= cbpy<<2;
- s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED;
+ s->current_picture.mb_type[xy] |= ac_pred*MB_TYPE_ACPRED;
s->pred_dir_table[xy]= dir;
}else if(IS_SKIP(s->current_picture.mb_type[xy])){
s->current_picture.qscale_table[xy]= s->qscale;
av_log(s->avctx, AV_LOG_ERROR, "P cbpy corrupted at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
if(s->cbp_table[xy] & 8) {
ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
}
int mb_num;
const int part_a_error= s->pict_type==I_TYPE ? (DC_ERROR|MV_ERROR) : MV_ERROR;
const int part_a_end = s->pict_type==I_TYPE ? (DC_END |MV_END) : MV_END;
-
- mb_num= mpeg4_decode_partition_a(s);
+
+ mb_num= mpeg4_decode_partition_a(s);
if(mb_num<0){
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, part_a_error);
return -1;
}
-
+
if(s->resync_mb_x + s->resync_mb_y*s->mb_width + mb_num > s->mb_num){
av_log(s->avctx, AV_LOG_ERROR, "slice below monitor ...\n");
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, part_a_error);
}
s->mb_num_left= mb_num;
-
+
if(s->pict_type==I_TYPE){
while(show_bits(&s->gb, 9) == 1)
skip_bits(&s->gb, 9);
}
}
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, part_a_end);
-
+
if( mpeg4_decode_partition_b(s, mb_num) < 0){
if(s->pict_type==P_TYPE)
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, DC_ERROR);
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, DC_END);
}
- return 0;
+ return 0;
}
/**
if(s->current_picture.qscale_table[xy] != s->qscale){
ff_set_qscale(s, s->current_picture.qscale_table[xy] );
}
-
+
if (s->pict_type == P_TYPE || s->pict_type==S_TYPE) {
int i;
for(i=0; i<4; i++){
s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]);
}else if(!s->mb_intra){
// s->mcsel= 0; //FIXME do we need to init that
-
+
s->mv_dir = MV_DIR_FORWARD;
if (IS_8X8(mb_type)) {
s->mv_type = MV_TYPE_8X8;
if(mpeg4_is_resync(s))
return SLICE_END;
else
- return SLICE_NOEND;
+ return SLICE_NOEND;
}else{
if(mpeg4_is_resync(s)){
const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1;
*/
static void preview_obmc(MpegEncContext *s){
GetBitContext gb= s->gb;
-
+
int cbpc, i, pred_x, pred_y, mx, my;
int16_t *mot_val;
const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride;
const int stride= s->b8_stride*2;
-
+
for(i=0; i<4; i++)
s->block_index[i]+= 2;
for(i=4; i<6; i++)
s->block_index[i]+= 1;
s->mb_x++;
-
+
assert(s->pict_type == P_TYPE);
do{
if (get_bits1(&s->gb)) {
/* skip mb */
mot_val = s->current_picture.motion_val[0][ s->block_index[0] ];
- mot_val[0 ]= mot_val[2 ]=
+ mot_val[0 ]= mot_val[2 ]=
mot_val[0+stride]= mot_val[2+stride]= 0;
mot_val[1 ]= mot_val[3 ]=
mot_val[1+stride]= mot_val[3+stride]= 0;
-
+
s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
goto end;
}
cbpc = get_vlc2(&s->gb, inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2);
}while(cbpc == 20);
-
+
if(cbpc & 4){
s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
}else{
}else
skip_bits(&s->gb, 2);
}
-
+
if ((cbpc & 16) == 0) {
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
+ s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
/* 16x16 motion prediction */
mot_val= h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
if (s->umvplus)
mx = h263p_decode_umotion(s, pred_x);
else
mx = h263_decode_motion(s, pred_x, 1);
-
+
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
else
my = h263_decode_motion(s, pred_y, 1);
-
- mot_val[0 ]= mot_val[2 ]=
+
+ mot_val[0 ]= mot_val[2 ]=
mot_val[0+stride]= mot_val[2+stride]= mx;
mot_val[1 ]= mot_val[3 ]=
mot_val[1+stride]= mot_val[3+stride]= my;
} else {
- s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
+ s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
for(i=0;i<4;i++) {
mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
if (s->umvplus)
mx = h263p_decode_umotion(s, pred_x);
else
mx = h263_decode_motion(s, pred_x, 1);
-
+
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
- else
+ else
my = h263_decode_motion(s, pred_y, 1);
if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
}
}
end:
-
+
for(i=0; i<4; i++)
s->block_index[i]-= 2;
for(i=4; i<6; i++)
int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
int16_t *mot_val;
const int xy= s->mb_x + s->mb_y * s->mb_stride;
-
+
assert(!s->h263_pred);
-
+
if (s->pict_type == P_TYPE) {
do{
if (get_bits1(&s->gb)) {
return -1;
}
}while(cbpc == 20);
-
+
s->dsp.clear_blocks(s->block[0]);
-
+
dquant = cbpc & 8;
s->mb_intra = ((cbpc & 4) != 0);
if (s->mb_intra) goto intra;
-
+
cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
-
+
if(s->alt_inter_vlc==0 || (cbpc & 3)!=3)
cbpy ^= 0xF;
-
+
cbp = (cbpc & 3) | (cbpy << 2);
if (dquant) {
h263_decode_dquant(s);
}
-
+
s->mv_dir = MV_DIR_FORWARD;
if ((cbpc & 16) == 0) {
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
+ s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
/* 16x16 motion prediction */
s->mv_type = MV_TYPE_16X16;
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
mx = h263p_decode_umotion(s, pred_x);
else
mx = h263_decode_motion(s, pred_x, 1);
-
+
if (mx >= 0xffff)
return -1;
-
+
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
else
my = h263_decode_motion(s, pred_y, 1);
-
+
if (my >= 0xffff)
return -1;
s->mv[0][0][0] = mx;
s->mv[0][0][1] = my;
if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
- skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
+ skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
} else {
- s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
+ s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
s->mv_type = MV_TYPE_8X8;
for(i=0;i<4;i++) {
mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
mx = h263_decode_motion(s, pred_x, 1);
if (mx >= 0xffff)
return -1;
-
+
if (s->umvplus)
my = h263p_decode_umotion(s, pred_y);
- else
+ else
my = h263_decode_motion(s, pred_y, 1);
if (my >= 0xffff)
return -1;
int16_t *mot_val1 = s->current_picture.motion_val[1][ 2*(s->mb_x + s->mb_y*stride) ];
// const int mv_xy= s->mb_x + 1 + s->mb_y * s->mb_stride;
- //FIXME ugly
- mot_val0[0 ]= mot_val0[2 ]= mot_val0[0+2*stride]= mot_val0[2+2*stride]=
- mot_val0[1 ]= mot_val0[3 ]= mot_val0[1+2*stride]= mot_val0[3+2*stride]=
- mot_val1[0 ]= mot_val1[2 ]= mot_val1[0+2*stride]= mot_val1[2+2*stride]=
+ //FIXME ugly
+ mot_val0[0 ]= mot_val0[2 ]= mot_val0[0+2*stride]= mot_val0[2+2*stride]=
+ mot_val0[1 ]= mot_val0[3 ]= mot_val0[1+2*stride]= mot_val0[3+2*stride]=
+ mot_val1[0 ]= mot_val1[2 ]= mot_val1[0+2*stride]= mot_val1[2+2*stride]=
mot_val1[1 ]= mot_val1[3 ]= mot_val1[1+2*stride]= mot_val1[3+2*stride]= 0;
do{
av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
if(s->alt_inter_vlc==0 || (cbpc & 3)!=3)
cbpy ^= 0xF;
-
+
cbp = (cbpc & 3) | (cbpy << 2);
}else
cbp=0;
-
+
assert(!s->mb_intra);
if(IS_QUANT(mb_type)){
mx = h263_decode_motion(s, mx, 1);
my = h263_decode_motion(s, my, 1);
-
+
s->mv[0][0][0] = mx;
s->mv[0][0][1] = my;
mot_val[0 ]= mot_val[2 ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx;
mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
}
-
+
if(USES_LIST(mb_type, 1)){
int16_t *mot_val= h263_pred_motion(s, 0, 1, &mx, &my);
s->mv_dir |= MV_DIR_BACKWARD;
-
+
mx = h263_decode_motion(s, mx, 1);
my = h263_decode_motion(s, my, 1);
mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
}
}
-
+
s->current_picture.mb_type[xy]= mb_type;
/* decode each block */
s->ac_pred = get_bits1(&s->gb);
if(s->ac_pred){
s->current_picture.mb_type[xy]= MB_TYPE_INTRA | MB_TYPE_ACPRED;
-
+
s->h263_aic_dir = get_bits1(&s->gb);
}
}else
s->ac_pred = 0;
-
+
cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
if(cbpy<0){
av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
/* per-MB end of slice check */
{
int v= show_bits(&s->gb, 16);
-
+
if(get_bits_count(&s->gb) + 16 > s->gb.size_in_bits){
v>>= get_bits_count(&s->gb) + 16 - s->gb.size_in_bits;
}
return SLICE_END;
}
- return SLICE_OK;
+ return SLICE_OK;
}
int ff_mpeg4_decode_mb(MpegEncContext *s,
int16_t *mot_val;
static int8_t quant_tab[4] = { -1, -2, 1, 2 };
const int xy= s->mb_x + s->mb_y * s->mb_stride;
-
+
assert(s->h263_pred);
-
+
if (s->pict_type == P_TYPE || s->pict_type==S_TYPE) {
do{
if (get_bits1(&s->gb)) {
return -1;
}
}while(cbpc == 20);
-
+
s->dsp.clear_blocks(s->block[0]);
dquant = cbpc & 8;
s->mb_intra = ((cbpc & 4) != 0);
if (s->mb_intra) goto intra;
-
+
if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
s->mcsel= get_bits1(&s->gb);
else s->mcsel= 0;
cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;
-
+
cbp = (cbpc & 3) | (cbpy << 2);
if (dquant) {
ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
}
if((!s->progressive_sequence) && (cbp || (s->workaround_bugs&FF_BUG_XVID_ILACE)))
s->interlaced_dct= get_bits1(&s->gb);
-
+
s->mv_dir = MV_DIR_FORWARD;
if ((cbpc & 16) == 0) {
if(s->mcsel){
s->mv[0][0][0] = mx;
s->mv[0][0][1] = my;
}else if((!s->progressive_sequence) && get_bits1(&s->gb)){
- s->current_picture.mb_type[xy]= MB_TYPE_16x8 | MB_TYPE_L0 | MB_TYPE_INTERLACED;
+ s->current_picture.mb_type[xy]= MB_TYPE_16x8 | MB_TYPE_L0 | MB_TYPE_INTERLACED;
/* 16x8 field motion prediction */
s->mv_type= MV_TYPE_FIELD;
s->field_select[0][1]= get_bits1(&s->gb);
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
-
+
for(i=0; i<2; i++){
mx = h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
-
+
my = h263_decode_motion(s, pred_y/2, s->f_code);
if (my >= 0xffff)
return -1;
s->mv[0][i][1] = my;
}
}else{
- s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
+ s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
/* 16x16 motion prediction */
s->mv_type = MV_TYPE_16X16;
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
mx = h263_decode_motion(s, pred_x, s->f_code);
-
+
if (mx >= 0xffff)
return -1;
-
+
my = h263_decode_motion(s, pred_y, s->f_code);
-
+
if (my >= 0xffff)
return -1;
s->mv[0][0][0] = mx;
s->mv[0][0][1] = my;
}
} else {
- s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
+ s->current_picture.mb_type[xy]= MB_TYPE_8x8 | MB_TYPE_L0;
s->mv_type = MV_TYPE_8X8;
for(i=0;i<4;i++) {
mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
mx = h263_decode_motion(s, pred_x, s->f_code);
if (mx >= 0xffff)
return -1;
-
+
my = h263_decode_motion(s, pred_y, s->f_code);
if (my >= 0xffff)
return -1;
if(s->mb_x==0){
for(i=0; i<2; i++){
- s->last_mv[i][0][0]=
- s->last_mv[i][0][1]=
- s->last_mv[i][1][0]=
+ s->last_mv[i][0][0]=
+ s->last_mv[i][0][1]=
+ s->last_mv[i][1][0]=
s->last_mv[i][1][1]= 0;
}
}
s->mv[0][0][1] = 0;
s->mv[1][0][0] = 0;
s->mv[1][0][1] = 0;
- s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
+ s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
goto end;
}
- modb1= get_bits1(&s->gb);
+ modb1= get_bits1(&s->gb);
if(modb1){
mb_type= MB_TYPE_DIRECT2 | MB_TYPE_SKIP | MB_TYPE_L0L1; //like MB_TYPE_B_DIRECT but no vectors coded
cbp=0;
s->last_mv[0][1][0]= s->last_mv[0][0][0]= s->mv[0][0][0] = mx;
s->last_mv[0][1][1]= s->last_mv[0][0][1]= s->mv[0][0][1] = my;
}
-
+
if(USES_LIST(mb_type, 1)){
s->mv_dir |= MV_DIR_BACKWARD;
if(USES_LIST(mb_type, 0)){
s->mv_dir = MV_DIR_FORWARD;
-
+
for(i=0; i<2; i++){
mx = h263_decode_motion(s, s->last_mv[0][i][0] , s->f_code);
my = h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code);
s->last_mv[0][i][1]= (s->mv[0][i][1] = my)*2;
}
}
-
+
if(USES_LIST(mb_type, 1)){
s->mv_dir |= MV_DIR_BACKWARD;
}
}
}
-
+
if(IS_DIRECT(mb_type)){
if(IS_SKIP(mb_type))
mx=my=0;
mx = h263_decode_motion(s, 0, 1);
my = h263_decode_motion(s, 0, 1);
}
-
+
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
mb_type |= ff_mpeg4_set_direct_mv(s, mx, my);
}
s->current_picture.mb_type[xy]= MB_TYPE_INTRA | MB_TYPE_ACPRED;
else
s->current_picture.mb_type[xy]= MB_TYPE_INTRA;
-
+
cbpy = get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
if(cbpy<0){
av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y);
if (dquant) {
ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
}
-
+
if(!s->progressive_sequence)
s->interlaced_dct= get_bits1(&s->gb);
}
}
- return SLICE_OK;
+ return SLICE_OK;
}
static int h263_decode_motion(MpegEncContext * s, int pred, int f_code)
val += 64;
if (pred > 32 && val > 63)
val -= 64;
-
+
}
return val;
}
static int h263p_decode_umotion(MpegEncContext * s, int pred)
{
int code = 0, sign;
-
+
if (get_bits1(&s->gb)) /* Motion difference = 0 */
return pred;
-
+
code = 2 + get_bits1(&s->gb);
-
+
while (get_bits1(&s->gb))
{
code <<= 1;
}
sign = code & 1;
code >>= 1;
-
+
code = (sign) ? (pred - code) : (pred + code);
#ifdef DEBUG
av_log( s->avctx, AV_LOG_DEBUG,"H.263+ UMV Motion = %d\n", code);
#endif
- return code;
+ return code;
}
rl = &rl_intra_aic;
i = 0;
if (s->ac_pred) {
- if (s->h263_aic_dir)
+ if (s->h263_aic_dir)
scan_table = s->intra_v_scantable.permutated; /* left */
else
scan_table = s->intra_h_scantable.permutated; /* top */
break;
i++;
}
-not_coded:
+not_coded:
if (s->mb_intra && s->h263_aic) {
h263_pred_acdc(s, block, n);
i = 63;
{
int level, code;
- if (n < 4)
+ if (n < 4)
code = get_vlc2(&s->gb, dc_lum.table, DC_VLC_BITS, 1);
- else
+ else
code = get_vlc2(&s->gb, dc_chrom.table, DC_VLC_BITS, 1);
if (code < 0 || code > 9 /* && s->nbit<9 */){
av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
int qmul, qadd;
//Note intra & rvlc should be optimized away if this is inlined
-
+
if(intra) {
if(s->qscale < s->intra_dc_threshold){
/* DC coef */
i = 0;
}else{
i = -1;
- }
- if (!coded)
+ }
+ if (!coded)
goto not_coded;
-
- if(rvlc){
+
+ if(rvlc){
rl = &rvlc_rl_intra;
rl_vlc = rvlc_rl_intra.rl_vlc[0];
}else{
rl_vlc = rl_intra.rl_vlc[0];
}
if (s->ac_pred) {
- if (dc_pred_dir == 0)
+ if (dc_pred_dir == 0)
scan_table = s->intra_v_scantable.permutated; /* left */
else
scan_table = s->intra_h_scantable.permutated; /* top */
}
if(rvlc) rl = &rvlc_rl_inter;
else rl = &rl_inter;
-
+
scan_table = s->intra_scantable.permutated;
if(s->mpeg_quant){
qmul=1;
qadd=0;
- if(rvlc){
- rl_vlc = rvlc_rl_inter.rl_vlc[0];
+ if(rvlc){
+ rl_vlc = rvlc_rl_inter.rl_vlc[0];
}else{
- rl_vlc = rl_inter.rl_vlc[0];
+ rl_vlc = rl_inter.rl_vlc[0];
}
}else{
qmul = s->qscale << 1;
qadd = (s->qscale - 1) | 1;
- if(rvlc){
- rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale];
+ if(rvlc){
+ rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale];
}else{
- rl_vlc = rl_inter.rl_vlc[s->qscale];
+ rl_vlc = rl_inter.rl_vlc[s->qscale];
}
}
}
UPDATE_CACHE(re, &s->gb);
GET_RL_VLC(level, run, re, &s->gb, rl_vlc, TEX_VLC_BITS, 2, 0);
if (level==0) {
- /* escape */
+ /* escape */
if(rvlc){
if(SHOW_UBITS(re, &s->gb, 1)==0){
av_log(s->avctx, AV_LOG_ERROR, "1. marker bit missing in rvlc esc\n");
return -1;
}; SKIP_CACHE(re, &s->gb, 1);
-
+
last= SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1);
run= SHOW_UBITS(re, &s->gb, 6); LAST_SKIP_CACHE(re, &s->gb, 6);
SKIP_COUNTER(re, &s->gb, 1+1+6);
UPDATE_CACHE(re, &s->gb);
-
+
if(SHOW_UBITS(re, &s->gb, 1)==0){
av_log(s->avctx, AV_LOG_ERROR, "2. marker bit missing in rvlc esc\n");
return -1;
}; SKIP_CACHE(re, &s->gb, 1);
-
+
level= SHOW_UBITS(re, &s->gb, 11); SKIP_CACHE(re, &s->gb, 11);
-
+
if(SHOW_UBITS(re, &s->gb, 5)!=0x10){
av_log(s->avctx, AV_LOG_ERROR, "reverse esc missing\n");
return -1;
int cache;
cache= GET_CACHE(re, &s->gb);
- if(IS_3IV1)
+ if(IS_3IV1)
cache ^= 0xC0000000;
if (cache&0x80000000) {
SKIP_COUNTER(re, &s->gb, 1+12+1);
}
-
+
#if 0
if(s->error_resilience >= FF_ER_COMPLIANT){
const int abs_level= ABS(level);
if (intra) {
if(s->qscale >= s->intra_dc_threshold){
block[0] = ff_mpeg4_pred_dc(s, n, block[0], &dc_pred_dir, 0);
-
+
if(i == -1) i=0;
}
{
int format, width, height, i;
uint32_t startcode;
-
+
align_get_bits(&s->gb);
startcode= get_bits(&s->gb, 22-8);
for(i= s->gb.size_in_bits - get_bits_count(&s->gb); i>24; i-=8) {
startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF;
-
+
if(startcode == 0x20)
break;
}
-
+
if (startcode != 0x20) {
av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
return -1;
s->current_picture_ptr->pts=
s->picture_number= (s->picture_number&~0xFF) + i;
- /* PTYPE starts here */
+ /* PTYPE starts here */
if (get_bits1(&s->gb) != 1) {
/* marker */
av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n");
height = h263_format[format][1];
if (!width)
return -1;
-
+
s->pict_type = I_TYPE + get_bits1(&s->gb);
- s->h263_long_vectors = get_bits1(&s->gb);
+ s->h263_long_vectors = get_bits1(&s->gb);
if (get_bits1(&s->gb) != 0) {
av_log(s->avctx, AV_LOG_ERROR, "H263 SAC not supported\n");
}
s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
s->unrestricted_mv = s->h263_long_vectors || s->obmc;
-
+
if (get_bits1(&s->gb) != 0) {
av_log(s->avctx, AV_LOG_ERROR, "H263 PB frame not supported\n");
return -1; /* not PB frame */
s->avctx->time_base= (AVRational){1001, 30000};
} else {
int ufep;
-
+
/* H.263v2 */
s->h263_plus = 1;
ufep = get_bits(&s->gb, 3); /* Update Full Extended PTYPE */
- /* ufep other than 0 and 1 are reserved */
+ /* ufep other than 0 and 1 are reserved */
if (ufep == 1) {
- /* OPPTYPE */
+ /* OPPTYPE */
format = get_bits(&s->gb, 3);
dprintf("ufep=1, format: %d\n", format);
s->custom_pcf= get_bits1(&s->gb);
s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */
s->loop_filter= get_bits1(&s->gb);
s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter;
-
+
s->h263_slice_structured= get_bits1(&s->gb);
if (get_bits1(&s->gb) != 0) {
av_log(s->avctx, AV_LOG_ERROR, "Reference Picture Selection not supported\n");
s->modified_quant= get_bits1(&s->gb);
if(s->modified_quant)
s->chroma_qscale_table= ff_h263_chroma_qscale_table;
-
+
skip_bits(&s->gb, 1); /* Prevent start code emulation */
skip_bits(&s->gb, 3); /* Reserved */
av_log(s->avctx, AV_LOG_ERROR, "Bad UFEP type (%d)\n", ufep);
return -1;
}
-
+
/* MPPTYPE */
s->pict_type = get_bits(&s->gb, 3);
switch(s->pict_type){
skip_bits(&s->gb, 2);
s->no_rounding = get_bits1(&s->gb);
skip_bits(&s->gb, 4);
-
+
/* Get the picture dimensions */
if (ufep) {
if (format == 6) {
s->avctx->time_base= (AVRational){1001, 30000};
}
}
-
+
if(s->custom_pcf){
skip_bits(&s->gb, 2); //extended Temporal reference
}
if (ufep) {
if (s->umvplus) {
if(get_bits1(&s->gb)==0) /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */
- skip_bits1(&s->gb);
+ skip_bits1(&s->gb);
}
if(s->h263_slice_structured){
if (get_bits1(&s->gb) != 0) {
}
}
}
-
+
s->qscale = get_bits(&s->gb, 5);
}
}
}
s->f_code = 1;
-
+
if(s->h263_aic){
- s->y_dc_scale_table=
+ s->y_dc_scale_table=
s->c_dc_scale_table= ff_aic_dc_scale_table;
}else{
s->y_dc_scale_table=
}
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n",
+ av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n",
s->qscale, av_get_pict_type_char(s->pict_type),
s->gb.size_in_bits, 1-s->no_rounding,
s->obmc ? " AP" : "",
s->loop_filter ? " LOOP" : "",
s->h263_slice_structured ? " SS" : "",
s->avctx->time_base.den, s->avctx->time_base.num
- );
+ );
}
#if 1
if (s->pict_type == I_TYPE && s->avctx->codec_tag == ff_get_fourcc("ZYGO")){
x= get_xbits(gb, length);
}
if(!(s->divx_version==500 && s->divx_build==413)) skip_bits1(gb); /* marker bit */
-
+
length= get_vlc(gb, &sprite_trajectory);
if(length){
y=get_xbits(gb, length);
}
/* sprite_ref[3][0]= (a>>1)*(2*vop_ref[3][0] + d[0][0] + d[1][0] + d[2][0] + d[3][0]);
sprite_ref[3][1]= (a>>1)*(2*vop_ref[3][1] + d[0][1] + d[1][1] + d[2][1] + d[3][1]); */
-
+
// this is mostly identical to the mpeg4 std (and is totally unreadable because of that ...)
// perhaps it should be reordered to be more readable ...
// the idea behind this virtual_ref mess is to be able to use shifts later per pixel instead of divides
// so the distance between points is converted from w&h based to w2&h2 based which are of the 2^x form
- virtual_ref[0][0]= 16*(vop_ref[0][0] + w2)
+ virtual_ref[0][0]= 16*(vop_ref[0][0] + w2)
+ ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + w2*(r*sprite_ref[1][0] - 16*vop_ref[1][0])),w);
- virtual_ref[0][1]= 16*vop_ref[0][1]
+ virtual_ref[0][1]= 16*vop_ref[0][1]
+ ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + w2*(r*sprite_ref[1][1] - 16*vop_ref[1][1])),w);
- virtual_ref[1][0]= 16*vop_ref[0][0]
+ virtual_ref[1][0]= 16*vop_ref[0][0]
+ ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + h2*(r*sprite_ref[2][0] - 16*vop_ref[2][0])),h);
- virtual_ref[1][1]= 16*(vop_ref[0][1] + h2)
+ virtual_ref[1][1]= 16*(vop_ref[0][1] + h2)
+ ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + h2*(r*sprite_ref[2][1] - 16*vop_ref[2][1])),h);
-
+
switch(s->num_sprite_warping_points)
{
case 0:
+ (1<<(alpha+rho-1));
s->sprite_offset[1][0]= ( (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][0] + 1)
+( r*sprite_ref[0][1] - virtual_ref[0][1])*(-2*vop_ref[0][1] + 1)
- +2*w2*r*sprite_ref[0][0]
- - 16*w2
+ +2*w2*r*sprite_ref[0][0]
+ - 16*w2
+ (1<<(alpha+rho+1)));
- s->sprite_offset[1][1]= ( (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-2*vop_ref[0][0] + 1)
+ s->sprite_offset[1][1]= ( (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-2*vop_ref[0][0] + 1)
+(-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][1] + 1)
- +2*w2*r*sprite_ref[0][1]
+ +2*w2*r*sprite_ref[0][1]
- 16*w2
+ (1<<(alpha+rho+1)));
s->sprite_delta[0][0]= (-r*sprite_ref[0][0] + virtual_ref[0][0]);
s->sprite_delta[0][1]= (+r*sprite_ref[0][1] - virtual_ref[0][1]);
s->sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1]);
s->sprite_delta[1][1]= (-r*sprite_ref[0][0] + virtual_ref[0][0]);
-
+
s->sprite_shift[0]= alpha+rho;
s->sprite_shift[1]= alpha+rho+2;
break;
s->sprite_delta[0][1]= (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3;
s->sprite_delta[1][0]= (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3;
s->sprite_delta[1][1]= (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3;
-
+
s->sprite_shift[0]= alpha + beta + rho - min_ab;
s->sprite_shift[1]= alpha + beta + rho - min_ab + 2;
break;
}
- /* try to simplify the situation */
+ /* try to simplify the situation */
if( s->sprite_delta[0][0] == a<<s->sprite_shift[0]
&& s->sprite_delta[0][1] == 0
&& s->sprite_delta[1][0] == 0
vop_ref[0][0], vop_ref[0][1],
vop_ref[1][0], vop_ref[1][1],
vop_ref[2][0], vop_ref[2][1],
- sprite_ref[0][0], sprite_ref[0][1],
- sprite_ref[1][0], sprite_ref[1][1],
- sprite_ref[2][0], sprite_ref[2][1],
- virtual_ref[0][0], virtual_ref[0][1],
+ sprite_ref[0][0], sprite_ref[0][1],
+ sprite_ref[1][0], sprite_ref[1][1],
+ sprite_ref[2][0], sprite_ref[2][1],
+ virtual_ref[0][0], virtual_ref[0][1],
virtual_ref[1][0], virtual_ref[1][1]
);
-
+
printf("offset: %d:%d , delta: %d %d %d %d, shift %d\n",
s->sprite_offset[0][0], s->sprite_offset[0][1],
s->sprite_delta[0][0], s->sprite_delta[0][1],
skip_bits1(gb);
skip_bits1(gb);
-
+
return 0;
}
}
//printf("vo type:%d\n",s->vo_type);
s->aspect_ratio_info= get_bits(gb, 4);
- if(s->aspect_ratio_info == FF_ASPECT_EXTENDED){
+ if(s->aspect_ratio_info == FF_ASPECT_EXTENDED){
s->avctx->sample_aspect_ratio.num= get_bits(gb, 8); // par_width
s->avctx->sample_aspect_ratio.den= get_bits(gb, 8); // par_height
}else{
get_bits(gb, 11); /* first_half_vbv_occupancy */
skip_bits1(gb); /* marker */
get_bits(gb, 15); /* latter_half_vbv_occupancy */
- skip_bits1(gb); /* marker */
+ skip_bits1(gb); /* marker */
}
}else{
// set low delay flag only once the smartest? low delay detection won't be overriden
}
check_marker(gb, "before time_increment_resolution");
-
+
s->avctx->time_base.den = get_bits(gb, 16);
if(!s->avctx->time_base.den){
av_log(s->avctx, AV_LOG_ERROR, "time_base.den==0\n");
return -1;
}
-
+
s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1;
if (s->time_increment_bits < 1)
s->time_increment_bits = 1;
-
+
check_marker(gb, "before fixed_vop_rate");
if (get_bits1(gb) != 0) { /* fixed_vop_rate */
// printf("width/height: %d %d\n", width, height);
}
}
-
- s->progressive_sequence=
+
+ s->progressive_sequence=
s->progressive_frame= get_bits1(gb)^1;
- if(!get_bits1(gb) && (s->avctx->debug & FF_DEBUG_PICT_INFO))
+ if(!get_bits1(gb) && (s->avctx->debug & FF_DEBUG_PICT_INFO))
av_log(s->avctx, AV_LOG_INFO, "MPEG4 OBMC not supported (very likely buggy encoder)\n"); /* OBMC Disable */
if (vo_ver_id == 1) {
s->vol_sprite_usage = get_bits1(gb); /* vol_sprite_usage */
s->sprite_warping_accuracy = get_bits(gb, 2);
s->sprite_brightness_change= get_bits1(gb);
if(s->vol_sprite_usage==STATIC_SPRITE)
- s->low_latency_sprite= get_bits1(gb);
+ s->low_latency_sprite= get_bits1(gb);
}
// FIXME sadct disable bit if verid!=1 && shape not rect
-
+
if (get_bits1(gb) == 1) { /* not_8_bit */
s->quant_precision = get_bits(gb, 4); /* quant_precision */
if(get_bits(gb, 4)!=8) av_log(s->avctx, AV_LOG_ERROR, "N-bit not supported\n"); /* bits_per_pixel */
} else {
s->quant_precision = 5;
}
-
+
// FIXME a bunch of grayscale shape things
if((s->mpeg_quant=get_bits1(gb))){ /* vol_quant_type */
int i, v;
-
+
/* load default matrixes */
for(i=0; i<64; i++){
int j= s->dsp.idct_permutation[i];
v= ff_mpeg4_default_intra_matrix[i];
s->intra_matrix[j]= v;
s->chroma_intra_matrix[j]= v;
-
+
v= ff_mpeg4_default_non_intra_matrix[i];
s->inter_matrix[j]= v;
s->chroma_inter_matrix[j]= v;
int j;
v= get_bits(gb, 8);
if(v==0) break;
-
+
last= v;
j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ];
s->intra_matrix[j]= v;
if(s->data_partitioning){
s->rvlc= get_bits1(gb);
}
-
+
if(vo_ver_id != 1) {
s->new_pred= get_bits1(gb);
if(s->new_pred){
int h_sampling_factor_m;
int v_sampling_factor_n;
int v_sampling_factor_m;
-
+
s->hierachy_type= get_bits1(gb);
ref_layer_id= get_bits(gb, 4);
ref_layer_sampling_dir= get_bits1(gb);
v_sampling_factor_n= get_bits(gb, 5);
v_sampling_factor_m= get_bits(gb, 5);
s->enhancement_type= get_bits1(gb);
-
- if( h_sampling_factor_n==0 || h_sampling_factor_m==0
+
+ if( h_sampling_factor_n==0 || h_sampling_factor_m==0
|| v_sampling_factor_n==0 || v_sampling_factor_m==0){
-
+
// fprintf(stderr, "illegal scalability header (VERY broken encoder), trying to workaround\n");
s->scalability=0;
-
+
*gb= bak;
}else
av_log(s->avctx, AV_LOG_ERROR, "scalability not supported\n");
-
+
// bin shape stuff FIXME
}
}
s->divx_build= build;
s->divx_packed= e==3 && last=='p';
}
-
+
/* ffmpeg detection */
e=sscanf(buf, "FFmpe%*[^b]b%d", &build)+3;
if(e!=4)
- e=sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);
+ e=sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);
if(e!=4){
e=sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3)+1;
if (e>1)
if(e==4){
s->lavc_build= build;
}
-
+
/* xvid detection */
e=sscanf(buf, "XviD%d", &build);
if(e==1){
av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n");
s->low_delay=0;
}
-
+
s->partitioned_frame= s->data_partitioning && s->pict_type!=B_TYPE;
if(s->partitioned_frame)
s->decode_mb= mpeg4_decode_partitioned_mb;
s->decode_mb= ff_mpeg4_decode_mb;
time_incr=0;
- while (get_bits1(gb) != 0)
+ while (get_bits1(gb) != 0)
time_incr++;
check_marker(gb, "before time_increment");
av_log(s->avctx, AV_LOG_ERROR, "my guess is %d bits ;)\n",s->time_increment_bits);
}
-
+
if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further
else time_increment= get_bits(gb, s->time_increment_bits);
-
+
// printf("%d %X\n", s->time_increment_bits, time_increment);
//av_log(s->avctx, AV_LOG_DEBUG, " type:%d modulo_time_base:%d increment:%d t_frame %d\n", s->pict_type, time_incr, time_increment, s->t_frame);
if(s->pict_type!=B_TYPE){
// printf("messed up order, maybe after seeking? skipping current b frame\n");
return FRAME_SKIPPED;
}
-
+
if(s->t_frame==0) s->t_frame= s->pb_time;
if(s->t_frame==0) s->t_frame=1; // 1/0 protection
- s->pp_field_time= ( ROUNDED_DIV(s->last_non_b_time, s->t_frame)
+ s->pp_field_time= ( ROUNDED_DIV(s->last_non_b_time, s->t_frame)
- ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
- s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame)
+ s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame)
- ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
}
//av_log(s->avctx, AV_LOG_DEBUG, "last nonb %Ld last_base %d time %Ld pp %d pb %d t %d ppf %d pbf %d\n", s->last_non_b_time, s->last_time_base, s->time, s->pp_time, s->pb_time, s->t_frame, s->pp_field_time, s->pb_field_time);
-
+
if(s->avctx->time_base.num)
s->current_picture_ptr->pts= (s->time + s->avctx->time_base.num/2) / s->avctx->time_base.num;
else
av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n", s->current_picture_ptr->pts);
check_marker(gb, "before vop_coded");
-
+
/* vop coded */
if (get_bits1(gb) != 1){
if(s->avctx->debug&FF_DEBUG_PICT_INFO)
return FRAME_SKIPPED;
}
//printf("time %d %d %d || %Ld %Ld %Ld\n", s->time_increment_bits, s->avctx->time_base.den, s->time_base,
-//s->time, s->last_non_b_time, s->last_non_b_time - s->pp_time);
+//s->time, s->last_non_b_time, s->last_non_b_time - s->pp_time);
if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == P_TYPE
|| (s->pict_type == S_TYPE && s->vol_sprite_usage==GMC_SPRITE))) {
/* rounding type for motion estimation */
if (s->shape != RECT_SHAPE) {
if (s->vol_sprite_usage != 1 || s->pict_type != I_TYPE) {
int width, height, hor_spat_ref, ver_spat_ref;
-
+
width = get_bits(gb, 13);
skip_bits1(gb); /* marker */
height = get_bits(gb, 13);
ver_spat_ref = get_bits(gb, 13); /* ver_spat_ref */
}
skip_bits1(gb); /* change_CR_disable */
-
+
if (get_bits1(gb) != 0) {
skip_bits(gb, 8); /* constant_alpha_value */
}
}
//FIXME complexity estimation stuff
-
+
if (s->shape != BIN_ONLY_SHAPE) {
s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ];
if(!s->progressive_sequence){
ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_alternate_horizontal_scan);
ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
}
-
+
if(s->pict_type == S_TYPE && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
mpeg4_decode_sprite_trajectory(s, gb);
if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n");
av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (qscale=0)\n");
return -1; // makes no sense to continue, as there is nothing left from the image then
}
-
+
if (s->pict_type != I_TYPE) {
s->f_code = get_bits(gb, 3); /* fcode_for */
if(s->f_code==0){
}
}else
s->f_code=1;
-
+
if (s->pict_type == B_TYPE) {
s->b_code = get_bits(gb, 3);
}else
s->b_code=1;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d\n",
- s->qscale, s->f_code, s->b_code,
- s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")),
- gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first,
+ av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d\n",
+ s->qscale, s->f_code, s->b_code,
+ s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")),
+ gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first,
s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points,
- s->sprite_warping_accuracy, 1-s->no_rounding, s->vo_type, s->vol_control_parameters ? " VOLC" : " ", s->intra_dc_threshold);
+ s->sprite_warping_accuracy, 1-s->no_rounding, s->vo_type, s->vol_control_parameters ? " VOLC" : " ", s->intra_dc_threshold);
}
if(!s->scalability){
s->picture_number++; // better than pic number==0 always ;)
- s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table; //FIXME add short header support
+ s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table; //FIXME add short header support
s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table;
if(s->workaround_bugs&FF_BUG_EDGE){
if((startcode&0xFFFFFF00) != 0x100)
continue; //no startcode
-
+
if(s->avctx->debug&FF_DEBUG_STARTCODE){
av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X ", startcode);
if (startcode<=0x11F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Start");
}
if(startcode >= 0x120 && startcode <= 0x12F){
- if(decode_vol_header(s, gb) < 0)
+ if(decode_vol_header(s, gb) < 0)
return -1;
}
else if(startcode == USER_DATA_STARTCODE){
s->h263_plus = 0;
s->pict_type = I_TYPE + get_bits1(&s->gb);
-
- s->unrestricted_mv = get_bits1(&s->gb);
+
+ s->unrestricted_mv = get_bits1(&s->gb);
s->h263_long_vectors = s->unrestricted_mv;
if (get_bits1(&s->gb) != 0) {
s->dropable= s->pict_type > P_TYPE;
if (s->dropable)
s->pict_type = P_TYPE;
-
+
skip_bits1(&s->gb); /* deblocking flag */
s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n",
s->dropable ? 'D' : av_get_pict_type_char(s->pict_type), s->h263_flv-1, s->qscale, s->picture_number);
}
-
+
s->y_dc_scale_table=
s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
/* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */
/* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */
-const uint8_t inter_MCBPC_code[28] = {
- 1, 3, 2, 5,
- 3, 4, 3, 3,
+const uint8_t inter_MCBPC_code[28] = {
+ 1, 3, 2, 5,
+ 3, 4, 3, 3,
3, 7, 6, 5,
4, 4, 3, 2,
2, 5, 4, 5,
1, 0, 0, 0, /* Stuffing */
2, 12, 14, 15,
};
-const uint8_t inter_MCBPC_bits[28] = {
+const uint8_t inter_MCBPC_bits[28] = {
1, 4, 4, 6, /* inter */
5, 8, 8, 7, /* intra */
3, 7, 7, 9, /* interQ */
};
static const uint8_t h263_mbtype_b_tab[15][2] = {
- {1, 1},
- {3, 3},
- {1, 5},
+ {1, 1},
+ {3, 3},
+ {1, 5},
{4, 4},
{5, 4},
{6, 6},
};
const uint16_t intra_vlc_aic[103][2] = {
-{ 0x2, 2 }, { 0x6, 3 }, { 0xe, 4 }, { 0xc, 5 },
-{ 0xd, 5 }, { 0x10, 6 }, { 0x11, 6 }, { 0x12, 6 },
-{ 0x16, 7 }, { 0x1b, 8 }, { 0x20, 9 }, { 0x21, 9 },
-{ 0x1a, 9 }, { 0x1b, 9 }, { 0x1c, 9 }, { 0x1d, 9 },
-{ 0x1e, 9 }, { 0x1f, 9 }, { 0x23, 11 }, { 0x22, 11 },
-{ 0x57, 12 }, { 0x56, 12 }, { 0x55, 12 }, { 0x54, 12 },
-{ 0x53, 12 }, { 0xf, 4 }, { 0x14, 6 }, { 0x14, 7 },
-{ 0x1e, 8 }, { 0xf, 10 }, { 0x21, 11 }, { 0x50, 12 },
-{ 0xb, 5 }, { 0x15, 7 }, { 0xe, 10 }, { 0x9, 10 },
-{ 0x15, 6 }, { 0x1d, 8 }, { 0xd, 10 }, { 0x51, 12 },
-{ 0x13, 6 }, { 0x23, 9 }, { 0x7, 11 }, { 0x17, 7 },
-{ 0x22, 9 }, { 0x52, 12 }, { 0x1c, 8 }, { 0xc, 10 },
-{ 0x1f, 8 }, { 0xb, 10 }, { 0x25, 9 }, { 0xa, 10 },
-{ 0x24, 9 }, { 0x6, 11 }, { 0x21, 10 }, { 0x20, 10 },
-{ 0x8, 10 }, { 0x20, 11 }, { 0x7, 4 }, { 0xc, 6 },
-{ 0x10, 7 }, { 0x13, 8 }, { 0x11, 9 }, { 0x12, 9 },
-{ 0x4, 10 }, { 0x27, 11 }, { 0x26, 11 }, { 0x5f, 12 },
-{ 0xf, 6 }, { 0x13, 9 }, { 0x5, 10 }, { 0x25, 11 },
-{ 0xe, 6 }, { 0x14, 9 }, { 0x24, 11 }, { 0xd, 6 },
-{ 0x6, 10 }, { 0x5e, 12 }, { 0x11, 7 }, { 0x7, 10 },
-{ 0x13, 7 }, { 0x5d, 12 }, { 0x12, 7 }, { 0x5c, 12 },
-{ 0x14, 8 }, { 0x5b, 12 }, { 0x15, 8 }, { 0x1a, 8 },
-{ 0x19, 8 }, { 0x18, 8 }, { 0x17, 8 }, { 0x16, 8 },
-{ 0x19, 9 }, { 0x15, 9 }, { 0x16, 9 }, { 0x18, 9 },
-{ 0x17, 9 }, { 0x4, 11 }, { 0x5, 11 }, { 0x58, 12 },
+{ 0x2, 2 }, { 0x6, 3 }, { 0xe, 4 }, { 0xc, 5 },
+{ 0xd, 5 }, { 0x10, 6 }, { 0x11, 6 }, { 0x12, 6 },
+{ 0x16, 7 }, { 0x1b, 8 }, { 0x20, 9 }, { 0x21, 9 },
+{ 0x1a, 9 }, { 0x1b, 9 }, { 0x1c, 9 }, { 0x1d, 9 },
+{ 0x1e, 9 }, { 0x1f, 9 }, { 0x23, 11 }, { 0x22, 11 },
+{ 0x57, 12 }, { 0x56, 12 }, { 0x55, 12 }, { 0x54, 12 },
+{ 0x53, 12 }, { 0xf, 4 }, { 0x14, 6 }, { 0x14, 7 },
+{ 0x1e, 8 }, { 0xf, 10 }, { 0x21, 11 }, { 0x50, 12 },
+{ 0xb, 5 }, { 0x15, 7 }, { 0xe, 10 }, { 0x9, 10 },
+{ 0x15, 6 }, { 0x1d, 8 }, { 0xd, 10 }, { 0x51, 12 },
+{ 0x13, 6 }, { 0x23, 9 }, { 0x7, 11 }, { 0x17, 7 },
+{ 0x22, 9 }, { 0x52, 12 }, { 0x1c, 8 }, { 0xc, 10 },
+{ 0x1f, 8 }, { 0xb, 10 }, { 0x25, 9 }, { 0xa, 10 },
+{ 0x24, 9 }, { 0x6, 11 }, { 0x21, 10 }, { 0x20, 10 },
+{ 0x8, 10 }, { 0x20, 11 }, { 0x7, 4 }, { 0xc, 6 },
+{ 0x10, 7 }, { 0x13, 8 }, { 0x11, 9 }, { 0x12, 9 },
+{ 0x4, 10 }, { 0x27, 11 }, { 0x26, 11 }, { 0x5f, 12 },
+{ 0xf, 6 }, { 0x13, 9 }, { 0x5, 10 }, { 0x25, 11 },
+{ 0xe, 6 }, { 0x14, 9 }, { 0x24, 11 }, { 0xd, 6 },
+{ 0x6, 10 }, { 0x5e, 12 }, { 0x11, 7 }, { 0x7, 10 },
+{ 0x13, 7 }, { 0x5d, 12 }, { 0x12, 7 }, { 0x5c, 12 },
+{ 0x14, 8 }, { 0x5b, 12 }, { 0x15, 8 }, { 0x1a, 8 },
+{ 0x19, 8 }, { 0x18, 8 }, { 0x17, 8 }, { 0x16, 8 },
+{ 0x19, 9 }, { 0x15, 9 }, { 0x16, 9 }, { 0x18, 9 },
+{ 0x17, 9 }, { 0x4, 11 }, { 0x5, 11 }, { 0x58, 12 },
{ 0x59, 12 }, { 0x5a, 12 }, { 0x3, 7 },
};
const int8_t intra_run_aic[102] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 4, 5, 5, 5, 6, 6,
- 7, 7, 8, 8, 9, 9, 10, 11,
-12, 13, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 1, 1, 1,
- 2, 2, 2, 3, 3, 3, 4, 4,
- 5, 5, 6, 6, 7, 7, 8, 9,
-10, 11, 12, 13, 14, 15, 16, 17,
-18, 19, 20, 21, 22, 23,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 3, 3, 3, 3,
+ 4, 4, 4, 5, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 11,
+12, 13, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1,
+ 2, 2, 2, 3, 3, 3, 4, 4,
+ 5, 5, 6, 6, 7, 7, 8, 9,
+10, 11, 12, 13, 14, 15, 16, 17,
+18, 19, 20, 21, 22, 23,
};
const int8_t intra_level_aic[102] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 20, 21, 22, 23, 24,
-25, 1, 2, 3, 4, 5, 6, 7,
- 1, 2, 3, 4, 1, 2, 3, 4,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 1,
- 1, 1, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 1, 2, 3, 4,
- 1, 2, 3, 1, 2, 3, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+17, 18, 19, 20, 21, 22, 23, 24,
+25, 1, 2, 3, 4, 5, 6, 7,
+ 1, 2, 3, 4, 1, 2, 3, 4,
+ 1, 2, 3, 1, 2, 3, 1, 2,
+ 1, 2, 1, 2, 1, 2, 1, 1,
+ 1, 1, 1, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 1, 2, 3, 4,
+ 1, 2, 3, 1, 2, 3, 1, 2,
+ 1, 2, 1, 2, 1, 2, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,
};
};
static const uint8_t wrong_run[102] = {
- 1, 2, 3, 5, 4, 10, 9, 8,
-11, 15, 17, 16, 23, 22, 21, 20,
-19, 18, 25, 24, 27, 26, 11, 7,
- 6, 1, 2, 13, 2, 2, 2, 2,
- 6, 12, 3, 9, 1, 3, 4, 3,
- 7, 4, 1, 1, 5, 5, 14, 6,
- 1, 7, 1, 8, 1, 1, 1, 1,
-10, 1, 1, 5, 9, 17, 25, 24,
-29, 33, 32, 41, 2, 23, 28, 31,
- 3, 22, 30, 4, 27, 40, 8, 26,
- 6, 39, 7, 38, 16, 37, 15, 10,
-11, 12, 13, 14, 1, 21, 20, 18,
+ 1, 2, 3, 5, 4, 10, 9, 8,
+11, 15, 17, 16, 23, 22, 21, 20,
+19, 18, 25, 24, 27, 26, 11, 7,
+ 6, 1, 2, 13, 2, 2, 2, 2,
+ 6, 12, 3, 9, 1, 3, 4, 3,
+ 7, 4, 1, 1, 5, 5, 14, 6,
+ 1, 7, 1, 8, 1, 1, 1, 1,
+10, 1, 1, 5, 9, 17, 25, 24,
+29, 33, 32, 41, 2, 23, 28, 31,
+ 3, 22, 30, 4, 27, 40, 8, 26,
+ 6, 39, 7, 38, 16, 37, 15, 10,
+11, 12, 13, 14, 1, 21, 20, 18,
19, 2, 1, 34, 35, 36
};
0, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,27,28
},{
0, 2, 3, 4, 5, 6, 7, 8, 9,10,11,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,31,31,26
-}
+}
};
const uint8_t ff_h263_chroma_qscale_table[32]={
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file h263dec.c
* H.263 decoder.
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
ff_msmpeg4_decode_init(s);
else
h263_decode_init_vlc(s);
-
+
return 0;
}
*/
static int get_consumed_bytes(MpegEncContext *s, int buf_size){
int pos= (get_bits_count(&s->gb)+7)>>3;
-
+
if(s->divx_packed){
//we would have to scan through the whole buf to handle the weird reordering ...
- return buf_size;
+ return buf_size;
}else if(s->flags&CODEC_FLAG_TRUNCATED){
pos -= s->parse_context.last_index;
if(pos<0) pos=0; // padding is not really read so this might be -1
const int mb_size= 16>>s->avctx->lowres;
s->last_resync_gb= s->gb;
s->first_slice_line= 1;
-
+
s->resync_mb_x= s->mb_x;
s->resync_mb_y= s->mb_y;
ff_set_qscale(s, s->qscale);
-
+
if(s->partitioned_frame){
const int qscale= s->qscale;
if(s->codec_id==CODEC_ID_MPEG4){
if(ff_mpeg4_decode_partitions(s) < 0)
- return -1;
+ return -1;
}
-
+
/* restore variables which were modified */
s->first_slice_line=1;
s->mb_x= s->resync_mb_x;
return 0;
}
}
-
+
if(s->msmpeg4_version==1){
s->last_dc[0]=
s->last_dc[1]=
s->last_dc[2]= 128;
}
-
+
ff_init_block_index(s);
for(; s->mb_x < s->mb_width; s->mb_x++) {
int ret;
ff_update_block_index(s);
if(s->resync_mb_x == s->mb_x && s->resync_mb_y+1 == s->mb_y){
- s->first_slice_line=0;
+ s->first_slice_line=0;
}
/* DCT & quantize */
-
+
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
// s->mb_skipped = 0;
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
s->padding_bug_score--;
-
+
if(++s->mb_x >= s->mb_width){
s->mb_x=0;
ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size);
s->mb_y++;
}
- return 0;
+ return 0;
}else if(ret==SLICE_NOEND){
av_log(s->avctx, AV_LOG_ERROR, "Slice mismatch at MB: %d\n", xy);
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x+1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
}
av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", xy);
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
-
+
return -1;
}
if(s->loop_filter)
ff_h263_loop_filter(s);
}
-
+
ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size);
-
+
s->mb_x= 0;
}
-
+
assert(s->mb_x==0 && s->mb_y==s->mb_height);
/* try to detect the padding bug */
if( s->codec_id==CODEC_ID_MPEG4
- && (s->workaround_bugs&FF_BUG_AUTODETECT)
+ && (s->workaround_bugs&FF_BUG_AUTODETECT)
&& s->gb.size_in_bits - get_bits_count(&s->gb) >=0
&& s->gb.size_in_bits - get_bits_count(&s->gb) < 48
// && !s->resync_marker
&& !s->data_partitioning){
-
+
const int bits_count= get_bits_count(&s->gb);
const int bits_left = s->gb.size_in_bits - bits_count;
-
+
if(bits_left==0){
s->padding_bug_score+=16;
} else if(bits_left != 1){
else if(v==0x7F && ((get_bits_count(&s->gb)+8)&8) && bits_left<=16)
s->padding_bug_score+= 4;
else
- s->padding_bug_score++;
- }
+ s->padding_bug_score++;
+ }
}
-
+
if(s->workaround_bugs&FF_BUG_AUTODETECT){
if(s->padding_bug_score > -2 && !s->data_partitioning /*&& (s->divx_version || !s->resync_marker)*/)
s->workaround_bugs |= FF_BUG_NO_PADDING;
if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly
int left= s->gb.size_in_bits - get_bits_count(&s->gb);
int max_extra=7;
-
+
/* no markers in M$ crap */
if(s->msmpeg4_version && s->pict_type==I_TYPE)
max_extra+= 17;
-
+
/* buggy padding but the frame should still end approximately at the bitstream end */
if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_resilience>=3)
max_extra+= 48;
else if((s->workaround_bugs&FF_BUG_NO_PADDING))
max_extra+= 256*256*256*64;
-
+
if(left>max_extra){
av_log(s->avctx, AV_LOG_ERROR, "discarding %d junk bits at end, next would be %X\n", left, show_bits(&s->gb, 24));
}
av_log(s->avctx, AV_LOG_ERROR, "overreading %d bits\n", -left);
}else
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
-
+
return 0;
}
- av_log(s->avctx, AV_LOG_ERROR, "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
+ av_log(s->avctx, AV_LOG_ERROR, "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
s->gb.size_in_bits - get_bits_count(&s->gb),
show_bits(&s->gb, 24), s->padding_bug_score);
-
+
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
return -1;
int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
int vop_found, i;
uint32_t state;
-
+
vop_found= pc->frame_start_found;
state= pc->state;
-
+
i=0;
if(!vop_found){
for(i=0; i<buf_size; i++){
state= (state<<8) | buf[i];
if((state&0xFFFFFF00) == 0x100){
pc->frame_start_found=0;
- pc->state=-1;
+ pc->state=-1;
return i-3;
}
}
static int h263_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
int vop_found, i;
uint32_t state;
-
+
vop_found= pc->frame_start_found;
state= pc->state;
-
+
i=0;
if(!vop_found){
for(i=0; i<buf_size; i++){
}
}
- if(vop_found){
+ if(vop_found){
for(; i<buf_size; i++){
state= (state<<8) | buf[i];
if(state>>(32-22) == 0x20){
pc->frame_start_found=0;
- pc->state=-1;
+ pc->state=-1;
return i-3;
}
}
}
pc->frame_start_found= vop_found;
pc->state= state;
-
+
return END_NOT_FOUND;
}
static int h263_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext *pc = s->priv_data;
int next;
-
+
next= h263_find_frame_end(pc, buf, buf_size);
if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
return next;
}
-int ff_h263_decode_frame(AVCodecContext *avctx,
+int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
int ret;
- AVFrame *pict = data;
-
+ AVFrame *pict = data;
+
#ifdef PRINT_FRAME_TIME
uint64_t time= rdtsc();
#endif
if(s->flags&CODEC_FLAG_TRUNCATED){
int next;
-
+
if(s->codec_id==CODEC_ID_MPEG4){
next= ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size);
}else if(s->codec_id==CODEC_ID_H263){
av_log(s->avctx, AV_LOG_ERROR, "this codec does not support truncated bitstreams\n");
return -1;
}
-
+
if( ff_combine_frame(&s->parse_context, next, &buf, &buf_size) < 0 )
return buf_size;
}
-
+
retry:
-
+
if(s->bitstream_buffer_size && (s->divx_packed || buf_size<20)){ //divx 5.01+/xvid frame reorder
init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size*8);
}else
if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
return -1;
}
-
+
//we need to set current_picture_ptr before reading the header, otherwise we cant store anyting im there
if(s->current_picture_ptr==NULL || s->current_picture_ptr->data[0]){
int i= ff_find_unused_picture(s, 0);
s->current_picture_ptr= &s->picture[i];
}
-
+
/* let's go :-) */
if (s->msmpeg4_version==5) {
ret= ff_wmv2_decode_picture_header(s);
} else if (s->h263_pred) {
if(s->avctx->extradata_size && s->picture_number==0){
GetBitContext gb;
-
+
init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size*8);
ret = ff_mpeg4_decode_picture_header(s, &gb);
}
} else {
ret = h263_decode_picture_header(s);
}
-
+
if(ret==FRAME_SKIPPED) return get_consumed_bytes(s, buf_size);
/* skip if the header was thrashed */
av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
return -1;
}
-
+
avctx->has_b_frames= !s->low_delay;
-
+
if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){
- if(s->avctx->stream_codec_tag == ff_get_fourcc("XVID") ||
+ if(s->avctx->stream_codec_tag == ff_get_fourcc("XVID") ||
s->avctx->codec_tag == ff_get_fourcc("XVID") || s->avctx->codec_tag == ff_get_fourcc("XVIX"))
s->xvid_build= -1;
#if 0
if(s->avctx->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
- && s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc
+ && s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc
s->xvid_build= -1;
#endif
}
if(s->avctx->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==0)
s->divx_version= 400; //divx 4
}
-
+
if(s->xvid_build && s->divx_version){
s->divx_version=
s->divx_build= 0;
}
if(s->workaround_bugs&FF_BUG_AUTODETECT){
- if(s->avctx->codec_tag == ff_get_fourcc("XVIX"))
+ if(s->avctx->codec_tag == ff_get_fourcc("XVIX"))
s->workaround_bugs|= FF_BUG_XVID_ILACE;
if(s->avctx->codec_tag == ff_get_fourcc("UMP4")){
if(s->xvid_build && s->xvid_build<=3)
s->padding_bug_score= 256*256*256*64;
-
+
if(s->xvid_build && s->xvid_build<=1)
s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
if(s->lavc_build && s->lavc_build<4653)
s->workaround_bugs|= FF_BUG_STD_QPEL;
-
+
if(s->lavc_build && s->lavc_build<4655)
s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE;
if(s->lavc_build && s->lavc_build<4670){
s->workaround_bugs|= FF_BUG_EDGE;
}
-
+
if(s->lavc_build && s->lavc_build<=4712)
s->workaround_bugs|= FF_BUG_DC_CLIP;
if(s->divx_version && s->divx_version<500){
s->workaround_bugs|= FF_BUG_EDGE;
}
-
+
if(s->divx_version)
s->workaround_bugs|= FF_BUG_HPEL_CHROMA;
#if 0
if( s->resync_marker==0 && s->data_partitioning==0 && s->divx_version==0
&& s->codec_id==CODEC_ID_MPEG4 && s->vo_type==0)
s->workaround_bugs|= FF_BUG_NO_PADDING;
-
+
if(s->lavc_build && s->lavc_build<4609) //FIXME not sure about the version num but a 4609 file seems ok
s->workaround_bugs|= FF_BUG_NO_PADDING;
#endif
}
-
+
if(s->workaround_bugs& FF_BUG_STD_QPEL){
SET_QPEL_FUNC(qpel_pixels_tab[0][ 5], qpel16_mc11_old_c)
SET_QPEL_FUNC(qpel_pixels_tab[0][ 7], qpel16_mc31_old_c)
}
if(avctx->debug & FF_DEBUG_BUGS)
- av_log(s->avctx, AV_LOG_DEBUG, "bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
+ av_log(s->avctx, AV_LOG_DEBUG, "bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
s->workaround_bugs, s->lavc_build, s->xvid_build, s->divx_version, s->divx_build,
s->divx_packed ? "p" : "");
-
+
#if 0 // dump bits per frame / qp / complexity
{
static FILE *f=NULL;
/* and other parameters. So then we could init the picture */
/* FIXME: By the way H263 decoder is evolving it should have */
/* an H263EncContext */
-
- if ( s->width != avctx->coded_width
+
+ if ( s->width != avctx->coded_width
|| s->height != avctx->coded_height) {
/* H.263 could change picture size any time */
ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P))
s->gob_index = ff_h263_get_gob_height(s);
-
+
// for hurry_up==5
s->current_picture.pict_type= s->pict_type;
s->current_picture.key_frame= s->pict_type == I_TYPE;
if(avctx->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size);
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
|| (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
- || avctx->skip_frame >= AVDISCARD_ALL)
+ || avctx->skip_frame >= AVDISCARD_ALL)
return get_consumed_bytes(s, buf_size);
/* skip everything if we are in a hurry>=5 */
if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
-
+
if(s->next_p_frame_damaged){
if(s->pict_type==B_TYPE)
return get_consumed_bytes(s, buf_size);
#endif
ff_er_frame_start(s);
-
+
//the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type
//which isnt available before MPV_frame_start()
if (s->msmpeg4_version==5){
}
/* decode each macroblock */
- s->mb_x=0;
+ s->mb_x=0;
s->mb_y=0;
-
+
decode_slice(s);
while(s->mb_y<s->mb_height){
if(s->msmpeg4_version){
if(ff_h263_resync(s)<0)
break;
}
-
+
if(s->msmpeg4_version<4 && s->h263_pred)
ff_mpeg4_clean_buffers(s);
if(msmpeg4_decode_ext_header(s, buf_size) < 0){
s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
}
-
+
/* divx 5.01+ bistream reorder stuff */
if(s->codec_id==CODEC_ID_MPEG4 && s->bitstream_buffer_size==0 && s->divx_packed){
int current_pos= get_bits_count(&s->gb)>>3;
int startcode_found=0;
-
+
if(buf_size - current_pos > 5){
int i;
for(i=current_pos; i<buf_size-3; i++){
if(startcode_found){
s->bitstream_buffer= av_fast_realloc(
- s->bitstream_buffer,
- &s->allocated_bitstream_buffer_size,
+ s->bitstream_buffer,
+ &s->allocated_bitstream_buffer_size,
buf_size - current_pos + FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(s->bitstream_buffer, buf + current_pos, buf_size - current_pos);
s->bitstream_buffer_size= buf_size - current_pos;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file h264.c
* H.264 / AVC / MPEG4 part10 codec.
* Sequence parameter set
*/
typedef struct SPS{
-
+
int profile_idc;
int level_idc;
int transform_bypass; ///< qpprime_y_zero_transform_bypass_flag
MMCO_LONG2UNUSED,
MMCO_SHORT2LONG,
MMCO_SET_MAX_LONG,
- MMCO_RESET,
+ MMCO_RESET,
MMCO_LONG,
} MMCOOpcode;
*/
typedef struct H264Context{
MpegEncContext s;
- int nal_ref_idc;
+ int nal_ref_idc;
int nal_unit_type;
#define NAL_SLICE 1
#define NAL_DPA 2
int top_mb_xy;
int left_mb_xy[2];
-
+
int8_t intra4x4_pred_mode_cache[5*8];
int8_t (*intra4x4_pred_mode)[8];
void (*pred4x4 [9+3])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
int8_t ref_cache[2][5*8] __align8;
#define LIST_NOT_USED -1 //FIXME rename?
#define PART_NOT_AVAILABLE -2
-
+
/**
* is 1 if the specific list MV&references are set to 0,0,-2.
*/
* block_offset[24..47] for field macroblocks
*/
int block_offset[2*(16+8)];
-
+
uint32_t *mb2b_xy; //FIXME are these 4 a good idea?
uint32_t *mb2b8_xy;
int b_stride; //FIXME use s->b4_stride
SPS sps_buffer[MAX_SPS_COUNT];
SPS sps; ///< current sps
-
+
PPS pps_buffer[MAX_PPS_COUNT];
/**
* current pps
uint8_t *slice_table; ///< slice_table_base + mb_stride + 1
int slice_type;
int slice_type_fixed;
-
+
//interlacing specific flags
int mb_aff_frame;
int mb_field_decoding_flag;
-
+
int sub_mb_type[4];
-
+
//POC stuff
int poc_lsb;
int poc_msb;
* frame_num for frames or 2*frame_num for field pics.
*/
int curr_pic_num;
-
+
/**
* max_frame_num or 2*max_frame_num for field pics.
*/
int chroma_weight[2][16][2];
int chroma_offset[2][16][2];
int implicit_weight[16][16];
-
+
//deblock
- int deblocking_filter; ///< disable_deblocking_filter_idc with 1<->0
+ int deblocking_filter; ///< disable_deblocking_filter_idc with 1<->0
int slice_alpha_c0_offset;
int slice_beta_offset;
-
+
int redundant_pic_count;
-
+
int direct_spatial_mv_pred;
int dist_scale_factor[16];
int map_col_to_list0[2][16];
Picture field_ref_list[2][32]; //FIXME size?
Picture *delayed_pic[16]; //FIXME size?
Picture *delayed_output_pic;
-
+
/**
* memory management control operations buffer.
*/
MMCO mmco[MAX_MMCO_COUNT];
int mmco_index;
-
+
int long_ref_count; ///< number of actual long term references
int short_ref_count; ///< number of actual short term references
-
+
//data partitioning
GetBitContext intra_gb;
GetBitContext inter_gb;
GetBitContext *intra_gb_ptr;
GetBitContext *inter_gb_ptr;
-
+
DCTELEM mb[16*24] __align8;
/**
uint8_t field_scan[16];
const uint8_t *zigzag_scan_q0;
const uint8_t *field_scan_q0;
-
+
int x264_build;
}H264Context;
static inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){ //FIXME ensure this IS inlined
uint8_t *p= (uint8_t*)vp;
assert(size==1 || size==4);
-
+
w *= size;
stride *= size;
-
+
assert((((long)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0);
assert((stride&(w-1))==0);
//FIXME check what gcc generates for 64 bit on x86 and possibly write a 32 bit ver of it
if(for_deblock && h->slice_num == 1)
return;
- //wow what a mess, why didn't they simplify the interlacing&intra stuff, i can't imagine that these complex rules are worth it
-
+ //wow what a mess, why didn't they simplify the interlacing&intra stuff, i can't imagine that these complex rules are worth it
+
top_xy = mb_xy - s->mb_stride;
topleft_xy = top_xy - 1;
topright_xy= top_xy + 1;
}
if(IS_INTRA(mb_type)){
- h->topleft_samples_available=
- h->top_samples_available=
+ h->topleft_samples_available=
+ h->top_samples_available=
h->left_samples_available= 0xFFFF;
h->topright_samples_available= 0xEEEA;
h->left_samples_available&= 0x5F5F;
}
}
-
+
if(!IS_INTRA(topleft_type) && (topleft_type==0 || h->pps.constrained_intra_pred))
h->topleft_samples_available&= 0x7FFF;
-
+
if(!IS_INTRA(topright_type) && (topright_type==0 || h->pps.constrained_intra_pred))
h->topright_samples_available&= 0xFBFF;
-
+
if(IS_INTRA4x4(mb_type)){
if(IS_INTRA4x4(top_type)){
h->intra4x4_pred_mode_cache[4+8*0]= h->intra4x4_pred_mode[top_xy][4];
}
}
}
-
-
+
+
/*
-0 . T T. T T T T
-1 L . .L . . . .
-2 L . .L . . . .
-3 . T TL . . . .
-4 L . .L . . . .
-5 L . .. . . . .
+0 . T T. T T T T
+1 L . .L . . . .
+2 L . .L . . . .
+3 . T TL . . . .
+4 L . .L . . . .
+5 L . .. . . . .
*/
//FIXME constraint_intra_pred & partitioning & nnz (lets hope this is just a typo in the spec)
if(top_type){
h->non_zero_count_cache[5+8*0]= h->non_zero_count[top_xy][5];
h->non_zero_count_cache[6+8*0]= h->non_zero_count[top_xy][6];
h->non_zero_count_cache[7+8*0]= h->non_zero_count[top_xy][3];
-
+
h->non_zero_count_cache[1+8*0]= h->non_zero_count[top_xy][9];
h->non_zero_count_cache[2+8*0]= h->non_zero_count[top_xy][8];
-
+
h->non_zero_count_cache[1+8*3]= h->non_zero_count[top_xy][12];
h->non_zero_count_cache[2+8*3]= h->non_zero_count[top_xy][11];
-
+
}else{
- h->non_zero_count_cache[4+8*0]=
+ h->non_zero_count_cache[4+8*0]=
h->non_zero_count_cache[5+8*0]=
h->non_zero_count_cache[6+8*0]=
h->non_zero_count_cache[7+8*0]=
-
+
h->non_zero_count_cache[1+8*0]=
h->non_zero_count_cache[2+8*0]=
-
+
h->non_zero_count_cache[1+8*3]=
h->non_zero_count_cache[2+8*3]= h->pps.cabac && !IS_INTRA(mb_type) ? 0 : 64;
-
+
}
for (i=0; i<2; i++) {
h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count[left_xy[i]][left_block[4+2*i]];
h->non_zero_count_cache[0+8*4 + 8*i]= h->non_zero_count[left_xy[i]][left_block[5+2*i]];
}else{
- h->non_zero_count_cache[3+8*1 + 2*8*i]=
- h->non_zero_count_cache[3+8*2 + 2*8*i]=
- h->non_zero_count_cache[0+8*1 + 8*i]=
+ h->non_zero_count_cache[3+8*1 + 2*8*i]=
+ h->non_zero_count_cache[3+8*2 + 2*8*i]=
+ h->non_zero_count_cache[0+8*1 + 8*i]=
h->non_zero_count_cache[0+8*4 + 8*i]= h->pps.cabac && !IS_INTRA(mb_type) ? 0 : 64;
}
}
continue;
}
h->mv_cache_clean[list]= 0;
-
+
if(IS_INTER(top_type)){
const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride;
const int b8_xy= h->mb2b8_xy[top_xy] + h->b8_stride;
h->ref_cache[list][scan8[0] + 2 - 1*8]=
h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][b8_xy + 1];
}else{
- *(uint32_t*)h->mv_cache [list][scan8[0] + 0 - 1*8]=
- *(uint32_t*)h->mv_cache [list][scan8[0] + 1 - 1*8]=
- *(uint32_t*)h->mv_cache [list][scan8[0] + 2 - 1*8]=
+ *(uint32_t*)h->mv_cache [list][scan8[0] + 0 - 1*8]=
+ *(uint32_t*)h->mv_cache [list][scan8[0] + 1 - 1*8]=
+ *(uint32_t*)h->mv_cache [list][scan8[0] + 2 - 1*8]=
*(uint32_t*)h->mv_cache [list][scan8[0] + 3 - 1*8]= 0;
*(uint32_t*)&h->ref_cache[list][scan8[0] + 0 - 1*8]= ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101;
}
const int b8_xy= h->mb2b8_xy[left_xy[0]] + 1;
*(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 0*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0]];
*(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[1]];
- h->ref_cache[list][scan8[0] - 1 + 0*8]=
+ h->ref_cache[list][scan8[0] - 1 + 0*8]=
h->ref_cache[list][scan8[0] - 1 + 1*8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[0]>>1)];
}else{
*(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 0*8]=
h->ref_cache[list][scan8[0] - 1 + 0*8]=
h->ref_cache[list][scan8[0] - 1 + 1*8]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
}
-
+
if(IS_INTER(left_type[1])){
const int b_xy= h->mb2b_xy[left_xy[1]] + 3;
const int b8_xy= h->mb2b8_xy[left_xy[1]] + 1;
*(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 2*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[2]];
*(uint32_t*)h->mv_cache[list][scan8[0] - 1 + 3*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[3]];
- h->ref_cache[list][scan8[0] - 1 + 2*8]=
+ h->ref_cache[list][scan8[0] - 1 + 2*8]=
h->ref_cache[list][scan8[0] - 1 + 3*8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[2]>>1)];
}else{
*(uint32_t*)h->mv_cache [list][scan8[0] - 1 + 2*8]=
*(uint32_t*)h->mv_cache[list][scan8[0] - 1 - 1*8]= 0;
h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
}
-
+
if(IS_INTER(topright_type)){
const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;
const int b8_xy= h->mb2b8_xy[topright_xy] + h->b8_stride;
*(uint32_t*)h->mv_cache [list][scan8[0] + 4 - 1*8]= 0;
h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
}
-
- h->ref_cache[list][scan8[5 ]+1] =
- h->ref_cache[list][scan8[7 ]+1] =
+
+ h->ref_cache[list][scan8[5 ]+1] =
+ h->ref_cache[list][scan8[7 ]+1] =
h->ref_cache[list][scan8[13]+1] = //FIXME remove past 3 (init somewhere else)
- h->ref_cache[list][scan8[4 ]] =
+ h->ref_cache[list][scan8[4 ]] =
h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE;
*(uint32_t*)h->mv_cache [list][scan8[5 ]+1]=
*(uint32_t*)h->mv_cache [list][scan8[7 ]+1]=
*(uint32_t*)h->mvd_cache[list][scan8[0] + 2 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 2];
*(uint32_t*)h->mvd_cache[list][scan8[0] + 3 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 3];
}else{
- *(uint32_t*)h->mvd_cache [list][scan8[0] + 0 - 1*8]=
- *(uint32_t*)h->mvd_cache [list][scan8[0] + 1 - 1*8]=
- *(uint32_t*)h->mvd_cache [list][scan8[0] + 2 - 1*8]=
+ *(uint32_t*)h->mvd_cache [list][scan8[0] + 0 - 1*8]=
+ *(uint32_t*)h->mvd_cache [list][scan8[0] + 1 - 1*8]=
+ *(uint32_t*)h->mvd_cache [list][scan8[0] + 2 - 1*8]=
*(uint32_t*)h->mvd_cache [list][scan8[0] + 3 - 1*8]= 0;
}
if(IS_INTER(left_type[0])){
}else{
*(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0;
}
-
+
//FIXME interlacing
if(IS_DIRECT(left_type[0])){
h->direct_cache[scan8[0] - 1 + 0*8]=
static const int8_t top [12]= {-1, 0,LEFT_DC_PRED,-1,-1,-1,-1,-1, 0};
static const int8_t left[12]= { 0,-1, TOP_DC_PRED, 0,-1,-1,-1, 0,-1,DC_128_PRED};
int i;
-
+
if(!(h->top_samples_available&0x8000)){
for(i=0; i<4; i++){
int status= top[ h->intra4x4_pred_mode_cache[scan8[0] + i] ];
}
}
}
-
+
if(!(h->left_samples_available&0x8000)){
for(i=0; i<4; i++){
int status= left[ h->intra4x4_pred_mode_cache[scan8[0] + 8*i] ];
MpegEncContext * const s = &h->s;
static const int8_t top [7]= {LEFT_DC_PRED8x8, 1,-1,-1};
static const int8_t left[7]= { TOP_DC_PRED8x8,-1, 2,-1,DC_128_PRED8x8};
-
+
if(mode < 0 || mode > 6) {
av_log(h->s.avctx, AV_LOG_ERROR, "out of range intra chroma pred mode at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
if(!(h->top_samples_available&0x8000)){
mode= top[ mode ];
if(mode<0){
return -1;
}
}
-
+
if(!(h->left_samples_available&0x8000)){
mode= left[ mode ];
if(mode<0){
av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra mode at %d %d\n", s->mb_x, s->mb_y);
return -1;
- }
+ }
}
return mode;
h->non_zero_count[mb_xy][4]= h->non_zero_count_cache[4+8*4];
h->non_zero_count[mb_xy][5]= h->non_zero_count_cache[5+8*4];
h->non_zero_count[mb_xy][6]= h->non_zero_count_cache[6+8*4];
-
+
h->non_zero_count[mb_xy][9]= h->non_zero_count_cache[1+8*2];
h->non_zero_count[mb_xy][8]= h->non_zero_count_cache[2+8*2];
h->non_zero_count[mb_xy][7]= h->non_zero_count_cache[2+8*1];
const int left= h->non_zero_count_cache[index8 - 1];
const int top = h->non_zero_count_cache[index8 - 8];
int i= left + top;
-
+
if(i<64) i= (i+1)>>1;
tprintf("pred_nnz L%X T%X n%d s%d P%X\n", left, top, n, scan8[n], i&31);
assert(part_width==1 || part_width==2 || part_width==4);
/* mv_cache
- B . . A T T T T
+ B . . A T T T T
U . . L . . , .
U . . L . . . .
U . . L . . , .
}else if(match_count==1){
if(left_ref==ref){
*mx= A[0];
- *my= A[1];
+ *my= A[1];
}else if(top_ref==ref){
*mx= B[0];
- *my= B[1];
+ *my= B[1];
}else{
*mx= C[0];
- *my= C[1];
+ *my= C[1];
}
}else{
if(top_ref == PART_NOT_AVAILABLE && diagonal_ref == PART_NOT_AVAILABLE && left_ref != PART_NOT_AVAILABLE){
*mx= A[0];
- *my= A[1];
+ *my= A[1];
}else{
*mx= mid_pred(A[0], B[0], C[0]);
*my= mid_pred(A[1], B[1], C[1]);
}
}
-
+
tprintf("pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1], diagonal_ref, C[0], C[1], left_ref, A[0], A[1], ref, *mx, *my, h->s.mb_x, h->s.mb_y, n, list);
}
const int16_t * const B= h->mv_cache[list][ scan8[0] - 8 ];
tprintf("pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1], h->s.mb_x, h->s.mb_y, n, list);
-
+
if(top_ref == ref){
*mx= B[0];
*my= B[1];
}else{
const int left_ref= h->ref_cache[list][ scan8[8] - 1 ];
const int16_t * const A= h->mv_cache[list][ scan8[8] - 1 ];
-
+
tprintf("pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", left_ref, A[0], A[1], h->s.mb_x, h->s.mb_y, n, list);
if(left_ref == ref){
if(n==0){
const int left_ref= h->ref_cache[list][ scan8[0] - 1 ];
const int16_t * const A= h->mv_cache[list][ scan8[0] - 1 ];
-
+
tprintf("pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", left_ref, A[0], A[1], h->s.mb_x, h->s.mb_y, n, list);
if(left_ref == ref){
int diagonal_ref;
diagonal_ref= fetch_diagonal_mv(h, &C, scan8[4], list, 2);
-
+
tprintf("pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", diagonal_ref, C[0], C[1], h->s.mb_x, h->s.mb_y, n, list);
- if(diagonal_ref == ref){
+ if(diagonal_ref == ref){
*mx= C[0];
*my= C[1];
return;
if(top_ref == PART_NOT_AVAILABLE || left_ref == PART_NOT_AVAILABLE
|| (top_ref == 0 && *(uint32_t*)h->mv_cache[0][ scan8[0] - 8 ] == 0)
|| (left_ref == 0 && *(uint32_t*)h->mv_cache[0][ scan8[0] - 1 ] == 0)){
-
+
*mx = *my = 0;
return;
}
-
+
pred_motion(h, 0, 4, 0, 0, mx, my);
return;
*mb_type |= MB_TYPE_DIRECT2;
tprintf("mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col);
-
+
if(h->direct_spatial_mv_pred){
int ref[2];
int mv[2][2];
if(IS_16X16(*mb_type)){
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, ref[1], 1);
- if(!IS_INTRA(mb_type_col)
+ if(!IS_INTRA(mb_type_col)
&& ( (l1ref0[0] == 0 && ABS(l1mv0[0][0]) <= 1 && ABS(l1mv0[0][1]) <= 1)
|| (l1ref0[0] < 0 && l1ref1[0] == 0 && ABS(l1mv1[0][0]) <= 1 && ABS(l1mv1[0][1]) <= 1
&& (h->x264_build>33 || !h->x264_build)))){
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
-
+
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
-
+
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4);
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, ref[1], 1);
-
+
/* col_zero_flag */
- if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0
- || (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0
+ if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0
+ || (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0
&& (h->x264_build>33 || !h->x264_build)))){
const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1;
for(i4=0; i4<4; i4++){
fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
continue;
}
-
+
ref0 = l1ref0[x8 + y8*h->b8_stride];
if(ref0 >= 0)
ref0 = h->map_col_to_list0[0][ref0];
l1mv= l1mv1;
}
dist_scale_factor = h->dist_scale_factor[ref0];
-
+
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
for(i4=0; i4<4; i4++){
}
continue;
}
-
+
for(y=0; y<4; y++){
*(uint64_t*)s->current_picture.motion_val[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+0 + 8*y];
*(uint64_t*)s->current_picture.motion_val[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+2 + 8*y];
s->current_picture.ref_index[list][b8_xy + 1 + y*h->b8_stride]= h->ref_cache[list][scan8[0]+2 + 16*y];
}
}
-
+
if(h->slice_type == B_TYPE && h->pps.cabac){
if(IS_8X8(mb_type)){
h->direct_table[b8_xy+1+0*h->b8_stride] = IS_DIRECT(h->sub_mb_type[1]) ? 1 : 0;
* @param consumed is the number of bytes used as input
* @param length is the length of the array
* @param dst_length is the number of decoded bytes FIXME here or a decode rbsp tailing?
- * @returns decoded bytes, might be src+1 if no escapes
+ * @returns decoded bytes, might be src+1 if no escapes
*/
static uint8_t *decode_nal(H264Context *h, uint8_t *src, int *dst_length, int *consumed, int length){
int i, si, di;
h->nal_unit_type= src[0]&0x1F;
src++; length--;
-#if 0
+#if 0
for(i=0; i<length; i++)
printf("%2X ", src[i]);
#endif
if(i>=length-1){ //no escaped 0
*dst_length= length;
*consumed= length+1; //+1 for the header
- return src;
+ return src;
}
h->rbsp_buffer= av_fast_realloc(h->rbsp_buffer, &h->rbsp_buffer_size, length);
//printf("decoding esc\n");
si=di=0;
- while(si<length){
+ while(si<length){
//remove escapes (very rare 1:2^22)
if(si+2<length && src[si]==0 && src[si+1]==0 && src[si+2]<=3){
if(src[si+2]==3){ //escape
static int encode_nal(H264Context *h, uint8_t *dst, uint8_t *src, int length, int dst_length){
int i, escape_count, si, di;
uint8_t *temp;
-
+
assert(length>=0);
assert(dst_length>0);
-
+
dst[0]= (h->nal_ref_idc<<5) + h->nal_unit_type;
if(length==0) return 1;
escape_count= 0;
for(i=0; i<length; i+=2){
if(src[i]) continue;
- if(i>0 && src[i-1]==0)
+ if(i>0 && src[i-1]==0)
i--;
if(i+2<length && src[i+1]==0 && src[i+2]<=3){
escape_count++;
i+=2;
}
}
-
- if(escape_count==0){
+
+ if(escape_count==0){
if(dst+1 != src)
memcpy(dst+1, src, length);
return length + 1;
}
-
+
if(length + escape_count + 1> dst_length)
return -1;
h->rbsp_buffer= av_fast_realloc(h->rbsp_buffer, &h->rbsp_buffer_size, length + escape_count);
temp= h->rbsp_buffer;
//printf("encoding esc\n");
-
+
si= 0;
di= 0;
while(si < length){
if(si+2<length && src[si]==0 && src[si+1]==0 && src[si+2]<=3){
temp[di++]= 0; si++;
temp[di++]= 0; si++;
- temp[di++]= 3;
+ temp[di++]= 3;
temp[di++]= src[si++];
}
else
temp[di++]= src[si++];
}
memcpy(dst+1, temp, length+escape_count);
-
+
assert(di == length+escape_count);
-
+
return di + 1;
}
* gets the chroma qp.
*/
static inline int get_chroma_qp(int chroma_qp_index_offset, int qscale){
-
+
return chroma_qp[clip(qscale + chroma_qp_index_offset, 0, 51)];
}
static void h264_diff_dct_c(DCTELEM *block, uint8_t *src1, uint8_t *src2, int stride){
int i;
//FIXME try int temp instead of block
-
+
for(i=0; i<4; i++){
const int d0= src1[0 + i*stride] - src2[0 + i*stride];
const int d1= src1[1 + i*stride] - src2[1 + i*stride];
const int z3= d0 - d3;
const int z1= d1 + d2;
const int z2= d1 - d2;
-
+
block[0 + 4*i]= z0 + z1;
block[1 + 4*i]= 2*z3 + z2;
block[2 + 4*i]= z0 - z1;
block[3 + 4*i]= z3 - 2*z2;
- }
+ }
for(i=0; i<4; i++){
const int z0= block[0*4 + i] + block[3*4 + i];
const int z3= block[0*4 + i] - block[3*4 + i];
const int z1= block[1*4 + i] + block[2*4 + i];
const int z2= block[1*4 + i] - block[2*4 + i];
-
+
block[0*4 + i]= z0 + z1;
block[1*4 + i]= 2*z3 + z2;
block[2*4 + i]= z0 - z1;
static void pred4x4_dc_c(uint8_t *src, uint8_t *topright, int stride){
const int dc= ( src[-stride] + src[1-stride] + src[2-stride] + src[3-stride]
+ src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 4) >>3;
-
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
- ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
+
+ ((uint32_t*)(src+0*stride))[0]=
+ ((uint32_t*)(src+1*stride))[0]=
+ ((uint32_t*)(src+2*stride))[0]=
+ ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
}
static void pred4x4_left_dc_c(uint8_t *src, uint8_t *topright, int stride){
const int dc= ( src[-1+0*stride] + src[-1+1*stride] + src[-1+2*stride] + src[-1+3*stride] + 2) >>2;
-
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
- ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
+
+ ((uint32_t*)(src+0*stride))[0]=
+ ((uint32_t*)(src+1*stride))[0]=
+ ((uint32_t*)(src+2*stride))[0]=
+ ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
}
static void pred4x4_top_dc_c(uint8_t *src, uint8_t *topright, int stride){
const int dc= ( src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;
-
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
- ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
+
+ ((uint32_t*)(src+0*stride))[0]=
+ ((uint32_t*)(src+1*stride))[0]=
+ ((uint32_t*)(src+2*stride))[0]=
+ ((uint32_t*)(src+3*stride))[0]= dc* 0x01010101;
}
static void pred4x4_128_dc_c(uint8_t *src, uint8_t *topright, int stride){
- ((uint32_t*)(src+0*stride))[0]=
- ((uint32_t*)(src+1*stride))[0]=
- ((uint32_t*)(src+2*stride))[0]=
+ ((uint32_t*)(src+0*stride))[0]=
+ ((uint32_t*)(src+1*stride))[0]=
+ ((uint32_t*)(src+2*stride))[0]=
((uint32_t*)(src+3*stride))[0]= 128U*0x01010101U;
}
LOAD_TOP_EDGE
LOAD_LEFT_EDGE
- src[0+3*stride]=(l3 + 2*l2 + l1 + 2)>>2;
+ src[0+3*stride]=(l3 + 2*l2 + l1 + 2)>>2;
src[0+2*stride]=
- src[1+3*stride]=(l2 + 2*l1 + l0 + 2)>>2;
+ src[1+3*stride]=(l2 + 2*l1 + l0 + 2)>>2;
src[0+1*stride]=
src[1+2*stride]=
- src[2+3*stride]=(l1 + 2*l0 + lt + 2)>>2;
+ src[2+3*stride]=(l1 + 2*l0 + lt + 2)>>2;
src[0+0*stride]=
src[1+1*stride]=
src[2+2*stride]=
- src[3+3*stride]=(l0 + 2*lt + t0 + 2)>>2;
+ src[3+3*stride]=(l0 + 2*lt + t0 + 2)>>2;
src[1+0*stride]=
src[2+1*stride]=
src[3+2*stride]=(lt + 2*t0 + t1 + 2)>>2;
}
static void pred4x4_down_left_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_TOP_EDGE
- LOAD_TOP_RIGHT_EDGE
-// LOAD_LEFT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
+// LOAD_LEFT_EDGE
src[0+0*stride]=(t0 + t2 + 2*t1 + 2)>>2;
src[1+0*stride]=
static void pred4x4_vertical_right_c(uint8_t *src, uint8_t *topright, int stride){
const int lt= src[-1-1*stride];
- LOAD_TOP_EDGE
- LOAD_LEFT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_LEFT_EDGE
const __attribute__((unused)) int unu= l3;
src[0+0*stride]=
}
static void pred4x4_vertical_left_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_TOP_EDGE
- LOAD_TOP_RIGHT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_TOP_RIGHT_EDGE
const __attribute__((unused)) int unu= t7;
src[0+0*stride]=(t0 + t1 + 1)>>1;
}
static void pred4x4_horizontal_up_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_LEFT_EDGE
+ LOAD_LEFT_EDGE
src[0+0*stride]=(l0 + l1 + 1)>>1;
src[1+0*stride]=(l0 + 2*l1 + l2 + 2)>>2;
src[2+3*stride]=
src[3+3*stride]=l3;
}
-
+
static void pred4x4_horizontal_down_c(uint8_t *src, uint8_t *topright, int stride){
const int lt= src[-1-1*stride];
- LOAD_TOP_EDGE
- LOAD_LEFT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_LEFT_EDGE
const __attribute__((unused)) int unu= t3;
src[0+0*stride]=
const uint32_t b= ((uint32_t*)(src-stride))[1];
const uint32_t c= ((uint32_t*)(src-stride))[2];
const uint32_t d= ((uint32_t*)(src-stride))[3];
-
+
for(i=0; i<16; i++){
((uint32_t*)(src+i*stride))[0]= a;
((uint32_t*)(src+i*stride))[1]= b;
for(i=0;i<16; i++){
dc+= src[-1+i*stride];
}
-
+
for(i=0;i<16; i++){
dc+= src[i-stride];
}
for(i=0;i<16; i++){
dc+= src[-1+i*stride];
}
-
+
dc= 0x01010101*((dc + 8)>>4);
for(i=0; i<16; i++){
int i;
const uint32_t a= ((uint32_t*)(src-stride))[0];
const uint32_t b= ((uint32_t*)(src-stride))[1];
-
+
for(i=0; i<8; i++){
((uint32_t*)(src+i*stride))[0]= a;
((uint32_t*)(src+i*stride))[1]= b;
int i;
for(i=0; i<8; i++){
- ((uint32_t*)(src+i*stride))[0]=
+ ((uint32_t*)(src+i*stride))[0]=
((uint32_t*)(src+i*stride))[1]= 0x01010101U*128U;
}
}
SRC(5,0)=SRC(6,1)=SRC(7,2)= (t3 + 2*t4 + t5 + 2) >> 2;
SRC(6,0)=SRC(7,1)= (t4 + 2*t5 + t6 + 2) >> 2;
SRC(7,0)= (t5 + 2*t6 + t7 + 2) >> 2;
-
+
}
static void pred8x8l_vertical_right_c(uint8_t *src, int has_topleft, int has_topright, int stride)
{
const int full_my= my>>2;
const int pic_width = 16*s->mb_width;
const int pic_height = 16*s->mb_height;
-
+
assert(pic->data[0]);
-
+
if(mx&7) extra_width -= 3;
if(my&7) extra_height -= 3;
-
- if( full_mx < 0-extra_width
- || full_my < 0-extra_height
- || full_mx + 16/*FIXME*/ > pic_width + extra_width
+
+ if( full_mx < 0-extra_width
+ || full_my < 0-extra_height
+ || full_mx + 16/*FIXME*/ > pic_width + extra_width
|| full_my + 16/*FIXME*/ > pic_height + extra_height){
ff_emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*s->linesize, s->linesize, 16+5, 16+5/*FIXME*/, full_mx-2, full_my-2, pic_width, pic_height);
src_y= s->edge_emu_buffer + 2 + 2*s->linesize;
emu=1;
}
-
+
qpix_op[luma_xy](dest_y, src_y, s->linesize); //FIXME try variable height perhaps?
if(!square){
qpix_op[luma_xy](dest_y + delta, src_y + delta, s->linesize);
}
-
+
if(s->flags&CODEC_FLAG_GRAY) return;
-
+
if(emu){
ff_emulated_edge_mc(s->edge_emu_buffer, src_cb, s->uvlinesize, 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
src_cb= s->edge_emu_buffer;
MpegEncContext * const s = &h->s;
qpel_mc_func *qpix_op= qpix_put;
h264_chroma_mc_func chroma_op= chroma_put;
-
+
dest_y += 2*x_offset + 2*y_offset*s-> linesize;
dest_cb += x_offset + y_offset*s->uvlinesize;
dest_cr += x_offset + y_offset*s->uvlinesize;
x_offset += 8*s->mb_x;
y_offset += 8*s->mb_y;
-
+
if(list0){
Picture *ref= &h->ref_list[0][ h->ref_cache[0][ scan8[n] ] ];
mc_dir_part(h, ref, n, square, chroma_height, delta, 0,
dest_cr += x_offset + y_offset*s->uvlinesize;
x_offset += 8*s->mb_x;
y_offset += 8*s->mb_y;
-
+
if(list0 && list1){
/* don't optimize for luma-only case, since B-frames usually
* use implicit weights => chroma too. */
chroma_weight_avg(dest_cr, tmp_cr, s->uvlinesize, 5, weight0, weight1, 0, 0);
}else{
luma_weight_avg(dest_y, tmp_y, s->linesize, h->luma_log2_weight_denom,
- h->luma_weight[0][refn0], h->luma_weight[1][refn1],
+ h->luma_weight[0][refn0], h->luma_weight[1][refn1],
h->luma_offset[0][refn0], h->luma_offset[1][refn1]);
chroma_weight_avg(dest_cb, tmp_cb, s->uvlinesize, h->chroma_log2_weight_denom,
- h->chroma_weight[0][refn0][0], h->chroma_weight[1][refn1][0],
+ h->chroma_weight[0][refn0][0], h->chroma_weight[1][refn1][0],
h->chroma_offset[0][refn0][0], h->chroma_offset[1][refn1][0]);
chroma_weight_avg(dest_cr, tmp_cr, s->uvlinesize, h->chroma_log2_weight_denom,
- h->chroma_weight[0][refn0][1], h->chroma_weight[1][refn1][1],
+ h->chroma_weight[0][refn0][1], h->chroma_weight[1][refn1][1],
h->chroma_offset[0][refn0][1], h->chroma_offset[1][refn1][1]);
}
}else{
int x_offset, int y_offset,
qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put,
qpel_mc_func *qpix_avg, h264_chroma_mc_func chroma_avg,
- h264_weight_func *weight_op, h264_biweight_func *weight_avg,
+ h264_weight_func *weight_op, h264_biweight_func *weight_avg,
int list0, int list1){
if((h->use_weight==2 && list0 && list1
&& (h->implicit_weight[ h->ref_cache[0][scan8[n]] ][ h->ref_cache[1][scan8[n]] ] != 32))
MpegEncContext * const s = &h->s;
const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
const int mb_type= s->current_picture.mb_type[mb_xy];
-
+
assert(IS_INTER(mb_type));
-
+
if(IS_16X16(mb_type)){
mc_part(h, 0, 1, 8, 0, dest_y, dest_cb, dest_cr, 0, 0,
qpix_put[0], chroma_put[0], qpix_avg[0], chroma_avg[0],
IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
}else{
int i;
-
+
assert(IS_8X8(mb_type));
for(i=0; i<4; i++){
int i;
done = 1;
- init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5,
+ init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5,
&chroma_dc_coeff_token_len [0], 1, 1,
&chroma_dc_coeff_token_bits[0], 1, 1, 1);
for(i=0; i<4; i++){
- init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17,
+ init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17,
&coeff_token_len [i][0], 1, 1,
&coeff_token_bits[i][0], 1, 1, 1);
}
&chroma_dc_total_zeros_bits[i][0], 1, 1, 1);
}
for(i=0; i<15; i++){
- init_vlc(&total_zeros_vlc[i], TOTAL_ZEROS_VLC_BITS, 16,
+ init_vlc(&total_zeros_vlc[i], TOTAL_ZEROS_VLC_BITS, 16,
&total_zeros_len [i][0], 1, 1,
&total_zeros_bits[i][0], 1, 1, 1);
}
for(i=0; i<6; i++){
- init_vlc(&run_vlc[i], RUN_VLC_BITS, 7,
+ init_vlc(&run_vlc[i], RUN_VLC_BITS, 7,
&run_len [i][0], 1, 1,
&run_bits[i][0], 1, 1, 1);
}
- init_vlc(&run7_vlc, RUN7_VLC_BITS, 16,
+ init_vlc(&run7_vlc, RUN7_VLC_BITS, 16,
&run_len [6][0], 1, 1,
&run_bits[6][0], 1, 1, 1);
}
const int mb_xy= x + y*s->mb_stride;
const int b_xy = 4*x + 4*y*h->b_stride;
const int b8_xy= 2*x + 2*y*h->b8_stride;
-
+
h->mb2b_xy [mb_xy]= b_xy;
h->mb2b8_xy[mb_xy]= b8_xy;
}
s->width = s->avctx->width;
s->height = s->avctx->height;
s->codec_id= s->avctx->codec->id;
-
+
init_pred_ptrs(h);
h->dequant_coeff_pps= -1;
MpegEncContext * const s = &h->s;
MPV_decode_defaults(s);
-
+
s->avctx = avctx;
common_init(h);
avctx->pix_fmt= PIX_FMT_YUV420P;
decode_init_vlc(h);
-
+
if(avctx->extradata_size > 0 && avctx->extradata &&
*(char *)avctx->extradata == 1){
h->is_avc = 1;
static inline void backup_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize){
MpegEncContext * const s = &h->s;
int i;
-
+
src_y -= linesize;
src_cb -= uvlinesize;
src_cr -= uvlinesize;
for(i=1; i<17; i++){
h->left_border[i]= src_y[15+i* linesize];
}
-
+
*(uint64_t*)(h->top_borders[0][s->mb_x]+0)= *(uint64_t*)(src_y + 16*linesize);
*(uint64_t*)(h->top_borders[0][s->mb_x]+8)= *(uint64_t*)(src_y +8+16*linesize);
static inline void backup_pair_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize){
MpegEncContext * const s = &h->s;
int i;
-
+
src_y -= 2 * linesize;
src_cb -= 2 * uvlinesize;
src_cr -= 2 * uvlinesize;
for(i=2; i<34; i++){
h->left_border[i]= src_y[15+i* linesize];
}
-
+
*(uint64_t*)(h->top_borders[0][s->mb_x]+0)= *(uint64_t*)(src_y + 32*linesize);
*(uint64_t*)(h->top_borders[0][s->mb_x]+8)= *(uint64_t*)(src_y +8+32*linesize);
*(uint64_t*)(h->top_borders[1][s->mb_x]+0)= *(uint64_t*)(src_y + 33*linesize);
uvlinesize = s->uvlinesize;
// dct_offset = s->linesize * 16;
}
-
+
idct_add = transform_bypass
? IS_8x8DCT(mb_type) ? s->dsp.add_pixels8 : s->dsp.add_pixels4
: IS_8x8DCT(mb_type) ? s->dsp.h264_idct8_add : s->dsp.h264_idct_add;
if(!topright_avail){
tr= ptr[3 - linesize]*0x01010101;
topright= (uint8_t*) &tr;
- }else
+ }else
topright= ptr + 4 - linesize;
}else
topright= NULL;
}
}else if(s->codec_id == CODEC_ID_H264){
hl_motion(h, dest_y, dest_cb, dest_cr,
- s->dsp.put_h264_qpel_pixels_tab, s->dsp.put_h264_chroma_pixels_tab,
+ s->dsp.put_h264_qpel_pixels_tab, s->dsp.put_h264_chroma_pixels_tab,
s->dsp.avg_h264_qpel_pixels_tab, s->dsp.avg_h264_chroma_pixels_tab,
s->dsp.weight_h264_pixels_tab, s->dsp.biweight_h264_pixels_tab);
}
backup_pair_border(h, pair_dest_y, pair_dest_cb, pair_dest_cr, s->linesize, s->uvlinesize);
// TODO deblock a pair
- // top
+ // top
s->mb_y--;
tprintf("call mbaff filter_mb mb_x:%d mb_y:%d pair_dest_y = %p, dest_y = %p\n", mb_x, mb_y, pair_dest_y, dest_y);
fill_caches(h, mb_type_top, 1); //FIXME don't fill stuff which isn't used by filter_mb
int i;
int smallest_poc_greater_than_current = -1;
Picture sorted_short_ref[32];
-
+
if(h->slice_type==B_TYPE){
int out_i;
int limit= INT_MIN;
best_i= i;
}
}
-
+
assert(best_i != INT_MIN);
-
+
limit= best_poc;
sorted_short_ref[out_i]= *h->short_ref[best_i];
tprintf("sorted poc: %d->%d poc:%d fn:%d\n", best_i, out_i, sorted_short_ref[out_i].poc, sorted_short_ref[out_i].frame_num);
h->default_ref_list[ list ][index ]= *h->long_ref[i];
h->default_ref_list[ list ][index++].pic_id= i;;
}
-
+
if(list && (smallest_poc_greater_than_current<=0 || smallest_poc_greater_than_current>=h->short_ref_count) && (1 < index)){
// swap the two first elements of L1 when
// L0 and L1 are identical
static int decode_ref_pic_list_reordering(H264Context *h){
MpegEncContext * const s = &h->s;
int list, index;
-
+
print_short_term(h);
print_long_term(h);
if(h->slice_type==I_TYPE || h->slice_type==SI_TYPE) return 0; //FIXME move before func
-
+
for(list=0; list<2; list++){
memcpy(h->ref_list[list], h->default_ref_list[list], sizeof(Picture)*h->ref_count[list]);
int pic_id;
int i;
Picture *ref = NULL;
-
- if(reordering_of_pic_nums_idc==3)
+
+ if(reordering_of_pic_nums_idc==3)
break;
-
+
if(index >= h->ref_count[list]){
av_log(h->s.avctx, AV_LOG_ERROR, "reference count overflow\n");
return -1;
}
-
+
if(reordering_of_pic_nums_idc<3){
if(reordering_of_pic_nums_idc<2){
const int abs_diff_pic_num= get_ue_golomb(&s->gb) + 1;
if(reordering_of_pic_nums_idc == 0) pred-= abs_diff_pic_num;
else pred+= abs_diff_pic_num;
pred &= h->max_pic_num - 1;
-
+
for(i= h->short_ref_count-1; i>=0; i--){
ref = h->short_ref[i];
assert(ref->reference == 3);
}
if(h->slice_type!=B_TYPE) break;
}
-
+
if(h->slice_type==B_TYPE && !h->direct_spatial_mv_pred)
direct_dist_scale_factor(h);
direct_ref_list_init(h);
- return 0;
+ return 0;
}
static int pred_weight_table(H264Context *h){
MpegEncContext * const s = &h->s;
int list, i;
int luma_def, chroma_def;
-
+
h->use_weight= 0;
h->use_weight_chroma= 0;
h->luma_log2_weight_denom= get_ue_golomb(&s->gb);
for(list=0; list<2; list++){
for(i=0; i<h->ref_count[list]; i++){
int luma_weight_flag, chroma_weight_flag;
-
+
luma_weight_flag= get_bits1(&s->gb);
if(luma_weight_flag){
h->luma_weight[list][i]= get_se_golomb(&s->gb);
static Picture * remove_short(H264Context *h, int frame_num){
MpegEncContext * const s = &h->s;
int i;
-
+
if(s->avctx->debug&FF_DEBUG_MMCO)
av_log(h->s.avctx, AV_LOG_DEBUG, "remove short %d count %d\n", frame_num, h->short_ref_count);
-
+
for(i=0; i<h->short_ref_count; i++){
Picture *pic= h->short_ref[i];
if(s->avctx->debug&FF_DEBUG_MMCO)
int i, j;
int current_is_long=0;
Picture *pic;
-
+
if((s->avctx->debug&FF_DEBUG_MMCO) && mmco_count==0)
av_log(h->s.avctx, AV_LOG_DEBUG, "no mmco here\n");
-
+
for(i=0; i<mmco_count; i++){
if(s->avctx->debug&FF_DEBUG_MMCO)
av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_frame_num, h->mmco[i].long_index);
case MMCO_SHORT2LONG:
pic= remove_long(h, mmco[i].long_index);
if(pic) unreference_pic(h, pic);
-
+
h->long_ref[ mmco[i].long_index ]= remove_short(h, mmco[i].short_frame_num);
h->long_ref[ mmco[i].long_index ]->long_ref=1;
h->long_ref_count++;
case MMCO_LONG:
pic= remove_long(h, mmco[i].long_index);
if(pic) unreference_pic(h, pic);
-
+
h->long_ref[ mmco[i].long_index ]= s->current_picture_ptr;
h->long_ref[ mmco[i].long_index ]->long_ref=1;
h->long_ref_count++;
-
+
current_is_long=1;
break;
case MMCO_SET_MAX_LONG:
default: assert(0);
}
}
-
+
if(!current_is_long){
pic= remove_short(h, s->current_picture_ptr->frame_num);
if(pic){
unreference_pic(h, pic);
av_log(h->s.avctx, AV_LOG_ERROR, "illegal short term buffer state detected\n");
}
-
+
if(h->short_ref_count)
memmove(&h->short_ref[1], &h->short_ref[0], h->short_ref_count*sizeof(Picture*));
h->short_ref[0]->long_ref=0;
h->short_ref_count++;
}
-
+
print_short_term(h);
print_long_term(h);
- return 0;
+ return 0;
}
static int decode_ref_pic_marking(H264Context *h){
MpegEncContext * const s = &h->s;
int i;
-
+
if(h->nal_unit_type == NAL_IDR_SLICE){ //FIXME fields
s->broken_link= get_bits1(&s->gb) -1;
h->mmco[0].long_index= get_bits1(&s->gb) - 1; // current_long_term_idx
else{
h->mmco[0].opcode= MMCO_LONG;
h->mmco_index= 1;
- }
+ }
}else{
if(get_bits1(&s->gb)){ // adaptive_ref_pic_marking_mode_flag
- for(i= 0; i<MAX_MMCO_COUNT; i++) {
+ for(i= 0; i<MAX_MMCO_COUNT; i++) {
MMCOOpcode opcode= get_ue_golomb(&s->gb);;
h->mmco[i].opcode= opcode;
return -1;
}
}
-
+
if(opcode > MMCO_LONG){
av_log(h->s.avctx, AV_LOG_ERROR, "illegal memory management control operation %d\n", opcode);
return -1;
h->mmco_index= 0;
}
}
-
- return 0;
+
+ return 0;
}
static int init_poc(H264Context *h){
else
h->poc_msb = h->prev_poc_msb;
//printf("poc: %d %d\n", h->poc_msb, h->poc_lsb);
- field_poc[0] =
+ field_poc[0] =
field_poc[1] = h->poc_msb + h->poc_lsb;
- if(s->picture_structure == PICT_FRAME)
+ if(s->picture_structure == PICT_FRAME)
field_poc[1] += h->delta_poc_bottom;
}else if(h->sps.poc_type==1){
int abs_frame_num, expected_delta_per_poc_cycle, expectedpoc;
if(h->nal_ref_idc==0 && abs_frame_num > 0)
abs_frame_num--;
-
+
expected_delta_per_poc_cycle = 0;
for(i=0; i < h->sps.poc_cycle_length; i++)
expected_delta_per_poc_cycle += h->sps.offset_for_ref_frame[ i ]; //FIXME integrate during sps parse
} else
expectedpoc = 0;
- if(h->nal_ref_idc == 0)
+ if(h->nal_ref_idc == 0)
expectedpoc = expectedpoc + h->sps.offset_for_non_ref_pic;
-
+
field_poc[0] = expectedpoc + h->delta_poc[0];
field_poc[1] = field_poc[0] + h->sps.offset_for_top_to_bottom_field;
field_poc[0]= poc;
field_poc[1]= poc;
}
-
+
if(s->picture_structure != PICT_BOTTOM_FIELD)
s->current_picture_ptr->field_poc[0]= field_poc[0];
if(s->picture_structure != PICT_TOP_FIELD)
h->slice_type_fixed=1;
}else
h->slice_type_fixed=0;
-
+
slice_type= slice_type_map[ slice_type ];
if (slice_type == I_TYPE
|| (h->slice_num != 0 && slice_type == h->slice_type) ) {
h->slice_type= slice_type;
s->pict_type= h->slice_type; // to make a few old func happy, it's wrong though
-
+
pps_id= get_ue_golomb(&s->gb);
if(pps_id>255){
av_log(h->s.avctx, AV_LOG_ERROR, "pps_id out of range\n");
h->dequant_coeff_pps = pps_id;
init_dequant_tables(h);
}
-
+
s->mb_width= h->sps.mb_width;
s->mb_height= h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
-
+
h->b_stride= s->mb_width*4 + 1;
h->b8_stride= s->mb_width*2 + 1;
s->height= 16*s->mb_height - 2*(h->sps.crop_top + h->sps.crop_bottom);
else
s->height= 16*s->mb_height - 4*(h->sps.crop_top + h->sps.crop_bottom); //FIXME recheck
-
- if (s->context_initialized
+
+ if (s->context_initialized
&& ( s->width != s->avctx->width || s->height != s->avctx->height)) {
free_tables(h);
MPV_common_end(s);
if (!s->context_initialized) {
if (MPV_common_init(s) < 0)
return -1;
-
+
if(s->dsp.h264_idct_add == ff_h264_idct_add_c){ //FIXME little ugly
memcpy(h->zigzag_scan, zigzag_scan, 16*sizeof(uint8_t));
memcpy(h-> field_scan, field_scan, 16*sizeof(uint8_t));
if(s->mb_y >= s->mb_height){
return -1;
}
-
+
if(s->picture_structure==PICT_FRAME){
h->curr_pic_num= h->frame_num;
h->max_pic_num= 1<< h->sps.log2_max_frame_num;
h->curr_pic_num= 2*h->frame_num;
h->max_pic_num= 1<<(h->sps.log2_max_frame_num + 1);
}
-
+
if(h->nal_unit_type == NAL_IDR_SLICE){
get_ue_golomb(&s->gb); /* idr_pic_id */
}
-
+
if(h->sps.poc_type==0){
h->poc_lsb= get_bits(&s->gb, h->sps.log2_max_poc_lsb);
-
+
if(h->pps.pic_order_present==1 && s->picture_structure==PICT_FRAME){
h->delta_poc_bottom= get_se_golomb(&s->gb);
}
}
-
+
if(h->sps.poc_type==1 && !h->sps.delta_pic_order_always_zero_flag){
h->delta_poc[0]= get_se_golomb(&s->gb);
-
+
if(h->pps.pic_order_present==1 && s->picture_structure==PICT_FRAME)
h->delta_poc[1]= get_se_golomb(&s->gb);
}
-
+
init_poc(h);
-
+
if(h->pps.redundant_pic_cnt_present){
h->redundant_pic_count= get_ue_golomb(&s->gb);
}
h->direct_spatial_mv_pred= get_bits1(&s->gb);
}
num_ref_idx_active_override_flag= get_bits1(&s->gb);
-
+
if(num_ref_idx_active_override_flag){
h->ref_count[0]= get_ue_golomb(&s->gb) + 1;
if(h->slice_type==B_TYPE)
if(decode_ref_pic_list_reordering(h) < 0)
return -1;
- if( (h->pps.weighted_pred && (h->slice_type == P_TYPE || h->slice_type == SP_TYPE ))
+ if( (h->pps.weighted_pred && (h->slice_type == P_TYPE || h->slice_type == SP_TYPE ))
|| (h->pps.weighted_bipred_idc==1 && h->slice_type==B_TYPE ) )
pred_weight_table(h);
else if(h->pps.weighted_bipred_idc==2 && h->slice_type==B_TYPE)
implicit_weight_table(h);
else
h->use_weight = 0;
-
+
if(s->current_picture.reference)
decode_ref_pic_marking(h);
h->slice_beta_offset = 0;
if( h->pps.deblocking_filter_parameters_present ) {
h->deblocking_filter= get_ue_golomb(&s->gb);
- if(h->deblocking_filter < 2)
+ if(h->deblocking_filter < 2)
h->deblocking_filter^= 1; // 1<->0
if( h->deblocking_filter ) {
h->slice_num++;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "slice:%d %s mb:%d %c pps:%d frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s\n",
+ av_log(h->s.avctx, AV_LOG_DEBUG, "slice:%d %s mb:%d %c pps:%d frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s\n",
h->slice_num,
(s->picture_structure==PICT_FRAME ? "F" : s->picture_structure==PICT_TOP_FIELD ? "T" : "B"),
- first_mb_in_slice,
+ first_mb_in_slice,
av_get_pict_type_char(h->slice_type),
pps_id, h->frame_num,
s->current_picture_ptr->field_poc[0], s->current_picture_ptr->field_poc[1],
static inline int get_level_prefix(GetBitContext *gb){
unsigned int buf;
int log;
-
+
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
buf=GET_CACHE(re, gb);
-
+
log= 32 - av_log2(buf);
#ifdef TRACE
print_bin(buf>>(32-log), log);
if(n == CHROMA_DC_BLOCK_INDEX){
coeff_token= get_vlc2(gb, chroma_dc_coeff_token_vlc.table, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 1);
total_coeff= coeff_token>>2;
- }else{
+ }else{
if(n == LUMA_DC_BLOCK_INDEX){
total_coeff= pred_non_zero_count(h, 0);
coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2);
if(total_coeff==0)
return 0;
-
+
trailing_ones= coeff_token&3;
tprintf("trailing:%d, total:%d\n", trailing_ones, total_coeff);
assert(total_coeff<=16);
-
+
for(i=0; i<trailing_ones; i++){
level[i]= 1 - 2*get_bits1(gb);
}
MpegEncContext * const s = &h->s;
const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
int mb_type=0;
-
+
memset(h->non_zero_count[mb_xy], 0, 16);
memset(h->non_zero_count_cache + 8, 0, 8*5); //FIXME ugly, remove pfui
int mb_type, partition_count, cbp;
int dct8x8_allowed= h->pps.transform_8x8_mode;
- s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?
+ s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?
tprintf("pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y);
cbp = 0; /* avoid warning. FIXME: find a solution without slowing
if(h->slice_type != I_TYPE && h->slice_type != SI_TYPE){
if(s->mb_skip_run==-1)
s->mb_skip_run= get_ue_golomb(&s->gb);
-
+
if (s->mb_skip_run--) {
decode_mb_skip(h);
return 0;
h->mb_field_decoding_flag = get_bits1(&s->gb);
}else
h->mb_field_decoding_flag= (s->picture_structure!=PICT_FRAME);
-
+
h->prev_mb_skipped= 0;
-
+
mb_type= get_ue_golomb(&s->gb);
if(h->slice_type == B_TYPE){
if(mb_type < 23){
mb_type |= MB_TYPE_INTERLACED;
h->slice_table[ mb_xy ]= h->slice_num;
-
+
if(IS_INTRA_PCM(mb_type)){
unsigned int x, y;
-
+
// we assume these blocks are very rare so we dont optimize it
align_get_bits(&s->gb);
-
+
// The pixels are stored in the same order as levels in h->mb array.
for(y=0; y<16; y++){
const int index= 4*(y&3) + 32*((y>>2)&1) + 128*(y>>3);
h->mb[index + (x&3) + 16*(x>>2)]= get_bits(&s->gb, 8);
}
}
-
+
// In deblocking, the quantizer is 0
s->current_picture.qscale_table[mb_xy]= 0;
h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, 0);
// All coeffs are present
memset(h->non_zero_count[mb_xy], 16, 16);
-
+
s->current_picture.mb_type[mb_xy]= mb_type;
return 0;
}
-
+
fill_caches(h, mb_type, 0);
//mb_pred
}else{
mode= predicted_mode;
}
-
+
if(di==4)
fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
else
return -1;
}else if(partition_count==4){
int i, j, sub_partition_count[4], list, ref[2][4];
-
+
if(h->slice_type == B_TYPE){
for(i=0; i<4; i++){
h->sub_mb_type[i]= get_ue_golomb(&s->gb);
h->sub_mb_type[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].type;
}
}
-
+
for(list=0; list<2; list++){
int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list];
if(ref_count == 0) continue;
}
}
}
-
+
if(dct8x8_allowed)
dct8x8_allowed = get_dct8x8_allowed(h);
-
+
for(list=0; list<2; list++){
const int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list];
if(ref_count == 0) continue;
tprintf("final mv:%d %d\n", mx, my);
if(IS_SUB_8X8(sub_mb_type)){
- mv_cache[ 0 ][0]= mv_cache[ 1 ][0]=
+ mv_cache[ 0 ][0]= mv_cache[ 1 ][0]=
mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx;
- mv_cache[ 0 ][1]= mv_cache[ 1 ][1]=
+ mv_cache[ 0 ][1]= mv_cache[ 1 ][1]=
mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my;
}else if(IS_SUB_8X4(sub_mb_type)){
mv_cache[ 0 ][0]= mv_cache[ 1 ][0]= mx;
}
}
}
-
+
if(IS_INTER(mb_type))
write_back_motion(h, mb_type);
-
+
if(!IS_INTRA16x16(mb_type)){
cbp= get_ue_golomb(&s->gb);
if(cbp > 47){
av_log(h->s.avctx, AV_LOG_ERROR, "cbp too large (%d) at %d %d\n", cbp, s->mb_x, s->mb_y);
return -1;
}
-
+
if(IS_INTRA4x4(mb_type))
cbp= golomb_to_intra4x4_cbp[cbp];
else
int chroma_qp, dquant;
GetBitContext *gb= IS_INTRA(mb_type) ? h->intra_gb_ptr : h->inter_gb_ptr;
const uint8_t *scan, *dc_scan;
-
+
// fill_non_zero_count_cache(h);
if(IS_INTERLACED(mb_type)){
av_log(h->s.avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, s->mb_x, s->mb_y);
return -1;
}
-
+
s->qscale += dquant;
if(((unsigned)s->qscale) > 51){
if(s->qscale<0) s->qscale+= 52;
else s->qscale-= 52;
}
-
+
h->chroma_qp= chroma_qp= get_chroma_qp(h->pps.chroma_qp_index_offset, s->qscale);
if(IS_INTRA16x16(mb_type)){
if( decode_residual(h, h->intra_gb_ptr, h->mb, LUMA_DC_BLOCK_INDEX, dc_scan, h->dequant4_coeff[0][s->qscale], 16) < 0){
}else{
for(i4x4=0; i4x4<4; i4x4++){
const int index= i4x4 + 4*i8x8;
-
+
if( decode_residual(h, gb, h->mb + 16*index, index, scan, h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale], 16) <0 ){
return -1;
}
}
}
}
-
+
if(cbp&0x30){
for(chroma_idx=0; chroma_idx<2; chroma_idx++)
if( decode_residual(h, gb, h->mb + 256 + 16*4*chroma_idx, CHROMA_DC_BLOCK_INDEX, chroma_dc_scan, NULL, 4) < 0){
const int mbb_xy = mb_x + (mb_y-2)*s->mb_stride;
unsigned int ctx = 0;
-
+
if( h->slice_table[mba_xy] == h->slice_num && IS_INTERLACED( s->current_picture.mb_type[mba_xy] ) ) {
ctx += 1;
}
static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_slice) {
uint8_t *state= &h->cabac_state[ctx_base];
int mb_type;
-
+
if(intra_slice){
MpegEncContext * const s = &h->s;
const int mba_xy = h->left_mb_xy[0];
if( get_cabac_bypass( &h->cabac ) ) block[j] = (-qmul[j] + 32) >> 6;
else block[j] = ( qmul[j] + 32) >> 6;
}
-
+
abslevel1++;
} else {
int coeff_abs = 2;
coeff_abs += 1 << j;
j++;
}
-
+
while( j-- ) {
if( get_cabac_bypass( &h->cabac ) )
coeff_abs += 1 << j ;
if( get_cabac_bypass( &h->cabac ) ) block[j] = (-coeff_abs * qmul[j] + 32) >> 6;
else block[j] = ( coeff_abs * qmul[j] + 32) >> 6;
}
-
+
abslevelgt1++;
}
}
if(IS_INTRA_PCM(mb_type)) {
const uint8_t *ptr;
unsigned int x, y;
-
+
// We assume these blocks are very rare so we dont optimize it.
// FIXME The two following lines get the bitstream position in the cabac
// decode, I think it should be done by a function in cabac.h (or cabac.c).
int index_a;
int alpha;
int beta;
-
+
int qp_index;
int bS_index = (i >> 1);
if (h->mb_field_decoding_flag) {
for(;s->mb_y < s->mb_height; s->mb_y++){
for(;s->mb_x < s->mb_width; s->mb_x++){
int ret= decode_mb(h);
-
+
hl_decode_mb(h);
if(ret<0){
return -1;
}
-
+
if(++s->mb_x >= s->mb_width){
s->mb_x=0;
if(++s->mb_y >= s->mb_height){
}
}
}
-
+
if(get_bits_count(s->?gb) >= s->gb?.size_in_bits){
if(get_bits_count(s->gb) == s->gb.size_in_bits){
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
MpegEncContext * const s = &h->s;
uint8_t user_data[16+256];
int e, build, i;
-
+
if(size<16)
return -1;
-
+
for(i=0; i<sizeof(user_data)-1 && i<size; i++){
user_data[i]= get_bits(&s->gb, 8);
}
-
+
user_data[i]= 0;
e= sscanf(user_data+16, "x264 - core %d"/*%s - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html*/, &build);
if(e==1 && build>=0)
h->x264_build= build;
-
+
if(s->avctx->debug & FF_DEBUG_BUGS)
av_log(s->avctx, AV_LOG_DEBUG, "user data:\"%s\"\n", user_data+16);
for(; i<size; i++)
skip_bits(&s->gb, 8);
-
+
return 0;
}
static int decode_sei(H264Context *h){
MpegEncContext * const s = &h->s;
-
+
while(get_bits_count(&s->gb) + 16 < s->gb.size_in_bits){
int size, type;
-
+
type=0;
do{
type+= show_bits(&s->gb, 8);
}while(get_bits(&s->gb, 8) == 255);
-
+
size=0;
do{
size+= show_bits(&s->gb, 8);
}while(get_bits(&s->gb, 8) == 255);
-
+
switch(type){
case 5:
if(decode_unregistered_user_data(h, size) < 0);
default:
skip_bits(&s->gb, 8*size);
}
-
+
//FIXME check bits here
align_get_bits(&s->gb);
}
int nal_hrd_parameters_present_flag, vcl_hrd_parameters_present_flag;
aspect_ratio_info_present_flag= get_bits1(&s->gb);
-
+
if( aspect_ratio_info_present_flag ) {
aspect_ratio_idc= get_bits(&s->gb, 8);
if( aspect_ratio_idc == EXTENDED_SAR ) {
return -1;
}
}else{
- sps->sar.num=
+ sps->sar.num=
sps->sar.den= 0;
}
// s->avctx->aspect_ratio= sar_width*s->width / (float)(s->height*sar_height);
int i, last = 8, next = 8;
const uint8_t *scan = size == 16 ? zigzag_scan : zigzag_scan8x8;
if(!get_bits1(&s->gb)) /* matrix not written, we use the default one */
- memcpy(factors, default_list, size*sizeof(uint8_t));
+ memcpy(factors, default_list, size*sizeof(uint8_t));
else
for(i=0;i<size;i++){
if(next)
next = (last + get_se_golomb(&s->gb)) & 0xff;
if(!i && !next){ /* matrix not written, we use the default one */
- memcpy(factors, default_list, size*sizeof(uint8_t));
+ memcpy(factors, default_list, size*sizeof(uint8_t));
break;
}
last = factors[scan[i]] = next ? next : last;
int profile_idc, level_idc;
int sps_id, i;
SPS *sps;
-
+
profile_idc= get_bits(&s->gb, 8);
get_bits1(&s->gb); //constraint_set0_flag
get_bits1(&s->gb); //constraint_set1_flag
get_bits(&s->gb, 4); // reserved
level_idc= get_bits(&s->gb, 8);
sps_id= get_ue_golomb(&s->gb);
-
+
sps= &h->sps_buffer[ sps_id ];
sps->profile_idc= profile_idc;
sps->level_idc= level_idc;
sps->log2_max_frame_num= get_ue_golomb(&s->gb) + 4;
sps->poc_type= get_ue_golomb(&s->gb);
-
+
if(sps->poc_type == 0){ //FIXME #define
sps->log2_max_poc_lsb= get_ue_golomb(&s->gb) + 4;
} else if(sps->poc_type == 1){//FIXME #define
sps->offset_for_non_ref_pic= get_se_golomb(&s->gb);
sps->offset_for_top_to_bottom_field= get_se_golomb(&s->gb);
sps->poc_cycle_length= get_ue_golomb(&s->gb);
-
+
for(i=0; i<sps->poc_cycle_length; i++)
sps->offset_for_ref_frame[i]= get_se_golomb(&s->gb);
}
sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb);
sps->mb_width= get_ue_golomb(&s->gb) + 1;
sps->mb_height= get_ue_golomb(&s->gb) + 1;
- if((unsigned)sps->mb_width >= INT_MAX/16 || (unsigned)sps->mb_height >= INT_MAX/16 ||
+ if((unsigned)sps->mb_width >= INT_MAX/16 || (unsigned)sps->mb_height >= INT_MAX/16 ||
avcodec_check_dimensions(NULL, 16*sps->mb_width, 16*sps->mb_height))
return -1;
av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
}
}else{
- sps->crop_left =
- sps->crop_right =
- sps->crop_top =
+ sps->crop_left =
+ sps->crop_right =
+ sps->crop_top =
sps->crop_bottom= 0;
}
sps->vui_parameters_present_flag= get_bits1(&s->gb);
if( sps->vui_parameters_present_flag )
decode_vui_parameters(h, sps);
-
+
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "sps:%d profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s\n",
+ av_log(h->s.avctx, AV_LOG_DEBUG, "sps:%d profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s\n",
sps_id, sps->profile_idc, sps->level_idc,
sps->poc_type,
sps->ref_frame_count,
sps->mb_width, sps->mb_height,
sps->frame_mbs_only_flag ? "FRM" : (sps->mb_aff ? "MB-AFF" : "PIC-AFF"),
sps->direct_8x8_inference_flag ? "8B8" : "",
- sps->crop_left, sps->crop_right,
- sps->crop_top, sps->crop_bottom,
+ sps->crop_left, sps->crop_right,
+ sps->crop_top, sps->crop_bottom,
sps->vui_parameters_present_flag ? "VUI" : ""
);
}
MpegEncContext * const s = &h->s;
int pps_id= get_ue_golomb(&s->gb);
PPS *pps= &h->pps_buffer[pps_id];
-
+
pps->sps_id= get_ue_golomb(&s->gb);
pps->cabac= get_bits1(&s->gb);
pps->pic_order_present= get_bits1(&s->gb);
av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow (pps)\n");
return -1;
}
-
+
pps->weighted_pred= get_bits1(&s->gb);
pps->weighted_bipred_idc= get_bits(&s->gb, 2);
pps->init_qp= get_se_golomb(&s->gb) + 26;
pps->deblocking_filter_parameters_present= get_bits1(&s->gb);
pps->constrained_intra_pred= get_bits1(&s->gb);
pps->redundant_pic_cnt_present = get_bits1(&s->gb);
-
+
memset(pps->scaling_matrix4, 16, 6*16*sizeof(uint8_t));
memset(pps->scaling_matrix8, 16, 2*64*sizeof(uint8_t));
decode_scaling_matrices(h, &h->sps_buffer[pps->sps_id], pps, 0, pps->scaling_matrix4, pps->scaling_matrix8);
get_se_golomb(&s->gb); //second_chroma_qp_index_offset
}
-
+
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%d sps:%d %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d %s %s %s %s\n",
+ av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%d sps:%d %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d %s %s %s %s\n",
pps_id, pps->sps_id,
pps->cabac ? "CABAC" : "CAVLC",
pps->slice_group_count,
pps->transform_8x8_mode ? "8x8DCT" : ""
);
}
-
+
return 0;
}
// first_mb_in_slice is 0, probably the first nal of a new
// slice
tprintf("find_frame_end frame_end_found, state = %08x, pos = %d\n", state, i);
- pc->state=-1;
+ pc->state=-1;
pc->frame_start_found= 0;
return i-4;
}
}
if((state&0xFFFFFF1F) == 0x107 || (state&0xFFFFFF1F) == 0x108 || (state&0xFFFFFF1F) == 0x109){
if(pc->frame_start_found){
- pc->state=-1;
+ pc->state=-1;
pc->frame_start_found= 0;
- return i-4;
+ return i-4;
}
}
if (i<buf_size)
state= (state<<8) | buf[i];
}
-
+
pc->state= state;
return END_NOT_FOUND;
}
static int h264_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
H264Context *h = s->priv_data;
ParseContext *pc = &h->s.parse_context;
int next;
-
+
next= find_frame_end(h, buf, buf_size);
if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
int bit_length;
uint8_t *ptr;
int i, nalsize = 0;
-
+
if(h->is_avc) {
if(buf_index >= buf_size) break;
nalsize = 0;
if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1)
break;
}
-
+
if(buf_index+3 >= buf_size) break;
-
+
buf_index+=3;
- }
-
+ }
+
ptr= decode_nal(h, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
if(ptr[dst_length - 1] == 0) dst_length--;
bit_length= 8*dst_length - decode_rbsp_trailing(ptr + dst_length - 1);
if(s->avctx->debug&FF_DEBUG_STARTCODE){
av_log(h->s.avctx, AV_LOG_DEBUG, "NAL %d at %d/%d length %d\n", h->nal_unit_type, buf_index, buf_size, dst_length);
}
-
+
if (h->is_avc && (nalsize != consumed))
av_log(h->s.avctx, AV_LOG_ERROR, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
if( (s->hurry_up == 1 && h->nal_ref_idc == 0) //FIXME dont discard SEI id
||(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
continue;
-
+
switch(h->nal_unit_type){
case NAL_IDR_SLICE:
idr(h); //FIXME ensure we don't loose some frames if there is reordering
h->intra_gb_ptr=
h->inter_gb_ptr= &s->gb;
s->data_partitioning = 0;
-
+
if(decode_slice_header(h) < 0){
av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
break;
}
- if(h->redundant_pic_count==0 && s->hurry_up < 5
+ if(h->redundant_pic_count==0 && s->hurry_up < 5
&& (avctx->skip_frame < AVDISCARD_NONREF || h->nal_ref_idc)
&& (avctx->skip_frame < AVDISCARD_BIDIR || h->slice_type!=B_TYPE)
&& (avctx->skip_frame < AVDISCARD_NONKEY || h->slice_type==I_TYPE)
h->intra_gb_ptr=
h->inter_gb_ptr= NULL;
s->data_partitioning = 1;
-
+
if(decode_slice_header(h) < 0){
av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
}
init_get_bits(&h->inter_gb, ptr, bit_length);
h->inter_gb_ptr= &h->inter_gb;
- if(h->redundant_pic_count==0 && h->intra_gb_ptr && s->data_partitioning
+ if(h->redundant_pic_count==0 && h->intra_gb_ptr && s->data_partitioning
&& s->hurry_up < 5
&& (avctx->skip_frame < AVDISCARD_NONREF || h->nal_ref_idc)
&& (avctx->skip_frame < AVDISCARD_BIDIR || h->slice_type!=B_TYPE)
case NAL_SPS:
init_get_bits(&s->gb, ptr, bit_length);
decode_seq_parameter_set(h);
-
+
if(s->flags& CODEC_FLAG_LOW_DELAY)
s->low_delay=1;
-
+
if(avctx->has_b_frames < 2)
avctx->has_b_frames= !s->low_delay;
break;
case NAL_PPS:
init_get_bits(&s->gb, ptr, bit_length);
-
+
decode_picture_parameter_set(h, bit_length);
break;
break;
default:
av_log(avctx, AV_LOG_ERROR, "Unknown NAL code: %d\n", h->nal_unit_type);
- }
+ }
}
-
+
if(!s->current_picture_ptr) return buf_index; //no frame
s->current_picture_ptr->pict_type= s->pict_type;
s->current_picture_ptr->key_frame= s->pict_type == I_TYPE && h->nal_unit_type == NAL_IDR_SLICE;
-
+
h->prev_frame_num_offset= h->frame_num_offset;
h->prev_frame_num= h->frame_num;
if(s->current_picture_ptr->reference){
if(s->flags&CODEC_FLAG_TRUNCATED){
pos -= s->parse_context.last_index;
if(pos<0) pos=0; // FIXME remove (unneeded?)
-
+
return pos;
}else{
if(pos==0) pos=1; //avoid infinite loops (i doubt thats needed but ...)
}
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
H264Context *h = avctx->priv_data;
MpegEncContext *s = &h->s;
- AVFrame *pict = data;
+ AVFrame *pict = data;
int buf_index;
-
+
s->flags= avctx->flags;
s->flags2= avctx->flags2;
if (buf_size == 0) {
return 0;
}
-
+
if(s->flags&CODEC_FLAG_TRUNCATED){
int next= find_frame_end(h, buf, buf_size);
-
+
if( ff_combine_frame(&s->parse_context, next, &buf, &buf_size) < 0 )
return buf_size;
//printf("next:%d buf_size:%d last_index:%d\n", next, buf_size, s->parse_context.last_index);
return -1;
}
p += nalsize;
- }
+ }
// Decode pps from avcC
cnt = *(p++); // Number of pps
for (i = 0; i < cnt; i++) {
return -1;
}
p += nalsize;
- }
+ }
// Now store right nal length size, that will be use to parse all other nals
h->nal_length_size = ((*(((char*)(avctx->extradata))+4))&0x03)+1;
// Do not reparse avcC
}
if(!h->is_avc && s->avctx->extradata_size && s->picture_number==0){
- if(decode_nal_units(h, s->avctx->extradata, s->avctx->extradata_size) < 0)
+ if(decode_nal_units(h, s->avctx->extradata, s->avctx->extradata_size) < 0)
return -1;
}
buf_index=decode_nal_units(h, buf, buf_size);
- if(buf_index < 0)
+ if(buf_index < 0)
return -1;
- //FIXME do something with unavailable reference frames
-
+ //FIXME do something with unavailable reference frames
+
// if(ret==FRAME_SKIPPED) return get_consumed_bytes(s, buf_index, buf_size);
if(!s->current_picture_ptr){
av_log(h->s.avctx, AV_LOG_DEBUG, "error, NO frame\n");
if(prev && pics <= s->avctx->has_b_frames)
out = prev;
else if((out_of_order && pics-1 == s->avctx->has_b_frames && pics < 15)
- || (s->low_delay &&
+ || (s->low_delay &&
((!cross_idr && prev && out->poc > prev->poc + 2)
|| cur->pict_type == B_TYPE)))
{
// int int_temp[10000];
DSPContext dsp;
AVCodecContext avctx;
-
+
dsputil_init(&dsp, &avctx);
init_put_bits(&pb, temp, SIZE);
STOP_TIMER("set_ue_golomb");
}
flush_put_bits(&pb);
-
+
init_get_bits(&gb, temp, 8*SIZE);
for(i=0; i<COUNT; i++){
int j, s;
-
+
s= show_bits(&gb, 24);
-
+
START_TIMER
j= get_ue_golomb(&gb);
if(j != i){
}
STOP_TIMER("get_ue_golomb");
}
-
-
+
+
init_put_bits(&pb, temp, SIZE);
printf("testing signed exp golomb\n");
for(i=0; i<COUNT; i++){
STOP_TIMER("set_se_golomb");
}
flush_put_bits(&pb);
-
+
init_get_bits(&gb, temp, 8*SIZE);
for(i=0; i<COUNT; i++){
int j, s;
-
+
s= show_bits(&gb, 24);
-
+
START_TIMER
j= get_se_golomb(&gb);
if(j != i - COUNT/2){
}
printf("testing 4x4 (I)DCT\n");
-
+
DCTELEM block[16];
uint8_t src[16], ref[16];
uint64_t error= 0, max_error=0;
}
h264_diff_dct_c(block, src, ref, 4);
-
+
//normalize
for(j=0; j<16; j++){
// printf("%d ", block[j]);
if(j&4) block[j]= (block[j]*4 + 2)/5;
}
// printf("\n");
-
+
s->dsp.h264_idct_add(ref, block, 4);
/* for(j=0; j<16; j++){
printf("%d ", ref[j]);
}
printf("\n");*/
-
+
for(j=0; j<16; j++){
int diff= ABS(src[j] - ref[j]);
-
+
error+= diff*diff;
max_error= FFMAX(max_error, diff);
}
for(qp=0; qp<52; qp++){
for(i=0; i<16; i++)
src1_block[i]= src2_block[i]= random()%255;
-
+
}
#endif
printf("Testing NAL layer\n");
-
+
uint8_t bitstream[COUNT];
uint8_t nal[COUNT*2];
H264Context h;
memset(&h, 0, sizeof(H264Context));
-
+
for(i=0; i<COUNT; i++){
int zeros= i;
int nal_length;
int out_length;
uint8_t *out;
int j;
-
+
for(j=0; j<COUNT; j++){
bitstream[j]= (random() % 255) + 1;
}
-
+
for(j=0; j<zeros; j++){
int pos= random() % COUNT;
while(bitstream[pos] == 0){
}
bitstream[pos]=0;
}
-
+
START_TIMER
-
+
nal_length= encode_nal(&h, nal, bitstream, COUNT, COUNT*2);
if(nal_length<0){
printf("encoding failed\n");
return -1;
}
-
+
out= decode_nal(&h, nal, &out_length, &consumed, nal_length);
STOP_TIMER("NAL")
-
+
if(out_length != COUNT){
printf("incorrect length %d %d\n", out_length, COUNT);
return -1;
}
-
+
if(consumed != nal_length){
printf("incorrect consumed length %d %d\n", nal_length, consumed);
return -1;
}
-
+
if(memcmp(bitstream, out, COUNT)){
printf("missmatch\n");
return -1;
}
}
-
+
printf("Testing RBSP\n");
-
-
+
+
return 0;
}
#endif
{
H264Context *h = avctx->priv_data;
MpegEncContext *s = &h->s;
-
+
av_freep(&h->rbsp_buffer);
free_tables(h); //FIXME cleanup init stuff perhaps
MPV_common_end(s);
// memset(h, 0, sizeof(H264Context));
-
+
return 0;
}
/**
* @file h264data.h
- * @brief
+ * @brief
* H264 / AVC / MPEG4 part10 codec data table
* @author Michael Niedermayer <michaelni@gmx.at>
*/
16, 3, 5, 10, 12, 19, 21, 26, 28, 35, 37, 42, 44, 1, 2, 4,
8, 17, 18, 20, 24, 6, 9, 22, 25, 32, 33, 34, 36, 40, 38, 41
};
-
+
static const uint8_t golomb_to_inter_cbp[48]={
0, 16, 1, 2, 4, 8, 32, 3, 5, 10, 12, 15, 47, 7, 11, 13,
14, 6, 9, 31, 35, 37, 42, 44, 33, 34, 36, 40, 39, 43, 45, 46,
16, 33, 34, 21, 35, 22, 39, 4, 36, 40, 23, 5, 24, 6, 7, 1,
41, 42, 43, 25, 44, 26, 46, 12, 45, 47, 27, 13, 28, 14, 15, 0
};
-
+
static const uint8_t inter_cbp_to_golomb[48]={
0, 2, 3, 7, 4, 8, 17, 13, 5, 18, 9, 14, 10, 15, 16, 11,
1, 32, 33, 36, 34, 37, 44, 40, 35, 45, 38, 41, 39, 42, 43, 19,
};
static const uint8_t total_zeros_len[16][16]= {
- {1,3,3,4,4,5,5,6,6,7,7,8,8,9,9,9},
- {3,3,3,3,3,4,4,4,4,5,5,6,6,6,6},
- {4,3,3,3,4,4,3,3,4,5,5,6,5,6},
- {5,3,4,4,3,3,3,4,3,4,5,5,5},
- {4,4,4,3,3,3,3,3,4,5,4,5},
- {6,5,3,3,3,3,3,3,4,3,6},
- {6,5,3,3,3,2,3,4,3,6},
- {6,4,5,3,2,2,3,3,6},
- {6,6,4,2,2,3,2,5},
- {5,5,3,2,2,2,4},
- {4,4,3,3,1,3},
- {4,4,2,1,3},
- {3,3,1,2},
- {2,2,1},
- {1,1},
+ {1,3,3,4,4,5,5,6,6,7,7,8,8,9,9,9},
+ {3,3,3,3,3,4,4,4,4,5,5,6,6,6,6},
+ {4,3,3,3,4,4,3,3,4,5,5,6,5,6},
+ {5,3,4,4,3,3,3,4,3,4,5,5,5},
+ {4,4,4,3,3,3,3,3,4,5,4,5},
+ {6,5,3,3,3,3,3,3,4,3,6},
+ {6,5,3,3,3,2,3,4,3,6},
+ {6,4,5,3,2,2,3,3,6},
+ {6,6,4,2,2,3,2,5},
+ {5,5,3,2,2,2,4},
+ {4,4,3,3,1,3},
+ {4,4,2,1,3},
+ {3,3,1,2},
+ {2,2,1},
+ {1,1},
};
static const uint8_t total_zeros_bits[16][16]= {
static const uint8_t chroma_dc_total_zeros_len[3][4]= {
{ 1, 2, 3, 3,},
{ 1, 2, 2, 0,},
- { 1, 1, 0, 0,},
+ { 1, 1, 0, 0,},
};
static const uint8_t chroma_dc_total_zeros_bits[3][4]= {
};
static const uint8_t zigzag_scan[16]={
- 0+0*4, 1+0*4, 0+1*4, 0+2*4,
- 1+1*4, 2+0*4, 3+0*4, 2+1*4,
- 1+2*4, 0+3*4, 1+3*4, 2+2*4,
- 3+1*4, 3+2*4, 2+3*4, 3+3*4,
+ 0+0*4, 1+0*4, 0+1*4, 0+2*4,
+ 1+1*4, 2+0*4, 3+0*4, 2+1*4,
+ 1+2*4, 0+3*4, 1+3*4, 2+2*4,
+ 3+1*4, 3+2*4, 2+3*4, 3+3*4,
};
static const uint8_t field_scan[16]={
- 0+0*4, 0+1*4, 1+0*4, 0+2*4,
+ 0+0*4, 0+1*4, 1+0*4, 0+2*4,
0+3*4, 1+1*4, 1+2*4, 1+3*4,
- 2+0*4, 2+1*4, 2+2*4, 2+3*4,
+ 2+0*4, 2+1*4, 2+2*4, 2+3*4,
3+0*4, 3+1*4, 3+2*4, 3+3*4,
};
};
static const uint8_t luma_dc_field_scan[16]={
- 0*16 + 0*64, 2*16 + 0*64, 1*16 + 0*64, 0*16 + 2*64,
- 2*16 + 2*64, 3*16 + 0*64, 1*16 + 2*64, 3*16 + 2*64,
- 0*16 + 1*64, 2*16 + 1*64, 0*16 + 3*64, 2*16 + 3*64,
+ 0*16 + 0*64, 2*16 + 0*64, 1*16 + 0*64, 0*16 + 2*64,
+ 2*16 + 2*64, 3*16 + 0*64, 1*16 + 2*64, 3*16 + 2*64,
+ 0*16 + 1*64, 2*16 + 1*64, 0*16 + 3*64, 2*16 + 3*64,
1*16 + 1*64, 3*16 + 1*64, 1*16 + 3*64, 3*16 + 3*64,
};
static const uint8_t chroma_dc_scan[4]={
- (0+0*2)*16, (1+0*2)*16,
+ (0+0*2)*16, (1+0*2)*16,
(0+1*2)*16, (1+1*2)*16, //FIXME
};
static const uint8_t rem6[52]={
-0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
+0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
};
static const uint8_t div6[52]={
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file h264-idct.c
* H.264 IDCT.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-
+
#include "dsputil.h"
static always_inline void idct_internal(uint8_t *dst, DCTELEM *block, int stride, int block_stride, int shift, int add){
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
- * the algorithm used
+ * the algorithm used
*/
-
+
/**
* @file huffyuv.c
* huffyuv codec for libavcodec.
PLANE,
MEDIAN,
} Predictor;
-
+
typedef struct HYuvContext{
AVCodecContext *avctx;
Predictor predictor;
AVFrame picture;
uint8_t *bitstream_buffer;
int bitstream_buffer_size;
- DSPContext dsp;
+ DSPContext dsp;
}HYuvContext;
static const unsigned char classic_shift_luma[] = {
l= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF) + diff[i];
lt= src1[i];
dst[i]= l;
- }
+ }
*left= l;
*left_top= lt;
b+= src[4*i+B];
g+= src[4*i+G];
r+= src[4*i+R];
-
+
dst[4*i+B]= b;
dst[4*i+G]= g;
dst[4*i+R]= r;
static void read_len_table(uint8_t *dst, GetBitContext *gb){
int i, val, repeat;
-
+
for(i=0; i<256;){
repeat= get_bits(gb, 3);
val = get_bits(gb, 5);
uint64_t counts[2*size];
int up[2*size];
int offset, i, next;
-
+
for(offset=1; ; offset<<=1){
for(i=0; i<size; i++){
counts[i]= stats[i] + offset - 1;
}
-
+
for(next=size; next<size*2; next++){
uint64_t min1, min2;
int min1_i, min2_i;
-
+
min1=min2= INT64_MAX;
min1_i= min2_i=-1;
-
+
for(i=0; i<next; i++){
if(min2 > counts[i]){
if(min1 > counts[i]){
}
}
}
-
+
if(min2==INT64_MAX) break;
-
+
counts[next]= min1 + min2;
counts[min1_i]=
counts[min2_i]= INT64_MAX;
up[min2_i]= next;
up[next]= -1;
}
-
+
for(i=0; i<size; i++){
int len;
int index=i;
-
+
for(len=0; up[index] != -1; len++)
index= up[index];
-
+
if(len >= 32) break;
-
+
dst[i]= len;
}
if(i==size) break;
static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){
GetBitContext gb;
int i;
-
+
init_get_bits(&gb, src, length*8);
-
+
for(i=0; i<3; i++){
read_len_table(s->len[i], &gb);
-
+
if(generate_bits_table(s->bits[i], s->len[i])<0){
return -1;
}
free_vlc(&s->vlc[i]);
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
}
-
+
return (get_bits_count(&gb)+7)/8;
}
read_len_table(s->len[0], &gb);
init_get_bits(&gb, classic_shift_chroma, sizeof(classic_shift_chroma)*8);
read_len_table(s->len[1], &gb);
-
+
for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma [i];
for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i];
}
memcpy(s->bits[2], s->bits[1], 256*sizeof(uint32_t));
memcpy(s->len[2] , s->len [1], 256*sizeof(uint8_t));
-
+
for(i=0; i<3; i++){
free_vlc(&s->vlc[i]);
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
}
-
+
return 0;
#else
fprintf(stderr, "v1 huffyuv is not supported \n");
static void alloc_temp(HYuvContext *s){
int i;
-
+
if(s->bitstream_bpp<24){
for(i=0; i<3; i++){
s->temp[i]= av_malloc(s->width + 16);
s->avctx= avctx;
s->flags= avctx->flags;
-
+
dsputil_init(&s->dsp, avctx);
-
+
s->width= avctx->width;
s->height= avctx->height;
assert(s->width>0 && s->height>0);
-
+
return 0;
}
common_init(avctx);
memset(s->vlc, 0, 3*sizeof(VLC));
-
+
avctx->coded_frame= &s->picture;
s->interlaced= s->height > 288;
s->version=2;
}else
s->version=0;
-
+
if(s->version==2){
int method, interlace;
s->decorrelate= method&64 ? 1 : 0;
s->predictor= method&63;
s->bitstream_bpp= ((uint8_t*)avctx->extradata)[1];
- if(s->bitstream_bpp==0)
+ if(s->bitstream_bpp==0)
s->bitstream_bpp= avctx->bits_per_sample&~7;
interlace= (((uint8_t*)avctx->extradata)[2] & 0x30) >> 4;
s->interlaced= (interlace==1) ? 1 : (interlace==2) ? 0 : s->interlaced;
s->context= ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0;
-
+
if(read_huffman_tables(s, ((uint8_t*)avctx->extradata)+4, avctx->extradata_size) < 0)
return -1;
}else{
}
s->bitstream_bpp= avctx->bits_per_sample & ~7;
s->context= 0;
-
+
if(read_old_huffman_tables(s) < 0)
return -1;
}
-
+
switch(s->bitstream_bpp){
case 12:
avctx->pix_fmt = PIX_FMT_YUV420P;
default:
assert(0);
}
-
+
alloc_temp(s);
-
+
// av_log(NULL, AV_LOG_DEBUG, "pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
return 0;
for(i=0; i<256;){
int val= len[i];
int repeat=0;
-
+
for(; i<256 && len[i]==val && repeat<255; i++)
repeat++;
-
+
assert(val < 32 && val >0 && repeat<256 && repeat>0);
if(repeat>7){
buf[index++]= val;
buf[index++]= val | (repeat<<5);
}
}
-
+
return index;
}
int i, j;
common_init(avctx);
-
+
avctx->extradata= av_mallocz(1024*30); // 256*3+4 == 772
avctx->stats_out= av_mallocz(1024*30); // 21*256*3(%llu ) + 3(\n) + 1(0) = 16132
s->version=2;
-
+
avctx->coded_frame= &s->picture;
-
+
switch(avctx->pix_fmt){
case PIX_FMT_YUV420P:
s->bitstream_bpp= 12;
return -1;
}
}else s->context= 0;
-
+
if(avctx->codec->id==CODEC_ID_HUFFYUV){
if(avctx->pix_fmt==PIX_FMT_YUV420P){
av_log(avctx, AV_LOG_ERROR, "Error: YV12 is not supported by huffyuv; use vcodec=ffvhuff or format=422p\n");
av_log(avctx, AV_LOG_ERROR, "This codec is under development; files encoded with it may not be decodable with future versions!!! Set vstrict=-2 / -strict -2 to use it anyway.\n");
return -1;
}
-
+
((uint8_t*)avctx->extradata)[0]= s->predictor;
((uint8_t*)avctx->extradata)[1]= s->bitstream_bpp;
((uint8_t*)avctx->extradata)[2]= s->interlaced ? 0x10 : 0x20;
((uint8_t*)avctx->extradata)[2]|= 0x40;
((uint8_t*)avctx->extradata)[3]= 0;
s->avctx->extradata_size= 4;
-
+
if(avctx->stats_in){
char *p= avctx->stats_in;
-
+
for(i=0; i<3; i++)
for(j=0; j<256; j++)
s->stats[i][j]= 1;
s->stats[i][j]+= strtol(p, &next, 0);
if(next==p) return -1;
p=next;
- }
+ }
}
if(p[0]==0 || p[1]==0 || p[2]==0) break;
}
for(i=0; i<3; i++)
for(j=0; j<256; j++){
int d= FFMIN(j, 256-j);
-
+
s->stats[i][j]= 100000000/(d+1);
}
}
-
+
for(i=0; i<3; i++){
generate_len_table(s->len[i], s->stats[i], 256);
if(generate_bits_table(s->bits[i], s->len[i])<0){
return -1;
}
-
+
s->avctx->extradata_size+=
store_table(s, s->len[i], &((uint8_t*)s->avctx->extradata)[s->avctx->extradata_size]);
}
for(j=0; j<256; j++)
s->stats[i][j]= 0;
}
-
+
// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
alloc_temp(s);
int i;
count/=2;
-
+
for(i=0; i<count; i++){
- s->temp[0][2*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[1][ i ]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][2*i+1]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[2][ i ]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
+ s->temp[0][2*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
+ s->temp[1][ i ]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
+ s->temp[0][2*i+1]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
+ s->temp[2][ i ]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
}
}
static void decode_gray_bitstream(HYuvContext *s, int count){
int i;
-
+
count/=2;
-
+
for(i=0; i<count; i++){
- s->temp[0][2*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[0][2*i+1]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
+ s->temp[0][2*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
+ s->temp[0][2*i+1]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
}
}
static int encode_422_bitstream(HYuvContext *s, int count){
int i;
-
+
if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 2*4*count){
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
-
+
count/=2;
if(s->flags&CODEC_FLAG_PASS1){
for(i=0; i<count; i++){
static int encode_gray_bitstream(HYuvContext *s, int count){
int i;
-
+
if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 4*count){
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
if(s->avctx->flags2&CODEC_FLAG2_NO_OUTPUT)
return 0;
-
+
if(s->context){
for(i=0; i<count; i++){
s->stats[0][ s->temp[0][2*i ] ]++;
if(s->decorrelate){
if(s->bitstream_bpp==24){
for(i=0; i<count; i++){
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
+ s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+G];
s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) + s->temp[0][4*i+G];
}
}else{
for(i=0; i<count; i++){
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
+ s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+G];
- s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) + s->temp[0][4*i+G];
+ s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) + s->temp[0][4*i+G];
get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3); //?!
}
}
if(s->bitstream_bpp==24){
for(i=0; i<count; i++){
s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
+ s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
+ s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
}
}else{
for(i=0; i<count; i++){
s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3);
- s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
- s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
+ s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3);
+ s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3);
get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3); //?!
}
}
static void draw_slice(HYuvContext *s, int y){
int h, cy;
int offset[4];
-
- if(s->avctx->draw_horiz_band==NULL)
+
+ if(s->avctx->draw_horiz_band==NULL)
return;
-
+
h= y - s->last_slice_end;
y -= h;
-
+
if(s->bitstream_bpp==12){
cy= y>>1;
}else{
emms_c();
s->avctx->draw_horiz_band(s->avctx, &s->picture, offset, y, 3, h);
-
+
s->last_slice_end= y + h;
}
s->bitstream_buffer= av_fast_realloc(s->bitstream_buffer, &s->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
s->dsp.bswap_buf((uint32_t*)s->bitstream_buffer, (uint32_t*)buf, buf_size/4);
-
+
if(p->data[0])
avctx->release_buffer(avctx, p);
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
-
+
if(s->context){
table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size);
if(table_size < 0)
fake_ystride= s->interlaced ? p->linesize[0]*2 : p->linesize[0];
fake_ustride= s->interlaced ? p->linesize[1]*2 : p->linesize[1];
fake_vstride= s->interlaced ? p->linesize[2]*2 : p->linesize[2];
-
+
s->last_slice_end= 0;
-
+
if(s->bitstream_bpp<24){
int y, cy;
int lefty, leftu, leftv;
int lefttopy, lefttopu, lefttopv;
-
+
if(s->yuy2){
p->data[0][3]= get_bits(&s->gb, 8);
p->data[0][2]= get_bits(&s->gb, 8);
p->data[0][1]= get_bits(&s->gb, 8);
p->data[0][0]= get_bits(&s->gb, 8);
-
+
av_log(avctx, AV_LOG_ERROR, "YUY2 output is not implemented yet\n");
return -1;
}else{
-
+
leftv= p->data[2][0]= get_bits(&s->gb, 8);
lefty= p->data[0][1]= get_bits(&s->gb, 8);
leftu= p->data[1][0]= get_bits(&s->gb, 8);
p->data[0][0]= get_bits(&s->gb, 8);
-
+
switch(s->predictor){
case LEFT:
case PLANE:
for(cy=y=1; y<s->height; y++,cy++){
uint8_t *ydst, *udst, *vdst;
-
+
if(s->bitstream_bpp==12){
decode_gray_bitstream(s, width);
-
+
ydst= p->data[0] + p->linesize[0]*y;
lefty= add_left_prediction(ydst, s->temp[0], width, lefty);
y++;
if(y>=s->height) break;
}
-
+
draw_slice(s, y);
-
+
ydst= p->data[0] + p->linesize[0]*y;
udst= p->data[1] + p->linesize[1]*cy;
vdst= p->data[2] + p->linesize[2]*cy;
-
+
decode_422_bitstream(s, width);
lefty= add_left_prediction(ydst, s->temp[0], width, lefty);
if(!(s->flags&CODEC_FLAG_GRAY)){
}
}
draw_slice(s, height);
-
+
break;
case MEDIAN:
/* first line except first 2 pixels is left predicted */
leftu= add_left_prediction(p->data[1] + 1, s->temp[1], width2-1, leftu);
leftv= add_left_prediction(p->data[2] + 1, s->temp[2], width2-1, leftv);
}
-
+
cy=y=1;
-
+
/* second line is left predicted for interlaced case */
if(s->interlaced){
decode_422_bitstream(s, width);
add_median_prediction(p->data[2] + fake_vstride+2, p->data[2]+2, s->temp[2], width2-2, &leftv, &lefttopv);
}
y++; cy++;
-
+
for(; y<height; y++,cy++){
uint8_t *ydst, *udst, *vdst;
int y;
int leftr, leftg, leftb;
const int last_line= (height-1)*p->linesize[0];
-
+
if(s->bitstream_bpp==32){
skip_bits(&s->gb, 8);
leftr= p->data[0][last_line+R]= get_bits(&s->gb, 8);
leftb= p->data[0][last_line+B]= get_bits(&s->gb, 8);
skip_bits(&s->gb, 8);
}
-
+
if(s->bgr32){
switch(s->predictor){
case LEFT:
for(y=s->height-2; y>=0; y--){ //yes its stored upside down
decode_bgr_bitstream(s, width);
-
+
add_left_prediction_bgr32(p->data[0] + p->linesize[0]*y, s->temp[0], width, &leftr, &leftg, &leftb);
if(s->predictor == PLANE){
if((y&s->interlaced)==0 && y<s->height-1-s->interlaced){
- s->dsp.add_bytes(p->data[0] + p->linesize[0]*y,
+ s->dsp.add_bytes(p->data[0] + p->linesize[0]*y,
p->data[0] + p->linesize[0]*y + fake_ystride, fake_ystride);
}
}
}
}
emms_c();
-
+
*picture= *p;
*data_size = sizeof(AVFrame);
-
+
return (get_bits_count(&s->gb)+31)/32*4;
}
static int common_end(HYuvContext *s){
int i;
-
+
for(i=0; i<3; i++){
av_freep(&s->temp[i]);
}
{
HYuvContext *s = avctx->priv_data;
int i;
-
+
common_end(s);
av_freep(&s->bitstream_buffer);
-
+
for(i=0; i<3; i++){
free_vlc(&s->vlc[i]);
}
*p = *pict;
p->pict_type= FF_I_TYPE;
p->key_frame= 1;
-
+
if(s->context){
for(i=0; i<3; i++){
generate_len_table(s->len[i], s->stats[i], 256);
put_bits(&s->pb, 8, lefty= p->data[0][1]);
put_bits(&s->pb, 8, leftu= p->data[1][0]);
put_bits(&s->pb, 8, p->data[0][0]);
-
+
lefty= sub_left_prediction(s, s->temp[0], p->data[0]+2, width-2 , lefty);
leftu= sub_left_prediction(s, s->temp[1], p->data[1]+1, width2-1, leftu);
leftv= sub_left_prediction(s, s->temp[2], p->data[2]+1, width2-1, leftv);
-
+
encode_422_bitstream(s, width-2);
-
+
if(s->predictor==MEDIAN){
int lefttopy, lefttopu, lefttopv;
cy=y=1;
lefty= sub_left_prediction(s, s->temp[0], p->data[0]+p->linesize[0], width , lefty);
leftu= sub_left_prediction(s, s->temp[1], p->data[1]+p->linesize[1], width2, leftu);
leftv= sub_left_prediction(s, s->temp[2], p->data[2]+p->linesize[2], width2, leftv);
-
+
encode_422_bitstream(s, width);
y++; cy++;
}
-
+
lefty= sub_left_prediction(s, s->temp[0], p->data[0]+fake_ystride, 4, lefty);
leftu= sub_left_prediction(s, s->temp[1], p->data[1]+fake_ustride, 2, leftu);
leftv= sub_left_prediction(s, s->temp[2], p->data[2]+fake_vstride, 2, leftv);
-
+
encode_422_bitstream(s, 4);
lefttopy= p->data[0][3];
for(; y<height; y++,cy++){
uint8_t *ydst, *udst, *vdst;
-
+
if(s->bitstream_bpp==12){
while(2*cy > y){
ydst= p->data[0] + p->linesize[0]*y;
}else{
for(cy=y=1; y<height; y++,cy++){
uint8_t *ydst, *udst, *vdst;
-
+
/* encode a luma only line & y++ */
if(s->bitstream_bpp==12){
ydst= p->data[0] + p->linesize[0]*y;
y++;
if(y>=height) break;
}
-
+
ydst= p->data[0] + p->linesize[0]*y;
udst= p->data[1] + p->linesize[1]*cy;
vdst= p->data[2] + p->linesize[2]*cy;
encode_422_bitstream(s, width);
}
- }
+ }
}else{
av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
}
emms_c();
-
+
size+= (put_bits_count(&s->pb)+31)/8;
size/= 4;
-
+
if((s->flags&CODEC_FLAG_PASS1) && (s->picture_number&31)==0){
int j;
char *p= avctx->stats_out;
s->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size);
avctx->stats_out[0] = '\0';
}
-
+
s->picture_number++;
return size*4;
static int encode_end(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
-
+
common_end(s);
av_freep(&avctx->extradata);
av_freep(&avctx->stats_out);
-
+
return 0;
}
int eax, ebx, ecx, edx;
int max_std_level, max_ext_level, std_caps=0, ext_caps=0;
long a, c;
-
+
__asm__ __volatile__ (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
"pushf\n\t"
"pop %0\n\t"
"mov %0, %1\n\t"
-
+
/* ... Toggle the ID bit in one copy and store */
/* to the EFLAGS reg */
"xor $0x200000, %0\n\t"
"push %0\n\t"
"popf\n\t"
-
+
/* ... Get the (hopefully modified) EFLAGS */
"pushf\n\t"
"pop %0\n\t"
: "=a" (a), "=c" (c)
:
- : "cc"
+ : "cc"
);
-
+
if (a == c)
return 0; /* CPUID not supported */
cpuid(1, eax, ebx, ecx, std_caps);
if (std_caps & (1<<23))
rval |= MM_MMX;
- if (std_caps & (1<<25))
+ if (std_caps & (1<<25))
rval |= MM_MMXEXT | MM_SSE;
- if (std_caps & (1<<26))
+ if (std_caps & (1<<26))
rval |= MM_SSE2;
}
According to the table, the only CPU which supports level
2 is also the only one which supports extended CPUID levels.
*/
- if (eax < 2)
+ if (eax < 2)
return rval;
if (ext_caps & (1<<24))
rval |= MM_MMXEXT;
}
#if 0
- av_log(NULL, AV_LOG_DEBUG, "%s%s%s%s%s%s\n",
- (rval&MM_MMX) ? "MMX ":"",
- (rval&MM_MMXEXT) ? "MMX2 ":"",
- (rval&MM_SSE) ? "SSE ":"",
- (rval&MM_SSE2) ? "SSE2 ":"",
- (rval&MM_3DNOW) ? "3DNow ":"",
+ av_log(NULL, AV_LOG_DEBUG, "%s%s%s%s%s%s\n",
+ (rval&MM_MMX) ? "MMX ":"",
+ (rval&MM_MMXEXT) ? "MMX2 ":"",
+ (rval&MM_SSE) ? "SSE ":"",
+ (rval&MM_SSE2) ? "SSE2 ":"",
+ (rval&MM_3DNOW) ? "3DNow ":"",
(rval&MM_3DNOWEXT) ? "3DNowExt ":"");
#endif
return rval;
const int strength= ff_h263_loop_filter_strength[qscale];
asm volatile(
-
+
H263_LOOP_FILTER
-
+
"movq %%mm3, %1 \n\t"
"movq %%mm4, %2 \n\t"
"movq %%mm5, %0 \n\t"
"movd %%mm1, %2 \n\t"
"punpckhdq %%mm1, %%mm1 \n\t"
"movd %%mm1, %3 \n\t"
-
+
: "=m" (*(uint32_t*)(dst + 0*dst_stride)),
"=m" (*(uint32_t*)(dst + 1*dst_stride)),
"=m" (*(uint32_t*)(dst + 2*dst_stride)),
const int strength= ff_h263_loop_filter_strength[qscale];
uint64_t temp[4] __attribute__ ((aligned(8)));
uint8_t *btemp= (uint8_t*)temp;
-
+
src -= 2;
transpose4x4(btemp , src , 8, stride);
transpose4x4(btemp+4, src + 4*stride, 8, stride);
asm volatile(
H263_LOOP_FILTER // 5 3 4 6
-
+
: "+m" (temp[0]),
"+m" (temp[1]),
"+m" (temp[2]),
"psrlq $32, %%mm7\n" /* shift hi dword to lo */
"paddd %%mm7,%%mm1\n"
"movd %%mm1,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
+ : "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "%ecx");
return tmp;
"psrlq $32, %%mm7\n" /* shift hi dword to lo */
"paddd %%mm7,%%mm1\n"
"movd %%mm1,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
+ : "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "%ecx");
return tmp;
"psrldq $4, %%xmm7\n" /* shift hi dword to lo */
"paddd %%xmm1,%%xmm7\n"
"movd %%xmm7,%3\n"
- : "+r" (pix1), "+r" (pix2), "+r"(h), "=r"(tmp)
+ : "+r" (pix1), "+r" (pix2), "+r"(h), "=r"(tmp)
: "r" ((long)line_size));
return tmp;
}
"movl %3,%%ecx\n"
"pxor %%mm7,%%mm7\n"
"pxor %%mm6,%%mm6\n"
-
+
"movq (%0),%%mm0\n"
"movq %%mm0, %%mm1\n"
"psllq $8, %%mm0\n"
"punpckhbw %%mm7,%%mm3\n"
"psubw %%mm1, %%mm0\n"
"psubw %%mm3, %%mm2\n"
-
+
"add %2,%0\n"
-
+
"movq (%0),%%mm4\n"
"movq %%mm4, %%mm1\n"
"psllq $8, %%mm4\n"
"pcmpgtw %%mm2, %%mm1\n\t"
"pxor %%mm3, %%mm0\n"
"pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
+ "psubw %%mm3, %%mm0\n"
"psubw %%mm1, %%mm2\n"
"paddw %%mm0, %%mm2\n"
"paddw %%mm2, %%mm6\n"
"add %2,%0\n"
"1:\n"
-
+
"movq (%0),%%mm0\n"
"movq %%mm0, %%mm1\n"
"psllq $8, %%mm0\n"
"pcmpgtw %%mm5, %%mm1\n\t"
"pxor %%mm3, %%mm4\n"
"pxor %%mm1, %%mm5\n"
- "psubw %%mm3, %%mm4\n"
+ "psubw %%mm3, %%mm4\n"
"psubw %%mm1, %%mm5\n"
"paddw %%mm4, %%mm5\n"
"paddw %%mm5, %%mm6\n"
-
+
"add %2,%0\n"
-
+
"movq (%0),%%mm4\n"
"movq %%mm4, %%mm1\n"
"psllq $8, %%mm4\n"
"pcmpgtw %%mm2, %%mm1\n\t"
"pxor %%mm3, %%mm0\n"
"pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
+ "psubw %%mm3, %%mm0\n"
"psubw %%mm1, %%mm2\n"
"paddw %%mm0, %%mm2\n"
"paddw %%mm2, %%mm6\n"
"punpcklwd %%mm7,%%mm0\n"
"punpckhwd %%mm7,%%mm6\n"
"paddd %%mm0, %%mm6\n"
-
+
"movq %%mm6,%%mm0\n"
"psrlq $32, %%mm6\n"
"paddd %%mm6,%%mm0\n"
"movd %%mm0,%1\n"
- : "+r" (pix1), "=r"(tmp)
+ : "+r" (pix1), "=r"(tmp)
: "r" ((long)line_size) , "g" (h-2)
: "%ecx");
return tmp;
"movl %3,%%ecx\n"
"pxor %%mm7,%%mm7\n"
"pxor %%mm6,%%mm6\n"
-
+
"movq (%0),%%mm0\n"
"movq 1(%0),%%mm1\n"
"movq %%mm0, %%mm2\n"
"punpckhbw %%mm7,%%mm3\n"
"psubw %%mm1, %%mm0\n"
"psubw %%mm3, %%mm2\n"
-
+
"add %2,%0\n"
-
+
"movq (%0),%%mm4\n"
"movq 1(%0),%%mm1\n"
"movq %%mm4, %%mm5\n"
"pcmpgtw %%mm2, %%mm1\n\t"
"pxor %%mm3, %%mm0\n"
"pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
+ "psubw %%mm3, %%mm0\n"
"psubw %%mm1, %%mm2\n"
"paddw %%mm0, %%mm2\n"
"paddw %%mm2, %%mm6\n"
"add %2,%0\n"
"1:\n"
-
+
"movq (%0),%%mm0\n"
"movq 1(%0),%%mm1\n"
"movq %%mm0, %%mm2\n"
"psubw %%mm1, %%mm5\n"
"paddw %%mm4, %%mm5\n"
"paddw %%mm5, %%mm6\n"
-
+
"add %2,%0\n"
-
+
"movq (%0),%%mm4\n"
"movq 1(%0),%%mm1\n"
"movq %%mm4, %%mm5\n"
"pcmpgtw %%mm2, %%mm1\n\t"
"pxor %%mm3, %%mm0\n"
"pxor %%mm1, %%mm2\n"
- "psubw %%mm3, %%mm0\n"
+ "psubw %%mm3, %%mm0\n"
"psubw %%mm1, %%mm2\n"
"paddw %%mm0, %%mm2\n"
"paddw %%mm2, %%mm6\n"
"punpcklwd %%mm7,%%mm0\n"
"punpckhwd %%mm7,%%mm6\n"
"paddd %%mm0, %%mm6\n"
-
+
"movq %%mm6,%%mm0\n"
"psrlq $32, %%mm6\n"
"paddd %%mm6,%%mm0\n"
"movd %%mm0,%1\n"
- : "+r" (pix1), "=r"(tmp)
+ : "+r" (pix1), "=r"(tmp)
: "r" ((long)line_size) , "g" (h-2)
: "%ecx");
return tmp + hf_noise8_mmx(pix+8, line_size, h);
static int vsad_intra16_mmx(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) {
int tmp;
-
+
assert( (((int)pix) & 7) == 0);
assert((line_size &7) ==0);
-
+
#define SUM(in0, in1, out0, out1) \
"movq (%0), %%mm2\n"\
"movq 8(%0), %%mm3\n"\
"paddw %%mm2, " #in0 "\n"\
"paddw " #in0 ", %%mm6\n"
-
+
asm volatile (
"movl %3,%%ecx\n"
"pxor %%mm6,%%mm6\n"
"subl $2, %%ecx\n"
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
"1:\n"
-
+
SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
+
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
+
"subl $2, %%ecx\n"
"jnz 1b\n"
"psrlq $16, %%mm0\n"
"paddw %%mm6,%%mm0\n"
"movd %%mm0,%1\n"
- : "+r" (pix), "=r"(tmp)
+ : "+r" (pix), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "%ecx");
return tmp & 0xFFFF;
static int vsad_intra16_mmx2(void *v, uint8_t * pix, uint8_t * dummy, int line_size, int h) {
int tmp;
-
+
assert( (((int)pix) & 7) == 0);
assert((line_size &7) ==0);
-
+
#define SUM(in0, in1, out0, out1) \
"movq (%0), " #out0 "\n"\
"movq 8(%0), " #out1 "\n"\
"subl $2, %%ecx\n"
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
"1:\n"
-
+
SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
+
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
+
"subl $2, %%ecx\n"
"jnz 1b\n"
"movd %%mm6,%1\n"
- : "+r" (pix), "=r"(tmp)
+ : "+r" (pix), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "%ecx");
return tmp;
static int vsad16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
int tmp;
-
+
assert( (((int)pix1) & 7) == 0);
assert( (((int)pix2) & 7) == 0);
assert((line_size &7) ==0);
-
+
#define SUM(in0, in1, out0, out1) \
"movq (%0),%%mm2\n"\
"movq (%1)," #out0 "\n"\
"paddw %%mm2, " #in0 "\n"\
"paddw " #in0 ", %%mm6\n"
-
+
asm volatile (
"movl %4,%%ecx\n"
"pxor %%mm6,%%mm6\n"
"pxor %%mm7, %%mm1\n"
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
"1:\n"
-
+
SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
+
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
+
"subl $2, %%ecx\n"
"jnz 1b\n"
"psrlq $16, %%mm0\n"
"paddw %%mm6,%%mm0\n"
"movd %%mm0,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
+ : "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "%ecx");
return tmp & 0x7FFF;
static int vsad16_mmx2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int h) {
int tmp;
-
+
assert( (((int)pix1) & 7) == 0);
assert( (((int)pix2) & 7) == 0);
assert((line_size &7) ==0);
-
+
#define SUM(in0, in1, out0, out1) \
"movq (%0)," #out0 "\n"\
"movq (%1),%%mm2\n"\
"pxor %%mm7, %%mm1\n"
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
"1:\n"
-
+
SUM(%%mm4, %%mm5, %%mm0, %%mm1)
-
+
SUM(%%mm0, %%mm1, %%mm4, %%mm5)
-
+
"subl $2, %%ecx\n"
"jnz 1b\n"
"movd %%mm6,%2\n"
- : "+r" (pix1), "+r" (pix2), "=r"(tmp)
+ : "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "%ecx");
return tmp;
static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
long i=0;
uint8_t l, lt;
-
+
asm volatile(
"1: \n\t"
"movq -1(%1, %0), %%mm0 \n\t" // LT
"movq %%mm4, %%mm5 \n\t" // L
"pmaxub %%mm1, %%mm4 \n\t" // max(T, L)
"pminub %%mm5, %%mm1 \n\t" // min(T, L)
- "pminub %%mm2, %%mm4 \n\t"
+ "pminub %%mm2, %%mm4 \n\t"
"pmaxub %%mm1, %%mm4 \n\t"
"psubb %%mm4, %%mm3 \n\t" // dst - pred
"movq %%mm3, (%3, %0) \n\t"
l= *left;
lt= *left_top;
-
+
dst[0]= src2[0] - mid_pred(l, src1[0], (l + src1[0] - lt)&0xFF);
-
+
*left_top= src1[w-1];
*left = src2[w-1];
}
"psubw " #a ", " #z " \n\t"\
"pmaxsw " #z ", " #a " \n\t"\
"paddusw " #a ", " #sum " \n\t"
-
+
#define SBUTTERFLY(a,b,t,n)\
"movq " #a ", " #t " \n\t" /* abcd */\
"punpckl" #n " " #b ", " #a " \n\t" /* aebf */\
static int hadamard8_diff_mmx(void *s, uint8_t *src1, uint8_t *src2, int stride, int h){
uint64_t temp[16] __align8;
int sum=0;
-
+
assert(h==8);
diff_pixels_mmx((DCTELEM*)temp, src1, src2, stride);
asm volatile(
LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
LOAD4(64, %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
-
+
"movq %%mm7, 112(%1) \n\t"
-
+
TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
STORE4(0 , %%mm0, %%mm3, %%mm7, %%mm2)
-
+
"movq 112(%1), %%mm7 \n\t"
TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
STORE4(64, %%mm4, %%mm7, %%mm0, %%mm6)
LOAD4(8 , %%mm0, %%mm1, %%mm2, %%mm3)
LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
-
+
"movq %%mm7, 120(%1) \n\t"
-
+
TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
STORE4(8 , %%mm0, %%mm3, %%mm7, %%mm2)
-
+
"movq 120(%1), %%mm7 \n\t"
TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
"movq %%mm7, %%mm5 \n\t"//FIXME remove
"movq %%mm6, %%mm7 \n\t"
"movq %%mm0, %%mm6 \n\t"
// STORE4(72, %%mm4, %%mm7, %%mm0, %%mm6) //FIXME remove
-
+
LOAD4(64, %%mm0, %%mm1, %%mm2, %%mm3)
// LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
"movq %%mm7, 64(%1) \n\t"
MMABS(%%mm0, %%mm7)
"movq 64(%1), %%mm1 \n\t"
MMABS_SUM(%%mm1, %%mm7, %%mm0)
"movq %%mm0, 64(%1) \n\t"
-
+
LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
LOAD4(8 , %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
"movq %%mm7, (%1) \n\t"
MMABS(%%mm0, %%mm7)
MMABS_SUM(%%mm1, %%mm7, %%mm0)
"movq 64(%1), %%mm1 \n\t"
MMABS_SUM(%%mm1, %%mm7, %%mm0)
-
+
"movq %%mm0, %%mm1 \n\t"
"psrlq $32, %%mm0 \n\t"
"paddusw %%mm1, %%mm0 \n\t"
"psrlq $16, %%mm0 \n\t"
"paddusw %%mm1, %%mm0 \n\t"
"movd %%mm0, %0 \n\t"
-
+
: "=r" (sum)
: "r"(temp)
);
static int hadamard8_diff_mmx2(void *s, uint8_t *src1, uint8_t *src2, int stride, int h){
uint64_t temp[16] __align8;
int sum=0;
-
+
assert(h==8);
diff_pixels_mmx((DCTELEM*)temp, src1, src2, stride);
asm volatile(
LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
LOAD4(64, %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
-
+
"movq %%mm7, 112(%1) \n\t"
-
+
TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
STORE4(0 , %%mm0, %%mm3, %%mm7, %%mm2)
-
+
"movq 112(%1), %%mm7 \n\t"
TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
STORE4(64, %%mm4, %%mm7, %%mm0, %%mm6)
LOAD4(8 , %%mm0, %%mm1, %%mm2, %%mm3)
LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
-
+
"movq %%mm7, 120(%1) \n\t"
-
+
TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm7)
STORE4(8 , %%mm0, %%mm3, %%mm7, %%mm2)
-
+
"movq 120(%1), %%mm7 \n\t"
TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
"movq %%mm7, %%mm5 \n\t"//FIXME remove
"movq %%mm6, %%mm7 \n\t"
"movq %%mm0, %%mm6 \n\t"
// STORE4(72, %%mm4, %%mm7, %%mm0, %%mm6) //FIXME remove
-
+
LOAD4(64, %%mm0, %%mm1, %%mm2, %%mm3)
// LOAD4(72, %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
"movq %%mm7, 64(%1) \n\t"
MMABS_MMX2(%%mm0, %%mm7)
"movq 64(%1), %%mm1 \n\t"
MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
"movq %%mm0, 64(%1) \n\t"
-
+
LOAD4(0 , %%mm0, %%mm1, %%mm2, %%mm3)
LOAD4(8 , %%mm4, %%mm5, %%mm6, %%mm7)
-
+
HADAMARD48
"movq %%mm7, (%1) \n\t"
MMABS_MMX2(%%mm0, %%mm7)
MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
"movq 64(%1), %%mm1 \n\t"
MMABS_SUM_MMX2(%%mm1, %%mm7, %%mm0)
-
+
"pshufw $0x0E, %%mm0, %%mm1 \n\t"
"paddusw %%mm1, %%mm0 \n\t"
"pshufw $0x01, %%mm0, %%mm1 \n\t"
"paddusw %%mm1, %%mm0 \n\t"
"movd %%mm0, %0 \n\t"
-
+
: "=r" (sum)
: "r"(temp)
);
static int try_8x8basis_mmx(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale){
long i=0;
-
+
assert(ABS(scale) < 256);
scale<<= 16 + 1 - BASIS_SHIFT + RECON_SHIFT;
"pcmpeqw %%mm6, %%mm6 \n\t" // -1w
"psrlw $15, %%mm6 \n\t" // 1w
"pxor %%mm7, %%mm7 \n\t"
- "movd %4, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
+ "movd %4, %%mm5 \n\t"
+ "punpcklwd %%mm5, %%mm5 \n\t"
+ "punpcklwd %%mm5, %%mm5 \n\t"
"1: \n\t"
- "movq (%1, %0), %%mm0 \n\t"
+ "movq (%1, %0), %%mm0 \n\t"
"movq 8(%1, %0), %%mm1 \n\t"
"pmulhw %%mm5, %%mm0 \n\t"
"pmulhw %%mm5, %%mm1 \n\t"
"paddd %%mm6, %%mm7 \n\t"
"psrld $2, %%mm7 \n\t"
"movd %%mm7, %0 \n\t"
-
+
: "+r" (i)
: "r"(basis), "r"(rem), "r"(weight), "g"(scale)
);
static void add_8x8basis_mmx(int16_t rem[64], int16_t basis[64], int scale){
long i=0;
-
+
if(ABS(scale) < 256){
scale<<= 16 + 1 - BASIS_SHIFT + RECON_SHIFT;
asm volatile(
"pcmpeqw %%mm6, %%mm6 \n\t" // -1w
"psrlw $15, %%mm6 \n\t" // 1w
- "movd %3, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
- "punpcklwd %%mm5, %%mm5 \n\t"
+ "movd %3, %%mm5 \n\t"
+ "punpcklwd %%mm5, %%mm5 \n\t"
+ "punpcklwd %%mm5, %%mm5 \n\t"
"1: \n\t"
- "movq (%1, %0), %%mm0 \n\t"
+ "movq (%1, %0), %%mm0 \n\t"
"movq 8(%1, %0), %%mm1 \n\t"
"pmulhw %%mm5, %%mm0 \n\t"
"pmulhw %%mm5, %%mm1 \n\t"
- "paddw %%mm6, %%mm0 \n\t"
+ "paddw %%mm6, %%mm0 \n\t"
"paddw %%mm6, %%mm1 \n\t"
"psraw $1, %%mm0 \n\t"
"psraw $1, %%mm1 \n\t"
"add $16, %0 \n\t"
"cmp $128, %0 \n\t" //FIXME optimize & bench
" jb 1b \n\t"
-
+
: "+r" (i)
: "r"(basis), "r"(rem), "g"(scale)
);
}else{
for(i=0; i<8*8; i++){
rem[i] += (basis[i]*scale + (1<<(BASIS_SHIFT - RECON_SHIFT-1)))>>(BASIS_SHIFT - RECON_SHIFT);
- }
+ }
}
}
#include "h264dsp_mmx.c"
-
+
/* external functions, from idct_mmx.c */
void ff_mmx_idct(DCTELEM *block);
void ff_mmxext_idct(DCTELEM *block);
add_pixels_clamped_mmx(block, dest, line_size);
}
#endif
-
+
void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
{
mm_flags = mm_support();
c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels8_x2_mmx;
c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels8_y2_mmx;
c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels8_xy2_mmx;
-
+
c->add_bytes= add_bytes_mmx;
#ifdef CONFIG_ENCODERS
c->diff_bytes= diff_bytes_mmx;
-
+
c->hadamard8_diff[0]= hadamard8_diff16_mmx;
c->hadamard8_diff[1]= hadamard8_diff_mmx;
-
+
c->pix_norm1 = pix_norm1_mmx;
c->sse[0] = (mm_flags & MM_SSE2) ? sse16_sse2 : sse16_mmx;
c->sse[1] = sse8_mmx;
if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
c->vsad[0] = vsad16_mmx;
}
-
+
if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
c->try_8x8basis= try_8x8basis_mmx;
}
c->add_8x8basis= add_8x8basis_mmx;
-
+
#endif //CONFIG_ENCODERS
c->h263_v_loop_filter= h263_v_loop_filter_mmx;
- c->h263_h_loop_filter= h263_h_loop_filter_mmx;
+ c->h263_h_loop_filter= h263_h_loop_filter_mmx;
c->put_h264_chroma_pixels_tab[0]= put_h264_chroma_mc8_mmx;
c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_mmx;
-
+
if (mm_flags & MM_MMXEXT) {
c->put_pixels_tab[0][1] = put_pixels16_x2_mmx2;
c->put_pixels_tab[0][2] = put_pixels16_y2_mmx2;
c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_3dnow;
}
}
-
+
#ifdef CONFIG_ENCODERS
dsputil_init_pix_mmx(c, avctx);
#endif //CONFIG_ENCODERS
* mostly rewritten by Michael Niedermayer <michaelni@gmx.at>
* and improved by Zdenek Kabelac <kabi@users.sf.net>
*/
-
+
/* XXX: we use explicit registers to avoid a gcc 2.95.2 register asm
clobber bug - now it will work with 2.95.2 and also with -fPIC
*/
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
}
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
:"r"(src1Stride), "r"(dstStride)
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
:"r"(src1Stride), "r"(dstStride)
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
}
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
:"r"(src1Stride), "r"(dstStride)
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
:"r"(src1Stride), "r"(dstStride)
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
:"r"(src1Stride), "r"(dstStride)
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
:"r"(src1Stride), "r"(dstStride)
:"memory");*/
}
-
+
/* GL: this function does incorrect rounding if overflow */
static void DEF(put_no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
:"%"REG_a, "memory");
}
-// Note this is not correctly rounded, but this function is only used for b frames so it doesnt matter
+// Note this is not correctly rounded, but this function is only used for b frames so it doesnt matter
static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
MOVQ_BONE(mm6);
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
- :"memory");
+ :"memory");
}
static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)
* SSE2 optimization is Copyright (c) 2004 Denes Balatoni.
*
* from fdctam32.c - AP922 MMX(3D-Now) forward-DCT
- *
+ *
* Intel Application Note AP-922 - fast, precise implementation of DCT
* http://developer.intel.com/vtune/cbts/appnotes.htm
*
static const int32_t fdct_r_row[2] ATTR_ALIGN(8) = {RND_FRW_ROW, RND_FRW_ROW };
-struct
+struct
{
const int32_t fdct_r_row_sse2[4] ATTR_ALIGN(16);
} fdct_r_row_sse2 ATTR_ALIGN(16)=
//static const long fdct_r_row_sse2[4] ATTR_ALIGN(16) = {RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW};
static const int16_t tab_frw_01234567[] ATTR_ALIGN(8) = { // forward_dct coeff table
- 16384, 16384, 22725, 19266,
- 16384, 16384, 12873, 4520,
- 21407, 8867, 19266, -4520,
- -8867, -21407, -22725, -12873,
- 16384, -16384, 12873, -22725,
- -16384, 16384, 4520, 19266,
- 8867, -21407, 4520, -12873,
- 21407, -8867, 19266, -22725,
-
- 22725, 22725, 31521, 26722,
- 22725, 22725, 17855, 6270,
- 29692, 12299, 26722, -6270,
- -12299, -29692, -31521, -17855,
- 22725, -22725, 17855, -31521,
- -22725, 22725, 6270, 26722,
- 12299, -29692, 6270, -17855,
- 29692, -12299, 26722, -31521,
-
- 21407, 21407, 29692, 25172,
- 21407, 21407, 16819, 5906,
- 27969, 11585, 25172, -5906,
- -11585, -27969, -29692, -16819,
- 21407, -21407, 16819, -29692,
- -21407, 21407, 5906, 25172,
- 11585, -27969, 5906, -16819,
- 27969, -11585, 25172, -29692,
-
- 19266, 19266, 26722, 22654,
- 19266, 19266, 15137, 5315,
- 25172, 10426, 22654, -5315,
- -10426, -25172, -26722, -15137,
- 19266, -19266, 15137, -26722,
- -19266, 19266, 5315, 22654,
- 10426, -25172, 5315, -15137,
- 25172, -10426, 22654, -26722,
-
- 16384, 16384, 22725, 19266,
- 16384, 16384, 12873, 4520,
- 21407, 8867, 19266, -4520,
- -8867, -21407, -22725, -12873,
- 16384, -16384, 12873, -22725,
- -16384, 16384, 4520, 19266,
- 8867, -21407, 4520, -12873,
- 21407, -8867, 19266, -22725,
-
- 19266, 19266, 26722, 22654,
- 19266, 19266, 15137, 5315,
- 25172, 10426, 22654, -5315,
- -10426, -25172, -26722, -15137,
- 19266, -19266, 15137, -26722,
- -19266, 19266, 5315, 22654,
- 10426, -25172, 5315, -15137,
- 25172, -10426, 22654, -26722,
-
- 21407, 21407, 29692, 25172,
- 21407, 21407, 16819, 5906,
- 27969, 11585, 25172, -5906,
- -11585, -27969, -29692, -16819,
- 21407, -21407, 16819, -29692,
- -21407, 21407, 5906, 25172,
- 11585, -27969, 5906, -16819,
- 27969, -11585, 25172, -29692,
-
- 22725, 22725, 31521, 26722,
- 22725, 22725, 17855, 6270,
- 29692, 12299, 26722, -6270,
- -12299, -29692, -31521, -17855,
- 22725, -22725, 17855, -31521,
- -22725, 22725, 6270, 26722,
- 12299, -29692, 6270, -17855,
- 29692, -12299, 26722, -31521,
+ 16384, 16384, 22725, 19266,
+ 16384, 16384, 12873, 4520,
+ 21407, 8867, 19266, -4520,
+ -8867, -21407, -22725, -12873,
+ 16384, -16384, 12873, -22725,
+ -16384, 16384, 4520, 19266,
+ 8867, -21407, 4520, -12873,
+ 21407, -8867, 19266, -22725,
+
+ 22725, 22725, 31521, 26722,
+ 22725, 22725, 17855, 6270,
+ 29692, 12299, 26722, -6270,
+ -12299, -29692, -31521, -17855,
+ 22725, -22725, 17855, -31521,
+ -22725, 22725, 6270, 26722,
+ 12299, -29692, 6270, -17855,
+ 29692, -12299, 26722, -31521,
+
+ 21407, 21407, 29692, 25172,
+ 21407, 21407, 16819, 5906,
+ 27969, 11585, 25172, -5906,
+ -11585, -27969, -29692, -16819,
+ 21407, -21407, 16819, -29692,
+ -21407, 21407, 5906, 25172,
+ 11585, -27969, 5906, -16819,
+ 27969, -11585, 25172, -29692,
+
+ 19266, 19266, 26722, 22654,
+ 19266, 19266, 15137, 5315,
+ 25172, 10426, 22654, -5315,
+ -10426, -25172, -26722, -15137,
+ 19266, -19266, 15137, -26722,
+ -19266, 19266, 5315, 22654,
+ 10426, -25172, 5315, -15137,
+ 25172, -10426, 22654, -26722,
+
+ 16384, 16384, 22725, 19266,
+ 16384, 16384, 12873, 4520,
+ 21407, 8867, 19266, -4520,
+ -8867, -21407, -22725, -12873,
+ 16384, -16384, 12873, -22725,
+ -16384, 16384, 4520, 19266,
+ 8867, -21407, 4520, -12873,
+ 21407, -8867, 19266, -22725,
+
+ 19266, 19266, 26722, 22654,
+ 19266, 19266, 15137, 5315,
+ 25172, 10426, 22654, -5315,
+ -10426, -25172, -26722, -15137,
+ 19266, -19266, 15137, -26722,
+ -19266, 19266, 5315, 22654,
+ 10426, -25172, 5315, -15137,
+ 25172, -10426, 22654, -26722,
+
+ 21407, 21407, 29692, 25172,
+ 21407, 21407, 16819, 5906,
+ 27969, 11585, 25172, -5906,
+ -11585, -27969, -29692, -16819,
+ 21407, -21407, 16819, -29692,
+ -21407, 21407, 5906, 25172,
+ 11585, -27969, 5906, -16819,
+ 27969, -11585, 25172, -29692,
+
+ 22725, 22725, 31521, 26722,
+ 22725, 22725, 17855, 6270,
+ 29692, 12299, 26722, -6270,
+ -12299, -29692, -31521, -17855,
+ 22725, -22725, 17855, -31521,
+ -22725, 22725, 6270, 26722,
+ 12299, -29692, 6270, -17855,
+ 29692, -12299, 26722, -31521,
};
-struct
+struct
{
const int16_t tab_frw_01234567_sse2[256] ATTR_ALIGN(16);
} tab_frw_01234567_sse2 ATTR_ALIGN(16) =
{{
-//static const int16_t tab_frw_01234567_sse2[] ATTR_ALIGN(16) = { // forward_dct coeff table
+//static const int16_t tab_frw_01234567_sse2[] ATTR_ALIGN(16) = { // forward_dct coeff table
#define TABLE_SSE2 C4, C4, C1, C3, -C6, -C2, -C1, -C5, \
C4, C4, C5, C7, C2, C6, C3, -C7, \
-C4, C4, C7, C3, C6, -C2, C7, -C5, \
- C4, -C4, C5, -C1, C2, -C6, C3, -C1,
-// c1..c7 * cos(pi/4) * 2^15
+ C4, -C4, C5, -C1, C2, -C6, C3, -C1,
+// c1..c7 * cos(pi/4) * 2^15
#define C1 22725
#define C2 21407
#define C3 19266
"movq \\i(%0), %%xmm2 \n\t"
"movq \\i+8(%0), %%xmm0 \n\t"
"movdqa \\t+32(%1), %%xmm3 \n\t"
- "movdqa \\t+48(%1), %%xmm7 \n\t"
+ "movdqa \\t+48(%1), %%xmm7 \n\t"
"movdqa \\t(%1), %%xmm4 \n\t"
- "movdqa \\t+16(%1), %%xmm5 \n\t"
+ "movdqa \\t+16(%1), %%xmm5 \n\t"
".endm \n\t"
".macro FDCT_ROW_SSE2_H2 i t \n\t"
"movq \\i(%0), %%xmm2 \n\t"
"movq \\i+8(%0), %%xmm0 \n\t"
"movdqa \\t+32(%1), %%xmm3 \n\t"
- "movdqa \\t+48(%1), %%xmm7 \n\t"
+ "movdqa \\t+48(%1), %%xmm7 \n\t"
".endm \n\t"
- ".macro FDCT_ROW_SSE2 i \n\t"
+ ".macro FDCT_ROW_SSE2 i \n\t"
"movq %%xmm2, %%xmm1 \n\t"
"pshuflw $27, %%xmm0, %%xmm0 \n\t"
"paddsw %%xmm0, %%xmm1 \n\t"
"pmaddwd %%xmm1, %%xmm7 \n\t"
"pmaddwd %%xmm5, %%xmm2 \n\t"
"pmaddwd %%xmm4, %%xmm1 \n\t"
- "paddd %%xmm7, %%xmm3 \n\t"
+ "paddd %%xmm7, %%xmm3 \n\t"
"paddd %%xmm2, %%xmm1 \n\t"
"paddd %%xmm6, %%xmm3 \n\t"
"paddd %%xmm6, %%xmm1 \n\t"
"psrad %3, %%xmm1 \n\t"
"packssdw %%xmm3, %%xmm1 \n\t"
"movdqa %%xmm1, \\i(%4) \n\t"
- ".endm \n\t"
- "movdqa (%2), %%xmm6 \n\t"
+ ".endm \n\t"
+ "movdqa (%2), %%xmm6 \n\t"
"FDCT_ROW_SSE2_H1 0 0 \n\t"
"FDCT_ROW_SSE2 0 \n\t"
"FDCT_ROW_SSE2_H2 64 0 \n\t"
}
static always_inline void fdct_row_mmx2(const int16_t *in, int16_t *out, const int16_t *table)
-{
+{
pshufw_m2r(*(in + 4), mm5, 0x1B);
movq_m2r(*(in + 0), mm0);
movq_r2r(mm0, mm1);
}
static always_inline void fdct_row_mmx(const int16_t *in, int16_t *out, const int16_t *table)
-{
+{
//FIXME reorder (i dont have a old mmx only cpu here to benchmark ...)
movd_m2r(*(in + 6), mm1);
punpcklwd_m2r(*(in + 4), mm1);
}
}
-void ff_fdct_sse2(int16_t *block)
+void ff_fdct_sse2(int16_t *block)
{
int64_t align_tmp[16] ATTR_ALIGN(8);
int16_t * const block_tmp= (int16_t*)align_tmp;
#include <xmmintrin.h>
-static const float p1p1p1m1[4] __attribute__((aligned(16))) =
+static const float p1p1p1m1[4] __attribute__((aligned(16))) =
{ 1.0, 1.0, 1.0, -1.0 };
-static const float p1p1m1p1[4] __attribute__((aligned(16))) =
+static const float p1p1m1p1[4] __attribute__((aligned(16))) =
{ 1.0, 1.0, -1.0, 1.0 };
-static const float p1p1m1m1[4] __attribute__((aligned(16))) =
+static const float p1p1m1m1[4] __attribute__((aligned(16))) =
{ 1.0, 1.0, -1.0, -1.0 };
#if 0
a = *(__m128 *)p;
b = *(__m128 *)q;
-
+
/* complex mul */
c = *(__m128 *)cptr;
/* cre*re cim*re */
- t1 = _mm_mul_ps(c,
- _mm_shuffle_ps(b, b, _MM_SHUFFLE(2, 2, 0, 0)));
+ t1 = _mm_mul_ps(c,
+ _mm_shuffle_ps(b, b, _MM_SHUFFLE(2, 2, 0, 0)));
c = *(__m128 *)(cptr + 2);
/* -cim*im cre*im */
t2 = _mm_mul_ps(c,
- _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 3, 1, 1)));
+ _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 3, 1, 1)));
b = _mm_add_ps(t1, t2);
-
+
/* butterfly */
*(__m128 *)p = _mm_add_ps(a, b);
*(__m128 *)q = _mm_sub_ps(a, b);
-
+
p += 2;
q += 2;
cptr += 4;
} while (--k);
-
+
p += nloops;
q += nloops;
} while (--j);
"psraw $5, %%mm6 \n\t"\
"packuswb %%mm6, %%mm6 \n\t"\
OP(%%mm6, (%1), A, d)\
- "add %3, %1 \n\t"
+ "add %3, %1 \n\t"
#define QPEL_H264HV(A,B,C,D,E,F,OF)\
"movd (%0), "#F" \n\t"\
"paddw "#F", "#A" \n\t"\
"paddw "#A", %%mm6 \n\t"\
"movq %%mm6, "#OF"(%1) \n\t"
-
+
#define QPEL_H264(OPNAME, OP, MMX)\
static void OPNAME ## h264_qpel4_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
int h=4;\
//-----------------------------------------------------------------------------
-static const int16_t tg_1_16[4*4] attribute_used __attribute__ ((aligned(8))) = {
+static const int16_t tg_1_16[4*4] attribute_used __attribute__ ((aligned(8))) = {
13036,13036,13036,13036, // tg * (2<<16) + 0.5
27146,27146,27146,27146, // tg * (2<<16) + 0.5
-21746,-21746,-21746,-21746, // tg * (2<<16) + 0.5
23170,23170,23170,23170}; // cos * (2<<15) + 0.5
-static const int32_t rounder_0[2*8] attribute_used __attribute__ ((aligned(8))) = {
+static const int32_t rounder_0[2*8] attribute_used __attribute__ ((aligned(8))) = {
65536,65536,
3597,3597,
2260,2260,
//-----------------------------------------------------------------------------
// Table for rows 0,4 - constants are multiplied by cos_4_16
-static const int16_t tab_i_04_mmx[32*4] attribute_used __attribute__ ((aligned(8))) = {
+static const int16_t tab_i_04_mmx[32*4] attribute_used __attribute__ ((aligned(8))) = {
16384,16384,16384,-16384, // movq-> w06 w04 w02 w00
21407,8867,8867,-21407, // w07 w05 w03 w01
16384,-16384,16384,16384, // w14 w12 w10 w08
//-----------------------------------------------------------------------------
// %3 for rows 0,4 - constants are multiplied by cos_4_16
-static const int16_t tab_i_04_xmm[32*4] attribute_used __attribute__ ((aligned(8))) = {
+static const int16_t tab_i_04_xmm[32*4] attribute_used __attribute__ ((aligned(8))) = {
16384,21407,16384,8867, // movq-> w05 w04 w01 w00
16384,8867,-16384,-21407, // w07 w06 w03 w02
16384,-8867,16384,-21407, // w13 w12 w09 w08
DCT_8_INV_ROW_MMX(5*16(%0), 5*16(%0), 64*3(%2), 8*5(%1))
DCT_8_INV_ROW_MMX(6*16(%0), 6*16(%0), 64*2(%2), 8*6(%1))
DCT_8_INV_ROW_MMX(7*16(%0), 7*16(%0), 64*1(%2), 8*7(%1))
-
+
//# Process the columns (4 at a time)
DCT_8_INV_COL(0(%0), 0(%0))
DCT_8_INV_COL(8(%0), 8(%0))
DCT_8_INV_ROW_XMM(5*16(%0), 5*16(%0), 64*3(%2), 8*5(%1))
DCT_8_INV_ROW_XMM(6*16(%0), 6*16(%0), 64*2(%2), 8*6(%1))
DCT_8_INV_ROW_XMM(7*16(%0), 7*16(%0), 64*1(%2), 8*7(%1))
-
+
//# Process the columns (4 at a time)
DCT_8_INV_COL(0(%0), 0(%0))
DCT_8_INV_COL(8(%0), 8(%0))
c->sad[0]= sad16_mmx2;
c->sad[1]= sad8_mmx2;
-
+
if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
c->pix_abs[0][1] = sad16_x2_mmx2;
c->pix_abs[0][2] = sad16_y2_mmx2;
qmul = qscale << 1;
assert(s->block_last_index[n]>=0 || s->h263_aic);
-
+
if (!s->h263_aic) {
if (n < 4)
level = block[0] * s->y_dc_scale;
qadd = (qscale - 1) | 1;
assert(s->block_last_index[n]>=0 || s->h263_aic);
-
+
nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
//printf("%d %d ", qmul, qadd);
asm volatile(
nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]+1;
- if (n < 4)
+ if (n < 4)
block0 = block[0] * s->y_dc_scale;
else
block0 = block[0] * s->c_dc_scale;
"js 1b \n\t"
::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)
: "%"REG_a, "memory"
- );
+ );
block[0]= block0;
}
long nCoeffs;
const uint16_t *quant_matrix;
int block0;
-
+
assert(s->block_last_index[n]>=0);
if(s->alternate_scan) nCoeffs= 63; //FIXME
else nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
- if (n < 4)
+ if (n < 4)
block0 = block[0] * s->y_dc_scale;
else
block0 = block[0] * s->c_dc_scale;
"jng 1b \n\t"
::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "g" (-2*nCoeffs)
: "%"REG_a, "memory"
- );
+ );
block[0]= block0;
//Note, we dont do mismatch control for intra as errors cannot accumulate
}
{
long nCoeffs;
const uint16_t *quant_matrix;
-
+
assert(s->block_last_index[n]>=0);
if(s->alternate_scan) nCoeffs= 63; //FIXME
"psrlq $15, %%mm7 \n\t"
"pxor %%mm7, %%mm0 \n\t"
"movd %%mm0, 124(%0, %3) \n\t"
-
+
::"r" (block+nCoeffs), "r"(quant_matrix+nCoeffs), "g" (qscale), "r" (-2*nCoeffs)
: "%"REG_a, "memory"
);
}
-/* draw the edges of width 'w' of an image of size width, height
+/* draw the edges of width 'w' of an image of size width, height
this mmx version can only handle w==8 || w==16 */
static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, int w)
{
asm volatile(
"1: \n\t"
"movd (%0), %%mm0 \n\t"
- "punpcklbw %%mm0, %%mm0 \n\t"
+ "punpcklbw %%mm0, %%mm0 \n\t"
"punpcklwd %%mm0, %%mm0 \n\t"
"punpckldq %%mm0, %%mm0 \n\t"
"movq %%mm0, -8(%0) \n\t"
asm volatile(
"1: \n\t"
"movd (%0), %%mm0 \n\t"
- "punpcklbw %%mm0, %%mm0 \n\t"
+ "punpcklbw %%mm0, %%mm0 \n\t"
"punpcklwd %%mm0, %%mm0 \n\t"
"punpckldq %%mm0, %%mm0 \n\t"
"movq %%mm0, -8(%0) \n\t"
"movq %%mm1, 8(%0, %2) \n\t"
"add %1, %0 \n\t"
"cmp %3, %0 \n\t"
- " jb 1b \n\t"
+ " jb 1b \n\t"
: "+r" (ptr)
: "r" ((long)wrap), "r" ((long)width), "r" (ptr + wrap*height)
);
}
-
+
for(i=0;i<w;i+=4) {
/* top and bottom (and hopefully also the corners) */
ptr= buf - (i + 1) * wrap - w;
{
if (mm_flags & MM_MMX) {
const int dct_algo = s->avctx->dct_algo;
-
+
s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_mmx;
s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_mmx;
s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_mmx;
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
draw_edges = draw_edges_mmx;
-
+
if (mm_flags & MM_SSE2) {
s->denoise_dct= denoise_dct_sse2;
} else {
int level=0, q; //=0 is cuz gcc says uninitalized ...
const uint16_t *qmat, *bias;
__align8 int16_t temp_block[64];
-
+
assert((7&(int)(&temp_block[0])) == 0); //did gcc align it correctly?
//s->fdct (block);
} else
/* For AIC we skip quant/dequant of INTRADC */
level = (block[0] + 4)>>3;
-
+
block[0]=0; //avoid fake overflow
// temp_block[0] = (block[0] + (q >> 1)) / q;
last_non_zero_p1 = 1;
}
if((s->out_format == FMT_H263 || s->out_format == FMT_H261) && s->mpeg_quant==0){
-
+
asm volatile(
"movd %%"REG_a", %%mm3 \n\t" // last_non_zero_p1
SPREADW(%%mm3)
"pxor %%mm1, %%mm1 \n\t" // 0
"movq (%1, %%"REG_a"), %%mm0 \n\t" // block[i]
"pcmpgtw %%mm0, %%mm1 \n\t" // block[i] <= 0 ? 0xFF : 0x00
- "pxor %%mm1, %%mm0 \n\t"
+ "pxor %%mm1, %%mm0 \n\t"
"psubw %%mm1, %%mm0 \n\t" // ABS(block[i])
"psubusw %%mm6, %%mm0 \n\t" // ABS(block[i]) + bias[0]
"pmulhw %%mm5, %%mm0 \n\t" // (ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16
- "por %%mm0, %%mm4 \n\t"
- "pxor %%mm1, %%mm0 \n\t"
+ "por %%mm0, %%mm4 \n\t"
+ "pxor %%mm1, %%mm0 \n\t"
"psubw %%mm1, %%mm0 \n\t" // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i])
"movq %%mm0, (%5, %%"REG_a") \n\t"
"pcmpeqw %%mm7, %%mm0 \n\t" // out==0 ? 0xFF : 0x00
- "movq (%4, %%"REG_a"), %%mm1 \n\t"
+ "movq (%4, %%"REG_a"), %%mm1 \n\t"
"movq %%mm7, (%1, %%"REG_a") \n\t" // 0
"pandn %%mm1, %%mm0 \n\t"
PMAXW(%%mm0, %%mm3)
asm volatile(
"movd %1, %%mm1 \n\t" // max_qcoeff
SPREADW(%%mm1)
- "psubusw %%mm1, %%mm4 \n\t"
+ "psubusw %%mm1, %%mm4 \n\t"
"packuswb %%mm4, %%mm4 \n\t"
"movd %%mm4, %0 \n\t" // *overflow
: "=g" (*overflow)
"pxor %%mm1, %%mm1 \n\t" // 0
"movq (%1, %%"REG_a"), %%mm0 \n\t" // block[i]
"pcmpgtw %%mm0, %%mm1 \n\t" // block[i] <= 0 ? 0xFF : 0x00
- "pxor %%mm1, %%mm0 \n\t"
+ "pxor %%mm1, %%mm0 \n\t"
"psubw %%mm1, %%mm0 \n\t" // ABS(block[i])
"movq (%3, %%"REG_a"), %%mm6 \n\t" // bias[0]
"paddusw %%mm6, %%mm0 \n\t" // ABS(block[i]) + bias[0]
"movq (%2, %%"REG_a"), %%mm5 \n\t" // qmat[i]
"pmulhw %%mm5, %%mm0 \n\t" // (ABS(block[i])*qmat[0] + bias[0]*qmat[0])>>16
- "por %%mm0, %%mm4 \n\t"
- "pxor %%mm1, %%mm0 \n\t"
+ "por %%mm0, %%mm4 \n\t"
+ "pxor %%mm1, %%mm0 \n\t"
"psubw %%mm1, %%mm0 \n\t" // out=((ABS(block[i])*qmat[0] - bias[0]*qmat[0])>>16)*sign(block[i])
"movq %%mm0, (%5, %%"REG_a") \n\t"
"pcmpeqw %%mm7, %%mm0 \n\t" // out==0 ? 0xFF : 0x00
- "movq (%4, %%"REG_a"), %%mm1 \n\t"
+ "movq (%4, %%"REG_a"), %%mm1 \n\t"
"movq %%mm7, (%1, %%"REG_a") \n\t" // 0
"pandn %%mm1, %%mm0 \n\t"
PMAXW(%%mm0, %%mm3)
asm volatile(
"movd %1, %%mm1 \n\t" // max_qcoeff
SPREADW(%%mm1)
- "psubusw %%mm1, %%mm4 \n\t"
+ "psubusw %%mm1, %%mm4 \n\t"
"packuswb %%mm4, %%mm4 \n\t"
"movd %%mm4, %0 \n\t" // *overflow
: "=g" (*overflow)
if(s->dsp.idct_permutation_type == FF_SIMPLE_IDCT_PERM){
if(last_non_zero_p1 <= 1) goto end;
- block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08];
- block[0x20] = temp_block[0x10];
+ block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08];
+ block[0x20] = temp_block[0x10];
if(last_non_zero_p1 <= 4) goto end;
- block[0x18] = temp_block[0x09]; block[0x04] = temp_block[0x02];
- block[0x09] = temp_block[0x03];
+ block[0x18] = temp_block[0x09]; block[0x04] = temp_block[0x02];
+ block[0x09] = temp_block[0x03];
if(last_non_zero_p1 <= 7) goto end;
- block[0x14] = temp_block[0x0A]; block[0x28] = temp_block[0x11];
- block[0x12] = temp_block[0x18]; block[0x02] = temp_block[0x20];
+ block[0x14] = temp_block[0x0A]; block[0x28] = temp_block[0x11];
+ block[0x12] = temp_block[0x18]; block[0x02] = temp_block[0x20];
if(last_non_zero_p1 <= 11) goto end;
- block[0x1A] = temp_block[0x19]; block[0x24] = temp_block[0x12];
- block[0x19] = temp_block[0x0B]; block[0x01] = temp_block[0x04];
- block[0x0C] = temp_block[0x05];
+ block[0x1A] = temp_block[0x19]; block[0x24] = temp_block[0x12];
+ block[0x19] = temp_block[0x0B]; block[0x01] = temp_block[0x04];
+ block[0x0C] = temp_block[0x05];
if(last_non_zero_p1 <= 16) goto end;
- block[0x11] = temp_block[0x0C]; block[0x29] = temp_block[0x13];
- block[0x16] = temp_block[0x1A]; block[0x0A] = temp_block[0x21];
- block[0x30] = temp_block[0x28]; block[0x22] = temp_block[0x30];
- block[0x38] = temp_block[0x29]; block[0x06] = temp_block[0x22];
+ block[0x11] = temp_block[0x0C]; block[0x29] = temp_block[0x13];
+ block[0x16] = temp_block[0x1A]; block[0x0A] = temp_block[0x21];
+ block[0x30] = temp_block[0x28]; block[0x22] = temp_block[0x30];
+ block[0x38] = temp_block[0x29]; block[0x06] = temp_block[0x22];
if(last_non_zero_p1 <= 24) goto end;
- block[0x1B] = temp_block[0x1B]; block[0x21] = temp_block[0x14];
- block[0x1C] = temp_block[0x0D]; block[0x05] = temp_block[0x06];
- block[0x0D] = temp_block[0x07]; block[0x15] = temp_block[0x0E];
- block[0x2C] = temp_block[0x15]; block[0x13] = temp_block[0x1C];
+ block[0x1B] = temp_block[0x1B]; block[0x21] = temp_block[0x14];
+ block[0x1C] = temp_block[0x0D]; block[0x05] = temp_block[0x06];
+ block[0x0D] = temp_block[0x07]; block[0x15] = temp_block[0x0E];
+ block[0x2C] = temp_block[0x15]; block[0x13] = temp_block[0x1C];
if(last_non_zero_p1 <= 32) goto end;
- block[0x0B] = temp_block[0x23]; block[0x34] = temp_block[0x2A];
- block[0x2A] = temp_block[0x31]; block[0x32] = temp_block[0x38];
- block[0x3A] = temp_block[0x39]; block[0x26] = temp_block[0x32];
- block[0x39] = temp_block[0x2B]; block[0x03] = temp_block[0x24];
+ block[0x0B] = temp_block[0x23]; block[0x34] = temp_block[0x2A];
+ block[0x2A] = temp_block[0x31]; block[0x32] = temp_block[0x38];
+ block[0x3A] = temp_block[0x39]; block[0x26] = temp_block[0x32];
+ block[0x39] = temp_block[0x2B]; block[0x03] = temp_block[0x24];
if(last_non_zero_p1 <= 40) goto end;
- block[0x1E] = temp_block[0x1D]; block[0x25] = temp_block[0x16];
- block[0x1D] = temp_block[0x0F]; block[0x2D] = temp_block[0x17];
- block[0x17] = temp_block[0x1E]; block[0x0E] = temp_block[0x25];
- block[0x31] = temp_block[0x2C]; block[0x2B] = temp_block[0x33];
+ block[0x1E] = temp_block[0x1D]; block[0x25] = temp_block[0x16];
+ block[0x1D] = temp_block[0x0F]; block[0x2D] = temp_block[0x17];
+ block[0x17] = temp_block[0x1E]; block[0x0E] = temp_block[0x25];
+ block[0x31] = temp_block[0x2C]; block[0x2B] = temp_block[0x33];
if(last_non_zero_p1 <= 48) goto end;
- block[0x36] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
- block[0x23] = temp_block[0x34]; block[0x3C] = temp_block[0x2D];
- block[0x07] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
- block[0x0F] = temp_block[0x27]; block[0x35] = temp_block[0x2E];
+ block[0x36] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
+ block[0x23] = temp_block[0x34]; block[0x3C] = temp_block[0x2D];
+ block[0x07] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
+ block[0x0F] = temp_block[0x27]; block[0x35] = temp_block[0x2E];
if(last_non_zero_p1 <= 56) goto end;
- block[0x2E] = temp_block[0x35]; block[0x33] = temp_block[0x3C];
- block[0x3E] = temp_block[0x3D]; block[0x27] = temp_block[0x36];
- block[0x3D] = temp_block[0x2F]; block[0x2F] = temp_block[0x37];
+ block[0x2E] = temp_block[0x35]; block[0x33] = temp_block[0x3C];
+ block[0x3E] = temp_block[0x3D]; block[0x27] = temp_block[0x36];
+ block[0x3D] = temp_block[0x2F]; block[0x2F] = temp_block[0x37];
block[0x37] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
}else if(s->dsp.idct_permutation_type == FF_LIBMPEG2_IDCT_PERM){
if(last_non_zero_p1 <= 1) goto end;
- block[0x04] = temp_block[0x01];
- block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
+ block[0x04] = temp_block[0x01];
+ block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
if(last_non_zero_p1 <= 4) goto end;
- block[0x0C] = temp_block[0x09]; block[0x01] = temp_block[0x02];
- block[0x05] = temp_block[0x03];
+ block[0x0C] = temp_block[0x09]; block[0x01] = temp_block[0x02];
+ block[0x05] = temp_block[0x03];
if(last_non_zero_p1 <= 7) goto end;
- block[0x09] = temp_block[0x0A]; block[0x14] = temp_block[0x11];
- block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
+ block[0x09] = temp_block[0x0A]; block[0x14] = temp_block[0x11];
+ block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
if(last_non_zero_p1 <= 11) goto end;
- block[0x1C] = temp_block[0x19];
- block[0x11] = temp_block[0x12]; block[0x0D] = temp_block[0x0B];
- block[0x02] = temp_block[0x04]; block[0x06] = temp_block[0x05];
+ block[0x1C] = temp_block[0x19];
+ block[0x11] = temp_block[0x12]; block[0x0D] = temp_block[0x0B];
+ block[0x02] = temp_block[0x04]; block[0x06] = temp_block[0x05];
if(last_non_zero_p1 <= 16) goto end;
- block[0x0A] = temp_block[0x0C]; block[0x15] = temp_block[0x13];
- block[0x19] = temp_block[0x1A]; block[0x24] = temp_block[0x21];
- block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
- block[0x2C] = temp_block[0x29]; block[0x21] = temp_block[0x22];
+ block[0x0A] = temp_block[0x0C]; block[0x15] = temp_block[0x13];
+ block[0x19] = temp_block[0x1A]; block[0x24] = temp_block[0x21];
+ block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
+ block[0x2C] = temp_block[0x29]; block[0x21] = temp_block[0x22];
if(last_non_zero_p1 <= 24) goto end;
- block[0x1D] = temp_block[0x1B]; block[0x12] = temp_block[0x14];
- block[0x0E] = temp_block[0x0D]; block[0x03] = temp_block[0x06];
- block[0x07] = temp_block[0x07]; block[0x0B] = temp_block[0x0E];
- block[0x16] = temp_block[0x15]; block[0x1A] = temp_block[0x1C];
+ block[0x1D] = temp_block[0x1B]; block[0x12] = temp_block[0x14];
+ block[0x0E] = temp_block[0x0D]; block[0x03] = temp_block[0x06];
+ block[0x07] = temp_block[0x07]; block[0x0B] = temp_block[0x0E];
+ block[0x16] = temp_block[0x15]; block[0x1A] = temp_block[0x1C];
if(last_non_zero_p1 <= 32) goto end;
- block[0x25] = temp_block[0x23]; block[0x29] = temp_block[0x2A];
- block[0x34] = temp_block[0x31]; block[0x38] = temp_block[0x38];
- block[0x3C] = temp_block[0x39]; block[0x31] = temp_block[0x32];
- block[0x2D] = temp_block[0x2B]; block[0x22] = temp_block[0x24];
+ block[0x25] = temp_block[0x23]; block[0x29] = temp_block[0x2A];
+ block[0x34] = temp_block[0x31]; block[0x38] = temp_block[0x38];
+ block[0x3C] = temp_block[0x39]; block[0x31] = temp_block[0x32];
+ block[0x2D] = temp_block[0x2B]; block[0x22] = temp_block[0x24];
if(last_non_zero_p1 <= 40) goto end;
- block[0x1E] = temp_block[0x1D]; block[0x13] = temp_block[0x16];
- block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
- block[0x1B] = temp_block[0x1E]; block[0x26] = temp_block[0x25];
- block[0x2A] = temp_block[0x2C]; block[0x35] = temp_block[0x33];
+ block[0x1E] = temp_block[0x1D]; block[0x13] = temp_block[0x16];
+ block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
+ block[0x1B] = temp_block[0x1E]; block[0x26] = temp_block[0x25];
+ block[0x2A] = temp_block[0x2C]; block[0x35] = temp_block[0x33];
if(last_non_zero_p1 <= 48) goto end;
- block[0x39] = temp_block[0x3A]; block[0x3D] = temp_block[0x3B];
- block[0x32] = temp_block[0x34]; block[0x2E] = temp_block[0x2D];
- block[0x23] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
- block[0x27] = temp_block[0x27]; block[0x2B] = temp_block[0x2E];
+ block[0x39] = temp_block[0x3A]; block[0x3D] = temp_block[0x3B];
+ block[0x32] = temp_block[0x34]; block[0x2E] = temp_block[0x2D];
+ block[0x23] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
+ block[0x27] = temp_block[0x27]; block[0x2B] = temp_block[0x2E];
if(last_non_zero_p1 <= 56) goto end;
- block[0x36] = temp_block[0x35]; block[0x3A] = temp_block[0x3C];
- block[0x3E] = temp_block[0x3D]; block[0x33] = temp_block[0x36];
- block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
+ block[0x36] = temp_block[0x35]; block[0x3A] = temp_block[0x3C];
+ block[0x3E] = temp_block[0x3D]; block[0x33] = temp_block[0x36];
+ block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
block[0x3B] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
}else{
if(last_non_zero_p1 <= 1) goto end;
- block[0x01] = temp_block[0x01];
- block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
+ block[0x01] = temp_block[0x01];
+ block[0x08] = temp_block[0x08]; block[0x10] = temp_block[0x10];
if(last_non_zero_p1 <= 4) goto end;
- block[0x09] = temp_block[0x09]; block[0x02] = temp_block[0x02];
- block[0x03] = temp_block[0x03];
+ block[0x09] = temp_block[0x09]; block[0x02] = temp_block[0x02];
+ block[0x03] = temp_block[0x03];
if(last_non_zero_p1 <= 7) goto end;
- block[0x0A] = temp_block[0x0A]; block[0x11] = temp_block[0x11];
- block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
+ block[0x0A] = temp_block[0x0A]; block[0x11] = temp_block[0x11];
+ block[0x18] = temp_block[0x18]; block[0x20] = temp_block[0x20];
if(last_non_zero_p1 <= 11) goto end;
- block[0x19] = temp_block[0x19];
- block[0x12] = temp_block[0x12]; block[0x0B] = temp_block[0x0B];
- block[0x04] = temp_block[0x04]; block[0x05] = temp_block[0x05];
+ block[0x19] = temp_block[0x19];
+ block[0x12] = temp_block[0x12]; block[0x0B] = temp_block[0x0B];
+ block[0x04] = temp_block[0x04]; block[0x05] = temp_block[0x05];
if(last_non_zero_p1 <= 16) goto end;
- block[0x0C] = temp_block[0x0C]; block[0x13] = temp_block[0x13];
- block[0x1A] = temp_block[0x1A]; block[0x21] = temp_block[0x21];
- block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
- block[0x29] = temp_block[0x29]; block[0x22] = temp_block[0x22];
+ block[0x0C] = temp_block[0x0C]; block[0x13] = temp_block[0x13];
+ block[0x1A] = temp_block[0x1A]; block[0x21] = temp_block[0x21];
+ block[0x28] = temp_block[0x28]; block[0x30] = temp_block[0x30];
+ block[0x29] = temp_block[0x29]; block[0x22] = temp_block[0x22];
if(last_non_zero_p1 <= 24) goto end;
- block[0x1B] = temp_block[0x1B]; block[0x14] = temp_block[0x14];
- block[0x0D] = temp_block[0x0D]; block[0x06] = temp_block[0x06];
- block[0x07] = temp_block[0x07]; block[0x0E] = temp_block[0x0E];
- block[0x15] = temp_block[0x15]; block[0x1C] = temp_block[0x1C];
+ block[0x1B] = temp_block[0x1B]; block[0x14] = temp_block[0x14];
+ block[0x0D] = temp_block[0x0D]; block[0x06] = temp_block[0x06];
+ block[0x07] = temp_block[0x07]; block[0x0E] = temp_block[0x0E];
+ block[0x15] = temp_block[0x15]; block[0x1C] = temp_block[0x1C];
if(last_non_zero_p1 <= 32) goto end;
- block[0x23] = temp_block[0x23]; block[0x2A] = temp_block[0x2A];
- block[0x31] = temp_block[0x31]; block[0x38] = temp_block[0x38];
- block[0x39] = temp_block[0x39]; block[0x32] = temp_block[0x32];
- block[0x2B] = temp_block[0x2B]; block[0x24] = temp_block[0x24];
+ block[0x23] = temp_block[0x23]; block[0x2A] = temp_block[0x2A];
+ block[0x31] = temp_block[0x31]; block[0x38] = temp_block[0x38];
+ block[0x39] = temp_block[0x39]; block[0x32] = temp_block[0x32];
+ block[0x2B] = temp_block[0x2B]; block[0x24] = temp_block[0x24];
if(last_non_zero_p1 <= 40) goto end;
- block[0x1D] = temp_block[0x1D]; block[0x16] = temp_block[0x16];
- block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
- block[0x1E] = temp_block[0x1E]; block[0x25] = temp_block[0x25];
- block[0x2C] = temp_block[0x2C]; block[0x33] = temp_block[0x33];
+ block[0x1D] = temp_block[0x1D]; block[0x16] = temp_block[0x16];
+ block[0x0F] = temp_block[0x0F]; block[0x17] = temp_block[0x17];
+ block[0x1E] = temp_block[0x1E]; block[0x25] = temp_block[0x25];
+ block[0x2C] = temp_block[0x2C]; block[0x33] = temp_block[0x33];
if(last_non_zero_p1 <= 48) goto end;
- block[0x3A] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
- block[0x34] = temp_block[0x34]; block[0x2D] = temp_block[0x2D];
- block[0x26] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
- block[0x27] = temp_block[0x27]; block[0x2E] = temp_block[0x2E];
+ block[0x3A] = temp_block[0x3A]; block[0x3B] = temp_block[0x3B];
+ block[0x34] = temp_block[0x34]; block[0x2D] = temp_block[0x2D];
+ block[0x26] = temp_block[0x26]; block[0x1F] = temp_block[0x1F];
+ block[0x27] = temp_block[0x27]; block[0x2E] = temp_block[0x2E];
if(last_non_zero_p1 <= 56) goto end;
- block[0x35] = temp_block[0x35]; block[0x3C] = temp_block[0x3C];
- block[0x3D] = temp_block[0x3D]; block[0x36] = temp_block[0x36];
- block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
+ block[0x35] = temp_block[0x35]; block[0x3C] = temp_block[0x3C];
+ block[0x3D] = temp_block[0x3D]; block[0x36] = temp_block[0x36];
+ block[0x2F] = temp_block[0x2F]; block[0x37] = temp_block[0x37];
block[0x3E] = temp_block[0x3E]; block[0x3F] = temp_block[0x3F];
}
end:
C4, C4, C4, C4,
C4, -C4, C4, -C4,
-
+
C2, C6, C2, C6,
C6, -C2, C6, -C2,
-
+
C1, C3, C1, C3,
C5, C7, C5, C7,
-
+
C3, -C7, C3, -C7,
-C1, -C5, -C1, -C5,
-
+
C5, -C1, C5, -C1,
C7, C3, C7, C3,
-
+
C7, -C5, C7, -C5,
C3, -C1, C3, -C1
};
"movd %%mm4, 64+" #dst " \n\t"\
"movd %%mm5, 80+" #dst " \n\t"\
-
+
#define DC_COND_ROW_IDCT(src0, src4, src1, src5, dst, rounder, shift) \
"movq " #src0 ", %%mm0 \n\t" /* R4 R0 r4 r0 */\
"movq " #src4 ", %%mm1 \n\t" /* R6 R2 r6 r2 */\
"packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
"movd %%mm6, 48+" #dst " \n\t"\
"movd %%mm1, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
+ "movd %%mm5, 80+" #dst " \n\t"
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
"packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
"movd %%mm6, 48+" #dst " \n\t"\
"movd %%mm1, 64+" #dst " \n\t"\
- "movd %%mm5, 80+" #dst " \n\t"
+ "movd %%mm5, 80+" #dst " \n\t"
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
"packssdw %%mm1, %%mm6 \n\t" /* A3+B3 a3+b3 */\
"movq %%mm6, 48+" #dst " \n\t"\
"movq %%mm6, 64+" #dst " \n\t"\
- "movq %%mm5, 80+" #dst " \n\t"
-
+ "movq %%mm5, 80+" #dst " \n\t"
+
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
"packssdw %%mm5, %%mm5 \n\t" /* A2-B2 a2-b2 */\
"movd %%mm4, 64+" #dst " \n\t"\
"movd %%mm5, 80+" #dst " \n\t"
-
+
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
IDCT( (%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
"movq %%mm0, 32+" #dst " \n\t"\
"movq %%mm4, 48+" #dst " \n\t"\
"movq %%mm4, 64+" #dst " \n\t"\
- "movq %%mm0, 80+" #dst " \n\t"
+ "movq %%mm0, 80+" #dst " \n\t"
//IDCT( src0, src4, src1, src5, dst, rounder, shift)
IDCT( 0(%1), 64(%1), 32(%1), 96(%1), 0(%0),/nop, 20)
12 32 16 36 52 72 56 76
05 45 07 47 25 65 27 67
15 35 17 37 55 75 57 77
-
+
Temp
00 04 10 14 20 24 30 34
40 44 50 54 60 64 70 74
I(1) = d1 c1 b1 a1
I(2) = d2 c2 b2 a2
I(3) = d3 c3 b3 a3
-
+
J(4) = h0 g0 f0 e0
J(5) = h1 g1 f1 e1
J(6) = h2 g2 f2 e2
};
static const unsigned int __align16 eight_data[] =
-{
- 0x00080008,
+{
+ 0x00080008,
+ 0x00080008,
0x00080008,
- 0x00080008,
- 0x00080008
-};
+ 0x00080008
+};
static const unsigned short __align16 SSE2_idct_data[7 * 8] =
{
- 64277,64277,64277,64277,64277,64277,64277,64277,
- 60547,60547,60547,60547,60547,60547,60547,60547,
- 54491,54491,54491,54491,54491,54491,54491,54491,
- 46341,46341,46341,46341,46341,46341,46341,46341,
- 36410,36410,36410,36410,36410,36410,36410,36410,
- 25080,25080,25080,25080,25080,25080,25080,25080,
+ 64277,64277,64277,64277,64277,64277,64277,64277,
+ 60547,60547,60547,60547,60547,60547,60547,60547,
+ 54491,54491,54491,54491,54491,54491,54491,54491,
+ 46341,46341,46341,46341,46341,46341,46341,46341,
+ 36410,36410,36410,36410,36410,36410,36410,36410,
+ 25080,25080,25080,25080,25080,25080,25080,25080,
12785,12785,12785,12785,12785,12785,12785,12785
};
SSE2_Row_IDCT();
SSE2_Transpose();
-
+
SSE2_Column_IDCT();
}
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
+ .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_YUV422P] = {
.name = "yuv422p",
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
+ .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_YUV444P] = {
.name = "yuv444p",
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
+ .x_chroma_shift = 0, .y_chroma_shift = 0,
},
[PIX_FMT_YUV422] = {
.name = "yuv422",
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 1,
+ .x_chroma_shift = 1, .y_chroma_shift = 1,
},
[PIX_FMT_YUVJ422P] = {
.name = "yuvj422p",
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 1, .y_chroma_shift = 0,
+ .x_chroma_shift = 1, .y_chroma_shift = 0,
},
[PIX_FMT_YUVJ444P] = {
.name = "yuvj444p",
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
- .x_chroma_shift = 0, .y_chroma_shift = 0,
+ .x_chroma_shift = 0, .y_chroma_shift = 0,
},
/* RGB formats */
enum PixelFormat avcodec_get_pix_fmt(const char* name)
{
- int i;
-
+ int i;
+
for (i=0; i < PIX_FMT_NB; i++)
if (!strcmp(pix_fmt_info[i].name, name))
break;
{
int size, w2, h2, size2;
PixFmtInfo *pinfo;
-
+
if(avcodec_check_dimensions(NULL, width, height))
goto fail;
{
PixFmtInfo* pf = &pix_fmt_info[pix_fmt];
int i, j, w, h, data_planes;
- const unsigned char* s;
+ const unsigned char* s;
int size = avpicture_get_size(pix_fmt, width, height);
if (size > dest_size || size < 0)
return -1;
if (pf->pixel_type == FF_PIXEL_PACKED || pf->pixel_type == FF_PIXEL_PALETTE) {
- if (pix_fmt == PIX_FMT_YUV422 ||
- pix_fmt == PIX_FMT_UYVY422 ||
+ if (pix_fmt == PIX_FMT_YUV422 ||
+ pix_fmt == PIX_FMT_UYVY422 ||
pix_fmt == PIX_FMT_RGB565 ||
pix_fmt == PIX_FMT_RGB555)
w = width * 2;
w = width;
else
w = width * (pf->depth * pf->nb_channels / 8);
-
+
data_planes = 1;
h = height;
} else {
w = (width*pf->depth + 7)/8;
h = height;
}
-
+
for (i=0; i<data_planes; i++) {
if (i == 1) {
w = width >> pf->x_chroma_shift;
s += src->linesize[i];
}
}
-
+
if (pf->pixel_type == FF_PIXEL_PALETTE)
memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4);
-
+
return size;
}
}
/**
- * compute the loss when converting from a pixel format to another
+ * compute the loss when converting from a pixel format to another
*/
int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
int has_alpha)
break;
case FF_COLOR_YUV_JPEG:
if (ps->color_type != FF_COLOR_YUV_JPEG &&
- ps->color_type != FF_COLOR_YUV &&
+ ps->color_type != FF_COLOR_YUV &&
ps->color_type != FF_COLOR_GRAY)
loss |= FF_LOSS_COLORSPACE;
break;
loss |= FF_LOSS_CHROMA;
if (!pf->is_alpha && (ps->is_alpha && has_alpha))
loss |= FF_LOSS_ALPHA;
- if (pf->pixel_type == FF_PIXEL_PALETTE &&
+ if (pf->pixel_type == FF_PIXEL_PALETTE &&
(ps->pixel_type != FF_PIXEL_PALETTE && ps->color_type != FF_COLOR_GRAY))
loss |= FF_LOSS_COLORQUANT;
return loss;
if (pf->x_chroma_shift == 0 && pf->y_chroma_shift == 0) {
bits = pf->depth * pf->nb_channels;
} else {
- bits = pf->depth + ((2 * pf->depth) >>
+ bits = pf->depth + ((2 * pf->depth) >>
(pf->x_chroma_shift + pf->y_chroma_shift));
}
break;
return bits;
}
-static int avcodec_find_best_pix_fmt1(int pix_fmt_mask,
+static int avcodec_find_best_pix_fmt1(int pix_fmt_mask,
int src_pix_fmt,
int has_alpha,
int loss_mask)
return dst_pix_fmt;
}
-/**
- * find best pixel format to convert to. Return -1 if none found
+/**
+ * find best pixel format to convert to. Return -1 if none found
*/
int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
int has_alpha, int *loss_ptr)
i = 0;
for(;;) {
loss_mask = loss_mask_order[i++];
- dst_pix_fmt = avcodec_find_best_pix_fmt1(pix_fmt_mask, src_pix_fmt,
+ dst_pix_fmt = avcodec_find_best_pix_fmt1(pix_fmt_mask, src_pix_fmt,
has_alpha, loss_mask);
if (dst_pix_fmt >= 0)
goto found;
return dst_pix_fmt;
}
-static void img_copy_plane(uint8_t *dst, int dst_wrap,
+static void img_copy_plane(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
- if((!dst) || (!src))
+ if((!dst) || (!src))
return;
for(;height > 0; height--) {
memcpy(dst, src, width);
{
int bwidth, bits, i;
PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
-
+
pf = &pix_fmt_info[pix_fmt];
switch(pf->pixel_type) {
case FF_PIXEL_PACKED:
const uint8_t *p, *p1;
uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
int w;
-
+
p1 = src->data[0];
lum1 = dst->data[0];
cb1 = dst->data[1];
const uint8_t *p, *p1;
uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
int w;
-
+
p1 = src->data[0];
-
+
lum1 = dst->data[0];
cb1 = dst->data[1];
cr1 = dst->data[2];
uint8_t *lum1, *lum2, *lumsrc = src->data[0];
uint8_t *cb1, *cb2 = src->data[1];
uint8_t *cr1, *cr2 = src->data[2];
-
+
for(h = height / 2; h--;) {
line1 = linesrc;
line2 = linesrc + dst->linesize[0];
-
+
lum1 = lumsrc;
lum2 = lumsrc + src->linesize[0];
-
+
cb1 = cb2;
cr1 = cr2;
-
+
for(w = width / 2; w--;) {
- *line1++ = *lum1++; *line2++ = *lum2++;
- *line1++ = *line2++ = *cb1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
+ *line1++ = *lum1++; *line2++ = *lum2++;
+ *line1++ = *line2++ = *cb1++;
+ *line1++ = *lum1++; *line2++ = *lum2++;
*line1++ = *line2++ = *cr1++;
}
-
+
linesrc += dst->linesize[0] * 2;
lumsrc += src->linesize[0] * 2;
cb2 += src->linesize[1];
uint8_t *lum1, *lum2, *lumsrc = src->data[0];
uint8_t *cb1, *cb2 = src->data[1];
uint8_t *cr1, *cr2 = src->data[2];
-
+
for(h = height / 2; h--;) {
line1 = linesrc;
line2 = linesrc + dst->linesize[0];
-
+
lum1 = lumsrc;
lum2 = lumsrc + src->linesize[0];
-
+
cb1 = cb2;
cr1 = cr2;
-
+
for(w = width / 2; w--;) {
- *line1++ = *line2++ = *cb1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
+ *line1++ = *line2++ = *cb1++;
+ *line1++ = *lum1++; *line2++ = *lum2++;
*line1++ = *line2++ = *cr1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
+ *line1++ = *lum1++; *line2++ = *lum2++;
}
-
+
linesrc += dst->linesize[0] * 2;
lumsrc += src->linesize[0] * 2;
cb2 += src->linesize[1];
}
/* apply to each pixel the given table */
-static void img_apply_table(uint8_t *dst, int dst_wrap,
+static void img_apply_table(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height, const uint8_t *table1)
{
/* XXX: in most cases, the sampling position is incorrect */
/* 4x1 -> 1x1 */
-static void shrink41(uint8_t *dst, int dst_wrap,
+static void shrink41(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
}
/* 2x1 -> 1x1 */
-static void shrink21(uint8_t *dst, int dst_wrap,
+static void shrink21(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
}
/* 1x2 -> 1x1 */
-static void shrink12(uint8_t *dst, int dst_wrap,
+static void shrink12(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
}
/* 2x2 -> 1x1 */
-static void shrink22(uint8_t *dst, int dst_wrap,
+static void shrink22(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
}
/* 4x4 -> 1x1 */
-static void shrink44(uint8_t *dst, int dst_wrap,
+static void shrink44(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
}
/* 1x2 -> 2x1 */
-static void conv411(uint8_t *dst, int dst_wrap,
+static void conv411(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
for(r = 0; r < 6; r++) {
for(g = 0; g < 6; g++) {
for(b = 0; b < 6; b++) {
- pal[i++] = (0xff << 24) | (pal_value[r] << 16) |
+ pal[i++] = (0xff << 24) | (pal_value[r] << 16) |
(pal_value[g] << 8) | pal_value[b];
}
}
q = dst->data[0];
dst_wrap = dst->linesize[0] - width;
for(y=0;y<height;y++) {
- w = width;
+ w = width;
while (w >= 8) {
v = *p++ ^ xor_mask;
q[0] = -(v >> 7);
to convert from any format to any format, the following constraints
must be satisfied:
- - all FF_COLOR_RGB formats must convert to and from PIX_FMT_RGB24
+ - all FF_COLOR_RGB formats must convert to and from PIX_FMT_RGB24
- all FF_COLOR_GRAY formats must convert to and from PIX_FMT_GRAY8
[PIX_FMT_YUV422] = {
.convert = yuv420p_to_yuv422,
},
- [PIX_FMT_RGB555] = {
+ [PIX_FMT_RGB555] = {
.convert = yuv420p_to_rgb555
},
- [PIX_FMT_RGB565] = {
+ [PIX_FMT_RGB565] = {
.convert = yuv420p_to_rgb565
},
- [PIX_FMT_BGR24] = {
+ [PIX_FMT_BGR24] = {
.convert = yuv420p_to_bgr24
},
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = yuv420p_to_rgb24
},
- [PIX_FMT_RGBA32] = {
+ [PIX_FMT_RGBA32] = {
.convert = yuv420p_to_rgba32
},
- [PIX_FMT_UYVY422] = {
+ [PIX_FMT_UYVY422] = {
.convert = yuv420p_to_uyvy422,
},
},
- [PIX_FMT_YUV422P] = {
- [PIX_FMT_YUV422] = {
+ [PIX_FMT_YUV422P] = {
+ [PIX_FMT_YUV422] = {
.convert = yuv422p_to_yuv422,
},
- [PIX_FMT_UYVY422] = {
+ [PIX_FMT_UYVY422] = {
.convert = yuv422p_to_uyvy422,
},
},
- [PIX_FMT_YUV444P] = {
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_YUV444P] = {
+ [PIX_FMT_RGB24] = {
.convert = yuv444p_to_rgb24
},
},
[PIX_FMT_YUVJ420P] = {
- [PIX_FMT_RGB555] = {
+ [PIX_FMT_RGB555] = {
.convert = yuvj420p_to_rgb555
},
- [PIX_FMT_RGB565] = {
+ [PIX_FMT_RGB565] = {
.convert = yuvj420p_to_rgb565
},
- [PIX_FMT_BGR24] = {
+ [PIX_FMT_BGR24] = {
.convert = yuvj420p_to_bgr24
},
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = yuvj420p_to_rgb24
},
- [PIX_FMT_RGBA32] = {
+ [PIX_FMT_RGBA32] = {
.convert = yuvj420p_to_rgba32
},
},
- [PIX_FMT_YUVJ444P] = {
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_YUVJ444P] = {
+ [PIX_FMT_RGB24] = {
.convert = yuvj444p_to_rgb24
},
},
- [PIX_FMT_YUV422] = {
- [PIX_FMT_YUV420P] = {
+ [PIX_FMT_YUV422] = {
+ [PIX_FMT_YUV420P] = {
.convert = yuv422_to_yuv420p,
},
- [PIX_FMT_YUV422P] = {
+ [PIX_FMT_YUV422P] = {
.convert = yuv422_to_yuv422p,
},
},
- [PIX_FMT_UYVY422] = {
- [PIX_FMT_YUV420P] = {
+ [PIX_FMT_UYVY422] = {
+ [PIX_FMT_YUV420P] = {
.convert = uyvy422_to_yuv420p,
},
- [PIX_FMT_YUV422P] = {
+ [PIX_FMT_YUV422P] = {
.convert = uyvy422_to_yuv422p,
},
},
[PIX_FMT_RGB24] = {
- [PIX_FMT_YUV420P] = {
+ [PIX_FMT_YUV420P] = {
.convert = rgb24_to_yuv420p
},
- [PIX_FMT_RGB565] = {
+ [PIX_FMT_RGB565] = {
.convert = rgb24_to_rgb565
},
- [PIX_FMT_RGB555] = {
+ [PIX_FMT_RGB555] = {
.convert = rgb24_to_rgb555
},
- [PIX_FMT_RGBA32] = {
+ [PIX_FMT_RGBA32] = {
.convert = rgb24_to_rgba32
},
- [PIX_FMT_BGR24] = {
+ [PIX_FMT_BGR24] = {
.convert = rgb24_to_bgr24
},
- [PIX_FMT_GRAY8] = {
+ [PIX_FMT_GRAY8] = {
.convert = rgb24_to_gray
},
[PIX_FMT_PAL8] = {
.convert = rgb24_to_pal8
},
- [PIX_FMT_YUV444P] = {
+ [PIX_FMT_YUV444P] = {
.convert = rgb24_to_yuv444p
},
- [PIX_FMT_YUVJ420P] = {
+ [PIX_FMT_YUVJ420P] = {
.convert = rgb24_to_yuvj420p
},
- [PIX_FMT_YUVJ444P] = {
+ [PIX_FMT_YUVJ444P] = {
.convert = rgb24_to_yuvj444p
},
},
[PIX_FMT_RGBA32] = {
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = rgba32_to_rgb24
},
- [PIX_FMT_RGB555] = {
+ [PIX_FMT_RGB555] = {
.convert = rgba32_to_rgb555
},
- [PIX_FMT_PAL8] = {
+ [PIX_FMT_PAL8] = {
.convert = rgba32_to_pal8
},
- [PIX_FMT_YUV420P] = {
+ [PIX_FMT_YUV420P] = {
.convert = rgba32_to_yuv420p
},
- [PIX_FMT_GRAY8] = {
+ [PIX_FMT_GRAY8] = {
.convert = rgba32_to_gray
},
},
[PIX_FMT_BGR24] = {
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = bgr24_to_rgb24
},
- [PIX_FMT_YUV420P] = {
+ [PIX_FMT_YUV420P] = {
.convert = bgr24_to_yuv420p
},
- [PIX_FMT_GRAY8] = {
+ [PIX_FMT_GRAY8] = {
.convert = bgr24_to_gray
},
},
[PIX_FMT_RGB555] = {
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = rgb555_to_rgb24
},
- [PIX_FMT_RGBA32] = {
+ [PIX_FMT_RGBA32] = {
.convert = rgb555_to_rgba32
},
- [PIX_FMT_YUV420P] = {
+ [PIX_FMT_YUV420P] = {
.convert = rgb555_to_yuv420p
},
- [PIX_FMT_GRAY8] = {
+ [PIX_FMT_GRAY8] = {
.convert = rgb555_to_gray
},
},
[PIX_FMT_RGB565] = {
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = rgb565_to_rgb24
},
- [PIX_FMT_YUV420P] = {
+ [PIX_FMT_YUV420P] = {
.convert = rgb565_to_yuv420p
},
- [PIX_FMT_GRAY8] = {
+ [PIX_FMT_GRAY8] = {
.convert = rgb565_to_gray
},
},
[PIX_FMT_GRAY8] = {
- [PIX_FMT_RGB555] = {
+ [PIX_FMT_RGB555] = {
.convert = gray_to_rgb555
},
- [PIX_FMT_RGB565] = {
+ [PIX_FMT_RGB565] = {
.convert = gray_to_rgb565
},
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = gray_to_rgb24
},
- [PIX_FMT_BGR24] = {
+ [PIX_FMT_BGR24] = {
.convert = gray_to_bgr24
},
- [PIX_FMT_RGBA32] = {
+ [PIX_FMT_RGBA32] = {
.convert = gray_to_rgba32
},
- [PIX_FMT_MONOWHITE] = {
+ [PIX_FMT_MONOWHITE] = {
.convert = gray_to_monowhite
},
- [PIX_FMT_MONOBLACK] = {
+ [PIX_FMT_MONOBLACK] = {
.convert = gray_to_monoblack
},
},
[PIX_FMT_MONOWHITE] = {
- [PIX_FMT_GRAY8] = {
+ [PIX_FMT_GRAY8] = {
.convert = monowhite_to_gray
},
},
[PIX_FMT_MONOBLACK] = {
- [PIX_FMT_GRAY8] = {
+ [PIX_FMT_GRAY8] = {
.convert = monoblack_to_gray
},
},
[PIX_FMT_PAL8] = {
- [PIX_FMT_RGB555] = {
+ [PIX_FMT_RGB555] = {
.convert = pal8_to_rgb555
},
- [PIX_FMT_RGB565] = {
+ [PIX_FMT_RGB565] = {
.convert = pal8_to_rgb565
},
- [PIX_FMT_BGR24] = {
+ [PIX_FMT_BGR24] = {
.convert = pal8_to_bgr24
},
- [PIX_FMT_RGB24] = {
+ [PIX_FMT_RGB24] = {
.convert = pal8_to_rgb24
},
- [PIX_FMT_RGBA32] = {
+ [PIX_FMT_RGBA32] = {
.convert = pal8_to_rgba32
},
},
- [PIX_FMT_UYVY411] = {
- [PIX_FMT_YUV411P] = {
+ [PIX_FMT_UYVY411] = {
+ [PIX_FMT_YUV411P] = {
.convert = uyvy411_to_yuv411p,
},
},
static inline int is_yuv_planar(PixFmtInfo *ps)
{
return (ps->color_type == FF_COLOR_YUV ||
- ps->color_type == FF_COLOR_YUV_JPEG) &&
+ ps->color_type == FF_COLOR_YUV_JPEG) &&
ps->pixel_type == FF_PIXEL_PLANAR;
}
/* XXX: always use linesize. Return -1 if not supported */
int img_convert(AVPicture *dst, int dst_pix_fmt,
- const AVPicture *src, int src_pix_fmt,
+ const AVPicture *src, int src_pix_fmt,
int src_width, int src_height)
{
static int inited;
}
/* YUV to gray */
- if (is_yuv_planar(src_pix) &&
+ if (is_yuv_planar(src_pix) &&
dst_pix_fmt == PIX_FMT_GRAY8) {
if (src_pix->color_type == FF_COLOR_YUV_JPEG) {
img_copy_plane(dst->data[0], dst->linesize[0],
/* YUV to YUV planar */
if (is_yuv_planar(dst_pix) && is_yuv_planar(src_pix)) {
int x_shift, y_shift, w, h, xy_shift;
- void (*resize_func)(uint8_t *dst, int dst_wrap,
+ void (*resize_func)(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height);
for(i = 1;i <= 2; i++)
img_apply_table(dst->data[i], dst->linesize[i],
dst->data[i], dst->linesize[i],
- dst_width>>dst_pix->x_chroma_shift,
+ dst_width>>dst_pix->x_chroma_shift,
dst_height>>dst_pix->y_chroma_shift,
c_table);
}
/* specific case: convert to YUV411P first */
int_pix_fmt = PIX_FMT_YUV411P;
} else if ((src_pix->color_type == FF_COLOR_GRAY &&
- src_pix_fmt != PIX_FMT_GRAY8) ||
+ src_pix_fmt != PIX_FMT_GRAY8) ||
(dst_pix->color_type == FF_COLOR_GRAY &&
dst_pix_fmt != PIX_FMT_GRAY8)) {
/* gray8 is the normalized format */
int_pix_fmt = PIX_FMT_GRAY8;
- } else if ((is_yuv_planar(src_pix) &&
+ } else if ((is_yuv_planar(src_pix) &&
src_pix_fmt != PIX_FMT_YUV444P &&
src_pix_fmt != PIX_FMT_YUVJ444P)) {
/* yuv444 is the normalized format */
int_pix_fmt = PIX_FMT_YUVJ444P;
else
int_pix_fmt = PIX_FMT_YUV444P;
- } else if ((is_yuv_planar(dst_pix) &&
+ } else if ((is_yuv_planar(dst_pix) &&
dst_pix_fmt != PIX_FMT_YUV444P &&
dst_pix_fmt != PIX_FMT_YUVJ444P)) {
/* yuv444 is the normalized format */
int src_wrap, ret, x, y;
unsigned int a;
uint32_t *palette = (uint32_t *)src->data[1];
-
+
p = src->data[0];
src_wrap = src->linesize[0] - width;
ret = 0;
#endif
/* filter parameters: [-1 4 2 4 -1] // 8 */
-static void deinterlace_line(uint8_t *dst,
- const uint8_t *lum_m4, const uint8_t *lum_m3,
- const uint8_t *lum_m2, const uint8_t *lum_m1,
+static void deinterlace_line(uint8_t *dst,
+ const uint8_t *lum_m4, const uint8_t *lum_m3,
+ const uint8_t *lum_m2, const uint8_t *lum_m1,
const uint8_t *lum,
int size)
{
q = dst->data[0];
dst_wrap = dst->linesize[0] - width;
has_alpha = 0;
-
+
for(y=0;y<height;y++) {
for(x=0;x<width;x++) {
#ifdef RGBA_IN
}
#endif /* defined(FMT_RGB24) || defined(FMT_RGBA32) */
-
+
#ifdef RGBA_IN
static int glue(get_alpha_info_, RGB_NAME)(const AVPicture *src,
/*
- * High quality image resampling with polyphase filters
+ * High quality image resampling with polyphase filters
* Copyright (c) 2001 Fabrice Bellard.
*
* This library is free software; you can redistribute it and/or
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file imgresample.c
* High quality image resampling with polyphase filters .
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
const uint8_t *s;
int16_t *filter;
mmx_t tmp;
-
+
src_pos = src_start;
pxor_r2r(mm7, mm7);
const uint8_t *s;
mmx_t tmp;
mmx_t coefs[4];
-
+
for(i=0;i<4;i++) {
v = filter[i];
coefs[i].uw[0] = v;
coefs[i].uw[2] = v;
coefs[i].uw[3] = v;
}
-
+
pxor_r2r(mm7, mm7);
s = src;
while (dst_width >= 4) {
paddw_r2r(mm3, mm2);
paddw_r2r(mm2, mm0);
psraw_i2r(FILTER_BITS, mm0);
-
+
packuswb_r2r(mm7, mm0);
movq_r2m(mm0, tmp);
const uint8_t *s;
vector unsigned char *tv, tmp, dstv, zero;
vec_ss_t srchv[4], srclv[4], fv[4];
- vector signed short zeros, sumhv, sumlv;
+ vector signed short zeros, sumhv, sumlv;
s = src;
for(i=0;i<4;i++)
fv[i].s[0] = filter[i] << (15-FILTER_BITS);
fv[i].v = vec_splat(fv[i].v, 0);
}
-
+
zero = vec_splat_u8(0);
zeros = vec_splat_s16(0);
dst_width--;
i--;
}
-
+
/* Do our altivec resampling on 16 pixels at once. */
while(dst_width>=16) {
/*
srclv[3].v = (vector signed short) vec_mergel(zero, tmp);
sumhv = vec_madds(srchv[3].v, fv[3].v, sumhv);
sumlv = vec_madds(srclv[3].v, fv[3].v, sumlv);
-
+
/*
Pack the results into our destination vector,
and do an aligned write of that back to memory.
*/
dstv = vec_packsu(sumhv, sumlv) ;
vec_st(dstv, 0, (vector unsigned char *) dst);
-
+
dst+=16;
s+=16;
dst_width-=16;
}
src_end = src_start + dst_width * src_incr;
if (src_end > ((src_width - NB_TAPS) << POS_FRAC_BITS)) {
- n = (((src_width - NB_TAPS + 1) << POS_FRAC_BITS) - 1 - src_start) /
+ n = (((src_width - NB_TAPS + 1) << POS_FRAC_BITS) - 1 - src_start) /
src_incr;
} else {
n = dst_width;
}
#ifdef HAVE_MMX
if ((mm_flags & MM_MMX) && NB_TAPS == 4)
- h_resample_fast4_mmx(dst, n,
+ h_resample_fast4_mmx(dst, n,
src, src_width, src_start, src_incr, filters);
else
#endif
- h_resample_fast(dst, n,
+ h_resample_fast(dst, n,
src, src_width, src_start, src_incr, filters);
if (n < dst_width) {
dst += n;
dst_width -= n;
src_start += n * src_incr;
- h_resample_slow(dst, dst_width,
+ h_resample_slow(dst, dst_width,
src, src_width, src_start, src_incr, filters);
}
}
-static void component_resample(ImgReSampleContext *s,
+static void component_resample(ImgReSampleContext *s,
uint8_t *output, int owrap, int owidth, int oheight,
uint8_t *input, int iwrap, int iwidth, int iheight)
{
last_src_y = - FCENTER - 1;
/* position of the bottom of the filter in the source image */
- src_y = (last_src_y + NB_TAPS) * POS_FRAC;
+ src_y = (last_src_y + NB_TAPS) * POS_FRAC;
ring_y = NB_TAPS; /* position in ring buffer */
for(y=0;y<oheight;y++) {
/* apply horizontal filter on new lines from input if needed */
src_line = input + y1 * iwrap;
new_line = s->line_buf + ring_y * owidth;
/* apply filter and handle limit cases correctly */
- h_resample(new_line, owidth,
- src_line, iwidth, - FCENTER * POS_FRAC, s->h_incr,
+ h_resample(new_line, owidth,
+ src_line, iwidth, - FCENTER * POS_FRAC, s->h_incr,
&s->h_filters[0][0]);
/* handle ring buffer wraping */
if (ring_y >= LINE_BUF_HEIGHT) {
#ifdef HAVE_MMX
/* desactivated MMX because loss of precision */
if ((mm_flags & MM_MMX) && NB_TAPS == 4 && 0)
- v_resample4_mmx(output, owidth,
- s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
+ v_resample4_mmx(output, owidth,
+ s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
&s->v_filters[phase_y][0]);
else
#endif
&s->v_filters[phase_y][0]);
else
#endif
- v_resample(output, owidth,
- s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
+ v_resample(output, owidth,
+ s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
&s->v_filters[phase_y][0]);
-
+
src_y += s->v_incr;
-
+
output += owrap;
}
}
ImgReSampleContext *img_resample_init(int owidth, int oheight,
int iwidth, int iheight)
{
- return img_resample_full_init(owidth, oheight, iwidth, iheight,
+ return img_resample_full_init(owidth, oheight, iwidth, iheight,
0, 0, 0, 0, 0, 0, 0, 0);
}
if((unsigned)owidth >= UINT_MAX / (LINE_BUF_HEIGHT + NB_TAPS))
return NULL;
s->line_buf = av_mallocz(owidth * (LINE_BUF_HEIGHT + NB_TAPS));
- if (!s->line_buf)
+ if (!s->line_buf)
goto fail;
-
+
s->owidth = owidth;
s->oheight = oheight;
s->iwidth = iwidth;
s->iheight = iheight;
-
+
s->topBand = topBand;
s->bottomBand = bottomBand;
s->leftBand = leftBand;
s->rightBand = rightBand;
-
+
s->padtop = padtop;
s->padbottom = padbottom;
s->padleft = padleft;
s->pad_oheight = oheight - (padtop + padbottom);
s->h_incr = ((iwidth - leftBand - rightBand) * POS_FRAC) / s->pad_owidth;
- s->v_incr = ((iheight - topBand - bottomBand) * POS_FRAC) / s->pad_oheight;
+ s->v_incr = ((iheight - topBand - bottomBand) * POS_FRAC) / s->pad_oheight;
- av_build_filter(&s->h_filters[0][0], (float) s->pad_owidth /
+ av_build_filter(&s->h_filters[0][0], (float) s->pad_owidth /
(float) (iwidth - leftBand - rightBand), NB_TAPS, NB_PHASES, 1<<FILTER_BITS, 0);
- av_build_filter(&s->v_filters[0][0], (float) s->pad_oheight /
+ av_build_filter(&s->v_filters[0][0], (float) s->pad_oheight /
(float) (iheight - topBand - bottomBand), NB_TAPS, NB_PHASES, 1<<FILTER_BITS, 0);
return s;
return NULL;
}
-void img_resample(ImgReSampleContext *s,
+void img_resample(ImgReSampleContext *s,
AVPicture *output, const AVPicture *input)
{
int i, shift;
for (i=0;i<3;i++) {
shift = (i == 0) ? 0 : 1;
- optr = output->data[i] + (((output->linesize[i] *
+ optr = output->data[i] + (((output->linesize[i] *
s->padtop) + s->padleft) >> shift);
- component_resample(s, optr, output->linesize[i],
+ component_resample(s, optr, output->linesize[i],
s->pad_owidth >> shift, s->pad_oheight >> shift,
- input->data[i] + (input->linesize[i] *
+ input->data[i] + (input->linesize[i] *
(s->topBand >> shift)) + (s->leftBand >> shift),
- input->linesize[i], ((s->iwidth - s->leftBand -
+ input->linesize[i], ((s->iwidth - s->leftBand -
s->rightBand) >> shift),
(s->iheight - s->topBand - s->bottomBand) >> shift);
}
else
v = 0x00;
} else if (x < XSIZE/4) {
- if (x & 1)
+ if (x & 1)
v = 0xff;
- else
+ else
v = 0;
} else if (y < XSIZE/4) {
- if (y & 1)
+ if (y & 1)
v = 0xff;
- else
+ else
v = 0;
} else {
if (y < YSIZE*3/8) {
- if ((y+x) & 1)
+ if ((y+x) & 1)
v = 0xff;
- else
+ else
v = 0;
} else {
if (((x+3) % 4) <= 1 &&
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file indeo2.c
* Intel Indeo 2 decoder.
int out = 0;
int c;
int t;
-
+
if(width&1)
return -1;
}
}
dst += stride;
-
+
for (j = 1; j < height; j++){
out = 0;
while (out < width){
return 0;
}
-static int ir2_decode_frame(AVCodecContext *avctx,
+static int ir2_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
}
s->decode_delta = buf[18];
-
+
/* decide whether frame uses deltas or not */
-#ifndef ALT_BITSTREAM_READER_LE
+#ifndef ALT_BITSTREAM_READER_LE
for (i = 0; i < buf_size; i++)
buf[i] = ff_reverse[buf[i]];
#endif
ic->avctx = avctx;
avctx->pix_fmt= PIX_FMT_YUV410P;
-
+
if (!ir2_vlc.table)
init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
&ir2_codes[0][1], 4, 2,
#ifdef ALT_BITSTREAM_READER_LE
- &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
+ &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE);
#else
- &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC);
+ &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC);
#endif
-
+
return 0;
}
#define IR2_CODES 143
static const uint16_t ir2_codes[IR2_CODES][2] = {
#ifdef ALT_BITSTREAM_READER_LE
-{0x0000, 3}, {0x0004, 3}, {0x0006, 3}, {0x0001, 5},
-{0x0009, 5}, {0x0019, 5}, {0x000D, 5}, {0x001D, 5},
-{0x0023, 6}, {0x0013, 6}, {0x0033, 6}, {0x000B, 6},
-{0x002B, 6}, {0x001B, 6}, {0x0007, 8}, {0x0087, 8},
-{0x0027, 8}, {0x00A7, 8}, {0x0067, 8}, {0x00E7, 8},
-{0x0097, 8}, {0x0057, 8}, {0x0037, 8}, {0x00B7, 8},
-{0x00F7, 8}, {0x000F, 9}, {0x008F, 9}, {0x018F, 9},
-{0x014F, 9}, {0x00CF, 9}, {0x002F, 9}, {0x012F, 9},
-{0x01AF, 9}, {0x006F, 9}, {0x00EF, 9}, {0x01EF, 9},
-{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10},
-{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10},
-{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10},
-{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10},
-{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13},
-{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13},
-{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13},
-{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13},
-{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13},
-{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13},
-{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13},
-{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13},
-{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13},
-{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13},
-{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13},
-{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13},
-{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13},
-{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13},
-{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13},
-{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13},
-{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14},
-{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14},
-{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002, 3},
-{0x0011, 5}, {0x0005, 5}, {0x0015, 5}, {0x0003, 6},
-{0x003B, 6}, {0x0047, 8}, {0x00C7, 8}, {0x0017, 8},
-{0x00D7, 8}, {0x0077, 8}, {0x010F, 9}, {0x004F, 9},
+{0x0000, 3}, {0x0004, 3}, {0x0006, 3}, {0x0001, 5},
+{0x0009, 5}, {0x0019, 5}, {0x000D, 5}, {0x001D, 5},
+{0x0023, 6}, {0x0013, 6}, {0x0033, 6}, {0x000B, 6},
+{0x002B, 6}, {0x001B, 6}, {0x0007, 8}, {0x0087, 8},
+{0x0027, 8}, {0x00A7, 8}, {0x0067, 8}, {0x00E7, 8},
+{0x0097, 8}, {0x0057, 8}, {0x0037, 8}, {0x00B7, 8},
+{0x00F7, 8}, {0x000F, 9}, {0x008F, 9}, {0x018F, 9},
+{0x014F, 9}, {0x00CF, 9}, {0x002F, 9}, {0x012F, 9},
+{0x01AF, 9}, {0x006F, 9}, {0x00EF, 9}, {0x01EF, 9},
+{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10},
+{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10},
+{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10},
+{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10},
+{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13},
+{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13},
+{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13},
+{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13},
+{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13},
+{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13},
+{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13},
+{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13},
+{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13},
+{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13},
+{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13},
+{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13},
+{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13},
+{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13},
+{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13},
+{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13},
+{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14},
+{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14},
+{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002, 3},
+{0x0011, 5}, {0x0005, 5}, {0x0015, 5}, {0x0003, 6},
+{0x003B, 6}, {0x0047, 8}, {0x00C7, 8}, {0x0017, 8},
+{0x00D7, 8}, {0x0077, 8}, {0x010F, 9}, {0x004F, 9},
{0x01CF, 9}, {0x00AF, 9}, {0x016F, 9},
#else
{0x0000, 3}, {0x0001, 3}, {0x0003, 3}, {0x0010, 5},
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
- 0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
+ 0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
- 0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
+ 0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
- 0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
+ 0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
- 0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
+ 0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
- 0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
+ 0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
- 0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
+ 0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
- 0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
+ 0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
- 0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
+ 0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
- 0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
+ 0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
- 0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
+ 0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
- 0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
+ 0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
- 0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
+ 0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
- 0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
+ 0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
- 0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
+ 0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80
};
static int corrector_type_2[8] = { 9, 7, 6, 8, 5, 4, 3, 2 };
-static void build_modpred(Indeo3DecodeContext *s)
+static void build_modpred(Indeo3DecodeContext *s)
{
int i, j;
}
}
-static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur,
- unsigned char *ref, int width, int height, unsigned char *buf1,
+static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur,
+ unsigned char *ref, int width, int height, unsigned char *buf1,
long fflags2, unsigned char *hdr,
unsigned char *buf2, int min_width_160);
#endif
/* ---------------------------------------------------------------------- */
-static void iv_alloc_frames(Indeo3DecodeContext *s)
+static void iv_alloc_frames(Indeo3DecodeContext *s)
{
int luma_width, luma_height, luma_pixels, chroma_width, chroma_height,
chroma_pixels, i;
luma_width = (s->width + 3) & (~3);
luma_height = (s->height + 3) & (~3);
- s->iv_frame[0].y_w = s->iv_frame[0].y_h =
+ s->iv_frame[0].y_w = s->iv_frame[0].y_h =
s->iv_frame[0].the_buf_size = 0;
- s->iv_frame[1].y_w = s->iv_frame[1].y_h =
+ s->iv_frame[1].y_w = s->iv_frame[1].y_h =
s->iv_frame[1].the_buf_size = 0;
s->iv_frame[1].the_buf = NULL;
luma_pixels = luma_width * luma_height;
chroma_pixels = chroma_width * chroma_height;
- bufsize = luma_pixels * 2 + luma_width * 3 +
+ bufsize = luma_pixels * 2 + luma_width * 3 +
(chroma_pixels + chroma_width) * 4;
- if((s->iv_frame[0].the_buf =
- (s->iv_frame[0].the_buf_size == 0 ? av_malloc(bufsize) :
+ if((s->iv_frame[0].the_buf =
+ (s->iv_frame[0].the_buf_size == 0 ? av_malloc(bufsize) :
av_realloc(s->iv_frame[0].the_buf, bufsize))) == NULL)
return;
s->iv_frame[0].y_w = s->iv_frame[1].y_w = luma_width;
s->iv_frame[1].Vbuf = s->iv_frame[0].the_buf + i;
for(i = 1; i <= luma_width; i++)
- s->iv_frame[0].Ybuf[-i] = s->iv_frame[1].Ybuf[-i] =
+ s->iv_frame[0].Ybuf[-i] = s->iv_frame[1].Ybuf[-i] =
s->iv_frame[0].Ubuf[-i] = 0x80;
for(i = 1; i <= chroma_width; i++) {
}
/* ---------------------------------------------------------------------- */
-static void iv_free_func(Indeo3DecodeContext *s)
+static void iv_free_func(Indeo3DecodeContext *s)
{
int i;
for(i = 0 ; i < 2 ; i++) {
- if(s->iv_frame[i].the_buf != NULL)
+ if(s->iv_frame[i].the_buf != NULL)
av_free(s->iv_frame[i].the_buf);
- s->iv_frame[i].Ybuf = s->iv_frame[i].Ubuf =
+ s->iv_frame[i].Ybuf = s->iv_frame[i].Ubuf =
s->iv_frame[i].Vbuf = NULL;
s->iv_frame[i].the_buf = NULL;
s->iv_frame[i].the_buf_size = 0;
}
/* ---------------------------------------------------------------------- */
-static unsigned long iv_decode_frame(Indeo3DecodeContext *s,
- unsigned char *buf, int buf_size)
+static unsigned long iv_decode_frame(Indeo3DecodeContext *s,
+ unsigned char *buf, int buf_size)
{
unsigned int hdr_width, hdr_height,
chroma_width, chroma_height;
hdr_height = le2me_16(*(uint16_t *)buf_pos);
buf_pos += 2;
hdr_width = le2me_16(*(uint16_t *)buf_pos);
-
+
if(avcodec_check_dimensions(NULL, hdr_width, hdr_height))
return -1;
-
+
buf_pos += 2;
chroma_height = ((hdr_height >> 2) + 3) & 0x7ffc;
chroma_width = ((hdr_width >> 2) + 3) & 0x7ffc;
offs = le2me_32(*(uint32_t *)buf_pos);
buf_pos += 4;
- iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width,
- hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
+ iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width,
+ hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
min(hdr_width, 160));
if (!(s->avctx->flags & CODEC_FLAG_GRAY))
offs = le2me_32(*(uint32_t *)buf_pos);
buf_pos += 4;
- iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width,
- chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
+ iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width,
+ chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
min(chroma_width, 40));
buf_pos = buf + 16 + offs3;
offs = le2me_32(*(uint32_t *)buf_pos);
buf_pos += 4;
- iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width,
- chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
+ iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width,
+ chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
min(chroma_width, 40));
}
lp2 = 4;
static void iv_Decode_Chunk(Indeo3DecodeContext *s,
- unsigned char *cur, unsigned char *ref, int width, int height,
+ unsigned char *cur, unsigned char *ref, int width, int height,
unsigned char *buf1, long fflags2, unsigned char *hdr,
unsigned char *buf2, int min_width_160)
{
width_tbl = width_tbl_arr + 1;
i = (width < 0 ? width + 3 : width)/4;
- for(j = -1; j < 8; j++)
+ for(j = -1; j < 8; j++)
width_tbl[j] = i * j;
strip = strip_tbl;
cur_frm_pos = cur + width * strip->ypos + strip->xpos;
- if((blks_width = strip->width) < 0)
+ if((blks_width = strip->width) < 0)
blks_width += 3;
blks_width >>= 2;
blks_height = strip->height;
if(ref_vectors != NULL) {
ref_frm_pos = ref + (ref_vectors[0] + strip->ypos) * width +
ref_vectors[1] + strip->xpos;
- } else
+ } else
ref_frm_pos = cur_frm_pos - width_tbl[4];
if(cmd == 2) {
cur_frm_pos += 4;
ref_frm_pos += 4;
}
- } else if(cmd != 1)
+ } else if(cmd != 1)
return;
} else {
k = *buf1 >> 4;
if((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) {
cp2 = s->ModPred + ((lv - 8) << 7);
cp = ref_frm_pos;
- for(i = 0; i < blks_width << 2; i++) {
+ for(i = 0; i < blks_width << 2; i++) {
int v = *cp >> 1;
- *(cp++) = cp2[v];
+ *(cp++) = cp2[v];
}
}
break;
case 7:
- if(rle_v3 != 0)
+ if(rle_v3 != 0)
rle_v3 = 0;
else {
buf1--;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
- default:
+ default:
return;
}
}
case 4:
case 3: /********** CASE 3 **********/
- if(ref_vectors != NULL)
+ if(ref_vectors != NULL)
return;
flag1 = 1;
break;
case 7:
- if(rle_v3 != 0)
+ if(rle_v3 != 0)
rle_v3 = 0;
else {
buf1--;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
- default:
+ default:
return;
}
}
case 7:
if(lp2 == 0) {
- if(rle_v3 != 0)
+ if(rle_v3 != 0)
rle_v3 = 0;
else {
buf1--;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
- default:
+ default:
return;
}
}
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
- default:
+ default:
return;
}
}
break;
case 11: /********** CASE 11 **********/
- if(ref_vectors == NULL)
+ if(ref_vectors == NULL)
return;
for( ; blks_height > 0; blks_height -= 8) {
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
- default:
+ default:
return;
}
}
}
break;
- default:
+ default:
return;
}
}
- if(strip < strip_tbl)
+ if(strip < strip_tbl)
return;
for( ; strip >= strip_tbl; strip--) {
static const uint32_t correction[] = {
- 0x00000000, 0x00000202, 0xfffffdfe, 0x000002ff, 0xfffffd01, 0xffffff03, 0x000000fd, 0x00000404,
- 0xfffffbfc, 0x00000501, 0xfffffaff, 0x00000105, 0xfffffefb, 0x000003fc, 0xfffffc04, 0x000005fe,
- 0xfffffa02, 0xfffffe06, 0x000001fa, 0x00000904, 0xfffff6fc, 0x00000409, 0xfffffbf7, 0x00000909,
- 0xfffff6f7, 0x00000a01, 0xfffff5ff, 0x0000010a, 0xfffffef6, 0x000007fb, 0xfffff805, 0xfffffb08,
- 0x000004f8, 0x00000f09, 0xfffff0f7, 0x0000090f, 0xfffff6f1, 0x00000bfd, 0xfffff403, 0xfffffd0c,
- 0x000002f4, 0x00001004, 0xffffeffc, 0x00000410, 0xfffffbf0, 0x00001010, 0xffffeff0, 0x00001200,
- 0xffffee00, 0x00000012, 0xffffffee, 0x00000bf4, 0xfffff40c, 0x00000ff7, 0xfffff009, 0xfffff710,
- 0x000008f0, 0x00001b0b, 0xffffe4f5, 0x00000b1b, 0xfffff4e5, 0x00001c13, 0xffffe3ed, 0x0000131c,
- 0xffffece4, 0x000015fa, 0xffffea06, 0xfffffa16, 0x000005ea, 0x00001d04, 0xffffe2fc, 0x0000041d,
- 0xfffffbe3, 0x00001e1e, 0xffffe1e2, 0x000020fe, 0xffffdf02, 0xfffffe21, 0x000001df, 0x000016ee,
- 0xffffe912, 0xffffee17, 0x000011e9, 0x00001df1, 0xffffe20f, 0xfffff11e, 0x00000ee2, 0x00002e16,
- 0xffffd1ea, 0x0000162e, 0xffffe9d2, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003123,
- 0xffffcedd, 0x00002331, 0xffffdccf, 0x000028f5, 0xffffd70b, 0xfffff529, 0x00000ad7, 0x00003304,
- 0xffffccfc, 0x00000433, 0xfffffbcd, 0x00003636, 0xffffc9ca, 0x000021de, 0xffffde22, 0x000029e3,
- 0xffffd61d, 0xffffe32a, 0x00001cd6, 0x00003bfa, 0xffffc406, 0xfffffa3c, 0x000005c4, 0x00004c1b,
- 0xffffb3e5, 0x00001b4c, 0xffffe4b4, 0x00004d2b, 0xffffb2d5, 0x00002b4d, 0xffffd4b3, 0x000036e8,
- 0xffffc918, 0xffffe837, 0x000017c9, 0x00004f0e, 0xffffb0f2, 0x00000e4f, 0xfffff1b1, 0x0000533f,
- 0xffffacc1, 0x00003f53, 0xffffc0ad, 0x000049ec, 0xffffb614, 0xffffec4a, 0x000013b6, 0x00005802,
- 0xffffa7fe, 0x00000258, 0xfffffda8, 0x00005d5d, 0xffffa2a3, 0x00003ccc, 0xffffc334, 0xffffcc3d,
- 0x000033c3, 0x00007834, 0xffff87cc, 0x00003478, 0xffffcb88, 0x00004ad3, 0xffffb52d, 0xffffd34b,
- 0x00002cb5, 0x00007d4b, 0xffff82b5, 0x00004b7d, 0xffffb483, 0x00007a21, 0xffff85df, 0x0000217a,
- 0xffffde86, 0x000066f3, 0xffff990d, 0xfffff367, 0x00000c99, 0x00005fd8, 0xffffa028, 0xffffd860,
- 0x000027a0, 0x00007ede, 0xffff8122, 0xffffde7f, 0x00002181, 0x000058a7, 0xffffa759, 0x000068b2,
- 0xffff974e, 0xffffb269, 0x00004d97, 0x00000c0c, 0xfffff3f4, 0x00001717, 0xffffe8e9, 0x00002a2a,
- 0xffffd5d6, 0x00004949, 0xffffb6b7, 0x00000000, 0x02020000, 0xfdfe0000, 0x02ff0000, 0xfd010000,
- 0xff030000, 0x00fd0000, 0x00000202, 0x02020202, 0xfdfe0202, 0x02ff0202, 0xfd010202, 0xff030202,
- 0x00fd0202, 0xfffffdfe, 0x0201fdfe, 0xfdfdfdfe, 0x02fefdfe, 0xfd00fdfe, 0xff02fdfe, 0x00fcfdfe,
- 0x000002ff, 0x020202ff, 0xfdfe02ff, 0x02ff02ff, 0xfd0102ff, 0xff0302ff, 0x00fd02ff, 0xfffffd01,
- 0x0201fd01, 0xfdfdfd01, 0x02fefd01, 0xfd00fd01, 0xff02fd01, 0x00fcfd01, 0xffffff03, 0x0201ff03,
- 0xfdfdff03, 0x02feff03, 0xfd00ff03, 0xff02ff03, 0x00fcff03, 0x000000fd, 0x020200fd, 0xfdfe00fd,
- 0x02ff00fd, 0xfd0100fd, 0xff0300fd, 0x00fd00fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000303, 0xfffffcfd, 0x000003ff, 0xfffffc01, 0xffffff04, 0x000000fc, 0x00000707,
- 0xfffff8f9, 0x00000802, 0xfffff7fe, 0x00000208, 0xfffffdf8, 0x000008fe, 0xfffff702, 0xfffffe09,
- 0x000001f7, 0x000005fa, 0xfffffa06, 0x00000d06, 0xfffff2fa, 0x0000060d, 0xfffff9f3, 0x00000d0d,
- 0xfffff2f3, 0x00000e01, 0xfffff1ff, 0x0000010e, 0xfffffef2, 0x00000bf8, 0xfffff408, 0xfffff80c,
- 0x000007f4, 0x0000170e, 0xffffe8f2, 0x00000e17, 0xfffff1e9, 0x000011fb, 0xffffee05, 0xfffffb12,
- 0x000004ee, 0x00001806, 0xffffe7fa, 0x00000618, 0xfffff9e8, 0x00001818, 0xffffe7e8, 0x00001aff,
- 0xffffe501, 0xffffff1b, 0x000000e5, 0x000010ef, 0xffffef11, 0x000016f3, 0xffffe90d, 0xfffff317,
- 0x00000ce9, 0x00002810, 0xffffd7f0, 0x00001028, 0xffffefd8, 0x0000291c, 0xffffd6e4, 0x00001c29,
- 0xffffe3d7, 0x000020f7, 0xffffdf09, 0xfffff721, 0x000008df, 0x00002b06, 0xffffd4fa, 0x0000062b,
- 0xfffff9d5, 0x00002e2e, 0xffffd1d2, 0x000031fc, 0xffffce04, 0xfffffc32, 0x000003ce, 0x000021e5,
- 0xffffde1b, 0xffffe522, 0x00001ade, 0x00002cea, 0xffffd316, 0xffffea2d, 0x000015d3, 0x00004522,
- 0xffffbade, 0x00002245, 0xffffddbb, 0x00004613, 0xffffb9ed, 0x00001346, 0xffffecba, 0x00004935,
- 0xffffb6cb, 0x00003549, 0xffffcab7, 0x00003def, 0xffffc211, 0xffffef3e, 0x000010c2, 0x00004d05,
- 0xffffb2fb, 0x0000054d, 0xfffffab3, 0x00005252, 0xffffadae, 0x000032cd, 0xffffcd33, 0x00003fd5,
- 0xffffc02b, 0xffffd540, 0x00002ac0, 0x000059f6, 0xffffa60a, 0xfffff65a, 0x000009a6, 0x00007229,
- 0xffff8dd7, 0x00002972, 0xffffd68e, 0x00007440, 0xffff8bc0, 0x00004074, 0xffffbf8c, 0x000051db,
- 0xffffae25, 0xffffdb52, 0x000024ae, 0x00007716, 0xffff88ea, 0x00001677, 0xffffe989, 0x00007c5f,
- 0xffff83a1, 0x00005f7c, 0xffffa084, 0x00006ee2, 0xffff911e, 0xffffe26f, 0x00001d91, 0x00005bb2,
- 0xffffa44e, 0xffffb25c, 0x00004da4, 0x000070bc, 0xffff8f44, 0xffffbc71, 0x0000438f, 0x00001212,
- 0xffffedee, 0x00002222, 0xffffddde, 0x00003f3f, 0xffffc0c1, 0x00006d6d, 0xffff9293, 0x00000000,
- 0x03030000, 0xfcfd0000, 0x03ff0000, 0xfc010000, 0xff040000, 0x00fc0000, 0x07070000, 0xf8f90000,
- 0x00000303, 0x03030303, 0xfcfd0303, 0x03ff0303, 0xfc010303, 0xff040303, 0x00fc0303, 0x07070303,
- 0xf8f90303, 0xfffffcfd, 0x0302fcfd, 0xfcfcfcfd, 0x03fefcfd, 0xfc00fcfd, 0xff03fcfd, 0x00fbfcfd,
- 0x0706fcfd, 0xf8f8fcfd, 0x000003ff, 0x030303ff, 0xfcfd03ff, 0x03ff03ff, 0xfc0103ff, 0xff0403ff,
- 0x00fc03ff, 0x070703ff, 0xf8f903ff, 0xfffffc01, 0x0302fc01, 0xfcfcfc01, 0x03fefc01, 0xfc00fc01,
- 0xff03fc01, 0x00fbfc01, 0x0706fc01, 0xf8f8fc01, 0xffffff04, 0x0302ff04, 0xfcfcff04, 0x03feff04,
- 0xfc00ff04, 0xff03ff04, 0x00fbff04, 0x0706ff04, 0xf8f8ff04, 0x000000fc, 0x030300fc, 0xfcfd00fc,
- 0x03ff00fc, 0xfc0100fc, 0xff0400fc, 0x00fc00fc, 0x070700fc, 0xf8f900fc, 0x00000707, 0x03030707,
- 0xfcfd0707, 0x03ff0707, 0xfc010707, 0xff040707, 0x00fc0707, 0x07070707, 0xf8f90707, 0xfffff8f9,
- 0x0302f8f9, 0xfcfcf8f9, 0x03fef8f9, 0xfc00f8f9, 0xff03f8f9, 0x00fbf8f9, 0x0706f8f9, 0xf8f8f8f9,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000404, 0xfffffbfc, 0x000004ff, 0xfffffb01, 0xffffff05, 0x000000fb, 0x00000a03,
- 0xfffff5fd, 0x0000030a, 0xfffffcf6, 0x00000909, 0xfffff6f7, 0x000006f9, 0xfffff907, 0x00000bfd,
- 0xfffff403, 0xfffffd0c, 0x000002f4, 0x00001108, 0xffffeef8, 0x00000811, 0xfffff7ef, 0x00001111,
- 0xffffeeef, 0x00001301, 0xffffecff, 0x00000113, 0xfffffeed, 0x00000ff5, 0xfffff00b, 0xfffff510,
- 0x00000af0, 0x000016fa, 0xffffe906, 0xfffffa17, 0x000005e9, 0x00001f12, 0xffffe0ee, 0x0000121f,
- 0xffffede1, 0x00002008, 0xffffdff8, 0x00000820, 0xfffff7e0, 0x00002121, 0xffffdedf, 0x000023ff,
- 0xffffdc01, 0xffffff24, 0x000000dc, 0x000016e9, 0xffffe917, 0x00001eef, 0xffffe111, 0xffffef1f,
- 0x000010e1, 0x00003615, 0xffffc9eb, 0x00001536, 0xffffeaca, 0x00003725, 0xffffc8db, 0x00002537,
- 0xffffdac9, 0x00002bf4, 0xffffd40c, 0xfffff42c, 0x00000bd4, 0x00003908, 0xffffc6f8, 0x00000839,
- 0xfffff7c7, 0x00003d3d, 0xffffc2c3, 0x000041fb, 0xffffbe05, 0xfffffb42, 0x000004be, 0x00002cdc,
- 0xffffd324, 0xffffdc2d, 0x000023d3, 0x00003be3, 0xffffc41d, 0xffffe33c, 0x00001cc4, 0x00005c2d,
- 0xffffa3d3, 0x00002d5c, 0xffffd2a4, 0x00005d19, 0xffffa2e7, 0x0000195d, 0xffffe6a3, 0x00006147,
- 0xffff9eb9, 0x00004761, 0xffffb89f, 0x000052ea, 0xffffad16, 0xffffea53, 0x000015ad, 0x00006607,
- 0xffff99f9, 0x00000766, 0xfffff89a, 0x00006d6d, 0xffff9293, 0x000043bc, 0xffffbc44, 0x000054c7,
- 0xffffab39, 0xffffc755, 0x000038ab, 0x000077f3, 0xffff880d, 0xfffff378, 0x00000c88, 0x00006dcf,
- 0xffff9231, 0xffffcf6e, 0x00003092, 0x00007a98, 0xffff8568, 0xffff987b, 0x00006785, 0x00001818,
- 0xffffe7e8, 0x00002e2e, 0xffffd1d2, 0x00005454, 0xffffabac, 0x00000000, 0x04040000, 0xfbfc0000,
- 0x04ff0000, 0xfb010000, 0xff050000, 0x00fb0000, 0x0a030000, 0xf5fd0000, 0x030a0000, 0x00000404,
- 0x04040404, 0xfbfc0404, 0x04ff0404, 0xfb010404, 0xff050404, 0x00fb0404, 0x0a030404, 0xf5fd0404,
- 0x030a0404, 0xfffffbfc, 0x0403fbfc, 0xfbfbfbfc, 0x04fefbfc, 0xfb00fbfc, 0xff04fbfc, 0x00fafbfc,
- 0x0a02fbfc, 0xf5fcfbfc, 0x0309fbfc, 0x000004ff, 0x040404ff, 0xfbfc04ff, 0x04ff04ff, 0xfb0104ff,
- 0xff0504ff, 0x00fb04ff, 0x0a0304ff, 0xf5fd04ff, 0x030a04ff, 0xfffffb01, 0x0403fb01, 0xfbfbfb01,
- 0x04fefb01, 0xfb00fb01, 0xff04fb01, 0x00fafb01, 0x0a02fb01, 0xf5fcfb01, 0x0309fb01, 0xffffff05,
- 0x0403ff05, 0xfbfbff05, 0x04feff05, 0xfb00ff05, 0xff04ff05, 0x00faff05, 0x0a02ff05, 0xf5fcff05,
- 0x0309ff05, 0x000000fb, 0x040400fb, 0xfbfc00fb, 0x04ff00fb, 0xfb0100fb, 0xff0500fb, 0x00fb00fb,
- 0x0a0300fb, 0xf5fd00fb, 0x030a00fb, 0x00000a03, 0x04040a03, 0xfbfc0a03, 0x04ff0a03, 0xfb010a03,
- 0xff050a03, 0x00fb0a03, 0x0a030a03, 0xf5fd0a03, 0x030a0a03, 0xfffff5fd, 0x0403f5fd, 0xfbfbf5fd,
- 0x04fef5fd, 0xfb00f5fd, 0xff04f5fd, 0x00faf5fd, 0x0a02f5fd, 0xf5fcf5fd, 0x0309f5fd, 0x0000030a,
- 0x0404030a, 0xfbfc030a, 0x04ff030a, 0xfb01030a, 0xff05030a, 0x00fb030a, 0x0a03030a, 0xf5fd030a,
- 0x030a030a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000505, 0xfffffafb, 0x000006fe, 0xfffff902, 0xfffffe07, 0x000001f9, 0x00000b0b,
- 0xfffff4f5, 0x00000d03, 0xfffff2fd, 0x0000030d, 0xfffffcf3, 0x000008f7, 0xfffff709, 0x00000efc,
- 0xfffff104, 0xfffffc0f, 0x000003f1, 0x0000160b, 0xffffe9f5, 0x00000b16, 0xfffff4ea, 0x00001515,
- 0xffffeaeb, 0x00001802, 0xffffe7fe, 0x00000218, 0xfffffde8, 0x000013f2, 0xffffec0e, 0xfffff214,
- 0x00000dec, 0x00002617, 0xffffd9e9, 0x00001726, 0xffffe8da, 0x00001cf8, 0xffffe308, 0xfffff81d,
- 0x000007e3, 0x0000270b, 0xffffd8f5, 0x00000b27, 0xfffff4d9, 0x00002929, 0xffffd6d7, 0x00002cff,
- 0xffffd301, 0xffffff2d, 0x000000d3, 0x00001ce3, 0xffffe31d, 0x000026ea, 0xffffd916, 0xffffea27,
- 0x000015d9, 0x0000431b, 0xffffbce5, 0x00001b43, 0xffffe4bd, 0x0000452f, 0xffffbad1, 0x00002f45,
- 0xffffd0bb, 0x000037f1, 0xffffc80f, 0xfffff138, 0x00000ec8, 0x0000470b, 0xffffb8f5, 0x00000b47,
- 0xfffff4b9, 0x00004c4c, 0xffffb3b4, 0x000052fa, 0xffffad06, 0xfffffa53, 0x000005ad, 0x000038d3,
- 0xffffc72d, 0xffffd339, 0x00002cc7, 0x00004adc, 0xffffb524, 0xffffdc4b, 0x000023b5, 0x00007338,
- 0xffff8cc8, 0x00003873, 0xffffc78d, 0x0000751f, 0xffff8ae1, 0x00001f75, 0xffffe08b, 0x00007a58,
- 0xffff85a8, 0x0000587a, 0xffffa786, 0x000067e4, 0xffff981c, 0xffffe468, 0x00001b98, 0x000054ab,
- 0xffffab55, 0x000069b8, 0xffff9648, 0xffffb86a, 0x00004796, 0x00001e1e, 0xffffe1e2, 0x00003a3a,
- 0xffffc5c6, 0x00006969, 0xffff9697, 0x00000000, 0x05050000, 0xfafb0000, 0x06fe0000, 0xf9020000,
- 0xfe070000, 0x01f90000, 0x0b0b0000, 0xf4f50000, 0x0d030000, 0xf2fd0000, 0x00000505, 0x05050505,
- 0xfafb0505, 0x06fe0505, 0xf9020505, 0xfe070505, 0x01f90505, 0x0b0b0505, 0xf4f50505, 0x0d030505,
- 0xf2fd0505, 0xfffffafb, 0x0504fafb, 0xfafafafb, 0x06fdfafb, 0xf901fafb, 0xfe06fafb, 0x01f8fafb,
- 0x0b0afafb, 0xf4f4fafb, 0x0d02fafb, 0xf2fcfafb, 0x000006fe, 0x050506fe, 0xfafb06fe, 0x06fe06fe,
- 0xf90206fe, 0xfe0706fe, 0x01f906fe, 0x0b0b06fe, 0xf4f506fe, 0x0d0306fe, 0xf2fd06fe, 0xfffff902,
- 0x0504f902, 0xfafaf902, 0x06fdf902, 0xf901f902, 0xfe06f902, 0x01f8f902, 0x0b0af902, 0xf4f4f902,
- 0x0d02f902, 0xf2fcf902, 0xfffffe07, 0x0504fe07, 0xfafafe07, 0x06fdfe07, 0xf901fe07, 0xfe06fe07,
- 0x01f8fe07, 0x0b0afe07, 0xf4f4fe07, 0x0d02fe07, 0xf2fcfe07, 0x000001f9, 0x050501f9, 0xfafb01f9,
- 0x06fe01f9, 0xf90201f9, 0xfe0701f9, 0x01f901f9, 0x0b0b01f9, 0xf4f501f9, 0x0d0301f9, 0xf2fd01f9,
- 0x00000b0b, 0x05050b0b, 0xfafb0b0b, 0x06fe0b0b, 0xf9020b0b, 0xfe070b0b, 0x01f90b0b, 0x0b0b0b0b,
- 0xf4f50b0b, 0x0d030b0b, 0xf2fd0b0b, 0xfffff4f5, 0x0504f4f5, 0xfafaf4f5, 0x06fdf4f5, 0xf901f4f5,
- 0xfe06f4f5, 0x01f8f4f5, 0x0b0af4f5, 0xf4f4f4f5, 0x0d02f4f5, 0xf2fcf4f5, 0x00000d03, 0x05050d03,
- 0xfafb0d03, 0x06fe0d03, 0xf9020d03, 0xfe070d03, 0x01f90d03, 0x0b0b0d03, 0xf4f50d03, 0x0d030d03,
- 0xf2fd0d03, 0xfffff2fd, 0x0504f2fd, 0xfafaf2fd, 0x06fdf2fd, 0xf901f2fd, 0xfe06f2fd, 0x01f8f2fd,
- 0x0b0af2fd, 0xf4f4f2fd, 0x0d02f2fd, 0xf2fcf2fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000606, 0xfffff9fa, 0x000007fe, 0xfffff802, 0xfffffe08, 0x000001f8, 0x00000d0d,
- 0xfffff2f3, 0x00000f04, 0xfffff0fc, 0x0000040f, 0xfffffbf1, 0x00000af5, 0xfffff50b, 0x000011fb,
- 0xffffee05, 0xfffffb12, 0x000004ee, 0x00001a0d, 0xffffe5f3, 0x00000d1a, 0xfffff2e6, 0x00001a1a,
- 0xffffe5e6, 0x00001d02, 0xffffe2fe, 0x0000021d, 0xfffffde3, 0x000017f0, 0xffffe810, 0xfffff018,
- 0x00000fe8, 0x00002e1c, 0xffffd1e4, 0x00001c2e, 0xffffe3d2, 0x000022f7, 0xffffdd09, 0xfffff723,
- 0x000008dd, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003131, 0xffffcecf, 0x000035ff,
- 0xffffca01, 0xffffff36, 0x000000ca, 0x000022dd, 0xffffdd23, 0x00002ee6, 0xffffd11a, 0xffffe62f,
- 0x000019d1, 0x00005120, 0xffffaee0, 0x00002051, 0xffffdfaf, 0x00005338, 0xffffacc8, 0x00003853,
- 0xffffc7ad, 0x000042ee, 0xffffbd12, 0xffffee43, 0x000011bd, 0x0000560d, 0xffffa9f3, 0x00000d56,
- 0xfffff2aa, 0x00005b5b, 0xffffa4a5, 0x000062f9, 0xffff9d07, 0xfffff963, 0x0000069d, 0x000043ca,
- 0xffffbc36, 0xffffca44, 0x000035bc, 0x000059d4, 0xffffa62c, 0xffffd45a, 0x00002ba6, 0x00007bdf,
- 0xffff8421, 0xffffdf7c, 0x00002084, 0x00006699, 0xffff9967, 0x00007eaa, 0xffff8156, 0xffffaa7f,
- 0x00005581, 0x00002525, 0xffffdadb, 0x00004545, 0xffffbabb, 0x00000000, 0x06060000, 0xf9fa0000,
- 0x07fe0000, 0xf8020000, 0xfe080000, 0x01f80000, 0x0d0d0000, 0xf2f30000, 0x0f040000, 0xf0fc0000,
- 0x040f0000, 0x00000606, 0x06060606, 0xf9fa0606, 0x07fe0606, 0xf8020606, 0xfe080606, 0x01f80606,
- 0x0d0d0606, 0xf2f30606, 0x0f040606, 0xf0fc0606, 0x040f0606, 0xfffff9fa, 0x0605f9fa, 0xf9f9f9fa,
- 0x07fdf9fa, 0xf801f9fa, 0xfe07f9fa, 0x01f7f9fa, 0x0d0cf9fa, 0xf2f2f9fa, 0x0f03f9fa, 0xf0fbf9fa,
- 0x040ef9fa, 0x000007fe, 0x060607fe, 0xf9fa07fe, 0x07fe07fe, 0xf80207fe, 0xfe0807fe, 0x01f807fe,
- 0x0d0d07fe, 0xf2f307fe, 0x0f0407fe, 0xf0fc07fe, 0x040f07fe, 0xfffff802, 0x0605f802, 0xf9f9f802,
- 0x07fdf802, 0xf801f802, 0xfe07f802, 0x01f7f802, 0x0d0cf802, 0xf2f2f802, 0x0f03f802, 0xf0fbf802,
- 0x040ef802, 0xfffffe08, 0x0605fe08, 0xf9f9fe08, 0x07fdfe08, 0xf801fe08, 0xfe07fe08, 0x01f7fe08,
- 0x0d0cfe08, 0xf2f2fe08, 0x0f03fe08, 0xf0fbfe08, 0x040efe08, 0x000001f8, 0x060601f8, 0xf9fa01f8,
- 0x07fe01f8, 0xf80201f8, 0xfe0801f8, 0x01f801f8, 0x0d0d01f8, 0xf2f301f8, 0x0f0401f8, 0xf0fc01f8,
- 0x040f01f8, 0x00000d0d, 0x06060d0d, 0xf9fa0d0d, 0x07fe0d0d, 0xf8020d0d, 0xfe080d0d, 0x01f80d0d,
- 0x0d0d0d0d, 0xf2f30d0d, 0x0f040d0d, 0xf0fc0d0d, 0x040f0d0d, 0xfffff2f3, 0x0605f2f3, 0xf9f9f2f3,
- 0x07fdf2f3, 0xf801f2f3, 0xfe07f2f3, 0x01f7f2f3, 0x0d0cf2f3, 0xf2f2f2f3, 0x0f03f2f3, 0xf0fbf2f3,
- 0x040ef2f3, 0x00000f04, 0x06060f04, 0xf9fa0f04, 0x07fe0f04, 0xf8020f04, 0xfe080f04, 0x01f80f04,
- 0x0d0d0f04, 0xf2f30f04, 0x0f040f04, 0xf0fc0f04, 0x040f0f04, 0xfffff0fc, 0x0605f0fc, 0xf9f9f0fc,
- 0x07fdf0fc, 0xf801f0fc, 0xfe07f0fc, 0x01f7f0fc, 0x0d0cf0fc, 0xf2f2f0fc, 0x0f03f0fc, 0xf0fbf0fc,
- 0x040ef0fc, 0x0000040f, 0x0606040f, 0xf9fa040f, 0x07fe040f, 0xf802040f, 0xfe08040f, 0x01f8040f,
- 0x0d0d040f, 0xf2f3040f, 0x0f04040f, 0xf0fc040f, 0x040f040f, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000707, 0xfffff8f9, 0x000009fd, 0xfffff603, 0xfffffd0a, 0x000002f6, 0x00001010,
- 0xffffeff0, 0x00001205, 0xffffedfb, 0x00000512, 0xfffffaee, 0x00000cf3, 0xfffff30d, 0x000014fa,
- 0xffffeb06, 0xfffffa15, 0x000005eb, 0x00001e0f, 0xffffe1f1, 0x00000f1e, 0xfffff0e2, 0x00001e1e,
- 0xffffe1e2, 0x00002202, 0xffffddfe, 0x00000222, 0xfffffdde, 0x00001bed, 0xffffe413, 0xffffed1c,
- 0x000012e4, 0x00003620, 0xffffc9e0, 0x00002036, 0xffffdfca, 0x000028f5, 0xffffd70b, 0xfffff529,
- 0x00000ad7, 0x0000370f, 0xffffc8f1, 0x00000f37, 0xfffff0c9, 0x00003939, 0xffffc6c7, 0x00003eff,
- 0xffffc101, 0xffffff3f, 0x000000c1, 0x000027d8, 0xffffd828, 0x000036e2, 0xffffc91e, 0xffffe237,
- 0x00001dc9, 0x00005e25, 0xffffa1db, 0x0000255e, 0xffffdaa2, 0x00006041, 0xffff9fbf, 0x00004160,
- 0xffffbea0, 0x00004deb, 0xffffb215, 0xffffeb4e, 0x000014b2, 0x0000640f, 0xffff9bf1, 0x00000f64,
- 0xfffff09c, 0x00006a6a, 0xffff9596, 0x000073f8, 0xffff8c08, 0xfffff874, 0x0000078c, 0x00004ec1,
- 0xffffb13f, 0xffffc14f, 0x00003eb1, 0x000068cd, 0xffff9733, 0xffffcd69, 0x00003297, 0x00007788,
- 0xffff8878, 0x00002b2b, 0xffffd4d5, 0x00005050, 0xffffafb0, 0x00000000, 0x07070000, 0xf8f90000,
- 0x09fd0000, 0xf6030000, 0xfd0a0000, 0x02f60000, 0x10100000, 0xeff00000, 0x12050000, 0xedfb0000,
- 0x05120000, 0x00000707, 0x07070707, 0xf8f90707, 0x09fd0707, 0xf6030707, 0xfd0a0707, 0x02f60707,
- 0x10100707, 0xeff00707, 0x12050707, 0xedfb0707, 0x05120707, 0xfffff8f9, 0x0706f8f9, 0xf8f8f8f9,
- 0x09fcf8f9, 0xf602f8f9, 0xfd09f8f9, 0x02f5f8f9, 0x100ff8f9, 0xefeff8f9, 0x1204f8f9, 0xedfaf8f9,
- 0x0511f8f9, 0x000009fd, 0x070709fd, 0xf8f909fd, 0x09fd09fd, 0xf60309fd, 0xfd0a09fd, 0x02f609fd,
- 0x101009fd, 0xeff009fd, 0x120509fd, 0xedfb09fd, 0x051209fd, 0xfffff603, 0x0706f603, 0xf8f8f603,
- 0x09fcf603, 0xf602f603, 0xfd09f603, 0x02f5f603, 0x100ff603, 0xefeff603, 0x1204f603, 0xedfaf603,
- 0x0511f603, 0xfffffd0a, 0x0706fd0a, 0xf8f8fd0a, 0x09fcfd0a, 0xf602fd0a, 0xfd09fd0a, 0x02f5fd0a,
- 0x100ffd0a, 0xefeffd0a, 0x1204fd0a, 0xedfafd0a, 0x0511fd0a, 0x000002f6, 0x070702f6, 0xf8f902f6,
- 0x09fd02f6, 0xf60302f6, 0xfd0a02f6, 0x02f602f6, 0x101002f6, 0xeff002f6, 0x120502f6, 0xedfb02f6,
- 0x051202f6, 0x00001010, 0x07071010, 0xf8f91010, 0x09fd1010, 0xf6031010, 0xfd0a1010, 0x02f61010,
- 0x10101010, 0xeff01010, 0x12051010, 0xedfb1010, 0x05121010, 0xffffeff0, 0x0706eff0, 0xf8f8eff0,
- 0x09fceff0, 0xf602eff0, 0xfd09eff0, 0x02f5eff0, 0x100feff0, 0xefefeff0, 0x1204eff0, 0xedfaeff0,
- 0x0511eff0, 0x00001205, 0x07071205, 0xf8f91205, 0x09fd1205, 0xf6031205, 0xfd0a1205, 0x02f61205,
- 0x10101205, 0xeff01205, 0x12051205, 0xedfb1205, 0x05121205, 0xffffedfb, 0x0706edfb, 0xf8f8edfb,
- 0x09fcedfb, 0xf602edfb, 0xfd09edfb, 0x02f5edfb, 0x100fedfb, 0xefefedfb, 0x1204edfb, 0xedfaedfb,
- 0x0511edfb, 0x00000512, 0x07070512, 0xf8f90512, 0x09fd0512, 0xf6030512, 0xfd0a0512, 0x02f60512,
- 0x10100512, 0xeff00512, 0x12050512, 0xedfb0512, 0x05120512, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000808, 0xfffff7f8, 0x00000afd, 0xfffff503, 0xfffffd0b, 0x000002f5, 0x00001212,
- 0xffffedee, 0x00001405, 0xffffebfb, 0x00000514, 0xfffffaec, 0x00000ef1, 0xfffff10f, 0x000017f9,
- 0xffffe807, 0xfffff918, 0x000006e8, 0x00002311, 0xffffdcef, 0x00001123, 0xffffeedd, 0x00002222,
- 0xffffddde, 0x00002603, 0xffffd9fd, 0x00000326, 0xfffffcda, 0x00001fea, 0xffffe016, 0xffffea20,
- 0x000015e0, 0x00003d25, 0xffffc2db, 0x0000253d, 0xffffdac3, 0x00002ef3, 0xffffd10d, 0xfffff32f,
- 0x00000cd1, 0x00003f11, 0xffffc0ef, 0x0000113f, 0xffffeec1, 0x00004141, 0xffffbebf, 0x000047ff,
- 0xffffb801, 0xffffff48, 0x000000b8, 0x00002dd2, 0xffffd22e, 0x00003edd, 0xffffc123, 0xffffdd3f,
- 0x000022c1, 0x00006b2b, 0xffff94d5, 0x00002b6b, 0xffffd495, 0x00006e4b, 0xffff91b5, 0x00004b6e,
- 0xffffb492, 0x000058e8, 0xffffa718, 0xffffe859, 0x000017a7, 0x00007211, 0xffff8def, 0x00001172,
- 0xffffee8e, 0x00007979, 0xffff8687, 0x00005ab8, 0xffffa548, 0xffffb85b, 0x000047a5, 0x000077c6,
- 0xffff883a, 0xffffc678, 0x00003988, 0x00003131, 0xffffcecf, 0x00005c5c, 0xffffa3a4, 0x00000000,
- 0x08080000, 0xf7f80000, 0x0afd0000, 0xf5030000, 0xfd0b0000, 0x02f50000, 0x12120000, 0xedee0000,
- 0x14050000, 0xebfb0000, 0x05140000, 0x00000808, 0x08080808, 0xf7f80808, 0x0afd0808, 0xf5030808,
- 0xfd0b0808, 0x02f50808, 0x12120808, 0xedee0808, 0x14050808, 0xebfb0808, 0x05140808, 0xfffff7f8,
- 0x0807f7f8, 0xf7f7f7f8, 0x0afcf7f8, 0xf502f7f8, 0xfd0af7f8, 0x02f4f7f8, 0x1211f7f8, 0xededf7f8,
- 0x1404f7f8, 0xebfaf7f8, 0x0513f7f8, 0x00000afd, 0x08080afd, 0xf7f80afd, 0x0afd0afd, 0xf5030afd,
- 0xfd0b0afd, 0x02f50afd, 0x12120afd, 0xedee0afd, 0x14050afd, 0xebfb0afd, 0x05140afd, 0xfffff503,
- 0x0807f503, 0xf7f7f503, 0x0afcf503, 0xf502f503, 0xfd0af503, 0x02f4f503, 0x1211f503, 0xededf503,
- 0x1404f503, 0xebfaf503, 0x0513f503, 0xfffffd0b, 0x0807fd0b, 0xf7f7fd0b, 0x0afcfd0b, 0xf502fd0b,
- 0xfd0afd0b, 0x02f4fd0b, 0x1211fd0b, 0xededfd0b, 0x1404fd0b, 0xebfafd0b, 0x0513fd0b, 0x000002f5,
- 0x080802f5, 0xf7f802f5, 0x0afd02f5, 0xf50302f5, 0xfd0b02f5, 0x02f502f5, 0x121202f5, 0xedee02f5,
- 0x140502f5, 0xebfb02f5, 0x051402f5, 0x00001212, 0x08081212, 0xf7f81212, 0x0afd1212, 0xf5031212,
- 0xfd0b1212, 0x02f51212, 0x12121212, 0xedee1212, 0x14051212, 0xebfb1212, 0x05141212, 0xffffedee,
- 0x0807edee, 0xf7f7edee, 0x0afcedee, 0xf502edee, 0xfd0aedee, 0x02f4edee, 0x1211edee, 0xedededee,
- 0x1404edee, 0xebfaedee, 0x0513edee, 0x00001405, 0x08081405, 0xf7f81405, 0x0afd1405, 0xf5031405,
- 0xfd0b1405, 0x02f51405, 0x12121405, 0xedee1405, 0x14051405, 0xebfb1405, 0x05141405, 0xffffebfb,
- 0x0807ebfb, 0xf7f7ebfb, 0x0afcebfb, 0xf502ebfb, 0xfd0aebfb, 0x02f4ebfb, 0x1211ebfb, 0xededebfb,
- 0x1404ebfb, 0xebfaebfb, 0x0513ebfb, 0x00000514, 0x08080514, 0xf7f80514, 0x0afd0514, 0xf5030514,
- 0xfd0b0514, 0x02f50514, 0x12120514, 0xedee0514, 0x14050514, 0xebfb0514, 0x05140514, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000909, 0xfffff6f7, 0x00000bfd, 0xfffff403, 0xfffffd0c, 0x000002f4, 0x00001414,
- 0xffffebec, 0x00001706, 0xffffe8fa, 0x00000617, 0xfffff9e9, 0x000010ef, 0xffffef11, 0x00001af9,
- 0xffffe507, 0xfffff91b, 0x000006e5, 0x00002713, 0xffffd8ed, 0x00001327, 0xffffecd9, 0x00002727,
- 0xffffd8d9, 0x00002b03, 0xffffd4fd, 0x0000032b, 0xfffffcd5, 0x000023e8, 0xffffdc18, 0xffffe824,
- 0x000017dc, 0x0000452a, 0xffffbad6, 0x00002a45, 0xffffd5bb, 0x000034f2, 0xffffcb0e, 0xfffff235,
- 0x00000dcb, 0x00004713, 0xffffb8ed, 0x00001347, 0xffffecb9, 0x00004949, 0xffffb6b7, 0x00004ffe,
- 0xffffb002, 0xfffffe50, 0x000001b0, 0x000033cc, 0xffffcc34, 0x000045d9, 0xffffba27, 0xffffd946,
- 0x000026ba, 0x00007930, 0xffff86d0, 0x00003079, 0xffffcf87, 0x00007c54, 0xffff83ac, 0x0000547c,
- 0xffffab84, 0x000063e5, 0xffff9c1b, 0xffffe564, 0x00001a9c, 0x000065af, 0xffff9a51, 0xffffaf66,
- 0x0000509a, 0x00003737, 0xffffc8c9, 0x00006868, 0xffff9798, 0x00000000, 0x09090000, 0xf6f70000,
- 0x0bfd0000, 0xf4030000, 0xfd0c0000, 0x02f40000, 0x14140000, 0xebec0000, 0x17060000, 0xe8fa0000,
- 0x06170000, 0xf9e90000, 0x00000909, 0x09090909, 0xf6f70909, 0x0bfd0909, 0xf4030909, 0xfd0c0909,
- 0x02f40909, 0x14140909, 0xebec0909, 0x17060909, 0xe8fa0909, 0x06170909, 0xf9e90909, 0xfffff6f7,
- 0x0908f6f7, 0xf6f6f6f7, 0x0bfcf6f7, 0xf402f6f7, 0xfd0bf6f7, 0x02f3f6f7, 0x1413f6f7, 0xebebf6f7,
- 0x1705f6f7, 0xe8f9f6f7, 0x0616f6f7, 0xf9e8f6f7, 0x00000bfd, 0x09090bfd, 0xf6f70bfd, 0x0bfd0bfd,
- 0xf4030bfd, 0xfd0c0bfd, 0x02f40bfd, 0x14140bfd, 0xebec0bfd, 0x17060bfd, 0xe8fa0bfd, 0x06170bfd,
- 0xf9e90bfd, 0xfffff403, 0x0908f403, 0xf6f6f403, 0x0bfcf403, 0xf402f403, 0xfd0bf403, 0x02f3f403,
- 0x1413f403, 0xebebf403, 0x1705f403, 0xe8f9f403, 0x0616f403, 0xf9e8f403, 0xfffffd0c, 0x0908fd0c,
- 0xf6f6fd0c, 0x0bfcfd0c, 0xf402fd0c, 0xfd0bfd0c, 0x02f3fd0c, 0x1413fd0c, 0xebebfd0c, 0x1705fd0c,
- 0xe8f9fd0c, 0x0616fd0c, 0xf9e8fd0c, 0x000002f4, 0x090902f4, 0xf6f702f4, 0x0bfd02f4, 0xf40302f4,
- 0xfd0c02f4, 0x02f402f4, 0x141402f4, 0xebec02f4, 0x170602f4, 0xe8fa02f4, 0x061702f4, 0xf9e902f4,
- 0x00001414, 0x09091414, 0xf6f71414, 0x0bfd1414, 0xf4031414, 0xfd0c1414, 0x02f41414, 0x14141414,
- 0xebec1414, 0x17061414, 0xe8fa1414, 0x06171414, 0xf9e91414, 0xffffebec, 0x0908ebec, 0xf6f6ebec,
- 0x0bfcebec, 0xf402ebec, 0xfd0bebec, 0x02f3ebec, 0x1413ebec, 0xebebebec, 0x1705ebec, 0xe8f9ebec,
- 0x0616ebec, 0xf9e8ebec, 0x00001706, 0x09091706, 0xf6f71706, 0x0bfd1706, 0xf4031706, 0xfd0c1706,
- 0x02f41706, 0x14141706, 0xebec1706, 0x17061706, 0xe8fa1706, 0x06171706, 0xf9e91706, 0xffffe8fa,
- 0x0908e8fa, 0xf6f6e8fa, 0x0bfce8fa, 0xf402e8fa, 0xfd0be8fa, 0x02f3e8fa, 0x1413e8fa, 0xebebe8fa,
- 0x1705e8fa, 0xe8f9e8fa, 0x0616e8fa, 0xf9e8e8fa, 0x00000617, 0x09090617, 0xf6f70617, 0x0bfd0617,
- 0xf4030617, 0xfd0c0617, 0x02f40617, 0x14140617, 0xebec0617, 0x17060617, 0xe8fa0617, 0x06170617,
- 0xf9e90617, 0xfffff9e9, 0x0908f9e9, 0xf6f6f9e9, 0x0bfcf9e9, 0xf402f9e9, 0xfd0bf9e9, 0x02f3f9e9,
- 0x1413f9e9, 0xebebf9e9, 0x1705f9e9, 0xe8f9f9e9, 0x0616f9e9, 0xf9e8f9e9, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404,
- 0xfffffbfc, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x000003fc, 0xfffffc04, 0x000005fe,
- 0xfffffa02, 0xfffffe06, 0x000001fa, 0x00000804, 0xfffff7fc, 0x00000408, 0xfffffbf8, 0x00000808,
- 0xfffff7f8, 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x000007fc, 0xfffff804, 0xfffffc08,
- 0x000003f8, 0x00000e08, 0xfffff1f8, 0x0000080e, 0xfffff7f2, 0x00000bfe, 0xfffff402, 0xfffffe0c,
- 0x000001f4, 0x00001004, 0xffffeffc, 0x00000410, 0xfffffbf0, 0x00001010, 0xffffeff0, 0x00001200,
- 0xffffee00, 0x00000012, 0xffffffee, 0x00000bf4, 0xfffff40c, 0x00000ff8, 0xfffff008, 0xfffff810,
- 0x000007f0, 0x00001a0a, 0xffffe5f6, 0x00000a1a, 0xfffff5e6, 0x00001c12, 0xffffe3ee, 0x0000121c,
- 0xffffede4, 0x000015fa, 0xffffea06, 0xfffffa16, 0x000005ea, 0x00001c04, 0xffffe3fc, 0x0000041c,
- 0xfffffbe4, 0x00001e1e, 0xffffe1e2, 0x00001ffe, 0xffffe002, 0xfffffe20, 0x000001e0, 0x000015ee,
- 0xffffea12, 0xffffee16, 0x000011ea, 0x00001df2, 0xffffe20e, 0xfffff21e, 0x00000de2, 0x00002e16,
- 0xffffd1ea, 0x0000162e, 0xffffe9d2, 0x00002e0c, 0xffffd1f4, 0x00000c2e, 0xfffff3d2, 0x00003022,
- 0xffffcfde, 0x00002230, 0xffffddd0, 0x000027f6, 0xffffd80a, 0xfffff628, 0x000009d8, 0x00003204,
- 0xffffcdfc, 0x00000432, 0xfffffbce, 0x00003636, 0xffffc9ca, 0x000021de, 0xffffde22, 0x000029e4,
- 0xffffd61c, 0xffffe42a, 0x00001bd6, 0x00003bfa, 0xffffc406, 0xfffffa3c, 0x000005c4, 0x00004c1a,
- 0xffffb3e6, 0x00001a4c, 0xffffe5b4, 0x00004c2a, 0xffffb3d6, 0x00002a4c, 0xffffd5b4, 0x000035e8,
- 0xffffca18, 0xffffe836, 0x000017ca, 0x00004e0e, 0xffffb1f2, 0x00000e4e, 0xfffff1b2, 0x0000523e,
- 0xffffadc2, 0x00003e52, 0xffffc1ae, 0x000049ec, 0xffffb614, 0xffffec4a, 0x000013b6, 0x00005802,
- 0xffffa7fe, 0x00000258, 0xfffffda8, 0x00005c5c, 0xffffa3a4, 0x00003bcc, 0xffffc434, 0xffffcc3c,
- 0x000033c4, 0x00007634, 0xffff89cc, 0x00003476, 0xffffcb8a, 0x000049d4, 0xffffb62c, 0xffffd44a,
- 0x00002bb6, 0x0000764a, 0xffff89b6, 0x00004a76, 0xffffb58a, 0x00007620, 0xffff89e0, 0x00002076,
- 0xffffdf8a, 0x000065f4, 0xffff9a0c, 0xfffff466, 0x00000b9a, 0x00005fd8, 0xffffa028, 0xffffd860,
- 0x000027a0, 0x000075de, 0xffff8a22, 0xffffde76, 0x0000218a, 0x000057a8, 0xffffa858, 0x000067b2,
- 0xffff984e, 0xffffb268, 0x00004d98, 0x00000c0c, 0xfffff3f4, 0x00001616, 0xffffe9ea, 0x00002a2a,
- 0xffffd5d6, 0x00004848, 0xffffb7b8, 0x00000000, 0x02020000, 0xfdfe0000, 0x02000000, 0xfe000000,
- 0x00020000, 0xfffe0000, 0x00000202, 0x02020202, 0xfdfe0202, 0x02000202, 0xfe000202, 0x00020202,
- 0xfffe0202, 0xfffffdfe, 0x0201fdfe, 0xfdfdfdfe, 0x01fffdfe, 0xfdfffdfe, 0x0001fdfe, 0xfffdfdfe,
- 0x00000200, 0x02020200, 0xfdfe0200, 0x02000200, 0xfe000200, 0x00020200, 0xfffe0200, 0xfffffe00,
- 0x0201fe00, 0xfdfdfe00, 0x01fffe00, 0xfdfffe00, 0x0001fe00, 0xfffdfe00, 0x00000002, 0x02020002,
- 0xfdfe0002, 0x02000002, 0xfe000002, 0x00020002, 0xfffe0002, 0xfffffffe, 0x0201fffe, 0xfdfdfffe,
- 0x01fffffe, 0xfdfffffe, 0x0001fffe, 0xfffdfffe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000303, 0xfffffcfd, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
- 0xfffff9fa, 0x00000903, 0xfffff6fd, 0x00000309, 0xfffffcf7, 0x000008fd, 0xfffff703, 0xfffffd09,
- 0x000002f7, 0x000005fa, 0xfffffa06, 0x00000c06, 0xfffff3fa, 0x0000060c, 0xfffff9f4, 0x00000c0c,
- 0xfffff3f4, 0x00000f00, 0xfffff100, 0x0000000f, 0xfffffff1, 0x00000bf7, 0xfffff409, 0xfffff70c,
- 0x000008f4, 0x0000180f, 0xffffe7f1, 0x00000f18, 0xfffff0e8, 0x000011fa, 0xffffee06, 0xfffffa12,
- 0x000005ee, 0x00001806, 0xffffe7fa, 0x00000618, 0xfffff9e8, 0x00001818, 0xffffe7e8, 0x00001b00,
- 0xffffe500, 0x0000001b, 0xffffffe5, 0x000011ee, 0xffffee12, 0x000017f4, 0xffffe80c, 0xfffff418,
- 0x00000be8, 0x0000270f, 0xffffd8f1, 0x00000f27, 0xfffff0d9, 0x00002a1b, 0xffffd5e5, 0x00001b2a,
- 0xffffe4d6, 0x000020f7, 0xffffdf09, 0xfffff721, 0x000008df, 0x00002a06, 0xffffd5fa, 0x0000062a,
- 0xfffff9d6, 0x00002d2d, 0xffffd2d3, 0x000032fd, 0xffffcd03, 0xfffffd33, 0x000002cd, 0x000020e5,
- 0xffffdf1b, 0xffffe521, 0x00001adf, 0x00002ceb, 0xffffd315, 0xffffeb2d, 0x000014d3, 0x00004521,
- 0xffffbadf, 0x00002145, 0xffffdebb, 0x00004512, 0xffffbaee, 0x00001245, 0xffffedbb, 0x00004836,
- 0xffffb7ca, 0x00003648, 0xffffc9b8, 0x00003eee, 0xffffc112, 0xffffee3f, 0x000011c1, 0x00004e06,
- 0xffffb1fa, 0x0000064e, 0xfffff9b2, 0x00005151, 0xffffaeaf, 0x000032cd, 0xffffcd33, 0x00003ed6,
- 0xffffc12a, 0xffffd63f, 0x000029c1, 0x000059f7, 0xffffa609, 0xfffff75a, 0x000008a6, 0x0000722a,
- 0xffff8dd6, 0x00002a72, 0xffffd58e, 0x0000753f, 0xffff8ac1, 0x00003f75, 0xffffc08b, 0x000050dc,
- 0xffffaf24, 0xffffdc51, 0x000023af, 0x00007815, 0xffff87eb, 0x00001578, 0xffffea88, 0x00007b60,
- 0xffff84a0, 0x0000607b, 0xffff9f85, 0x00006ee2, 0xffff911e, 0xffffe26f, 0x00001d91, 0x00005cb2,
- 0xffffa34e, 0xffffb25d, 0x00004da3, 0x000071bb, 0xffff8e45, 0xffffbb72, 0x0000448e, 0x00001212,
- 0xffffedee, 0x00002121, 0xffffdedf, 0x00003f3f, 0xffffc0c1, 0x00006c6c, 0xffff9394, 0x00000000,
- 0x03030000, 0xfcfd0000, 0x03000000, 0xfd000000, 0x00030000, 0xfffd0000, 0x06060000, 0xf9fa0000,
- 0x00000303, 0x03030303, 0xfcfd0303, 0x03000303, 0xfd000303, 0x00030303, 0xfffd0303, 0x06060303,
- 0xf9fa0303, 0xfffffcfd, 0x0302fcfd, 0xfcfcfcfd, 0x02fffcfd, 0xfcfffcfd, 0x0002fcfd, 0xfffcfcfd,
- 0x0605fcfd, 0xf9f9fcfd, 0x00000300, 0x03030300, 0xfcfd0300, 0x03000300, 0xfd000300, 0x00030300,
- 0xfffd0300, 0x06060300, 0xf9fa0300, 0xfffffd00, 0x0302fd00, 0xfcfcfd00, 0x02fffd00, 0xfcfffd00,
- 0x0002fd00, 0xfffcfd00, 0x0605fd00, 0xf9f9fd00, 0x00000003, 0x03030003, 0xfcfd0003, 0x03000003,
- 0xfd000003, 0x00030003, 0xfffd0003, 0x06060003, 0xf9fa0003, 0xfffffffd, 0x0302fffd, 0xfcfcfffd,
- 0x02fffffd, 0xfcfffffd, 0x0002fffd, 0xfffcfffd, 0x0605fffd, 0xf9f9fffd, 0x00000606, 0x03030606,
- 0xfcfd0606, 0x03000606, 0xfd000606, 0x00030606, 0xfffd0606, 0x06060606, 0xf9fa0606, 0xfffff9fa,
- 0x0302f9fa, 0xfcfcf9fa, 0x02fff9fa, 0xfcfff9fa, 0x0002f9fa, 0xfffcf9fa, 0x0605f9fa, 0xf9f9f9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000404, 0xfffffbfc, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000804,
- 0xfffff7fc, 0x00000408, 0xfffffbf8, 0x00000808, 0xfffff7f8, 0x000007f8, 0xfffff808, 0x00000bfc,
- 0xfffff404, 0xfffffc0c, 0x000003f4, 0x00001008, 0xffffeff8, 0x00000810, 0xfffff7f0, 0x00001010,
- 0xffffeff0, 0x00001400, 0xffffec00, 0x00000014, 0xffffffec, 0x00000ff4, 0xfffff00c, 0xfffff410,
- 0x00000bf0, 0x000017fc, 0xffffe804, 0xfffffc18, 0x000003e8, 0x00002010, 0xffffdff0, 0x00001020,
- 0xffffefe0, 0x00002008, 0xffffdff8, 0x00000820, 0xfffff7e0, 0x00002020, 0xffffdfe0, 0x00002400,
- 0xffffdc00, 0x00000024, 0xffffffdc, 0x000017e8, 0xffffe818, 0x00001ff0, 0xffffe010, 0xfffff020,
- 0x00000fe0, 0x00003414, 0xffffcbec, 0x00001434, 0xffffebcc, 0x00003824, 0xffffc7dc, 0x00002438,
- 0xffffdbc8, 0x00002bf4, 0xffffd40c, 0xfffff42c, 0x00000bd4, 0x00003808, 0xffffc7f8, 0x00000838,
- 0xfffff7c8, 0x00003c3c, 0xffffc3c4, 0x00003ffc, 0xffffc004, 0xfffffc40, 0x000003c0, 0x00002bdc,
- 0xffffd424, 0xffffdc2c, 0x000023d4, 0x00003be4, 0xffffc41c, 0xffffe43c, 0x00001bc4, 0x00005c2c,
- 0xffffa3d4, 0x00002c5c, 0xffffd3a4, 0x00005c18, 0xffffa3e8, 0x0000185c, 0xffffe7a4, 0x00006048,
- 0xffff9fb8, 0x00004860, 0xffffb7a0, 0x000053ec, 0xffffac14, 0xffffec54, 0x000013ac, 0x00006408,
- 0xffff9bf8, 0x00000864, 0xfffff79c, 0x00006c6c, 0xffff9394, 0x000043bc, 0xffffbc44, 0x000053c8,
- 0xffffac38, 0xffffc854, 0x000037ac, 0x000077f4, 0xffff880c, 0xfffff478, 0x00000b88, 0x00006bd0,
- 0xffff9430, 0xffffd06c, 0x00002f94, 0x00007b98, 0xffff8468, 0xffff987c, 0x00006784, 0x00001818,
- 0xffffe7e8, 0x00002c2c, 0xffffd3d4, 0x00005454, 0xffffabac, 0x00000000, 0x04040000, 0xfbfc0000,
- 0x04000000, 0xfc000000, 0x00040000, 0xfffc0000, 0x08040000, 0xf7fc0000, 0x04080000, 0x00000404,
- 0x04040404, 0xfbfc0404, 0x04000404, 0xfc000404, 0x00040404, 0xfffc0404, 0x08040404, 0xf7fc0404,
- 0x04080404, 0xfffffbfc, 0x0403fbfc, 0xfbfbfbfc, 0x03fffbfc, 0xfbfffbfc, 0x0003fbfc, 0xfffbfbfc,
- 0x0803fbfc, 0xf7fbfbfc, 0x0407fbfc, 0x00000400, 0x04040400, 0xfbfc0400, 0x04000400, 0xfc000400,
- 0x00040400, 0xfffc0400, 0x08040400, 0xf7fc0400, 0x04080400, 0xfffffc00, 0x0403fc00, 0xfbfbfc00,
- 0x03fffc00, 0xfbfffc00, 0x0003fc00, 0xfffbfc00, 0x0803fc00, 0xf7fbfc00, 0x0407fc00, 0x00000004,
- 0x04040004, 0xfbfc0004, 0x04000004, 0xfc000004, 0x00040004, 0xfffc0004, 0x08040004, 0xf7fc0004,
- 0x04080004, 0xfffffffc, 0x0403fffc, 0xfbfbfffc, 0x03fffffc, 0xfbfffffc, 0x0003fffc, 0xfffbfffc,
- 0x0803fffc, 0xf7fbfffc, 0x0407fffc, 0x00000804, 0x04040804, 0xfbfc0804, 0x04000804, 0xfc000804,
- 0x00040804, 0xfffc0804, 0x08040804, 0xf7fc0804, 0x04080804, 0xfffff7fc, 0x0403f7fc, 0xfbfbf7fc,
- 0x03fff7fc, 0xfbfff7fc, 0x0003f7fc, 0xfffbf7fc, 0x0803f7fc, 0xf7fbf7fc, 0x0407f7fc, 0x00000408,
- 0x04040408, 0xfbfc0408, 0x04000408, 0xfc000408, 0x00040408, 0xfffc0408, 0x08040408, 0xf7fc0408,
- 0x04080408, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000505, 0xfffffafb, 0x00000500, 0xfffffb00, 0x00000005, 0xfffffffb, 0x00000a0a,
- 0xfffff5f6, 0x00000f05, 0xfffff0fb, 0x0000050f, 0xfffffaf1, 0x000009f6, 0xfffff60a, 0x00000efb,
- 0xfffff105, 0xfffffb0f, 0x000004f1, 0x0000140a, 0xffffebf6, 0x00000a14, 0xfffff5ec, 0x00001414,
- 0xffffebec, 0x00001900, 0xffffe700, 0x00000019, 0xffffffe7, 0x000013f1, 0xffffec0f, 0xfffff114,
- 0x00000eec, 0x00002819, 0xffffd7e7, 0x00001928, 0xffffe6d8, 0x00001df6, 0xffffe20a, 0xfffff61e,
- 0x000009e2, 0x0000280a, 0xffffd7f6, 0x00000a28, 0xfffff5d8, 0x00002828, 0xffffd7d8, 0x00002d00,
- 0xffffd300, 0x0000002d, 0xffffffd3, 0x00001de2, 0xffffe21e, 0x000027ec, 0xffffd814, 0xffffec28,
- 0x000013d8, 0x00004119, 0xffffbee7, 0x00001941, 0xffffe6bf, 0x0000462d, 0xffffb9d3, 0x00002d46,
- 0xffffd2ba, 0x000036f1, 0xffffc90f, 0xfffff137, 0x00000ec9, 0x0000460a, 0xffffb9f6, 0x00000a46,
- 0xfffff5ba, 0x00004b4b, 0xffffb4b5, 0x000054fb, 0xffffab05, 0xfffffb55, 0x000004ab, 0x000036d3,
- 0xffffc92d, 0xffffd337, 0x00002cc9, 0x00004add, 0xffffb523, 0xffffdd4b, 0x000022b5, 0x00007337,
- 0xffff8cc9, 0x00003773, 0xffffc88d, 0x0000731e, 0xffff8ce2, 0x00001e73, 0xffffe18d, 0x0000785a,
- 0xffff87a6, 0x00005a78, 0xffffa588, 0x000068e2, 0xffff971e, 0xffffe269, 0x00001d97, 0x000054ab,
- 0xffffab55, 0x000068ba, 0xffff9746, 0xffffba69, 0x00004597, 0x00001e1e, 0xffffe1e2, 0x00003c3c,
- 0xffffc3c4, 0x00006969, 0xffff9697, 0x00000000, 0x05050000, 0xfafb0000, 0x05000000, 0xfb000000,
- 0x00050000, 0xfffb0000, 0x0a0a0000, 0xf5f60000, 0x0f050000, 0xf0fb0000, 0x00000505, 0x05050505,
- 0xfafb0505, 0x05000505, 0xfb000505, 0x00050505, 0xfffb0505, 0x0a0a0505, 0xf5f60505, 0x0f050505,
- 0xf0fb0505, 0xfffffafb, 0x0504fafb, 0xfafafafb, 0x04fffafb, 0xfafffafb, 0x0004fafb, 0xfffafafb,
- 0x0a09fafb, 0xf5f5fafb, 0x0f04fafb, 0xf0fafafb, 0x00000500, 0x05050500, 0xfafb0500, 0x05000500,
- 0xfb000500, 0x00050500, 0xfffb0500, 0x0a0a0500, 0xf5f60500, 0x0f050500, 0xf0fb0500, 0xfffffb00,
- 0x0504fb00, 0xfafafb00, 0x04fffb00, 0xfafffb00, 0x0004fb00, 0xfffafb00, 0x0a09fb00, 0xf5f5fb00,
- 0x0f04fb00, 0xf0fafb00, 0x00000005, 0x05050005, 0xfafb0005, 0x05000005, 0xfb000005, 0x00050005,
- 0xfffb0005, 0x0a0a0005, 0xf5f60005, 0x0f050005, 0xf0fb0005, 0xfffffffb, 0x0504fffb, 0xfafafffb,
- 0x04fffffb, 0xfafffffb, 0x0004fffb, 0xfffafffb, 0x0a09fffb, 0xf5f5fffb, 0x0f04fffb, 0xf0fafffb,
- 0x00000a0a, 0x05050a0a, 0xfafb0a0a, 0x05000a0a, 0xfb000a0a, 0x00050a0a, 0xfffb0a0a, 0x0a0a0a0a,
- 0xf5f60a0a, 0x0f050a0a, 0xf0fb0a0a, 0xfffff5f6, 0x0504f5f6, 0xfafaf5f6, 0x04fff5f6, 0xfafff5f6,
- 0x0004f5f6, 0xfffaf5f6, 0x0a09f5f6, 0xf5f5f5f6, 0x0f04f5f6, 0xf0faf5f6, 0x00000f05, 0x05050f05,
- 0xfafb0f05, 0x05000f05, 0xfb000f05, 0x00050f05, 0xfffb0f05, 0x0a0a0f05, 0xf5f60f05, 0x0f050f05,
- 0xf0fb0f05, 0xfffff0fb, 0x0504f0fb, 0xfafaf0fb, 0x04fff0fb, 0xfafff0fb, 0x0004f0fb, 0xfffaf0fb,
- 0x0a09f0fb, 0xf5f5f0fb, 0x0f04f0fb, 0xf0faf0fb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000606, 0xfffff9fa, 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x00000c0c,
- 0xfffff3f4, 0x00000c06, 0xfffff3fa, 0x0000060c, 0xfffff9f4, 0x00000bf4, 0xfffff40c, 0x000011fa,
- 0xffffee06, 0xfffffa12, 0x000005ee, 0x0000180c, 0xffffe7f4, 0x00000c18, 0xfffff3e8, 0x00001818,
- 0xffffe7e8, 0x00001e00, 0xffffe200, 0x0000001e, 0xffffffe2, 0x000017ee, 0xffffe812, 0xffffee18,
- 0x000011e8, 0x0000301e, 0xffffcfe2, 0x00001e30, 0xffffe1d0, 0x000023fa, 0xffffdc06, 0xfffffa24,
- 0x000005dc, 0x0000300c, 0xffffcff4, 0x00000c30, 0xfffff3d0, 0x00003030, 0xffffcfd0, 0x00003600,
- 0xffffca00, 0x00000036, 0xffffffca, 0x000023dc, 0xffffdc24, 0x00002fe8, 0xffffd018, 0xffffe830,
- 0x000017d0, 0x00004e1e, 0xffffb1e2, 0x00001e4e, 0xffffe1b2, 0x00005436, 0xffffabca, 0x00003654,
- 0xffffc9ac, 0x000041ee, 0xffffbe12, 0xffffee42, 0x000011be, 0x0000540c, 0xffffabf4, 0x00000c54,
- 0xfffff3ac, 0x00005a5a, 0xffffa5a6, 0x00005ffa, 0xffffa006, 0xfffffa60, 0x000005a0, 0x000041ca,
- 0xffffbe36, 0xffffca42, 0x000035be, 0x000059d6, 0xffffa62a, 0xffffd65a, 0x000029a6, 0x00007de2,
- 0xffff821e, 0xffffe27e, 0x00001d82, 0x0000659a, 0xffff9a66, 0x00007dac, 0xffff8254, 0xffffac7e,
- 0x00005382, 0x00002424, 0xffffdbdc, 0x00004242, 0xffffbdbe, 0x00000000, 0x06060000, 0xf9fa0000,
- 0x06000000, 0xfa000000, 0x00060000, 0xfffa0000, 0x0c0c0000, 0xf3f40000, 0x0c060000, 0xf3fa0000,
- 0x060c0000, 0x00000606, 0x06060606, 0xf9fa0606, 0x06000606, 0xfa000606, 0x00060606, 0xfffa0606,
- 0x0c0c0606, 0xf3f40606, 0x0c060606, 0xf3fa0606, 0x060c0606, 0xfffff9fa, 0x0605f9fa, 0xf9f9f9fa,
- 0x05fff9fa, 0xf9fff9fa, 0x0005f9fa, 0xfff9f9fa, 0x0c0bf9fa, 0xf3f3f9fa, 0x0c05f9fa, 0xf3f9f9fa,
- 0x060bf9fa, 0x00000600, 0x06060600, 0xf9fa0600, 0x06000600, 0xfa000600, 0x00060600, 0xfffa0600,
- 0x0c0c0600, 0xf3f40600, 0x0c060600, 0xf3fa0600, 0x060c0600, 0xfffffa00, 0x0605fa00, 0xf9f9fa00,
- 0x05fffa00, 0xf9fffa00, 0x0005fa00, 0xfff9fa00, 0x0c0bfa00, 0xf3f3fa00, 0x0c05fa00, 0xf3f9fa00,
- 0x060bfa00, 0x00000006, 0x06060006, 0xf9fa0006, 0x06000006, 0xfa000006, 0x00060006, 0xfffa0006,
- 0x0c0c0006, 0xf3f40006, 0x0c060006, 0xf3fa0006, 0x060c0006, 0xfffffffa, 0x0605fffa, 0xf9f9fffa,
- 0x05fffffa, 0xf9fffffa, 0x0005fffa, 0xfff9fffa, 0x0c0bfffa, 0xf3f3fffa, 0x0c05fffa, 0xf3f9fffa,
- 0x060bfffa, 0x00000c0c, 0x06060c0c, 0xf9fa0c0c, 0x06000c0c, 0xfa000c0c, 0x00060c0c, 0xfffa0c0c,
- 0x0c0c0c0c, 0xf3f40c0c, 0x0c060c0c, 0xf3fa0c0c, 0x060c0c0c, 0xfffff3f4, 0x0605f3f4, 0xf9f9f3f4,
- 0x05fff3f4, 0xf9fff3f4, 0x0005f3f4, 0xfff9f3f4, 0x0c0bf3f4, 0xf3f3f3f4, 0x0c05f3f4, 0xf3f9f3f4,
- 0x060bf3f4, 0x00000c06, 0x06060c06, 0xf9fa0c06, 0x06000c06, 0xfa000c06, 0x00060c06, 0xfffa0c06,
- 0x0c0c0c06, 0xf3f40c06, 0x0c060c06, 0xf3fa0c06, 0x060c0c06, 0xfffff3fa, 0x0605f3fa, 0xf9f9f3fa,
- 0x05fff3fa, 0xf9fff3fa, 0x0005f3fa, 0xfff9f3fa, 0x0c0bf3fa, 0xf3f3f3fa, 0x0c05f3fa, 0xf3f9f3fa,
- 0x060bf3fa, 0x0000060c, 0x0606060c, 0xf9fa060c, 0x0600060c, 0xfa00060c, 0x0006060c, 0xfffa060c,
- 0x0c0c060c, 0xf3f4060c, 0x0c06060c, 0xf3fa060c, 0x060c060c, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000707, 0xfffff8f9, 0x00000700, 0xfffff900, 0x00000007, 0xfffffff9, 0x00000e0e,
- 0xfffff1f2, 0x00001507, 0xffffeaf9, 0x00000715, 0xfffff8eb, 0x00000df2, 0xfffff20e, 0x000014f9,
- 0xffffeb07, 0xfffff915, 0x000006eb, 0x00001c0e, 0xffffe3f2, 0x00000e1c, 0xfffff1e4, 0x00001c1c,
- 0xffffe3e4, 0x00002300, 0xffffdd00, 0x00000023, 0xffffffdd, 0x00001beb, 0xffffe415, 0xffffeb1c,
- 0x000014e4, 0x00003823, 0xffffc7dd, 0x00002338, 0xffffdcc8, 0x000029f2, 0xffffd60e, 0xfffff22a,
- 0x00000dd6, 0x0000380e, 0xffffc7f2, 0x00000e38, 0xfffff1c8, 0x00003838, 0xffffc7c8, 0x00003f00,
- 0xffffc100, 0x0000003f, 0xffffffc1, 0x000029d6, 0xffffd62a, 0x000037e4, 0xffffc81c, 0xffffe438,
- 0x00001bc8, 0x00005b23, 0xffffa4dd, 0x0000235b, 0xffffdca5, 0x0000623f, 0xffff9dc1, 0x00003f62,
- 0xffffc09e, 0x00004ceb, 0xffffb315, 0xffffeb4d, 0x000014b3, 0x0000620e, 0xffff9df2, 0x00000e62,
- 0xfffff19e, 0x00006969, 0xffff9697, 0x000076f9, 0xffff8907, 0xfffff977, 0x00000689, 0x00004cc1,
- 0xffffb33f, 0xffffc14d, 0x00003eb3, 0x000068cf, 0xffff9731, 0xffffcf69, 0x00003097, 0x00007689,
- 0xffff8977, 0x00002a2a, 0xffffd5d6, 0x00004d4d, 0xffffb2b3, 0x00000000, 0x07070000, 0xf8f90000,
- 0x07000000, 0xf9000000, 0x00070000, 0xfff90000, 0x0e0e0000, 0xf1f20000, 0x15070000, 0xeaf90000,
- 0x07150000, 0x00000707, 0x07070707, 0xf8f90707, 0x07000707, 0xf9000707, 0x00070707, 0xfff90707,
- 0x0e0e0707, 0xf1f20707, 0x15070707, 0xeaf90707, 0x07150707, 0xfffff8f9, 0x0706f8f9, 0xf8f8f8f9,
- 0x06fff8f9, 0xf8fff8f9, 0x0006f8f9, 0xfff8f8f9, 0x0e0df8f9, 0xf1f1f8f9, 0x1506f8f9, 0xeaf8f8f9,
- 0x0714f8f9, 0x00000700, 0x07070700, 0xf8f90700, 0x07000700, 0xf9000700, 0x00070700, 0xfff90700,
- 0x0e0e0700, 0xf1f20700, 0x15070700, 0xeaf90700, 0x07150700, 0xfffff900, 0x0706f900, 0xf8f8f900,
- 0x06fff900, 0xf8fff900, 0x0006f900, 0xfff8f900, 0x0e0df900, 0xf1f1f900, 0x1506f900, 0xeaf8f900,
- 0x0714f900, 0x00000007, 0x07070007, 0xf8f90007, 0x07000007, 0xf9000007, 0x00070007, 0xfff90007,
- 0x0e0e0007, 0xf1f20007, 0x15070007, 0xeaf90007, 0x07150007, 0xfffffff9, 0x0706fff9, 0xf8f8fff9,
- 0x06fffff9, 0xf8fffff9, 0x0006fff9, 0xfff8fff9, 0x0e0dfff9, 0xf1f1fff9, 0x1506fff9, 0xeaf8fff9,
- 0x0714fff9, 0x00000e0e, 0x07070e0e, 0xf8f90e0e, 0x07000e0e, 0xf9000e0e, 0x00070e0e, 0xfff90e0e,
- 0x0e0e0e0e, 0xf1f20e0e, 0x15070e0e, 0xeaf90e0e, 0x07150e0e, 0xfffff1f2, 0x0706f1f2, 0xf8f8f1f2,
- 0x06fff1f2, 0xf8fff1f2, 0x0006f1f2, 0xfff8f1f2, 0x0e0df1f2, 0xf1f1f1f2, 0x1506f1f2, 0xeaf8f1f2,
- 0x0714f1f2, 0x00001507, 0x07071507, 0xf8f91507, 0x07001507, 0xf9001507, 0x00071507, 0xfff91507,
- 0x0e0e1507, 0xf1f21507, 0x15071507, 0xeaf91507, 0x07151507, 0xffffeaf9, 0x0706eaf9, 0xf8f8eaf9,
- 0x06ffeaf9, 0xf8ffeaf9, 0x0006eaf9, 0xfff8eaf9, 0x0e0deaf9, 0xf1f1eaf9, 0x1506eaf9, 0xeaf8eaf9,
- 0x0714eaf9, 0x00000715, 0x07070715, 0xf8f90715, 0x07000715, 0xf9000715, 0x00070715, 0xfff90715,
- 0x0e0e0715, 0xf1f20715, 0x15070715, 0xeaf90715, 0x07150715, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000808, 0xfffff7f8, 0x00000800, 0xfffff800, 0x00000008, 0xfffffff8, 0x00001010,
- 0xffffeff0, 0x00001008, 0xffffeff8, 0x00000810, 0xfffff7f0, 0x00000ff0, 0xfffff010, 0x000017f8,
- 0xffffe808, 0xfffff818, 0x000007e8, 0x00002010, 0xffffdff0, 0x00001020, 0xffffefe0, 0x00002020,
- 0xffffdfe0, 0x00002800, 0xffffd800, 0x00000028, 0xffffffd8, 0x00001fe8, 0xffffe018, 0xffffe820,
- 0x000017e0, 0x00004028, 0xffffbfd8, 0x00002840, 0xffffd7c0, 0x00002ff0, 0xffffd010, 0xfffff030,
- 0x00000fd0, 0x00004010, 0xffffbff0, 0x00001040, 0xffffefc0, 0x00004040, 0xffffbfc0, 0x00004800,
- 0xffffb800, 0x00000048, 0xffffffb8, 0x00002fd0, 0xffffd030, 0x00003fe0, 0xffffc020, 0xffffe040,
- 0x00001fc0, 0x00006828, 0xffff97d8, 0x00002868, 0xffffd798, 0x00007048, 0xffff8fb8, 0x00004870,
- 0xffffb790, 0x000057e8, 0xffffa818, 0xffffe858, 0x000017a8, 0x00007010, 0xffff8ff0, 0x00001070,
- 0xffffef90, 0x00007878, 0xffff8788, 0x000057b8, 0xffffa848, 0xffffb858, 0x000047a8, 0x000077c8,
- 0xffff8838, 0xffffc878, 0x00003788, 0x00003030, 0xffffcfd0, 0x00005858, 0xffffa7a8, 0x00000000,
- 0x08080000, 0xf7f80000, 0x08000000, 0xf8000000, 0x00080000, 0xfff80000, 0x10100000, 0xeff00000,
- 0x10080000, 0xeff80000, 0x08100000, 0x00000808, 0x08080808, 0xf7f80808, 0x08000808, 0xf8000808,
- 0x00080808, 0xfff80808, 0x10100808, 0xeff00808, 0x10080808, 0xeff80808, 0x08100808, 0xfffff7f8,
- 0x0807f7f8, 0xf7f7f7f8, 0x07fff7f8, 0xf7fff7f8, 0x0007f7f8, 0xfff7f7f8, 0x100ff7f8, 0xefeff7f8,
- 0x1007f7f8, 0xeff7f7f8, 0x080ff7f8, 0x00000800, 0x08080800, 0xf7f80800, 0x08000800, 0xf8000800,
- 0x00080800, 0xfff80800, 0x10100800, 0xeff00800, 0x10080800, 0xeff80800, 0x08100800, 0xfffff800,
- 0x0807f800, 0xf7f7f800, 0x07fff800, 0xf7fff800, 0x0007f800, 0xfff7f800, 0x100ff800, 0xefeff800,
- 0x1007f800, 0xeff7f800, 0x080ff800, 0x00000008, 0x08080008, 0xf7f80008, 0x08000008, 0xf8000008,
- 0x00080008, 0xfff80008, 0x10100008, 0xeff00008, 0x10080008, 0xeff80008, 0x08100008, 0xfffffff8,
- 0x0807fff8, 0xf7f7fff8, 0x07fffff8, 0xf7fffff8, 0x0007fff8, 0xfff7fff8, 0x100ffff8, 0xefeffff8,
- 0x1007fff8, 0xeff7fff8, 0x080ffff8, 0x00001010, 0x08081010, 0xf7f81010, 0x08001010, 0xf8001010,
- 0x00081010, 0xfff81010, 0x10101010, 0xeff01010, 0x10081010, 0xeff81010, 0x08101010, 0xffffeff0,
- 0x0807eff0, 0xf7f7eff0, 0x07ffeff0, 0xf7ffeff0, 0x0007eff0, 0xfff7eff0, 0x100feff0, 0xefefeff0,
- 0x1007eff0, 0xeff7eff0, 0x080feff0, 0x00001008, 0x08081008, 0xf7f81008, 0x08001008, 0xf8001008,
- 0x00081008, 0xfff81008, 0x10101008, 0xeff01008, 0x10081008, 0xeff81008, 0x08101008, 0xffffeff8,
- 0x0807eff8, 0xf7f7eff8, 0x07ffeff8, 0xf7ffeff8, 0x0007eff8, 0xfff7eff8, 0x100feff8, 0xefefeff8,
- 0x1007eff8, 0xeff7eff8, 0x080feff8, 0x00000810, 0x08080810, 0xf7f80810, 0x08000810, 0xf8000810,
- 0x00080810, 0xfff80810, 0x10100810, 0xeff00810, 0x10080810, 0xeff80810, 0x08100810, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000909, 0xfffff6f7, 0x00000900, 0xfffff700, 0x00000009, 0xfffffff7, 0x00001212,
- 0xffffedee, 0x00001b09, 0xffffe4f7, 0x0000091b, 0xfffff6e5, 0x000011ee, 0xffffee12, 0x00001af7,
- 0xffffe509, 0xfffff71b, 0x000008e5, 0x00002412, 0xffffdbee, 0x00001224, 0xffffeddc, 0x00002424,
- 0xffffdbdc, 0x00002d00, 0xffffd300, 0x0000002d, 0xffffffd3, 0x000023e5, 0xffffdc1b, 0xffffe524,
- 0x00001adc, 0x0000482d, 0xffffb7d3, 0x00002d48, 0xffffd2b8, 0x000035ee, 0xffffca12, 0xffffee36,
- 0x000011ca, 0x00004812, 0xffffb7ee, 0x00001248, 0xffffedb8, 0x00004848, 0xffffb7b8, 0x00005100,
- 0xffffaf00, 0x00000051, 0xffffffaf, 0x000035ca, 0xffffca36, 0x000047dc, 0xffffb824, 0xffffdc48,
- 0x000023b8, 0x0000752d, 0xffff8ad3, 0x00002d75, 0xffffd28b, 0x00007e51, 0xffff81af, 0x0000517e,
- 0xffffae82, 0x000062e5, 0xffff9d1b, 0xffffe563, 0x00001a9d, 0x000062af, 0xffff9d51, 0xffffaf63,
- 0x0000509d, 0x00003636, 0xffffc9ca, 0x00006c6c, 0xffff9394, 0x00000000, 0x09090000, 0xf6f70000,
- 0x09000000, 0xf7000000, 0x00090000, 0xfff70000, 0x12120000, 0xedee0000, 0x1b090000, 0xe4f70000,
- 0x091b0000, 0xf6e50000, 0x00000909, 0x09090909, 0xf6f70909, 0x09000909, 0xf7000909, 0x00090909,
- 0xfff70909, 0x12120909, 0xedee0909, 0x1b090909, 0xe4f70909, 0x091b0909, 0xf6e50909, 0xfffff6f7,
- 0x0908f6f7, 0xf6f6f6f7, 0x08fff6f7, 0xf6fff6f7, 0x0008f6f7, 0xfff6f6f7, 0x1211f6f7, 0xededf6f7,
- 0x1b08f6f7, 0xe4f6f6f7, 0x091af6f7, 0xf6e4f6f7, 0x00000900, 0x09090900, 0xf6f70900, 0x09000900,
- 0xf7000900, 0x00090900, 0xfff70900, 0x12120900, 0xedee0900, 0x1b090900, 0xe4f70900, 0x091b0900,
- 0xf6e50900, 0xfffff700, 0x0908f700, 0xf6f6f700, 0x08fff700, 0xf6fff700, 0x0008f700, 0xfff6f700,
- 0x1211f700, 0xededf700, 0x1b08f700, 0xe4f6f700, 0x091af700, 0xf6e4f700, 0x00000009, 0x09090009,
- 0xf6f70009, 0x09000009, 0xf7000009, 0x00090009, 0xfff70009, 0x12120009, 0xedee0009, 0x1b090009,
- 0xe4f70009, 0x091b0009, 0xf6e50009, 0xfffffff7, 0x0908fff7, 0xf6f6fff7, 0x08fffff7, 0xf6fffff7,
- 0x0008fff7, 0xfff6fff7, 0x1211fff7, 0xededfff7, 0x1b08fff7, 0xe4f6fff7, 0x091afff7, 0xf6e4fff7,
- 0x00001212, 0x09091212, 0xf6f71212, 0x09001212, 0xf7001212, 0x00091212, 0xfff71212, 0x12121212,
- 0xedee1212, 0x1b091212, 0xe4f71212, 0x091b1212, 0xf6e51212, 0xffffedee, 0x0908edee, 0xf6f6edee,
- 0x08ffedee, 0xf6ffedee, 0x0008edee, 0xfff6edee, 0x1211edee, 0xedededee, 0x1b08edee, 0xe4f6edee,
- 0x091aedee, 0xf6e4edee, 0x00001b09, 0x09091b09, 0xf6f71b09, 0x09001b09, 0xf7001b09, 0x00091b09,
- 0xfff71b09, 0x12121b09, 0xedee1b09, 0x1b091b09, 0xe4f71b09, 0x091b1b09, 0xf6e51b09, 0xffffe4f7,
- 0x0908e4f7, 0xf6f6e4f7, 0x08ffe4f7, 0xf6ffe4f7, 0x0008e4f7, 0xfff6e4f7, 0x1211e4f7, 0xedede4f7,
- 0x1b08e4f7, 0xe4f6e4f7, 0x091ae4f7, 0xf6e4e4f7, 0x0000091b, 0x0909091b, 0xf6f7091b, 0x0900091b,
- 0xf700091b, 0x0009091b, 0xfff7091b, 0x1212091b, 0xedee091b, 0x1b09091b, 0xe4f7091b, 0x091b091b,
- 0xf6e5091b, 0xfffff6e5, 0x0908f6e5, 0xf6f6f6e5, 0x08fff6e5, 0xf6fff6e5, 0x0008f6e5, 0xfff6f6e5,
- 0x1211f6e5, 0xededf6e5, 0x1b08f6e5, 0xe4f6f6e5, 0x091af6e5, 0xf6e4f6e5, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
- 0xfffff9fa, 0x00000700, 0xfffff900, 0x00000007, 0xfffffff9, 0x000004fb, 0xfffffb05, 0xfffffb05,
- 0x000004fb, 0x00000b06, 0xfffff4fa, 0x0000060b, 0xfffff9f5, 0x00000800, 0xfffff800, 0x00000008,
- 0xfffffff8, 0x00000b0b, 0xfffff4f5, 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x0000110c,
- 0xffffeef4, 0x00000c11, 0xfffff3ef, 0x00001111, 0xffffeeef, 0x00001206, 0xffffedfa, 0x00000612,
- 0xfffff9ee, 0x00000af8, 0xfffff508, 0xfffff80b, 0x000007f5, 0x00000f00, 0xfffff100, 0x0000000f,
- 0xfffffff1, 0x00001400, 0xffffec00, 0x00000014, 0xffffffec, 0x00001912, 0xffffe6ee, 0x00001219,
- 0xffffede7, 0x0000190b, 0xffffe6f5, 0x00000b19, 0xfffff4e7, 0x00001919, 0xffffe6e7, 0x00000df2,
- 0xfffff20e, 0xfffff20e, 0x00000df2, 0x00001a00, 0xffffe600, 0x0000001a, 0xffffffe6, 0x000011f5,
- 0xffffee0b, 0xfffff512, 0x00000aee, 0x000015f9, 0xffffea07, 0xfffff916, 0x000006ea, 0x0000221a,
- 0xffffdde6, 0x00001a22, 0xffffe5de, 0x00002212, 0xffffddee, 0x00001222, 0xffffedde, 0x00002222,
- 0xffffddde, 0x0000230b, 0xffffdcf5, 0x00000b23, 0xfffff4dd, 0x00001d00, 0xffffe300, 0x0000001d,
- 0xffffffe3, 0x000015ed, 0xffffea13, 0xffffed16, 0x000012ea, 0x000019f1, 0xffffe60f, 0xfffff11a,
- 0x00000ee6, 0x00002500, 0xffffdb00, 0x00000025, 0xffffffdb, 0x00002c1b, 0xffffd3e5, 0x00001b2c,
- 0xffffe4d4, 0x00002c24, 0xffffd3dc, 0x0000242c, 0xffffdbd4, 0x00002c12, 0xffffd3ee, 0x0000122c,
- 0xffffedd4, 0x000020f6, 0xffffdf0a, 0xfffff621, 0x000009df, 0x00002d2d, 0xffffd2d3, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
- 0xfffff9fa, 0x00000700, 0xfffff900, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020300, 0x0201fd00,
- 0x02020003, 0x0201fffd, 0x02020606, 0x0201f9fa, 0x02020700, 0x0201f900, 0xfdfe0000, 0xfdfe0202,
- 0xfdfdfdfe, 0xfdfe0300, 0xfdfdfd00, 0xfdfe0003, 0xfdfdfffd, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0700,
- 0xfdfdf900, 0x03000000, 0x03000202, 0x02fffdfe, 0x03000300, 0x02fffd00, 0x03000003, 0x02fffffd,
- 0x03000606, 0x02fff9fa, 0x03000700, 0x02fff900, 0xfd000000, 0xfd000202, 0xfcfffdfe, 0xfd000300,
- 0xfcfffd00, 0xfd000003, 0xfcfffffd, 0xfd000606, 0xfcfff9fa, 0xfd000700, 0xfcfff900, 0x00030000,
- 0x00030202, 0x0002fdfe, 0x00030300, 0x0002fd00, 0x00030003, 0x0002fffd, 0x00030606, 0x0002f9fa,
- 0x00030700, 0x0002f900, 0xfffd0000, 0xfffd0202, 0xfffcfdfe, 0xfffd0300, 0xfffcfd00, 0xfffd0003,
- 0xfffcfffd, 0xfffd0606, 0xfffcf9fa, 0xfffd0700, 0xfffcf900, 0x06060000, 0x06060202, 0x0605fdfe,
- 0x06060300, 0x0605fd00, 0x06060003, 0x0605fffd, 0x06060606, 0x0605f9fa, 0x06060700, 0x0605f900,
- 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0300, 0xf9f9fd00, 0xf9fa0003, 0xf9f9fffd, 0xf9fa0606,
- 0xf9f9f9fa, 0xf9fa0700, 0xf9f9f900, 0x07000000, 0x07000202, 0x06fffdfe, 0x07000300, 0x06fffd00,
- 0x07000003, 0x06fffffd, 0x07000606, 0x06fff9fa, 0x07000700, 0x06fff900, 0xf9000000, 0xf9000202,
- 0xf8fffdfe, 0xf9000300, 0xf8fffd00, 0xf9000003, 0xf8fffffd, 0xf9000606, 0xf8fff9fa, 0xf9000700,
- 0xf8fff900, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000202, 0xfffffdfe, 0x00000606,
- 0xfffff9fa, 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x000003fc, 0xfffffc04, 0xfffffa0a,
- 0x000005f6, 0xfffff400, 0x00000c00, 0xfffff3fa, 0xfffff406, 0x00000bfa, 0x00000c06, 0xfffffff2,
- 0x0000000e, 0x00000c0c, 0xfffff3f4, 0xffffee00, 0x00001200, 0xfffff40e, 0x00000bf2, 0xfffff9ee,
- 0xfffffa12, 0x000005ee, 0x00000612, 0xffffedf6, 0xffffee0a, 0x000011f6, 0x0000120a, 0xffffffea,
- 0x00000016, 0xffffe800, 0x00001800, 0xfffff3ea, 0xfffff416, 0x00000bea, 0x00000c16, 0xffffe7f8,
- 0xffffe808, 0x000017f8, 0x00001808, 0xfffff9e6, 0xfffffa1a, 0x000005e6, 0x0000061a, 0xffffffe4,
- 0x0000001c, 0x00001414, 0xffffebec, 0xffffe5f2, 0x00001a0e, 0xfffff3e2, 0x00000c1e, 0xffffdff6,
- 0x0000200a, 0xffffdfee, 0x00002012, 0xffffe5e6, 0x00001a1a, 0xffffebde, 0x00001422, 0xfffff3da,
- 0x00000c26, 0xffffdfe0, 0x00002020, 0x00002020, 0xffffd7ea, 0xffffddde, 0x00002222, 0x00000000,
- 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa,
- 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x02000000, 0x02000200, 0x01fffe00, 0x02000002,
- 0x01fffffe, 0x02000202, 0x01fffdfe, 0x02000606, 0x01fff9fa, 0x02000600, 0x01fffa00, 0x02000006,
- 0x01fffffa, 0xfe000000, 0xfe000200, 0xfdfffe00, 0xfe000002, 0xfdfffffe, 0xfe000202, 0xfdfffdfe,
- 0xfe000606, 0xfdfff9fa, 0xfe000600, 0xfdfffa00, 0xfe000006, 0xfdfffffa, 0x00020000, 0x00020200,
- 0x0001fe00, 0x00020002, 0x0001fffe, 0x00020202, 0x0001fdfe, 0x00020606, 0x0001f9fa, 0x00020600,
- 0x0001fa00, 0x00020006, 0x0001fffa, 0xfffe0000, 0xfffe0200, 0xfffdfe00, 0xfffe0002, 0xfffdfffe,
- 0xfffe0202, 0xfffdfdfe, 0xfffe0606, 0xfffdf9fa, 0xfffe0600, 0xfffdfa00, 0xfffe0006, 0xfffdfffa,
- 0x02020000, 0x02020200, 0x0201fe00, 0x02020002, 0x0201fffe, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020600, 0x0201fa00, 0x02020006, 0x0201fffa, 0xfdfe0000, 0xfdfe0200, 0xfdfdfe00,
- 0xfdfe0002, 0xfdfdfffe, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0600, 0xfdfdfa00,
- 0xfdfe0006, 0xfdfdfffa, 0x06060000, 0x06060200, 0x0605fe00, 0x06060002, 0x0605fffe, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060600, 0x0605fa00, 0x06060006, 0x0605fffa, 0xf9fa0000,
- 0xf9fa0200, 0xf9f9fe00, 0xf9fa0002, 0xf9f9fffe, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0600, 0xf9f9fa00, 0xf9fa0006, 0xf9f9fffa, 0x06000000, 0x06000200, 0x05fffe00, 0x06000002,
- 0x05fffffe, 0x06000202, 0x05fffdfe, 0x06000606, 0x05fff9fa, 0x06000600, 0x05fffa00, 0x06000006,
- 0x05fffffa, 0xfa000000, 0xfa000200, 0xf9fffe00, 0xfa000002, 0xf9fffffe, 0xfa000202, 0xf9fffdfe,
- 0xfa000606, 0xf9fff9fa, 0xfa000600, 0xf9fffa00, 0xfa000006, 0xf9fffffa, 0x00060000, 0x00060200,
- 0x0005fe00, 0x00060002, 0x0005fffe, 0x00060202, 0x0005fdfe, 0x00060606, 0x0005f9fa, 0x00060600,
- 0x0005fa00, 0x00060006, 0x0005fffa, 0xfffa0000, 0xfffa0200, 0xfff9fe00, 0xfffa0002, 0xfff9fffe,
- 0xfffa0202, 0xfff9fdfe, 0xfffa0606, 0xfff9f9fa, 0xfffa0600, 0xfff9fa00, 0xfffa0006, 0xfff9fffa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404, 0xfffffbfc, 0x00000a0a,
- 0xfffff5f6, 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x000005fa, 0xfffffa06, 0xfffff80e,
- 0x000007f2, 0xffffffee, 0x00000012, 0xfffff00a, 0x00000ff6, 0xffffe800, 0x00001800, 0xfffff7e8,
- 0xfffff818, 0x000007e8, 0x00000818, 0x00001212, 0xffffedee, 0xfffff014, 0x00000fec, 0xffffe5f2,
- 0xffffe60e, 0x000019f2, 0x00001a0e, 0xffffffe2, 0x0000001e, 0xffffde00, 0x00002200, 0xfffff7de,
- 0xfffff822, 0x000007de, 0x00000822, 0xffffede2, 0xffffee1e, 0x000011e2, 0x0000121e, 0xffffddf6,
- 0xffffde0a, 0x000021f6, 0x0000220a, 0xffffddec, 0x00002214, 0xffffffd8, 0x00000028, 0x00001e1e,
- 0xffffe1e2, 0xffffedd8, 0x00001228, 0xffffd400, 0x00002c00, 0xffffd3f0, 0x00002c10, 0xffffdbdc,
- 0xffffdbdc, 0x00002424, 0xffffd3e6, 0x00002c1a, 0xffffe5d2, 0x00001a2e, 0xffffedcc, 0x00001234,
- 0xffffc9ec, 0xffffd3d4, 0x00002c2c, 0xffffc9e0, 0xffffd1d2, 0xffffd1d2, 0x00002e2e, 0x00000000,
- 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404, 0xfffffbfc, 0x00000a0a, 0xfffff5f6,
- 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x02000000, 0x02000200, 0x01fffe00, 0x02000002,
- 0x01fffffe, 0x02000404, 0x01fffbfc, 0x02000a0a, 0x01fff5f6, 0x02000a00, 0x01fff600, 0x0200000a,
- 0x01fffff6, 0xfe000000, 0xfe000200, 0xfdfffe00, 0xfe000002, 0xfdfffffe, 0xfe000404, 0xfdfffbfc,
- 0xfe000a0a, 0xfdfff5f6, 0xfe000a00, 0xfdfff600, 0xfe00000a, 0xfdfffff6, 0x00020000, 0x00020200,
- 0x0001fe00, 0x00020002, 0x0001fffe, 0x00020404, 0x0001fbfc, 0x00020a0a, 0x0001f5f6, 0x00020a00,
- 0x0001f600, 0x0002000a, 0x0001fff6, 0xfffe0000, 0xfffe0200, 0xfffdfe00, 0xfffe0002, 0xfffdfffe,
- 0xfffe0404, 0xfffdfbfc, 0xfffe0a0a, 0xfffdf5f6, 0xfffe0a00, 0xfffdf600, 0xfffe000a, 0xfffdfff6,
- 0x04040000, 0x04040200, 0x0403fe00, 0x04040002, 0x0403fffe, 0x04040404, 0x0403fbfc, 0x04040a0a,
- 0x0403f5f6, 0x04040a00, 0x0403f600, 0x0404000a, 0x0403fff6, 0xfbfc0000, 0xfbfc0200, 0xfbfbfe00,
- 0xfbfc0002, 0xfbfbfffe, 0xfbfc0404, 0xfbfbfbfc, 0xfbfc0a0a, 0xfbfbf5f6, 0xfbfc0a00, 0xfbfbf600,
- 0xfbfc000a, 0xfbfbfff6, 0x0a0a0000, 0x0a0a0200, 0x0a09fe00, 0x0a0a0002, 0x0a09fffe, 0x0a0a0404,
- 0x0a09fbfc, 0x0a0a0a0a, 0x0a09f5f6, 0x0a0a0a00, 0x0a09f600, 0x0a0a000a, 0x0a09fff6, 0xf5f60000,
- 0xf5f60200, 0xf5f5fe00, 0xf5f60002, 0xf5f5fffe, 0xf5f60404, 0xf5f5fbfc, 0xf5f60a0a, 0xf5f5f5f6,
- 0xf5f60a00, 0xf5f5f600, 0xf5f6000a, 0xf5f5fff6, 0x0a000000, 0x0a000200, 0x09fffe00, 0x0a000002,
- 0x09fffffe, 0x0a000404, 0x09fffbfc, 0x0a000a0a, 0x09fff5f6, 0x0a000a00, 0x09fff600, 0x0a00000a,
- 0x09fffff6, 0xf6000000, 0xf6000200, 0xf5fffe00, 0xf6000002, 0xf5fffffe, 0xf6000404, 0xf5fffbfc,
- 0xf6000a0a, 0xf5fff5f6, 0xf6000a00, 0xf5fff600, 0xf600000a, 0xf5fffff6, 0x000a0000, 0x000a0200,
- 0x0009fe00, 0x000a0002, 0x0009fffe, 0x000a0404, 0x0009fbfc, 0x000a0a0a, 0x0009f5f6, 0x000a0a00,
- 0x0009f600, 0x000a000a, 0x0009fff6, 0xfff60000, 0xfff60200, 0xfff5fe00, 0xfff60002, 0xfff5fffe,
- 0xfff60404, 0xfff5fbfc, 0xfff60a0a, 0xfff5f5f6, 0xfff60a00, 0xfff5f600, 0xfff6000a, 0xfff5fff6,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000404, 0xfffffbfc, 0x00000c0c,
- 0xfffff3f4, 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x000007f8, 0xfffff808, 0xfffff008,
- 0x00000ff8, 0xffffe800, 0x00001800, 0xfffff7e8, 0xfffff818, 0x000007e8, 0x00000818, 0xfffff014,
- 0x00000fec, 0xffffffe4, 0x0000001c, 0xffffe7f0, 0xffffe810, 0x000017f0, 0x00001810, 0xffffe000,
- 0x00002000, 0xffffefe4, 0xfffff01c, 0x00000fe4, 0x0000101c, 0xffffdff8, 0xffffe008, 0xfffff7e0,
- 0xfffff820, 0x000007e0, 0x00000820, 0x00001ff8, 0x00002008, 0x00001818, 0xffffe7e8, 0xffffe818,
- 0x000017e8, 0xffffdfec, 0x00002014, 0xffffffd8, 0x00000028, 0xffffefd8, 0x00001028, 0xffffd400,
- 0xffffd400, 0xffffffd4, 0x0000002c, 0x00002c00, 0x00002c00, 0xffffdfe0, 0x00002020, 0xffffd3f0,
- 0x00002c10, 0xffffd3e8, 0xffffe7d4, 0x0000182c, 0x00002c18, 0xffffefd0, 0x00001030, 0xffffdbdc,
- 0xffffdbdc, 0x00002424, 0x00002424, 0xffffcbec, 0x00002828, 0xffffd7d8, 0xffffcbe0, 0x00000000,
- 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000404, 0xfffffbfc, 0x00000c0c, 0xfffff3f4,
- 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x04000000, 0x04000400, 0x03fffc00, 0x04000004,
- 0x03fffffc, 0x04000404, 0x03fffbfc, 0x04000c0c, 0x03fff3f4, 0x04000c00, 0x03fff400, 0x0400000c,
- 0x03fffff4, 0xfc000000, 0xfc000400, 0xfbfffc00, 0xfc000004, 0xfbfffffc, 0xfc000404, 0xfbfffbfc,
- 0xfc000c0c, 0xfbfff3f4, 0xfc000c00, 0xfbfff400, 0xfc00000c, 0xfbfffff4, 0x00040000, 0x00040400,
- 0x0003fc00, 0x00040004, 0x0003fffc, 0x00040404, 0x0003fbfc, 0x00040c0c, 0x0003f3f4, 0x00040c00,
- 0x0003f400, 0x0004000c, 0x0003fff4, 0xfffc0000, 0xfffc0400, 0xfffbfc00, 0xfffc0004, 0xfffbfffc,
- 0xfffc0404, 0xfffbfbfc, 0xfffc0c0c, 0xfffbf3f4, 0xfffc0c00, 0xfffbf400, 0xfffc000c, 0xfffbfff4,
- 0x04040000, 0x04040400, 0x0403fc00, 0x04040004, 0x0403fffc, 0x04040404, 0x0403fbfc, 0x04040c0c,
- 0x0403f3f4, 0x04040c00, 0x0403f400, 0x0404000c, 0x0403fff4, 0xfbfc0000, 0xfbfc0400, 0xfbfbfc00,
- 0xfbfc0004, 0xfbfbfffc, 0xfbfc0404, 0xfbfbfbfc, 0xfbfc0c0c, 0xfbfbf3f4, 0xfbfc0c00, 0xfbfbf400,
- 0xfbfc000c, 0xfbfbfff4, 0x0c0c0000, 0x0c0c0400, 0x0c0bfc00, 0x0c0c0004, 0x0c0bfffc, 0x0c0c0404,
- 0x0c0bfbfc, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c0c00, 0x0c0bf400, 0x0c0c000c, 0x0c0bfff4, 0xf3f40000,
- 0xf3f40400, 0xf3f3fc00, 0xf3f40004, 0xf3f3fffc, 0xf3f40404, 0xf3f3fbfc, 0xf3f40c0c, 0xf3f3f3f4,
- 0xf3f40c00, 0xf3f3f400, 0xf3f4000c, 0xf3f3fff4, 0x0c000000, 0x0c000400, 0x0bfffc00, 0x0c000004,
- 0x0bfffffc, 0x0c000404, 0x0bfffbfc, 0x0c000c0c, 0x0bfff3f4, 0x0c000c00, 0x0bfff400, 0x0c00000c,
- 0x0bfffff4, 0xf4000000, 0xf4000400, 0xf3fffc00, 0xf4000004, 0xf3fffffc, 0xf4000404, 0xf3fffbfc,
- 0xf4000c0c, 0xf3fff3f4, 0xf4000c00, 0xf3fff400, 0xf400000c, 0xf3fffff4, 0x000c0000, 0x000c0400,
- 0x000bfc00, 0x000c0004, 0x000bfffc, 0x000c0404, 0x000bfbfc, 0x000c0c0c, 0x000bf3f4, 0x000c0c00,
- 0x000bf400, 0x000c000c, 0x000bfff4, 0xfff40000, 0xfff40400, 0xfff3fc00, 0xfff40004, 0xfff3fffc,
- 0xfff40404, 0xfff3fbfc, 0xfff40c0c, 0xfff3f3f4, 0xfff40c00, 0xfff3f400, 0xfff4000c, 0xfff3fff4,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
- 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
- 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
- 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
- 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
- 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
- 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
- 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
- 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
- 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
- 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
- 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
- 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
- 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
- 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
- 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
- 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
- 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
- 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
- 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
- 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
- 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x000002ff, 0xfffffd01, 0xffffff03, 0x000000fd, 0x00000404,
+ 0xfffffbfc, 0x00000501, 0xfffffaff, 0x00000105, 0xfffffefb, 0x000003fc, 0xfffffc04, 0x000005fe,
+ 0xfffffa02, 0xfffffe06, 0x000001fa, 0x00000904, 0xfffff6fc, 0x00000409, 0xfffffbf7, 0x00000909,
+ 0xfffff6f7, 0x00000a01, 0xfffff5ff, 0x0000010a, 0xfffffef6, 0x000007fb, 0xfffff805, 0xfffffb08,
+ 0x000004f8, 0x00000f09, 0xfffff0f7, 0x0000090f, 0xfffff6f1, 0x00000bfd, 0xfffff403, 0xfffffd0c,
+ 0x000002f4, 0x00001004, 0xffffeffc, 0x00000410, 0xfffffbf0, 0x00001010, 0xffffeff0, 0x00001200,
+ 0xffffee00, 0x00000012, 0xffffffee, 0x00000bf4, 0xfffff40c, 0x00000ff7, 0xfffff009, 0xfffff710,
+ 0x000008f0, 0x00001b0b, 0xffffe4f5, 0x00000b1b, 0xfffff4e5, 0x00001c13, 0xffffe3ed, 0x0000131c,
+ 0xffffece4, 0x000015fa, 0xffffea06, 0xfffffa16, 0x000005ea, 0x00001d04, 0xffffe2fc, 0x0000041d,
+ 0xfffffbe3, 0x00001e1e, 0xffffe1e2, 0x000020fe, 0xffffdf02, 0xfffffe21, 0x000001df, 0x000016ee,
+ 0xffffe912, 0xffffee17, 0x000011e9, 0x00001df1, 0xffffe20f, 0xfffff11e, 0x00000ee2, 0x00002e16,
+ 0xffffd1ea, 0x0000162e, 0xffffe9d2, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003123,
+ 0xffffcedd, 0x00002331, 0xffffdccf, 0x000028f5, 0xffffd70b, 0xfffff529, 0x00000ad7, 0x00003304,
+ 0xffffccfc, 0x00000433, 0xfffffbcd, 0x00003636, 0xffffc9ca, 0x000021de, 0xffffde22, 0x000029e3,
+ 0xffffd61d, 0xffffe32a, 0x00001cd6, 0x00003bfa, 0xffffc406, 0xfffffa3c, 0x000005c4, 0x00004c1b,
+ 0xffffb3e5, 0x00001b4c, 0xffffe4b4, 0x00004d2b, 0xffffb2d5, 0x00002b4d, 0xffffd4b3, 0x000036e8,
+ 0xffffc918, 0xffffe837, 0x000017c9, 0x00004f0e, 0xffffb0f2, 0x00000e4f, 0xfffff1b1, 0x0000533f,
+ 0xffffacc1, 0x00003f53, 0xffffc0ad, 0x000049ec, 0xffffb614, 0xffffec4a, 0x000013b6, 0x00005802,
+ 0xffffa7fe, 0x00000258, 0xfffffda8, 0x00005d5d, 0xffffa2a3, 0x00003ccc, 0xffffc334, 0xffffcc3d,
+ 0x000033c3, 0x00007834, 0xffff87cc, 0x00003478, 0xffffcb88, 0x00004ad3, 0xffffb52d, 0xffffd34b,
+ 0x00002cb5, 0x00007d4b, 0xffff82b5, 0x00004b7d, 0xffffb483, 0x00007a21, 0xffff85df, 0x0000217a,
+ 0xffffde86, 0x000066f3, 0xffff990d, 0xfffff367, 0x00000c99, 0x00005fd8, 0xffffa028, 0xffffd860,
+ 0x000027a0, 0x00007ede, 0xffff8122, 0xffffde7f, 0x00002181, 0x000058a7, 0xffffa759, 0x000068b2,
+ 0xffff974e, 0xffffb269, 0x00004d97, 0x00000c0c, 0xfffff3f4, 0x00001717, 0xffffe8e9, 0x00002a2a,
+ 0xffffd5d6, 0x00004949, 0xffffb6b7, 0x00000000, 0x02020000, 0xfdfe0000, 0x02ff0000, 0xfd010000,
+ 0xff030000, 0x00fd0000, 0x00000202, 0x02020202, 0xfdfe0202, 0x02ff0202, 0xfd010202, 0xff030202,
+ 0x00fd0202, 0xfffffdfe, 0x0201fdfe, 0xfdfdfdfe, 0x02fefdfe, 0xfd00fdfe, 0xff02fdfe, 0x00fcfdfe,
+ 0x000002ff, 0x020202ff, 0xfdfe02ff, 0x02ff02ff, 0xfd0102ff, 0xff0302ff, 0x00fd02ff, 0xfffffd01,
+ 0x0201fd01, 0xfdfdfd01, 0x02fefd01, 0xfd00fd01, 0xff02fd01, 0x00fcfd01, 0xffffff03, 0x0201ff03,
+ 0xfdfdff03, 0x02feff03, 0xfd00ff03, 0xff02ff03, 0x00fcff03, 0x000000fd, 0x020200fd, 0xfdfe00fd,
+ 0x02ff00fd, 0xfd0100fd, 0xff0300fd, 0x00fd00fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000303, 0xfffffcfd, 0x000003ff, 0xfffffc01, 0xffffff04, 0x000000fc, 0x00000707,
+ 0xfffff8f9, 0x00000802, 0xfffff7fe, 0x00000208, 0xfffffdf8, 0x000008fe, 0xfffff702, 0xfffffe09,
+ 0x000001f7, 0x000005fa, 0xfffffa06, 0x00000d06, 0xfffff2fa, 0x0000060d, 0xfffff9f3, 0x00000d0d,
+ 0xfffff2f3, 0x00000e01, 0xfffff1ff, 0x0000010e, 0xfffffef2, 0x00000bf8, 0xfffff408, 0xfffff80c,
+ 0x000007f4, 0x0000170e, 0xffffe8f2, 0x00000e17, 0xfffff1e9, 0x000011fb, 0xffffee05, 0xfffffb12,
+ 0x000004ee, 0x00001806, 0xffffe7fa, 0x00000618, 0xfffff9e8, 0x00001818, 0xffffe7e8, 0x00001aff,
+ 0xffffe501, 0xffffff1b, 0x000000e5, 0x000010ef, 0xffffef11, 0x000016f3, 0xffffe90d, 0xfffff317,
+ 0x00000ce9, 0x00002810, 0xffffd7f0, 0x00001028, 0xffffefd8, 0x0000291c, 0xffffd6e4, 0x00001c29,
+ 0xffffe3d7, 0x000020f7, 0xffffdf09, 0xfffff721, 0x000008df, 0x00002b06, 0xffffd4fa, 0x0000062b,
+ 0xfffff9d5, 0x00002e2e, 0xffffd1d2, 0x000031fc, 0xffffce04, 0xfffffc32, 0x000003ce, 0x000021e5,
+ 0xffffde1b, 0xffffe522, 0x00001ade, 0x00002cea, 0xffffd316, 0xffffea2d, 0x000015d3, 0x00004522,
+ 0xffffbade, 0x00002245, 0xffffddbb, 0x00004613, 0xffffb9ed, 0x00001346, 0xffffecba, 0x00004935,
+ 0xffffb6cb, 0x00003549, 0xffffcab7, 0x00003def, 0xffffc211, 0xffffef3e, 0x000010c2, 0x00004d05,
+ 0xffffb2fb, 0x0000054d, 0xfffffab3, 0x00005252, 0xffffadae, 0x000032cd, 0xffffcd33, 0x00003fd5,
+ 0xffffc02b, 0xffffd540, 0x00002ac0, 0x000059f6, 0xffffa60a, 0xfffff65a, 0x000009a6, 0x00007229,
+ 0xffff8dd7, 0x00002972, 0xffffd68e, 0x00007440, 0xffff8bc0, 0x00004074, 0xffffbf8c, 0x000051db,
+ 0xffffae25, 0xffffdb52, 0x000024ae, 0x00007716, 0xffff88ea, 0x00001677, 0xffffe989, 0x00007c5f,
+ 0xffff83a1, 0x00005f7c, 0xffffa084, 0x00006ee2, 0xffff911e, 0xffffe26f, 0x00001d91, 0x00005bb2,
+ 0xffffa44e, 0xffffb25c, 0x00004da4, 0x000070bc, 0xffff8f44, 0xffffbc71, 0x0000438f, 0x00001212,
+ 0xffffedee, 0x00002222, 0xffffddde, 0x00003f3f, 0xffffc0c1, 0x00006d6d, 0xffff9293, 0x00000000,
+ 0x03030000, 0xfcfd0000, 0x03ff0000, 0xfc010000, 0xff040000, 0x00fc0000, 0x07070000, 0xf8f90000,
+ 0x00000303, 0x03030303, 0xfcfd0303, 0x03ff0303, 0xfc010303, 0xff040303, 0x00fc0303, 0x07070303,
+ 0xf8f90303, 0xfffffcfd, 0x0302fcfd, 0xfcfcfcfd, 0x03fefcfd, 0xfc00fcfd, 0xff03fcfd, 0x00fbfcfd,
+ 0x0706fcfd, 0xf8f8fcfd, 0x000003ff, 0x030303ff, 0xfcfd03ff, 0x03ff03ff, 0xfc0103ff, 0xff0403ff,
+ 0x00fc03ff, 0x070703ff, 0xf8f903ff, 0xfffffc01, 0x0302fc01, 0xfcfcfc01, 0x03fefc01, 0xfc00fc01,
+ 0xff03fc01, 0x00fbfc01, 0x0706fc01, 0xf8f8fc01, 0xffffff04, 0x0302ff04, 0xfcfcff04, 0x03feff04,
+ 0xfc00ff04, 0xff03ff04, 0x00fbff04, 0x0706ff04, 0xf8f8ff04, 0x000000fc, 0x030300fc, 0xfcfd00fc,
+ 0x03ff00fc, 0xfc0100fc, 0xff0400fc, 0x00fc00fc, 0x070700fc, 0xf8f900fc, 0x00000707, 0x03030707,
+ 0xfcfd0707, 0x03ff0707, 0xfc010707, 0xff040707, 0x00fc0707, 0x07070707, 0xf8f90707, 0xfffff8f9,
+ 0x0302f8f9, 0xfcfcf8f9, 0x03fef8f9, 0xfc00f8f9, 0xff03f8f9, 0x00fbf8f9, 0x0706f8f9, 0xf8f8f8f9,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000404, 0xfffffbfc, 0x000004ff, 0xfffffb01, 0xffffff05, 0x000000fb, 0x00000a03,
+ 0xfffff5fd, 0x0000030a, 0xfffffcf6, 0x00000909, 0xfffff6f7, 0x000006f9, 0xfffff907, 0x00000bfd,
+ 0xfffff403, 0xfffffd0c, 0x000002f4, 0x00001108, 0xffffeef8, 0x00000811, 0xfffff7ef, 0x00001111,
+ 0xffffeeef, 0x00001301, 0xffffecff, 0x00000113, 0xfffffeed, 0x00000ff5, 0xfffff00b, 0xfffff510,
+ 0x00000af0, 0x000016fa, 0xffffe906, 0xfffffa17, 0x000005e9, 0x00001f12, 0xffffe0ee, 0x0000121f,
+ 0xffffede1, 0x00002008, 0xffffdff8, 0x00000820, 0xfffff7e0, 0x00002121, 0xffffdedf, 0x000023ff,
+ 0xffffdc01, 0xffffff24, 0x000000dc, 0x000016e9, 0xffffe917, 0x00001eef, 0xffffe111, 0xffffef1f,
+ 0x000010e1, 0x00003615, 0xffffc9eb, 0x00001536, 0xffffeaca, 0x00003725, 0xffffc8db, 0x00002537,
+ 0xffffdac9, 0x00002bf4, 0xffffd40c, 0xfffff42c, 0x00000bd4, 0x00003908, 0xffffc6f8, 0x00000839,
+ 0xfffff7c7, 0x00003d3d, 0xffffc2c3, 0x000041fb, 0xffffbe05, 0xfffffb42, 0x000004be, 0x00002cdc,
+ 0xffffd324, 0xffffdc2d, 0x000023d3, 0x00003be3, 0xffffc41d, 0xffffe33c, 0x00001cc4, 0x00005c2d,
+ 0xffffa3d3, 0x00002d5c, 0xffffd2a4, 0x00005d19, 0xffffa2e7, 0x0000195d, 0xffffe6a3, 0x00006147,
+ 0xffff9eb9, 0x00004761, 0xffffb89f, 0x000052ea, 0xffffad16, 0xffffea53, 0x000015ad, 0x00006607,
+ 0xffff99f9, 0x00000766, 0xfffff89a, 0x00006d6d, 0xffff9293, 0x000043bc, 0xffffbc44, 0x000054c7,
+ 0xffffab39, 0xffffc755, 0x000038ab, 0x000077f3, 0xffff880d, 0xfffff378, 0x00000c88, 0x00006dcf,
+ 0xffff9231, 0xffffcf6e, 0x00003092, 0x00007a98, 0xffff8568, 0xffff987b, 0x00006785, 0x00001818,
+ 0xffffe7e8, 0x00002e2e, 0xffffd1d2, 0x00005454, 0xffffabac, 0x00000000, 0x04040000, 0xfbfc0000,
+ 0x04ff0000, 0xfb010000, 0xff050000, 0x00fb0000, 0x0a030000, 0xf5fd0000, 0x030a0000, 0x00000404,
+ 0x04040404, 0xfbfc0404, 0x04ff0404, 0xfb010404, 0xff050404, 0x00fb0404, 0x0a030404, 0xf5fd0404,
+ 0x030a0404, 0xfffffbfc, 0x0403fbfc, 0xfbfbfbfc, 0x04fefbfc, 0xfb00fbfc, 0xff04fbfc, 0x00fafbfc,
+ 0x0a02fbfc, 0xf5fcfbfc, 0x0309fbfc, 0x000004ff, 0x040404ff, 0xfbfc04ff, 0x04ff04ff, 0xfb0104ff,
+ 0xff0504ff, 0x00fb04ff, 0x0a0304ff, 0xf5fd04ff, 0x030a04ff, 0xfffffb01, 0x0403fb01, 0xfbfbfb01,
+ 0x04fefb01, 0xfb00fb01, 0xff04fb01, 0x00fafb01, 0x0a02fb01, 0xf5fcfb01, 0x0309fb01, 0xffffff05,
+ 0x0403ff05, 0xfbfbff05, 0x04feff05, 0xfb00ff05, 0xff04ff05, 0x00faff05, 0x0a02ff05, 0xf5fcff05,
+ 0x0309ff05, 0x000000fb, 0x040400fb, 0xfbfc00fb, 0x04ff00fb, 0xfb0100fb, 0xff0500fb, 0x00fb00fb,
+ 0x0a0300fb, 0xf5fd00fb, 0x030a00fb, 0x00000a03, 0x04040a03, 0xfbfc0a03, 0x04ff0a03, 0xfb010a03,
+ 0xff050a03, 0x00fb0a03, 0x0a030a03, 0xf5fd0a03, 0x030a0a03, 0xfffff5fd, 0x0403f5fd, 0xfbfbf5fd,
+ 0x04fef5fd, 0xfb00f5fd, 0xff04f5fd, 0x00faf5fd, 0x0a02f5fd, 0xf5fcf5fd, 0x0309f5fd, 0x0000030a,
+ 0x0404030a, 0xfbfc030a, 0x04ff030a, 0xfb01030a, 0xff05030a, 0x00fb030a, 0x0a03030a, 0xf5fd030a,
+ 0x030a030a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000505, 0xfffffafb, 0x000006fe, 0xfffff902, 0xfffffe07, 0x000001f9, 0x00000b0b,
+ 0xfffff4f5, 0x00000d03, 0xfffff2fd, 0x0000030d, 0xfffffcf3, 0x000008f7, 0xfffff709, 0x00000efc,
+ 0xfffff104, 0xfffffc0f, 0x000003f1, 0x0000160b, 0xffffe9f5, 0x00000b16, 0xfffff4ea, 0x00001515,
+ 0xffffeaeb, 0x00001802, 0xffffe7fe, 0x00000218, 0xfffffde8, 0x000013f2, 0xffffec0e, 0xfffff214,
+ 0x00000dec, 0x00002617, 0xffffd9e9, 0x00001726, 0xffffe8da, 0x00001cf8, 0xffffe308, 0xfffff81d,
+ 0x000007e3, 0x0000270b, 0xffffd8f5, 0x00000b27, 0xfffff4d9, 0x00002929, 0xffffd6d7, 0x00002cff,
+ 0xffffd301, 0xffffff2d, 0x000000d3, 0x00001ce3, 0xffffe31d, 0x000026ea, 0xffffd916, 0xffffea27,
+ 0x000015d9, 0x0000431b, 0xffffbce5, 0x00001b43, 0xffffe4bd, 0x0000452f, 0xffffbad1, 0x00002f45,
+ 0xffffd0bb, 0x000037f1, 0xffffc80f, 0xfffff138, 0x00000ec8, 0x0000470b, 0xffffb8f5, 0x00000b47,
+ 0xfffff4b9, 0x00004c4c, 0xffffb3b4, 0x000052fa, 0xffffad06, 0xfffffa53, 0x000005ad, 0x000038d3,
+ 0xffffc72d, 0xffffd339, 0x00002cc7, 0x00004adc, 0xffffb524, 0xffffdc4b, 0x000023b5, 0x00007338,
+ 0xffff8cc8, 0x00003873, 0xffffc78d, 0x0000751f, 0xffff8ae1, 0x00001f75, 0xffffe08b, 0x00007a58,
+ 0xffff85a8, 0x0000587a, 0xffffa786, 0x000067e4, 0xffff981c, 0xffffe468, 0x00001b98, 0x000054ab,
+ 0xffffab55, 0x000069b8, 0xffff9648, 0xffffb86a, 0x00004796, 0x00001e1e, 0xffffe1e2, 0x00003a3a,
+ 0xffffc5c6, 0x00006969, 0xffff9697, 0x00000000, 0x05050000, 0xfafb0000, 0x06fe0000, 0xf9020000,
+ 0xfe070000, 0x01f90000, 0x0b0b0000, 0xf4f50000, 0x0d030000, 0xf2fd0000, 0x00000505, 0x05050505,
+ 0xfafb0505, 0x06fe0505, 0xf9020505, 0xfe070505, 0x01f90505, 0x0b0b0505, 0xf4f50505, 0x0d030505,
+ 0xf2fd0505, 0xfffffafb, 0x0504fafb, 0xfafafafb, 0x06fdfafb, 0xf901fafb, 0xfe06fafb, 0x01f8fafb,
+ 0x0b0afafb, 0xf4f4fafb, 0x0d02fafb, 0xf2fcfafb, 0x000006fe, 0x050506fe, 0xfafb06fe, 0x06fe06fe,
+ 0xf90206fe, 0xfe0706fe, 0x01f906fe, 0x0b0b06fe, 0xf4f506fe, 0x0d0306fe, 0xf2fd06fe, 0xfffff902,
+ 0x0504f902, 0xfafaf902, 0x06fdf902, 0xf901f902, 0xfe06f902, 0x01f8f902, 0x0b0af902, 0xf4f4f902,
+ 0x0d02f902, 0xf2fcf902, 0xfffffe07, 0x0504fe07, 0xfafafe07, 0x06fdfe07, 0xf901fe07, 0xfe06fe07,
+ 0x01f8fe07, 0x0b0afe07, 0xf4f4fe07, 0x0d02fe07, 0xf2fcfe07, 0x000001f9, 0x050501f9, 0xfafb01f9,
+ 0x06fe01f9, 0xf90201f9, 0xfe0701f9, 0x01f901f9, 0x0b0b01f9, 0xf4f501f9, 0x0d0301f9, 0xf2fd01f9,
+ 0x00000b0b, 0x05050b0b, 0xfafb0b0b, 0x06fe0b0b, 0xf9020b0b, 0xfe070b0b, 0x01f90b0b, 0x0b0b0b0b,
+ 0xf4f50b0b, 0x0d030b0b, 0xf2fd0b0b, 0xfffff4f5, 0x0504f4f5, 0xfafaf4f5, 0x06fdf4f5, 0xf901f4f5,
+ 0xfe06f4f5, 0x01f8f4f5, 0x0b0af4f5, 0xf4f4f4f5, 0x0d02f4f5, 0xf2fcf4f5, 0x00000d03, 0x05050d03,
+ 0xfafb0d03, 0x06fe0d03, 0xf9020d03, 0xfe070d03, 0x01f90d03, 0x0b0b0d03, 0xf4f50d03, 0x0d030d03,
+ 0xf2fd0d03, 0xfffff2fd, 0x0504f2fd, 0xfafaf2fd, 0x06fdf2fd, 0xf901f2fd, 0xfe06f2fd, 0x01f8f2fd,
+ 0x0b0af2fd, 0xf4f4f2fd, 0x0d02f2fd, 0xf2fcf2fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000606, 0xfffff9fa, 0x000007fe, 0xfffff802, 0xfffffe08, 0x000001f8, 0x00000d0d,
+ 0xfffff2f3, 0x00000f04, 0xfffff0fc, 0x0000040f, 0xfffffbf1, 0x00000af5, 0xfffff50b, 0x000011fb,
+ 0xffffee05, 0xfffffb12, 0x000004ee, 0x00001a0d, 0xffffe5f3, 0x00000d1a, 0xfffff2e6, 0x00001a1a,
+ 0xffffe5e6, 0x00001d02, 0xffffe2fe, 0x0000021d, 0xfffffde3, 0x000017f0, 0xffffe810, 0xfffff018,
+ 0x00000fe8, 0x00002e1c, 0xffffd1e4, 0x00001c2e, 0xffffe3d2, 0x000022f7, 0xffffdd09, 0xfffff723,
+ 0x000008dd, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003131, 0xffffcecf, 0x000035ff,
+ 0xffffca01, 0xffffff36, 0x000000ca, 0x000022dd, 0xffffdd23, 0x00002ee6, 0xffffd11a, 0xffffe62f,
+ 0x000019d1, 0x00005120, 0xffffaee0, 0x00002051, 0xffffdfaf, 0x00005338, 0xffffacc8, 0x00003853,
+ 0xffffc7ad, 0x000042ee, 0xffffbd12, 0xffffee43, 0x000011bd, 0x0000560d, 0xffffa9f3, 0x00000d56,
+ 0xfffff2aa, 0x00005b5b, 0xffffa4a5, 0x000062f9, 0xffff9d07, 0xfffff963, 0x0000069d, 0x000043ca,
+ 0xffffbc36, 0xffffca44, 0x000035bc, 0x000059d4, 0xffffa62c, 0xffffd45a, 0x00002ba6, 0x00007bdf,
+ 0xffff8421, 0xffffdf7c, 0x00002084, 0x00006699, 0xffff9967, 0x00007eaa, 0xffff8156, 0xffffaa7f,
+ 0x00005581, 0x00002525, 0xffffdadb, 0x00004545, 0xffffbabb, 0x00000000, 0x06060000, 0xf9fa0000,
+ 0x07fe0000, 0xf8020000, 0xfe080000, 0x01f80000, 0x0d0d0000, 0xf2f30000, 0x0f040000, 0xf0fc0000,
+ 0x040f0000, 0x00000606, 0x06060606, 0xf9fa0606, 0x07fe0606, 0xf8020606, 0xfe080606, 0x01f80606,
+ 0x0d0d0606, 0xf2f30606, 0x0f040606, 0xf0fc0606, 0x040f0606, 0xfffff9fa, 0x0605f9fa, 0xf9f9f9fa,
+ 0x07fdf9fa, 0xf801f9fa, 0xfe07f9fa, 0x01f7f9fa, 0x0d0cf9fa, 0xf2f2f9fa, 0x0f03f9fa, 0xf0fbf9fa,
+ 0x040ef9fa, 0x000007fe, 0x060607fe, 0xf9fa07fe, 0x07fe07fe, 0xf80207fe, 0xfe0807fe, 0x01f807fe,
+ 0x0d0d07fe, 0xf2f307fe, 0x0f0407fe, 0xf0fc07fe, 0x040f07fe, 0xfffff802, 0x0605f802, 0xf9f9f802,
+ 0x07fdf802, 0xf801f802, 0xfe07f802, 0x01f7f802, 0x0d0cf802, 0xf2f2f802, 0x0f03f802, 0xf0fbf802,
+ 0x040ef802, 0xfffffe08, 0x0605fe08, 0xf9f9fe08, 0x07fdfe08, 0xf801fe08, 0xfe07fe08, 0x01f7fe08,
+ 0x0d0cfe08, 0xf2f2fe08, 0x0f03fe08, 0xf0fbfe08, 0x040efe08, 0x000001f8, 0x060601f8, 0xf9fa01f8,
+ 0x07fe01f8, 0xf80201f8, 0xfe0801f8, 0x01f801f8, 0x0d0d01f8, 0xf2f301f8, 0x0f0401f8, 0xf0fc01f8,
+ 0x040f01f8, 0x00000d0d, 0x06060d0d, 0xf9fa0d0d, 0x07fe0d0d, 0xf8020d0d, 0xfe080d0d, 0x01f80d0d,
+ 0x0d0d0d0d, 0xf2f30d0d, 0x0f040d0d, 0xf0fc0d0d, 0x040f0d0d, 0xfffff2f3, 0x0605f2f3, 0xf9f9f2f3,
+ 0x07fdf2f3, 0xf801f2f3, 0xfe07f2f3, 0x01f7f2f3, 0x0d0cf2f3, 0xf2f2f2f3, 0x0f03f2f3, 0xf0fbf2f3,
+ 0x040ef2f3, 0x00000f04, 0x06060f04, 0xf9fa0f04, 0x07fe0f04, 0xf8020f04, 0xfe080f04, 0x01f80f04,
+ 0x0d0d0f04, 0xf2f30f04, 0x0f040f04, 0xf0fc0f04, 0x040f0f04, 0xfffff0fc, 0x0605f0fc, 0xf9f9f0fc,
+ 0x07fdf0fc, 0xf801f0fc, 0xfe07f0fc, 0x01f7f0fc, 0x0d0cf0fc, 0xf2f2f0fc, 0x0f03f0fc, 0xf0fbf0fc,
+ 0x040ef0fc, 0x0000040f, 0x0606040f, 0xf9fa040f, 0x07fe040f, 0xf802040f, 0xfe08040f, 0x01f8040f,
+ 0x0d0d040f, 0xf2f3040f, 0x0f04040f, 0xf0fc040f, 0x040f040f, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000707, 0xfffff8f9, 0x000009fd, 0xfffff603, 0xfffffd0a, 0x000002f6, 0x00001010,
+ 0xffffeff0, 0x00001205, 0xffffedfb, 0x00000512, 0xfffffaee, 0x00000cf3, 0xfffff30d, 0x000014fa,
+ 0xffffeb06, 0xfffffa15, 0x000005eb, 0x00001e0f, 0xffffe1f1, 0x00000f1e, 0xfffff0e2, 0x00001e1e,
+ 0xffffe1e2, 0x00002202, 0xffffddfe, 0x00000222, 0xfffffdde, 0x00001bed, 0xffffe413, 0xffffed1c,
+ 0x000012e4, 0x00003620, 0xffffc9e0, 0x00002036, 0xffffdfca, 0x000028f5, 0xffffd70b, 0xfffff529,
+ 0x00000ad7, 0x0000370f, 0xffffc8f1, 0x00000f37, 0xfffff0c9, 0x00003939, 0xffffc6c7, 0x00003eff,
+ 0xffffc101, 0xffffff3f, 0x000000c1, 0x000027d8, 0xffffd828, 0x000036e2, 0xffffc91e, 0xffffe237,
+ 0x00001dc9, 0x00005e25, 0xffffa1db, 0x0000255e, 0xffffdaa2, 0x00006041, 0xffff9fbf, 0x00004160,
+ 0xffffbea0, 0x00004deb, 0xffffb215, 0xffffeb4e, 0x000014b2, 0x0000640f, 0xffff9bf1, 0x00000f64,
+ 0xfffff09c, 0x00006a6a, 0xffff9596, 0x000073f8, 0xffff8c08, 0xfffff874, 0x0000078c, 0x00004ec1,
+ 0xffffb13f, 0xffffc14f, 0x00003eb1, 0x000068cd, 0xffff9733, 0xffffcd69, 0x00003297, 0x00007788,
+ 0xffff8878, 0x00002b2b, 0xffffd4d5, 0x00005050, 0xffffafb0, 0x00000000, 0x07070000, 0xf8f90000,
+ 0x09fd0000, 0xf6030000, 0xfd0a0000, 0x02f60000, 0x10100000, 0xeff00000, 0x12050000, 0xedfb0000,
+ 0x05120000, 0x00000707, 0x07070707, 0xf8f90707, 0x09fd0707, 0xf6030707, 0xfd0a0707, 0x02f60707,
+ 0x10100707, 0xeff00707, 0x12050707, 0xedfb0707, 0x05120707, 0xfffff8f9, 0x0706f8f9, 0xf8f8f8f9,
+ 0x09fcf8f9, 0xf602f8f9, 0xfd09f8f9, 0x02f5f8f9, 0x100ff8f9, 0xefeff8f9, 0x1204f8f9, 0xedfaf8f9,
+ 0x0511f8f9, 0x000009fd, 0x070709fd, 0xf8f909fd, 0x09fd09fd, 0xf60309fd, 0xfd0a09fd, 0x02f609fd,
+ 0x101009fd, 0xeff009fd, 0x120509fd, 0xedfb09fd, 0x051209fd, 0xfffff603, 0x0706f603, 0xf8f8f603,
+ 0x09fcf603, 0xf602f603, 0xfd09f603, 0x02f5f603, 0x100ff603, 0xefeff603, 0x1204f603, 0xedfaf603,
+ 0x0511f603, 0xfffffd0a, 0x0706fd0a, 0xf8f8fd0a, 0x09fcfd0a, 0xf602fd0a, 0xfd09fd0a, 0x02f5fd0a,
+ 0x100ffd0a, 0xefeffd0a, 0x1204fd0a, 0xedfafd0a, 0x0511fd0a, 0x000002f6, 0x070702f6, 0xf8f902f6,
+ 0x09fd02f6, 0xf60302f6, 0xfd0a02f6, 0x02f602f6, 0x101002f6, 0xeff002f6, 0x120502f6, 0xedfb02f6,
+ 0x051202f6, 0x00001010, 0x07071010, 0xf8f91010, 0x09fd1010, 0xf6031010, 0xfd0a1010, 0x02f61010,
+ 0x10101010, 0xeff01010, 0x12051010, 0xedfb1010, 0x05121010, 0xffffeff0, 0x0706eff0, 0xf8f8eff0,
+ 0x09fceff0, 0xf602eff0, 0xfd09eff0, 0x02f5eff0, 0x100feff0, 0xefefeff0, 0x1204eff0, 0xedfaeff0,
+ 0x0511eff0, 0x00001205, 0x07071205, 0xf8f91205, 0x09fd1205, 0xf6031205, 0xfd0a1205, 0x02f61205,
+ 0x10101205, 0xeff01205, 0x12051205, 0xedfb1205, 0x05121205, 0xffffedfb, 0x0706edfb, 0xf8f8edfb,
+ 0x09fcedfb, 0xf602edfb, 0xfd09edfb, 0x02f5edfb, 0x100fedfb, 0xefefedfb, 0x1204edfb, 0xedfaedfb,
+ 0x0511edfb, 0x00000512, 0x07070512, 0xf8f90512, 0x09fd0512, 0xf6030512, 0xfd0a0512, 0x02f60512,
+ 0x10100512, 0xeff00512, 0x12050512, 0xedfb0512, 0x05120512, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000808, 0xfffff7f8, 0x00000afd, 0xfffff503, 0xfffffd0b, 0x000002f5, 0x00001212,
+ 0xffffedee, 0x00001405, 0xffffebfb, 0x00000514, 0xfffffaec, 0x00000ef1, 0xfffff10f, 0x000017f9,
+ 0xffffe807, 0xfffff918, 0x000006e8, 0x00002311, 0xffffdcef, 0x00001123, 0xffffeedd, 0x00002222,
+ 0xffffddde, 0x00002603, 0xffffd9fd, 0x00000326, 0xfffffcda, 0x00001fea, 0xffffe016, 0xffffea20,
+ 0x000015e0, 0x00003d25, 0xffffc2db, 0x0000253d, 0xffffdac3, 0x00002ef3, 0xffffd10d, 0xfffff32f,
+ 0x00000cd1, 0x00003f11, 0xffffc0ef, 0x0000113f, 0xffffeec1, 0x00004141, 0xffffbebf, 0x000047ff,
+ 0xffffb801, 0xffffff48, 0x000000b8, 0x00002dd2, 0xffffd22e, 0x00003edd, 0xffffc123, 0xffffdd3f,
+ 0x000022c1, 0x00006b2b, 0xffff94d5, 0x00002b6b, 0xffffd495, 0x00006e4b, 0xffff91b5, 0x00004b6e,
+ 0xffffb492, 0x000058e8, 0xffffa718, 0xffffe859, 0x000017a7, 0x00007211, 0xffff8def, 0x00001172,
+ 0xffffee8e, 0x00007979, 0xffff8687, 0x00005ab8, 0xffffa548, 0xffffb85b, 0x000047a5, 0x000077c6,
+ 0xffff883a, 0xffffc678, 0x00003988, 0x00003131, 0xffffcecf, 0x00005c5c, 0xffffa3a4, 0x00000000,
+ 0x08080000, 0xf7f80000, 0x0afd0000, 0xf5030000, 0xfd0b0000, 0x02f50000, 0x12120000, 0xedee0000,
+ 0x14050000, 0xebfb0000, 0x05140000, 0x00000808, 0x08080808, 0xf7f80808, 0x0afd0808, 0xf5030808,
+ 0xfd0b0808, 0x02f50808, 0x12120808, 0xedee0808, 0x14050808, 0xebfb0808, 0x05140808, 0xfffff7f8,
+ 0x0807f7f8, 0xf7f7f7f8, 0x0afcf7f8, 0xf502f7f8, 0xfd0af7f8, 0x02f4f7f8, 0x1211f7f8, 0xededf7f8,
+ 0x1404f7f8, 0xebfaf7f8, 0x0513f7f8, 0x00000afd, 0x08080afd, 0xf7f80afd, 0x0afd0afd, 0xf5030afd,
+ 0xfd0b0afd, 0x02f50afd, 0x12120afd, 0xedee0afd, 0x14050afd, 0xebfb0afd, 0x05140afd, 0xfffff503,
+ 0x0807f503, 0xf7f7f503, 0x0afcf503, 0xf502f503, 0xfd0af503, 0x02f4f503, 0x1211f503, 0xededf503,
+ 0x1404f503, 0xebfaf503, 0x0513f503, 0xfffffd0b, 0x0807fd0b, 0xf7f7fd0b, 0x0afcfd0b, 0xf502fd0b,
+ 0xfd0afd0b, 0x02f4fd0b, 0x1211fd0b, 0xededfd0b, 0x1404fd0b, 0xebfafd0b, 0x0513fd0b, 0x000002f5,
+ 0x080802f5, 0xf7f802f5, 0x0afd02f5, 0xf50302f5, 0xfd0b02f5, 0x02f502f5, 0x121202f5, 0xedee02f5,
+ 0x140502f5, 0xebfb02f5, 0x051402f5, 0x00001212, 0x08081212, 0xf7f81212, 0x0afd1212, 0xf5031212,
+ 0xfd0b1212, 0x02f51212, 0x12121212, 0xedee1212, 0x14051212, 0xebfb1212, 0x05141212, 0xffffedee,
+ 0x0807edee, 0xf7f7edee, 0x0afcedee, 0xf502edee, 0xfd0aedee, 0x02f4edee, 0x1211edee, 0xedededee,
+ 0x1404edee, 0xebfaedee, 0x0513edee, 0x00001405, 0x08081405, 0xf7f81405, 0x0afd1405, 0xf5031405,
+ 0xfd0b1405, 0x02f51405, 0x12121405, 0xedee1405, 0x14051405, 0xebfb1405, 0x05141405, 0xffffebfb,
+ 0x0807ebfb, 0xf7f7ebfb, 0x0afcebfb, 0xf502ebfb, 0xfd0aebfb, 0x02f4ebfb, 0x1211ebfb, 0xededebfb,
+ 0x1404ebfb, 0xebfaebfb, 0x0513ebfb, 0x00000514, 0x08080514, 0xf7f80514, 0x0afd0514, 0xf5030514,
+ 0xfd0b0514, 0x02f50514, 0x12120514, 0xedee0514, 0x14050514, 0xebfb0514, 0x05140514, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000909, 0xfffff6f7, 0x00000bfd, 0xfffff403, 0xfffffd0c, 0x000002f4, 0x00001414,
+ 0xffffebec, 0x00001706, 0xffffe8fa, 0x00000617, 0xfffff9e9, 0x000010ef, 0xffffef11, 0x00001af9,
+ 0xffffe507, 0xfffff91b, 0x000006e5, 0x00002713, 0xffffd8ed, 0x00001327, 0xffffecd9, 0x00002727,
+ 0xffffd8d9, 0x00002b03, 0xffffd4fd, 0x0000032b, 0xfffffcd5, 0x000023e8, 0xffffdc18, 0xffffe824,
+ 0x000017dc, 0x0000452a, 0xffffbad6, 0x00002a45, 0xffffd5bb, 0x000034f2, 0xffffcb0e, 0xfffff235,
+ 0x00000dcb, 0x00004713, 0xffffb8ed, 0x00001347, 0xffffecb9, 0x00004949, 0xffffb6b7, 0x00004ffe,
+ 0xffffb002, 0xfffffe50, 0x000001b0, 0x000033cc, 0xffffcc34, 0x000045d9, 0xffffba27, 0xffffd946,
+ 0x000026ba, 0x00007930, 0xffff86d0, 0x00003079, 0xffffcf87, 0x00007c54, 0xffff83ac, 0x0000547c,
+ 0xffffab84, 0x000063e5, 0xffff9c1b, 0xffffe564, 0x00001a9c, 0x000065af, 0xffff9a51, 0xffffaf66,
+ 0x0000509a, 0x00003737, 0xffffc8c9, 0x00006868, 0xffff9798, 0x00000000, 0x09090000, 0xf6f70000,
+ 0x0bfd0000, 0xf4030000, 0xfd0c0000, 0x02f40000, 0x14140000, 0xebec0000, 0x17060000, 0xe8fa0000,
+ 0x06170000, 0xf9e90000, 0x00000909, 0x09090909, 0xf6f70909, 0x0bfd0909, 0xf4030909, 0xfd0c0909,
+ 0x02f40909, 0x14140909, 0xebec0909, 0x17060909, 0xe8fa0909, 0x06170909, 0xf9e90909, 0xfffff6f7,
+ 0x0908f6f7, 0xf6f6f6f7, 0x0bfcf6f7, 0xf402f6f7, 0xfd0bf6f7, 0x02f3f6f7, 0x1413f6f7, 0xebebf6f7,
+ 0x1705f6f7, 0xe8f9f6f7, 0x0616f6f7, 0xf9e8f6f7, 0x00000bfd, 0x09090bfd, 0xf6f70bfd, 0x0bfd0bfd,
+ 0xf4030bfd, 0xfd0c0bfd, 0x02f40bfd, 0x14140bfd, 0xebec0bfd, 0x17060bfd, 0xe8fa0bfd, 0x06170bfd,
+ 0xf9e90bfd, 0xfffff403, 0x0908f403, 0xf6f6f403, 0x0bfcf403, 0xf402f403, 0xfd0bf403, 0x02f3f403,
+ 0x1413f403, 0xebebf403, 0x1705f403, 0xe8f9f403, 0x0616f403, 0xf9e8f403, 0xfffffd0c, 0x0908fd0c,
+ 0xf6f6fd0c, 0x0bfcfd0c, 0xf402fd0c, 0xfd0bfd0c, 0x02f3fd0c, 0x1413fd0c, 0xebebfd0c, 0x1705fd0c,
+ 0xe8f9fd0c, 0x0616fd0c, 0xf9e8fd0c, 0x000002f4, 0x090902f4, 0xf6f702f4, 0x0bfd02f4, 0xf40302f4,
+ 0xfd0c02f4, 0x02f402f4, 0x141402f4, 0xebec02f4, 0x170602f4, 0xe8fa02f4, 0x061702f4, 0xf9e902f4,
+ 0x00001414, 0x09091414, 0xf6f71414, 0x0bfd1414, 0xf4031414, 0xfd0c1414, 0x02f41414, 0x14141414,
+ 0xebec1414, 0x17061414, 0xe8fa1414, 0x06171414, 0xf9e91414, 0xffffebec, 0x0908ebec, 0xf6f6ebec,
+ 0x0bfcebec, 0xf402ebec, 0xfd0bebec, 0x02f3ebec, 0x1413ebec, 0xebebebec, 0x1705ebec, 0xe8f9ebec,
+ 0x0616ebec, 0xf9e8ebec, 0x00001706, 0x09091706, 0xf6f71706, 0x0bfd1706, 0xf4031706, 0xfd0c1706,
+ 0x02f41706, 0x14141706, 0xebec1706, 0x17061706, 0xe8fa1706, 0x06171706, 0xf9e91706, 0xffffe8fa,
+ 0x0908e8fa, 0xf6f6e8fa, 0x0bfce8fa, 0xf402e8fa, 0xfd0be8fa, 0x02f3e8fa, 0x1413e8fa, 0xebebe8fa,
+ 0x1705e8fa, 0xe8f9e8fa, 0x0616e8fa, 0xf9e8e8fa, 0x00000617, 0x09090617, 0xf6f70617, 0x0bfd0617,
+ 0xf4030617, 0xfd0c0617, 0x02f40617, 0x14140617, 0xebec0617, 0x17060617, 0xe8fa0617, 0x06170617,
+ 0xf9e90617, 0xfffff9e9, 0x0908f9e9, 0xf6f6f9e9, 0x0bfcf9e9, 0xf402f9e9, 0xfd0bf9e9, 0x02f3f9e9,
+ 0x1413f9e9, 0xebebf9e9, 0x1705f9e9, 0xe8f9f9e9, 0x0616f9e9, 0xf9e8f9e9, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404,
+ 0xfffffbfc, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x000003fc, 0xfffffc04, 0x000005fe,
+ 0xfffffa02, 0xfffffe06, 0x000001fa, 0x00000804, 0xfffff7fc, 0x00000408, 0xfffffbf8, 0x00000808,
+ 0xfffff7f8, 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x000007fc, 0xfffff804, 0xfffffc08,
+ 0x000003f8, 0x00000e08, 0xfffff1f8, 0x0000080e, 0xfffff7f2, 0x00000bfe, 0xfffff402, 0xfffffe0c,
+ 0x000001f4, 0x00001004, 0xffffeffc, 0x00000410, 0xfffffbf0, 0x00001010, 0xffffeff0, 0x00001200,
+ 0xffffee00, 0x00000012, 0xffffffee, 0x00000bf4, 0xfffff40c, 0x00000ff8, 0xfffff008, 0xfffff810,
+ 0x000007f0, 0x00001a0a, 0xffffe5f6, 0x00000a1a, 0xfffff5e6, 0x00001c12, 0xffffe3ee, 0x0000121c,
+ 0xffffede4, 0x000015fa, 0xffffea06, 0xfffffa16, 0x000005ea, 0x00001c04, 0xffffe3fc, 0x0000041c,
+ 0xfffffbe4, 0x00001e1e, 0xffffe1e2, 0x00001ffe, 0xffffe002, 0xfffffe20, 0x000001e0, 0x000015ee,
+ 0xffffea12, 0xffffee16, 0x000011ea, 0x00001df2, 0xffffe20e, 0xfffff21e, 0x00000de2, 0x00002e16,
+ 0xffffd1ea, 0x0000162e, 0xffffe9d2, 0x00002e0c, 0xffffd1f4, 0x00000c2e, 0xfffff3d2, 0x00003022,
+ 0xffffcfde, 0x00002230, 0xffffddd0, 0x000027f6, 0xffffd80a, 0xfffff628, 0x000009d8, 0x00003204,
+ 0xffffcdfc, 0x00000432, 0xfffffbce, 0x00003636, 0xffffc9ca, 0x000021de, 0xffffde22, 0x000029e4,
+ 0xffffd61c, 0xffffe42a, 0x00001bd6, 0x00003bfa, 0xffffc406, 0xfffffa3c, 0x000005c4, 0x00004c1a,
+ 0xffffb3e6, 0x00001a4c, 0xffffe5b4, 0x00004c2a, 0xffffb3d6, 0x00002a4c, 0xffffd5b4, 0x000035e8,
+ 0xffffca18, 0xffffe836, 0x000017ca, 0x00004e0e, 0xffffb1f2, 0x00000e4e, 0xfffff1b2, 0x0000523e,
+ 0xffffadc2, 0x00003e52, 0xffffc1ae, 0x000049ec, 0xffffb614, 0xffffec4a, 0x000013b6, 0x00005802,
+ 0xffffa7fe, 0x00000258, 0xfffffda8, 0x00005c5c, 0xffffa3a4, 0x00003bcc, 0xffffc434, 0xffffcc3c,
+ 0x000033c4, 0x00007634, 0xffff89cc, 0x00003476, 0xffffcb8a, 0x000049d4, 0xffffb62c, 0xffffd44a,
+ 0x00002bb6, 0x0000764a, 0xffff89b6, 0x00004a76, 0xffffb58a, 0x00007620, 0xffff89e0, 0x00002076,
+ 0xffffdf8a, 0x000065f4, 0xffff9a0c, 0xfffff466, 0x00000b9a, 0x00005fd8, 0xffffa028, 0xffffd860,
+ 0x000027a0, 0x000075de, 0xffff8a22, 0xffffde76, 0x0000218a, 0x000057a8, 0xffffa858, 0x000067b2,
+ 0xffff984e, 0xffffb268, 0x00004d98, 0x00000c0c, 0xfffff3f4, 0x00001616, 0xffffe9ea, 0x00002a2a,
+ 0xffffd5d6, 0x00004848, 0xffffb7b8, 0x00000000, 0x02020000, 0xfdfe0000, 0x02000000, 0xfe000000,
+ 0x00020000, 0xfffe0000, 0x00000202, 0x02020202, 0xfdfe0202, 0x02000202, 0xfe000202, 0x00020202,
+ 0xfffe0202, 0xfffffdfe, 0x0201fdfe, 0xfdfdfdfe, 0x01fffdfe, 0xfdfffdfe, 0x0001fdfe, 0xfffdfdfe,
+ 0x00000200, 0x02020200, 0xfdfe0200, 0x02000200, 0xfe000200, 0x00020200, 0xfffe0200, 0xfffffe00,
+ 0x0201fe00, 0xfdfdfe00, 0x01fffe00, 0xfdfffe00, 0x0001fe00, 0xfffdfe00, 0x00000002, 0x02020002,
+ 0xfdfe0002, 0x02000002, 0xfe000002, 0x00020002, 0xfffe0002, 0xfffffffe, 0x0201fffe, 0xfdfdfffe,
+ 0x01fffffe, 0xfdfffffe, 0x0001fffe, 0xfffdfffe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000303, 0xfffffcfd, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
+ 0xfffff9fa, 0x00000903, 0xfffff6fd, 0x00000309, 0xfffffcf7, 0x000008fd, 0xfffff703, 0xfffffd09,
+ 0x000002f7, 0x000005fa, 0xfffffa06, 0x00000c06, 0xfffff3fa, 0x0000060c, 0xfffff9f4, 0x00000c0c,
+ 0xfffff3f4, 0x00000f00, 0xfffff100, 0x0000000f, 0xfffffff1, 0x00000bf7, 0xfffff409, 0xfffff70c,
+ 0x000008f4, 0x0000180f, 0xffffe7f1, 0x00000f18, 0xfffff0e8, 0x000011fa, 0xffffee06, 0xfffffa12,
+ 0x000005ee, 0x00001806, 0xffffe7fa, 0x00000618, 0xfffff9e8, 0x00001818, 0xffffe7e8, 0x00001b00,
+ 0xffffe500, 0x0000001b, 0xffffffe5, 0x000011ee, 0xffffee12, 0x000017f4, 0xffffe80c, 0xfffff418,
+ 0x00000be8, 0x0000270f, 0xffffd8f1, 0x00000f27, 0xfffff0d9, 0x00002a1b, 0xffffd5e5, 0x00001b2a,
+ 0xffffe4d6, 0x000020f7, 0xffffdf09, 0xfffff721, 0x000008df, 0x00002a06, 0xffffd5fa, 0x0000062a,
+ 0xfffff9d6, 0x00002d2d, 0xffffd2d3, 0x000032fd, 0xffffcd03, 0xfffffd33, 0x000002cd, 0x000020e5,
+ 0xffffdf1b, 0xffffe521, 0x00001adf, 0x00002ceb, 0xffffd315, 0xffffeb2d, 0x000014d3, 0x00004521,
+ 0xffffbadf, 0x00002145, 0xffffdebb, 0x00004512, 0xffffbaee, 0x00001245, 0xffffedbb, 0x00004836,
+ 0xffffb7ca, 0x00003648, 0xffffc9b8, 0x00003eee, 0xffffc112, 0xffffee3f, 0x000011c1, 0x00004e06,
+ 0xffffb1fa, 0x0000064e, 0xfffff9b2, 0x00005151, 0xffffaeaf, 0x000032cd, 0xffffcd33, 0x00003ed6,
+ 0xffffc12a, 0xffffd63f, 0x000029c1, 0x000059f7, 0xffffa609, 0xfffff75a, 0x000008a6, 0x0000722a,
+ 0xffff8dd6, 0x00002a72, 0xffffd58e, 0x0000753f, 0xffff8ac1, 0x00003f75, 0xffffc08b, 0x000050dc,
+ 0xffffaf24, 0xffffdc51, 0x000023af, 0x00007815, 0xffff87eb, 0x00001578, 0xffffea88, 0x00007b60,
+ 0xffff84a0, 0x0000607b, 0xffff9f85, 0x00006ee2, 0xffff911e, 0xffffe26f, 0x00001d91, 0x00005cb2,
+ 0xffffa34e, 0xffffb25d, 0x00004da3, 0x000071bb, 0xffff8e45, 0xffffbb72, 0x0000448e, 0x00001212,
+ 0xffffedee, 0x00002121, 0xffffdedf, 0x00003f3f, 0xffffc0c1, 0x00006c6c, 0xffff9394, 0x00000000,
+ 0x03030000, 0xfcfd0000, 0x03000000, 0xfd000000, 0x00030000, 0xfffd0000, 0x06060000, 0xf9fa0000,
+ 0x00000303, 0x03030303, 0xfcfd0303, 0x03000303, 0xfd000303, 0x00030303, 0xfffd0303, 0x06060303,
+ 0xf9fa0303, 0xfffffcfd, 0x0302fcfd, 0xfcfcfcfd, 0x02fffcfd, 0xfcfffcfd, 0x0002fcfd, 0xfffcfcfd,
+ 0x0605fcfd, 0xf9f9fcfd, 0x00000300, 0x03030300, 0xfcfd0300, 0x03000300, 0xfd000300, 0x00030300,
+ 0xfffd0300, 0x06060300, 0xf9fa0300, 0xfffffd00, 0x0302fd00, 0xfcfcfd00, 0x02fffd00, 0xfcfffd00,
+ 0x0002fd00, 0xfffcfd00, 0x0605fd00, 0xf9f9fd00, 0x00000003, 0x03030003, 0xfcfd0003, 0x03000003,
+ 0xfd000003, 0x00030003, 0xfffd0003, 0x06060003, 0xf9fa0003, 0xfffffffd, 0x0302fffd, 0xfcfcfffd,
+ 0x02fffffd, 0xfcfffffd, 0x0002fffd, 0xfffcfffd, 0x0605fffd, 0xf9f9fffd, 0x00000606, 0x03030606,
+ 0xfcfd0606, 0x03000606, 0xfd000606, 0x00030606, 0xfffd0606, 0x06060606, 0xf9fa0606, 0xfffff9fa,
+ 0x0302f9fa, 0xfcfcf9fa, 0x02fff9fa, 0xfcfff9fa, 0x0002f9fa, 0xfffcf9fa, 0x0605f9fa, 0xf9f9f9fa,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000404, 0xfffffbfc, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000804,
+ 0xfffff7fc, 0x00000408, 0xfffffbf8, 0x00000808, 0xfffff7f8, 0x000007f8, 0xfffff808, 0x00000bfc,
+ 0xfffff404, 0xfffffc0c, 0x000003f4, 0x00001008, 0xffffeff8, 0x00000810, 0xfffff7f0, 0x00001010,
+ 0xffffeff0, 0x00001400, 0xffffec00, 0x00000014, 0xffffffec, 0x00000ff4, 0xfffff00c, 0xfffff410,
+ 0x00000bf0, 0x000017fc, 0xffffe804, 0xfffffc18, 0x000003e8, 0x00002010, 0xffffdff0, 0x00001020,
+ 0xffffefe0, 0x00002008, 0xffffdff8, 0x00000820, 0xfffff7e0, 0x00002020, 0xffffdfe0, 0x00002400,
+ 0xffffdc00, 0x00000024, 0xffffffdc, 0x000017e8, 0xffffe818, 0x00001ff0, 0xffffe010, 0xfffff020,
+ 0x00000fe0, 0x00003414, 0xffffcbec, 0x00001434, 0xffffebcc, 0x00003824, 0xffffc7dc, 0x00002438,
+ 0xffffdbc8, 0x00002bf4, 0xffffd40c, 0xfffff42c, 0x00000bd4, 0x00003808, 0xffffc7f8, 0x00000838,
+ 0xfffff7c8, 0x00003c3c, 0xffffc3c4, 0x00003ffc, 0xffffc004, 0xfffffc40, 0x000003c0, 0x00002bdc,
+ 0xffffd424, 0xffffdc2c, 0x000023d4, 0x00003be4, 0xffffc41c, 0xffffe43c, 0x00001bc4, 0x00005c2c,
+ 0xffffa3d4, 0x00002c5c, 0xffffd3a4, 0x00005c18, 0xffffa3e8, 0x0000185c, 0xffffe7a4, 0x00006048,
+ 0xffff9fb8, 0x00004860, 0xffffb7a0, 0x000053ec, 0xffffac14, 0xffffec54, 0x000013ac, 0x00006408,
+ 0xffff9bf8, 0x00000864, 0xfffff79c, 0x00006c6c, 0xffff9394, 0x000043bc, 0xffffbc44, 0x000053c8,
+ 0xffffac38, 0xffffc854, 0x000037ac, 0x000077f4, 0xffff880c, 0xfffff478, 0x00000b88, 0x00006bd0,
+ 0xffff9430, 0xffffd06c, 0x00002f94, 0x00007b98, 0xffff8468, 0xffff987c, 0x00006784, 0x00001818,
+ 0xffffe7e8, 0x00002c2c, 0xffffd3d4, 0x00005454, 0xffffabac, 0x00000000, 0x04040000, 0xfbfc0000,
+ 0x04000000, 0xfc000000, 0x00040000, 0xfffc0000, 0x08040000, 0xf7fc0000, 0x04080000, 0x00000404,
+ 0x04040404, 0xfbfc0404, 0x04000404, 0xfc000404, 0x00040404, 0xfffc0404, 0x08040404, 0xf7fc0404,
+ 0x04080404, 0xfffffbfc, 0x0403fbfc, 0xfbfbfbfc, 0x03fffbfc, 0xfbfffbfc, 0x0003fbfc, 0xfffbfbfc,
+ 0x0803fbfc, 0xf7fbfbfc, 0x0407fbfc, 0x00000400, 0x04040400, 0xfbfc0400, 0x04000400, 0xfc000400,
+ 0x00040400, 0xfffc0400, 0x08040400, 0xf7fc0400, 0x04080400, 0xfffffc00, 0x0403fc00, 0xfbfbfc00,
+ 0x03fffc00, 0xfbfffc00, 0x0003fc00, 0xfffbfc00, 0x0803fc00, 0xf7fbfc00, 0x0407fc00, 0x00000004,
+ 0x04040004, 0xfbfc0004, 0x04000004, 0xfc000004, 0x00040004, 0xfffc0004, 0x08040004, 0xf7fc0004,
+ 0x04080004, 0xfffffffc, 0x0403fffc, 0xfbfbfffc, 0x03fffffc, 0xfbfffffc, 0x0003fffc, 0xfffbfffc,
+ 0x0803fffc, 0xf7fbfffc, 0x0407fffc, 0x00000804, 0x04040804, 0xfbfc0804, 0x04000804, 0xfc000804,
+ 0x00040804, 0xfffc0804, 0x08040804, 0xf7fc0804, 0x04080804, 0xfffff7fc, 0x0403f7fc, 0xfbfbf7fc,
+ 0x03fff7fc, 0xfbfff7fc, 0x0003f7fc, 0xfffbf7fc, 0x0803f7fc, 0xf7fbf7fc, 0x0407f7fc, 0x00000408,
+ 0x04040408, 0xfbfc0408, 0x04000408, 0xfc000408, 0x00040408, 0xfffc0408, 0x08040408, 0xf7fc0408,
+ 0x04080408, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000505, 0xfffffafb, 0x00000500, 0xfffffb00, 0x00000005, 0xfffffffb, 0x00000a0a,
+ 0xfffff5f6, 0x00000f05, 0xfffff0fb, 0x0000050f, 0xfffffaf1, 0x000009f6, 0xfffff60a, 0x00000efb,
+ 0xfffff105, 0xfffffb0f, 0x000004f1, 0x0000140a, 0xffffebf6, 0x00000a14, 0xfffff5ec, 0x00001414,
+ 0xffffebec, 0x00001900, 0xffffe700, 0x00000019, 0xffffffe7, 0x000013f1, 0xffffec0f, 0xfffff114,
+ 0x00000eec, 0x00002819, 0xffffd7e7, 0x00001928, 0xffffe6d8, 0x00001df6, 0xffffe20a, 0xfffff61e,
+ 0x000009e2, 0x0000280a, 0xffffd7f6, 0x00000a28, 0xfffff5d8, 0x00002828, 0xffffd7d8, 0x00002d00,
+ 0xffffd300, 0x0000002d, 0xffffffd3, 0x00001de2, 0xffffe21e, 0x000027ec, 0xffffd814, 0xffffec28,
+ 0x000013d8, 0x00004119, 0xffffbee7, 0x00001941, 0xffffe6bf, 0x0000462d, 0xffffb9d3, 0x00002d46,
+ 0xffffd2ba, 0x000036f1, 0xffffc90f, 0xfffff137, 0x00000ec9, 0x0000460a, 0xffffb9f6, 0x00000a46,
+ 0xfffff5ba, 0x00004b4b, 0xffffb4b5, 0x000054fb, 0xffffab05, 0xfffffb55, 0x000004ab, 0x000036d3,
+ 0xffffc92d, 0xffffd337, 0x00002cc9, 0x00004add, 0xffffb523, 0xffffdd4b, 0x000022b5, 0x00007337,
+ 0xffff8cc9, 0x00003773, 0xffffc88d, 0x0000731e, 0xffff8ce2, 0x00001e73, 0xffffe18d, 0x0000785a,
+ 0xffff87a6, 0x00005a78, 0xffffa588, 0x000068e2, 0xffff971e, 0xffffe269, 0x00001d97, 0x000054ab,
+ 0xffffab55, 0x000068ba, 0xffff9746, 0xffffba69, 0x00004597, 0x00001e1e, 0xffffe1e2, 0x00003c3c,
+ 0xffffc3c4, 0x00006969, 0xffff9697, 0x00000000, 0x05050000, 0xfafb0000, 0x05000000, 0xfb000000,
+ 0x00050000, 0xfffb0000, 0x0a0a0000, 0xf5f60000, 0x0f050000, 0xf0fb0000, 0x00000505, 0x05050505,
+ 0xfafb0505, 0x05000505, 0xfb000505, 0x00050505, 0xfffb0505, 0x0a0a0505, 0xf5f60505, 0x0f050505,
+ 0xf0fb0505, 0xfffffafb, 0x0504fafb, 0xfafafafb, 0x04fffafb, 0xfafffafb, 0x0004fafb, 0xfffafafb,
+ 0x0a09fafb, 0xf5f5fafb, 0x0f04fafb, 0xf0fafafb, 0x00000500, 0x05050500, 0xfafb0500, 0x05000500,
+ 0xfb000500, 0x00050500, 0xfffb0500, 0x0a0a0500, 0xf5f60500, 0x0f050500, 0xf0fb0500, 0xfffffb00,
+ 0x0504fb00, 0xfafafb00, 0x04fffb00, 0xfafffb00, 0x0004fb00, 0xfffafb00, 0x0a09fb00, 0xf5f5fb00,
+ 0x0f04fb00, 0xf0fafb00, 0x00000005, 0x05050005, 0xfafb0005, 0x05000005, 0xfb000005, 0x00050005,
+ 0xfffb0005, 0x0a0a0005, 0xf5f60005, 0x0f050005, 0xf0fb0005, 0xfffffffb, 0x0504fffb, 0xfafafffb,
+ 0x04fffffb, 0xfafffffb, 0x0004fffb, 0xfffafffb, 0x0a09fffb, 0xf5f5fffb, 0x0f04fffb, 0xf0fafffb,
+ 0x00000a0a, 0x05050a0a, 0xfafb0a0a, 0x05000a0a, 0xfb000a0a, 0x00050a0a, 0xfffb0a0a, 0x0a0a0a0a,
+ 0xf5f60a0a, 0x0f050a0a, 0xf0fb0a0a, 0xfffff5f6, 0x0504f5f6, 0xfafaf5f6, 0x04fff5f6, 0xfafff5f6,
+ 0x0004f5f6, 0xfffaf5f6, 0x0a09f5f6, 0xf5f5f5f6, 0x0f04f5f6, 0xf0faf5f6, 0x00000f05, 0x05050f05,
+ 0xfafb0f05, 0x05000f05, 0xfb000f05, 0x00050f05, 0xfffb0f05, 0x0a0a0f05, 0xf5f60f05, 0x0f050f05,
+ 0xf0fb0f05, 0xfffff0fb, 0x0504f0fb, 0xfafaf0fb, 0x04fff0fb, 0xfafff0fb, 0x0004f0fb, 0xfffaf0fb,
+ 0x0a09f0fb, 0xf5f5f0fb, 0x0f04f0fb, 0xf0faf0fb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000606, 0xfffff9fa, 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x00000c0c,
+ 0xfffff3f4, 0x00000c06, 0xfffff3fa, 0x0000060c, 0xfffff9f4, 0x00000bf4, 0xfffff40c, 0x000011fa,
+ 0xffffee06, 0xfffffa12, 0x000005ee, 0x0000180c, 0xffffe7f4, 0x00000c18, 0xfffff3e8, 0x00001818,
+ 0xffffe7e8, 0x00001e00, 0xffffe200, 0x0000001e, 0xffffffe2, 0x000017ee, 0xffffe812, 0xffffee18,
+ 0x000011e8, 0x0000301e, 0xffffcfe2, 0x00001e30, 0xffffe1d0, 0x000023fa, 0xffffdc06, 0xfffffa24,
+ 0x000005dc, 0x0000300c, 0xffffcff4, 0x00000c30, 0xfffff3d0, 0x00003030, 0xffffcfd0, 0x00003600,
+ 0xffffca00, 0x00000036, 0xffffffca, 0x000023dc, 0xffffdc24, 0x00002fe8, 0xffffd018, 0xffffe830,
+ 0x000017d0, 0x00004e1e, 0xffffb1e2, 0x00001e4e, 0xffffe1b2, 0x00005436, 0xffffabca, 0x00003654,
+ 0xffffc9ac, 0x000041ee, 0xffffbe12, 0xffffee42, 0x000011be, 0x0000540c, 0xffffabf4, 0x00000c54,
+ 0xfffff3ac, 0x00005a5a, 0xffffa5a6, 0x00005ffa, 0xffffa006, 0xfffffa60, 0x000005a0, 0x000041ca,
+ 0xffffbe36, 0xffffca42, 0x000035be, 0x000059d6, 0xffffa62a, 0xffffd65a, 0x000029a6, 0x00007de2,
+ 0xffff821e, 0xffffe27e, 0x00001d82, 0x0000659a, 0xffff9a66, 0x00007dac, 0xffff8254, 0xffffac7e,
+ 0x00005382, 0x00002424, 0xffffdbdc, 0x00004242, 0xffffbdbe, 0x00000000, 0x06060000, 0xf9fa0000,
+ 0x06000000, 0xfa000000, 0x00060000, 0xfffa0000, 0x0c0c0000, 0xf3f40000, 0x0c060000, 0xf3fa0000,
+ 0x060c0000, 0x00000606, 0x06060606, 0xf9fa0606, 0x06000606, 0xfa000606, 0x00060606, 0xfffa0606,
+ 0x0c0c0606, 0xf3f40606, 0x0c060606, 0xf3fa0606, 0x060c0606, 0xfffff9fa, 0x0605f9fa, 0xf9f9f9fa,
+ 0x05fff9fa, 0xf9fff9fa, 0x0005f9fa, 0xfff9f9fa, 0x0c0bf9fa, 0xf3f3f9fa, 0x0c05f9fa, 0xf3f9f9fa,
+ 0x060bf9fa, 0x00000600, 0x06060600, 0xf9fa0600, 0x06000600, 0xfa000600, 0x00060600, 0xfffa0600,
+ 0x0c0c0600, 0xf3f40600, 0x0c060600, 0xf3fa0600, 0x060c0600, 0xfffffa00, 0x0605fa00, 0xf9f9fa00,
+ 0x05fffa00, 0xf9fffa00, 0x0005fa00, 0xfff9fa00, 0x0c0bfa00, 0xf3f3fa00, 0x0c05fa00, 0xf3f9fa00,
+ 0x060bfa00, 0x00000006, 0x06060006, 0xf9fa0006, 0x06000006, 0xfa000006, 0x00060006, 0xfffa0006,
+ 0x0c0c0006, 0xf3f40006, 0x0c060006, 0xf3fa0006, 0x060c0006, 0xfffffffa, 0x0605fffa, 0xf9f9fffa,
+ 0x05fffffa, 0xf9fffffa, 0x0005fffa, 0xfff9fffa, 0x0c0bfffa, 0xf3f3fffa, 0x0c05fffa, 0xf3f9fffa,
+ 0x060bfffa, 0x00000c0c, 0x06060c0c, 0xf9fa0c0c, 0x06000c0c, 0xfa000c0c, 0x00060c0c, 0xfffa0c0c,
+ 0x0c0c0c0c, 0xf3f40c0c, 0x0c060c0c, 0xf3fa0c0c, 0x060c0c0c, 0xfffff3f4, 0x0605f3f4, 0xf9f9f3f4,
+ 0x05fff3f4, 0xf9fff3f4, 0x0005f3f4, 0xfff9f3f4, 0x0c0bf3f4, 0xf3f3f3f4, 0x0c05f3f4, 0xf3f9f3f4,
+ 0x060bf3f4, 0x00000c06, 0x06060c06, 0xf9fa0c06, 0x06000c06, 0xfa000c06, 0x00060c06, 0xfffa0c06,
+ 0x0c0c0c06, 0xf3f40c06, 0x0c060c06, 0xf3fa0c06, 0x060c0c06, 0xfffff3fa, 0x0605f3fa, 0xf9f9f3fa,
+ 0x05fff3fa, 0xf9fff3fa, 0x0005f3fa, 0xfff9f3fa, 0x0c0bf3fa, 0xf3f3f3fa, 0x0c05f3fa, 0xf3f9f3fa,
+ 0x060bf3fa, 0x0000060c, 0x0606060c, 0xf9fa060c, 0x0600060c, 0xfa00060c, 0x0006060c, 0xfffa060c,
+ 0x0c0c060c, 0xf3f4060c, 0x0c06060c, 0xf3fa060c, 0x060c060c, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000707, 0xfffff8f9, 0x00000700, 0xfffff900, 0x00000007, 0xfffffff9, 0x00000e0e,
+ 0xfffff1f2, 0x00001507, 0xffffeaf9, 0x00000715, 0xfffff8eb, 0x00000df2, 0xfffff20e, 0x000014f9,
+ 0xffffeb07, 0xfffff915, 0x000006eb, 0x00001c0e, 0xffffe3f2, 0x00000e1c, 0xfffff1e4, 0x00001c1c,
+ 0xffffe3e4, 0x00002300, 0xffffdd00, 0x00000023, 0xffffffdd, 0x00001beb, 0xffffe415, 0xffffeb1c,
+ 0x000014e4, 0x00003823, 0xffffc7dd, 0x00002338, 0xffffdcc8, 0x000029f2, 0xffffd60e, 0xfffff22a,
+ 0x00000dd6, 0x0000380e, 0xffffc7f2, 0x00000e38, 0xfffff1c8, 0x00003838, 0xffffc7c8, 0x00003f00,
+ 0xffffc100, 0x0000003f, 0xffffffc1, 0x000029d6, 0xffffd62a, 0x000037e4, 0xffffc81c, 0xffffe438,
+ 0x00001bc8, 0x00005b23, 0xffffa4dd, 0x0000235b, 0xffffdca5, 0x0000623f, 0xffff9dc1, 0x00003f62,
+ 0xffffc09e, 0x00004ceb, 0xffffb315, 0xffffeb4d, 0x000014b3, 0x0000620e, 0xffff9df2, 0x00000e62,
+ 0xfffff19e, 0x00006969, 0xffff9697, 0x000076f9, 0xffff8907, 0xfffff977, 0x00000689, 0x00004cc1,
+ 0xffffb33f, 0xffffc14d, 0x00003eb3, 0x000068cf, 0xffff9731, 0xffffcf69, 0x00003097, 0x00007689,
+ 0xffff8977, 0x00002a2a, 0xffffd5d6, 0x00004d4d, 0xffffb2b3, 0x00000000, 0x07070000, 0xf8f90000,
+ 0x07000000, 0xf9000000, 0x00070000, 0xfff90000, 0x0e0e0000, 0xf1f20000, 0x15070000, 0xeaf90000,
+ 0x07150000, 0x00000707, 0x07070707, 0xf8f90707, 0x07000707, 0xf9000707, 0x00070707, 0xfff90707,
+ 0x0e0e0707, 0xf1f20707, 0x15070707, 0xeaf90707, 0x07150707, 0xfffff8f9, 0x0706f8f9, 0xf8f8f8f9,
+ 0x06fff8f9, 0xf8fff8f9, 0x0006f8f9, 0xfff8f8f9, 0x0e0df8f9, 0xf1f1f8f9, 0x1506f8f9, 0xeaf8f8f9,
+ 0x0714f8f9, 0x00000700, 0x07070700, 0xf8f90700, 0x07000700, 0xf9000700, 0x00070700, 0xfff90700,
+ 0x0e0e0700, 0xf1f20700, 0x15070700, 0xeaf90700, 0x07150700, 0xfffff900, 0x0706f900, 0xf8f8f900,
+ 0x06fff900, 0xf8fff900, 0x0006f900, 0xfff8f900, 0x0e0df900, 0xf1f1f900, 0x1506f900, 0xeaf8f900,
+ 0x0714f900, 0x00000007, 0x07070007, 0xf8f90007, 0x07000007, 0xf9000007, 0x00070007, 0xfff90007,
+ 0x0e0e0007, 0xf1f20007, 0x15070007, 0xeaf90007, 0x07150007, 0xfffffff9, 0x0706fff9, 0xf8f8fff9,
+ 0x06fffff9, 0xf8fffff9, 0x0006fff9, 0xfff8fff9, 0x0e0dfff9, 0xf1f1fff9, 0x1506fff9, 0xeaf8fff9,
+ 0x0714fff9, 0x00000e0e, 0x07070e0e, 0xf8f90e0e, 0x07000e0e, 0xf9000e0e, 0x00070e0e, 0xfff90e0e,
+ 0x0e0e0e0e, 0xf1f20e0e, 0x15070e0e, 0xeaf90e0e, 0x07150e0e, 0xfffff1f2, 0x0706f1f2, 0xf8f8f1f2,
+ 0x06fff1f2, 0xf8fff1f2, 0x0006f1f2, 0xfff8f1f2, 0x0e0df1f2, 0xf1f1f1f2, 0x1506f1f2, 0xeaf8f1f2,
+ 0x0714f1f2, 0x00001507, 0x07071507, 0xf8f91507, 0x07001507, 0xf9001507, 0x00071507, 0xfff91507,
+ 0x0e0e1507, 0xf1f21507, 0x15071507, 0xeaf91507, 0x07151507, 0xffffeaf9, 0x0706eaf9, 0xf8f8eaf9,
+ 0x06ffeaf9, 0xf8ffeaf9, 0x0006eaf9, 0xfff8eaf9, 0x0e0deaf9, 0xf1f1eaf9, 0x1506eaf9, 0xeaf8eaf9,
+ 0x0714eaf9, 0x00000715, 0x07070715, 0xf8f90715, 0x07000715, 0xf9000715, 0x00070715, 0xfff90715,
+ 0x0e0e0715, 0xf1f20715, 0x15070715, 0xeaf90715, 0x07150715, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000808, 0xfffff7f8, 0x00000800, 0xfffff800, 0x00000008, 0xfffffff8, 0x00001010,
+ 0xffffeff0, 0x00001008, 0xffffeff8, 0x00000810, 0xfffff7f0, 0x00000ff0, 0xfffff010, 0x000017f8,
+ 0xffffe808, 0xfffff818, 0x000007e8, 0x00002010, 0xffffdff0, 0x00001020, 0xffffefe0, 0x00002020,
+ 0xffffdfe0, 0x00002800, 0xffffd800, 0x00000028, 0xffffffd8, 0x00001fe8, 0xffffe018, 0xffffe820,
+ 0x000017e0, 0x00004028, 0xffffbfd8, 0x00002840, 0xffffd7c0, 0x00002ff0, 0xffffd010, 0xfffff030,
+ 0x00000fd0, 0x00004010, 0xffffbff0, 0x00001040, 0xffffefc0, 0x00004040, 0xffffbfc0, 0x00004800,
+ 0xffffb800, 0x00000048, 0xffffffb8, 0x00002fd0, 0xffffd030, 0x00003fe0, 0xffffc020, 0xffffe040,
+ 0x00001fc0, 0x00006828, 0xffff97d8, 0x00002868, 0xffffd798, 0x00007048, 0xffff8fb8, 0x00004870,
+ 0xffffb790, 0x000057e8, 0xffffa818, 0xffffe858, 0x000017a8, 0x00007010, 0xffff8ff0, 0x00001070,
+ 0xffffef90, 0x00007878, 0xffff8788, 0x000057b8, 0xffffa848, 0xffffb858, 0x000047a8, 0x000077c8,
+ 0xffff8838, 0xffffc878, 0x00003788, 0x00003030, 0xffffcfd0, 0x00005858, 0xffffa7a8, 0x00000000,
+ 0x08080000, 0xf7f80000, 0x08000000, 0xf8000000, 0x00080000, 0xfff80000, 0x10100000, 0xeff00000,
+ 0x10080000, 0xeff80000, 0x08100000, 0x00000808, 0x08080808, 0xf7f80808, 0x08000808, 0xf8000808,
+ 0x00080808, 0xfff80808, 0x10100808, 0xeff00808, 0x10080808, 0xeff80808, 0x08100808, 0xfffff7f8,
+ 0x0807f7f8, 0xf7f7f7f8, 0x07fff7f8, 0xf7fff7f8, 0x0007f7f8, 0xfff7f7f8, 0x100ff7f8, 0xefeff7f8,
+ 0x1007f7f8, 0xeff7f7f8, 0x080ff7f8, 0x00000800, 0x08080800, 0xf7f80800, 0x08000800, 0xf8000800,
+ 0x00080800, 0xfff80800, 0x10100800, 0xeff00800, 0x10080800, 0xeff80800, 0x08100800, 0xfffff800,
+ 0x0807f800, 0xf7f7f800, 0x07fff800, 0xf7fff800, 0x0007f800, 0xfff7f800, 0x100ff800, 0xefeff800,
+ 0x1007f800, 0xeff7f800, 0x080ff800, 0x00000008, 0x08080008, 0xf7f80008, 0x08000008, 0xf8000008,
+ 0x00080008, 0xfff80008, 0x10100008, 0xeff00008, 0x10080008, 0xeff80008, 0x08100008, 0xfffffff8,
+ 0x0807fff8, 0xf7f7fff8, 0x07fffff8, 0xf7fffff8, 0x0007fff8, 0xfff7fff8, 0x100ffff8, 0xefeffff8,
+ 0x1007fff8, 0xeff7fff8, 0x080ffff8, 0x00001010, 0x08081010, 0xf7f81010, 0x08001010, 0xf8001010,
+ 0x00081010, 0xfff81010, 0x10101010, 0xeff01010, 0x10081010, 0xeff81010, 0x08101010, 0xffffeff0,
+ 0x0807eff0, 0xf7f7eff0, 0x07ffeff0, 0xf7ffeff0, 0x0007eff0, 0xfff7eff0, 0x100feff0, 0xefefeff0,
+ 0x1007eff0, 0xeff7eff0, 0x080feff0, 0x00001008, 0x08081008, 0xf7f81008, 0x08001008, 0xf8001008,
+ 0x00081008, 0xfff81008, 0x10101008, 0xeff01008, 0x10081008, 0xeff81008, 0x08101008, 0xffffeff8,
+ 0x0807eff8, 0xf7f7eff8, 0x07ffeff8, 0xf7ffeff8, 0x0007eff8, 0xfff7eff8, 0x100feff8, 0xefefeff8,
+ 0x1007eff8, 0xeff7eff8, 0x080feff8, 0x00000810, 0x08080810, 0xf7f80810, 0x08000810, 0xf8000810,
+ 0x00080810, 0xfff80810, 0x10100810, 0xeff00810, 0x10080810, 0xeff80810, 0x08100810, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000909, 0xfffff6f7, 0x00000900, 0xfffff700, 0x00000009, 0xfffffff7, 0x00001212,
+ 0xffffedee, 0x00001b09, 0xffffe4f7, 0x0000091b, 0xfffff6e5, 0x000011ee, 0xffffee12, 0x00001af7,
+ 0xffffe509, 0xfffff71b, 0x000008e5, 0x00002412, 0xffffdbee, 0x00001224, 0xffffeddc, 0x00002424,
+ 0xffffdbdc, 0x00002d00, 0xffffd300, 0x0000002d, 0xffffffd3, 0x000023e5, 0xffffdc1b, 0xffffe524,
+ 0x00001adc, 0x0000482d, 0xffffb7d3, 0x00002d48, 0xffffd2b8, 0x000035ee, 0xffffca12, 0xffffee36,
+ 0x000011ca, 0x00004812, 0xffffb7ee, 0x00001248, 0xffffedb8, 0x00004848, 0xffffb7b8, 0x00005100,
+ 0xffffaf00, 0x00000051, 0xffffffaf, 0x000035ca, 0xffffca36, 0x000047dc, 0xffffb824, 0xffffdc48,
+ 0x000023b8, 0x0000752d, 0xffff8ad3, 0x00002d75, 0xffffd28b, 0x00007e51, 0xffff81af, 0x0000517e,
+ 0xffffae82, 0x000062e5, 0xffff9d1b, 0xffffe563, 0x00001a9d, 0x000062af, 0xffff9d51, 0xffffaf63,
+ 0x0000509d, 0x00003636, 0xffffc9ca, 0x00006c6c, 0xffff9394, 0x00000000, 0x09090000, 0xf6f70000,
+ 0x09000000, 0xf7000000, 0x00090000, 0xfff70000, 0x12120000, 0xedee0000, 0x1b090000, 0xe4f70000,
+ 0x091b0000, 0xf6e50000, 0x00000909, 0x09090909, 0xf6f70909, 0x09000909, 0xf7000909, 0x00090909,
+ 0xfff70909, 0x12120909, 0xedee0909, 0x1b090909, 0xe4f70909, 0x091b0909, 0xf6e50909, 0xfffff6f7,
+ 0x0908f6f7, 0xf6f6f6f7, 0x08fff6f7, 0xf6fff6f7, 0x0008f6f7, 0xfff6f6f7, 0x1211f6f7, 0xededf6f7,
+ 0x1b08f6f7, 0xe4f6f6f7, 0x091af6f7, 0xf6e4f6f7, 0x00000900, 0x09090900, 0xf6f70900, 0x09000900,
+ 0xf7000900, 0x00090900, 0xfff70900, 0x12120900, 0xedee0900, 0x1b090900, 0xe4f70900, 0x091b0900,
+ 0xf6e50900, 0xfffff700, 0x0908f700, 0xf6f6f700, 0x08fff700, 0xf6fff700, 0x0008f700, 0xfff6f700,
+ 0x1211f700, 0xededf700, 0x1b08f700, 0xe4f6f700, 0x091af700, 0xf6e4f700, 0x00000009, 0x09090009,
+ 0xf6f70009, 0x09000009, 0xf7000009, 0x00090009, 0xfff70009, 0x12120009, 0xedee0009, 0x1b090009,
+ 0xe4f70009, 0x091b0009, 0xf6e50009, 0xfffffff7, 0x0908fff7, 0xf6f6fff7, 0x08fffff7, 0xf6fffff7,
+ 0x0008fff7, 0xfff6fff7, 0x1211fff7, 0xededfff7, 0x1b08fff7, 0xe4f6fff7, 0x091afff7, 0xf6e4fff7,
+ 0x00001212, 0x09091212, 0xf6f71212, 0x09001212, 0xf7001212, 0x00091212, 0xfff71212, 0x12121212,
+ 0xedee1212, 0x1b091212, 0xe4f71212, 0x091b1212, 0xf6e51212, 0xffffedee, 0x0908edee, 0xf6f6edee,
+ 0x08ffedee, 0xf6ffedee, 0x0008edee, 0xfff6edee, 0x1211edee, 0xedededee, 0x1b08edee, 0xe4f6edee,
+ 0x091aedee, 0xf6e4edee, 0x00001b09, 0x09091b09, 0xf6f71b09, 0x09001b09, 0xf7001b09, 0x00091b09,
+ 0xfff71b09, 0x12121b09, 0xedee1b09, 0x1b091b09, 0xe4f71b09, 0x091b1b09, 0xf6e51b09, 0xffffe4f7,
+ 0x0908e4f7, 0xf6f6e4f7, 0x08ffe4f7, 0xf6ffe4f7, 0x0008e4f7, 0xfff6e4f7, 0x1211e4f7, 0xedede4f7,
+ 0x1b08e4f7, 0xe4f6e4f7, 0x091ae4f7, 0xf6e4e4f7, 0x0000091b, 0x0909091b, 0xf6f7091b, 0x0900091b,
+ 0xf700091b, 0x0009091b, 0xfff7091b, 0x1212091b, 0xedee091b, 0x1b09091b, 0xe4f7091b, 0x091b091b,
+ 0xf6e5091b, 0xfffff6e5, 0x0908f6e5, 0xf6f6f6e5, 0x08fff6e5, 0xf6fff6e5, 0x0008f6e5, 0xfff6f6e5,
+ 0x1211f6e5, 0xededf6e5, 0x1b08f6e5, 0xe4f6f6e5, 0x091af6e5, 0xf6e4f6e5, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
+ 0xfffff9fa, 0x00000700, 0xfffff900, 0x00000007, 0xfffffff9, 0x000004fb, 0xfffffb05, 0xfffffb05,
+ 0x000004fb, 0x00000b06, 0xfffff4fa, 0x0000060b, 0xfffff9f5, 0x00000800, 0xfffff800, 0x00000008,
+ 0xfffffff8, 0x00000b0b, 0xfffff4f5, 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x0000110c,
+ 0xffffeef4, 0x00000c11, 0xfffff3ef, 0x00001111, 0xffffeeef, 0x00001206, 0xffffedfa, 0x00000612,
+ 0xfffff9ee, 0x00000af8, 0xfffff508, 0xfffff80b, 0x000007f5, 0x00000f00, 0xfffff100, 0x0000000f,
+ 0xfffffff1, 0x00001400, 0xffffec00, 0x00000014, 0xffffffec, 0x00001912, 0xffffe6ee, 0x00001219,
+ 0xffffede7, 0x0000190b, 0xffffe6f5, 0x00000b19, 0xfffff4e7, 0x00001919, 0xffffe6e7, 0x00000df2,
+ 0xfffff20e, 0xfffff20e, 0x00000df2, 0x00001a00, 0xffffe600, 0x0000001a, 0xffffffe6, 0x000011f5,
+ 0xffffee0b, 0xfffff512, 0x00000aee, 0x000015f9, 0xffffea07, 0xfffff916, 0x000006ea, 0x0000221a,
+ 0xffffdde6, 0x00001a22, 0xffffe5de, 0x00002212, 0xffffddee, 0x00001222, 0xffffedde, 0x00002222,
+ 0xffffddde, 0x0000230b, 0xffffdcf5, 0x00000b23, 0xfffff4dd, 0x00001d00, 0xffffe300, 0x0000001d,
+ 0xffffffe3, 0x000015ed, 0xffffea13, 0xffffed16, 0x000012ea, 0x000019f1, 0xffffe60f, 0xfffff11a,
+ 0x00000ee6, 0x00002500, 0xffffdb00, 0x00000025, 0xffffffdb, 0x00002c1b, 0xffffd3e5, 0x00001b2c,
+ 0xffffe4d4, 0x00002c24, 0xffffd3dc, 0x0000242c, 0xffffdbd4, 0x00002c12, 0xffffd3ee, 0x0000122c,
+ 0xffffedd4, 0x000020f6, 0xffffdf0a, 0xfffff621, 0x000009df, 0x00002d2d, 0xffffd2d3, 0x00000000,
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x00000300, 0xfffffd00, 0x00000003, 0xfffffffd, 0x00000606,
+ 0xfffff9fa, 0x00000700, 0xfffff900, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020300, 0x0201fd00,
+ 0x02020003, 0x0201fffd, 0x02020606, 0x0201f9fa, 0x02020700, 0x0201f900, 0xfdfe0000, 0xfdfe0202,
+ 0xfdfdfdfe, 0xfdfe0300, 0xfdfdfd00, 0xfdfe0003, 0xfdfdfffd, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0700,
+ 0xfdfdf900, 0x03000000, 0x03000202, 0x02fffdfe, 0x03000300, 0x02fffd00, 0x03000003, 0x02fffffd,
+ 0x03000606, 0x02fff9fa, 0x03000700, 0x02fff900, 0xfd000000, 0xfd000202, 0xfcfffdfe, 0xfd000300,
+ 0xfcfffd00, 0xfd000003, 0xfcfffffd, 0xfd000606, 0xfcfff9fa, 0xfd000700, 0xfcfff900, 0x00030000,
+ 0x00030202, 0x0002fdfe, 0x00030300, 0x0002fd00, 0x00030003, 0x0002fffd, 0x00030606, 0x0002f9fa,
+ 0x00030700, 0x0002f900, 0xfffd0000, 0xfffd0202, 0xfffcfdfe, 0xfffd0300, 0xfffcfd00, 0xfffd0003,
+ 0xfffcfffd, 0xfffd0606, 0xfffcf9fa, 0xfffd0700, 0xfffcf900, 0x06060000, 0x06060202, 0x0605fdfe,
+ 0x06060300, 0x0605fd00, 0x06060003, 0x0605fffd, 0x06060606, 0x0605f9fa, 0x06060700, 0x0605f900,
+ 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0300, 0xf9f9fd00, 0xf9fa0003, 0xf9f9fffd, 0xf9fa0606,
+ 0xf9f9f9fa, 0xf9fa0700, 0xf9f9f900, 0x07000000, 0x07000202, 0x06fffdfe, 0x07000300, 0x06fffd00,
+ 0x07000003, 0x06fffffd, 0x07000606, 0x06fff9fa, 0x07000700, 0x06fff900, 0xf9000000, 0xf9000202,
+ 0xf8fffdfe, 0xf9000300, 0xf8fffd00, 0xf9000003, 0xf8fffffd, 0xf9000606, 0xf8fff9fa, 0xf9000700,
+ 0xf8fff900, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000202, 0xfffffdfe, 0x00000606,
+ 0xfffff9fa, 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x000003fc, 0xfffffc04, 0xfffffa0a,
+ 0x000005f6, 0xfffff400, 0x00000c00, 0xfffff3fa, 0xfffff406, 0x00000bfa, 0x00000c06, 0xfffffff2,
+ 0x0000000e, 0x00000c0c, 0xfffff3f4, 0xffffee00, 0x00001200, 0xfffff40e, 0x00000bf2, 0xfffff9ee,
+ 0xfffffa12, 0x000005ee, 0x00000612, 0xffffedf6, 0xffffee0a, 0x000011f6, 0x0000120a, 0xffffffea,
+ 0x00000016, 0xffffe800, 0x00001800, 0xfffff3ea, 0xfffff416, 0x00000bea, 0x00000c16, 0xffffe7f8,
+ 0xffffe808, 0x000017f8, 0x00001808, 0xfffff9e6, 0xfffffa1a, 0x000005e6, 0x0000061a, 0xffffffe4,
+ 0x0000001c, 0x00001414, 0xffffebec, 0xffffe5f2, 0x00001a0e, 0xfffff3e2, 0x00000c1e, 0xffffdff6,
+ 0x0000200a, 0xffffdfee, 0x00002012, 0xffffe5e6, 0x00001a1a, 0xffffebde, 0x00001422, 0xfffff3da,
+ 0x00000c26, 0xffffdfe0, 0x00002020, 0x00002020, 0xffffd7ea, 0xffffddde, 0x00002222, 0x00000000,
+ 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa,
+ 0x00000600, 0xfffffa00, 0x00000006, 0xfffffffa, 0x02000000, 0x02000200, 0x01fffe00, 0x02000002,
+ 0x01fffffe, 0x02000202, 0x01fffdfe, 0x02000606, 0x01fff9fa, 0x02000600, 0x01fffa00, 0x02000006,
+ 0x01fffffa, 0xfe000000, 0xfe000200, 0xfdfffe00, 0xfe000002, 0xfdfffffe, 0xfe000202, 0xfdfffdfe,
+ 0xfe000606, 0xfdfff9fa, 0xfe000600, 0xfdfffa00, 0xfe000006, 0xfdfffffa, 0x00020000, 0x00020200,
+ 0x0001fe00, 0x00020002, 0x0001fffe, 0x00020202, 0x0001fdfe, 0x00020606, 0x0001f9fa, 0x00020600,
+ 0x0001fa00, 0x00020006, 0x0001fffa, 0xfffe0000, 0xfffe0200, 0xfffdfe00, 0xfffe0002, 0xfffdfffe,
+ 0xfffe0202, 0xfffdfdfe, 0xfffe0606, 0xfffdf9fa, 0xfffe0600, 0xfffdfa00, 0xfffe0006, 0xfffdfffa,
+ 0x02020000, 0x02020200, 0x0201fe00, 0x02020002, 0x0201fffe, 0x02020202, 0x0201fdfe, 0x02020606,
+ 0x0201f9fa, 0x02020600, 0x0201fa00, 0x02020006, 0x0201fffa, 0xfdfe0000, 0xfdfe0200, 0xfdfdfe00,
+ 0xfdfe0002, 0xfdfdfffe, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0600, 0xfdfdfa00,
+ 0xfdfe0006, 0xfdfdfffa, 0x06060000, 0x06060200, 0x0605fe00, 0x06060002, 0x0605fffe, 0x06060202,
+ 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060600, 0x0605fa00, 0x06060006, 0x0605fffa, 0xf9fa0000,
+ 0xf9fa0200, 0xf9f9fe00, 0xf9fa0002, 0xf9f9fffe, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
+ 0xf9fa0600, 0xf9f9fa00, 0xf9fa0006, 0xf9f9fffa, 0x06000000, 0x06000200, 0x05fffe00, 0x06000002,
+ 0x05fffffe, 0x06000202, 0x05fffdfe, 0x06000606, 0x05fff9fa, 0x06000600, 0x05fffa00, 0x06000006,
+ 0x05fffffa, 0xfa000000, 0xfa000200, 0xf9fffe00, 0xfa000002, 0xf9fffffe, 0xfa000202, 0xf9fffdfe,
+ 0xfa000606, 0xf9fff9fa, 0xfa000600, 0xf9fffa00, 0xfa000006, 0xf9fffffa, 0x00060000, 0x00060200,
+ 0x0005fe00, 0x00060002, 0x0005fffe, 0x00060202, 0x0005fdfe, 0x00060606, 0x0005f9fa, 0x00060600,
+ 0x0005fa00, 0x00060006, 0x0005fffa, 0xfffa0000, 0xfffa0200, 0xfff9fe00, 0xfffa0002, 0xfff9fffe,
+ 0xfffa0202, 0xfff9fdfe, 0xfffa0606, 0xfff9f9fa, 0xfffa0600, 0xfff9fa00, 0xfffa0006, 0xfff9fffa,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404, 0xfffffbfc, 0x00000a0a,
+ 0xfffff5f6, 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x000005fa, 0xfffffa06, 0xfffff80e,
+ 0x000007f2, 0xffffffee, 0x00000012, 0xfffff00a, 0x00000ff6, 0xffffe800, 0x00001800, 0xfffff7e8,
+ 0xfffff818, 0x000007e8, 0x00000818, 0x00001212, 0xffffedee, 0xfffff014, 0x00000fec, 0xffffe5f2,
+ 0xffffe60e, 0x000019f2, 0x00001a0e, 0xffffffe2, 0x0000001e, 0xffffde00, 0x00002200, 0xfffff7de,
+ 0xfffff822, 0x000007de, 0x00000822, 0xffffede2, 0xffffee1e, 0x000011e2, 0x0000121e, 0xffffddf6,
+ 0xffffde0a, 0x000021f6, 0x0000220a, 0xffffddec, 0x00002214, 0xffffffd8, 0x00000028, 0x00001e1e,
+ 0xffffe1e2, 0xffffedd8, 0x00001228, 0xffffd400, 0x00002c00, 0xffffd3f0, 0x00002c10, 0xffffdbdc,
+ 0xffffdbdc, 0x00002424, 0xffffd3e6, 0x00002c1a, 0xffffe5d2, 0x00001a2e, 0xffffedcc, 0x00001234,
+ 0xffffc9ec, 0xffffd3d4, 0x00002c2c, 0xffffc9e0, 0xffffd1d2, 0xffffd1d2, 0x00002e2e, 0x00000000,
+ 0x00000200, 0xfffffe00, 0x00000002, 0xfffffffe, 0x00000404, 0xfffffbfc, 0x00000a0a, 0xfffff5f6,
+ 0x00000a00, 0xfffff600, 0x0000000a, 0xfffffff6, 0x02000000, 0x02000200, 0x01fffe00, 0x02000002,
+ 0x01fffffe, 0x02000404, 0x01fffbfc, 0x02000a0a, 0x01fff5f6, 0x02000a00, 0x01fff600, 0x0200000a,
+ 0x01fffff6, 0xfe000000, 0xfe000200, 0xfdfffe00, 0xfe000002, 0xfdfffffe, 0xfe000404, 0xfdfffbfc,
+ 0xfe000a0a, 0xfdfff5f6, 0xfe000a00, 0xfdfff600, 0xfe00000a, 0xfdfffff6, 0x00020000, 0x00020200,
+ 0x0001fe00, 0x00020002, 0x0001fffe, 0x00020404, 0x0001fbfc, 0x00020a0a, 0x0001f5f6, 0x00020a00,
+ 0x0001f600, 0x0002000a, 0x0001fff6, 0xfffe0000, 0xfffe0200, 0xfffdfe00, 0xfffe0002, 0xfffdfffe,
+ 0xfffe0404, 0xfffdfbfc, 0xfffe0a0a, 0xfffdf5f6, 0xfffe0a00, 0xfffdf600, 0xfffe000a, 0xfffdfff6,
+ 0x04040000, 0x04040200, 0x0403fe00, 0x04040002, 0x0403fffe, 0x04040404, 0x0403fbfc, 0x04040a0a,
+ 0x0403f5f6, 0x04040a00, 0x0403f600, 0x0404000a, 0x0403fff6, 0xfbfc0000, 0xfbfc0200, 0xfbfbfe00,
+ 0xfbfc0002, 0xfbfbfffe, 0xfbfc0404, 0xfbfbfbfc, 0xfbfc0a0a, 0xfbfbf5f6, 0xfbfc0a00, 0xfbfbf600,
+ 0xfbfc000a, 0xfbfbfff6, 0x0a0a0000, 0x0a0a0200, 0x0a09fe00, 0x0a0a0002, 0x0a09fffe, 0x0a0a0404,
+ 0x0a09fbfc, 0x0a0a0a0a, 0x0a09f5f6, 0x0a0a0a00, 0x0a09f600, 0x0a0a000a, 0x0a09fff6, 0xf5f60000,
+ 0xf5f60200, 0xf5f5fe00, 0xf5f60002, 0xf5f5fffe, 0xf5f60404, 0xf5f5fbfc, 0xf5f60a0a, 0xf5f5f5f6,
+ 0xf5f60a00, 0xf5f5f600, 0xf5f6000a, 0xf5f5fff6, 0x0a000000, 0x0a000200, 0x09fffe00, 0x0a000002,
+ 0x09fffffe, 0x0a000404, 0x09fffbfc, 0x0a000a0a, 0x09fff5f6, 0x0a000a00, 0x09fff600, 0x0a00000a,
+ 0x09fffff6, 0xf6000000, 0xf6000200, 0xf5fffe00, 0xf6000002, 0xf5fffffe, 0xf6000404, 0xf5fffbfc,
+ 0xf6000a0a, 0xf5fff5f6, 0xf6000a00, 0xf5fff600, 0xf600000a, 0xf5fffff6, 0x000a0000, 0x000a0200,
+ 0x0009fe00, 0x000a0002, 0x0009fffe, 0x000a0404, 0x0009fbfc, 0x000a0a0a, 0x0009f5f6, 0x000a0a00,
+ 0x0009f600, 0x000a000a, 0x0009fff6, 0xfff60000, 0xfff60200, 0xfff5fe00, 0xfff60002, 0xfff5fffe,
+ 0xfff60404, 0xfff5fbfc, 0xfff60a0a, 0xfff5f5f6, 0xfff60a00, 0xfff5f600, 0xfff6000a, 0xfff5fff6,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000404, 0xfffffbfc, 0x00000c0c,
+ 0xfffff3f4, 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x000007f8, 0xfffff808, 0xfffff008,
+ 0x00000ff8, 0xffffe800, 0x00001800, 0xfffff7e8, 0xfffff818, 0x000007e8, 0x00000818, 0xfffff014,
+ 0x00000fec, 0xffffffe4, 0x0000001c, 0xffffe7f0, 0xffffe810, 0x000017f0, 0x00001810, 0xffffe000,
+ 0x00002000, 0xffffefe4, 0xfffff01c, 0x00000fe4, 0x0000101c, 0xffffdff8, 0xffffe008, 0xfffff7e0,
+ 0xfffff820, 0x000007e0, 0x00000820, 0x00001ff8, 0x00002008, 0x00001818, 0xffffe7e8, 0xffffe818,
+ 0x000017e8, 0xffffdfec, 0x00002014, 0xffffffd8, 0x00000028, 0xffffefd8, 0x00001028, 0xffffd400,
+ 0xffffd400, 0xffffffd4, 0x0000002c, 0x00002c00, 0x00002c00, 0xffffdfe0, 0x00002020, 0xffffd3f0,
+ 0x00002c10, 0xffffd3e8, 0xffffe7d4, 0x0000182c, 0x00002c18, 0xffffefd0, 0x00001030, 0xffffdbdc,
+ 0xffffdbdc, 0x00002424, 0x00002424, 0xffffcbec, 0x00002828, 0xffffd7d8, 0xffffcbe0, 0x00000000,
+ 0x00000400, 0xfffffc00, 0x00000004, 0xfffffffc, 0x00000404, 0xfffffbfc, 0x00000c0c, 0xfffff3f4,
+ 0x00000c00, 0xfffff400, 0x0000000c, 0xfffffff4, 0x04000000, 0x04000400, 0x03fffc00, 0x04000004,
+ 0x03fffffc, 0x04000404, 0x03fffbfc, 0x04000c0c, 0x03fff3f4, 0x04000c00, 0x03fff400, 0x0400000c,
+ 0x03fffff4, 0xfc000000, 0xfc000400, 0xfbfffc00, 0xfc000004, 0xfbfffffc, 0xfc000404, 0xfbfffbfc,
+ 0xfc000c0c, 0xfbfff3f4, 0xfc000c00, 0xfbfff400, 0xfc00000c, 0xfbfffff4, 0x00040000, 0x00040400,
+ 0x0003fc00, 0x00040004, 0x0003fffc, 0x00040404, 0x0003fbfc, 0x00040c0c, 0x0003f3f4, 0x00040c00,
+ 0x0003f400, 0x0004000c, 0x0003fff4, 0xfffc0000, 0xfffc0400, 0xfffbfc00, 0xfffc0004, 0xfffbfffc,
+ 0xfffc0404, 0xfffbfbfc, 0xfffc0c0c, 0xfffbf3f4, 0xfffc0c00, 0xfffbf400, 0xfffc000c, 0xfffbfff4,
+ 0x04040000, 0x04040400, 0x0403fc00, 0x04040004, 0x0403fffc, 0x04040404, 0x0403fbfc, 0x04040c0c,
+ 0x0403f3f4, 0x04040c00, 0x0403f400, 0x0404000c, 0x0403fff4, 0xfbfc0000, 0xfbfc0400, 0xfbfbfc00,
+ 0xfbfc0004, 0xfbfbfffc, 0xfbfc0404, 0xfbfbfbfc, 0xfbfc0c0c, 0xfbfbf3f4, 0xfbfc0c00, 0xfbfbf400,
+ 0xfbfc000c, 0xfbfbfff4, 0x0c0c0000, 0x0c0c0400, 0x0c0bfc00, 0x0c0c0004, 0x0c0bfffc, 0x0c0c0404,
+ 0x0c0bfbfc, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c0c00, 0x0c0bf400, 0x0c0c000c, 0x0c0bfff4, 0xf3f40000,
+ 0xf3f40400, 0xf3f3fc00, 0xf3f40004, 0xf3f3fffc, 0xf3f40404, 0xf3f3fbfc, 0xf3f40c0c, 0xf3f3f3f4,
+ 0xf3f40c00, 0xf3f3f400, 0xf3f4000c, 0xf3f3fff4, 0x0c000000, 0x0c000400, 0x0bfffc00, 0x0c000004,
+ 0x0bfffffc, 0x0c000404, 0x0bfffbfc, 0x0c000c0c, 0x0bfff3f4, 0x0c000c00, 0x0bfff400, 0x0c00000c,
+ 0x0bfffff4, 0xf4000000, 0xf4000400, 0xf3fffc00, 0xf4000004, 0xf3fffffc, 0xf4000404, 0xf3fffbfc,
+ 0xf4000c0c, 0xf3fff3f4, 0xf4000c00, 0xf3fff400, 0xf400000c, 0xf3fffff4, 0x000c0000, 0x000c0400,
+ 0x000bfc00, 0x000c0004, 0x000bfffc, 0x000c0404, 0x000bfbfc, 0x000c0c0c, 0x000bf3f4, 0x000c0c00,
+ 0x000bf400, 0x000c000c, 0x000bfff4, 0xfff40000, 0xfff40400, 0xfff3fc00, 0xfff40004, 0xfff3fffc,
+ 0xfff40404, 0xfff3fbfc, 0xfff40c0c, 0xfff3f3f4, 0xfff40c00, 0xfff3f400, 0xfff4000c, 0xfff3fff4,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
+ 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
+ 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
+ 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
+ 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
+ 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
+ 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
+ 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
+ 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
+ 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
+ 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
+ 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
+ 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
+ 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
+ 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
+ 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
+ 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
+ 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
+ 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
+ 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
+ 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
+ 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
+ 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
+ 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
+ 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
+ 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
+ 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
+ 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
+ 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
+ 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
+ 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
+ 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
+ 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
+ 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
+ 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
+ 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
+ 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
+ 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
+ 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
+ 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
+ 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
+ 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
+ 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
+ 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
+ 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
+ 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
+ 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
+ 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
+ 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
+ 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
+ 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
+ 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
+ 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
+ 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
+ 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
+ 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
+ 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
+ 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
+ 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
+ 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
+ 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
+ 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
+ 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
+ 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414,
+ 0xffffebec, 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000202, 0xfffffdfe, 0x00000606, 0xfffff9fa, 0x00000c0c, 0xfffff3f4, 0x00001414, 0xffffebec,
+ 0x00002020, 0xffffdfe0, 0x00002e2e, 0xffffd1d2, 0x02020000, 0x02020202, 0x0201fdfe, 0x02020606,
+ 0x0201f9fa, 0x02020c0c, 0x0201f3f4, 0x02021414, 0x0201ebec, 0x02022020, 0x0201dfe0, 0x02022e2e,
+ 0x0201d1d2, 0xfdfe0000, 0xfdfe0202, 0xfdfdfdfe, 0xfdfe0606, 0xfdfdf9fa, 0xfdfe0c0c, 0xfdfdf3f4,
+ 0xfdfe1414, 0xfdfdebec, 0xfdfe2020, 0xfdfddfe0, 0xfdfe2e2e, 0xfdfdd1d2, 0x06060000, 0x06060202,
+ 0x0605fdfe, 0x06060606, 0x0605f9fa, 0x06060c0c, 0x0605f3f4, 0x06061414, 0x0605ebec, 0x06062020,
+ 0x0605dfe0, 0x06062e2e, 0x0605d1d2, 0xf9fa0000, 0xf9fa0202, 0xf9f9fdfe, 0xf9fa0606, 0xf9f9f9fa,
+ 0xf9fa0c0c, 0xf9f9f3f4, 0xf9fa1414, 0xf9f9ebec, 0xf9fa2020, 0xf9f9dfe0, 0xf9fa2e2e, 0xf9f9d1d2,
+ 0x0c0c0000, 0x0c0c0202, 0x0c0bfdfe, 0x0c0c0606, 0x0c0bf9fa, 0x0c0c0c0c, 0x0c0bf3f4, 0x0c0c1414,
+ 0x0c0bebec, 0x0c0c2020, 0x0c0bdfe0, 0x0c0c2e2e, 0x0c0bd1d2, 0xf3f40000, 0xf3f40202, 0xf3f3fdfe,
+ 0xf3f40606, 0xf3f3f9fa, 0xf3f40c0c, 0xf3f3f3f4, 0xf3f41414, 0xf3f3ebec, 0xf3f42020, 0xf3f3dfe0,
+ 0xf3f42e2e, 0xf3f3d1d2, 0x14140000, 0x14140202, 0x1413fdfe, 0x14140606, 0x1413f9fa, 0x14140c0c,
+ 0x1413f3f4, 0x14141414, 0x1413ebec, 0x14142020, 0x1413dfe0, 0x14142e2e, 0x1413d1d2, 0xebec0000,
+ 0xebec0202, 0xebebfdfe, 0xebec0606, 0xebebf9fa, 0xebec0c0c, 0xebebf3f4, 0xebec1414, 0xebebebec,
+ 0xebec2020, 0xebebdfe0, 0xebec2e2e, 0xebebd1d2, 0x20200000, 0x20200202, 0x201ffdfe, 0x20200606,
+ 0x201ff9fa, 0x20200c0c, 0x201ff3f4, 0x20201414, 0x201febec, 0x20202020, 0x201fdfe0, 0x20202e2e,
+ 0x201fd1d2, 0xdfe00000, 0xdfe00202, 0xdfdffdfe, 0xdfe00606, 0xdfdff9fa, 0xdfe00c0c, 0xdfdff3f4,
+ 0xdfe01414, 0xdfdfebec, 0xdfe02020, 0xdfdfdfe0, 0xdfe02e2e, 0xdfdfd1d2, 0x2e2e0000, 0x2e2e0202,
+ 0x2e2dfdfe, 0x2e2e0606, 0x2e2df9fa, 0x2e2e0c0c, 0x2e2df3f4, 0x2e2e1414, 0x2e2debec, 0x2e2e2020,
+ 0x2e2ddfe0, 0x2e2e2e2e, 0x2e2dd1d2, 0xd1d20000, 0xd1d20202, 0xd1d1fdfe, 0xd1d20606, 0xd1d1f9fa,
+ 0xd1d20c0c, 0xd1d1f3f4, 0xd1d21414, 0xd1d1ebec, 0xd1d22020, 0xd1d1dfe0, 0xd1d22e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
};
static const uint32_t correctionloworder[] = {
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x04040404,
- 0xfbfbfbfc, 0x05050101, 0xfafafeff, 0x01010505, 0xfefefafb, 0x0403fbfc, 0xfbfc0404, 0x0605fdfe,
- 0xf9fa0202, 0xfdfe0606, 0x0201f9fa, 0x09090404, 0xf6f6fbfc, 0x04040909, 0xfbfbf6f7, 0x09090909,
- 0xf6f6f6f7, 0x0a0a0101, 0xf5f5feff, 0x01010a0a, 0xfefef5f6, 0x0807fafb, 0xf7f80505, 0xfafb0808,
- 0x0504f7f8, 0x0f0f0909, 0xf0f0f6f7, 0x09090f0f, 0xf6f6f0f1, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
- 0x0302f3f4, 0x10100404, 0xefeffbfc, 0x04041010, 0xfbfbeff0, 0x10101010, 0xefefeff0, 0x12120000,
- 0xedee0000, 0x00001212, 0xffffedee, 0x0c0bf3f4, 0xf3f40c0c, 0x100ff6f7, 0xeff00909, 0xf6f71010,
- 0x0908eff0, 0x1b1b0b0b, 0xe4e4f4f5, 0x0b0b1b1b, 0xf4f4e4e5, 0x1c1c1313, 0xe3e3eced, 0x13131c1c,
- 0xecece3e4, 0x1615f9fa, 0xe9ea0606, 0xf9fa1616, 0x0605e9ea, 0x1d1d0404, 0xe2e2fbfc, 0x04041d1d,
- 0xfbfbe2e3, 0x1e1e1e1e, 0xe1e1e1e2, 0x2120fdfe, 0xdedf0202, 0xfdfe2121, 0x0201dedf, 0x1716edee,
- 0xe8e91212, 0xedee1717, 0x1211e8e9, 0x1e1df0f1, 0xe1e20f0f, 0xf0f11e1e, 0x0f0ee1e2, 0x2e2e1616,
- 0xd1d1e9ea, 0x16162e2e, 0xe9e9d1d2, 0x2f2f0d0d, 0xd0d0f2f3, 0x0d0d2f2f, 0xf2f2d0d1, 0x31312323,
- 0xcecedcdd, 0x23233131, 0xdcdccecf, 0x2928f4f5, 0xd6d70b0b, 0xf4f52929, 0x0b0ad6d7, 0x33330404,
- 0xccccfbfc, 0x04043333, 0xfbfbcccd, 0x36363636, 0xc9c9c9ca, 0x2221ddde, 0xddde2222, 0x2a29e2e3,
- 0xd5d61d1d, 0xe2e32a2a, 0x1d1cd5d6, 0x3c3bf9fa, 0xc3c40606, 0xf9fa3c3c, 0x0605c3c4, 0x4c4c1b1b,
- 0xb3b3e4e5, 0x1b1b4c4c, 0xe4e4b3b4, 0x4d4d2b2b, 0xb2b2d4d5, 0x2b2b4d4d, 0xd4d4b2b3, 0x3736e7e8,
- 0xc8c91818, 0xe7e83737, 0x1817c8c9, 0x4f4f0e0e, 0xb0b0f1f2, 0x0e0e4f4f, 0xf1f1b0b1, 0x53533f3f,
- 0xacacc0c1, 0x3f3f5353, 0xc0c0acad, 0x4a49ebec, 0xb5b61414, 0xebec4a4a, 0x1413b5b6, 0x58580202,
- 0xa7a7fdfe, 0x02025858, 0xfdfda7a8, 0x5d5d5d5d, 0xa2a2a2a3, 0x3d3ccbcc, 0xc2c33434, 0xcbcc3d3d,
- 0x3433c2c3, 0x78783434, 0x8787cbcc, 0x34347878, 0xcbcb8788, 0x4b4ad2d3, 0xb4b52d2d, 0xd2d34b4b,
- 0x2d2cb4b5, 0x7d7d4b4b, 0x8282b4b5, 0x4b4b7d7d, 0xb4b48283, 0x7a7a2121, 0x8585dedf, 0x21217a7a,
- 0xdede8586, 0x6766f2f3, 0x98990d0d, 0xf2f36767, 0x0d0c9899, 0x605fd7d8, 0x9fa02828, 0xd7d86060,
- 0x28279fa0, 0x7f7eddde, 0x80812222, 0xddde7f7f, 0x22218081, 0x5958a6a7, 0xa6a75959, 0x6968b1b2,
- 0x96974e4e, 0xb1b26969, 0x4e4d9697, 0x0c0c0c0c, 0xf3f3f3f4, 0x17171717, 0xe8e8e8e9, 0x2a2a2a2a,
- 0xd5d5d5d6, 0x49494949, 0xb6b6b6b7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0xfcfd0101,
- 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfeff0303, 0xfeff0303,
- 0xfeff0303, 0xfeff0303, 0xfeff0303, 0xfeff0303, 0xfeff0303, 0x0100fcfd, 0x0100fcfd, 0x0100fcfd,
- 0x0100fcfd, 0x0100fcfd, 0x0100fcfd, 0x0100fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707,
- 0xf8f8f8f9, 0x08080202, 0xf7f7fdfe, 0x02020808, 0xfdfdf7f8, 0x0908fdfe, 0xf6f70202, 0xfdfe0909,
- 0x0201f6f7, 0x0605f9fa, 0xf9fa0606, 0x0d0d0606, 0xf2f2f9fa, 0x06060d0d, 0xf9f9f2f3, 0x0d0d0d0d,
- 0xf2f2f2f3, 0x0e0e0101, 0xf1f1feff, 0x01010e0e, 0xfefef1f2, 0x0c0bf7f8, 0xf3f40808, 0xf7f80c0c,
- 0x0807f3f4, 0x17170e0e, 0xe8e8f1f2, 0x0e0e1717, 0xf1f1e8e9, 0x1211fafb, 0xedee0505, 0xfafb1212,
- 0x0504edee, 0x18180606, 0xe7e7f9fa, 0x06061818, 0xf9f9e7e8, 0x18181818, 0xe7e7e7e8, 0x1b1afeff,
- 0xe4e50101, 0xfeff1b1b, 0x0100e4e5, 0x1110eeef, 0xeeef1111, 0x1716f2f3, 0xe8e90d0d, 0xf2f31717,
- 0x0d0ce8e9, 0x28281010, 0xd7d7eff0, 0x10102828, 0xefefd7d8, 0x29291c1c, 0xd6d6e3e4, 0x1c1c2929,
- 0xe3e3d6d7, 0x2120f6f7, 0xdedf0909, 0xf6f72121, 0x0908dedf, 0x2b2b0606, 0xd4d4f9fa, 0x06062b2b,
- 0xf9f9d4d5, 0x2e2e2e2e, 0xd1d1d1d2, 0x3231fbfc, 0xcdce0404, 0xfbfc3232, 0x0403cdce, 0x2221e4e5,
- 0xddde1b1b, 0xe4e52222, 0x1b1addde, 0x2d2ce9ea, 0xd2d31616, 0xe9ea2d2d, 0x1615d2d3, 0x45452222,
- 0xbabaddde, 0x22224545, 0xddddbabb, 0x46461313, 0xb9b9eced, 0x13134646, 0xececb9ba, 0x49493535,
- 0xb6b6cacb, 0x35354949, 0xcacab6b7, 0x3e3deeef, 0xc1c21111, 0xeeef3e3e, 0x1110c1c2, 0x4d4d0505,
- 0xb2b2fafb, 0x05054d4d, 0xfafab2b3, 0x52525252, 0xadadadae, 0x3332cccd, 0xcccd3333, 0x403fd4d5,
- 0xbfc02b2b, 0xd4d54040, 0x2b2abfc0, 0x5a59f5f6, 0xa5a60a0a, 0xf5f65a5a, 0x0a09a5a6, 0x72722929,
- 0x8d8dd6d7, 0x29297272, 0xd6d68d8e, 0x74744040, 0x8b8bbfc0, 0x40407474, 0xbfbf8b8c, 0x5251dadb,
- 0xadae2525, 0xdadb5252, 0x2524adae, 0x77771616, 0x8888e9ea, 0x16167777, 0xe9e98889, 0x7c7c5f5f,
- 0x8383a0a1, 0x5f5f7c7c, 0xa0a08384, 0x6f6ee1e2, 0x90911e1e, 0xe1e26f6f, 0x1e1d9091, 0x5c5bb1b2,
- 0xa3a44e4e, 0xb1b25c5c, 0x4e4da3a4, 0x7170bbbc, 0x8e8f4444, 0xbbbc7171, 0x44438e8f, 0x12121212,
- 0xedededee, 0x22222222, 0xddddddde, 0x3f3f3f3f, 0xc0c0c0c1, 0x6d6d6d6d, 0x92929293, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303,
- 0x03030303, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd,
- 0xfcfcfcfd, 0xfcfcfcfd, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff,
- 0x0403feff, 0x0403feff, 0x0403feff, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101,
- 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404,
- 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc,
- 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x07070707, 0x07070707,
- 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9,
- 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303,
- 0xf5f5fcfd, 0x03030a0a, 0xfcfcf5f6, 0x09090909, 0xf6f6f6f7, 0x0706f8f9, 0xf8f90707, 0x0c0bfcfd,
- 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x11110808, 0xeeeef7f8, 0x08081111, 0xf7f7eeef, 0x11111111,
- 0xeeeeeeef, 0x13130101, 0xececfeff, 0x01011313, 0xfefeeced, 0x100ff4f5, 0xeff00b0b, 0xf4f51010,
- 0x0b0aeff0, 0x1716f9fa, 0xe8e90606, 0xf9fa1717, 0x0605e8e9, 0x1f1f1212, 0xe0e0edee, 0x12121f1f,
- 0xedede0e1, 0x20200808, 0xdfdff7f8, 0x08082020, 0xf7f7dfe0, 0x21212121, 0xdedededf, 0x2423feff,
- 0xdbdc0101, 0xfeff2424, 0x0100dbdc, 0x1716e8e9, 0xe8e91717, 0x1f1eeeef, 0xe0e11111, 0xeeef1f1f,
- 0x1110e0e1, 0x36361515, 0xc9c9eaeb, 0x15153636, 0xeaeac9ca, 0x37372525, 0xc8c8dadb, 0x25253737,
- 0xdadac8c9, 0x2c2bf3f4, 0xd3d40c0c, 0xf3f42c2c, 0x0c0bd3d4, 0x39390808, 0xc6c6f7f8, 0x08083939,
- 0xf7f7c6c7, 0x3d3d3d3d, 0xc2c2c2c3, 0x4241fafb, 0xbdbe0505, 0xfafb4242, 0x0504bdbe, 0x2d2cdbdc,
- 0xd2d32424, 0xdbdc2d2d, 0x2423d2d3, 0x3c3be2e3, 0xc3c41d1d, 0xe2e33c3c, 0x1d1cc3c4, 0x5c5c2d2d,
- 0xa3a3d2d3, 0x2d2d5c5c, 0xd2d2a3a4, 0x5d5d1919, 0xa2a2e6e7, 0x19195d5d, 0xe6e6a2a3, 0x61614747,
- 0x9e9eb8b9, 0x47476161, 0xb8b89e9f, 0x5352e9ea, 0xacad1616, 0xe9ea5353, 0x1615acad, 0x66660707,
- 0x9999f8f9, 0x07076666, 0xf8f8999a, 0x6d6d6d6d, 0x92929293, 0x4443bbbc, 0xbbbc4444, 0x5554c6c7,
- 0xaaab3939, 0xc6c75555, 0x3938aaab, 0x7877f2f3, 0x87880d0d, 0xf2f37878, 0x0d0c8788, 0x6e6dcecf,
- 0x91923131, 0xcecf6e6e, 0x31309192, 0x7b7a9798, 0x84856868, 0x97987b7b, 0x68678485, 0x18181818,
- 0xe7e7e7e8, 0x2e2e2e2e, 0xd1d1d1d2, 0x54545454, 0xabababac, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff,
- 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0xfafb0101, 0xfafb0101, 0xfafb0101,
- 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfeff0505,
- 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505,
- 0xfeff0505, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb,
- 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303,
- 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd,
- 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0x03030a0a,
- 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a,
- 0x03030a0a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b,
- 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x03030d0d, 0xfcfcf2f3, 0x0908f6f7, 0xf6f70909, 0x0f0efbfc,
- 0xf0f10404, 0xfbfc0f0f, 0x0403f0f1, 0x16160b0b, 0xe9e9f4f5, 0x0b0b1616, 0xf4f4e9ea, 0x15151515,
- 0xeaeaeaeb, 0x18180202, 0xe7e7fdfe, 0x02021818, 0xfdfde7e8, 0x1413f1f2, 0xebec0e0e, 0xf1f21414,
- 0x0e0debec, 0x26261717, 0xd9d9e8e9, 0x17172626, 0xe8e8d9da, 0x1d1cf7f8, 0xe2e30808, 0xf7f81d1d,
- 0x0807e2e3, 0x27270b0b, 0xd8d8f4f5, 0x0b0b2727, 0xf4f4d8d9, 0x29292929, 0xd6d6d6d7, 0x2d2cfeff,
- 0xd2d30101, 0xfeff2d2d, 0x0100d2d3, 0x1d1ce2e3, 0xe2e31d1d, 0x2726e9ea, 0xd8d91616, 0xe9ea2727,
- 0x1615d8d9, 0x43431b1b, 0xbcbce4e5, 0x1b1b4343, 0xe4e4bcbd, 0x45452f2f, 0xbabad0d1, 0x2f2f4545,
- 0xd0d0babb, 0x3837f0f1, 0xc7c80f0f, 0xf0f13838, 0x0f0ec7c8, 0x47470b0b, 0xb8b8f4f5, 0x0b0b4747,
- 0xf4f4b8b9, 0x4c4c4c4c, 0xb3b3b3b4, 0x5352f9fa, 0xacad0606, 0xf9fa5353, 0x0605acad, 0x3938d2d3,
- 0xc6c72d2d, 0xd2d33939, 0x2d2cc6c7, 0x4b4adbdc, 0xb4b52424, 0xdbdc4b4b, 0x2423b4b5, 0x73733838,
- 0x8c8cc7c8, 0x38387373, 0xc7c78c8d, 0x75751f1f, 0x8a8ae0e1, 0x1f1f7575, 0xe0e08a8b, 0x7a7a5858,
- 0x8585a7a8, 0x58587a7a, 0xa7a78586, 0x6867e3e4, 0x97981c1c, 0xe3e46868, 0x1c1b9798, 0x5554aaab,
- 0xaaab5555, 0x6a69b7b8, 0x95964848, 0xb7b86a6a, 0x48479596, 0x1e1e1e1e, 0xe1e1e1e2, 0x3a3a3a3a,
- 0xc5c5c5c6, 0x69696969, 0x96969697, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x05050505, 0x05050505,
- 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505,
- 0x05050505, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb,
- 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe,
- 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0xf8f90202,
- 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202,
- 0xf8f90202, 0xf8f90202, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707,
- 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9,
- 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9,
- 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b,
- 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5,
- 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0x0d0d0303, 0x0d0d0303,
- 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303,
- 0x0d0d0303, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd,
- 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d,
- 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0xfbfbf0f1, 0x0b0af4f5, 0xf4f50b0b, 0x1211fafb,
- 0xedee0505, 0xfafb1212, 0x0504edee, 0x1a1a0d0d, 0xe5e5f2f3, 0x0d0d1a1a, 0xf2f2e5e6, 0x1a1a1a1a,
- 0xe5e5e5e6, 0x1d1d0202, 0xe2e2fdfe, 0x02021d1d, 0xfdfde2e3, 0x1817eff0, 0xe7e81010, 0xeff01818,
- 0x100fe7e8, 0x2e2e1c1c, 0xd1d1e3e4, 0x1c1c2e2e, 0xe3e3d1d2, 0x2322f6f7, 0xdcdd0909, 0xf6f72323,
- 0x0908dcdd, 0x2f2f0d0d, 0xd0d0f2f3, 0x0d0d2f2f, 0xf2f2d0d1, 0x31313131, 0xcecececf, 0x3635feff,
- 0xc9ca0101, 0xfeff3636, 0x0100c9ca, 0x2322dcdd, 0xdcdd2323, 0x2f2ee5e6, 0xd0d11a1a, 0xe5e62f2f,
- 0x1a19d0d1, 0x51512020, 0xaeaedfe0, 0x20205151, 0xdfdfaeaf, 0x53533838, 0xacacc7c8, 0x38385353,
- 0xc7c7acad, 0x4342edee, 0xbcbd1212, 0xedee4343, 0x1211bcbd, 0x56560d0d, 0xa9a9f2f3, 0x0d0d5656,
- 0xf2f2a9aa, 0x5b5b5b5b, 0xa4a4a4a5, 0x6362f8f9, 0x9c9d0707, 0xf8f96363, 0x07069c9d, 0x4443c9ca,
- 0xbbbc3636, 0xc9ca4444, 0x3635bbbc, 0x5a59d3d4, 0xa5a62c2c, 0xd3d45a5a, 0x2c2ba5a6, 0x7c7bdedf,
- 0x83842121, 0xdedf7c7c, 0x21208384, 0x67669899, 0x98996767, 0x7f7ea9aa, 0x80815656, 0xa9aa7f7f,
- 0x56558081, 0x25252525, 0xdadadadb, 0x45454545, 0xbabababb, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe,
- 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0xf7f80202, 0xf7f80202, 0xf7f80202,
- 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202,
- 0xf7f80202, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808,
- 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8,
- 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8,
- 0x0201f7f8, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d,
- 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3,
- 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3,
- 0xf2f2f2f3, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404,
- 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc,
- 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc,
- 0xf0f0fbfc, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f,
- 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010,
- 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0xfafaedee, 0x0d0cf2f3, 0xf2f30d0d, 0x1514f9fa,
- 0xeaeb0606, 0xf9fa1515, 0x0605eaeb, 0x1e1e0f0f, 0xe1e1f0f1, 0x0f0f1e1e, 0xf0f0e1e2, 0x1e1e1e1e,
- 0xe1e1e1e2, 0x22220202, 0xddddfdfe, 0x02022222, 0xfdfdddde, 0x1c1beced, 0xe3e41313, 0xeced1c1c,
- 0x1312e3e4, 0x36362020, 0xc9c9dfe0, 0x20203636, 0xdfdfc9ca, 0x2928f4f5, 0xd6d70b0b, 0xf4f52929,
- 0x0b0ad6d7, 0x37370f0f, 0xc8c8f0f1, 0x0f0f3737, 0xf0f0c8c9, 0x39393939, 0xc6c6c6c7, 0x3f3efeff,
- 0xc0c10101, 0xfeff3f3f, 0x0100c0c1, 0x2827d7d8, 0xd7d82828, 0x3736e1e2, 0xc8c91e1e, 0xe1e23737,
- 0x1e1dc8c9, 0x5e5e2525, 0xa1a1dadb, 0x25255e5e, 0xdadaa1a2, 0x60604141, 0x9f9fbebf, 0x41416060,
- 0xbebe9fa0, 0x4e4deaeb, 0xb1b21515, 0xeaeb4e4e, 0x1514b1b2, 0x64640f0f, 0x9b9bf0f1, 0x0f0f6464,
- 0xf0f09b9c, 0x6a6a6a6a, 0x95959596, 0x7473f7f8, 0x8b8c0808, 0xf7f87474, 0x08078b8c, 0x4f4ec0c1,
- 0xb0b13f3f, 0xc0c14f4f, 0x3f3eb0b1, 0x6968cccd, 0x96973333, 0xcccd6969, 0x33329697, 0x78778788,
- 0x87887878, 0x2b2b2b2b, 0xd4d4d4d5, 0x50505050, 0xafafafb0, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707,
- 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd,
- 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0xf5f60303, 0xf5f60303, 0xf5f60303,
- 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303,
- 0xf5f60303, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a,
- 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6,
- 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6,
- 0x0302f5f6, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010,
- 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0xefefeff0, 0xefefeff0, 0xefefeff0,
- 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0,
- 0xefefeff0, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505,
- 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0xededfafb, 0xededfafb, 0xededfafb,
- 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb,
- 0xededfafb, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212,
- 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212,
- 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0xfafaebec, 0x0f0ef0f1, 0xf0f10f0f, 0x1817f8f9,
- 0xe7e80707, 0xf8f91818, 0x0706e7e8, 0x23231111, 0xdcdceeef, 0x11112323, 0xeeeedcdd, 0x22222222,
- 0xddddddde, 0x26260303, 0xd9d9fcfd, 0x03032626, 0xfcfcd9da, 0x201fe9ea, 0xdfe01616, 0xe9ea2020,
- 0x1615dfe0, 0x3d3d2525, 0xc2c2dadb, 0x25253d3d, 0xdadac2c3, 0x2f2ef2f3, 0xd0d10d0d, 0xf2f32f2f,
- 0x0d0cd0d1, 0x3f3f1111, 0xc0c0eeef, 0x11113f3f, 0xeeeec0c1, 0x41414141, 0xbebebebf, 0x4847feff,
- 0xb7b80101, 0xfeff4848, 0x0100b7b8, 0x2e2dd1d2, 0xd1d22e2e, 0x3f3edcdd, 0xc0c12323, 0xdcdd3f3f,
- 0x2322c0c1, 0x6b6b2b2b, 0x9494d4d5, 0x2b2b6b6b, 0xd4d49495, 0x6e6e4b4b, 0x9191b4b5, 0x4b4b6e6e,
- 0xb4b49192, 0x5958e7e8, 0xa6a71818, 0xe7e85959, 0x1817a6a7, 0x72721111, 0x8d8deeef, 0x11117272,
- 0xeeee8d8e, 0x79797979, 0x86868687, 0x5b5ab7b8, 0xa4a54848, 0xb7b85b5b, 0x4847a4a5, 0x7877c5c6,
- 0x87883a3a, 0xc5c67878, 0x3a398788, 0x31313131, 0xcecececf, 0x5c5c5c5c, 0xa3a3a3a4, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808,
- 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd,
- 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0xf4f50303,
- 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303,
- 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b,
- 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0x0302f4f5,
- 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5,
- 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
- 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0xedededee,
- 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee,
- 0xedededee, 0xedededee, 0xedededee, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505,
- 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0xebebfafb,
- 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb,
- 0xebebfafb, 0xebebfafb, 0xebebfafb, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414,
- 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414,
- 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x1110eeef, 0xeeef1111, 0x1b1af8f9,
- 0xe4e50707, 0xf8f91b1b, 0x0706e4e5, 0x27271313, 0xd8d8eced, 0x13132727, 0xececd8d9, 0x27272727,
- 0xd8d8d8d9, 0x2b2b0303, 0xd4d4fcfd, 0x03032b2b, 0xfcfcd4d5, 0x2423e7e8, 0xdbdc1818, 0xe7e82424,
- 0x1817dbdc, 0x45452a2a, 0xbabad5d6, 0x2a2a4545, 0xd5d5babb, 0x3534f1f2, 0xcacb0e0e, 0xf1f23535,
- 0x0e0dcacb, 0x47471313, 0xb8b8eced, 0x13134747, 0xececb8b9, 0x49494949, 0xb6b6b6b7, 0x504ffdfe,
- 0xafb00202, 0xfdfe5050, 0x0201afb0, 0x3433cbcc, 0xcbcc3434, 0x4645d8d9, 0xb9ba2727, 0xd8d94646,
- 0x2726b9ba, 0x79793030, 0x8686cfd0, 0x30307979, 0xcfcf8687, 0x7c7c5454, 0x8383abac, 0x54547c7c,
- 0xabab8384, 0x6463e4e5, 0x9b9c1b1b, 0xe4e56464, 0x1b1a9b9c, 0x6665aeaf, 0x999a5151, 0xaeaf6666,
- 0x5150999a, 0x37373737, 0xc8c8c8c9, 0x68686868, 0x97979798, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909,
- 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd,
- 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd,
- 0x0c0bfcfd, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303,
- 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xfcfd0c0c, 0xfcfd0c0c,
- 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c,
- 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4,
- 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606,
- 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0xe8e8f9fa,
- 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa,
- 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0x06061717, 0x06061717, 0x06061717, 0x06061717,
- 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717,
- 0x06061717, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9,
- 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404,
- 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x0403fbfc, 0xfbfc0404, 0x0605fdfe,
- 0xf9fa0202, 0xfdfe0606, 0x0201f9fa, 0x08080404, 0xf7f7fbfc, 0x04040808, 0xfbfbf7f8, 0x08080808,
- 0xf7f7f7f8, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x0807fbfc, 0xf7f80404, 0xfbfc0808,
- 0x0403f7f8, 0x0e0e0808, 0xf1f1f7f8, 0x08080e0e, 0xf7f7f1f2, 0x0c0bfdfe, 0xf3f40202, 0xfdfe0c0c,
- 0x0201f3f4, 0x10100404, 0xefeffbfc, 0x04041010, 0xfbfbeff0, 0x10101010, 0xefefeff0, 0x12120000,
- 0xedee0000, 0x00001212, 0xffffedee, 0x0c0bf3f4, 0xf3f40c0c, 0x100ff7f8, 0xeff00808, 0xf7f81010,
- 0x0807eff0, 0x1a1a0a0a, 0xe5e5f5f6, 0x0a0a1a1a, 0xf5f5e5e6, 0x1c1c1212, 0xe3e3edee, 0x12121c1c,
- 0xedede3e4, 0x1615f9fa, 0xe9ea0606, 0xf9fa1616, 0x0605e9ea, 0x1c1c0404, 0xe3e3fbfc, 0x04041c1c,
- 0xfbfbe3e4, 0x1e1e1e1e, 0xe1e1e1e2, 0x201ffdfe, 0xdfe00202, 0xfdfe2020, 0x0201dfe0, 0x1615edee,
- 0xe9ea1212, 0xedee1616, 0x1211e9ea, 0x1e1df1f2, 0xe1e20e0e, 0xf1f21e1e, 0x0e0de1e2, 0x2e2e1616,
- 0xd1d1e9ea, 0x16162e2e, 0xe9e9d1d2, 0x2e2e0c0c, 0xd1d1f3f4, 0x0c0c2e2e, 0xf3f3d1d2, 0x30302222,
- 0xcfcfddde, 0x22223030, 0xddddcfd0, 0x2827f5f6, 0xd7d80a0a, 0xf5f62828, 0x0a09d7d8, 0x32320404,
- 0xcdcdfbfc, 0x04043232, 0xfbfbcdce, 0x36363636, 0xc9c9c9ca, 0x2221ddde, 0xddde2222, 0x2a29e3e4,
- 0xd5d61c1c, 0xe3e42a2a, 0x1c1bd5d6, 0x3c3bf9fa, 0xc3c40606, 0xf9fa3c3c, 0x0605c3c4, 0x4c4c1a1a,
- 0xb3b3e5e6, 0x1a1a4c4c, 0xe5e5b3b4, 0x4c4c2a2a, 0xb3b3d5d6, 0x2a2a4c4c, 0xd5d5b3b4, 0x3635e7e8,
- 0xc9ca1818, 0xe7e83636, 0x1817c9ca, 0x4e4e0e0e, 0xb1b1f1f2, 0x0e0e4e4e, 0xf1f1b1b2, 0x52523e3e,
- 0xadadc1c2, 0x3e3e5252, 0xc1c1adae, 0x4a49ebec, 0xb5b61414, 0xebec4a4a, 0x1413b5b6, 0x58580202,
- 0xa7a7fdfe, 0x02025858, 0xfdfda7a8, 0x5c5c5c5c, 0xa3a3a3a4, 0x3c3bcbcc, 0xc3c43434, 0xcbcc3c3c,
- 0x3433c3c4, 0x76763434, 0x8989cbcc, 0x34347676, 0xcbcb898a, 0x4a49d3d4, 0xb5b62c2c, 0xd3d44a4a,
- 0x2c2bb5b6, 0x76764a4a, 0x8989b5b6, 0x4a4a7676, 0xb5b5898a, 0x76762020, 0x8989dfe0, 0x20207676,
- 0xdfdf898a, 0x6665f3f4, 0x999a0c0c, 0xf3f46666, 0x0c0b999a, 0x605fd7d8, 0x9fa02828, 0xd7d86060,
- 0x28279fa0, 0x7675ddde, 0x898a2222, 0xddde7676, 0x2221898a, 0x5857a7a8, 0xa7a85858, 0x6867b1b2,
- 0x97984e4e, 0xb1b26868, 0x4e4d9798, 0x0c0c0c0c, 0xf3f3f3f4, 0x16161616, 0xe9e9e9ea, 0x2a2a2a2a,
- 0xd5d5d5d6, 0x48484848, 0xb7b7b7b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0xfdfe0000,
- 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x09090303, 0xf6f6fcfd, 0x03030909, 0xfcfcf6f7, 0x0908fcfd, 0xf6f70303, 0xfcfd0909,
- 0x0302f6f7, 0x0605f9fa, 0xf9fa0606, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0xf9f9f3f4, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0f0f0000, 0xf0f10000, 0x00000f0f, 0xfffff0f1, 0x0c0bf6f7, 0xf3f40909, 0xf6f70c0c,
- 0x0908f3f4, 0x18180f0f, 0xe7e7f0f1, 0x0f0f1818, 0xf0f0e7e8, 0x1211f9fa, 0xedee0606, 0xf9fa1212,
- 0x0605edee, 0x18180606, 0xe7e7f9fa, 0x06061818, 0xf9f9e7e8, 0x18181818, 0xe7e7e7e8, 0x1b1b0000,
- 0xe4e50000, 0x00001b1b, 0xffffe4e5, 0x1211edee, 0xedee1212, 0x1817f3f4, 0xe7e80c0c, 0xf3f41818,
- 0x0c0be7e8, 0x27270f0f, 0xd8d8f0f1, 0x0f0f2727, 0xf0f0d8d9, 0x2a2a1b1b, 0xd5d5e4e5, 0x1b1b2a2a,
- 0xe4e4d5d6, 0x2120f6f7, 0xdedf0909, 0xf6f72121, 0x0908dedf, 0x2a2a0606, 0xd5d5f9fa, 0x06062a2a,
- 0xf9f9d5d6, 0x2d2d2d2d, 0xd2d2d2d3, 0x3332fcfd, 0xcccd0303, 0xfcfd3333, 0x0302cccd, 0x2120e4e5,
- 0xdedf1b1b, 0xe4e52121, 0x1b1adedf, 0x2d2ceaeb, 0xd2d31515, 0xeaeb2d2d, 0x1514d2d3, 0x45452121,
- 0xbabadedf, 0x21214545, 0xdedebabb, 0x45451212, 0xbabaedee, 0x12124545, 0xededbabb, 0x48483636,
- 0xb7b7c9ca, 0x36364848, 0xc9c9b7b8, 0x3f3eedee, 0xc0c11212, 0xedee3f3f, 0x1211c0c1, 0x4e4e0606,
- 0xb1b1f9fa, 0x06064e4e, 0xf9f9b1b2, 0x51515151, 0xaeaeaeaf, 0x3332cccd, 0xcccd3333, 0x3f3ed5d6,
- 0xc0c12a2a, 0xd5d63f3f, 0x2a29c0c1, 0x5a59f6f7, 0xa5a60909, 0xf6f75a5a, 0x0908a5a6, 0x72722a2a,
- 0x8d8dd5d6, 0x2a2a7272, 0xd5d58d8e, 0x75753f3f, 0x8a8ac0c1, 0x3f3f7575, 0xc0c08a8b, 0x5150dbdc,
- 0xaeaf2424, 0xdbdc5151, 0x2423aeaf, 0x78781515, 0x8787eaeb, 0x15157878, 0xeaea8788, 0x7b7b6060,
- 0x84849fa0, 0x60607b7b, 0x9f9f8485, 0x6f6ee1e2, 0x90911e1e, 0xe1e26f6f, 0x1e1d9091, 0x5d5cb1b2,
- 0xa2a34e4e, 0xb1b25d5d, 0x4e4da2a3, 0x7271babb, 0x8d8e4545, 0xbabb7272, 0x45448d8e, 0x12121212,
- 0xedededee, 0x21212121, 0xdedededf, 0x3f3f3f3f, 0xc0c0c0c1, 0x6c6c6c6c, 0x93939394, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303,
- 0x03030303, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd,
- 0xfcfcfcfd, 0xfcfcfcfd, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000,
- 0x03030000, 0x03030000, 0x03030000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000,
- 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0x00000303, 0x00000303, 0x00000303, 0x00000303,
- 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd,
- 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404,
- 0xf7f7fbfc, 0x04040808, 0xfbfbf7f8, 0x08080808, 0xf7f7f7f8, 0x0807f7f8, 0xf7f80808, 0x0c0bfbfc,
- 0xf3f40404, 0xfbfc0c0c, 0x0403f3f4, 0x10100808, 0xefeff7f8, 0x08081010, 0xf7f7eff0, 0x10101010,
- 0xefefeff0, 0x14140000, 0xebec0000, 0x00001414, 0xffffebec, 0x100ff3f4, 0xeff00c0c, 0xf3f41010,
- 0x0c0beff0, 0x1817fbfc, 0xe7e80404, 0xfbfc1818, 0x0403e7e8, 0x20201010, 0xdfdfeff0, 0x10102020,
- 0xefefdfe0, 0x20200808, 0xdfdff7f8, 0x08082020, 0xf7f7dfe0, 0x20202020, 0xdfdfdfe0, 0x24240000,
- 0xdbdc0000, 0x00002424, 0xffffdbdc, 0x1817e7e8, 0xe7e81818, 0x201feff0, 0xdfe01010, 0xeff02020,
- 0x100fdfe0, 0x34341414, 0xcbcbebec, 0x14143434, 0xebebcbcc, 0x38382424, 0xc7c7dbdc, 0x24243838,
- 0xdbdbc7c8, 0x2c2bf3f4, 0xd3d40c0c, 0xf3f42c2c, 0x0c0bd3d4, 0x38380808, 0xc7c7f7f8, 0x08083838,
- 0xf7f7c7c8, 0x3c3c3c3c, 0xc3c3c3c4, 0x403ffbfc, 0xbfc00404, 0xfbfc4040, 0x0403bfc0, 0x2c2bdbdc,
- 0xd3d42424, 0xdbdc2c2c, 0x2423d3d4, 0x3c3be3e4, 0xc3c41c1c, 0xe3e43c3c, 0x1c1bc3c4, 0x5c5c2c2c,
- 0xa3a3d3d4, 0x2c2c5c5c, 0xd3d3a3a4, 0x5c5c1818, 0xa3a3e7e8, 0x18185c5c, 0xe7e7a3a4, 0x60604848,
- 0x9f9fb7b8, 0x48486060, 0xb7b79fa0, 0x5453ebec, 0xabac1414, 0xebec5454, 0x1413abac, 0x64640808,
- 0x9b9bf7f8, 0x08086464, 0xf7f79b9c, 0x6c6c6c6c, 0x93939394, 0x4443bbbc, 0xbbbc4444, 0x5453c7c8,
- 0xabac3838, 0xc7c85454, 0x3837abac, 0x7877f3f4, 0x87880c0c, 0xf3f47878, 0x0c0b8788, 0x6c6bcfd0,
- 0x93943030, 0xcfd06c6c, 0x302f9394, 0x7c7b9798, 0x83846868, 0x97987c7c, 0x68678384, 0x18181818,
- 0xe7e7e7e8, 0x2c2c2c2c, 0xd3d3d3d4, 0x54545454, 0xabababac, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
- 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000,
- 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0x00000404,
- 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404,
- 0x00000404, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
- 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0x08080404,
- 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc,
- 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0x04040808,
- 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808,
- 0x04040808, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x05050f0f, 0xfafaf0f1, 0x0a09f5f6, 0xf5f60a0a, 0x0f0efafb,
- 0xf0f10505, 0xfafb0f0f, 0x0504f0f1, 0x14140a0a, 0xebebf5f6, 0x0a0a1414, 0xf5f5ebec, 0x14141414,
- 0xebebebec, 0x19190000, 0xe6e70000, 0x00001919, 0xffffe6e7, 0x1413f0f1, 0xebec0f0f, 0xf0f11414,
- 0x0f0eebec, 0x28281919, 0xd7d7e6e7, 0x19192828, 0xe6e6d7d8, 0x1e1df5f6, 0xe1e20a0a, 0xf5f61e1e,
- 0x0a09e1e2, 0x28280a0a, 0xd7d7f5f6, 0x0a0a2828, 0xf5f5d7d8, 0x28282828, 0xd7d7d7d8, 0x2d2d0000,
- 0xd2d30000, 0x00002d2d, 0xffffd2d3, 0x1e1de1e2, 0xe1e21e1e, 0x2827ebec, 0xd7d81414, 0xebec2828,
- 0x1413d7d8, 0x41411919, 0xbebee6e7, 0x19194141, 0xe6e6bebf, 0x46462d2d, 0xb9b9d2d3, 0x2d2d4646,
- 0xd2d2b9ba, 0x3736f0f1, 0xc8c90f0f, 0xf0f13737, 0x0f0ec8c9, 0x46460a0a, 0xb9b9f5f6, 0x0a0a4646,
- 0xf5f5b9ba, 0x4b4b4b4b, 0xb4b4b4b5, 0x5554fafb, 0xaaab0505, 0xfafb5555, 0x0504aaab, 0x3736d2d3,
- 0xc8c92d2d, 0xd2d33737, 0x2d2cc8c9, 0x4b4adcdd, 0xb4b52323, 0xdcdd4b4b, 0x2322b4b5, 0x73733737,
- 0x8c8cc8c9, 0x37377373, 0xc8c88c8d, 0x73731e1e, 0x8c8ce1e2, 0x1e1e7373, 0xe1e18c8d, 0x78785a5a,
- 0x8787a5a6, 0x5a5a7878, 0xa5a58788, 0x6968e1e2, 0x96971e1e, 0xe1e26969, 0x1e1d9697, 0x5554aaab,
- 0xaaab5555, 0x6968b9ba, 0x96974646, 0xb9ba6969, 0x46459697, 0x1e1e1e1e, 0xe1e1e1e2, 0x3c3c3c3c,
- 0xc3c3c3c4, 0x69696969, 0x96969697, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x05050505, 0x05050505,
- 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505,
- 0x05050505, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb,
- 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0x05050000, 0x05050000, 0x05050000, 0x05050000,
- 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0xfafb0000,
- 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000,
- 0xfafb0000, 0xfafb0000, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505,
- 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0xfffffafb, 0xfffffafb, 0xfffffafb,
- 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb,
- 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a,
- 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6,
- 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0x0f0f0505, 0x0f0f0505,
- 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505,
- 0x0f0f0505, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb,
- 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0xf9f9f3f4, 0x0c0bf3f4, 0xf3f40c0c, 0x1211f9fa,
- 0xedee0606, 0xf9fa1212, 0x0605edee, 0x18180c0c, 0xe7e7f3f4, 0x0c0c1818, 0xf3f3e7e8, 0x18181818,
- 0xe7e7e7e8, 0x1e1e0000, 0xe1e20000, 0x00001e1e, 0xffffe1e2, 0x1817edee, 0xe7e81212, 0xedee1818,
- 0x1211e7e8, 0x30301e1e, 0xcfcfe1e2, 0x1e1e3030, 0xe1e1cfd0, 0x2423f9fa, 0xdbdc0606, 0xf9fa2424,
- 0x0605dbdc, 0x30300c0c, 0xcfcff3f4, 0x0c0c3030, 0xf3f3cfd0, 0x30303030, 0xcfcfcfd0, 0x36360000,
- 0xc9ca0000, 0x00003636, 0xffffc9ca, 0x2423dbdc, 0xdbdc2424, 0x302fe7e8, 0xcfd01818, 0xe7e83030,
- 0x1817cfd0, 0x4e4e1e1e, 0xb1b1e1e2, 0x1e1e4e4e, 0xe1e1b1b2, 0x54543636, 0xababc9ca, 0x36365454,
- 0xc9c9abac, 0x4241edee, 0xbdbe1212, 0xedee4242, 0x1211bdbe, 0x54540c0c, 0xababf3f4, 0x0c0c5454,
- 0xf3f3abac, 0x5a5a5a5a, 0xa5a5a5a6, 0x605ff9fa, 0x9fa00606, 0xf9fa6060, 0x06059fa0, 0x4241c9ca,
- 0xbdbe3636, 0xc9ca4242, 0x3635bdbe, 0x5a59d5d6, 0xa5a62a2a, 0xd5d65a5a, 0x2a29a5a6, 0x7e7de1e2,
- 0x81821e1e, 0xe1e27e7e, 0x1e1d8182, 0x6665999a, 0x999a6666, 0x7e7dabac, 0x81825454, 0xabac7e7e,
- 0x54538182, 0x24242424, 0xdbdbdbdc, 0x42424242, 0xbdbdbdbe, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
- 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
- 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
- 0xf9fa0000, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606,
- 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0xfffff9fa, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606,
- 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa,
- 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa,
- 0xf3f3f9fa, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c,
- 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e,
- 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0xf8f8eaeb, 0x0e0df1f2, 0xf1f20e0e, 0x1514f8f9,
- 0xeaeb0707, 0xf8f91515, 0x0706eaeb, 0x1c1c0e0e, 0xe3e3f1f2, 0x0e0e1c1c, 0xf1f1e3e4, 0x1c1c1c1c,
- 0xe3e3e3e4, 0x23230000, 0xdcdd0000, 0x00002323, 0xffffdcdd, 0x1c1beaeb, 0xe3e41515, 0xeaeb1c1c,
- 0x1514e3e4, 0x38382323, 0xc7c7dcdd, 0x23233838, 0xdcdcc7c8, 0x2a29f1f2, 0xd5d60e0e, 0xf1f22a2a,
- 0x0e0dd5d6, 0x38380e0e, 0xc7c7f1f2, 0x0e0e3838, 0xf1f1c7c8, 0x38383838, 0xc7c7c7c8, 0x3f3f0000,
- 0xc0c10000, 0x00003f3f, 0xffffc0c1, 0x2a29d5d6, 0xd5d62a2a, 0x3837e3e4, 0xc7c81c1c, 0xe3e43838,
- 0x1c1bc7c8, 0x5b5b2323, 0xa4a4dcdd, 0x23235b5b, 0xdcdca4a5, 0x62623f3f, 0x9d9dc0c1, 0x3f3f6262,
- 0xc0c09d9e, 0x4d4ceaeb, 0xb2b31515, 0xeaeb4d4d, 0x1514b2b3, 0x62620e0e, 0x9d9df1f2, 0x0e0e6262,
- 0xf1f19d9e, 0x69696969, 0x96969697, 0x7776f8f9, 0x88890707, 0xf8f97777, 0x07068889, 0x4d4cc0c1,
- 0xb2b33f3f, 0xc0c14d4d, 0x3f3eb2b3, 0x6968cecf, 0x96973131, 0xcecf6969, 0x31309697, 0x77768889,
- 0x88897777, 0x2a2a2a2a, 0xd5d5d5d6, 0x4d4d4d4d, 0xb2b2b2b3, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707,
- 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
- 0xf8f8f8f9, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000,
- 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707,
- 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9,
- 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9,
- 0xfffff8f9, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e,
- 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2,
- 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2,
- 0xf1f1f1f2, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707,
- 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9,
- 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9,
- 0xeaeaf8f9, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515,
- 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010,
- 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0xf7f7eff0, 0x100feff0, 0xeff01010, 0x1817f7f8,
- 0xe7e80808, 0xf7f81818, 0x0807e7e8, 0x20201010, 0xdfdfeff0, 0x10102020, 0xefefdfe0, 0x20202020,
- 0xdfdfdfe0, 0x28280000, 0xd7d80000, 0x00002828, 0xffffd7d8, 0x201fe7e8, 0xdfe01818, 0xe7e82020,
- 0x1817dfe0, 0x40402828, 0xbfbfd7d8, 0x28284040, 0xd7d7bfc0, 0x302feff0, 0xcfd01010, 0xeff03030,
- 0x100fcfd0, 0x40401010, 0xbfbfeff0, 0x10104040, 0xefefbfc0, 0x40404040, 0xbfbfbfc0, 0x48480000,
- 0xb7b80000, 0x00004848, 0xffffb7b8, 0x302fcfd0, 0xcfd03030, 0x403fdfe0, 0xbfc02020, 0xdfe04040,
- 0x201fbfc0, 0x68682828, 0x9797d7d8, 0x28286868, 0xd7d79798, 0x70704848, 0x8f8fb7b8, 0x48487070,
- 0xb7b78f90, 0x5857e7e8, 0xa7a81818, 0xe7e85858, 0x1817a7a8, 0x70701010, 0x8f8feff0, 0x10107070,
- 0xefef8f90, 0x78787878, 0x87878788, 0x5857b7b8, 0xa7a84848, 0xb7b85858, 0x4847a7a8, 0x7877c7c8,
- 0x87883838, 0xc7c87878, 0x38378788, 0x30303030, 0xcfcfcfd0, 0x58585858, 0xa7a7a7a8, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808,
- 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8,
- 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000,
- 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0xf7f80000,
- 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000,
- 0xf7f80000, 0xf7f80000, 0xf7f80000, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808,
- 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0xfffff7f8,
- 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8,
- 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010,
- 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0xefefeff0,
- 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0,
- 0xefefeff0, 0xefefeff0, 0xefefeff0, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808,
- 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0xefeff7f8,
- 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8,
- 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010,
- 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212,
- 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x1211edee, 0xedee1212, 0x1b1af6f7,
- 0xe4e50909, 0xf6f71b1b, 0x0908e4e5, 0x24241212, 0xdbdbedee, 0x12122424, 0xededdbdc, 0x24242424,
- 0xdbdbdbdc, 0x2d2d0000, 0xd2d30000, 0x00002d2d, 0xffffd2d3, 0x2423e4e5, 0xdbdc1b1b, 0xe4e52424,
- 0x1b1adbdc, 0x48482d2d, 0xb7b7d2d3, 0x2d2d4848, 0xd2d2b7b8, 0x3635edee, 0xc9ca1212, 0xedee3636,
- 0x1211c9ca, 0x48481212, 0xb7b7edee, 0x12124848, 0xededb7b8, 0x48484848, 0xb7b7b7b8, 0x51510000,
- 0xaeaf0000, 0x00005151, 0xffffaeaf, 0x3635c9ca, 0xc9ca3636, 0x4847dbdc, 0xb7b82424, 0xdbdc4848,
- 0x2423b7b8, 0x75752d2d, 0x8a8ad2d3, 0x2d2d7575, 0xd2d28a8b, 0x7e7e5151, 0x8181aeaf, 0x51517e7e,
- 0xaeae8182, 0x6362e4e5, 0x9c9d1b1b, 0xe4e56363, 0x1b1a9c9d, 0x6362aeaf, 0x9c9d5151, 0xaeaf6363,
- 0x51509c9d, 0x36363636, 0xc9c9c9ca, 0x6c6c6c6c, 0x93939394, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909,
- 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7,
- 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0x09090000, 0x09090000, 0x09090000, 0x09090000,
- 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000,
- 0x09090000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000,
- 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0x00000909, 0x00000909,
- 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909,
- 0x00000909, 0x00000909, 0x00000909, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7,
- 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7,
- 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
- 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0xedededee, 0xedededee, 0xedededee,
- 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee,
- 0xedededee, 0xedededee, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909,
- 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0xe4e4f6f7,
- 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7,
- 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b,
- 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b,
- 0x09091b1b, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5,
- 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0504fafb, 0xfafb0505, 0xfafb0505,
- 0x0504fafb, 0x0b0b0606, 0xf4f4f9fa, 0x06060b0b, 0xf9f9f4f5, 0x08080000, 0xf7f80000, 0x00000808,
- 0xfffff7f8, 0x0b0b0b0b, 0xf4f4f4f5, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x11110c0c,
- 0xeeeef3f4, 0x0c0c1111, 0xf3f3eeef, 0x11111111, 0xeeeeeeef, 0x12120606, 0xededf9fa, 0x06061212,
- 0xf9f9edee, 0x0b0af7f8, 0xf4f50808, 0xf7f80b0b, 0x0807f4f5, 0x0f0f0000, 0xf0f10000, 0x00000f0f,
- 0xfffff0f1, 0x14140000, 0xebec0000, 0x00001414, 0xffffebec, 0x19191212, 0xe6e6edee, 0x12121919,
- 0xedede6e7, 0x19190b0b, 0xe6e6f4f5, 0x0b0b1919, 0xf4f4e6e7, 0x19191919, 0xe6e6e6e7, 0x0e0df1f2,
- 0xf1f20e0e, 0xf1f20e0e, 0x0e0df1f2, 0x1a1a0000, 0xe5e60000, 0x00001a1a, 0xffffe5e6, 0x1211f4f5,
- 0xedee0b0b, 0xf4f51212, 0x0b0aedee, 0x1615f8f9, 0xe9ea0707, 0xf8f91616, 0x0706e9ea, 0x22221a1a,
- 0xdddde5e6, 0x1a1a2222, 0xe5e5ddde, 0x22221212, 0xddddedee, 0x12122222, 0xededddde, 0x22222222,
- 0xddddddde, 0x23230b0b, 0xdcdcf4f5, 0x0b0b2323, 0xf4f4dcdd, 0x1d1d0000, 0xe2e30000, 0x00001d1d,
- 0xffffe2e3, 0x1615eced, 0xe9ea1313, 0xeced1616, 0x1312e9ea, 0x1a19f0f1, 0xe5e60f0f, 0xf0f11a1a,
- 0x0f0ee5e6, 0x25250000, 0xdadb0000, 0x00002525, 0xffffdadb, 0x2c2c1b1b, 0xd3d3e4e5, 0x1b1b2c2c,
- 0xe4e4d3d4, 0x2c2c2424, 0xd3d3dbdc, 0x24242c2c, 0xdbdbd3d4, 0x2c2c1212, 0xd3d3edee, 0x12122c2c,
- 0xededd3d4, 0x2120f5f6, 0xdedf0a0a, 0xf5f62121, 0x0a09dedf, 0x2d2d2d2d, 0xd2d2d2d3, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000,
- 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000,
- 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd,
- 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000,
- 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
- 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303,
- 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000,
- 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000,
- 0xf8f90000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0403fbfc, 0xfbfc0404, 0xf9fa0a0a,
- 0x0605f5f6, 0xf3f40000, 0x0c0c0000, 0xf3f3f9fa, 0xf3f40606, 0x0c0bf9fa, 0x0c0c0606, 0xfffff1f2,
- 0x00000e0e, 0x0c0c0c0c, 0xf3f3f3f4, 0xedee0000, 0x12120000, 0xf3f40e0e, 0x0c0bf1f2, 0xf9f9edee,
- 0xf9fa1212, 0x0605edee, 0x06061212, 0xededf5f6, 0xedee0a0a, 0x1211f5f6, 0x12120a0a, 0xffffe9ea,
- 0x00001616, 0xe7e80000, 0x18180000, 0xf3f3e9ea, 0xf3f41616, 0x0c0be9ea, 0x0c0c1616, 0xe7e7f7f8,
- 0xe7e80808, 0x1817f7f8, 0x18180808, 0xf9f9e5e6, 0xf9fa1a1a, 0x0605e5e6, 0x06061a1a, 0xffffe3e4,
- 0x00001c1c, 0x14141414, 0xebebebec, 0xe5e5f1f2, 0x1a1a0e0e, 0xf3f3e1e2, 0x0c0c1e1e, 0xdfdff5f6,
- 0x20200a0a, 0xdfdfedee, 0x20201212, 0xe5e5e5e6, 0x1a1a1a1a, 0xebebddde, 0x14142222, 0xf3f3d9da,
- 0x0c0c2626, 0xdfdfdfe0, 0x20202020, 0x20202020, 0xd7d7e9ea, 0xddddddde, 0x22222222, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606,
- 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000,
- 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000,
- 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000,
- 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606,
- 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000,
- 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x0605f9fa, 0xf9fa0606, 0xf7f80e0e,
- 0x0807f1f2, 0xffffedee, 0x00001212, 0xeff00a0a, 0x100ff5f6, 0xe7e80000, 0x18180000, 0xf7f7e7e8,
- 0xf7f81818, 0x0807e7e8, 0x08081818, 0x12121212, 0xedededee, 0xeff01414, 0x100febec, 0xe5e5f1f2,
- 0xe5e60e0e, 0x1a19f1f2, 0x1a1a0e0e, 0xffffe1e2, 0x00001e1e, 0xddde0000, 0x22220000, 0xf7f7ddde,
- 0xf7f82222, 0x0807ddde, 0x08082222, 0xedede1e2, 0xedee1e1e, 0x1211e1e2, 0x12121e1e, 0xddddf5f6,
- 0xddde0a0a, 0x2221f5f6, 0x22220a0a, 0xddddebec, 0x22221414, 0xffffd7d8, 0x00002828, 0x1e1e1e1e,
- 0xe1e1e1e2, 0xededd7d8, 0x12122828, 0xd3d40000, 0x2c2c0000, 0xd3d3eff0, 0x2c2c1010, 0xdbdbdbdc,
- 0xdbdbdbdc, 0x24242424, 0xd3d3e5e6, 0x2c2c1a1a, 0xe5e5d1d2, 0x1a1a2e2e, 0xededcbcc, 0x12123434,
- 0xc9c9ebec, 0xd3d3d3d4, 0x2c2c2c2c, 0xc9c9dfe0, 0xd1d1d1d2, 0xd1d1d1d2, 0x2e2e2e2e, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6,
- 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a,
- 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000,
- 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6,
- 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000,
- 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000,
- 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404,
- 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6,
- 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a,
- 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000,
- 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000,
- 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x0807f7f8, 0xf7f80808, 0xeff00808,
- 0x100ff7f8, 0xe7e80000, 0x18180000, 0xf7f7e7e8, 0xf7f81818, 0x0807e7e8, 0x08081818, 0xeff01414,
- 0x100febec, 0xffffe3e4, 0x00001c1c, 0xe7e7eff0, 0xe7e81010, 0x1817eff0, 0x18181010, 0xdfe00000,
- 0x20200000, 0xefefe3e4, 0xeff01c1c, 0x100fe3e4, 0x10101c1c, 0xdfdff7f8, 0xdfe00808, 0xf7f7dfe0,
- 0xf7f82020, 0x0807dfe0, 0x08082020, 0x201ff7f8, 0x20200808, 0x18181818, 0xe7e7e7e8, 0xe7e81818,
- 0x1817e7e8, 0xdfdfebec, 0x20201414, 0xffffd7d8, 0x00002828, 0xefefd7d8, 0x10102828, 0xd3d40000,
- 0xd3d40000, 0xffffd3d4, 0x00002c2c, 0x2c2c0000, 0x2c2c0000, 0xdfdfdfe0, 0x20202020, 0xd3d3eff0,
- 0x2c2c1010, 0xd3d3e7e8, 0xe7e7d3d4, 0x18182c2c, 0x2c2c1818, 0xefefcfd0, 0x10103030, 0xdbdbdbdc,
- 0xdbdbdbdc, 0x24242424, 0x24242424, 0xcbcbebec, 0x28282828, 0xd7d7d7d8, 0xcbcbdfe0, 0x00000000,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404,
- 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c,
- 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000,
- 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000,
- 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4,
- 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000,
- 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000,
- 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404,
- 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404,
- 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c,
- 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000,
- 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000,
- 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
- 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
- 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
- 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
- 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
- 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
- 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
- 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
- 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x04040404,
+ 0xfbfbfbfc, 0x05050101, 0xfafafeff, 0x01010505, 0xfefefafb, 0x0403fbfc, 0xfbfc0404, 0x0605fdfe,
+ 0xf9fa0202, 0xfdfe0606, 0x0201f9fa, 0x09090404, 0xf6f6fbfc, 0x04040909, 0xfbfbf6f7, 0x09090909,
+ 0xf6f6f6f7, 0x0a0a0101, 0xf5f5feff, 0x01010a0a, 0xfefef5f6, 0x0807fafb, 0xf7f80505, 0xfafb0808,
+ 0x0504f7f8, 0x0f0f0909, 0xf0f0f6f7, 0x09090f0f, 0xf6f6f0f1, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
+ 0x0302f3f4, 0x10100404, 0xefeffbfc, 0x04041010, 0xfbfbeff0, 0x10101010, 0xefefeff0, 0x12120000,
+ 0xedee0000, 0x00001212, 0xffffedee, 0x0c0bf3f4, 0xf3f40c0c, 0x100ff6f7, 0xeff00909, 0xf6f71010,
+ 0x0908eff0, 0x1b1b0b0b, 0xe4e4f4f5, 0x0b0b1b1b, 0xf4f4e4e5, 0x1c1c1313, 0xe3e3eced, 0x13131c1c,
+ 0xecece3e4, 0x1615f9fa, 0xe9ea0606, 0xf9fa1616, 0x0605e9ea, 0x1d1d0404, 0xe2e2fbfc, 0x04041d1d,
+ 0xfbfbe2e3, 0x1e1e1e1e, 0xe1e1e1e2, 0x2120fdfe, 0xdedf0202, 0xfdfe2121, 0x0201dedf, 0x1716edee,
+ 0xe8e91212, 0xedee1717, 0x1211e8e9, 0x1e1df0f1, 0xe1e20f0f, 0xf0f11e1e, 0x0f0ee1e2, 0x2e2e1616,
+ 0xd1d1e9ea, 0x16162e2e, 0xe9e9d1d2, 0x2f2f0d0d, 0xd0d0f2f3, 0x0d0d2f2f, 0xf2f2d0d1, 0x31312323,
+ 0xcecedcdd, 0x23233131, 0xdcdccecf, 0x2928f4f5, 0xd6d70b0b, 0xf4f52929, 0x0b0ad6d7, 0x33330404,
+ 0xccccfbfc, 0x04043333, 0xfbfbcccd, 0x36363636, 0xc9c9c9ca, 0x2221ddde, 0xddde2222, 0x2a29e2e3,
+ 0xd5d61d1d, 0xe2e32a2a, 0x1d1cd5d6, 0x3c3bf9fa, 0xc3c40606, 0xf9fa3c3c, 0x0605c3c4, 0x4c4c1b1b,
+ 0xb3b3e4e5, 0x1b1b4c4c, 0xe4e4b3b4, 0x4d4d2b2b, 0xb2b2d4d5, 0x2b2b4d4d, 0xd4d4b2b3, 0x3736e7e8,
+ 0xc8c91818, 0xe7e83737, 0x1817c8c9, 0x4f4f0e0e, 0xb0b0f1f2, 0x0e0e4f4f, 0xf1f1b0b1, 0x53533f3f,
+ 0xacacc0c1, 0x3f3f5353, 0xc0c0acad, 0x4a49ebec, 0xb5b61414, 0xebec4a4a, 0x1413b5b6, 0x58580202,
+ 0xa7a7fdfe, 0x02025858, 0xfdfda7a8, 0x5d5d5d5d, 0xa2a2a2a3, 0x3d3ccbcc, 0xc2c33434, 0xcbcc3d3d,
+ 0x3433c2c3, 0x78783434, 0x8787cbcc, 0x34347878, 0xcbcb8788, 0x4b4ad2d3, 0xb4b52d2d, 0xd2d34b4b,
+ 0x2d2cb4b5, 0x7d7d4b4b, 0x8282b4b5, 0x4b4b7d7d, 0xb4b48283, 0x7a7a2121, 0x8585dedf, 0x21217a7a,
+ 0xdede8586, 0x6766f2f3, 0x98990d0d, 0xf2f36767, 0x0d0c9899, 0x605fd7d8, 0x9fa02828, 0xd7d86060,
+ 0x28279fa0, 0x7f7eddde, 0x80812222, 0xddde7f7f, 0x22218081, 0x5958a6a7, 0xa6a75959, 0x6968b1b2,
+ 0x96974e4e, 0xb1b26969, 0x4e4d9697, 0x0c0c0c0c, 0xf3f3f3f4, 0x17171717, 0xe8e8e8e9, 0x2a2a2a2a,
+ 0xd5d5d5d6, 0x49494949, 0xb6b6b6b7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0x0302feff, 0xfcfd0101,
+ 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfcfd0101, 0xfeff0303, 0xfeff0303,
+ 0xfeff0303, 0xfeff0303, 0xfeff0303, 0xfeff0303, 0xfeff0303, 0x0100fcfd, 0x0100fcfd, 0x0100fcfd,
+ 0x0100fcfd, 0x0100fcfd, 0x0100fcfd, 0x0100fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707,
+ 0xf8f8f8f9, 0x08080202, 0xf7f7fdfe, 0x02020808, 0xfdfdf7f8, 0x0908fdfe, 0xf6f70202, 0xfdfe0909,
+ 0x0201f6f7, 0x0605f9fa, 0xf9fa0606, 0x0d0d0606, 0xf2f2f9fa, 0x06060d0d, 0xf9f9f2f3, 0x0d0d0d0d,
+ 0xf2f2f2f3, 0x0e0e0101, 0xf1f1feff, 0x01010e0e, 0xfefef1f2, 0x0c0bf7f8, 0xf3f40808, 0xf7f80c0c,
+ 0x0807f3f4, 0x17170e0e, 0xe8e8f1f2, 0x0e0e1717, 0xf1f1e8e9, 0x1211fafb, 0xedee0505, 0xfafb1212,
+ 0x0504edee, 0x18180606, 0xe7e7f9fa, 0x06061818, 0xf9f9e7e8, 0x18181818, 0xe7e7e7e8, 0x1b1afeff,
+ 0xe4e50101, 0xfeff1b1b, 0x0100e4e5, 0x1110eeef, 0xeeef1111, 0x1716f2f3, 0xe8e90d0d, 0xf2f31717,
+ 0x0d0ce8e9, 0x28281010, 0xd7d7eff0, 0x10102828, 0xefefd7d8, 0x29291c1c, 0xd6d6e3e4, 0x1c1c2929,
+ 0xe3e3d6d7, 0x2120f6f7, 0xdedf0909, 0xf6f72121, 0x0908dedf, 0x2b2b0606, 0xd4d4f9fa, 0x06062b2b,
+ 0xf9f9d4d5, 0x2e2e2e2e, 0xd1d1d1d2, 0x3231fbfc, 0xcdce0404, 0xfbfc3232, 0x0403cdce, 0x2221e4e5,
+ 0xddde1b1b, 0xe4e52222, 0x1b1addde, 0x2d2ce9ea, 0xd2d31616, 0xe9ea2d2d, 0x1615d2d3, 0x45452222,
+ 0xbabaddde, 0x22224545, 0xddddbabb, 0x46461313, 0xb9b9eced, 0x13134646, 0xececb9ba, 0x49493535,
+ 0xb6b6cacb, 0x35354949, 0xcacab6b7, 0x3e3deeef, 0xc1c21111, 0xeeef3e3e, 0x1110c1c2, 0x4d4d0505,
+ 0xb2b2fafb, 0x05054d4d, 0xfafab2b3, 0x52525252, 0xadadadae, 0x3332cccd, 0xcccd3333, 0x403fd4d5,
+ 0xbfc02b2b, 0xd4d54040, 0x2b2abfc0, 0x5a59f5f6, 0xa5a60a0a, 0xf5f65a5a, 0x0a09a5a6, 0x72722929,
+ 0x8d8dd6d7, 0x29297272, 0xd6d68d8e, 0x74744040, 0x8b8bbfc0, 0x40407474, 0xbfbf8b8c, 0x5251dadb,
+ 0xadae2525, 0xdadb5252, 0x2524adae, 0x77771616, 0x8888e9ea, 0x16167777, 0xe9e98889, 0x7c7c5f5f,
+ 0x8383a0a1, 0x5f5f7c7c, 0xa0a08384, 0x6f6ee1e2, 0x90911e1e, 0xe1e26f6f, 0x1e1d9091, 0x5c5bb1b2,
+ 0xa3a44e4e, 0xb1b25c5c, 0x4e4da3a4, 0x7170bbbc, 0x8e8f4444, 0xbbbc7171, 0x44438e8f, 0x12121212,
+ 0xedededee, 0x22222222, 0xddddddde, 0x3f3f3f3f, 0xc0c0c0c1, 0x6d6d6d6d, 0x92929293, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303,
+ 0x03030303, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd,
+ 0xfcfcfcfd, 0xfcfcfcfd, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff, 0x0403feff,
+ 0x0403feff, 0x0403feff, 0x0403feff, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101,
+ 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfbfc0101, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404,
+ 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0xfeff0404, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc,
+ 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x0100fbfc, 0x07070707, 0x07070707,
+ 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9,
+ 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303,
+ 0xf5f5fcfd, 0x03030a0a, 0xfcfcf5f6, 0x09090909, 0xf6f6f6f7, 0x0706f8f9, 0xf8f90707, 0x0c0bfcfd,
+ 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x11110808, 0xeeeef7f8, 0x08081111, 0xf7f7eeef, 0x11111111,
+ 0xeeeeeeef, 0x13130101, 0xececfeff, 0x01011313, 0xfefeeced, 0x100ff4f5, 0xeff00b0b, 0xf4f51010,
+ 0x0b0aeff0, 0x1716f9fa, 0xe8e90606, 0xf9fa1717, 0x0605e8e9, 0x1f1f1212, 0xe0e0edee, 0x12121f1f,
+ 0xedede0e1, 0x20200808, 0xdfdff7f8, 0x08082020, 0xf7f7dfe0, 0x21212121, 0xdedededf, 0x2423feff,
+ 0xdbdc0101, 0xfeff2424, 0x0100dbdc, 0x1716e8e9, 0xe8e91717, 0x1f1eeeef, 0xe0e11111, 0xeeef1f1f,
+ 0x1110e0e1, 0x36361515, 0xc9c9eaeb, 0x15153636, 0xeaeac9ca, 0x37372525, 0xc8c8dadb, 0x25253737,
+ 0xdadac8c9, 0x2c2bf3f4, 0xd3d40c0c, 0xf3f42c2c, 0x0c0bd3d4, 0x39390808, 0xc6c6f7f8, 0x08083939,
+ 0xf7f7c6c7, 0x3d3d3d3d, 0xc2c2c2c3, 0x4241fafb, 0xbdbe0505, 0xfafb4242, 0x0504bdbe, 0x2d2cdbdc,
+ 0xd2d32424, 0xdbdc2d2d, 0x2423d2d3, 0x3c3be2e3, 0xc3c41d1d, 0xe2e33c3c, 0x1d1cc3c4, 0x5c5c2d2d,
+ 0xa3a3d2d3, 0x2d2d5c5c, 0xd2d2a3a4, 0x5d5d1919, 0xa2a2e6e7, 0x19195d5d, 0xe6e6a2a3, 0x61614747,
+ 0x9e9eb8b9, 0x47476161, 0xb8b89e9f, 0x5352e9ea, 0xacad1616, 0xe9ea5353, 0x1615acad, 0x66660707,
+ 0x9999f8f9, 0x07076666, 0xf8f8999a, 0x6d6d6d6d, 0x92929293, 0x4443bbbc, 0xbbbc4444, 0x5554c6c7,
+ 0xaaab3939, 0xc6c75555, 0x3938aaab, 0x7877f2f3, 0x87880d0d, 0xf2f37878, 0x0d0c8788, 0x6e6dcecf,
+ 0x91923131, 0xcecf6e6e, 0x31309192, 0x7b7a9798, 0x84856868, 0x97987b7b, 0x68678485, 0x18181818,
+ 0xe7e7e7e8, 0x2e2e2e2e, 0xd1d1d1d2, 0x54545454, 0xabababac, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040404,
+ 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
+ 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
+ 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff,
+ 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0x0504feff, 0xfafb0101, 0xfafb0101, 0xfafb0101,
+ 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfafb0101, 0xfeff0505,
+ 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505, 0xfeff0505,
+ 0xfeff0505, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0100fafb,
+ 0x0100fafb, 0x0100fafb, 0x0100fafb, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303,
+ 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0x0a0a0303, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd,
+ 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0xf5f5fcfd, 0x03030a0a,
+ 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a, 0x03030a0a,
+ 0x03030a0a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b,
+ 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x03030d0d, 0xfcfcf2f3, 0x0908f6f7, 0xf6f70909, 0x0f0efbfc,
+ 0xf0f10404, 0xfbfc0f0f, 0x0403f0f1, 0x16160b0b, 0xe9e9f4f5, 0x0b0b1616, 0xf4f4e9ea, 0x15151515,
+ 0xeaeaeaeb, 0x18180202, 0xe7e7fdfe, 0x02021818, 0xfdfde7e8, 0x1413f1f2, 0xebec0e0e, 0xf1f21414,
+ 0x0e0debec, 0x26261717, 0xd9d9e8e9, 0x17172626, 0xe8e8d9da, 0x1d1cf7f8, 0xe2e30808, 0xf7f81d1d,
+ 0x0807e2e3, 0x27270b0b, 0xd8d8f4f5, 0x0b0b2727, 0xf4f4d8d9, 0x29292929, 0xd6d6d6d7, 0x2d2cfeff,
+ 0xd2d30101, 0xfeff2d2d, 0x0100d2d3, 0x1d1ce2e3, 0xe2e31d1d, 0x2726e9ea, 0xd8d91616, 0xe9ea2727,
+ 0x1615d8d9, 0x43431b1b, 0xbcbce4e5, 0x1b1b4343, 0xe4e4bcbd, 0x45452f2f, 0xbabad0d1, 0x2f2f4545,
+ 0xd0d0babb, 0x3837f0f1, 0xc7c80f0f, 0xf0f13838, 0x0f0ec7c8, 0x47470b0b, 0xb8b8f4f5, 0x0b0b4747,
+ 0xf4f4b8b9, 0x4c4c4c4c, 0xb3b3b3b4, 0x5352f9fa, 0xacad0606, 0xf9fa5353, 0x0605acad, 0x3938d2d3,
+ 0xc6c72d2d, 0xd2d33939, 0x2d2cc6c7, 0x4b4adbdc, 0xb4b52424, 0xdbdc4b4b, 0x2423b4b5, 0x73733838,
+ 0x8c8cc7c8, 0x38387373, 0xc7c78c8d, 0x75751f1f, 0x8a8ae0e1, 0x1f1f7575, 0xe0e08a8b, 0x7a7a5858,
+ 0x8585a7a8, 0x58587a7a, 0xa7a78586, 0x6867e3e4, 0x97981c1c, 0xe3e46868, 0x1c1b9798, 0x5554aaab,
+ 0xaaab5555, 0x6a69b7b8, 0x95964848, 0xb7b86a6a, 0x48479596, 0x1e1e1e1e, 0xe1e1e1e2, 0x3a3a3a3a,
+ 0xc5c5c5c6, 0x69696969, 0x96969697, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x05050505, 0x05050505,
+ 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505,
+ 0x05050505, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb,
+ 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe,
+ 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0x0706fdfe, 0xf8f90202,
+ 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202, 0xf8f90202,
+ 0xf8f90202, 0xf8f90202, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707,
+ 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0xfdfe0707, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9,
+ 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9, 0x0201f8f9,
+ 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b,
+ 0x0b0b0b0b, 0x0b0b0b0b, 0x0b0b0b0b, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5,
+ 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0xf4f4f4f5, 0x0d0d0303, 0x0d0d0303,
+ 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303, 0x0d0d0303,
+ 0x0d0d0303, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd,
+ 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0xf2f2fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d,
+ 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0xfbfbf0f1, 0x0b0af4f5, 0xf4f50b0b, 0x1211fafb,
+ 0xedee0505, 0xfafb1212, 0x0504edee, 0x1a1a0d0d, 0xe5e5f2f3, 0x0d0d1a1a, 0xf2f2e5e6, 0x1a1a1a1a,
+ 0xe5e5e5e6, 0x1d1d0202, 0xe2e2fdfe, 0x02021d1d, 0xfdfde2e3, 0x1817eff0, 0xe7e81010, 0xeff01818,
+ 0x100fe7e8, 0x2e2e1c1c, 0xd1d1e3e4, 0x1c1c2e2e, 0xe3e3d1d2, 0x2322f6f7, 0xdcdd0909, 0xf6f72323,
+ 0x0908dcdd, 0x2f2f0d0d, 0xd0d0f2f3, 0x0d0d2f2f, 0xf2f2d0d1, 0x31313131, 0xcecececf, 0x3635feff,
+ 0xc9ca0101, 0xfeff3636, 0x0100c9ca, 0x2322dcdd, 0xdcdd2323, 0x2f2ee5e6, 0xd0d11a1a, 0xe5e62f2f,
+ 0x1a19d0d1, 0x51512020, 0xaeaedfe0, 0x20205151, 0xdfdfaeaf, 0x53533838, 0xacacc7c8, 0x38385353,
+ 0xc7c7acad, 0x4342edee, 0xbcbd1212, 0xedee4343, 0x1211bcbd, 0x56560d0d, 0xa9a9f2f3, 0x0d0d5656,
+ 0xf2f2a9aa, 0x5b5b5b5b, 0xa4a4a4a5, 0x6362f8f9, 0x9c9d0707, 0xf8f96363, 0x07069c9d, 0x4443c9ca,
+ 0xbbbc3636, 0xc9ca4444, 0x3635bbbc, 0x5a59d3d4, 0xa5a62c2c, 0xd3d45a5a, 0x2c2ba5a6, 0x7c7bdedf,
+ 0x83842121, 0xdedf7c7c, 0x21208384, 0x67669899, 0x98996767, 0x7f7ea9aa, 0x80815656, 0xa9aa7f7f,
+ 0x56558081, 0x25252525, 0xdadadadb, 0x45454545, 0xbabababb, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe,
+ 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0x0807fdfe, 0xf7f80202, 0xf7f80202, 0xf7f80202,
+ 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202, 0xf7f80202,
+ 0xf7f80202, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808,
+ 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0xfdfe0808, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8,
+ 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8, 0x0201f7f8,
+ 0x0201f7f8, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d,
+ 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0x0d0d0d0d, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3,
+ 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3, 0xf2f2f2f3,
+ 0xf2f2f2f3, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404,
+ 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0x0f0f0404, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc,
+ 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc, 0xf0f0fbfc,
+ 0xf0f0fbfc, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f,
+ 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x04040f0f, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010,
+ 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0xfafaedee, 0x0d0cf2f3, 0xf2f30d0d, 0x1514f9fa,
+ 0xeaeb0606, 0xf9fa1515, 0x0605eaeb, 0x1e1e0f0f, 0xe1e1f0f1, 0x0f0f1e1e, 0xf0f0e1e2, 0x1e1e1e1e,
+ 0xe1e1e1e2, 0x22220202, 0xddddfdfe, 0x02022222, 0xfdfdddde, 0x1c1beced, 0xe3e41313, 0xeced1c1c,
+ 0x1312e3e4, 0x36362020, 0xc9c9dfe0, 0x20203636, 0xdfdfc9ca, 0x2928f4f5, 0xd6d70b0b, 0xf4f52929,
+ 0x0b0ad6d7, 0x37370f0f, 0xc8c8f0f1, 0x0f0f3737, 0xf0f0c8c9, 0x39393939, 0xc6c6c6c7, 0x3f3efeff,
+ 0xc0c10101, 0xfeff3f3f, 0x0100c0c1, 0x2827d7d8, 0xd7d82828, 0x3736e1e2, 0xc8c91e1e, 0xe1e23737,
+ 0x1e1dc8c9, 0x5e5e2525, 0xa1a1dadb, 0x25255e5e, 0xdadaa1a2, 0x60604141, 0x9f9fbebf, 0x41416060,
+ 0xbebe9fa0, 0x4e4deaeb, 0xb1b21515, 0xeaeb4e4e, 0x1514b1b2, 0x64640f0f, 0x9b9bf0f1, 0x0f0f6464,
+ 0xf0f09b9c, 0x6a6a6a6a, 0x95959596, 0x7473f7f8, 0x8b8c0808, 0xf7f87474, 0x08078b8c, 0x4f4ec0c1,
+ 0xb0b13f3f, 0xc0c14f4f, 0x3f3eb0b1, 0x6968cccd, 0x96973333, 0xcccd6969, 0x33329697, 0x78778788,
+ 0x87887878, 0x2b2b2b2b, 0xd4d4d4d5, 0x50505050, 0xafafafb0, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707,
+ 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
+ 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
+ 0xf8f8f8f9, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd,
+ 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0x0a09fcfd, 0xf5f60303, 0xf5f60303, 0xf5f60303,
+ 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303, 0xf5f60303,
+ 0xf5f60303, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a,
+ 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0xfcfd0a0a, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6,
+ 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6, 0x0302f5f6,
+ 0x0302f5f6, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010,
+ 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0xefefeff0, 0xefefeff0, 0xefefeff0,
+ 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0,
+ 0xefefeff0, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505,
+ 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0x12120505, 0xededfafb, 0xededfafb, 0xededfafb,
+ 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb, 0xededfafb,
+ 0xededfafb, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212,
+ 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x05051212, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212,
+ 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0xfafaebec, 0x0f0ef0f1, 0xf0f10f0f, 0x1817f8f9,
+ 0xe7e80707, 0xf8f91818, 0x0706e7e8, 0x23231111, 0xdcdceeef, 0x11112323, 0xeeeedcdd, 0x22222222,
+ 0xddddddde, 0x26260303, 0xd9d9fcfd, 0x03032626, 0xfcfcd9da, 0x201fe9ea, 0xdfe01616, 0xe9ea2020,
+ 0x1615dfe0, 0x3d3d2525, 0xc2c2dadb, 0x25253d3d, 0xdadac2c3, 0x2f2ef2f3, 0xd0d10d0d, 0xf2f32f2f,
+ 0x0d0cd0d1, 0x3f3f1111, 0xc0c0eeef, 0x11113f3f, 0xeeeec0c1, 0x41414141, 0xbebebebf, 0x4847feff,
+ 0xb7b80101, 0xfeff4848, 0x0100b7b8, 0x2e2dd1d2, 0xd1d22e2e, 0x3f3edcdd, 0xc0c12323, 0xdcdd3f3f,
+ 0x2322c0c1, 0x6b6b2b2b, 0x9494d4d5, 0x2b2b6b6b, 0xd4d49495, 0x6e6e4b4b, 0x9191b4b5, 0x4b4b6e6e,
+ 0xb4b49192, 0x5958e7e8, 0xa6a71818, 0xe7e85959, 0x1817a6a7, 0x72721111, 0x8d8deeef, 0x11117272,
+ 0xeeee8d8e, 0x79797979, 0x86868687, 0x5b5ab7b8, 0xa4a54848, 0xb7b85b5b, 0x4847a4a5, 0x7877c5c6,
+ 0x87883a3a, 0xc5c67878, 0x3a398788, 0x31313131, 0xcecececf, 0x5c5c5c5c, 0xa3a3a3a4, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808,
+ 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0xf7f7f7f8,
+ 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8,
+ 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd,
+ 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0x0b0afcfd, 0xf4f50303,
+ 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xf4f50303,
+ 0xf4f50303, 0xf4f50303, 0xf4f50303, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b,
+ 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0xfcfd0b0b, 0x0302f4f5,
+ 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x0302f4f5,
+ 0x0302f4f5, 0x0302f4f5, 0x0302f4f5, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
+ 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0xedededee,
+ 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee,
+ 0xedededee, 0xedededee, 0xedededee, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505,
+ 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0x14140505, 0xebebfafb,
+ 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb, 0xebebfafb,
+ 0xebebfafb, 0xebebfafb, 0xebebfafb, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414,
+ 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x05051414, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414,
+ 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x1110eeef, 0xeeef1111, 0x1b1af8f9,
+ 0xe4e50707, 0xf8f91b1b, 0x0706e4e5, 0x27271313, 0xd8d8eced, 0x13132727, 0xececd8d9, 0x27272727,
+ 0xd8d8d8d9, 0x2b2b0303, 0xd4d4fcfd, 0x03032b2b, 0xfcfcd4d5, 0x2423e7e8, 0xdbdc1818, 0xe7e82424,
+ 0x1817dbdc, 0x45452a2a, 0xbabad5d6, 0x2a2a4545, 0xd5d5babb, 0x3534f1f2, 0xcacb0e0e, 0xf1f23535,
+ 0x0e0dcacb, 0x47471313, 0xb8b8eced, 0x13134747, 0xececb8b9, 0x49494949, 0xb6b6b6b7, 0x504ffdfe,
+ 0xafb00202, 0xfdfe5050, 0x0201afb0, 0x3433cbcc, 0xcbcc3434, 0x4645d8d9, 0xb9ba2727, 0xd8d94646,
+ 0x2726b9ba, 0x79793030, 0x8686cfd0, 0x30307979, 0xcfcf8687, 0x7c7c5454, 0x8383abac, 0x54547c7c,
+ 0xabab8384, 0x6463e4e5, 0x9b9c1b1b, 0xe4e56464, 0x1b1a9b9c, 0x6665aeaf, 0x999a5151, 0xaeaf6666,
+ 0x5150999a, 0x37373737, 0xc8c8c8c9, 0x68686868, 0x97979798, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909,
+ 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0xf6f6f6f7,
+ 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7,
+ 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd,
+ 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd, 0x0c0bfcfd,
+ 0x0c0bfcfd, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303,
+ 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xf3f40303, 0xfcfd0c0c, 0xfcfd0c0c,
+ 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c,
+ 0xfcfd0c0c, 0xfcfd0c0c, 0xfcfd0c0c, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4,
+ 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4, 0x0302f3f4,
+ 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
+ 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec, 0xebebebec, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606,
+ 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0x17170606, 0xe8e8f9fa,
+ 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa,
+ 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0xe8e8f9fa, 0x06061717, 0x06061717, 0x06061717, 0x06061717,
+ 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717, 0x06061717,
+ 0x06061717, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9,
+ 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0xf9f9e8e9, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404,
+ 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x0403fbfc, 0xfbfc0404, 0x0605fdfe,
+ 0xf9fa0202, 0xfdfe0606, 0x0201f9fa, 0x08080404, 0xf7f7fbfc, 0x04040808, 0xfbfbf7f8, 0x08080808,
+ 0xf7f7f7f8, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x0807fbfc, 0xf7f80404, 0xfbfc0808,
+ 0x0403f7f8, 0x0e0e0808, 0xf1f1f7f8, 0x08080e0e, 0xf7f7f1f2, 0x0c0bfdfe, 0xf3f40202, 0xfdfe0c0c,
+ 0x0201f3f4, 0x10100404, 0xefeffbfc, 0x04041010, 0xfbfbeff0, 0x10101010, 0xefefeff0, 0x12120000,
+ 0xedee0000, 0x00001212, 0xffffedee, 0x0c0bf3f4, 0xf3f40c0c, 0x100ff7f8, 0xeff00808, 0xf7f81010,
+ 0x0807eff0, 0x1a1a0a0a, 0xe5e5f5f6, 0x0a0a1a1a, 0xf5f5e5e6, 0x1c1c1212, 0xe3e3edee, 0x12121c1c,
+ 0xedede3e4, 0x1615f9fa, 0xe9ea0606, 0xf9fa1616, 0x0605e9ea, 0x1c1c0404, 0xe3e3fbfc, 0x04041c1c,
+ 0xfbfbe3e4, 0x1e1e1e1e, 0xe1e1e1e2, 0x201ffdfe, 0xdfe00202, 0xfdfe2020, 0x0201dfe0, 0x1615edee,
+ 0xe9ea1212, 0xedee1616, 0x1211e9ea, 0x1e1df1f2, 0xe1e20e0e, 0xf1f21e1e, 0x0e0de1e2, 0x2e2e1616,
+ 0xd1d1e9ea, 0x16162e2e, 0xe9e9d1d2, 0x2e2e0c0c, 0xd1d1f3f4, 0x0c0c2e2e, 0xf3f3d1d2, 0x30302222,
+ 0xcfcfddde, 0x22223030, 0xddddcfd0, 0x2827f5f6, 0xd7d80a0a, 0xf5f62828, 0x0a09d7d8, 0x32320404,
+ 0xcdcdfbfc, 0x04043232, 0xfbfbcdce, 0x36363636, 0xc9c9c9ca, 0x2221ddde, 0xddde2222, 0x2a29e3e4,
+ 0xd5d61c1c, 0xe3e42a2a, 0x1c1bd5d6, 0x3c3bf9fa, 0xc3c40606, 0xf9fa3c3c, 0x0605c3c4, 0x4c4c1a1a,
+ 0xb3b3e5e6, 0x1a1a4c4c, 0xe5e5b3b4, 0x4c4c2a2a, 0xb3b3d5d6, 0x2a2a4c4c, 0xd5d5b3b4, 0x3635e7e8,
+ 0xc9ca1818, 0xe7e83636, 0x1817c9ca, 0x4e4e0e0e, 0xb1b1f1f2, 0x0e0e4e4e, 0xf1f1b1b2, 0x52523e3e,
+ 0xadadc1c2, 0x3e3e5252, 0xc1c1adae, 0x4a49ebec, 0xb5b61414, 0xebec4a4a, 0x1413b5b6, 0x58580202,
+ 0xa7a7fdfe, 0x02025858, 0xfdfda7a8, 0x5c5c5c5c, 0xa3a3a3a4, 0x3c3bcbcc, 0xc3c43434, 0xcbcc3c3c,
+ 0x3433c3c4, 0x76763434, 0x8989cbcc, 0x34347676, 0xcbcb898a, 0x4a49d3d4, 0xb5b62c2c, 0xd3d44a4a,
+ 0x2c2bb5b6, 0x76764a4a, 0x8989b5b6, 0x4a4a7676, 0xb5b5898a, 0x76762020, 0x8989dfe0, 0x20207676,
+ 0xdfdf898a, 0x6665f3f4, 0x999a0c0c, 0xf3f46666, 0x0c0b999a, 0x605fd7d8, 0x9fa02828, 0xd7d86060,
+ 0x28279fa0, 0x7675ddde, 0x898a2222, 0xddde7676, 0x2221898a, 0x5857a7a8, 0xa7a85858, 0x6867b1b2,
+ 0x97984e4e, 0xb1b26868, 0x4e4d9798, 0x0c0c0c0c, 0xf3f3f3f4, 0x16161616, 0xe9e9e9ea, 0x2a2a2a2a,
+ 0xd5d5d5d6, 0x48484848, 0xb7b7b7b8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0xfdfe0000,
+ 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
+ 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
+ 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
+ 0xf9f9f9fa, 0x09090303, 0xf6f6fcfd, 0x03030909, 0xfcfcf6f7, 0x0908fcfd, 0xf6f70303, 0xfcfd0909,
+ 0x0302f6f7, 0x0605f9fa, 0xf9fa0606, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0xf9f9f3f4, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x0f0f0000, 0xf0f10000, 0x00000f0f, 0xfffff0f1, 0x0c0bf6f7, 0xf3f40909, 0xf6f70c0c,
+ 0x0908f3f4, 0x18180f0f, 0xe7e7f0f1, 0x0f0f1818, 0xf0f0e7e8, 0x1211f9fa, 0xedee0606, 0xf9fa1212,
+ 0x0605edee, 0x18180606, 0xe7e7f9fa, 0x06061818, 0xf9f9e7e8, 0x18181818, 0xe7e7e7e8, 0x1b1b0000,
+ 0xe4e50000, 0x00001b1b, 0xffffe4e5, 0x1211edee, 0xedee1212, 0x1817f3f4, 0xe7e80c0c, 0xf3f41818,
+ 0x0c0be7e8, 0x27270f0f, 0xd8d8f0f1, 0x0f0f2727, 0xf0f0d8d9, 0x2a2a1b1b, 0xd5d5e4e5, 0x1b1b2a2a,
+ 0xe4e4d5d6, 0x2120f6f7, 0xdedf0909, 0xf6f72121, 0x0908dedf, 0x2a2a0606, 0xd5d5f9fa, 0x06062a2a,
+ 0xf9f9d5d6, 0x2d2d2d2d, 0xd2d2d2d3, 0x3332fcfd, 0xcccd0303, 0xfcfd3333, 0x0302cccd, 0x2120e4e5,
+ 0xdedf1b1b, 0xe4e52121, 0x1b1adedf, 0x2d2ceaeb, 0xd2d31515, 0xeaeb2d2d, 0x1514d2d3, 0x45452121,
+ 0xbabadedf, 0x21214545, 0xdedebabb, 0x45451212, 0xbabaedee, 0x12124545, 0xededbabb, 0x48483636,
+ 0xb7b7c9ca, 0x36364848, 0xc9c9b7b8, 0x3f3eedee, 0xc0c11212, 0xedee3f3f, 0x1211c0c1, 0x4e4e0606,
+ 0xb1b1f9fa, 0x06064e4e, 0xf9f9b1b2, 0x51515151, 0xaeaeaeaf, 0x3332cccd, 0xcccd3333, 0x3f3ed5d6,
+ 0xc0c12a2a, 0xd5d63f3f, 0x2a29c0c1, 0x5a59f6f7, 0xa5a60909, 0xf6f75a5a, 0x0908a5a6, 0x72722a2a,
+ 0x8d8dd5d6, 0x2a2a7272, 0xd5d58d8e, 0x75753f3f, 0x8a8ac0c1, 0x3f3f7575, 0xc0c08a8b, 0x5150dbdc,
+ 0xaeaf2424, 0xdbdc5151, 0x2423aeaf, 0x78781515, 0x8787eaeb, 0x15157878, 0xeaea8788, 0x7b7b6060,
+ 0x84849fa0, 0x60607b7b, 0x9f9f8485, 0x6f6ee1e2, 0x90911e1e, 0xe1e26f6f, 0x1e1d9091, 0x5d5cb1b2,
+ 0xa2a34e4e, 0xb1b25d5d, 0x4e4da2a3, 0x7271babb, 0x8d8e4545, 0xbabb7272, 0x45448d8e, 0x12121212,
+ 0xedededee, 0x21212121, 0xdedededf, 0x3f3f3f3f, 0xc0c0c0c1, 0x6c6c6c6c, 0x93939394, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303, 0x03030303,
+ 0x03030303, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd, 0xfcfcfcfd,
+ 0xfcfcfcfd, 0xfcfcfcfd, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000,
+ 0x03030000, 0x03030000, 0x03030000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000,
+ 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0x00000303, 0x00000303, 0x00000303, 0x00000303,
+ 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd,
+ 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404,
+ 0xf7f7fbfc, 0x04040808, 0xfbfbf7f8, 0x08080808, 0xf7f7f7f8, 0x0807f7f8, 0xf7f80808, 0x0c0bfbfc,
+ 0xf3f40404, 0xfbfc0c0c, 0x0403f3f4, 0x10100808, 0xefeff7f8, 0x08081010, 0xf7f7eff0, 0x10101010,
+ 0xefefeff0, 0x14140000, 0xebec0000, 0x00001414, 0xffffebec, 0x100ff3f4, 0xeff00c0c, 0xf3f41010,
+ 0x0c0beff0, 0x1817fbfc, 0xe7e80404, 0xfbfc1818, 0x0403e7e8, 0x20201010, 0xdfdfeff0, 0x10102020,
+ 0xefefdfe0, 0x20200808, 0xdfdff7f8, 0x08082020, 0xf7f7dfe0, 0x20202020, 0xdfdfdfe0, 0x24240000,
+ 0xdbdc0000, 0x00002424, 0xffffdbdc, 0x1817e7e8, 0xe7e81818, 0x201feff0, 0xdfe01010, 0xeff02020,
+ 0x100fdfe0, 0x34341414, 0xcbcbebec, 0x14143434, 0xebebcbcc, 0x38382424, 0xc7c7dbdc, 0x24243838,
+ 0xdbdbc7c8, 0x2c2bf3f4, 0xd3d40c0c, 0xf3f42c2c, 0x0c0bd3d4, 0x38380808, 0xc7c7f7f8, 0x08083838,
+ 0xf7f7c7c8, 0x3c3c3c3c, 0xc3c3c3c4, 0x403ffbfc, 0xbfc00404, 0xfbfc4040, 0x0403bfc0, 0x2c2bdbdc,
+ 0xd3d42424, 0xdbdc2c2c, 0x2423d3d4, 0x3c3be3e4, 0xc3c41c1c, 0xe3e43c3c, 0x1c1bc3c4, 0x5c5c2c2c,
+ 0xa3a3d3d4, 0x2c2c5c5c, 0xd3d3a3a4, 0x5c5c1818, 0xa3a3e7e8, 0x18185c5c, 0xe7e7a3a4, 0x60604848,
+ 0x9f9fb7b8, 0x48486060, 0xb7b79fa0, 0x5453ebec, 0xabac1414, 0xebec5454, 0x1413abac, 0x64640808,
+ 0x9b9bf7f8, 0x08086464, 0xf7f79b9c, 0x6c6c6c6c, 0x93939394, 0x4443bbbc, 0xbbbc4444, 0x5453c7c8,
+ 0xabac3838, 0xc7c85454, 0x3837abac, 0x7877f3f4, 0x87880c0c, 0xf3f47878, 0x0c0b8788, 0x6c6bcfd0,
+ 0x93943030, 0xcfd06c6c, 0x302f9394, 0x7c7b9798, 0x83846868, 0x97987c7c, 0x68678384, 0x18181818,
+ 0xe7e7e7e8, 0x2c2c2c2c, 0xd3d3d3d4, 0x54545454, 0xabababac, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040404,
+ 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
+ 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
+ 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
+ 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000,
+ 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0x00000404,
+ 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404,
+ 0x00000404, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
+ 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0x08080404,
+ 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0x08080404, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc,
+ 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0xf7f7fbfc, 0x04040808,
+ 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808, 0x04040808,
+ 0x04040808, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a,
+ 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x05050f0f, 0xfafaf0f1, 0x0a09f5f6, 0xf5f60a0a, 0x0f0efafb,
+ 0xf0f10505, 0xfafb0f0f, 0x0504f0f1, 0x14140a0a, 0xebebf5f6, 0x0a0a1414, 0xf5f5ebec, 0x14141414,
+ 0xebebebec, 0x19190000, 0xe6e70000, 0x00001919, 0xffffe6e7, 0x1413f0f1, 0xebec0f0f, 0xf0f11414,
+ 0x0f0eebec, 0x28281919, 0xd7d7e6e7, 0x19192828, 0xe6e6d7d8, 0x1e1df5f6, 0xe1e20a0a, 0xf5f61e1e,
+ 0x0a09e1e2, 0x28280a0a, 0xd7d7f5f6, 0x0a0a2828, 0xf5f5d7d8, 0x28282828, 0xd7d7d7d8, 0x2d2d0000,
+ 0xd2d30000, 0x00002d2d, 0xffffd2d3, 0x1e1de1e2, 0xe1e21e1e, 0x2827ebec, 0xd7d81414, 0xebec2828,
+ 0x1413d7d8, 0x41411919, 0xbebee6e7, 0x19194141, 0xe6e6bebf, 0x46462d2d, 0xb9b9d2d3, 0x2d2d4646,
+ 0xd2d2b9ba, 0x3736f0f1, 0xc8c90f0f, 0xf0f13737, 0x0f0ec8c9, 0x46460a0a, 0xb9b9f5f6, 0x0a0a4646,
+ 0xf5f5b9ba, 0x4b4b4b4b, 0xb4b4b4b5, 0x5554fafb, 0xaaab0505, 0xfafb5555, 0x0504aaab, 0x3736d2d3,
+ 0xc8c92d2d, 0xd2d33737, 0x2d2cc8c9, 0x4b4adcdd, 0xb4b52323, 0xdcdd4b4b, 0x2322b4b5, 0x73733737,
+ 0x8c8cc8c9, 0x37377373, 0xc8c88c8d, 0x73731e1e, 0x8c8ce1e2, 0x1e1e7373, 0xe1e18c8d, 0x78785a5a,
+ 0x8787a5a6, 0x5a5a7878, 0xa5a58788, 0x6968e1e2, 0x96971e1e, 0xe1e26969, 0x1e1d9697, 0x5554aaab,
+ 0xaaab5555, 0x6968b9ba, 0x96974646, 0xb9ba6969, 0x46459697, 0x1e1e1e1e, 0xe1e1e1e2, 0x3c3c3c3c,
+ 0xc3c3c3c4, 0x69696969, 0x96969697, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x05050505, 0x05050505,
+ 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505, 0x05050505,
+ 0x05050505, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb,
+ 0xfafafafb, 0xfafafafb, 0xfafafafb, 0xfafafafb, 0x05050000, 0x05050000, 0x05050000, 0x05050000,
+ 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0x05050000, 0xfafb0000,
+ 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000, 0xfafb0000,
+ 0xfafb0000, 0xfafb0000, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505,
+ 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0x00000505, 0xfffffafb, 0xfffffafb, 0xfffffafb,
+ 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb, 0xfffffafb,
+ 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a,
+ 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6,
+ 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0x0f0f0505, 0x0f0f0505,
+ 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505, 0x0f0f0505,
+ 0x0f0f0505, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb,
+ 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0xf0f0fafb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0xf9f9f3f4, 0x0c0bf3f4, 0xf3f40c0c, 0x1211f9fa,
+ 0xedee0606, 0xf9fa1212, 0x0605edee, 0x18180c0c, 0xe7e7f3f4, 0x0c0c1818, 0xf3f3e7e8, 0x18181818,
+ 0xe7e7e7e8, 0x1e1e0000, 0xe1e20000, 0x00001e1e, 0xffffe1e2, 0x1817edee, 0xe7e81212, 0xedee1818,
+ 0x1211e7e8, 0x30301e1e, 0xcfcfe1e2, 0x1e1e3030, 0xe1e1cfd0, 0x2423f9fa, 0xdbdc0606, 0xf9fa2424,
+ 0x0605dbdc, 0x30300c0c, 0xcfcff3f4, 0x0c0c3030, 0xf3f3cfd0, 0x30303030, 0xcfcfcfd0, 0x36360000,
+ 0xc9ca0000, 0x00003636, 0xffffc9ca, 0x2423dbdc, 0xdbdc2424, 0x302fe7e8, 0xcfd01818, 0xe7e83030,
+ 0x1817cfd0, 0x4e4e1e1e, 0xb1b1e1e2, 0x1e1e4e4e, 0xe1e1b1b2, 0x54543636, 0xababc9ca, 0x36365454,
+ 0xc9c9abac, 0x4241edee, 0xbdbe1212, 0xedee4242, 0x1211bdbe, 0x54540c0c, 0xababf3f4, 0x0c0c5454,
+ 0xf3f3abac, 0x5a5a5a5a, 0xa5a5a5a6, 0x605ff9fa, 0x9fa00606, 0xf9fa6060, 0x06059fa0, 0x4241c9ca,
+ 0xbdbe3636, 0xc9ca4242, 0x3635bdbe, 0x5a59d5d6, 0xa5a62a2a, 0xd5d65a5a, 0x2a29a5a6, 0x7e7de1e2,
+ 0x81821e1e, 0xe1e27e7e, 0x1e1d8182, 0x6665999a, 0x999a6666, 0x7e7dabac, 0x81825454, 0xabac7e7e,
+ 0x54538182, 0x24242424, 0xdbdbdbdc, 0x42424242, 0xbdbdbdbe, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
+ 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
+ 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
+ 0xf9fa0000, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606,
+ 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
+ 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
+ 0xfffff9fa, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606,
+ 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0x0c0c0606, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa,
+ 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa, 0xf3f3f9fa,
+ 0xf3f3f9fa, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c,
+ 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x06060c0c, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e,
+ 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0xf8f8eaeb, 0x0e0df1f2, 0xf1f20e0e, 0x1514f8f9,
+ 0xeaeb0707, 0xf8f91515, 0x0706eaeb, 0x1c1c0e0e, 0xe3e3f1f2, 0x0e0e1c1c, 0xf1f1e3e4, 0x1c1c1c1c,
+ 0xe3e3e3e4, 0x23230000, 0xdcdd0000, 0x00002323, 0xffffdcdd, 0x1c1beaeb, 0xe3e41515, 0xeaeb1c1c,
+ 0x1514e3e4, 0x38382323, 0xc7c7dcdd, 0x23233838, 0xdcdcc7c8, 0x2a29f1f2, 0xd5d60e0e, 0xf1f22a2a,
+ 0x0e0dd5d6, 0x38380e0e, 0xc7c7f1f2, 0x0e0e3838, 0xf1f1c7c8, 0x38383838, 0xc7c7c7c8, 0x3f3f0000,
+ 0xc0c10000, 0x00003f3f, 0xffffc0c1, 0x2a29d5d6, 0xd5d62a2a, 0x3837e3e4, 0xc7c81c1c, 0xe3e43838,
+ 0x1c1bc7c8, 0x5b5b2323, 0xa4a4dcdd, 0x23235b5b, 0xdcdca4a5, 0x62623f3f, 0x9d9dc0c1, 0x3f3f6262,
+ 0xc0c09d9e, 0x4d4ceaeb, 0xb2b31515, 0xeaeb4d4d, 0x1514b2b3, 0x62620e0e, 0x9d9df1f2, 0x0e0e6262,
+ 0xf1f19d9e, 0x69696969, 0x96969697, 0x7776f8f9, 0x88890707, 0xf8f97777, 0x07068889, 0x4d4cc0c1,
+ 0xb2b33f3f, 0xc0c14d4d, 0x3f3eb2b3, 0x6968cecf, 0x96973131, 0xcecf6969, 0x31309697, 0x77768889,
+ 0x88897777, 0x2a2a2a2a, 0xd5d5d5d6, 0x4d4d4d4d, 0xb2b2b2b3, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707,
+ 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0x07070707, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
+ 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9, 0xf8f8f8f9,
+ 0xf8f8f8f9, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000,
+ 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
+ 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
+ 0xf8f90000, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707,
+ 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0x00000707, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9,
+ 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9, 0xfffff8f9,
+ 0xfffff8f9, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e,
+ 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0x0e0e0e0e, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2,
+ 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2, 0xf1f1f1f2,
+ 0xf1f1f1f2, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707,
+ 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0x15150707, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9,
+ 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9, 0xeaeaf8f9,
+ 0xeaeaf8f9, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515,
+ 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x07071515, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010,
+ 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0xf7f7eff0, 0x100feff0, 0xeff01010, 0x1817f7f8,
+ 0xe7e80808, 0xf7f81818, 0x0807e7e8, 0x20201010, 0xdfdfeff0, 0x10102020, 0xefefdfe0, 0x20202020,
+ 0xdfdfdfe0, 0x28280000, 0xd7d80000, 0x00002828, 0xffffd7d8, 0x201fe7e8, 0xdfe01818, 0xe7e82020,
+ 0x1817dfe0, 0x40402828, 0xbfbfd7d8, 0x28284040, 0xd7d7bfc0, 0x302feff0, 0xcfd01010, 0xeff03030,
+ 0x100fcfd0, 0x40401010, 0xbfbfeff0, 0x10104040, 0xefefbfc0, 0x40404040, 0xbfbfbfc0, 0x48480000,
+ 0xb7b80000, 0x00004848, 0xffffb7b8, 0x302fcfd0, 0xcfd03030, 0x403fdfe0, 0xbfc02020, 0xdfe04040,
+ 0x201fbfc0, 0x68682828, 0x9797d7d8, 0x28286868, 0xd7d79798, 0x70704848, 0x8f8fb7b8, 0x48487070,
+ 0xb7b78f90, 0x5857e7e8, 0xa7a81818, 0xe7e85858, 0x1817a7a8, 0x70701010, 0x8f8feff0, 0x10107070,
+ 0xefef8f90, 0x78787878, 0x87878788, 0x5857b7b8, 0xa7a84848, 0xb7b85858, 0x4847a7a8, 0x7877c7c8,
+ 0x87883838, 0xc7c87878, 0x38378788, 0x30303030, 0xcfcfcfd0, 0x58585858, 0xa7a7a7a8, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808,
+ 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0x08080808, 0xf7f7f7f8,
+ 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8,
+ 0xf7f7f7f8, 0xf7f7f7f8, 0xf7f7f7f8, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000,
+ 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0x08080000, 0xf7f80000,
+ 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000, 0xf7f80000,
+ 0xf7f80000, 0xf7f80000, 0xf7f80000, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808,
+ 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0xfffff7f8,
+ 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0xfffff7f8,
+ 0xfffff7f8, 0xfffff7f8, 0xfffff7f8, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010,
+ 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0x10101010, 0xefefeff0,
+ 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0, 0xefefeff0,
+ 0xefefeff0, 0xefefeff0, 0xefefeff0, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808,
+ 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0x10100808, 0xefeff7f8,
+ 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0xefeff7f8,
+ 0xefeff7f8, 0xefeff7f8, 0xefeff7f8, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010,
+ 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x08081010, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212,
+ 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x1211edee, 0xedee1212, 0x1b1af6f7,
+ 0xe4e50909, 0xf6f71b1b, 0x0908e4e5, 0x24241212, 0xdbdbedee, 0x12122424, 0xededdbdc, 0x24242424,
+ 0xdbdbdbdc, 0x2d2d0000, 0xd2d30000, 0x00002d2d, 0xffffd2d3, 0x2423e4e5, 0xdbdc1b1b, 0xe4e52424,
+ 0x1b1adbdc, 0x48482d2d, 0xb7b7d2d3, 0x2d2d4848, 0xd2d2b7b8, 0x3635edee, 0xc9ca1212, 0xedee3636,
+ 0x1211c9ca, 0x48481212, 0xb7b7edee, 0x12124848, 0xededb7b8, 0x48484848, 0xb7b7b7b8, 0x51510000,
+ 0xaeaf0000, 0x00005151, 0xffffaeaf, 0x3635c9ca, 0xc9ca3636, 0x4847dbdc, 0xb7b82424, 0xdbdc4848,
+ 0x2423b7b8, 0x75752d2d, 0x8a8ad2d3, 0x2d2d7575, 0xd2d28a8b, 0x7e7e5151, 0x8181aeaf, 0x51517e7e,
+ 0xaeae8182, 0x6362e4e5, 0x9c9d1b1b, 0xe4e56363, 0x1b1a9c9d, 0x6362aeaf, 0x9c9d5151, 0xaeaf6363,
+ 0x51509c9d, 0x36363636, 0xc9c9c9ca, 0x6c6c6c6c, 0x93939394, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909,
+ 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0x09090909, 0xf6f6f6f7,
+ 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7,
+ 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0xf6f6f6f7, 0x09090000, 0x09090000, 0x09090000, 0x09090000,
+ 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000, 0x09090000,
+ 0x09090000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000,
+ 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0xf6f70000, 0x00000909, 0x00000909,
+ 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909, 0x00000909,
+ 0x00000909, 0x00000909, 0x00000909, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7,
+ 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7, 0xfffff6f7,
+ 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212,
+ 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0x12121212, 0xedededee, 0xedededee, 0xedededee,
+ 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee, 0xedededee,
+ 0xedededee, 0xedededee, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909,
+ 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0x1b1b0909, 0xe4e4f6f7,
+ 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7,
+ 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0xe4e4f6f7, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b,
+ 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b, 0x09091b1b,
+ 0x09091b1b, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5,
+ 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0xf6f6e4e5, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
+ 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0504fafb, 0xfafb0505, 0xfafb0505,
+ 0x0504fafb, 0x0b0b0606, 0xf4f4f9fa, 0x06060b0b, 0xf9f9f4f5, 0x08080000, 0xf7f80000, 0x00000808,
+ 0xfffff7f8, 0x0b0b0b0b, 0xf4f4f4f5, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x11110c0c,
+ 0xeeeef3f4, 0x0c0c1111, 0xf3f3eeef, 0x11111111, 0xeeeeeeef, 0x12120606, 0xededf9fa, 0x06061212,
+ 0xf9f9edee, 0x0b0af7f8, 0xf4f50808, 0xf7f80b0b, 0x0807f4f5, 0x0f0f0000, 0xf0f10000, 0x00000f0f,
+ 0xfffff0f1, 0x14140000, 0xebec0000, 0x00001414, 0xffffebec, 0x19191212, 0xe6e6edee, 0x12121919,
+ 0xedede6e7, 0x19190b0b, 0xe6e6f4f5, 0x0b0b1919, 0xf4f4e6e7, 0x19191919, 0xe6e6e6e7, 0x0e0df1f2,
+ 0xf1f20e0e, 0xf1f20e0e, 0x0e0df1f2, 0x1a1a0000, 0xe5e60000, 0x00001a1a, 0xffffe5e6, 0x1211f4f5,
+ 0xedee0b0b, 0xf4f51212, 0x0b0aedee, 0x1615f8f9, 0xe9ea0707, 0xf8f91616, 0x0706e9ea, 0x22221a1a,
+ 0xdddde5e6, 0x1a1a2222, 0xe5e5ddde, 0x22221212, 0xddddedee, 0x12122222, 0xededddde, 0x22222222,
+ 0xddddddde, 0x23230b0b, 0xdcdcf4f5, 0x0b0b2323, 0xf4f4dcdd, 0x1d1d0000, 0xe2e30000, 0x00001d1d,
+ 0xffffe2e3, 0x1615eced, 0xe9ea1313, 0xeced1616, 0x1312e9ea, 0x1a19f0f1, 0xe5e60f0f, 0xf0f11a1a,
+ 0x0f0ee5e6, 0x25250000, 0xdadb0000, 0x00002525, 0xffffdadb, 0x2c2c1b1b, 0xd3d3e4e5, 0x1b1b2c2c,
+ 0xe4e4d3d4, 0x2c2c2424, 0xd3d3dbdc, 0x24242c2c, 0xdbdbd3d4, 0x2c2c1212, 0xd3d3edee, 0x12122c2c,
+ 0xededd3d4, 0x2120f5f6, 0xdedf0a0a, 0xf5f62121, 0x0a09dedf, 0x2d2d2d2d, 0xd2d2d2d3, 0x00000000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
+ 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000,
+ 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000,
+ 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd,
+ 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000,
+ 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
+ 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303,
+ 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe,
+ 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
+ 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x03030000, 0xfcfd0000,
+ 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000, 0xf8f90000, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x07070000,
+ 0xf8f90000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0403fbfc, 0xfbfc0404, 0xf9fa0a0a,
+ 0x0605f5f6, 0xf3f40000, 0x0c0c0000, 0xf3f3f9fa, 0xf3f40606, 0x0c0bf9fa, 0x0c0c0606, 0xfffff1f2,
+ 0x00000e0e, 0x0c0c0c0c, 0xf3f3f3f4, 0xedee0000, 0x12120000, 0xf3f40e0e, 0x0c0bf1f2, 0xf9f9edee,
+ 0xf9fa1212, 0x0605edee, 0x06061212, 0xededf5f6, 0xedee0a0a, 0x1211f5f6, 0x12120a0a, 0xffffe9ea,
+ 0x00001616, 0xe7e80000, 0x18180000, 0xf3f3e9ea, 0xf3f41616, 0x0c0be9ea, 0x0c0c1616, 0xe7e7f7f8,
+ 0xe7e80808, 0x1817f7f8, 0x18180808, 0xf9f9e5e6, 0xf9fa1a1a, 0x0605e5e6, 0x06061a1a, 0xffffe3e4,
+ 0x00001c1c, 0x14141414, 0xebebebec, 0xe5e5f1f2, 0x1a1a0e0e, 0xf3f3e1e2, 0x0c0c1e1e, 0xdfdff5f6,
+ 0x20200a0a, 0xdfdfedee, 0x20201212, 0xe5e5e5e6, 0x1a1a1a1a, 0xebebddde, 0x14142222, 0xf3f3d9da,
+ 0x0c0c2626, 0xdfdfdfe0, 0x20202020, 0x20202020, 0xd7d7e9ea, 0xddddddde, 0x22222222, 0x00000000,
+ 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
+ 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606,
+ 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe,
+ 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000,
+ 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000,
+ 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000,
+ 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000,
+ 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000,
+ 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
+ 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606,
+ 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe,
+ 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000,
+ 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000,
+ 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a,
+ 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x0605f9fa, 0xf9fa0606, 0xf7f80e0e,
+ 0x0807f1f2, 0xffffedee, 0x00001212, 0xeff00a0a, 0x100ff5f6, 0xe7e80000, 0x18180000, 0xf7f7e7e8,
+ 0xf7f81818, 0x0807e7e8, 0x08081818, 0x12121212, 0xedededee, 0xeff01414, 0x100febec, 0xe5e5f1f2,
+ 0xe5e60e0e, 0x1a19f1f2, 0x1a1a0e0e, 0xffffe1e2, 0x00001e1e, 0xddde0000, 0x22220000, 0xf7f7ddde,
+ 0xf7f82222, 0x0807ddde, 0x08082222, 0xedede1e2, 0xedee1e1e, 0x1211e1e2, 0x12121e1e, 0xddddf5f6,
+ 0xddde0a0a, 0x2221f5f6, 0x22220a0a, 0xddddebec, 0x22221414, 0xffffd7d8, 0x00002828, 0x1e1e1e1e,
+ 0xe1e1e1e2, 0xededd7d8, 0x12122828, 0xd3d40000, 0x2c2c0000, 0xd3d3eff0, 0x2c2c1010, 0xdbdbdbdc,
+ 0xdbdbdbdc, 0x24242424, 0xd3d3e5e6, 0x2c2c1a1a, 0xe5e5d1d2, 0x1a1a2e2e, 0xededcbcc, 0x12123434,
+ 0xc9c9ebec, 0xd3d3d3d4, 0x2c2c2c2c, 0xc9c9dfe0, 0xd1d1d1d2, 0xd1d1d1d2, 0x2e2e2e2e, 0x00000000,
+ 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6,
+ 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
+ 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a,
+ 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc,
+ 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000,
+ 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000,
+ 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
+ 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6,
+ 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a,
+ 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000,
+ 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000,
+ 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404,
+ 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000,
+ 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6,
+ 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202,
+ 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a,
+ 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc,
+ 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000,
+ 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000,
+ 0xf5f60000, 0x00000a0a, 0xfffff5f6, 0x00000000, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
+ 0x04040404, 0xfbfbfbfc, 0x0a0a0a0a, 0xf5f5f5f6, 0x0a0a0000, 0xf5f60000, 0x00000a0a, 0xfffff5f6,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x0807f7f8, 0xf7f80808, 0xeff00808,
+ 0x100ff7f8, 0xe7e80000, 0x18180000, 0xf7f7e7e8, 0xf7f81818, 0x0807e7e8, 0x08081818, 0xeff01414,
+ 0x100febec, 0xffffe3e4, 0x00001c1c, 0xe7e7eff0, 0xe7e81010, 0x1817eff0, 0x18181010, 0xdfe00000,
+ 0x20200000, 0xefefe3e4, 0xeff01c1c, 0x100fe3e4, 0x10101c1c, 0xdfdff7f8, 0xdfe00808, 0xf7f7dfe0,
+ 0xf7f82020, 0x0807dfe0, 0x08082020, 0x201ff7f8, 0x20200808, 0x18181818, 0xe7e7e7e8, 0xe7e81818,
+ 0x1817e7e8, 0xdfdfebec, 0x20201414, 0xffffd7d8, 0x00002828, 0xefefd7d8, 0x10102828, 0xd3d40000,
+ 0xd3d40000, 0xffffd3d4, 0x00002c2c, 0x2c2c0000, 0x2c2c0000, 0xdfdfdfe0, 0x20202020, 0xd3d3eff0,
+ 0x2c2c1010, 0xd3d3e7e8, 0xe7e7d3d4, 0x18182c2c, 0x2c2c1818, 0xefefcfd0, 0x10103030, 0xdbdbdbdc,
+ 0xdbdbdbdc, 0x24242424, 0x24242424, 0xcbcbebec, 0x28282828, 0xd7d7d7d8, 0xcbcbdfe0, 0x00000000,
+ 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404,
+ 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c,
+ 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000,
+ 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000,
+ 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
+ 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4,
+ 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000,
+ 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000,
+ 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404,
+ 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000,
+ 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404,
+ 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c,
+ 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000,
+ 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000,
+ 0xf3f40000, 0x00000c0c, 0xfffff3f4, 0x00000000, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
+ 0x04040404, 0xfbfbfbfc, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0000, 0xf3f40000, 0x00000c0c, 0xfffff3f4,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
+ 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
+ 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
+ 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
+ 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
+ 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
+ 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414,
+ 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe,
+ 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0,
+ 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c,
+ 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec,
+ 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606,
+ 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e,
+ 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020,
+ 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x06060606, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x14141414, 0xebebebec, 0x20202020, 0xdfdfdfe0, 0x2e2e2e2e, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
};
static const uint32_t correctionhighorder[] = {
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101,
- 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303,
- 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707,
- 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc,
- 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404,
- 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101,
- 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff,
- 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd,
- 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303,
- 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
- 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb,
- 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101,
- 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
- 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb,
- 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101,
- 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
- 0x03030a0a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202,
- 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505,
- 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303,
- 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9,
- 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe,
- 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000,
- 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5,
- 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707,
- 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb,
- 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd,
- 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b,
- 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202,
- 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505,
- 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303,
- 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9,
- 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
- 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
- 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
- 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
- 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
- 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
- 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa,
- 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
- 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec,
- 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd,
- 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717,
- 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4,
- 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909,
- 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606,
- 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303,
- 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414,
- 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa,
- 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
- 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec,
- 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd,
- 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717,
- 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4,
- 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000,
- 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202,
- 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
- 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000,
- 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202,
- 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe,
- 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
- 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
- 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd,
- 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303,
- 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000,
- 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000,
- 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd,
- 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303,
- 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000,
- 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
- 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000,
- 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
- 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
- 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000,
- 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc,
- 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
- 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
- 0x04040808, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000,
- 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505,
- 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505,
- 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000,
- 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000,
- 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6,
- 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505,
- 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb,
- 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb,
- 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a,
- 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000,
- 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505,
- 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505,
- 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb,
- 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
- 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
- 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
- 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
- 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
- 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
- 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
- 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
- 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7,
- 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909,
- 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee,
- 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000,
- 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b,
- 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7,
- 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909,
- 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909,
- 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000,
- 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5,
- 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212,
- 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7,
- 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7,
- 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909,
- 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000,
- 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee,
- 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000,
- 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b,
- 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7,
- 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000,
- 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000,
- 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0x00000303,
- 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303,
- 0x00000303, 0x00000303, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd,
- 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000,
- 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
- 0xf8f90000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000,
- 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
- 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
- 0x06060000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
- 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0x00000606, 0x00000606,
- 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606,
- 0x00000606, 0x00000606, 0x00000606, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
- 0x02020000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000,
- 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202,
- 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a,
- 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0xf5f5f5f6,
- 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6,
- 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000,
- 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000,
- 0x0a0a0000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000,
- 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0x00000a0a, 0x00000a0a,
- 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a,
- 0x00000a0a, 0x00000a0a, 0x00000a0a, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6,
- 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
- 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
- 0x04040000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000,
- 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0x00000404, 0x00000404,
- 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404,
- 0x00000404, 0x00000404, 0x00000404, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
- 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
- 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
- 0xfbfbfbfc, 0xfbfbfbfc, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000,
- 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000,
- 0x0c0c0000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000,
- 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0x00000c0c, 0x00000c0c,
- 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c,
- 0x00000c0c, 0x00000c0c, 0x00000c0c, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4,
- 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
- 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
- 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
- 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
- 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
- 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
- 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
- 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
- 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
- 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
- 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
- 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
- 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101,
+ 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303,
+ 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x02020202, 0xfdfdfdfe,
+ 0x0302feff, 0xfcfd0101, 0xfeff0303, 0x0100fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9,
+ 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707,
+ 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc,
+ 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404,
+ 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101,
+ 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x0403feff,
+ 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303, 0xfcfcfcfd,
+ 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000, 0x03030303,
+ 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9, 0x00000000,
+ 0x03030303, 0xfcfcfcfd, 0x0403feff, 0xfbfc0101, 0xfeff0404, 0x0100fbfc, 0x07070707, 0xf8f8f8f9,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x04040404, 0xfbfbfbfc,
+ 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
+ 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
+ 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb,
+ 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101,
+ 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc,
+ 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
+ 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
+ 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb,
+ 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101,
+ 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000, 0x04040404, 0xfbfbfbfc,
+ 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd, 0x03030a0a, 0x00000000,
+ 0x04040404, 0xfbfbfbfc, 0x0504feff, 0xfafb0101, 0xfeff0505, 0x0100fafb, 0x0a0a0303, 0xf5f5fcfd,
+ 0x03030a0a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202,
+ 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505,
+ 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303,
+ 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9,
+ 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe,
+ 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000,
+ 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5,
+ 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707,
+ 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb,
+ 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd,
+ 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b,
+ 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202,
+ 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x05050505,
+ 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9, 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303,
+ 0xf2f2fcfd, 0x00000000, 0x05050505, 0xfafafafb, 0x0706fdfe, 0xf8f90202, 0xfdfe0707, 0x0201f8f9,
+ 0x0b0b0b0b, 0xf4f4f4f5, 0x0d0d0303, 0xf2f2fcfd, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
+ 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
+ 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
+ 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
+ 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
+ 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
+ 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
+ 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
+ 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
+ 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
+ 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8, 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc,
+ 0x04040f0f, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x0807fdfe, 0xf7f80202, 0xfdfe0808, 0x0201f7f8,
+ 0x0d0d0d0d, 0xf2f2f2f3, 0x0f0f0404, 0xf0f0fbfc, 0x04040f0f, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
+ 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
+ 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
+ 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
+ 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
+ 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
+ 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
+ 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
+ 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
+ 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
+ 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6, 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb,
+ 0x05051212, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x0a09fcfd, 0xf5f60303, 0xfcfd0a0a, 0x0302f5f6,
+ 0x10101010, 0xefefeff0, 0x12120505, 0xededfafb, 0x05051212, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
+ 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
+ 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
+ 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
+ 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
+ 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
+ 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
+ 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
+ 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
+ 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
+ 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303, 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee,
+ 0x14140505, 0xebebfafb, 0x05051414, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x0b0afcfd, 0xf4f50303,
+ 0xfcfd0b0b, 0x0302f4f5, 0x12121212, 0xedededee, 0x14140505, 0xebebfafb, 0x05051414, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x09090909, 0xf6f6f6f7,
+ 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa,
+ 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
+ 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000,
+ 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec,
+ 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd,
+ 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717,
+ 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4,
+ 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909,
+ 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606,
+ 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303,
+ 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9,
+ 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414,
+ 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7,
+ 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa,
+ 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c,
+ 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000,
+ 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec,
+ 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd,
+ 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4, 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717,
+ 0xf9f9e8e9, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x0c0bfcfd, 0xf3f40303, 0xfcfd0c0c, 0x0302f3f4,
+ 0x14141414, 0xebebebec, 0x17170606, 0xe8e8f9fa, 0x06061717, 0xf9f9e8e9, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000,
+ 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202,
+ 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe,
+ 0x00000000, 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000,
+ 0x02020202, 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202,
+ 0xfdfdfdfe, 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x02020202, 0xfdfdfdfe,
+ 0x02020000, 0xfdfe0000, 0x00000202, 0xfffffdfe, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
+ 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606,
+ 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd,
+ 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303,
+ 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000,
+ 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd, 0x03030000,
+ 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303, 0xfcfcfcfd,
+ 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000, 0x03030303,
+ 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa, 0x00000000,
+ 0x03030303, 0xfcfcfcfd, 0x03030000, 0xfcfd0000, 0x00000303, 0xfffffcfd, 0x06060606, 0xf9f9f9fa,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x04040404, 0xfbfbfbfc,
+ 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
+ 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
+ 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
+ 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000,
+ 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc,
+ 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
+ 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
+ 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc,
+ 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000,
+ 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000, 0x04040404, 0xfbfbfbfc,
+ 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc, 0x04040808, 0x00000000,
+ 0x04040404, 0xfbfbfbfc, 0x04040000, 0xfbfc0000, 0x00000404, 0xfffffbfc, 0x08080404, 0xf7f7fbfc,
+ 0x04040808, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000,
+ 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505,
+ 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505,
+ 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb,
+ 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000,
+ 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000,
+ 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6,
+ 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505,
+ 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb,
+ 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb,
+ 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a,
+ 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000,
+ 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x05050505,
+ 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb, 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505,
+ 0xf0f0fafb, 0x00000000, 0x05050505, 0xfafafafb, 0x05050000, 0xfafb0000, 0x00000505, 0xfffffafb,
+ 0x0a0a0a0a, 0xf5f5f5f6, 0x0f0f0505, 0xf0f0fafb, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
+ 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
+ 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
+ 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
+ 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
+ 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa,
+ 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa, 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa,
+ 0x06060c0c, 0x00000000, 0x06060606, 0xf9f9f9fa, 0x06060000, 0xf9fa0000, 0x00000606, 0xfffff9fa,
+ 0x0c0c0c0c, 0xf3f3f3f4, 0x0c0c0606, 0xf3f3f9fa, 0x06060c0c, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
+ 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
+ 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
+ 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
+ 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
+ 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
+ 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
+ 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
+ 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
+ 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
+ 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9,
+ 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9, 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9,
+ 0x07071515, 0x00000000, 0x07070707, 0xf8f8f8f9, 0x07070000, 0xf8f90000, 0x00000707, 0xfffff8f9,
+ 0x0e0e0e0e, 0xf1f1f1f2, 0x15150707, 0xeaeaf8f9, 0x07071515, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
+ 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
+ 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
+ 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
+ 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
+ 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
+ 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
+ 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
+ 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
+ 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
+ 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
+ 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000, 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0,
+ 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000, 0x08080808, 0xf7f7f7f8, 0x08080000, 0xf7f80000,
+ 0x00000808, 0xfffff7f8, 0x10101010, 0xefefeff0, 0x10100808, 0xefeff7f8, 0x08081010, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000, 0x09090909, 0xf6f6f6f7,
+ 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7,
+ 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909,
+ 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000,
+ 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee,
+ 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000,
+ 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b,
+ 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7,
+ 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909,
+ 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909,
+ 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000,
+ 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5,
+ 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212,
+ 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7,
+ 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7,
+ 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909,
+ 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000,
+ 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee,
+ 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000,
+ 0xf6f70000, 0x00000909, 0xfffff6f7, 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b,
+ 0xf6f6e4e5, 0x00000000, 0x09090909, 0xf6f6f6f7, 0x09090000, 0xf6f70000, 0x00000909, 0xfffff6f7,
+ 0x12121212, 0xedededee, 0x1b1b0909, 0xe4e4f6f7, 0x09091b1b, 0xf6f6e4e5, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0x03030000,
+ 0x03030000, 0x03030000, 0x03030000, 0x03030000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000,
+ 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0xfcfd0000, 0x00000303,
+ 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303, 0x00000303,
+ 0x00000303, 0x00000303, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd,
+ 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0xfffffcfd, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000,
+ 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0x07070000, 0xf8f90000, 0xf8f90000,
+ 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000, 0xf8f90000,
+ 0xf8f90000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
+ 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
+ 0x02020000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000,
+ 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
+ 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202,
+ 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
+ 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
+ 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
+ 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000, 0x06060000,
+ 0x06060000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000,
+ 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0xf9fa0000, 0x00000606, 0x00000606,
+ 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606, 0x00000606,
+ 0x00000606, 0x00000606, 0x00000606, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
+ 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa, 0xfffff9fa,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
+ 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000, 0x02020000,
+ 0x02020000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000,
+ 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0xfdfe0000, 0x00000202, 0x00000202,
+ 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202, 0x00000202,
+ 0x00000202, 0x00000202, 0x00000202, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
+ 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe, 0xfffffdfe,
+ 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
+ 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
+ 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
+ 0xfbfbfbfc, 0xfbfbfbfc, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a,
+ 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0xf5f5f5f6,
+ 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6,
+ 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0xf5f5f5f6, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000,
+ 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000, 0x0a0a0000,
+ 0x0a0a0000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000,
+ 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0xf5f60000, 0x00000a0a, 0x00000a0a,
+ 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a, 0x00000a0a,
+ 0x00000a0a, 0x00000a0a, 0x00000a0a, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6,
+ 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6, 0xfffff5f6,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
+ 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000, 0x04040000,
+ 0x04040000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000,
+ 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0xfbfc0000, 0x00000404, 0x00000404,
+ 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404, 0x00000404,
+ 0x00000404, 0x00000404, 0x00000404, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
+ 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc, 0xfffffbfc,
+ 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404,
+ 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0x04040404, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
+ 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc, 0xfbfbfbfc,
+ 0xfbfbfbfc, 0xfbfbfbfc, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000,
+ 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000, 0x0c0c0000,
+ 0x0c0c0000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000,
+ 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0xf3f40000, 0x00000c0c, 0x00000c0c,
+ 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c, 0x00000c0c,
+ 0x00000c0c, 0x00000c0c, 0x00000c0c, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4,
+ 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4, 0xfffff3f4,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
+ 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
+ 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
+ 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
+ 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
+ 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
+ 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef,
+ 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202,
+ 0x02020202, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe,
+ 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0xfdfdfdfe, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606, 0x06060606,
+ 0x06060606, 0x06060606, 0x06060606, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa, 0xf9f9f9fa,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c,
+ 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0x0c0c0c0c, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4, 0xf3f3f3f4,
+ 0xf3f3f3f4, 0xf3f3f3f4, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414,
+ 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0x14141414, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec,
+ 0xebebebec, 0xebebebec, 0xebebebec, 0xebebebec, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
+ 0x20202020, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0,
+ 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0xdfdfdfe0, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e,
+ 0x2e2e2e2e, 0x2e2e2e2e, 0x2e2e2e2e, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
+ 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2, 0xd1d1d1d2,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
};
* @file jfdctfst.c
* Independent JPEG Group's fast AAN dct.
*/
-
+
#include <stdlib.h>
#include <stdio.h>
#include "common.h"
tmp5 = dataptr[2] - dataptr[5];
tmp3 = dataptr[3] + dataptr[4];
tmp4 = dataptr[3] - dataptr[4];
-
+
/* Even part */
-
+
tmp10 = tmp0 + tmp3; /* phase 2 */
tmp13 = tmp0 - tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
-
+
dataptr[0] = tmp10 + tmp11; /* phase 3 */
dataptr[4] = tmp10 - tmp11;
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
dataptr[2] = tmp13 + z1; /* phase 5 */
dataptr[6] = tmp13 - z1;
-
+
/* Odd part */
tmp10 = tmp4 + tmp5; /* phase 2 */
SHIFT_TEMPS
row_fdct(data);
-
+
/* Pass 2: process columns. */
dataptr = data;
tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
+
/* Even part */
-
+
tmp10 = tmp0 + tmp3; /* phase 2 */
tmp13 = tmp0 - tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
-
+
dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
dataptr[DCTSIZE*4] = tmp10 - tmp11;
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
dataptr[DCTSIZE*6] = tmp13 - z1;
-
+
/* Odd part */
tmp10 = tmp4 + tmp5; /* phase 2 */
SHIFT_TEMPS
row_fdct(data);
-
+
/* Pass 2: process columns. */
dataptr = data;
tmp7 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
/* Even part */
-
+
tmp10 = tmp0 + tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
tmp13 = tmp0 - tmp3;
-
+
dataptr[DCTSIZE*0] = tmp10 + tmp11;
dataptr[DCTSIZE*4] = tmp10 - tmp11;
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781);
dataptr[DCTSIZE*2] = tmp13 + z1;
dataptr[DCTSIZE*6] = tmp13 - z1;
tmp11 = tmp5 + tmp6;
tmp12 = tmp5 - tmp6;
tmp13 = tmp4 - tmp7;
-
+
dataptr[DCTSIZE*1] = tmp10 + tmp11;
dataptr[DCTSIZE*5] = tmp10 - tmp11;
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781);
dataptr[DCTSIZE*3] = tmp13 + z1;
dataptr[DCTSIZE*7] = tmp13 - z1;
-
+
dataptr++; /* advance pointer to next column */
}
}
* @file jfdctint.c
* Independent JPEG Group's slow & accurate dct.
*/
-
+
#include <stdlib.h>
#include <stdio.h>
#include "common.h"
tmp5 = dataptr[2] - dataptr[5];
tmp3 = dataptr[3] + dataptr[4];
tmp4 = dataptr[3] - dataptr[4];
-
+
/* Even part per LL&M figure 1 --- note that published figure is faulty;
* rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
*/
-
+
tmp10 = tmp0 + tmp3;
tmp13 = tmp0 - tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
-
+
dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
CONST_BITS-PASS1_BITS);
dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
CONST_BITS-PASS1_BITS);
-
+
/* Odd part per figure 8 --- note paper omits factor of sqrt(2).
* cK represents cos(K*pi/16).
* i0..i3 in the paper are tmp4..tmp7 here.
*/
-
+
z1 = tmp4 + tmp7;
z2 = tmp5 + tmp6;
z3 = tmp4 + tmp6;
z4 = tmp5 + tmp7;
z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
+
tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
+
z3 += z5;
z4 += z5;
-
+
dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
-
+
dataptr += DCTSIZE; /* advance pointer to next row */
}
}
tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
+
/* Even part per LL&M figure 1 --- note that published figure is faulty;
* rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
*/
-
+
tmp10 = tmp0 + tmp3;
tmp13 = tmp0 - tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
-
+
dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
CONST_BITS+PASS1_BITS);
dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
CONST_BITS+PASS1_BITS);
-
+
/* Odd part per figure 8 --- note paper omits factor of sqrt(2).
* cK represents cos(K*pi/16).
* i0..i3 in the paper are tmp4..tmp7 here.
*/
-
+
z1 = tmp4 + tmp7;
z2 = tmp5 + tmp6;
z3 = tmp4 + tmp6;
z4 = tmp5 + tmp7;
z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
+
tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
+
z3 += z5;
z4 += z5;
-
+
dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,
CONST_BITS+PASS1_BITS);
dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,
CONST_BITS+PASS1_BITS);
dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,
CONST_BITS+PASS1_BITS);
-
+
dataptr++; /* advance pointer to next column */
}
}
tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3];
tmp6 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5];
tmp7 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7];
-
+
tmp10 = tmp0 + tmp3;
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
tmp13 = tmp0 - tmp3;
-
+
dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
CONST_BITS+PASS1_BITS);
dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
-
+
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
CONST_BITS+PASS1_BITS);
dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
CONST_BITS+PASS1_BITS);
-
+
dataptr++; /* advance pointer to next column */
}
}
* The advantage of this method is that no data path contains more than one
* multiplication; this allows a very simple and accurate implementation in
* scaled fixed-point arithmetic, with a minimal number of shifts.
- *
+ *
* I've made lots of modifications to attempt to take advantage of the
* sparse nature of the DCT matrices we're getting. Although the logic
* is cumbersome, it's straightforward and the resulting code is much
* A better way to do this would be to pass in the DCT block as a sparse
* matrix, perhaps with the difference cases encoded.
*/
-
+
/**
* @file jrevdct.c
* Independent JPEG Group's LLM idct.
*/
-
+
#include "common.h"
#include "dsputil.h"
*/
/* Actually FIX is no longer used, we precomputed them all */
-#define FIX(x) ((int32_t) ((x) * CONST_SCALE + 0.5))
+#define FIX(x) ((int32_t) ((x) * CONST_SCALE + 0.5))
/* Descale and correctly round an int32_t value that's scaled by N bits.
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
#endif
-/*
+/*
Unlike our decoder where we approximate the FIXes, we need to use exact
-ones here or successive P-frames will drift too much with Reference frame coding
+ones here or successive P-frames will drift too much with Reference frame coding
*/
#define FIX_0_211164243 1730
#define FIX_0_275899380 2260
int32_t d0, d1, d2, d3, d4, d5, d6, d7;
register DCTELEM *dataptr;
int rowctr;
-
+
/* Pass 1: process rows. */
/* Note results are scaled up by sqrt(8) compared to a true IDCT; */
/* furthermore, we scale the results by 2**PASS1_BITS. */
/* Compute a 32 bit value to assign. */
DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
-
+
idataptr[0] = v;
idataptr[1] = v;
idataptr[2] = v;
idataptr[3] = v;
}
-
+
dataptr += DCTSIZE; /* advance pointer to next row */
continue;
}
z3 = d7 + d3;
z4 = d5 + d1;
z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z2 = MULTIPLY(-z2, FIX_2_562915447);
z3 = MULTIPLY(-z3, FIX_1_961570560);
z4 = MULTIPLY(-z4, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 += z2 + z4;
tmp2 += z2 + z3;
z2 = d5 + d3;
z3 = d7 + d3;
z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
z1 = MULTIPLY(-d7, FIX_0_899976223);
z2 = MULTIPLY(-z2, FIX_2_562915447);
z3 = MULTIPLY(-z3, FIX_1_961570560);
z4 = MULTIPLY(-d5, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 += z2 + z4;
tmp2 += z2 + z3;
z1 = d7 + d1;
z4 = d5 + d1;
z5 = MULTIPLY(d7 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z1 = MULTIPLY(-z1, FIX_0_899976223);
z2 = MULTIPLY(-d5, FIX_2_562915447);
z3 = MULTIPLY(-d7, FIX_1_961570560);
z4 = MULTIPLY(-z4, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 += z2 + z4;
tmp2 = z2 + z3;
tmp3 += z1 + z4;
} else {
/* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
+ tmp0 = MULTIPLY(-d7, FIX_0_601344887);
z1 = MULTIPLY(-d7, FIX_0_899976223);
z3 = MULTIPLY(-d7, FIX_1_961570560);
tmp1 = MULTIPLY(-d5, FIX_0_509795579);
z2 = MULTIPLY(-d5, FIX_2_562915447);
z4 = MULTIPLY(-d5, FIX_0_390180644);
z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z3;
tmp1 += z4;
tmp2 = z2 + z3;
z1 = d7 + d1;
z3 = d7 + d3;
z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z1 = MULTIPLY(-z1, FIX_0_899976223);
z2 = MULTIPLY(-d3, FIX_2_562915447);
z3 = MULTIPLY(-z3, FIX_1_961570560);
z4 = MULTIPLY(-d1, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 = z2 + z4;
tmp2 += z2 + z3;
} else {
/* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
z3 = d7 + d3;
-
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
+
+ tmp0 = MULTIPLY(-d7, FIX_0_601344887);
z1 = MULTIPLY(-d7, FIX_0_899976223);
tmp2 = MULTIPLY(d3, FIX_0_509795579);
z2 = MULTIPLY(-d3, FIX_2_562915447);
z5 = MULTIPLY(z3, FIX_1_175875602);
z3 = MULTIPLY(-z3, FIX_0_785694958);
-
+
tmp0 += z3;
tmp1 = z2 + z5;
tmp2 += z3;
z1 = MULTIPLY(z1, FIX_0_275899380);
z3 = MULTIPLY(-d7, FIX_1_961570560);
- tmp0 = MULTIPLY(-d7, FIX_1_662939225);
+ tmp0 = MULTIPLY(-d7, FIX_1_662939225);
z4 = MULTIPLY(-d1, FIX_0_390180644);
tmp3 = MULTIPLY(d1, FIX_1_111140466);
z2 = d5 + d3;
z4 = d5 + d1;
z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
-
+
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z2 = MULTIPLY(-z2, FIX_2_562915447);
z3 = MULTIPLY(-d3, FIX_1_961570560);
z4 = MULTIPLY(-z4, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 = z1 + z3;
tmp1 += z2 + z4;
tmp2 += z2 + z3;
} else {
/* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
z2 = d5 + d3;
-
+
z5 = MULTIPLY(z2, FIX_1_175875602);
tmp1 = MULTIPLY(d5, FIX_1_662939225);
z4 = MULTIPLY(-d5, FIX_0_390180644);
z2 = MULTIPLY(-z2, FIX_1_387039845);
tmp2 = MULTIPLY(d3, FIX_1_111140466);
z3 = MULTIPLY(-d3, FIX_1_961570560);
-
+
tmp0 = z3 + z5;
tmp1 += z2;
tmp2 += z2;
if (d1) {
/* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
z4 = d5 + d1;
-
+
z5 = MULTIPLY(z4, FIX_1_175875602);
z1 = MULTIPLY(-d1, FIX_0_899976223);
tmp3 = MULTIPLY(d1, FIX_0_601344887);
tmp1 = MULTIPLY(-d5, FIX_0_509795579);
z2 = MULTIPLY(-d5, FIX_2_562915447);
z4 = MULTIPLY(z4, FIX_0_785694958);
-
+
tmp0 = z1 + z5;
tmp1 += z4;
tmp2 = z2 + z5;
z2 = MULTIPLY(-d3, FIX_2_172734803);
z4 = MULTIPLY(z5, FIX_0_785694958);
z5 = MULTIPLY(z5, FIX_1_175875602);
-
+
tmp0 = z1 - z4;
tmp1 = z2 + z4;
tmp2 += z5;
z3 = d7 + d3;
z4 = d5 + d1;
z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z2 = MULTIPLY(-z2, FIX_2_562915447);
z3 = MULTIPLY(-z3, FIX_1_961570560);
z4 = MULTIPLY(-z4, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 += z2 + z4;
tmp2 += z2 + z3;
z2 = d5 + d3;
z3 = d7 + d3;
z5 = MULTIPLY(z3 + d5, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
z1 = MULTIPLY(-d7, FIX_0_899976223);
z2 = MULTIPLY(-z2, FIX_2_562915447);
z3 = MULTIPLY(-z3, FIX_1_961570560);
z4 = MULTIPLY(-d5, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 += z2 + z4;
tmp2 += z2 + z3;
z3 = d7;
z4 = d5 + d1;
z5 = MULTIPLY(z3 + z4, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z1 = MULTIPLY(-z1, FIX_0_899976223);
z2 = MULTIPLY(-d5, FIX_2_562915447);
z3 = MULTIPLY(-d7, FIX_1_961570560);
z4 = MULTIPLY(-z4, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 += z2 + z4;
tmp2 = z2 + z3;
tmp3 += z1 + z4;
} else {
/* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
+ tmp0 = MULTIPLY(-d7, FIX_0_601344887);
z1 = MULTIPLY(-d7, FIX_0_899976223);
z3 = MULTIPLY(-d7, FIX_1_961570560);
tmp1 = MULTIPLY(-d5, FIX_0_509795579);
z2 = MULTIPLY(-d5, FIX_2_562915447);
z4 = MULTIPLY(-d5, FIX_0_390180644);
z5 = MULTIPLY(d5 + d7, FIX_1_175875602);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z3;
tmp1 += z4;
tmp2 = z2 + z3;
z1 = d7 + d1;
z3 = d7 + d3;
z5 = MULTIPLY(z3 + d1, FIX_1_175875602);
-
- tmp0 = MULTIPLY(d7, FIX_0_298631336);
+
+ tmp0 = MULTIPLY(d7, FIX_0_298631336);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z1 = MULTIPLY(-z1, FIX_0_899976223);
z2 = MULTIPLY(-d3, FIX_2_562915447);
z3 = MULTIPLY(-z3, FIX_1_961570560);
z4 = MULTIPLY(-d1, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 += z1 + z3;
tmp1 = z2 + z4;
tmp2 += z2 + z3;
} else {
/* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */
z3 = d7 + d3;
-
- tmp0 = MULTIPLY(-d7, FIX_0_601344887);
+
+ tmp0 = MULTIPLY(-d7, FIX_0_601344887);
z1 = MULTIPLY(-d7, FIX_0_899976223);
tmp2 = MULTIPLY(d3, FIX_0_509795579);
z2 = MULTIPLY(-d3, FIX_2_562915447);
z5 = MULTIPLY(z3, FIX_1_175875602);
z3 = MULTIPLY(-z3, FIX_0_785694958);
-
+
tmp0 += z3;
tmp1 = z2 + z5;
tmp2 += z3;
z1 = MULTIPLY(z1, FIX_0_275899380);
z3 = MULTIPLY(-d7, FIX_1_961570560);
- tmp0 = MULTIPLY(-d7, FIX_1_662939225);
+ tmp0 = MULTIPLY(-d7, FIX_1_662939225);
z4 = MULTIPLY(-d1, FIX_0_390180644);
tmp3 = MULTIPLY(d1, FIX_1_111140466);
z2 = d5 + d3;
z4 = d5 + d1;
z5 = MULTIPLY(d3 + z4, FIX_1_175875602);
-
+
tmp1 = MULTIPLY(d5, FIX_2_053119869);
tmp2 = MULTIPLY(d3, FIX_3_072711026);
tmp3 = MULTIPLY(d1, FIX_1_501321110);
z2 = MULTIPLY(-z2, FIX_2_562915447);
z3 = MULTIPLY(-d3, FIX_1_961570560);
z4 = MULTIPLY(-z4, FIX_0_390180644);
-
+
z3 += z5;
z4 += z5;
-
+
tmp0 = z1 + z3;
tmp1 += z2 + z4;
tmp2 += z2 + z3;
} else {
/* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */
z2 = d5 + d3;
-
+
z5 = MULTIPLY(z2, FIX_1_175875602);
tmp1 = MULTIPLY(d5, FIX_1_662939225);
z4 = MULTIPLY(-d5, FIX_0_390180644);
z2 = MULTIPLY(-z2, FIX_1_387039845);
tmp2 = MULTIPLY(d3, FIX_1_111140466);
z3 = MULTIPLY(-d3, FIX_1_961570560);
-
+
tmp0 = z3 + z5;
tmp1 += z2;
tmp2 += z2;
if (d1) {
/* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */
z4 = d5 + d1;
-
+
z5 = MULTIPLY(z4, FIX_1_175875602);
z1 = MULTIPLY(-d1, FIX_0_899976223);
tmp3 = MULTIPLY(d1, FIX_0_601344887);
tmp1 = MULTIPLY(-d5, FIX_0_509795579);
z2 = MULTIPLY(-d5, FIX_2_562915447);
z4 = MULTIPLY(z4, FIX_0_785694958);
-
+
tmp0 = z1 + z5;
tmp1 += z4;
tmp2 = z2 + z5;
z2 = MULTIPLY(-d3, FIX_2_172734803);
z4 = MULTIPLY(z5, FIX_0_785694958);
z5 = MULTIPLY(z5, FIX_1_175875602);
-
+
tmp0 = z1 - z4;
tmp1 = z2 + z4;
tmp2 += z5;
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0,
CONST_BITS+PASS1_BITS+3);
-
+
dataptr++; /* advance pointer to next column */
}
}
/* furthermore, we scale the results by 2**PASS1_BITS. */
data[0] += 4;
-
+
dataptr = data;
for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) {
/* Compute a 32 bit value to assign. */
DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
-
+
idataptr[0] = v;
idataptr[1] = v;
}
-
+
dataptr += DCTSTRIDE; /* advance pointer to next row */
continue;
}
-
+
/* Even part: reverse the even part of the forward DCT. */
/* The rotator is sqrt(2)*c(-6). */
if (d6) {
dataptr[DCTSTRIDE*1] = tmp11 >> (CONST_BITS+PASS1_BITS+3);
dataptr[DCTSTRIDE*2] = tmp12 >> (CONST_BITS+PASS1_BITS+3);
dataptr[DCTSTRIDE*3] = tmp13 >> (CONST_BITS+PASS1_BITS+3);
-
+
dataptr++; /* advance pointer to next column */
}
}
d01 = data[0+0*DCTSTRIDE] - data[1+0*DCTSTRIDE];
d10 = data[0+1*DCTSTRIDE] + data[1+1*DCTSTRIDE];
d11 = data[0+1*DCTSTRIDE] - data[1+1*DCTSTRIDE];
-
+
data[0+0*DCTSTRIDE]= (d00 + d10)>>3;
data[1+0*DCTSTRIDE]= (d01 + d11)>>3;
data[0+1*DCTSTRIDE]= (d00 - d10)>>3;
unsigned char mask = 0;
unsigned char maskbit = 0;
unsigned int ofs, cnt;
-
+
while ((srclen > 0) && (destptr < destptr_end)) {
if (maskbit == 0) {
mask = *(srcptr++);
c->zstream.next_in = encoded + 8;
c->zstream.avail_in = mthread_inlen;
c->zstream.next_out = c->decomp_buf;
- c->zstream.avail_out = c->decomp_size;
+ c->zstream.avail_out = c->decomp_size;
zret = inflate(&(c->zstream), Z_FINISH);
if ((zret != Z_OK) && (zret != Z_STREAM_END)) {
av_log(avctx, AV_LOG_ERROR, "Mthread1 inflate error: %d\n", zret);
c->zstream.next_in = encoded + 8 + mthread_inlen;
c->zstream.avail_in = len - mthread_inlen;
c->zstream.next_out = c->decomp_buf + mthread_outlen;
- c->zstream.avail_out = c->decomp_size - mthread_outlen;
+ c->zstream.avail_out = c->decomp_size - mthread_outlen;
zret = inflate(&(c->zstream), Z_FINISH);
if ((zret != Z_OK) && (zret != Z_STREAM_END)) {
av_log(avctx, AV_LOG_ERROR, "Mthread2 inflate error: %d\n", zret);
#else
init_put_bits(&c->pb, buf, buf_size);
-
+
*p = *pict;
p->pict_type= FF_I_TYPE;
p->key_frame= 1;
-
+
if(avctx->pix_fmt != PIX_FMT_BGR24){
av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
return -1;
#ifdef CONFIG_ZLIB
// Needed if zlib unused or init aborted before inflateInit
- memset(&(c->zstream), 0, sizeof(z_stream));
+ memset(&(c->zstream), 0, sizeof(z_stream));
#endif
if (avctx->extradata_size < 8) {
return 1;
}
- /* Check codec type */
+ /* Check codec type */
if (((avctx->codec_id == CODEC_ID_MSZH) && (*((char *)avctx->extradata + 7) != CODEC_MSZH)) ||
((avctx->codec_id == CODEC_ID_ZLIB) && (*((char *)avctx->extradata + 7) != CODEC_ZLIB))) {
av_log(avctx, AV_LOG_ERROR, "Codec id and codec type mismatch. This should not happen.\n");
return 1;
}
}
-
- /* Detect flags */
+
+ /* Detect flags */
c->flags = *((char *)avctx->extradata + 6);
if (c->flags & FLAG_MULTITHREAD)
av_log(avctx, AV_LOG_INFO, "Multithread encoder flag set.\n");
#else
c->avctx= avctx;
-
+
assert(avctx->width && avctx->height);
-
+
avctx->extradata= av_mallocz(8);
avctx->coded_frame= &c->pic;
((uint8_t*)avctx->extradata)[6]= c->flags;
((uint8_t*)avctx->extradata)[7]= CODEC_ZLIB;
c->avctx->extradata_size= 8;
-
+
c->zstream.zalloc = Z_NULL;
c->zstream.zfree = Z_NULL;
c->zstream.opaque = Z_NULL;
#ifdef CONFIG_ZLIB
deflateEnd(&(c->zstream));
#endif
-
+
return 0;
}
if (num_bits != 0)
result = (result << num_bits) | (state->current_word >> (32 - num_bits));
-
+
state->bits_left = 32 - num_bits;
return result;
static inline uint32_t bitstream_get (a52_state_t * state, uint32_t num_bits)
{
uint32_t result;
-
+
if (num_bits < state->bits_left) {
result = (state->current_word << (32 - state->bits_left)) >> (32 - num_bits);
state->bits_left -= num_bits;
static inline int32_t bitstream_get_2 (a52_state_t * state, uint32_t num_bits)
{
int32_t result;
-
+
if (num_bits < state->bits_left) {
result = (((int32_t)state->current_word) << (32 - state->bits_left)) >> (32 - num_bits);
state->bits_left -= num_bits;
-/*
+/*
* crc.c
*
* Copyright (C) Aaron Holtzman - May 1999
*
* This file is part of ac3dec, a free Dolby AC-3 stream decoder.
- *
+ *
* ac3dec is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* ac3dec is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <stdio.h>
#include <inttypes.h>
-static const uint16_t crc_lut[256] =
+static const uint16_t crc_lut[256] =
{
0x0000,0x8005,0x800f,0x000a,0x801b,0x001e,0x0014,0x8011,
0x8033,0x0036,0x003c,0x8039,0x0028,0x802d,0x8027,0x0022,
sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2;
const sample_t * window = a52_imdct_window;
complex_t buf[128];
-
+
for (i = 0; i < 128; i++) {
k = fftorder[i];
t_r = pre1[i].real;
/* Post IFFT complex multiply */
/* Window and convert to real valued signal */
for (i = 0; i < 32; i++) {
- /* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */
+ /* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */
t_r = post2[i].real;
t_i = post2[i].imag;
BUTTERFLY_0 (a_r, a_i, t_i, t_r, buf1[i].imag, buf1[i].real);
{
static level_t clev[4] = { LEVEL (LEVEL_3DB), LEVEL (LEVEL_45DB),
LEVEL (LEVEL_6DB), LEVEL (LEVEL_45DB) };
- static level_t slev[4] = { LEVEL (LEVEL_3DB), LEVEL (LEVEL_6DB),
+ static level_t slev[4] = { LEVEL (LEVEL_3DB), LEVEL (LEVEL_6DB),
0, LEVEL (LEVEL_6DB) };
int chaninfo;
int acmod;
case EXP_D15:
*(dest++) = exponent;
}
- }
+ }
return 0;
}
int16_t nstate;
nstate = dither_lut[state->lfsr_state >> 8] ^ (state->lfsr_state << 8);
-
+
state->lfsr_state = (uint16_t) nstate;
return (3 * nstate) >> 2;
cplexpstr = bitstream_get (state, 2);
for (i = 0; i < nfchans; i++)
chexpstr[i] = bitstream_get (state, 2);
- if (state->lfeon)
+ if (state->lfeon)
lfeexpstr = bitstream_get (state, 1);
for (i = 0; i < nfchans; i++)
if (blksw[i])
a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i,
bias);
- else
+ else
a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i,
bias);
} else {
for (i = 0; i < nfchans; i++)
a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i,
state->bias);
- else
+ else
for (i = 0; i < nfchans; i++)
a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i,
state->bias);
a52_resample=tmp;
return tmp;
}
-
+
av_log(NULL, AV_LOG_ERROR, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags, chans);
return NULL;
}
// MMX optimizations from Michael Niedermayer (michaelni@gmx.at) (under GPL)
-/* optimization TODO / NOTES
- movntq is slightly faster (0.5% with the current test.c benchmark)
+/* optimization TODO / NOTES
+ movntq is slightly faster (0.5% with the current test.c benchmark)
(but thats just test.c so that needs to be testd in reallity)
- and it would mean (C / MMX2 / MMX / 3DNOW) versions
+ and it would mean (C / MMX2 / MMX / 3DNOW) versions
*/
static uint64_t __attribute__((aligned(8))) attribute_used magicF2W= 0x43c0000043c00000LL;
"movq %%mm0, (%0, %%edi) \n\t"
"movq %%mm1, 8(%0, %%edi) \n\t"
"movq %%mm3, 16(%0, %%edi) \n\t"
-
+
"movd 1032(%1, %%esi), %%mm1 \n\t"
"punpckldq 12(%1, %%esi), %%mm1\n\t"
"movd 2060(%1, %%esi), %%mm2 \n\t"
"packssdw %%mm3, %%mm2 \n\t"
"movq %%mm0, 24(%0, %%edi) \n\t"
"movq %%mm2, 32(%0, %%edi) \n\t"
-
+
"addl $16, %%esi \n\t"
" jnz 1b \n\t"
"emms \n\t"
"movq %%mm0, (%0, %%edi) \n\t"
"movq %%mm2, 8(%0, %%edi) \n\t"
"movq %%mm4, 16(%0, %%edi) \n\t"
-
+
"movd 3080(%1, %%esi), %%mm0 \n\t"
"punpckldq 4104(%1, %%esi), %%mm0\n\t"
"movd 1032(%1, %%esi), %%mm1 \n\t"
"packssdw %%mm3, %%mm2 \n\t"
"movq %%mm0, 24(%0, %%edi) \n\t"
"movq %%mm2, 32(%0, %%edi) \n\t"
-
+
"addl $16, %%esi \n\t"
" jnz 1b \n\t"
"emms \n\t"
"1: \n\t"
"movq 1024(%1, %%esi), %%mm0 \n\t"
"movq 2048(%1, %%esi), %%mm1 \n\t"
- "movq (%1, %%esi), %%mm5 \n\t"
+ "movq (%1, %%esi), %%mm5 \n\t"
"psubd %%mm7, %%mm0 \n\t"
"psubd %%mm7, %%mm1 \n\t"
"psubd %%mm7, %%mm5 \n\t"
"leal (%%esi, %%esi, 2), %%edi \n\t"
-
+
"pxor %%mm4, %%mm4 \n\t"
"packssdw %%mm5, %%mm0 \n\t" // FfAa
"packssdw %%mm4, %%mm1 \n\t" // 00Bb
"punpckldq %%mm4, %%mm3 \n\t" // f0XX
"punpckldq %%mm6, %%mm0 \n\t" // 00ba
"punpckhdq %%mm1, %%mm3 \n\t" // BAf0
-
+
"movq %%mm0, (%0, %%edi) \n\t" // 00ba
"punpckhdq %%mm4, %%mm0 \n\t" // F000
"movq %%mm3, 8(%0, %%edi) \n\t" // BAf0
"movq 1024(%1, %%esi), %%mm0 \n\t"
"movq 3072(%1, %%esi), %%mm1 \n\t"
"movq 2048(%1, %%esi), %%mm4 \n\t"
- "movq (%1, %%esi), %%mm5 \n\t"
+ "movq (%1, %%esi), %%mm5 \n\t"
"psubd %%mm7, %%mm0 \n\t"
"psubd %%mm7, %%mm1 \n\t"
"psubd %%mm7, %%mm4 \n\t"
"psubd %%mm7, %%mm5 \n\t"
"leal (%%esi, %%esi, 2), %%edi \n\t"
-
+
"packssdw %%mm4, %%mm0 \n\t" // EeAa
"packssdw %%mm5, %%mm1 \n\t" // FfBb
"movq %%mm0, %%mm2 \n\t" // EeAa
"movq %%mm0, %%mm1 \n\t" // BAba
"punpckldq %%mm6, %%mm0 \n\t" // 00ba
"punpckhdq %%mm1, %%mm1 \n\t" // BABA
-
+
"movq %%mm0, (%0, %%edi) \n\t"
"punpckhdq %%mm2, %%mm0 \n\t" // FE00
"punpckldq %%mm1, %%mm2 \n\t" // BAfe
"movq 2048(%1, %%esi), %%mm1 \n\t"
"movq 3072(%1, %%esi), %%mm2 \n\t"
"movq 4096(%1, %%esi), %%mm3 \n\t"
- "movq (%1, %%esi), %%mm5 \n\t"
+ "movq (%1, %%esi), %%mm5 \n\t"
"psubd %%mm7, %%mm0 \n\t"
"psubd %%mm7, %%mm1 \n\t"
"psubd %%mm7, %%mm2 \n\t"
"psubd %%mm7, %%mm3 \n\t"
"psubd %%mm7, %%mm5 \n\t"
"leal (%%esi, %%esi, 2), %%edi \n\t"
-
+
"packssdw %%mm2, %%mm0 \n\t" // CcAa
"packssdw %%mm3, %%mm1 \n\t" // DdBb
"packssdw %%mm5, %%mm5 \n\t" // FfFf
"punpckhdq %%mm1, %%mm1 \n\t" // BABA
"punpckldq %%mm1, %%mm4 \n\t" // BAf0
"punpckhdq %%mm3, %%mm2 \n\t" // F0DC
-
+
"movq %%mm0, (%0, %%edi) \n\t"
"movq %%mm4, 8(%0, %%edi) \n\t"
"movq %%mm2, 16(%0, %%edi) \n\t"
"movq 4096(%1, %%esi), %%mm2 \n\t"
"movq 5120(%1, %%esi), %%mm3 \n\t"
"movq 2048(%1, %%esi), %%mm4 \n\t"
- "movq (%1, %%esi), %%mm5 \n\t"
+ "movq (%1, %%esi), %%mm5 \n\t"
"psubd %%mm7, %%mm0 \n\t"
"psubd %%mm7, %%mm1 \n\t"
"psubd %%mm7, %%mm2 \n\t"
"psubd %%mm7, %%mm4 \n\t"
"psubd %%mm7, %%mm5 \n\t"
"leal (%%esi, %%esi, 2), %%edi \n\t"
-
+
"packssdw %%mm2, %%mm0 \n\t" // CcAa
"packssdw %%mm3, %%mm1 \n\t" // DdBb
"packssdw %%mm4, %%mm4 \n\t" // EeEe
"punpckhdq %%mm1, %%mm1 \n\t" // BABA
"punpckldq %%mm1, %%mm4 \n\t" // BAfe
"punpckhdq %%mm3, %%mm2 \n\t" // FEDC
-
+
"movq %%mm0, (%0, %%edi) \n\t"
"movq %%mm4, 8(%0, %%edi) \n\t"
"movq %%mm2, 16(%0, %%edi) \n\t"
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file libgsm.c
* Interface to libgsm for gsm encoding/decoding
avctx->block_align = GSM_BLOCK_SIZE;
avctx->priv_data = gsm_create();
-
+
avctx->coded_frame= avcodec_alloc_frame();
avctx->coded_frame->key_frame= 1;
-
+
return 0;
}
* @file postprocess.c
* postprocessing.
*/
-
+
/*
C MMX MMX2 3DNow AltiVec
isVertDC Ec Ec Ec
if((unsigned)(src[6] - src[3] + 2*QP) > 4*QP) return 0;
src += stride;
}
-#else
+#else
for(i=0; i<8; i++){
if((unsigned)(src[0] - src[7] + 2*QP) > 4*QP) return 0;
src += stride;
if(((unsigned)(src[ 7*step] - src[8*step] + dcOffset)) < dcThreshold) numEq++;
if(numEq > c->ppMode.flatnessThreshold){
int min, max, x;
-
+
if(src[0] > src[step]){
max= src[0];
min= src[step];
if(max-min < 2*QP){
const int first= ABS(src[-1*step] - src[0]) < QP ? src[-1*step] : src[0];
const int last= ABS(src[8*step] - src[7*step]) < QP ? src[8*step] : src[7*step];
-
+
int sums[10];
sums[0] = 4*first + src[0*step] + src[1*step] + src[2*step] + 4;
sums[1] = sums[0] - first + src[3*step];
int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) );
d= MAX(d, 0);
-
+
d= (5*d + 32) >> 6;
d*= SIGN(-middleEnergy);
-
+
if(q>0)
{
d= d<0 ? 0 : d;
d= d>0 ? 0 : d;
d= d<q ? q : d;
}
-
+
src[3*step]-= d;
src[4*step]+= d;
}
char *filterToken;
ppMode= memalign(8, sizeof(PPMode));
-
+
ppMode->lumMode= 0;
ppMode->chromMode= 0;
ppMode->maxTmpNoise[0]= 700;
}
}
}
- else if(filters[i].mask == V_DEBLOCK || filters[i].mask == H_DEBLOCK
+ else if(filters[i].mask == V_DEBLOCK || filters[i].mask == H_DEBLOCK
|| filters[i].mask == V_A_DEBLOCK || filters[i].mask == H_A_DEBLOCK)
{
int o;
PPContext *c= memalign(32, sizeof(PPContext));
int stride= (width+15)&(~15); //assumed / will realloc if needed
int qpStride= (width+15)/16 + 2; //assumed / will realloc if needed
-
+
global_init();
memset(c, 0, sizeof(PPContext));
}
reallocBuffers(c, width, height, stride, qpStride);
-
+
c->frameNum=-1;
return c;
void pp_free_context(void *vc){
PPContext *c = (PPContext*)vc;
int i;
-
+
for(i=0; i<3; i++) free(c->tempBlured[i]);
for(i=0; i<3; i++) free(c->tempBluredPast[i]);
-
+
free(c->tempBlocks);
free(c->yHistogram);
free(c->tempDst);
free(c->stdQPTable);
free(c->nonBQPTable);
free(c->forcedQPTable);
-
+
memset(c, 0, sizeof(PPContext));
free(c);
// c->stride and c->QPStride are always positive
if(c->stride < minStride || c->qpStride < absQPStride)
- reallocBuffers(c, width, height,
- MAX(minStride, c->stride),
+ reallocBuffers(c, width, height,
+ MAX(minStride, c->stride),
MAX(c->qpStride, absQPStride));
- if(QP_store==NULL || (mode->lumMode & FORCE_QUANT))
+ if(QP_store==NULL || (mode->lumMode & FORCE_QUANT))
{
int i;
QP_store= c->forcedQPTable;
c->stdQPTable[i] = QP_store[i]>>1;
}
QP_store= c->stdQPTable;
- QPStride= absQPStride;
+ QPStride= absQPStride;
}
if(0){
/**
* @file postprocess.h
- * @brief
+ * @brief
* external api for the pp stuff
*/
const vector signed int zero = vec_splat_s32(0);
const vector signed short mask = vec_splat_s16(1);
vector signed int v_numEq = vec_splat_s32(0);
-
+
data[0] = ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1;
data[1] = data[0] * 2 + 1;
data[2] = c->QP * 2;
#undef ITER
v_numEq = vec_sums(v_numEq, zero);
-
+
v_numEq = vec_splat(v_numEq, 3);
vec_ste(v_numEq, 0, &numEq);
0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f);
const vector unsigned char mmoP = (const vector unsigned char)
vec_lvsl(8, (unsigned char*)0);
-
+
vector signed short mmoL1 = vec_perm(v_srcAss0, v_srcAss2, mmoP1);
vector signed short mmoL2 = vec_perm(v_srcAss4, v_srcAss6, mmoP2);
vector signed short mmoL = vec_perm(mmoL1, mmoL2, mmoP);
vector signed short mmoR = vec_perm(mmoR1, mmoR2, mmoP);
vector signed short mmoDiff = vec_sub(mmoL, mmoR);
vector unsigned short mmoSum = (vector unsigned short)vec_add(mmoDiff, v2QP);
-
+
if (vec_any_gt(mmoSum, v4QP))
return 0;
else
return 1;
}
- else return 2;
+ else return 2;
}
static inline void doVertLowPass_altivec(uint8_t *src, int stride, PPContext *c) {
qp[0] = c->QP;
vector signed short vqp = vec_ld(0, qp);
vqp = vec_splat(vqp, 0);
-
+
src2 += stride*3;
vector signed short vb0, vb1, vb2, vb3, vb4, vb5, vb6, vb7, vb8, vb9;
vector unsigned char vbA0, vbA1, vbA2, vbA3, vbA4, vbA5, vbA6, vbA7, vbA8, vbA9;
vector unsigned char vbB0, vbB1, vbB2, vbB3, vbB4, vbB5, vbB6, vbB7, vbB8, vbB9;
vector unsigned char vbT0, vbT1, vbT2, vbT3, vbT4, vbT5, vbT6, vbT7, vbT8, vbT9;
-
+
#define LOAD_LINE(i) \
const vector unsigned char perml##i = \
vec_lvsl(i * stride, src2); \
const vector unsigned short v_cmp89 =
(const vector unsigned short) vec_cmplt(vec_abs(v_diff89), vqp);
const vector signed short v_last = vec_sel(vb8, vb9, v_cmp89);
-
+
const vector signed short temp01 = vec_mladd(v_first, (vector signed short)v_4, vb1);
const vector signed short temp02 = vec_add(vb2, vb3);
const vector signed short temp03 = vec_add(temp01, (vector signed short)v_4);
const vector signed short vb##i = \
(vector signed short)vec_mergeh((vector unsigned char)zero, \
(vector unsigned char)vbT##i)
-
+
src2 += stride*3;
-
+
LOAD_LINE(1);
LOAD_LINE(2);
LOAD_LINE(3);
LOAD_LINE(7);
LOAD_LINE(8);
#undef LOAD_LINE
-
+
const vector signed short v_1 = vec_splat_s16(1);
const vector signed short v_2 = vec_splat_s16(2);
const vector signed short v_5 = vec_splat_s16(5);
/* finally, stores */
const vector unsigned char st4 = vec_packsu(vb4minusd, (vector signed short)zero);
const vector unsigned char st5 = vec_packsu(vb5plusd, (vector signed short)zero);
-
+
const vector signed char neg1 = vec_splat_s8(-1);
const vector unsigned char permHH = (const vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
-
+
#define STORE(i) \
const vector unsigned char perms##i = \
vec_lvsr(i * stride, src2); \
vec_sel(vg2##i, vbB##i, mask##i); \
vec_st(svA##i, i * stride, src2); \
vec_st(svB##i, i * stride + 16, src2)
-
+
STORE(4);
STORE(5);
}
vector unsigned char sA##i = vec_ld(i * stride, srcCopy); \
vector unsigned char sB##i = vec_ld(i * stride + 16, srcCopy); \
vector unsigned char src##i = vec_perm(sA##i, sB##i, perm##i)
-
+
LOAD_LINE(0);
LOAD_LINE(1);
LOAD_LINE(2);
const vector unsigned char trunc_src34 = vec_perm(src3, src4, trunc_perm);
const vector unsigned char trunc_src56 = vec_perm(src5, src6, trunc_perm);
const vector unsigned char trunc_src78 = vec_perm(src7, src8, trunc_perm);
-
+
#define EXTRACT(op) do { \
const vector unsigned char s##op##_1 = vec_##op(trunc_src12, trunc_src34); \
const vector unsigned char s##op##_2 = vec_##op(trunc_src56, trunc_src78); \
const vector unsigned char s##op##_11h = vec_mergeh(s##op##_11, s##op##_11); \
const vector unsigned char s##op##_11l = vec_mergel(s##op##_11, s##op##_11); \
v_##op = vec_##op(s##op##_11h, s##op##_11l); } while (0)
-
+
vector unsigned char v_min;
vector unsigned char v_max;
EXTRACT(min);
EXTRACT(max);
#undef EXTRACT
-
+
if (vec_all_lt(vec_sub(v_max, v_min), v_dt))
return;
-
+
v_avg = vec_avg(v_min, v_max);
}
-
+
signed int __attribute__((aligned(16))) S[8];
{
const vector unsigned short mask1 = (vector unsigned short)
const vector unsigned short mask2 = (vector unsigned short)
AVV(0x0100, 0x0200, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000);
-
+
const vector unsigned int vuint32_16 = vec_sl(vec_splat_u32(1), vec_splat_u32(4));
const vector unsigned int vuint32_1 = vec_splat_u32(1);
-
+
#define COMPARE(i) \
vector signed int sum##i; \
do { \
const vector signed int sump##i = vec_sum4s(cmpHf##i, zero); \
const vector signed int sumq##i = vec_sum4s(cmpLf##i, sump##i); \
sum##i = vec_sums(sumq##i, zero); } while (0)
-
+
COMPARE(0);
COMPARE(1);
COMPARE(2);
COMPARE(8);
COMPARE(9);
#undef COMPARE
-
+
vector signed int sumA2;
vector signed int sumB2;
{
const vector signed int sump02 = vec_mergel(sum0, sum2);
const vector signed int sump13 = vec_mergel(sum1, sum3);
const vector signed int sumA = vec_mergel(sump02, sump13);
-
+
const vector signed int sump46 = vec_mergel(sum4, sum6);
const vector signed int sump57 = vec_mergel(sum5, sum7);
const vector signed int sumB = vec_mergel(sump46, sump57);
-
+
const vector signed int sump8A = vec_mergel(sum8, zero);
const vector signed int sump9B = vec_mergel(sum9, zero);
const vector signed int sumC = vec_mergel(sump8A, sump9B);
-
+
const vector signed int tA = vec_sl(vec_nor(zero, sumA), vuint32_16);
const vector signed int tB = vec_sl(vec_nor(zero, sumB), vuint32_16);
const vector signed int tC = vec_sl(vec_nor(zero, sumC), vuint32_16);
const vector signed int yA = vec_and(t2A, t3A);
const vector signed int yB = vec_and(t2B, t3B);
const vector signed int yC = vec_and(t2C, t3C);
-
+
const vector unsigned char strangeperm1 = vec_lvsl(4, (unsigned char*)0);
const vector unsigned char strangeperm2 = vec_lvsl(8, (unsigned char*)0);
const vector signed int sumAd4 = vec_perm(yA, yB, strangeperm1);
sumB2 = vec_or(sumBp,
vec_sra(sumBp,
vuint32_16));
- }
+ }
vec_st(sumA2, 0, S);
vec_st(sumB2, 16, S);
}
/* I'm not sure the following is actually faster
than straight, unvectorized C code :-( */
-
+
int __attribute__((aligned(16))) tQP2[4];
tQP2[0]= c->QP/2 + 1;
vector signed int vQP2 = vec_ld(0, tQP2);
ITER(7, 8, 9);
const vector signed char neg1 = vec_splat_s8(-1);
-
+
#define STORE_LINE(i) \
const vector unsigned char permST##i = \
vec_lvsr(i * stride, srcCopy); \
sB##i= vec_sel(src##i, sB##i, maskST##i); \
vec_st(sA##i, i * stride, srcCopy); \
vec_st(sB##i, i * stride + 16, srcCopy)
-
+
STORE_LINE(1);
STORE_LINE(2);
STORE_LINE(3);
vector signed int v_dp = zero;
vector signed int v_sysdp = zero;
int d, sysd, i;
-
+
tempBluredPast[127]= maxNoise[0];
tempBluredPast[128]= maxNoise[1];
tempBluredPast[129]= maxNoise[2];
vector signed short v_##src##Ass##i = \
(vector signed short)vec_mergeh((vector signed char)zero, \
(vector signed char)v_##src##A##i)
-
+
LOAD_LINE(src, 0);
LOAD_LINE(src, 1);
LOAD_LINE(src, 2);
v_dp = vec_splat(v_dp, 3);
v_sysdp = vec_splat(v_sysdp, 3);
-
+
vec_ste(v_dp, 0, &d);
vec_ste(v_sysdp, 0, &sysd);
const vector signed short vsint16_7 = vec_splat_s16(7);
const vector signed short vsint16_4 = vec_splat_s16(4);
const vector unsigned short vuint16_3 = vec_splat_u16(3);
-
+
#define OP(i) \
const vector signed short v_temp##i = \
vec_mladd(v_tempBluredAss##i, \
} else {
const vector signed short vsint16_3 = vec_splat_s16(3);
const vector signed short vsint16_2 = vec_splat_s16(2);
-
+
#define OP(i) \
const vector signed short v_temp##i = \
vec_mladd(v_tempBluredAss##i, \
vector unsigned char srcD##i = vec_ld(j * stride+ 16, src); \
vector unsigned char src##i = vec_perm(srcA##i, srcB##i, perm1##i); \
vector unsigned char src##j = vec_perm(srcC##i, srcD##i, perm2##i)
-
+
LOAD_DOUBLE_LINE(0, 1);
LOAD_DOUBLE_LINE(2, 3);
LOAD_DOUBLE_LINE(4, 5);
const vector unsigned char magic_perm = (const vector unsigned char)
AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
-
+
#define LOAD_DOUBLE_LINE(i, j) \
vector unsigned char src##i = vec_ld(i * 16, src); \
vector unsigned char src##j = vec_ld(j * 16, src)
uint8_t *tempBlocks; ///<used for the horizontal code
/**
- * luma histogram.
+ * luma histogram.
* we need 64bit here otherwise we'll going to have a problem
* after watching a black picture for 5 hours
*/
int nonBQP;
int frameNum;
-
+
int cpuCaps;
-
+
int qpStride; ///<size of qp buffers (needed to realloc them if needed)
int stride; ///<size of some buffers (needed to realloc them if needed)
-
+
int hChromaSubSample;
int vChromaSubSample;
int numEq= 0, dcOk;
src+= stride*4; // src points to begin of the 8x8 Block
asm volatile(
- "movq %0, %%mm7 \n\t"
- "movq %1, %%mm6 \n\t"
+ "movq %0, %%mm7 \n\t"
+ "movq %1, %%mm6 \n\t"
: : "m" (c->mmxDcOffset[c->nonBQP]), "m" (c->mmxDcThreshold[c->nonBQP])
);
-
+
asm volatile(
"lea (%2, %3), %%"REG_a" \n\t"
// 0 1 2 3 4 5 6 7 8 9
"paddb %%mm7, %%mm2 \n\t"
"pcmpgtb %%mm6, %%mm2 \n\t"
"paddb %%mm2, %%mm0 \n\t"
-
+
"lea (%%"REG_a", %3, 4), %%"REG_a" \n\t"
"movq (%2, %3, 4), %%mm2 \n\t"
"lea (%0, %1), %%"REG_a" \n\t"
"lea (%%"REG_a", %1, 4), %%"REG_d" \n\t"
-
+
// 0 1 2 3 4 5 6 7 8 9
// %0 eax eax+%1 eax+2%1 %0+4%1 edx edx+%1 edx+2%1 %0+8%1 edx+4%1
"cmpb "MANGLE(deringThreshold)", %%cl \n\t"
" jb 1f \n\t"
"lea -24(%%"REG_SP"), %%"REG_c" \n\t"
- "and "ALIGN_MASK", %%"REG_c" \n\t"
+ "and "ALIGN_MASK", %%"REG_c" \n\t"
PAVGB(%%mm0, %%mm7) // a=(max + min)/2
"punpcklbw %%mm7, %%mm7 \n\t"
"punpcklbw %%mm7, %%mm7 \n\t"
if(src[stride*y + 7] > avg) t+= 128;
if(src[stride*y + 8] > avg) t+= 256;
if(src[stride*y + 9] > avg) t+= 512;
-
+
t |= (~t)<<16;
t &= (t<<1) & (t>>1);
s[y] = t;
}
-
+
for(y=1; y<9; y++)
{
int t = s[y-1] & s[y] & s[y+1];
DEINT_L5(%%mm1, %%mm0, (%%REGa) , (%%REGa, %1) , (%%REGa, %1, 2))
DEINT_L5(%%mm0, %%mm1, (%%REGa, %1) , (%%REGa, %1, 2), (%0, %1, 4) )
DEINT_L5(%%mm1, %%mm0, (%%REGa, %1, 2), (%0, %1, 4) , (%%REGd) )
-DEINT_L5(%%mm0, %%mm1, (%0, %1, 4) , (%%REGd) , (%%REGd, %1) )
+DEINT_L5(%%mm0, %%mm1, (%0, %1, 4) , (%%REGd) , (%%REGd, %1) )
DEINT_L5(%%mm1, %%mm0, (%%REGd) , (%%REGd, %1) , (%%REGd, %1, 2))
DEINT_L5(%%mm0, %%mm1, (%%REGd, %1) , (%%REGd, %1, 2), (%0, %1, 8) )
DEINT_L5(%%mm1, %%mm0, (%%REGd, %1, 2), (%0, %1, 8) , (%%REGd, %1, 4))
"movd %%mm1, 112(%3) \n\t"
"lea (%%"REG_a", %1, 4), %%"REG_a" \n\t"
-
+
"movq (%0, %1, 4), %%mm0 \n\t" // 12345678
"movq (%%"REG_a"), %%mm1 \n\t" // abcdefgh
"movq %%mm0, %%mm2 \n\t" // 12345678
tempBluredPast[127]= maxNoise[0];
tempBluredPast[128]= maxNoise[1];
tempBluredPast[129]= maxNoise[2];
-
+
#define FAST_L2_DIFF
//#define L1_DIFF //u should change the thresholds too if u try that one
#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
src+= step*3; // src points to begin of the 8x8 Block
//START_TIMER
asm volatile(
- "movq %0, %%mm7 \n\t"
- "movq %1, %%mm6 \n\t"
+ "movq %0, %%mm7 \n\t"
+ "movq %1, %%mm6 \n\t"
: : "m" (c->mmxDcOffset[c->nonBQP]), "m" (c->mmxDcThreshold[c->nonBQP])
);
-
+
asm volatile(
"lea (%2, %3), %%"REG_a" \n\t"
// 0 1 2 3 4 5 6 7 8 9
"paddb %%mm7, %%mm2 \n\t"
"pcmpgtb %%mm6, %%mm2 \n\t"
"paddb %%mm2, %%mm0 \n\t"
-
+
"lea (%%"REG_a", %3, 4), %%"REG_a" \n\t"
"movq (%2, %3, 4), %%mm2 \n\t"
"pxor %%mm7, %%mm1 \n\t"
"pand %%mm0, %%mm1 \n\t"
"pxor %%mm1, %%mm7 \n\t"
-
+
"movq %%mm6, %%mm5 \n\t"
"punpckhbw %%mm4, %%mm6 \n\t"
"punpcklbw %%mm4, %%mm5 \n\t"
"psubw %%mm2, %%mm0 \n\t"\
"psubw %%mm3, %%mm1 \n\t"
-
+
NEXT //0
NEXT //1
NEXT //2
"movq %%mm7, %%mm6 \n\t"
"punpckhbw %%mm4, %%mm7 \n\t"
"punpcklbw %%mm4, %%mm6 \n\t"
-
+
NEXT //7
"mov %4, %0 \n\t"
"add %1, %0 \n\t"
"paddw %%mm7, %%mm1 \n\t"
"movq %%mm0, 96(%3) \n\t"
"movq %%mm1, 104(%3) \n\t"
-
+
PREV //2
"paddw %%mm6, %%mm0 \n\t"
"paddw %%mm7, %%mm1 \n\t"
c.packedYScale|= c.packedYScale<<32;
c.packedYScale|= c.packedYScale<<16;
-
+
if(mode & LEVEL_FIX) QPCorrecture= (int)(scale*256*256 + 0.5);
else QPCorrecture= 256*256;
}
"packuswb %%mm7, %%mm7 \n\t" // 0,QP, 0, QP, 0,QP, 0, QP
"packuswb %%mm7, %%mm7 \n\t" // QP,..., QP
"movq %%mm7, %0 \n\t"
- : "=m" (c.pQPb)
+ : "=m" (c.pQPb)
: "r" (QP)
);
#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file loco.c
* LOCO codec.
*/
-
+
#include "avcodec.h"
#include "common.h"
#include "bitstream.h"
{
int cnt = 0;
int val = r->count;
-
+
while(r->sum > val && cnt < 9) {
val <<= 1;
cnt++;
}
-
+
return cnt;
}
{
r->sum += val;
r->count++;
-
+
if(r->count == 16) {
r->sum >>= 1;
r->count >>= 1;
r->run2 = 0;
}
}
-
+
return v;
}
static inline int loco_predict(uint8_t* data, int stride, int step)
{
int a, b, c;
-
+
a = data[-stride];
b = data[-step];
c = data[-stride - step];
-
+
return mid_pred(a, a + b - c, b);
}
RICEContext rc;
int val;
int i, j;
-
+
init_get_bits(&rc.gb, buf, buf_size*8);
rc.save = 0;
rc.run = 0;
rc.run2 = 0;
- rc.lossy = l->lossy;
-
+ rc.lossy = l->lossy;
+
rc.sum = 8;
rc.count = 1;
-
+
/* restore top left pixel */
val = loco_get_rice(&rc);
data[0] = 128 + val;
}
data += stride;
}
-
+
return ((get_bits_count(&rc.gb) + 7) >> 3);
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
*data_size = sizeof(AVFrame);
*(AVFrame*)data = l->pic;
-
+
return buf_size;
}
l->lossy = LE_32(avctx->extradata + 8);
av_log(avctx, AV_LOG_INFO, "This is LOCO codec version %i, please upload file for study\n", version);
}
-
+
l->mode = LE_32(avctx->extradata + 4);
switch(l->mode) {
case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:
* @file mace.c
* MACE decoder.
*/
-
+
#include "avcodec.h"
/*
* @param input N/2 samples
* @param tmp N/2 samples
*/
-void ff_imdct_calc(MDCTContext *s, FFTSample *output,
+void ff_imdct_calc(MDCTContext *s, FFTSample *output,
const FFTSample *input, FFTSample *tmp)
{
int k, n8, n4, n2, n, j;
* @param out N/2 samples
* @param tmp temporary storage of N/2 samples
*/
-void ff_mdct_calc(MDCTContext *s, FFTSample *out,
+void ff_mdct_calc(MDCTContext *s, FFTSample *out,
const FFTSample *input, FFTSample *tmp)
{
int i, j, n, n8, n4, n2, n3;
}
ff_fft_calc(&s->fft, x);
-
+
/* post rotation */
for(i=0;i<n4;i++) {
re = x[i].re;
*
* based upon code from Sebastian Jedruszkiewicz <elf@frogger.rules.pl>
*/
-
+
/**
* @file mdec.c
* PSX MDEC codec.
* This is very similar to intra only MPEG1.
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
a->last_dc[component]+= diff;
block[0] = a->last_dc[component]<<3;
}
-
+
i = 0;
{
- OPEN_READER(re, &a->gb);
+ OPEN_READER(re, &a->gb);
/* now quantify & encode AC coefs */
for(;;) {
UPDATE_CACHE(re, &a->gb);
GET_RL_VLC(level, run, re, &a->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level == 127){
break;
} else if(level != 0) {
const int block_index[6]= {5,4,0,1,2,3};
a->dsp.clear_blocks(block[0]);
-
+
for(i=0; i<6; i++){
- if( mdec_decode_block_intra(a, block[ block_index[i] ], block_index[i]) < 0)
+ if( mdec_decode_block_intra(a, block[ block_index[i] ], block_index[i]) < 0)
return -1;
}
return 0;
static inline void idct_put(MDECContext *a, int mb_x, int mb_y){
DCTELEM (*block)[64]= a->block;
int linesize= a->picture.linesize[0];
-
+
uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;
uint8_t *dest_cb = a->picture.data[1] + (mb_y * 8 * a->picture.linesize[1]) + mb_x * 8;
uint8_t *dest_cr = a->picture.data[2] + (mb_y * 8 * a->picture.linesize[2]) + mb_x * 8;
}
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
a->bitstream_buffer[i+1]= buf[i ];
}
init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8);
-
+
/* skip over 4 preamble bytes in stream (typically 0xXX 0xXX 0x00 0x38) */
skip_bits(&a->gb, 32);
a->qscale= get_bits(&a->gb, 16);
a->version= get_bits(&a->gb, 16);
-
+
// printf("qscale:%d (0x%X), version:%d (0x%X)\n", a->qscale, a->qscale, a->version, a->version);
-
+
for(a->mb_x=0; a->mb_x<a->mb_width; a->mb_x++){
for(a->mb_y=0; a->mb_y<a->mb_height; a->mb_y++){
if( decode_mb(a, a->block) <0)
return -1;
-
+
idct_put(a, a->mb_x, a->mb_y);
}
}
// p->quality= (32 + a->inv_qscale/2)/a->inv_qscale;
// memset(p->qscale_table, p->quality, p->qstride*a->mb_height);
-
+
*picture= *(AVFrame*)&a->picture;
*data_size = sizeof(AVPicture);
emms_c();
-
+
return (get_bits_count(&a->gb)+31)/32*4;
}
static int decode_init(AVCodecContext *avctx){
MDECContext * const a = avctx->priv_data;
AVFrame *p= (AVFrame*)&a->picture;
-
+
mdec_common_init(avctx);
init_vlcs();
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_zigzag_direct);
av_freep(&a->bitstream_buffer);
av_freep(&a->picture.qscale_table);
a->bitstream_buffer_size=0;
-
+
return 0;
}
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file mem.c
* default memory allocator for libavcodec.
*/
-
+
#include "avcodec.h"
/* here we can use OS dependant allocation functions */
memory allocator. You do not need to suppress this file because the
linker will do it automatically */
-/**
+/**
* Memory allocation of size byte with alignment suitable for all
* memory accesses (including vectors if available on the
* CPU). av_malloc(0) must return a non NULL pointer.
/* lets disallow possible ambiguous cases */
if(size > INT_MAX)
return NULL;
-
+
#ifdef MEMALIGN_HACK
ptr = malloc(size+16+1);
diff= ((-(int)ptr - 1)&15) + 1;
ptr += diff;
((char*)ptr)[-1]= diff;
-#elif defined (HAVE_MEMALIGN)
+#elif defined (HAVE_MEMALIGN)
ptr = memalign(16,size);
- /* Why 64?
+ /* Why 64?
Indeed, we should align it:
on 4 for 386
on 16 for 486
memalign(64)+16 2543,2572,2563
memalign(64)+32 2546,2545,2571
memalign(64)+64 2570,2533,2558
-
+
btw, malloc seems to do 8 byte alignment by default here
*/
#else
/**
* av_realloc semantics (same as glibc): if ptr is NULL and size > 0,
* identical to malloc(size). If size is zero, it is identical to
- * free(ptr) and NULL is returned.
+ * free(ptr) and NULL is returned.
*/
void *av_realloc(void *ptr, unsigned int size)
{
* @file mjpeg.c
* MJPEG encoder and decoder.
*/
-
+
//#define DEBUG
#include <assert.h>
#undef TWOMATRIXES
typedef struct MJpegContext {
- uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
+ uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
uint16_t huff_code_dc_luminance[12];
uint8_t huff_size_dc_chrominance[12];
uint16_t huff_code_dc_chrominance[12];
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa
+ 0xf9, 0xfa
};
static const uint8_t bits_ac_chrominance[17] =
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa
+ 0xf9, 0xfa
};
/* isn't this function nicer than the one in the libjpeg ? */
int mjpeg_init(MpegEncContext *s)
{
MJpegContext *m;
-
+
m = av_malloc(sizeof(MJpegContext));
if (!m)
return -1;
-
+
s->min_qcoeff=-1023;
s->max_qcoeff= 1023;
m->huff_code_ac_chrominance,
bits_ac_chrominance,
val_ac_chrominance);
-
+
s->mjpeg_ctx = m;
return 0;
}
size = 2;
size += put_huffman_table(s, 0, 0, bits_dc_luminance, val_dc_luminance);
size += put_huffman_table(s, 0, 1, bits_dc_chrominance, val_dc_chrominance);
-
+
size += put_huffman_table(s, 1, 0, bits_ac_luminance, val_ac_luminance);
size += put_huffman_table(s, 1, 1, bits_ac_chrominance, val_ac_chrominance);
ptr[0] = size >> 8;
ptr[1] = size;
}
- if( s->avctx->pix_fmt == PIX_FMT_YUV420P
+ if( s->avctx->pix_fmt == PIX_FMT_YUV420P
||s->avctx->pix_fmt == PIX_FMT_YUV422P
||s->avctx->pix_fmt == PIX_FMT_YUV444P){
put_marker(p, COM);
if (!s->mjpeg_data_only_frames)
{
- jpeg_put_comments(s);
+ jpeg_put_comments(s);
if (s->mjpeg_write_tables) jpeg_table_header(s);
put_bits(&s->pb, 16, s->height);
put_bits(&s->pb, 16, s->width);
put_bits(&s->pb, 8, 3); /* 3 components */
-
+
/* Y component */
put_bits(&s->pb, 8, 1); /* component number */
put_bits(&s->pb, 4, s->mjpeg_hsample[0]); /* H factor */
put_bits(&s->pb, 4, s->mjpeg_vsample[0]); /* V factor */
put_bits(&s->pb, 8, 0); /* select matrix */
-
+
/* Cb component */
put_bits(&s->pb, 8, 2); /* component number */
put_bits(&s->pb, 4, s->mjpeg_hsample[1]); /* H factor */
put_marker(&s->pb, SOS);
put_bits(&s->pb, 16, 12); /* length */
put_bits(&s->pb, 8, 3); /* 3 components */
-
+
/* Y component */
put_bits(&s->pb, 8, 1); /* index */
put_bits(&s->pb, 4, 0); /* DC huffman table index */
put_bits(&s->pb, 4, 0); /* AC huffman table index */
-
+
/* Cb component */
put_bits(&s->pb, 8, 2); /* index */
put_bits(&s->pb, 4, 1); /* DC huffman table index */
put_bits(&s->pb, 4, lossless ? 0 : 1); /* AC huffman table index */
-
+
/* Cr component */
put_bits(&s->pb, 8, 3); /* index */
put_bits(&s->pb, 4, 1); /* DC huffman table index */
int i, ff_count;
uint8_t *buf= s->pb.buf + start;
int align= (-(size_t)(buf))&3;
-
+
assert((size&7) == 0);
size >>= 3;
-
+
ff_count=0;
for(i=0; i<size && i<align; i++){
if(buf[i]==0xFF) ff_count++;
}
if(ff_count==0) return;
-
+
/* skip put bits */
for(i=0; i<ff_count-3; i+=4)
put_bits(&s->pb, 32, 0);
put_bits(&s->pb, (ff_count-i)*8, 0);
- flush_put_bits(&s->pb);
+ flush_put_bits(&s->pb);
for(i=size-1; ff_count; i--){
int v= buf[i];
flush_put_bits(&s->pb);
assert((s->header_bits&7)==0);
-
+
escape_FF(s, s->header_bits>>3);
put_marker(&s->pb, EOI);
val = -val;
mant--;
}
-
+
nbits= av_log2_16bit(val) + 1;
-
+
put_bits(&s->pb, huff_size[nbits], huff_code[nbits]);
-
+
put_bits(&s->pb, nbits, mant & ((1 << nbits) - 1));
}
}
MJpegContext *m = s->mjpeg_ctx;
uint8_t *huff_size_ac;
uint16_t *huff_code_ac;
-
+
/* DC coef */
component = (n <= 3 ? 0 : n - 4 + 1);
dc = block[0]; /* overflow is impossible */
huff_code_ac = m->huff_code_ac_chrominance;
}
s->last_dc[component] = dc;
-
+
/* AC coefs */
-
+
run = 0;
last_index = s->block_last_index[n];
for(i=1;i<=last_index;i++) {
val = -val;
mant--;
}
-
+
nbits= av_log2(val) + 1;
code = (run << 4) | nbits;
put_bits(&s->pb, huff_size_ac[code], huff_code_ac[code]);
-
+
put_bits(&s->pb, nbits, mant & ((1 << nbits) - 1));
run = 0;
}
put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
}
-void mjpeg_encode_mb(MpegEncContext *s,
+void mjpeg_encode_mb(MpegEncContext *s,
DCTELEM block[6][64])
{
int i;
*p = *pict;
p->pict_type= FF_I_TYPE;
p->key_frame= 1;
-
+
mjpeg_picture_header(s);
s->header_bits= put_bits_count(&s->pb);
-
+
if(avctx->pix_fmt == PIX_FMT_RGBA32){
int x, y, i;
const int linesize= p->linesize[0];
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
-
+
for(i=0; i<3; i++){
top[i]= left[i]= topleft[i]= buffer[0][i];
}
int pred, diff;
PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
-
+
topleft[i]= top[i];
top[i]= buffer[x+1][i];
-
+
left[i]= buffer[x][i];
diff= ((left[i] - pred + 0x100)&0x1FF) - 0x100;
-
+
if(i==0)
mjpeg_encode_dc(s, diff, m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
else
int mb_x, mb_y, i;
const int mb_width = (width + s->mjpeg_hsample[0] - 1) / s->mjpeg_hsample[0];
const int mb_height = (height + s->mjpeg_vsample[0] - 1) / s->mjpeg_vsample[0];
-
+
for(mb_y = 0; mb_y < mb_height; mb_y++) {
if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < mb_width * 4 * 3 * s->mjpeg_hsample[0] * s->mjpeg_vsample[0]){
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
}
}
-
+
if(i==0)
mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
else
h = s->mjpeg_hsample[i];
v = s->mjpeg_vsample[i];
linesize= p->linesize[i];
-
+
for(y=0; y<v; y++){
for(x=0; x<h; x++){
int pred;
ptr = p->data[i] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
-//printf("%d %d %d %d %8X\n", mb_x, mb_y, x, y, ptr);
+//printf("%d %d %d %d %8X\n", mb_x, mb_y, x, y, ptr);
PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
if(i==0)
}
emms_c();
-
+
mjpeg_picture_trailer(s);
s->picture_number++;
int bottom_field; /* true if bottom field */
int lossless;
int rgb;
- int rct; /* standard rct */
- int pegasus_rct; /* pegasus reversible colorspace transform */
+ int rct; /* standard rct */
+ int pegasus_rct; /* pegasus reversible colorspace transform */
int bits; /* bits per component */
int width, height;
static int mjpeg_decode_dht(MJpegDecodeContext *s);
-static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table,
+static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table,
int nb_codes, int use_static)
{
uint8_t huff_size[256];
memset(huff_size, 0, sizeof(huff_size));
build_huffman_codes(huff_size, huff_code, bits_table, val_table);
-
+
return init_vlc(vlc, 9, nb_codes, huff_size, 1, 1, huff_code, 2, 2, use_static);
}
s->start_code = -1;
s->first_picture = 1;
s->org_height = avctx->coded_height;
-
+
build_vlc(&s->vlcs[0][0], bits_dc_luminance, val_dc_luminance, 12, 0);
build_vlc(&s->vlcs[0][1], bits_dc_chrominance, val_dc_chrominance, 12, 0);
build_vlc(&s->vlcs[1][0], bits_ac_luminance, val_ac_luminance, 251, 0);
static int find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
int vop_found, i;
uint16_t state;
-
+
vop_found= pc->frame_start_found;
state= pc->state;
-
+
i=0;
if(!vop_found){
for(i=0; i<buf_size; i++){
state= (state<<8) | buf[i];
if(state == 0xFFD8){
pc->frame_start_found=0;
- pc->state=0;
+ pc->state=0;
return i-1;
}
}
static int jpeg_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext *pc = s->priv_data;
int next;
-
+
next= find_frame_end(pc, buf, buf_size);
if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
static int mjpeg_decode_dqt(MJpegDecodeContext *s)
{
int len, index, i, j;
-
+
len = get_bits(&s->gb, 16) - 2;
while (len >= 65) {
dprintf("qscale[%d]: %d\n", index, s->qscale[index]);
len -= 65;
}
-
+
return 0;
}
int len, index, i, class, n, v, code_max;
uint8_t bits_table[17];
uint8_t val_table[256];
-
+
len = get_bits(&s->gb, 16) - 2;
while (len > 0) {
/* XXX: verify len field validity */
len = get_bits(&s->gb, 16);
s->bits= get_bits(&s->gb, 8);
-
- if(s->pegasus_rct) s->bits=9;
+
+ if(s->pegasus_rct) s->bits=9;
if(s->bits==9 && !s->pegasus_rct) s->rct=1; //FIXME ugly
if (s->bits != 8 && !s->lossless){
}
height = get_bits(&s->gb, 16);
width = get_bits(&s->gb, 16);
-
+
dprintf("sof0: picture: %dx%d\n", width, height);
if(avcodec_check_dimensions(s->avctx, width, height))
return -1;
dprintf("component %d %d:%d id: %d quant:%d\n", i, s->h_count[i],
s->v_count[i], s->component_id[i], s->quant_index[i]);
}
-
+
if(s->v_max==1 && s->h_max==1 && s->lossless==1) s->rgb=1;
/* if different size, realloc/alloc picture */
/* XXX: also check h_count and v_count */
if (width != s->width || height != s->height) {
av_freep(&s->qscale_table);
-
+
s->width = width;
s->height = height;
avcodec_set_dimensions(s->avctx, width, height);
s->first_picture = 0;
}
-
+
if(s->interlaced && s->bottom_field)
return 0;
-
+
/* XXX: not complete test ! */
switch((s->h_count[0] << 4) | s->v_count[0]) {
case 0x11:
}
s->picture.pict_type= I_TYPE;
s->picture.key_frame= 1;
-
+
for(i=0; i<3; i++){
s->linesize[i]= s->picture.linesize[i] << s->interlaced;
}
// printf("%d %d %d %d %d %d\n", s->width, s->height, s->linesize[0], s->linesize[1], s->interlaced, s->avctx->height);
-
+
if (len != (8+(3*nb_components)))
{
dprintf("decode_sof0: error, len(%d) mismatch\n", len);
}
-
+
return 0;
}
}
/* decode block and dequantize */
-static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
+static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
int component, int dc_index, int ac_index, int quant_index)
{
int code, i, j, level, val;
int left[3], top[3], topleft[3];
const int linesize= s->linesize[0];
const int mask= (1<<s->bits)-1;
-
+
if((unsigned)s->mb_width > 32768) //dynamic alloc
return -1;
-
+
for(i=0; i<3; i++){
buffer[0][i]= 1 << (s->bits + point_transform - 1);
}
top[i]= buffer[mb_x][i];
PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
-
- left[i]=
+
+ left[i]=
buffer[mb_x][i]= mask & (pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform));
}
x = 0;
y = 0;
linesize= s->linesize[c];
-
+
for(j=0; j<n; j++) {
int pred;
PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
}
}
-
+
if (s->interlaced && s->bottom_field)
ptr += linesize >> 1;
*ptr= pred + (mjpeg_decode_dc(s, s->dc_index[i]) << point_transform);
x = 0;
y = 0;
linesize= s->linesize[c];
-
+
for(j=0; j<n; j++) {
int pred;
y = 0;
for(j=0;j<n;j++) {
memset(s->block, 0, sizeof(s->block));
- if (decode_block(s, s->block, i,
- s->dc_index[i], s->ac_index[i],
+ if (decode_block(s, s->block, i,
+ s->dc_index[i], s->ac_index[i],
s->quant_index[c]) < 0) {
dprintf("error y=%d x=%d\n", mb_y, mb_x);
return -1;
}
// dprintf("mb: %d %d processed\n", mb_y, mb_x);
- ptr = s->picture.data[c] +
- (((s->linesize[c] * (v * mb_y + y) * 8) +
+ ptr = s->picture.data[c] +
+ (((s->linesize[c] * (v * mb_y + y) * 8) +
(h * mb_x + x) * 8) >> s->avctx->lowres);
if (s->interlaced && s->bottom_field)
ptr += s->linesize[c] >> 1;
case SOF3:
if (dc_index[i] > 3 || ac_index[i] != 0)
goto out_of_range;
- break;
+ break;
}
#endif
}
skip_bits(&s->gb, 4); /* Ah */
point_transform= get_bits(&s->gb, 4); /* Al */
- for(i=0;i<nb_components;i++)
+ for(i=0;i<nb_components;i++)
s->last_dc[i] = 1024;
if (nb_components > 1) {
if(s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG, "%s %s p:%d >>:%d\n", s->lossless ? "lossless" : "sequencial DCT", s->rgb ? "RGB" : "", predictor, point_transform);
-
+
/* mjpeg-b can have padding bytes between sos and image data, skip them */
for (i = s->mjpb_skiptosod; i > 0; i--)
skip_bits(&s->gb, 8);
len -= 6;
if(s->avctx->debug & FF_DEBUG_STARTCODE){
- av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id);
+ av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id);
}
-
+
/* buggy AVID, it puts EOI only at every 10th frame */
/* also this fourcc is used by non-avid files too, it holds some
informations, but it's always present in AVID creates files */
// printf("mjpeg: interlace polarity: %d\n", s->interlace_polarity);
goto out;
}
-
+
// len -= 2;
-
+
if (id == ff_get_fourcc("JFIF"))
{
int t_w, t_h, v1, v2;
len -= 10;
goto out;
}
-
+
if (id == ff_get_fourcc("Adob") && (get_bits(&s->gb, 8) == 'e'))
{
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
len -= 9;
goto out;
}
-
+
/* Apple MJPEG-A */
if ((s->start_code == APP1) && (len > (0x28 - 8)))
{
return val;
}
-static int mjpeg_decode_frame(AVCodecContext *avctx,
+static int mjpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
goto the_end;
} else {
dprintf("marker=%x avail_size_in_buf=%d\n", start_code, buf_end - buf_ptr);
-
+
if ((buf_end - buf_ptr) > s->buffer_size)
{
av_free(s->buffer);
dprintf("buffer too small, expanding to %d bytes\n",
s->buffer_size);
}
-
+
/* unescape buffer of SOS */
if (start_code == SOS)
{
}
}
init_get_bits(&s->gb, s->buffer, (dst - s->buffer)*8);
-
+
dprintf("escaping removed %d bytes\n",
(buf_end - buf_ptr) - (dst - s->buffer));
}
else
init_get_bits(&s->gb, buf_ptr, (buf_end - buf_ptr)*8);
-
+
s->start_code = start_code;
if(s->avctx->debug & FF_DEBUG_STARTCODE){
av_log(s->avctx, AV_LOG_DEBUG, "startcode: %X\n", start_code);
break;
case SOF0:
s->lossless=0;
- if (mjpeg_decode_sof(s) < 0)
+ if (mjpeg_decode_sof(s) < 0)
return -1;
break;
case SOF3:
s->lossless=1;
- if (mjpeg_decode_sof(s) < 0)
+ if (mjpeg_decode_sof(s) < 0)
return -1;
break;
case EOI:
- if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
+ if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
break;
eoi_parser:
{
*data_size = sizeof(AVFrame);
if(!s->lossless){
- picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
+ picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
picture->qstride= 0;
picture->qscale_table= s->qscale_table;
memset(picture->qscale_table, picture->quality, (s->width+15)/16);
av_log(s->avctx, AV_LOG_DEBUG, "QP: %d\n", picture->quality);
picture->quality*= FF_QP2LAMBDA;
}
-
+
goto the_end;
}
break;
return buf_ptr - buf;
}
-static int mjpegb_decode_frame(AVCodecContext *avctx,
+static int mjpegb_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
buf_ptr = buf;
buf_end = buf + buf_size;
-
+
read_header:
/* reset on every SOI */
s->restart_interval = 0;
init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8);
skip_bits(&hgb, 32); /* reserved zeros */
-
+
if (get_bits_long(&hgb, 32) != be2me_32(ff_get_fourcc("mjpg")))
{
dprintf("not mjpeg-b (bad fourcc)\n");
s->start_code = DQT;
mjpeg_decode_dqt(s);
}
-
+
dht_offs = get_bits_long(&hgb, 32);
dprintf("dht offs: 0x%x\n", dht_offs);
if (dht_offs)
*picture= s->picture;
*data_size = sizeof(AVFrame);
-
+
if(!s->lossless){
- picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
+ picture->quality= FFMAX(FFMAX(s->qscale[0], s->qscale[1]), s->qscale[2]);
picture->qstride= 0;
picture->qscale_table= s->qscale_table;
memset(picture->qscale_table, picture->quality, (s->width+15)/16);
#include "sp5x.h"
-static int sp5x_decode_frame(AVCodecContext *avctx,
+static int sp5x_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
s->quant_index[2] = 1;
s->h_max = 2;
s->v_max = 2;
-
+
s->qscale_table = av_mallocz((s->width+15)/16);
avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420;
s->interlaced = 0;
-
+
s->picture.reference = 0;
if (avctx->get_buffer(avctx, &s->picture) < 0)
{
s->v_scount[2] = s->v_count[2];
s->dc_index[2] = 1;
s->ac_index[2] = 1;
-
+
for (i = 0; i < 3; i++)
s->last_dc[i] = 1024;
s->mb_height = (s->height * s->v_max * 8 -1) / (s->v_max * 8);
init_get_bits(&s->gb, buf+14, (buf_size-14)*8);
-
+
return mjpeg_decode_scan(s);
#endif
av_free(s->buffer);
av_free(s->qscale_table);
-
+
for(i=0;i<2;i++) {
for(j=0;j<4;j++)
free_vlc(&s->vlcs[i][j]);
uint8_t *cm = cropTbl + MAX_NEG_CROP;
mlib_VideoIDCT8x8_S16_S16 (data, data);
-
+
for(i=0;i<8;i++) {
dest[0] = cm[data[0]];
dest[1] = cm[data[1]];
/*
- * Motion estimation
+ * Motion estimation
* Copyright (c) 2000,2001 Fabrice Bellard.
* Copyright (c) 2002-2004 Michael Niedermayer
- *
+ *
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* new Motion Estimation (X1/EPZS) by Michael Niedermayer <michaelni@gmx.at>
*/
-
+
/**
* @file motion_est.c
* Motion estimation.
*/
-
+
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
static int minima_cmp(const void *a, const void *b){
const Minima *da = (const Minima *) a;
const Minima *db = (const Minima *) b;
-
+
return da->height - db->height;
}
static int get_flags(MotionEstContext *c, int direct, int chroma){
return ((c->avctx->flags&CODEC_FLAG_QPEL) ? FLAG_QPEL : 0)
- + (direct ? FLAG_DIRECT : 0)
+ + (direct ? FLAG_DIRECT : 0)
+ (chroma ? FLAG_CHROMA : 0);
}
int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4));
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
-
+
uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1);
if(qpel){
c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp);
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
-
+
if(qpel){
c->qpel_put[1][fxy](c->temp , ref[0] + (fx>>2) + (fy>>2)*stride , stride);
c->qpel_put[1][fxy](c->temp + 8 , ref[0] + (fx>>2) + (fy>>2)*stride + 8 , stride);
c->qpel_avg[1][bxy](c->temp + 8 , ref[8] + (bx>>2) + (by>>2)*stride + 8 , stride);
c->qpel_avg[1][bxy](c->temp + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8*stride, stride);
c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride);
- }else{
+ }else{
assert((fx>>1) + 16*s->mb_x >= -16);
assert((fy>>1) + 16*s->mb_y >= -16);
assert((fx>>1) + 16*s->mb_x <= s->width);
if(chroma)
uvdxy= dxy | (x&1) | (2*(y&1));
}
- d = cmp_func(s, c->temp, src[0], stride, h);
+ d = cmp_func(s, c->temp, src[0], stride, h);
}else{
- d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h);
+ d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h);
if(chroma)
uvdxy= (x&1) + 2*(y&1);
}
uint8_t * const uvtemp= c->temp + 16*stride;
c->hpel_put[size+1][uvdxy](uvtemp , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
- d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1);
- d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
+ d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1);
+ d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
}
}
#if 0
ff_set_cmp(&s->dsp, s->dsp.me_cmp, c->avctx->me_cmp);
ff_set_cmp(&s->dsp, s->dsp.me_sub_cmp, c->avctx->me_sub_cmp);
ff_set_cmp(&s->dsp, s->dsp.mb_cmp, c->avctx->mb_cmp);
-
+
c->flags = get_flags(c, 0, c->avctx->me_cmp &FF_CMP_CHROMA);
c->sub_flags= get_flags(c, 0, c->avctx->me_sub_cmp&FF_CMP_CHROMA);
c->mb_flags = get_flags(c, 0, c->avctx->mb_cmp &FF_CMP_CHROMA);
}else{
if(c->avctx->me_sub_cmp&FF_CMP_CHROMA)
c->sub_motion_search= hpel_motion_search;
- else if( c->avctx->me_sub_cmp == FF_CMP_SAD
- && c->avctx-> me_cmp == FF_CMP_SAD
+ else if( c->avctx->me_sub_cmp == FF_CMP_SAD
+ && c->avctx-> me_cmp == FF_CMP_SAD
&& c->avctx-> mb_cmp == FF_CMP_SAD)
c->sub_motion_search= sad_hpel_motion_search; // 2050 vs. 2450 cycles
else
else c->hpel_put= s->dsp.put_pixels_tab;
if(s->linesize){
- c->stride = s->linesize;
+ c->stride = s->linesize;
c->uvstride= s->uvlinesize;
}else{
c->stride = 16*s->mb_width + 32;
c->temp= c->scratchpad;
}
-
+
#if 0
static int pix_dev(uint8_t * pix, int line_size, int mean)
{
int stride= c->stride;
const int flags= c->sub_flags;
LOAD_COMMON
-
+
assert(flags == 0);
if(c->skip){
return dmin;
}
// printf("N");
-
+
pix = c->src[src_index][0];
mx = *mx_ptr;
my = *my_ptr;
ptr = c->ref[ref_index][0] + (my * stride) + mx;
-
+
dminh = dmin;
- if (mx > xmin && mx < xmax &&
+ if (mx > xmin && mx < xmax &&
my > ymin && my < ymax) {
int dx=0, dy=0;
- int d, pen_x, pen_y;
+ int d, pen_x, pen_y;
const int index= (my<<ME_MAP_SHIFT) + mx;
const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)];
const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)];
mx<<=1;
my<<=1;
-
+
pen_x= pred_x + mx;
pen_y= pred_y + my;
static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my, int mv4)
{
const int xy= s->mb_x + s->mb_y*s->mb_stride;
-
+
s->p_mv_table[xy][0] = mx;
s->p_mv_table[xy][1] = my;
// Search range of H261 is different from other codec standards
c->xmin = (x > 15) ? - 15 : 0;
c->ymin = (y > 15) ? - 15 : 0;
- c->xmax = (x < s->mb_width * 16 - 16) ? 15 : 0;
+ c->xmax = (x < s->mb_width * 16 - 16) ? 15 : 0;
c->ymax = (y < s->mb_height * 16 - 16) ? 15 : 0;
} else {
c->xmin = - x;
uint8_t *mv_penalty= c->current_mv_penalty;
init_mv4_ref(c);
-
+
for(block=0; block<4; block++){
int mx4, my4;
int pred_x4, pred_y4;
if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift);
if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
+
P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift);
dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h);
-
+
if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
int dxy;
const int offset= ((block&1) + (block>>1)*stride)*8;
mx4_sum+= mx4;
my4_sum+= my4;
}
-
+
s->current_picture.motion_val[0][ s->block_index[block] ][0]= mx4;
s->current_picture.motion_val[0][ s->block_index[block] ][1]= my4;
if(mx4 != mx || my4 != my) same=0;
}
-
+
if(same)
return INT_MAX;
-
+
if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
dmin_sum += s->dsp.mb_cmp[0](s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*16*stride, c->scratchpad, stride, 16);
}
-
+
if(c->avctx->mb_cmp&FF_CMP_CHROMA){
int dxy;
int mx, my;
mx= ff_h263_round_chroma(mx4_sum);
my= ff_h263_round_chroma(my4_sum);
dxy = ((my & 1) << 1) | (mx & 1);
-
+
offset= (s->mb_x*8 + (mx>>1)) + (s->mb_y*8 + (my>>1))*s->uvlinesize;
-
+
if(s->no_rounding){
s->dsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.data[1] + offset, s->uvlinesize, 8);
s->dsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad+8 , s->last_picture.data[2] + offset, s->uvlinesize, 8);
dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad , s->uvlinesize, 8);
dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.data[2] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad+8, s->uvlinesize, 8);
}
-
+
c->pred_x= mx;
c->pred_y= my;
}
}
-static int interlaced_search(MpegEncContext *s, int ref_index,
+static int interlaced_search(MpegEncContext *s, int ref_index,
int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select)
{
MotionEstContext * const c= &s->me;
int dmin_sum= 0;
const int mot_stride= s->mb_stride;
const int xy= s->mb_x + s->mb_y*mot_stride;
-
+
c->ymin>>=1;
c->ymax>>=1;
c->stride<<=1;
c->uvstride<<=1;
init_interlaced_ref(s, ref_index);
-
+
for(block=0; block<2; block++){
int field_select;
int best_dmin= INT_MAX;
for(field_select=0; field_select<2; field_select++){
int dmin, mx_i, my_i;
int16_t (*mv_table)[2]= mv_tables[block][field_select];
-
+
if(user_field_select){
if(field_select_tables[block][xy] != field_select)
continue;
}
-
+
P_LEFT[0] = mv_table[xy - 1][0];
P_LEFT[1] = mv_table[xy - 1][1];
if(P_LEFT[0] > (c->xmax<<1)) P_LEFT[0] = (c->xmax<<1);
-
+
c->pred_x= P_LEFT[0];
c->pred_y= P_LEFT[1];
-
+
if(!s->first_slice_line){
P_TOP[0] = mv_table[xy - mot_stride][0];
P_TOP[1] = mv_table[xy - mot_stride][1];
if(P_TOPRIGHT[0] < (c->xmin<<1)) P_TOPRIGHT[0]= (c->xmin<<1);
if(P_TOPRIGHT[0] > (c->xmax<<1)) P_TOPRIGHT[0]= (c->xmax<<1);
if(P_TOPRIGHT[1] > (c->ymax<<1)) P_TOPRIGHT[1]= (c->ymax<<1);
-
+
P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
}
P_MV1[0]= mx; //FIXME not correct if block != field_select
P_MV1[1]= my / 2;
-
+
dmin = epzs_motion_search2(s, &mx_i, &my_i, P, block, field_select+ref_index, mv_table, (1<<16)>>1);
dmin= c->sub_motion_search(s, &mx_i, &my_i, dmin, block, field_select+ref_index, size, h);
-
+
mv_table[xy][0]= mx_i;
mv_table[xy][1]= my_i;
-
+
if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){
int dxy;
dmin+= (mv_penalty[mx_i-c->pred_x] + mv_penalty[my_i-c->pred_y] + 1)*c->mb_penalty_factor;
}else
dmin+= c->mb_penalty_factor; //field_select bits
-
+
dmin += field_select != block; //slightly prefer same field
-
+
if(dmin < best_dmin){
best_dmin= dmin;
best_field= field_select;
if(mv_table[xy][0] != mx) same=0; //FIXME check if these checks work and are any good at all
if(mv_table[xy][1]&1) same=0;
- if(mv_table[xy][1]*2 != my) same=0;
+ if(mv_table[xy][1]*2 != my) same=0;
if(best_field != block) same=0;
}
field_select_tables[block][xy]= best_field;
dmin_sum += best_dmin;
}
-
+
c->ymin<<=1;
c->ymax<<=1;
c->stride>>=1;
if(same)
return INT_MAX;
-
+
switch(c->avctx->mb_cmp&0xFF){
/*case FF_CMP_SSE:
return dmin_sum+ 32*s->qscale*s->qscale;*/
static void clip_input_mv(MpegEncContext * s, int16_t *mv, int interlaced){
int ymax= s->me.ymax>>interlaced;
int ymin= s->me.ymin>>interlaced;
-
+
if(mv[0] < s->me.xmin) mv[0] = s->me.xmin;
if(mv[0] > s->me.xmax) mv[0] = s->me.xmax;
if(mv[1] < ymin) mv[1] = ymin;
int d=0;
me_cmp_func cmpf= s->dsp.sse[0];
me_cmp_func chroma_cmpf= s->dsp.sse[1];
-
+
if(p_type && USES_LIST(mb_type, 1)){
av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n");
return INT_MAX/2;
}
assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1));
-
+
for(i=0; i<4; i++){
int xy= s->block_index[i];
clip_input_mv(s, p->motion_val[0][xy], !!IS_INTERLACED(mb_type));
s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTRA;
c->stride<<=1;
c->uvstride<<=1;
-
+
if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){
av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n");
return INT_MAX/2;
s->mb_type[mb_xy]= CANDIDATE_MB_TYPE_FORWARD_I;
}
- x= p->motion_val[0][xy ][0];
+ x= p->motion_val[0][xy ][0];
y= p->motion_val[0][xy ][1];
d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select0, 0, cmpf, chroma_cmpf, flags);
- x= p->motion_val[0][xy2][0];
+ x= p->motion_val[0][xy2][0];
y= p->motion_val[0][xy2][1];
d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select1, 1, cmpf, chroma_cmpf, flags);
}
s->mb_type[mb_xy]= CANDIDATE_MB_TYPE_BACKWARD_I;
}
- x= p->motion_val[1][xy ][0];
+ x= p->motion_val[1][xy ][0];
y= p->motion_val[1][xy ][1];
d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select0+2, 0, cmpf, chroma_cmpf, flags);
- x= p->motion_val[1][xy2][0];
+ x= p->motion_val[1][xy2][0];
y= p->motion_val[1][xy2][1];
d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 8, field_select1+2, 1, cmpf, chroma_cmpf, flags);
//FIXME bidir scores
init_mv4_ref(c);
for(i=0; i<4; i++){
xy= s->block_index[i];
- x= p->motion_val[0][xy][0];
+ x= p->motion_val[0][xy][0];
y= p->motion_val[0][xy][1];
d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 1, 8, i, i, cmpf, chroma_cmpf, flags);
}
*(uint32_t*)s->b_forw_mv_table[mb_xy]= *(uint32_t*)p->motion_val[0][xy];
s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_FORWARD;
}
- x= p->motion_val[0][xy][0];
+ x= p->motion_val[0][xy][0];
y= p->motion_val[0][xy][1];
d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 16, 0, 0, cmpf, chroma_cmpf, flags);
}else if(USES_LIST(mb_type, 1)){
*(uint32_t*)s->b_back_mv_table[mb_xy]= *(uint32_t*)p->motion_val[1][xy];
s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_BACKWARD;
-
- x= p->motion_val[1][xy][0];
+
+ x= p->motion_val[1][xy][0];
y= p->motion_val[1][xy][1];
d = cmp(s, x>>shift, y>>shift, x&mask, y&mask, 0, 16, 2, 0, cmpf, chroma_cmpf, flags);
}else
const int shift= 1+s->quarter_sample;
int mb_type=0;
Picture * const pic= &s->current_picture;
-
+
init_ref(c, s->new_picture.data, s->last_picture.data, NULL, 16*mb_x, 16*mb_y, 0);
assert(s->quarter_sample==0 || s->quarter_sample==1);
if(c->avctx->me_threshold){
vard= (check_input_motion(s, mb_x, mb_y, 1)+128)>>8;
-
+
if(vard<c->avctx->me_threshold){
pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = vard;
c->mc_mb_var_sum_temp += vard;
if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1] = (c->ymax<<shift);
if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
+
P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
}
}
- dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
+ dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
break;
}
/* At this point (mx,my) are full-pell and the relative displacement */
ppix = c->ref[0][0] + (my * s->linesize) + mx;
-
+
vard = (s->dsp.sse[0](NULL, pix, ppix, s->linesize, 16)+128)>>8;
pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = vard;
-// pic->mb_cmp_score[s->mb_stride * mb_y + mb_x] = dmin;
+// pic->mb_cmp_score[s->mb_stride * mb_y + mb_x] = dmin;
c->mc_mb_var_sum_temp += vard;
-
+
#if 0
printf("varc=%4d avg_var=%4d (sum=%4d) vard=%4d mx=%2d my=%2d\n",
varc, s->avg_mb_var, sum, vard, mx - xx, my - yy);
dmin= dmin_i;
}
}
-
-// pic->mb_cmp_score[s->mb_stride * mb_y + mb_x] = dmin;
+
+// pic->mb_cmp_score[s->mb_stride * mb_y + mb_x] = dmin;
set_p_mv_tables(s, mx, my, mb_type!=CANDIDATE_MB_TYPE_INTER4V);
/* get intra luma score */
}else{
int mean= (sum+128)>>8;
mean*= 0x01010101;
-
+
for(i=0; i<16; i++){
*(uint32_t*)(&c->scratchpad[i*s->linesize+ 0]) = mean;
*(uint32_t*)(&c->scratchpad[i*s->linesize+ 4]) = mean;
for(i=1; i<3; i++){
uint8_t *dest_c;
int mean;
-
+
if(s->out_format == FMT_H263){
mean= (s->dc_val[i][mb_x + mb_y*s->b8_stride] + 4)>>3; //FIXME not exact but simple ;)
}else{
mean= (s->last_dc[i] + 4)>>3;
}
dest_c = s->new_picture.data[i] + (mb_y * 8 * (s->uvlinesize)) + mb_x * 8;
-
+
mean*= 0x01010101;
for(i=0; i<8; i++){
*(uint32_t*)(&c->scratchpad[i*s->uvlinesize+ 0]) = mean;
*(uint32_t*)(&c->scratchpad[i*s->uvlinesize+ 4]) = mean;
}
-
+
intra_score+= s->dsp.mb_cmp[1](s, c->scratchpad, dest_c, s->uvlinesize);
- }
+ }
}
#endif
intra_score += c->mb_penalty_factor*16;
-
+
if(intra_score < dmin){
mb_type= CANDIDATE_MB_TYPE_INTRA;
s->current_picture.mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_INTRA; //FIXME cleanup
}else
s->current_picture.mb_type[mb_y*s->mb_stride + mb_x]= 0;
-
+
if (vard <= 64 || vard < varc) { //FIXME
c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
}else{
const int shift= 1+s->quarter_sample;
const int xy= mb_x + mb_y*s->mb_stride;
init_ref(c, s->new_picture.data, s->last_picture.data, NULL, 16*mb_x, 16*mb_y, 0);
-
+
assert(s->quarter_sample==0 || s->quarter_sample==1);
c->pre_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_pre_cmp);
c->pred_x= P_LEFT[0];
c->pred_y= P_LEFT[1];
P_TOP[0]= P_TOPRIGHT[0]= P_MEDIAN[0]=
- P_TOP[1]= P_TOPRIGHT[1]= P_MEDIAN[1]= 0; //FIXME
+ P_TOP[1]= P_TOPRIGHT[1]= P_MEDIAN[1]= 0; //FIXME
} else {
P_TOP[0] = s->p_mv_table[xy + s->mb_stride ][0];
P_TOP[1] = s->p_mv_table[xy + s->mb_stride ][1];
if(P_TOP[1] < (c->ymin<<shift)) P_TOP[1] = (c->ymin<<shift);
if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift);
if(P_TOPRIGHT[1] < (c->ymin<<shift)) P_TOPRIGHT[1]= (c->ymin<<shift);
-
+
P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
c->pred_y = P_MEDIAN[1];
}
- dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
+ dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
s->p_mv_table[xy][0] = mx<<shift;
s->p_mv_table[xy][1] = my<<shift;
-
+
return dmin;
}
const int mot_xy = mb_y*mot_stride + mb_x;
uint8_t * const mv_penalty= c->mv_penalty[f_code] + MAX_MV;
int mv_scale;
-
+
c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1]= (c->ymax<<shift);
if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
-
+
P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
}
c->pred_x= P_LEFT[0];
c->pred_y= P_LEFT[1];
}
-
+
if(mv_table == s->b_forw_mv_table){
mv_scale= (s->pb_time<<16) / (s->pp_time<<shift);
}else{
mv_scale= ((s->pb_time - s->pp_time)<<16) / (s->pp_time<<shift);
}
-
+
dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16);
-
+
break;
}
-
+
dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, ref_index, 0, 16);
-
+
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
dmin= ff_get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1);
dxy = ((motion_by & 3) << 2) | (motion_bx & 3);
src_x = motion_bx >> 2;
src_y = motion_by >> 2;
-
+
ptr = ref2_data[0] + (src_y * stride) + src_x;
s->dsp.avg_qpel_pixels_tab[size][dxy](dest_y , ptr , stride);
}else{
dxy = ((motion_by & 1) << 1) | (motion_bx & 1);
src_x = motion_bx >> 1;
src_y = motion_by >> 1;
-
+
ptr = ref2_data[0] + (src_y * stride) + src_x;
s->dsp.avg_pixels_tab[size][dxy](dest_y , ptr , stride, h);
}
fbmin = (mv_penalty[motion_fx-pred_fx] + mv_penalty[motion_fy-pred_fy])*c->mb_penalty_factor
+(mv_penalty[motion_bx-pred_bx] + mv_penalty[motion_by-pred_by])*c->mb_penalty_factor
+ s->dsp.mb_cmp[size](s, src_data[0], dest_y, stride, h); //FIXME new_pic
-
+
if(c->avctx->mb_cmp&FF_CMP_CHROMA){
}
//FIXME CHROMA !!!
-
+
return fbmin;
}
int motion_by= s->b_bidir_back_mv_table[xy][1]= s->b_back_mv_table[xy][1];
//FIXME do refinement and add flag
-
+
fbmin= check_bidir_mv(s, motion_fx, motion_fy,
motion_bx, motion_by,
pred_fx, pred_fy,
const int time_pb= s->pb_time;
int mx, my, xmin, xmax, ymin, ymax;
int16_t (*mv_table)[2]= s->b_direct_mv_table;
-
+
c->current_mv_penalty= c->mv_penalty[1] + MAX_MV;
ymin= xmin=(-32)>>shift;
ymax= xmax= 31>>shift;
for(i=0; i<4; i++){
int index= s->block_index[i];
int min, max;
-
+
c->co_located_mv[i][0]= s->next_picture.motion_val[0][index][0];
c->co_located_mv[i][1]= s->next_picture.motion_val[0][index][1];
c->direct_basis_mv[i][0]= c->co_located_mv[i][0]*time_pb/time_pp + ((i& 1)<<(shift+3));
min+= 16*mb_y - 1;
ymax= FFMIN(ymax, s->height - max);
ymin= FFMAX(ymin, - 16 - min);
-
+
if(s->mv_type == MV_TYPE_16X16) break;
}
-
+
assert(xmax <= 15 && ymax <= 15 && xmin >= -16 && ymin >= -16);
-
+
if(xmax < 0 || xmin >0 || ymax < 0 || ymin > 0){
s->b_direct_mv_table[mot_xy][0]= 0;
s->b_direct_mv_table[mot_xy][1]= 0;
return 256*256*256*64;
}
-
+
c->xmin= xmin;
c->ymin= ymin;
c->xmax= xmax;
P_TOP[1] = clip(mv_table[mot_xy - mot_stride ][1], ymin<<shift, ymax<<shift);
P_TOPRIGHT[0] = clip(mv_table[mot_xy - mot_stride + 1 ][0], xmin<<shift, xmax<<shift);
P_TOPRIGHT[1] = clip(mv_table[mot_xy - mot_stride + 1 ][1], ymin<<shift, ymax<<shift);
-
+
P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
}
-
+
dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, mv_table, 1<<(16-shift), 0, 16);
- if(c->sub_flags&FLAG_QPEL)
+ if(c->sub_flags&FLAG_QPEL)
dmin = qpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
else
dmin = hpel_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
-
+
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
-
+
get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed
s->b_direct_mv_table[mot_xy][0]= mx;
init_ref(c, s->new_picture.data, s->last_picture.data, s->next_picture.data, 16*mb_x, 16*mb_y, 2);
get_limits(s, 16*mb_x, 16*mb_y);
-
+
c->skip=0;
if(c->avctx->me_threshold){
int vard= (check_input_motion(s, mb_x, mb_y, 0)+128)>>8;
-
+
if(vard<c->avctx->me_threshold){
// pix = c->src[0][0];
// sum = s->dsp.pix_sum(pix, s->linesize);
// varc = (s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500 + 128)>>8;
-
+
// pic->mb_var [s->mb_stride * mb_y + mb_x] = varc;
s->current_picture.mc_mb_var[s->mb_stride * mb_y + mb_x] = vard;
/* pic->mb_mean [s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
//FIXME penalty stuff for non mpeg4
c->skip=0;
fmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code) + 3*penalty_factor;
-
+
c->skip=0;
bmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code) + 2*penalty_factor;
//printf(" %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);
c->skip=0;
fbmin= bidir_refine(s, mb_x, mb_y) + penalty_factor;
//printf("%d %d %d %d\n", dmin, fmin, bmin, fbmin);
-
+
if(s->flags & CODEC_FLAG_INTERLACED_ME){
//FIXME mb type penalty
c->skip=0;
{
int score= fmin;
type = CANDIDATE_MB_TYPE_FORWARD;
-
+
if (dmin <= score){
score = dmin;
type = CANDIDATE_MB_TYPE_DIRECT;
}
if(bmin<score){
score=bmin;
- type= CANDIDATE_MB_TYPE_BACKWARD;
+ type= CANDIDATE_MB_TYPE_BACKWARD;
}
if(fbmin<score){
score=fbmin;
score=bimin;
type= CANDIDATE_MB_TYPE_BACKWARD_I;
}
-
+
score= ((unsigned)(score*score + 128*256))>>16;
c->mc_mb_var_sum_temp += score;
s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
}
//FIXME something smarter
if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //dont try direct mode if its invalid for this MB
-#if 0
+#if 0
if(s->out_format == FMT_MPEG1)
type |= CANDIDATE_MB_TYPE_INTRA;
#endif
int best_fcode=-1;
int best_score=-10000000;
- if(s->msmpeg4_version)
+ if(s->msmpeg4_version)
range= FFMIN(range, 16);
else if(s->codec_id == CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL)
range= FFMIN(range, 256);
int fcode= FFMAX(fcode_tab[mx + MAX_MV],
fcode_tab[my + MAX_MV]);
int j;
-
- if(mx >= range || mx < -range ||
+
+ if(mx >= range || mx < -range ||
my >= range || my < -range)
continue;
-
+
for(j=0; j<fcode && j<8; j++){
if(s->pict_type==B_TYPE || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])
score[j]-= 170;
xy++;
}
}
-
+
for(i=1; i<8; i++){
if(score[i] > best_score){
best_score= score[i];
assert(range <= 16 || !s->msmpeg4_version);
assert(range <=256 || !(s->codec_id == CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL));
-
+
if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
-
+
//printf("%d no:%d %d//\n", clip, noclip, f_code);
if(s->flags&CODEC_FLAG_4MV){
const int wrap= s->b8_stride;
*
* @param truncate 1 for truncation, 0 for using intra
*/
-void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select,
+void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select,
int16_t (*mv_table)[2], int f_code, int type, int truncate)
{
MotionEstContext * const c= &s->me;
/*
- * Motion estimation
+ * Motion estimation
* Copyright (c) 2002-2004 Michael Niedermayer
*
* This library is free software; you can redistribute it and/or
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file motion_est_template.c
* Motion estimation template.
#if 0
static int hpel_motion_search)(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int dmin,
- uint8_t *ref_data[3],
+ uint8_t *ref_data[3],
int size)
{
const int xx = 16 * s->mb_x + 8*(n&1);
const int mx = *mx_ptr;
const int my = *my_ptr;
const int penalty_factor= c->sub_penalty_factor;
-
+
LOAD_COMMON
-
+
// INIT;
//FIXME factorize
me_cmp_func cmp, chroma_cmp, cmp_sub, chroma_cmp_sub;
*my_ptr = 0;
return dmin;
}
-
+
if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
CMP_HPEL(dmin, 0, 0, mx, my, size);
if(mx || my)
dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
}
-
- if (mx > xmin && mx < xmax &&
+
+ if (mx > xmin && mx < xmax &&
my > ymin && my < ymax) {
int bx=2*mx, by=2*my;
int d= dmin;
-
+
CHECK_HALF_MV(1, 1, mx-1, my-1)
- CHECK_HALF_MV(0, 1, mx , my-1)
+ CHECK_HALF_MV(0, 1, mx , my-1)
CHECK_HALF_MV(1, 1, mx , my-1)
CHECK_HALF_MV(1, 0, mx-1, my )
CHECK_HALF_MV(1, 0, mx , my )
CHECK_HALF_MV(1, 1, mx-1, my )
- CHECK_HALF_MV(0, 1, mx , my )
+ CHECK_HALF_MV(0, 1, mx , my )
CHECK_HALF_MV(1, 1, mx , my )
assert(bx >= xmin*2 || bx <= xmax*2 || by >= ymin*2 || by <= ymax*2);
{
MotionEstContext * const c= &s->me;
const int mx = *mx_ptr;
- const int my = *my_ptr;
+ const int my = *my_ptr;
const int penalty_factor= c->sub_penalty_factor;
me_cmp_func cmp_sub, chroma_cmp_sub;
int bx=2*mx, by=2*my;
LOAD_COMMON
int flags= c->sub_flags;
-
+
//FIXME factorize
cmp_sub= s->dsp.me_sub_cmp[size];
*my_ptr = 0;
return dmin;
}
-
+
if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
if(mx || my || size>0)
dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
}
-
- if (mx > xmin && mx < xmax &&
+
+ if (mx > xmin && mx < xmax &&
my > ymin && my < ymax) {
int d= dmin;
const int index= (my<<ME_MAP_SHIFT) + mx;
- const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
+ const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
+ (mv_penalty[bx - pred_x] + mv_penalty[by-2 - pred_y])*c->penalty_factor;
const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)]
+ (mv_penalty[bx-2 - pred_x] + mv_penalty[by - pred_y])*c->penalty_factor;
+ (mv_penalty[bx+2 - pred_x] + mv_penalty[by - pred_y])*c->penalty_factor;
const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
+ (mv_penalty[bx - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;
-
+
#if 1
int key;
int map_generation= c->map_generation;
assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
-#endif
+#endif
if(t<=b){
CHECK_HALF_MV(0, 1, mx ,my-1)
if(l<=r){
*mx_ptr = bx;
*my_ptr = by;
-
+
return dmin;
}
#endif
int d;
LOAD_COMMON
-
+
//FIXME factorize
cmp_sub= s->dsp.mb_cmp[size];
chroma_cmp_sub= s->dsp.mb_cmp[size+1];
-
+
// assert(!c->skip);
// assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);
//FIXME check cbp before adding penalty for (0,0) vector
if(add_rate && (mx || my || size>0))
d += (mv_penalty[mx - pred_x] + mv_penalty[my - pred_y])*penalty_factor;
-
+
return d;
}
static int qpel_motion_search(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int dmin,
- int src_index, int ref_index,
+ int src_index, int ref_index,
int size, int h)
{
MotionEstContext * const c= &s->me;
const int mx = *mx_ptr;
- const int my = *my_ptr;
+ const int my = *my_ptr;
const int penalty_factor= c->sub_penalty_factor;
const int map_generation= c->map_generation;
const int subpel_quality= c->avctx->me_subpel_quality;
LOAD_COMMON
int flags= c->sub_flags;
-
+
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1]; //factorize FIXME
//FIXME factorize
*my_ptr = 0;
return dmin;
}
-
+
if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
if(mx || my || size>0)
dmin += (mv_penalty[4*mx - pred_x] + mv_penalty[4*my - pred_y])*penalty_factor;
}
-
- if (mx > xmin && mx < xmax &&
+
+ if (mx > xmin && mx < xmax &&
my > ymin && my < ymax) {
int bx=4*mx, by=4*my;
int d= dmin;
const int c= score_map[(index )&(ME_MAP_SIZE-1)];
int best[8];
int best_pos[8][2];
-
+
memset(best, 64, sizeof(int)*8);
#if 1
- if(s->me.dia_size>=2){
+ if(s->me.dia_size>=2){
const int tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
const int bl= score_map[(index+(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
const int tr= score_map[(index-(1<<ME_MAP_SHIFT)+1)&(ME_MAP_SIZE-1)];
const int64_t b2= nx*nx*(br + bl - 2*b) + 4*nx*(br-bl) + 32*b;
int score= (ny*ny*(b2 + t2 - 2*c2) + 4*ny*(b2 - t2) + 32*c2 + 512)>>10;
int i;
-
+
if((nx&3)==0 && (ny&3)==0) continue;
-
+
score += (mv_penalty[4*mx + nx - pred_x] + mv_penalty[4*my + ny - pred_y])*penalty_factor;
-
+
// if(nx&1) score-=1024*c->penalty_factor;
// if(ny&1) score-=1024*c->penalty_factor;
-
+
for(i=0; i<8; i++){
if(score < best[i]){
memmove(&best[i+1], &best[i], sizeof(int)*(7-i));
int tl;
//FIXME this could overflow (unlikely though)
const int cx = 4*(r - l);
- const int cx2= r + l - 2*c;
+ const int cx2= r + l - 2*c;
const int cy = 4*(b - t);
const int cy2= b + t - 2*c;
int cxy;
-
+
if(map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)] == (my<<ME_MAP_MV_BITS) + mx + map_generation && 0){ //FIXME
tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
}else{
tl= cmp(s, mx-1, my-1, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);//FIXME wrong if chroma me is different
}
-
- cxy= 2*tl + (cx + cy)/4 - (cx2 + cy2) - 2*c;
-
+
+ cxy= 2*tl + (cx + cy)/4 - (cx2 + cy2) - 2*c;
+
assert(16*cx2 + 4*cx + 32*c == 32*r);
assert(16*cx2 - 4*cx + 32*c == 32*l);
assert(16*cy2 + 4*cy + 32*c == 32*b);
assert(16*cy2 - 4*cy + 32*c == 32*t);
assert(16*cxy + 16*cy2 + 16*cx2 - 4*cy - 4*cx + 32*c == 32*tl);
-
+
for(ny= -3; ny <= 3; ny++){
for(nx= -3; nx <= 3; nx++){
//FIXME this could overflow (unlikely though)
int score= ny*nx*cxy + nx*nx*cx2 + ny*ny*cy2 + nx*cx + ny*cy + 32*c; //FIXME factor
int i;
-
+
if((nx&3)==0 && (ny&3)==0) continue;
-
+
score += 32*(mv_penalty[4*mx + nx - pred_x] + mv_penalty[4*my + ny - pred_y])*penalty_factor;
// if(nx&1) score-=32*c->penalty_factor;
// if(ny&1) score-=32*c->penalty_factor;
-
+
for(i=0; i<8; i++){
if(score < best[i]){
memmove(&best[i+1], &best[i], sizeof(int)*(7-i));
}
}
}
- }
+ }
}
for(i=0; i<subpel_quality; i++){
nx= best_pos[i][0];
// nx= FFMAX(4*mx - bx, bx - 4*mx);
// ny= FFMAX(4*my - by, by - 4*my);
-
+
static int stats[7][7], count;
count++;
stats[4*mx - bx + 3][4*my - by + 3]++;
#else
CHECK_QUARTER_MV(2, 2, mx-1, my-1)
- CHECK_QUARTER_MV(0, 2, mx , my-1)
+ CHECK_QUARTER_MV(0, 2, mx , my-1)
CHECK_QUARTER_MV(2, 2, mx , my-1)
CHECK_QUARTER_MV(2, 0, mx , my )
CHECK_QUARTER_MV(2, 2, mx , my )
CHECK_QUARTER_MV(0, 2, mx , my )
CHECK_QUARTER_MV(2, 2, mx-1, my )
CHECK_QUARTER_MV(2, 0, mx-1, my )
-
+
nx= bx;
ny= by;
-
+
for(i=0; i<8; i++){
int ox[8]= {0, 1, 1, 1, 0,-1,-1,-1};
int oy[8]= {1, 1, 0,-1,-1,-1, 0, 1};
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
-
+
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
-
+
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
int dir;
const int x= best[0];
const int y= best[1];
-
+
if(dia_size&(dia_size-1)) continue;
if( x + dia_size > xmax
|| y + dia_size > ymax
|| y - dia_size < ymin)
continue;
-
+
for(dir= 0; dir<dia_size; dir+=2){
int d;
}
#endif
}
- return dmin;
+ return dmin;
}
#define SAB_CHECK_MV(ax,ay)\
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
-
+
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
-
+
for(j=i=0; i<ME_MAP_SIZE; i++){
uint32_t key= map[i];
key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1));
-
+
if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue;
-
+
assert(j<MAX_SAB_SIZE); //max j = number of predictors
-
+
minima[j].height= score_map[i];
minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS;
minima[j].y= key & ((1<<ME_MAP_MV_BITS)-1);
minima[j].checked=0;
if(minima[j].x || minima[j].y)
minima[j].height+= (mv_penalty[((minima[j].x)<<shift)-pred_x] + mv_penalty[((minima[j].y)<<shift)-pred_y])*penalty_factor;
-
+
j++;
}
-
+
qsort(minima, j, sizeof(Minima), minima_cmp);
-
+
for(; j<minima_count; j++){
minima[j].height=256*256*256*64;
minima[j].checked=0;
minima[j].x= minima[j].y=0;
}
-
+
for(i=0; i<minima_count; i++){
const int x= minima[i].x;
const int y= minima[i].y;
int d;
-
+
if(minima[i].checked) continue;
-
+
if( x >= xmax || x <= xmin
|| y >= ymax || y <= ymin)
continue;
SAB_CHECK_MV(x+1, y)
SAB_CHECK_MV(x , y-1)
SAB_CHECK_MV(x , y+1)
-
+
minima[i].checked= 1;
}
-
+
best[0]= minima[0].x;
best[1]= minima[0].y;
dmin= minima[0].height;
-
+
if( best[0] < xmax && best[0] > xmin
&& best[1] < ymax && best[1] > ymin){
int d;
CHECK_MV(best[0], best[1]-1)
CHECK_MV(best[0], best[1]+1)
}
- return dmin;
+ return dmin;
}
static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
-
+
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
}
#endif
}
- return dmin;
+ return dmin;
}
static always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
}
static always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
- int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
+ int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale, int flags, int size, int h)
{
MotionEstContext * const c= &s->me;
const int ref_mv_stride= s->mb_stride; //pass as arg FIXME
const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; //add to last_mv beforepassing FIXME
me_cmp_func cmpf, chroma_cmpf;
-
+
LOAD_COMMON
LOAD_COMMON2
-
+
if(c->pre_pass){
penalty_factor= c->pre_penalty_factor;
cmpf= s->dsp.me_pre_cmp[size];
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
}
-
+
map_generation= update_map_generation(c);
assert(cmpf);
/* first line */
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}else{
if(dmin<h*h && ( P_LEFT[0] |P_LEFT[1]
}
CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
if(dmin>h*h*2){
- CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift)
}
if(dmin>h*h*4){
if(c->pre_pass){
- CHECK_CLIPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
if(!s->first_slice_line)
- CHECK_CLIPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}else{
- CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
- CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
}
//check(best[0],best[1],0, b1)
*mx_ptr= best[0];
- *my_ptr= best[1];
+ *my_ptr= best[1];
// printf("%d %d %d \n", best[0], best[1], dmin);
return dmin;
//this function is dedicated to the braindamaged gcc
inline int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
- int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
+ int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale, int size, int h)
{
MotionEstContext * const c= &s->me;
static int epzs_motion_search4(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int P[10][2],
- int src_index, int ref_index, int16_t (*last_mv)[2],
+ int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
- int d, dmin;
+ int d, dmin;
int map_generation;
const int penalty_factor= c->penalty_factor;
const int size=1;
LOAD_COMMON
int flags= c->flags;
LOAD_COMMON2
-
+
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
map_generation= update_map_generation(c);
dmin = 1000000;
-//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
+//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
/* first line */
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
}else{
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
- CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}
}
if(dmin>64*4){
- CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
- CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
- *my_ptr= best[1];
+ *my_ptr= best[1];
// printf("%d %d %d \n", best[0], best[1], dmin);
return dmin;
//try to merge with above FIXME (needs PSNR test)
static int epzs_motion_search2(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int P[10][2],
- int src_index, int ref_index, int16_t (*last_mv)[2],
+ int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
- int d, dmin;
+ int d, dmin;
int map_generation;
const int penalty_factor= c->penalty_factor;
const int size=0; //FIXME pass as arg
LOAD_COMMON
int flags= c->flags;
LOAD_COMMON2
-
+
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
map_generation= update_map_generation(c);
dmin = 1000000;
-//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
+//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
/* first line */
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
- CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
}else{
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
- CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}
}
if(dmin>64*4){
- CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
- CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
+ CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
- *my_ptr= best[1];
+ *my_ptr= best[1];
// printf("%d %d %d \n", best[0], best[1], dmin);
return dmin;
fill_random(img1, WIDTH * HEIGHT);
fill_random(img2, WIDTH * HEIGHT);
-
+
for(y=0;y<HEIGHT-17;y++) {
for(x=0;x<WIDTH-17;x++) {
- ptr = img2 + y * WIDTH + x;
+ ptr = img2 + y * WIDTH + x;
d1 = test_func(img1, ptr, WIDTH);
d2 = ref_func(img1, ptr, WIDTH);
if (d1 != d2) {
}
}
emms();
-
+
/* speed test */
ti = gettime();
d1 = 0;
for(it=0;it<NB_ITS;it++) {
for(y=0;y<HEIGHT-17;y++) {
for(x=0;x<WIDTH-17;x++) {
- ptr = img2 + y * WIDTH + x;
+ ptr = img2 + y * WIDTH + x;
d1 += test_func(img1, ptr, WIDTH);
}
}
emms();
dummy = d1; /* avoid optimisation */
ti = gettime() - ti;
-
- printf(" %0.0f kop/s\n",
- (double)NB_ITS * (WIDTH - 16) * (HEIGHT - 16) /
+
+ printf(" %0.0f kop/s\n",
+ (double)NB_ITS * (WIDTH - 16) * (HEIGHT - 16) /
(double)(ti / 1000.0));
}
int main(int argc, char **argv)
{
int c;
-
+
for(;;) {
c = getopt(argc, argv, "h");
if (c == -1)
break;
}
}
-
+
printf("ffmpeg motion test\n");
test_motion("mmx", pix_abs16x16_mmx, pix_abs16x16_c);
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file mp3lameaudio.c
* Interface to libmp3lame for mp3 encoding.
goto err_close;
avctx->frame_size = lame_get_framesize(s->gfp);
-
+
avctx->coded_frame= avcodec_alloc_frame();
avctx->coded_frame->key_frame= 1;
if ( (( header >> 21 ) & 0x7ff) != 0x7ff || mode == 3 || layerID==3 || sampleRateID==3) {
return -1;
}
-
+
if(!samplesPerFrame) samplesPerFrame= &temp0;
if(!sampleRate ) sampleRate = &temp1;
bitRate = sBitRates[mpeg_id][layerID][bitRateID] * 1000;
*samplesPerFrame = sSamplesPerFrame[mpeg_id][layerID];
//av_log(NULL, AV_LOG_DEBUG, "sr:%d br:%d spf:%d l:%d m:%d\n", *sampleRate, bitRate, *samplesPerFrame, layerID, mode);
-
+
return *samplesPerFrame * bitRate / (bitsPerSlot * *sampleRate) + isPadded;
}
if(data){
if (s->stereo) {
lame_result = lame_encode_buffer_interleaved(
- s->gfp,
+ s->gfp,
data,
- avctx->frame_size,
- s->buffer + s->buffer_index,
+ avctx->frame_size,
+ s->buffer + s->buffer_index,
BUFFER_SIZE - s->buffer_index
);
} else {
lame_result = lame_encode_buffer(
- s->gfp,
- data,
- data,
+ s->gfp,
+ data,
+ data,
avctx->frame_size,
- s->buffer + s->buffer_index,
+ s->buffer + s->buffer_index,
BUFFER_SIZE - s->buffer_index
);
}
}else{
lame_result= lame_encode_flush(
- s->gfp,
- s->buffer + s->buffer_index,
+ s->gfp,
+ s->buffer + s->buffer_index,
BUFFER_SIZE - s->buffer_index
);
}
int MP3lame_encode_close(AVCodecContext *avctx)
{
Mp3AudioContext *s = avctx->priv_data;
-
+
av_freep(&avctx->coded_frame);
lame_close(s->gfp);
/*
* MPEG1 codec / MPEG2 decoder
* Copyright (c) 2000,2001 Fabrice Bellard.
- * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
+ * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file mpeg12.c
* MPEG1/2 codec
*/
-
+
//#define DEBUG
#include "avcodec.h"
#include "dsputil.h"
#define TEX_VLC_BITS 9
#ifdef CONFIG_ENCODERS
-static void mpeg1_encode_block(MpegEncContext *s,
- DCTELEM *block,
+static void mpeg1_encode_block(MpegEncContext *s,
+ DCTELEM *block,
int component);
static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code); // RAL: f_code parameter added
#endif //CONFIG_ENCODERS
-static inline int mpeg1_decode_block_inter(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg1_decode_block_inter(MpegEncContext *s,
+ DCTELEM *block,
int n);
-static inline int mpeg1_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg1_decode_block_intra(MpegEncContext *s,
+ DCTELEM *block,
int n);
static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n);
-static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
+ DCTELEM *block,
int n);
-static inline int mpeg2_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg2_decode_block_intra(MpegEncContext *s,
+ DCTELEM *block,
int n);
static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n);
static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n);
static void init_2d_vlc_rl(RLTable *rl, int use_static)
{
int i;
-
- init_vlc(&rl->vlc, TEX_VLC_BITS, rl->n + 2,
+
+ init_vlc(&rl->vlc, TEX_VLC_BITS, rl->n + 2,
&rl->table_vlc[0][1], 4, 2,
&rl->table_vlc[0][0], 4, 2, use_static);
- if(use_static)
+ if(use_static)
rl->rl_vlc[0]= av_mallocz_static(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
else
rl->rl_vlc[0]= av_malloc(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
int code= rl->vlc.table[i][0];
int len = rl->vlc.table[i][1];
int level, run;
-
+
if(len==0){ // illegal code
run= 65;
level= MAX_LEVEL;
int run;
for(run=0; run<64; run++){
int len, bits, code;
-
+
int alevel= ABS(level);
int sign= (level>>31)&1;
av_log(avctx, AV_LOG_INFO, "MPEG1/2 does not support %d/%d fps, there may be AV sync issues\n", avctx->time_base.den, avctx->time_base.num);
}
}
-
+
return 0;
}
float best_aspect_error= 1E10;
float aspect_ratio= av_q2d(s->avctx->sample_aspect_ratio);
int constraint_parameter_flag;
-
+
if(aspect_ratio==0.0) aspect_ratio= 1.0; //pixel aspect 1:1 (VGA)
-
+
if (s->current_picture.key_frame) {
AVRational framerate= frame_rate_tab[s->frame_rate_index];
/* mpeg1 header repeated every gop */
put_header(s, SEQ_START_CODE);
-
+
put_bits(&s->pb, 12, s->width);
put_bits(&s->pb, 12, s->height);
-
+
for(i=1; i<15; i++){
float error= aspect_ratio;
if(s->codec_id == CODEC_ID_MPEG1VIDEO || i <=1)
error-= 1.0/mpeg1_aspect[i];
else
error-= av_q2d(mpeg2_aspect[i])*s->height/s->width;
-
+
error= ABS(error);
-
+
if(error < best_aspect_error){
best_aspect_error= error;
s->aspect_ratio_info= i;
}
}
-
+
put_bits(&s->pb, 4, s->aspect_ratio_info);
put_bits(&s->pb, 4, s->frame_rate_index);
-
+
if(s->avctx->rc_max_rate){
v = (s->avctx->rc_max_rate + 399) / 400;
if (v > 0x3ffff && s->codec_id == CODEC_ID_MPEG1VIDEO)
put_bits(&s->pb, 1, 1); /* marker */
put_bits(&s->pb, 10, vbv_buffer_size & 0x3FF);
- constraint_parameter_flag=
- s->width <= 768 && s->height <= 576 &&
+ constraint_parameter_flag=
+ s->width <= 768 && s->height <= 576 &&
s->mb_width * s->mb_height <= 396 &&
s->mb_width * s->mb_height * framerate.num <= framerate.den*396*25 &&
framerate.num <= framerate.den*30 &&
vbv_buffer_size <= 20 &&
v <= 1856000/400 &&
s->codec_id == CODEC_ID_MPEG1VIDEO;
-
+
put_bits(&s->pb, 1, constraint_parameter_flag);
-
+
ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix);
ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix);
put_header(s, EXT_START_CODE);
put_bits(&s->pb, 4, 1); //seq ext
put_bits(&s->pb, 1, 0); //esc
-
+
if(s->avctx->profile == FF_PROFILE_UNKNOWN){
put_bits(&s->pb, 3, 4); //profile
}else{
put_bits(&s->pb, 2, 0); // frame_rate_ext_n
put_bits(&s->pb, 5, 0); // frame_rate_ext_d
}
-
+
put_header(s, GOP_START_CODE);
put_bits(&s->pb, 1, 0); /* do drop frame */
/* time code : we must convert from the real frame rate to a
put_bits(&s->pb, 11, 0x008);
run -= 33;
}
- put_bits(&s->pb, mbAddrIncrTable[run][1],
+ put_bits(&s->pb, mbAddrIncrTable[run][1],
mbAddrIncrTable[run][0]);
}
#endif //CONFIG_ENCODERS
/* temporal reference */
// RAL: s->picture_number instead of s->fake_picture_number
- put_bits(&s->pb, 10, (s->picture_number -
- s->gop_picture_number) & 0x3ff);
+ put_bits(&s->pb, 10, (s->picture_number -
+ s->gop_picture_number) & 0x3ff);
put_bits(&s->pb, 3, s->pict_type);
s->vbv_delay_ptr= s->pb.buf + put_bits_count(&s->pb)/8;
put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */
-
+
// RAL: Forward f_code also needed for B frames
if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
put_bits(&s->pb, 1, 0); /* half pel coordinates */
else
put_bits(&s->pb, 3, 7); /* forward_f_code */
}
-
+
// RAL: Backward f_code necessary for B frames
if (s->pict_type == B_TYPE) {
put_bits(&s->pb, 1, 0); /* half pel coordinates */
put_bits(&s->pb, 8, 255);
}
put_bits(&s->pb, 2, s->intra_dc_precision);
-
+
assert(s->picture_structure == PICT_FRAME);
put_bits(&s->pb, 2, s->picture_structure);
if (s->progressive_sequence) {
/* XXX: optimize the generation of this flag with entropy
measures */
s->frame_pred_frame_dct = s->progressive_sequence;
-
+
put_bits(&s->pb, 1, s->frame_pred_frame_dct);
put_bits(&s->pb, 1, s->concealment_motion_vectors);
put_bits(&s->pb, 1, s->q_scale_type);
put_bits(&s->pb, 8, svcd_scan_offset_placeholder[i]);
}
}
-
+
s->mb_y=0;
ff_mpeg1_encode_slice_header(s);
}
-static inline void put_mb_modes(MpegEncContext *s, int n, int bits,
+static inline void put_mb_modes(MpegEncContext *s, int n, int bits,
int has_mv, int field_motion)
{
put_bits(&s->pb, n, bits);
if (!s->frame_pred_frame_dct) {
- if (has_mv)
+ if (has_mv)
put_bits(&s->pb, 2, 2 - field_motion); /* motion_type: frame/field */
put_bits(&s->pb, 1, s->interlaced_dct);
}
if (s->block_last_index[i] >= 0)
cbp |= 1 << (5 - i);
}
-
+
if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 &&
- (mb_x != s->mb_width - 1 || (mb_y != s->mb_height - 1 && s->codec_id == CODEC_ID_MPEG1VIDEO)) &&
+ (mb_x != s->mb_width - 1 || (mb_y != s->mb_height - 1 && s->codec_id == CODEC_ID_MPEG1VIDEO)) &&
((s->pict_type == P_TYPE && (motion_x | motion_y) == 0) ||
(s->pict_type == B_TYPE && s->mv_dir == s->last_mv_dir && (((s->mv_dir & MV_DIR_FORWARD) ? ((s->mv[0][0][0] - s->last_mv[0][0][0])|(s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) |
((s->mv_dir & MV_DIR_BACKWARD) ? ((s->mv[1][0][0] - s->last_mv[1][0][0])|(s->mv[1][0][1] - s->last_mv[1][0][1])) : 0)) == 0))) {
s->misc_bits++;
s->last_bits++;
if(s->pict_type == P_TYPE){
- s->last_mv[0][1][0]= s->last_mv[0][0][0]=
+ s->last_mv[0][1][0]= s->last_mv[0][0][0]=
s->last_mv[0][1][1]= s->last_mv[0][0][1]= 0;
}
} else {
}else{
encode_mb_skip_run(s, s->mb_skip_run);
}
-
+
if (s->pict_type == I_TYPE) {
if(s->dquant && cbp){
put_mb_modes(s, 2, 1, 0, 0); /* macroblock_type : macroblock_quant = 1 */
s->misc_bits+= get_bits_diff(s);
s->i_count++;
memset(s->last_mv, 0, sizeof(s->last_mv));
- } else if (s->pict_type == P_TYPE) {
+ } else if (s->pict_type == P_TYPE) {
if(s->mv_type == MV_TYPE_16X16){
if (cbp != 0) {
if ((motion_x|motion_y) == 0) {
if(cbp)
put_bits(&s->pb, mbPatTable[cbp][1], mbPatTable[cbp][0]);
s->f_count++;
- } else{
+ } else{
static const int mb_type_len[4]={0,3,4,2}; //bak,for,bi
if(s->mv_type == MV_TYPE_16X16){
}
s->misc_bits += get_bits_diff(s);
if (s->mv_dir&MV_DIR_FORWARD){
- mpeg1_encode_motion(s, s->mv[0][0][0] - s->last_mv[0][0][0], s->f_code);
- mpeg1_encode_motion(s, s->mv[0][0][1] - s->last_mv[0][0][1], s->f_code);
+ mpeg1_encode_motion(s, s->mv[0][0][0] - s->last_mv[0][0][0], s->f_code);
+ mpeg1_encode_motion(s, s->mv[0][0][1] - s->last_mv[0][0][1], s->f_code);
s->last_mv[0][0][0]=s->last_mv[0][1][0]= s->mv[0][0][0];
s->last_mv[0][0][1]=s->last_mv[0][1][1]= s->mv[0][0][1];
s->f_count++;
}
if (s->mv_dir&MV_DIR_BACKWARD){
- mpeg1_encode_motion(s, s->mv[1][0][0] - s->last_mv[1][0][0], s->b_code);
- mpeg1_encode_motion(s, s->mv[1][0][1] - s->last_mv[1][0][1], s->b_code);
+ mpeg1_encode_motion(s, s->mv[1][0][0] - s->last_mv[1][0][0], s->b_code);
+ mpeg1_encode_motion(s, s->mv[1][0][1] - s->last_mv[1][0][1], s->b_code);
s->last_mv[1][0][0]=s->last_mv[1][1][0]= s->mv[1][0][0];
s->last_mv[1][0][1]=s->last_mv[1][1][1]= s->mv[1][0][1];
s->b_count++;
/* zero vector */
code = 0;
put_bits(&s->pb,
- mbMotionVectorTable[0][1],
- mbMotionVectorTable[0][0]);
+ mbMotionVectorTable[0][1],
+ mbMotionVectorTable[0][0]);
} else {
bit_size = f_or_b_code - 1;
range = 1 << bit_size;
assert(code > 0 && code <= 16);
put_bits(&s->pb,
- mbMotionVectorTable[code][1],
- mbMotionVectorTable[code][0]);
+ mbMotionVectorTable[code][1],
+ mbMotionVectorTable[code][0]);
put_bits(&s->pb, 1, sign);
if (bit_size > 0) {
mpeg1_max_level[0][i]= rl_mpeg1.max_level[0][i];
mpeg1_index_run[0][i]= rl_mpeg1.index_run[0][i];
}
-
+
init_uni_ac_vlc(&rl_mpeg1, uni_mpeg1_ac_vlc_bits, uni_mpeg1_ac_vlc_len);
/* build unified dc encoding tables */
bits= vlc_dc_lum_bits[index] + index;
code= (vlc_dc_lum_code[index]<<index) + (diff & ((1 << index) - 1));
mpeg1_lum_dc_uni[i+255]= bits + (code<<8);
-
+
bits= vlc_dc_chroma_bits[index] + index;
code= (vlc_dc_chroma_code[index]<<index) + (diff & ((1 << index) - 1));
mpeg1_chr_dc_uni[i+255]= bits + (code<<8);
range = 1 << bit_size;
val=mv;
- if (val < 0)
+ if (val < 0)
val = -val;
val--;
code = (val >> bit_size) + 1;
mv_penalty[f_code][mv+MAX_MV]= len;
}
}
-
+
for(f_code=MAX_FCODE; f_code>0; f_code--){
for(mv=-(8<<f_code); mv<(8<<f_code); mv++){
}
if (component == 0) {
put_bits(
- &s->pb,
+ &s->pb,
vlc_dc_lum_bits[index] + index,
(vlc_dc_lum_code[index]<<index) + (diff & ((1 << index) - 1)));
}else{
put_bits(
- &s->pb,
+ &s->pb,
vlc_dc_chroma_bits[index] + index,
(vlc_dc_chroma_code[index]<<index) + (diff & ((1 << index) - 1)));
}
}else{
if (component == 0) {
put_bits(
- &s->pb,
+ &s->pb,
mpeg1_lum_dc_uni[diff+255]&0xFF,
mpeg1_lum_dc_uni[diff+255]>>8);
} else {
put_bits(
- &s->pb,
+ &s->pb,
mpeg1_chr_dc_uni[diff+255]&0xFF,
mpeg1_chr_dc_uni[diff+255]>>8);
}
}
}
-static void mpeg1_encode_block(MpegEncContext *s,
- DCTELEM *block,
+static void mpeg1_encode_block(MpegEncContext *s,
+ DCTELEM *block,
int n)
{
int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign;
#if 0
if (level != 0)
dprintf("level[%d]=%d\n", i, level);
-#endif
+#endif
/* encode using VLC */
if (level != 0) {
run = i - last_non_zero - 1;
-
+
alevel= level;
MASK_ABS(sign, alevel)
sign&=1;
if (!done) {
done = 1;
- init_vlc(&dc_lum_vlc, DC_VLC_BITS, 12,
+ init_vlc(&dc_lum_vlc, DC_VLC_BITS, 12,
vlc_dc_lum_bits, 1, 1,
vlc_dc_lum_code, 2, 2, 1);
- init_vlc(&dc_chroma_vlc, DC_VLC_BITS, 12,
+ init_vlc(&dc_chroma_vlc, DC_VLC_BITS, 12,
vlc_dc_chroma_bits, 1, 1,
vlc_dc_chroma_code, 2, 2, 1);
- init_vlc(&mv_vlc, MV_VLC_BITS, 17,
+ init_vlc(&mv_vlc, MV_VLC_BITS, 17,
&mbMotionVectorTable[0][1], 2, 1,
&mbMotionVectorTable[0][0], 2, 1, 1);
- init_vlc(&mbincr_vlc, MBINCR_VLC_BITS, 36,
+ init_vlc(&mbincr_vlc, MBINCR_VLC_BITS, 36,
&mbAddrIncrTable[0][1], 2, 1,
&mbAddrIncrTable[0][0], 2, 1, 1);
init_vlc(&mb_pat_vlc, MB_PAT_VLC_BITS, 64,
&mbPatTable[0][1], 2, 1,
&mbPatTable[0][0], 2, 1, 1);
-
- init_vlc(&mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7,
+
+ init_vlc(&mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7,
&table_mb_ptype[0][1], 2, 1,
&table_mb_ptype[0][0], 2, 1, 1);
- init_vlc(&mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
+ init_vlc(&mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
&table_mb_btype[0][1], 2, 1,
&table_mb_btype[0][0], 2, 1, 1);
init_rl(&rl_mpeg1, 1);
static inline int get_dmv(MpegEncContext *s)
{
- if(get_bits1(&s->gb))
+ if(get_bits1(&s->gb))
return 1 - (get_bits1(&s->gb) << 1);
else
return 0;
av_log(s->avctx, AV_LOG_ERROR, "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
/* skip mb */
s->mb_intra = 0;
for(i=0;i<12;i++)
s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]= MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
} else {
int mb_type;
-
+
if(s->mb_x)
mb_type= s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride - 1];
else
- mb_type= s->current_picture.mb_type[ s->mb_width + (s->mb_y-1)*s->mb_stride - 1]; // FIXME not sure if this is allowed in mpeg at all,
+ mb_type= s->current_picture.mb_type[ s->mb_width + (s->mb_y-1)*s->mb_stride - 1]; // FIXME not sure if this is allowed in mpeg at all,
if(IS_INTRA(mb_type))
return -1;
-
+
/* if B type, reuse previous vectors and directions */
s->mv[0][0][0] = s->last_mv[0][0][0];
s->mv[0][0][1] = s->last_mv[0][0][1];
s->mv[1][0][0] = s->last_mv[1][0][0];
s->mv[1][0][1] = s->last_mv[1][0][1];
- s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]=
+ s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]=
mb_type | MB_TYPE_SKIP;
// assert(s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride - 1]&(MB_TYPE_16x16|MB_TYPE_16x8));
- if((s->mv[0][0][0]|s->mv[0][0][1]|s->mv[1][0][0]|s->mv[1][0][1])==0)
+ if((s->mv[0][0][0]|s->mv[0][0][1]|s->mv[1][0][0]|s->mv[1][0][1])==0)
s->mb_skipped = 1;
}
// motion_type = 0; /* avoid warning */
if (IS_INTRA(mb_type)) {
s->dsp.clear_blocks(s->block[0]);
-
+
if(!s->chroma_y_shift){
s->dsp.clear_blocks(s->block[6]);
}
-
+
/* compute dct type */
if (s->picture_structure == PICT_FRAME && //FIXME add a interlaced_dct coded var?
!s->frame_pred_frame_dct) {
if (IS_QUANT(mb_type))
s->qscale = get_qscale(s);
-
+
if (s->concealment_motion_vectors) {
/* just parse them */
- if (s->picture_structure != PICT_FRAME)
+ if (s->picture_structure != PICT_FRAME)
skip_bits1(&s->gb); /* field select */
-
- s->mv[0][0][0]= s->last_mv[0][0][0]= s->last_mv[0][1][0] =
+
+ s->mv[0][0][0]= s->last_mv[0][0][0]= s->last_mv[0][1][0] =
mpeg_decode_motion(s, s->mpeg_f_code[0][0], s->last_mv[0][0][0]);
- s->mv[0][0][1]= s->last_mv[0][0][1]= s->last_mv[0][1][1] =
+ s->mv[0][0][1]= s->last_mv[0][0][1]= s->last_mv[0][1][1] =
mpeg_decode_motion(s, s->mpeg_f_code[0][1], s->last_mv[0][0][1]);
skip_bits1(&s->gb); /* marker */
assert(mb_type & MB_TYPE_L0L1);
//FIXME decide if MBs in field pictures are MB_TYPE_INTERLACED
/* get additionnal motion vector type */
- if (s->frame_pred_frame_dct)
+ if (s->frame_pred_frame_dct)
motion_type = MT_FRAME;
else{
motion_type = get_bits(&s->gb, 2);
case MT_FRAME: /* or MT_16X8 */
if (s->picture_structure == PICT_FRAME) {
/* MT_FRAME */
- mb_type |= MB_TYPE_16x16;
+ mb_type |= MB_TYPE_16x16;
s->mv_type = MV_TYPE_16X16;
- s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
+ s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
- s->mv[i][0][1]= s->last_mv[i][0][1]= s->last_mv[i][1][1] =
+ s->mv[i][0][1]= s->last_mv[i][0][1]= s->last_mv[i][1][1] =
mpeg_decode_motion(s, s->mpeg_f_code[i][1], s->last_mv[i][0][1]);
/* full_pel: only for mpeg1 */
if (s->full_pel[i]){
}
} else {
/* MT_16X8 */
- mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
+ mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
s->mv_type = MV_TYPE_16X8;
for(j=0;j<2;j++) {
s->field_select[i][j] = get_bits1(&s->gb);
case MT_FIELD:
s->mv_type = MV_TYPE_FIELD;
if (s->picture_structure == PICT_FRAME) {
- mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
+ mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
for(j=0;j<2;j++) {
s->field_select[i][j] = get_bits1(&s->gb);
val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
dprintf("fmy=%d\n", val);
}
} else {
- mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
+ mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
s->field_select[i][0] = get_bits1(&s->gb);
for(k=0;k<2;k++) {
val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
{
int dmx, dmy, mx, my, m;
- mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
+ mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
s->last_mv[i][0][0]);
s->last_mv[i][0][0] = mx;
s->last_mv[i][1][0] = mx;
dmx = get_dmv(s);
- my = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
+ my = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
s->last_mv[i][0][1] >> 1);
dmy = get_dmv(s);
s->mv_type = MV_TYPE_DMV;
s->mv[i][1][1] = my;//not used
if (s->picture_structure == PICT_FRAME) {
- mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
+ mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
//m = 1 + 2 * s->top_field_first;
m = s->top_field_first ? 1 : 3;
s->mv[i][2][1] = ((my + (my > 0)) >> 1) + dmy;
if(s->picture_structure == PICT_TOP_FIELD)
s->mv[i][2][1]--;
- else
+ else
s->mv[i][2][1]++;
}
}
}
}
}
-
+
s->mb_intra = 0;
if (HAS_CBP(mb_type)) {
s->dsp.clear_blocks(s->block[0]);
-
+
if(!s->chroma_y_shift){
s->dsp.clear_blocks(s->block[6]);
}
if(s->swap_uv){
exchange_uv(s);
}
- }
+ }
#endif
if (s->codec_id == CODEC_ID_MPEG2VIDEO) {
}
}else{
cbp<<= 12-mb_block_count;
-
+
for(i=0;i<mb_block_count;i++) {
if ( cbp & (1<<11) ) {
if (mpeg2_decode_block_non_intra(s, s->pblocks[i], i) < 0)
if (sign)
val = -val;
val += pred;
-
+
/* modulo decoding */
l= INT_BIT - 5 - shift;
val = (val<<l)>>l;
return diff;
}
-static inline int mpeg1_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg1_decode_block_intra(MpegEncContext *s,
+ DCTELEM *block,
int n)
{
int level, dc, diff, i, j, run;
dprintf("dc=%d diff=%d\n", dc, diff);
i = 0;
{
- OPEN_READER(re, &s->gb);
+ OPEN_READER(re, &s->gb);
/* now quantify & encode AC coefs */
for(;;) {
UPDATE_CACHE(re, &s->gb);
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level == 127){
break;
} else if(level != 0) {
return 0;
}
-static inline int mpeg1_decode_block_inter(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg1_decode_block_inter(MpegEncContext *s,
+ DCTELEM *block,
int n)
{
int level, i, j, run;
/* now quantify & encode AC coefs */
for(;;) {
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level != 0) {
i += run;
j = scantable[i];
/* now quantify & encode AC coefs */
for(;;) {
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level != 0) {
i += run;
j = scantable[i];
}
-static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg2_decode_block_non_intra(MpegEncContext *s,
+ DCTELEM *block,
int n)
{
int level, i, j, run;
/* now quantify & encode AC coefs */
for(;;) {
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level != 0) {
i += run;
j = scantable[i];
av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
mismatch ^= level;
block[j] = level;
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
CLOSE_READER(re, &s->gb);
}
block[63] ^= (mismatch & 1);
-
+
s->block_last_index[n] = i;
return 0;
}
-static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
+ DCTELEM *block,
int n)
{
int level, i, j, run;
/* now quantify & encode AC coefs */
for(;;) {
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level != 0) {
i += run;
j = scantable[i];
level= ((level*2+1)*qscale)>>1;
}
}
-
+
block[j] = level;
if(((int32_t)GET_CACHE(re, &s->gb)) <= (int32_t)0xBFFFFFFF)
break;
UPDATE_CACHE(re, &s->gb);
}
end:
- LAST_SKIP_BITS(re, &s->gb, 2);
+ LAST_SKIP_BITS(re, &s->gb, 2);
CLOSE_READER(re, &s->gb);
s->block_last_index[n] = i;
return 0;
}
-static inline int mpeg2_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg2_decode_block_intra(MpegEncContext *s,
+ DCTELEM *block,
int n)
{
int level, dc, diff, i, j, run;
/* DC coef */
if (n < 4){
quant_matrix = s->intra_matrix;
- component = 0;
+ component = 0;
}else{
quant_matrix = s->chroma_intra_matrix;
component = (n&1) + 1;
rl = &rl_mpeg1;
{
- OPEN_READER(re, &s->gb);
+ OPEN_READER(re, &s->gb);
/* now quantify & encode AC coefs */
for(;;) {
UPDATE_CACHE(re, &s->gb);
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level == 127){
break;
} else if(level != 0) {
av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
return -1;
}
-
+
mismatch^= level;
block[j] = level;
}
CLOSE_READER(re, &s->gb);
}
block[63]^= mismatch&1;
-
+
s->block_last_index[n] = i;
return 0;
}
-static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s,
- DCTELEM *block,
+static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s,
+ DCTELEM *block,
int n)
{
int level, dc, diff, j, run;
/* DC coef */
if (n < 4){
quant_matrix = s->intra_matrix;
- component = 0;
+ component = 0;
}else{
quant_matrix = s->chroma_intra_matrix;
component = (n&1) + 1;
rl = &rl_mpeg1;
{
- OPEN_READER(re, &s->gb);
+ OPEN_READER(re, &s->gb);
/* now quantify & encode AC coefs */
for(;;) {
UPDATE_CACHE(re, &s->gb);
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
-
+
if(level == 127){
break;
} else if(level != 0) {
level= (level*qscale*quant_matrix[j])>>4;
}
}
-
+
block[j] = level;
}
CLOSE_READER(re, &s->gb);
}
-
+
s->block_last_index[n] = scantable - s->intra_scantable.permutated;
return 0;
}
Mpeg1Context *s = avctx->priv_data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
int i;
-
+
//we need some parmutation to store
//matrixes, until MPV_common_init()
- //set the real permutatuon
+ //set the real permutatuon
for(i=0;i<64;i++)
s2->dsp.idct_permutation[i]=i;
MPV_decode_defaults(s2);
-
+
s->mpeg_enc_ctx.avctx= avctx;
s->mpeg_enc_ctx.flags= avctx->flags;
s->mpeg_enc_ctx.flags2= avctx->flags2;
return 0;
}
-static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm,
+static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm,
const uint8_t *new_perm){
uint16_t temp_matrix[64];
int i;
memcpy(temp_matrix,matrix,64*sizeof(uint16_t));
-
+
for(i=0;i<64;i++){
matrix[new_perm[i]] = temp_matrix[old_perm[i]];
- }
+ }
}
//Call this function when we know all parameters
uint8_t old_permutation[64];
if (
- (s1->mpeg_enc_ctx_allocated == 0)||
+ (s1->mpeg_enc_ctx_allocated == 0)||
avctx->coded_width != s->width ||
avctx->coded_height != s->height||
s1->save_aspect_info != s->aspect_ratio_info||
0)
{
-
+
if (s1->mpeg_enc_ctx_allocated) {
ParseContext pc= s->parse_context;
s->parse_context.buffer=0;
}else{//mpeg2
//mpeg2 fps
av_reduce(
- &s->avctx->time_base.den,
- &s->avctx->time_base.num,
+ &s->avctx->time_base.den,
+ &s->avctx->time_base.num,
frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num,
frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den,
1<<30);
//mpeg2 aspect
if(s->aspect_ratio_info > 1){
if( (s1->pan_scan.width == 0 )||(s1->pan_scan.height == 0) ){
- s->avctx->sample_aspect_ratio=
+ s->avctx->sample_aspect_ratio=
av_div_q(
- mpeg2_aspect[s->aspect_ratio_info],
+ mpeg2_aspect[s->aspect_ratio_info],
(AVRational){s->width, s->height}
);
}else{
- s->avctx->sample_aspect_ratio=
+ s->avctx->sample_aspect_ratio=
av_div_q(
- mpeg2_aspect[s->aspect_ratio_info],
+ mpeg2_aspect[s->aspect_ratio_info],
(AVRational){s1->pan_scan.width, s1->pan_scan.height}
);
}
}else{
- s->avctx->sample_aspect_ratio=
+ s->avctx->sample_aspect_ratio=
mpeg2_aspect[s->aspect_ratio_info];
}
}//mpeg2
if( avctx->idct_algo == FF_IDCT_AUTO )
avctx->idct_algo = FF_IDCT_SIMPLE;
- //quantization matrixes may need reordering
+ //quantization matrixes may need reordering
//if dct permutation is changed
memcpy(old_permutation,s->dsp.idct_permutation,64*sizeof(uint8_t));
buf_ptr += 2;
}
buf_end += 2; //undo the hack above
-
+
*pbuf_ptr = buf_end;
return -1;
}
-static int mpeg1_decode_picture(AVCodecContext *avctx,
+static int mpeg1_decode_picture(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int ref, f_code, vbv_delay;
- if(mpeg_decode_postinit(s->avctx) < 0)
+ if(mpeg_decode_postinit(s->avctx) < 0)
return -2;
init_get_bits(&s->gb, buf, buf_size*8);
}
s->current_picture.pict_type= s->pict_type;
s->current_picture.key_frame= s->pict_type == I_TYPE;
-
+
if(avctx->debug & FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_DEBUG, "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type);
-
+
s->y_dc_scale = 8;
s->c_dc_scale = 8;
s->first_slice = 1;
s->avctx->sub_id = 2; /* indicates mpeg2 found */
if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d vbv buffer: %d, bitrate:%d\n",
+ av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d vbv buffer: %d, bitrate:%d\n",
s->avctx->profile, s->avctx->level, s->avctx->rc_buffer_size, s->bit_rate);
}
skip_bits(&s->gb, 1); //marker
h= get_bits(&s->gb, 14);
skip_bits(&s->gb, 1); //marker
-
+
s1->pan_scan.width= 16*w;
s1->pan_scan.height=16*h;
-
+
if(s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG, "sde w:%d, h:%d\n", w, h);
}
if(s->repeat_first_field){
nofco++;
if(s->top_field_first)
- nofco++;
+ nofco++;
}
}else{
if(s->picture_structure == PICT_FRAME){
s1->pan_scan.position[i][1]= get_sbits(&s->gb, 16);
skip_bits(&s->gb, 1); //marker
}
-
+
if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "pde (%d,%d) (%d,%d) (%d,%d)\n",
- s1->pan_scan.position[0][0], s1->pan_scan.position[0][1],
- s1->pan_scan.position[1][0], s1->pan_scan.position[1][1],
+ av_log(s->avctx, AV_LOG_DEBUG, "pde (%d,%d) (%d,%d) (%d,%d)\n",
+ s1->pan_scan.position[0][0], s1->pan_scan.position[0][1],
+ s1->pan_scan.position[1][0], s1->pan_scan.position[1][1],
s1->pan_scan.position[2][0], s1->pan_scan.position[2][1]
);
}
s->first_field ^= 1;
memset(s->mbskip_table, 0, s->mb_stride*s->mb_height);
}
-
+
if(s->alternate_scan){
ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_alternate_vertical_scan);
ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_alternate_vertical_scan);
ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_zigzag_direct);
ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_zigzag_direct);
}
-
+
/* composite display not parsed */
dprintf("intra_dc_precision=%d\n", s->intra_dc_precision);
dprintf("picture_structure=%d\n", s->picture_structure);
dprintf("progressive_frame=%d\n", s->progressive_frame);
}
-static void mpeg_decode_extension(AVCodecContext *avctx,
+static void mpeg_decode_extension(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
int ext_type;
init_get_bits(&s->gb, buf, buf_size*8);
-
+
ext_type = get_bits(&s->gb, 4);
switch(ext_type) {
case 0x1:
} else if (s->progressive_frame) {
s->current_picture_ptr->repeat_pict = 1;
}
- }
+ }
*s->current_picture_ptr->pan_scan= s1->pan_scan;
}else{ //second field
int i;
-
+
if(!s->current_picture_ptr){
av_log(s->avctx, AV_LOG_ERROR, "first field missing\n");
return -1;
}
-
+
for(i=0; i<4; i++){
s->current_picture.data[i] = s->current_picture_ptr->data[i];
if(s->picture_structure == PICT_BOTTOM_FIELD){
s->current_picture.data[i] += s->current_picture_ptr->linesize[i];
- }
+ }
}
}
#ifdef HAVE_XVMC
av_log(s->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s->mb_height);
return -1;
}
-
+
init_get_bits(&s->gb, *buf, buf_size*8);
ff_mpeg1_clean_buffers(s);
av_log(s->avctx, AV_LOG_ERROR, "qscale == 0\n");
return -1;
}
-
+
/* extra slice info */
while (get_bits1(&s->gb) != 0) {
skip_bits(&s->gb, 8);
}
-
+
s->mb_x=0;
for(;;) {
if (s->mb_y==0 && s->mb_x==0 && (s->first_field || s->picture_structure==PICT_FRAME)) {
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%2d%2d%2d%2d %s %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
+ av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%2d%2d%2d%2d %s %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1],
- s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")),
- s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"",
+ s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")),
+ s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"",
s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors,
s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :"");
}
- }
-
+ }
+
for(;;) {
#ifdef HAVE_XVMC
//one 1 we memcpy blocks in xvmcvideo
s->dest[2] += 16 >> (s->chroma_x_shift + lowres);
MPV_decode_mb(s, s->block);
-
+
if (++s->mb_x >= s->mb_width) {
const int mb_size= 16>>s->avctx->lowres;
}else
goto eos;
}
-
+
ff_init_block_index(s);
}
ret= mpeg_decode_slice((Mpeg1Context*)s, mb_y, &buf, s->gb.buffer_end - buf);
emms_c();
-//av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
+//av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
//ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, s->start_mb_y, s->end_mb_y, s->error_count);
if(ret < 0){
if(s->resync_mb_x>=0 && s->resync_mb_y>=0)
}else{
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
}
-
+
if(s->mb_y == s->end_mb_y)
return 0;
-
+
start_code = find_start_code(&buf, s->gb.buffer_end);
mb_y= start_code - SLICE_MIN_START_CODE;
if(mb_y < 0 || mb_y >= s->end_mb_y)
return -1;
}
-
+
return 0; //not reached
}
/**
* handles slice ends.
- * @return 1 if it seems to be the last slice of
+ * @return 1 if it seems to be the last slice of
*/
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
-
+
if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr)
return 0;
}
}
-static int mpeg1_decode_sequence(AVCodecContext *avctx,
+static int mpeg1_decode_sequence(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
s->chroma_inter_matrix[j] = v;
}
}
-
+
if(show_bits(&s->gb, 23) != 0){
av_log(s->avctx, AV_LOG_ERROR, "sequence header damaged\n");
return -1;
s->out_format = FMT_MPEG1;
s->swap_uv = 0;//AFAIK VCR2 don't have SEQ_HEADER
if(s->flags & CODEC_FLAG_LOW_DELAY) s->low_delay=1;
-
+
if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%d\n",
+ av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%d\n",
s->avctx->rc_buffer_size, s->bit_rate);
-
+
return 0;
}
if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT )
if( avctx->idct_algo == FF_IDCT_AUTO )
avctx->idct_algo = FF_IDCT_SIMPLE;
-
+
if (MPV_common_init(s) < 0)
return -1;
exchange_uv(s);//common init reset pblocks, so we swap them here
- s->swap_uv = 1;// in case of xvmc we need to swap uv for each MB
+ s->swap_uv = 1;// in case of xvmc we need to swap uv for each MB
s1->mpeg_enc_ctx_allocated = 1;
for(i=0;i<64;i++) {
}
-static void mpeg_decode_user_data(AVCodecContext *avctx,
+static void mpeg_decode_user_data(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
const uint8_t *p;
}
}
-static void mpeg_decode_gop(AVCodecContext *avctx,
+static void mpeg_decode_gop(AVCodecContext *avctx,
const uint8_t *buf, int buf_size){
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
init_get_bits(&s->gb, buf, buf_size*8);
drop_frame_flag = get_bits1(&s->gb);
-
+
time_code_hours=get_bits(&s->gb,5);
time_code_minutes = get_bits(&s->gb,6);
skip_bits1(&s->gb);//marker bit
{
int i;
uint32_t state;
-
+
state= pc->state;
-
+
i=0;
if(!pc->frame_start_found){
for(i=0; i<buf_size; i++){
}
}
}
-
+
if(pc->frame_start_found){
/* EOF considered as end of frame */
if (buf_size == 0)
if((state&0xFFFFFF00) == 0x100){
if(state < SLICE_MIN_START_CODE || state > SLICE_MAX_START_CODE){
pc->frame_start_found=0;
- pc->state=-1;
+ pc->state=-1;
return i-3;
}
}
}
- }
+ }
pc->state= state;
return END_NOT_FOUND;
}
/* handle buffering and image synchronisation */
-static int mpeg_decode_frame(AVCodecContext *avctx,
+static int mpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
if(s2->flags&CODEC_FLAG_TRUNCATED){
int next= ff_mpeg1_find_frame_end(&s2->parse_context, buf, buf_size);
-
+
if( ff_combine_frame(&s2->parse_context, next, &buf, &buf_size) < 0 )
return buf_size;
- }
-
+ }
+
buf_ptr = buf;
buf_end = buf + buf_size;
-#if 0
- if (s->repeat_field % 2 == 1) {
+#if 0
+ if (s->repeat_field % 2 == 1) {
s->repeat_field++;
//fprintf(stderr,"\nRepeating last frame: %d -> %d! pict: %d %d", avctx->frame_number-1, avctx->frame_number,
// s2->picture_number, s->repeat_field);
if(s->mpeg_enc_ctx_allocated==0 && avctx->codec_tag == ff_get_fourcc("VCR2"))
vcr2_init_sequence(avctx);
-
+
s->slice_count= 0;
-
+
for(;;) {
/* find start next code */
start_code = find_start_code(&buf_ptr, buf_end);
}
return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
}
-
+
input_size = buf_end - buf_ptr;
if(avctx->debug & FF_DEBUG_STARTCODE){
/* prepare data for next start code */
switch(start_code) {
case SEQ_START_CODE:
- mpeg1_decode_sequence(avctx, buf_ptr,
+ mpeg1_decode_sequence(avctx, buf_ptr,
input_size);
break;
-
+
case PICTURE_START_CODE:
/* we have a complete image : we try to decompress it */
- mpeg1_decode_picture(avctx,
+ mpeg1_decode_picture(avctx,
buf_ptr, input_size);
break;
case EXT_START_CODE:
buf_ptr, input_size);
break;
case USER_START_CODE:
- mpeg_decode_user_data(avctx,
+ mpeg_decode_user_data(avctx,
buf_ptr, input_size);
break;
case GOP_START_CODE:
s2->first_field=0;
- mpeg_decode_gop(avctx,
+ mpeg_decode_gop(avctx,
buf_ptr, input_size);
break;
default:
if (start_code >= SLICE_MIN_START_CODE &&
start_code <= SLICE_MAX_START_CODE) {
int mb_y= start_code - SLICE_MIN_START_CODE;
-
+
if(s2->last_picture_ptr==NULL){
/* skip b frames if we dont have reference frames */
if(s2->pict_type==B_TYPE) break;
break;
/* skip everything if we are in a hurry>=5 */
if(avctx->hurry_up>=5) break;
-
+
if (!s->mpeg_enc_ctx_allocated) break;
if(s2->codec_id == CODEC_ID_MPEG2VIDEO){
if(mb_y < avctx->skip_top || mb_y >= s2->mb_height - avctx->skip_bottom)
break;
}
-
+
if(s2->first_slice){
s2->first_slice=0;
if(mpeg_field_start(s2) < 0)
return -1;
}
-
+
if(avctx->thread_count > 1){
int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count;
if(threshold <= mb_y){
MpegEncContext *thread_context= s2->thread_context[s->slice_count];
-
+
thread_context->start_mb_y= mb_y;
thread_context->end_mb_y = s2->mb_height;
if(s->slice_count){
static int mpeg_mc_decode_init(AVCodecContext *avctx){
Mpeg1Context *s;
- if( avctx->thread_count > 1)
+ if( avctx->thread_count > 1)
return -1;
if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
return -1;
#endif
-/* this is ugly i know, but the alternative is too make
+/* this is ugly i know, but the alternative is too make
hundreds of vars global and prefix them with ff_mpeg1_
which is far uglier. */
-#include "mdec.c"
+#include "mdec.c"
{0x20, 8}, {0x16,13}, {0x15,13}, {0x1f,15},
{0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15},
{0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16},
- {0x11,16}, {0x10,16}, {0x05, 5}, {0x07, 7},
- {0xfc, 8}, {0x0c,10}, {0x14,13}, {0x07, 5},
- {0x26, 8}, {0x1c,12}, {0x13,13}, {0x06, 6},
- {0xfd, 8}, {0x12,12}, {0x07, 6}, {0x04, 9},
- {0x12,13}, {0x06, 7}, {0x1e,12}, {0x14,16},
- {0x04, 7}, {0x15,12}, {0x05, 7}, {0x11,12},
- {0x78, 7}, {0x11,13}, {0x7a, 7}, {0x10,13},
- {0x21, 8}, {0x1a,16}, {0x25, 8}, {0x19,16},
- {0x24, 8}, {0x18,16}, {0x05, 9}, {0x17,16},
- {0x07, 9}, {0x16,16}, {0x0d,10}, {0x15,16},
- {0x1f,12}, {0x1a,12}, {0x19,12}, {0x17,12},
- {0x16,12}, {0x1f,13}, {0x1e,13}, {0x1d,13},
- {0x1c,13}, {0x1b,13}, {0x1f,16}, {0x1e,16},
- {0x1d,16}, {0x1c,16}, {0x1b,16},
+ {0x11,16}, {0x10,16}, {0x05, 5}, {0x07, 7},
+ {0xfc, 8}, {0x0c,10}, {0x14,13}, {0x07, 5},
+ {0x26, 8}, {0x1c,12}, {0x13,13}, {0x06, 6},
+ {0xfd, 8}, {0x12,12}, {0x07, 6}, {0x04, 9},
+ {0x12,13}, {0x06, 7}, {0x1e,12}, {0x14,16},
+ {0x04, 7}, {0x15,12}, {0x05, 7}, {0x11,12},
+ {0x78, 7}, {0x11,13}, {0x7a, 7}, {0x10,13},
+ {0x21, 8}, {0x1a,16}, {0x25, 8}, {0x19,16},
+ {0x24, 8}, {0x18,16}, {0x05, 9}, {0x17,16},
+ {0x07, 9}, {0x16,16}, {0x0d,10}, {0x15,16},
+ {0x1f,12}, {0x1a,12}, {0x19,12}, {0x17,12},
+ {0x16,12}, {0x1f,13}, {0x1e,13}, {0x1d,13},
+ {0x1c,13}, {0x1b,13}, {0x1f,16}, {0x1e,16},
+ {0x1d,16}, {0x1c,16}, {0x1b,16},
{0x01,6}, /* escape */
{0x06,4}, /* EOB */
};
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
};
-static const uint8_t mpeg2_dc_scale_table2[128]={
+static const uint8_t mpeg2_dc_scale_table2[128]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
};
-static const uint8_t mpeg2_dc_scale_table3[128]={
+static const uint8_t mpeg2_dc_scale_table3[128]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
ff_mpeg1_dc_scale_table,
mpeg2_dc_scale_table1,
mpeg2_dc_scale_table2,
- mpeg2_dc_scale_table3,
+ mpeg2_dc_scale_table3,
};
static const float mpeg1_aspect[16]={
1.0000,
0.6735,
0.7031,
-
+
0.7615,
0.8055,
0.8437,
{
{3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7},
{1,8}, {1,9}, {1,10}, {1,11},
-};
+};
const uint8_t DCtab_chrom[13][2] =
{
{3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8},
{1,9}, {1,10}, {1,11}, {1,12},
-};
+};
const uint16_t intra_vlc[103][2] = {
{ 0x2, 2 },
};
static const uint8_t inter_rvlc_run[169]={
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 3, 3, 3, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6,
- 7, 7, 7, 7, 8, 8, 8, 9,
- 9, 9, 10, 10, 11, 11, 12, 12,
-13, 13, 14, 14, 15, 15, 16, 16,
-17, 17, 18, 19, 20, 21, 22, 23,
-24, 25, 26, 27, 28, 29, 30, 31,
-32, 33, 34, 35, 36, 37, 38,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 2, 2, 2, 3, 3, 4,
- 4, 5, 5, 6, 6, 7, 7, 8,
- 8, 9, 9, 10, 10, 11, 11, 12,
-12, 13, 13, 14, 15, 16, 17, 18,
-19, 20, 21, 22, 23, 24, 25, 26,
-27, 28, 29, 30, 31, 32, 33, 34,
-35, 36, 37, 38, 39, 40, 41, 42,
-43, 44,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 2, 2,
+ 2, 2, 2, 2, 3, 3, 3, 3,
+ 3, 3, 3, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 6, 6, 6, 6,
+ 7, 7, 7, 7, 8, 8, 8, 9,
+ 9, 9, 10, 10, 11, 11, 12, 12,
+13, 13, 14, 14, 15, 15, 16, 16,
+17, 17, 18, 19, 20, 21, 22, 23,
+24, 25, 26, 27, 28, 29, 30, 31,
+32, 33, 34, 35, 36, 37, 38,
+ 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 1, 2, 2, 2, 3, 3, 4,
+ 4, 5, 5, 6, 6, 7, 7, 8,
+ 8, 9, 9, 10, 10, 11, 11, 12,
+12, 13, 13, 14, 15, 16, 17, 18,
+19, 20, 21, 22, 23, 24, 25, 26,
+27, 28, 29, 30, 31, 32, 33, 34,
+35, 36, 37, 38, 39, 40, 41, 42,
+43, 44,
};
static const uint8_t inter_rvlc_level[169]={
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 1, 2, 3,
- 4, 5, 6, 7, 1, 2, 3, 4,
- 5, 6, 7, 1, 2, 3, 4, 5,
- 1, 2, 3, 4, 1, 2, 3, 4,
- 1, 2, 3, 4, 1, 2, 3, 1,
- 2, 3, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 2, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 3, 4, 5, 1, 2, 3,
- 4, 5, 1, 2, 3, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1,
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+17, 18, 19, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 1, 2, 3,
+ 4, 5, 6, 7, 1, 2, 3, 4,
+ 5, 6, 7, 1, 2, 3, 4, 5,
+ 1, 2, 3, 4, 1, 2, 3, 4,
+ 1, 2, 3, 4, 1, 2, 3, 1,
+ 2, 3, 1, 2, 1, 2, 1, 2,
+ 1, 2, 1, 2, 1, 2, 1, 2,
+ 1, 2, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 3, 4, 5, 1, 2, 3,
+ 4, 5, 1, 2, 3, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1,
};
static RLTable rvlc_rl_inter = {
};
static const uint8_t intra_rvlc_run[169]={
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 4, 4, 4, 4,
- 4, 4, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 7, 7, 7,
- 7, 7, 8, 8, 8, 8, 9, 9,
- 9, 9, 10, 10, 11, 11, 12, 12,
-13, 14, 15, 16, 17, 18, 19,
- 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 2, 2, 2, 3, 3, 4,
- 4, 5, 5, 6, 6, 7, 7, 8,
- 8, 9, 9, 10, 10, 11, 11, 12,
-12, 13, 13, 14, 15, 16, 17, 18,
-19, 20, 21, 22, 23, 24, 25, 26,
-27, 28, 29, 30, 31, 32, 33, 34,
-35, 36, 37, 38, 39, 40, 41, 42,
-43, 44,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 4, 4, 4, 4,
+ 4, 4, 5, 5, 5, 5, 5, 5,
+ 6, 6, 6, 6, 6, 7, 7, 7,
+ 7, 7, 8, 8, 8, 8, 9, 9,
+ 9, 9, 10, 10, 11, 11, 12, 12,
+13, 14, 15, 16, 17, 18, 19,
+ 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 1, 2, 2, 2, 3, 3, 4,
+ 4, 5, 5, 6, 6, 7, 7, 8,
+ 8, 9, 9, 10, 10, 11, 11, 12,
+12, 13, 13, 14, 15, 16, 17, 18,
+19, 20, 21, 22, 23, 24, 25, 26,
+27, 28, 29, 30, 31, 32, 33, 34,
+35, 36, 37, 38, 39, 40, 41, 42,
+43, 44,
};
static const uint8_t intra_rvlc_level[169]={
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
-17, 18, 19, 20, 21, 22, 23, 24,
-25, 26, 27, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13,
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 1, 2, 3, 4,
- 5, 6, 1, 2, 3, 4, 5, 6,
- 1, 2, 3, 4, 5, 1, 2, 3,
- 4, 5, 1, 2, 3, 4, 1, 2,
- 3, 4, 1, 2, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 3, 4, 5, 1, 2, 3,
- 4, 5, 1, 2, 3, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 2, 1,
- 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1,
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16,
+17, 18, 19, 20, 21, 22, 23, 24,
+25, 26, 27, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 12, 13,
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 1, 2, 3, 4,
+ 5, 6, 1, 2, 3, 4, 5, 6,
+ 1, 2, 3, 4, 5, 1, 2, 3,
+ 4, 5, 1, 2, 3, 4, 1, 2,
+ 3, 4, 1, 2, 1, 2, 1, 2,
+ 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 3, 4, 5, 1, 2, 3,
+ 4, 5, 1, 2, 3, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1,
};
static RLTable rvlc_rl_intra = {
static const uint16_t sprite_trajectory_tab[15][2] = {
{0x00, 2}, {0x02, 3}, {0x03, 3}, {0x04, 3}, {0x05, 3}, {0x06, 3},
- {0x0E, 4}, {0x1E, 5}, {0x3E, 6}, {0x7E, 7}, {0xFE, 8},
+ {0x0E, 4}, {0x1E, 5}, {0x3E, 6}, {0x7E, 7}, {0xFE, 8},
{0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12},
};
22, 23, 24, 26, 28, 30, 32, 35,
23, 24, 26, 28, 30, 32, 35, 38,
25, 26, 28, 30, 32, 35, 38, 41,
- 27, 28, 30, 32, 35, 38, 41, 45,
+ 27, 28, 30, 32, 35, 38, 41, 45,
};
const int16_t ff_mpeg4_default_non_intra_matrix[64] = {
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file mpegaudio.c
* The simplest mpeg audio layer 2 encoder.
*/
-
+
#include "avcodec.h"
#include "bitstream.h"
#include "mpegaudio.h"
int sb_samples[MPA_MAX_CHANNELS][3][12][SBLIMIT];
unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3]; /* scale factors */
/* code to group 3 scale factors */
- unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];
+ unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];
int sblimit; /* number of used subbands */
const unsigned char *alloc_table;
} MpegAudioContext;
/* encoding freq */
s->lsf = 0;
for(i=0;i<3;i++) {
- if (mpa_freq_tab[i] == freq)
+ if (mpa_freq_tab[i] == freq)
break;
if ((mpa_freq_tab[i] / 2) == freq) {
s->lsf = 1;
/* encoding bitrate & frequency */
for(i=0;i<15;i++) {
- if (mpa_bitrate_tab[s->lsf][1][i] == bitrate)
+ if (mpa_bitrate_tab[s->lsf][1][i] == bitrate)
break;
}
if (i == 15){
s->bitrate_index = i;
/* compute total header size & pad bit */
-
+
a = (float)(bitrate * 1000 * MPA_FRAME_SIZE) / (freq * 8.0);
s->frame_size = ((int)a) * 8;
/* frame fractional size to compute padding */
s->frame_frac = 0;
s->frame_frac_incr = (int)((a - floor(a)) * 65536.0);
-
+
/* select the right allocation table */
table = l2_select_table(bitrate, s->nb_channels, freq, s->lsf);
s->alloc_table = alloc_tables[table];
#ifdef DEBUG
- av_log(avctx, AV_LOG_DEBUG, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
+ av_log(avctx, AV_LOG_DEBUG, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
bitrate, freq, s->frame_size, table, s->frame_frac_incr);
#endif
v = 2;
else if (v < 3)
v = 3;
- else
+ else
v = 4;
scale_diff_table[i] = v;
}
for(i=0;i<17;i++) {
v = quant_bits[i];
- if (v < 0)
+ if (v < 0)
v = -v;
else
v = v * 3;
const int *xp = costab32;
for(j=31;j>=3;j-=2) tab[j] += tab[j - 2];
-
+
t = tab + 30;
t1 = tab + 2;
do {
t[3] += t[3-8];
t -= 8;
} while (t != t1);
-
+
t = tab;
t1 = tab + 32;
do {
- t[ 3] = -t[ 3];
- t[ 6] = -t[ 6];
-
- t[11] = -t[11];
- t[12] = -t[12];
- t[13] = -t[13];
- t[15] = -t[15];
+ t[ 3] = -t[ 3];
+ t[ 6] = -t[ 6];
+
+ t[11] = -t[11];
+ t[12] = -t[12];
+ t[13] = -t[13];
+ t[15] = -t[15];
t += 16;
} while (t != t1);
-
+
t = tab;
t1 = tab + 8;
do {
int x1, x2, x3, x4;
-
+
x3 = MUL(t[16], FIX(SQRT2*0.5));
x4 = t[0] - x3;
x3 = t[0] + x3;
-
+
x2 = MUL(-(t[24] + t[8]), FIX(SQRT2*0.5));
x1 = MUL((t[8] - x2), xp[0]);
x2 = MUL((t[8] + x2), xp[1]);
xr = MUL(t[4],xp[1]);
t[ 4] = (t[24] - xr);
t[24] = (t[24] + xr);
-
+
xr = MUL(t[20],xp[2]);
t[20] = (t[8] - xr);
t[ 8] = (t[8] + xr);
-
+
xr = MUL(t[12],xp[3]);
t[12] = (t[16] - xr);
t[16] = (t[16] + xr);
xr = MUL(tab[30-i*4],xp[0]);
tab[30-i*4] = (tab[i*4] - xr);
tab[ i*4] = (tab[i*4] + xr);
-
+
xr = MUL(tab[ 2+i*4],xp[1]);
tab[ 2+i*4] = (tab[28-i*4] - xr);
tab[28-i*4] = (tab[28-i*4] + xr);
-
+
xr = MUL(tab[31-i*4],xp[0]);
tab[31-i*4] = (tab[1+i*4] - xr);
tab[ 1+i*4] = (tab[1+i*4] + xr);
-
+
xr = MUL(tab[ 3+i*4],xp[1]);
tab[ 3+i*4] = (tab[29-i*4] - xr);
tab[29-i*4] = (tab[29-i*4] + xr);
-
+
xp += 2;
}
out += 32;
/* handle the wrap around */
if (offset < 0) {
- memmove(s->samples_buf[ch] + SAMPLES_BUF_SIZE - (512 - 32),
+ memmove(s->samples_buf[ch] + SAMPLES_BUF_SIZE - (512 - 32),
s->samples_buf[ch], (512 - 32) * 2);
offset = SAMPLES_BUF_SIZE - 512;
}
}
static void compute_scale_factors(unsigned char scale_code[SBLIMIT],
- unsigned char scale_factors[SBLIMIT][3],
+ unsigned char scale_factors[SBLIMIT][3],
int sb_samples[3][12][SBLIMIT],
int sblimit)
{
int *p, vmax, v, n, i, j, k, code;
int index, d1, d2;
unsigned char *sf = &scale_factors[0][0];
-
+
for(j=0;j<sblimit;j++) {
for(i=0;i<3;i++) {
/* find the max absolute value */
/* compute the scale factor index using log 2 computations */
if (vmax > 0) {
n = av_log2(vmax);
- /* n is the position of the MSB of vmax. now
+ /* n is the position of the MSB of vmax. now
use at most 2 compares to find the index */
index = (21 - n) * 3 - 3;
if (index >= 0) {
}
#if 0
- printf("%2d:%d in=%x %x %d\n",
+ printf("%2d:%d in=%x %x %d\n",
j, i, vmax, scale_factor_table[index], index);
#endif
/* store the scale factor */
are close enough to each other */
d1 = scale_diff_table[sf[0] - sf[1] + 64];
d2 = scale_diff_table[sf[1] - sf[2] + 64];
-
+
/* handle the 25 cases */
switch(d1 * 5 + d2) {
case 0*5+0:
assert(0); //cant happen
code = 0; /* kill warning */
}
-
+
#if 0
- printf("%d: %2d %2d %2d %d %d -> %d\n", j,
+ printf("%d: %2d %2d %2d %d %d -> %d\n", j,
sf[0], sf[1], sf[2], d1, d2, code);
#endif
scale_code[j] = code;
/* Try to maximize the smr while using a number of bits inferior to
the frame size. I tried to make the code simpler, faster and
smaller than other encoders :-) */
-static void compute_bit_allocation(MpegAudioContext *s,
+static void compute_bit_allocation(MpegAudioContext *s,
short smr1[MPA_MAX_CHANNELS][SBLIMIT],
unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT],
int *padding)
memcpy(smr, smr1, s->nb_channels * sizeof(short) * SBLIMIT);
memset(subband_status, SB_NOTALLOCATED, s->nb_channels * SBLIMIT);
memset(bit_alloc, 0, s->nb_channels * SBLIMIT);
-
+
/* compute frame size and padding */
max_frame_size = s->frame_size;
s->frame_frac += s->frame_frac_incr;
}
}
#if 0
- printf("current=%d max=%d max_sb=%d alloc=%d\n",
+ printf("current=%d max=%d max_sb=%d alloc=%d\n",
current_frame_size, max_frame_size, max_sb,
bit_alloc[max_sb]);
-#endif
+#endif
if (max_sb < 0)
break;
-
+
/* find alloc table entry (XXX: not optimal, should use
pointer table) */
alloc = s->alloc_table;
} else {
/* increments bit allocation */
b = bit_alloc[max_ch][max_sb];
- incr = total_quant_bits[alloc[b + 1]] -
+ incr = total_quant_bits[alloc[b + 1]] -
total_quant_bits[alloc[b]];
}
}
j += 1 << bit_alloc_bits;
}
-
+
/* scale codes */
for(i=0;i<s->sblimit;i++) {
for(ch=0;ch<s->nb_channels;ch++) {
- if (bit_alloc[ch][i])
+ if (bit_alloc[ch][i])
put_bits(p, 2, s->scale_code[ch][i]);
}
}
}
}
}
-
+
/* quantization & write sub band samples */
for(k=0;k<3;k++) {
e = s->scale_factors[ch][i][k];
shift = scale_factor_shift[e];
mult = scale_factor_mult[e];
-
+
/* normalize to P bits */
if (shift < 0)
q1 = sample << (-shift);
bits = quant_bits[qindex];
if (bits < 0) {
/* group the 3 values to save bits */
- put_bits(p, -bits,
+ put_bits(p, -bits,
q[0] + steps * (q[1] + steps * q[2]));
#if 0
- printf("%d: gr1 %d\n",
+ printf("%d: gr1 %d\n",
i, q[0] + steps * (q[1] + steps * q[2]));
#endif
} else {
#if 0
- printf("%d: gr3 %d %d %d\n",
+ printf("%d: gr3 %d %d %d\n",
i, q[0], q[1], q[2]);
-#endif
+#endif
put_bits(p, bits, q[0]);
put_bits(p, bits, q[1]);
put_bits(p, bits, q[2]);
}
}
/* next subband in alloc table */
- j += 1 << bit_alloc_bits;
+ j += 1 << bit_alloc_bits;
}
}
}
}
for(i=0;i<s->nb_channels;i++) {
- compute_scale_factors(s->scale_code[i], s->scale_factors[i],
+ compute_scale_factors(s->scale_code[i], s->scale_factors[i],
s->sb_samples[i], s->sblimit);
}
for(i=0;i<s->nb_channels;i++) {
init_put_bits(&s->pb, frame, MPA_MAX_CODED_FRAME_SIZE);
encode_frame(s, bit_alloc, padding);
-
+
s->nb_samples += MPA_FRAME_SIZE;
return pbBufPtr(&s->pb) - s->pb.buf;
}
*/
/* max frame size, in samples */
-#define MPA_FRAME_SIZE 1152
+#define MPA_FRAME_SIZE 1152
/* max compressed frame size */
#define MPA_MAX_CODED_FRAME_SIZE 1792
/**
* @file mpegaudiodec.c
* MPEG Audio decoder.
- */
+ */
//#define DEBUG
#include "avcodec.h"
int free_format_frame_size; /* frame size in case of free format
(zero if currently unknown) */
/* next header (used in free format parsing) */
- uint32_t free_format_next_header;
+ uint32_t free_format_next_header;
int error_protection;
int layer;
int sample_rate;
static void compute_antialias_float(MPADecodeContext *s, GranuleDef *g);
/* vlc structure for decoding layer 3 huffman tables */
-static VLC huff_vlc[16];
+static VLC huff_vlc[16];
static uint8_t *huff_code_table[16];
static VLC huff_quad_vlc[2];
/* computed from band_size_long */
void ff_mpa_synth_init(MPA_INT *window);
static MPA_INT window[512] __attribute__((aligned(16)));
-
+
/* layer 1 unscaling */
/* n = number of bits of the mantissa minus 1 */
static inline int l1_unscale(int n, int mant, int scale_factor)
{
int e, er, eq, j;
int a, a1;
-
+
/* renormalize */
a = i;
e = POW_FRAC_BITS;
avctx->sample_fmt= SAMPLE_FMT_S32;
#else
avctx->sample_fmt= SAMPLE_FMT_S16;
-#endif
-
+#endif
+
if(avctx->antialias_algo != FF_AA_FLOAT)
s->compute_antialias= compute_antialias_integer;
else
scale_factor_mult[i][1] = MULL(FIXR(0.7937005259 * 2.0), norm);
scale_factor_mult[i][2] = MULL(FIXR(0.6299605249 * 2.0), norm);
dprintf("%d: norm=%x s=%x %x %x\n",
- i, norm,
+ i, norm,
scale_factor_mult[i][0],
scale_factor_mult[i][1],
scale_factor_mult[i][2]);
}
-
+
ff_mpa_synth_init(window);
-
+
/* huffman decode tables */
huff_code_table[0] = NULL;
for(i=1;i<16;i++) {
xsize = h->xsize;
n = xsize * xsize;
/* XXX: fail test */
- init_vlc(&huff_vlc[i], 8, n,
+ init_vlc(&huff_vlc[i], 8, n,
h->bits, 1, 1, h->codes, 2, 2, 1);
-
+
code_table = av_mallocz(n);
j = 0;
for(x=0;x<xsize;x++) {
huff_code_table[i] = code_table;
}
for(i=0;i<2;i++) {
- init_vlc(&huff_quad_vlc[i], i == 0 ? 7 : 4, 16,
+ init_vlc(&huff_quad_vlc[i], i == 0 ? 7 : 4, 16,
mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, 1);
}
table_4_3_value= av_mallocz_static(TABLE_4_3_SIZE * sizeof(table_4_3_value[0]));
if(!table_4_3_value)
return -1;
-
+
int_pow_init();
for(i=1;i<TABLE_4_3_SIZE;i++) {
double f, fm;
// av_log(NULL, AV_LOG_DEBUG, "%d %d %f\n", i, m, pow((double)i, 4.0 / 3.0));
table_4_3_exp[i] = -e;
}
-
+
for(i=0;i<7;i++) {
float f;
int v;
k = i & 1;
is_table_lsf[j][k ^ 1][i] = FIXR(f);
is_table_lsf[j][k][i] = FIXR(1.0);
- dprintf("is_table_lsf %d %d: %x %x\n",
+ dprintf("is_table_lsf %d %d: %x %x\n",
i, j, is_table_lsf[j][0][i], is_table_lsf[j][1][i]);
}
}
csa_table[i][0] = FIXHR(cs/4);
csa_table[i][1] = FIXHR(ca/4);
csa_table[i][2] = FIXHR(ca/4) + FIXHR(cs/4);
- csa_table[i][3] = FIXHR(ca/4) - FIXHR(cs/4);
+ csa_table[i][3] = FIXHR(ca/4) - FIXHR(cs/4);
csa_table_float[i][0] = cs;
csa_table_float[i][1] = ca;
csa_table_float[i][2] = ca + cs;
- csa_table_float[i][3] = ca - cs;
+ csa_table_float[i][3] = ca - cs;
// printf("%d %d %d %d\n", FIX(cs), FIX(cs-1), FIX(ca), FIX(cs)-FIX(ca));
// av_log(NULL, AV_LOG_DEBUG,"%f %f %f %f\n", cs, ca, ca+cs, ca-cs);
}
for(i=0;i<36;i++) {
for(j=0; j<4; j++){
double d;
-
+
if(j==2 && i%3 != 1)
continue;
-
+
d= sin(M_PI * (i + 0.5) / 36.0);
if(j==1){
if (i>=30) d= 0;
BF(5, 10, COS1_5);
BF(6, 9, COS1_6);
BF(7, 8, COS1_7);
-
+
BF(16, 31, -COS1_0);
BF(17, 30, -COS1_1);
BF(18, 29, -COS1_2);
BF(21, 26, -COS1_5);
BF(22, 25, -COS1_6);
BF(23, 24, -COS1_7);
-
+
/* pass 3 */
BF(0, 7, COS2_0);
BF(1, 6, COS2_1);
BF(2, 5, COS2_2);
BF(3, 4, COS2_3);
-
+
BF(8, 15, -COS2_0);
BF(9, 14, -COS2_1);
BF(10, 13, -COS2_2);
BF(11, 12, -COS2_3);
-
+
BF(16, 23, COS2_0);
BF(17, 22, COS2_1);
BF(18, 21, COS2_2);
BF(19, 20, COS2_3);
-
+
BF(24, 31, -COS2_0);
BF(25, 30, -COS2_1);
BF(26, 29, -COS2_2);
/* pass 4 */
BF(0, 3, COS3_0);
BF(1, 2, COS3_1);
-
+
BF(4, 7, -COS3_0);
BF(5, 6, -COS3_1);
-
+
BF(8, 11, COS3_0);
BF(9, 10, COS3_1);
-
+
BF(12, 15, -COS3_0);
BF(13, 14, -COS3_1);
-
+
BF(16, 19, COS3_0);
BF(17, 18, COS3_1);
-
+
BF(20, 23, -COS3_0);
BF(21, 22, -COS3_1);
-
+
BF(24, 27, COS3_0);
BF(25, 26, COS3_1);
-
+
BF(28, 31, -COS3_0);
BF(29, 30, -COS3_1);
-
+
/* pass 5 */
BF1(0, 1, 2, 3);
BF2(4, 5, 6, 7);
BF2(20, 21, 22, 23);
BF1(24, 25, 26, 27);
BF2(28, 29, 30, 31);
-
+
/* pass 6 */
-
+
ADD( 8, 12);
ADD(12, 10);
ADD(10, 14);
out[22] = tab[13];
out[14] = tab[14];
out[30] = tab[15];
-
+
ADD(24, 28);
ADD(28, 26);
ADD(26, 30);
#else
-static inline int round_sample(int64_t *sum)
+static inline int round_sample(int64_t *sum)
{
int sum1;
sum1 = (int)((*sum) >> OUT_SHIFT);
v = -v;
if (i != 0)
window[512 - i] = v;
- }
+ }
}
/* 32 sub band synthesis filter. Input: 32 sub band samples, Output:
/* XXX: optimize by avoiding ring buffer usage */
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
- OUT_INT *samples, int incr,
+ OUT_INT *samples, int incr,
int32_t sb_samples[SBLIMIT])
{
int32_t tmp[32];
#endif
dct32(tmp, sb_samples);
-
+
offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset;
w++;
w2--;
}
-
+
p = synth_buf + 32;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
in2= MULH(2*in2, C3);
in3= MULH(2*in3, C3);
-
+
t1 = in0 - in4;
t2 = MULL(in1 - in5, icos36[4]);
- out[ 7]=
+ out[ 7]=
out[10]= t1 + t2;
out[ 1]=
out[ 4]= t1 - t2;
in0 += in4>>1;
in4 = in0 + in2;
in1 += in5>>1;
- in5 = MULL(in1 + in3, icos36[1]);
- out[ 8]=
+ in5 = MULL(in1 + in3, icos36[1]);
+ out[ 8]=
out[ 9]= in4 + in5;
out[ 2]=
out[ 3]= in4 - in5;
-
+
in0 -= in2;
in1 = MULL(in1 - in3, icos36[7]);
out[ 0]=
out[ 5]= in0 - in1;
out[ 6]=
- out[11]= in0 + in1;
+ out[11]= in0 + in1;
}
/* cos(pi*i/18) */
//more accurate but slower
int64_t t0, t1, t2, t3;
t2 = in1[2*4] + in1[2*8] - in1[2*2];
-
+
t3 = (in1[2*0] + (int64_t)(in1[2*6]>>1))<<32;
t1 = in1[2*0] - in1[2*6];
tmp1[ 6] = t1 - (t2>>1);
t0 = MUL64(2*(in1[2*2] + in1[2*4]), C2);
t1 = MUL64( in1[2*4] - in1[2*8] , -2*C8);
t2 = MUL64(2*(in1[2*2] + in1[2*8]), -C4);
-
+
tmp1[10] = (t3 - t0 - t2) >> 32;
tmp1[ 2] = (t3 + t0 + t1) >> 32;
tmp1[14] = (t3 + t2 - t1) >> 32;
-
+
tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3);
t2 = MUL64(2*(in1[2*1] + in1[2*5]), C1);
t3 = MUL64( in1[2*5] - in1[2*7] , -2*C7);
tmp1[ 8] = (t3 - t1 - t0) >> 32;
#else
t2 = in1[2*4] + in1[2*8] - in1[2*2];
-
+
t3 = in1[2*0] + (in1[2*6]>>1);
t1 = in1[2*0] - in1[2*6];
tmp1[ 6] = t1 - (t2>>1);
t0 = MULH(2*(in1[2*2] + in1[2*4]), C2);
t1 = MULH( in1[2*4] - in1[2*8] , -2*C8);
t2 = MULH(2*(in1[2*2] + in1[2*8]), -C4);
-
+
tmp1[10] = t3 - t0 - t2;
tmp1[ 2] = t3 + t0 + t1;
tmp1[14] = t3 + t2 - t1;
-
+
tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3);
t2 = MULH(2*(in1[2*1] + in1[2*5]), C1);
t3 = MULH( in1[2*5] - in1[2*7] , -2*C7);
t3 = tmp[i + 3];
s1 = MULL(t3 + t2, icos36[j]);
s3 = MULL(t3 - t2, icos36[8 - j]);
-
+
t0 = s0 + s1;
t1 = s0 - s1;
out[(9 + j)*SBLIMIT] = MULH(t1, win[9 + j]) + buf[9 + j];
out[(8 - j)*SBLIMIT] = MULH(t1, win[8 - j]) + buf[8 - j];
buf[9 + j] = MULH(t0, win[18 + 9 + j]);
buf[8 - j] = MULH(t0, win[18 + 8 - j]);
-
+
t0 = s2 + s3;
t1 = s2 - s3;
out[(9 + 8 - j)*SBLIMIT] = MULH(t1, win[9 + 8 - j]) + buf[9 + 8 - j];
s->lsf = 1;
mpeg25 = 1;
}
-
+
s->layer = 4 - ((header >> 17) & 3);
/* extract frequency */
sample_rate_index = (header >> 10) & 3;
s->nb_channels = 1;
else
s->nb_channels = 2;
-
+
if (bitrate_index != 0) {
frame_size = mpa_bitrate_tab[s->lsf][s->layer - 1][bitrate_index];
s->bit_rate = frame_size * 1000;
break;
}
}
-
+
#if defined(DEBUG)
printf("layer%d, %d Hz, %d kbits/s, ",
s->layer, s->sample_rate, s->bit_rate);
uint8_t allocation[MPA_MAX_CHANNELS][SBLIMIT];
uint8_t scale_factors[MPA_MAX_CHANNELS][SBLIMIT];
- if (s->mode == MPA_JSTEREO)
+ if (s->mode == MPA_JSTEREO)
bound = (s->mode_ext + 1) * 4;
else
bound = SBLIMIT;
scale_factors[1][i] = get_bits(&s->gb, 6);
}
}
-
+
/* compute samples */
for(j=0;j<12;j++) {
for(i=0;i<bound;i++) {
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf)
{
int ch_bitrate, table;
-
+
ch_bitrate = bitrate / nb_channels;
if (!lsf) {
if ((freq == 48000 && ch_bitrate >= 56) ||
- (ch_bitrate >= 56 && ch_bitrate <= 80))
+ (ch_bitrate >= 56 && ch_bitrate <= 80))
table = 0;
- else if (freq != 48000 && ch_bitrate >= 96)
+ else if (freq != 48000 && ch_bitrate >= 96)
table = 1;
- else if (freq != 32000 && ch_bitrate <= 48)
+ else if (freq != 32000 && ch_bitrate <= 48)
table = 2;
- else
+ else
table = 3;
} else {
table = 4;
int scale, qindex, bits, steps, k, l, m, b;
/* select decoding table */
- table = l2_select_table(s->bit_rate / 1000, s->nb_channels,
+ table = l2_select_table(s->bit_rate / 1000, s->nb_channels,
s->sample_rate, s->lsf);
sblimit = sblimit_table[table];
alloc_table = alloc_tables[table];
- if (s->mode == MPA_JSTEREO)
+ if (s->mode == MPA_JSTEREO)
bound = (s->mode_ext + 1) * 4;
else
bound = sblimit;
/* scale codes */
for(i=0;i<sblimit;i++) {
for(ch=0;ch<s->nb_channels;ch++) {
- if (bit_alloc[ch][i])
+ if (bit_alloc[ch][i])
scale_code[ch][i] = get_bits(&s->gb, 2);
}
}
-
+
/* scale factors */
for(i=0;i<sblimit;i++) {
for(ch=0;ch<s->nb_channels;ch++) {
/* 3 values at the same time */
v = get_bits(&s->gb, -bits);
steps = quant_steps[qindex];
- s->sb_samples[ch][k * 12 + l + 0][i] =
+ s->sb_samples[ch][k * 12 + l + 0][i] =
l2_unscale_group(steps, v % steps, scale);
v = v / steps;
- s->sb_samples[ch][k * 12 + l + 1][i] =
+ s->sb_samples[ch][k * 12 + l + 1][i] =
l2_unscale_group(steps, v % steps, scale);
v = v / steps;
- s->sb_samples[ch][k * 12 + l + 2][i] =
+ s->sb_samples[ch][k * 12 + l + 2][i] =
l2_unscale_group(steps, v, scale);
} else {
for(m=0;m<3;m++) {
}
}
/* next subband in alloc table */
- j += 1 << bit_alloc_bits;
+ j += 1 << bit_alloc_bits;
}
/* XXX: find a way to avoid this duplication of code */
for(i=bound;i<sblimit;i++) {
steps = quant_steps[qindex];
mant = v % steps;
v = v / steps;
- s->sb_samples[0][k * 12 + l + 0][i] =
+ s->sb_samples[0][k * 12 + l + 0][i] =
l2_unscale_group(steps, mant, scale0);
- s->sb_samples[1][k * 12 + l + 0][i] =
+ s->sb_samples[1][k * 12 + l + 0][i] =
l2_unscale_group(steps, mant, scale1);
mant = v % steps;
v = v / steps;
- s->sb_samples[0][k * 12 + l + 1][i] =
+ s->sb_samples[0][k * 12 + l + 1][i] =
l2_unscale_group(steps, mant, scale0);
- s->sb_samples[1][k * 12 + l + 1][i] =
+ s->sb_samples[1][k * 12 + l + 1][i] =
l2_unscale_group(steps, mant, scale1);
- s->sb_samples[0][k * 12 + l + 2][i] =
+ s->sb_samples[0][k * 12 + l + 2][i] =
l2_unscale_group(steps, v, scale0);
- s->sb_samples[1][k * 12 + l + 2][i] =
+ s->sb_samples[1][k * 12 + l + 2][i] =
l2_unscale_group(steps, v, scale1);
} else {
for(m=0;m<3;m++) {
mant = get_bits(&s->gb, bits);
- s->sb_samples[0][k * 12 + l + m][i] =
+ s->sb_samples[0][k * 12 + l + m][i] =
l1_unscale(bits - 1, mant, scale0);
- s->sb_samples[1][k * 12 + l + m][i] =
+ s->sb_samples[1][k * 12 + l + m][i] =
l1_unscale(bits - 1, mant, scale1);
}
}
s->sb_samples[1][k * 12 + l + 2][i] = 0;
}
/* next subband in alloc table */
- j += 1 << bit_alloc_bits;
+ j += 1 << bit_alloc_bits;
}
/* fill remaining samples to zero */
for(i=sblimit;i<SBLIMIT;i++) {
/* copy old data before current one */
ptr -= backstep;
- memcpy(ptr, s->inbuf1[s->inbuf_index ^ 1] +
+ memcpy(ptr, s->inbuf1[s->inbuf_index ^ 1] +
BACKSTEP_SIZE + s->old_frame_size - backstep, backstep);
/* init get bits again */
init_get_bits(&s->gb, ptr, (s->frame_size + backstep)*8);
slen[0] = sf;
}
-static void exponents_from_scale_factors(MPADecodeContext *s,
+static void exponents_from_scale_factors(MPADecodeContext *s,
GranuleDef *g,
int16_t *exponents)
{
x = 0;
y = 0;
}
- dprintf("region=%d n=%d x=%d y=%d exp=%d\n",
+ dprintf("region=%d n=%d x=%d y=%d exp=%d\n",
i, g->region_size[i] - j, x, y, exponents[s_index]);
if (x) {
if (x == 15)
g->sb_hybrid[s_index++] = v;
}
}
-
+
/* high frequencies */
vlc = &huff_quad_vlc[g->count1table_select];
last_gb.buffer = NULL;
} else {
ptr = g->sb_hybrid;
}
-
+
for(i=g->short_start;i<13;i++) {
len = band_size_short[s->sample_rate_index][i];
ptr1 = ptr;
is_tab = is_table_lsf[g1->scalefac_compress & 1];
sf_max = 16;
}
-
+
tab0 = g0->sb_hybrid + 576;
tab1 = g1->sb_hybrid + 576;
}
}
- non_zero_found = non_zero_found_short[0] |
- non_zero_found_short[1] |
+ non_zero_found = non_zero_found_short[0] |
+ non_zero_found_short[1] |
non_zero_found_short[2];
for(i = g1->long_end - 1;i >= 0;i--) {
} else {
n = SBLIMIT - 1;
}
-
+
ptr = g->sb_hybrid + 18;
for(i = n;i > 0;i--) {
int tmp0, tmp1, tmp2;
INT_AA(5)
INT_AA(6)
INT_AA(7)
-
- ptr += 18;
+
+ ptr += 18;
}
}
} else {
n = SBLIMIT - 1;
}
-
+
ptr = g->sb_hybrid + 18;
for(i = n;i > 0;i--) {
float tmp0, tmp1;
- float *csa = &csa_table_float[0][0];
+ float *csa = &csa_table_float[0][0];
#define FLOAT_AA(j)\
tmp0= ptr[-1-j];\
tmp1= ptr[ j];\
ptr[-1-j] = lrintf(tmp0 * csa[0+4*j] - tmp1 * csa[1+4*j]);\
ptr[ j] = lrintf(tmp0 * csa[1+4*j] + tmp1 * csa[0+4*j]);
-
+
FLOAT_AA(0)
FLOAT_AA(1)
FLOAT_AA(2)
FLOAT_AA(6)
FLOAT_AA(7)
- ptr += 18;
+ ptr += 18;
}
}
static void compute_imdct(MPADecodeContext *s,
- GranuleDef *g,
+ GranuleDef *g,
int32_t *sb_samples,
int32_t *mdct_buf)
{
/* select frequency inversion */
win = mdct_win[2] + ((4 * 36) & -(j & 1));
out_ptr = sb_samples + j;
-
+
for(i=0; i<6; i++){
*out_ptr = buf[i];
out_ptr += SBLIMIT;
char buf[512];
int i;
int32_t v;
-
+
f = files[fnum];
if (!f) {
- snprintf(buf, sizeof(buf), "/tmp/out%d.%s.pcm",
- fnum,
+ snprintf(buf, sizeof(buf), "/tmp/out%d.%s.pcm",
+ fnum,
#ifdef USE_HIGHPRECISION
"hp"
#else
return;
files[fnum] = f;
}
-
+
if (fnum == 0) {
static int pos = 0;
av_log(NULL, AV_LOG_DEBUG, "pos=%d\n", pos);
granules[ch][1].scfsi = get_bits(&s->gb, 4);
}
}
-
+
for(gr=0;gr<nb_granules;gr++) {
for(ch=0;ch<s->nb_channels;ch++) {
dprintf("gr=%d ch=%d: side_info\n", gr, ch);
g->global_gain = get_bits(&s->gb, 8);
/* if MS stereo only is selected, we precompute the
1/sqrt(2) renormalization factor */
- if ((s->mode_ext & (MODE_EXT_MS_STEREO | MODE_EXT_I_STEREO)) ==
+ if ((s->mode_ext & (MODE_EXT_MS_STEREO | MODE_EXT_I_STEREO)) ==
MODE_EXT_MS_STEREO)
g->global_gain -= 2;
if (s->lsf)
g->switch_point = get_bits(&s->gb, 1);
for(i=0;i<2;i++)
g->table_select[i] = get_bits(&s->gb, 5);
- for(i=0;i<3;i++)
+ for(i=0;i<3;i++)
g->subblock_gain[i] = get_bits(&s->gb, 3);
/* compute huffman coded region sizes */
if (g->block_type == 2)
g->region_size[0] = (36 / 2);
else {
- if (s->sample_rate_index <= 2)
+ if (s->sample_rate_index <= 2)
g->region_size[0] = (36 / 2);
- else if (s->sample_rate_index != 8)
+ else if (s->sample_rate_index != 8)
g->region_size[0] = (54 / 2);
else
g->region_size[0] = (108 / 2);
/* compute huffman coded region sizes */
region_address1 = get_bits(&s->gb, 4);
region_address2 = get_bits(&s->gb, 3);
- dprintf("region1=%d region2=%d\n",
+ dprintf("region1=%d region2=%d\n",
region_address1, region_address2);
- g->region_size[0] =
+ g->region_size[0] =
band_index_long[s->sample_rate_index][region_address1 + 1] >> 1;
l = region_address1 + region_address2 + 2;
/* should not overflow */
if (l > 22)
l = 22;
- g->region_size[1] =
+ g->region_size[1] =
band_index_long[s->sample_rate_index][l] >> 1;
}
/* convert region offsets to region sizes and truncate
g->long_end = 6;
else
g->long_end = 4; /* 8000 Hz */
-
+
if (s->sample_rate_index != 8)
g->short_start = 3;
else
- g->short_start = 2;
+ g->short_start = 2;
} else {
g->long_end = 0;
g->short_start = 0;
g->short_start = 13;
g->long_end = 22;
}
-
+
g->preflag = 0;
if (!s->lsf)
g->preflag = get_bits(&s->gb, 1);
for(gr=0;gr<nb_granules;gr++) {
for(ch=0;ch<s->nb_channels;ch++) {
g = &granules[ch][gr];
-
+
bits_pos = get_bits_count(&s->gb);
-
+
if (!s->lsf) {
uint8_t *sc;
int slen, slen1, slen2;
}
#if defined(DEBUG)
{
- printf("scfsi=%x gr=%d ch=%d scale_factors:\n",
+ printf("scfsi=%x gr=%d ch=%d scale_factors:\n",
g->scfsi, gr, ch);
for(i=0;i<j;i++)
printf(" %d", g->scale_factors[i]);
g->scale_factors[j] = 0;
#if defined(DEBUG)
{
- printf("gr=%d ch=%d scale_factors:\n",
+ printf("gr=%d ch=%d scale_factors:\n",
gr, ch);
for(i=0;i<40;i++)
printf(" %d", g->scale_factors[i]);
#if defined(DEBUG)
sample_dump(1, g->sb_hybrid, 576);
#endif
- compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);
+ compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);
#if defined(DEBUG)
sample_dump(2, &s->sb_samples[ch][18 * gr][0], 576);
#endif
return nb_granules * 18;
}
-static int mp_decode_frame(MPADecodeContext *s,
+static int mp_decode_frame(MPADecodeContext *s,
OUT_INT *samples)
{
int i, nb_frames, ch;
OUT_INT *samples_ptr;
- init_get_bits(&s->gb, s->inbuf + HEADER_SIZE,
+ init_get_bits(&s->gb, s->inbuf + HEADER_SIZE,
(s->inbuf_ptr - s->inbuf - HEADER_SIZE)*8);
-
+
/* skip error protection field */
if (s->error_protection)
get_bits(&s->gb, 16);
}
}
#ifdef DEBUG
- s->frame_count++;
+ s->frame_count++;
#endif
return nb_frames * 32 * sizeof(OUT_INT) * s->nb_channels;
}
s->free_format_frame_size -= padding * 4;
else
s->free_format_frame_size -= padding;
- dprintf("free frame size=%d padding=%d\n",
+ dprintf("free frame size=%d padding=%d\n",
s->free_format_frame_size, padding);
decode_header(s, header1);
goto next_data;
buf_size -= len;
}
next_data:
- if (s->frame_size > 0 &&
+ if (s->frame_size > 0 &&
(s->inbuf_ptr - s->inbuf) >= s->frame_size) {
if (avctx->parse_only) {
/* simply return the frame data */
/**
* @file mpegaudiodectab.h
- * mpeg audio layer decoder tables.
+ * mpeg audio layer decoder tables.
*/
const uint16_t mpa_bitrate_tab[2][3][15] = {
/* we use a negative value if grouped */
const int quant_bits[17] = {
- -5, -7, 3, -10, 4,
+ -5, -7, 3, -10, 4,
5, 6, 7, 8, 9,
10, 11, 12, 13, 14,
- 15, 16
+ 15, 16
};
/* encoding tables which give the quantization index. Note how it is
possible to store them efficiently ! */
static const unsigned char alloc_table_0[] = {
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
+ 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
};
static const unsigned char alloc_table_1[] = {
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 3, 0, 1, 2, 3, 4, 5, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
- 2, 0, 1, 16,
+ 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 4, 0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 3, 0, 1, 2, 3, 4, 5, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
+ 2, 0, 1, 16,
};
static const unsigned char alloc_table_2[] = {
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
+ 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
};
static const unsigned char alloc_table_3[] = {
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
+ 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 4, 0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
};
static const unsigned char alloc_table_4[] = {
4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 3, 0, 1, 3, 4, 5, 6, 7,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
- 2, 0, 1, 3,
-};
-
-const unsigned char *alloc_tables[5] =
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 3, 0, 1, 3, 4, 5, 6, 7,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+ 2, 0, 1, 3,
+};
+
+const unsigned char *alloc_tables[5] =
{ alloc_table_0, alloc_table_1, alloc_table_2, alloc_table_3, alloc_table_4, };
/*******************************************************/
{ { 6, 5, 5, 5 }, { 9, 9, 9, 9 }, { 6, 9, 9, 9 } },
{ { 6, 5, 7, 3 }, { 9, 9, 12, 6 }, { 6, 9, 12, 6 } },
{ { 11, 10, 0, 0 }, { 18, 18, 0, 0 }, { 15, 18, 0, 0 } },
- { { 7, 7, 7, 0 }, { 12, 12, 12, 0 }, { 6, 15, 12, 0 } },
+ { { 7, 7, 7, 0 }, { 12, 12, 12, 0 }, { 6, 15, 12, 0 } },
{ { 6, 6, 6, 3 }, { 12, 9, 9, 6 }, { 6, 12, 9, 6 } },
{ { 8, 8, 5, 0 }, { 15, 12, 9, 0 }, { 6, 18, 9, 0 } },
};
/*
* mpeg audio layer 2 tables. Most of them come from the mpeg audio
* specification.
- *
+ *
* Copyright (c) 2000, 2001 Fabrice Bellard.
*
* The licence of this code is contained in file LICENCE found in the
- * same archive
+ * same archive
*/
/**
* @file mpegaudiotab.h
- * mpeg audio layer 2 tables.
+ * mpeg audio layer 2 tables.
* Most of them come from the mpeg audio specification.
*/
-
+
#define SQRT2 1.41421356237309514547
static const int costab32[30] = {
FIX(0.54119610014619701222),
FIX(1.3065629648763763537),
-
+
FIX(0.50979557910415917998),
FIX(2.5629154477415054814),
FIX(0.89997622313641556513),
FIX(0.60134488693504528634),
-
+
FIX(0.5024192861881556782),
FIX(5.1011486186891552563),
FIX(0.78815462345125020249),
FIX(1.0606776859903470633),
FIX(1.7224470982383341955),
FIX(0.52249861493968885462),
-
+
FIX(10.19000812354803287),
FIX(0.674808341455005678),
FIX(1.1694399334328846596),
static unsigned short total_quant_bits[17];
/* signal to noise ratio of each quantification step (could be
- computed from quant_steps[]). The values are dB multiplied by 10
+ computed from quant_steps[]). The values are dB multiplied by 10
*/
-static const unsigned short quant_snr[17] = {
+static const unsigned short quant_snr[17] = {
70, 110, 160, 208,
253, 316, 378, 439,
- 499, 559, 620, 680,
- 740, 800, 861, 920,
+ 499, 559, 620, 680,
+ 740, 800, 861, 920,
980
};
*
* 4MV & hq & b-frame encoding stuff by Michael Niedermayer <michaelni@gmx.at>
*/
-
+
/**
* @file mpegvideo.c
* The simplest mpeg encoder (well, it was the simplest!).
- */
-
+ */
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#ifdef CONFIG_ENCODERS
static void encode_picture(MpegEncContext *s, int picture_number);
#endif //CONFIG_ENCODERS
-static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
+static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
-static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
+static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
-static void dct_unquantize_h263_intra_c(MpegEncContext *s,
+static void dct_unquantize_h263_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
-static void dct_unquantize_h263_inter_c(MpegEncContext *s,
+static void dct_unquantize_h263_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
static void draw_edges_c(uint8_t *buf, int wrap, int width, int height, int w);
#ifdef CONFIG_ENCODERS
for(qscale=qmin; qscale<=qmax; qscale++){
int i;
- if (dsp->fdct == ff_jpeg_fdct_islow
+ if (dsp->fdct == ff_jpeg_fdct_islow
#ifdef FAAN_POSTSCALE
|| dsp->fdct == ff_faandct
#endif
/* 19952 <= aanscales[i] * qscale * quant_matrix[i] <= 249205026 */
/* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */
/* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */
-
- qmat[qscale][i] = (int)((uint64_t_C(1) << QMAT_SHIFT) /
+
+ qmat[qscale][i] = (int)((uint64_t_C(1) << QMAT_SHIFT) /
(qscale * quant_matrix[j]));
}
} else if (dsp->fdct == fdct_ifast
/* 19952 <= aanscales[i] * qscale * quant_matrix[i] <= 249205026 */
/* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */
/* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */
-
- qmat[qscale][i] = (int)((uint64_t_C(1) << (QMAT_SHIFT + 14)) /
+
+ qmat[qscale][i] = (int)((uint64_t_C(1) << (QMAT_SHIFT + 14)) /
(aanscales[i] * qscale * quant_matrix[j]));
}
} else {
qmat16[qscale][1][i]= ROUNDED_DIV(bias<<(16-QUANT_BIAS_SHIFT), qmat16[qscale][0][i]);
}
}
-
+
for(i=intra; i<64; i++){
int64_t max= 8191;
if (dsp->fdct == fdct_ifast
) {
max= (8191LL*aanscales[i]) >> 14;
}
- while(((max * qmat[qscale][i]) >> shift) > INT_MAX){
+ while(((max * qmat[qscale][i]) >> shift) > INT_MAX){
shift++;
}
}
static inline void update_qscale(MpegEncContext *s){
s->qscale= (s->lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
s->qscale= clip(s->qscale, s->avctx->qmin, s->avctx->qmax);
-
+
s->lambda2= (s->lambda*s->lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT;
}
#endif //CONFIG_ENCODERS
void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable){
int i;
int end;
-
+
st->scantable= src_scantable;
for(i=0; i<64; i++){
st->inverse[j] = i;
#endif
}
-
+
end=-1;
for(i=0; i<64; i++){
int j;
s->dct_quantize= dct_quantize_c;
s->denoise_dct= denoise_dct_c;
#endif //CONFIG_ENCODERS
-
+
#ifdef HAVE_MMX
MPV_common_init_mmx(s);
#endif
#endif //CONFIG_ENCODERS
/* load & permutate scantables
- note: only wmv uses different ones
+ note: only wmv uses different ones
*/
if(s->alternate_scan){
ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_alternate_vertical_scan);
src->motion_subsample_log2, dst->motion_subsample_log2);
memcpy(dst->mb_type, src->mb_type, s->mb_stride * s->mb_height * sizeof(dst->mb_type[0]));
-
+
for(i=0; i<2; i++){
int stride= ((16*s->mb_width )>>src->motion_subsample_log2) + 1;
int height= ((16*s->mb_height)>>src->motion_subsample_log2);
const int b8_array_size= s->b8_stride*s->mb_height*2;
const int b4_array_size= s->b4_stride*s->mb_height*4;
int i;
-
+
if(shared){
assert(pic->data[0]);
assert(pic->type == 0 || pic->type == FF_BUFFER_TYPE_SHARED);
pic->type= FF_BUFFER_TYPE_SHARED;
}else{
int r;
-
+
assert(!pic->data[0]);
-
+
r= s->avctx->get_buffer(s->avctx, (AVFrame*)pic);
-
+
if(r<0 || !pic->age || !pic->type || !pic->data[0]){
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (%d %d %d %p)\n", r, pic->age, pic->type, pic->data[0]);
return -1;
s->linesize = pic->linesize[0];
s->uvlinesize= pic->linesize[1];
}
-
+
if(pic->qscale_table==NULL){
- if (s->encoding) {
+ if (s->encoding) {
CHECKED_ALLOCZ(pic->mb_var , mb_array_size * sizeof(int16_t))
CHECKED_ALLOCZ(pic->mc_mb_var, mb_array_size * sizeof(int16_t))
CHECKED_ALLOCZ(pic->mb_mean , mb_array_size * sizeof(int8_t))
s->prev_pict_types[0]= s->pict_type;
if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == B_TYPE)
pic->age= INT_MAX; // skipped MBs in b frames are quite rare in mpeg1/2 and its a bit tricky to skip them anyway
-
+
return 0;
fail: //for the CHECKED_ALLOCZ macro
return -1;
av_freep(&pic->motion_val_base[i]);
av_freep(&pic->ref_index[i]);
}
-
+
if(pic->type == FF_BUFFER_TYPE_SHARED){
for(i=0; i<4; i++){
pic->base[i]=
pic->data[i]= NULL;
}
- pic->type= 0;
+ pic->type= 0;
}
}
static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base){
int i;
- // edge emu needs blocksize + filter length - 1 (=17x17 for halfpel / 21x21 for h264)
+ // edge emu needs blocksize + filter length - 1 (=17x17 for halfpel / 21x21 for h264)
CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*17*2); //(width + edge + align)*interlaced*MBsize*tolerance
s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*17;
//FIXME should be linesize instead of s->width*2 but that isnt known before get_buffer()
- CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t))
+ CHECKED_ALLOCZ(s->me.scratchpad, (s->width+64)*4*16*2*sizeof(uint8_t))
s->rd_scratchpad= s->me.scratchpad;
s->b_scratchpad= s->me.scratchpad;
s->obmc_scratchpad= s->me.scratchpad + 16;
if(s->avctx->noise_reduction){
CHECKED_ALLOCZ(s->dct_error_sum, 2 * 64 * sizeof(int))
}
- }
+ }
CHECKED_ALLOCZ(s->blocks, 64*12*2 * sizeof(DCTELEM))
s->block= s->blocks[0];
av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL;
av_freep(&s->me.scratchpad);
- s->rd_scratchpad=
- s->b_scratchpad=
+ s->rd_scratchpad=
+ s->b_scratchpad=
s->obmc_scratchpad= NULL;
-
+
av_freep(&s->dct_error_sum);
av_freep(&s->me.map);
av_freep(&s->me.score_map);
#ifdef CONFIG_ENCODERS
static void MPV_encode_defaults(MpegEncContext *s){
static int done=0;
-
+
MPV_common_defaults(s);
-
+
if(!done){
int i;
done=1;
}
#endif //CONFIG_ENCODERS
-/**
+/**
* init common structure for both encoder and decoder.
* this assumes that some variables like width/height are already set
*/
s->v_edge_pos= s->mb_height*16;
s->mb_num = s->mb_width * s->mb_height;
-
+
s->block_wrap[0]=
s->block_wrap[1]=
s->block_wrap[2]=
s->block_wrap[3]= s->b8_stride;
s->block_wrap[4]=
s->block_wrap[5]= s->mb_stride;
-
+
y_size = s->b8_stride * (2 * s->mb_height + 1);
c_size = s->mb_stride * (s->mb_height + 1);
yc_size = y_size + 2 * c_size;
-
+
/* convert fourcc to upper case */
- s->avctx->codec_tag= toupper( s->avctx->codec_tag &0xFF)
+ s->avctx->codec_tag= toupper( s->avctx->codec_tag &0xFF)
+ (toupper((s->avctx->codec_tag>>8 )&0xFF)<<8 )
- + (toupper((s->avctx->codec_tag>>16)&0xFF)<<16)
+ + (toupper((s->avctx->codec_tag>>16)&0xFF)<<16)
+ (toupper((s->avctx->codec_tag>>24)&0xFF)<<24);
- s->avctx->stream_codec_tag= toupper( s->avctx->stream_codec_tag &0xFF)
+ s->avctx->stream_codec_tag= toupper( s->avctx->stream_codec_tag &0xFF)
+ (toupper((s->avctx->stream_codec_tag>>8 )&0xFF)<<8 )
- + (toupper((s->avctx->stream_codec_tag>>16)&0xFF)<<16)
+ + (toupper((s->avctx->stream_codec_tag>>16)&0xFF)<<16)
+ (toupper((s->avctx->stream_codec_tag>>24)&0xFF)<<24);
s->avctx->coded_frame= (AVFrame*)&s->current_picture;
}
}
s->mb_index2xy[ s->mb_height*s->mb_width ] = (s->mb_height-1)*s->mb_stride + s->mb_width; //FIXME really needed?
-
+
if (s->encoding) {
/* Allocate MV tables */
CHECKED_ALLOCZ(s->p_mv_table_base , mv_table_size * 2 * sizeof(int16_t))
/* Allocate MB type table */
CHECKED_ALLOCZ(s->mb_type , mb_array_size * sizeof(uint16_t)) //needed for encoding
-
+
CHECKED_ALLOCZ(s->lambda_table, mb_array_size * sizeof(int))
-
+
CHECKED_ALLOCZ(s->q_intra_matrix, 64*32 * sizeof(int))
CHECKED_ALLOCZ(s->q_inter_matrix, 64*32 * sizeof(int))
CHECKED_ALLOCZ(s->q_intra_matrix16, 64*32*2 * sizeof(uint16_t))
CHECKED_ALLOCZ(s->q_inter_matrix16, 64*32*2 * sizeof(uint16_t))
CHECKED_ALLOCZ(s->input_picture, MAX_PICTURE_COUNT * sizeof(Picture*))
CHECKED_ALLOCZ(s->reordered_input_picture, MAX_PICTURE_COUNT * sizeof(Picture*))
-
+
if(s->avctx->noise_reduction){
CHECKED_ALLOCZ(s->dct_offset, 2 * 64 * sizeof(uint16_t))
}
CHECKED_ALLOCZ(s->picture, MAX_PICTURE_COUNT * sizeof(Picture))
CHECKED_ALLOCZ(s->error_status_table, mb_array_size*sizeof(uint8_t))
-
+
if(s->codec_id==CODEC_ID_MPEG4 || (s->flags & CODEC_FLAG_INTERLACED_ME)){
/* interlaced direct mode decoding tables */
for(i=0; i<2; i++){
s->ac_val[0] = s->ac_val_base + s->b8_stride + 1;
s->ac_val[1] = s->ac_val_base + y_size + s->mb_stride + 1;
s->ac_val[2] = s->ac_val[1] + c_size;
-
+
/* cbp values */
CHECKED_ALLOCZ(s->coded_block_base, y_size);
s->coded_block= s->coded_block_base + s->b8_stride + 1;
-
+
/* cbp, ac_pred, pred_dir */
CHECKED_ALLOCZ(s->cbp_table , mb_array_size * sizeof(uint8_t))
CHECKED_ALLOCZ(s->pred_dir_table, mb_array_size * sizeof(uint8_t))
}
-
+
if (s->h263_pred || s->h263_plus || !s->encoding) {
/* dc values */
//MN: we need these for error resilience of intra-frames
/* which mb is a intra block */
CHECKED_ALLOCZ(s->mbintra_table, mb_array_size);
memset(s->mbintra_table, 1, mb_array_size);
-
+
/* init macroblock skip table */
CHECKED_ALLOCZ(s->mbskip_table, mb_array_size+2);
//Note the +1 is for a quicker mpeg4 slice_end detection
CHECKED_ALLOCZ(s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE);
-
+
s->parse_context.state= -1;
if((s->avctx->debug&(FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) || (s->avctx->debug_mv)){
s->visualization_buffer[0] = av_malloc((s->mb_width*16 + 2*EDGE_WIDTH) * s->mb_height*16 + 2*EDGE_WIDTH);
}
av_freep(&s->p_field_select_table[i]);
}
-
+
av_freep(&s->dc_val_base);
av_freep(&s->ac_val_base);
av_freep(&s->coded_block_base);
av_freep(&s->mbintra_table);
av_freep(&s->cbp_table);
av_freep(&s->pred_dir_table);
-
+
av_freep(&s->mbskip_table);
av_freep(&s->prev_pict_types);
av_freep(&s->bitstream_buffer);
MpegEncContext *s = avctx->priv_data;
int i;
int chroma_h_shift, chroma_v_shift;
-
+
MPV_encode_defaults(s);
if(avctx->pix_fmt != PIX_FMT_YUVJ420P && avctx->pix_fmt != PIX_FMT_YUV420P){
/* Fixed QSCALE */
s->fixed_qscale = !!(avctx->flags & CODEC_FLAG_QSCALE);
-
+
s->adaptive_quant= ( s->avctx->lumi_masking
|| s->avctx->dark_masking
- || s->avctx->temporal_cplx_masking
+ || s->avctx->temporal_cplx_masking
|| s->avctx->spatial_cplx_masking
|| s->avctx->p_masking
|| s->avctx->border_masking
|| (s->flags&CODEC_FLAG_QP_RD))
&& !s->fixed_qscale;
-
+
s->obmc= !!(s->flags & CODEC_FLAG_OBMC);
s->loop_filter= !!(s->flags & CODEC_FLAG_LOOP_FILTER);
s->alternate_scan= !!(s->flags & CODEC_FLAG_ALT_SCAN);
if(avctx->rc_max_rate && !avctx->rc_buffer_size){
av_log(avctx, AV_LOG_ERROR, "a vbv buffer size is needed, for encoding with a maximum bitrate\n");
return -1;
- }
+ }
if(avctx->rc_min_rate && avctx->rc_max_rate != avctx->rc_min_rate){
av_log(avctx, AV_LOG_INFO, "Warning min_rate > 0 but min_rate != max_rate isn't recommended!\n");
}
-
+
if(avctx->rc_min_rate && avctx->rc_min_rate > avctx->bit_rate){
av_log(avctx, AV_LOG_INFO, "bitrate below min bitrate\n");
return -1;
}
-
+
if(avctx->rc_max_rate && avctx->rc_max_rate < avctx->bit_rate){
av_log(avctx, AV_LOG_INFO, "bitrate above max bitrate\n");
return -1;
}
-
- if( s->avctx->rc_max_rate && s->avctx->rc_min_rate == s->avctx->rc_max_rate
+
+ if( s->avctx->rc_max_rate && s->avctx->rc_min_rate == s->avctx->rc_max_rate
&& (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO)
&& 90000LL * (avctx->rc_buffer_size-1) > s->avctx->rc_max_rate*0xFFFFLL){
-
+
av_log(avctx, AV_LOG_INFO, "Warning vbv_delay will be set to 0xFFFF (=VBR) as the specified vbv buffer is too large for the given bitrate!\n");
}
-
- if((s->flags & CODEC_FLAG_4MV) && s->codec_id != CODEC_ID_MPEG4
+
+ if((s->flags & CODEC_FLAG_4MV) && s->codec_id != CODEC_ID_MPEG4
&& s->codec_id != CODEC_ID_H263 && s->codec_id != CODEC_ID_H263P && s->codec_id != CODEC_ID_FLV1){
av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n");
return -1;
}
-
+
if(s->obmc && s->avctx->mb_decision != FF_MB_DECISION_SIMPLE){
av_log(avctx, AV_LOG_ERROR, "OBMC is only supported with simple mb decision\n");
return -1;
}
-
+
if(s->obmc && s->codec_id != CODEC_ID_H263 && s->codec_id != CODEC_ID_H263P){
av_log(avctx, AV_LOG_ERROR, "OBMC is only supported with H263(+)\n");
return -1;
}
-
+
if(s->quarter_sample && s->codec_id != CODEC_ID_MPEG4){
av_log(avctx, AV_LOG_ERROR, "qpel not supported by codec\n");
return -1;
av_log(avctx, AV_LOG_ERROR, "data partitioning not supported by codec\n");
return -1;
}
-
+
if(s->max_b_frames && s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG1VIDEO && s->codec_id != CODEC_ID_MPEG2VIDEO){
av_log(avctx, AV_LOG_ERROR, "b frames not supported by codec\n");
return -1;
}
- if((s->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME|CODEC_FLAG_ALT_SCAN))
+ if((s->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME|CODEC_FLAG_ALT_SCAN))
&& s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO){
av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
return -1;
}
-
+
if(s->mpeg_quant && s->codec_id != CODEC_ID_MPEG4){ //FIXME mpeg2 uses that too
av_log(avctx, AV_LOG_ERROR, "mpeg2 style quantization not supported by codec\n");
return -1;
}
-
+
if((s->flags & CODEC_FLAG_CBP_RD) && !(s->flags & CODEC_FLAG_TRELLIS_QUANT)){
av_log(avctx, AV_LOG_ERROR, "CBP RD needs trellis quant\n");
return -1;
av_log(avctx, AV_LOG_ERROR, "QP RD needs mbd=2\n");
return -1;
}
-
+
if(s->avctx->scenechange_threshold < 1000000000 && (s->flags & CODEC_FLAG_CLOSED_GOP)){
av_log(avctx, AV_LOG_ERROR, "closed gop with scene change detection arent supported yet\n");
return -1;
}
-
- if(s->avctx->thread_count > 1 && s->codec_id != CODEC_ID_MPEG4
- && s->codec_id != CODEC_ID_MPEG1VIDEO && s->codec_id != CODEC_ID_MPEG2VIDEO
+
+ if(s->avctx->thread_count > 1 && s->codec_id != CODEC_ID_MPEG4
+ && s->codec_id != CODEC_ID_MPEG1VIDEO && s->codec_id != CODEC_ID_MPEG2VIDEO
&& (s->codec_id != CODEC_ID_H263P || !(s->flags & CODEC_FLAG_H263P_SLICE_STRUCT))){
av_log(avctx, AV_LOG_ERROR, "multi threaded encoding not supported by codec\n");
return -1;
}
-
+
if(s->avctx->thread_count > 1)
s->rtp_mode= 1;
av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
return -1;
}
-
+
i= (INT_MAX/2+128)>>8;
if(avctx->me_threshold >= i){
av_log(avctx, AV_LOG_ERROR, "me_threshold too large, max is %d\n", i - 1);
av_log(avctx, AV_LOG_ERROR, "mb_threshold too large, max is %d\n", i - 1);
return -1;
}
-
+
if(avctx->b_frame_strategy && (avctx->flags&CODEC_FLAG_PASS2)){
av_log(avctx, AV_LOG_ERROR, "b_frame_strategy must be 0 on the second pass");
return -1;
avctx->time_base.num /= i;
// return -1;
}
-
+
if(s->codec_id==CODEC_ID_MJPEG){
s->intra_quant_bias= 1<<(QUANT_BIAS_SHIFT-1); //(a + x/2)/x
s->inter_quant_bias= 0;
s->intra_quant_bias=0;
s->inter_quant_bias=-(1<<(QUANT_BIAS_SHIFT-2)); //(a - x/4)/x
}
-
+
if(avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
s->intra_quant_bias= avctx->intra_quant_bias;
if(avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)
s->inter_quant_bias= avctx->inter_quant_bias;
-
+
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, &chroma_v_shift);
if(avctx->codec_id == CODEC_ID_MPEG4 && s->avctx->time_base.den > (1<<16)-1){
av_log(avctx, AV_LOG_ERROR, "timebase not supported by mpeg 4 standard\n");
- return -1;
+ return -1;
}
s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1;
s->mjpeg_data_only_frames = 0; /* write all the needed headers */
s->mjpeg_vsample[0] = 1<<chroma_v_shift;
s->mjpeg_vsample[1] = 1;
- s->mjpeg_vsample[2] = 1;
+ s->mjpeg_vsample[2] = 1;
s->mjpeg_hsample[0] = 1<<chroma_h_shift;
- s->mjpeg_hsample[1] = 1;
- s->mjpeg_hsample[2] = 1;
+ s->mjpeg_hsample[1] = 1;
+ s->mjpeg_hsample[2] = 1;
if (mjpeg_init(s) < 0)
return -1;
avctx->delay=0;
default:
return -1;
}
-
+
avctx->has_b_frames= !s->low_delay;
s->encoding = 1;
if(s->modified_quant)
s->chroma_qscale_table= ff_h263_chroma_qscale_table;
- s->progressive_frame=
+ s->progressive_frame=
s->progressive_sequence= !(avctx->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME));
s->quant_precision=5;
-
+
ff_set_cmp(&s->dsp, s->dsp.ildct_cmp, s->avctx->ildct_cmp);
ff_set_cmp(&s->dsp, s->dsp.frame_skip_cmp, s->avctx->frame_skip_cmp);
-
+
#ifdef CONFIG_H261_ENCODER
if (s->out_format == FMT_H261)
ff_h261_encode_init(s);
/* precompute matrix */
/* for mjpeg, we do include qscale in the matrix */
if (s->out_format != FMT_MJPEG) {
- convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
+ convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
s->intra_matrix, s->intra_quant_bias, avctx->qmin, 31, 1);
- convert_matrix(&s->dsp, s->q_inter_matrix, s->q_inter_matrix16,
+ convert_matrix(&s->dsp, s->q_inter_matrix, s->q_inter_matrix16,
s->inter_matrix, s->inter_quant_bias, avctx->qmin, 31, 0);
}
if(ff_rate_control_init(s) < 0)
return -1;
-
+
return 0;
}
mjpeg_close(s);
av_freep(&avctx->extradata);
-
+
return 0;
}
int ff_find_unused_picture(MpegEncContext *s, int shared){
int i;
-
+
if(shared){
for(i=0; i<MAX_PICTURE_COUNT; i++){
if(s->picture[i].data[0]==NULL && s->picture[i].type==0) return i;
}
s->dct_count[intra] >>= 1;
}
-
+
for(i=0; i<64; i++){
s->dct_offset[intra][i]= (s->avctx->noise_reduction * s->dct_count[intra] + s->dct_error_sum[intra][i]/2) / (s->dct_error_sum[intra][i]+1);
}
for(i=0; i<MAX_PICTURE_COUNT; i++){
if(s->picture[i].data[0] && &s->picture[i] != s->next_picture_ptr && s->picture[i].reference){
av_log(avctx, AV_LOG_ERROR, "releasing zombie picture\n");
- avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]);
+ avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]);
}
}
}
&& !s->dropable ? 3 : 0;
pic->coded_picture_number= s->coded_picture_number++;
-
+
if( alloc_picture(s, (Picture*)pic, 0) < 0)
return -1;
}
s->current_picture_ptr->pict_type= s->pict_type;
-// if(s->flags && CODEC_FLAG_QSCALE)
+// if(s->flags && CODEC_FLAG_QSCALE)
// s->current_picture_ptr->quality= s->new_picture_ptr->quality;
s->current_picture_ptr->key_frame= s->pict_type == I_TYPE;
copy_picture(&s->current_picture, s->current_picture_ptr);
-
+
if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
if (s->pict_type != B_TYPE) {
s->last_picture_ptr= s->next_picture_ptr;
s->next_picture_ptr= s->current_picture_ptr;
}
/* av_log(s->avctx, AV_LOG_DEBUG, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n", s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
- s->last_picture_ptr ? s->last_picture_ptr->data[0] : NULL,
- s->next_picture_ptr ? s->next_picture_ptr->data[0] : NULL,
+ s->last_picture_ptr ? s->last_picture_ptr->data[0] : NULL,
+ s->next_picture_ptr ? s->next_picture_ptr->data[0] : NULL,
s->current_picture_ptr ? s->current_picture_ptr->data[0] : NULL,
s->pict_type, s->dropable);*/
-
+
if(s->last_picture_ptr) copy_picture(&s->last_picture, s->last_picture_ptr);
if(s->next_picture_ptr) copy_picture(&s->next_picture, s->next_picture_ptr);
-
+
if(s->pict_type != I_TYPE && (s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL)){
av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
assert(s->pict_type != B_TYPE); //these should have been dropped if we don't have a reference
for(i=0; i<4; i++){
if(s->picture_structure == PICT_BOTTOM_FIELD){
s->current_picture.data[i] += s->current_picture.linesize[i];
- }
+ }
s->current_picture.linesize[i] *= 2;
s->last_picture.linesize[i] *=2;
s->next_picture.linesize[i] *=2;
}
}
}
-
+
s->hurry_up= s->avctx->hurry_up;
s->error_resilience= avctx->error_resilience;
update_noise_reduction(s);
}
-
+
#ifdef HAVE_XVMC
if(s->avctx->xvmc_acceleration)
return XVMC_field_start(s, avctx);
draw_edges(s->current_picture.data[2], s->uvlinesize, s->h_edge_pos>>1, s->v_edge_pos>>1, EDGE_WIDTH/2);
}
emms_c();
-
+
s->last_pict_type = s->pict_type;
if(s->pict_type!=B_TYPE){
s->last_non_b_pict_type= s->pict_type;
if(s->picture[i].data[0] == s->current_picture.data[0]){
s->picture[i]= s->current_picture;
break;
- }
+ }
}
assert(i<MAX_PICTURE_COUNT);
-#endif
+#endif
if(s->encoding){
/* release non-reference frames */
*/
static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
int t, x, y, fr, f;
-
+
sx= clip(sx, 0, w-1);
sy= clip(sy, 0, h-1);
ex= clip(ex, 0, w-1);
ey= clip(ey, 0, h-1);
-
+
buf[sy*stride + sx]+= color;
-
+
if(ABS(ex - sx) > ABS(ey - sy)){
if(sx > ex){
t=sx; sx=ex; ex=t;
* @param stride stride/linesize of the image
* @param color color of the arrow
*/
-static void draw_arrow(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
+static void draw_arrow(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
int dx,dy;
sx= clip(sx, -100, w+100);
sy= clip(sy, -100, h+100);
ex= clip(ex, -100, w+100);
ey= clip(ey, -100, h+100);
-
+
dx= ex - sx;
dy= ey - sy;
-
+
if(dx*dx + dy*dy > 3*3){
int rx= dx + dy;
int ry= -dx + dy;
int length= ff_sqrt((rx*rx + ry*ry)<<8);
-
+
//FIXME subpixel accuracy
rx= ROUNDED_DIV(rx*3<<4, length);
ry= ROUNDED_DIV(ry*3<<4, length);
-
+
draw_line(buf, sx, sy, sx + rx, sy + ry, w, h, stride, color);
draw_line(buf, sx, sy, sx - ry, sy + rx, w, h, stride, color);
}
if(s->avctx->debug&(FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE)){
int x,y;
-
+
av_log(s->avctx,AV_LOG_DEBUG,"New frame, type: ");
switch (pict->pict_type) {
case FF_I_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"I\n"); break;
case FF_B_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"B\n"); break;
case FF_S_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"S\n"); break;
case FF_SI_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SI\n"); break;
- case FF_SP_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break;
+ case FF_SP_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break;
}
for(y=0; y<s->mb_height; y++){
for(x=0; x<s->mb_width; x++){
assert(USES_LIST(mb_type, 0) && USES_LIST(mb_type, 1));
av_log(s->avctx, AV_LOG_DEBUG, "X");
}
-
+
//segmentation
if(IS_8X8(mb_type))
av_log(s->avctx, AV_LOG_DEBUG, "+");
av_log(s->avctx, AV_LOG_DEBUG, " ");
else
av_log(s->avctx, AV_LOG_DEBUG, "?");
-
-
+
+
if(IS_INTERLACED(mb_type) && s->codec_id == CODEC_ID_H264)
av_log(s->avctx, AV_LOG_DEBUG, "=");
else
int xy= (mb_x*2 + (mb_y*2 + i)*mv_stride) << (mv_sample_log2-1);
int mx=(pict->motion_val[direction][xy][0]>>shift);
int my=(pict->motion_val[direction][xy][1]>>shift);
-
+
if(IS_INTERLACED(pict->mb_type[mb_index]))
my*=2;
-
+
draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
}
}else if(IS_8X16(pict->mb_type[mb_index])){
int xy= (mb_x*2 + i + mb_y*2*mv_stride) << (mv_sample_log2-1);
int mx=(pict->motion_val[direction][xy][0]>>shift);
int my=(pict->motion_val[direction][xy][1]>>shift);
-
+
if(IS_INTERLACED(pict->mb_type[mb_index]))
my*=2;
-
+
draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
}
}else{
int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
}
- }
+ }
}
if((s->avctx->debug&FF_DEBUG_VIS_QP) && pict->motion_val){
uint64_t c= (pict->qscale_table[mb_index]*128/31) * 0x0101010101010101ULL;
u= (int)(128 + r*cos(theta*3.141592/180));\
v= (int)(128 + r*sin(theta*3.141592/180));
-
+
u=v=128;
if(IS_PCM(mb_type)){
COLOR(120,48)
*(uint64_t*)(pict->data[0] + sx + (sy + 4)*pict->linesize[0])^= 0x8080808080808080ULL;
}
}
-
+
if(IS_INTERLACED(mb_type) && s->codec_id == CODEC_ID_H264){
// hmm
}
static int get_sae(uint8_t *src, int ref, int stride){
int x,y;
int acc=0;
-
+
for(y=0; y<16; y++){
for(x=0; x<16; x++){
acc+= ABS(src[x+y*stride] - ref);
}
}
-
+
return acc;
}
static int get_intra_count(MpegEncContext *s, uint8_t *src, uint8_t *ref, int stride){
int x, y, w, h;
int acc=0;
-
+
w= s->width &~15;
h= s->height&~15;
-
+
for(y=0; y<h; y+=16){
for(x=0; x<w; x+=16){
int offset= x + y*stride;
int sad = s->dsp.sad[0](NULL, src + offset, ref + offset, stride, 16);
int mean= (s->dsp.pix_sum(src + offset, stride) + 128)>>8;
int sae = get_sae(src + offset, mean, stride);
-
+
acc+= sae + 500 < sad;
}
}
int i;
const int encoding_delay= s->max_b_frames;
int direct=1;
-
+
if(pic_arg){
pts= pic_arg->pts;
pic_arg->display_picture_number= s->input_picture_number++;
- if(pts != AV_NOPTS_VALUE){
+ if(pts != AV_NOPTS_VALUE){
if(s->user_specified_pts != AV_NOPTS_VALUE){
int64_t time= pts;
int64_t last= s->user_specified_pts;
-
- if(time <= last){
+
+ if(time <= last){
av_log(s->avctx, AV_LOG_ERROR, "Error, Invalid timestamp=%"PRId64", last=%"PRId64"\n", pts, s->user_specified_pts);
return -1;
}
s->user_specified_pts= pts;
}else{
if(s->user_specified_pts != AV_NOPTS_VALUE){
- s->user_specified_pts=
+ s->user_specified_pts=
pts= s->user_specified_pts + 1;
av_log(s->avctx, AV_LOG_INFO, "Warning: AVFrame.pts=? trying to guess (%"PRId64")\n", pts);
}else{
if(pic_arg->linesize[0] != s->linesize) direct=0;
if(pic_arg->linesize[1] != s->uvlinesize) direct=0;
if(pic_arg->linesize[2] != s->uvlinesize) direct=0;
-
+
// av_log(AV_LOG_DEBUG, "%d %d %d %d\n",pic_arg->linesize[0], pic_arg->linesize[1], s->linesize, s->uvlinesize);
-
+
if(direct){
i= ff_find_unused_picture(s, 1);
pic= (AVFrame*)&s->picture[i];
pic->reference= 3;
-
+
for(i=0; i<4; i++){
pic->data[i]= pic_arg->data[i];
pic->linesize[i]= pic_arg->linesize[i];
alloc_picture(s, (Picture*)pic, 0);
- if( pic->data[0] + offset == pic_arg->data[0]
+ if( pic->data[0] + offset == pic_arg->data[0]
&& pic->data[1] + offset == pic_arg->data[1]
&& pic->data[2] + offset == pic_arg->data[2]){
// empty
}else{
int h_chroma_shift, v_chroma_shift;
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift);
-
+
for(i=0; i<3; i++){
int src_stride= pic_arg->linesize[i];
int dst_stride= i ? s->uvlinesize : s->linesize;
int h= s->height>>v_shift;
uint8_t *src= pic_arg->data[i];
uint8_t *dst= pic->data[i] + offset;
-
+
if(src_stride==dst_stride)
memcpy(dst, src, src_stride*h);
else{
copy_picture_attributes(s, pic, pic_arg);
pic->pts= pts; //we set this here to avoid modifiying pic_arg
}
-
+
/* shift buffer entries */
for(i=1; i<MAX_PICTURE_COUNT /*s->encoding_delay+1*/; i++)
s->input_picture[i-1]= s->input_picture[i];
-
+
s->input_picture[encoding_delay]= (Picture*)pic;
return 0;
for(x=0; x<s->mb_width*bw; x++){
int off= p->type == FF_BUFFER_TYPE_SHARED ? 0: 16;
int v= s->dsp.frame_skip_cmp[1](s, p->data[plane] + 8*(x + y*stride)+off, ref->data[plane] + 8*(x + y*stride), stride, 8);
-
+
switch(s->avctx->frame_skip_exp){
case 0: score= FFMAX(score, v); break;
case 1: score+= ABS(v);break;
}
}
}
-
+
if(score) score64= score;
if(score64 < s->avctx->frame_skip_threshold)
if(s->picture_in_gop_number < s->gop_size && skip_check(s, s->input_picture[0], s->next_picture_ptr)){
//FIXME check that te gop check above is +-1 correct
//av_log(NULL, AV_LOG_DEBUG, "skip %p %Ld\n", s->input_picture[0]->data[0], s->input_picture[0]->pts);
-
+
if(s->input_picture[0]->type == FF_BUFFER_TYPE_SHARED){
for(i=0; i<4; i++)
s->input_picture[0]->data[i]= NULL;
- s->input_picture[0]->type= 0;
+ s->input_picture[0]->type= 0;
}else{
- assert( s->input_picture[0]->type==FF_BUFFER_TYPE_USER
+ assert( s->input_picture[0]->type==FF_BUFFER_TYPE_USER
|| s->input_picture[0]->type==FF_BUFFER_TYPE_INTERNAL);
-
+
s->avctx->release_buffer(s->avctx, (AVFrame*)s->input_picture[0]);
}
-
+
emms_c();
ff_vbv_update(s, 0);
for(i=0; i<s->max_b_frames+1; i++){
int pict_num= s->input_picture[0]->display_picture_number + i;
- if(pict_num >= s->rc_context.num_entries)
+ if(pict_num >= s->rc_context.num_entries)
break;
if(!s->input_picture[i]){
s->rc_context.entry[pict_num-1].new_pict_type = P_TYPE;
break;
}
- s->input_picture[i]->pict_type=
+ s->input_picture[i]->pict_type=
s->rc_context.entry[pict_num].new_pict_type;
}
}
}else if(s->avctx->b_frame_strategy==1){
for(i=1; i<s->max_b_frames+1; i++){
if(s->input_picture[i] && s->input_picture[i]->b_frame_score==0){
- s->input_picture[i]->b_frame_score=
- get_intra_count(s, s->input_picture[i ]->data[0],
+ s->input_picture[i]->b_frame_score=
+ get_intra_count(s, s->input_picture[i ]->data[0],
s->input_picture[i-1]->data[0], s->linesize) + 1;
}
}
for(i=0; i<s->max_b_frames+1; i++){
if(s->input_picture[i]==NULL || s->input_picture[i]->b_frame_score - 1 > s->mb_num/40) break;
}
-
+
b_frames= FFMAX(0, i-1);
-
+
/* reset scores */
for(i=0; i<b_frames+1; i++){
s->input_picture[i]->b_frame_score=0;
s->input_picture[b_frames]->pict_type= I_TYPE;
}
}
-
+
if( (s->flags & CODEC_FLAG_CLOSED_GOP)
&& b_frames
&& s->input_picture[b_frames]->pict_type== I_TYPE)
if(s->reordered_input_picture[0]->type == FF_BUFFER_TYPE_SHARED){
// input is a shared pix, so we can't modifiy it -> alloc a new one & ensure that the shared one is reuseable
-
+
int i= ff_find_unused_picture(s, 0);
Picture *pic= &s->picture[i];
for(i=0; i<4; i++)
s->reordered_input_picture[0]->data[i]= NULL;
s->reordered_input_picture[0]->type= 0;
-
+
pic->reference = s->reordered_input_picture[0]->reference;
-
+
alloc_picture(s, pic, 0);
copy_picture_attributes(s, (AVFrame*)pic, (AVFrame*)s->reordered_input_picture[0]);
}else{
// input is not a shared pix -> reuse buffer for current_pix
- assert( s->reordered_input_picture[0]->type==FF_BUFFER_TYPE_USER
+ assert( s->reordered_input_picture[0]->type==FF_BUFFER_TYPE_USER
|| s->reordered_input_picture[0]->type==FF_BUFFER_TYPE_INTERNAL);
-
+
s->current_picture_ptr= s->reordered_input_picture[0];
for(i=0; i<4; i++){
s->new_picture.data[i]+=16;
}
}
copy_picture(&s->current_picture, s->current_picture_ptr);
-
+
s->picture_number= s->new_picture.display_picture_number;
//printf("dpn:%d\n", s->picture_number);
}else{
av_log(avctx, AV_LOG_ERROR, "this codec supports only YUV420P\n");
return -1;
}
-
+
for(i=0; i<avctx->thread_count; i++){
int start_y= s->thread_context[i]->start_mb_y;
int end_y= s->thread_context[i]-> end_mb_y;
if(load_input_picture(s, pic_arg) < 0)
return -1;
-
+
select_input_picture(s);
-
+
/* output? */
if(s->new_picture.data[0]){
s->pict_type= s->new_picture.pict_type;
MPV_frame_start(s, avctx);
encode_picture(s, s->picture_number);
-
+
avctx->real_pict_num = s->picture_number;
avctx->header_bits = s->header_bits;
avctx->mv_bits = s->mv_bits;
if (s->out_format == FMT_MJPEG)
mjpeg_picture_trailer(s);
-
+
if(s->flags&CODEC_FLAG_PASS1)
ff_write_pass1_stats(s);
s->frame_bits = put_bits_count(&s->pb);
}
- /* update mpeg1/2 vbv_delay for CBR */
+ /* update mpeg1/2 vbv_delay for CBR */
if(s->avctx->rc_max_rate && s->avctx->rc_min_rate == s->avctx->rc_max_rate && s->out_format == FMT_MPEG1
&& 90000LL * (avctx->rc_buffer_size-1) <= s->avctx->rc_max_rate*0xFFFFLL){
int vbv_delay;
assert(s->repeat_first_field==0);
-
+
vbv_delay= lrintf(90000 * s->rc_context.buffer_index / s->avctx->rc_max_rate);
assert(vbv_delay < 0xFFFF);
s->frame_bits=0;
}
assert((s->frame_bits&7)==0);
-
+
return s->frame_bits/8;
}
linesize = s->linesize;
uvlinesize = s->uvlinesize;
-
+
ptr = ref_picture[0] + (src_y * linesize) + src_x;
if(s->flags&CODEC_FLAG_EMU_EDGE){
ptr= s->edge_emu_buffer;
}
}
-
+
if((motion_x|motion_y)&7){
s->dsp.gmc1(dest_y , ptr , linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding);
s->dsp.gmc1(dest_y+8, ptr+8, linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding);
}else{
int dxy;
-
+
dxy= ((motion_x>>3)&1) | ((motion_y>>2)&2);
if (s->no_rounding){
s->dsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16);
s->dsp.put_pixels_tab [0][dxy](dest_y, ptr, linesize, 16);
}
}
-
+
if(s->flags&CODEC_FLAG_GRAY) return;
motion_x= s->sprite_offset[1][0];
}
}
s->dsp.gmc1(dest_cb, ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding);
-
+
ptr = ref_picture[2] + offset;
if(emu){
ff_emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
ptr= s->edge_emu_buffer;
}
s->dsp.gmc1(dest_cr, ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding);
-
+
return;
}
oy= s->sprite_offset[0][1] + s->sprite_delta[1][0]*s->mb_x*16 + s->sprite_delta[1][1]*s->mb_y*16;
s->dsp.gmc(dest_y, ptr, linesize, 16,
- ox,
- oy,
+ ox,
+ oy,
s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
+ s->sprite_delta[1][0], s->sprite_delta[1][1],
a+1, (1<<(2*a+1)) - s->no_rounding,
s->h_edge_pos, s->v_edge_pos);
s->dsp.gmc(dest_y+8, ptr, linesize, 16,
- ox + s->sprite_delta[0][0]*8,
- oy + s->sprite_delta[1][0]*8,
+ ox + s->sprite_delta[0][0]*8,
+ oy + s->sprite_delta[1][0]*8,
s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
+ s->sprite_delta[1][0], s->sprite_delta[1][1],
a+1, (1<<(2*a+1)) - s->no_rounding,
s->h_edge_pos, s->v_edge_pos);
ptr = ref_picture[1];
s->dsp.gmc(dest_cb, ptr, uvlinesize, 8,
- ox,
- oy,
+ ox,
+ oy,
s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
+ s->sprite_delta[1][0], s->sprite_delta[1][1],
a+1, (1<<(2*a+1)) - s->no_rounding,
s->h_edge_pos>>1, s->v_edge_pos>>1);
-
+
ptr = ref_picture[2];
s->dsp.gmc(dest_cr, ptr, uvlinesize, 8,
- ox,
- oy,
+ ox,
+ oy,
s->sprite_delta[0][0], s->sprite_delta[0][1],
- s->sprite_delta[1][0], s->sprite_delta[1][1],
+ s->sprite_delta[1][0], s->sprite_delta[1][1],
a+1, (1<<(2*a+1)) - s->no_rounding,
s->h_edge_pos>>1, s->v_edge_pos>>1);
}
* @param w width of the source buffer
* @param h height of the source buffer
*/
-void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h,
+void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h,
int src_x, int src_y, int w, int h){
int x, y;
int start_y, start_x, end_y, end_x;
buf[x + y*linesize]= buf[x + (end_y-1)*linesize];
}
}
-
+
for(y=0; y<block_h; y++){
//left
for(x=0; x<start_x; x++){
buf[x + y*linesize]= buf[start_x + y*linesize];
}
-
+
//right
for(x=end_x; x<block_w; x++){
buf[x + y*linesize]= buf[end_x - 1 + y*linesize];
}
}
-static inline int hpel_motion(MpegEncContext *s,
+static inline int hpel_motion(MpegEncContext *s,
uint8_t *dest, uint8_t *src,
int field_based, int field_select,
int src_x, int src_y,
dxy = ((motion_y & 1) << 1) | (motion_x & 1);
src_x += motion_x >> 1;
src_y += motion_y >> 1;
-
+
/* WARNING: do no forget half pels */
src_x = clip(src_x, -16, width); //FIXME unneeded for emu?
if (src_x == width)
return emu;
}
-static inline int hpel_motion_lowres(MpegEncContext *s,
+static inline int hpel_motion_lowres(MpegEncContext *s,
uint8_t *dest, uint8_t *src,
int field_based, int field_select,
int src_x, int src_y,
sy= motion_y & s_mask;
src_x += motion_x >> (lowres+1);
src_y += motion_y >> (lowres+1);
-
+
src += src_y * stride + src_x;
if( (unsigned)src_x > h_edge_pos - (!!sx) - w
{
uint8_t *ptr_y, *ptr_cb, *ptr_cr;
int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, uvlinesize, linesize;
-
-#if 0
+
+#if 0
if(s->quarter_sample)
{
motion_x>>=1;
ptr_y = s->edge_emu_buffer;
if(!(s->flags&CODEC_FLAG_GRAY)){
uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
- ff_emulated_edge_mc(uvbuf , ptr_cb, s->uvlinesize, 9, 9+field_based,
+ ff_emulated_edge_mc(uvbuf , ptr_cb, s->uvlinesize, 9, 9+field_based,
uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ff_emulated_edge_mc(uvbuf+16, ptr_cr, s->uvlinesize, 9, 9+field_based,
+ ff_emulated_edge_mc(uvbuf+16, ptr_cr, s->uvlinesize, 9, 9+field_based,
uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
ptr_cb= uvbuf;
ptr_cr= uvbuf+16;
}
pix_op[0][dxy](dest_y, ptr_y, linesize, h);
-
+
if(!(s->flags&CODEC_FLAG_GRAY)){
pix_op[s->chroma_x_shift][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
pix_op[s->chroma_x_shift][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
motion_x/=2;
motion_y/=2;
}
-
+
if(field_based){
motion_y += (bottom_field - field_select)*((1<<lowres)-1);
}
sy= motion_y & s_mask;
src_x = s->mb_x*2*block_s + (motion_x >> (lowres+1));
src_y =(s->mb_y*2*block_s>>field_based) + (motion_y >> (lowres+1));
-
+
if (s->out_format == FMT_H263) {
uvsx = ((motion_x>>1) & s_mask) | (sx&1);
uvsy = ((motion_y>>1) & s_mask) | (sy&1);
ptr_y = s->edge_emu_buffer;
if(!(s->flags&CODEC_FLAG_GRAY)){
uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
- ff_emulated_edge_mc(uvbuf , ptr_cb, s->uvlinesize, 9, 9+field_based,
+ ff_emulated_edge_mc(uvbuf , ptr_cb, s->uvlinesize, 9, 9+field_based,
uvsrc_x, uvsrc_y<<field_based, h_edge_pos>>1, v_edge_pos>>1);
- ff_emulated_edge_mc(uvbuf+16, ptr_cr, s->uvlinesize, 9, 9+field_based,
+ ff_emulated_edge_mc(uvbuf+16, ptr_cr, s->uvlinesize, 9, 9+field_based,
uvsrc_x, uvsrc_y<<field_based, h_edge_pos>>1, v_edge_pos>>1);
ptr_cb= uvbuf;
ptr_cr= uvbuf+16;
sx <<= 2 - lowres;
sy <<= 2 - lowres;
pix_op[lowres-1](dest_y, ptr_y, linesize, h, sx, sy);
-
+
if(!(s->flags&CODEC_FLAG_GRAY)){
uvsx <<= 2 - lowres;
uvsy <<= 2 - lowres;
OBMC_FILTER(x+1 , t, l, m, r, b);\
OBMC_FILTER(x +stride, t, l, m, r, b);\
OBMC_FILTER(x+1+stride, t, l, m, r, b);
-
+
x=0;
OBMC_FILTER (x , 2, 2, 4, 0, 0);
OBMC_FILTER (x+1, 2, 1, 5, 0, 0);
{
int i;
uint8_t *ptr[5];
-
+
assert(s->quarter_sample==0);
-
+
for(i=0; i<5; i++){
if(i && mv[i][0]==mv[MID][0] && mv[i][1]==mv[MID][1]){
ptr[i]= ptr[MID];
}
}
- put_obmc(dest, ptr, s->linesize);
+ put_obmc(dest, ptr, s->linesize);
}
static inline void qpel_motion(MpegEncContext *s,
v_edge_pos = s->v_edge_pos >> field_based;
linesize = s->linesize << field_based;
uvlinesize = s->uvlinesize << field_based;
-
+
if(field_based){
mx= motion_x/2;
my= motion_y>>1;
ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16
+ if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16
|| (unsigned)src_y > v_edge_pos - (motion_y&3) - h ){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
+ ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);
ptr_y= s->edge_emu_buffer;
if(!(s->flags&CODEC_FLAG_GRAY)){
uint8_t *uvbuf= s->edge_emu_buffer + 18*s->linesize;
- ff_emulated_edge_mc(uvbuf, ptr_cb, s->uvlinesize, 9, 9 + field_based,
+ ff_emulated_edge_mc(uvbuf, ptr_cb, s->uvlinesize, 9, 9 + field_based,
uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
- ff_emulated_edge_mc(uvbuf + 16, ptr_cr, s->uvlinesize, 9, 9 + field_based,
+ ff_emulated_edge_mc(uvbuf + 16, ptr_cr, s->uvlinesize, 9, 9 + field_based,
uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
ptr_cb= uvbuf;
ptr_cr= uvbuf + 16;
int mx, int my){
int dxy, emu=0, src_x, src_y, offset;
uint8_t *ptr;
-
+
/* In case of 8X8, we construct a single chroma motion vector
with a special rounding */
mx= ff_h263_round_chroma(mx);
my= ff_h263_round_chroma(my);
-
+
dxy = ((my & 1) << 1) | (mx & 1);
mx >>= 1;
my >>= 1;
src_y = clip(src_y, -8, s->height/2);
if (src_y == s->height/2)
dxy &= ~2;
-
+
offset = (src_y * (s->uvlinesize)) + src_x;
ptr = ref_picture[1] + offset;
if(s->flags&CODEC_FLAG_EMU_EDGE){
const int v_edge_pos = s->v_edge_pos >> (lowres+1);
int emu=0, src_x, src_y, offset, sx, sy;
uint8_t *ptr;
-
+
if(s->quarter_sample){
mx/=2;
my/=2;
with a special rounding */
mx= ff_h263_round_chroma(mx);
my= ff_h263_round_chroma(my);
-
+
sx= mx & s_mask;
sy= my & s_mask;
src_x = s->mb_x*block_s + (mx >> (lowres+1));
src_y = s->mb_y*block_s + (my >> (lowres+1));
-
+
offset = src_y * s->uvlinesize + src_x;
ptr = ref_picture[1] + offset;
if(s->flags&CODEC_FLAG_EMU_EDGE){
ptr= s->edge_emu_buffer;
emu=1;
}
- }
+ }
sx <<= 2 - lowres;
sy <<= 2 - lowres;
pix_op[lowres](dest_cb, ptr, s->uvlinesize, block_s, sx, sy);
-
+
ptr = ref_picture[2] + offset;
if(emu){
ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, src_x, src_y, h_edge_pos, v_edge_pos);
* @param pic_op qpel motion compensation function (average or put normally)
* the motion vectors are taken from s->mv and the MV type from s->mv_type
*/
-static inline void MPV_motion(MpegEncContext *s,
+static inline void MPV_motion(MpegEncContext *s,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int dir, uint8_t **ref_picture,
+ int dir, uint8_t **ref_picture,
op_pixels_func (*pix_op)[4], qpel_mc_func (*qpix_op)[16])
{
int dxy, mx, my, src_x, src_y, motion_x, motion_y;
const int mot_xy= mb_x*2 + mb_y*2*mot_stride;
assert(!s->mb_skipped);
-
+
memcpy(mv_cache[1][1], s->current_picture.motion_val[0][mot_xy ], sizeof(int16_t)*4);
memcpy(mv_cache[2][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
memcpy(mv_cache[3][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
*(int32_t*)mv_cache[1][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2];
*(int32_t*)mv_cache[2][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2+mot_stride];
}
-
+
mx = 0;
my = 0;
for(i=0;i<4;i++) {
return;
}
-
+
switch(s->mv_type) {
case MV_TYPE_16X16:
if(s->mcsel){
ref_picture);
}
}else if(s->quarter_sample){
- qpel_motion(s, dest_y, dest_cb, dest_cr,
+ qpel_motion(s, dest_y, dest_cb, dest_cr,
0, 0, 0,
ref_picture, pix_op, qpix_op,
s->mv[dir][0][0], s->mv[dir][0][1], 16);
s->mv[dir][0][0], s->mv[dir][0][1], 16);
}else
{
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
+ mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, 0,
ref_picture, pix_op,
s->mv[dir][0][0], s->mv[dir][0][1], 16);
- }
+ }
break;
case MV_TYPE_8X8:
mx = 0;
dxy = ((motion_y & 3) << 2) | (motion_x & 3);
src_x = mb_x * 16 + (motion_x >> 2) + (i & 1) * 8;
src_y = mb_y * 16 + (motion_y >> 2) + (i >>1) * 8;
-
+
/* WARNING: do no forget half pels */
src_x = clip(src_x, -16, s->width);
if (src_x == s->width)
src_y = clip(src_y, -16, s->height);
if (src_y == s->height)
dxy &= ~12;
-
+
ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
if(s->flags&CODEC_FLAG_EMU_EDGE){
- if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8
+ if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8
|| (unsigned)src_y > s->v_edge_pos - (motion_y&3) - 8 ){
ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, s->v_edge_pos);
ptr= s->edge_emu_buffer;
s->mv[dir][i][0], s->mv[dir][i][1], 8);
}
}else{
- /* top field */
+ /* top field */
mpeg_motion(s, dest_y, dest_cb, dest_cr,
1, 0, s->field_select[dir][0],
ref_picture, pix_op,
} else {
if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != B_TYPE && !s->first_field){
ref_picture= s->current_picture_ptr->data;
- }
+ }
mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][0],
ref2picture= ref_picture;
}else{
ref2picture= s->current_picture_ptr->data;
- }
+ }
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
+ mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][i],
ref2picture, pix_op,
s->mv[dir][i][0], s->mv[dir][i][1] + 16*i, 8);
-
+
dest_y += 16*s->linesize;
dest_cb+= (16>>s->chroma_y_shift)*s->uvlinesize;
dest_cr+= (16>>s->chroma_y_shift)*s->uvlinesize;
- }
+ }
break;
case MV_TYPE_DMV:
if(s->picture_structure == PICT_FRAME){
ref_picture, pix_op,
s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], 8);
}
- pix_op = s->dsp.avg_pixels_tab;
+ pix_op = s->dsp.avg_pixels_tab;
}
}else{
for(i=0; i<2; i++){
- mpeg_motion(s, dest_y, dest_cb, dest_cr,
+ mpeg_motion(s, dest_y, dest_cb, dest_cr,
0, 0, s->picture_structure != i+1,
ref_picture, pix_op,
s->mv[dir][2*i][0],s->mv[dir][2*i][1],16);
// after put we make avg of the same block
- pix_op=s->dsp.avg_pixels_tab;
+ pix_op=s->dsp.avg_pixels_tab;
//opposite parity is always in the same frame if this is second field
if(!s->first_field){
- ref_picture = s->current_picture_ptr->data;
+ ref_picture = s->current_picture_ptr->data;
}
}
}
* @param pic_op halfpel motion compensation function (average or put normally)
* the motion vectors are taken from s->mv and the MV type from s->mv_type
*/
-static inline void MPV_motion_lowres(MpegEncContext *s,
+static inline void MPV_motion_lowres(MpegEncContext *s,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
- int dir, uint8_t **ref_picture,
+ int dir, uint8_t **ref_picture,
h264_chroma_mc_func *pix_op)
{
int mx, my;
int mb_x, mb_y, i;
const int lowres= s->avctx->lowres;
- const int block_s= 8>>lowres;
+ const int block_s= 8>>lowres;
mb_x = s->mb_x;
mb_y = s->mb_y;
switch(s->mv_type) {
case MV_TYPE_16X16:
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
+ mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, 0,
ref_picture, pix_op,
s->mv[dir][0][0], s->mv[dir][0][1], 2*block_s);
break;
case MV_TYPE_FIELD:
if (s->picture_structure == PICT_FRAME) {
- /* top field */
+ /* top field */
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
1, 0, s->field_select[dir][0],
ref_picture, pix_op,
} else {
if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != B_TYPE && !s->first_field){
ref_picture= s->current_picture_ptr->data;
- }
+ }
mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][0],
ref2picture= ref_picture;
}else{
ref2picture= s->current_picture_ptr->data;
- }
+ }
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
+ mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, s->field_select[dir][i],
ref2picture, pix_op,
s->mv[dir][i][0], s->mv[dir][i][1] + 2*block_s*i, block_s);
-
+
dest_y += 2*block_s*s->linesize;
dest_cb+= (2*block_s>>s->chroma_y_shift)*s->uvlinesize;
dest_cr+= (2*block_s>>s->chroma_y_shift)*s->uvlinesize;
- }
+ }
break;
case MV_TYPE_DMV:
if(s->picture_structure == PICT_FRAME){
}
}else{
for(i=0; i<2; i++){
- mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
+ mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr,
0, 0, s->picture_structure != i+1,
ref_picture, pix_op,
s->mv[dir][2*i][0],s->mv[dir][2*i][1],2*block_s);
//opposite parity is always in the same frame if this is second field
if(!s->first_field){
- ref_picture = s->current_picture_ptr->data;
+ ref_picture = s->current_picture_ptr->data;
}
}
}
}
/* put block[] to dest[] */
-static inline void put_dct(MpegEncContext *s,
+static inline void put_dct(MpegEncContext *s,
DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale)
{
s->dct_unquantize_intra(s, block, i, qscale);
}
/* add block[] to dest[] */
-static inline void add_dct(MpegEncContext *s,
+static inline void add_dct(MpegEncContext *s,
DCTELEM *block, int i, uint8_t *dest, int line_size)
{
if (s->block_last_index[i] >= 0) {
}
}
-static inline void add_dequant_dct(MpegEncContext *s,
+static inline void add_dequant_dct(MpegEncContext *s,
DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale)
{
if (s->block_last_index[i] >= 0) {
{
int wrap = s->b8_stride;
int xy = s->block_index[0];
-
- s->dc_val[0][xy ] =
- s->dc_val[0][xy + 1 ] =
+
+ s->dc_val[0][xy ] =
+ s->dc_val[0][xy + 1 ] =
s->dc_val[0][xy + wrap] =
s->dc_val[0][xy + 1 + wrap] = 1024;
/* ac pred */
/* ac pred */
memset(s->ac_val[1][xy], 0, 16 * sizeof(int16_t));
memset(s->ac_val[2][xy], 0, 16 * sizeof(int16_t));
-
+
s->mbintra_table[xy]= 0;
}
if (s->mb_skipped) {
s->mb_skipped= 0;
assert(s->pict_type!=I_TYPE);
-
+
(*mbskip_ptr) ++; /* indicate that this time we skipped it */
if(*mbskip_ptr >99) *mbskip_ptr= 99;
*mbskip_ptr = 0; /* not skipped */
}
}
-
+
dct_linesize = linesize << s->interlaced_dct;
dct_offset =(s->interlaced_dct)? linesize : linesize*block_size;
-
+
if(readable){
dest_y= s->dest[0];
dest_cb= s->dest[1];
MPV_motion_lowres(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix);
}
}else{
- if ((!s->no_rounding) || s->pict_type==B_TYPE){
+ if ((!s->no_rounding) || s->pict_type==B_TYPE){
op_pix = s->dsp.put_pixels_tab;
op_qpix= s->dsp.put_qpel_pixels_tab;
}else{
const int maxlevel= s->max_qcoeff;
const int minlevel= s->min_qcoeff;
int overflow=0;
-
+
if(s->mb_intra){
i=1; //skip clipping of intra dc
}else
i=0;
-
+
for(;i<=last_index; i++){
const int j= s->intra_scantable.permutated[i];
int level = block[j];
-
+
if (level>maxlevel){
level=maxlevel;
overflow++;
level=minlevel;
overflow++;
}
-
+
block[j]= level;
}
-
+
if(overflow && s->avctx->mb_decision == FF_MB_DECISION_SIMPLE)
av_log(s->avctx, AV_LOG_INFO, "warning, clipping %d dct coefficients to %d..%d\n", overflow, minlevel, maxlevel);
}
if (s->avctx->draw_horiz_band) {
AVFrame *src;
int offset[4];
-
+
if(s->picture_structure != PICT_FRAME){
h <<= 1;
y <<= 1;
h= FFMIN(h, s->avctx->height - y);
- if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
+ if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
src= (AVFrame*)s->current_picture_ptr;
else if(s->last_picture_ptr)
src= (AVFrame*)s->last_picture_ptr;
else
return;
-
+
if(s->pict_type==B_TYPE && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
offset[0]=
offset[1]=
offset[3]= 0;
}else{
offset[0]= y * s->linesize;;
- offset[1]=
+ offset[1]=
offset[2]= (y >> s->chroma_y_shift) * s->uvlinesize;
offset[3]= 0;
}
const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics
const int uvlinesize= s->current_picture.linesize[1];
const int mb_size= 4 - s->avctx->lowres;
-
+
s->block_index[0]= s->b8_stride*(s->mb_y*2 ) - 2 + s->mb_x*2;
s->block_index[1]= s->b8_stride*(s->mb_y*2 ) - 1 + s->mb_x*2;
s->block_index[2]= s->b8_stride*(s->mb_y*2 + 1) - 2 + s->mb_x*2;
int dct_offset = s->linesize*8; //default for progressive frames
uint8_t *ptr_y, *ptr_cb, *ptr_cr;
int wrap_y, wrap_c;
-
+
for(i=0; i<6; i++) skip_dct[i]=0;
-
+
if(s->adaptive_quant){
const int last_qp= s->qscale;
const int mb_xy= mb_x + mb_y*s->mb_stride;
s->lambda= s->lambda_table[mb_xy];
update_qscale(s);
-
+
if(!(s->flags&CODEC_FLAG_QP_RD)){
s->dquant= s->qscale - last_qp;
if(s->out_format==FMT_H263){
s->dquant= clip(s->dquant, -2, 2); //FIXME RD
-
- if(s->codec_id==CODEC_ID_MPEG4){
+
+ if(s->codec_id==CODEC_ID_MPEG4){
if(!s->mb_intra){
if(s->pict_type == B_TYPE){
- if(s->dquant&1)
+ if(s->dquant&1)
s->dquant= (s->dquant/2)*2;
if(s->mv_dir&MV_DIRECT)
s->dquant= 0;
int progressive_score, interlaced_score;
s->interlaced_dct=0;
- progressive_score= s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y, 8)
+ progressive_score= s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y, 8)
+s->dsp.ildct_cmp[4](s, ptr_y + wrap_y*8, NULL, wrap_y, 8) - 400;
if(progressive_score > 0){
- interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y*2, 8)
+ interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y*2, 8)
+s->dsp.ildct_cmp[4](s, ptr_y + wrap_y , NULL, wrap_y*2, 8);
if(progressive_score > interlaced_score){
s->interlaced_dct=1;
-
+
dct_offset= wrap_y;
wrap_y<<=1;
}
}
}
-
+
s->dsp.get_pixels(s->block[0], ptr_y , wrap_y);
s->dsp.get_pixels(s->block[1], ptr_y + 8, wrap_y);
s->dsp.get_pixels(s->block[2], ptr_y + dct_offset , wrap_y);
int progressive_score, interlaced_score;
s->interlaced_dct=0;
- progressive_score= s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y, 8)
+ progressive_score= s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y, 8)
+s->dsp.ildct_cmp[0](s, dest_y + wrap_y*8, ptr_y + wrap_y*8, wrap_y, 8) - 400;
-
+
if(s->avctx->ildct_cmp == FF_CMP_VSSE) progressive_score -= 400;
if(progressive_score>0){
- interlaced_score = s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y*2, 8)
+ interlaced_score = s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y*2, 8)
+s->dsp.ildct_cmp[0](s, dest_y + wrap_y , ptr_y + wrap_y , wrap_y*2, 8);
-
+
if(progressive_score > interlaced_score){
s->interlaced_dct=1;
-
+
dct_offset= wrap_y;
wrap_y<<=1;
}
}
}
-
+
s->dsp.diff_pixels(s->block[0], ptr_y , dest_y , wrap_y);
s->dsp.diff_pixels(s->block[1], ptr_y + 8, dest_y + 8, wrap_y);
s->dsp.diff_pixels(s->block[2], ptr_y + dct_offset , dest_y + dct_offset , wrap_y);
s->dsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8, dest_y + dct_offset + 8, wrap_y);
-
+
if(s->flags&CODEC_FLAG_GRAY){
skip_dct[4]= 1;
skip_dct[5]= 1;
s->dsp.diff_pixels(s->block[4], ptr_cb, dest_cb, wrap_c);
s->dsp.diff_pixels(s->block[5], ptr_cr, dest_cr, wrap_c);
}
- /* pre quantization */
+ /* pre quantization */
if(s->current_picture.mc_mb_var[s->mb_stride*mb_y+ mb_x]<2*s->qscale*s->qscale){
//FIXME optimize
if(s->dsp.sad[1](NULL, ptr_y , dest_y , wrap_y, 8) < 20*s->qscale) skip_dct[0]= 1;
if(!skip_dct[5]) get_vissual_weight(weight[5], ptr_cr , wrap_c);
memcpy(orig[0], s->block[0], sizeof(DCTELEM)*64*6);
}
-
+
/* DCT & quantize */
assert(s->out_format!=FMT_MJPEG || s->qscale==8);
{
}
}
}
-
+
if(s->luma_elim_threshold && !s->mb_intra)
for(i=0; i<4; i++)
dct_single_coeff_elimination(s, i, s->luma_elim_threshold);
void ff_mpeg_flush(AVCodecContext *avctx){
int i;
MpegEncContext *s = avctx->priv_data;
-
- if(s==NULL || s->picture==NULL)
+
+ if(s==NULL || s->picture==NULL)
return;
-
+
for(i=0; i<MAX_PICTURE_COUNT; i++){
if(s->picture[i].data[0] && ( s->picture[i].type == FF_BUFFER_TYPE_INTERNAL
|| s->picture[i].type == FF_BUFFER_TYPE_USER))
avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]);
}
s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL;
-
+
s->mb_x= s->mb_y= 0;
-
+
s->parse_context.state= -1;
s->parse_context.frame_start_found= 0;
s->parse_context.overread= 0;
int i;
if(length==0) return;
-
+
if(words < 16){
for(i=0; i<words; i++) put_bits(pb, 16, be2me_16(srcw[i]));
}else if(put_bits_count(pb)&7){
memcpy(pbBufPtr(pb), src+i, 2*words-i);
skip_put_bytes(pb, 2*words-i);
}
-
+
put_bits(pb, bits, be2me_16(srcw[words])>>(16-bits));
}
d->mb_skip_run= s->mb_skip_run;
for(i=0; i<3; i++)
d->last_dc[i]= s->last_dc[i];
-
+
/* statistics */
d->mv_bits= s->mv_bits;
d->i_tex_bits= s->i_tex_bits;
static inline void copy_context_after_encode(MpegEncContext *d, MpegEncContext *s, int type){
int i;
- memcpy(d->mv, s->mv, 2*4*2*sizeof(int));
+ memcpy(d->mv, s->mv, 2*4*2*sizeof(int));
memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster then a loop?
-
+
/* mpeg1 */
d->mb_skip_run= s->mb_skip_run;
for(i=0; i<3; i++)
d->last_dc[i]= s->last_dc[i];
-
+
/* statistics */
d->mv_bits= s->mv_bits;
d->i_tex_bits= s->i_tex_bits;
d->qscale= s->qscale;
}
-static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegEncContext *best, int type,
+static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegEncContext *best, int type,
PutBitContext pb[2], PutBitContext pb2[2], PutBitContext tex_pb[2],
int *dmin, int *next_block, int motion_x, int motion_y)
{
int score;
uint8_t *dest_backup[3];
-
+
copy_context_before_encode(s, backup, type);
s->block= s->blocks[*next_block];
s->pb2 = pb2 [*next_block];
s->tex_pb= tex_pb[*next_block];
}
-
+
if(*next_block){
memcpy(dest_backup, s->dest, sizeof(s->dest));
s->dest[0] = s->rd_scratchpad;
}
encode_mb(s, motion_x, motion_y);
-
+
score= put_bits_count(&s->pb);
if(s->data_partitioning){
score+= put_bits_count(&s->pb2);
score+= put_bits_count(&s->tex_pb);
}
-
+
if(s->avctx->mb_decision == FF_MB_DECISION_RD){
MPV_decode_mb(s, s->block);
score *= s->lambda2;
score += sse_mb(s) << FF_LAMBDA_SHIFT;
}
-
+
if(*next_block){
memcpy(s->dest, dest_backup, sizeof(s->dest));
}
copy_context_after_encode(best, s, type);
}
}
-
+
static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, int stride){
uint32_t *sq = squareTbl + 256;
int acc=0;
int x,y;
-
- if(w==16 && h==16)
+
+ if(w==16 && h==16)
return s->dsp.sse[0](NULL, src1, src2, stride, 16);
else if(w==8 && h==8)
return s->dsp.sse[1](NULL, src1, src2, stride, 8);
-
+
for(y=0; y<h; y++){
for(x=0; x<w; x++){
acc+= sq[src1[x + y*stride] - src2[x + y*stride]];
- }
+ }
}
-
+
assert(acc>=0);
-
+
return acc;
}
static int pre_estimate_motion_thread(AVCodecContext *c, void *arg){
MpegEncContext *s= arg;
-
+
s->me.pre_pass=1;
s->me.dia_size= s->avctx->pre_dia_size;
s->first_slice_line=1;
}
s->first_slice_line=0;
}
-
+
s->me.pre_pass=0;
-
+
return 0;
}
s->block_index[1]+=2;
s->block_index[2]+=2;
s->block_index[3]+=2;
-
+
/* compute motion vector & mb_type and store in context */
if(s->pict_type==B_TYPE)
ff_estimate_b_frame_motion(s, s->mb_x, s->mb_y);
uint8_t *pix = s->new_picture.data[0] + (yy * s->linesize) + xx;
int varc;
int sum = s->dsp.pix_sum(pix, s->linesize);
-
+
varc = (s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500 + 128)>>8;
s->current_picture.mb_var [s->mb_stride * mb_y + mb_x] = varc;
if(s->partitioned_frame){
ff_mpeg4_merge_partitions(s);
}
-
+
ff_mpeg4_stuffing(&s->pb);
}else if(s->out_format == FMT_MJPEG){
ff_mjpeg_stuffing(&s->pb);
align_put_bits(&s->pb);
flush_put_bits(&s->pb);
-
+
if((s->flags&CODEC_FLAG_PASS1) && !s->partitioned_frame)
s->misc_bits+= get_bits_diff(s);
}
/* init last dc values */
/* note: quant matrix value (8) is implied here */
s->last_dc[i] = 128 << s->intra_dc_precision;
-
+
s->current_picture.error[i] = 0;
}
s->mb_skip_run = 0;
memset(s->last_mv, 0, sizeof(s->last_mv));
-
+
s->last_mv_dir = 0;
switch(s->codec_id){
}
s->resync_mb_x=0;
- s->resync_mb_y=0;
+ s->resync_mb_y=0;
s->first_slice_line = 1;
s->ptr_lastgob = s->pb.buf;
for(mb_y= s->start_mb_y; mb_y < s->end_mb_y; mb_y++) {
ff_set_qscale(s, s->qscale);
ff_init_block_index(s);
-
+
for(mb_x=0; mb_x < s->mb_width; mb_x++) {
int xy= mb_y*s->mb_stride + mb_x; // removed const, H261 needs to adjust this
int mb_type= s->mb_type[xy];
/* write gob / video packet header */
if(s->rtp_mode){
int current_packet_size, is_gob_start;
-
+
current_packet_size= ((put_bits_count(&s->pb)+7)>>3) - (s->ptr_lastgob - s->pb.buf);
-
- is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0;
-
+
+ is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0;
+
if(s->start_mb_y == mb_y && mb_y > 0 && mb_x==0) is_gob_start=1;
-
+
switch(s->codec_id){
case CODEC_ID_H263:
case CODEC_ID_H263P:
ff_mpeg4_init_partitions(s);
}
}
-
+
assert((put_bits_count(&s->pb)&7) == 0);
current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob;
-
+
if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
int d= 100 / s->avctx->error_rate;
int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x;
s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, current_packet_size, number_mb);
}
-
+
switch(s->codec_id){
case CODEC_ID_MPEG4:
ff_mpeg4_encode_video_packet_header(s);
break;
case CODEC_ID_H263:
case CODEC_ID_H263P:
- h263_encode_gob_header(s, mb_y);
+ h263_encode_gob_header(s, mb_y);
break;
}
s->misc_bits+= bits - s->last_bits;
s->last_bits= bits;
}
-
+
s->ptr_lastgob += current_packet_size;
s->first_slice_line=1;
s->resync_mb_x=mb_x;
if( (s->resync_mb_x == s->mb_x)
&& s->resync_mb_y+1 == s->mb_y){
- s->first_slice_line=0;
+ s->first_slice_line=0;
}
s->mb_skipped=0;
s->mb_intra= 0;
s->mv[0][0][0] = s->p_mv_table[xy][0];
s->mv[0][0][1] = s->p_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
}
- if(mb_type&CANDIDATE_MB_TYPE_INTER_I){
+ if(mb_type&CANDIDATE_MB_TYPE_INTER_I){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
s->mv[0][i][0] = s->p_field_mv_table[i][j][xy][0];
s->mv[0][i][1] = s->p_field_mv_table[i][j][xy][1];
}
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER_I, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_SKIPPED){
s->mb_intra= 0;
s->mv[0][0][0] = 0;
s->mv[0][0][1] = 0;
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_SKIPPED, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_SKIPPED, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
}
- if(mb_type&CANDIDATE_MB_TYPE_INTER4V){
+ if(mb_type&CANDIDATE_MB_TYPE_INTER4V){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_8X8;
s->mb_intra= 0;
s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
}
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER4V, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER4V, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_FORWARD){
s->mb_intra= 0;
s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
}
if(mb_type&CANDIDATE_MB_TYPE_BACKWARD){
s->mb_intra= 0;
s->mv[1][0][0] = s->b_back_mv_table[xy][0];
s->mv[1][0][1] = s->b_back_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[1][0][0], s->mv[1][0][1]);
}
if(mb_type&CANDIDATE_MB_TYPE_BIDIR){
s->mv[0][0][1] = s->b_bidir_forw_mv_table[xy][1];
s->mv[1][0][0] = s->b_bidir_back_mv_table[xy][0];
s->mv[1][0][1] = s->b_bidir_back_mv_table[xy][1];
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_DIRECT){
int mx= s->b_direct_mv_table[xy][0];
int my= s->b_direct_mv_table[xy][1];
-
+
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
s->mb_intra= 0;
ff_mpeg4_set_direct_mv(s, mx, my);
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
&dmin, &next_block, mx, my);
}
- if(mb_type&CANDIDATE_MB_TYPE_FORWARD_I){
+ if(mb_type&CANDIDATE_MB_TYPE_FORWARD_I){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
s->mv[0][i][0] = s->b_field_mv_table[0][i][j][xy][0];
s->mv[0][i][1] = s->b_field_mv_table[0][i][j][xy][1];
}
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD_I, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
- if(mb_type&CANDIDATE_MB_TYPE_BACKWARD_I){
+ if(mb_type&CANDIDATE_MB_TYPE_BACKWARD_I){
s->mv_dir = MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
s->mv[1][i][0] = s->b_field_mv_table[1][i][j][xy][0];
s->mv[1][i][1] = s->b_field_mv_table[1][i][j][xy][1];
}
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD_I, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
- if(mb_type&CANDIDATE_MB_TYPE_BIDIR_I){
+ if(mb_type&CANDIDATE_MB_TYPE_BIDIR_I){
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
s->mv[dir][i][1] = s->b_field_mv_table[dir][i][j][xy][1];
}
}
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR_I, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_INTRA){
s->mb_intra= 1;
s->mv[0][0][0] = 0;
s->mv[0][0][1] = 0;
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTRA, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTRA, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
if(s->h263_pred || s->h263_aic){
if(best_s.mb_intra)
int dquant, dir, qp, dc[6];
DCTELEM ac[6][16];
const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0;
-
+
assert(backup_s.dquant == 0);
//FIXME intra
s->mv[0][0][1] = best_s.mv[0][0][1];
s->mv[1][0][0] = best_s.mv[1][0][0];
s->mv[1][0][1] = best_s.mv[1][0][1];
-
+
dir= s->pict_type == B_TYPE ? 2 : 1;
if(last_qp + dir > s->avctx->qmax) dir= -dir;
for(dquant= dir; dquant<=2 && dquant>=-2; dquant += dir){
}
}
- encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER /* wrong but unused */, pb, pb2, tex_pb,
+ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER /* wrong but unused */, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[mvdir][0][0], s->mv[mvdir][0][1]);
if(best_s.qscale != qp){
if(s->mb_intra && s->dc_val[0]){
}
copy_context_after_encode(s, &best_s, -1);
-
+
pb_bits_count= put_bits_count(&s->pb);
flush_put_bits(&s->pb);
ff_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count);
s->pb= backup_s.pb;
-
+
if(s->data_partitioning){
pb2_bits_count= put_bits_count(&s->pb2);
flush_put_bits(&s->pb2);
ff_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count);
s->pb2= backup_s.pb2;
-
+
tex_pb_bits_count= put_bits_count(&s->tex_pb);
flush_put_bits(&s->tex_pb);
ff_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count);
s->tex_pb= backup_s.tex_pb;
}
s->last_bits= put_bits_count(&s->pb);
-
+
if (s->out_format == FMT_H263 && s->pict_type!=B_TYPE)
ff_h263_update_motion_val(s);
-
+
if(next_block==0){ //FIXME 16 vs linesize16
s->dsp.put_pixels_tab[0][0](s->dest[0], s->rd_scratchpad , s->linesize ,16);
s->dsp.put_pixels_tab[1][0](s->dest[1], s->rd_scratchpad + 16*s->linesize , s->uvlinesize, 8);
int motion_x, motion_y;
s->mv_type=MV_TYPE_16X16;
// only one MB-Type possible
-
+
switch(mb_type){
case CANDIDATE_MB_TYPE_INTRA:
s->mv_dir = 0;
// RAL: Update last macroblock type
s->last_mv_dir = s->mv_dir;
-
+
if (s->out_format == FMT_H263 && s->pict_type!=B_TYPE)
ff_h263_update_motion_val(s);
-
+
MPV_decode_mb(s, s->block);
}
s->p_mv_table[xy][0]=0;
s->p_mv_table[xy][1]=0;
}
-
+
if(s->flags&CODEC_FLAG_PSNR){
int w= 16;
int h= 16;
write_slice_end(s);
- /* Send the last GOB if RTP */
+ /* Send the last GOB if RTP */
if (s->avctx->rtp_callback) {
int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
pdif = pbBufPtr(&s->pb) - s->ptr_lastgob;
MERGE(dct_error_sum[1][i]);
}
}
-
+
assert(put_bits_count(&src->pb) % 8 ==0);
assert(put_bits_count(&dst->pb) % 8 ==0);
ff_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb));
int bits;
s->picture_number = picture_number;
-
+
/* Reset the average MB variance */
s->me.mb_var_sum_temp =
s->me.mc_mb_var_sum_temp = 0;
// RAL: Condition added for MPEG1VIDEO
if (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->h263_msmpeg4))
ff_set_mpeg4_time(s, s->picture_number); //FIXME rename and use has_b_frames or similar
-
+
s->me.scene_change_score=0;
-
+
// s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME ratedistoration
-
+
if(s->pict_type==I_TYPE){
if(s->msmpeg4_version >= 3) s->no_rounding=1;
else s->no_rounding=0;
}else if(s->pict_type!=B_TYPE){
if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
- s->no_rounding ^= 1;
+ s->no_rounding ^= 1;
}
-
+
s->mb_intra=0; //for the rate distortion & bit compare functions
for(i=1; i<s->avctx->thread_count; i++){
ff_update_duplicate_context(s->thread_context[i], s);
/* I-Frame */
for(i=0; i<s->mb_stride*s->mb_height; i++)
s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-
+
if(!s->fixed_qscale){
/* finding spatial complexity for I-frame rate control */
s->avctx->execute(s->avctx, mb_var_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count);
b= ff_get_best_fcode(s, s->p_field_mv_table[1][1], CANDIDATE_MB_TYPE_INTER_I);
s->f_code= FFMAX(s->f_code, FFMAX(a,b));
}
-
+
ff_fix_long_p_mvs(s);
ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, 0);
if(s->flags & CODEC_FLAG_INTERLACED_ME){
int j;
for(i=0; i<2; i++){
for(j=0; j<2; j++)
- ff_fix_long_mvs(s, s->p_field_select_table[i], j,
+ ff_fix_long_mvs(s, s->p_field_select_table[i], j,
s->p_field_mv_table[i][j], s->f_code, CANDIDATE_MB_TYPE_INTER_I, 0);
}
}
for(dir=0; dir<2; dir++){
for(i=0; i<2; i++){
for(j=0; j<2; j++){
- int type= dir ? (CANDIDATE_MB_TYPE_BACKWARD_I|CANDIDATE_MB_TYPE_BIDIR_I)
+ int type= dir ? (CANDIDATE_MB_TYPE_BACKWARD_I|CANDIDATE_MB_TYPE_BIDIR_I)
: (CANDIDATE_MB_TYPE_FORWARD_I |CANDIDATE_MB_TYPE_BIDIR_I);
- ff_fix_long_mvs(s, s->b_field_select_table[dir][i], j,
+ ff_fix_long_mvs(s, s->b_field_select_table[dir][i], j,
s->b_field_mv_table[dir][i][j], dir ? s->b_code : s->f_code, type, 1);
}
}
}
}
- if (!s->fixed_qscale)
+ if (!s->fixed_qscale)
s->current_picture.quality = ff_rate_estimate_qscale(s); //FIXME pic_ptr
if(s->adaptive_quant){
s->lambda= s->current_picture.quality;
//printf("%d %d\n", s->avctx->global_quality, s->current_picture.quality);
update_qscale(s);
-
- if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==I_TYPE && !(s->flags & CODEC_FLAG_QSCALE))
+
+ if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==I_TYPE && !(s->flags & CODEC_FLAG_QSCALE))
s->qscale= 3; //reduce clipping problems
-
+
if (s->out_format == FMT_MJPEG) {
/* for mjpeg, we do include qscale in the matrix */
s->intra_matrix[0] = ff_mpeg1_default_intra_matrix[0];
s->intra_matrix[j] = clip_uint8((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3) & 0xFF;
}
- convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
+ convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
s->intra_matrix, s->intra_quant_bias, 8, 8, 1);
s->qscale= 8;
}
-
+
//FIXME var duplication
s->current_picture_ptr->key_frame=
s->current_picture.key_frame= s->pict_type == I_TYPE; //FIXME pic_ptr
break;
#endif
case FMT_H263:
- if (s->codec_id == CODEC_ID_WMV2)
+ if (s->codec_id == CODEC_ID_WMV2)
ff_wmv2_encode_picture_header(s, picture_number);
- else if (s->h263_msmpeg4)
+ else if (s->h263_msmpeg4)
msmpeg4_encode_picture_header(s, picture_number);
else if (s->h263_pred)
mpeg4_encode_picture_header(s, picture_number);
#ifdef CONFIG_RV10_ENCODER
- else if (s->codec_id == CODEC_ID_RV10)
+ else if (s->codec_id == CODEC_ID_RV10)
rv10_encode_picture_header(s, picture_number);
#endif
#ifdef CONFIG_RV20_ENCODER
- else if (s->codec_id == CODEC_ID_RV20)
+ else if (s->codec_id == CODEC_ID_RV20)
rv20_encode_picture_header(s, picture_number);
#endif
else if (s->codec_id == CODEC_ID_FLV1)
}
bits= put_bits_count(&s->pb);
s->header_bits= bits - s->last_bits;
-
+
for(i=1; i<s->avctx->thread_count; i++){
update_duplicate_context_after_me(s->thread_context[i], s);
}
#ifdef CONFIG_ENCODERS
-static int dct_quantize_trellis_c(MpegEncContext *s,
+static int dct_quantize_trellis_c(MpegEncContext *s,
DCTELEM *block, int n,
int qscale, int *overflow){
const int *qmat;
uint8_t * length;
uint8_t * last_length;
const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6);
-
+
s->dsp.fdct (block);
-
+
if(s->dct_error_sum)
s->denoise_dct(s, block);
qmul= qscale*16;
q = 1 << 3;
qadd=0;
}
-
+
/* note: block[0] is assumed to be positive */
block[0] = (block[0] + (q >> 1)) / q;
start_i = 1;
coeff_count[i]= 1;
}
}
-
+
*overflow= s->max_qcoeff < max; //overflow might have happened
-
+
if(last_non_zero < start_i){
memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM));
return last_non_zero;
score_tab[start_i]= 0;
survivor[0]= start_i;
survivor_count= 1;
-
+
for(i=start_i; i<=last_non_zero; i++){
int level_index, j;
const int dct_coeff= ABS(block[ scantable[i] ]);
int level= coeff[level_index][i];
const int alevel= ABS(level);
int unquant_coeff;
-
+
assert(level);
if(s->out_format == FMT_H263){
int run= i - survivor[j];
int score= distoration + length[UNI_AC_ENC_INDEX(run, level)]*lambda;
score += score_tab[i-run];
-
+
if(score < best_score){
best_score= score;
run_tab[i+1]= run;
for(j=survivor_count-1; j>=0; j--){
int run= i - survivor[j];
int score= distoration + score_tab[i-run];
-
+
if(score < best_score){
best_score= score;
run_tab[i+1]= run;
}
}
}
-
+
score_tab[i+1]= best_score;
//Note: there is a vlc code in mpeg4 which is 1 bit shorter then another one with a shorter run and the same level
}
s->coded_score[n] = last_score;
-
+
dc= ABS(block[0]);
last_non_zero= last_i - 1;
memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM));
-
+
if(last_non_zero < start_i)
return last_non_zero;
if(last_non_zero == 0 && start_i == 0){
int best_level= 0;
int best_score= dc * dc;
-
+
for(i=0; i<coeff_count[0]; i++){
int level= coeff[i][0];
int alevel= ABS(level);
block[ perm_scantable[last_non_zero] ]= last_level;
i -= last_run + 1;
-
+
for(; i>start_i; i -= run_tab[i] + 1){
block[ perm_scantable[i-1] ]= level_tab[i];
}
if(basis[0][0] == 0)
build_basis(s->dsp.idct_permutation);
-
+
qmul= qscale*2;
qadd= (qscale-1)|1;
if (s->mb_intra) {
weight[i] = w;
// w=weight[i] = (63*qns + (w/2)) / w;
-
+
assert(w>0);
assert(w<(1<<6));
sum += w*w;
int j= perm_scantable[i];
const int level= block[j];
int coeff;
-
+
if(level){
if(level<0) coeff= qmul*level - qadd;
else coeff= qmul*level + qadd;
#endif
for(i=0; i<64; i++){
int w= weight[i];
-
+
d1[i] = (rem[i]*w*w + (1<<(RECON_SHIFT+12-1)))>>(RECON_SHIFT+12);
}
#ifdef REFINE_STATS
int change, old_coeff;
assert(s->mb_intra);
-
+
old_coeff= q*level;
-
+
for(change=-1; change<=1; change+=2){
int new_level= level + change;
int score, new_coeff;
-
+
new_coeff= q*new_level;
if(new_coeff >= 2048 || new_coeff < 0)
continue;
}
}
}
-
+
run=0;
rle_index=0;
run2= run_tab[rle_index++];
run2--;
assert(run2>=0 || i >= last_non_zero );
}
-
+
for(change=-1; change<=1; change+=2){
int new_level= level + change;
int score, new_coeff, unquant_change;
-
+
score=0;
if(s->avctx->quantizer_noise_shaping < 2 && ABS(new_level) > ABS(level))
continue;
if(new_coeff >= 2048 || new_coeff <= -2048)
continue;
//FIXME check for overflow
-
+
if(level){
if(level < 63 && level > -63){
if(i < last_non_zero)
}
}else{
assert(ABS(new_level)==1);
-
+
if(analyze_gradient){
int g= d1[ scantable[i] ];
if(g && (g^new_level) >= 0)
if(i < last_non_zero){
int next_i= i + run2 + 1;
int next_level= block[ perm_scantable[next_i] ] + 64;
-
+
if(next_level&(~127))
next_level= 0;
if(i < last_non_zero){
int next_i= i + run2 + 1;
int next_level= block[ perm_scantable[next_i] ] + 64;
-
+
if(next_level&(~127))
next_level= 0;
}
}
}
-
+
score *= lambda;
unquant_change= new_coeff - old_coeff;
assert((score < 100*lambda && score > -100*lambda) || lambda==0);
-
+
score+= s->dsp.try_8x8basis(rem, weight, basis[j], unquant_change);
if(score<best_score){
best_score= score;
if(best_change){
int j= perm_scantable[ best_coeff ];
-
+
block[j] += best_change;
-
+
if(best_coeff > last_non_zero){
last_non_zero= best_coeff;
assert(block[j]);
for(i=start_i; i<=last_non_zero; i++){
int j= perm_scantable[i];
const int level= block[j];
-
+
if(level){
run_tab[rle_index++]=run;
run=0;
run++;
}
}
-
+
s->dsp.add_8x8basis(rem, basis[j], best_unquant_change);
}else{
break;
return last_non_zero;
}
-static int dct_quantize_c(MpegEncContext *s,
+static int dct_quantize_c(MpegEncContext *s,
DCTELEM *block, int n,
int qscale, int *overflow)
{
} else
/* For AIC we skip quant/dequant of INTRADC */
q = 1 << 3;
-
+
/* note: block[0] is assumed to be positive */
block[0] = (block[0] + (q >> 1)) / q;
start_i = 1;
}
}
*overflow= s->max_qcoeff < max; //overflow might have happened
-
+
/* we need this permutation so that we correct the IDCT, we only permute the !=0 elements */
if (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM)
ff_block_permute(block, s->dsp.idct_permutation, scantable, last_non_zero);
#endif //CONFIG_ENCODERS
-static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
+static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level, nCoeffs;
const uint16_t *quant_matrix;
nCoeffs= s->block_last_index[n];
-
- if (n < 4)
+
+ if (n < 4)
block[0] = block[0] * s->y_dc_scale;
else
block[0] = block[0] * s->c_dc_scale;
}
}
-static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
+static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level, nCoeffs;
const uint16_t *quant_matrix;
nCoeffs= s->block_last_index[n];
-
+
quant_matrix = s->inter_matrix;
for(i=0; i<=nCoeffs; i++) {
int j= s->intra_scantable.permutated[i];
}
}
-static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
+static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level, nCoeffs;
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];
-
- if (n < 4)
+
+ if (n < 4)
block[0] = block[0] * s->y_dc_scale;
else
block[0] = block[0] * s->c_dc_scale;
}
}
-static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
+static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level, nCoeffs;
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];
-
+
quant_matrix = s->inter_matrix;
for(i=0; i<=nCoeffs; i++) {
int j= s->intra_scantable.permutated[i];
block[63]^=sum&1;
}
-static void dct_unquantize_h263_intra_c(MpegEncContext *s,
+static void dct_unquantize_h263_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level, qmul, qadd;
int nCoeffs;
-
+
assert(s->block_last_index[n]>=0);
-
+
qmul = qscale << 1;
-
+
if (!s->h263_aic) {
- if (n < 4)
+ if (n < 4)
block[0] = block[0] * s->y_dc_scale;
else
block[0] = block[0] * s->c_dc_scale;
}
}
-static void dct_unquantize_h263_inter_c(MpegEncContext *s,
+static void dct_unquantize_h263_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level, qmul, qadd;
int nCoeffs;
-
+
assert(s->block_last_index[n]>=0);
-
+
qadd = (qscale - 1) | 1;
qmul = qscale << 1;
-
+
nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
for(i=0; i<=nCoeffs; i++) {
* @file mpegvideo.h
* mpegvideo header.
*/
-
+
#ifndef AVCODEC_MPEGVIDEO_H
#define AVCODEC_MPEGVIDEO_H
FMT_MPEG1,
FMT_H261,
FMT_H263,
- FMT_MJPEG,
+ FMT_MJPEG,
FMT_H264,
};
*/
typedef struct RateControlContext{
FILE *stats_file;
- int num_entries; ///< number of RateControlEntries
+ int num_entries; ///< number of RateControlEntries
RateControlEntry *entry;
- double buffer_index; ///< amount of bits in the video/audio buffer
+ double buffer_index; ///< amount of bits in the video/audio buffer
Predictor pred[5];
- double short_term_qsum; ///< sum of recent qscales
- double short_term_qcount; ///< count of recent qscales
- double pass1_rc_eq_output_sum;///< sum of the output of the rc equation, this is used for normalization
- double pass1_wanted_bits; ///< bits which should have been outputed by the pass1 code (including complexity init)
+ double short_term_qsum; ///< sum of recent qscales
+ double short_term_qcount; ///< count of recent qscales
+ double pass1_rc_eq_output_sum;///< sum of the output of the rc equation, this is used for normalization
+ double pass1_wanted_bits; ///< bits which should have been outputed by the pass1 code (including complexity init)
double last_qscale;
- double last_qscale_for[5]; ///< last qscale for a specific pict type, used for max_diff & ipb factor stuff
+ double last_qscale_for[5]; ///< last qscale for a specific pict type, used for max_diff & ipb factor stuff
int last_mc_mb_var_sum;
int last_mb_var_sum;
uint64_t i_cplx_sum[5];
int ref_poc[2][16]; ///< h264 POCs of the frames used as reference
int ref_count[2]; ///< number of entries in ref_poc
- int mb_var_sum; ///< sum of MB variance for current frame
- int mc_mb_var_sum; ///< motion compensated MB variance for current frame
- uint16_t *mb_var; ///< Table for MB variances
- uint16_t *mc_mb_var; ///< Table for motion compensated MB variances
- uint8_t *mb_mean; ///< Table for MB luminance
+ int mb_var_sum; ///< sum of MB variance for current frame
+ int mc_mb_var_sum; ///< motion compensated MB variance for current frame
+ uint16_t *mb_var; ///< Table for MB variances
+ uint16_t *mc_mb_var; ///< Table for motion compensated MB variances
+ uint8_t *mb_mean; ///< Table for MB luminance
int32_t *mb_cmp_score; ///< Table for MB cmp scores, for mb decision FIXME remove
int b_frame_score; /* */
} Picture;
*/
typedef struct MotionEstContext{
AVCodecContext *avctx;
- int skip; ///< set if ME is skipped for the current MB
- int co_located_mv[4][2]; ///< mv from last p frame for direct mode ME
+ int skip; ///< set if ME is skipped for the current MB
+ int co_located_mv[4][2]; ///< mv from last p frame for direct mode ME
int direct_basis_mv[4][2];
- uint8_t *scratchpad; ///< data area for the me algo, so that the ME doesnt need to malloc/free
+ uint8_t *scratchpad; ///< data area for the me algo, so that the ME doesnt need to malloc/free
uint8_t *best_mb;
uint8_t *temp_mb[2];
uint8_t *temp;
int best_bits;
- uint32_t *map; ///< map to avoid duplicate evaluations
- uint32_t *score_map; ///< map to store the scores
- int map_generation;
+ uint32_t *map; ///< map to avoid duplicate evaluations
+ uint32_t *score_map; ///< map to store the scores
+ int map_generation;
int pre_penalty_factor;
int penalty_factor;
int sub_penalty_factor;
int flags;
int sub_flags;
int mb_flags;
- int pre_pass; ///< = 1 for the pre pass
+ int pre_pass; ///< = 1 for the pre pass
int dia_size;
int xmin;
int xmax;
op_pixels_func (*hpel_avg)[4];
qpel_mc_func (*qpel_put)[16];
qpel_mc_func (*qpel_avg)[16];
- uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV
+ uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV
uint8_t *current_mv_penalty;
int (*sub_motion_search)(struct MpegEncContext * s,
int *mx_ptr, int *my_ptr, int dmin,
typedef struct MpegEncContext {
struct AVCodecContext *avctx;
/* the following parameters must be initialized before encoding */
- int width, height;///< picture size. must be a multiple of 16
+ int width, height;///< picture size. must be a multiple of 16
int gop_size;
- int intra_only; ///< if true, only intra pictures are generated
- int bit_rate; ///< wanted bit rate
- enum OutputFormat out_format; ///< output format
- int h263_pred; ///< use mpeg4/h263 ac/dc predictions
+ int intra_only; ///< if true, only intra pictures are generated
+ int bit_rate; ///< wanted bit rate
+ enum OutputFormat out_format; ///< output format
+ int h263_pred; ///< use mpeg4/h263 ac/dc predictions
/* the following codec id fields are deprecated in favor of codec_id */
- int h263_plus; ///< h263 plus headers
+ int h263_plus; ///< h263 plus headers
int h263_msmpeg4; ///< generate MSMPEG4 compatible stream (deprecated, use msmpeg4_version instead)
- int h263_flv; ///< use flv h263 header
-
+ int h263_flv; ///< use flv h263 header
+
enum CodecID codec_id; /* see CODEC_ID_xxx */
- int fixed_qscale; ///< fixed qscale if non zero
- int encoding; ///< true if we are encoding (vs decoding)
- int flags; ///< AVCodecContext.flags (HQ, MV4, ...)
+ int fixed_qscale; ///< fixed qscale if non zero
+ int encoding; ///< true if we are encoding (vs decoding)
+ int flags; ///< AVCodecContext.flags (HQ, MV4, ...)
int flags2; ///< AVCodecContext.flags2
- int max_b_frames; ///< max number of b-frames for encoding
+ int max_b_frames; ///< max number of b-frames for encoding
int luma_elim_threshold;
int chroma_elim_threshold;
- int strict_std_compliance; ///< strictly follow the std (MPEG4, ...)
- int workaround_bugs; ///< workaround bugs in encoders which cannot be detected automatically
+ int strict_std_compliance; ///< strictly follow the std (MPEG4, ...)
+ int workaround_bugs; ///< workaround bugs in encoders which cannot be detected automatically
/* the following fields are managed internally by the encoder */
/** bit output */
int input_picture_number; ///< used to set pic->display_picture_number, shouldnt be used for/by anything else
int coded_picture_number; ///< used to set pic->coded_picture_number, shouldnt be used for/by anything else
int picture_number; //FIXME remove, unclear definition
- int picture_in_gop_number; ///< 0-> first pic in gop, ...
- int b_frames_since_non_b; ///< used for encoding, relative to not yet reordered input
+ int picture_in_gop_number; ///< 0-> first pic in gop, ...
+ int b_frames_since_non_b; ///< used for encoding, relative to not yet reordered input
int64_t user_specified_pts;///< last non zero pts from AVFrame which was passed into avcodec_encode_video()
- int mb_width, mb_height; ///< number of MBs horizontally & vertically
+ int mb_width, mb_height; ///< number of MBs horizontally & vertically
int mb_stride; ///< mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11
int b8_stride; ///< 2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
int b4_stride; ///< 4*mb_width+1 used for some 4x4 block arrays to allow simple addressing
int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replication)
- int mb_num; ///< number of MBs of a picture
- int linesize; ///< line size, in bytes, may be different from width
- int uvlinesize; ///< line size, for chroma in bytes, may be different from width
- Picture *picture; ///< main picture buffer
+ int mb_num; ///< number of MBs of a picture
+ int linesize; ///< line size, in bytes, may be different from width
+ int uvlinesize; ///< line size, for chroma in bytes, may be different from width
+ Picture *picture; ///< main picture buffer
Picture **input_picture; ///< next pictures on display order for encoding
Picture **reordered_input_picture; ///< pointer to the next pictures in codedorder for encoding
-
+
int start_mb_y; ///< start mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
int end_mb_y; ///< end mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y)
struct MpegEncContext *thread_context[MAX_THREADS];
-
- /**
+
+ /**
* copy of the previous picture structure.
* note, linesize & data, might not match the previous picture (for field pictures)
*/
- Picture last_picture;
-
- /**
+ Picture last_picture;
+
+ /**
* copy of the next picture structure.
* note, linesize & data, might not match the next picture (for field pictures)
*/
Picture next_picture;
-
- /**
+
+ /**
* copy of the source picture structure for encoding.
* note, linesize & data, might not match the source picture (for field pictures)
*/
Picture new_picture;
-
- /**
+
+ /**
* copy of the current picture structure.
* note, linesize & data, might not match the current picture (for field pictures)
*/
- Picture current_picture; ///< buffer to store the decompressed current picture
-
+ Picture current_picture; ///< buffer to store the decompressed current picture
+
Picture *last_picture_ptr; ///< pointer to the previous picture.
- Picture *next_picture_ptr; ///< pointer to the next picture (for bidir pred)
+ Picture *next_picture_ptr; ///< pointer to the next picture (for bidir pred)
Picture *current_picture_ptr; ///< pointer to the current picture
uint8_t *visualization_buffer[3]; //< temporary buffer vor MV visualization
- int last_dc[3]; ///< last DC values for MPEG1
+ int last_dc[3]; ///< last DC values for MPEG1
int16_t *dc_val_base;
- int16_t *dc_val[3]; ///< used for mpeg4 DC prediction, all 3 arrays must be continuous
+ int16_t *dc_val[3]; ///< used for mpeg4 DC prediction, all 3 arrays must be continuous
int16_t dc_cache[4*5];
int y_dc_scale, c_dc_scale;
- const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table
- const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table
+ const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table
+ const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table
const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (h263)
uint8_t *coded_block_base;
uint8_t *coded_block; ///< used for coded block pattern prediction (msmpeg4v3, wmv1)
int16_t (*ac_val_base)[16];
- int16_t (*ac_val[3])[16]; ///< used for for mpeg4 AC prediction, all 3 arrays must be continuous
+ int16_t (*ac_val[3])[16]; ///< used for for mpeg4 AC prediction, all 3 arrays must be continuous
int ac_pred;
- uint8_t *prev_pict_types; ///< previous picture types in bitstream order, used for mb skip
+ uint8_t *prev_pict_types; ///< previous picture types in bitstream order, used for mb skip
#define PREV_PICT_TYPES_BUFFER_SIZE 256
- int mb_skipped; ///< MUST BE SET only during DECODING
- uint8_t *mbskip_table; /**< used to avoid copy if macroblock skipped (for black regions for example)
+ int mb_skipped; ///< MUST BE SET only during DECODING
+ uint8_t *mbskip_table; /**< used to avoid copy if macroblock skipped (for black regions for example)
and used for b-frame encoding & decoding (contains skip table of next P Frame) */
- uint8_t *mbintra_table; ///< used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
- uint8_t *cbp_table; ///< used to store cbp, ac_pred for partitioned decoding
- uint8_t *pred_dir_table; ///< used to store pred_dir for partitioned decoding
+ uint8_t *mbintra_table; ///< used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
+ uint8_t *cbp_table; ///< used to store cbp, ac_pred for partitioned decoding
+ uint8_t *pred_dir_table; ///< used to store pred_dir for partitioned decoding
uint8_t *allocated_edge_emu_buffer;
uint8_t *edge_emu_buffer; ///< points into the middle of allocated_edge_emu_buffer
uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision
uint8_t *obmc_scratchpad;
uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers
- int qscale; ///< QP
- int chroma_qscale; ///< chroma QP
+ int qscale; ///< QP
+ int chroma_qscale; ///< chroma QP
int lambda; ///< lagrange multipler used in rate distortion
- int lambda2; ///< (lambda*lambda) >> FF_LAMBDA_SHIFT
+ int lambda2; ///< (lambda*lambda) >> FF_LAMBDA_SHIFT
int *lambda_table;
- int adaptive_quant; ///< use adaptive quantization
- int dquant; ///< qscale difference to prev qscale
- int pict_type; ///< I_TYPE, P_TYPE, B_TYPE, ...
+ int adaptive_quant; ///< use adaptive quantization
+ int dquant; ///< qscale difference to prev qscale
+ int pict_type; ///< I_TYPE, P_TYPE, B_TYPE, ...
int last_pict_type; //FIXME removes
- int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol
+ int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol
int dropable;
int frame_rate_index;
/* motion compensation */
- int unrestricted_mv; ///< mv can point outside of the coded picture
- int h263_long_vectors; ///< use horrible h263v1 long vector mode
+ int unrestricted_mv; ///< mv can point outside of the coded picture
+ int h263_long_vectors; ///< use horrible h263v1 long vector mode
int decode; ///< if 0 then decoding will be skipped (for encoding b frames for example)
DSPContext dsp; ///< pointers for accelerated dsp functions
- int f_code; ///< forward MV resolution
- int b_code; ///< backward MV resolution for B Frames (mpeg4)
+ int f_code; ///< forward MV resolution
+ int b_code; ///< backward MV resolution for B Frames (mpeg4)
int16_t (*p_mv_table_base)[2];
int16_t (*b_forw_mv_table_base)[2];
int16_t (*b_back_mv_table_base)[2];
- int16_t (*b_bidir_forw_mv_table_base)[2];
- int16_t (*b_bidir_back_mv_table_base)[2];
+ int16_t (*b_bidir_forw_mv_table_base)[2];
+ int16_t (*b_bidir_back_mv_table_base)[2];
int16_t (*b_direct_mv_table_base)[2];
int16_t (*p_field_mv_table_base[2][2])[2];
int16_t (*b_field_mv_table_base[2][2][2])[2];
- int16_t (*p_mv_table)[2]; ///< MV table (1MV per MB) p-frame encoding
- int16_t (*b_forw_mv_table)[2]; ///< MV table (1MV per MB) forward mode b-frame encoding
- int16_t (*b_back_mv_table)[2]; ///< MV table (1MV per MB) backward mode b-frame encoding
- int16_t (*b_bidir_forw_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
- int16_t (*b_bidir_back_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
- int16_t (*b_direct_mv_table)[2]; ///< MV table (1MV per MB) direct mode b-frame encoding
+ int16_t (*p_mv_table)[2]; ///< MV table (1MV per MB) p-frame encoding
+ int16_t (*b_forw_mv_table)[2]; ///< MV table (1MV per MB) forward mode b-frame encoding
+ int16_t (*b_back_mv_table)[2]; ///< MV table (1MV per MB) backward mode b-frame encoding
+ int16_t (*b_bidir_forw_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
+ int16_t (*b_bidir_back_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
+ int16_t (*b_direct_mv_table)[2]; ///< MV table (1MV per MB) direct mode b-frame encoding
int16_t (*p_field_mv_table[2][2])[2]; ///< MV table (2MV per MB) interlaced p-frame encoding
int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced b-frame encoding
uint8_t (*p_field_select_table[2]);
uint8_t (*b_field_select_table[2][2]);
- int me_method; ///< ME algorithm
+ int me_method; ///< ME algorithm
int mv_dir;
#define MV_DIR_BACKWARD 1
#define MV_DIR_FORWARD 2
#define MV_DIRECT 4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
int mv_type;
-#define MV_TYPE_16X16 0 ///< 1 vector for the whole mb
-#define MV_TYPE_8X8 1 ///< 4 vectors (h263, mpeg4 4MV)
-#define MV_TYPE_16X8 2 ///< 2 vectors, one per 16x8 block
-#define MV_TYPE_FIELD 3 ///< 2 vectors, one per field
-#define MV_TYPE_DMV 4 ///< 2 vectors, special mpeg2 Dual Prime Vectors
- /**motion vectors for a macroblock
+#define MV_TYPE_16X16 0 ///< 1 vector for the whole mb
+#define MV_TYPE_8X8 1 ///< 4 vectors (h263, mpeg4 4MV)
+#define MV_TYPE_16X8 2 ///< 2 vectors, one per 16x8 block
+#define MV_TYPE_FIELD 3 ///< 2 vectors, one per field
+#define MV_TYPE_DMV 4 ///< 2 vectors, special mpeg2 Dual Prime Vectors
+ /**motion vectors for a macroblock
first coordinate : 0 = forward 1 = backward
second " : depend on type
third " : 0 = x, 1 = y
*/
int mv[2][4][2];
int field_select[2][2];
- int last_mv[2][2][2]; ///< last MV, used for MV prediction in MPEG1 & B-frame MPEG4
- uint8_t *fcode_tab; ///< smallest fcode needed for each MV
-
+ int last_mv[2][2][2]; ///< last MV, used for MV prediction in MPEG1 & B-frame MPEG4
+ uint8_t *fcode_tab; ///< smallest fcode needed for each MV
+
MotionEstContext me;
- int no_rounding; /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
+ int no_rounding; /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
for b-frames rounding mode is allways 0 */
int hurry_up; /**< when set to 1 during decoding, b frames will be skipped
when set to 2 idct/dequant will be skipped too */
-
+
/* macroblock layer */
int mb_x, mb_y;
int mb_skip_run;
int block_index[6]; ///< index to current MB in block based arrays with edges
int block_wrap[6];
uint8_t *dest[3];
-
+
int *mb_index2xy; ///< mb_index -> mb_x + mb_y*mb_stride
/** matrix transmitted in the bitstream */
uint16_t inter_matrix[64];
uint16_t chroma_inter_matrix[64];
#define QUANT_BIAS_SHIFT 8
- int intra_quant_bias; ///< bias for the quantizer
- int inter_quant_bias; ///< bias for the quantizer
- int min_qcoeff; ///< minimum encodable coefficient
- int max_qcoeff; ///< maximum encodable coefficient
- int ac_esc_length; ///< num of bits needed to encode the longest esc
+ int intra_quant_bias; ///< bias for the quantizer
+ int inter_quant_bias; ///< bias for the quantizer
+ int min_qcoeff; ///< minimum encodable coefficient
+ int max_qcoeff; ///< maximum encodable coefficient
+ int ac_esc_length; ///< num of bits needed to encode the longest esc
uint8_t *intra_ac_vlc_length;
uint8_t *intra_ac_vlc_last_length;
uint8_t *inter_ac_vlc_length;
ScanTable intra_h_scantable;
ScanTable intra_v_scantable;
ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce tha cache usage
-
+
/* noise reduction */
int (*dct_error_sum)[64];
int dct_count[2];
/* bit rate control */
int64_t wanted_bits;
int64_t total_bits;
- int frame_bits; ///< bits used for the current frame
+ int frame_bits; ///< bits used for the current frame
RateControlContext rc_context; ///< contains stuff only accessed in ratecontrol.c
/* statistics, used for 2-pass encoding */
int skip_count;
int misc_bits; ///< cbp, mb_type
int last_bits; ///< temp var used for calculating the above vars
-
+
/* error concealment / resync */
int error_count;
- uint8_t *error_status_table; ///< table of the error status of each MB
-#define VP_START 1 ///< current MB is the first after a resync marker
+ uint8_t *error_status_table; ///< table of the error status of each MB
+#define VP_START 1 ///< current MB is the first after a resync marker
#define AC_ERROR 2
#define DC_ERROR 4
#define MV_ERROR 8
#define DC_END 32
#define MV_END 64
//FIXME some prefix?
-
- int resync_mb_x; ///< x position of last resync marker
- int resync_mb_y; ///< y position of last resync marker
- GetBitContext last_resync_gb; ///< used to search for the next resync marker
+
+ int resync_mb_x; ///< x position of last resync marker
+ int resync_mb_y; ///< y position of last resync marker
+ GetBitContext last_resync_gb; ///< used to search for the next resync marker
int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
- int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed b frames
+ int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed b frames
int error_resilience;
-
+
ParseContext parse_context;
/* H.263 specific */
int gob_index;
int obmc; ///< overlapped block motion compensation
-
+
/* H.263+ specific */
- int umvplus; ///< == H263+ && unrestricted_mv
- int h263_aic; ///< Advanded INTRA Coding (AIC)
+ int umvplus; ///< == H263+ && unrestricted_mv
+ int h263_aic; ///< Advanded INTRA Coding (AIC)
int h263_aic_dir; ///< AIC direction: 0 = left, 1 = top
int h263_slice_structured;
int alt_inter_vlc; ///< alternative inter vlc
int modified_quant;
- int loop_filter;
+ int loop_filter;
int custom_pcf;
-
+
/* mpeg4 specific */
- int time_increment_bits; ///< number of bits to represent the fractional part of time
+ int time_increment_bits; ///< number of bits to represent the fractional part of time
int last_time_base;
- int time_base; ///< time in seconds of last I,P,S Frame
- int64_t time; ///< time of current frame
+ int time_base; ///< time in seconds of last I,P,S Frame
+ int64_t time; ///< time of current frame
int64_t last_non_b_time;
- uint16_t pp_time; ///< time distance between the last 2 p,s,i frames
- uint16_t pb_time; ///< time distance between the last b and p,s,i frame
+ uint16_t pp_time; ///< time distance between the last 2 p,s,i frames
+ uint16_t pb_time; ///< time distance between the last b and p,s,i frame
uint16_t pp_field_time;
- uint16_t pb_field_time; ///< like above, just for interlaced
+ uint16_t pb_field_time; ///< like above, just for interlaced
int shape;
int vol_sprite_usage;
int sprite_width;
int sprite_brightness_change;
int num_sprite_warping_points;
int real_sprite_warping_points;
- int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY]
- int sprite_delta[2][2]; ///< sprite_delta [isY][isMVY]
- int sprite_shift[2]; ///< sprite shift [isChroma]
+ int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY]
+ int sprite_delta[2][2]; ///< sprite_delta [isY][isMVY]
+ int sprite_shift[2]; ///< sprite shift [isChroma]
int mcsel;
int quant_precision;
- int quarter_sample; ///< 1->qpel, 0->half pel ME/MC
+ int quarter_sample; ///< 1->qpel, 0->half pel ME/MC
int scalability;
int hierachy_type;
int enhancement_type;
int aspect_ratio_info; //FIXME remove
int sprite_warping_accuracy;
int low_latency_sprite;
- int data_partitioning; ///< data partitioning flag from header
- int partitioned_frame; ///< is current frame partitioned
- int rvlc; ///< reversible vlc
+ int data_partitioning; ///< data partitioning flag from header
+ int partitioned_frame; ///< is current frame partitioned
+ int rvlc; ///< reversible vlc
int resync_marker; ///< could this stream contain resync markers
- int low_delay; ///< no reordering needed / has no b-frames
+ int low_delay; ///< no reordering needed / has no b-frames
int vo_type;
- int vol_control_parameters; ///< does the stream contain the low_delay flag, used to workaround buggy encoders
- int intra_dc_threshold; ///< QP above whch the ac VLC should be used for intra dc
- PutBitContext tex_pb; ///< used for data partitioned VOPs
- PutBitContext pb2; ///< used for data partitioned VOPs
+ int vol_control_parameters; ///< does the stream contain the low_delay flag, used to workaround buggy encoders
+ int intra_dc_threshold; ///< QP above whch the ac VLC should be used for intra dc
+ PutBitContext tex_pb; ///< used for data partitioned VOPs
+ PutBitContext pb2; ///< used for data partitioned VOPs
int mpeg_quant;
- int t_frame; ///< time distance of first I -> B, used for interlaced b frames
- int padding_bug_score; ///< used to detect the VERY common padding bug in MPEG4
+ int t_frame; ///< time distance of first I -> B, used for interlaced b frames
+ int padding_bug_score; ///< used to detect the VERY common padding bug in MPEG4
/* divx specific, used to workaround (many) bugs in divx5 */
int divx_version;
uint8_t *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them
int bitstream_buffer_size;
int allocated_bitstream_buffer_size;
-
+
int xvid_build;
-
+
/* lavc specific stuff, used to workaround bugs in libavcodec */
int lavc_build;
-
+
/* RV10 specific */
- int rv10_version; ///< RV10 version: 0 or 3
+ int rv10_version; ///< RV10 version: 0 or 3
int rv10_first_dc_coded[3];
-
+
/* MJPEG specific */
struct MJpegContext *mjpeg_ctx;
- int mjpeg_vsample[3]; ///< vertical sampling factors, default = {2, 1, 1}
- int mjpeg_hsample[3]; ///< horizontal sampling factors, default = {2, 1, 1}
- int mjpeg_write_tables; ///< do we want to have quantisation- and huffmantables in the jpeg file ?
- int mjpeg_data_only_frames; ///< frames only with SOI, SOS and EOI markers
+ int mjpeg_vsample[3]; ///< vertical sampling factors, default = {2, 1, 1}
+ int mjpeg_hsample[3]; ///< horizontal sampling factors, default = {2, 1, 1}
+ int mjpeg_write_tables; ///< do we want to have quantisation- and huffmantables in the jpeg file ?
+ int mjpeg_data_only_frames; ///< frames only with SOI, SOS and EOI markers
/* MSMPEG4 specific */
int mv_table_index;
int rl_chroma_table_index;
int dc_table_index;
int use_skip_mb_code;
- int slice_height; ///< in macroblocks
- int first_slice_line; ///< used in mpeg4 too to handle resync markers
+ int slice_height; ///< in macroblocks
+ int first_slice_line; ///< used in mpeg4 too to handle resync markers
int flipflop_rounding;
int msmpeg4_version; ///< 0=not msmpeg4, 1=mp41, 2=mp42, 3=mp43/divx3 4=wmv1/7 5=wmv2/8
int per_mb_rl_table;
GetBitContext gb;
/* Mpeg1 specific */
- int gop_picture_number; ///< index of the first picture of a GOP based on fake_pic_num & mpeg1 specific
- int last_mv_dir; ///< last mv_dir, used for b frame encoding
+ int gop_picture_number; ///< index of the first picture of a GOP based on fake_pic_num & mpeg1 specific
+ int last_mv_dir; ///< last mv_dir, used for b frame encoding
int broken_link; ///< no_output_of_prior_pics_flag
- uint8_t *vbv_delay_ptr; ///< pointer to vbv_delay in the bitstream
-
+ uint8_t *vbv_delay_ptr; ///< pointer to vbv_delay in the bitstream
+
/* MPEG2 specific - I wish I had not to support this mess. */
int progressive_sequence;
int mpeg_f_code[2][2];
/* RTP specific */
int rtp_mode;
-
+
uint8_t *ptr_lastgob;
int swap_uv;//vcr2 codec is mpeg2 varint with UV swaped
short * pblocks[12];
-
- DCTELEM (*block)[64]; ///< points to one of the following blocks
+
+ DCTELEM (*block)[64]; ///< points to one of the following blocks
DCTELEM (*blocks)[6][64]; // for HQ mode we need to keep the best block
int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
#define SLICE_OK 0
#define SLICE_ERROR -1
#define SLICE_END -2 ///<end marker found
#define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded
-
- void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s,
+
+ void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s,
+ void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s,
+ void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s,
+ void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h263_intra)(struct MpegEncContext *s,
+ void (*dct_unquantize_h263_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h263_inter)(struct MpegEncContext *s,
+ void (*dct_unquantize_h263_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h261_intra)(struct MpegEncContext *s,
+ void (*dct_unquantize_h261_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_h261_inter)(struct MpegEncContext *s,
+ void (*dct_unquantize_h261_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
DCTELEM *block/*align 16*/, int n, int qscale);
void ff_clean_intra_table_entries(MpegEncContext *s);
void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable);
void ff_draw_horiz_band(MpegEncContext *s, int y, int h);
-void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h,
+void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h,
int src_x, int src_y, int w, int h);
#define END_NOT_FOUND -100
int ff_combine_frame(ParseContext *pc, int next, uint8_t **buf, int *buf_size);
void ff_init_me(MpegEncContext *s);
int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y);
inline int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
- int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
- int ref_mv_scale, int size, int h);
+ int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
+ int ref_mv_scale, int size, int h);
int inline ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
int ref_index, int size, int h, int add_rate);
/** RLTable. */
typedef struct RLTable {
- int n; ///< number of entries of table_vlc minus 1
- int last; ///< number of values for last = 0
+ int n; ///< number of entries of table_vlc minus 1
+ int last; ///< number of values for last = 0
const uint16_t (*table_vlc)[2];
const int8_t *table_run;
const int8_t *table_level;
- uint8_t *index_run[2]; ///< encoding only
- int8_t *max_level[2]; ///< encoding & decoding
- int8_t *max_run[2]; ///< encoding & decoding
+ uint8_t *index_run[2]; ///< encoding only
+ int8_t *max_level[2]; ///< encoding & decoding
+ int8_t *max_run[2]; ///< encoding & decoding
VLC vlc; ///< decoding only deprected FIXME remove
- RL_VLC_ELEM *rl_vlc[32]; ///< decoding only
+ RL_VLC_ELEM *rl_vlc[32]; ///< decoding only
} RLTable;
void init_rl(RLTable *rl, int use_static);
/* h263.c, h263dec.c */
int ff_h263_decode_init(AVCodecContext *avctx);
-int ff_h263_decode_frame(AVCodecContext *avctx,
+int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size);
int ff_h263_decode_end(AVCodecContext *avctx);
-void h263_encode_mb(MpegEncContext *s,
+void h263_encode_mb(MpegEncContext *s,
DCTELEM block[6][64],
int motion_x, int motion_y);
-void mpeg4_encode_mb(MpegEncContext *s,
+void mpeg4_encode_mb(MpegEncContext *s,
DCTELEM block[6][64],
int motion_x, int motion_y);
void h263_encode_picture_header(MpegEncContext *s, int picture_number);
void h263_encode_gob_header(MpegEncContext * s, int mb_line);
int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir,
int *px, int *py);
-void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
+void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
int dir);
void ff_set_mpeg4_time(MpegEncContext * s, int picture_number);
void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
/* msmpeg4.c */
void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
void msmpeg4_encode_ext_header(MpegEncContext * s);
-void msmpeg4_encode_mb(MpegEncContext * s,
+void msmpeg4_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int motion_x, int motion_y);
int msmpeg4_decode_picture_header(MpegEncContext * s);
uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
int motion_x, int motion_y, int h);
int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);
-void ff_wmv2_encode_mb(MpegEncContext * s,
+void ff_wmv2_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int motion_x, int motion_y);
/* mjpeg.c */
int mjpeg_init(MpegEncContext *s);
void mjpeg_close(MpegEncContext *s);
-void mjpeg_encode_mb(MpegEncContext *s,
+void mjpeg_encode_mb(MpegEncContext *s,
DCTELEM block[6][64]);
void mjpeg_picture_header(MpegEncContext *s);
void mjpeg_picture_trailer(MpegEncContext *s);
#include "mpegvideo.h"
/*
- * You can also call this codec : MPEG4 with a twist !
+ * You can also call this codec : MPEG4 with a twist !
*
- * TODO:
+ * TODO:
* - (encoding) select best mv table (two choices)
- * - (encoding) select best vlc/dc table
+ * - (encoding) select best vlc/dc table
*/
//#define DEBUG
static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int n, int coded, const uint8_t *scantable);
static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
-static int msmpeg4_decode_motion(MpegEncContext * s,
+static int msmpeg4_decode_motion(MpegEncContext * s,
int *mx_ptr, int *my_ptr);
static void msmpeg4v2_encode_motion(MpegEncContext * s, int val);
static void init_h263_dc_for_msmpeg4(void);
if (total == 0)
total = 1;
for(i=0;i<ST_NB;i++) {
- printf("%-10s : %10.1f %5.1f%%\n",
- st_names[i],
- (double)st_bit_counts[i] / 8.0,
+ printf("%-10s : %10.1f %5.1f%%\n",
+ st_names[i],
+ (double)st_bit_counts[i] / 8.0,
(double)st_bit_counts[i] * 100.0 / total);
}
printf("%-10s : %10.1f %5.1f%%\n",
- "total",
- (double)total / 8.0,
+ "total",
+ (double)total / 8.0,
100.0);
printf("Output:\n");
if (total == 0)
total = 1;
for(i=0;i<ST_NB;i++) {
- printf("%-10s : %10.1f %5.1f%%\n",
- st_names[i],
- (double)st_out_bit_counts[i] / 8.0,
+ printf("%-10s : %10.1f %5.1f%%\n",
+ st_names[i],
+ (double)st_out_bit_counts[i] / 8.0,
(double)st_out_bit_counts[i] * 100.0 / total);
}
printf("%-10s : %10.1f %5.1f%%\n",
- "total",
- (double)total / 8.0,
+ "total",
+ (double)total / 8.0,
100.0);
}
static void common_init(MpegEncContext * s)
{
static int inited=0;
-
+
switch(s->msmpeg4_version){
case 1:
case 2:
}
-
+
if(s->msmpeg4_version>=4){
ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , wmv1_scantable[1]);
ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, wmv1_scantable[2]);
ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , wmv1_scantable[0]);
}
//Note the default tables are set in common_init in mpegvideo.c
-
+
if(!inited){
inited=1;
/* mark all entries as not used */
for(i=0;i<4096;i++)
tab->table_mv_index[i] = tab->n;
-
+
for(i=0;i<tab->n;i++) {
x = tab->table_mvx[i];
y = tab->table_mvy[i];
int size=0;
int code;
int run_diff= intra ? 0 : 1;
-
+
code = get_rl_index(rl, last, run, level);
size+= rl->table_vlc[code][1];
if (code == rl->n) {
int level1, run1;
level1 = level - rl->max_level[last][run];
- if (level1 < 1)
+ if (level1 < 1)
goto esc2;
code = get_rl_index(rl, last, run, level1);
if (code == rl->n) {
int size=0;
if(i>0){// ;)
- size++;
+ size++;
chroma_size++;
}
for(level=0; level<=MAX_LEVEL; level++){
int inter_count = s->ac_stats[0][0][level][run][last] + s->ac_stats[0][1][level][run][last];
int intra_luma_count = s->ac_stats[1][0][level][run][last];
int intra_chroma_count= s->ac_stats[1][1][level][run][last];
-
+
if(s->pict_type==I_TYPE){
size += intra_luma_count *rl_length[i ][level][run][last];
chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last];
size+= intra_luma_count *rl_length[i ][level][run][last]
+intra_chroma_count*rl_length[i+3][level][run][last]
+inter_count *rl_length[i+3][level][run][last];
- }
+ }
}
if(last_size == size+chroma_size) break;
}
}
}
-// printf("type:%d, best:%d, qp:%d, var:%d, mcvar:%d, size:%d //\n",
+// printf("type:%d, best:%d, qp:%d, var:%d, mcvar:%d, size:%d //\n",
// s->pict_type, best, s->qscale, s->mb_var_sum, s->mc_mb_var_sum, best_size);
-
+
if(s->pict_type==P_TYPE) chroma_best= best;
memset(s->ac_stats, 0, sizeof(int)*(MAX_LEVEL+1)*(MAX_RUN+1)*2*2*2);
s->rl_table_index = best;
s->rl_chroma_table_index= chroma_best;
-
+
if(s->pict_type != s->last_non_b_pict_type){
s->rl_table_index= 2;
if(s->pict_type==I_TYPE)
if (s->pict_type == I_TYPE) {
s->slice_height= s->mb_height/1;
put_bits(&s->pb, 5, 0x16 + s->mb_height/s->slice_height);
-
+
if(s->msmpeg4_version==4){
msmpeg4_encode_ext_header(s);
if(s->bit_rate>MBAC_BITRATE)
}
} else {
put_bits(&s->pb, 1, s->use_skip_mb_code);
-
+
if(s->msmpeg4_version==4 && s->bit_rate>MBAC_BITRATE)
put_bits(&s->pb, 1, s->per_mb_rl_table);
wrap = s->b8_stride;
/* B C
- * A X
+ * A X
*/
a = s->coded_block[xy - 1 ];
b = s->coded_block[xy - 1 - wrap];
c = s->coded_block[xy - wrap];
-
+
if (b == c) {
pred = a;
} else {
pred = c;
}
-
+
/* store value */
*coded_block_ptr = &s->coded_block[xy];
#ifdef CONFIG_ENCODERS
-static void msmpeg4_encode_motion(MpegEncContext * s,
+static void msmpeg4_encode_motion(MpegEncContext * s,
int mx, int my)
{
int code;
my += 64;
else if (my >= 64)
my -= 64;
-
+
mx += 32;
my += 32;
#if 0
if ((unsigned)mx >= 64 ||
- (unsigned)my >= 64)
+ (unsigned)my >= 64)
fprintf(stderr, "error mx=%d my=%d\n", mx, my);
#endif
mv = &mv_tables[s->mv_table_index];
code = mv->table_mv_index[(mx << 6) | my];
set_stat(ST_MV);
- put_bits(&s->pb,
- mv->table_mv_bits[code],
+ put_bits(&s->pb,
+ mv->table_mv_bits[code],
mv->table_mv_code[code]);
if (code == mv->n) {
/* escape : code litterally */
}
s->first_slice_line = 1;
} else {
- s->first_slice_line = 0;
+ s->first_slice_line = 0;
}
}
}
-void msmpeg4_encode_mb(MpegEncContext * s,
+void msmpeg4_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int motion_x, int motion_y)
{
uint8_t *coded_block;
handle_slices(s);
-
+
if (!s->mb_intra) {
/* compute cbp */
set_stat(ST_INTER_MB);
}
if (s->use_skip_mb_code)
put_bits(&s->pb, 1, 0); /* mb coded */
-
+
if(s->msmpeg4_version<=2){
- put_bits(&s->pb,
- v2_mb_type[cbp&3][1],
+ put_bits(&s->pb,
+ v2_mb_type[cbp&3][1],
v2_mb_type[cbp&3][0]);
if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
else coded_cbp= cbp;
- put_bits(&s->pb,
- cbpy_tab[coded_cbp>>2][1],
+ put_bits(&s->pb,
+ cbpy_tab[coded_cbp>>2][1],
cbpy_tab[coded_cbp>>2][0]);
s->misc_bits += get_bits_diff(s);
msmpeg4v2_encode_motion(s, motion_x - pred_x);
msmpeg4v2_encode_motion(s, motion_y - pred_y);
}else{
- put_bits(&s->pb,
- table_mb_non_intra[cbp + 64][1],
+ put_bits(&s->pb,
+ table_mb_non_intra[cbp + 64][1],
table_mb_non_intra[cbp + 64][0]);
s->misc_bits += get_bits_diff(s);
/* motion vector */
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- msmpeg4_encode_motion(s, motion_x - pred_x,
+ msmpeg4_encode_motion(s, motion_x - pred_x,
motion_y - pred_y);
}
if(s->msmpeg4_version<=2){
if (s->pict_type == I_TYPE) {
- put_bits(&s->pb,
+ put_bits(&s->pb,
v2_intra_cbpc[cbp&3][1], v2_intra_cbpc[cbp&3][0]);
} else {
if (s->use_skip_mb_code)
put_bits(&s->pb, 1, 0); /* mb coded */
- put_bits(&s->pb,
- v2_mb_type[(cbp&3) + 4][1],
+ put_bits(&s->pb,
+ v2_mb_type[(cbp&3) + 4][1],
v2_mb_type[(cbp&3) + 4][0]);
}
put_bits(&s->pb, 1, 0); /* no AC prediction yet */
- put_bits(&s->pb,
- cbpy_tab[cbp>>2][1],
+ put_bits(&s->pb,
+ cbpy_tab[cbp>>2][1],
cbpy_tab[cbp>>2][0]);
}else{
if (s->pict_type == I_TYPE) {
set_stat(ST_INTRA_MB);
- put_bits(&s->pb,
+ put_bits(&s->pb,
ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
} else {
if (s->use_skip_mb_code)
put_bits(&s->pb, 1, 0); /* mb coded */
- put_bits(&s->pb,
- table_mb_non_intra[cbp][1],
+ put_bits(&s->pb,
+ table_mb_non_intra[cbp][1],
table_mb_non_intra[cbp][0]);
}
set_stat(ST_INTRA_MB);
#endif //CONFIG_ENCODERS
-static inline int msmpeg4v1_pred_dc(MpegEncContext * s, int n,
+static inline int msmpeg4v1_pred_dc(MpegEncContext * s, int n,
int32_t **dc_val_ptr)
{
int i;
} else {
i= n-3;
}
-
+
*dc_val_ptr= &s->last_dc[i];
- return s->last_dc[i];
+ return s->last_dc[i];
}
static int get_dc(uint8_t *src, int stride, int scale)
}
/* dir = 0: left, dir = 1: top prediction */
-static inline int msmpeg4_pred_dc(MpegEncContext * s, int n,
+static inline int msmpeg4_pred_dc(MpegEncContext * s, int n,
uint16_t **dc_val_ptr, int *dir_ptr)
{
int a, b, c, wrap, pred, scale;
} else {
scale = s->c_dc_scale;
}
-
+
wrap = s->block_wrap[n];
dc_val= s->dc_val[0] + s->block_index[n];
/* B C
- * A X
+ * A X
*/
a = dc_val[ - 1];
b = dc_val[ - 1 - wrap];
c = dc_val[ - wrap];
-
+
if(s->first_slice_line && (n&2)==0 && s->msmpeg4_version<4){
b=c=1024;
}
if(s->inter_intra_pred){
uint8_t *dest;
int wrap;
-
+
if(n==1){
pred=a;
*dir_ptr = 0;
else a= get_dc(dest-8, wrap, scale*8);
if(s->mb_y==0) c= (1024 + (scale>>1))/scale;
else c= get_dc(dest-8*wrap, wrap, scale*8);
-
+
if (s->h263_aic_dir==0) {
pred= a;
*dir_ptr = 0;
if(s->msmpeg4_version==1){
int32_t *dc_val;
pred = msmpeg4v1_pred_dc(s, n, &dc_val);
-
+
/* update predictor */
*dc_val= level;
}else{
if(s->msmpeg4_version<=2){
if (n < 4) {
- put_bits(&s->pb,
+ put_bits(&s->pb,
v2_dc_lum_table[level+256][1],
v2_dc_lum_table[level+256][0]);
}else{
- put_bits(&s->pb,
+ put_bits(&s->pb,
v2_dc_chroma_table[level+256][1],
v2_dc_chroma_table[level+256][0]);
}
sign = 1;
}
code = level;
- if (code > DC_MAX)
+ if (code > DC_MAX)
code = DC_MAX;
if (s->dc_table_index == 0) {
put_bits(&s->pb, ff_table1_dc_chroma[code][1], ff_table1_dc_chroma[code][0]);
}
}
-
+
if (code == DC_MAX)
put_bits(&s->pb, 8, level);
-
+
if (level != 0) {
put_bits(&s->pb, 1, sign);
}
int level1, run1;
level1 = level - rl->max_level[last][run];
- if (level1 < 1)
+ if (level1 < 1)
goto esc2;
code = get_rl_index(rl, last, run, level1);
if (code == rl->n) {
uni_code= DCtab_chrom[size][0];
uni_len = DCtab_chrom[size][1];
uni_code ^= (1<<uni_len)-1; //M$ doesnt like compatibility
-
+
if (size > 0) {
uni_code<<=size; uni_code|=l;
uni_len+=size;
}
for(i=0;i<2;i++) {
mv = &mv_tables[i];
- init_vlc(&mv->vlc, MV_VLC_BITS, mv->n + 1,
+ init_vlc(&mv->vlc, MV_VLC_BITS, mv->n + 1,
mv->table_mv_bits, 1, 1,
mv->table_mv_code, 2, 2, 1);
}
- init_vlc(&ff_msmp4_dc_luma_vlc[0], DC_VLC_BITS, 120,
+ init_vlc(&ff_msmp4_dc_luma_vlc[0], DC_VLC_BITS, 120,
&ff_table0_dc_lum[0][1], 8, 4,
&ff_table0_dc_lum[0][0], 8, 4, 1);
- init_vlc(&ff_msmp4_dc_chroma_vlc[0], DC_VLC_BITS, 120,
+ init_vlc(&ff_msmp4_dc_chroma_vlc[0], DC_VLC_BITS, 120,
&ff_table0_dc_chroma[0][1], 8, 4,
&ff_table0_dc_chroma[0][0], 8, 4, 1);
- init_vlc(&ff_msmp4_dc_luma_vlc[1], DC_VLC_BITS, 120,
+ init_vlc(&ff_msmp4_dc_luma_vlc[1], DC_VLC_BITS, 120,
&ff_table1_dc_lum[0][1], 8, 4,
&ff_table1_dc_lum[0][0], 8, 4, 1);
- init_vlc(&ff_msmp4_dc_chroma_vlc[1], DC_VLC_BITS, 120,
+ init_vlc(&ff_msmp4_dc_chroma_vlc[1], DC_VLC_BITS, 120,
&ff_table1_dc_chroma[0][1], 8, 4,
&ff_table1_dc_chroma[0][0], 8, 4, 1);
-
- init_vlc(&v2_dc_lum_vlc, DC_VLC_BITS, 512,
+
+ init_vlc(&v2_dc_lum_vlc, DC_VLC_BITS, 512,
&v2_dc_lum_table[0][1], 8, 4,
&v2_dc_lum_table[0][0], 8, 4, 1);
- init_vlc(&v2_dc_chroma_vlc, DC_VLC_BITS, 512,
+ init_vlc(&v2_dc_chroma_vlc, DC_VLC_BITS, 512,
&v2_dc_chroma_table[0][1], 8, 4,
&v2_dc_chroma_table[0][0], 8, 4, 1);
-
+
init_vlc(&cbpy_vlc, CBPY_VLC_BITS, 16,
&cbpy_tab[0][1], 2, 1,
&cbpy_tab[0][0], 2, 1, 1);
&mvtab[0][0], 2, 1, 1);
for(i=0; i<4; i++){
- init_vlc(&mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128,
+ init_vlc(&mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128,
&wmv2_inter_table[i][0][1], 8, 4,
&wmv2_inter_table[i][0][0], 8, 4, 1); //FIXME name?
}
-
- init_vlc(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
+
+ init_vlc(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
&ff_msmp4_mb_i_table[0][1], 4, 2,
&ff_msmp4_mb_i_table[0][0], 4, 2, 1);
-
- init_vlc(&v1_intra_cbpc_vlc, V1_INTRA_CBPC_VLC_BITS, 8,
+
+ init_vlc(&v1_intra_cbpc_vlc, V1_INTRA_CBPC_VLC_BITS, 8,
intra_MCBPC_bits, 1, 1,
intra_MCBPC_code, 1, 1, 1);
- init_vlc(&v1_inter_cbpc_vlc, V1_INTER_CBPC_VLC_BITS, 25,
+ init_vlc(&v1_inter_cbpc_vlc, V1_INTER_CBPC_VLC_BITS, 25,
inter_MCBPC_bits, 1, 1,
inter_MCBPC_code, 1, 1, 1);
-
- init_vlc(&inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
+
+ init_vlc(&inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
&table_inter_intra[0][1], 2, 1,
&table_inter_intra[0][0], 2, 1, 1);
}
-
+
switch(s->msmpeg4_version){
case 1:
case 2:
//FIXME + TODO VC9 decode mb
break;
}
-
+
s->slice_height= s->mb_height; //to avoid 1/0 if the first frame isnt a keyframe
-
+
return 0;
}
}
if (s->pict_type == I_TYPE) {
- code = get_bits(&s->gb, 5);
+ code = get_bits(&s->gb, 5);
if(s->msmpeg4_version==1){
if(code==0 || code>s->mb_height){
av_log(s->avctx, AV_LOG_ERROR, "invalid slice height %d\n", code);
if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb);
else s->per_mb_rl_table= 0;
-
+
if(!s->per_mb_rl_table){
s->rl_chroma_table_index = decode012(&s->gb);
s->rl_table_index = decode012(&s->gb);
}
s->no_rounding = 1;
if(s->avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d slice:%d \n",
+ av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d slice:%d \n",
s->qscale,
s->rl_chroma_table_index,
- s->rl_table_index,
+ s->rl_table_index,
s->dc_table_index,
s->per_mb_rl_table,
s->slice_height);
s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
break;
}
-
+
if(s->avctx->debug&FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "skip:%d rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d \n",
- s->use_skip_mb_code,
- s->rl_table_index,
- s->rl_chroma_table_index,
+ av_log(s->avctx, AV_LOG_DEBUG, "skip:%d rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d \n",
+ s->use_skip_mb_code,
+ s->rl_table_index,
+ s->rl_chroma_table_index,
s->dc_table_index,
s->mv_table_index,
s->per_mb_rl_table,
code = (val >> bit_size) + 1;
bits = val & (range - 1);
- put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
+ put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
if (bit_size > 0) {
put_bits(&s->pb, bit_size, bits);
}
static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
{
int cbp, code, i;
-
+
if (s->pict_type == P_TYPE) {
if (s->use_skip_mb_code) {
if (get_bits1(&s->gb)) {
}
s->mb_intra = code >>2;
-
+
cbp = code & 0x3;
} else {
s->mb_intra = 1;
if (!s->mb_intra) {
int mx, my, cbpy;
-
+
cbpy= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1);
if(cbpy<0){
av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
cbp|= cbpy<<2;
if(s->msmpeg4_version==1 || (cbp&3) != 3) cbp^= 0x3C;
-
+
h263_pred_motion(s, 0, 0, &mx, &my);
mx= msmpeg4v2_decode_motion(s, mx, 1);
my= msmpeg4v2_decode_motion(s, my, 1);
-
+
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
s->mv[0][0][0] = mx;
return 0;
}
}
-
+
code = get_vlc2(&s->gb, mb_non_intra_vlc[DEFAULT_INTER_INDEX].table, MB_NON_INTRA_VLC_BITS, 3);
if (code < 0)
return -1;
//s->mb_intra = (code & 0x40) ? 0 : 1;
s->mb_intra = (~code & 0x40) >> 6;
-
+
cbp = code & 0x3f;
} else {
set_stat(ST_INTRA_MB);
return -1;
}
}
-
+
return 0;
}
//#define ERROR_DETAILS
/* DC coef */
set_stat(ST_DC);
level = msmpeg4_decode_dc(s, n, &dc_pred_dir);
-
+
if (level < 0){
av_log(s->avctx, AV_LOG_ERROR, "dc overflow- block: %d qscale: %d//\n", n, s->qscale);
if(s->inter_intra_pred) level=0;
goto not_coded;
}
if (s->ac_pred) {
- if (dc_pred_dir == 0)
+ if (dc_pred_dir == 0)
scan_table = s->intra_v_scantable.permutated; /* left */
else
scan_table = s->intra_h_scantable.permutated; /* top */
run= SHOW_UBITS(re, &s->gb, 6); SKIP_CACHE(re, &s->gb, 6);
level= SHOW_SBITS(re, &s->gb, 8); LAST_SKIP_CACHE(re, &s->gb, 8);
SKIP_COUNTER(re, &s->gb, 1+6+8);
- }else{
+ }else{
int sign;
last= SHOW_UBITS(re, &s->gb, 1); SKIP_BITS(re, &s->gb, 1);
if(!s->esc3_level_length){
//printf("level length:%d, run length: %d\n", ll, s->esc3_run_length);
UPDATE_CACHE(re, &s->gb);
}
- run= SHOW_UBITS(re, &s->gb, s->esc3_run_length);
+ run= SHOW_UBITS(re, &s->gb, s->esc3_run_length);
SKIP_BITS(re, &s->gb, s->esc3_run_length);
-
- sign= SHOW_UBITS(re, &s->gb, 1);
+
+ sign= SHOW_UBITS(re, &s->gb, 1);
SKIP_BITS(re, &s->gb, 1);
-
- level= SHOW_UBITS(re, &s->gb, s->esc3_level_length);
+
+ level= SHOW_UBITS(re, &s->gb, s->esc3_level_length);
SKIP_BITS(re, &s->gb, s->esc3_level_length);
if(sign) level= -level;
}
}
if(s->msmpeg4_version>=4 && i>0) i=63; //FIXME/XXX optimize
s->block_last_index[n] = i;
-
+
return 0;
}
} else {
level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, DC_VLC_BITS, 3);
}
- if (level < 0)
+ if (level < 0)
return -1;
level-=256;
}else{ //FIXME optimize use unified tables & index
int32_t *dc_val;
pred = msmpeg4v1_pred_dc(s, n, &dc_val);
level += pred;
-
+
/* update predictor */
*dc_val= level;
}else{
return level;
}
-static int msmpeg4_decode_motion(MpegEncContext * s,
+static int msmpeg4_decode_motion(MpegEncContext * s,
int *mx_ptr, int *my_ptr)
{
MVTable *mv;
/* cleanest way to support it
* there is too much shared between versions so that we cant have 1 file per version & 1 common
- * as allmost everything would be in the common file
+ * as allmost everything would be in the common file
*/
#include "wmv2.c"
/**
* @file msmpeg4data.h
- * MSMPEG4 data tables.
+ * MSMPEG4 data tables.
*/
/* intra picture macro block coded block pattern */
#define WMV1_SCANTABLE_COUNT 4
static const uint8_t wmv1_scantable00[64]= {
-0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
-0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
-0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05,
-0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A,
-0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F,
-0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34,
-0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35,
-0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F,
+0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
+0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
+0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05,
+0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A,
+0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F,
+0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34,
+0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35,
+0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F,
};
static const uint8_t wmv1_scantable01[64]= {
-0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
-0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
-0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D,
-0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A,
-0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D,
-0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25,
-0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35,
-0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F,
+0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
+0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
+0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D,
+0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A,
+0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D,
+0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25,
+0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35,
+0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F,
};
static const uint8_t wmv1_scantable02[64]= {
-0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18,
-0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20,
-0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07,
-0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39,
-0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D,
-0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E,
-0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35,
-0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
+0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18,
+0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20,
+0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07,
+0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39,
+0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D,
+0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E,
+0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35,
+0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
};
static const uint8_t wmv1_scantable03[64]= {
-0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09,
-0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29,
-0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13,
-0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C,
-0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24,
-0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E,
-0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35,
-0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
+0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09,
+0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29,
+0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13,
+0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C,
+0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24,
+0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E,
+0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35,
+0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F,
};
static const uint8_t *wmv1_scantable[WMV1_SCANTABLE_COUNT+1]={
#define WMV2_INTER_CBP_TABLE_COUNT 4
static const uint32_t table_mb_non_intra2[128][2] = {
-{0x0000A7, 14}, {0x01B2B8, 18}, {0x01B28E, 18}, {0x036575, 19},
-{0x006CAC, 16}, {0x000A69, 18}, {0x002934, 20}, {0x00526B, 21},
-{0x006CA1, 16}, {0x01B2B9, 18}, {0x0029AD, 20}, {0x029353, 24},
-{0x006CA7, 16}, {0x006CAB, 16}, {0x01B2BB, 18}, {0x00029B, 16},
-{0x00D944, 17}, {0x000A6A, 18}, {0x0149A8, 23}, {0x03651F, 19},
-{0x006CAF, 16}, {0x000A4C, 18}, {0x03651E, 19}, {0x000A48, 18},
-{0x00299C, 20}, {0x00299F, 20}, {0x029352, 24}, {0x0029AC, 20},
-{0x000296, 16}, {0x00D946, 17}, {0x000A68, 18}, {0x000298, 16},
-{0x000527, 17}, {0x00D94D, 17}, {0x0014D7, 19}, {0x036574, 19},
-{0x000A5C, 18}, {0x01B299, 18}, {0x00299D, 20}, {0x00299E, 20},
-{0x000525, 17}, {0x000A66, 18}, {0x00A4D5, 22}, {0x00149B, 19},
-{0x000295, 16}, {0x006CAD, 16}, {0x000A49, 18}, {0x000521, 17},
-{0x006CAA, 16}, {0x00D945, 17}, {0x01B298, 18}, {0x00052F, 17},
-{0x003654, 15}, {0x006CA0, 16}, {0x000532, 17}, {0x000291, 16},
-{0x003652, 15}, {0x000520, 17}, {0x000A5D, 18}, {0x000294, 16},
-{0x00009B, 11}, {0x0006E2, 12}, {0x000028, 12}, {0x0001B0, 10},
-{0x000001, 3}, {0x000010, 8}, {0x00002F, 6}, {0x00004C, 10},
-{0x00000D, 4}, {0x000000, 10}, {0x000006, 9}, {0x000134, 12},
-{0x00000C, 4}, {0x000007, 10}, {0x000007, 9}, {0x0006E1, 12},
-{0x00000E, 5}, {0x0000DA, 9}, {0x000022, 9}, {0x000364, 11},
-{0x00000F, 4}, {0x000006, 10}, {0x00000F, 9}, {0x000135, 12},
-{0x000014, 5}, {0x0000DD, 9}, {0x000004, 9}, {0x000015, 11},
-{0x00001A, 6}, {0x0001B3, 10}, {0x000005, 10}, {0x0006E3, 12},
-{0x00000C, 5}, {0x0000B9, 8}, {0x000004, 8}, {0x0000DB, 9},
-{0x00000E, 4}, {0x00000B, 10}, {0x000023, 9}, {0x0006CB, 12},
-{0x000005, 6}, {0x0001B1, 10}, {0x000001, 10}, {0x0006E0, 12},
-{0x000011, 5}, {0x0000DF, 9}, {0x00000E, 9}, {0x000373, 11},
-{0x000003, 5}, {0x0000B8, 8}, {0x000006, 8}, {0x000175, 9},
-{0x000015, 5}, {0x000174, 9}, {0x000027, 9}, {0x000372, 11},
-{0x000010, 5}, {0x0000BB, 8}, {0x000005, 8}, {0x0000DE, 9},
-{0x00000F, 5}, {0x000001, 9}, {0x000012, 8}, {0x000004, 10},
-{0x000002, 3}, {0x000016, 5}, {0x000009, 4}, {0x000001, 5},
+{0x0000A7, 14}, {0x01B2B8, 18}, {0x01B28E, 18}, {0x036575, 19},
+{0x006CAC, 16}, {0x000A69, 18}, {0x002934, 20}, {0x00526B, 21},
+{0x006CA1, 16}, {0x01B2B9, 18}, {0x0029AD, 20}, {0x029353, 24},
+{0x006CA7, 16}, {0x006CAB, 16}, {0x01B2BB, 18}, {0x00029B, 16},
+{0x00D944, 17}, {0x000A6A, 18}, {0x0149A8, 23}, {0x03651F, 19},
+{0x006CAF, 16}, {0x000A4C, 18}, {0x03651E, 19}, {0x000A48, 18},
+{0x00299C, 20}, {0x00299F, 20}, {0x029352, 24}, {0x0029AC, 20},
+{0x000296, 16}, {0x00D946, 17}, {0x000A68, 18}, {0x000298, 16},
+{0x000527, 17}, {0x00D94D, 17}, {0x0014D7, 19}, {0x036574, 19},
+{0x000A5C, 18}, {0x01B299, 18}, {0x00299D, 20}, {0x00299E, 20},
+{0x000525, 17}, {0x000A66, 18}, {0x00A4D5, 22}, {0x00149B, 19},
+{0x000295, 16}, {0x006CAD, 16}, {0x000A49, 18}, {0x000521, 17},
+{0x006CAA, 16}, {0x00D945, 17}, {0x01B298, 18}, {0x00052F, 17},
+{0x003654, 15}, {0x006CA0, 16}, {0x000532, 17}, {0x000291, 16},
+{0x003652, 15}, {0x000520, 17}, {0x000A5D, 18}, {0x000294, 16},
+{0x00009B, 11}, {0x0006E2, 12}, {0x000028, 12}, {0x0001B0, 10},
+{0x000001, 3}, {0x000010, 8}, {0x00002F, 6}, {0x00004C, 10},
+{0x00000D, 4}, {0x000000, 10}, {0x000006, 9}, {0x000134, 12},
+{0x00000C, 4}, {0x000007, 10}, {0x000007, 9}, {0x0006E1, 12},
+{0x00000E, 5}, {0x0000DA, 9}, {0x000022, 9}, {0x000364, 11},
+{0x00000F, 4}, {0x000006, 10}, {0x00000F, 9}, {0x000135, 12},
+{0x000014, 5}, {0x0000DD, 9}, {0x000004, 9}, {0x000015, 11},
+{0x00001A, 6}, {0x0001B3, 10}, {0x000005, 10}, {0x0006E3, 12},
+{0x00000C, 5}, {0x0000B9, 8}, {0x000004, 8}, {0x0000DB, 9},
+{0x00000E, 4}, {0x00000B, 10}, {0x000023, 9}, {0x0006CB, 12},
+{0x000005, 6}, {0x0001B1, 10}, {0x000001, 10}, {0x0006E0, 12},
+{0x000011, 5}, {0x0000DF, 9}, {0x00000E, 9}, {0x000373, 11},
+{0x000003, 5}, {0x0000B8, 8}, {0x000006, 8}, {0x000175, 9},
+{0x000015, 5}, {0x000174, 9}, {0x000027, 9}, {0x000372, 11},
+{0x000010, 5}, {0x0000BB, 8}, {0x000005, 8}, {0x0000DE, 9},
+{0x00000F, 5}, {0x000001, 9}, {0x000012, 8}, {0x000004, 10},
+{0x000002, 3}, {0x000016, 5}, {0x000009, 4}, {0x000001, 5},
};
static const uint32_t table_mb_non_intra3[128][2] = {
-{0x0002A1, 10}, {0x005740, 15}, {0x01A0BF, 18}, {0x015D19, 17},
-{0x001514, 13}, {0x00461E, 15}, {0x015176, 17}, {0x015177, 17},
-{0x0011AD, 13}, {0x00682E, 16}, {0x0682F9, 20}, {0x03417D, 19},
-{0x001A36, 14}, {0x002A2D, 14}, {0x00D05E, 17}, {0x006824, 16},
-{0x001515, 13}, {0x00545C, 15}, {0x0230E9, 18}, {0x011AFA, 17},
-{0x0015D7, 13}, {0x005747, 15}, {0x008D79, 16}, {0x006825, 16},
-{0x002BA2, 14}, {0x00A8BA, 16}, {0x0235F6, 18}, {0x015D18, 17},
-{0x0011AE, 13}, {0x00346F, 15}, {0x008C3B, 16}, {0x00346E, 15},
-{0x000D1A, 13}, {0x00461F, 15}, {0x0682F8, 20}, {0x011875, 17},
-{0x002BA1, 14}, {0x008D61, 16}, {0x0235F7, 18}, {0x0230E8, 18},
-{0x001513, 13}, {0x008D7B, 16}, {0x011AF4, 17}, {0x011AF5, 17},
-{0x001185, 13}, {0x0046BF, 15}, {0x008D60, 16}, {0x008D7C, 16},
-{0x001512, 13}, {0x00461C, 15}, {0x00AE8D, 16}, {0x008D78, 16},
-{0x000D0E, 13}, {0x003413, 15}, {0x0046B1, 15}, {0x003416, 15},
-{0x000AEA, 12}, {0x002A2C, 14}, {0x005741, 15}, {0x002A2F, 14},
-{0x000158, 9}, {0x0008D2, 12}, {0x00054C, 11}, {0x000686, 12},
-{0x000000, 2}, {0x000069, 8}, {0x00006B, 8}, {0x00068C, 12},
-{0x000007, 3}, {0x00015E, 9}, {0x0002A3, 10}, {0x000AE9, 12},
-{0x000006, 3}, {0x000231, 10}, {0x0002B8, 10}, {0x001A08, 14},
-{0x000010, 5}, {0x0001A9, 10}, {0x000342, 11}, {0x000A88, 12},
-{0x000004, 4}, {0x0001A2, 10}, {0x0002A4, 10}, {0x001184, 13},
-{0x000012, 5}, {0x000232, 10}, {0x0002B2, 10}, {0x000680, 12},
-{0x00001B, 6}, {0x00046A, 11}, {0x00068E, 12}, {0x002359, 14},
-{0x000016, 5}, {0x00015F, 9}, {0x0002A0, 10}, {0x00054D, 11},
-{0x000005, 4}, {0x000233, 10}, {0x0002B9, 10}, {0x0015D6, 13},
-{0x000022, 6}, {0x000468, 11}, {0x000683, 12}, {0x001A0A, 14},
-{0x000013, 5}, {0x000236, 10}, {0x0002BB, 10}, {0x001186, 13},
-{0x000017, 5}, {0x0001AB, 10}, {0x0002A7, 10}, {0x0008D3, 12},
-{0x000014, 5}, {0x000237, 10}, {0x000460, 11}, {0x000D0F, 13},
-{0x000019, 6}, {0x0001AA, 10}, {0x0002B3, 10}, {0x000681, 12},
-{0x000018, 6}, {0x0001A8, 10}, {0x0002A5, 10}, {0x00068F, 12},
-{0x000007, 4}, {0x000055, 7}, {0x000047, 7}, {0x0000AD, 8},
+{0x0002A1, 10}, {0x005740, 15}, {0x01A0BF, 18}, {0x015D19, 17},
+{0x001514, 13}, {0x00461E, 15}, {0x015176, 17}, {0x015177, 17},
+{0x0011AD, 13}, {0x00682E, 16}, {0x0682F9, 20}, {0x03417D, 19},
+{0x001A36, 14}, {0x002A2D, 14}, {0x00D05E, 17}, {0x006824, 16},
+{0x001515, 13}, {0x00545C, 15}, {0x0230E9, 18}, {0x011AFA, 17},
+{0x0015D7, 13}, {0x005747, 15}, {0x008D79, 16}, {0x006825, 16},
+{0x002BA2, 14}, {0x00A8BA, 16}, {0x0235F6, 18}, {0x015D18, 17},
+{0x0011AE, 13}, {0x00346F, 15}, {0x008C3B, 16}, {0x00346E, 15},
+{0x000D1A, 13}, {0x00461F, 15}, {0x0682F8, 20}, {0x011875, 17},
+{0x002BA1, 14}, {0x008D61, 16}, {0x0235F7, 18}, {0x0230E8, 18},
+{0x001513, 13}, {0x008D7B, 16}, {0x011AF4, 17}, {0x011AF5, 17},
+{0x001185, 13}, {0x0046BF, 15}, {0x008D60, 16}, {0x008D7C, 16},
+{0x001512, 13}, {0x00461C, 15}, {0x00AE8D, 16}, {0x008D78, 16},
+{0x000D0E, 13}, {0x003413, 15}, {0x0046B1, 15}, {0x003416, 15},
+{0x000AEA, 12}, {0x002A2C, 14}, {0x005741, 15}, {0x002A2F, 14},
+{0x000158, 9}, {0x0008D2, 12}, {0x00054C, 11}, {0x000686, 12},
+{0x000000, 2}, {0x000069, 8}, {0x00006B, 8}, {0x00068C, 12},
+{0x000007, 3}, {0x00015E, 9}, {0x0002A3, 10}, {0x000AE9, 12},
+{0x000006, 3}, {0x000231, 10}, {0x0002B8, 10}, {0x001A08, 14},
+{0x000010, 5}, {0x0001A9, 10}, {0x000342, 11}, {0x000A88, 12},
+{0x000004, 4}, {0x0001A2, 10}, {0x0002A4, 10}, {0x001184, 13},
+{0x000012, 5}, {0x000232, 10}, {0x0002B2, 10}, {0x000680, 12},
+{0x00001B, 6}, {0x00046A, 11}, {0x00068E, 12}, {0x002359, 14},
+{0x000016, 5}, {0x00015F, 9}, {0x0002A0, 10}, {0x00054D, 11},
+{0x000005, 4}, {0x000233, 10}, {0x0002B9, 10}, {0x0015D6, 13},
+{0x000022, 6}, {0x000468, 11}, {0x000683, 12}, {0x001A0A, 14},
+{0x000013, 5}, {0x000236, 10}, {0x0002BB, 10}, {0x001186, 13},
+{0x000017, 5}, {0x0001AB, 10}, {0x0002A7, 10}, {0x0008D3, 12},
+{0x000014, 5}, {0x000237, 10}, {0x000460, 11}, {0x000D0F, 13},
+{0x000019, 6}, {0x0001AA, 10}, {0x0002B3, 10}, {0x000681, 12},
+{0x000018, 6}, {0x0001A8, 10}, {0x0002A5, 10}, {0x00068F, 12},
+{0x000007, 4}, {0x000055, 7}, {0x000047, 7}, {0x0000AD, 8},
};
static const uint32_t table_mb_non_intra4[128][2] = {
-{0x0000D4, 8}, {0x0021C5, 14}, {0x00F18A, 16}, {0x00D5BC, 16},
-{0x000879, 12}, {0x00354D, 14}, {0x010E3F, 17}, {0x010F54, 17},
-{0x000866, 12}, {0x00356E, 14}, {0x010F55, 17}, {0x010E3E, 17},
-{0x0010CE, 13}, {0x003C84, 14}, {0x00D5BD, 16}, {0x00F18B, 16},
-{0x000868, 12}, {0x00438C, 15}, {0x0087AB, 16}, {0x00790B, 15},
-{0x000F10, 12}, {0x00433D, 15}, {0x006AD3, 15}, {0x00790A, 15},
-{0x001AA7, 13}, {0x0043D4, 15}, {0x00871E, 16}, {0x006ADF, 15},
-{0x000D7C, 12}, {0x003C94, 14}, {0x00438D, 15}, {0x006AD2, 15},
-{0x0006BC, 11}, {0x0021E9, 14}, {0x006ADA, 15}, {0x006A99, 15},
-{0x0010F7, 13}, {0x004389, 15}, {0x006ADB, 15}, {0x0078C4, 15},
-{0x000D56, 12}, {0x0035F7, 14}, {0x00438E, 15}, {0x006A98, 15},
-{0x000D52, 12}, {0x003C95, 14}, {0x004388, 15}, {0x00433C, 15},
-{0x000D54, 12}, {0x001E4B, 13}, {0x003C63, 14}, {0x003C83, 14},
-{0x000861, 12}, {0x0021EB, 14}, {0x00356C, 14}, {0x0035F6, 14},
-{0x000863, 12}, {0x00219F, 14}, {0x003568, 14}, {0x003C82, 14},
-{0x0001AE, 9}, {0x0010C0, 13}, {0x000F11, 12}, {0x001AFA, 13},
-{0x000000, 1}, {0x0000F0, 8}, {0x0001AD, 9}, {0x0010C1, 13},
-{0x00000A, 4}, {0x0003C5, 10}, {0x000789, 11}, {0x001AB5, 13},
-{0x000009, 4}, {0x000435, 11}, {0x000793, 11}, {0x001E40, 13},
-{0x00001D, 5}, {0x0003CB, 10}, {0x000878, 12}, {0x001AAF, 13},
-{0x00000B, 4}, {0x0003C7, 10}, {0x000791, 11}, {0x001AAB, 13},
-{0x00001F, 5}, {0x000436, 11}, {0x0006BF, 11}, {0x000F19, 12},
-{0x00003D, 6}, {0x000D51, 12}, {0x0010C4, 13}, {0x0021E8, 14},
-{0x000036, 6}, {0x000437, 11}, {0x0006AF, 11}, {0x0010C5, 13},
-{0x00000C, 4}, {0x000432, 11}, {0x000794, 11}, {0x001E30, 13},
-{0x000042, 7}, {0x000870, 12}, {0x000F24, 12}, {0x001E43, 13},
-{0x000020, 6}, {0x00043E, 11}, {0x000795, 11}, {0x001AAA, 13},
-{0x000037, 6}, {0x0006AC, 11}, {0x0006AE, 11}, {0x0010F6, 13},
-{0x000034, 6}, {0x00043A, 11}, {0x000D50, 12}, {0x001AAE, 13},
-{0x000039, 6}, {0x00043F, 11}, {0x00078D, 11}, {0x0010D2, 13},
-{0x000038, 6}, {0x00043B, 11}, {0x0006BD, 11}, {0x0010D3, 13},
-{0x000011, 5}, {0x0001AC, 9}, {0x0000F3, 8}, {0x000439, 11},
+{0x0000D4, 8}, {0x0021C5, 14}, {0x00F18A, 16}, {0x00D5BC, 16},
+{0x000879, 12}, {0x00354D, 14}, {0x010E3F, 17}, {0x010F54, 17},
+{0x000866, 12}, {0x00356E, 14}, {0x010F55, 17}, {0x010E3E, 17},
+{0x0010CE, 13}, {0x003C84, 14}, {0x00D5BD, 16}, {0x00F18B, 16},
+{0x000868, 12}, {0x00438C, 15}, {0x0087AB, 16}, {0x00790B, 15},
+{0x000F10, 12}, {0x00433D, 15}, {0x006AD3, 15}, {0x00790A, 15},
+{0x001AA7, 13}, {0x0043D4, 15}, {0x00871E, 16}, {0x006ADF, 15},
+{0x000D7C, 12}, {0x003C94, 14}, {0x00438D, 15}, {0x006AD2, 15},
+{0x0006BC, 11}, {0x0021E9, 14}, {0x006ADA, 15}, {0x006A99, 15},
+{0x0010F7, 13}, {0x004389, 15}, {0x006ADB, 15}, {0x0078C4, 15},
+{0x000D56, 12}, {0x0035F7, 14}, {0x00438E, 15}, {0x006A98, 15},
+{0x000D52, 12}, {0x003C95, 14}, {0x004388, 15}, {0x00433C, 15},
+{0x000D54, 12}, {0x001E4B, 13}, {0x003C63, 14}, {0x003C83, 14},
+{0x000861, 12}, {0x0021EB, 14}, {0x00356C, 14}, {0x0035F6, 14},
+{0x000863, 12}, {0x00219F, 14}, {0x003568, 14}, {0x003C82, 14},
+{0x0001AE, 9}, {0x0010C0, 13}, {0x000F11, 12}, {0x001AFA, 13},
+{0x000000, 1}, {0x0000F0, 8}, {0x0001AD, 9}, {0x0010C1, 13},
+{0x00000A, 4}, {0x0003C5, 10}, {0x000789, 11}, {0x001AB5, 13},
+{0x000009, 4}, {0x000435, 11}, {0x000793, 11}, {0x001E40, 13},
+{0x00001D, 5}, {0x0003CB, 10}, {0x000878, 12}, {0x001AAF, 13},
+{0x00000B, 4}, {0x0003C7, 10}, {0x000791, 11}, {0x001AAB, 13},
+{0x00001F, 5}, {0x000436, 11}, {0x0006BF, 11}, {0x000F19, 12},
+{0x00003D, 6}, {0x000D51, 12}, {0x0010C4, 13}, {0x0021E8, 14},
+{0x000036, 6}, {0x000437, 11}, {0x0006AF, 11}, {0x0010C5, 13},
+{0x00000C, 4}, {0x000432, 11}, {0x000794, 11}, {0x001E30, 13},
+{0x000042, 7}, {0x000870, 12}, {0x000F24, 12}, {0x001E43, 13},
+{0x000020, 6}, {0x00043E, 11}, {0x000795, 11}, {0x001AAA, 13},
+{0x000037, 6}, {0x0006AC, 11}, {0x0006AE, 11}, {0x0010F6, 13},
+{0x000034, 6}, {0x00043A, 11}, {0x000D50, 12}, {0x001AAE, 13},
+{0x000039, 6}, {0x00043F, 11}, {0x00078D, 11}, {0x0010D2, 13},
+{0x000038, 6}, {0x00043B, 11}, {0x0006BD, 11}, {0x0010D3, 13},
+{0x000011, 5}, {0x0001AC, 9}, {0x0000F3, 8}, {0x000439, 11},
};
static const uint32_t (*wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]={
static const uint8_t wmv2_scantableB[64]={
0x00, 0x08, 0x01, 0x10, 0x09, 0x18, 0x11, 0x02,
-0x20, 0x0A, 0x19, 0x28, 0x12, 0x30, 0x21, 0x1A,
-0x38, 0x29, 0x22, 0x03, 0x31, 0x39, 0x0B, 0x2A,
+0x20, 0x0A, 0x19, 0x28, 0x12, 0x30, 0x21, 0x1A,
+0x38, 0x29, 0x22, 0x03, 0x31, 0x39, 0x0B, 0x2A,
0x13, 0x32, 0x1B, 0x3A, 0x23, 0x2B, 0x33, 0x3B,
};
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
- pixels[pixel_ptr++] =
- colors[((pixel_y & 0x2) << 1) +
+ pixels[pixel_ptr++] =
+ colors[((pixel_y & 0x2) << 1) +
(pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
pixel_ptr -= row_dec;
}
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
- pixels[pixel_ptr++] =
- colors[((pixel_y & 0x2) << 1) +
+ pixels[pixel_ptr++] =
+ colors[((pixel_y & 0x2) << 1) +
(pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
pixel_ptr -= row_dec;
}
vorbis_analysis_headerout(&context->vd, &context->vc, &header,
&header_comm, &header_code);
-
+
len = header.bytes + header_comm.bytes + header_code.bytes;
avccontext->extradata_size= 64 + len + len/255;
p = avccontext->extradata= av_mallocz(avccontext->extradata_size);
offset += header_code.bytes;
avccontext->extradata_size = offset;
avccontext->extradata= av_realloc(avccontext->extradata, avccontext->extradata_size);
-
+
/* vorbis_block_clear(&context->vb);
vorbis_dsp_clear(&context->vd);
vorbis_info_clear(&context->vi);*/
vorbis_comment_clear(&context->vc);
-
+
avccontext->frame_size = OGGVORBIS_FRAME_SIZE ;
-
+
avccontext->coded_frame= avcodec_alloc_frame();
avccontext->coded_frame->key_frame= 1;
-
+
return 0 ;
}
buffer[1][l]=audio[l*2+1]/32768.f;
}
}
-
- vorbis_analysis_wrote(&context->vd, samples) ;
+
+ vorbis_analysis_wrote(&context->vd, samples) ;
while(vorbis_analysis_blockout(&context->vd, &context->vb) == 1) {
vorbis_analysis(&context->vb, NULL);
static int oggvorbis_encode_close(AVCodecContext *avccontext) {
OggVorbisContext *context = avccontext->priv_data ;
/* ogg_packet op ; */
-
+
vorbis_analysis_wrote(&context->vd, 0) ; /* notify vorbisenc this is EOF */
vorbis_block_clear(&context->vb);
av_freep(&avccontext->coded_frame);
av_freep(&avccontext->extradata);
-
+
return 0 ;
}
avccontext->time_base= (AVRational){1, avccontext->sample_rate};
vorbis_synthesis_init(&context->vd, &context->vi);
- vorbis_block_init(&context->vd, &context->vb);
+ vorbis_block_init(&context->vd, &context->vb);
return 0 ;
}
int i, j, val ;
ogg_int16_t *ptr, *data = (ogg_int16_t*)buf ;
float *mono ;
-
+
for(i = 0 ; i < channels ; i++){
ptr = &data[i];
mono = pcm[i] ;
-
+
for(j = 0 ; j < samples ; j++) {
-
+
val = mono[j] * 32767.f;
-
+
if(val > 32767) val = 32767 ;
if(val < -32768) val = -32768 ;
-
+
*ptr = val ;
ptr += channels;
}
}
-
+
return 0 ;
}
-
-
+
+
static int oggvorbis_decode_frame(AVCodecContext *avccontext,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
OggVorbisContext *context = avccontext->priv_data ;
float **pcm ;
- ogg_packet *op= &context->op;
+ ogg_packet *op= &context->op;
int samples, total_samples, total_bytes;
-
+
if(!buf_size){
//FIXME flush
return 0;
}
-
+
op->packet = buf;
op->bytes = buf_size;
// av_log(avccontext, AV_LOG_DEBUG, "%d %d %d %lld %lld %d %d\n", op->bytes, op->b_o_s, op->e_o_s, op->granulepos, op->packetno, buf_size, context->vi.rate);
-
+
/* for(i=0; i<op->bytes; i++)
av_log(avccontext, AV_LOG_DEBUG, "%02X ", op->packet[i]);
av_log(avccontext, AV_LOG_DEBUG, "\n");*/
if(vorbis_synthesis(&context->vb, op) == 0)
vorbis_synthesis_blockin(&context->vd, &context->vb) ;
-
+
total_samples = 0 ;
total_bytes = 0 ;
vorbis_synthesis_read(&context->vd, samples) ;
}
- *data_size = total_bytes ;
+ *data_size = total_bytes ;
return buf_size ;
}
static int oggvorbis_decode_close(AVCodecContext *avccontext) {
OggVorbisContext *context = avccontext->priv_data ;
-
+
vorbis_info_clear(&context->vi) ;
vorbis_comment_clear(&context->vc) ;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file opt.c
* AVOptions
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-
+
#include "avcodec.h"
#include "opt.h"
-
+
static double av_parse_num(const char *name, char **tail){
double d;
d= strtod(name, tail);
static AVOption *find_opt(void *v, const char *name, const char *unit){
AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass
AVOption *o= c->option;
-
+
for(;o && o->name; o++){
if(!strcmp(o->name, name) && (!unit || !strcmp(o->unit, unit)) )
return o;
static AVOption *av_set_number(void *obj, const char *name, double num, int den, int64_t intnum){
AVOption *o= find_opt(obj, name, NULL);
void *dst;
- if(!o || o->offset<=0)
+ if(!o || o->offset<=0)
return NULL;
-
+
if(o->max*den < num*intnum || o->min*den > num*intnum)
return NULL;
-
+
dst= ((uint8_t*)obj) + o->offset;
switch(o->type){
- case FF_OPT_TYPE_FLAGS:
+ case FF_OPT_TYPE_FLAGS:
case FF_OPT_TYPE_INT: *(int *)dst= lrintf(num/den)*intnum; break;
case FF_OPT_TYPE_INT64: *(int64_t *)dst= lrintf(num/den)*intnum; break;
case FF_OPT_TYPE_FLOAT: *(float *)dst= num*intnum/den; break;
AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass
AVOption *o= c->option;
AVOption *ret=NULL;
-
+
for(;o && o->name; o++){
if(o->type != FF_OPT_TYPE_CONST && o->unit && !strcmp(o->unit, unit)){
double tmp= d;
if(o && o->offset==0 && o->type == FF_OPT_TYPE_CONST && o->unit){
return set_all_opt(obj, o->unit, o->default_val);
}
- if(!o || !val || o->offset<=0)
+ if(!o || !val || o->offset<=0)
return NULL;
if(o->type != FF_OPT_TYPE_STRING){
for(;;){
if(*val == '+' || *val == '-')
cmd= *(val++);
-
+
for(i=0; i<sizeof(buf)-1 && val[i] && val[i]!='+' && val[i]!='-'; i++)
buf[i]= val[i];
buf[i]=0;
val+= i;
-
+
d= av_parse_num(buf, &tail);
if(tail <= buf){
AVOption *o_named= find_opt(obj, buf, o->unit);
- if(o_named && o_named->type == FF_OPT_TYPE_CONST)
+ if(o_named && o_named->type == FF_OPT_TYPE_CONST)
d= o_named->default_val;
else if(!strcmp(buf, "default")) d= o->default_val;
else if(!strcmp(buf, "max" )) d= o->max;
}
return NULL;
}
-
+
memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val));
return o;
}
}
/**
- *
+ *
* @param buf a buffer which is used for returning non string values as strings, can be NULL
* @param buf_len allocated length in bytes of buf
*/
dst= ((uint8_t*)obj) + o->offset;
if(o_out) *o_out= o;
-
+
if(o->type == FF_OPT_TYPE_STRING)
return dst;
-
+
switch(o->type){
case FF_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break;
case FF_OPT_TYPE_INT: snprintf(buf, buf_len, "%d" , *(int *)dst);break;
if(o_out) *o_out= o;
switch(o->type){
- case FF_OPT_TYPE_FLAGS:
+ case FF_OPT_TYPE_FLAGS:
case FF_OPT_TYPE_INT: *intnum= *(int *)dst;return 0;
case FF_OPT_TYPE_INT64: *intnum= *(int64_t*)dst;return 0;
case FF_OPT_TYPE_FLOAT: *num= *(float *)dst;return 0;
case FF_OPT_TYPE_DOUBLE: *num= *(double *)dst;return 0;
- case FF_OPT_TYPE_RATIONAL: *intnum= ((AVRational*)dst)->num;
+ case FF_OPT_TYPE_RATIONAL: *intnum= ((AVRational*)dst)->num;
*den = ((AVRational*)dst)->den;
return 0;
}
int av_opt_show(void *obj, void *av_log_obj){
AVOption *opt=NULL;
-
+
if(!obj)
return -1;
while((opt= av_next_option(obj, opt))){
if(!(opt->flags & (AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM)))
continue;
-
+
av_log(av_log_obj, AV_LOG_INFO, "-%-17s ", opt->name);
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_ENCODING_PARAM) ? 'E' : '.');
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_DECODING_PARAM) ? 'D' : '.');
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_VIDEO_PARAM ) ? 'V' : '.');
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_AUDIO_PARAM ) ? 'A' : '.');
av_log(av_log_obj, AV_LOG_INFO, "%c", (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) ? 'S' : '.');
-
+
if(opt->help)
av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
av_log(av_log_obj, AV_LOG_INFO, "\n");
* @fixme what about other languages
*/
const char *help;
- int offset; ///< offset to context structure where the parsed value should be stored
+ int offset; ///< offset to context structure where the parsed value should be stored
enum AVOptionType type;
-
+
double default_val;
double min;
double max;
-
+
int flags;
#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
AVCodecParserContext *s;
AVCodecParser *parser;
int ret;
-
+
if(codec_id == CODEC_ID_NONE)
return NULL;
/* NOTE: buf_size == 0 is used to signal EOF so that the last frame
can be returned if necessary */
-int av_parser_parse(AVCodecParserContext *s,
+int av_parser_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int64_t pts, int64_t dts)
{
int index, i, k;
uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
-
+
if (buf_size == 0) {
/* padding is always necessary even if EOF, so we add it here */
memset(dummy_buf, 0, sizeof(dummy_buf));
s->frame_offset = s->last_frame_offset;
s->pts = s->last_pts;
s->dts = s->last_dts;
-
+
/* offset of the next frame */
s->last_frame_offset = s->cur_offset + index;
/* find the packet in which the new frame starts. It
s->last_pts = s->cur_frame_pts[k];
s->last_dts = s->cur_frame_dts[k];
-
+
/* some parsers tell us the packet size even before seeing the first byte of the next packet,
so the next pts/dts is in the next chunk */
if(index == buf_size){
*/
int av_parser_change(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size, int keyframe){
-
+
if(s && s->parser->split){
if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
int i= s->parser->split(avctx, buf, buf_size);
int size= buf_size + avctx->extradata_size;
*poutbuf_size= size;
*poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
-
+
memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
return 1;
*buf_size=
pc->overread_index= pc->index + next;
-
+
/* append to buffer */
if(pc->index){
pc->buffer= av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
#define MPEG1_FRAME_RATE_BASE 1001
static const int frame_rate_tab[16] = {
- 0,
+ 0,
24000,
24024,
25025,
};
//FIXME move into mpeg12.c
-static void mpegvideo_extract_headers(AVCodecParserContext *s,
+static void mpegvideo_extract_headers(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
top_field_first = buf[3] & (1 << 7);
repeat_first_field = buf[3] & (1 << 1);
progressive_frame = buf[4] & (1 << 7);
-
+
/* check if we must repeat the frame */
if (repeat_first_field) {
if (pc->progressive_sequence) {
s->repeat_pict = 1;
}
}
-
- /* the packet only represents half a frame
+
+ /* the packet only represents half a frame
XXX,FIXME maybe find a different solution */
if(picture_structure != 3)
s->repeat_pict = -1;
default:
/* we stop parsing when we encounter a slice. It ensures
that this function takes a negligible amount of time */
- if (start_code >= SLICE_MIN_START_CODE &&
+ if (start_code >= SLICE_MIN_START_CODE &&
start_code <= SLICE_MAX_START_CODE)
goto the_end;
break;
static int mpegvideo_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext1 *pc1 = s->priv_data;
ParseContext *pc= &pc1->pc;
int next;
-
+
if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
next= buf_size;
}else{
next= ff_mpeg1_find_frame_end(pc, buf, buf_size);
-
+
if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
*poutbuf = NULL;
*poutbuf_size = 0;
return buf_size;
}
-
+
}
/* we have a full frame : we just parse the first few MPEG headers
to have the full timing information. The time take by this
function should be negligible for uncorrupted streams */
mpegvideo_extract_headers(s, avctx, buf, buf_size);
#if 0
- printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
+ printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);
#endif
{
int i;
uint32_t state= -1;
-
+
for(i=0; i<buf_size; i++){
state= (state<<8) | buf[i];
if(state != 0x1B3 && state != 0x1B5 && state < 0x200 && state >= 0x100)
/* used by parser */
/* XXX: make it use less memory */
-static int av_mpeg4_decode_header(AVCodecParserContext *s1,
+static int av_mpeg4_decode_header(AVCodecParserContext *s1,
AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
static int mpeg4video_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext *pc = s->priv_data;
int next;
-
+
if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
next= buf_size;
}else{
next= ff_mpeg4_find_frame_end(pc, buf, buf_size);
-
+
if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
*poutbuf = NULL;
*poutbuf_size = 0;
{
int i;
uint32_t state= -1;
-
+
for(i=0; i<buf_size; i++){
state= (state<<8) | buf[i];
if(state == 0x1B3 || state == 0x1B6)
static int mpegaudio_parse(AVCodecParserContext *s1,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
MpegAudioParseContext *s = s1->priv_data;
s->header= header;
s->header_count++;
s->frame_size = ret;
-
+
#if 0
/* free format: prepare to compute frame size */
if (decode_header(s, header) == 1) {
if(s->header_count <= 0)
avctx->sample_rate= sr; //FIXME ugly
}
- } else
+ } else
#if 0
if (s->frame_size == -1) {
/* free format : find next sync to compute frame size */
s->free_format_frame_size -= padding * 4;
else
s->free_format_frame_size -= padding;
- dprintf("free frame size=%d padding=%d\n",
+ dprintf("free frame size=%d padding=%d\n",
s->free_format_frame_size, padding);
decode_header(s, header1);
goto next_data;
s->inbuf_ptr += len;
buf_size -= len;
}
- } else
+ } else
#endif
if (len < s->frame_size) {
if (s->frame_size > MPA_MAX_CODED_FRAME_SIZE)
buf_size -= len;
}
// next_data:
- if (s->frame_size > 0 &&
+ if (s->frame_size > 0 &&
(s->inbuf_ptr - s->inbuf) >= s->frame_size) {
if(s->header_count > 0){
*poutbuf = s->inbuf;
static int ac3_parse(AVCodecParserContext *s1,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
AC3ParseContext *s = s1->priv_data;
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file pcm.c
* PCM codecs
*/
-
+
#include "avcodec.h"
#include "bitstream.h" // for ff_reverse
static uint8_t *linear_to_ulaw = NULL;
static int linear_to_ulaw_ref = 0;
-static void build_xlaw_table(uint8_t *linear_to_xlaw,
+static void build_xlaw_table(uint8_t *linear_to_xlaw,
int (*xlaw2linear)(unsigned char),
- int mask)
+ int mask)
{
int i, j, v, v1, v2;
default:
break;
}
-
+
switch(avctx->codec->id) {
case CODEC_ID_PCM_S32LE:
case CODEC_ID_PCM_S32BE:
avctx->coded_frame= avcodec_alloc_frame();
avctx->coded_frame->key_frame= 1;
-
+
return 0;
}
int channels;
int bits_per_pixel;
int bpp;
-
+
uint8_t *image_buf;
int image_linesize;
uint32_t palette[256];
};
/* Mask to determine which pixels to overwrite while displaying */
-static const uint8_t png_pass_dsp_mask[NB_PASSES] = {
+static const uint8_t png_pass_dsp_mask[NB_PASSES] = {
0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff
};
#if 0
/* NOTE: we try to construct a good looking image at each pass. width
is the original image width. We also do pixel format convertion at
this stage */
-static void png_put_interlaced_row(uint8_t *dst, int width,
- int bits_per_pixel, int pass,
+static void png_put_interlaced_row(uint8_t *dst, int width,
+ int bits_per_pixel, int pass,
int color_type, const uint8_t *src)
{
int x, mask, dsp_mask, j, src_x, b, bpp;
uint8_t *d;
const uint8_t *s;
-
+
mask = png_pass_mask[pass];
dsp_mask = png_pass_dsp_mask[pass];
switch(bits_per_pixel) {
}
}
-static void png_get_interlaced_row(uint8_t *dst, int row_size,
- int bits_per_pixel, int pass,
+static void png_get_interlaced_row(uint8_t *dst, int row_size,
+ int bits_per_pixel, int pass,
const uint8_t *src, int width)
{
int x, mask, dst_x, j, b, bpp;
/* XXX: optimize */
/* NOTE: 'dst' can be equal to 'last' */
-static void png_filter_row(uint8_t *dst, int filter_type,
+static void png_filter_row(uint8_t *dst, int filter_type,
uint8_t *src, uint8_t *last, int size, int bpp)
{
int i, p;
uint8_t *d;
int j;
unsigned int v;
-
+
d = dst;
for(j = 0; j < width; j++) {
v = ((uint32_t *)src)[j];
{
uint8_t *ptr, *last_row;
int got_line;
-
+
if (!s->interlace_type) {
ptr = s->image_buf + s->image_linesize * s->y;
/* need to swap bytes correctly for RGB_ALPHA */
if (s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
- png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
+ png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
s->last_row, s->row_size, s->bpp);
memcpy(s->last_row, s->tmp_row, s->row_size);
convert_to_rgba32(ptr, s->tmp_row, s->width);
last_row = s->last_row;
else
last_row = ptr - s->image_linesize;
-
- png_filter_row(ptr, s->crow_buf[0], s->crow_buf + 1,
+
+ png_filter_row(ptr, s->crow_buf[0], s->crow_buf + 1,
last_row, s->row_size, s->bpp);
}
s->y++;
wait for the next one */
if (got_line)
break;
- png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
+ png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
s->last_row, s->pass_row_size, s->bpp);
memcpy(s->last_row, s->tmp_row, s->pass_row_size);
got_line = 1;
}
if ((png_pass_dsp_ymask[s->pass] << (s->y & 7)) & 0x80) {
/* NOTE: rgba32 is handled directly in png_put_interlaced_row */
- png_put_interlaced_row(ptr, s->width, s->bits_per_pixel, s->pass,
+ png_put_interlaced_row(ptr, s->width, s->bits_per_pixel, s->pass,
s->color_type, s->last_row);
}
s->y++;
} else {
s->pass++;
s->y = 0;
- s->pass_row_size = png_pass_row_size(s->pass,
- s->bits_per_pixel,
+ s->pass_row_size = png_pass_row_size(s->pass,
+ s->bits_per_pixel,
s->width);
s->crow_size = s->pass_row_size + 1;
if (s->pass_row_size != 0)
s->zstream.avail_in = length;
s->zstream.next_in = s->bytestream;
s->bytestream += length;
-
+
if(s->bytestream > s->bytestream_end)
return -1;
return 0;
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
tag32 = get32(&s->bytestream);
tag = bswap_32(tag32);
#ifdef DEBUG
- printf("png: tag=%c%c%c%c length=%u\n",
+ printf("png: tag=%c%c%c%c length=%u\n",
(tag & 0xff),
((tag >> 8) & 0xff),
((tag >> 16) & 0xff),
crc = get32(&s->bytestream);
s->state |= PNG_IHDR;
#ifdef DEBUG
- printf("width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
- s->width, s->height, s->bit_depth, s->color_type,
+ printf("width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
+ s->width, s->height, s->bit_depth, s->color_type,
s->compression_type, s->filter_type, s->interlace_type);
#endif
break;
s->bpp = (s->bits_per_pixel + 7) >> 3;
s->row_size = (avctx->width * s->bits_per_pixel + 7) >> 3;
- if (s->bit_depth == 8 &&
+ if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_RGB) {
avctx->pix_fmt = PIX_FMT_RGB24;
- } else if (s->bit_depth == 8 &&
+ } else if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
avctx->pix_fmt = PIX_FMT_RGBA32;
- } else if (s->bit_depth == 8 &&
+ } else if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_GRAY) {
avctx->pix_fmt = PIX_FMT_GRAY8;
- } else if (s->bit_depth == 1 &&
+ } else if (s->bit_depth == 1 &&
s->color_type == PNG_COLOR_TYPE_GRAY) {
avctx->pix_fmt = PIX_FMT_MONOBLACK;
} else if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
}
if(p->data[0])
avctx->release_buffer(avctx, p);
-
+
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
s->crow_size = s->row_size + 1;
} else {
s->pass = 0;
- s->pass_row_size = png_pass_row_size(s->pass,
- s->bits_per_pixel,
+ s->pass_row_size = png_pass_row_size(s->pass,
+ s->bits_per_pixel,
s->width);
s->crow_size = s->pass_row_size + 1;
}
#ifdef DEBUG
- printf("row_size=%d crow_size =%d\n",
+ printf("row_size=%d crow_size =%d\n",
s->row_size, s->crow_size);
#endif
s->image_buf = p->data[0];
case MKTAG('P', 'L', 'T', 'E'):
{
int n, i, r, g, b;
-
+
if ((length % 3) != 0 || length > 256 * 3)
goto skip_tag;
/* read the palette */
*p = *pict;
p->pict_type= FF_I_TYPE;
p->key_frame= 1;
-
+
s->bytestream_start=
s->bytestream= buf;
s->bytestream_end= buf+buf_size;
/* write png header */
memcpy(s->bytestream, pngsig, 8);
s->bytestream += 8;
-
+
to_be32(s->buf, avctx->width);
to_be32(s->buf + 4, avctx->height);
s->buf[8] = bit_depth;
s->buf[10] = 0; /* compression type */
s->buf[11] = 0; /* filter type */
s->buf[12] = is_progressive; /* interlace type */
-
+
png_write_chunk(&s->bytestream, MKTAG('I', 'H', 'D', 'R'), s->buf, 13);
/* put the palette if needed */
unsigned int v;
uint32_t *palette;
uint8_t *alpha_ptr;
-
+
palette = (uint32_t *)p->data[1];
ptr = s->buf;
alpha_ptr = s->buf + 256 * 3;
} else {
ptr1 = ptr;
}
- png_get_interlaced_row(crow_buf + 1, pass_row_size,
- bits_per_pixel, pass,
+ png_get_interlaced_row(crow_buf + 1, pass_row_size,
+ bits_per_pixel, pass,
ptr1, avctx->width);
crow_buf[0] = PNG_FILTER_VALUE_NONE;
png_write_row(s, crow_buf, pass_row_size + 1);
AVFrame picture;
} PNMContext;
-static inline int pnm_space(int c)
+static inline int pnm_space(int c)
{
return (c == ' ' || c == '\n' || c == '\r' || c == '\t');
}
-static void pnm_get(PNMContext *sc, char *str, int buf_size)
+static void pnm_get(PNMContext *sc, char *str, int buf_size)
{
char *s;
int c;
-
+
/* skip spaces and comments */
for(;;) {
c = *sc->bytestream++;
break;
}
}
-
+
s = str;
while (sc->bytestream < sc->bytestream_end && !pnm_space(c)) {
if ((s - str) < buf_size - 1)
if (!strcmp(buf1, "P4")) {
avctx->pix_fmt = PIX_FMT_MONOWHITE;
} else if (!strcmp(buf1, "P5")) {
- if (avctx->codec_id == CODEC_ID_PGMYUV)
+ if (avctx->codec_id == CODEC_ID_PGMYUV)
avctx->pix_fmt = PIX_FMT_YUV420P;
else
avctx->pix_fmt = PIX_FMT_GRAY8;
/* check that all tags are present */
if (w <= 0 || h <= 0 || maxval <= 0 || depth <= 0 || tuple_type[0] == '\0' || avcodec_check_dimensions(avctx, w, h))
return -1;
-
+
avctx->width = w;
avctx->height = h;
if (depth == 1) {
if (maxval == 1)
avctx->pix_fmt = PIX_FMT_MONOWHITE;
- else
+ else
avctx->pix_fmt = PIX_FMT_GRAY8;
} else if (depth == 3) {
avctx->pix_fmt = PIX_FMT_RGB24;
return 0;
}
-static int pnm_decode_frame(AVCodecContext *avctx,
+static int pnm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
s->bytestream_start=
s->bytestream= buf;
s->bytestream_end= buf + buf_size;
-
+
if(pnm_decode_header(avctx, s) < 0)
return -1;
-
+
if(p->data[0])
avctx->release_buffer(avctx, p);
}
p->pict_type= FF_I_TYPE;
p->key_frame= 1;
-
+
switch(avctx->pix_fmt) {
default:
return -1;
*p = *pict;
p->pict_type= FF_I_TYPE;
p->key_frame= 1;
-
+
s->bytestream_start=
s->bytestream= outbuf;
s->bytestream_end= outbuf+buf_size;
default:
return -1;
}
- snprintf(s->bytestream, s->bytestream_end - s->bytestream,
+ snprintf(s->bytestream, s->bytestream_end - s->bytestream,
"P%c\n%d %d\n",
c, avctx->width, h1);
s->bytestream += strlen(s->bytestream);
if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {
- snprintf(s->bytestream, s->bytestream_end - s->bytestream,
+ snprintf(s->bytestream, s->bytestream_end - s->bytestream,
"%d\n", 255);
s->bytestream += strlen(s->bytestream);
}
s->bytestream += n;
ptr += linesize;
}
-
+
if (avctx->pix_fmt == PIX_FMT_YUV420P) {
h >>= 1;
n >>= 1;
*p = *pict;
p->pict_type= FF_I_TYPE;
p->key_frame= 1;
-
+
s->bytestream_start=
s->bytestream= outbuf;
s->bytestream_end= outbuf+buf_size;
default:
return -1;
}
- snprintf(s->bytestream, s->bytestream_end - s->bytestream,
+ snprintf(s->bytestream, s->bytestream_end - s->bytestream,
"P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLETYPE %s\nENDHDR\n",
w, h, depth, maxval, tuple_type);
s->bytestream += strlen(s->bytestream);
-
+
ptr = p->data[0];
linesize = p->linesize[0];
-
+
if (avctx->pix_fmt == PIX_FMT_RGBA32) {
int j;
unsigned int v;
static int pnm_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
- uint8_t **poutbuf, int *poutbuf_size,
+ uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext *pc = s->priv_data;
#endif
next= END_NOT_FOUND;
}else{
- next= pnmctx.bytestream - pnmctx.bytestream_start
+ next= pnmctx.bytestream - pnmctx.bytestream_start
+ avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
if(pnmctx.bytestream_start!=buf)
next-= pc->index;
if(next > buf_size)
next= END_NOT_FOUND;
}
-
+
if(ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size)<0){
*poutbuf = NULL;
*poutbuf_size = 0;
pnm_encode_frame,
NULL, //encode_end,
pnm_decode_frame,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_GRAY8, -1},
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_GRAY8, -1},
};
#endif // CONFIG_PGM_ENCODER
pnm_encode_frame,
NULL, //encode_end,
pnm_decode_frame,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
};
#endif // CONFIG_PGMYUV_ENCODER
pnm_encode_frame,
NULL, //encode_end,
pnm_decode_frame,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_RGB24, -1},
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_RGB24, -1},
};
#endif // CONFIG_PPM_ENCODER
pnm_encode_frame,
NULL, //encode_end,
pnm_decode_frame,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_MONOWHITE, -1},
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_MONOWHITE, -1},
};
#endif // CONFIG_PBM_ENCODER
pam_encode_frame,
NULL, //encode_end,
pnm_decode_frame,
- .pix_fmts= (enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGBA32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, -1},
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGBA32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE, -1},
};
#endif // CONFIG_PAM_ENCODER
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
#include "../dsputil.h"
#include "gcc_fixes.h"
signal (sig, SIG_DFL);
raise (sig);
}
-
+
canjump = 0;
siglongjmp (jmpbuf, 1);
}
*/
tv = (vector unsigned char *) pix1;
pix1v = vec_perm(tv[0], tv[1], vec_lvsl(0, pix1));
-
+
tv = (vector unsigned char *) &pix2[0];
pix2v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[0]));
/* Add each 4 pixel group together and put 4 results into sad */
sad = vec_sum4s(t5, sad);
-
+
pix1 += line_size;
pix2 += line_size;
}
*/
tv = (vector unsigned char *) &pix2[0];
pix2v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[0]));
-
+
for(i=0;i<h;i++) {
/*
Read unaligned pixels into our vectors. The vectors are as follows:
/* Add each 4 pixel group together and put 4 results into sad */
sad = vec_sum4s(t5, sad);
-
+
pix1 += line_size;
pix2v = pix3v;
pix3 += line_size;
-
+
}
-
+
/* Sum up the four partial sums, and put the result into s */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
- return s;
+ return s;
}
int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
vector signed int sumdiffs;
sad = (vector unsigned int)vec_splat_u32(0);
-
+
s = 0;
/*
pix2ilv = (vector unsigned short) vec_mergel(zero, pix2iv);
t1 = vec_add(pix2hv, pix2ihv);
t2 = vec_add(pix2lv, pix2ilv);
-
+
for(i=0;i<h;i++) {
/*
Read unaligned pixels into our vectors. The vectors are as follows:
vector unsigned char t1, t2, t3,t4, t5;
vector unsigned int sad;
vector signed int sumdiffs;
-
+
sad = (vector unsigned int)vec_splat_u32(0);
pix2v = (vector unsigned char *) pix2;
t1 = vec_perm(pix1v[0], pix1v[1], perm1);
t2 = vec_perm(pix2v[0], pix2v[1], perm2);
-
- /* Calculate a sum of abs differences vector */
+
+ /* Calculate a sum of abs differences vector */
t3 = vec_max(t1, t2);
t4 = vec_min(t1, t2);
t5 = vec_sub(t3, t4);
-
+
/* Add each 4 pixel group together and put 4 results into sad */
sad = vec_sum4s(t5, sad);
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
-
+
return s;
}
t1 = vec_and(vec_perm(pix1v[0], pix1v[1], perm1), permclear);
t2 = vec_and(vec_perm(pix2v[0], pix2v[1], perm2), permclear);
- /* Calculate a sum of abs differences vector */
+ /* Calculate a sum of abs differences vector */
t3 = vec_max(t1, t2);
t4 = vec_min(t1, t2);
t5 = vec_sub(t3, t4);
vector unsigned char pixv;
vector unsigned int sv;
vector signed int sum;
-
+
sv = (vector unsigned int)vec_splat_u32(0);
-
+
s = 0;
for (i = 0; i < 16; i++) {
/* Read in the potentially unaligned pixels */
vector unsigned char t1, t2, t3,t4, t5;
vector unsigned int sum;
vector signed int sumsqr;
-
+
sum = (vector unsigned int)vec_splat_u32(0);
permclear = (vector unsigned char)AVV(255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0);
-
+
for(i=0;i<h;i++) {
/* Read potentially unaligned pixels into t1 and t2
Since we're reading 16 pixels, and actually only want 8,
Since we want to use unsigned chars, we can take advantage
of the fact that abs(a-b)^2 = (a-b)^2.
*/
-
- /* Calculate abs differences vector */
+
+ /* Calculate abs differences vector */
t3 = vec_max(t1, t2);
t4 = vec_min(t1, t2);
t5 = vec_sub(t3, t4);
-
+
/* Square the values and add them to our sum */
sum = vec_msum(t5, t5, sum);
-
+
pix1 += line_size;
pix2 += line_size;
}
-
+
/* Sum up the four partial sums, and put the result into s */
sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
sumsqr = vec_splat(sumsqr, 3);
vec_ste(sumsqr, 0, &s);
-
+
return s;
}
vector unsigned char t1, t2, t3,t4, t5;
vector unsigned int sum;
vector signed int sumsqr;
-
+
sum = (vector unsigned int)vec_splat_u32(0);
-
+
for(i=0;i<h;i++) {
/* Read potentially unaligned pixels into t1 and t2 */
perm1 = vec_lvsl(0, pix1);
Since we want to use unsigned chars, we can take advantage
of the fact that abs(a-b)^2 = (a-b)^2.
*/
-
- /* Calculate abs differences vector */
+
+ /* Calculate abs differences vector */
t3 = vec_max(t1, t2);
t4 = vec_min(t1, t2);
t5 = vec_sub(t3, t4);
-
+
/* Square the values and add them to our sum */
sum = vec_msum(t5, t5, sum);
-
+
pix1 += line_size;
pix2 += line_size;
}
-
+
/* Sum up the four partial sums, and put the result into s */
sumsqr = vec_sums((vector signed int) sum, (vector signed int) zero);
sumsqr = vec_splat(sumsqr, 3);
vec_ste(sumsqr, 0, &s);
-
+
return s;
}
int i;
int s __attribute__((aligned(16)));
-
+
sad = (vector unsigned int)vec_splat_u32(0);
-
+
for (i = 0; i < 16; i++) {
/* Read the potentially unaligned 16 pixels into t1 */
perm = vec_lvsl(0, pix);
/* Add each 4 pixel group together and put 4 results into sad */
sad = vec_sum4s(t1, sad);
-
+
pix += line_size;
}
-
+
/* Sum up the four partial sums, and put the result into s */
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
sumdiffs = vec_splat(sumdiffs, 3);
vec_ste(sumdiffs, 0, &s);
-
+
return s;
}
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
register int i;
register vector unsigned char vdst, vsrc;
-
+
/* dst and src are 16 bytes-aligned (guaranteed) */
for(i = 0 ; (i + 15) < w ; i++)
{
int i;
POWERPC_PERF_START_COUNT(altivec_avg_pixels8_num, 1);
-
+
for (i = 0; i < h; i++) {
/*
block is 8 bytes-aligned, so we're either in the
left block (16 bytes-aligned) or in the right block (not)
*/
int rightside = ((unsigned long)block & 0x0000000F);
-
+
blockv = vec_ld(0, block);
pixelsv1 = vec_ld(0, (unsigned char*)pixels);
pixelsv2 = vec_ld(16, (unsigned char*)pixels);
pixelsv = vec_perm(pixelsv1, pixelsv2, vec_lvsl(0, pixels));
-
+
if (rightside)
{
pixelsv = vec_perm(blockv, pixelsv, vcprm(0,1,s0,s1));
{
pixelsv = vec_perm(blockv, pixelsv, vcprm(s0,s1,2,3));
}
-
+
blockv = vec_avg(blockv, pixelsv);
vec_st(blockv, 0, block);
-
+
pixels += line_size;
block += line_size;
}
-
+
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_num, 1);
-
+
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
pixelssum1, pixelssum2, temp3;
register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
-
+
temp1 = vec_ld(0, pixels);
temp2 = vec_ld(16, pixels);
pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vctwo);
-
-POWERPC_PERF_START_COUNT(altivec_put_pixels8_xy2_num, 1);
+
+POWERPC_PERF_START_COUNT(altivec_put_pixels8_xy2_num, 1);
for (i = 0; i < h ; i++) {
int rightside = ((unsigned long)block & 0x0000000F);
blockv = vec_ld(0, block);
temp3 = vec_sra(temp3, vctwo);
pixelssum1 = vec_add(pixelssum2, vctwo);
pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
+
if (rightside)
{
blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
{
blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
}
-
+
vec_st(blockv, 0, block);
-
+
block += line_size;
pixels += line_size;
}
-
+
POWERPC_PERF_STOP_COUNT(altivec_put_pixels8_xy2_num, 1);
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
} pixels += 4 - line_size * (h + 1);
block += 4 - line_size * h;
}
-
+
POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
#else /* ALTIVEC_USE_REFERENCE_C_CODE */
register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
register const_vector unsigned short vcone = (const_vector unsigned short)vec_splat_u16(1);
register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
-
+
temp1 = vec_ld(0, pixels);
temp2 = vec_ld(16, pixels);
pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vcone);
-
-POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
+
+POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
for (i = 0; i < h ; i++) {
int rightside = ((unsigned long)block & 0x0000000F);
blockv = vec_ld(0, block);
temp3 = vec_sra(temp3, vctwo);
pixelssum1 = vec_add(pixelssum2, vcone);
pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
+
if (rightside)
{
blockv = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
{
blockv = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
}
-
+
vec_st(blockv, 0, block);
-
+
block += line_size;
pixels += line_size;
}
-
+
POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
POWERPC_PERF_START_COUNT(altivec_put_pixels16_xy2_num, 1);
-
+
temp1 = vec_ld(0, pixels);
temp2 = vec_ld(16, pixels);
pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vctwo);
-
+
for (i = 0; i < h ; i++) {
blockv = vec_ld(0, block);
pixelsv4 = vec_mergel(vczero, pixelsv2);
pixelsv1 = vec_mergeh(vczero, pixelsv1);
pixelsv2 = vec_mergeh(vczero, pixelsv2);
-
+
pixelssum4 = vec_add((vector unsigned short)pixelsv3,
(vector unsigned short)pixelsv4);
pixelssum2 = vec_add((vector unsigned short)pixelsv1,
pixelssum1 = vec_add(pixelssum2, vctwo);
blockv = vec_packsu(temp3, temp4);
-
+
vec_st(blockv, 0, block);
-
+
block += line_size;
pixels += line_size;
}
-
+
POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_xy2_num, 1);
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
-
+
temp1 = vec_ld(0, pixels);
temp2 = vec_ld(16, pixels);
pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vcone);
-
+
for (i = 0; i < h ; i++) {
blockv = vec_ld(0, block);
pixelsv4 = vec_mergel(vczero, pixelsv2);
pixelsv1 = vec_mergeh(vczero, pixelsv1);
pixelsv2 = vec_mergeh(vczero, pixelsv2);
-
+
pixelssum4 = vec_add((vector unsigned short)pixelsv3,
(vector unsigned short)pixelsv4);
pixelssum2 = vec_add((vector unsigned short)pixelsv1,
pixelssum1 = vec_add(pixelssum2, vcone);
blockv = vec_packsu(temp3, temp4);
-
+
vec_st(blockv, 0, block);
-
+
block += line_size;
pixels += line_size;
}
-
+
POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1);
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
register vector signed short line5 = vec_sub(temp4, temp5);
register vector signed short line6 = vec_add(temp6, temp7);
register vector signed short line7 = vec_sub(temp6, temp7);
-
+
register vector signed short line0B = vec_add(line0, line2);
register vector signed short line2B = vec_sub(line0, line2);
register vector signed short line1B = vec_add(line1, line3);
register vector signed short line6B = vec_sub(line4, line6);
register vector signed short line5B = vec_add(line5, line7);
register vector signed short line7B = vec_sub(line5, line7);
-
+
register vector signed short line0C = vec_add(line0B, line4B);
register vector signed short line4C = vec_sub(line0B, line4B);
register vector signed short line1C = vec_add(line1B, line5B);
register vector signed short line6C = vec_sub(line2B, line6B);
register vector signed short line3C = vec_add(line3B, line7B);
register vector signed short line7C = vec_sub(line3B, line7B);
-
+
vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
vsum = vec_sum4s(vec_abs(line1C), vsum);
vsum = vec_sum4s(vec_abs(line2C), vsum);
16x8 works with 16 elements ; it allows to avoid replicating
loads, and give the compiler more rooms for scheduling.
It's only used from inside hadamard8_diff16_altivec.
-
+
Unfortunately, it seems gcc-3.3 is a bit dumb, and
the compiled code has a LOT of spill code, it seems
gcc (unlike xlc) cannot keep everything in registers
registers allocation. It's not clean, but on
a 7450 the resulting code is much faster (best case
fall from 700+ cycles to 550).
-
+
xlc doesn't add spill code, but it doesn't know how to
schedule for the 7450, and its code isn't much faster than
gcc-3.3 on the 7450 (but uses 25% less instructions...)
-
+
On the 970, the hand-made RA is still a win (arount 690
vs. around 780), but xlc goes to around 660 on the
regular C code...
register vector signed short line5 = vec_sub(temp4, temp5);
register vector signed short line6 = vec_add(temp6, temp7);
register vector signed short line7 = vec_sub(temp6, temp7);
-
+
register vector signed short line0B = vec_add(line0, line2);
register vector signed short line2B = vec_sub(line0, line2);
register vector signed short line1B = vec_add(line1, line3);
register vector signed short line6B = vec_sub(line4, line6);
register vector signed short line5B = vec_add(line5, line7);
register vector signed short line7B = vec_sub(line5, line7);
-
+
register vector signed short line0C = vec_add(line0B, line4B);
register vector signed short line4C = vec_sub(line0B, line4B);
register vector signed short line1C = vec_add(line1B, line5B);
register vector signed short line6C = vec_sub(line2B, line6B);
register vector signed short line3C = vec_add(line3B, line7B);
register vector signed short line7C = vec_sub(line3B, line7B);
-
+
vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
vsum = vec_sum4s(vec_abs(line1C), vsum);
vsum = vec_sum4s(vec_abs(line2C), vsum);
signal (SIGILL, SIG_DFL);
} else {
canjump = 1;
-
+
asm volatile ("mtspr 256, %0\n\t"
"vand %%v0, %%v0, %%v0"
:
: "r" (-1));
-
+
signal (SIGILL, SIG_DFL);
return 1;
}
pixelssum1, pixelssum2, temp3;
register const_vector unsigned char vczero = (const_vector unsigned char)vec_splat_u8(0);
register const_vector unsigned short vctwo = (const_vector unsigned short)vec_splat_u16(2);
-
+
temp1 = vec_ld(0, pixels);
temp2 = vec_ld(16, pixels);
pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels));
pixelssum1 = vec_add((vector unsigned short)pixelsv1,
(vector unsigned short)pixelsv2);
pixelssum1 = vec_add(pixelssum1, vctwo);
-
-POWERPC_PERF_START_COUNT(altivec_avg_pixels8_xy2_num, 1);
+
+POWERPC_PERF_START_COUNT(altivec_avg_pixels8_xy2_num, 1);
for (i = 0; i < h ; i++) {
int rightside = ((unsigned long)block & 0x0000000F);
blockv = vec_ld(0, block);
temp3 = vec_sra(temp3, vctwo);
pixelssum1 = vec_add(pixelssum2, vctwo);
pixelsavg = vec_packsu(temp3, (vector unsigned short) vczero);
-
+
if (rightside)
{
blocktemp = vec_perm(blockv, pixelsavg, vcprm(0, 1, s0, s1));
{
blocktemp = vec_perm(blockv, pixelsavg, vcprm(s0, s1, 2, 3));
}
-
+
blockv = vec_avg(blocktemp, blockv);
vec_st(blockv, 0, block);
-
+
block += line_size;
pixels += line_size;
}
-
+
POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_xy2_num, 1);
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
#include "../dsputil.h"
#include "gcc_fixes.h"
H264_MC(avg_, 16, altivec)
void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
-
+
#ifdef HAVE_ALTIVEC
if (has_altivec()) {
c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \
c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \
c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec
-
+
dspfunc(put_h264_qpel, 0, 16);
dspfunc(avg_h264_qpel, 0, 16);
#undef dspfunc
-
+
} else
#endif /* HAVE_ALTIVEC */
{
// Non-AltiVec PPC optimisations
-
+
// ... pending ...
}
}
register int loadSecond = (((unsigned long)src) % 16) <= 7 ? 0 : 1;
register int reallyBadAlign = (((unsigned long)src) % 16) == 15 ? 1 : 0;
-
+
vector unsigned char vsrcAuc;
vector unsigned char vsrcBuc;
vector unsigned char vsrcperm0;
vsrcBuc = vec_ld(16, src);
vsrcperm0 = vec_lvsl(0, src);
vsrcperm1 = vec_lvsl(1, src);
-
+
vector unsigned char vsrc0uc;
vector unsigned char vsrc1uc;
vsrc0uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm0);
vsrc1uc = vsrcBuc;
else
vsrc1uc = vec_perm(vsrcAuc, vsrcBuc, vsrcperm1);
-
+
vector signed short vsrc0ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero, (vector unsigned char)vsrc0uc);
vector signed short vsrc1ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero, (vector unsigned char)vsrc1uc);
for (i = 0 ; i < h ; i++) {
vector unsigned char vsrcCuc;
vsrcCuc = vec_ld(stride + 0, src);
-
+
vector unsigned char vsrc2uc;
vector unsigned char vsrc3uc;
vsrc2uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm0);
vsrc3uc = vec_perm(vsrcCuc, vsrcCuc, vsrcperm1);
-
+
vector signed short vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero, (vector unsigned char)vsrc2uc);
vector signed short vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero, (vector unsigned char)vsrc3uc);
-
+
vector signed short psum;
-
+
psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
psum = vec_mladd(vB, vsrc1ssH, psum);
psum = vec_mladd(vC, vsrc2ssH, psum);
psum = vec_mladd(vD, vsrc3ssH, psum);
psum = vec_add(v32ss, psum);
psum = vec_sra(psum, v6us);
-
+
vector unsigned char vdst = vec_ld(0, dst);
vector unsigned char ppsum = (vector unsigned char)vec_packsu(psum, psum);
-
+
vector unsigned char vfdst = vec_perm(vdst, ppsum, fperm);
vector unsigned char fsum;
-
+
OP_U8_ALTIVEC(fsum, vfdst, vdst);
vec_st(fsum, 0, dst);
-
+
vsrc0ssH = vsrc2ssH;
vsrc1ssH = vsrc3ssH;
-
+
dst += stride;
src += stride;
}
vector unsigned char vsrcDuc;
vsrcCuc = vec_ld(stride + 0, src);
vsrcDuc = vec_ld(stride + 16, src);
-
+
vector unsigned char vsrc2uc;
vector unsigned char vsrc3uc;
vsrc2uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm0);
vsrc3uc = vsrcDuc;
else
vsrc3uc = vec_perm(vsrcCuc, vsrcDuc, vsrcperm1);
-
+
vector signed short vsrc2ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero, (vector unsigned char)vsrc2uc);
vector signed short vsrc3ssH = (vector signed short)vec_mergeh((vector unsigned char)vzero, (vector unsigned char)vsrc3uc);
-
+
vector signed short psum;
-
+
psum = vec_mladd(vA, vsrc0ssH, vec_splat_s16(0));
psum = vec_mladd(vB, vsrc1ssH, psum);
psum = vec_mladd(vC, vsrc2ssH, psum);
psum = vec_mladd(vD, vsrc3ssH, psum);
psum = vec_add(v32ss, psum);
psum = vec_sr(psum, v6us);
-
+
vector unsigned char vdst = vec_ld(0, dst);
- vector unsigned char ppsum = (vector unsigned char)vec_pack(psum, psum);
-
+ vector unsigned char ppsum = (vector unsigned char)vec_pack(psum, psum);
+
vector unsigned char vfdst = vec_perm(vdst, ppsum, fperm);
vector unsigned char fsum;
-
+
OP_U8_ALTIVEC(fsum, vfdst, vdst);
vec_st(fsum, 0, dst);
-
+
vsrc0ssH = vsrc2ssH;
vsrc1ssH = vsrc3ssH;
-
+
dst += stride;
src += stride;
}
POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_h_lowpass_num, 1);
POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1);
register int i;
-
+
const vector signed int vzero = vec_splat_s32(0);
const vector unsigned char permM2 = vec_lvsl(-2, src);
const vector unsigned char permM1 = vec_lvsl(-1, src);
const vector signed short sum2B = vec_adds(srcM1B, srcP2B);
const vector signed short sum3A = vec_adds(srcM2A, srcP3A);
const vector signed short sum3B = vec_adds(srcM2B, srcP3B);
-
+
const vector signed short pp1A = vec_mladd(sum1A, v20ss, v16ss);
const vector signed short pp1B = vec_mladd(sum1B, v20ss, v16ss);
const vector signed short pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
const vector signed short pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
+
const vector signed short pp3A = vec_add(sum3A, pp1A);
const vector signed short pp3B = vec_add(sum3B, pp1B);
static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_v_lowpass_num, 1);
POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1);
-
+
register int i;
const vector signed int vzero = vec_splat_s32(0);
const vector unsigned char dstperm = vec_lvsr(0, dst);
const vector unsigned char neg1 = (const vector unsigned char)vec_splat_s8(-1);
const vector unsigned char dstmask = vec_perm((const vector unsigned char)vzero, neg1, dstperm);
-
+
uint8_t *srcbis = src - (srcStride * 2);
const vector unsigned char srcM2a = vec_ld(0, srcbis);
srcP1ssB = srcP2ssB;
srcP2ssA = srcP3ssA;
srcP2ssB = srcP3ssB;
-
+
const vector signed short pp1A = vec_mladd(sum1A, v20ss, v16ss);
const vector signed short pp1B = vec_mladd(sum1B, v20ss, v16ss);
const vector signed short pp2A = vec_mladd(sum2A, v5ss, (vector signed short)vzero);
const vector signed short pp2B = vec_mladd(sum2B, v5ss, (vector signed short)vzero);
-
+
const vector signed short pp3A = vec_add(sum3A, pp1A);
const vector signed short pp3B = vec_add(sum3B, pp1B);
const vector signed short sum2B = vec_adds(srcM1B, srcP2B);
const vector signed short sum3A = vec_adds(srcM2A, srcP3A);
const vector signed short sum3B = vec_adds(srcM2B, srcP3B);
-
+
const vector signed short pp1A = vec_mladd(sum1A, v20ss, sum3A);
const vector signed short pp1B = vec_mladd(sum1B, v20ss, sum3B);
vec_st(psumA, 0, tmp);
vec_st(psumB, 16, tmp);
-
+
src += srcStride;
tmp += tmpStride; /* int16_t*, and stride is 16, so it's OK here */
}
-
+
const vector unsigned char dstperm = vec_lvsr(0, dst);
const vector unsigned char neg1 = (const vector unsigned char)vec_splat_s8(-1);
const vector unsigned char dstmask = vec_perm((const vector unsigned char)vzero, neg1, dstperm);
const vector unsigned char mperm = (const vector unsigned char)
AVV(0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B,
0x04, 0x0C, 0x05, 0x0D, 0x06, 0x0E, 0x07, 0x0F);
-
+
int16_t *tmpbis = tmp - (tmpStride * 21);
vector signed short tmpM2ssA = vec_ld(0, tmpbis);
const vector signed int sumAo = vec_add(pp1cAo, pp32Ao);
const vector signed int sumBe = vec_add(pp1cBe, pp32Be);
const vector signed int sumBo = vec_add(pp1cBo, pp32Bo);
-
+
const vector signed int ssumAe = vec_sra(sumAe, v10ui);
const vector signed int ssumAo = vec_sra(sumAo, v10ui);
const vector signed int ssumBe = vec_sra(sumBe, v10ui);
}
av_free(fakedata);
-
+
return count;
}
#else
#ifdef HAVE_ALTIVEC
dsputil_h264_init_ppc(c, avctx);
-
+
if (has_altivec()) {
mm_flags |= MM_ALTIVEC;
-
+
// Altivec specific optimisations
c->pix_abs[0][1] = sad16_x2_altivec;
c->pix_abs[0][2] = sad16_y2_altivec;
c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec;
c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec;
c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
-
+
c->gmc1 = gmc1_altivec;
#ifdef CONFIG_DARWIN // ATM gcc-3.3 and gcc-3.4 fail to compile these in linux...
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
}
-
+
#ifdef POWERPC_PERFORMANCE_REPORT
{
int i, j;
FFTComplex *exptab = s->exptab;
int l;
FFTSample tmp_re, tmp_im;
-
+
POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6);
-
+
np = 1 << ln;
/* pass 0 */
p=&z[0];
j=(np >> 1);
do {
- BF(p[0].re, p[0].im, p[1].re, p[1].im,
+ BF(p[0].re, p[0].im, p[1].re, p[1].im,
p[0].re, p[0].im, p[1].re, p[1].im);
p+=2;
} while (--j != 0);
/* pass 1 */
-
+
p=&z[0];
j=np >> 2;
if (s->inverse) {
do {
- BF(p[0].re, p[0].im, p[2].re, p[2].im,
+ BF(p[0].re, p[0].im, p[2].re, p[2].im,
p[0].re, p[0].im, p[2].re, p[2].im);
- BF(p[1].re, p[1].im, p[3].re, p[3].im,
+ BF(p[1].re, p[1].im, p[3].re, p[3].im,
p[1].re, p[1].im, -p[3].im, p[3].re);
p+=4;
} while (--j != 0);
} else {
do {
- BF(p[0].re, p[0].im, p[2].re, p[2].im,
+ BF(p[0].re, p[0].im, p[2].re, p[2].im,
p[0].re, p[0].im, p[2].re, p[2].im);
- BF(p[1].re, p[1].im, p[3].re, p[3].im,
+ BF(p[1].re, p[1].im, p[3].re, p[3].im,
p[1].re, p[1].im, p[3].im, -p[3].re);
p+=4;
} while (--j != 0);
for (j = 0; j < nblocks; ++j) {
BF(p->re, p->im, q->re, q->im,
p->re, p->im, q->re, q->im);
-
+
p++;
q++;
for(l = nblocks; l < np2; l += nblocks) {
#else
register const vector float vczero = (const vector float){0.,0.,0.,0.};
#endif
-
+
int ln = s->nbits;
int j, np, np2;
int nblocks, nloops;
r = (vector float *)&z[0];
c1 = vcii(p,p,n,n);
-
+
if (s->inverse)
{
c2 = vcii(p,p,n,p);
{
c2 = vcii(p,p,p,n);
}
-
+
j = (np >> 2);
do {
a = vec_ld(0, r);
a1 = vec_ld(sizeof(vector float), r);
-
+
b = vec_perm(a,a,vcprmle(1,0,3,2));
a = vec_madd(a,c1,b);
/* do the pass 0 butterfly */
-
+
b = vec_perm(a1,a1,vcprmle(1,0,3,2));
b = vec_madd(a1,c1,b);
/* do the pass 0 butterfly */
-
+
/* multiply third by -i */
b = vec_perm(b,b,vcprmle(2,3,1,0));
-
+
/* do the pass 1 butterfly */
vec_st(vec_madd(b,c2,a), 0, r);
vec_st(vec_nmsub(b,c2,a), sizeof(vector float), r);
-
+
r += 2;
} while (--j != 0);
}
a = vec_ld(0, (float*)p);
b = vec_ld(0, (float*)q);
-
+
/* complex mul */
c = vec_ld(0, (float*)cptr);
/* cre*re cim*re */
c = vec_ld(sizeof(vector float), (float*)cptr);
/* -cim*im cre*im */
b = vec_madd(c, vec_perm(b,b,vcprmle(3,3,1,1)),t1);
-
+
/* butterfly */
vec_st(vec_add(a,b), 0, (float*)p);
vec_st(vec_sub(a,b), 0, (float*)q);
-
+
p += 2;
q += 2;
cptr += 4;
} while (--k);
-
+
p += nloops;
q += nloops;
} while (--j);
/*
* gcc fixes for altivec.
- * Used to workaround broken gcc (FSF gcc-3 pre gcc-3.3)
+ * Used to workaround broken gcc (FSF gcc-3 pre gcc-3.3)
* and to stay somewhat compatible with Darwin.
*/
# endif
#else
#define AVV(x...) {x}
-#if (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
+#if (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
/* This code was provided to me by Bartosch Pixa
* as a separate header file (broken_mergel.h).
};
return vec_perm (A, B, lowword);
}
-/*#define ff_vmrglb ff_vmrglb
-#define ff_vmrglh ff_vmrglh
-#define ff_vmrglw ff_vmrglw
+/*#define ff_vmrglb ff_vmrglb
+#define ff_vmrglh ff_vmrglh
+#define ff_vmrglw ff_vmrglw
*/
#undef vec_mergel
int i;
POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND);
-
+
for(i=0; i<h; i++)
{
dst[0]= (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + rounder)>>8;
Dv = vec_splat(tempA, 3);
rounderV = vec_ld(0, (unsigned short*)rounder_a);
-
+
// we'll be able to pick-up our 9 char elements
// at src from those 32 bytes
// we load the first batch here, as inside the loop
src_0 = vec_ld(0, src);
src_1 = vec_ld(16, src);
srcvA = vec_perm(src_0, src_1, vec_lvsl(0, src));
-
+
if (src_really_odd != 0x0000000F)
{ // if src & 0xF == 0xF, then (src+1) is properly aligned on the second vector.
srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src));
}
srcvA = vec_mergeh(vczero, srcvA);
srcvB = vec_mergeh(vczero, srcvB);
-
+
for(i=0; i<h; i++)
{
dst_odd = (unsigned long)dst & 0x0000000F;
src_really_odd = (((unsigned long)src) + stride) & 0x0000000F;
-
+
dstv = vec_ld(0, dst);
-
+
// we we'll be able to pick-up our 9 char elements
// at src + stride from those 32 bytes
// then reuse the resulting 2 vectors srvcC and srcvD
src_0 = vec_ld(stride + 0, src);
src_1 = vec_ld(stride + 16, src);
srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src));
-
+
if (src_really_odd != 0x0000000F)
{ // if src & 0xF == 0xF, then (src+1) is properly aligned on the second vector.
srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src));
{
srcvD = src_1;
}
-
+
srcvC = vec_mergeh(vczero, srcvC);
srcvD = vec_mergeh(vczero, srcvD);
-
+
// OK, now we (finally) do the math :-)
// those four instructions replaces 32 int muls & 32 int adds.
tempB = vec_mladd((vector unsigned short)srcvB, Bv, tempA);
tempC = vec_mladd((vector unsigned short)srcvC, Cv, tempB);
tempD = vec_mladd((vector unsigned short)srcvD, Dv, tempC);
-
+
srcvA = srcvC;
srcvB = srcvD;
-
+
tempD = vec_sr(tempD, vcsr8);
-
+
dstv2 = vec_pack(tempD, (vector unsigned short)vczero);
-
+
if (dst_odd)
{
dstv2 = vec_perm(dstv, dstv2, vcprm(0,1,s0,s1));
{
dstv2 = vec_perm(dstv, dstv2, vcprm(s0,s1,2,3));
}
-
+
vec_st(dstv2, 0, dst);
-
+
dst += stride;
src += stride;
}
vy3 = vec_adds (t2, t6); \
vy4 = vec_subs (t2, t6);
-
+
#define IDCT \
vector_s16_t vx0, vx1, vx2, vx3, vx4, vx5, vx6, vx7; \
vector_s16_t vy0, vy1, vy2, vy3, vy4, vy5, vy6, vy7; \
#include "../mpegvideo.h"
#include "gcc_fixes.h"
-
+
#include "dsputil_altivec.h"
// Swaps two variables (used for altivec registers)
// slower, for dumb non-apple GCC
#define FOUROF(a) {a,a,a,a}
#endif
-int dct_quantize_altivec(MpegEncContext* s,
+int dct_quantize_altivec(MpegEncContext* s,
DCTELEM* data, int n,
int qscale, int* overflow)
{
if (whichPass == 1)
{
// transpose the data for the second pass
-
+
// First, block transpose the upper right with lower left.
SWAP(row4, alt0);
SWAP(row5, alt1);
vec_cmpgt(alt7, zero));
}
-
+
}
// Store the data back into the original block
vec_ste(scanIndices_01, 0, &lastNonZeroChar);
lastNonZero = lastNonZeroChar;
-
+
// While the data is still in vectors we check for the transpose IDCT permute
// and handle it using the vector unit if we can. This is the permute used
// by the altivec idct, so it is common when using the altivec dct.
AltiVec version of dct_unquantize_h263
this code assumes `block' is 16 bytes-aligned
*/
-void dct_unquantize_h263_altivec(MpegEncContext *s,
+void dct_unquantize_h263_altivec(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
POWERPC_PERF_DECLARE(altivec_dct_unquantize_h263_num, 1);
int i, level, qmul, qadd;
int nCoeffs;
-
+
assert(s->block_last_index[n]>=0);
POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1);
-
+
qadd = (qscale - 1) | 1;
qmul = qscale << 1;
-
+
if (s->mb_intra) {
if (!s->h263_aic) {
- if (n < 4)
+ if (n < 4)
block[0] = block[0] * s->y_dc_scale;
else
block[0] = block[0] * s->c_dc_scale;
}else
qadd = 0;
i = 1;
- nCoeffs= 63; //does not allways use zigzag table
+ nCoeffs= 63; //does not allways use zigzag table
} else {
i = 0;
nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
register vector bool short blockv_null, blockv_neg;
register short backup_0 = block[0];
register int j = 0;
-
+
qmulv = vec_ld(0, qmul8);
qaddv = vec_ld(0, qadd8);
nqaddv = vec_ld(0, nqadd8);
}
}
#endif
-
+
// vectorize all the 16 bytes-aligned blocks
// of 8 elements
for(; (j + 7) <= nCoeffs ; j+=8)
block[j] = level;
}
}
-
+
if (i == 1)
{ // cheat. this avoid special-casing the first iteration
block[0] = backup_0;
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
#include "../dsputil.h"
#include "../mpegvideo.h"
#include <time.h>
#include "dsputil_altivec.h"
#endif
-extern int dct_quantize_altivec(MpegEncContext *s,
+extern int dct_quantize_altivec(MpegEncContext *s,
DCTELEM *block, int n,
int qscale, int *overflow);
extern void dct_unquantize_h263_altivec(MpegEncContext *s,
c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mmi;
c->get_pixels = get_pixels_mmi;
-
+
if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_PS2){
c->idct_put= ff_mmi_idct_put;
c->idct_add= ff_mmi_idct_add;
Rounding trick Copyright (c) 2000 Michel Lespinasse <walken@zoy.org>
MMI port by Leon van Stuivenberg
-*/
+*/
#include "../common.h"
#include "../dsputil.h"
#include "mmi.h"
/* rounder 1*/
0x3ff, 0, 0x3ff, 0, 0x3ff, 0, 0x3ff, 0,
/* row 0/4*/
- 16384, 21407, -16384, -21407, 22725, 19266, -22725, -12873,
- 8867, 16384, 8867, 16384, 4520, 12873, -4520, 19266,
- 16384, -8867, 16384, -8867, 12873, -22725, 19266, -22725,
- 21407, -16384, -21407, 16384, 19266, 4520, -12873, 4520,
+ 16384, 21407, -16384, -21407, 22725, 19266, -22725, -12873,
+ 8867, 16384, 8867, 16384, 4520, 12873, -4520, 19266,
+ 16384, -8867, 16384, -8867, 12873, -22725, 19266, -22725,
+ 21407, -16384, -21407, 16384, 19266, 4520, -12873, 4520,
/* row 1/7*/
- 22725, 29692, -22725, -29692, 31521, 26722, -31521, -17855,
- 12299, 22725, 12299, 22725, 6270, 17855, -6270, 26722,
- 22725, -12299, 22725, -12299, 17855, -31521, 26722, -31521,
- 29692, -22725, -29692, 22725, 26722, 6270, -17855, 6270,
+ 22725, 29692, -22725, -29692, 31521, 26722, -31521, -17855,
+ 12299, 22725, 12299, 22725, 6270, 17855, -6270, 26722,
+ 22725, -12299, 22725, -12299, 17855, -31521, 26722, -31521,
+ 29692, -22725, -29692, 22725, 26722, 6270, -17855, 6270,
/* row 2/6*/
- 21407, 27969, -21407, -27969, 29692, 25172, -29692, -16819,
- 11585, 21407, 11585, 21407, 5906, 16819, -5906, 25172,
- 21407, -11585, 21407, -11585, 16819, -29692, 25172, -29692,
- 27969, -21407, -27969, 21407, 25172, 5906, -16819, 5906,
+ 21407, 27969, -21407, -27969, 29692, 25172, -29692, -16819,
+ 11585, 21407, 11585, 21407, 5906, 16819, -5906, 25172,
+ 21407, -11585, 21407, -11585, 16819, -29692, 25172, -29692,
+ 27969, -21407, -27969, 21407, 25172, 5906, -16819, 5906,
/*row 3/5*/
- 19266, 25172, -19266, -25172, 26722, 22654, -26722, -15137,
- 10426, 19266, 10426, 19266, 5315, 15137, -5315, 22654,
- 19266, -10426, 19266, -10426, 15137, -26722, 22654, -26722,
+ 19266, 25172, -19266, -25172, 26722, 22654, -26722, -15137,
+ 10426, 19266, 10426, 19266, 5315, 15137, -5315, 22654,
+ 19266, -10426, 19266, -10426, 15137, -26722, 22654, -26722,
25172, -19266, -25172, 19266, 22654, 5315, -15137, 5315,
/*column constants*/
TG1, TG1, TG1, TG1, TG1, TG1, TG1, TG1,
DCT_8_INV_ROW1($4, 112, TAB_i_17, $7, $15);
DCT_8_INV_COL8();
DCT_8_INV_COL8_STORE($4);
-
+
//let savedtemp regs be saved
__asm__ __volatile__(" ":::"$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23");
}
*
* MMI optimization by Leon van Stuivenberg
*/
-
+
#include "../dsputil.h"
#include "../mpegvideo.h"
#include "../avcodec.h"
-static void dct_unquantize_h263_mmi(MpegEncContext *s,
+static void dct_unquantize_h263_mmi(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int level=0, qmul, qadd;
int nCoeffs;
-
+
assert(s->block_last_index[n]>=0);
-
+
qadd = (qscale - 1) | 1;
qmul = qscale << 1;
-
+
if (s->mb_intra) {
if (!s->h263_aic) {
- if (n < 4)
+ if (n < 4)
level = block[0] * s->y_dc_scale;
else
level = block[0] * s->c_dc_scale;
qadd = 0;
level = block[0];
}
- nCoeffs= 63; //does not allways use zigzag table
+ nCoeffs= 63; //does not allways use zigzag table
} else {
nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
}
asm volatile(
"add $14, $0, %3 \n\t"
- "pcpyld $8, %0, %0 \n\t"
+ "pcpyld $8, %0, %0 \n\t"
"pcpyh $8, $8 \n\t" //r8 = qmul
- "pcpyld $9, %1, %1 \n\t"
+ "pcpyld $9, %1, %1 \n\t"
"pcpyh $9, $9 \n\t" //r9 = qadd
".p2align 2 \n\t"
"1: \n\t"
"pcgth $11, $0, $10 \n\t" //r11 = level < 0 ? -1 : 0
"pcgth $12, $10, $0 \n\t" //r12 = level > 0 ? -1 : 0
"por $12, $11, $12 \n\t"
- "pmulth $10, $10, $8 \n\t"
+ "pmulth $10, $10, $8 \n\t"
"paddh $13, $9, $11 \n\t"
"pxor $13, $13, $11 \n\t" //r13 = level < 0 ? -qadd : qadd
"pmfhl.uw $11 \n\t"
void MPV_common_init_mmi(MpegEncContext *s)
{
- s->dct_unquantize_h263_intra =
+ s->dct_unquantize_h263_intra =
s->dct_unquantize_h263_inter = dct_unquantize_h263_mmi;
}
/*
* Copyright (c) 2004 Roman Shaposhnik.
- *
+ *
* Many thanks to Steven M. Schultz for providing clever ideas and
* to Michael Niedermayer <michaelni@gmx.at> for writing initial
* implementation.
int *rets;
int rets_count;
int job_count;
-
+
pthread_cond_t last_job_cond;
pthread_cond_t current_job_cond;
pthread_mutex_t current_job_lock;
int done;
} ThreadContext;
-static void* worker(void *v)
+static void* worker(void *v)
{
AVCodecContext *avctx = v;
ThreadContext *c = avctx->thread_opaque;
pthread_mutex_lock(&c->current_job_lock);
self_id = c->current_job++;
- for (;;){
+ for (;;){
while (our_job >= c->job_count) {
if (c->current_job == thread_count + c->job_count)
pthread_cond_signal(&c->last_job_cond);
-
+
pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);
our_job = self_id;
-
+
if (c->done) {
pthread_mutex_unlock(&c->current_job_lock);
return NULL;
}
}
pthread_mutex_unlock(&c->current_job_lock);
-
+
c->rets[our_job%c->rets_count] = c->func(avctx, c->args[our_job]);
-
+
pthread_mutex_lock(&c->current_job_lock);
our_job = c->current_job++;
}
pthread_mutex_unlock(&c->current_job_lock);
}
-void avcodec_thread_free(AVCodecContext *avctx)
+void avcodec_thread_free(AVCodecContext *avctx)
{
ThreadContext *c = avctx->thread_opaque;
int i;
-
+
pthread_mutex_lock(&c->current_job_lock);
c->done = 1;
pthread_cond_broadcast(&c->current_job_cond);
av_free(c);
}
-int avcodec_thread_execute(AVCodecContext *avctx, action_t* func, void **arg, int *ret, int job_count)
+int avcodec_thread_execute(AVCodecContext *avctx, action_t* func, void **arg, int *ret, int job_count)
{
ThreadContext *c= avctx->thread_opaque;
int dummy_ret;
-
+
if (job_count <= 0)
return 0;
-
+
pthread_mutex_lock(&c->current_job_lock);
c->current_job = avctx->thread_count;
if (ret) {
c->rets = ret;
c->rets_count = job_count;
- } else {
+ } else {
c->rets = &dummy_ret;
c->rets_count = 1;
}
pthread_cond_broadcast(&c->current_job_cond);
avcodec_thread_park_workers(c, avctx->thread_count);
-
+
return 0;
}
-int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
+int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
{
int i;
ThreadContext *c;
c = av_mallocz(sizeof(ThreadContext));
if (!c)
return -1;
-
+
c->workers = av_mallocz(sizeof(pthread_t)*thread_count);
if (!c->workers) {
av_free(c);
c->current_job = 0;
c->job_count = 0;
c->done = 0;
- pthread_cond_init(&c->current_job_cond, NULL);
+ pthread_cond_init(&c->current_job_cond, NULL);
pthread_cond_init(&c->last_job_cond, NULL);
pthread_mutex_init(&c->current_job_lock, NULL);
pthread_mutex_lock(&c->current_job_lock);
- for (i=0; i<thread_count; i++) {
+ for (i=0; i<thread_count; i++) {
if(pthread_create(&c->workers[i], NULL, worker, avctx)) {
avctx->thread_count = i;
pthread_mutex_unlock(&c->current_job_lock);
return -1;
}
}
-
+
avcodec_thread_park_workers(c, thread_count);
-
+
avctx->execute = avcodec_thread_execute;
return 0;
}
* c is built with data from subpacket 11
* Most of this function is used only if superblock_type_2_3 == 0, never seen it in samples
*
- * @param tone_level_idx
+ * @param tone_level_idx
* @param tone_level_idx_temp
* @param coding_method q->coding_method[0][0][0]
* @param nb_channels number of channels
samples[0] = type30_dequant[qdm2_get_vlc(gb, &vlc_tab_type30, 0, 1)];
else
samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
-
+
run = 1;
break;
if (BITS_LEFT(length,gb) < 16)
break;
diff = qdm2_get_se_vlc(&vlc_tab_diff, gb, 2);
-
+
for (k = 1; k <= run; k++)
quantized_coeffs[i + k] = (level + ((k * diff) / run));
-
+
level += diff;
i += run;
}
for (i = q->fft_tone_start; i < q->fft_tone_end; i++)
{
FFTTone *t = &q->fft_tones[i];
-
+
av_log(NULL,AV_LOG_DEBUG,"Tone (%d) dump:\n", i);
av_log(NULL,AV_LOG_DEBUG," level = %f\n", t->level);
// PRINT(" level", t->level);
int tmp_val, tmp, size;
int i;
float alpha;
-
+
/* extradata parsing
-
+
Structure:
wave {
frma (QDM2)
QDCA
QDCP
}
-
+
32 size (including this field)
32 tag (=frma)
32 type (=QDM2 or QDMC)
-
+
32 size (including this field, in bytes)
32 tag (=QDCA) // maybe mandatory parameters
32 unknown (=1)
32 block size (=4096)
32 frame size (=256) (for one channel)
32 packet size (=1300)
-
+
32 size (including this field, in bytes)
32 tag (=QDCP) // maybe some tuneable parameters
32 float1 (=1.0)
s->sub_sampling = s->fft_order - 7;
s->frequency_range = 255 / (1 << (2 - s->sub_sampling));
-
+
switch ((s->sub_sampling * 2 + s->channels - 1)) {
case 0: tmp = 40; break;
case 1: tmp = 48; break;
}
qdm2_init(s);
-
+
// dump_context(s);
return 0;
}
QDM2Context *s = avctx->priv_data;
ff_fft_end(&s->fft_ctx);
-
+
return 0;
}
{
int ch, i;
const int frame_size = (q->frame_size * q->channels);
-
+
/* select input buffer */
q->compressed_data = in;
q->compressed_size = q->checksum_size;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file qdm2data.h
* Various QDM2 tables.
{ .1250000000f,-.0164473690f,-.0097465888f, .0558035709f, .0330687836f },
{ .0416666667f,-.0208333333f,-.0123456791f, .0000000000f, .0000000000f },
{ .0100000000f,-.0069444444f,-.0018416207f,-.0037037037f,-.0020000000f } },
-
+
{ { .0050000000f,-.0200000000f, .0125000000f,-.3030303030f, .0020000000f },
{ .1041666642f, .0400000000f,-.0250000000f, .0333333333f,-.0200000000f },
{ .1250000000f, .0100000000f, .0142857144f,-.0500000007f,-.0200000000f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
-
+
{ { .1428571492f, .1250000000f,-.0285714287f,-.0357142873f, .0208333333f },
{ .1818181818f, .0588235296f, .0333333333f, .0212765951f, .0100000000f },
{ .1818181818f, .0212765951f, .0100000000f, .0588235296f, .0333333333f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } },
-
+
{ { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
{ .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f },
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file qdrw.c
* Apple QuickDraw codec.
*/
-
+
#include "avcodec.h"
#include "mpegvideo.h"
uint8_t palette[256*3];
} QdrawContext;
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
uint8_t* outdata;
int colors;
int i;
-
+
if(p->data[0])
avctx->release_buffer(avctx, p);
p->key_frame= 1;
outdata = a->pic.data[0];
-
+
buf += 0x68; /* jump to palette */
colors = BE_32(buf);
buf += 4;
-
+
if(colors < 0 || colors > 256) {
av_log(avctx, AV_LOG_ERROR, "Error color count - %i(0x%X)\n", colors, colors);
return -1;
}
-
+
for (i = 0; i <= colors; i++) {
unsigned int idx;
idx = BE_16(buf); /* color index */
buf += 2;
-
+
if (idx > 255) {
av_log(avctx, AV_LOG_ERROR, "Palette index out of range: %u\n", idx);
buf += 6;
uint8_t *next;
uint8_t *out;
int tsize = 0;
-
+
/* decode line */
out = outdata;
size = BE_16(buf); /* size of packed line */
*data_size = sizeof(AVFrame);
*(AVFrame*)data = a->pic;
-
+
return buf_size;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file qpeg.c
* QPEG codec.
*/
-
+
#include "avcodec.h"
#include "mpegvideo.h"
int run, copy;
int filled = 0;
int rows_to_go;
-
+
rows_to_go = height;
height--;
dst = dst + height * stride;
-
+
while((size > 0) && (rows_to_go > 0)) {
code = *src++;
size--;
} else { /* short copy */
copy = code + 1;
}
-
+
/* perform actual run or copy */
if(run) {
int p;
-
+
p = *src++;
size--;
for(i = 0; i < run; i++) {
}
}
-static int qpeg_table_h[16] =
+static int qpeg_table_h[16] =
{ 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
static int qpeg_table_w[16] =
{ 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
-
+
/* Decodes delta frames */
static void qpeg_decode_inter(uint8_t *src, uint8_t *dst, int size,
int stride, int width, int height,
int filled = 0;
int orig_height;
uint8_t *blkdata;
-
+
/* copy prev frame */
for(i = 0; i < height; i++)
memcpy(refdata + (i * width), dst + (i * stride), width);
-
+
orig_height = height;
blkdata = src - 0x86;
height--;
while((size > 0) && (height >= 0)) {
code = *src++;
size--;
-
+
if(delta) {
/* motion compensation */
while((code & 0xF0) == 0xF0) {
int me_w, me_h, me_x, me_y;
uint8_t *me_plane;
int corr, val;
-
+
/* get block size by index */
me_idx = code & 0xF;
me_w = qpeg_table_w[me_idx];
me_h = qpeg_table_h[me_idx];
-
+
/* extract motion vector */
corr = *src++;
size--;
if(val > 7)
val -= 16;
me_x = val;
-
+
val = corr & 0xF;
if(val > 7)
val -= 16;
me_y = val;
-
+
/* check motion vector */
if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
(height - me_y - me_h < 0) || (height - me_y > orig_height) ||
size--;
}
}
-
+
if(code == 0xE0) /* end-of-picture code */
break;
if(code > 0xE0) { /* run code: 0xE1..0xFF */
}
} else if(code >= 0xC0) { /* copy code: 0xC0..0xDF */
code &= 0x1F;
-
+
for(i = 0; i <= code; i++) {
dst[filled++] = *src++;
if(filled >= width) {
size -= code + 1;
} else if(code >= 0x80) { /* skip code: 0x80..0xBF */
int skip;
-
+
code &= 0x3F;
/* codes 0x80 and 0x81 are actually escape codes,
skip value minus constant is in the next byte */
}
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
AVFrame * const p= (AVFrame*)&a->pic;
uint8_t* outdata;
int delta;
-
+
if(p->data[0])
avctx->release_buffer(avctx, p);
*data_size = sizeof(AVFrame);
*(AVFrame*)data = a->pic;
-
+
return buf_size;
}
static int decode_init(AVCodecContext *avctx){
QpegContext * const a = avctx->priv_data;
-
+
a->avctx = avctx;
avctx->pix_fmt= PIX_FMT_PAL8;
avctx->has_b_frames = 0;
static int decode_end(AVCodecContext *avctx){
QpegContext * const a = avctx->priv_data;
AVFrame * const p= (AVFrame*)&a->pic;
-
+
if(p->data[0])
avctx->release_buffer(avctx, p);
int *b1,*b2;
int x,y;
int *ptr,*tmp;
-
+
b1=buffer;
b2=a2;
-
+
for (x=0;x<10;x++) {
b1[x]=(*a1)<<4;
b1=b2;
b2=tmp;
a1++;
- }
+ }
ptr=a2+10;
while (ptr>a2) (*a2++)>>=4;
}
ptr=glob->wavtable1+n*9;
ptr2=glob->wavtable2+n*9;
if (f!=0) {
- a=((*ptr)*m1)>>((*ptr2)+1);
+ a=((*ptr)*m1)>>((*ptr2)+1);
} else {
a=0;
}
*(output++)=ptr[x];
*(output++)=ptr[x+2];
*(output++)=ptr[x+3];
- *(output++)=ptr[x+1];
+ *(output++)=ptr[x+1];
}
}
if(buf_size==0)
return 0;
-
+
datao = data;
unpack_input(buf,glob->unpacked);
-
+
glob->iptr=glob->unpacked;
glob->val=decodetable[0][(*(glob->iptr++))<<1];
0x0004,0x0016,0xfff6,0xfff0,0x0024,0x0005,0x000b,0xffc8,
0xffdb,0xfffa,0x000a,0x0005,0x000d,0x0003,0xfffa,0x0005,
0xfff5,0xfffc,0x0013,0x0005,0x0010,0xffd7,0xffe8,0xfff3};
-
+
static const unsigned long ftable1[128]={
0x4cc9f,0x482af,0x47bd8,0x44700,0x5238b,0x47377,0x4898a,0x411fd,
0x4f8b7,0x4a7d5,0x4bd1b,0x47feb,0x5554b,0x49414,0x4c9d4,0x4403c,
#include "avcodec.h"
#include "ra288.h"
-
+
typedef struct {
float history[8];
float output[40];
if (x==c) fp=in;
work[x]=*(table++)*(*(st1++)=*(fp++));
}
-
+
prodsum(buffer1,work+n,i,n);
prodsum(buffer2,work+a,j,n);
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file rangecoder.c
* Range coder.
void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size){
- c->bytestream_start=
+ c->bytestream_start=
c->bytestream= buf;
c->bytestream_end= buf + buf_size;
#if 0
for(i=1; i<256; i++){
- if(c->one_state[i])
+ if(c->one_state[i])
continue;
-
+
p= (i*one + 128) >> 8;
last_p8= i;
for(;;){
if(p8 <= last_p8) p8= last_p8+1;
if(last_p8 && last_p8<256 && p8<=max_p)
c->one_state[last_p8]= p8;
-
+
p+= ((one-p)*factor + one/2) >> 32;
last_p8= p8;
}
#endif
for(i=256-max_p; i<=max_p; i++){
- if(c->one_state[i])
+ if(c->one_state[i])
continue;
p= (i*one + 128) >> 8;
if(p8 > max_p) p8= max_p;
c->one_state[ i]= p8;
}
-
+
for(i=0; i<256; i++)
c->zero_state[i]= 256-c->one_state[256-i];
#if 0
uint8_t r[9*SIZE];
int i;
uint8_t state[10]= {0};
-
+
ff_init_range_encoder(&c, b, SIZE);
ff_build_rac_states(&c, 0.05*(1LL<<32), 128+64+32+16);
-
+
memset(state, 128, sizeof(state));
for(i=0; i<SIZE; i++){
r[i]= random()%7;
}
-
-
+
+
for(i=0; i<SIZE; i++){
START_TIMER
put_rac(&c, state, r[i]&1);
}
ff_put_rac_terminate(&c);
-
+
ff_init_range_decoder(&c, b, SIZE);
-
+
memset(state, 128, sizeof(state));
-
+
for(i=0; i<SIZE; i++){
START_TIMER
if( (r[i]&1) != get_rac(&c, state) )
av_log(NULL, AV_LOG_DEBUG, "rac failure at %d\n", i);
STOP_TIMER("get_rac")
}
-
+
return 0;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file rangecoder.h
* Range coder.
}else{
c->outstanding_count++;
}
-
+
c->low = (c->low & 0xFF)<<8;
c->range <<= 8;
}
c->range = range1;
*state= c->one_state[*state];
}
-
+
renorm_encoder(c);
}
static inline int get_rac(RangeCoder *c, uint8_t * const state){
int range1= (c->range * (*state)) >> 8;
int attribute_unused one_mask;
-
+
c->range -= range1;
#if 1
if(c->low < c->range){
}
#else
one_mask= (c->range - c->low-1)>>31;
-
+
c->low -= c->range & one_mask;
c->range += (range1 - c->range) & one_mask;
-
+
*state= c->zero_state[(*state) + (256&one_mask)];
-
+
refill(c);
return one_mask&1;
/**
* @file ratecontrol.c
* Rate control for video encoders.
- */
+ */
#include "avcodec.h"
#include "dsputil.h"
void ff_write_pass1_stats(MpegEncContext *s){
snprintf(s->avctx->stats_out, 256, "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d;\n",
- s->current_picture_ptr->display_picture_number, s->current_picture_ptr->coded_picture_number, s->pict_type,
- s->current_picture.quality, s->i_tex_bits, s->p_tex_bits, s->mv_bits, s->misc_bits,
+ s->current_picture_ptr->display_picture_number, s->current_picture_ptr->coded_picture_number, s->pict_type,
+ s->current_picture.quality, s->i_tex_bits, s->p_tex_bits, s->mv_bits, s->misc_bits,
s->f_code, s->b_code, s->current_picture.mc_mb_var_sum, s->current_picture.mb_var_sum, s->i_count);
}
for(i=0; i<5; i++){
rcc->pred[i].coeff= FF_QP2LAMBDA * 7.0;
rcc->pred[i].count= 1.0;
-
+
rcc->pred[i].decay= 0.4;
rcc->i_cplx_sum [i]=
rcc->p_cplx_sum [i]=
return -1;
rcc->entry = (RateControlEntry*)av_mallocz(i*sizeof(RateControlEntry));
rcc->num_entries= i;
-
+
/* init all to skipped p frames (with b frames we might have a not encoded frame at the end FIXME) */
for(i=0; i<rcc->num_entries; i++){
RateControlEntry *rce= &rcc->entry[i];
rce->qscale= rce->new_qscale=FF_QP2LAMBDA * 2;
rce->misc_bits= s->mb_num + 10;
rce->mb_var_sum= s->mb_num*100;
- }
-
+ }
+
/* read stats */
p= s->avctx->stats_in;
for(i=0; i<rcc->num_entries - s->max_b_frames; i++){
rce= &rcc->entry[picture_number];
e+=sscanf(p, " in:%*d out:%*d type:%d q:%f itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d",
- &rce->pict_type, &rce->qscale, &rce->i_tex_bits, &rce->p_tex_bits, &rce->mv_bits, &rce->misc_bits,
+ &rce->pict_type, &rce->qscale, &rce->i_tex_bits, &rce->p_tex_bits, &rce->mv_bits, &rce->misc_bits,
&rce->f_code, &rce->b_code, &rce->mc_mb_var_sum, &rce->mb_var_sum, &rce->i_count);
if(e!=12){
av_log(s->avctx, AV_LOG_ERROR, "statistics are damaged at line %d, parser out=%d\n", i, e);
}
p= next;
}
-
+
if(init_pass2(s) < 0) return -1;
}
-
+
if(!(s->flags&CODEC_FLAG_PASS2)){
rcc->short_term_qsum=0.001;
rcc->short_term_qcount=0.001;
-
+
rcc->pass1_rc_eq_output_sum= 0.001;
rcc->pass1_wanted_bits=0.001;
-
+
/* init stuff with the user specified complexity */
if(s->avctx->rc_initial_cplx){
for(i=0; i<60*30; i++){
double bits= s->avctx->rc_initial_cplx * (i/10000.0 + 1.0)*s->mb_num;
RateControlEntry rce;
double q;
-
+
if (i%((s->gop_size+3)/4)==0) rce.pict_type= I_TYPE;
else if(i%(s->max_b_frames+1)) rce.pict_type= B_TYPE;
else rce.pict_type= P_TYPE;
}
}
-
+
return 0;
}
}
return rce->qscale * (double)(rce->i_tex_bits + rce->p_tex_bits+1)/ bits;
}
-
+
int ff_vbv_update(MpegEncContext *s, int frame_size){
RateControlContext *rcc= &s->rc_context;
const double fps= 1/av_q2d(s->avctx->time_base);
const int buffer_size= s->avctx->rc_buffer_size;
const double min_rate= s->avctx->rc_min_rate/fps;
const double max_rate= s->avctx->rc_max_rate/fps;
-
+
//printf("%d %f %d %f %f\n", buffer_size, rcc->buffer_index, frame_size, min_rate, max_rate);
if(buffer_size){
int left;
if(rcc->buffer_index > buffer_size){
int stuffing= ceil((rcc->buffer_index - buffer_size)/8);
-
+
if(stuffing < 4 && s->codec_id == CODEC_ID_MPEG4)
stuffing=4;
rcc->buffer_index -= 8*stuffing;
-
+
if(s->avctx->debug & FF_DEBUG_RC)
av_log(s->avctx, AV_LOG_DEBUG, "stuffing %d bytes\n", stuffing);
AVCodecContext *a= s->avctx;
double q, bits;
const int pict_type= rce->new_pict_type;
- const double mb_num= s->mb_num;
+ const double mb_num= s->mb_num;
int i;
double const_values[]={
};
bits= ff_eval(s->avctx->rc_eq, const_values, const_names, func1, func1_names, NULL, NULL, rce);
-
+
rcc->pass1_rc_eq_output_sum+= bits;
bits*=rate_factor;
if(bits<0.0) bits=0.0;
bits+= 1.0; //avoid 1/0 issues
-
+
/* user override */
for(i=0; i<s->avctx->rc_override_count; i++){
RcOverride *rco= s->avctx->rc_override;
if(rco[i].start_frame > frame_num) continue;
if(rco[i].end_frame < frame_num) continue;
-
- if(rco[i].qscale)
+
+ if(rco[i].qscale)
bits= qp2bits(rce, rco[i].qscale); //FIXME move at end to really force it?
else
bits*= rco[i].quality_factor;
}
q= bits2qp(rce, bits);
-
+
/* I/B difference */
if (pict_type==I_TYPE && s->avctx->i_quant_factor<0.0)
q= -q*s->avctx->i_quant_factor + s->avctx->i_quant_offset;
else if(pict_type==B_TYPE && s->avctx->b_quant_factor<0.0)
q= -q*s->avctx->b_quant_factor + s->avctx->b_quant_offset;
-
+
return q;
}
const int pict_type= rce->new_pict_type;
const double last_p_q = rcc->last_qscale_for[P_TYPE];
const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type];
-
+
if (pict_type==I_TYPE && (a->i_quant_factor>0.0 || rcc->last_non_b_pict_type==P_TYPE))
q= last_p_q *ABS(a->i_quant_factor) + a->i_quant_offset;
else if(pict_type==B_TYPE && a->b_quant_factor>0.0)
}
rcc->last_qscale_for[pict_type]= q; //Note we cant do that after blurring
-
+
if(pict_type!=B_TYPE)
rcc->last_non_b_pict_type= pict_type;
* gets the qmin & qmax for pict_type
*/
static void get_qminmax(int *qmin_ret, int *qmax_ret, MpegEncContext *s, int pict_type){
- int qmin= s->avctx->lmin;
+ int qmin= s->avctx->lmin;
int qmax= s->avctx->lmax;
-
+
assert(qmin <= qmax);
if(pict_type==B_TYPE){
qmax= clip(qmax, 1, FF_LAMBDA_MAX);
if(qmax<qmin) qmax= qmin;
-
+
*qmin_ret= qmin;
*qmax_ret= qmax;
}
const double fps= 1/av_q2d(s->avctx->time_base);
const double min_rate= s->avctx->rc_min_rate / fps;
const double max_rate= s->avctx->rc_max_rate / fps;
-
+
get_qminmax(&qmin, &qmax, s, pict_type);
/* modulation */
}else{
double min2= log(qmin);
double max2= log(qmax);
-
+
q= log(q);
q= (q - min2)/(max2-min2) - 0.5;
q*= -4.0;
q= 1.0/(1.0 + exp(q));
q= q*(max2-min2) + min2;
-
+
q= exp(q);
}
-
+
return q;
}
Picture * const pic= &s->current_picture;
const int mb_width = s->mb_width;
const int mb_height = s->mb_height;
-
+
for(i=0; i<s->mb_num; i++){
const int mb_xy= s->mb_index2xy[i];
float temp_cplx= sqrt(pic->mc_mb_var[mb_xy]); //FIXME merge in pow()
int mb_y = mb_xy / s->mb_stride;
int mb_distance;
float mb_factor = 0.0;
-#if 0
+#if 0
if(spat_cplx < q/3) spat_cplx= q/3; //FIXME finetune
if(temp_cplx < q/3) temp_cplx= q/3; //FIXME finetune
-#endif
+#endif
if(spat_cplx < 4) spat_cplx= 4; //FIXME finetune
if(temp_cplx < 4) temp_cplx= 4; //FIXME finetune
- if((s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTRA)){//FIXME hq mode
+ if((s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTRA)){//FIXME hq mode
cplx= spat_cplx;
factor= 1.0 + p_masking;
}else{
}
factor*= 1.0 - border_masking*mb_factor;
-
+
if(factor<0.00001) factor= 0.00001;
-
+
bits= cplx*factor;
cplx_sum+= cplx;
bits_sum+= bits;
if(bits_sum < 0.001) bits_sum= 0.001;
if(cplx_sum < 0.001) cplx_sum= 0.001;
}
-
+
for(i=0; i<s->mb_num; i++){
const int mb_xy= s->mb_index2xy[i];
float newq= q*cplx_tab[i]/bits_tab[i];
if(br_compensation<=0.0) br_compensation=0.001;
var= pict_type == I_TYPE ? pic->mb_var_sum : pic->mc_mb_var_sum;
-
+
short_term_q = 0; /* avoid warning */
if(s->flags&CODEC_FLAG_PASS2){
if(pict_type!=I_TYPE)
q= rce->new_qscale / br_compensation;
//printf("%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale, br_compensation, s->frame_bits, var, pict_type);
}else{
- rce->pict_type=
+ rce->pict_type=
rce->new_pict_type= pict_type;
rce->mc_mb_var_sum= pic->mc_mb_var_sum;
rce->mb_var_sum = pic-> mb_var_sum;
rce->i_count = 0; //FIXME we do know this approx
rce->i_tex_bits= 0;
rce->p_tex_bits= bits*0.9;
-
+
rce->mv_bits= bits*0.1;
}
rcc->i_cplx_sum [pict_type] += rce->i_tex_bits*rce->qscale;
bits= rce->i_tex_bits + rce->p_tex_bits;
rate_factor= rcc->pass1_wanted_bits/rcc->pass1_rc_eq_output_sum * br_compensation;
-
+
q= get_qscale(s, rce, rate_factor, picture_number);
assert(q>0.0);
//printf("%f ", q);
}
assert(q>0.0);
-
+
q= modify_qscale(s, rce, q, picture_number);
rcc->pass1_wanted_bits+= s->bit_rate/fps;
);
}
- if (q<qmin) q=qmin;
+ if (q<qmin) q=qmin;
else if(q>qmax) q=qmax;
if(s->adaptive_quant)
adaptive_quantization(s, q);
else
q= (int)(q + 0.5);
-
+
rcc->last_qscale= q;
rcc->last_mc_mb_var_sum= pic->mc_mb_var_sum;
rcc->last_mb_var_sum= pic->mb_var_sum;
double rate_factor=0;
double step;
//int last_i_frame=-10000000;
- const int filter_size= (int)(a->qblur*4) | 1;
+ const int filter_size= (int)(a->qblur*4) | 1;
double expected_bits;
double *qscale, *blured_qscale;
/* find complexity & const_bits & decide the pict_types */
for(i=0; i<rcc->num_entries; i++){
RateControlEntry *rce= &rcc->entry[i];
-
+
rce->new_pict_type= rce->pict_type;
rcc->i_cplx_sum [rce->pict_type] += rce->i_tex_bits*rce->qscale;
rcc->p_cplx_sum [rce->pict_type] += rce->p_tex_bits*rce->qscale;
const_bits[rce->new_pict_type]+= rce->mv_bits + rce->misc_bits;
}
all_const_bits= const_bits[I_TYPE] + const_bits[P_TYPE] + const_bits[B_TYPE];
-
+
if(all_available_bits < all_const_bits){
av_log(s->avctx, AV_LOG_ERROR, "requested bitrate is to low\n");
return -1;
}
-
+
/* find average quantizers */
avg_quantizer[P_TYPE]=0;
for(step=256*256; step>0.0000001; step*=0.5){
double expected_bits=0;
avg_quantizer[P_TYPE]+= step;
-
+
avg_quantizer[I_TYPE]= avg_quantizer[P_TYPE]*ABS(s->avctx->i_quant_factor) + s->avctx->i_quant_offset;
avg_quantizer[B_TYPE]= avg_quantizer[P_TYPE]*ABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
-
- expected_bits=
- + all_const_bits
+
+ expected_bits=
+ + all_const_bits
+ complexity[I_TYPE]/avg_quantizer[I_TYPE]
+ complexity[P_TYPE]/avg_quantizer[P_TYPE]
+ complexity[B_TYPE]/avg_quantizer[B_TYPE];
-
+
if(expected_bits < all_available_bits) avg_quantizer[P_TYPE]-= step;
//printf("%f %lld %f\n", expected_bits, all_available_bits, avg_quantizer[P_TYPE]);
}
available_bits[i]= const_bits[i] + complexity[i]/avg_quantizer[i];
}
//printf("%lld %lld %lld %lld\n", available_bits[I_TYPE], available_bits[P_TYPE], available_bits[B_TYPE], all_available_bits);
-
+
qscale= av_malloc(sizeof(double)*rcc->num_entries);
blured_qscale= av_malloc(sizeof(double)*rcc->num_entries);
for(step=256*256; step>0.0000001; step*=0.5){
expected_bits=0;
rate_factor+= step;
-
+
rcc->buffer_index= s->avctx->rc_buffer_size/2;
/* find qscale */
/* fixed I/B QP relative to P mode */
for(i=rcc->num_entries-1; i>=0; i--){
RateControlEntry *rce= &rcc->entry[i];
-
+
qscale[i]= get_diff_limited_q(s, rce, qscale[i]);
}
const int pict_type= rce->new_pict_type;
int j;
double q=0.0, sum=0.0;
-
+
for(j=0; j<filter_size; j++){
int index= i+j-filter_size/2;
double d= index-i;
double coeff= a->qblur==0 ? 1.0 : exp(-d*d/(a->qblur * a->qblur));
-
+
if(index < 0 || index >= rcc->num_entries) continue;
if(pict_type != rcc->entry[index].new_pict_type) continue;
q+= qscale[index] * coeff;
}
blured_qscale[i]= q/sum;
}
-
+
/* find expected bits */
for(i=0; i<rcc->num_entries; i++){
RateControlEntry *rce= &rcc->entry[i];
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file raw.c
* Raw Video Codec
*/
-
+
#include "avcodec.h"
typedef struct RawVideoContext {
while (tags->pix_fmt >= 0) {
if (tags->pix_fmt == fmt)
return tags->fourcc;
- tags++;
+ tags++;
}
return 0;
}
case 32: avctx->pix_fmt= PIX_FMT_RGBA32; break;
}
}
-
+
context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
context->buffer = av_malloc(context->length);
context->p = context->buffer;
context->pic.pict_type = FF_I_TYPE;
context->pic.key_frame = 1;
-
+
avctx->coded_frame= &context->pic;
-
+
if (!context->buffer)
return -1;
-
+
return 0;
}
/* Early out without copy if packet size == frame size */
if (buf_size == context->length && context->p == context->buffer) {
avpicture_fill(picture, buf, avctx->pix_fmt, avctx->width, avctx->height);
- flip(avctx, picture);
+ flip(avctx, picture);
*data_size = sizeof(AVPicture);
return buf_size;
}
memcpy(context->p, buf, bytesNeeded);
context->p = context->buffer;
avpicture_fill(picture, context->buffer, avctx->pix_fmt, avctx->width, avctx->height);
- flip(avctx, picture);
+ flip(avctx, picture);
*data_size = sizeof(AVPicture);
return bytesNeeded;
}
static int raw_close_decoder(AVCodecContext *avctx)
{
RawVideoContext *context = avctx->priv_data;
-
+
av_freep(&context->buffer);
return 0;
}
}
}
-ReSampleContext *audio_resample_init(int output_channels, int input_channels,
+ReSampleContext *audio_resample_init(int output_channels, int input_channels,
int output_rate, int input_rate)
{
ReSampleContext *s;
-
+
if ( input_channels > 2)
{
av_log(NULL, AV_LOG_ERROR, "Resampling with input channels greater than 2 unsupported.");
}
s->ratio = (float)output_rate / (float)input_rate;
-
+
s->input_channels = input_channels;
s->output_channels = output_channels;
-
+
s->filter_channels = s->input_channels;
if (s->output_channels < s->filter_channels)
s->filter_channels = s->output_channels;
s->filter_channels = 2;
s->resample_context= av_resample_init(output_rate, input_rate, 16, 10, 0, 1.0);
-
+
return s;
}
memcpy(bufin[i], s->temp[i], s->temp_len * sizeof(short));
buftmp2[i] = bufin[i] + s->temp_len;
}
-
+
/* make some zoom to avoid round pb */
lenout= (int)(nb_samples * s->ratio) + 16;
bufout[0]= (short*) av_malloc( lenout * sizeof(short) );
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file resample2.c
* audio resampling
double v=1;
double t=1;
int i;
-
+
for(i=1; i<50; i++){
t *= i;
v += pow(x*x/4, i)/(t*t);
AVResampleContext *c= av_mallocz(sizeof(AVResampleContext));
double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
int phase_count= 1<<phase_shift;
-
+
c->phase_shift= phase_shift;
c->phase_mask= phase_count-1;
c->linear= linear;
* example: av_resample_compensate(c, 10, 500)
* here instead of 510 samples only 500 samples would be output
*
- * note, due to rounding the actual compensation might be slightly different,
+ * note, due to rounding the actual compensation might be slightly different,
* especially if the compensation_distance is large and the in_rate used during init is small
*/
void av_resample_compensate(AVResampleContext *c, int sample_delta, int compensation_distance){
int64_t index2= ((int64_t)index)<<32;
int64_t incr= (1LL<<32) * c->dst_incr / c->src_incr;
dst_size= FFMIN(dst_size, (src_size-1-index) * (int64_t)c->src_incr / c->dst_incr);
-
+
for(dst_index=0; dst_index < dst_size; dst_index++){
dst[dst_index] = src[index2>>32];
index2 += incr;
FELEM *filter= c->filter_bank + c->filter_length*(index & c->phase_mask);
int sample_index= index >> c->phase_shift;
FELEM2 val=0;
-
+
if(sample_index < 0){
for(i=0; i<c->filter_length; i++)
val += src[ABS(sample_index + i) % src_size] * filter[i];
c->dst_incr= dst_incr_frac + c->src_incr*dst_incr;
c->compensation_distance= compensation_distance;
}
-#if 0
+#if 0
if(update_ctx && !c->compensation_distance){
#undef rand
av_resample_compensate(c, rand() % (8000*2) - 8000, 8000*2);
av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", c->dst_incr, c->ideal_dst_incr, c->compensation_distance);
}
#endif
-
+
return dst_index;
}
pa[2] = avg2(pb[2], pb[3]);
pa[3] = avg2(pb[3], pb[4]);
break;
-
+
case 2:
pa[0] = avg2(pb[0], pb[hw]);
pa[1] = avg2(pb[1], pb[hw+1]);
apply_motion_4x4(ri, x, y, 0, 8, 8);
break;
case RoQ_ID_FCC:
- apply_motion_4x4(ri, x, y, buf[bpos++],
+ apply_motion_4x4(ri, x, y, buf[bpos++],
chunk_arg >> 8, chunk_arg & 0xff);
break;
case RoQ_ID_SLD:
colorA = (opcode << 8) | (s->buf[stream_ptr++]);
opcode = 0;
if ((s->buf[stream_ptr] & 0x80) != 0) {
- /* Must behave as opcode 110xxxxx, using colorA computed
- * above. Use fake opcode 0x20 to enter switch block at
+ /* Must behave as opcode 110xxxxx, using colorA computed
+ * above. Use fake opcode 0x20 to enter switch block at
* the right place */
opcode = 0x20;
n_blocks = 1;
* @file rv10.c
* RV10 codec.
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
};
-static const uint8_t rv_lum_bits[256] =
+static const uint8_t rv_lum_bits[256] =
{
14, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12,
int full_frame= 0;
align_put_bits(&s->pb);
-
+
put_bits(&s->pb, 1, 1); /* marker */
put_bits(&s->pb, 1, (s->pict_type == P_TYPE));
put_bits(&s->pb, 2, s->pict_type); //I 0 vs. 1 ?
put_bits(&s->pb, 1, 0); /* unknown bit */
put_bits(&s->pb, 5, s->qscale);
-
+
put_bits(&s->pb, 8, picture_number&0xFF); //FIXME wrong, but correct is not known
s->mb_x= s->mb_y= 0;
ff_h263_encode_mba(s);
-
+
put_bits(&s->pb, 1, s->no_rounding);
-
+
assert(s->f_code == 1);
assert(s->unrestricted_mv == 1);
// assert(s->h263_aic== (s->pict_type == I_TYPE));
s->h263_aic= s->pict_type == I_TYPE;
if(s->h263_aic){
- s->y_dc_scale_table=
+ s->y_dc_scale_table=
s->c_dc_scale_table= ff_aic_dc_scale_table;
}else{
s->y_dc_scale_table=
static int rv10_decode_picture_header(MpegEncContext *s)
{
int mb_count, pb_frame, marker, unk, mb_xy;
-
+
//printf("ff:%d\n", full_frame);
marker = get_bits(&s->gb, 1);
#ifdef DEBUG
printf("pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
#endif
-
+
if (pb_frame){
av_log(s->avctx, AV_LOG_ERROR, "pb frame not supported\n");
return -1;
static int rv20_decode_picture_header(MpegEncContext *s)
{
int seq, mb_pos, i;
-
+
#if 0
GetBitContext gb= s->gb;
for(i=0; i<64; i++){
}
av_log(s->avctx, AV_LOG_DEBUG, "\n");
#endif
-
+
if(s->avctx->sub_id == 0x30202002 || s->avctx->sub_id == 0x30203002){
if (get_bits(&s->gb, 3)){
av_log(s->avctx, AV_LOG_ERROR, "unknown triplet set\n");
return -1;
- }
- }
+ }
+ }
i= get_bits(&s->gb, 2);
switch(i){
case 1: s->pict_type= I_TYPE; break; //hmm ...
case 2: s->pict_type= P_TYPE; break;
case 3: s->pict_type= B_TYPE; break;
- default:
+ default:
av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
return -1;
}
-
+
if(s->last_picture_ptr==NULL && s->pict_type==B_TYPE){
av_log(s->avctx, AV_LOG_ERROR, "early B pix\n");
return -1;
}
-
+
if (get_bits(&s->gb, 1)){
av_log(s->avctx, AV_LOG_ERROR, "unknown bit set\n");
return -1;
return -1;
}
}
-
+
if(s->avctx->has_b_frames){
int f=9;
int v= s->avctx->extradata_size >= 4 ? ((uint8_t*)s->avctx->extradata)[1] : 0;
}
seq= get_bits(&s->gb, 14)<<1;
- if(v)
+ if(v)
f= get_bits(&s->gb, av_log2(v));
if(s->avctx->debug & FF_DEBUG_PICT_INFO){
seq= get_bits(&s->gb, 8)*128;
}
-// if(s->avctx->sub_id <= 0x20201002){ //0x20201002 definitely needs this
+// if(s->avctx->sub_id <= 0x20201002){ //0x20201002 definitely needs this
mb_pos= ff_h263_decode_mba(s);
/* }else{
mb_pos= get_bits(&s->gb, av_log2(s->mb_num-1)+1);
seq |= s->time &~0x7FFF;
if(seq - s->time > 0x4000) seq -= 0x8000;
if(seq - s->time < -0x4000) seq += 0x8000;
- if(seq != s->time){
+ if(seq != s->time){
if(s->pict_type!=B_TYPE){
s->time= seq;
s->pp_time= s->time - s->last_non_b_time;
}
av_log(s->avctx, AV_LOG_DEBUG, "\n");*/
s->no_rounding= get_bits1(&s->gb);
-
+
s->f_code = 1;
s->unrestricted_mv = 1;
s->h263_aic= s->pict_type == I_TYPE;
// s->umvplus=1;
s->modified_quant=1;
s->loop_filter=1;
-
+
if(s->avctx->debug & FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
+ av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding);
}
static int done=0;
MPV_decode_defaults(s);
-
+
s->avctx= avctx;
s->out_format = FMT_H263;
s->codec_id= avctx->codec_id;
default:
av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", avctx->sub_id);
}
-
+
if(avctx->debug & FF_DEBUG_PICT_INFO){
av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", avctx->sub_id, avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1);
}
/* init rv vlc */
if (!done) {
- init_vlc(&rv_dc_lum, DC_VLC_BITS, 256,
+ init_vlc(&rv_dc_lum, DC_VLC_BITS, 256,
rv_lum_bits, 1, 1,
rv_lum_code, 2, 2, 1);
- init_vlc(&rv_dc_chrom, DC_VLC_BITS, 256,
+ init_vlc(&rv_dc_chrom, DC_VLC_BITS, 256,
rv_chrom_bits, 1, 1,
rv_chrom_code, 2, 2, 1);
done = 1;
return 0;
}
-static int rv10_decode_packet(AVCodecContext *avctx,
+static int rv10_decode_packet(AVCodecContext *avctx,
uint8_t *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n");
return -1;
}
-
+
if (s->mb_x >= s->mb_width ||
s->mb_y >= s->mb_height) {
av_log(s->avctx, AV_LOG_ERROR, "POS ERROR %d %d\n", s->mb_x, s->mb_y);
if(s->codec_id== CODEC_ID_RV10){
if(s->mb_y==0) s->first_slice_line=1;
}else{
- s->first_slice_line=1;
+ s->first_slice_line=1;
s->resync_mb_x= s->mb_x;
s->resync_mb_y= s->mb_y;
}
if(s->h263_aic){
- s->y_dc_scale_table=
+ s->y_dc_scale_table=
s->c_dc_scale_table= ff_aic_dc_scale_table;
}else{
s->y_dc_scale_table=
if(s->modified_quant)
s->chroma_qscale_table= ff_h263_chroma_qscale_table;
-
+
ff_set_qscale(s, s->qscale);
s->rv10_first_dc_coded[0] = 0;
#endif
s->mv_dir = MV_DIR_FORWARD;
- s->mv_type = MV_TYPE_16X16;
+ s->mv_type = MV_TYPE_16X16;
ret=ff_h263_decode_mb(s, s->block);
if (ret == SLICE_ERROR || s->gb.size_in_bits < get_bits_count(&s->gb)) {
return buf_size;
}
-static int rv10_decode_frame(AVCodecContext *avctx,
+static int rv10_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
int i;
- AVFrame *pict = data;
+ AVFrame *pict = data;
#ifdef DEBUG
printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
for(i=0; i<avctx->slice_count; i++){
int offset= avctx->slice_offset[i];
int size;
-
+
if(i+1 == avctx->slice_count)
size= buf_size - offset;
else
}else{
rv10_decode_packet(avctx, buf, buf_size);
}
-
+
if(s->mb_y>=s->mb_height){
ff_er_frame_end(s);
MPV_frame_end(s);
-
+
if(s->pict_type==B_TYPE || s->low_delay){
*pict= *(AVFrame*)&s->current_picture;
ff_print_debug_info(s, pict);
/*
- * aligned/packed access motion
+ * aligned/packed access motion
*
* Copyright (c) 2001-2003 BERO <bero@geocities.co.jp>
*
static void clear_blocks_sh4(DCTELEM *blocks)
{
-// if (((int)blocks&7)==0)
+// if (((int)blocks&7)==0)
memzero_align8(blocks,sizeof(DCTELEM)*6*64);
}
dsputil_init_align(c,avctx);
c->clear_blocks = clear_blocks_sh4;
- if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SH4){
+ if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SH4){
c->idct_put = idct_put;
c->idct_add = idct_add;
c->idct = idct_sh4;
#if 1
-//optimized
+//optimized
void idct_sh4(DCTELEM *block)
{
-/*
+/*
this is optimized for sh, which have post increment addressing (*p++)
some cpu may be index (p[n]) faster than post increment (*p++)
*/
}while(--h);
}
-static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
+static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height)
{
int y, vx, vy;
const int s= 1<<shift;
-
+
width--;
height--;
frac_y= src_y&(s-1);
src_x>>=shift;
src_y>>=shift;
-
+
if((unsigned)src_x < width){
if((unsigned)src_y < height){
index= src_x + src_y*stride;
+ src[index+stride+1]* frac_x )* frac_y
+ r)>>(shift*2);
}else{
- index= src_x + clip(src_y, 0, height)*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
+ index= src_x + clip(src_y, 0, height)*stride;
+ dst[y*stride + x]= ( ( src[index ]*(s-frac_x)
+ src[index +1]* frac_x )*s
+ r)>>(shift*2);
}
}else{
if((unsigned)src_y < height){
- index= clip(src_x, 0, width) + src_y*stride;
- dst[y*stride + x]= ( ( src[index ]*(s-frac_y)
+ index= clip(src_x, 0, width) + src_y*stride;
+ dst[y*stride + x]= ( ( src[index ]*(s-frac_y)
+ src[index+stride ]* frac_y )*s
+ r)>>(shift*2);
}else{
- index= clip(src_x, 0, width) + clip(src_y, 0, height)*stride;
+ index= clip(src_x, 0, width) + clip(src_y, 0, height)*stride;
dst[y*stride + x]= src[index ];
}
}
-
+
vx+= dxx;
vy+= dyx;
}
src9 = *s++;
dst[7]= cm[(9*(src7 + src8) - (src6 + src9) + 8)>>4];
dst+=dstStride;
- src+=srcStride;
+ src+=srcStride;
}while(--h);
}
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file simple_idct.c
* simpleidct in C.
*/
-
+
/*
based upon some outcommented c code from mpeg2dec (idct_mmx.c
- written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
+ written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
*/
#include "avcodec.h"
#include "dsputil.h"
#define ROW0_MASK 0xffffLL
#endif
if(sizeof(DCTELEM)==2){
- if ( ((((uint64_t *)row)[0] & ~ROW0_MASK) |
+ if ( ((((uint64_t *)row)[0] & ~ROW0_MASK) |
((uint64_t *)row)[1]) == 0) {
temp = (row[0] << 3) & 0xffff;
temp += temp << 16;
if(sizeof(DCTELEM)==2){
if (!(((uint32_t*)row)[1] |
((uint32_t*)row)[2] |
- ((uint32_t*)row)[3] |
+ ((uint32_t*)row)[3] |
row[1])) {
temp = (row[0] << 3) & 0xffff;
temp += temp << 16;
MAC16(b0, W5, row[5]);
MAC16(b0, W7, row[7]);
-
+
MAC16(b1, -W1, row[5]);
MAC16(b1, -W5, row[7]);
-
+
MAC16(b2, W7, row[5]);
MAC16(b2, W3, row[7]);
-
+
MAC16(b3, W3, row[5]);
MAC16(b3, -W1, row[7]);
}
row[4] = (a3 - b3) >> ROW_SHIFT;
}
-static inline void idctSparseColPut (uint8_t *dest, int line_size,
+static inline void idctSparseColPut (uint8_t *dest, int line_size,
DCTELEM * col)
{
int a0, a1, a2, a3, b0, b1, b2, b3;
dest[0] = cm[(a0 - b0) >> COL_SHIFT];
}
-static inline void idctSparseColAdd (uint8_t *dest, int line_size,
+static inline void idctSparseColAdd (uint8_t *dest, int line_size,
DCTELEM * col)
{
int a0, a1, a2, a3, b0, b1, b2, b3;
int i;
for(i=0; i<8; i++)
idctRowCondDC(block + i*8);
-
+
for(i=0; i<8; i++)
idctSparseColPut(dest + i, line_size, block + i);
}
int i;
for(i=0; i<8; i++)
idctRowCondDC(block + i*8);
-
+
for(i=0; i<8; i++)
idctSparseColAdd(dest + i, line_size, block + i);
}
int i;
for(i=0; i<8; i++)
idctRowCondDC(block + i*8);
-
+
for(i=0; i<8; i++)
idctSparseCol(block + i);
}
{
int i;
DCTELEM *ptr;
-
+
/* butterfly */
ptr = block;
for(i=0;i<4;i++) {
* @file simple_idct.h
* simple idct header.
*/
-
+
void simple_idct_put(uint8_t *dest, int line_size, DCTELEM *block);
void simple_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
void ff_simple_idct_mmx(int16_t *block);
/* figure out where the previous block started */
if (pixel_ptr == 0)
- prev_block_ptr1 =
+ prev_block_ptr1 =
(row_ptr - s->avctx->width * 4) + s->avctx->width - 4;
else
prev_block_ptr1 = row_ptr + pixel_ptr - 4;
/* figure out where the previous 2 blocks started */
if (pixel_ptr == 0)
- prev_block_ptr1 = (row_ptr - s->avctx->width * 4) +
+ prev_block_ptr1 = (row_ptr - s->avctx->width * 4) +
s->avctx->width - 4 * 2;
else if (pixel_ptr == 4)
prev_block_ptr1 = (row_ptr - s->avctx->width * 4) + row_inc;
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixel = color_table_index +
+ pixel = color_table_index +
((color_flags >> flag_mask) & 0x03);
flag_mask -= 2;
pixels[block_ptr++] = s->color_quads[pixel];
flag_mask = 21;
}
for (pixel_x = 0; pixel_x < 4; pixel_x++) {
- pixel = color_table_index +
+ pixel = color_table_index +
((color_flags >> flag_mask) & 0x07);
flag_mask -= 3;
pixels[block_ptr++] = s->color_octets[pixel];
s->size = buf_size;
s->frame.reference = 1;
- s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
+ s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
if (avctx->reget_buffer(avctx, &s->frame)) {
av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
static void slice_buffer_init(slice_buffer * buf, int line_count, int max_allocated_lines, int line_width, DWTELEM * base_buffer)
{
int i;
-
+
buf->base_buffer = base_buffer;
buf->line_count = line_count;
buf->line_width = line_width;
buf->data_count = max_allocated_lines;
buf->line = (DWTELEM * *) av_mallocz (sizeof(DWTELEM *) * line_count);
buf->data_stack = (DWTELEM * *) av_malloc (sizeof(DWTELEM *) * max_allocated_lines);
-
+
for (i = 0; i < max_allocated_lines; i++)
{
buf->data_stack[i] = (DWTELEM *) av_malloc (sizeof(DWTELEM) * line_width);
}
-
+
buf->data_stack_top = max_allocated_lines - 1;
}
{
int offset;
DWTELEM * buffer;
-
-// av_log(NULL, AV_LOG_DEBUG, "Cache hit: %d\n", line);
-
+
+// av_log(NULL, AV_LOG_DEBUG, "Cache hit: %d\n", line);
+
assert(buf->data_stack_top >= 0);
// assert(!buf->line[line]);
if (buf->line[line])
return buf->line[line];
-
+
offset = buf->line_width * line;
buffer = buf->data_stack[buf->data_stack_top];
buf->data_stack_top--;
buf->line[line] = buffer;
-
+
// av_log(NULL, AV_LOG_DEBUG, "slice_buffer_load_line: line: %d remaining: %d\n", line, buf->data_stack_top + 1);
-
+
return buffer;
}
buf->data_stack_top++;
buf->data_stack[buf->data_stack_top] = buffer;
buf->line[line] = NULL;
-
+
// av_log(NULL, AV_LOG_DEBUG, "slice_buffer_release: line: %d remaining: %d\n", line, buf->data_stack_top + 1);
}
{
int i;
slice_buffer_flush(buf);
-
+
for (i = buf->data_count - 1; i >= 0; i--)
{
assert(buf->data_stack[i]);
const int a= ABS(v);
const int e= av_log2(a);
#if 1
- const int el= FFMIN(e, 10);
+ const int el= FFMIN(e, 10);
put_rac(c, state+0, 0);
for(i=0; i<el; i++){
if(is_signed)
put_rac(c, state+11 + el, v < 0); //11..21
#else
-
+
put_rac(c, state+0, 0);
if(e<=9){
for(i=0; i<e; i++){
if(log2>0) r+=r;
}
put_rac(c, state+4+log2, 0);
-
+
for(i=log2-1; i>=0; i--){
put_rac(c, state+31-i, (v>>i)&1);
}
log2++;
if(log2>0) r+=r;
}
-
+
for(i=log2-1; i>=0; i--){
v+= get_rac(c, state+31-i)<<i;
}
dst += dst_step;
src += src_step;
}
-
+
for(i=0; i<w; i++){
dst[i*dst_step] = LIFT(src[i*src_step], ((mul*(ref[i*ref_step] + ref[(i+1)*ref_step])+add)>>shift), inverse);
}
-
+
if(mirror_right){
dst[w*dst_step] = LIFT(src[w*src_step], ((mul*2*ref[w*ref_step]+add)>>shift), inverse);
}
dst += dst_step;
src += src_step;
}
-
+
for(i=0; i<w; i++){
int r= 3*(ref[i*ref_step] + ref[(i+1)*ref_step]);
r += r>>4;
r += r>>8;
dst[i*dst_step] = LIFT(src[i*src_step], ((r+add)>>shift), inverse);
}
-
+
if(mirror_right){
int r= 3*2*ref[w*ref_step];
r += r>>4;
dst += dst_step;
src += src_step;
}
-
+
for(i=0; i<w; i++){
dst[i*dst_step] = LIFTS(src[i*src_step], mul*(ref[i*ref_step] + ref[(i+1)*ref_step])+add, inverse);
}
-
+
if(mirror_right){
dst[w*dst_step] = LIFTS(src[w*src_step], mul*2*ref[w*ref_step]+add, inverse);
}
static void inplace_lift(DWTELEM *dst, int width, int *coeffs, int n, int shift, int start, int inverse){
int x, i;
-
+
for(x=start; x<width; x+=2){
int64_t sum=0;
for(y=start; y<height; y+=2){
for(x=0; x<width; x++){
int64_t sum=0;
-
+
for(i=0; i<n; i++){
int y2= y + 2*i - n + 1;
if (y2< 0) y2= -y2;
#define N4 0
#define SHIFT4 0
#define COEFFS4 NULL
-#elif 1 // 11/5
+#elif 1 // 11/5
#define N1 0
#define SHIFT1 1
#define COEFFS1 NULL
inplace_lift(b, width, COEFFS2, N2, SHIFT2, LX0, 0);
inplace_lift(b, width, COEFFS3, N3, SHIFT3, LX1, 0);
inplace_lift(b, width, COEFFS4, N4, SHIFT4, LX0, 0);
-
+
for(x=0; x<width2; x++){
temp[x ]= b[2*x ];
temp[x+w2]= b[2*x + 1];
static void spatial_decomposeX(DWTELEM *buffer, int width, int height, int stride){
int x, y;
-
+
for(y=0; y<height; y++){
for(x=0; x<width; x++){
buffer[y*stride + x] *= SCALEX;
for(y=0; y<height; y++){
horizontal_decomposeX(buffer + y*stride, width);
}
-
+
inplace_liftV(buffer, width, height, stride, COEFFS1, N1, SHIFT1, LX1, 0);
inplace_liftV(buffer, width, height, stride, COEFFS2, N2, SHIFT2, LX0, 0);
inplace_liftV(buffer, width, height, stride, COEFFS3, N3, SHIFT3, LX1, 0);
- inplace_liftV(buffer, width, height, stride, COEFFS4, N4, SHIFT4, LX0, 0);
+ inplace_liftV(buffer, width, height, stride, COEFFS4, N4, SHIFT4, LX0, 0);
}
static void spatial_composeX(DWTELEM *buffer, int width, int height, int stride){
int x, y;
-
+
inplace_liftV(buffer, width, height, stride, COEFFS4, N4, SHIFT4, LX0, 1);
inplace_liftV(buffer, width, height, stride, COEFFS3, N3, SHIFT3, LX1, 1);
inplace_liftV(buffer, width, height, stride, COEFFS2, N2, SHIFT2, LX0, 1);
b[width -1] = A3;
b[width2-1] = A2;
}
-#else
+#else
lift(b+w2, temp+w2, temp, 1, 1, 1, width, -1, 0, 1, 1, 0);
lift(b , temp , b+w2, 1, 1, 1, width, 1, 2, 2, 0, 0);
#endif
static void vertical_decompose53iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] -= (b0[i] + b2[i])>>1;
}
static void vertical_decompose53iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] += (b0[i] + b2[i] + 2)>>2;
}
int y;
DWTELEM *b0= buffer + mirror(-2-1, height-1)*stride;
DWTELEM *b1= buffer + mirror(-2 , height-1)*stride;
-
+
for(y=-2; y<height; y+=2){
DWTELEM *b2= buffer + mirror(y+1, height-1)*stride;
DWTELEM *b3= buffer + mirror(y+2, height-1)*stride;
if(b1 <= b3) horizontal_decompose53i(b2, width);
if(y+2 < height) horizontal_decompose53i(b3, width);
STOP_TIMER("horizontal_decompose53i")}
-
+
{START_TIMER
if(b1 <= b3) vertical_decompose53iH0(b1, b2, b3, width);
if(b0 <= b2) vertical_decompose53iL0(b0, b1, b2, width);
STOP_TIMER("vertical_decompose53i*")}
-
+
b0=b2;
b1=b3;
}
static void vertical_decompose97iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] -= (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
}
static void vertical_decompose97iH1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
#ifdef lift5
b1[i] += (W_CM*(b0[i] + b2[i])+W_CO)>>W_CS;
static void vertical_decompose97iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
#ifdef liftS
b1[i] -= (W_BM*(b0[i] + b2[i])+W_BO)>>W_BS;
static void vertical_decompose97iL1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] += (W_DM*(b0[i] + b2[i])+W_DO)>>W_DS;
}
DWTELEM *b1= buffer + mirror(-4 , height-1)*stride;
DWTELEM *b2= buffer + mirror(-4+1, height-1)*stride;
DWTELEM *b3= buffer + mirror(-4+2, height-1)*stride;
-
+
for(y=-4; y<height; y+=2){
DWTELEM *b4= buffer + mirror(y+3, height-1)*stride;
DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;
if(width>400){
STOP_TIMER("horizontal_decompose97i")
}}
-
+
{START_TIMER
if(b3 <= b5) vertical_decompose97iH0(b3, b4, b5, width);
if(b2 <= b4) vertical_decompose97iL0(b2, b3, b4, width);
if(width>400){
STOP_TIMER("vertical_decompose97i")
}}
-
+
b0=b2;
b1=b3;
b2=b4;
void ff_spatial_dwt(DWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count){
int level;
-
+
for(level=0; level<decomposition_count; level++){
switch(type){
case 0: spatial_decompose97i(buffer, width>>level, height>>level, stride<<level); break;
A2 += (A1 + A3 + 2)>>2;
b[width -1] = A3;
b[width2-1] = A2;
-#else
+#else
lift(temp , b , b+w2, 1, 1, 1, width, 1, 2, 2, 0, 1);
lift(temp+w2, b+w2, temp, 1, 1, 1, width, -1, 0, 1, 1, 1);
#endif
static void vertical_compose53iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] += (b0[i] + b2[i])>>1;
}
static void vertical_compose53iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] -= (b0[i] + b2[i] + 2)>>2;
}
int mirror1 = mirror(y , height-1);
int mirror2 = mirror(y+1, height-1);
int mirror3 = mirror(y+2, height-1);
-
+
DWTELEM *b0= cs->b0;
DWTELEM *b1= cs->b1;
DWTELEM *b2= slice_buffer_get_line(sb, mirror2 * stride_line);
spatial_compose53i_init(&cs, buffer, height, stride);
while(cs.y <= height)
spatial_compose53i_dy(&cs, buffer, width, height, stride);
-}
+}
+
-
static void horizontal_compose97i(DWTELEM *b, int width){
DWTELEM temp[width];
const int w2= (width+1)>>1;
static void vertical_compose97iH0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS;
}
static void vertical_compose97iH1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
#ifdef lift5
b1[i] -= (W_CM*(b0[i] + b2[i])+W_CO)>>W_CS;
static void vertical_compose97iL0(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
#ifdef liftS
b1[i] += (W_BM*(b0[i] + b2[i])+W_BO)>>W_BS;
static void vertical_compose97iL1(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width){
int i;
-
+
for(i=0; i<width; i++){
b1[i] -= (W_DM*(b0[i] + b2[i])+W_DO)>>W_DS;
}
static void vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width){
int i;
-
+
for(i=0; i<width; i++){
#ifndef lift5
int r;
static void spatial_compose97i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){
int y = cs->y;
-
+
int mirror0 = mirror(y - 1, height - 1);
int mirror1 = mirror(y + 0, height - 1);
int mirror2 = mirror(y + 1, height - 1);
DWTELEM *b3= cs->b3;
DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line);
DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line);
-
+
{START_TIMER
if(y>0 && y+4<height){
vertical_compose97i(b0, b1, b2, b3, b4, b5, width);
DWTELEM *b4= buffer + mirror(y+3, height-1)*stride;
DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;
- if(stride == width && y+4 < height && 0){
+ if(stride == width && y+4 < height && 0){
int x;
for(x=0; x<width/2; x++)
b5[x] += 64*2;
for(; x<width; x++)
b5[x] += 169*2;
}
-
+
{START_TIMER
if(b3 <= b5) vertical_compose97iL1(b3, b4, b5, width);
if(b2 <= b4) vertical_compose97iH1(b2, b3, b4, width);
int runs[w*h];
int run_index=0;
int max_index;
-
+
for(y=0; y<h; y++){
for(x=0; x<w; x++){
int v, p=0;
if(parent){
int px= x>>1;
int py= y>>1;
- if(px<b->parent->width && py<b->parent->height)
+ if(px<b->parent->width && py<b->parent->height)
p= parent[px + py*2*stride];
}
if(!(/*ll|*/l|lt|t|rt|p)){
put_symbol2(&s->c, b->state[30], max_index, 0);
if(run_index <= max_index)
put_symbol2(&s->c, b->state[1], run, 3);
-
+
for(y=0; y<h; y++){
if(s->c.bytestream_end - s->c.bytestream < w*40){
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
if(parent){
int px= x>>1;
int py= y>>1;
- if(px<b->parent->width && py<b->parent->height)
+ if(px<b->parent->width && py<b->parent->height)
p= parent[px + py*2*stride];
}
if(/*ll|*/l|lt|t|rt|p){
return 0;
}
-static int encode_subband(SnowContext *s, SubBand *b, DWTELEM *src, DWTELEM *parent, int stride, int orientation){
+static int encode_subband(SnowContext *s, SubBand *b, DWTELEM *src, DWTELEM *parent, int stride, int orientation){
// encode_subband_qtree(s, b, src, parent, stride, orientation);
// encode_subband_z0run(s, b, src, parent, stride, orientation);
return encode_subband_c0run(s, b, src, parent, stride, orientation);
const int w= b->width;
const int h= b->height;
int x,y;
-
+
if(1){
int run, runs;
x_and_coeff *xc= b->x_coeff;
for(x=0; x<w; x++){
int p=0;
const int l= v;
-
+
lt= t; t= rt;
if(y){
if(v){
v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l&0xFF] + 3*quant3bA[t&0xFF]]);
-
+
xc->x=x;
(xc++)->coeff= v;
}
else run= INT_MAX;
v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1);
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]);
-
+
xc->x=x;
(xc++)->coeff= v;
}else{
(xc++)->x= w+1; //end marker
prev_xc= prev2_xc;
prev2_xc= xc;
-
+
if(parent_xc){
if(y&1){
while(parent_xc->x != parent->width+1)
int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
int new_index = 0;
-
+
START_TIMER
if(b->buf == s->spatial_dwt_buffer || s->qlog == LOSSLESS_QLOG){
if (start_y != 0)
new_index = save_state[0];
-
+
for(y=start_y; y<h; y++){
int x = 0;
int v;
if(w > 200 && start_y != 0/*level+1 == s->spatial_decomposition_count*/){
STOP_TIMER("decode_subband")
}
-
+
/* Save our variables for the next slice. */
save_state[0] = new_index;
-
+
return;
}
static int alloc_blocks(SnowContext *s){
int w= -((-s->avctx->width )>>LOG2_MB_SIZE);
int h= -((-s->avctx->height)>>LOG2_MB_SIZE);
-
+
s->b_width = w;
s->b_height= h;
-
+
s->block= av_mallocz(w * h * sizeof(BlockNode) << (s->block_max_depth*2));
return 0;
}
const int block_w= 1<<rem_depth;
BlockNode block;
int i,j;
-
+
block.color[0]= l;
block.color[1]= cb;
block.color[2]= cr;
P_TOP [1]= top->my;
P_TOPRIGHT[0]= tr->mx;
P_TOPRIGHT[1]= tr->my;
-
+
last_mv[0][0]= s->block[index].mx;
last_mv[0][1]= s->block[index].my;
last_mv[1][0]= right->mx;
last_mv[1][1]= right->my;
last_mv[2][0]= bottom->mx;
last_mv[2][1]= bottom->my;
-
+
s->m.mb_stride=2;
- s->m.mb_x=
+ s->m.mb_x=
s->m.mb_y= 0;
s->m.me.skip= 0;
init_ref(c, current_data, s->last_picture.data, NULL, block_w*x, block_w*y, 0);
-
+
assert(s->m.me. stride == stride);
assert(s->m.me.uvstride == uvstride);
-
+
c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_MV;
-
+
c->xmin = - x*block_w - 16+2;
c->ymin = - y*block_w - 16+2;
c->xmax = - (x+1)*block_w + (w<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-2;
c->ymax = - (y+1)*block_w + (h<<(LOG2_MB_SIZE - s->block_max_depth)) + 16-2;
if(P_LEFT[0] > (c->xmax<<shift)) P_LEFT[0] = (c->xmax<<shift);
- if(P_LEFT[1] > (c->ymax<<shift)) P_LEFT[1] = (c->ymax<<shift);
+ if(P_LEFT[1] > (c->ymax<<shift)) P_LEFT[1] = (c->ymax<<shift);
if(P_TOP[0] > (c->xmax<<shift)) P_TOP[0] = (c->xmax<<shift);
if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1] = (c->ymax<<shift);
if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
c->pred_y = P_MEDIAN[1];
}
- score= ff_epzs_motion_search(&s->m, &mx, &my, P, 0, /*ref_index*/ 0, last_mv,
+ score= ff_epzs_motion_search(&s->m, &mx, &my, P, 0, /*ref_index*/ 0, last_mv,
(1<<16)>>shift, level-LOG2_MB_SIZE+4, block_w);
assert(mx >= c->xmin);
assert(mx <= c->xmax);
assert(my >= c->ymin);
assert(my <= c->ymax);
-
+
score= s->m.me.sub_motion_search(&s->m, &mx, &my, score, 0, 0, level-LOG2_MB_SIZE+4, block_w);
score= ff_get_mb_score(&s->m, mx, my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0);
//FIXME if mb_cmp != SSE then intra cant be compared currently and mb_penalty vs. lambda2
-
+
// subpel search
pc= s->c;
pc.bytestream_start=
sum = pix_sum(¤t_mb[0][0], stride, block_w);
l= (sum + block_s/2)/block_s;
iscore = pix_norm1(¤t_mb[0][0], stride, block_w) - 2*l*sum + l*l*block_s;
-
+
block_s= block_w*block_w>>2;
sum = pix_sum(¤t_mb[1][0], uvstride, block_w>>1);
cb= (sum + block_s/2)/block_s;
else
c->scene_change_score+= s->m.qscale;
}
-
+
if(level!=s->block_max_depth){
put_rac(&s->c, &s->block_state[4 + s_context], 0);
score2 = encode_q_branch(s, level+1, 2*x+0, 2*y+0);
score2+= encode_q_branch(s, level+1, 2*x+0, 2*y+1);
score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+1);
score2+= s->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead
-
+
if(score2 < score && score2 < iscore)
return score2;
}
-
+
if(iscore < score){
memcpy(pbbak, i_buffer, i_len);
s->c= ic;
BlockNode *tl = y && x ? &s->block[index-w-1] : left;
BlockNode *tr = y && trx<w && ((x&1)==0 || level==0) ? &s->block[index-w+(1<<rem_depth)] : tl; //FIXME use lt
int s_context= 2*left->level + 2*top->level + tl->level + tr->level;
-
+
if(s->keyframe){
set_blocks(s, level, x, y, null_block.color[0], null_block.color[1], null_block.color[2], null_block.mx, null_block.my, BLOCK_INTRA);
return;
int my= mid_pred(left->my, top->my, tr->my);
int mx_context= av_log2(2*ABS(left->mx - top->mx)) + 0*av_log2(2*ABS(tr->mx - top->mx));
int my_context= av_log2(2*ABS(left->my - top->my)) + 0*av_log2(2*ABS(tr->my - top->my));
-
+
type= get_rac(&s->c, &s->block_state[1 + left->type + top->type]) ? BLOCK_INTRA : 0;
if(type){
if(dx<8) am = (32*a2*( 8-dx) + am* dx + 128)>>8;
else am = ( am*(16-dx) + 32*a3*(dx-8) + 128)>>8;
-
+
/* FIXME Try increasing tmp buffer to 16 bits and not clipping here. Should give marginally better results. - Robert*/
if(am&(~255)) am= ~(am>>31);
-
+
tmp[x] = am;
/* if (dx< 4) tmp[x + y*stride]= (16*a1*( 4-dx) + aL* dx + 32)>>6;
src += stride;
}
tmp -= (b_h+5)*stride;
-
+
for(y=0; y < b_h; y++){
for(x=0; x < b_w; x++){
int a0= tmp[x + 0*stride];
// int am= 18*(a2+a3) - 2*(a1+a4);
/* int aL= (-7*a0 + 105*a1 + 35*a2 - 5*a3)>>3;
int aR= (-7*a3 + 105*a2 + 35*a1 - 5*a0)>>3;*/
-
+
// if(b_w==16) am= 8*(a1+a2);
if(dy<8) am = (32*a2*( 8-dy) + am* dy + 128)>>8;
else am = ( am*(16-dy) + 32*a3*(dy-8) + 128)>>8;
if(am&(~255)) am= ~(am>>31);
-
+
dst[x] = am;
/* if (dy< 4) tmp[x + y*stride]= (16*a1*( 4-dy) + aL* dy + 32)>>6;
else if(dy< 8) tmp[x + y*stride]= ( aL*( 8-dy) + am*(dy- 4) + 32)>>6;
BlockNode *rt= lt+1;
BlockNode *lb= lt+b_stride;
BlockNode *rb= lb+1;
- uint8_t *block[4];
+ uint8_t *block[4];
int tmp_step= src_stride >= 7*MB_SIZE ? MB_SIZE : MB_SIZE*src_stride;
uint8_t tmp[src_stride*7*MB_SIZE]; //FIXME align
uint8_t *ptmp;
lb= lt;
rb= rt;
}
-
+
if(src_x<0){ //FIXME merge with prev & always round internal width upto *16
obmc -= src_x;
b_w += src_x;
}else if(src_y + b_h> h){
b_h = h - src_y;
}
-
+
if(b_w<=0 || b_h<=0) return;
assert(src_stride > 2*MB_SIZE + 5);
ptmp= tmp + 3*tmp_step;
block[0]= ptmp;
ptmp+=tmp_step;
- pred_block(s, block[0], src, tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);
+ pred_block(s, block[0], src, tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);
if(same_block(lt, rt)){
block[1]= block[0];
ptmp+=tmp_step;
pred_block(s, block[1], src, tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h);
}
-
+
if(same_block(lt, lb)){
block[2]= block[0];
}else if(same_block(rt, lb)){
{
START_TIMER
-
+
for(y=0; y<b_h; y++){
//FIXME ugly missue of obmc_stride
uint8_t *obmc1= obmc + y*obmc_stride;
BlockNode *rt= lt+1;
BlockNode *lb= lt+b_stride;
BlockNode *rb= lb+1;
- uint8_t *block[4];
+ uint8_t *block[4];
int tmp_step= src_stride >= 7*MB_SIZE ? MB_SIZE : MB_SIZE*src_stride;
uint8_t tmp[src_stride*7*MB_SIZE]; //FIXME align
uint8_t *ptmp;
lb= lt;
rb= rt;
}
-
+
if(src_x<0){ //FIXME merge with prev & always round internal width upto *16
obmc -= src_x;
b_w += src_x;
}else if(src_y + b_h> h){
b_h = h - src_y;
}
-
+
if(b_w<=0 || b_h<=0) return;
assert(src_stride > 2*MB_SIZE + 5);
ptmp= tmp + 3*tmp_step;
block[0]= ptmp;
ptmp+=tmp_step;
- pred_block(s, block[0], src, tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);
+ pred_block(s, block[0], src, tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h);
if(same_block(lt, rt)){
block[1]= block[0];
ptmp+=tmp_step;
pred_block(s, block[1], src, tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h);
}
-
+
if(same_block(lt, lb)){
block[2]= block[0];
}else if(same_block(rt, lb)){
+obmc2[x] * block[2][x + y*src_stride]
+obmc3[x] * block[1][x + y*src_stride]
+obmc4[x] * block[0][x + y*src_stride];
-
+
v <<= 8 - LOG2_OBMC_MAX;
if(FRAC_BITS != 8){
v += 1<<(7 - FRAC_BITS);
int w= p->width;
int h= p->height;
START_TIMER
-
+
if(s->keyframe || (s->avctx->debug&512)){
if(mb_y==mb_h)
return;
return;
}
-
+
for(mb_x=0; mb_x<=mb_w; mb_x++){
START_TIMER
- add_yblock_buffered(s, sb, old_buffer, dst8, ref, obmc,
+ add_yblock_buffered(s, sb, old_buffer, dst8, ref, obmc,
block_w*mb_x - block_w/2,
block_w*mb_y - block_w/2,
block_w, block_w,
w, ref_stride, obmc_stride,
mb_x - 1, mb_y - 1,
add, plane_index);
-
+
STOP_TIMER("add_yblock")
}
-
+
STOP_TIMER("predict_slice")
}
int w= p->width;
int h= p->height;
START_TIMER
-
+
if(s->keyframe || (s->avctx->debug&512)){
if(mb_y==mb_h)
return;
return;
}
-
+
for(mb_x=0; mb_x<=mb_w; mb_x++){
START_TIMER
- add_yblock(s, buf, dst8, ref, obmc,
+ add_yblock(s, buf, dst8, ref, obmc,
block_w*mb_x - block_w/2,
block_w*mb_y - block_w/2,
block_w, block_w,
w, ref_stride, obmc_stride,
mb_x - 1, mb_y - 1,
add, plane_index);
-
+
STOP_TIMER("add_yblock")
}
-
+
STOP_TIMER("predict_slice")
}
// START_TIMER
if(s->qlog == LOSSLESS_QLOG) return;
-
+
bias= bias ? 0 : (3*qmul)>>3;
thres1= ((qmul - bias)>>QEXPSHIFT) - 1;
thres2= 2*thres1;
-
+
if(!bias){
for(y=0; y<h; y++){
for(x=0; x<w; x++){
int i= src[x + y*stride];
-
+
if((unsigned)(i+thres1) > thres2){
if(i>=0){
i<<= QEXPSHIFT;
}else{
for(y=0; y<h; y++){
for(x=0; x<w; x++){
- int i= src[x + y*stride];
-
+ int i= src[x + y*stride];
+
if((unsigned)(i+thres1) > thres2){
if(i>=0){
i<<= QEXPSHIFT;
const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
int x,y;
START_TIMER
-
+
if(s->qlog == LOSSLESS_QLOG) return;
-
+
for(y=start_y; y<end_y; y++){
// DWTELEM * line = slice_buffer_get_line_from_address(sb, src + (y * stride));
DWTELEM * line = slice_buffer_get_line(sb, (y * b->stride_line) + b->buf_y_offset) + b->buf_x_offset;
const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
int x,y;
START_TIMER
-
+
if(s->qlog == LOSSLESS_QLOG) return;
-
+
for(y=0; y<h; y++){
for(x=0; x<w; x++){
int i= src[x + y*stride];
const int w= b->width;
const int h= b->height;
int x,y;
-
+
for(y=h-1; y>=0; y--){
for(x=w-1; x>=0; x--){
int i= x + y*stride;
-
+
if(x){
if(use_median){
if(y && x+1<w) src[i] -= mid_pred(src[i - 1], src[i - stride], src[i - stride + 1]);
static void correlate_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int inverse, int use_median, int start_y, int end_y){
const int w= b->width;
int x,y;
-
+
// START_TIMER
-
+
DWTELEM * line;
DWTELEM * prev;
-
+
if (start_y != 0)
line = slice_buffer_get_line(sb, ((start_y - 1) * b->stride_line) + b->buf_y_offset) + b->buf_x_offset;
-
+
for(y=start_y; y<end_y; y++){
prev = line;
// line = slice_buffer_get_line_from_address(sb, src + (y * stride));
}
}
}
-
+
// STOP_TIMER("correlate")
}
const int w= b->width;
const int h= b->height;
int x,y;
-
+
for(y=0; y<h; y++){
for(x=0; x<w; x++){
int i= x + y*stride;
-
+
if(x){
if(use_median){
if(y && x+1<w) src[i] += mid_pred(src[i - 1], src[i - stride], src[i - stride + 1]);
static void encode_header(SnowContext *s){
int plane_index, level, orientation;
- uint8_t kstate[32];
-
- memset(kstate, MID_STATE, sizeof(kstate));
+ uint8_t kstate[32];
+
+ memset(kstate, MID_STATE, sizeof(kstate));
put_rac(&s->c, kstate, s->keyframe);
if(s->keyframe || s->always_reset)
}
}
put_symbol(&s->c, s->header_state, s->spatial_decomposition_type, 0);
- put_symbol(&s->c, s->header_state, s->qlog, 1);
- put_symbol(&s->c, s->header_state, s->mv_scale, 0);
+ put_symbol(&s->c, s->header_state, s->qlog, 1);
+ put_symbol(&s->c, s->header_state, s->mv_scale, 0);
put_symbol(&s->c, s->header_state, s->qbias, 1);
put_symbol(&s->c, s->header_state, s->block_max_depth, 0);
}
int plane_index, level, orientation;
uint8_t kstate[32];
- memset(kstate, MID_STATE, sizeof(kstate));
+ memset(kstate, MID_STATE, sizeof(kstate));
s->keyframe= get_rac(&s->c, kstate);
if(s->keyframe || s->always_reset)
}
}
}
-
+
s->spatial_decomposition_type= get_symbol(&s->c, s->header_state, 0);
if(s->spatial_decomposition_type > 2){
av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported", s->spatial_decomposition_type);
return -1;
}
-
+
s->qlog= get_symbol(&s->c, s->header_state, 1);
s->mv_scale= get_symbol(&s->c, s->header_state, 0);
s->qbias= get_symbol(&s->c, s->header_state, 1);
for(i=0; i<QROOT; i++){
qexp[i]= lrintf(v);
- v *= pow(2, 1.0 / QROOT);
+ v *= pow(2, 1.0 / QROOT);
}
}
int level, orientation, plane_index, dec;
s->avctx= avctx;
-
+
dsputil_init(&s->dsp, avctx);
#define mcf(dx,dy)\
dec= s->spatial_decomposition_count= 5;
s->spatial_decomposition_type= avctx->prediction_method; //FIXME add decorrelator type r transform_type
-
+
s->chroma_h_shift= 1; //FIXME XXX
s->chroma_v_shift= 1;
-
+
// dec += FFMAX(s->chroma_h_shift, s->chroma_v_shift);
-
+
width= s->avctx->width;
height= s->avctx->height;
s->spatial_dwt_buffer= av_mallocz(width*height*sizeof(DWTELEM));
-
+
s->mv_scale= (s->avctx->flags & CODEC_FLAG_QPEL) ? 2 : 4;
s->block_max_depth= (s->avctx->flags & CODEC_FLAG_4MV) ? 1 : 0;
-
- for(plane_index=0; plane_index<3; plane_index++){
+
+ for(plane_index=0; plane_index<3; plane_index++){
int w= s->avctx->width;
int h= s->avctx->height;
for(level=s->spatial_decomposition_count-1; level>=0; level--){
for(orientation=level ? 1 : 0; orientation<4; orientation++){
SubBand *b= &s->plane[plane_index].band[level][orientation];
-
+
b->buf= s->spatial_dwt_buffer;
b->level= level;
b->stride= s->plane[plane_index].width << (s->spatial_decomposition_count - level);
b->width = (w + !(orientation&1))>>1;
b->height= (h + !(orientation>1))>>1;
-
+
b->stride_line = 1 << (s->spatial_decomposition_count - level);
b->buf_x_offset = 0;
b->buf_y_offset = 0;
-
+
if(orientation&1){
b->buf += (w+1)>>1;
b->buf_x_offset = (w+1)>>1;
b->buf += b->stride>>1;
b->buf_y_offset = b->stride_line >> 1;
}
-
+
if(level)
b->parent= &s->plane[plane_index].band[level-1][orientation];
b->x_coeff=av_mallocz(((b->width+1) * b->height+1)*sizeof(x_and_coeff));
h= (h+1)>>1;
}
}
-
+
reset_contexts(s);
-/*
+/*
width= s->width= avctx->width;
height= s->height= avctx->height;
-
+
assert(width && height);
*/
s->avctx->get_buffer(s->avctx, &s->mconly_picture);
-
+
return 0;
}
SubBand *b= &p->band[level][orientation];
DWTELEM *buf= b->buf;
int64_t error=0;
-
+
memset(s->spatial_dwt_buffer, 0, sizeof(int)*width*height);
buf[b->width/2 + b->height/2*b->stride]= 256*256;
ff_spatial_idwt(s->spatial_dwt_buffer, width, height, width, s->spatial_decomposition_type, s->spatial_decomposition_count);
"use vstrict=-2 / -strict -2 to use it anyway\n");
return -1;
}
-
+
common_init(avctx);
alloc_blocks(s);
-
+
s->version=0;
-
+
s->m.avctx = avctx;
s->m.flags = avctx->flags;
s->m.bit_rate= avctx->bit_rate;
for(plane_index=0; plane_index<3; plane_index++){
calculate_vissual_weight(s, &s->plane[plane_index]);
}
-
-
+
+
avctx->coded_frame= &s->current_picture;
switch(avctx->pix_fmt){
// case PIX_FMT_YUV444P:
tmp= s->last_picture;
s->last_picture= s->current_picture;
s->current_picture= tmp;
-
+
s->current_picture.reference= 1;
if(s->avctx->get_buffer(s->avctx, &s->current_picture) < 0){
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
-
+
return 0;
}
ff_init_range_encoder(c, buf, buf_size);
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
-
+
s->input_picture = *pict;
if(avctx->flags&CODEC_FLAG_PASS2){
s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0;
pict->pict_type= s->keyframe ? FF_I_TYPE : FF_P_TYPE;
}
-
+
if(pict->quality){
s->qlog= rint(QROOT*log(pict->quality / (float)FF_QP2LAMBDA)/log(2));
//<64 >60
int block_width = (width +15)>>4;
int block_height= (height+15)>>4;
int stride= s->current_picture.linesize[0];
-
+
assert(s->current_picture.data[0]);
assert(s->last_picture.data[0]);
-
+
s->m.avctx= s->avctx;
s->m.current_picture.data[0]= s->current_picture.data[0];
s->m. last_picture.data[0]= s-> last_picture.data[0];
s->m.dsp= s->dsp; //move
ff_init_me(&s->m);
}
-
+
redo_frame:
-
+
s->qbias= pict->pict_type == P_TYPE ? 2 : 0;
encode_header(s);
s->m.misc_bits = 8*(s->c.bytestream - s->c.bytestream_start);
encode_blocks(s);
s->m.mv_bits = 8*(s->c.bytestream - s->c.bytestream_start) - s->m.misc_bits;
-
+
for(plane_index=0; plane_index<3; plane_index++){
Plane *p= &s->plane[plane_index];
int w= p->width;
}
}
predict_plane(s, s->spatial_dwt_buffer, plane_index, 0);
-
- if( plane_index==0
- && pict->pict_type == P_TYPE
+
+ if( plane_index==0
+ && pict->pict_type == P_TYPE
&& s->m.me.scene_change_score > s->avctx->scenechange_threshold){
ff_init_range_encoder(c, buf, buf_size);
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
reset_contexts(s);
goto redo_frame;
}
-
+
if(s->qlog == LOSSLESS_QLOG){
for(y=0; y<h; y++){
for(x=0; x<w; x++){
}
}
}
-
+
ff_spatial_dwt(s->spatial_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count);
for(level=0; level<s->spatial_decomposition_count; level++){
for(orientation=level ? 1 : 0; orientation<4; orientation++){
SubBand *b= &p->band[level][orientation];
-
+
quantize(s, b, b->buf, b->stride, s->qbias);
if(orientation==0)
decorrelate(s, b, b->buf, b->stride, pict->pict_type == P_TYPE, 0);
STOP_TIMER("pred-conv")}
if(s->avctx->flags&CODEC_FLAG_PSNR){
int64_t error= 0;
-
+
if(pict->data[plane_index]) //FIXME gray hack
for(y=0; y<h; y++){
for(x=0; x<w; x++){
}
emms_c();
-
+
return ff_rac_terminate(c);
}
av_freep(&s->spatial_dwt_buffer);
- av_freep(&s->m.me.scratchpad);
+ av_freep(&s->m.me.scratchpad);
av_freep(&s->m.me.map);
av_freep(&s->m.me.score_map);
-
+
av_freep(&s->block);
- for(plane_index=0; plane_index<3; plane_index++){
+ for(plane_index=0; plane_index<3; plane_index++){
for(level=s->spatial_decomposition_count-1; level>=0; level--){
for(orientation=level ? 1 : 0; orientation<4; orientation++){
SubBand *b= &s->plane[plane_index].band[level][orientation];
-
+
av_freep(&b->x_coeff);
}
}
{
SnowContext *s = avctx->priv_data;
int block_size;
-
+
avctx->pix_fmt= PIX_FMT_YUV420P;
common_init(avctx);
-
+
block_size = MB_SIZE >> s->block_max_depth;
slice_buffer_init(&s->sb, s->plane[0].height, (block_size) + (s->spatial_decomposition_count * (s->spatial_decomposition_count + 2)) + 1, s->plane[0].width, s->spatial_dwt_buffer);
-
+
return 0;
}
//keyframe flag dupliaction mess FIXME
if(avctx->debug&FF_DEBUG_PICT_INFO)
av_log(avctx, AV_LOG_ERROR, "keyframe:%d qlog:%d\n", s->keyframe, s->qlog);
-
+
decode_blocks(s);
for(plane_index=0; plane_index<3; plane_index++){
int h= p->height;
int x, y;
int decode_state[MAX_DECOMPOSITIONS][4][1]; /* Stored state info for unpack_coeffs. 1 variable per instance. */
-
+
if(s->avctx->debug&2048){
memset(s->spatial_dwt_buffer, 0, sizeof(DWTELEM)*w*h);
predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
ff_spatial_idwt_buffered_init(cs, &s->sb, w, h, 1, s->spatial_decomposition_type, s->spatial_decomposition_count);
for(mb_y=0; mb_y<=mb_h; mb_y++){
-
+
int slice_starty = block_w*mb_y;
int slice_h = block_w*(mb_y+1);
if (!(s->keyframe || s->avctx->debug&512)){
slice_h -= (block_w >> 1);
}
- {
+ {
START_TIMER
for(level=0; level<s->spatial_decomposition_count; level++){
for(orientation=level ? 1 : 0; orientation<4; orientation++){
}
start_y = FFMIN(b->height, start_y);
end_y = FFMIN(b->height, end_y);
-
+
if (start_y != end_y){
if (orientation == 0){
SubBand * correlate_band = &p->band[0][0];
}
STOP_TIMER("decode_subband_slice");
}
-
+
{ START_TIMER
for(; yd<slice_h; yd+=4){
ff_spatial_idwt_buffered_slice(cs, &s->sb, w, h, 1, s->spatial_decomposition_type, s->spatial_decomposition_count, yd);
}
STOP_TIMER("idwt slice");}
-
+
if(s->qlog == LOSSLESS_QLOG){
for(; yq<slice_h && yq<h; yq++){
DWTELEM * line = slice_buffer_get_line(&s->sb, yq);
}
predict_slice_buffered(s, &s->sb, s->spatial_dwt_buffer, plane_index, 1, mb_y);
-
+
y = FFMIN(p->height, slice_starty);
end_y = FFMIN(p->height, slice_h);
while(y < end_y)
slice_buffer_release(&s->sb, y++);
}
-
+
slice_buffer_flush(&s->sb);
-
+
STOP_TIMER("idwt + predict_slices")}
}
-
+
emms_c();
if(s->last_picture.data[0])
avctx->release_buffer(avctx, &s->last_picture);
-if(!(s->avctx->debug&2048))
+if(!(s->avctx->debug&2048))
*picture= s->current_picture;
else
*picture= s->mconly_picture;
-
+
*data_size = sizeof(AVFrame);
-
+
bytes_read= c->bytestream - c->bytestream_start;
if(bytes_read ==0) av_log(s->avctx, AV_LOG_ERROR, "error at end of frame\n"); //FIXME
SnowContext *s = avctx->priv_data;
slice_buffer_destroy(&s->sb);
-
+
common_end(s);
return 0;
int i;
s.spatial_decomposition_count=6;
s.spatial_decomposition_type=1;
-
+
printf("testing 5/3 DWT\n");
for(i=0; i<width*height; i++)
buffer[0][i]= buffer[1][i]= random()%54321 - 12345;
-
+
ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
-
+
for(i=0; i<width*height; i++)
if(buffer[0][i]!= buffer[1][i]) printf("fsck: %d %d %d\n",i, buffer[0][i], buffer[1][i]);
s.spatial_decomposition_type=0;
for(i=0; i<width*height; i++)
buffer[0][i]= buffer[1][i]= random()%54321 - 12345;
-
+
ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
-
+
for(i=0; i<width*height; i++)
if(ABS(buffer[0][i] - buffer[1][i])>20) printf("fsck: %d %d %d\n",i, buffer[0][i], buffer[1][i]);
-
+
#if 0
printf("testing AC coder\n");
memset(s.header_state, 0, sizeof(s.header_state));
ff_init_range_encoder(&s.c, buffer[0], 256*256);
ff_init_cabac_states(&s.c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
-
+
for(i=-256; i<256; i++){
START_TIMER
put_symbol(&s.c, s.header_state, i*i*i/3*ABS(i), 1);
memset(s.header_state, 0, sizeof(s.header_state));
ff_init_range_decoder(&s.c, buffer[0], 256*256);
ff_init_cabac_states(&s.c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64);
-
+
for(i=-256; i<256; i++){
int j;
START_TIMER
if(orientation&1) buf+=w;
if(orientation>1) buf+=stride>>1;
-
+
memset(buffer[0], 0, sizeof(int)*width*height);
buf[w/2 + h/2*stride]= 256*256;
ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
buf+=w;
buf+=stride>>1;
-
+
memset(buffer[0], 0, sizeof(int)*width*height);
#if 1
for(y=0; y<height; y++){
typedef struct SonicContext {
int lossless, decorrelation;
-
+
int num_taps, downsampling;
double quantization;
-
+
int channels, samplerate, block_align, frame_size;
int *tap_quant;
static inline int intlist_read(GetBitContext *gb, int *buf, int entries, int base_2_part)
{
int i;
-
+
for (i = 0; i < entries; i++)
buf[i] = get_se_golomb(gb);
static int bits_to_store(uint64_t x)
{
int res = 0;
-
+
while(x)
{
res++;
static unsigned int read_uint_max(GetBitContext *gb, int max)
{
int i, bits, value = 0;
-
+
if (!max)
return 0;
copy = av_mallocz(4* entries);
if (!copy)
return -1;
-
+
if (base_2_part)
{
int energy = 0;
-
+
for (i = 0; i < entries; i++)
energy += abs(buf[i]);
-
+
low_bits = bits_to_store(energy / (entries * 2));
if (low_bits > 15)
low_bits = 15;
-
+
put_bits(pb, 4, low_bits);
}
-
+
for (i = 0; i < entries; i++)
{
put_bits(pb, low_bits, abs(buf[i]));
// av_free(copy);
return -1;
}
-
+
for (i = 0; i <= max; i++)
{
for (j = 0; j < entries; j++)
while (pos < x)
{
int steplet = step >> 8;
-
+
if (pos + steplet > x)
steplet = x - pos;
-
+
for (i = 0; i < steplet; i++)
if (bits[i+pos] != dominant)
any = 1;
-
+
put_bits(pb, 1, any);
-
+
if (!any)
{
pos += steplet;
else
{
int interloper = 0;
-
+
while (((pos + interloper) < x) && (bits[pos + interloper] == dominant))
interloper++;
// note change
- write_uint_max(pb, interloper, (step >> 8) - 1);
-
+ write_uint_max(pb, interloper, (step >> 8) - 1);
+
pos += interloper + 1;
step -= step / ADAPT_LEVEL;
}
-
+
if (step < 256)
{
step = 65536 / step;
dominant = !dominant;
}
}
-
+
// store signs
for (i = 0; i < entries; i++)
if (buf[i])
if (!bits)
return -1;
-
+
if (base_2_part)
{
low_bits = get_bits(gb, 4);
while (n_zeros < entries)
{
int steplet = step >> 8;
-
+
if (!get_bits1(gb))
{
for (i = 0; i < steplet; i++)
bits[x++] = dominant;
-
+
if (!dominant)
n_zeros += steplet;
-
+
step += step / ADAPT_LEVEL;
}
else
{
int actual_run = read_uint_max(gb, steplet-1);
-
+
// av_log(NULL, AV_LOG_INFO, "actual run: %d\n", actual_run);
-
+
for (i = 0; i < actual_run; i++)
bits[x++] = dominant;
-
+
bits[x++] = !dominant;
-
+
if (!dominant)
n_zeros += actual_run;
else
n_zeros++;
-
+
step -= step / ADAPT_LEVEL;
}
-
+
if (step < 256)
{
step = 65536 / step;
dominant = !dominant;
}
}
-
+
// reconstruct unsigned values
n_zeros = 0;
for (i = 0; n_zeros < entries; i++)
pos = 0;
level += 1 << low_bits;
}
-
+
if (buf[pos] >= level)
break;
-
+
pos++;
}
-
+
if (bits[i])
buf[pos] += 1 << low_bits;
else
n_zeros++;
-
+
pos++;
}
// av_free(bits);
-
+
// read signs
for (i = 0; i < entries; i++)
if (buf[i] && get_bits1(gb))
}
#endif
- // don't drift too far, to avoid overflows
+ // don't drift too far, to avoid overflows
if (x > (SAMPLE_FACTOR<<16)) x = (SAMPLE_FACTOR<<16);
if (x < -(SAMPLE_FACTOR<<16)) x = -(SAMPLE_FACTOR<<16);
{
int i;
int *state = av_mallocz(4* window_entries);
-
+
memcpy(state, window, 4* window_entries);
-
+
for (i = 0; i < out_entries; i++)
{
int step = (i+1)*channels, k, j;
k = 0;
else
k = (int)(floor(-xy/xx * (double)LATTICE_FACTOR / (double)(tap_quant[i]) + 0.5));
-
+
if (k > (LATTICE_FACTOR/tap_quant[i]))
k = LATTICE_FACTOR/tap_quant[i];
if (-k > (LATTICE_FACTOR/tap_quant[i]))
k = -(LATTICE_FACTOR/tap_quant[i]);
-
+
out[i] = k;
k *= tap_quant[i];
*x_ptr = x_value + shift_down(k*state_value,LATTICE_SHIFT);
*state_ptr = state_value + shift_down(k*x_value, LATTICE_SHIFT);
}
-#else
+#else
for (j=0; j <= (window_entries - step); j++)
{
int stepval = window[step+j], stateval=state[j];
}
#endif
}
-
+
av_free(state);
}
if (!s->coded_samples[i])
return -1;
}
-
+
s->int_samples = av_mallocz(4* s->frame_size);
s->window_size = ((2*s->tail_size)+s->frame_size);
}
memset(s->window, 0, 4* s->window_size);
-
+
for (i = 0; i < s->tail_size; i++)
s->window[x++] = s->tail[i];
for (i = 0; i < s->frame_size; i++)
s->window[x++] = s->int_samples[i];
-
+
for (i = 0; i < s->tail_size; i++)
s->window[x++] = 0;
s->coded_samples[ch][i] = sum;
}
}
-
- // simple rate control code
+
+ // simple rate control code
if (!s->lossless)
{
double energy1 = 0.0, energy2 = 0.0;
energy1 += fabs(sample);
}
}
-
+
energy2 = sqrt(energy2/(s->channels*s->block_align));
energy1 = sqrt(2.0)*energy1/(s->channels*s->block_align);
-
+
// increase bitrate when samples are like a gaussian distribution
// reduce bitrate when samples are like a two-tailed exponential distribution
-
+
if (energy2 > energy1)
energy2 += (energy2-energy1)*RATE_VARIATION;
-
+
quant = (int)(BASE_QUANT*s->quantization*energy2/SAMPLE_FACTOR);
// av_log(avctx, AV_LOG_DEBUG, "quant: %d energy: %f / %f\n", quant, energy1, energy2);
quant = 1;
if (quant > 65535)
quant = 65535;
-
+
set_ue_golomb(&pb, quant);
-
+
quant *= SAMPLE_FACTOR;
}
SonicContext *s = avctx->priv_data;
GetBitContext gb;
int i, version;
-
+
s->channels = avctx->channels;
s->samplerate = avctx->sample_rate;
-
+
if (!avctx->extradata)
{
av_log(avctx, AV_LOG_ERROR, "No mandatory headers present\n");
return -1;
}
-
+
init_get_bits(&gb, avctx->extradata, avctx->extradata_size);
-
+
version = get_bits(&gb, 2);
if (version > 1)
{
s->num_taps = (get_bits(&gb, 5)+1)<<5;
if (get_bits1(&gb)) // XXX FIXME
av_log(avctx, AV_LOG_INFO, "Custom quant table\n");
-
+
s->block_align = (int)(2048.0*(s->samplerate/44100))/s->downsampling;
s->frame_size = s->channels*s->block_align*s->downsampling;
// avctx->frame_size = s->block_align;
s->tap_quant = av_mallocz(4* s->num_taps);
for (i = 0; i < s->num_taps; i++)
s->tap_quant[i] = (int)(sqrt(i+1));
-
+
s->predictor_k = av_mallocz(4* s->num_taps);
-
+
for (i = 0; i < s->channels; i++)
{
s->predictor_state[i] = av_mallocz(4* s->num_taps);
{
SonicContext *s = avctx->priv_data;
int i;
-
+
av_free(s->int_samples);
av_free(s->tap_quant);
av_free(s->predictor_k);
-
+
for (i = 0; i < s->channels; i++)
{
av_free(s->predictor_state[i]);
av_free(s->coded_samples[i]);
}
-
+
return 0;
}
if (buf_size == 0) return 0;
// av_log(NULL, AV_LOG_INFO, "buf_size: %d\n", buf_size);
-
+
init_get_bits(&gb, buf, buf_size*8);
-
+
intlist_read(&gb, s->predictor_k, s->num_taps, 0);
// dequantize
int x = ch;
predictor_init_state(s->predictor_k, s->predictor_state[ch], s->num_taps);
-
+
intlist_read(&gb, s->coded_samples[ch], s->block_align, 1);
for (i = 0; i < s->block_align; i++)
s->int_samples[x] = predictor_calc_error(s->predictor_k, s->predictor_state[ch], s->num_taps, 0);
x += s->channels;
}
-
+
s->int_samples[x] = predictor_calc_error(s->predictor_k, s->predictor_state[ch], s->num_taps, s->coded_samples[ch][i] * quant);
x += s->channels;
}
for (i = 0; i < s->num_taps; i++)
s->predictor_state[ch][i] = s->int_samples[s->frame_size - s->channels + ch - i*s->channels];
}
-
+
switch(s->decorrelation)
{
case MID_SIDE:
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
};
-static const uint8_t sp5x_data_dht[] = {
+static const uint8_t sp5x_data_dht[] = {
0xFF, 0xC4, /* DHT */
0x01, 0xA2, /* len */
0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01,
#if 0
/* 4NF-M, not ZigZag */
-static const uint8_t sp5x_quant_table_orig[18][64] =
+static const uint8_t sp5x_quant_table_orig[18][64] =
{
/* index 0, Q50 */
{ 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55,
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
-
+
static void sigill_handler (int sig)
{
if (!canjump) {
signal (SIGILL, SIG_DFL);
return accel;
}
-
+
canjump = 1;
-
+
/* pdist %f0, %f0, %f0 */
__asm__ __volatile__(".word\t0x81b007c0");
c->put_pixels_tab[0][1] = MC_put_x_16_vis;
c->put_pixels_tab[0][2] = MC_put_y_16_vis;
c->put_pixels_tab[0][3] = MC_put_xy_16_vis;
-
+
c->put_pixels_tab[1][0] = MC_put_o_8_vis;
c->put_pixels_tab[1][1] = MC_put_x_8_vis;
c->put_pixels_tab[1][2] = MC_put_y_8_vis;
c->put_pixels_tab[1][3] = MC_put_xy_8_vis;
-
+
c->avg_pixels_tab[0][0] = MC_avg_o_16_vis;
c->avg_pixels_tab[0][1] = MC_avg_x_16_vis;
c->avg_pixels_tab[0][2] = MC_avg_y_16_vis;
c->avg_pixels_tab[0][3] = MC_avg_xy_16_vis;
-
+
c->avg_pixels_tab[1][0] = MC_avg_o_8_vis;
c->avg_pixels_tab[1][1] = MC_avg_x_8_vis;
c->avg_pixels_tab[1][2] = MC_avg_y_8_vis;
c->avg_pixels_tab[1][3] = MC_avg_xy_8_vis;
-
+
c->put_no_rnd_pixels_tab[0][0] = MC_put_no_round_o_16_vis;
c->put_no_rnd_pixels_tab[0][1] = MC_put_no_round_x_16_vis;
c->put_no_rnd_pixels_tab[0][2] = MC_put_no_round_y_16_vis;
c->put_no_rnd_pixels_tab[0][3] = MC_put_no_round_xy_16_vis;
-
+
c->put_no_rnd_pixels_tab[1][0] = MC_put_no_round_o_8_vis;
c->put_no_rnd_pixels_tab[1][1] = MC_put_no_round_x_8_vis;
c->put_no_rnd_pixels_tab[1][2] = MC_put_no_round_y_8_vis;
c->put_no_rnd_pixels_tab[1][3] = MC_put_no_round_xy_8_vis;
-
+
c->avg_no_rnd_pixels_tab[0][0] = MC_avg_no_round_o_16_vis;
c->avg_no_rnd_pixels_tab[0][1] = MC_avg_no_round_x_16_vis;
c->avg_no_rnd_pixels_tab[0][2] = MC_avg_no_round_y_16_vis;
c->avg_no_rnd_pixels_tab[0][3] = MC_avg_no_round_xy_16_vis;
-
+
c->avg_no_rnd_pixels_tab[1][0] = MC_avg_no_round_o_8_vis;
c->avg_no_rnd_pixels_tab[1][1] = MC_avg_no_round_x_8_vis;
c->avg_no_rnd_pixels_tab[1][2] = MC_avg_no_round_y_8_vis;
/*
- *
+ *
* Copyright (C) 2002 the xine project
* Copyright (C) 2002 the ffmpeg project
- *
+ *
* This library 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
AVFrame last_picture;
PutBitContext pb;
GetBitContext gb;
-
+
PutBitContext reorder_pb[6]; //why ooh why this sick breadth first order, everything is slower and more complex
int frame_width;
/* U & V plane (C planes) block dimensions */
int c_block_width;
int c_block_height;
-
+
uint16_t *mb_type;
uint32_t *dummy;
int16_t (*motion_val8[3])[2];
/* get motion code */
diff = get_vlc2(bitbuf, svq1_motion_component.table, 7, 2);
- if(diff<0)
+ if(diff<0)
return -1;
else if(diff){
if(get_bits1(bitbuf)) diff= -diff;
motion[0].y =
motion[(x / 8) + 2].y =
motion[(x / 8) + 3].y = mv.y;
-
+
if(y + (mv.y >> 1)<0)
mv.y= 0;
if(x + (mv.x >> 1)<0)
if(x + (mv.x >> 1)<0 || y + (mv.y >> 1)<0 || x + (mv.x >> 1) + 16 > w || y + (mv.y >> 1) + 16> h)
av_log(s->avctx, AV_LOG_INFO, "%d %d %d %d\n", x, y, x + (mv.x >> 1), y + (mv.y >> 1));
#endif
-
+
src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch];
dst = current;
for (i=0; i < 4; i++) {
int mvx= pmv[i]->x + (i&1)*16;
int mvy= pmv[i]->y + (i>>1)*16;
-
+
///XXX /FIXME cliping or padding?
if(y + (mvy >> 1)<0)
mvy= 0;
#endif
src = &previous[(x + (mvx >> 1)) + (y + (mvy >> 1))*pitch];
dst = current;
-
+
s->dsp.put_pixels_tab[1][((mvy & 1) << 1) | (mvx & 1)](dst,src,pitch,8);
/* select next block */
/* frame type */
s->pict_type= get_bits (bitbuf, 2)+1;
- if(s->pict_type==4)
+ if(s->pict_type==4)
return -1;
-
+
if (s->pict_type == I_TYPE) {
/* unknown fields */
skip_bits (bitbuf, 8);
}
}
-
+
return 0;
}
-static int svq1_decode_frame(AVCodecContext *avctx,
+static int svq1_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
MpegEncContext *s=avctx->priv_data;
uint8_t *current, *previous;
int result, i, x, y, width, height;
- AVFrame *pict = data;
+ AVFrame *pict = data;
/* initialize bit buffer */
init_get_bits(&s->gb,buf,buf_size*8);
#endif
return result;
}
-
+
//FIXME this avoids some confusion for "B frames" without 2 references
//this should be removed after libavcodec can handle more flexible picture types & ordering
if(s->pict_type==B_TYPE && s->last_picture_ptr==NULL) return buf_size;
-
+
if(avctx->hurry_up && s->pict_type==B_TYPE) return buf_size;
if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
|| avctx->skip_frame >= AVDISCARD_ALL)
- return buf_size;
+ return buf_size;
if(MPV_frame_start(s, avctx) < 0)
return -1;
}
}
}
-
+
*pict = *(AVFrame*)&s->current_picture;
MPV_frame_end(s);
-
+
*data_size=sizeof(AVFrame);
return buf_size;
}
break;
}
}
-
+
if (i == 7)
{
put_bits(&s->pb, 3, 7);
int best_vector_sum=-999, best_vector_mean=-999;
const int stage= count-1;
const int8_t *vector;
-
+
for(i=0; i<16; i++){
int sum= codebook_sum[stage*16 + i];
int sqr=0;
int diff, mean, score;
-
+
vector = codebook + stage*size*16 + i*size;
-
+
for(j=0; j<size; j++){
int v= vector[j];
sqr += (v - block[stage][j])*(v - block[stage][j]);
block[stage+1][j] = block[stage][j] - vector[j];
}
block_sum[stage+1]= block_sum[stage] - best_vector_sum;
- best_vector_score +=
+ best_vector_score +=
lambda*(+ 1 + 4*count
+ multistage_vlc[1+count][1]
+ mean_vlc[best_vector_mean][1]);
-
+
if(best_vector_score < best_score){
best_score= best_vector_score;
best_count= count;
}
}
}
-
+
split=0;
if(best_score > threshold && level){
int score=0;
score += encode_block(s, src , ref , decoded , stride, level-1, threshold>>1, lambda, intra);
score += encode_block(s, src + offset, ref + offset, decoded + offset, stride, level-1, threshold>>1, lambda, intra);
score += lambda;
-
+
if(score < best_score){
best_score= score;
split=1;
assert(best_mean >= -256 && best_mean<256);
assert(best_count >=0 && best_count<7);
assert(level<4 || best_count==0);
-
+
/* output the encoding */
- put_bits(&s->reorder_pb[level],
+ put_bits(&s->reorder_pb[level],
multistage_vlc[1 + best_count][1],
multistage_vlc[1 + best_count][0]);
put_bits(&s->reorder_pb[level], mean_vlc[best_mean][1],
assert(best_vector[i]>=0 && best_vector[i]<16);
put_bits(&s->reorder_pb[level], 4, best_vector[i]);
}
-
+
for(y=0; y<h; y++){
for(x=0; x<w; x++){
decoded[x + y*stride]= src[x + y*stride] - block[best_count][x + w*y] + best_mean;
s->m.last_picture_ptr = &s->m.last_picture;
s->m.last_picture.data[0]= ref_plane;
s->m.linesize=
- s->m.last_picture.linesize[0]=
- s->m.new_picture.linesize[0]=
+ s->m.last_picture.linesize[0]=
+ s->m.new_picture.linesize[0]=
s->m.current_picture.linesize[0]= stride;
s->m.width= width;
s->m.height= height;
s->m.flags= s->avctx->flags;
// s->m.out_format = FMT_H263;
// s->m.unrestricted_mv= 1;
-
+
s->m.lambda= s->picture.quality;
s->m.qscale= (s->m.lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7);
s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT;
-
+
if(!s->motion_val8[plane]){
s->motion_val8 [plane]= av_mallocz((s->m.b8_stride*block_height*2 + 2)*2*sizeof(int16_t));
s->motion_val16[plane]= av_mallocz((s->m.mb_stride*(block_height + 2) + 1)*2*sizeof(int16_t));
}
s->m.mb_type= s->mb_type;
-
+
//dummies, to avoid segfaults
s->m.current_picture.mb_mean= (uint8_t *)s->dummy;
s->m.current_picture.mb_var= (uint16_t*)s->dummy;
s->m.current_picture.mc_mb_var= (uint16_t*)s->dummy;
s->m.current_picture.mb_type= s->dummy;
-
+
s->m.current_picture.motion_val[0]= s->motion_val8[plane] + 2;
s->m.p_mv_table= s->motion_val16[plane] + s->m.mb_stride + 1;
s->m.dsp= s->dsp; //move
ff_init_me(&s->m);
-
+
s->m.me.dia_size= s->avctx->dia_size;
s->m.first_slice_line=1;
for (y = 0; y < block_height; y++) {
uint8_t src[stride*16];
-
+
s->m.new_picture.data[0]= src - y*16*stride; //ugly
s->m.mb_y= y;
-
+
for(i=0; i<16 && i + 16*y<height; i++){
memcpy(&src[i*stride], &src_plane[(i+16*y)*src_stride], width);
for(x=width; x<16*block_width; x++)
}
for(; i<16 && i + 16*y<16*block_height; i++)
memcpy(&src[i*stride], &src[(i-1)*stride], 16*block_width);
-
+
for (x = 0; x < block_width; x++) {
s->m.mb_x= x;
ff_init_block_index(&s->m);
ff_update_block_index(&s->m);
-
+
ff_estimate_p_frame_motion(&s->m, x, y);
}
s->m.first_slice_line=0;
}
-
+
ff_fix_long_p_mvs(&s->m);
ff_fix_long_mvs(&s->m, NULL, 0, s->m.p_mv_table, s->m.f_code, CANDIDATE_MB_TYPE_INTER, 0);
}
-
+
s->m.first_slice_line=1;
for (y = 0; y < block_height; y++) {
uint8_t src[stride*16];
-
+
for(i=0; i<16 && i + 16*y<height; i++){
memcpy(&src[i*stride], &src_plane[(i+16*y)*src_stride], width);
for(x=width; x<16*block_width; x++)
uint8_t *ref= ref_plane + offset;
int score[4]={0,0,0,0}, best;
uint8_t temp[16*stride];
-
+
if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 3000){ //FIXME check size
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
s->m.mb_x= x;
ff_init_block_index(&s->m);
ff_update_block_index(&s->m);
-
+
if(s->picture.pict_type == I_TYPE || (s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTRA)){
for(i=0; i<6; i++){
init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7*32);
}
}else
score[0]= INT_MAX;
-
+
best=0;
-
+
if(s->picture.pict_type == P_TYPE){
const uint8_t *vlc= svq1_block_type_vlc[SVQ1_BLOCK_INTER];
int mx, my, pred_x, pred_y, dxy;
init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i], 7*32);
put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
-
- s->m.pb= s->reorder_pb[5];
+
+ s->m.pb= s->reorder_pb[5];
mx= motion_ptr[0];
my= motion_ptr[1];
assert(mx>=-32 && mx<=31);
ff_h263_encode_motion(&s->m, my - pred_y, 1);
s->reorder_pb[5]= s->m.pb;
score[1] += lambda*put_bits_count(&s->reorder_pb[5]);
-
+
dxy= (mx&1) + 2*(my&1);
-
+
s->dsp.put_pixels_tab[0][dxy](temp+16, ref + (mx>>1) + stride*(my>>1), stride, 16);
-
+
score[1]+= encode_block(s, src+16*x, temp+16, decoded, stride, 5, 64, lambda, 0);
best= score[1] <= score[0];
motion_ptr[2+2*s->m.b8_stride] = motion_ptr[3+2*s->m.b8_stride]=0;
}
}
-
+
s->rd_total += score[best];
for(i=5; i>=0; i--){
s->avctx= avctx;
s->m.avctx= avctx;
- s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t));
+ s->m.me.scratchpad= av_mallocz((avctx->width+64)*2*16*2*sizeof(uint8_t));
s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
s->mb_type = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int16_t));
s->dummy = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int32_t));
h263_encode_init(&s->m); //mv_penalty
-
+
return 0;
}
-static int svq1_encode_frame(AVCodecContext *avctx, unsigned char *buf,
+static int svq1_encode_frame(AVCodecContext *avctx, unsigned char *buf,
int buf_size, void *data)
{
SVQ1Context * const s = avctx->priv_data;
av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
return -1;
}
-
+
if(!s->current_picture.data[0]){
avctx->get_buffer(avctx, &s->current_picture);
avctx->get_buffer(avctx, &s->last_picture);
}
-
+
temp= s->current_picture;
s->current_picture= s->last_picture;
s->last_picture= temp;
-
+
init_put_bits(&s->pb, buf, buf_size);
*p = *pict;
for(i=0; i<3; i++){
if(svq1_encode_plane(s, i,
s->picture.data[i], s->last_picture.data[i], s->current_picture.data[i],
- s->frame_width / (i?4:1), s->frame_height / (i?4:1),
+ s->frame_width / (i?4:1), s->frame_height / (i?4:1),
s->picture.linesize[i], s->current_picture.linesize[i]) < 0)
return -1;
}
// align_put_bits(&s->pb);
while(put_bits_count(&s->pb) & 31)
put_bits(&s->pb, 1, 0);
-
+
flush_put_bits(&s->pb);
return (put_bits_count(&s->pb) / 8);
int i;
av_log(avctx, AV_LOG_DEBUG, "RD: %f\n", s->rd_total/(double)(avctx->width*avctx->height*avctx->frame_number));
-
- av_freep(&s->m.me.scratchpad);
+
+ av_freep(&s->m.me.scratchpad);
av_freep(&s->m.me.map);
av_freep(&s->m.me.score_map);
av_freep(&s->mb_type);
/*
- *
+ *
* Copyright (C) 2002 the xine project
* Copyright (C) 2002 the ffmpeg project
- *
+ *
* This library 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
* @file svq1_cb.h
* svq1 code books.
*/
-
+
/* 6x16-entry codebook for inter-coded 4x2 vectors */
static const int8_t svq1_inter_codebook_4x2[768] = {
7, 2, -6, -7, 7, 3, -3, -4, -7, -2, 7, 8, -8, -4, 3, 4,
static const uint8_t svq1_block_type_vlc[4][2] = {
/* { code, length } */
{ 0x1, 1 }, { 0x1, 2 }, { 0x1, 3 }, { 0x0, 3 }
-
+
};
/* values in this table range from -1..6; adjust retrieved value by -1 */
* the calling app must make the SVQ3 ImageDescription atom available
* via the AVCodecContext's extradata[_size] field:
*
- * AVCodecContext.extradata = pointer to ImageDescription, first characters
+ * AVCodecContext.extradata = pointer to ImageDescription, first characters
* are expected to be 'S', 'V', 'Q', and '3', NOT the 4-byte atom length
- * AVCodecContext.extradata_size = size of ImageDescription atom memory
- * buffer (which will be the same as the ImageDescription atom size field
+ * AVCodecContext.extradata_size = size of ImageDescription atom memory
+ * buffer (which will be the same as the ImageDescription atom size field
* from the QT file, minus 4 bytes since the length is missing)
*
* You will know you have these parameters passed correctly when the decoder
* ftp://ftp.mplayerhq.hu/MPlayer/samples/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
*
*/
-
+
/**
* @file svq3.c
* svq3 decoder.
*/
-#define FULLPEL_MODE 1
-#define HALFPEL_MODE 2
+#define FULLPEL_MODE 1
+#define HALFPEL_MODE 2
#define THIRDPEL_MODE 3
#define PREDICT_MODE 4
-
+
/* dual scan (from some older h264 draft)
o-->o-->o o
| /|
o o o / o
| / | |/ |
o o o o
- /
+ /
o-->o-->o-->o
*/
static const uint8_t svq3_scan[16]={
}
static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){
- LOAD_TOP_EDGE
- LOAD_LEFT_EDGE
+ LOAD_TOP_EDGE
+ LOAD_LEFT_EDGE
const __attribute__((unused)) int unu0= t0;
const __attribute__((unused)) int unu1= l0;
mx += x;
my += y;
-
+
if (mx < 0 || mx >= (s->h_edge_pos - width - 1) ||
my < 0 || my >= (s->v_edge_pos - height - 1)) {
N??11111
N
*/
-
+
for (m=0; m < 2; m++) {
if (s->mb_x > 0 && h->intra4x4_pred_mode[mb_xy - 1][0] != -1) {
for (i=0; i < 4; i++) {
s->picture_number = h->slice_num;
if(avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "%c hpel:%d, tpel:%d aqp:%d qp:%d\n",
+ av_log(h->s.avctx, AV_LOG_DEBUG, "%c hpel:%d, tpel:%d aqp:%d qp:%d\n",
av_get_pict_type_char(s->pict_type), h->halfpel_flag, h->thirdpel_flag,
s->adaptive_quant, s->qscale
);
h->ref_cache[m][scan8[0] + 8*i + j]= PART_NOT_AVAILABLE;
}
}
-
+
for (s->mb_y=0; s->mb_y < s->mb_height; s->mb_y++) {
for (s->mb_x=0; s->mb_x < s->mb_width; s->mb_x++) {
/**
* @file truemotion1.c
- * Duck TrueMotion v1 Video Decoder by
+ * Duck TrueMotion v1 Video Decoder by
* Alex Beregszaszi (alex@fsn.hu) and
* Mike Melanson (melanson@pcisys.net)
*
int flags;
int x, y, w, h;
-
+
uint32_t y_predictor_table[1024];
uint32_t c_predictor_table[1024];
uint32_t fat_y_predictor_table[1024];
uint32_t fat_c_predictor_table[1024];
-
+
int compression;
int block_type;
int block_width;
int16_t cdt[8];
int16_t fat_ydt[8];
int16_t fat_cdt[8];
-
+
int last_deltaset, last_vectable;
unsigned int *vert_pred;
#endif
{
int lo, hi;
-
+
lo = ydt[p1];
lo += (lo << 5) + (lo << 10);
hi = ydt[p2];
#endif
{
int r, b, lo;
-
+
b = cdt[p2];
r = cdt[p1] << 10;
lo = b + r;
#endif
{
int lo, hi;
-
+
lo = ydt[p1];
lo += (lo << 6) + (lo << 11);
hi = ydt[p2];
#endif
{
int r, b, lo;
-
+
b = cdt[p2];
r = cdt[p1] << 11;
lo = b + r;
#endif
{
int lo, hi;
-
+
lo = ydt[p1];
hi = ydt[p2];
return ((lo + (hi << 8) + (hi << 16)) << 1);
#endif
{
int r, b;
-
+
b = cdt[p2];
r = cdt[p1]<<16;
return ((b+r) << 1);
{
int len, i, j;
unsigned char delta_pair;
-
+
for (i = 0; i < 1024; i += 4)
{
len = *sel_vector_table++ / 2;
for (j = 0; j < len; j++)
{
delta_pair = *sel_vector_table++;
- s->y_predictor_table[i+j] = 0xfffffffe &
+ s->y_predictor_table[i+j] = 0xfffffffe &
make_ydt15_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
- s->c_predictor_table[i+j] = 0xfffffffe &
+ s->c_predictor_table[i+j] = 0xfffffffe &
make_cdt15_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
}
s->y_predictor_table[i+(j-1)] |= 1;
{
int len, i, j;
unsigned char delta_pair;
-
+
for (i = 0; i < 1024; i += 4)
{
len = *sel_vector_table++ / 2;
for (j = 0; j < len; j++)
{
delta_pair = *sel_vector_table++;
- s->y_predictor_table[i+j] = 0xfffffffe &
+ s->y_predictor_table[i+j] = 0xfffffffe &
make_ydt16_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
- s->c_predictor_table[i+j] = 0xfffffffe &
+ s->c_predictor_table[i+j] = 0xfffffffe &
make_cdt16_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
}
s->y_predictor_table[i+(j-1)] |= 1;
{
int len, i, j;
unsigned char delta_pair;
-
+
for (i = 0; i < 1024; i += 4)
{
len = *sel_vector_table++ / 2;
for (j = 0; j < len; j++)
{
delta_pair = *sel_vector_table++;
- s->y_predictor_table[i+j] = 0xfffffffe &
+ s->y_predictor_table[i+j] = 0xfffffffe &
make_ydt24_entry(delta_pair >> 4, delta_pair & 0xf, s->ydt);
- s->c_predictor_table[i+j] = 0xfffffffe &
+ s->c_predictor_table[i+j] = 0xfffffffe &
make_cdt24_entry(delta_pair >> 4, delta_pair & 0xf, s->cdt);
- s->fat_y_predictor_table[i+j] = 0xfffffffe &
+ s->fat_y_predictor_table[i+j] = 0xfffffffe &
make_ydt24_entry(delta_pair >> 4, delta_pair & 0xf, s->fat_ydt);
- s->fat_c_predictor_table[i+j] = 0xfffffffe &
+ s->fat_c_predictor_table[i+j] = 0xfffffffe &
make_cdt24_entry(delta_pair >> 4, delta_pair & 0xf, s->fat_cdt);
}
s->y_predictor_table[i+(j-1)] |= 1;
}
/* Returns the number of bytes consumed from the bytestream. Returns -1 if
- * there was an error while decoding the header */
+ * there was an error while decoding the header */
static int truemotion1_decode_header(TrueMotion1Context *s)
{
int i;
s->flags = FLAG_KEYFRAME;
} else /* Version 1 */
s->flags = FLAG_KEYFRAME;
-
+
if (s->flags & FLAG_SPRITE) {
av_log(s->avctx, AV_LOG_INFO, "SPRITE frame found, please report the sample to the developers\n");
s->w = header.width;
av_log(s->avctx, AV_LOG_ERROR, "invalid compression type (%d)\n", header.compression);
return -1;
}
-
- if ((header.deltaset != s->last_deltaset) ||
+
+ if ((header.deltaset != s->last_deltaset) ||
(header.vectable != s->last_vectable))
select_delta_tables(s, header.deltaset);
return -1;
}
}
-
+
// FIXME: where to place this ?!?!
if (compression_types[header.compression].algorithm == ALGO_RGB24H)
s->avctx->pix_fmt = PIX_FMT_RGBA32;
s->index_stream = s->mb_change_bits;
} else {
/* one change bit per 4x4 block */
- s->index_stream = s->mb_change_bits +
+ s->index_stream = s->mb_change_bits +
(s->mb_change_bits_row_size * (s->avctx->height >> 2));
}
s->index_stream_size = s->size - (s->index_stream - s->buf);
s->flags & FLAG_SPRITE ? " SPRITE" : "",
s->flags & FLAG_INTERPOLATED ? " INTERPOL" : "");
- return header.header_size;
+ return header.header_size;
}
static int truemotion1_decode_init(AVCodecContext *avctx)
/* there is a vertical predictor for each pixel in a line; each vertical
* predictor is 0 to start with */
- s->vert_pred =
+ s->vert_pred =
(unsigned int *)av_malloc(s->avctx->width * sizeof(unsigned int));
return 0;
index++; \
} \
} else \
- index++;
+ index++;
#define APPLY_Y_PREDICTOR() \
switch (y & 3) {
case 0:
- /* if macroblock width is 2, apply C-Y-C-Y; else
+ /* if macroblock width is 2, apply C-Y-C-Y; else
* apply C-Y-Y */
if (s->block_width == 2) {
APPLY_C_PREDICTOR();
break;
case 2:
- /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
+ /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
* depending on the macroblock type */
if (s->block_type == BLOCK_2x2) {
APPLY_C_PREDICTOR();
} else {
- /* skip (copy) four pixels, but reassign the horizontal
+ /* skip (copy) four pixels, but reassign the horizontal
* predictor */
*current_pixel_pair = *prev_pixel_pair++;
*vert_pred++ = *current_pixel_pair++;
*current_pixel_pair = *prev_pixel_pair++;
horiz_pred = *current_pixel_pair - *vert_pred;
*vert_pred++ = *current_pixel_pair++;
-
+
}
if (!keyframe) {
switch (y & 3) {
case 0:
- /* if macroblock width is 2, apply C-Y-C-Y; else
+ /* if macroblock width is 2, apply C-Y-C-Y; else
* apply C-Y-Y */
if (s->block_width == 2) {
APPLY_C_PREDICTOR_24();
break;
case 2:
- /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
+ /* this iteration might be C-Y-C-Y, Y-Y, or C-Y-Y
* depending on the macroblock type */
if (s->block_type == BLOCK_2x2) {
APPLY_C_PREDICTOR_24();
} else {
- /* skip (copy) four pixels, but reassign the horizontal
+ /* skip (copy) four pixels, but reassign the horizontal
* predictor */
*current_pixel_pair = *prev_pixel_pair++;
*vert_pred++ = *current_pixel_pair++;
*current_pixel_pair = *prev_pixel_pair++;
horiz_pred = *current_pixel_pair - *vert_pred;
*vert_pred++ = *current_pixel_pair++;
-
+
}
if (!keyframe) {
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file truemotion2.c
* Duck TrueMotion2 decoder.
*/
-
+
#include "avcodec.h"
#include "common.h"
#include "bitstream.h"
GetBitContext gb;
DSPContext dsp;
-
+
/* TM2 streams */
int *tokens[TM2_NUM_STREAMS];
int tok_lens[TM2_NUM_STREAMS];
int CD[4];
int *last;
int *clast;
-
+
/* data for current and previous frame */
int *Y1, *U1, *V1, *Y2, *U2, *V2;
int cur;
{
TM2Huff huff;
int res = 0;
-
+
huff.val_bits = get_bits(&ctx->gb, 5);
huff.max_bits = get_bits(&ctx->gb, 5);
huff.min_bits = get_bits(&ctx->gb, 5);
huff.nodes = get_bits_long(&ctx->gb, 17);
huff.num = 0;
-
+
/* check for correct codes parameters */
if((huff.val_bits < 1) || (huff.val_bits > 32) ||
(huff.max_bits < 0) || (huff.max_bits > 32)) {
/* one-node tree */
if(huff.max_bits == 0)
huff.max_bits = 1;
-
+
/* allocate space for codes - it is exactly ceil(nodes / 2) entries */
huff.max_num = (huff.nodes + 1) >> 1;
huff.nums = av_mallocz(huff.max_num * sizeof(int));
huff.bits = av_mallocz(huff.max_num * sizeof(uint32_t));
huff.lens = av_mallocz(huff.max_num * sizeof(int));
-
+
if(tm2_read_tree(ctx, 0, 0, &huff) == -1)
res = -1;
-
+
if(huff.num != huff.max_num) {
av_log(ctx->avctx, AV_LOG_ERROR, "Got less codes than expected: %i of %i\n",
huff.num, huff.max_num);
res = -1;
}
-
+
/* convert codes to vlc_table */
if(res != -1) {
int i;
-
+
res = init_vlc(&code->vlc, huff.max_bits, huff.max_num,
huff.lens, sizeof(int), sizeof(int),
huff.bits, sizeof(uint32_t), sizeof(uint32_t), 0);
if(res < 0) {
av_log(ctx->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
res = -1;
- } else
+ } else
res = 0;
if(res != -1) {
code->bits = huff.max_bits;
av_free(huff.nums);
av_free(huff.bits);
av_free(huff.lens);
-
+
return res;
}
uint32_t magic;
uint8_t *obuf;
int length;
-
+
obuf = buf;
-
+
magic = LE_32(buf);
buf += 4;
-
+
if(magic == 0x00000100) { /* old header */
/* av_log (ctx->avctx, AV_LOG_ERROR, "TM2 old header: not implemented (yet)\n"); */
return 40;
} else if(magic == 0x00000101) { /* new header */
int w, h, size, flags, xr, yr;
-
+
length = LE_32(buf);
buf += 4;
-
+
init_get_bits(&ctx->gb, buf, 32 * 8);
size = get_bits_long(&ctx->gb, 31);
h = get_bits(&ctx->gb, 15);
flags = get_bits_long(&ctx->gb, 31);
yr = get_bits(&ctx->gb, 9);
xr = get_bits(&ctx->gb, 9);
-
+
return 40;
} else {
av_log (ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
return -1;
}
-
+
return (buf - obuf);
}
static int tm2_read_deltas(TM2Context *ctx, int stream_id) {
int d, mb;
int i, v;
-
+
d = get_bits(&ctx->gb, 9);
mb = get_bits(&ctx->gb, 5);
-
+
if((d < 1) || (d > TM2_DELTAS) || (mb < 1) || (mb > 32)) {
av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect delta table: %i deltas x %i bits\n", d, mb);
return -1;
}
-
+
for(i = 0; i < d; i++) {
v = get_bits_long(&ctx->gb, mb);
if(v & (1 << (mb - 1)))
}
for(; i < TM2_DELTAS; i++)
ctx->deltas[stream_id][i] = 0;
-
+
return 0;
}
int skip = 0;
int len, toks;
TM2Codes codes;
-
+
/* get stream length in dwords */
len = BE_32(buf); buf += 4; cur += 4;
skip = len * 4 + 4;
-
+
if(len == 0)
return 4;
-
+
toks = BE_32(buf); buf += 4; cur += 4;
if(toks & 1) {
len = BE_32(buf); buf += 4; cur += 4;
}
buf += 4; cur += 4;
buf += 4; cur += 4; /* unused by decoder */
-
+
init_get_bits(&ctx->gb, buf, (skip - cur) * 8);
if(tm2_build_huff_table(ctx, &codes) == -1)
return -1;
buf += ((get_bits_count(&ctx->gb) + 31) >> 5) << 2;
cur += ((get_bits_count(&ctx->gb) + 31) >> 5) << 2;
-
+
toks >>= 1;
/* check if we have sane number of tokens */
if((toks < 0) || (toks > 0xFFFFFF)){
ctx->tokens[stream_id][i] = codes.recode[0];
}
tm2_free_codes(&codes);
-
+
return skip;
}
{
int ct, d;
int i, j;
-
+
for(j = 0; j < 4; j++){
ct = ctx->D[j];
for(i = 0; i < 4; i++){
CD[1] = CD[0] + CD[1] - t;
CD[0] = t;
clast[0] = l;
-
+
tm2_high_chroma(data, stride, clast, CD, deltas);
}
}
tm2_high_chroma(U, Ustride, clast, ctx->CD, deltas);
tm2_high_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas + 4);
-
+
/* hi-res luma */
for(i = 0; i < 16; i++)
deltas[i] = GET_TOK(ctx, TM2_L_HI);
-
+
tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
}
int i;
int deltas[16];
TM2_INIT_POINTERS();
-
+
/* low-res chroma */
deltas[0] = GET_TOK(ctx, TM2_C_LO);
deltas[1] = deltas[2] = deltas[3] = 0;
/* hi-res luma */
for(i = 0; i < 16; i++)
deltas[i] = GET_TOK(ctx, TM2_L_HI);
-
+
tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
}
/* low-res luma */
for(i = 0; i < 16; i++)
deltas[i] = 0;
-
+
deltas[ 0] = GET_TOK(ctx, TM2_L_LO);
deltas[ 2] = GET_TOK(ctx, TM2_L_LO);
deltas[ 8] = GET_TOK(ctx, TM2_L_LO);
deltas[10] = GET_TOK(ctx, TM2_L_LO);
-
+
if(bx > 0)
last[0] = (last[-1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3] + last[1]) >> 1;
else
t2 = ctx->D[2] + ctx->D[3];
ctx->D[2] = t2 >> 1;
ctx->D[3] = t2 - (t2 >> 1);
-
+
tm2_apply_deltas(ctx, Y, Ystride, deltas, last);
}
int left, right, diff;
int deltas[16];
TM2_INIT_POINTERS();
-
+
/* null chroma */
deltas[0] = deltas[1] = deltas[2] = deltas[3] = 0;
tm2_low_chroma(U, Ustride, clast, ctx->CD, deltas, bx);
deltas[0] = deltas[1] = deltas[2] = deltas[3] = 0;
tm2_low_chroma(V, Vstride, clast + 2, ctx->CD + 2, deltas, bx);
-
+
/* null luma */
for(i = 0; i < 16; i++)
deltas[i] = 0;
ct = ctx->D[0] + ctx->D[1] + ctx->D[2] + ctx->D[3];
-
+
if(bx > 0)
left = last[-1] - ct;
else
left = 0;
-
+
right = last[3];
diff = right - left;
last[0] = left + (diff >> 2);
last[3] = right;
{
int tp = left;
-
+
ctx->D[0] = (tp + (ct >> 2)) - left;
left += ctx->D[0];
ctx->D[1] = (tp + (ct >> 1)) - left;
int i, j;
int d;
TM2_INIT_POINTERS_2();
-
+
/* update chroma */
for(j = 0; j < 2; j++){
for(i = 0; i < 2; i++){
mx = GET_TOK(ctx, TM2_MOT);
my = GET_TOK(ctx, TM2_MOT);
-
+
Yo += my * oYstride + mx;
Uo += (my >> 1) * oUstride + (mx >> 1);
Vo += (my >> 1) * oVstride + (mx >> 1);
-
+
/* copy chroma */
for(j = 0; j < 2; j++){
for(i = 0; i < 2; i++){
int keyframe = 1;
uint8_t *Y, *U, *V;
int *src;
-
+
bw = ctx->avctx->width >> 2;
bh = ctx->avctx->height >> 2;
for(i = 0; i < TM2_NUM_STREAMS; i++)
ctx->tok_ptrs[i] = 0;
-
+
if (ctx->tok_lens[TM2_TYPE]<bw*bh){
av_log(ctx->avctx,AV_LOG_ERROR,"Got %i tokens for %i blocks\n",ctx->tok_lens[TM2_TYPE],bw*bh);
return -1;
}
-
+
memset(ctx->last, 0, 4 * bw * sizeof(int));
memset(ctx->clast, 0, 4 * bw * sizeof(int));
}
}
}
-
- /* copy data from our buffer to AVFrame */
+
+ /* copy data from our buffer to AVFrame */
Y = p->data[0];
src = (ctx->cur?ctx->Y2:ctx->Y1);
for(j = 0; j < ctx->avctx->height; j++){
}
V += p->linesize[1];
}
-
+
return keyframe;
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
l->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, buf_size >> 2);
skip = tm2_read_header(l, buf);
-
+
if(skip == -1)
return -1;
-
+
t = tm2_read_stream(l, buf + skip, TM2_C_HI);
if(t == -1)
return -1;
p->pict_type = FF_I_TYPE;
else
p->pict_type = FF_P_TYPE;
-
+
l->cur = !l->cur;
*data_size = sizeof(AVFrame);
*(AVFrame*)data = l->pic;
-
+
return buf_size;
}
av_log(avctx, AV_LOG_ERROR, "Width and height must be multiple of 4\n");
return -1;
}
-
+
l->avctx = avctx;
l->pic.data[0]=NULL;
avctx->has_b_frames = 0;
avctx->pix_fmt = PIX_FMT_YUV420P;
dsputil_init(&l->dsp, avctx);
-
+
l->last = av_malloc(4 * sizeof(int) * (avctx->width >> 2));
l->clast = av_malloc(4 * sizeof(int) * (avctx->width >> 2));
-
+
for(i = 0; i < TM2_NUM_STREAMS; i++) {
l->tokens[i] = NULL;
l->tok_lens[i] = 0;
}
-
+
l->Y1 = av_malloc(sizeof(int) * avctx->width * avctx->height);
l->U1 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
l->V1 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
l->U2 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
l->V2 = av_malloc(sizeof(int) * ((avctx->width + 1) >> 1) * ((avctx->height + 1) >> 1));
l->cur = 0;
-
+
return 0;
}
* and enhanced to bigger color depths
*
*/
-
+
static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
{
unsigned char *src = c->decomp_buf;
unsigned char *output, *output_end;
int p1, p2, line=c->height, pos=0, i;
-
+
output = c->pic.data[0] + (c->height - 1) * c->pic.linesize[0];
output_end = c->pic.data[0] + (c->height) * c->pic.linesize[0];
while(src < c->decomp_buf + srcsize) {
pos += p1;
}
}
-
- av_log(c->avctx, AV_LOG_ERROR, "Camtasia warning: no End-of-picture code\n");
+
+ av_log(c->avctx, AV_LOG_ERROR, "Camtasia warning: no End-of-picture code\n");
return 1;
}
if(zret != Z_DATA_ERROR)
decode_rle(c, c->zstream.avail_out);
-
+
/* make the palette available on the way out */
if (c->avctx->pix_fmt == PIX_FMT_PAL8) {
memcpy(c->pic.data[1], c->avctx->palctrl->palette, AVPALETTE_SIZE);
#ifdef CONFIG_ZLIB
// Needed if zlib unused or init aborted before inflateInit
- memset(&(c->zstream), 0, sizeof(z_stream));
+ memset(&(c->zstream), 0, sizeof(z_stream));
#else
av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
return 1;
break;
case 32: avctx->pix_fmt = PIX_FMT_RGBA32; break;
default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_sample);
- return -1;
+ return -1;
}
c->bpp = avctx->bits_per_sample;
c->decomp_size = (avctx->width * c->bpp + (avctx->width + 254) / 255 + 2) * avctx->height + 2;//RLE in the 'best' case
return 1;
}
}
-
+
#ifdef CONFIG_ZLIB
c->zstream.zalloc = Z_NULL;
c->zstream.zfree = Z_NULL;
*/
/**
- * @file ulti.c
+ * @file ulti.c
* IBM Ultimotion Video Decoder.
*/
-
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
0x9B, 0x9F, 0xA2, 0xA5, 0xA9, 0xAC, 0xB0, 0xB3,
0xB7, 0xBA, 0xBE, 0xC1, 0xC5, 0xC8, 0xCC, 0xCF,
0xD3, 0xD6, 0xDA, 0xDD, 0xE1, 0xE4, 0xE8, 0xEB};
-
+
static uint8_t ulti_chromas[16] =
{ 0x60, 0x67, 0x6D, 0x73, 0x7A, 0x80, 0x86, 0x8D,
0x93, 0x99, 0xA0, 0xA6, 0xAC, 0xB3, 0xB9, 0xC0};
-
+
/* convert Ultimotion YUV block (sixteen 6-bit Y samples and
two 4-bit chroma samples) into standard YUV and put it into frame */
static void ulti_convert_yuv(AVFrame *frame, int x, int y,
{
uint8_t *y_plane, *cr_plane, *cb_plane;
int i;
-
+
y_plane = frame->data[0] + x + y * frame->linesize[0];
cr_plane = frame->data[1] + (x / 4) + (y / 4) * frame->linesize[1];
cb_plane = frame->data[2] + (x / 4) + (y / 4) * frame->linesize[2];
-
+
cr_plane[0] = ulti_chromas[chroma >> 4];
-
+
cb_plane[0] = ulti_chromas[chroma & 0xF];
-
+
for(i = 0; i < 16; i++){
y_plane[i & 3] = ulti_lumas[luma[i]];
if((i & 3) == 3) { //next row
else
Luma[i] = Y0;
}
-
+
for(mask = 0x80, i = 8; mask; mask >>= 1, i++) {
if(f1 & mask)
Luma[i] = Y1;
else
Luma[i] = Y0;
}
-
+
ulti_convert_yuv(frame, x, y, Luma, chroma);
}
Luma[0] = Y[0]; Luma[1] = Y[1]; Luma[2] = Y[2]; Luma[3] = Y[3];
Luma[4] = Y[0]; Luma[5] = Y[1]; Luma[6] = Y[2]; Luma[7] = Y[3];
Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[2]; Luma[11] = Y[3];
- Luma[12] = Y[0]; Luma[13] = Y[1]; Luma[14] = Y[2]; Luma[15] = Y[3];
+ Luma[12] = Y[0]; Luma[13] = Y[1]; Luma[14] = Y[2]; Luma[15] = Y[3];
break;
case 1:
Luma[0] = Y[1]; Luma[1] = Y[2]; Luma[2] = Y[3]; Luma[3] = Y[3];
Luma[4] = Y[0]; Luma[5] = Y[1]; Luma[6] = Y[2]; Luma[7] = Y[3];
Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[2]; Luma[11] = Y[3];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
+ Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
break;
case 2:
Luma[0] = Y[1]; Luma[1] = Y[2]; Luma[2] = Y[3]; Luma[3] = Y[3];
Luma[4] = Y[1]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[3];
Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[2];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
+ Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[1]; Luma[15] = Y[2];
break;
case 3:
Luma[0] = Y[2]; Luma[1] = Y[3]; Luma[2] = Y[3]; Luma[3] = Y[3];
Luma[4] = Y[1]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[3];
Luma[8] = Y[0]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[2];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[1];
+ Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[1];
break;
case 4:
Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[3]; Luma[3] = Y[3];
Luma[4] = Y[2]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[2];
Luma[8] = Y[1]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[1];
- Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
+ Luma[12] = Y[0]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
break;
case 5:
Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[3]; Luma[3] = Y[2];
Luma[4] = Y[3]; Luma[5] = Y[2]; Luma[6] = Y[2]; Luma[7] = Y[1];
Luma[8] = Y[2]; Luma[9] = Y[1]; Luma[10] = Y[1]; Luma[11] = Y[0];
- Luma[12] = Y[1]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
+ Luma[12] = Y[1]; Luma[13] = Y[0]; Luma[14] = Y[0]; Luma[15] = Y[0];
break;
case 6:
Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[2]; Luma[3] = Y[2];
Luma[4] = Y[3]; Luma[5] = Y[2]; Luma[6] = Y[1]; Luma[7] = Y[1];
Luma[8] = Y[2]; Luma[9] = Y[2]; Luma[10] = Y[1]; Luma[11] = Y[0];
- Luma[12] = Y[1]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
+ Luma[12] = Y[1]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
break;
case 7:
Luma[0] = Y[3]; Luma[1] = Y[3]; Luma[2] = Y[2]; Luma[3] = Y[1];
Luma[4] = Y[3]; Luma[5] = Y[2]; Luma[6] = Y[1]; Luma[7] = Y[0];
Luma[8] = Y[3]; Luma[9] = Y[2]; Luma[10] = Y[1]; Luma[11] = Y[0];
- Luma[12] = Y[2]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
+ Luma[12] = Y[2]; Luma[13] = Y[1]; Luma[14] = Y[0]; Luma[15] = Y[0];
break;
default:
Luma[0] = Y[0]; Luma[1] = Y[0]; Luma[2] = Y[1]; Luma[3] = Y[1];
Luma[4] = Y[0]; Luma[5] = Y[0]; Luma[6] = Y[1]; Luma[7] = Y[1];
Luma[8] = Y[2]; Luma[9] = Y[2]; Luma[10] = Y[3]; Luma[11] = Y[3];
- Luma[12] = Y[2]; Luma[13] = Y[2]; Luma[14] = Y[3]; Luma[15] = Y[3];
+ Luma[12] = Y[2]; Luma[13] = Y[2]; Luma[14] = Y[3]; Luma[15] = Y[3];
break;
}
-
+
ulti_convert_yuv(frame, x, y, Luma, chroma);
}
-static int ulti_decode_frame(AVCodecContext *avctx,
+static int ulti_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
-
+
while(!done) {
int idx;
if(blocks >= s->blocks || y >= s->height)
break;//all blocks decoded
-
+
idx = *buf++;
if((idx & 0xF8) == 0x70) {
switch(idx) {
break;
default:
av_log(avctx, AV_LOG_INFO, "warning: unknown escape 0x%02X\n", idx);
- }
+ }
} else { //handle one block
int code;
int cf;
tx = x + block_coords[i * 2];
ty = y + block_coords[(i * 2) + 1];
switch(code) {
- case 1:
+ case 1:
tmp = *buf++;
-
+
angle = angle_by_index[(tmp >> 6) & 0x3];
-
+
Y[0] = tmp & 0x3F;
Y[1] = Y[0];
-
+
if (angle) {
Y[2] = Y[0]+1;
if (Y[2] > 0x3F)
Y[2] = 0x3F;
- Y[3] = Y[2];
+ Y[3] = Y[2];
} else {
Y[2] = Y[0];
Y[3] = Y[0];
}
break;
-
+
case 2:
if (modifier) { // unpack four luma samples
tmp = (*buf++) << 16;
tmp += (*buf++) << 8;
tmp += *buf++;
-
+
Y[0] = (tmp >> 18) & 0x3F;
Y[1] = (tmp >> 12) & 0x3F;
Y[2] = (tmp >> 6) & 0x3F;
} else { // retrieve luma samples from codebook
tmp = (*buf++) << 8;
tmp += (*buf++);
-
+
angle = (tmp >> 12) & 0xF;
tmp &= 0xFFF;
tmp <<= 2;
Y[3] = s->ulti_codebook[tmp + 3];
}
break;
-
+
case 3:
if (modifier) { // all 16 luma samples
uint8_t Luma[16];
-
+
tmp = (*buf++) << 16;
tmp += (*buf++) << 8;
tmp += *buf++;
Luma[1] = (tmp >> 12) & 0x3F;
Luma[2] = (tmp >> 6) & 0x3F;
Luma[3] = tmp & 0x3F;
-
+
tmp = (*buf++) << 16;
tmp += (*buf++) << 8;
tmp += *buf++;
Luma[5] = (tmp >> 12) & 0x3F;
Luma[6] = (tmp >> 6) & 0x3F;
Luma[7] = tmp & 0x3F;
-
+
tmp = (*buf++) << 16;
tmp += (*buf++) << 8;
tmp += *buf++;
Luma[9] = (tmp >> 12) & 0x3F;
Luma[10] = (tmp >> 6) & 0x3F;
Luma[11] = tmp & 0x3F;
-
+
tmp = (*buf++) << 16;
tmp += (*buf++) << 8;
tmp += *buf++;
Luma[13] = (tmp >> 12) & 0x3F;
Luma[14] = (tmp >> 6) & 0x3F;
Luma[15] = tmp & 0x3F;
-
+
ulti_convert_yuv(&s->frame, tx, ty, Luma, chroma);
} else {
tmp = *buf++;
}
}
}
-
+
*data_size=sizeof(AVFrame);
*(AVFrame*)data= s->frame;
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file utils.c
* utils.
*/
-
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
void *av_mallocz(unsigned int size)
{
void *ptr;
-
+
ptr = av_malloc(size);
if (!ptr)
return NULL;
*/
void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size)
{
- if(min_size < *size)
+ if(min_size < *size)
return ptr;
-
+
*size= FFMAX(17*min_size/16 + 32, min_size);
return av_realloc(ptr, *size);
{
void *ptr = av_mallocz(size);
- if(ptr){
+ if(ptr){
array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));
if(!array_static)
return NULL;
#define ALIGN(x, a) (((x)+(a)-1)&~((a)-1))
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
- int w_align= 1;
- int h_align= 1;
-
+ int w_align= 1;
+ int h_align= 1;
+
switch(s->pix_fmt){
case PIX_FMT_YUV420P:
case PIX_FMT_YUV422:
int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4)
return 0;
-
+
av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
return -1;
}
}
#if 0
s->internal_buffer= av_fast_realloc(
- s->internal_buffer,
- &s->internal_buffer_size,
+ s->internal_buffer,
+ &s->internal_buffer_size,
sizeof(InternalBuffer)*FFMAX(99, s->internal_buffer_count+1)/*FIXME*/
);
#endif
-
+
buf= &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
picture_number= &(((InternalBuffer*)s->internal_buffer)[INTERNAL_BUFFER_SIZE-1]).last_pic_num; //FIXME ugly hack
(*picture_number)++;
-
+
if(buf->base[0]){
pic->age= *picture_number - buf->last_pic_num;
buf->last_pic_num= *picture_number;
avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
avcodec_align_dimensions(s, &w, &h);
-
+
if(!(s->flags&CODEC_FLAG_EMU_EDGE)){
w+= EDGE_WIDTH*2;
h+= EDGE_WIDTH*2;
memset(buf->base[i], 128, size[i]);
// no edge if EDEG EMU or not planar YUV, we check for PAL8 redundantly to protect against a exploitable bug regression ...
- if((s->flags&CODEC_FLAG_EMU_EDGE) || (s->pix_fmt == PIX_FMT_PAL8) || !size[2])
+ if((s->flags&CODEC_FLAG_EMU_EDGE) || (s->pix_fmt == PIX_FMT_PAL8) || !size[2])
buf->data[i] = buf->base[i];
else
buf->data[i] = buf->base[i] + ALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), STRIDE_ALIGN);
AVCodecContext *avc= ptr;
if(avc && avc->codec && avc->codec->name)
- return avc->codec->name;
+ return avc->codec->name;
else
return "NULL";
}
#define V AV_OPT_FLAG_VIDEO_PARAM
#define A AV_OPT_FLAG_AUDIO_PARAM
#define S AV_OPT_FLAG_SUBTITLE_PARAM
-#define E AV_OPT_FLAG_ENCODING_PARAM
+#define E AV_OPT_FLAG_ENCODING_PARAM
#define D AV_OPT_FLAG_DECODING_PARAM
static AVOption options[]={
s->pix_fmt= PIX_FMT_NONE;
s->frame_skip_cmp= FF_CMP_DCTMAX;
s->nsse_weight= 8;
-
+
s->intra_quant_bias= FF_DEFAULT_QUANT_BIAS;
s->inter_quant_bias= FF_DEFAULT_QUANT_BIAS;
s->palctrl = NULL;
/**
* allocates a AVCodecContext and set it to defaults.
- * this can be deallocated by simply calling free()
+ * this can be deallocated by simply calling free()
*/
AVCodecContext *avcodec_alloc_context(void){
AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
-
+
if(avctx==NULL) return NULL;
-
+
avcodec_get_context_defaults(avctx);
-
+
return avctx;
}
/**
* allocates a AVPFrame and set it to defaults.
- * this can be deallocated by simply calling free()
+ * this can be deallocated by simply calling free()
*/
AVFrame *avcodec_alloc_frame(void){
AVFrame *pic= av_malloc(sizeof(AVFrame));
-
+
if(pic==NULL) return NULL;
-
+
avcodec_get_frame_defaults(pic);
-
+
return pic;
}
int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
{
int ret= -1;
-
+
entangled_thread_counter++;
if(entangled_thread_counter != 1){
av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
avctx->frame_number = 0;
if (codec->priv_data_size > 0) {
avctx->priv_data = av_mallocz(codec->priv_data_size);
- if (!avctx->priv_data)
+ if (!avctx->priv_data)
goto end;
} else {
avctx->priv_data = NULL;
return ret;
}
-int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const short *samples)
{
if(buf_size < FF_MIN_BUFFER_SIZE && 0){
return 0;
}
-int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVFrame *pict)
{
if(buf_size < FF_MIN_BUFFER_SIZE){
int ret = avctx->codec->encode(avctx, buf, buf_size, (void *)pict);
avctx->frame_number++;
emms_c(); //needed to avoid an emms_c() call before every return;
-
+
return ret;
}else
return 0;
}
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVSubtitle *sub)
{
int ret;
return ret;
}
-/**
- * decode a frame.
+/**
+ * decode a frame.
* @param buf bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE larger then the actual read bytes
* because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
* @param buf_size the size of the buffer in bytes
* @param got_picture_ptr zero if no frame could be decompressed, Otherwise, it is non zero
* @return -1 if error, otherwise return the number of
- * bytes used.
+ * bytes used.
*/
-int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
+int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
uint8_t *buf, int buf_size)
{
int ret;
-
+
*got_picture_ptr= 0;
if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
return -1;
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
- ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
+ ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
buf, buf_size);
emms_c(); //needed to avoid an emms_c() call before every return;
-
- if (*got_picture_ptr)
+
+ if (*got_picture_ptr)
avctx->frame_number++;
}else
ret= 0;
*number of bytes used. If no frame could be decompressed,
*frame_size_ptr is zero. Otherwise, it is the decompressed frame
*size in BYTES. */
-int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
+int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
uint8_t *buf, int buf_size)
{
*frame_size_ptr= 0;
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
- ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
+ ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
buf, buf_size);
avctx->frame_number++;
}else
int ret;
*got_sub_ptr = 0;
- ret = avctx->codec->decode(avctx, sub, got_sub_ptr,
+ ret = avctx->codec->decode(avctx, sub, got_sub_ptr,
(uint8_t *)buf, buf_size);
if (*got_sub_ptr)
avctx->frame_number++;
codec_name = enc->codec_name;
} else {
/* output avi tags */
- if( isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF)
+ if( isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF)
&& isprint((enc->codec_tag>>16)&0xFF) && isprint((enc->codec_tag>>24)&0xFF)){
- snprintf(buf1, sizeof(buf1), "%c%c%c%c / 0x%04X",
+ snprintf(buf1, sizeof(buf1), "%c%c%c%c / 0x%04X",
enc->codec_tag & 0xff,
(enc->codec_tag >> 8) & 0xff,
(enc->codec_tag >> 16) & 0xff,
enc->sample_rate,
channels_str);
}
-
+
/* for PCM codecs, compute bitrate directly */
switch(enc->codec_id) {
case CODEC_ID_PCM_S32LE:
", pass 2");
}
if (bitrate != 0) {
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %d kb/s", bitrate / 1000);
}
}
int i, j;
if(s->internal_buffer==NULL) return;
-
+
for(i=0; i<INTERNAL_BUFFER_SIZE; i++){
InternalBuffer *buf= &((InternalBuffer*)s->internal_buffer)[i];
for(j=0; j<4; j++){
}
}
av_freep(&s->internal_buffer);
-
+
s->internal_buffer_count=0;
}
char av_get_pict_type_char(int pict_type){
switch(pict_type){
- case I_TYPE: return 'I';
- case P_TYPE: return 'P';
- case B_TYPE: return 'B';
- case S_TYPE: return 'S';
- case SI_TYPE:return 'i';
- case SP_TYPE:return 'p';
+ case I_TYPE: return 'I';
+ case P_TYPE: return 'P';
+ case B_TYPE: return 'B';
+ case S_TYPE: return 'S';
+ case SI_TYPE:return 'i';
+ case SP_TYPE:return 'p';
default: return '?';
}
}
fprintf(stderr, "[%s @ %p]", avc->item_name(ptr), avc);
}
#define fprintf please_use_av_log
-
+
print_prefix= strstr(fmt, "\n") != NULL;
-
+
vfprintf(stderr, fmt, vl);
}
*/
//@{
int profile; ///< 2bits, Profile
- int frmrtq_postproc; ///< 3bits,
+ int frmrtq_postproc; ///< 3bits,
int bitrtq_postproc; ///< 5bits, quantized framerate-based postprocessing strength
int fastuvmc; ///< Rounding of qpel vector to hpel ? (not in Simple)
int extended_mv; ///< Ext MV in P/B (not in Simple)
}
#endif
-/**
+/**
* Decode Simple/Main Profiles sequence header
* @see Figure 7-8, p16-17
* @param avctx Codec context
if (!bp || bp->width<0 || bp->height<0) return -1;
bp->data = (uint8_t*)av_malloc(width*height);
if (!bp->data) return -1;
- bp->width = bp->stride = width;
+ bp->width = bp->stride = width;
bp->height = height;
return 0;
}
if (!get_bits(gb, 1)) //rowskip
memset(plane, 0, width);
else
- for (x=0; x<width; x++)
+ for (x=0; x<width; x++)
plane[x] = get_bits(gb, 1);
plane += stride;
}
}
/***********************************************************************/
-/**
+/**
* @defgroup all_frame_hdr All VC9 profiles frame header
* @brief Part of the frame header decoding from all profiles
* @warning Only pro/epilog differs between Simple/Main and Advanced => check caller
/***********************************************************************/
-/**
+/**
* @defgroup std_frame_hdr VC9 Simple/Main Profiles header decoding
* @brief Part of the frame header decoding belonging to Simple/Main Profiles
* @warning Only pro/epilog differs between Simple/Main and Advanced =>
#if HAS_ADVANCED_PROFILE
/***********************************************************************/
-/**
+/**
* @defgroup adv_frame_hdr VC9 Advanced Profile header decoding
* @brief Part of the frame header decoding belonging to Advanced Profiles
* @warning Only pro/epilog differs between Simple/Main and Advanced =>
* check caller
* @{
*/
-/** Frame header decoding, primary part
+/** Frame header decoding, primary part
* @param v VC9 context
* @return Status
*/
case P_TYPE: status = decode_p_picture_secondary_header(v); break;
case B_TYPE: status = decode_b_picture_secondary_header(v); break;
case BI_TYPE:
- case I_TYPE: status = decode_i_picture_secondary_header(v); break;
+ case I_TYPE: status = decode_i_picture_secondary_header(v); break;
}
if (status<0) return FRAME_SKIPPED;
/** @} */ //End for adv_frame_hdr
/***********************************************************************/
-/**
+/**
* @defgroup block VC9 Block-level functions
* @see 7.1.4, p91 and 8.1.1.7, p(1)04
* @todo TODO: Integrate to MpegEncContext facilities
int a, b, c, wrap, pred, scale;
int16_t *dc_val;
static const uint16_t dcpred[31] = {
- 1024, 512, 341, 256, 205, 171, 146, 128,
- 114, 102, 93, 85, 79, 73, 68, 64,
- 60, 57, 54, 51, 49, 47, 45, 43,
+ 1024, 512, 341, 256, 205, 171, 146, 128,
+ 114, 102, 93, 85, 79, 73, 68, 64,
+ 60, 57, 54, 51, 49, 47, 45, 43,
41, 39, 38, 37, 35, 34, 33
};
dc_val= s->dc_val[0] + s->block_index[n];
/* B C
- * A X
+ * A X
*/
a = dc_val[ - 1];
b = dc_val[ - 1 - wrap];
c = dc_val[ - wrap];
/* XXX: Rule B is used only for I and BI frames in S/M/C profile
- * with overlap filtering off
+ * with overlap filtering off
*/
if ((s->pict_type == I_TYPE || s->pict_type == BI_TYPE) &&
1 /* XXX: overlap filtering off */)
/** @} */ //End for group block
/***********************************************************************/
-/**
+/**
* @defgroup std_mb VC9 Macroblock-level functions in Simple/Main Profiles
* @see 7.1.4, p91 and 8.1.1.7, p(1)04
* @todo TODO: Integrate to MpegEncContext facilities
wrap = s->b8_stride;
/* B C
- * A X
+ * A X
*/
a = s->coded_block[xy - 1 ];
b = s->coded_block[xy - 1 - wrap];
int i, mb_offset = s->mb_x + s->mb_y*s->mb_width; /* XXX: mb_stride */
int cbp; /* cbp decoding stuff */
int hybrid_pred; /* Prediction types */
- int mv_mode_bit = 0;
+ int mv_mode_bit = 0;
int mqdiff, mquant; /* MB quantization */
int ttmb; /* MB Transform type */
int status;
#if HAS_ADVANCED_PROFILE
/***********************************************************************/
-/**
+/**
* @defgroup adv_mb VC9 Macroblock-level functions in Advanced Profile
* @todo TODO: Integrate to MpegEncContext facilities
* @todo TODO: Code P, B and BI
if (scp != 0x000001)
break; // eof ?
- scs = buf[i++];
+ scs = buf[i++];
init_get_bits(gb, buf+i, (buf_size-i)*8);
};
static const uint16_t vc9_norm6_codes[64] = {
-0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E,
-0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037,
-0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036,
-0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007,
+0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E,
+0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037,
+0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036,
+0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007,
};
static const uint8_t vc9_norm6_bits[64] = {
- 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13,
- 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
- 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
+ 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13,
+ 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
+ 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
8, 10, 10, 13, 10, 13, 13, 9, 10, 13, 13, 9, 13, 9, 9, 6,
};
/* Normal-6 imode */
11, 9, 7,
11
}
-};
+};
/* TTBLK (Transform Type per Block) tables */
static const uint8_t vc9_ttblk_codes[3][8] = {
14, 14, 14, 14, 2, 3, 6, 8, 8, 6, 3, 4, 6, 8, 6, 9,
6, 6, 6, 8, 8, 8, 14, 7, 7, 8, 7, 9, 13, 9, 8, 9,
13, 9, 13, 13, 13, 13, 13, 13, 5 /* 73 elements */
-
+
},
{
3, 12, 12, 12, 12, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11,
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file vcr1.c
* ati vcr1 codec.
*/
-
+
#include "avcodec.h"
#include "mpegvideo.h"
int offset[4];
} VCR1Context;
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
a->delta[i]= *(bytestream++);
bytestream++;
}
-
+
for(y=0; y<avctx->height; y++){
int offset;
uint8_t *luma= &a->picture.data[0][ y*a->picture.linesize[0] ];
luma[2]=( offset += a->delta[ bytestream[0]&0xF ]);
luma[3]=( offset += a->delta[ bytestream[0]>>4 ]);
luma += 4;
-
+
*(cb++) = bytestream[3];
*(cr++) = bytestream[1];
-
+
bytestream+= 4;
}
}else{
*data_size = sizeof(AVPicture);
emms_c();
-
+
return buf_size;
}
p->key_frame= 1;
emms_c();
-
+
align_put_bits(&a->pb);
while(get_bit_count(&a->pb)&31)
put_bits(&a->pb, 8, 0);
-
+
size= get_bit_count(&a->pb)/32;
-
+
return size*4;
}
#endif
}
static int decode_init(AVCodecContext *avctx){
-
+
common_init(avctx);
-
+
avctx->pix_fmt= PIX_FMT_YUV410P;
return 0;
#if 0
static int encode_init(AVCodecContext *avctx){
-
+
common_init(avctx);
-
+
return 0;
}
#endif
* The video decoder outputs PAL8 colorspace data. The decoder expects
* a 0x330-byte VMD file header to be transmitted via extradata during
* codec initialization. Each encoded frame that is sent to this decoder
- * is expected to be prepended with the appropriate 16-byte frame
+ * is expected to be prepended with the appropriate 16-byte frame
* information record from the VMD file.
*
* The audio decoder, like the video decoder, expects each encoded data
}
}
-static int rle_unpack(unsigned char *src, unsigned char *dest,
+static int rle_unpack(unsigned char *src, unsigned char *dest,
int src_len, int dest_len)
{
unsigned char *ps;
if (frame_x || frame_y || (frame_width != s->avctx->width) ||
(frame_height != s->avctx->height)) {
- memcpy(s->frame.data[0], s->prev_frame.data[0],
+ memcpy(s->frame.data[0], s->prev_frame.data[0],
s->avctx->height * s->frame.linesize[0]);
}
/* make sure the VMD header made it */
if (s->avctx->extradata_size != VMD_HEADER_SIZE) {
- av_log(s->avctx, AV_LOG_ERROR, "VMD video: expected extradata size of %d\n",
+ av_log(s->avctx, AV_LOG_ERROR, "VMD video: expected extradata size of %d\n",
VMD_HEADER_SIZE);
return -1;
}
else codebook_setup->nb_bits=V_NB_BITS;
codebook_setup->maxdepth=(codebook_setup->maxdepth+codebook_setup->nb_bits-1)/codebook_setup->nb_bits;
-
+
if (init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits, entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits), sizeof(*tmp_vlc_bits), tmp_vlc_codes, sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes), INIT_VLC_LE)) {
av_log(vc->avccontext, AV_LOG_ERROR, " Error generating vlc tables. \n");
goto error;
#define FRAGMENT_PIXELS 8
-/*
+/*
* Debugging Variables
- *
+ *
* Define one or more of the following compile-time variables to 1 to obtain
* elaborate information about certain aspects of the decoding process.
*
#if DEBUG_DEQUANTIZERS
#define debug_dequantizers(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_dequantizers(const char *format, ...) { }
+static inline void debug_dequantizers(const char *format, ...) { }
#endif
#if DEBUG_BLOCK_CODING
#define debug_block_coding(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_block_coding(const char *format, ...) { }
+static inline void debug_block_coding(const char *format, ...) { }
#endif
#if DEBUG_MODES
-#define debug_modes(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
+#define debug_modes(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_modes(const char *format, ...) { }
+static inline void debug_modes(const char *format, ...) { }
#endif
#if DEBUG_VECTORS
#define debug_vectors(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_vectors(const char *format, ...) { }
+static inline void debug_vectors(const char *format, ...) { }
#endif
-#if DEBUG_TOKEN
+#if DEBUG_TOKEN
#define debug_token(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_token(const char *format, ...) { }
+static inline void debug_token(const char *format, ...) { }
#endif
#if DEBUG_VLC
#define debug_vlc(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_vlc(const char *format, ...) { }
+static inline void debug_vlc(const char *format, ...) { }
#endif
#if DEBUG_DC_PRED
#define debug_dc_pred(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_dc_pred(const char *format, ...) { }
+static inline void debug_dc_pred(const char *format, ...) { }
#endif
#if DEBUG_IDCT
#define debug_idct(args...) av_log(NULL, AV_LOG_DEBUG, ## args)
#else
-static inline void debug_idct(const char *format, ...) { }
+static inline void debug_idct(const char *format, ...) { }
#endif
typedef struct Coeff {
{ 0, 0, 0, 0, 0, 0, 0, 0 },
/* scheme 1: Last motion vector dominates */
- { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
+ { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
MODE_INTER_PLUS_MV, MODE_INTER_NO_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_INTRA, MODE_USING_GOLDEN,
MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 2 */
- { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
+ { MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
MODE_INTER_NO_MV, MODE_INTER_PLUS_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_INTRA, MODE_USING_GOLDEN,
MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 3 */
- { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
+ { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
MODE_INTER_PRIOR_LAST, MODE_INTER_NO_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_INTRA, MODE_USING_GOLDEN,
MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 4 */
- { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
+ { MODE_INTER_LAST_MV, MODE_INTER_PLUS_MV,
MODE_INTER_NO_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_INTRA, MODE_USING_GOLDEN,
MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 5: No motion vector dominates */
- { MODE_INTER_NO_MV, MODE_INTER_LAST_MV,
+ { MODE_INTER_NO_MV, MODE_INTER_LAST_MV,
MODE_INTER_PRIOR_LAST, MODE_INTER_PLUS_MV,
- MODE_INTRA, MODE_USING_GOLDEN,
+ MODE_INTRA, MODE_USING_GOLDEN,
MODE_GOLDEN_MV, MODE_INTER_FOURMV },
/* scheme 6 */
- { MODE_INTER_NO_MV, MODE_USING_GOLDEN,
+ { MODE_INTER_NO_MV, MODE_USING_GOLDEN,
MODE_INTER_LAST_MV, MODE_INTER_PRIOR_LAST,
- MODE_INTER_PLUS_MV, MODE_INTRA,
+ MODE_INTER_PLUS_MV, MODE_INTRA,
MODE_GOLDEN_MV, MODE_INTER_FOURMV },
};
Coeff *next_coeff;
int u_fragment_start;
int v_fragment_start;
-
+
ScanTable scantable;
-
+
/* tables */
uint16_t coded_dc_scale_factor[64];
uint32_t coded_ac_scale_factor[64];
* numbers corresponds to the fragment indices 0..5 which comprise
* the macroblock (4 Y fragments and 2 C fragments). */
int *macroblock_fragments;
- /* This is an array that indicates how a particular macroblock
+ /* This is an array that indicates how a particular macroblock
* is coded. */
unsigned char *macroblock_coding;
*
* Returns 0 is successful; returns 1 if *anything* went wrong.
*/
-static int init_block_mapping(Vp3DecodeContext *s)
+static int init_block_mapping(Vp3DecodeContext *s)
{
int i, j;
signed int hilbert_walk_y[16];
int c_fragment;
signed char travel_width[16] = {
- 1, 1, 0, -1,
+ 1, 1, 0, -1,
0, 0, 1, 0,
1, 0, 1, 0,
0, -1, 0, 1
bottom_edge = s->fragment_height;
current_width = -1;
current_height = 0;
- superblock_row_inc = 3 * s->fragment_width -
+ superblock_row_inc = 3 * s->fragment_width -
(s->y_superblock_width * 4 - s->fragment_width);
hilbert = hilbert_walk_y;
bottom_edge = s->fragment_height / 2;
current_width = -1;
current_height = 0;
- superblock_row_inc = 3 * (s->fragment_width / 2) -
+ superblock_row_inc = 3 * (s->fragment_width / 2) -
(s->c_superblock_width * 4 - s->fragment_width / 2);
hilbert = hilbert_walk_c;
bottom_edge = s->fragment_height / 2;
current_width = -1;
current_height = 0;
- superblock_row_inc = 3 * (s->fragment_width / 2) -
+ superblock_row_inc = 3 * (s->fragment_width / 2) -
(s->c_superblock_width * 4 - s->fragment_width / 2);
hilbert = hilbert_walk_c;
if ((current_width < right_edge) &&
(current_height < bottom_edge)) {
s->superblock_fragments[mapping_index] = current_fragment;
- debug_init(" mapping fragment %d to superblock %d, position %d (%d/%d x %d/%d)\n",
+ debug_init(" mapping fragment %d to superblock %d, position %d (%d/%d x %d/%d)\n",
s->superblock_fragments[mapping_index], i, j,
current_width, right_edge, current_height, bottom_edge);
} else {
s->superblock_fragments[mapping_index] = -1;
- debug_init(" superblock %d, position %d has no fragment (%d/%d x %d/%d)\n",
+ debug_init(" superblock %d, position %d has no fragment (%d/%d x %d/%d)\n",
i, j,
current_width, right_edge, current_height, bottom_edge);
}
s->macroblock_fragments[mapping_index++] = -1;
if (i + 1 < s->fragment_height) {
- s->all_fragments[current_fragment + s->fragment_width].macroblock =
+ s->all_fragments[current_fragment + s->fragment_width].macroblock =
current_macroblock;
- s->macroblock_fragments[mapping_index++] =
+ s->macroblock_fragments[mapping_index++] =
current_fragment + s->fragment_width;
debug_init("%d ", current_fragment + s->fragment_width);
} else
s->macroblock_fragments[mapping_index++] = -1;
if ((j + 1 < s->fragment_width) && (i + 1 < s->fragment_height)) {
- s->all_fragments[current_fragment + s->fragment_width + 1].macroblock =
+ s->all_fragments[current_fragment + s->fragment_width + 1].macroblock =
current_macroblock;
- s->macroblock_fragments[mapping_index++] =
+ s->macroblock_fragments[mapping_index++] =
current_fragment + s->fragment_width + 1;
debug_init("%d ", current_fragment + s->fragment_width + 1);
} else
s->macroblock_fragments[mapping_index++] = -1;
/* C planes */
- c_fragment = s->u_fragment_start +
+ c_fragment = s->u_fragment_start +
(i * s->fragment_width / 4) + (j / 2);
s->all_fragments[c_fragment].macroblock = s->macroblock_count;
s->macroblock_fragments[mapping_index++] = c_fragment;
debug_init("%d ", c_fragment);
- c_fragment = s->v_fragment_start +
+ c_fragment = s->v_fragment_start +
(i * s->fragment_width / 4) + (j / 2);
s->all_fragments[c_fragment].macroblock = s->macroblock_count;
s->macroblock_fragments[mapping_index++] = c_fragment;
if (j + 2 <= s->fragment_width)
current_fragment += 2;
- else
+ else
current_fragment++;
current_macroblock++;
}
debug_vp3(" vp3: initializing dequantization tables\n");
- /*
+ /*
* Scale dequantizers:
*
* quantizer * sf
s->inter_dequant[j] = MIN_DEQUANT_VAL * 2;
s->inter_dequant[j] *= SCALER;
}
-
+
memset(s->qscale_table, (FFMAX(s->intra_y_dequant[1], s->intra_c_dequant[1])+8)/16, 512); //FIXME finetune
/* print debug information as requested */
}
/*
- * This function unpacks all of the superblock/macroblock/fragment coding
+ * This function unpacks all of the superblock/macroblock/fragment coding
* information from the bitstream.
*/
static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
/* unpack the list of partially-coded superblocks */
bit = get_bits(gb, 1);
- /* toggle the bit because as soon as the first run length is
+ /* toggle the bit because as soon as the first run length is
* fetched the bit will be toggled again */
bit ^= 1;
while (current_superblock < s->superblock_count) {
if (current_run-- == 0) {
bit ^= 1;
- current_run = get_vlc2(gb,
+ current_run = get_vlc2(gb,
s->superblock_run_length_vlc.table, 6, 2);
if (current_run == 33)
current_run += get_bits(gb, 12);
current_superblock = 0;
current_run = 0;
bit = get_bits(gb, 1);
- /* toggle the bit because as soon as the first run length is
+ /* toggle the bit because as soon as the first run length is
* fetched the bit will be toggled again */
bit ^= 1;
while (current_superblock < s->superblock_count) {
if (current_run-- == 0) {
bit ^= 1;
- current_run = get_vlc2(gb,
+ current_run = get_vlc2(gb,
s->superblock_run_length_vlc.table, 6, 2);
if (current_run == 33)
current_run += get_bits(gb, 12);
current_run = 0;
bit = get_bits(gb, 1);
- /* toggle the bit because as soon as the first run length is
+ /* toggle the bit because as soon as the first run length is
* fetched the bit will be toggled again */
bit ^= 1;
}
if (s->superblock_coding[i] == SB_NOT_CODED) {
/* copy all the fragments from the prior frame */
- s->all_fragments[current_fragment].coding_method =
+ s->all_fragments[current_fragment].coding_method =
MODE_COPY;
} else if (s->superblock_coding[i] == SB_PARTIALLY_CODED) {
* that cares about the fragment coding runs */
if (current_run-- == 0) {
bit ^= 1;
- current_run = get_vlc2(gb,
+ current_run = get_vlc2(gb,
s->fragment_run_length_vlc.table, 5, 2);
}
if (bit) {
- /* default mode; actual mode will be decoded in
+ /* default mode; actual mode will be decoded in
* the next phase */
- s->all_fragments[current_fragment].coding_method =
+ s->all_fragments[current_fragment].coding_method =
MODE_INTER_NO_MV;
s->all_fragments[current_fragment].next_coeff= s->coeffs + current_fragment;
- s->coded_fragment_list[s->coded_fragment_list_index] =
+ s->coded_fragment_list[s->coded_fragment_list_index] =
current_fragment;
if ((current_fragment >= s->u_fragment_start) &&
(s->last_coded_y_fragment == -1) &&
/* fragments are fully coded in this superblock; actual
* coding will be determined in next step */
- s->all_fragments[current_fragment].coding_method =
+ s->all_fragments[current_fragment].coding_method =
MODE_INTER_NO_MV;
s->all_fragments[current_fragment].next_coeff= s->coeffs + current_fragment;
- s->coded_fragment_list[s->coded_fragment_list_index] =
+ s->coded_fragment_list[s->coded_fragment_list_index] =
current_fragment;
if ((current_fragment >= s->u_fragment_start) &&
(s->last_coded_y_fragment == -1) &&
if (!first_c_fragment_seen)
/* only Y fragments coded in this frame */
s->last_coded_y_fragment = s->coded_fragment_list_index - 1;
- else
+ else
/* end the list of coded C fragments */
s->last_coded_c_fragment = s->coded_fragment_list_index - 1;
}
for (i = 0; i < 8; i++)
- debug_modes(" mode[%d][%d] = %d\n", scheme, i,
+ debug_modes(" mode[%d][%d] = %d\n", scheme, i,
ModeAlphabet[scheme][i]);
/* iterate through all of the macroblocks that contain 1 or more
s->macroblock_coding[current_macroblock] = coding_mode;
for (k = 0; k < 6; k++) {
- current_fragment =
+ current_fragment =
s->macroblock_fragments[current_macroblock * 6 + k];
if (current_fragment == -1)
continue;
current_fragment, s->fragment_count);
return 1;
}
- if (s->all_fragments[current_fragment].coding_method !=
+ if (s->all_fragments[current_fragment].coding_method !=
MODE_COPY)
s->all_fragments[current_fragment].coding_method =
coding_mode;
motion_y[4] += motion_y[k];
}
- if (motion_x[4] >= 0)
+ if (motion_x[4] >= 0)
motion_x[4] = (motion_x[4] + 2) / 4;
else
motion_x[4] = (motion_x[4] - 2) / 4;
motion_x[5] = motion_x[4];
- if (motion_y[4] >= 0)
+ if (motion_y[4] >= 0)
motion_y[4] = (motion_y[4] + 2) / 4;
else
motion_y[4] = (motion_y[4] - 2) / 4;
current_fragment,
s->macroblock_coding[current_macroblock]);
for (k = 0; k < 6; k++) {
- current_fragment =
+ current_fragment =
s->macroblock_fragments[current_macroblock * 6 + k];
if (current_fragment == -1)
continue;
return 0;
}
-/*
+/*
* This function is called by unpack_dct_coeffs() to extract the VLCs from
* the bitstream. The VLCs encode tokens which are used to unpack DCT
* data. This function unpacks all the VLCs for either the Y plane or both
s->coded_fragment_list[i], fragment->next_coeff[coeff_index]);
} else {
fragment->coeff_count |= 128;
- debug_vlc(" fragment %d eob with %d coefficients\n",
+ debug_vlc(" fragment %d eob with %d coefficients\n",
s->coded_fragment_list[i], fragment->coeff_count&127);
eob_run--;
}
/* unpack the Y plane DC coefficients */
debug_vp3(" vp3: unpacking Y plane DC coefficients using table %d\n",
dc_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0,
+ residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0,
s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
/* unpack the C plane DC coefficients */
debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_y_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_y_table], i,
s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_c_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_c_table], i,
s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
}
debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_y_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_y_table], i,
s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_c_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_c_table], i,
s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
}
debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_y_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_y_table], i,
s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_c_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_c_table], i,
s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
}
debug_vp3(" vp3: unpacking level %d Y plane AC coefficients using table %d\n",
i, ac_y_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_y_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_y_table], i,
s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);
debug_vp3(" vp3: unpacking level %d C plane AC coefficients using table %d\n",
i, ac_c_table);
- residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_c_table], i,
+ residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_c_table], i,
s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);
}
/*
* This function reverses the DC prediction for each coded fragment in
- * the frame. Much of this function is adapted directly from the original
+ * the frame. Much of this function is adapted directly from the original
* VP3 source code.
*/
#define COMPATIBLE_FRAME(x) \
static void reverse_dc_prediction(Vp3DecodeContext *s,
int first_fragment,
int fragment_width,
- int fragment_height)
+ int fragment_height)
{
#define PUL 8
* 10000000004
* 10000000004
*
- * Note: Groups 5 and 7 do not exist as it would mean that the
+ * Note: Groups 5 and 7 do not exist as it would mean that the
* fragment's x coordinate is both 0 and (width - 1) at the same time.
*/
int predictor_group;
/* indices for the left, up-left, up, and up-right fragments */
int l, ul, u, ur;
- /*
+ /*
* The 6 fields mean:
* 0: up-left multiplier
* 1: up multiplier
/* This table shows which types of blocks can use other blocks for
* prediction. For example, INTRA is the only mode in this table to
* have a frame number of 0. That means INTRA blocks can only predict
- * from other INTRA blocks. There are 2 golden frame coding types;
+ * from other INTRA blocks. There are 2 golden frame coding types;
* blocks encoding in these modes can only predict from other blocks
* that were encoded with these 1 of these 2 modes. */
unsigned char compatible_frame[8] = {
/* reverse prediction if this block was coded */
if (s->all_fragments[i].coding_method != MODE_COPY) {
- current_frame_type =
+ current_frame_type =
compatible_frame[s->all_fragments[i].coding_method];
predictor_group = (x == 0) + ((y == 0) << 1) +
((x + 1 == fragment_width) << 2);
/* if there were no fragments to predict from, use last
* DC saved */
predicted_dc = last_dc[current_frame_type];
- debug_dc_pred("from last DC (%d) = %d\n",
+ debug_dc_pred("from last DC (%d) = %d\n",
current_frame_type, DC_COEFF(i));
} else {
/* if there is a shift value in the transform, add
* the sign bit before the shift */
if (predictor_transform[transform][5] != 0) {
- predicted_dc += ((predicted_dc >> 15) &
+ predicted_dc += ((predicted_dc >> 15) &
predictor_transform[transform][4]);
predicted_dc >>= predictor_transform[transform][5];
}
predicted_dc = vul;
}
- debug_dc_pred("from pred DC = %d\n",
+ debug_dc_pred("from pred DC = %d\n",
DC_COEFF(i));
}
i = s->macroblock_fragments[current_macroblock_entry + 5];
}
fragment_width = plane_width / FRAGMENT_PIXELS;
-
+
if(ABS(stride) > 2048)
return; //various tables are fixed size
if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) ||
(s->all_fragments[i].coding_method == MODE_GOLDEN_MV))
motion_source= golden_plane;
- else
+ else
motion_source= last_plane;
motion_source += s->all_fragments[i].first_pixel;
motion_source= temp;
}
}
-
+
/* first, take care of copying a block from either the
* previous or the golden frame */
if (s->all_fragments[i].coding_method != MODE_INTRA) {
- /* Note, it is possible to implement all MC cases with
- put_no_rnd_pixels_l2 which would look more like the
- VP3 source but this would be slower as
+ /* Note, it is possible to implement all MC cases with
+ put_no_rnd_pixels_l2 which would look more like the
+ VP3 source but this would be slower as
put_no_rnd_pixels_tab is better optimzed */
if(motion_halfpel_index != 3){
s->dsp.put_no_rnd_pixels_tab[1][motion_halfpel_index](
int d= (motion_x ^ motion_y)>>31; // d is 0 if motion_x and _y have the same sign, else -1
s->dsp.put_no_rnd_pixels_l2[1](
output_plane + s->all_fragments[i].first_pixel,
- motion_source - d,
- motion_source + stride + 1 + d,
+ motion_source - d,
+ motion_source + stride + 1 + d,
stride, 8);
}
dequantizer = s->inter_dequant;
}
/* dequantize the DCT coefficients */
- debug_idct("fragment %d, coding mode %d, DC = %d, dequant = %d:\n",
- i, s->all_fragments[i].coding_method,
+ debug_idct("fragment %d, coding mode %d, DC = %d, dequant = %d:\n",
+ i, s->all_fragments[i].coding_method,
DC_COEFF(i), dequantizer[0]);
if(s->avctx->idct_algo==FF_IDCT_VP3){
}
/* invert DCT and place (or add) in final output */
-
+
if (s->all_fragments[i].coding_method == MODE_INTRA) {
if(s->avctx->idct_algo!=FF_IDCT_VP3)
block[0] += 128<<3;
"put" : "add");
for (m = 0; m < 8; m++) {
for (n = 0; n < 8; n++) {
- debug_idct(" %3d", *(output_plane +
+ debug_idct(" %3d", *(output_plane +
s->all_fragments[i].first_pixel + (m * stride + n)));
}
debug_idct("\n");
int filter_value;
for (end= first_pixel + 8*stride; first_pixel < end; first_pixel += stride) {
- filter_value =
+ filter_value =
(first_pixel[-2] - first_pixel[ 1])
+3*(first_pixel[ 0] - first_pixel[-1]);
filter_value = bounding_values[(filter_value + 4) >> 3];
const int nstride= -stride;
for (end= first_pixel + 8; first_pixel < end; first_pixel++) {
- filter_value =
+ filter_value =
(first_pixel[2 * nstride] - first_pixel[ stride])
+3*(first_pixel[0 ] - first_pixel[nstride]);
filter_value = bounding_values[(filter_value + 4) >> 3];
if ((x > 0) &&
(s->all_fragments[fragment].coding_method != MODE_COPY)) {
horizontal_filter(
- plane_data + s->all_fragments[fragment].first_pixel - 7*stride,
+ plane_data + s->all_fragments[fragment].first_pixel - 7*stride,
stride, bounding_values);
}
if ((y > 0) &&
(s->all_fragments[fragment].coding_method != MODE_COPY)) {
vertical_filter(
- plane_data + s->all_fragments[fragment].first_pixel + stride,
+ plane_data + s->all_fragments[fragment].first_pixel + stride,
stride, bounding_values);
}
(s->all_fragments[fragment].coding_method != MODE_COPY) &&
(s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
horizontal_filter(
- plane_data + s->all_fragments[fragment + 1].first_pixel - 7*stride,
+ plane_data + s->all_fragments[fragment + 1].first_pixel - 7*stride,
stride, bounding_values);
}
(s->all_fragments[fragment].coding_method != MODE_COPY) &&
(s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
vertical_filter(
- plane_data + s->all_fragments[fragment + width].first_pixel + stride,
+ plane_data + s->all_fragments[fragment + width].first_pixel + stride,
stride, bounding_values);
}
}
}
-/*
+/*
* This function computes the first pixel addresses for each fragment.
* This function needs to be invoked after the first frame is allocated
* so that it has access to the plane strides.
*/
-static void vp3_calculate_pixel_addresses(Vp3DecodeContext *s)
+static void vp3_calculate_pixel_addresses(Vp3DecodeContext *s)
{
int i, x, y;
i = 0;
for (y = s->fragment_height; y > 0; y--) {
for (x = 0; x < s->fragment_width; x++) {
- s->all_fragments[i++].first_pixel =
+ s->all_fragments[i++].first_pixel =
s->golden_frame.linesize[0] * y * FRAGMENT_PIXELS -
s->golden_frame.linesize[0] +
x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
+ debug_init(" fragment %d, first pixel @ %d\n",
i-1, s->all_fragments[i-1].first_pixel);
}
}
i = s->u_fragment_start;
for (y = s->fragment_height / 2; y > 0; y--) {
for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
+ s->all_fragments[i++].first_pixel =
s->golden_frame.linesize[1] * y * FRAGMENT_PIXELS -
s->golden_frame.linesize[1] +
x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
+ debug_init(" fragment %d, first pixel @ %d\n",
i-1, s->all_fragments[i-1].first_pixel);
}
}
i = s->v_fragment_start;
for (y = s->fragment_height / 2; y > 0; y--) {
for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
+ s->all_fragments[i++].first_pixel =
s->golden_frame.linesize[2] * y * FRAGMENT_PIXELS -
s->golden_frame.linesize[2] +
x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
+ debug_init(" fragment %d, first pixel @ %d\n",
i-1, s->all_fragments[i-1].first_pixel);
}
}
}
/* FIXME: this should be merged with the above! */
-static void theora_calculate_pixel_addresses(Vp3DecodeContext *s)
+static void theora_calculate_pixel_addresses(Vp3DecodeContext *s)
{
int i, x, y;
i = 0;
for (y = 1; y <= s->fragment_height; y++) {
for (x = 0; x < s->fragment_width; x++) {
- s->all_fragments[i++].first_pixel =
+ s->all_fragments[i++].first_pixel =
s->golden_frame.linesize[0] * y * FRAGMENT_PIXELS -
s->golden_frame.linesize[0] +
x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
+ debug_init(" fragment %d, first pixel @ %d\n",
i-1, s->all_fragments[i-1].first_pixel);
}
}
i = s->u_fragment_start;
for (y = 1; y <= s->fragment_height / 2; y++) {
for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
+ s->all_fragments[i++].first_pixel =
s->golden_frame.linesize[1] * y * FRAGMENT_PIXELS -
s->golden_frame.linesize[1] +
x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
+ debug_init(" fragment %d, first pixel @ %d\n",
i-1, s->all_fragments[i-1].first_pixel);
}
}
i = s->v_fragment_start;
for (y = 1; y <= s->fragment_height / 2; y++) {
for (x = 0; x < s->fragment_width / 2; x++) {
- s->all_fragments[i++].first_pixel =
+ s->all_fragments[i++].first_pixel =
s->golden_frame.linesize[2] * y * FRAGMENT_PIXELS -
s->golden_frame.linesize[2] +
x * FRAGMENT_PIXELS;
- debug_init(" fragment %d, first pixel @ %d\n",
+ debug_init(" fragment %d, first pixel @ %d\n",
i-1, s->all_fragments[i-1].first_pixel);
}
}
if(avctx->idct_algo==FF_IDCT_AUTO)
avctx->idct_algo=FF_IDCT_VP3;
dsputil_init(&s->dsp, avctx);
-
+
ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
/* initialize to an impossible value which will force a recalculation
s->y_superblock_width, s->y_superblock_height, y_superblock_count);
debug_init(" C superblocks: %d x %d, %d total\n",
s->c_superblock_width, s->c_superblock_height, c_superblock_count);
- debug_init(" total superblocks = %d, U starts @ %d, V starts @ %d\n",
+ debug_init(" total superblocks = %d, U starts @ %d, V starts @ %d\n",
s->superblock_count, s->u_superblock_start, s->v_superblock_start);
debug_init(" macroblocks: %d x %d, %d total\n",
s->macroblock_width, s->macroblock_height, s->macroblock_count);
/*
* This is the ffmpeg/libavcodec API frame decode function.
*/
-static int vp3_decode_frame(AVCodecContext *avctx,
+static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
int i;
init_get_bits(&gb, buf, buf_size * 8);
-
+
if (s->theora && get_bits1(&gb))
{
#if 1
av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
return -1;
#else
- int ptype = get_bits(&gb, 7);
+ int ptype = get_bits(&gb, 7);
skip_bits(&gb, 6*8); /* "theora" */
-
+
switch(ptype)
{
case 1:
av_free(s->superblock_macroblocks);
av_free(s->macroblock_fragments);
av_free(s->macroblock_coding);
-
+
/* release all frames */
if (s->golden_frame.data[0] && s->golden_frame.data[0] != s->last_frame.data[0])
avctx->release_buffer(avctx, &s->golden_frame);
s->width = get_bits(&gb, 16) << 4;
s->height = get_bits(&gb, 16) << 4;
-
+
if(avcodec_check_dimensions(avctx, s->width, s->height)){
av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n", s->width, s->height);
s->width= s->height= 0;
skip_bits(&gb, 32); /* total number of blocks in a frame */
skip_bits(&gb, 4); /* total number of blocks in a frame */
skip_bits(&gb, 32); /* total number of macroblocks in a frame */
-
+
skip_bits(&gb, 24); /* frame width */
skip_bits(&gb, 24); /* frame height */
}
skip_bits(&gb, 32); /* fps denumerator */
skip_bits(&gb, 24); /* aspect numerator */
skip_bits(&gb, 24); /* aspect denumerator */
-
+
if (s->theora < 0x030200)
skip_bits(&gb, 5); /* keyframe frequency force */
skip_bits(&gb, 8); /* colorspace */
skip_bits(&gb, 24); /* bitrate */
skip_bits(&gb, 6); /* quality hint */
-
+
if (s->theora >= 0x030200)
{
skip_bits(&gb, 5); /* keyframe frequency force */
-
+
if (s->theora < 0x030400)
skip_bits(&gb, 5); /* spare bits */
}
-
+
// align_get_bits(&gb);
-
+
avctx->width = s->width;
avctx->height = s->height;
ret += get_bits(&gb, 8) << 8;
ret += get_bits(&gb, 8) << 16;
ret += get_bits(&gb, 8) << 24;
-
+
return ret;
}
while (len--)
skip_bits(&gb, 8);
} while (1);
- }
+ }
return 0;
}
for (i = 0; i < 64; i++)
s->filter_limit_values[i] = get_bits(&gb, n);
}
-
+
if (s->theora >= 0x030200)
n = get_bits(&gb, 4) + 1;
else
read_huffman_tree(avctx, &gb);
}
}
-
+
s->theora_tables = 1;
-
+
return 0;
}
int ptype;
uint8_t *p= avctx->extradata;
int op_bytes, i;
-
+
s->theora = 1;
if (!avctx->extradata_size)
ptype = get_bits(&gb, 8);
debug_vp3("Theora headerpacket type: %x\n", ptype);
-
+
if (!(ptype & 0x80))
{
av_log(avctx, AV_LOG_ERROR, "Invalid extradata!\n");
return -1;
- }
+ }
// FIXME: check for this aswell
skip_bits(&gb, 6*8); /* "theora" */
-
+
switch(ptype)
{
case 0x80:
72, 92, 95, 98, 112, 100, 103, 99
};
-/* these coefficients dequantize intraframe C plane coefficients
+/* these coefficients dequantize intraframe C plane coefficients
* (note: same as JPEG) */
static const int16_t vp31_intra_c_dequant[64] =
{ 17, 18, 24, 47, 99, 99, 99, 99,
21, 19, 18, 17, 15, 13, 12, 10
};
-static const uint32_t vp31_filter_limit_values[64] =
+static const uint32_t vp31_filter_limit_values[64] =
{ 30, 25, 20, 20, 15, 15, 14, 14,
13, 13, 12, 12, 11, 11, 10, 10,
9, 9, 8, 8, 7, 7, 7, 7,
{ 0x3E4, 10 }, { 0x3E5, 10 }, { 0x3E6, 10 }, { 0x3E7, 10 },
{ 0x3E8, 10 }, { 0x3E9, 10 }, { 0x3EA, 10 }, { 0x3EB, 10 },
{ 0x3EC, 10 }, { 0x3ED, 10 }, { 0x3EE, 10 }, { 0x3EF, 10 },
-
+
{ 0x3F, 6 } /* this last VLC is a special case for reading 12 more
bits from stream and adding the value 34 */
};
{ 0, 3 },
{ 1, 3 },
{ 2, 3 },
-
+
{ 6, 4 }, { 7, 4 },
{ 8, 4 }, { 9, 4 },
};
static const int8_t fixed_motion_vector_table[64] = {
- 0, 0, 1, -1, 2, -2, 3, -3,
+ 0, 0, 1, -1, 2, -2, 3, -3,
4, -4, 5, -5, 6, -6, 7, -7,
8, -8, 9, -9, 10, -10, 11, -11,
12, -12, 13, -13, 14, -14, 15, -15,
1, 1, 1, 1, /* 13..16 are constants but still need sign bit */
2, 3, 4, 5, 6, 10, /* 17..22, for reading large coeffs */
1, 1, 1, 1, 1, 1, 1, /* 23..29 are constants but still need sign bit */
- 2, 2 /* 30..31 */
+ 2, 2 /* 30..31 */
};
static const int16_t coeff_table_token_7_8[1] = { 0 };
};
static const int16_t coeff_table_token_20[32] = {
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36,
- -21, -22, -23, -24, -25, -26, -27, -28,
+ 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36,
+ -21, -22, -23, -24, -25, -26, -27, -28,
-29, -30, -31, -32, -33, -34, -35, -36
};
static const int16_t coeff_table_token_21[64] = {
- 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68,
- -37, -38, -39, -40, -41, -42, -43, -44,
- -45, -46, -47, -48, -49, -50, -51, -52,
- -53, -54, -55, -56, -57, -58, -59, -60,
+ 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68,
+ -37, -38, -39, -40, -41, -42, -43, -44,
+ -45, -46, -47, -48, -49, -50, -51, -52,
+ -53, -54, -55, -56, -57, -58, -59, -60,
-61, -62, -63, -64, -65, -66, -67, -68
};
static const int16_t coeff_table_token_22[1024] = {
- 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108,
- 109, 110, 111, 112, 113, 114, 115, 116,
- 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 126, 127, 128, 129, 130, 131, 132,
- 133, 134, 135, 136, 137, 138, 139, 140,
- 141, 142, 143, 144, 145, 146, 147, 148,
- 149, 150, 151, 152, 153, 154, 155, 156,
- 157, 158, 159, 160, 161, 162, 163, 164,
- 165, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 176, 177, 178, 179, 180,
- 181, 182, 183, 184, 185, 186, 187, 188,
- 189, 190, 191, 192, 193, 194, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204,
- 205, 206, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 217, 218, 219, 220,
- 221, 222, 223, 224, 225, 226, 227, 228,
- 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238, 239, 240, 241, 242, 243, 244,
- 245, 246, 247, 248, 249, 250, 251, 252,
- 253, 254, 255, 256, 257, 258, 259, 260,
- 261, 262, 263, 264, 265, 266, 267, 268,
- 269, 270, 271, 272, 273, 274, 275, 276,
- 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292,
- 293, 294, 295, 296, 297, 298, 299, 300,
- 301, 302, 303, 304, 305, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316,
- 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332,
- 333, 334, 335, 336, 337, 338, 339, 340,
- 341, 342, 343, 344, 345, 346, 347, 348,
- 349, 350, 351, 352, 353, 354, 355, 356,
- 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372,
- 373, 374, 375, 376, 377, 378, 379, 380,
- 381, 382, 383, 384, 385, 386, 387, 388,
- 389, 390, 391, 392, 393, 394, 395, 396,
- 397, 398, 399, 400, 401, 402, 403, 404,
- 405, 406, 407, 408, 409, 410, 411, 412,
- 413, 414, 415, 416, 417, 418, 419, 420,
- 421, 422, 423, 424, 425, 426, 427, 428,
- 429, 430, 431, 432, 433, 434, 435, 436,
- 437, 438, 439, 440, 441, 442, 443, 444,
- 445, 446, 447, 448, 449, 450, 451, 452,
- 453, 454, 455, 456, 457, 458, 459, 460,
- 461, 462, 463, 464, 465, 466, 467, 468,
- 469, 470, 471, 472, 473, 474, 475, 476,
- 477, 478, 479, 480, 481, 482, 483, 484,
- 485, 486, 487, 488, 489, 490, 491, 492,
- 493, 494, 495, 496, 497, 498, 499, 500,
- 501, 502, 503, 504, 505, 506, 507, 508,
- 509, 510, 511, 512, 513, 514, 515, 516,
- 517, 518, 519, 520, 521, 522, 523, 524,
- 525, 526, 527, 528, 529, 530, 531, 532,
- 533, 534, 535, 536, 537, 538, 539, 540,
- 541, 542, 543, 544, 545, 546, 547, 548,
- 549, 550, 551, 552, 553, 554, 555, 556,
- 557, 558, 559, 560, 561, 562, 563, 564,
- 565, 566, 567, 568, 569, 570, 571, 572,
+ 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92,
+ 93, 94, 95, 96, 97, 98, 99, 100,
+ 101, 102, 103, 104, 105, 106, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, 128, 129, 130, 131, 132,
+ 133, 134, 135, 136, 137, 138, 139, 140,
+ 141, 142, 143, 144, 145, 146, 147, 148,
+ 149, 150, 151, 152, 153, 154, 155, 156,
+ 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 171, 172,
+ 173, 174, 175, 176, 177, 178, 179, 180,
+ 181, 182, 183, 184, 185, 186, 187, 188,
+ 189, 190, 191, 192, 193, 194, 195, 196,
+ 197, 198, 199, 200, 201, 202, 203, 204,
+ 205, 206, 207, 208, 209, 210, 211, 212,
+ 213, 214, 215, 216, 217, 218, 219, 220,
+ 221, 222, 223, 224, 225, 226, 227, 228,
+ 229, 230, 231, 232, 233, 234, 235, 236,
+ 237, 238, 239, 240, 241, 242, 243, 244,
+ 245, 246, 247, 248, 249, 250, 251, 252,
+ 253, 254, 255, 256, 257, 258, 259, 260,
+ 261, 262, 263, 264, 265, 266, 267, 268,
+ 269, 270, 271, 272, 273, 274, 275, 276,
+ 277, 278, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292,
+ 293, 294, 295, 296, 297, 298, 299, 300,
+ 301, 302, 303, 304, 305, 306, 307, 308,
+ 309, 310, 311, 312, 313, 314, 315, 316,
+ 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 326, 327, 328, 329, 330, 331, 332,
+ 333, 334, 335, 336, 337, 338, 339, 340,
+ 341, 342, 343, 344, 345, 346, 347, 348,
+ 349, 350, 351, 352, 353, 354, 355, 356,
+ 357, 358, 359, 360, 361, 362, 363, 364,
+ 365, 366, 367, 368, 369, 370, 371, 372,
+ 373, 374, 375, 376, 377, 378, 379, 380,
+ 381, 382, 383, 384, 385, 386, 387, 388,
+ 389, 390, 391, 392, 393, 394, 395, 396,
+ 397, 398, 399, 400, 401, 402, 403, 404,
+ 405, 406, 407, 408, 409, 410, 411, 412,
+ 413, 414, 415, 416, 417, 418, 419, 420,
+ 421, 422, 423, 424, 425, 426, 427, 428,
+ 429, 430, 431, 432, 433, 434, 435, 436,
+ 437, 438, 439, 440, 441, 442, 443, 444,
+ 445, 446, 447, 448, 449, 450, 451, 452,
+ 453, 454, 455, 456, 457, 458, 459, 460,
+ 461, 462, 463, 464, 465, 466, 467, 468,
+ 469, 470, 471, 472, 473, 474, 475, 476,
+ 477, 478, 479, 480, 481, 482, 483, 484,
+ 485, 486, 487, 488, 489, 490, 491, 492,
+ 493, 494, 495, 496, 497, 498, 499, 500,
+ 501, 502, 503, 504, 505, 506, 507, 508,
+ 509, 510, 511, 512, 513, 514, 515, 516,
+ 517, 518, 519, 520, 521, 522, 523, 524,
+ 525, 526, 527, 528, 529, 530, 531, 532,
+ 533, 534, 535, 536, 537, 538, 539, 540,
+ 541, 542, 543, 544, 545, 546, 547, 548,
+ 549, 550, 551, 552, 553, 554, 555, 556,
+ 557, 558, 559, 560, 561, 562, 563, 564,
+ 565, 566, 567, 568, 569, 570, 571, 572,
573, 574, 575, 576, 577, 578, 579, 580,
- -69, -70, -71, -72, -73, -74, -75, -76,
- -77, -78, -79, -80, -81, -82, -83, -84,
- -85, -86, -87, -88, -89, -90, -91, -92,
- -93, -94, -95, -96, -97, -98, -99, -100,
- -101, -102, -103, -104, -105, -106, -107, -108,
- -109, -110, -111, -112, -113, -114, -115, -116,
- -117, -118, -119, -120, -121, -122, -123, -124,
- -125, -126, -127, -128, -129, -130, -131, -132,
- -133, -134, -135, -136, -137, -138, -139, -140,
- -141, -142, -143, -144, -145, -146, -147, -148,
- -149, -150, -151, -152, -153, -154, -155, -156,
- -157, -158, -159, -160, -161, -162, -163, -164,
- -165, -166, -167, -168, -169, -170, -171, -172,
- -173, -174, -175, -176, -177, -178, -179, -180,
- -181, -182, -183, -184, -185, -186, -187, -188,
- -189, -190, -191, -192, -193, -194, -195, -196,
- -197, -198, -199, -200, -201, -202, -203, -204,
- -205, -206, -207, -208, -209, -210, -211, -212,
- -213, -214, -215, -216, -217, -218, -219, -220,
- -221, -222, -223, -224, -225, -226, -227, -228,
- -229, -230, -231, -232, -233, -234, -235, -236,
- -237, -238, -239, -240, -241, -242, -243, -244,
- -245, -246, -247, -248, -249, -250, -251, -252,
- -253, -254, -255, -256, -257, -258, -259, -260,
- -261, -262, -263, -264, -265, -266, -267, -268,
- -269, -270, -271, -272, -273, -274, -275, -276,
- -277, -278, -279, -280, -281, -282, -283, -284,
- -285, -286, -287, -288, -289, -290, -291, -292,
- -293, -294, -295, -296, -297, -298, -299, -300,
- -301, -302, -303, -304, -305, -306, -307, -308,
- -309, -310, -311, -312, -313, -314, -315, -316,
- -317, -318, -319, -320, -321, -322, -323, -324,
- -325, -326, -327, -328, -329, -330, -331, -332,
- -333, -334, -335, -336, -337, -338, -339, -340,
- -341, -342, -343, -344, -345, -346, -347, -348,
- -349, -350, -351, -352, -353, -354, -355, -356,
- -357, -358, -359, -360, -361, -362, -363, -364,
- -365, -366, -367, -368, -369, -370, -371, -372,
- -373, -374, -375, -376, -377, -378, -379, -380,
- -381, -382, -383, -384, -385, -386, -387, -388,
- -389, -390, -391, -392, -393, -394, -395, -396,
- -397, -398, -399, -400, -401, -402, -403, -404,
- -405, -406, -407, -408, -409, -410, -411, -412,
- -413, -414, -415, -416, -417, -418, -419, -420,
- -421, -422, -423, -424, -425, -426, -427, -428,
- -429, -430, -431, -432, -433, -434, -435, -436,
- -437, -438, -439, -440, -441, -442, -443, -444,
- -445, -446, -447, -448, -449, -450, -451, -452,
- -453, -454, -455, -456, -457, -458, -459, -460,
- -461, -462, -463, -464, -465, -466, -467, -468,
- -469, -470, -471, -472, -473, -474, -475, -476,
- -477, -478, -479, -480, -481, -482, -483, -484,
- -485, -486, -487, -488, -489, -490, -491, -492,
- -493, -494, -495, -496, -497, -498, -499, -500,
- -501, -502, -503, -504, -505, -506, -507, -508,
- -509, -510, -511, -512, -513, -514, -515, -516,
- -517, -518, -519, -520, -521, -522, -523, -524,
- -525, -526, -527, -528, -529, -530, -531, -532,
- -533, -534, -535, -536, -537, -538, -539, -540,
- -541, -542, -543, -544, -545, -546, -547, -548,
- -549, -550, -551, -552, -553, -554, -555, -556,
- -557, -558, -559, -560, -561, -562, -563, -564,
- -565, -566, -567, -568, -569, -570, -571, -572,
+ -69, -70, -71, -72, -73, -74, -75, -76,
+ -77, -78, -79, -80, -81, -82, -83, -84,
+ -85, -86, -87, -88, -89, -90, -91, -92,
+ -93, -94, -95, -96, -97, -98, -99, -100,
+ -101, -102, -103, -104, -105, -106, -107, -108,
+ -109, -110, -111, -112, -113, -114, -115, -116,
+ -117, -118, -119, -120, -121, -122, -123, -124,
+ -125, -126, -127, -128, -129, -130, -131, -132,
+ -133, -134, -135, -136, -137, -138, -139, -140,
+ -141, -142, -143, -144, -145, -146, -147, -148,
+ -149, -150, -151, -152, -153, -154, -155, -156,
+ -157, -158, -159, -160, -161, -162, -163, -164,
+ -165, -166, -167, -168, -169, -170, -171, -172,
+ -173, -174, -175, -176, -177, -178, -179, -180,
+ -181, -182, -183, -184, -185, -186, -187, -188,
+ -189, -190, -191, -192, -193, -194, -195, -196,
+ -197, -198, -199, -200, -201, -202, -203, -204,
+ -205, -206, -207, -208, -209, -210, -211, -212,
+ -213, -214, -215, -216, -217, -218, -219, -220,
+ -221, -222, -223, -224, -225, -226, -227, -228,
+ -229, -230, -231, -232, -233, -234, -235, -236,
+ -237, -238, -239, -240, -241, -242, -243, -244,
+ -245, -246, -247, -248, -249, -250, -251, -252,
+ -253, -254, -255, -256, -257, -258, -259, -260,
+ -261, -262, -263, -264, -265, -266, -267, -268,
+ -269, -270, -271, -272, -273, -274, -275, -276,
+ -277, -278, -279, -280, -281, -282, -283, -284,
+ -285, -286, -287, -288, -289, -290, -291, -292,
+ -293, -294, -295, -296, -297, -298, -299, -300,
+ -301, -302, -303, -304, -305, -306, -307, -308,
+ -309, -310, -311, -312, -313, -314, -315, -316,
+ -317, -318, -319, -320, -321, -322, -323, -324,
+ -325, -326, -327, -328, -329, -330, -331, -332,
+ -333, -334, -335, -336, -337, -338, -339, -340,
+ -341, -342, -343, -344, -345, -346, -347, -348,
+ -349, -350, -351, -352, -353, -354, -355, -356,
+ -357, -358, -359, -360, -361, -362, -363, -364,
+ -365, -366, -367, -368, -369, -370, -371, -372,
+ -373, -374, -375, -376, -377, -378, -379, -380,
+ -381, -382, -383, -384, -385, -386, -387, -388,
+ -389, -390, -391, -392, -393, -394, -395, -396,
+ -397, -398, -399, -400, -401, -402, -403, -404,
+ -405, -406, -407, -408, -409, -410, -411, -412,
+ -413, -414, -415, -416, -417, -418, -419, -420,
+ -421, -422, -423, -424, -425, -426, -427, -428,
+ -429, -430, -431, -432, -433, -434, -435, -436,
+ -437, -438, -439, -440, -441, -442, -443, -444,
+ -445, -446, -447, -448, -449, -450, -451, -452,
+ -453, -454, -455, -456, -457, -458, -459, -460,
+ -461, -462, -463, -464, -465, -466, -467, -468,
+ -469, -470, -471, -472, -473, -474, -475, -476,
+ -477, -478, -479, -480, -481, -482, -483, -484,
+ -485, -486, -487, -488, -489, -490, -491, -492,
+ -493, -494, -495, -496, -497, -498, -499, -500,
+ -501, -502, -503, -504, -505, -506, -507, -508,
+ -509, -510, -511, -512, -513, -514, -515, -516,
+ -517, -518, -519, -520, -521, -522, -523, -524,
+ -525, -526, -527, -528, -529, -530, -531, -532,
+ -533, -534, -535, -536, -537, -538, -539, -540,
+ -541, -542, -543, -544, -545, -546, -547, -548,
+ -549, -550, -551, -552, -553, -554, -555, -556,
+ -557, -558, -559, -560, -561, -562, -563, -564,
+ -565, -566, -567, -568, -569, -570, -571, -572,
-573, -574, -575, -576, -577, -578, -579, -580
};
/**
* @file vp3dsp.c
- * Standard C DSP-oriented functions cribbed from the original VP3
+ * Standard C DSP-oriented functions cribbed from the original VP3
* source code.
*/
int t1, t2;
int i;
-
+
/* Inverse DCT on the rows now */
for (i = 0; i < 8; i++) {
/* Check for non-zero values */
ip += 8; /* next row */
}
-
+
ip = input;
for ( i = 0; i < 8; i++) {
if(type==0){
ip[0*8] = (_Gd + _Cd ) >> 4;
ip[7*8] = (_Gd - _Cd ) >> 4;
-
+
ip[1*8] = (_Add + _Hd ) >> 4;
ip[2*8] = (_Add - _Hd ) >> 4;
-
+
ip[3*8] = (_Ed + _Dd ) >> 4;
ip[4*8] = (_Ed - _Dd ) >> 4;
-
+
ip[5*8] = (_Fd + _Bdd ) >> 4;
ip[6*8] = (_Fd - _Bdd ) >> 4;
}else if(type==1){
dst[0*stride] = cm[(_Gd + _Cd ) >> 4];
dst[7*stride] = cm[(_Gd - _Cd ) >> 4];
-
+
dst[1*stride] = cm[(_Add + _Hd ) >> 4];
dst[2*stride] = cm[(_Add - _Hd ) >> 4];
-
+
dst[3*stride] = cm[(_Ed + _Dd ) >> 4];
dst[4*stride] = cm[(_Ed - _Dd ) >> 4];
-
+
dst[5*stride] = cm[(_Fd + _Bdd ) >> 4];
dst[6*stride] = cm[(_Fd - _Bdd ) >> 4];
}else{
dst[0*stride] = cm[dst[0*stride] + ((_Gd + _Cd ) >> 4)];
dst[7*stride] = cm[dst[7*stride] + ((_Gd - _Cd ) >> 4)];
-
+
dst[1*stride] = cm[dst[1*stride] + ((_Add + _Hd ) >> 4)];
dst[2*stride] = cm[dst[2*stride] + ((_Add - _Hd ) >> 4)];
-
+
dst[3*stride] = cm[dst[3*stride] + ((_Ed + _Dd ) >> 4)];
dst[4*stride] = cm[dst[4*stride] + ((_Ed - _Dd ) >> 4)];
-
+
dst[5*stride] = cm[dst[5*stride] + ((_Fd + _Bdd ) >> 4)];
dst[6*stride] = cm[dst[6*stride] + ((_Fd - _Bdd ) >> 4)];
}
} else {
if(type==0){
- ip[0*8] =
- ip[1*8] =
- ip[2*8] =
- ip[3*8] =
- ip[4*8] =
- ip[5*8] =
+ ip[0*8] =
+ ip[1*8] =
+ ip[2*8] =
+ ip[3*8] =
+ ip[4*8] =
+ ip[5*8] =
ip[6*8] =
ip[7*8] = ((xC4S4 * ip[0*8] + (IdctAdjustBeforeShift<<16))>>20);
}else if(type==1){
void ff_vp3_idct_c(DCTELEM *block/* align 16*/){
idct(NULL, 0, block, 0);
}
-
+
void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){
idct(dest, line_size, block, 1);
}
index_shift = 4;
else
index_shift = 3;
- for (y = 0; y < s->frame.linesize[0] * s->height;
+ for (y = 0; y < s->frame.linesize[0] * s->height;
y += s->frame.linesize[0] * s->vector_height) {
for (x = y; x < y + s->width; x += 4, lobytes++, hibytes++) {
switch (s->vqa_version) {
case 1:
-/* still need sample media for this case (only one game, "Legend of
+/* still need sample media for this case (only one game, "Legend of
* Kyrandia III : Malcolm's Revenge", is known to use this version) */
lines = 0;
break;
if (s->partial_countdown == 0) {
/* time to replace codebook */
- memcpy(s->codebook, s->next_codebook_buffer,
+ memcpy(s->codebook, s->next_codebook_buffer,
s->next_codebook_buffer_index);
/* reset accounting */
if (s->partial_countdown == 0) {
/* decompress codebook */
- decode_format80(s->next_codebook_buffer,
- s->next_codebook_buffer_index,
+ decode_format80(s->next_codebook_buffer,
+ s->next_codebook_buffer_index,
s->codebook, s->codebook_size, 0);
/* reset accounting */
//printf("thread_func %X signal complete\n", (int)v); fflush(stdout);
ReleaseSemaphore(c->done_sem, 1, 0);
}
-
+
return 0;
}
int i;
for(i=0; i<s->thread_count; i++){
-
+
c[i].func= NULL;
ReleaseSemaphore(c[i].work_sem, 1, 0);
WaitForSingleObject(c[i].thread, INFINITE);
int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count){
ThreadContext *c= s->thread_opaque;
int i;
-
+
assert(s == c->avctx);
assert(count <= s->thread_count);
-
+
/* note, we can be certain that this is not called with the same AVCodecContext by different threads at the same time */
for(i=0; i<count; i++){
}
for(i=0; i<count; i++){
WaitForSingleObject(c[i].done_sem, INFINITE);
-
+
c[i].func= NULL;
if(ret) ret[i]= c[i].ret;
}
assert(!s->thread_opaque);
c= av_mallocz(sizeof(ThreadContext)*thread_count);
s->thread_opaque= c;
-
+
for(i=0; i<thread_count; i++){
//printf("init semaphors %d\n", i); fflush(stdout);
c[i].avctx= s;
if( !c[i].thread ) goto fail;
}
//printf("init done\n"); fflush(stdout);
-
+
s->execute= avcodec_thread_execute;
return 0;
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
};
-
+
static const CoefVLCTable coef_vlcs[6] = {
- {
+ {
sizeof(coef0_huffbits), coef0_huffcodes, coef0_huffbits, levels0,
},
- {
+ {
sizeof(coef1_huffbits), coef1_huffcodes, coef1_huffbits, levels1,
},
- {
+ {
sizeof(coef2_huffbits), coef2_huffcodes, coef2_huffbits, levels2,
},
- {
+ {
sizeof(coef3_huffbits), coef3_huffcodes, coef3_huffbits, levels3,
},
- {
+ {
sizeof(coef4_huffbits), coef4_huffcodes, coef4_huffbits, levels4,
},
- {
+ {
sizeof(coef5_huffbits), coef5_huffcodes, coef5_huffbits, levels5,
},
};
* @file wmadec.c
* WMA compatible decoder.
* This decoder handles Microsoft Windows Media Audio data, versions 1 & 2.
- * WMA v1 is identified by audio format 0x160 in Microsoft media files
+ * WMA v1 is identified by audio format 0x160 in Microsoft media files
* (ASF/AVI/WAV). WMA v2 is identified by audio format 0x161.
*
* To use this decoder, a calling application must supply the extra data
* bytes provided with the WMA data. These are the extra, codec-specific
- * bytes at the end of a WAVEFORMATEX data structure. Transmit these bytes
- * to the decoder using the extradata[_size] fields in AVCodecContext. There
+ * bytes at the end of a WAVEFORMATEX data structure. Transmit these bytes
+ * to the decoder using the extradata[_size] fields in AVCodecContext. There
* should be 4 extra bytes for v1 data and 6 extra bytes for v2 data.
*/
int coefs_start; /* first coded coef */
int coefs_end[BLOCK_NB_SIZES]; /* max number of coded coefficients */
int exponent_high_sizes[BLOCK_NB_SIZES];
- int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE];
+ int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE];
VLC hgain_vlc;
-
+
/* coded values in high bands */
int high_band_coded[MAX_CHANNELS][HIGH_BAND_MAX_SIZE];
int high_band_values[MAX_CHANNELS][HIGH_BAND_MAX_SIZE];
#endif
/* XXX: use same run/length optimization as mpeg decoders */
-static void init_coef_vlc(VLC *vlc,
+static void init_coef_vlc(VLC *vlc,
uint16_t **prun_table, uint16_t **plevel_table,
const CoefVLCTable *vlc_table)
{
volatile float bps;
int sample_rate1;
int coef_vlc_table;
-
+
s->sample_rate = avctx->sample_rate;
s->nb_channels = avctx->channels;
s->bit_rate = avctx->bit_rate;
} else {
s->version = 2;
}
-
+
/* extract flag infos */
flags1 = 0;
flags2 = 0;
flags1 = extradata[0] | (extradata[1] << 8);
flags2 = extradata[2] | (extradata[3] << 8);
} else if (s->version == 2 && avctx->extradata_size >= 6) {
- flags1 = extradata[0] | (extradata[1] << 8) |
+ flags1 = extradata[0] | (extradata[1] << 8) |
(extradata[2] << 16) | (extradata[3] << 24);
flags2 = extradata[4] | (extradata[5] << 8);
}
/* compute MDCT block size */
if (s->sample_rate <= 16000) {
s->frame_len_bits = 9;
- } else if (s->sample_rate <= 22050 ||
+ } else if (s->sample_rate <= 22050 ||
(s->sample_rate <= 32000 && s->version == 1)) {
s->frame_len_bits = 10;
} else {
/* if version 2, then the rates are normalized */
sample_rate1 = s->sample_rate;
if (s->version == 2) {
- if (sample_rate1 >= 44100)
+ if (sample_rate1 >= 44100)
sample_rate1 = 44100;
- else if (sample_rate1 >= 22050)
+ else if (sample_rate1 >= 22050)
sample_rate1 = 22050;
- else if (sample_rate1 >= 16000)
+ else if (sample_rate1 >= 16000)
sample_rate1 = 16000;
- else if (sample_rate1 >= 11025)
+ else if (sample_rate1 >= 11025)
sample_rate1 = 11025;
- else if (sample_rate1 >= 8000)
+ else if (sample_rate1 >= 8000)
sample_rate1 = 8000;
}
} else if (sample_rate1 == 22050) {
if (bps1 >= 1.16)
s->use_noise_coding = 0;
- else if (bps1 >= 0.72)
+ else if (bps1 >= 0.72)
high_freq = high_freq * 0.7;
else
high_freq = high_freq * 0.6;
}
dprintf("flags1=0x%x flags2=0x%x\n", flags1, flags2);
dprintf("version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
- s->version, s->nb_channels, s->sample_rate, s->bit_rate,
+ s->version, s->nb_channels, s->sample_rate, s->bit_rate,
s->block_align);
- dprintf("bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
+ dprintf("bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
bps, bps1, high_freq, s->byte_offset_bits);
dprintf("use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes);
{
int a, b, pos, lpos, k, block_len, i, j, n;
const uint8_t *table;
-
+
if (s->version == 1) {
s->coefs_start = 3;
} else {
a = wma_critical_freqs[i];
b = s->sample_rate;
pos = ((block_len * 2 * a) + (b >> 1)) / b;
- if (pos > block_len)
+ if (pos > block_len)
pos = block_len;
s->exponent_bands[0][i] = pos - lpos;
if (pos >= block_len) {
b = s->sample_rate;
pos = ((block_len * 2 * a) + (b << 1)) / (4 * b);
pos <<= 2;
- if (pos > block_len)
+ if (pos > block_len)
pos = block_len;
if (pos > lpos)
s->exponent_bands[k][j++] = pos - lpos;
/* max number of coefs */
s->coefs_end[k] = (s->frame_len - ((s->frame_len * 9) / 100)) >> k;
/* high freq computation */
- s->high_band_start[k] = (int)((block_len * 2 * high_freq) /
+ s->high_band_start[k] = (int)((block_len * 2 * high_freq) /
s->sample_rate + 0.5);
n = s->exponent_sizes[k];
j = 0;
s->exponent_high_sizes[k] = j;
#if 0
tprintf("%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
- s->frame_len >> k,
+ s->frame_len >> k,
s->coefs_end[k],
s->high_band_start[k],
s->exponent_high_sizes[k]);
{
int i, j;
for(i = 0; i < s->nb_block_sizes; i++) {
- tprintf("%5d: n=%2d:",
- s->frame_len >> i,
+ tprintf("%5d: n=%2d:",
+ s->frame_len >> i,
s->exponent_sizes[i]);
for(j=0;j<s->exponent_sizes[i];j++)
tprintf(" %d", s->exponent_bands[i][j]);
/* init MDCT */
for(i = 0; i < s->nb_block_sizes; i++)
ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 1);
-
+
/* init MDCT windows : simple sinus window */
for(i = 0; i < s->nb_block_sizes; i++) {
int n, j;
}
s->reset_block_lengths = 1;
-
+
if (s->use_noise_coding) {
/* init the noise generator */
s->noise_mult = 0.02;
else
s->noise_mult = 0.04;
-
+
#ifdef TRACE
for(i=0;i<NOISE_TAB_SIZE;i++)
s->noise_table[i] = 1.0 * s->noise_mult;
}
}
#endif
- init_vlc(&s->hgain_vlc, 9, sizeof(hgain_huffbits),
+ init_vlc(&s->hgain_vlc, 9, sizeof(hgain_huffbits),
hgain_huffbits, 1, 1,
hgain_huffcodes, 2, 2, 0);
}
if (s->use_exp_vlc) {
- init_vlc(&s->exp_vlc, 9, sizeof(scale_huffbits),
+ init_vlc(&s->exp_vlc, 9, sizeof(scale_huffbits),
scale_huffbits, 1, 1,
scale_huffcodes, 4, 4, 0);
} else {
}
static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
-{
+{
float wdel, a, b;
int i, e, m;
/* NOTE: We use the same code as Vorbis here */
/* XXX: optimize it further with SSE/3Dnow */
-static void wma_lsp_to_curve(WMADecodeContext *s,
- float *out, float *val_max_ptr,
+static void wma_lsp_to_curve(WMADecodeContext *s,
+ float *out, float *val_max_ptr,
int n, float *lsp)
{
int i, j;
int last_exp, n, code;
const uint16_t *ptr, *band_ptr;
float v, *q, max_scale, *q_end;
-
+
band_ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits];
ptr = band_ptr;
q = s->exponents[ch];
/* compute current block length */
if (s->use_variable_block_len) {
n = av_log2(s->nb_block_sizes - 1) + 1;
-
+
if (s->reset_block_lengths) {
s->reset_block_lengths = 0;
v = get_bits(&s->gb, n);
if (a != 127)
break;
}
-
+
if (total_gain < 15)
coef_nb_bits = 13;
else if (total_gain < 32)
}
}
}
-
+
/* exposant can be interpolated in short blocks. */
parse_exponents = 1;
if (s->block_len_bits != s->frame_len_bits) {
parse_exponents = get_bits(&s->gb, 1);
}
-
+
if (parse_exponents) {
for(ch = 0; ch < s->nb_channels; ch++) {
if (s->channel_coded[ch]) {
} else {
for(ch = 0; ch < s->nb_channels; ch++) {
if (s->channel_coded[ch]) {
- interpolate_array(s->exponents[ch], 1 << s->prev_block_len_bits,
+ interpolate_array(s->exponents[ch], 1 << s->prev_block_len_bits,
s->block_len);
}
}
align_get_bits(&s->gb);
}
}
-
+
/* normalize */
{
int n4 = s->block_len / 2;
*coefs++ = s->noise_table[s->noise_index] * (*exponents++) * mult1;
s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
}
-
+
n1 = s->exponent_high_sizes[bsize];
/* compute power of high bands */
- exp_ptr = exponents +
- s->high_band_start[bsize] -
+ exp_ptr = exponents +
+ s->high_band_start[bsize] -
s->coefs_start;
last_high_band = 0; /* avoid warning */
for(j=0;j<n1;j++) {
- n = s->exponent_high_bands[s->frame_len_bits -
+ n = s->exponent_high_bands[s->frame_len_bits -
s->block_len_bits][j];
if (s->high_band_coded[ch][j]) {
float e2, v;
/* main freqs and high freqs */
for(j=-1;j<n1;j++) {
if (j < 0) {
- n = s->high_band_start[bsize] -
+ n = s->high_band_start[bsize] -
s->coefs_start;
} else {
- n = s->exponent_high_bands[s->frame_len_bits -
+ n = s->exponent_high_bands[s->frame_len_bits -
s->block_len_bits][j];
}
if (j >= 0 && s->high_band_coded[ch][j]) {
}
}
#endif
-
+
if (s->ms_stereo && s->channel_coded[1]) {
float a, b;
int i;
memset(s->coefs[0], 0, sizeof(float) * s->block_len);
s->channel_coded[0] = 1;
}
-
+
for(i = 0; i < s->block_len; i++) {
a = s->coefs[0][i];
b = s->coefs[1][i];
}
}
-
+
for(ch = 0; ch < s->nb_channels; ch++) {
if (s->channel_coded[ch]) {
FFTSample output[BLOCK_MAX_SIZE * 2] __attribute__((aligned(16)));
n = s->block_len;
n4 = s->block_len / 2;
- ff_imdct_calc(&s->mdct_ctx[bsize],
+ ff_imdct_calc(&s->mdct_ctx[bsize],
output, s->coefs[ch], s->mdct_tmp);
/* XXX: optimize all that by build the window and
s->block_pos = 0;
for(;;) {
ret = wma_decode_block(s);
- if (ret < 0)
+ if (ret < 0)
return -1;
if (ret)
break;
memmove(&s->frame_out[ch][0], &s->frame_out[ch][s->frame_len],
s->frame_len * sizeof(float));
/* XXX: suppress this */
- memset(&s->frame_out[ch][s->frame_len], 0,
+ memset(&s->frame_out[ch][s->frame_len], 0,
s->frame_len * sizeof(float));
}
return 0;
}
-static int wma_decode_superframe(AVCodecContext *avctx,
+static int wma_decode_superframe(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
int nb_frames, bit_offset, i, pos, len;
uint8_t *q;
int16_t *samples;
-
+
tprintf("***decode_superframe:\n");
if(buf_size==0){
s->last_superframe_len = 0;
return 0;
}
-
+
samples = data;
init_get_bits(&s->gb, buf, buf_size*8);
-
+
if (s->use_bit_reservoir) {
/* read super frame header */
get_bits(&s->gb, 4); /* super frame index */
if (s->last_superframe_len > 0) {
// printf("skip=%d\n", s->last_bitoffset);
/* add bit_offset bits to last frame */
- if ((s->last_superframe_len + ((bit_offset + 7) >> 3)) >
+ if ((s->last_superframe_len + ((bit_offset + 7) >> 3)) >
MAX_CODED_SUPERFRAME_SIZE)
goto fail;
q = s->last_superframe + s->last_superframe_len;
if (len > 0) {
*q++ = (get_bits)(&s->gb, len) << (8 - len);
}
-
+
/* XXX: bit_offset bits into last frame */
init_get_bits(&s->gb, s->last_superframe, MAX_CODED_SUPERFRAME_SIZE*8);
/* skip unused bits */
len = pos & 7;
if (len > 0)
skip_bits(&s->gb, len);
-
+
s->reset_block_lengths = 1;
for(i=0;i<nb_frames;i++) {
if (wma_decode_frame(s, samples) < 0)
av_free(s->run_table[i]);
av_free(s->level_table[i]);
}
-
+
return 0;
}
* @file wmv2.c
* wmv2 codec.
*/
-
+
#include "simple_idct.h"
-
+
#define SKIP_TYPE_NONE 0
#define SKIP_TYPE_MPEG 1
#define SKIP_TYPE_ROW 2
int per_mb_rl_bit;
int skip_type;
int hshift;
-
+
ScanTable abt_scantable[2];
DCTELEM abt_block2[6][64] __align8;
}Wmv2Context;
static void wmv2_common_init(Wmv2Context * w){
MpegEncContext * const s= &w->s;
-
+
ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], wmv2_scantableA);
ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], wmv2_scantableB);
}
MpegEncContext * const s= &w->s;
PutBitContext pb;
int code;
-
+
init_put_bits(&pb, s->avctx->extradata, s->avctx->extradata_size);
put_bits(&pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
put_bits(&pb, 11, FFMIN(s->bit_rate/1024, 2047));
-
+
put_bits(&pb, 1, w->mspel_bit=1);
put_bits(&pb, 1, w->flag3=1);
put_bits(&pb, 1, w->abt_flag=1);
put_bits(&pb, 1, w->top_left_mv_flag=0);
put_bits(&pb, 1, w->per_mb_rl_bit=1);
put_bits(&pb, 3, code=1);
-
+
flush_put_bits(&pb);
s->slice_height = s->mb_height / code;
-
+
return 0;
}
static int wmv2_encode_init(AVCodecContext *avctx){
Wmv2Context * const w= avctx->priv_data;
-
+
if(MPV_encode_init(avctx) < 0)
return -1;
-
+
wmv2_common_init(w);
avctx->extradata_size= 4;
avctx->extradata= av_mallocz(avctx->extradata_size + 10);
encode_ext_header(w);
-
+
return 0;
}
#if 0 /* unused, remove? */
static int wmv2_encode_end(AVCodecContext *avctx){
-
+
if(MPV_encode_end(avctx) < 0)
return -1;
-
+
avctx->extradata_size= 0;
av_freep(&avctx->extradata);
-
+
return 0;
}
#endif
if (s->pict_type == I_TYPE) {
assert(s->no_rounding==1);
if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type);
-
+
if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
-
+
if(!s->per_mb_rl_table){
code012(&s->pb, s->rl_chroma_table_index);
code012(&s->pb, s->rl_table_index);
int cbp_index;
put_bits(&s->pb, 2, SKIP_TYPE_NONE);
-
+
code012(&s->pb, cbp_index=0);
if(s->qscale <= 10){
int map[3]= {0,2,1};
}
if(w->mspel_bit) put_bits(&s->pb, 1, s->mspel);
-
+
if(w->abt_flag){
put_bits(&s->pb, 1, w->per_mb_abt^1);
if(!w->per_mb_abt){
}
if(w->per_mb_rl_bit) put_bits(&s->pb, 1, s->per_mb_rl_table);
-
+
if(!s->per_mb_rl_table){
code012(&s->pb, s->rl_table_index);
s->rl_chroma_table_index = s->rl_table_index;
}
put_bits(&s->pb, 1, s->dc_table_index);
put_bits(&s->pb, 1, s->mv_table_index);
-
+
s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
}
s->esc3_level_length= 0;
// nearly idential to wmv1 but thats just because we dont use the useless M$ crap features
// its duplicated here in case someone wants to add support for these carp features
-void ff_wmv2_encode_mb(MpegEncContext * s,
+void ff_wmv2_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int motion_x, int motion_y)
{
uint8_t *coded_block;
handle_slices(s);
-
+
if (!s->mb_intra) {
/* compute cbp */
set_stat(ST_INTER_MB);
if (s->block_last_index[i] >= 0)
cbp |= 1 << (5 - i);
}
-
- put_bits(&s->pb,
- wmv2_inter_table[w->cbp_table_index][cbp + 64][1],
+
+ put_bits(&s->pb,
+ wmv2_inter_table[w->cbp_table_index][cbp + 64][1],
wmv2_inter_table[w->cbp_table_index][cbp + 64][0]);
/* motion vector */
h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
- msmpeg4_encode_motion(s, motion_x - pred_x,
+ msmpeg4_encode_motion(s, motion_x - pred_x,
motion_y - pred_y);
} else {
/* compute cbp */
if (s->pict_type == I_TYPE) {
set_stat(ST_INTRA_MB);
- put_bits(&s->pb,
+ put_bits(&s->pb,
ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
} else {
- put_bits(&s->pb,
- wmv2_inter_table[w->cbp_table_index][cbp][1],
+ put_bits(&s->pb,
+ wmv2_inter_table[w->cbp_table_index][cbp][1],
wmv2_inter_table[w->cbp_table_index][cbp][0]);
}
set_stat(ST_INTRA_MB);
int code;
if(s->avctx->extradata_size<4) return -1;
-
+
init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size*8);
fps = get_bits(&gb, 5);
w->top_left_mv_flag= get_bits1(&gb);
w->per_mb_rl_bit = get_bits1(&gb);
code = get_bits(&gb, 3);
-
+
if(code==0) return -1;
s->slice_height = s->mb_height / code;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, flag3:%d, slices:%d\n",
- fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, w->flag3,
+ av_log(s->avctx, AV_LOG_DEBUG, "fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, tl_mv_flag:%d, mbrl_bit:%d, code:%d, flag3:%d, slices:%d\n",
+ fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, w->top_left_mv_flag, w->per_mb_rl_bit, code, w->flag3,
code);
}
return 0;
s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
if(s->qscale < 0)
return -1;
-
+
return 0;
}
if (s->pict_type == I_TYPE) {
if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
else w->j_type= 0; //FIXME check
-
+
if(!w->j_type){
if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
else s->per_mb_rl_table= 0;
-
+
if(!s->per_mb_rl_table){
s->rl_chroma_table_index = decode012(&s->gb);
s->rl_table_index = decode012(&s->gb);
s->inter_intra_pred= 0;
s->no_rounding = 1;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
+ av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n",
s->qscale,
s->rl_chroma_table_index,
- s->rl_table_index,
+ s->rl_table_index,
s->dc_table_index,
s->per_mb_rl_table,
w->j_type);
if(w->mspel_bit) s->mspel= get_bits1(&s->gb);
else s->mspel= 0; //FIXME check
-
+
if(w->abt_flag){
w->per_mb_abt= get_bits1(&s->gb)^1;
if(!w->per_mb_abt){
if(w->per_mb_rl_bit) s->per_mb_rl_table= get_bits1(&s->gb);
else s->per_mb_rl_table= 0;
-
+
if(!s->per_mb_rl_table){
s->rl_table_index = decode012(&s->gb);
s->rl_chroma_table_index = s->rl_table_index;
s->dc_table_index = get_bits1(&s->gb);
s->mv_table_index = get_bits1(&s->gb);
-
+
s->inter_intra_pred= 0;//(s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE);
s->no_rounding ^= 1;
-
+
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_DEBUG, "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
- s->rl_table_index,
- s->rl_chroma_table_index,
+ av_log(s->avctx, AV_LOG_DEBUG, "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n",
+ s->rl_table_index,
+ s->rl_chroma_table_index,
s->dc_table_index,
s->mv_table_index,
s->per_mb_rl_table,
}
s->esc3_level_length= 0;
s->esc3_run_length= 0;
-
+
s->picture_number++; //FIXME ?
static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
MpegEncContext * const s= &w->s;
int ret;
-
+
ret= msmpeg4_decode_motion(s, mx_ptr, my_ptr);
-
+
if(ret<0) return -1;
-
+
if((((*mx_ptr)|(*my_ptr)) & 1) && s->mspel)
w->hshift= get_bits1(&s->gb);
- else
+ else
w->hshift= 0;
//printf("%d %d ", *mx_ptr, *my_ptr);
-
+
return 0;
}
A = s->current_picture.motion_val[0][xy - 1];
B = s->current_picture.motion_val[0][xy - wrap];
C = s->current_picture.motion_val[0][xy + 2 - wrap];
-
+
if(s->mb_x && !s->first_slice_line && !s->mspel && w->top_left_mv_flag)
diff= FFMAX(ABS(A[0] - B[0]), ABS(A[1] - B[1]));
- else
+ else
diff=0;
-
+
if(diff >= 8)
type= get_bits1(&s->gb);
else
type= 2;
-
+
if(type == 0){
*px= A[0];
*py= A[1];
static const int sub_cbp_table[3]= {2,3,1};
int sub_cbp;
- if(!cbp){
+ if(!cbp){
s->block_last_index[n] = -1;
return 0;
}
-
+
if(w->per_block_abt)
w->abt_type= decode012(&s->gb);
#if 0
if (msmpeg4_decode_block(s, block, n, 1, scantable) < 0)
return -1;
}
-
+
if(sub_cbp&2){
if (msmpeg4_decode_block(s, w->abt_block2[n], n, 1, scantable) < 0)
return -1;
wmv2_add_block(w, block1[1], dest_y + 8 , s->linesize, 1);
wmv2_add_block(w, block1[2], dest_y + 8*s->linesize, s->linesize, 2);
wmv2_add_block(w, block1[3], dest_y + 8 + 8*s->linesize, s->linesize, 3);
-
+
if(s->flags&CODEC_FLAG_GRAY) return;
-
+
wmv2_add_block(w, block1[4], dest_cb , s->uvlinesize, 4);
wmv2_add_block(w, block1[5], dest_cr , s->uvlinesize, 5);
}
uint8_t *ptr;
int dxy, offset, mx, my, src_x, src_y, v_edge_pos, linesize, uvlinesize;
int emu=0;
-
+
dxy = ((motion_y & 1) << 1) | (motion_x & 1);
dxy = 2*dxy + w->hshift;
src_x = s->mb_x * 16 + (motion_x >> 1);
src_y = s->mb_y * 16 + (motion_y >> 1);
-
+
/* WARNING: do no forget half pels */
v_edge_pos = s->v_edge_pos;
src_x = clip(src_x, -16, s->width);
if(s->flags&CODEC_FLAG_EMU_EDGE){
if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
|| src_y + h+1 >= v_edge_pos){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr - 1 - s->linesize, s->linesize, 19, 19,
+ ff_emulated_edge_mc(s->edge_emu_buffer, ptr - 1 - s->linesize, s->linesize, 19, 19,
src_x-1, src_y-1, s->h_edge_pos, s->v_edge_pos);
ptr= s->edge_emu_buffer + 1 + s->linesize;
emu=1;
mx >>= 1;
my >>= 1;
}
-
+
src_x = s->mb_x * 8 + mx;
src_y = s->mb_y * 8 + my;
src_x = clip(src_x, -8, s->width >> 1);
offset = (src_y * uvlinesize) + src_x;
ptr = ref_picture[1] + offset;
if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9,
+ ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9,
src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
ptr= s->edge_emu_buffer;
}
ptr = ref_picture[2] + offset;
if(emu){
- ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9,
+ ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9,
src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
ptr= s->edge_emu_buffer;
}
uint8_t *coded_val;
if(w->j_type) return 0;
-
+
if (s->pict_type == P_TYPE) {
if(IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])){
/* skip mb */
if (code < 0)
return -1;
s->mb_intra = (~code & 0x40) >> 6;
-
+
cbp = code & 0x3f;
} else {
s->mb_intra = 1;
int mx, my;
//printf("P at %d %d\n", s->mb_x, s->mb_y);
wmv2_pred_motion(w, &mx, &my);
-
+
if(cbp){
s->dsp.clear_blocks(s->block[0]);
if(s->per_mb_rl_table){
}else
w->per_block_abt=0;
}
-
+
if (wmv2_decode_motion(w, &mx, &my) < 0)
return -1;
av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding inter block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
return -1;
}
- }
+ }
} else {
//if(s->pict_type==P_TYPE)
// printf("%d%d ", s->inter_intra_pred, cbp);
s->rl_table_index = decode012(&s->gb);
s->rl_chroma_table_index = s->rl_table_index;
}
-
+
s->dsp.clear_blocks(s->block[0]);
for (i = 0; i < 6; i++) {
if (msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0)
av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding intra block: %d x %d (%d)\n", s->mb_x, s->mb_y, i);
return -1;
}
- }
+ }
}
return 0;
static int wmv2_decode_init(AVCodecContext *avctx){
Wmv2Context * const w= avctx->priv_data;
-
+
if(ff_h263_decode_init(avctx) < 0)
return -1;
-
+
wmv2_common_init(w);
-
+
return 0;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file wnv1.c
* Winnov WNV1 codec.
*/
-
+
#include "avcodec.h"
#include "common.h"
#include "bitstream.h"
static uint16_t code_tab[16][2]={
{0x1FD,9}, {0xFD,8}, {0x7D,7}, {0x3D,6}, {0x1D,5}, {0x0D,4}, {0x005,3},
-{0x000,1},
+{0x000,1},
{0x004,3}, {0x0C,4}, {0x1C,5}, {0x3C,6}, {0x7C,7}, {0xFC,8}, {0x1FC,9}, {0xFF,8}
};
return base_value + ((v - 7)<<w->shift);
}
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
l->shift = 1;
}
}
-
+
Y = p->data[0];
U = p->data[1];
V = p->data[2];
V += p->linesize[2];
}
-
+
*data_size = sizeof(AVFrame);
*(AVFrame*)data = l->pic;
-
+
return buf_size;
}
static int ws_snd_decode_init(AVCodecContext * avctx)
{
// WSSNDContext *c = avctx->priv_data;
-
+
return 0;
}
uint8_t *buf, int buf_size)
{
// WSSNDContext *c = avctx->priv_data;
-
+
int in_size, out_size;
int sample = 0;
int i;
short *samples = data;
-
+
if (!buf_size)
return 0;
*data_size = out_size * 2;
in_size = LE_16(&buf[2]);
buf += 4;
-
+
if (in_size == out_size) {
for (i = 0; i < out_size; i++)
*samples++ = (*buf++ - 0x80) << 8;
return buf_size;
}
-
+
while (out_size > 0) {
int code;
uint8_t count;
}
}
}
-
+
return buf_size;
}
s->avctx = avctx;
s->frame_size = 0;
- if ((avctx->codec->id == CODEC_ID_XAN_WC3) &&
+ if ((avctx->codec->id == CODEC_ID_XAN_WC3) &&
(s->avctx->palctrl == NULL)) {
av_log(avctx, AV_LOG_ERROR, " WC3 Xan video: palette expected.\n");
return -1;
if(avcodec_check_dimensions(avctx, avctx->width, avctx->height))
return -1;
-
+
s->buffer1_size = avctx->width * avctx->height;
s->buffer1 = av_malloc(s->buffer1_size);
s->buffer2_size = avctx->width * avctx->height;
return 0;
}
-/* This function is used in lieu of memcpy(). This decoder can not use
+/* This function is used in lieu of memcpy(). This decoder can not use
* memcpy because the memory locations often overlap and
* memcpy doesn't like that; it's not uncommon, for example, for
* dest = src+1, to turn byte A into pattern AAAAAAAA.
dest[i] = src[i];
}
-static int xan_huffman_decode(unsigned char *dest, unsigned char *src,
+static int xan_huffman_decode(unsigned char *dest, unsigned char *src,
int dest_len)
{
unsigned char byte = *src++;
bytecopy(dest, src, size); dest += size; src += size;
}
-static void inline xan_wc3_output_pixel_run(XanContext *s,
+static void inline xan_wc3_output_pixel_run(XanContext *s,
unsigned char *pixel_buffer, int x, int y, int pixel_count)
{
int stride;
}
}
-static void inline xan_wc3_copy_pixel_run(XanContext *s,
+static void inline xan_wc3_copy_pixel_run(XanContext *s,
int x, int y, int pixel_count, int motion_x, int motion_y)
{
int stride;
prevframe_x = x + motion_x;
while((pixel_count--) && (curframe_index < s->frame_size)) {
- palette_plane[curframe_index++] =
+ palette_plane[curframe_index++] =
prev_palette_plane[prevframe_index++];
curframe_x++;
xan_huffman_decode(opcode_buffer, huffman_segment, opcode_buffer_size);
if (imagedata_segment[0] == 2)
- xan_unpack(imagedata_buffer, &imagedata_segment[1],
+ xan_unpack(imagedata_buffer, &imagedata_segment[1],
imagedata_buffer_size);
else
imagedata_buffer = &imagedata_segment[1];
s->frame_size = s->current_frame.linesize[0] * s->avctx->height;
palette_control->palette_changed = 0;
- memcpy(s->current_frame.data[1], palette_control->palette,
+ memcpy(s->current_frame.data[1], palette_control->palette,
AVPALETTE_SIZE);
s->current_frame.palette_has_changed = 1;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file xl.c
* Miro VideoXL codec.
*/
-
+
#include "avcodec.h"
#include "mpegvideo.h"
64, 82, 94, 103, 108, 113, 116, 119,
120, 121, 122, 123, 124, 125, 126, 127};
-static int decode_frame(AVCodecContext *avctx,
+static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
Y = a->pic.data[0];
U = a->pic.data[1];
V = a->pic.data[2];
-
+
stride = avctx->width - 4;
for (i = 0; i < avctx->height; i++) {
/* lines are stored in reversed order */
buf += stride;
-
+
for (j = 0; j < avctx->width; j += 4) {
/* value is stored in LE dword with word swapped */
val = LE_32(buf);
buf -= 4;
val = ((val >> 16) & 0xFFFF) | ((val & 0xFFFF) << 16);
-
+
if(!j)
y0 = (val & 0x1F) << 2;
else
c1 = (val & 0x1F) << 2;
else
c1 += xl_table[val & 0x1F];
-
+
Y[j + 0] = y0 << 1;
Y[j + 1] = y1 << 1;
Y[j + 2] = y2 << 1;
Y[j + 3] = y3 << 1;
-
+
U[j >> 2] = c0 << 1;
V[j >> 2] = c1 << 1;
}
-
+
buf += avctx->width + 4;
Y += a->pic.linesize[0];
U += a->pic.linesize[1];
*data_size = sizeof(AVFrame);
*(AVFrame*)data = a->pic;
-
+
return buf_size;
}
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file xvidmpeg4.c
* Interface to xvidcore for MPEG-4 compliant encoding.
* @author Adam Thayer (krevnik@comcast.net)
*/
-
+
#include <xvid.h>
#include <unistd.h>
#include "common.h"
unsigned char *intra_matrix; /** P-Frame Quant Matrix */
unsigned char *inter_matrix; /** I-Frame Quant Matrix */
} xvid_context_t;
-
+
/**
* Structure for the private first-pass plugin.
*/
/* Prototypes - See function implementation for details */
int xvid_strip_vol_header(AVCodecContext *avctx, unsigned char *frame, unsigned int header_len, unsigned int frame_len);
int xvid_ff_2pass(void *ref, int opt, void *p1, void *p2);
-void xvid_correct_framerate(AVCodecContext *avctx);
-
-/**
+void xvid_correct_framerate(AVCodecContext *avctx);
+
+/**
* Creates the private context for the encoder.
* All buffers are allocated, settings are loaded from the user,
* and the encoder context created.
*
* @param avctx AVCodecContext pointer to context
* @return Returns 0 on success, -1 on failure
- */
+ */
int ff_xvid_encode_init(AVCodecContext *avctx) {
int xerr, i;
int xvid_flags = avctx->flags;
xvid_context_t *x = avctx->priv_data;
uint16_t *intra, *inter;
int fd;
-
+
xvid_plugin_single_t single;
xvid_ff_pass1_t rc2pass1;
xvid_plugin_2pass2_t rc2pass2;
/* Bring in VOP flags from ffmpeg command-line */
x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */
- if( xvid_flags & CODEC_FLAG_4MV )
+ if( xvid_flags & CODEC_FLAG_4MV )
x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */
- if( xvid_flags & CODEC_FLAG_TRELLIS_QUANT)
+ if( xvid_flags & CODEC_FLAG_TRELLIS_QUANT)
x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */
- if( xvid_flags & CODEC_FLAG_AC_PRED )
+ if( xvid_flags & CODEC_FLAG_AC_PRED )
x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */
if( xvid_flags & CODEC_FLAG_GRAY )
x->vop_flags |= XVID_VOP_GREYSCALE;
-
+
/* Decide which ME quality setting to use */
x->me_flags = 0;
switch( avctx->me_method ) {
case ME_FULL: /* Quality 6 */
x->me_flags |= XVID_ME_EXTSEARCH16
| XVID_ME_EXTSEARCH8;
-
+
case ME_EPZS: /* Quality 4 */
x->me_flags |= XVID_ME_ADVANCEDDIAMOND8
| XVID_ME_HALFPELREFINE8
| XVID_ME_CHROMA_PVOP
| XVID_ME_CHROMA_BVOP;
-
+
case ME_LOG: /* Quality 2 */
case ME_PHODS:
case ME_X1:
x->me_flags |= XVID_ME_ADVANCEDDIAMOND16
| XVID_ME_HALFPELREFINE16;
-
+
case ME_ZERO: /* Quality 0 */
default:
break;
}
-
+
/* Decide how we should decide blocks */
switch( avctx->mb_decision ) {
case 2:
x->me_flags |= XVID_ME_HALFPELREFINE8_RD
| XVID_ME_QUARTERPELREFINE8_RD
| XVID_ME_EXTSEARCH_RD
- | XVID_ME_CHECKPREDICTION_RD;
+ | XVID_ME_CHECKPREDICTION_RD;
case 1:
if( !(x->vop_flags & XVID_VOP_MODEDECISION_RD) )
x->vop_flags |= XVID_VOP_FAST_MODEDECISION_RD;
x->me_flags |= XVID_ME_HALFPELREFINE16_RD
| XVID_ME_QUARTERPELREFINE16_RD;
-
+
default:
break;
}
-
+
/* Bring in VOL flags from ffmpeg command-line */
x->vol_flags = 0;
- if( xvid_flags & CODEC_FLAG_GMC ) {
- x->vol_flags |= XVID_VOL_GMC;
- x->me_flags |= XVID_ME_GME_REFINE;
+ if( xvid_flags & CODEC_FLAG_GMC ) {
+ x->vol_flags |= XVID_VOL_GMC;
+ x->me_flags |= XVID_ME_GME_REFINE;
}
- if( xvid_flags & CODEC_FLAG_QPEL ) {
+ if( xvid_flags & CODEC_FLAG_QPEL ) {
x->vol_flags |= XVID_VOL_QUARTERPEL;
x->me_flags |= XVID_ME_QUARTERPELREFINE16;
if( x->vop_flags & XVID_VOP_INTER4V )
memset(&xvid_gbl_init, 0, sizeof(xvid_gbl_init));
xvid_gbl_init.version = XVID_VERSION;
xvid_gbl_init.debug = 0;
-
+
#ifdef ARCH_POWERPC
/* XviD's PPC support is borked, use libavcodec to detect */
#if HAVE_ALTIVEC==1
xvid_gbl_init.cpu_flags = XVID_CPU_FORCE | XVID_CPU_ALTIVEC;
} else
#endif
- xvid_gbl_init.cpu_flags = XVID_CPU_FORCE;
+ xvid_gbl_init.cpu_flags = XVID_CPU_FORCE;
#else
/* XviD can detect on x86 */
xvid_gbl_init.cpu_flags = 0;
#endif
-
+
/* Initialize */
xvid_global(NULL, XVID_GBL_INIT, &xvid_gbl_init, NULL);
/* Create the encoder reference */
memset(&xvid_enc_create, 0, sizeof(xvid_enc_create));
xvid_enc_create.version = XVID_VERSION;
-
+
/* Store the desired frame size */
xvid_enc_create.width = x->xsize = avctx->width;
xvid_enc_create.height = x->ysize = avctx->height;
/* XviD can determine the proper profile to use */
/* xvid_enc_create.profile = XVID_PROFILE_S_L3; */
-
+
/* We don't use zones or threads */
xvid_enc_create.zones = NULL;
xvid_enc_create.num_zones = 0;
xvid_enc_create.num_threads = 0;
-
+
xvid_enc_create.plugins = plugins;
xvid_enc_create.num_plugins = 0;
-
+
/* Initialize Buffers */
x->twopassbuffer = NULL;
x->old_twopassbuffer = NULL;
x->twopassfile = NULL;
-
+
if( xvid_flags & CODEC_FLAG_PASS1 ) {
memset(&rc2pass1, 0, sizeof(xvid_ff_pass1_t));
rc2pass1.version = XVID_VERSION;
return -1;
}
x->twopassbuffer[0] = x->old_twopassbuffer[0] = 0;
-
+
plugins[xvid_enc_create.num_plugins].func = xvid_ff_2pass;
plugins[xvid_enc_create.num_plugins].param = &rc2pass1;
xvid_enc_create.num_plugins++;
memset(&rc2pass2, 0, sizeof(xvid_plugin_2pass2_t));
rc2pass2.version = XVID_VERSION;
rc2pass2.bitrate = avctx->bit_rate;
-
+
#ifdef CONFIG_WIN32 /* Ugly work around */
{
char *tempname;
"XviD: Cannot write 2-pass pipe\n");
return -1;
}
-
+
if( avctx->stats_in == NULL ) {
av_log(avctx, AV_LOG_ERROR,
"XviD: No 2-pass information loaded for second pass\n");
return -1;
}
-
- if( strlen(avctx->stats_in) >
+
+ if( strlen(avctx->stats_in) >
write(fd, avctx->stats_in, strlen(avctx->stats_in)) ) {
close(fd);
av_log(avctx, AV_LOG_ERROR,
"XviD: Cannot write to 2-pass pipe\n");
return -1;
}
-
+
close(fd);
rc2pass2.filename = x->twopassfile;
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2;
memset(&single, 0, sizeof(xvid_plugin_single_t));
single.version = XVID_VERSION;
single.bitrate = avctx->bit_rate;
-
+
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_single;
plugins[xvid_enc_create.num_plugins].param = &single;
xvid_enc_create.num_plugins++;
xvid_enc_create.max_key_interval = 240; /* XviD's best default */
/* Quants */
- if( xvid_flags & CODEC_FLAG_QSCALE ) x->qscale = 1;
+ if( xvid_flags & CODEC_FLAG_QSCALE ) x->qscale = 1;
else x->qscale = 0;
-
+
xvid_enc_create.min_quant[0] = avctx->qmin;
xvid_enc_create.min_quant[1] = avctx->qmin;
xvid_enc_create.min_quant[2] = avctx->qmin;
xvid_enc_create.max_quant[0] = avctx->qmax;
xvid_enc_create.max_quant[1] = avctx->qmax;
xvid_enc_create.max_quant[2] = avctx->qmax;
-
+
/* Quant Matrices */
x->intra_matrix = x->inter_matrix = NULL;
if( avctx->mpeg_quant )
x->vol_flags |= XVID_VOL_MPEGQUANT;
if( (avctx->intra_matrix || avctx->inter_matrix) ) {
x->vol_flags |= XVID_VOL_MPEGQUANT;
-
+
if( avctx->intra_matrix ) {
intra = avctx->intra_matrix;
x->intra_matrix = av_malloc(sizeof(unsigned char) * 64);
- } else
+ } else
intra = NULL;
if( avctx->inter_matrix ) {
inter = avctx->inter_matrix;
x->inter_matrix = av_malloc(sizeof(unsigned char) * 64);
- } else
+ } else
inter = NULL;
-
+
for( i = 0; i < 64; i++ ) {
if( intra )
x->intra_matrix[i] = (unsigned char)intra[i];
x->inter_matrix[i] = (unsigned char)inter[i];
}
}
-
+
/* Misc Settings */
xvid_enc_create.frame_drop_ratio = 0;
xvid_enc_create.global = 0;
- if( xvid_flags & CODEC_FLAG_CLOSED_GOP )
+ if( xvid_flags & CODEC_FLAG_CLOSED_GOP )
xvid_enc_create.global |= XVID_GLOBAL_CLOSED_GOP;
/* Determines which codec mode we are operating in */
/* We are claiming to be XviD */
x->quicktime_format = 0;
avctx->codec_tag = ff_get_fourcc("xvid");
- }
-
+ }
+
/* Bframes */
xvid_enc_create.max_bframes = avctx->max_b_frames;
xvid_enc_create.bquant_offset = avctx->b_quant_offset;
xvid_enc_create.bquant_ratio = 100 * avctx->b_quant_factor;
if( avctx->max_b_frames > 0 && !x->quicktime_format ) xvid_enc_create.global |= XVID_GLOBAL_PACKED;
-
+
/* Create encoder context */
xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL);
if( xerr ) {
av_log(avctx, AV_LOG_ERROR, "XviD: Could not create encoder reference\n");
return -1;
}
-
+
x->encoder_handle = xvid_enc_create.handle;
avctx->coded_frame = &x->encoded_picture;
return 0;
}
-/**
+/**
* Encodes a single frame.
*
* @param avctx AVCodecContext pointer to context
xvid_context_t *x = avctx->priv_data;
AVFrame *picture = data;
AVFrame *p = &(x->encoded_picture);
-
+
xvid_enc_frame_t xvid_enc_frame;
xvid_enc_stats_t xvid_enc_stats;
-
+
/* Start setting up the frame */
memset(&xvid_enc_frame, 0, sizeof(xvid_enc_frame));
xvid_enc_frame.version = XVID_VERSION;
memset(&xvid_enc_stats, 0, sizeof(xvid_enc_stats));
xvid_enc_stats.version = XVID_VERSION;
- *p = *picture;
+ *p = *picture;
/* Let XviD know where to put the frame. */
xvid_enc_frame.bitstream = frame;
xvid_enc_frame.length = buf_size;
-
+
/* Initialize input image fields */
if( avctx->pix_fmt != PIX_FMT_YUV420P ) {
av_log(avctx, AV_LOG_ERROR, "XviD: Color spaces other than 420p not supported\n");
return -1;
}
-
+
xvid_enc_frame.input.csp = XVID_CSP_PLANAR; /* YUV420P */
for( i = 0; i < 4; i++ ) {
xvid_enc_frame.vol_flags = x->vol_flags;
xvid_enc_frame.motion = x->me_flags;
xvid_enc_frame.type = XVID_TYPE_AUTO;
-
+
/* Quant Setting */
if( x->qscale ) xvid_enc_frame.quant = picture->quality / FF_QP2LAMBDA;
else xvid_enc_frame.quant = 0;
-
+
/* Matrices */
xvid_enc_frame.quant_intra_matrix = x->intra_matrix;
xvid_enc_frame.quant_inter_matrix = x->inter_matrix;
/* Encode */
- xerr = xvid_encore(x->encoder_handle, XVID_ENC_ENCODE,
+ xerr = xvid_encore(x->encoder_handle, XVID_ENC_ENCODE,
&xvid_enc_frame, &xvid_enc_stats);
/* Two-pass log buffer swapping */
if( x->old_twopassbuffer[0] != 0 ) {
avctx->stats_out = x->old_twopassbuffer;
}
- }
-
+ }
+
if( 0 <= xerr ) {
p->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
if( xvid_enc_stats.type == XVID_TYPE_PVOP )
if( xvid_enc_frame.out_flags & XVID_KEYFRAME ) {
p->key_frame = 1;
if( x->quicktime_format )
- return xvid_strip_vol_header(avctx, frame,
+ return xvid_strip_vol_header(avctx, frame,
xvid_enc_stats.hlength, xerr);
- } else
+ } else
p->key_frame = 0;
return xerr;
}
}
-/**
+/**
* Destroys the private context for the encoder.
* All buffers are freed, and the XviD encoder context is destroyed.
*
*/
int ff_xvid_encode_close(AVCodecContext *avctx) {
xvid_context_t *x = avctx->priv_data;
-
+
xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
if( avctx->extradata != NULL )
return 0;
}
-/**
+/**
* Routine to create a global VO/VOL header for MP4 container.
* What we do here is extract the header from the XviD bitstream
* as it is encoded. We also strip the repeated headers from the
* @param frame_len Length of encoded frame data
* @return Returns new length of frame data
*/
-int xvid_strip_vol_header(AVCodecContext *avctx,
- unsigned char *frame,
+int xvid_strip_vol_header(AVCodecContext *avctx,
+ unsigned char *frame,
unsigned int header_len,
unsigned int frame_len) {
int vo_len = 0, i;
for( i = 0; i < header_len - 3; i++ ) {
- if( frame[i] == 0x00 &&
+ if( frame[i] == 0x00 &&
frame[i+1] == 0x00 &&
frame[i+2] == 0x01 &&
frame[i+3] == 0xB6 ) {
vo_len = i;
break;
- }
+ }
}
-
+
if( vo_len > 0 ) {
/* We need to store the header, so extract it */
if( avctx->extradata == NULL ) {
/**
* Routine to correct a possibly erroneous framerate being fed to us.
- * XviD currently chokes on framerates where the ticks per frame is
+ * XviD currently chokes on framerates where the ticks per frame is
* extremely large. This function works to correct problems in this area
- * by estimating a new framerate and taking the simpler fraction of
+ * by estimating a new framerate and taking the simpler fraction of
* the two presented.
*
* @param avctx Context that contains the framerate to correct.
int est_frate, est_fbase;
int gcd;
float est_fps, fps;
-
+
frate = avctx->time_base.den;
fbase = avctx->time_base.num;
-
+
gcd = ff_gcd(frate, fbase);
if( gcd > 1 ) {
frate /= gcd;
fbase /= gcd;
}
-
+
if( frate <= 65000 && fbase <= 65000 ) {
avctx->time_base.den = frate;
avctx->time_base.num = fbase;
return;
}
-
+
fps = (float)frate / (float)fbase;
est_fps = roundf(fps * 1000.0) / 1000.0;
est_frate = (int)est_fps;
if( est_fps > (int)est_fps ) {
est_frate = (est_frate + 1) * 1000;
- est_fbase = (int)roundf((float)est_frate / est_fps);
+ est_fbase = (int)roundf((float)est_frate / est_fps);
} else
est_fbase = 1;
if( gcd > 1 ) {
est_frate /= gcd;
est_fbase /= gcd;
- }
-
+ }
+
if( fbase > est_fbase ) {
avctx->time_base.den = est_frate;
avctx->time_base.num = est_fbase;
- av_log(avctx, AV_LOG_DEBUG,
+ av_log(avctx, AV_LOG_DEBUG,
"XviD: framerate re-estimated: %.2f, %.3f%% correction\n",
est_fps, (((est_fps - fps)/fps) * 100.0));
} else {
void ** handle) {
xvid_ff_pass1_t *x = (xvid_ff_pass1_t *)param->param;
char *log = x->context->twopassbuffer;
-
+
/* Do a quick bounds check */
if( log == NULL )
return XVID_ERR_FAIL;
-
+
/* We use snprintf() */
/* This is because we can safely prevent a buffer overflow */
log[0] = 0;
XVID_VERSION_MAJOR(XVID_VERSION),
XVID_VERSION_MINOR(XVID_VERSION),
XVID_VERSION_PATCH(XVID_VERSION));
-
+
*handle = x->context;
- return 0;
+ return 0;
}
/**
* @param param Destrooy context
* @return Returns 0, success guaranteed
*/
-static int xvid_ff_2pass_destroy(xvid_context_t *ref,
+static int xvid_ff_2pass_destroy(xvid_context_t *ref,
xvid_plg_destroy_t *param) {
/* Currently cannot think of anything to do on destruction */
/* Still, the framework should be here for reference/use */
static int xvid_ff_2pass_before(xvid_context_t *ref,
xvid_plg_data_t *param) {
int motion_remove;
- int motion_replacements;
+ int motion_replacements;
int vop_remove;
-
- /* Nothing to do here, result is changed too much */
+
+ /* Nothing to do here, result is changed too much */
if( param->zone && param->zone->mode == XVID_ZONE_QUANT )
- return 0;
-
- /* We can implement a 'turbo' first pass mode here */
- param->quant = 2;
-
+ return 0;
+
+ /* We can implement a 'turbo' first pass mode here */
+ param->quant = 2;
+
/* Init values */
motion_remove = ~XVID_ME_CHROMA_PVOP &
~XVID_ME_CHROMA_BVOP &
~XVID_VOP_TRELLISQUANT &
~XVID_VOP_INTER4V &
~XVID_VOP_HQACPRED;
-
+
param->vol_flags &= ~XVID_VOL_GMC;
param->vop_flags &= vop_remove;
param->motion_flags &= motion_remove;
- param->motion_flags |= motion_replacements;
-
- return 0;
+ param->motion_flags |= motion_replacements;
+
+ return 0;
}
/**
char *log = ref->twopassbuffer;
char *frame_types = " ipbs";
char frame_type;
-
+
/* Quick bounds check */
if( log == NULL )
return XVID_ERR_FAIL;
-
+
/* Convert the type given to us into a character */
if( param->type < 5 && param->type > 0 ) {
frame_type = frame_types[param->type];
} else {
return XVID_ERR_FAIL;
}
-
+
snprintf(BUFFER_CAT(log), BUFFER_REMAINING(log),
"%c %d %d %d %d %d %d\n",
- frame_type, param->stats.quant, param->stats.kblks, param->stats.mblks,
+ frame_type, param->stats.quant, param->stats.kblks, param->stats.mblks,
param->stats.ublks, param->stats.length, param->stats.hlength);
-
+
return 0;
}
case XVID_PLG_BEFORE:
return xvid_ff_2pass_before(ref, p1);
-
+
case XVID_PLG_CREATE:
return xvid_ff_2pass_create(p1, p2);
-
+
case XVID_PLG_AFTER:
return xvid_ff_2pass_after(ref, p1);
-
+
case XVID_PLG_DESTROY:
return xvid_ff_2pass_destroy(ref, p1);
-
+
default:
return XVID_ERR_FAIL;
}
assert(render->mv_blocks);
//take the next free macroblock
- mv_block = &render->mv_blocks[render->start_mv_blocks_num +
+ mv_block = &render->mv_blocks[render->start_mv_blocks_num +
render->filled_mv_blocks_num ];
// memset(mv_block,0,sizeof(XvMCMacroBlock));
if(s->block_last_index[i] >= 0)
cbp++;
}
-
+
if(s->flags & CODEC_FLAG_GRAY){
if(s->mb_intra){//intra frames are alwasy full chroma block
for(i=4; i<blocks_per_mb; i++){
/* if(s->pblocks[i] != &render->data_blocks[
(render->next_free_data_block_num)*64]){
printf("ERROR mb(%d,%d) s->pblocks[i]=%p data_block[]=%p\n",
- s->mb_x,s->mb_y, s->pblocks[i],
+ s->mb_x,s->mb_y, s->pblocks[i],
&render->data_blocks[(render->next_free_data_block_num)*64]);
}*/
}
fourxm->track_count = current_track + 1;
if((unsigned)fourxm->track_count >= UINT_MAX / sizeof(AudioTrack))
return -1;
- fourxm->tracks = av_realloc(fourxm->tracks,
+ fourxm->tracks = av_realloc(fourxm->tracks,
fourxm->track_count * sizeof(AudioTrack));
if (!fourxm->tracks) {
av_free(header);
ret= av_get_packet(&s->pb, pkt, size);
if(ret<0)
return AVERROR_IO;
- pkt->stream_index =
+ pkt->stream_index =
fourxm->tracks[fourxm->selected_track].stream_index;
pkt->pts = fourxm->audio_pts;
packet_read = 1;
/* pts accounting */
audio_frame_count = size;
if (fourxm->tracks[fourxm->selected_track].adpcm)
- audio_frame_count -=
+ audio_frame_count -=
2 * (fourxm->tracks[fourxm->selected_track].channels);
audio_frame_count /=
fourxm->tracks[fourxm->selected_track].channels;
if (fourxm->tracks[fourxm->selected_track].adpcm)
audio_frame_count *= 2;
- else
+ else
audio_frame_count /=
(fourxm->tracks[fourxm->selected_track].bits / 8);
fourxm->audio_pts += audio_frame_count;
# image formats
OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o
# file I/O
-OBJS+= avio.o aviobuf.o file.o
-OBJS+= framehook.o
+OBJS+= avio.o aviobuf.o file.o
+OBJS+= framehook.o
ifeq ($(CONFIG_VIDEO4LINUX),yes)
OBJS+= grab.o
endif
ifeq ($(CONFIG_AUDIO_OSS),yes)
-OBJS+= audio.o
+OBJS+= audio.o
endif
EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
install -m 644 ../libavformat.pc "$(libdir)/pkgconfig"
%.o: %.c
- $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
# BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
%.o: %.cpp
- g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
+ g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
-distclean clean:
+distclean clean:
rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB)
#
void av_register_all(void)
{
static int inited = 0;
-
+
if (inited != 0)
return;
inited = 1;
#endif
av_register_image_format(&jpeg_image_format);
#endif
- av_register_image_format(&gif_image_format);
+ av_register_image_format(&gif_image_format);
// av_register_image_format(&sgi_image_format); heap corruption, dont enable
#endif //CONFIG_MUXERS
-/*
+/*
* amr file format
* Copyright (c) 2001 ffmpeg project
*
static int amr_probe(AVProbeData *p)
{
- //Only check for "#!AMR" which could be amr-wb, amr-nb.
- //This will also trigger multichannel files: "#!AMR_MC1.0\n" and
+ //Only check for "#!AMR" which could be amr-wb, amr-nb.
+ //This will also trigger multichannel files: "#!AMR_MC1.0\n" and
//"#!AMR-WB_MC1.0\n" (not supported)
if (p->buf_size < 5)
{
return AVERROR_NOMEM;
}
-
+
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_tag = MKTAG('s', 'a', 'w', 'b');
st->codec->codec_id = CODEC_ID_AMR_WB;
{
return AVERROR_NOMEM;
}
-
+
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_tag = MKTAG('s', 'a', 'm', 'r');
st->codec->codec_id = CODEC_ID_AMR_NB;
uint8_t toc, q, ft;
int read;
int size;
-
+
if (url_feof(&s->pb))
{
return AVERROR_IO;
}
-
+
toc=get_byte(&s->pb);
q = (toc >> 2) & 0x01;
ft = (toc >> 3) & 0x0F;
-
+
size=packed_size[ft];
-
+
if (av_new_packet(pkt, size+1))
{
return AVERROR_IO;
pkt->stream_index = 0;
pkt->pos= url_ftell(&s->pb);
pkt->data[0]=toc;
-
+
read = get_buffer(&s->pb, pkt->data+1, size);
-
+
if (read != size)
{
av_free_packet(pkt);
return AVERROR_IO;
}
-
+
return 0;
}
else if(enc->codec_id == CODEC_ID_AMR_WB)
uint8_t toc, mode;
int read;
int size;
-
+
if (url_feof(&s->pb))
{
return AVERROR_IO;
}
-
+
toc=get_byte(&s->pb);
mode = (uint8_t)((toc >> 3) & 0x0F);
size = packed_size[mode];
-
+
if ( (size==0) || av_new_packet(pkt, size))
{
return AVERROR_IO;
}
-
+
pkt->stream_index = 0;
pkt->pos= url_ftell(&s->pb);
pkt->data[0]=toc;
-
+
read = get_buffer(&s->pb, pkt->data+1, size-1);
-
+
if (read != (size-1))
{
av_free_packet(pkt);
return AVERROR_IO;
}
-
+
return 0;
}
else
ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
ASF_PAYLOAD_REPLICATED_DATA_LENGTH \
)
-
+
#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS (\
1 + /*Stream Number*/ \
ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
asf->streams[n].num = n + 1;
asf->streams[n].seq = 0;
-
+
if (enc->codec_type == CODEC_TYPE_AUDIO) {
if (enc->codec_id == CODEC_ID_ADPCM_G726) {
er_spr = (uint8_t *)error_spread_ADPCM_G726;
put_le16(pb, asf->streams[n].num);
put_str16(pb, p ? p->name : enc->codec_name);
put_le16(pb, 0); /* no parameters */
-
-
+
+
/* id */
if (enc->codec_type == CODEC_TYPE_AUDIO) {
put_le16(pb, 2);
asf->packet_size = PACKET_SIZE;
asf->nb_packets = 0;
-
+
asf->last_indexed_pts = 0;
asf->index_ptr = (ASFIndex*)av_malloc( sizeof(ASFIndex) * ASF_INDEX_BLOCK );
asf->nb_index_memory_alloc = ASF_INDEX_BLOCK;
static int put_payload_parsing_info(
AVFormatContext *s,
- unsigned int sendtime,
+ unsigned int sendtime,
unsigned int duration,
- int nb_payloads,
+ int nb_payloads,
int padsize
)
{
unsigned char *start_ppi_ptr = pb->buf_ptr;
int iLengthTypeFlags = ASF_PPI_LENGTH_TYPE_FLAGS;
-
+
put_byte(pb, ASF_PACKET_ERROR_CORRECTION_FLAGS);
for (i = 0; i < ASF_PACKET_ERROR_CORRECTION_DATA_SIZE; i++){
put_byte(pb, 0x0);
ASFContext *asf = s->priv_data;
ByteIOContext *pb = &asf->pb;
int val;
-
+
val = stream->num;
if (flags & PKT_FLAG_KEY)
val |= ASF_PL_FLAG_KEY_FRAME;
put_byte(pb, val);
-
+
put_byte(pb, stream->seq); //Media object number
put_le32(pb, m_obj_offset); //Offset Into Media Object
-
+
// Replicated Data shall be at least 8 bytes long.
- // The first 4 bytes of data shall contain the
+ // The first 4 bytes of data shall contain the
// Size of the Media Object that the payload belongs to.
- // The next 4 bytes of data shall contain the
+ // The next 4 bytes of data shall contain the
// Presentation Time for the media object that the payload belongs to.
put_byte(pb, ASF_PAYLOAD_REPLICATED_DATA_LENGTH);
put_le32(pb, m_obj_size); //Replicated Data - Media Object Size
put_le32(pb, presentation_time);//Replicated Data - Presentation Time
-
+
if (asf->multi_payloads_present){
put_le16(pb, payload_len); //payload length
}
payload_len = m_obj_size - m_obj_offset;
if (asf->packet_timestamp_start == -1) {
asf->multi_payloads_present = (payload_len < MULTI_PAYLOAD_CONSTANT);
-
+
if (asf->multi_payloads_present){
asf->packet_size_left = PACKET_SIZE; //For debug
asf->packet_size_left = PACKET_SIZE - PACKET_HEADER_MIN_SIZE - 1;
payload_len = frag_len1;
else if (payload_len == (frag_len1 - 1))
payload_len = frag_len1 - 2; //additional byte need to put padding length
-
+
put_payload_header(s, stream, timestamp+preroll_time, m_obj_size, m_obj_offset, payload_len, flags);
put_buffer(&asf->pb, buf, payload_len);
else
asf->packet_size_left -= (payload_len + PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD);
asf->packet_timestamp_end = timestamp;
-
+
asf->packet_nb_payloads++;
} else {
payload_len = 0;
ASFStream *stream;
int64_t duration;
AVCodecContext *codec;
- int64_t packet_st,pts;
+ int64_t packet_st,pts;
int start_sec,i;
codec = s->streams[pkt->stream_index]->codec;
#include <assert.h>
#define FRAME_HEADER_SIZE 17
-// Fix Me! FRAME_HEADER_SIZE may be different.
+// Fix Me! FRAME_HEADER_SIZE may be different.
static const GUID index_guid = {
0x33000890, 0xe5b1, 0x11cf, { 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb },
goto fail;
st->priv_data = asf_st;
st->start_time = asf->hdr.preroll;
- st->duration = asf->hdr.send_time /
+ st->duration = asf->hdr.send_time /
(10000000 / 1000) - st->start_time;
get_guid(pb, &g);
if (!memcmp(&g, &audio_stream, sizeof(GUID))) {
uint32_t packet_length, padsize;
int rsize = 9;
int c;
-
+
assert((url_ftell(&s->pb) - s->data_offset) % asf->packet_size == 0);
-
+
c = get_byte(pb);
if (c != 0x82) {
if (!url_feof(pb))
asf_st->seq = asf->packet_seq;
asf_st->pkt.pts = asf->packet_frag_timestamp;
asf_st->pkt.stream_index = asf->stream_index;
- asf_st->pkt.pos =
- asf_st->packet_pos= asf->packet_pos;
-//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
+ asf_st->pkt.pos =
+ asf_st->packet_pos= asf->packet_pos;
+//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & PKT_FLAG_KEY,
//s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO, asf->packet_obj_size);
- if (s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO)
+ if (s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO)
asf->packet_key_frame = 1;
if (asf->packet_key_frame)
asf_st->pkt.flags |= PKT_FLAG_KEY;
asf->packet_obj_size = 0;
asf->packet_time_delta = 0;
asf->packet_time_start = 0;
-
+
for(i=0; i<s->nb_streams; i++){
asf_st= s->streams[i]->priv_data;
av_free_packet(&asf_st->pkt);
int64_t pos= *ppos;
int i;
int64_t start_pos[s->nb_streams];
-
+
for(i=0; i<s->nb_streams; i++){
start_pos[i]= pos;
}
-
+
pos= (pos+asf->packet_size-1-s->data_offset)/asf->packet_size*asf->packet_size+ s->data_offset;
*ppos= pos;
url_fseek(&s->pb, pos, SEEK_SET);
-
+
//printf("asf_read_pts\n");
asf_reset_header(s);
for(;;){
av_log(s, AV_LOG_INFO, "seek failed\n");
return AV_NOPTS_VALUE;
}
-
+
pts= pkt->pts * 1000 / AV_TIME_BASE;
av_free_packet(pkt);
av_add_index_entry(s->streams[i], pos, pts, pos - start_pos[i] + 1, AVINDEX_KEYFRAME);
start_pos[i]= asf_st->packet_pos + 1;
-
+
if(pkt->stream_index == stream_index)
break;
}
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
{
ASFContext *asf = s->priv_data;
-
+
if (asf->packet_size <= 0)
return -1;
int ds_chunk_size;
int ds_data_size;
int ds_silence_data;
-
+
int packet_pos;
} ASFStream;
-/*
+/*
* AU encoder and decoder
* Copyright (c) 2001 Fabrice Bellard.
*
return -1;
size = get_be32(pb); /* header size */
get_be32(pb); /* data size */
-
+
id = get_be32(pb);
rate = get_be32(pb);
channels = get_be32(pb);
-
+
codec = codec_get_id(codec_au_tags, id);
if (size >= 24) {
/* select format : favour native format */
err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
-
+
#ifdef WORDS_BIGENDIAN
if (tmp & AFMT_S16_BE) {
tmp = AFMT_S16_BE;
perror("SNDCTL_DSP_SETFMT");
goto fail;
}
-
+
tmp = (s->channels == 2);
err = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp);
if (err < 0) {
}
if (tmp)
s->channels = 2;
-
+
tmp = s->sample_rate;
err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp);
if (err < 0) {
int ret, bdelay;
int64_t cur_time;
struct audio_buf_info abufi;
-
+
if (av_new_packet(pkt, s->frame_size) < 0)
return AVERROR_IO;
for(;;) {
void (*destruct)(struct AVPacket *);
void *priv;
int64_t pos; ///< byte position in stream, -1 if unknown
-} AVPacket;
+} AVPacket;
#define PKT_FLAG_KEY 0x0001
void av_destruct_packet_nofree(AVPacket *pkt);
/* the exact value of the fractional number is: 'val + num / den'. num
is assumed to be such as 0 <= num < den */
typedef struct AVFrac {
- int64_t val, num, den;
+ int64_t val, num, den;
} AVFrac;
void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den);
} AVFormatParameters;
#define AVFMT_NOFILE 0x0001 /* no file should be opened */
-#define AVFMT_NEEDNUMBER 0x0002 /* needs '%d' in filename */
+#define AVFMT_NEEDNUMBER 0x0002 /* needs '%d' in filename */
#define AVFMT_SHOW_IDS 0x0008 /* show format stream IDs numbers */
#define AVFMT_RAWPICTURE 0x0020 /* format wants AVPicture structure for
raw picture data */
/* close the stream. The AVFormatContext and AVStreams are not
freed by this function */
int (*read_close)(struct AVFormatContext *);
- /**
- * seek to a given timestamp relative to the frames in
+ /**
+ * seek to a given timestamp relative to the frames in
* stream component stream_index
* @param stream_index must not be -1
- * @param flags selects which direction should be preferred if no exact
+ * @param flags selects which direction should be preferred if no exact
* match is available
*/
- int (*read_seek)(struct AVFormatContext *,
+ int (*read_seek)(struct AVFormatContext *,
int stream_index, int64_t timestamp, int flags);
/**
* gets the next timestamp in AV_TIME_BASE units.
AVCodecContext *codec; /* codec context */
/**
* real base frame rate of the stream.
- * for example if the timebase is 1/90000 and all frames have either
+ * for example if the timebase is 1/90000 and all frames have either
* approximately 3600 or 1800 timer ticks then r_frame_rate will be 50/1
*/
AVRational r_frame_rate;
void *priv_data;
/* internal data used in av_find_stream_info() */
- int64_t codec_info_duration;
+ int64_t codec_info_duration;
int codec_info_nb_frames;
/* encoding: PTS generation when outputing stream */
AVFrac pts;
//FIXME move stuff to a flags field?
/* quality, as it has been removed from AVCodecContext and put in AVVideoFrame
* MN:dunno if thats the right place, for it */
- float quality;
+ float quality;
/* decoding: position of the first frame of the component, in
AV_TIME_BASE fractional seconds. */
- int64_t start_time;
+ int64_t start_time;
/* decoding: duration of the stream, in AV_TIME_BASE fractional
seconds. */
int64_t duration;
support seeking natively */
int nb_index_entries;
int index_entries_allocated_size;
-
+
int64_t nb_frames; ///< number of frames in this stream if known or 0
} AVStream;
/* decoding: position of the first frame of the component, in
AV_TIME_BASE fractional seconds. NEVER set this value directly:
it is deduced from the AVStream values. */
- int64_t start_time;
+ int64_t start_time;
/* decoding: duration of the stream, in AV_TIME_BASE fractional
seconds. NEVER set this value directly: it is deduced from the
AVStream values. */
/* av_seek_frame() support */
int64_t data_offset; /* offset of the first packet */
int index_built;
-
+
int mux_rate;
int packet_size;
int preload;
int max_delay;
-#define AVFMT_NOOUTPUTLOOP -1
-#define AVFMT_INFINITEOUTPUTLOOP 0
+#define AVFMT_NOOUTPUTLOOP -1
+#define AVFMT_INFINITEOUTPUTLOOP 0
/* number of times to loop output in formats that support it */
int loop_output;
-
+
int flags;
#define AVFMT_FLAG_GENPTS 0x0001 ///< generate pts if missing even if it requires parsing future frames
} AVFormatContext;
known so that the caller can allocate the image. If 'allo_cb'
returns non zero, then the parsing is aborted. Return '0' if
OK. */
- int (*img_read)(ByteIOContext *,
+ int (*img_read)(ByteIOContext *,
int (*alloc_cb)(void *, AVImageInfo *info), void *);
/* write the image */
int supported_pixel_formats; /* mask of supported formats for output */
int ff_mmf_init(void);
/* raw.c */
-int pcm_read_seek(AVFormatContext *s,
+int pcm_read_seek(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags);
int raw_init(void);
/* utils.c */
void av_register_input_format(AVInputFormat *format);
void av_register_output_format(AVOutputFormat *format);
-AVOutputFormat *guess_stream_format(const char *short_name,
+AVOutputFormat *guess_stream_format(const char *short_name,
const char *filename, const char *mime_type);
-AVOutputFormat *guess_format(const char *short_name,
+AVOutputFormat *guess_format(const char *short_name,
const char *filename, const char *mime_type);
-enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
+enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type, enum CodecType type);
void av_hex_dump(FILE *f, uint8_t *buf, int size);
/* media file input */
AVInputFormat *av_find_input_format(const char *short_name);
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
-int av_open_input_stream(AVFormatContext **ic_ptr,
- ByteIOContext *pb, const char *filename,
+int av_open_input_stream(AVFormatContext **ic_ptr,
+ ByteIOContext *pb, const char *filename,
AVInputFormat *fmt, AVFormatParameters *ap);
-int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
+int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
AVInputFormat *fmt,
int buf_size,
AVFormatParameters *ap);
#define AVERROR_NOMEM (-5) /* not enough memory */
#define AVERROR_NOFMT (-6) /* unknown format */
#define AVERROR_NOTSUPP (-7) /* operation not supported */
-
+
int av_find_stream_info(AVFormatContext *ic);
int av_read_packet(AVFormatContext *s, AVPacket *pkt);
int av_read_frame(AVFormatContext *s, AVPacket *pkt);
int av_write_trailer(AVFormatContext *s);
void dump_format(AVFormatContext *ic,
- int index,
+ int index,
const char *url,
int is_output);
int parse_image_size(int *width_ptr, int *height_ptr, const char *str);
time_t mktimegm(struct tm *tm);
struct tm *brktimegm(time_t secs, struct tm *tm);
-const char *small_strptime(const char *p, const char *fmt,
+const char *small_strptime(const char *p, const char *fmt,
struct tm *dt);
struct in_addr;
void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const CodecTag *tags, int for_asf);
int put_wav_header(ByteIOContext *pb, AVCodecContext *enc);
int wav_codec_get_id(unsigned int tag, int bps);
-void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size);
+void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size);
extern const CodecTag codec_bmp_tags[];
extern const CodecTag codec_wav_tags[];
int packet_size;
int scale;
- int rate;
+ int rate;
int sample_size; /* audio only data */
int start;
-
+
int cum_len; /* temporary storage (used during seek) */
-
+
int prefix; ///< normally 'd'<<8 + 'c' or 'w'<<8 + 'b'
int prefix_count;
} AVIStream;
static int get_riff(AVIContext *avi, ByteIOContext *pb)
{
- uint32_t tag;
+ uint32_t tag;
/* check RIFF header */
tag = get_le32(pb);
tag = get_le32(pb);
if (tag != MKTAG('A', 'V', 'I', ' ') && tag != MKTAG('A', 'V', 'I', 'X'))
return -1;
-
+
return 0;
}
int xan_video = 0; /* hack to support Xan A/V */
avi->stream_index= -1;
-
+
if (get_riff(avi, pb) < 0)
return -1;
print_tag("strh", tag1, -1);
#endif
if(tag1 == MKTAG('i', 'a', 'v', 's') || tag1 == MKTAG('i', 'v', 'a', 's')){
- /*
- * After some consideration -- I don't think we
+ /*
+ * After some consideration -- I don't think we
* have to support anything but DV in a type1 AVIs.
*/
if (s->nb_streams != 1)
goto fail;
-
+
if (handler != MKTAG('d', 'v', 's', 'd') &&
handler != MKTAG('d', 'v', 'h', 'd') &&
handler != MKTAG('d', 'v', 's', 'l'))
goto fail;
-
+
ast = s->streams[0]->priv_data;
av_freep(&s->streams[0]->codec->extradata);
av_freep(&s->streams[0]);
if (stream_index >= s->nb_streams) {
url_fskip(pb, size - 8);
break;
- }
+ }
st = s->streams[stream_index];
ast = st->priv_data;
st->codec->stream_codec_tag= handler;
ast->scale = 1;
}
av_set_pts_info(st, 64, ast->scale, ast->rate);
-
+
ast->start= get_le32(pb); /* start */
nb_frames = get_le32(pb);
codec_type = CODEC_TYPE_AUDIO;
break;
case MKTAG('t', 'x', 't', 's'):
- //FIXME
+ //FIXME
codec_type = CODEC_TYPE_DATA; //CODEC_TYPE_SUB ? FIXME
break;
case MKTAG('p', 'a', 'd', 's'):
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
}
-
+
if(st->codec->extradata_size & 1) //FIXME check if the encoder really did this correctly
get_byte(pb);
assert(!avi->index_loaded);
avi_load_index(s);
avi->index_loaded = 1;
-
+
return 0;
}
int n, d[8], size;
offset_t i, sync;
void* dstr;
-
+
if (avi->dv_demux) {
size = dv_get_packet(avi->dv_demux, pkt);
if (size >= 0)
return size;
}
-
+
if(avi->non_interleaved){
int best_stream_index = 0;
AVStream *best_st= NULL;
AVIStream *best_ast;
int64_t best_ts= INT64_MAX;
int i;
-
+
for(i=0; i<s->nb_streams; i++){
AVStream *st = s->streams[i];
AVIStream *ast = st->priv_data;
pos += avi->movi_list + best_ast->packet_size - best_ast->remaining;
url_fseek(&s->pb, pos, SEEK_SET);
// av_log(NULL, AV_LOG_DEBUG, "pos=%Ld\n", pos);
-
+
if(best_ast->remaining)
avi->stream_index= best_stream_index;
else
avi->stream_index= -1;
}
}
-
+
resync:
if(avi->stream_index >= 0){
AVStream *st= s->streams[ avi->stream_index ];
AVIStream *ast= st->priv_data;
int size;
-
+
if(ast->sample_size == 0)
size= INT_MAX;
- else if(ast->sample_size < 32)
+ else if(ast->sample_size < 32)
size= 64*ast->sample_size;
else
size= ast->sample_size;
if(size > ast->remaining)
size= ast->remaining;
av_get_packet(pb, pkt, size);
-
+
if (avi->dv_demux) {
dstr = pkt->destruct;
size = dv_produce_packet(avi->dv_demux, pkt,
index= av_index_search_timestamp(st, pkt->dts, 0);
e= &st->index_entries[index];
-
+
if(index >= 0 && e->timestamp == ast->frame_offset){
if (e->flags & AVINDEX_KEYFRAME)
pkt->flags |= PKT_FLAG_KEY;
pkt->flags |= PKT_FLAG_KEY;
}
} else {
- pkt->flags |= PKT_FLAG_KEY;
+ pkt->flags |= PKT_FLAG_KEY;
}
if(ast->sample_size)
ast->frame_offset += pkt->size;
for(j=0; j<7; j++)
d[j]= d[j+1];
d[7]= get_byte(pb);
-
+
size= d[4] + (d[5]<<8) + (d[6]<<16) + (d[7]<<24);
-
+
if( d[2] >= '0' && d[2] <= '9'
&& d[3] >= '0' && d[3] <= '9'){
n= (d[2] - '0') * 10 + (d[3] - '0');
//av_log(NULL, AV_LOG_DEBUG, "%X %X %X %X %X %X %X %X %lld %d %d\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
if(i + size > avi->movi_end || d[0]<0)
continue;
-
+
//parse ix##
if( (d[0] == 'i' && d[1] == 'x' && n < s->nb_streams)
//parse JUNK
}else{
n= 100; //invalid stream id
}
-
+
//parse ##dc/##wb
if(n < s->nb_streams){
AVStream *st;
AVIStream *ast;
st = s->streams[n];
ast = st->priv_data;
-
+
if( (st->discard >= AVDISCARD_DEFAULT && size==0)
/*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/ //FIXME needs a little reordering
|| st->discard >= AVDISCARD_ALL){
goto resync;
}
- if( ((ast->prefix_count<5 || sync+9 > i) && d[2]<128 && d[3]<128) ||
+ if( ((ast->prefix_count<5 || sync+9 > i) && d[2]<128 && d[3]<128) ||
d[2]*256+d[3] == ast->prefix /*||
- (d[2] == 'd' && d[3] == 'c') ||
+ (d[2] == 'd' && d[3] == 'c') ||
(d[2] == 'w' && d[3] == 'b')*/) {
//av_log(NULL, AV_LOG_DEBUG, "OK\n");
AVIStream *ast;
unsigned int index, tag, flags, pos, len;
unsigned last_pos= -1;
-
+
nb_index_entries = size / 16;
if (nb_index_entries <= 0)
return -1;
pos = get_le32(pb);
len = get_le32(pb);
#if defined(DEBUG_SEEK)
- av_log(NULL, AV_LOG_DEBUG, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/",
+ av_log(NULL, AV_LOG_DEBUG, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/",
i, tag, flags, pos, len);
#endif
if(i==0 && pos > avi->movi_list)
continue;
st = s->streams[index];
ast = st->priv_data;
-
+
#if defined(DEBUG_SEEK)
av_log(NULL, AV_LOG_DEBUG, "%d cum_len=%d\n", len, ast->cum_len);
#endif
int i;
int64_t last_start=0;
int64_t first_end= INT64_MAX;
-
+
for(i=0; i<s->nb_streams; i++){
AVStream *st = s->streams[i];
int n= st->nb_index_entries;
ByteIOContext *pb = &s->pb;
uint32_t tag, size;
offset_t pos= url_ftell(pb);
-
+
url_fseek(pb, avi->movi_end, SEEK_SET);
#ifdef DEBUG_SEEK
printf("movi_end=0x%llx\n", avi->movi_end);
index= av_index_search_timestamp(st, timestamp, flags);
if(index<0)
return -1;
-
+
/* find the position */
pos = st->index_entries[index].pos;
timestamp = st->index_entries[index].timestamp;
if (st2->nb_index_entries <= 0)
continue;
-
+
// assert(st2->codec.block_align);
assert(st2->time_base.den == ast2->rate);
assert(st2->time_base.num == ast2->scale);
index = av_index_search_timestamp(
- st2,
+ st2,
av_rescale(timestamp, st2->time_base.den*(int64_t)st->time_base.num, st->time_base.den * (int64_t)st2->time_base.num),
flags | AVSEEK_FLAG_BACKWARD);
if(index<0)
index=0;
-
+
if(!avi->non_interleaved){
while(index>0 && st2->index_entries[index].pos > pos)
index--;
#include "avi.h"
/*
- * TODO:
+ * TODO:
* - fill all fields if non streamed (nb_frames for example)
*/
AVIIndex indexes[MAX_STREAMS];
} AVIContext;
-static inline AVIIentry* avi_get_ientry(AVIIndex* idx, int ent_id)
+static inline AVIIentry* avi_get_ientry(AVIIndex* idx, int ent_id)
{
int cl = ent_id / AVI_INDEX_CLUSTER_SIZE;
int id = ent_id % AVI_INDEX_CLUSTER_SIZE;
{ CODEC_ID_MPEG4, MKTAG('W', 'V', '1', 'F') },
{ CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '3'), .invalid_asf = 1 }, /* default signature when using MSMPEG4 */
- { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', '4', '3') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', '4', '3') },
/* added based on MPlayer */
- { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', 'G', '3') },
- { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '5') },
- { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '6') },
- { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '4') },
- { CODEC_ID_MSMPEG4V3, MKTAG('A', 'P', '4', '1') },
- { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '1') },
- { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '0') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', 'G', '3') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '5') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '6') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '4') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('A', 'P', '4', '1') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '1') },
+ { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '0') },
- { CODEC_ID_MSMPEG4V2, MKTAG('M', 'P', '4', '2') },
+ { CODEC_ID_MSMPEG4V2, MKTAG('M', 'P', '4', '2') },
/* added based on MPlayer */
{ CODEC_ID_MSMPEG4V2, MKTAG('D', 'I', 'V', '2') },
-
- { CODEC_ID_MSMPEG4V1, MKTAG('M', 'P', 'G', '4') },
- { CODEC_ID_WMV1, MKTAG('W', 'M', 'V', '1') },
+ { CODEC_ID_MSMPEG4V1, MKTAG('M', 'P', 'G', '4') },
+
+ { CODEC_ID_WMV1, MKTAG('W', 'M', 'V', '1') },
/* added based on MPlayer */
- { CODEC_ID_WMV2, MKTAG('W', 'M', 'V', '2') },
- { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'd') },
- { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', 'd') },
- { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'l') },
+ { CODEC_ID_WMV2, MKTAG('W', 'M', 'V', '2') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'd') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', 'd') },
+ { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'l') },
{ CODEC_ID_DVVIDEO, MKTAG('d', 'v', '2', '5') },
- { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '1') },
- { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '2') },
- { CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', '2') },
- { CODEC_ID_MPEG1VIDEO, MKTAG('P', 'I', 'M', '1') },
- { CODEC_ID_MPEG1VIDEO, MKTAG('V', 'C', 'R', '2') },
- { CODEC_ID_MPEG1VIDEO, 0x10000001 },
- { CODEC_ID_MPEG2VIDEO, 0x10000002 },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '1') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '2') },
+ { CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', '2') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('P', 'I', 'M', '1') },
+ { CODEC_ID_MPEG1VIDEO, MKTAG('V', 'C', 'R', '2') },
+ { CODEC_ID_MPEG1VIDEO, 0x10000001 },
+ { CODEC_ID_MPEG2VIDEO, 0x10000002 },
{ CODEC_ID_MPEG2VIDEO, MKTAG('D', 'V', 'R', ' ') },
{ CODEC_ID_MJPEG, MKTAG('M', 'J', 'P', 'G') },
{ CODEC_ID_MJPEG, MKTAG('L', 'J', 'P', 'G') },
put_le32(pb, enc->width);
put_le32(pb, enc->height);
put_le16(pb, 1); /* planes */
-
+
put_le16(pb, enc->bits_per_sample ? enc->bits_per_sample : 24); /* depth */
/* compression type */
put_le32(pb, for_asf ? (enc->codec_tag ? enc->codec_tag : codec_get_asf_tag(tags, enc->codec_id)) : enc->codec_tag); //
put_le32(pb, 0);
put_le32(pb, 0);
put_le32(pb, 0);
-
+
put_buffer(pb, enc->extradata, enc->extradata_size);
if (enc->extradata_size & 1)
*au_rate /= gcd;
}
-static offset_t avi_start_new_riff(AVIContext *avi, ByteIOContext *pb,
+static offset_t avi_start_new_riff(AVIContext *avi, ByteIOContext *pb,
const char* riff_tag, const char* list_tag)
{
offset_t loff;
int i;
-
+
avi->riff_id++;
for (i=0; i<MAX_STREAMS; i++)
avi->indexes[i].entry = 0;
-
+
avi->riff_start = start_tag(pb, "RIFF");
put_tag(pb, riff_tag);
loff = start_tag(pb, "LIST");
return loff;
}
-static unsigned char* avi_stream2fourcc(unsigned char* tag, int index,
+static unsigned char* avi_stream2fourcc(unsigned char* tag, int index,
enum CodecType type)
{
tag[0] = '0';
if (stream->codec_type == CODEC_TYPE_VIDEO)
video_enc = stream;
}
-
+
nb_frames = 0;
if(video_enc){
put_le32(pb, 0); /* initial frame */
put_le32(pb, s->nb_streams); /* nb streams */
put_le32(pb, 1024 * 1024); /* suggested buffer size */
- if(video_enc){
+ if(video_enc){
put_le32(pb, video_enc->width);
put_le32(pb, video_enc->height);
} else {
put_le32(pb, 0);
put_le32(pb, 0);
- }
+ }
put_le32(pb, 0); /* reserved */
put_le32(pb, 0); /* reserved */
put_le32(pb, 0); /* reserved */
put_le32(pb, 0); /* reserved */
-
+
/* stream list */
for(i=0;i<n;i++) {
list2 = start_tag(pb, "LIST");
put_tag(pb, "strl");
-
+
stream = s->streams[i]->codec;
/* FourCC should really be set by the codec itself */
put_le32(pb, AVI_MAX_RIFF_SIZE); /* FIXME: this may be broken, but who cares */
else
put_le32(pb, 0); /* length, XXX: filled later */
-
+
/* suggested buffer size */ //FIXME set at the end to largest chunk
if(stream->codec_type == CODEC_TYPE_VIDEO)
- put_le32(pb, 1024 * 1024);
+ put_le32(pb, 1024 * 1024);
else if(stream->codec_type == CODEC_TYPE_AUDIO)
- put_le32(pb, 12 * 1024);
+ put_le32(pb, 12 * 1024);
else
- put_le32(pb, 0);
+ put_le32(pb, 0);
put_le32(pb, -1); /* quality */
put_le32(pb, au_ssize); /* sample size */
put_le32(pb, 0);
}
end_tag(pb, strf);
}
-
+
if (!url_is_streamed(pb)) {
unsigned char tag[5];
int j;
-
- /* Starting to lay out AVI OpenDML master index.
+
+ /* Starting to lay out AVI OpenDML master index.
* We want to make it JUNK entry for now, since we'd
- * like to get away without making AVI an OpenDML one
+ * like to get away without making AVI an OpenDML one
* for compatibility reasons.
*/
avi->indexes[i].entry = avi->indexes[i].ents_allocated = 0;
- avi->indexes[i].indx_start = start_tag(pb, "JUNK");
+ avi->indexes[i].indx_start = start_tag(pb, "JUNK");
put_le16(pb, 4); /* wLongsPerEntry */
put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
put_byte(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
put_le64(pb, 0);
end_tag(pb, avi->indexes[i].indx_start);
}
-
+
end_tag(pb, list2);
}
-
+
if (!url_is_streamed(pb)) {
/* AVI could become an OpenDML one, if it grows beyond 2Gb range */
avi->odml_list = start_tag(pb, "JUNK");
}
end_tag(pb, list1);
-
+
avi->movi_list = start_tag(pb, "LIST");
put_tag(pb, "movi");
unsigned char tag[5];
unsigned char ix_tag[] = "ix00";
int i, j;
-
+
if (url_is_streamed(pb))
return -1;
if (avi->riff_id > AVI_MASTER_INDEX_SIZE)
return -1;
-
+
for (i=0;i<s->nb_streams;i++) {
offset_t ix, pos;
-
+
avi_stream2fourcc(&tag[0], i, s->streams[i]->codec->codec_type);
ix_tag[3] = '0' + i;
-
+
/* Writing AVI OpenDML leaf index chunk */
- ix = url_ftell(pb);
+ ix = url_ftell(pb);
put_tag(pb, &ix_tag[0]); /* ix?? */
- put_le32(pb, avi->indexes[i].entry * 8 + 24);
+ put_le32(pb, avi->indexes[i].entry * 8 + 24);
/* chunk size */
put_le16(pb, 2); /* wLongsPerEntry */
- put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
+ put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
put_byte(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
- put_le32(pb, avi->indexes[i].entry);
+ put_le32(pb, avi->indexes[i].entry);
/* nEntriesInUse */
put_tag(pb, &tag[0]); /* dwChunkId */
put_le64(pb, avi->movi_list);/* qwBaseOffset */
}
put_flush_packet(pb);
pos = url_ftell(pb);
-
+
/* Updating one entry in the AVI OpenDML master index */
url_fseek(pb, avi->indexes[i].indx_start - 8, SEEK_SET);
put_tag(pb, "indx"); /* enabling this entry */
for (i=0; i<s->nb_streams; i++) {
if (avi->indexes[i].entry <= entry[i])
continue;
-
+
tie = avi_get_ientry(&avi->indexes[i], entry[i]);
if (empty || tie->pos < ie->pos) {
- ie = tie;
+ ie = tie;
stream_id = i;
}
empty = 0;
}
if (!empty) {
- avi_stream2fourcc(&tag[0], stream_id,
- s->streams[stream_id]->codec->codec_type);
+ avi_stream2fourcc(&tag[0], stream_id,
+ s->streams[stream_id]->codec->codec_type);
put_tag(pb, &tag[0]);
put_le32(pb, ie->flags);
put_le32(pb, ie->pos);
}
if (avi->frames_hdr_all != 0) {
url_fseek(pb, avi->frames_hdr_all, SEEK_SET);
- put_le32(pb, nb_frames);
+ put_le32(pb, nb_frames);
}
url_fseek(pb, file_size, SEEK_SET);
}
avi->packet_count[stream_index]++;
// Make sure to put an OpenDML chunk when the file size exceeds the limits
- if (!url_is_streamed(pb) &&
+ if (!url_is_streamed(pb) &&
(url_ftell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) {
-
+
avi_write_ix(s);
end_tag(pb, avi->movi_list);
-
+
if (avi->riff_id == 1)
avi_write_idx1(s);
end_tag(pb, avi->riff_start);
avi->movi_list = avi_start_new_riff(avi, pb, "AVIX", "movi");
}
-
+
avi_stream2fourcc(&tag[0], stream_index, enc->codec_type);
if(pkt->flags&PKT_FLAG_KEY)
flags = 0x10;
int cl = idx->entry / AVI_INDEX_CLUSTER_SIZE;
int id = idx->entry % AVI_INDEX_CLUSTER_SIZE;
if (idx->ents_allocated <= idx->entry) {
- idx->cluster = av_realloc(idx->cluster, (cl+1)*sizeof(void*));
+ idx->cluster = av_realloc(idx->cluster, (cl+1)*sizeof(void*));
if (!idx->cluster)
return -1;
idx->cluster[cl] = av_malloc(AVI_INDEX_CLUSTER_SIZE*sizeof(AVIIentry));
return -1;
idx->ents_allocated += AVI_INDEX_CLUSTER_SIZE;
}
-
- idx->cluster[cl][id].flags = flags;
+
+ idx->cluster[cl][id].flags = flags;
idx->cluster[cl][id].pos = url_ftell(pb) - avi->movi_list;
idx->cluster[cl][id].len = size;
idx->entry++;
}
-
+
put_buffer(pb, tag, 4);
put_le32(pb, size);
put_buffer(pb, pkt->data, size);
avi->indexes[i].cluster = NULL;
avi->indexes[i].ents_allocated = avi->indexes[i].entry = 0;
}
-
+
return res;
}
} else {
*q = '\0';
}
-
+
up = first_protocol;
while (up != NULL) {
if (!strcmp(proto_str, up->name))
return AVERROR_IO;
/* avoid sending too big packets */
if (h->max_packet_size && size > h->max_packet_size)
- return AVERROR_IO;
+ return AVERROR_IO;
ret = h->prot->url_write(h, buf, size);
return ret;
}
offset_t url_filesize(URLContext *h)
{
offset_t pos, size;
-
+
pos = url_seek(h, 0, SEEK_CUR);
size = url_seek(h, -1, SEEK_END)+1;
url_seek(h, pos, SEEK_SET);
return size;
}
-/*
+/*
* Return the maximum packet size associated to packetized file
* handle. If the file is not packetized (stream like http or file on
* disk), then 0 is returned.
- *
+ *
* @param h file handle
* @return maximum packet size in bytes
*/
return 0;
}
-/**
+/**
* The callback is called in blocking functions to test regulary if
* asynchronous interruption is needed. -EINTR is returned in this
* case by the interrupted function. 'NULL' means no interrupt
- * callback is given.
+ * callback is given.
*/
void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)
{
struct URLContext {
struct URLProtocol *prot;
- int flags;
+ int flags;
int is_streamed; /* true if streamed (no seek possible), default = false */
int max_packet_size; /* if non zero, the stream is packetized with this max packet size */
void *priv_data;
s->buffer_size = buffer_size;
s->buf_ptr = buffer;
s->write_flag = write_flag;
- if (!s->write_flag)
+ if (!s->write_flag)
s->buf_end = buffer;
else
s->buf_end = buffer + buffer_size;
s->update_checksum= NULL;
return 0;
}
-
+
#ifdef CONFIG_MUXERS
static void flush_buffer(ByteIOContext *s)
void put_byte(ByteIOContext *s, int b)
{
*(s->buf_ptr)++ = b;
- if (s->buf_ptr >= s->buf_end)
+ if (s->buf_ptr >= s->buf_end)
flush_buffer(s);
}
memcpy(s->buf_ptr, buf, len);
s->buf_ptr += len;
- if (s->buf_ptr >= s->buf_end)
+ if (s->buf_ptr >= s->buf_end)
flush_buffer(s);
buf += len;
if (whence != SEEK_CUR && whence != SEEK_SET)
return -EINVAL;
-
+
#ifdef CONFIG_MUXERS
if (s->write_flag) {
if (whence == SEEK_CUR) {
offset += offset1;
}
offset1 = offset - s->pos;
- if (!s->must_flush &&
+ if (!s->must_flush &&
offset1 >= 0 && offset1 < (s->buf_end - s->buffer)) {
/* can do the seek inside the buffer */
s->buf_ptr = s->buffer + offset1;
s->seek(s->opaque, offset, SEEK_SET);
s->pos = offset;
}
- } else
+ } else
#endif //CONFIG_MUXERS
{
if (whence == SEEK_CUR) {
offset_t url_fsize(ByteIOContext *s)
{
offset_t size;
-
+
if (!s->seek)
return -EPIPE;
size = s->seek(s->opaque, -1, SEEK_END) + 1;
int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)
{
int len;
-
+
if(size<0)
return -1;
if (i < maxlen-1)
buf[i++] = c;
}
-
+
buf[i] = 0; /* Ensure null terminated, but may be truncated */
return buf;
uint8_t *buffer;
int buffer_size, max_packet_size;
-
+
max_packet_size = url_get_max_packet_size(h);
if (max_packet_size) {
buffer_size = max_packet_size; /* no need to bufferize more than one packet */
if (!buffer)
return -ENOMEM;
- if (init_put_byte(s, buffer, buffer_size,
+ if (init_put_byte(s, buffer, buffer_size,
(h->flags & URL_WRONLY || h->flags & URL_RDWR), h,
url_read_packet, url_write_packet, url_seek_packet) < 0) {
av_free(buffer);
s->buffer = buffer;
s->buffer_size = buf_size;
s->buf_ptr = buffer;
- if (!s->write_flag)
+ if (!s->write_flag)
s->buf_end = buffer;
else
s->buf_end = buffer + buf_size;
int url_fclose(ByteIOContext *s)
{
URLContext *h = s->opaque;
-
+
av_free(s->buffer);
memset(s, 0, sizeof(ByteIOContext));
return url_close(h);
return buf;
}
-/*
+/*
* Return the maximum packet size associated to packetized buffered file
* handle. If the file is not packetized (stream like http or file on
* disk), then 0 is returned.
- *
+ *
* @param h buffered file handle
* @return maximum packet size in bytes
*/
/* buffer handling */
int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags)
{
- return init_put_byte(s, buf, buf_size,
+ return init_put_byte(s, buf, buf_size,
(flags & URL_WRONLY || flags & URL_RDWR),
NULL, NULL, NULL, NULL);
}
{
DynBuffer *d = opaque;
int new_size, new_allocated_size;
-
+
/* reallocate buffer if needed */
new_size = d->pos + buf_size;
new_allocated_size = d->allocated_size;
if (!new_allocated_size)
new_allocated_size = new_size;
else
- new_allocated_size += new_allocated_size / 2 + 1;
+ new_allocated_size += new_allocated_size / 2 + 1;
}
-
+
if (new_allocated_size > d->allocated_size) {
d->buffer = av_realloc(d->buffer, new_allocated_size);
if(d->buffer == NULL)
{
DynBuffer *d;
int io_buffer_size, ret;
-
- if (max_packet_size)
+
+ if (max_packet_size)
io_buffer_size = max_packet_size;
else
io_buffer_size = 1024;
-
+
if(sizeof(DynBuffer) + io_buffer_size < io_buffer_size)
return -1;
d = av_malloc(sizeof(DynBuffer) + io_buffer_size);
d->pos = 0;
d->size = 0;
d->allocated_size = 0;
- ret = init_put_byte(s, d->io_buffer, io_buffer_size,
- 1, d, NULL,
- max_packet_size ? dyn_packet_buf_write : dyn_buf_write,
+ ret = init_put_byte(s, d->io_buffer, io_buffer_size,
+ 1, d, NULL,
+ max_packet_size ? dyn_packet_buf_write : dyn_buf_write,
max_packet_size ? NULL : dyn_buf_seek);
if (ret == 0) {
s->max_packet_size = max_packet_size;
/*
* Open a write only memory stream.
- *
+ *
* @param s new IO context
* @return zero if no error.
*/
* Open a write only packetized memory stream with a maximum packet
* size of 'max_packet_size'. The stream is stored in a memory buffer
* with a big endian 4 byte header giving the packet size in bytes.
- *
+ *
* @param s new IO context
- * @param max_packet_size maximum packet size (must be > 0)
+ * @param max_packet_size maximum packet size (must be > 0)
* @return zero if no error.
*/
int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size)
return url_open_dyn_buf_internal(s, max_packet_size);
}
-/*
+/*
* Return the written size and a pointer to the buffer. The buffer
- * must be freed with av_free().
+ * must be freed with av_free().
* @param s IO context
* @param pointer to a byte buffer
* @return the length of the byte buffer
int inet_aton (const char * str, struct in_addr * add) {
const char * pch = str;
unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
-
+
add1 = atoi(pch);
pch = strpbrk(pch,".");
if (pch == 0 || ++pch == 0) goto done;
done:
add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
-
- return 1;
+
+ return 1;
}
-/*
+/*
* CRC decoder (for codec/format testing)
* Copyright (c) 2002 Fabrice Bellard.
*
* 1 then it is clamped to buf_size - 1.
* NOTE: this function does what strncpy should have done to be
* useful. NEVER use strncpy.
- *
+ *
* @param buf destination buffer
* @param buf_size size of destination buffer
* @param str source string
{
int len;
len = strlen(buf);
- if (len < buf_size)
+ if (len < buf_size)
pstrcpy(buf + len, buf_size - len, s);
return buf;
}
y--;
}
- t = 86400 *
+ t = 86400 *
(d + (153 * m - 457) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 719469);
t += 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec;
#define ISLEAP(y) (((y) % 4 == 0) && (((y) % 100) != 0 || ((y) % 400) == 0))
#define LEAPS_COUNT(y) ((y)/4 - (y)/100 + (y)/400)
-/* this is our own gmtime_r. it differs from its POSIX counterpart in a
+/* this is our own gmtime_r. it differs from its POSIX counterpart in a
couple of places, though. */
struct tm *brktimegm(time_t secs, struct tm *tm)
-{
+{
int days, y, ny, m;
int md[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
}
/* small strptime for ffmpeg */
-const char *small_strptime(const char *p, const char *fmt,
+const char *small_strptime(const char *p, const char *fmt,
struct tm *dt)
{
int c, val;
for (fmt = dc1394_frame_formats; fmt->width; fmt++)
if (fmt->pix_fmt == ap->pix_fmt && fmt->width == ap->width && fmt->height == ap->height)
break;
-
+
for (fps = dc1394_frame_rates; fps->frame_rate; fps++)
if (fps->frame_rate == av_rescale(1000, ap->time_base.den, ap->time_base.num))
break;
-
+
/* create a video stream */
vst = av_new_stream(c, 0);
if (!vst)
dc1394->packet.size = avpicture_get_size(fmt->pix_fmt, fmt->width, fmt->height);
dc1394->packet.stream_index = vst->index;
dc1394->packet.flags |= PKT_FLAG_KEY;
-
+
dc1394->current_frame = 0;
dc1394->fps = fps->frame_rate;
vst->codec->bit_rate = av_rescale(dc1394->packet.size * 8, fps->frame_rate, 1000);
-
+
/* Now lets prep the hardware */
dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */
if (!dc1394->handle) {
camera_nodes = dc1394_get_camera_nodes(dc1394->handle, &res, 1);
if (!camera_nodes || camera_nodes[ap->channel] == DC1394_NO_CAMERA) {
av_log(c, AV_LOG_ERROR, "There's no IIDC camera on the channel %d\n", ap->channel);
- goto out_handle;
+ goto out_handle;
}
- res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[ap->channel],
+ res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[ap->channel],
0,
FORMAT_VGA_NONCOMPRESSED,
fmt->frame_size_id,
SPEED_400,
- fps->frame_rate_id, 8, 1,
- ap->device,
+ fps->frame_rate_id, 8, 1,
+ ap->device,
&dc1394->camera);
dc1394_free_camera_nodes(camera_nodes);
if (res != DC1394_SUCCESS) {
av_log(c, AV_LOG_ERROR, "Can't start isochronous transmission\n");
goto out_handle_dma;
}
-
+
return 0;
out_handle_dma:
{
struct dc1394_data *dc1394 = c->priv_data;
int res;
-
+
/* discard stale frame */
if (dc1394->current_frame++) {
if (dc1394_dma_done_with_buffer(&dc1394->camera) != DC1394_SUCCESS)
av_log(c, AV_LOG_ERROR, "failed to release %d frame\n", dc1394->current_frame);
}
-
+
res = dc1394_dma_single_capture(&dc1394->camera);
if (res == DC1394_SUCCESS) {
- dc1394->packet.data = (uint8_t *)(dc1394->camera.capture_buffer);
- dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->fps;
+ dc1394->packet.data = (uint8_t *)(dc1394->camera.capture_buffer);
+ dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->fps;
res = dc1394->packet.size;
} else {
av_log(c, AV_LOG_ERROR, "DMA capture failed\n");
dc1394->packet.data = NULL;
- res = -1;
+ res = -1;
}
-
+
*pkt = dc1394->packet;
return res;
}
dc1394_dma_unlisten(dc1394->handle, &dc1394->camera);
dc1394_dma_release_camera(dc1394->handle, &dc1394->camera);
dc1394_destroy_handle(dc1394->handle);
-
+
return 0;
}
-/*
- * General DV muxer/demuxer
+/*
+ * General DV muxer/demuxer
* Copyright (c) 2003 Roman Shaposhnick
*
* Many thanks to Dan Dennedy <dan@dennedy.org> for providing wealth
struct DVDemuxContext {
AVFormatContext* fctx;
AVStream* vst;
- AVStream* ast[2];
+ AVStream* ast[2];
AVPacket audio_pkt[2];
uint8_t audio_buf[2][8192];
int ach;
};
enum dv_pack_type {
- dv_header525 = 0x3f, /* see dv_write_pack for important details on */
+ dv_header525 = 0x3f, /* see dv_write_pack for important details on */
dv_header625 = 0xbf, /* these two packs */
dv_timecode = 0x13,
dv_audio_source = 0x50,
/*
* The reason why the following three big ugly looking tables are
- * here is my lack of DV spec IEC 61834. The tables were basically
- * constructed to make code that places packs in SSYB, VAUX and
+ * here is my lack of DV spec IEC 61834. The tables were basically
+ * constructed to make code that places packs in SSYB, VAUX and
* AAUX blocks very simple and table-driven. They conform to the
* SMPTE 314M and the output of my personal DV camcorder, neither
* of which is sufficient for a reliable DV stream producing. Thus
* while code is still in development I'll be gathering input from
* people with different DV equipment and modifying the tables to
* accommodate all the quirks. Later on, if possible, some of them
- * will be folded into smaller tables and/or switch-if logic. For
+ * will be folded into smaller tables and/or switch-if logic. For
* now, my only excuse is -- they don't eat up that much of a space.
*/
};
static const int dv_vaux_packs_dist[12][15] = {
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
- { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
+ { 0x60, 0x61, 0x62, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x61, 0x62, 0x63, 0xff, 0xff },
};
static inline uint16_t dv_audio_12to16(uint16_t sample)
{
uint16_t shift, result;
-
+
sample = (sample < 0x800) ? sample : sample | 0xf000;
shift = (sample & 0xf00) >> 8;
buf[2] = (0 << 7) | /* TF1: audio data is 0 - valid; 1 - invalid */
(0x0f << 3) | /* reserved -- always 1 */
(0 & 0x07); /* AP1: Audio application ID */
- buf[3] = (0 << 7) | /* TF2: video data is 0 - valid; 1 - invalid */
+ buf[3] = (0 << 7) | /* TF2: video data is 0 - valid; 1 - invalid */
(0x0f << 3) | /* reserved -- always 1 */
(0 & 0x07); /* AP2: Video application ID */
- buf[4] = (0 << 7) | /* TF3: subcode(SSYB) is 0 - valid; 1 - invalid */
+ buf[4] = (0 << 7) | /* TF3: subcode(SSYB) is 0 - valid; 1 - invalid */
(0x0f << 3) | /* reserved -- always 1 */
(0 & 0x07); /* AP3: Subcode application ID */
break;
case dv_timecode:
- ct = (time_t)(c->frames / ((float)c->sys->frame_rate /
+ ct = (time_t)(c->frames / ((float)c->sys->frame_rate /
(float)c->sys->frame_rate_base));
brktimegm(ct, &tc);
- /*
- * LTC drop-frame frame counter drops two frames (0 and 1) every
+ /*
+ * LTC drop-frame frame counter drops two frames (0 and 1) every
* minute, unless it is exactly divisible by 10
*/
ltc_frame = (c->frames + 2*ct/60 - 2*ct/600) % c->sys->ltc_divisor;
buf[4] = (1 << 7) | /* emphasis: 1 -- off */
(0 << 6) | /* emphasis time constant: 0 -- reserved */
(0 << 3) | /* frequency: 0 -- 48Khz, 1 -- 44,1Khz, 2 -- 32Khz */
- 0; /* quantization: 0 -- 16bit linear, 1 -- 12bit nonlinear */
+ 0; /* quantization: 0 -- 16bit linear, 1 -- 12bit nonlinear */
break;
case dv_audio_control:
buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */
buf[2] = (1 << 7) | /* recording start point: 1 -- no */
(1 << 6) | /* recording end point: 1 -- no */
(1 << 3) | /* recording mode: 1 -- original */
- 7;
+ 7;
buf[3] = (1 << 7) | /* direction: 1 -- forward */
0x20; /* speed */
buf[4] = (1 << 7) | /* reserved -- always 1 */
break;
case dv_audio_recdate:
case dv_video_recdate: /* VAUX recording date */
- ct = c->start_time + (time_t)(c->frames /
+ ct = c->start_time + (time_t)(c->frames /
((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
brktimegm(ct, &tc);
buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */
break;
case dv_audio_rectime: /* AAUX recording time */
case dv_video_rectime: /* VAUX recording time */
- ct = c->start_time + (time_t)(c->frames /
+ ct = c->start_time + (time_t)(c->frames /
((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
brktimegm(ct, &tc);
buf[1] = (3 << 6) | /* reserved -- always 1 */
0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */
- buf[2] = (1 << 7) | /* reserved -- always 1 */
+ buf[2] = (1 << 7) | /* reserved -- always 1 */
((tc.tm_sec / 10) << 4) | /* Tens of seconds */
(tc.tm_sec % 10); /* Units of seconds */
buf[3] = (1 << 7) | /* reserved -- always 1 */
((tc.tm_min / 10) << 4) | /* Tens of minutes */
(tc.tm_min % 10); /* Units of minutes */
- buf[4] = (3 << 6) | /* reserved -- always 1 */
+ buf[4] = (3 << 6) | /* reserved -- always 1 */
((tc.tm_hour / 10) << 4) | /* Tens of hours */
(tc.tm_hour % 10); /* Units of hours */
break;
return 5;
}
-static inline int dv_write_dif_id(enum dv_section_type t, uint8_t seq_num,
+static inline int dv_write_dif_id(enum dv_section_type t, uint8_t seq_num,
uint8_t dif_num, uint8_t* buf)
{
buf[0] = (uint8_t)t; /* Section type */
buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
(0<<4) | /* AP3 (Subcode application ID) */
0x0f; /* reserved -- always 1 */
- }
+ }
else if (syb_num == 11) {
buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
0x7f; /* reserved -- always 1 */
static void dv_format_frame(DVMuxContext *c, uint8_t* buf)
{
int i, j, k;
-
+
for (i = 0; i < c->sys->difseg_size; i++) {
memset(buf, 0xff, 80 * 6); /* First 6 DIF blocks are for control data */
-
+
/* DV header: 1DIF */
buf += dv_write_dif_id(dv_sect_header, i, 0, buf);
buf += dv_write_pack((c->sys->dsf ? dv_header625 : dv_header525), c, buf);
buf += 72; /* unused bytes */
-
+
/* DV subcode: 2DIFs */
for (j = 0; j < 2; j++) {
buf += dv_write_dif_id( dv_sect_subcode, i, j, buf);
}
buf += 29; /* unused bytes */
}
-
+
/* DV VAUX: 3DIFs */
for (j = 0; j < 3; j++) {
buf += dv_write_dif_id(dv_sect_vaux, i, j, buf);
for (k = 0; k < 15 ; k++)
buf += dv_write_pack(dv_vaux_packs_dist[i][k], c, buf);
buf += 2; /* unused bytes */
- }
-
+ }
+
/* DV Audio/Video: 135 Video DIFs + 9 Audio DIFs */
for (j = 0; j < 135; j++) {
if (j%15 == 0) {
of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride;
if (of*2 >= size)
continue;
-
+
frame_ptr[d] = pcm[of*2+1]; // FIXME: may be we have to admit
- frame_ptr[d+1] = pcm[of*2]; // that DV is a big endian PCM
+ frame_ptr[d+1] = pcm[of*2]; // that DV is a big endian PCM
}
frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
}
}
}
-/*
+/*
* This is the dumbest implementation of all -- it simply looks at
* a fixed offset and if pack isn't there -- fails. We might want
* to have a fallback mechanism for complete search of missing packs.
static const uint8_t* dv_extract_pack(uint8_t* frame, enum dv_pack_type t)
{
int offs;
-
+
switch (t) {
case dv_audio_source:
offs = (80*6 + 80*16*3 + 3);
break;
default:
return NULL;
- }
+ }
return (frame[offs] == t ? &frame[offs] : NULL);
}
-/*
+/*
* There's a couple of assumptions being made here:
* 1. By default we silence erroneous (0x8000/16bit 0x800/12bit) audio samples.
* We can pass them upwards when ffmpeg will be ready to deal with them.
uint16_t lc, rc;
const DVprofile* sys;
const uint8_t* as_pack;
-
+
as_pack = dv_extract_pack(frame, dv_audio_source);
if (!as_pack) /* No audio ? */
return 0;
-
+
sys = dv_frame_profile(frame);
smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
freq = (as_pack[4] >> 3) & 0x07; /* 0 - 48KHz, 1 - 44,1kHz, 2 - 32 kHz */
quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
-
+
if (quant > 1)
return -1; /* Unsupported quantization */
of = sys->audio_shuffle[i][j] + (d - 8)/2 * sys->audio_stride;
if (of*2 >= size)
continue;
-
+
pcm[of*2] = frame[d+1]; // FIXME: may be we have to admit
pcm[of*2+1] = frame[d]; // that DV is a big endian PCM
if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00)
pcm[of*2+1] = 0;
} else { /* 12bit quantization */
- lc = ((uint16_t)frame[d] << 4) |
+ lc = ((uint16_t)frame[d] << 4) |
((uint16_t)frame[d+2] >> 4);
rc = ((uint16_t)frame[d+1] << 4) |
((uint16_t)frame[d+2] & 0x0f);
pcm[of*2] = lc & 0xff; // FIXME: may be we have to admit
pcm[of*2+1] = lc >> 8; // that DV is a big endian PCM
- of = sys->audio_shuffle[i%half_ch+half_ch][j] +
+ of = sys->audio_shuffle[i%half_ch+half_ch][j] +
(d - 8)/3 * sys->audio_stride;
pcm[of*2] = rc & 0xff; // FIXME: may be we have to admit
pcm[of*2+1] = rc >> 8; // that DV is a big endian PCM
++d;
}
}
-
+
frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
}
}
c->ach = 0;
return 0;
}
-
+
smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
freq = (as_pack[4] >> 3) & 0x07; /* 0 - 48KHz, 1 - 44,1kHz, 2 - 32 kHz */
quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
c->ast[i]->start_time = 0;
}
c->ach = i;
-
+
return (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */;
}
static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
{
- const DVprofile* sys;
+ const DVprofile* sys;
const uint8_t* vsc_pack;
AVCodecContext* avctx;
int apt, is16_9;
int size = 0;
-
+
sys = dv_frame_profile(frame);
if (sys) {
avctx = c->vst->codec;
-
+
av_set_pts_info(c->vst, 64, sys->frame_rate_base, sys->frame_rate);
avctx->time_base= (AVRational){sys->frame_rate_base, sys->frame_rate};
if(!avctx->width){
avctx->height = sys->height;
}
avctx->pix_fmt = sys->pix_fmt;
-
+
/* finding out SAR is a little bit messy */
vsc_pack = dv_extract_pack(frame, dv_video_control);
apt = frame[4] & 0x07;
is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
(!apt && (vsc_pack[2] & 0x07) == 0x07)));
avctx->sample_aspect_ratio = sys->sar[is16_9];
-
+
size = sys->frame_size;
}
return size;
}
-/*
+/*
* The following 6 functions constitute our interface to the world
*/
{
uint8_t pcm[8192];
int fsize, reqasize;
-
+
*frame = &c->frame_buf[0];
if (c->has_audio && c->has_video) { /* must be a stale frame */
dv_format_frame(c, *frame);
c->has_audio = 0;
c->has_video = 0;
}
-
+
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
/* FIXME: we have to have more sensible approach than this one */
if (c->has_video)
av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames);
-
+
dv_inject_video(c, data, *frame);
c->has_video = 1;
data_size = 0;
if (c->has_audio < 0)
goto out;
- }
-
+ }
+
reqasize = 4 * dv_audio_frame_size(c->sys, c->frames);
fsize = fifo_size(&c->audio_data, c->audio_data.rptr);
- if (st->codec->codec_type == CODEC_TYPE_AUDIO || (c->has_video && fsize >= reqasize)) {
+ if (st->codec->codec_type == CODEC_TYPE_AUDIO || (c->has_video && fsize >= reqasize)) {
if (fsize + data_size >= reqasize && !c->has_audio) {
if (fsize >= reqasize) {
fifo_read(&c->audio_data, &pcm[0], reqasize, &c->audio_data.rptr);
dv_inject_audio(c, &pcm[0], *frame);
c->has_audio = 1;
}
-
+
/* FIXME: we have to have more sensible approach than this one */
if (fifo_size(&c->audio_data, c->audio_data.rptr) + data_size >= 100*AVCODEC_MAX_AUDIO_FRAME_SIZE)
av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames);
goto bail_out;
}
}
-
+
/* Some checks -- DV format is very picky about its incoming streams */
if (!vst || vst->codec->codec_id != CODEC_ID_DVVIDEO)
goto bail_out;
c->sys = dv_codec_profile(vst->codec);
if (!c->sys)
goto bail_out;
-
+
/* Ok, everything seems to be in working order */
c->frames = 0;
c->has_audio = ast ? 0 : -1;
c->has_video = 0;
c->start_time = (time_t)s->timestamp;
c->aspect = 0; /* 4:3 is the default */
- if ((int)(av_q2d(vst->codec->sample_aspect_ratio) * vst->codec->width / vst->codec->height * 10) == 17) /* 16:9 */
+ if ((int)(av_q2d(vst->codec->sample_aspect_ratio) * vst->codec->width / vst->codec->height * 10) == 17) /* 16:9 */
c->aspect = 0x07;
if (ast && fifo_init(&c->audio_data, 100*AVCODEC_MAX_AUDIO_FRAME_SIZE) < 0)
dv_format_frame(c, &c->frame_buf[0]);
return c;
-
+
bail_out:
av_free(c);
return NULL;
}
void dv_delete_mux(DVMuxContext *c)
-{
+{
fifo_free(&c->audio_data);
}
c->vst = av_new_stream(s, 0);
if (!c->vst) {
- av_free(c);
+ av_free(c);
return NULL;
}
c->vst->codec->codec_id = CODEC_ID_DVVIDEO;
c->vst->codec->bit_rate = 25000000;
c->vst->start_time = 0;
-
+
return c;
}
return size;
}
-int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
+int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t* buf, int buf_size)
{
int size, i;
const DVprofile* sys = dv_frame_profile(buf);
-
+
if (buf_size < 4 || buf_size < sys->frame_size)
return -1; /* Broken frame, or not enough data */
}
dv_extract_audio(buf, c->audio_buf[0], c->audio_buf[1]);
c->abytes += size;
-
+
/* Now it's time to return video packet */
size = dv_extract_video_info(c, buf);
av_init_packet(pkt);
pkt->data = buf;
- pkt->size = size;
+ pkt->size = size;
pkt->flags |= PKT_FLAG_KEY;
pkt->stream_index = c->vst->id;
pkt->pts = c->frames;
-
+
c->frames++;
return size;
}
-
+
static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
int64_t timestamp, int flags)
{
int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;
offset = sys->frame_size * timestamp;
-
+
if (offset > max_offset) offset = max_offset;
else if (offset < 0) offset = 0;
/************************************************************
* Implementation of the easiest DV storage of all -- raw DV.
************************************************************/
-
+
typedef struct RawDVContext {
uint8_t buf[144000];
DVDemuxContext* dv_demux;
c->dv_demux = dv_init_demux(s);
if (!c->dv_demux)
return -1;
-
+
if (get_buffer(&s->pb, c->buf, 4) <= 0 || url_fseek(&s->pb, -4, SEEK_CUR) < 0)
return AVERROR_IO;
sys = dv_frame_profile(c->buf);
s->bit_rate = av_rescale(sys->frame_size * 8, sys->frame_rate, sys->frame_rate_base);
-
+
return 0;
}
static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int size;
- RawDVContext *c = s->priv_data;
-
+ RawDVContext *c = s->priv_data;
+
size = dv_get_packet(c->dv_demux, pkt);
-
+
if (size < 0) {
- if (get_buffer(&s->pb, c->buf, 4) <= 0)
+ if (get_buffer(&s->pb, c->buf, 4) <= 0)
return AVERROR_IO;
-
+
size = dv_frame_profile(c->buf)->frame_size;
if (get_buffer(&s->pb, c->buf + 4, size - 4) <= 0)
return AVERROR_IO;
size = dv_produce_packet(c->dv_demux, pkt, c->buf, size);
- }
-
+ }
+
return size;
}
-static int dv_read_seek(AVFormatContext *s, int stream_index,
+static int dv_read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
RawDVContext *r = s->priv_data;
c->abytes= av_rescale(c->frames,
c->ast[0]->codec->bit_rate * (int64_t)sys->frame_rate_base,
8*sys->frame_rate);
-
+
dv_flush_audio_packets(c);
return url_fseek(&s->pb, offset, SEEK_SET);
}
{
uint8_t* frame;
int fsize;
-
+
fsize = dv_assemble_frame((DVMuxContext *)s->priv_data, s->streams[pkt->stream_index],
pkt->data, pkt->size, &frame);
if (fsize > 0) {
- put_buffer(&s->pb, frame, fsize);
+ put_buffer(&s->pb, frame, fsize);
put_flush_packet(&s->pb);
- }
+ }
return 0;
}
-/*
+/*
* We might end up with some extra A/V data without matching counterpart.
* E.g. video data without enough audio to write the complete frame.
- * Currently we simply drop the last frame. I don't know whether this
+ * Currently we simply drop the last frame. I don't know whether this
* is the best strategy of all
*/
static int dv_write_trailer(struct AVFormatContext *s)
-/*
- * General DV muxer/demuxer
+/*
+ * General DV muxer/demuxer
* Copyright (c) 2003 Roman Shaposhnick
*
* Many thanks to Dan Dennedy <dan@dennedy.org> for providing wealth
DVDemuxContext* dv_demux; /* Generic DV muxing/demuxing context */
};
-/*
+/*
* The trick here is to kludge around well known problem with kernel Ooopsing
- * when you try to capture PAL on a device node configure for NTSC. That's
+ * when you try to capture PAL on a device node configure for NTSC. That's
* why we have to configure the device node for PAL, and then read only NTSC
* amount of data.
*/
/* This usually means that ring buffer overflowed.
* We have to reset :(.
*/
-
+
av_log(context, AV_LOG_ERROR, "DV1394: Ring buffer overflow. Reseting ..\n");
-
+
dv1394_reset(dv);
dv1394_start(dv);
}
dv->done);
#endif
- size = dv_produce_packet(dv->dv_demux, pkt,
- dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE),
+ size = dv_produce_packet(dv->dv_demux, pkt,
+ dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE),
DV1394_PAL_FRAME_SIZE);
dv->index = (dv->index + 1) % DV1394_RING_FRAMES;
dv->done++; dv->avail--;
-
+
return size;
}
To set the DV output parameters (e.g. whether you want NTSC or PAL
video), use the DV1394_INIT ioctl, passing in the parameters you
want in a struct dv1394_init.
-
+
Example 1:
To play a raw .DV file: cat foo.DV > /dev/dv1394
(cat will use write() internally)
2)
For more control over buffering, and to avoid unnecessary copies
- of the DV data, you can use the more sophisticated the mmap() interface.
- First, call the DV1394_INIT ioctl to specify your parameters,
- including the number of frames in the ringbuffer. Then, calling mmap()
+ of the DV data, you can use the more sophisticated the mmap() interface.
+ First, call the DV1394_INIT ioctl to specify your parameters,
+ including the number of frames in the ringbuffer. Then, calling mmap()
on the dv1394 device will give you direct access to the ringbuffer
from which the DV card reads your frame data.
*--------------------------------------*
| CLEAR | DV data | DV data | CLEAR |
*--------------------------------------*
- <ACTIVE>
+ <ACTIVE>
transmission goes in this direction --->>>
will continue to transmit frame 2, and will increase the dropped_frames
counter each time it repeats the transmission).
-
+
If you called DV1394_GET_STATUS at this instant, you would
receive the following values:
-
+
n_frames = 4
active_frame = 1
first_clear_frame = 3
(checks of system call return values omitted for brevity; always
check return values in your code!)
-
+
while( frames left ) {
-
+
struct pollfd *pfd = ...;
pfd->fd = dv1394_fd;
pfd->events = POLLOUT | POLLIN; (OUT for transmit, IN for receive)
(add other sources of I/O here)
-
+
poll(pfd, 1, -1); (or select(); add a timeout if you want)
if(pfd->revents) {
struct dv1394_status status;
-
+
ioctl(dv1394_fd, DV1394_GET_STATUS, &status);
if(status.dropped_frames > 0) {
should close the dv1394 file descriptor (and munmap() all
ringbuffer mappings, if you are using them), then re-open the
dv1394 device (and re-map the ringbuffer).
-
+
*/
struct dv1394_init {
/* DV1394_API_VERSION */
unsigned int api_version;
-
+
/* isochronous transmission channel to use */
unsigned int channel;
enum pal_or_ntsc format;
/* the following are used only for transmission */
-
+
/* set these to zero unless you want a
non-default empty packet rate (see below) */
unsigned long cip_n;
would imply a different size for the ringbuffer). If you need a
different buffer size, simply close and re-open the device, then
initialize it with your new settings. */
-
+
/* Q: What are cip_n and cip_d? */
/*
The default empty packet insertion rate seems to work for many people; if
your DV output is stable, you can simply ignore this discussion. However,
we have exposed the empty packet rate as a parameter to support devices that
- do not work with the default rate.
+ do not work with the default rate.
The decision to insert an empty packet is made with a numerator/denominator
algorithm. Empty packets are produced at an average rate of CIP_N / CIP_D.
You can alter the empty packet rate by passing non-zero values for cip_n
and cip_d to the INIT ioctl.
-
+
*/
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_EA_MJPEG;
st->codec->codec_tag = 0; /* no fourcc */
-#endif
+#endif
/* initialize the audio decoder stream */
st = av_new_stream(s, 0);
pkt->pts *= ea->audio_frame_counter;
pkt->pts /= EA_SAMPLE_RATE;
- /* 2 samples/byte, 1 or 2 samples per frame depending
+ /* 2 samples/byte, 1 or 2 samples per frame depending
* on stereo; chunk also has 12-byte header */
ea->audio_frame_counter += ((chunk_size - 12) * 2) /
ea->num_channels;
fill_size = ffm->packet_end - ffm->packet_ptr;
memset(ffm->packet_ptr, 0, fill_size);
- if (url_ftell(pb) % ffm->packet_size)
+ if (url_ftell(pb) % ffm->packet_size)
av_abort();
/* put header */
pts = get_pts(s, pos_max);
- if (pts - 100000 > pts_start)
+ if (pts - 100000 > pts_start)
goto end;
ffm->write_index = FFM_PACKET_SIZE;
if (!fst)
goto fail;
s->streams[i] = st;
-
+
av_set_pts_info(st, 64, 1, 1000000);
-
+
st->priv_data = fst;
codec = st->codec;
printf("pos=%08Lx spos=%Lx, write_index=%Lx size=%Lx\n",
url_ftell(&s->pb), s->pb.pos, ffm->write_index, ffm->file_size);
#endif
- if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
+ if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
FRAME_HEADER_SIZE)
return -EAGAIN;
#if 0
av_new_packet(pkt, size);
pkt->stream_index = ffm->header[0];
- pkt->pos = url_ftell(&s->pb);
+ pkt->pos = url_ftell(&s->pb);
if (ffm->header[1] & FLAG_KEY_FRAME)
pkt->flags |= PKT_FLAG_KEY;
static int ffm_probe(AVProbeData *p)
{
if (p->buf_size >= 4 &&
- p->buf[0] == 'F' && p->buf[1] == 'F' && p->buf[2] == 'M' &&
+ p->buf[0] == 'F' && p->buf[1] == 'F' && p->buf[2] == 'M' &&
p->buf[3] == '1')
return AVPROBE_SCORE_MAX + 1;
return 0;
static offset_t file_seek(URLContext *h, offset_t pos, int whence)
{
int fd = (size_t)h->priv_data;
-#if defined(CONFIG_WIN32) && !defined(__CYGWIN__)
+#if defined(CONFIG_WIN32) && !defined(__CYGWIN__)
return _lseeki64(fd, pos, whence);
#else
return lseek(fd, pos, whence);
#define FLIC_FILE_MAGIC_1 0xAF11
#define FLIC_FILE_MAGIC_2 0xAF12
-#define FLIC_FILE_MAGIC_3 0xAF44 /* Flic Type for Extended FLX Format which
+#define FLIC_FILE_MAGIC_3 0xAF44 /* Flic Type for Extended FLX Format which
originated in Dave's Targa Animator (DTA) */
#define FLIC_CHUNK_MAGIC_1 0xF1FA
#define FLIC_CHUNK_MAGIC_2 0xF5FA
}
pkt->stream_index = flic->video_stream_index;
pkt->pts = flic->pts;
- pkt->pos = url_ftell(pb);
+ pkt->pos = url_ftell(pb);
memcpy(pkt->data, preamble, FLIC_PREAMBLE_SIZE);
- ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE,
+ ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE,
size - FLIC_PREAMBLE_SIZE);
if (ret != size - FLIC_PREAMBLE_SIZE) {
av_free_packet(pkt);
AVFormatParameters *ap)
{
int offset, flags;
-
+
s->ctx_flags |= AVFMTCTX_NOHEADER; //ok we have a header but theres no fps, codec type, sample_rate, ...
url_fskip(&s->pb, 4);
{
int ret, i, type, size, pts, flags, is_audio, next;
AVStream *st = NULL;
-
+
for(;;){
url_fskip(&s->pb, 4); /* size of previous packet */
type = get_byte(&s->pb);
return AVERROR_IO;
url_fskip(&s->pb, 4); /* reserved */
flags = 0;
-
+
if(size == 0)
continue;
-
+
next= size + url_ftell(&s->pb);
if (type == 8) {
char tmp[128];
int type, len;
double d= 0;
-
+
len= get_be16(&s->pb);
if(len >= sizeof(tmp) || !len)
break;
get_buffer(&s->pb, tmp, len);
tmp[len]=0;
-
+
type= get_byte(&s->pb);
if(type==0){
d= av_int2dbl(get_be64(&s->pb));
d= av_int2dbl(get_be64(&s->pb));
get_be16(&s->pb);
}
-
+
if(!strcmp(tmp, "duration")){
s->duration = d*AV_TIME_BASE;
}else if(!strcmp(tmp, "videodatarate")){
pkt->size = ret;
pkt->pts = pts;
pkt->stream_index = st->index;
-
+
if (is_audio || ((flags >> 4)==1))
pkt->flags |= PKT_FLAG_KEY;
-
+
return ret;
}
if (enc->channels > 1) {
flags |= 0x01;
}
-
+
switch(enc->codec_id){
case CODEC_ID_MP3:
flags |= 0x20 | 0x2;
av_log(enc, AV_LOG_ERROR, "codec not compatible with flv\n");
return -1;
}
-
+
return flags;
}
put_byte(pb,0); // delayed write
put_be32(pb,9);
put_be32(pb,0);
-
+
for(i=0; i<s->nb_streams; i++){
AVCodecContext *enc = s->streams[i]->codec;
av_set_pts_info(s->streams[i], 24, 1, 1000); /* 24 bit pts in ms */
int flags;
// av_log(s, AV_LOG_DEBUG, "type:%d pts: %lld size:%d\n", enc->codec_type, timestamp, size);
-
+
if (enc->codec_type == CODEC_TYPE_VIDEO) {
put_byte(pb, 9);
flags = 2; // choose h263
} else {
assert(enc->codec_type == CODEC_TYPE_AUDIO);
flags = get_audio_flags(enc);
-
+
assert(size);
put_byte(pb, 8);
put_byte(pb,flags);
put_buffer(pb, pkt->data, size);
put_be32(pb,size+1+11); // previous tag size
-
+
put_flush_packet(pb);
return 0;
}
#define _FRAMEHOOK_H
/*
- * Prototypes for interface to .so that implement a video processing hook
+ * Prototypes for interface to .so that implement a video processing hook
*/
#include "avcodec.h"
/* we use the standard 216 color palette */
/* this script was used to create the palette:
- * for r in 00 33 66 99 cc ff; do for g in 00 33 66 99 cc ff; do echo -n " "; for b in 00 33 66 99 cc ff; do
+ * for r in 00 33 66 99 cc ff; do for g in 00 33 66 99 cc ff; do echo -n " "; for b in 00 33 66 99 cc ff; do
* echo -n "{ 0x$r, 0x$g, 0x$b }, "; done; echo ""; done; done
*/
bit_cnt+=n;
} else {
bit_buf |= value << (bit_cnt);
-
+
*s->buf_ptr = bit_buf & 0xff;
s->buf_ptr[1] = (bit_buf >> 8) & 0xff;
s->buf_ptr[2] = (bit_buf >> 16) & 0xff;
s->buf_ptr[3] = (bit_buf >> 24) & 0xff;
-
+
//printf("bitbuf = %08x\n", bit_buf);
s->buf_ptr+=4;
if (s->buf_ptr >= s->buf_end)
/* !RevPutBitContext */
/* GIF header */
-static int gif_image_write_header(ByteIOContext *pb,
+static int gif_image_write_header(ByteIOContext *pb,
int width, int height, int loop_count,
uint32_t *palette)
{
byte 1 : 33 (hex 0x21) GIF Extension code
byte 2 : 255 (hex 0xFF) Application Extension Label
- byte 3 : 11 (hex (0x0B) Length of Application Block
+ byte 3 : 11 (hex (0x0B) Length of Application Block
(eleven bytes of data to follow)
bytes 4 to 11 : "NETSCAPE"
bytes 12 to 14 : "2.0"
- byte 15 : 3 (hex 0x03) Length of Data Sub-Block
+ byte 15 : 3 (hex 0x03) Length of Data Sub-Block
(three bytes of data to follow)
byte 16 : 1 (hex 0x01)
- bytes 17 to 18 : 0 to 65535, an unsigned integer in
- lo-hi byte format. This indicate the
- number of iterations the loop should
+ bytes 17 to 18 : 0 to 65535, an unsigned integer in
+ lo-hi byte format. This indicate the
+ number of iterations the loop should
be executed.
bytes 19 : 0 (hex 0x00) a Data Sub-block Terminator
*/
}
-static int gif_image_write_image(ByteIOContext *pb,
+static int gif_image_write_image(ByteIOContext *pb,
int x1, int y1, int width, int height,
const uint8_t *buf, int linesize, int pix_fmt)
{
left-=GIF_CHUNKS;
}
put_byte(pb, 0x00); /* end of image block */
-
+
return 0;
}
return 0;
}
-static int gif_write_video(AVFormatContext *s,
+static int gif_write_video(AVFormatContext *s,
AVCodecContext *enc, const uint8_t *buf, int size)
{
ByteIOContext *pb = &s->pb;
put_byte(pb, 0xf9);
put_byte(pb, 0x04); /* block size */
put_byte(pb, 0x04); /* flags */
-
+
/* 1 jiffy is 1/70 s */
/* the delay_time field indicates the number of jiffies - 1 */
delay = gif->file_time - gif->time;
/* better than nothing gif image writer */
int gif_write(ByteIOContext *pb, AVImageInfo *info)
{
- gif_image_write_header(pb, info->width, info->height, AVFMT_NOOUTPUTLOOP,
+ gif_image_write_header(pb, info->width, info->height, AVFMT_NOOUTPUTLOOP,
(uint32_t *)info->pict.data[1]);
- gif_image_write_image(pb, 0, 0, info->width, info->height,
- info->pict.data[0], info->pict.linesize[0],
+ gif_image_write_image(pb, 0, 0, info->width, info->height,
+ info->pict.data[0], info->pict.linesize[0],
PIX_FMT_PAL8);
put_byte(pb, 0x3b);
put_flush_packet(pb);
int gce_disposal;
/* delay during which the frame is shown */
int gce_delay;
-
+
/* LZW compatible decoder */
ByteIOContext *f;
int eob_reached;
palette = s->global_palette;
bits_per_pixel = s->bits_per_pixel;
}
-
+
/* verify that all the image is inside the screen dimensions */
if (left + width > s->screen_width ||
top + height > s->screen_height)
n = (1 << bits_per_pixel);
spal = palette;
for(i = 0; i < n; i++) {
- s->image_palette[i] = (0xff << 24) |
+ s->image_palette[i] = (0xff << 24) |
(spal[0] << 16) | (spal[1] << 8) | (spal[2]);
spal += 3;
}
ptr += linesize * 8;
if (y1 >= height) {
y1 = 4;
- if (pass == 0)
+ if (pass == 0)
ptr = ptr1 + linesize * 4;
else
ptr = ptr1 + linesize * 2;
}
}
av_free(line);
-
+
/* read the garbage data until end marker is found */
while (!s->eob_reached)
GetCode(s);
s->transparent_color_index = -1;
s->gce_disposal = (gce_flags >> 2) & 0x7;
#ifdef DEBUG
- printf("gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
- gce_flags, s->gce_delay,
+ printf("gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
+ gce_flags, s->gce_delay,
s->transparent_color_index, s->gce_disposal);
#endif
ext_len = get_byte(f);
break;
}
-
+
/* NOTE: many extension blocks can come after */
discard_ext:
while (ext_len != 0) {
s->transparent_color_index = -1;
s->screen_width = get_le16(f);
s->screen_height = get_le16(f);
- if( (unsigned)s->screen_width > 32767
+ if( (unsigned)s->screen_width > 32767
|| (unsigned)s->screen_height > 32767){
av_log(NULL, AV_LOG_ERROR, "picture size too large\n");
return -1;
- }
+ }
v = get_byte(f);
s->color_resolution = ((v & 0x70) >> 4) + 1;
s->f = f;
if (gif_read_header1(s) < 0)
return -1;
-
+
/* allocate image buffer */
s->image_linesize = s->screen_width * 3;
s->image_buf = av_malloc(s->screen_height * s->image_linesize);
}
/* read gif as image */
-static int gif_read(ByteIOContext *f,
+static int gif_read(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
{
GifState s1, *s = &s1;
if (!ap || ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0)
return -1;
-
+
width = ap->width;
height = ap->height;
frame_rate = ap->time_base.den;
if((unsigned)width > 32767 || (unsigned)height > 32767)
return -1;
-
+
st = av_new_stream(s1, 0);
if (!st)
return -ENOMEM;
perror(video_device);
goto fail;
}
-
+
if (ioctl(video_fd,VIDIOCGCAP, &s->video_cap) < 0) {
perror("VIDIOCGCAP");
goto fail;
desired_palette = VIDEO_PALETTE_YUV422;
} else if (st->codec->pix_fmt == PIX_FMT_BGR24) {
desired_palette = VIDEO_PALETTE_RGB24;
- }
+ }
/* set tv standard */
if (ap->standard && !ioctl(video_fd, VIDIOCGTUNER, &tuner)) {
tuner.mode = VIDEO_MODE_NTSC;
ioctl(video_fd, VIDIOCSTUNER, &tuner);
}
-
+
/* unmute audio */
audio.audio = 0;
ioctl(video_fd, VIDIOCGAUDIO, &audio);
pict.brightness,
pict.contrast,
pict.whiteness);
-#endif
+#endif
/* try to choose a suitable video format */
pict.palette = desired_palette;
if (desired_palette == -1 || (ret = ioctl(video_fd, VIDIOCSPICT, &pict)) < 0) {
if (ret < 0) {
pict.palette=VIDEO_PALETTE_RGB24;
ret = ioctl(video_fd, VIDIOCSPICT, &pict);
- if (ret < 0)
+ if (ret < 0)
goto fail1;
}
}
s->time_frame = av_gettime() * s->frame_rate / s->frame_rate_base;
s->use_mmap = 0;
-
+
/* ATI All In Wonder automatic activation */
if (!strcmp(s->video_cap.name, "Km")) {
if (aiw_init(s) < 0)
}
s->gb_frame = 0;
s->time_frame = av_gettime() * s->frame_rate / s->frame_rate_base;
-
+
/* start to grab the first frame */
s->gb_buf.frame = s->gb_frame % s->gb_buffers.frames;
s->gb_buf.height = height;
if (desired_palette == -1 || (ret = ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf)) < 0) {
s->gb_buf.format = VIDEO_PALETTE_YUV420P;
-
+
ret = ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf);
if (ret < 0 && errno != EAGAIN) {
/* try YUV422 */
s->gb_buf.format = VIDEO_PALETTE_YUV422;
-
+
ret = ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf);
if (ret < 0 && errno != EAGAIN) {
/* try RGB24 */
}
s->fd = video_fd;
s->frame_size = frame_size;
-
+
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_RAWVIDEO;
st->codec->width = width;
s->time_frame += int64_t_C(1000000);
}
break;
- }
+ }
ts.tv_sec = delay / 1000000;
ts.tv_nsec = (delay % 1000000) * 1000;
nanosleep(&ts, NULL);
if ((width == s->video_cap.maxwidth && height == s->video_cap.maxheight) ||
(width == s->video_cap.maxwidth && height == s->video_cap.maxheight*2) ||
(width == s->video_cap.maxwidth/2 && height == s->video_cap.maxheight)) {
-
+
s->deint=0;
s->halfw=0;
if (height == s->video_cap.maxheight*2) s->deint=1;
sum=(ptr[24]+ptr[26]+1) >> 1;lum[6]=sum; \
sum=(ptr[28]+ptr[30]+1) >> 1;lum[7]=sum; \
sum=(ptr[25]+ptr[29]+1) >> 1;cb[3]=sum; \
- sum=(ptr[27]+ptr[31]+1) >> 1;cr[3]=sum;
+ sum=(ptr[27]+ptr[31]+1) >> 1;cr[3]=sum;
#define LINE_NOUV_AVG \
sum=(ptr[0]+ptr[2]+1) >> 1;lum[0]=sum; \
sum=(ptr[16]+ptr[18]+1) >> 1;lum[4]=sum; \
sum=(ptr[20]+ptr[22]+1) >> 1;lum[5]=sum; \
sum=(ptr[24]+ptr[26]+1) >> 1;lum[6]=sum; \
- sum=(ptr[28]+ptr[30]+1) >> 1;lum[7]=sum;
+ sum=(ptr[28]+ptr[30]+1) >> 1;lum[7]=sum;
#define DEINT_LINE_LUM(ptroff) \
sum=(-lum_m4[(ptroff)]+(lum_m3[(ptroff)]<<2)+(lum_m2[(ptroff)]<<1)+(lum_m1[(ptroff)]<<2)-lum[(ptroff)]); \
video_buf_size = width * height * 12 / 8;
- video_buf = (uint8_t *)mmap((caddr_t)0, video_buf_size,
+ video_buf = (uint8_t *)mmap((caddr_t)0, video_buf_size,
PROT_READ, MAP_SHARED, *video_fd, (off_t)0);
if (video_buf == MAP_FAILED) {
perror("mmap");
}
if (frequency != 0.0) {
- ioctl_frequency = (unsigned long)(frequency*16);
+ ioctl_frequency = (unsigned long)(frequency*16);
if (ioctl(*tuner_fd, TVTUNER_SETFREQ, &ioctl_frequency) < 0)
perror("TVTUNER_SETFREQ");
}
h->priv_data = s;
proxy_path = getenv("http_proxy");
- use_proxy = (proxy_path != NULL) && !getenv("no_proxy") &&
+ use_proxy = (proxy_path != NULL) && !getenv("no_proxy") &&
strstart(proxy_path, "http://", NULL);
/* fill the dest addr */
redo:
/* needed in any case to build the host string */
- url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
+ url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
path1, sizeof(path1), uri);
if (port > 0) {
snprintf(hoststr, sizeof(hoststr), "%s:%d", hostname, port);
}
if (use_proxy) {
- url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
+ url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
NULL, 0, proxy_path);
path = uri;
} else {
static int process_line(HTTPContext *s, char *line, int line_count)
{
char *tag, *p;
-
+
/* end of header */
if (line[0] == '\0')
return 0;
} else {
while (*p != '\0' && *p != ':')
p++;
- if (*p != ':')
+ if (*p != ':')
return 1;
-
+
*p = '\0';
tag = line;
p++;
LIBAVFORMAT_IDENT,
hoststr,
b64_encode(auth));
-
+
if (http_write(h, s->buffer, strlen(s->buffer)) < 0)
return AVERROR_IO;
-
+
/* init input buffer */
s->buf_ptr = s->buffer;
s->buf_end = s->buffer;
sleep(1);
return 0;
}
-
+
/* wait for header */
q = line;
for(;;) {
/*****************************************************************************
* b64_encode: stolen from VLC's http.c
*****************************************************************************/
-
+
static char *b64_encode( const unsigned char *src )
{
static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
*dst++ = '=';
break;
}
-
+
while( i_shift >= 6 )
{
i_shift -= 6;
*dst++ = b64[(i_bits >> i_shift)&0x3f];
}
}
-
+
*dst++ = '\0';
-
+
return ret;
}
/* skip the number of decoded bytes (always equal to width * height) */
url_fseek(pb, 4, SEEK_CUR);
chunk_size -= 4;
- ret= av_get_packet(pb, pkt, chunk_size);
+ ret= av_get_packet(pb, pkt, chunk_size);
if (ret != chunk_size)
return AVERROR_IO;
pkt->stream_index = idcin->video_stream_index;
unsigned int chunk_type;
/* get the main header */
- if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
+ if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
RoQ_CHUNK_PREAMBLE_SIZE)
return AVERROR_IO;
roq->framerate = LE_16(&preamble[6]);
roq->frame_pts_inc = 90000 / roq->framerate;
/* init private context parameters */
- roq->width = roq->height = roq->audio_channels = roq->video_pts =
+ roq->width = roq->height = roq->audio_channels = roq->video_pts =
roq->audio_frame_count = 0;
/* scan the first n chunks searching for A/V parameters */
for (i = 0; i < RoQ_CHUNKS_TO_SCAN; i++) {
- if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
+ if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
RoQ_CHUNK_PREAMBLE_SIZE)
return AVERROR_IO;
case RoQ_INFO:
/* fetch the width and height; reuse the preamble bytes */
- if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
+ if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
RoQ_CHUNK_PREAMBLE_SIZE)
return AVERROR_IO;
roq->width = LE_16(&preamble[0]);
return AVERROR_IO;
/* get the next chunk preamble */
- if ((ret = get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE)) !=
+ if ((ret = get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE)) !=
RoQ_CHUNK_PREAMBLE_SIZE)
return AVERROR_IO;
codebook_offset = url_ftell(pb) - RoQ_CHUNK_PREAMBLE_SIZE;
codebook_size = chunk_size;
url_fseek(pb, codebook_size, SEEK_CUR);
- if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
+ if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
RoQ_CHUNK_PREAMBLE_SIZE)
return AVERROR_IO;
- chunk_size = LE_32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 +
+ chunk_size = LE_32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 +
codebook_size;
/* rewind */
/* return -1 if no image found */
-static int find_image_range(int *pfirst_index, int *plast_index,
+static int find_image_range(int *pfirst_index, int *plast_index,
const char *path)
{
char buf[1024];
}
if (first_index == 5)
goto fail;
-
+
/* find the last image */
last_index = first_index;
for(;;) {
range1 = 1;
else
range1 = 2 * range;
- if (get_frame_filename(buf, sizeof(buf), path,
+ if (get_frame_filename(buf, sizeof(buf), path,
last_index + range1) < 0)
goto fail;
if (!url_exist(buf))
pstrcpy(s->path, sizeof(s->path), s1->filename);
s->img_number = 0;
s->img_count = 0;
-
+
/* find format */
if (s1->iformat->flags & AVFMT_NOFILE)
s->is_pipe = 0;
} else {
st->codec->time_base= ap->time_base;
}
-
+
if (!s->is_pipe) {
if (find_image_range(&first_index, &last_index, s->path) < 0)
goto fail;
} else {
f = &s1->pb;
}
-
+
ret = av_read_image(f, s1->filename, s->img_fmt, read_header_alloc_cb, s);
if (ret < 0)
goto fail1;
} else {
url_fseek(f, 0, SEEK_SET);
}
-
+
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_RAWVIDEO;
st->codec->width = s->width;
if (s->nb_streams != 1)
return -1;
-
+
st = s->streams[0];
/* we select the first matching format */
for(i=0;i<PIX_FMT_NB;i++) {
img->is_pipe = 0;
else
img->is_pipe = 1;
-
+
return 0;
}
width = st->codec->width;
height = st->codec->height;
-
+
picture = (AVPicture *)pkt->data;
if (!img->is_pipe) {
- if (get_frame_filename(filename, sizeof(filename),
+ if (get_frame_filename(filename, sizeof(filename),
img->path, img->img_number) < 0)
return AVERROR_IO;
pb = &pb1;
av_register_input_format(&imagepipe_iformat);
av_register_output_format(&imagepipe_oformat);
-
+
return 0;
}
}
/* return -1 if no image found */
-static int find_image_range(int *pfirst_index, int *plast_index,
+static int find_image_range(int *pfirst_index, int *plast_index,
const char *path)
{
char buf[1024];
/* find the first image */
for(first_index = 0; first_index < 5; first_index++) {
if (get_frame_filename(buf, sizeof(buf), path, first_index) < 0){
- *pfirst_index =
+ *pfirst_index =
*plast_index = 1;
return 0;
}
}
if (first_index == 5)
goto fail;
-
+
/* find the last image */
last_index = first_index;
for(;;) {
range1 = 1;
else
range1 = 2 * range;
- if (get_frame_filename(buf, sizeof(buf), path,
+ if (get_frame_filename(buf, sizeof(buf), path,
last_index + range1) < 0)
goto fail;
if (!url_exist(buf))
pstrcpy(s->path, sizeof(s->path), s1->filename);
s->img_number = 0;
s->img_count = 0;
-
+
/* find format */
if (s1->iformat->flags & AVFMT_NOFILE)
s->is_pipe = 0;
s->is_pipe = 1;
st->need_parsing= 1;
}
-
+
if (!ap || !ap->time_base.num) {
av_set_pts_info(st, 60, 1, 25);
} else {
av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den);
}
-
+
if(ap && ap->width && ap->height){
st->codec->width = ap->width;
st->codec->height= ap->height;
}
-
+
if (!s->is_pipe) {
if (find_image_range(&first_index, &last_index, s->path) < 0)
return AVERROR_IO;
st->start_time = 0;
st->duration = last_index - first_index + 1;
}
-
+
if(ap->video_codec_id){
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = ap->video_codec_id;
if (url_fopen(f[i], filename, URL_RDONLY) < 0)
return AVERROR_IO;
size[i]= url_fsize(f[i]);
-
+
if(codec->codec_id != CODEC_ID_RAWVIDEO)
break;
filename[ strlen(filename) - 1 ]= 'U' + i;
}
-
+
if(codec->codec_id == CODEC_ID_RAWVIDEO && !codec->width)
infer_size(&codec->width, &codec->height, size[0]);
} else {
img->is_pipe = 0;
else
img->is_pipe = 1;
-
+
return 0;
}
int i;
if (!img->is_pipe) {
- if (get_frame_filename(filename, sizeof(filename),
+ if (get_frame_filename(filename, sizeof(filename),
img->path, img->img_number) < 0 && img->img_number>1)
return AVERROR_IO;
for(i=0; i<3; i++){
if (url_fopen(pb[i], filename, URL_WRONLY) < 0)
return AVERROR_IO;
-
+
if(codec->codec_id != CODEC_ID_RAWVIDEO)
break;
filename[ strlen(filename) - 1 ]= 'U' + i;
} else {
pb[0] = &s->pb;
}
-
+
if(codec->codec_id == CODEC_ID_RAWVIDEO){
int ysize = codec->width * codec->height;
put_buffer(pb[0], pkt->data , ysize);
av_register_input_format(&image2pipe_iformat);
av_register_output_format(&image2pipe_oformat);
-
+
return 0;
}
} IPMVEContext;
-static int load_ipmovie_packet(IPMVEContext *s, ByteIOContext *pb,
+static int load_ipmovie_packet(IPMVEContext *s, ByteIOContext *pb,
AVPacket *pkt) {
int chunk_type;
url_fseek(pb, s->decode_map_chunk_offset, SEEK_SET);
s->decode_map_chunk_offset = 0;
- if (get_buffer(pb, pkt->data, s->decode_map_chunk_size) !=
+ if (get_buffer(pb, pkt->data, s->decode_map_chunk_size) !=
s->decode_map_chunk_size) {
av_free_packet(pkt);
return CHUNK_EOF;
/* This function loads and processes a single chunk in an IP movie file.
* It returns the type of chunk that was processed. */
-static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb,
+static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb,
AVPacket *pkt)
{
unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
s->audio_bits,
s->audio_sample_rate,
(s->audio_channels == 2) ? "stereo" : "mono",
- (s->audio_type == CODEC_ID_INTERPLAY_DPCM) ?
+ (s->audio_type == CODEC_ID_INTERPLAY_DPCM) ?
"Interplay audio" : "PCM");
break;
}
}
-static void jpeg_img_copy(uint8_t *dst, int dst_wrap,
+static void jpeg_img_copy(uint8_t *dst, int dst_wrap,
uint8_t *src, int src_wrap,
int width, int height)
{
/* XXX: libavcodec is broken for truncated jpegs! */
#define IO_BUF_SIZE (1024*1024)
-static int jpeg_read(ByteIOContext *f,
+static int jpeg_read(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
{
AVCodecContext *c;
jctx.alloc_cb = alloc_cb;
jctx.opaque = opaque;
jctx.ret_code = -1; /* default return code is error */
-
+
c = avcodec_alloc_context();
if (!c)
return -1;
break;
inbuf_ptr = inbuf;
while (size > 0) {
- len = avcodec_decode_video(c, &picture1, &got_picture,
+ len = avcodec_decode_video(c, &picture1, &got_picture,
inbuf_ptr, size);
if (len < 0)
goto fail;
/* set the quality */
picture->quality = 3; /* XXX: a parameter should be used */
c->flags |= CODEC_FLAG_QSCALE;
-
+
if (avcodec_open(c, &mjpeg_encoder) < 0)
goto fail1;
-
+
/* XXX: needs to sort out that size problem */
outbuf_size = 1000000;
outbuf = av_malloc(outbuf_size);
break;
}
- /* position in the file + track to which it
+ /* position in the file + track to which it
* belongs */
case MATROSKA_ID_CUETRACKPOSITION:
if ((res = ebml_read_master(matroska, &id)) < 0)
"cannot parse further.\n", EBML_MAX_DEPTH);
return AVERROR_UNKNOWN;
}
-
+
level.start = 0;
level.length = (uint64_t)-1;
matroska->levels[matroska->num_levels] = level;
/* This is the MS compatibility mode which stores a
* WAVEFORMATEX in the CodecPrivate. */
- else if (!strcmp(track->codec_id,
+ else if (!strcmp(track->codec_id,
MATROSKA_CODEC_ID_AUDIO_ACM) &&
(track->codec_priv_size >= 18) &&
(track->codec_priv != NULL)) {
}
if(matroska->ctx->streams[ matroska->tracks[track]->stream_index ]->discard >= AVDISCARD_ALL){
av_free(origdata);
- break;
+ break;
}
/* time (relative to cluster time) */
-/*
+/*
* Yamaha SMAF format
* Copyright (c) 2005 Vidar Madsen
*
av_log(s, AV_LOG_ERROR, "Unsupported sample rate %d\n", s->streams[0]->codec->sample_rate);
return -1;
}
-
+
put_tag(pb, "MMMD");
put_be32(pb, 0);
pos = start_tag(pb, "CNTI");
if(!size)
return AVERROR_IO;
-
+
if (av_new_packet(pkt, size))
return AVERROR_IO;
pkt->stream_index = 0;
return 0;
}
-static int mmf_read_seek(AVFormatContext *s,
+static int mmf_read_seek(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
return pcm_read_seek(s, stream_index, timestamp, flags);
*/
#include <limits.h>
-
+
#include "avformat.h"
#include "avi.h"
/*
* First version by Francois Revol revol@free.fr
- * Seek function by Gael Chardon gael.dev@4now.net
+ * Seek function by Gael Chardon gael.dev@4now.net
*
* Features and limitations:
* - reads most of the QT files I have (at least the structure),
long sample_to_chunk_sz;
MOV_sample_to_chunk_tbl *sample_to_chunk;
long sample_to_chunk_index;
- int sample_to_time_index;
- long sample_to_time_sample;
- uint64_t sample_to_time_time;
+ int sample_to_time_index;
+ long sample_to_time_sample;
+ uint64_t sample_to_time_time;
int sample_to_ctime_index;
int sample_to_ctime_sample;
long sample_size;
/* empty */;
a.size -= 8;
-
+
if(a.size < 0)
break;
-
+
// av_log(NULL, AV_LOG_DEBUG, " i=%ld\n", i);
if (c->parse_table[i].type == 0) { /* skip leaf atoms data */
// url_seek(pb, atom.offset+atom.size, SEEK_SET);
if((uint64_t)atom.size > (1<<30))
return -1;
-
+
// currently SVQ3 decoder expect full STSD header - so let's fake it
// this should be fixed and just SMI header should be passed
av_free(st->codec->extradata);
if((uint64_t)atom.size > (1<<30))
return -1;
-
+
// pass all frma atom to codec, needed at least for QDM2
av_free(st->codec->extradata);
st->codec->extradata_size = atom.size;
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
entries = get_be32(pb);
-
+
if(entries >= UINT_MAX/sizeof(int64_t))
return -1;
-
+
sc->chunk_count = entries;
sc->chunk_offsets = (int64_t*) av_malloc(entries * sizeof(int64_t));
if (!sc->chunk_offsets)
}
} else
return -1;
-
+
for(i=0; i<c->fc->nb_streams; i++){
MOVStreamContext *sc2 = (MOVStreamContext *)c->fc->streams[i]->priv_data;
if(sc2 && sc2->chunk_offsets){
color_greyscale = st->codec->bits_per_sample & 0x20;
/* if the depth is 2, 4, or 8 bpp, file is palettized */
- if ((color_depth == 2) || (color_depth == 4) ||
+ if ((color_depth == 2) || (color_depth == 4) ||
(color_depth == 8)) {
if (color_greyscale) {
get_be16(pb);//Reserved_2
//AMRSpecificBox.(10 bytes)
-
+
get_be32(pb); //size
get_be32(pb); //type=='damr'
get_be32(pb); //vendor
st->codec->channels=1;
}
st->codec->bits_per_sample=16;
- st->codec->bit_rate=0; /*It is not possible to tell this before we have
+ st->codec->bit_rate=0; /*It is not possible to tell this before we have
an audio frame and even then every frame can be different*/
}
else if( st->codec->codec_tag == MKTAG( 'm', 'p', '4', 's' ))
get_be16(pb);
c->mp4=1;
-
+
if(mp4_version==1)
{
url_fskip(pb,16);
a.size=size-(16+20);
a.offset=url_ftell(pb);
-
+
mov_read_default(c, pb, a);
/* Get correct sample rate from extradata */
if(st->codec->extradata_size) {
const int samplerate_table[] = {
- 96000, 88200, 64000, 48000, 44100, 32000,
+ 96000, 88200, 64000, 48000, 44100, 32000,
24000, 22050, 16000, 12000, 11025, 8000,
7350, 0, 0, 0
};
/* fetch the 36-byte extradata needed for alac decoding */
st->codec->extradata_size = 36;
- st->codec->extradata = (uint8_t*)
+ st->codec->extradata = (uint8_t*)
av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
}
}
}
}
-
+
if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) {
st->codec->sample_rate= sc->time_scale;
}
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
entries = get_be32(pb);
-
+
if(entries >= UINT_MAX / sizeof(MOV_sample_to_chunk_tbl))
return -1;
-
+
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
#endif
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
entries = get_be32(pb);
-
+
if(entries >= UINT_MAX / sizeof(long))
return -1;
-
+
sc->keyframe_count = entries;
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "keyframe_count = %ld\n", sc->keyframe_count);
get_byte(pb); /* version */
get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
edit_count= c->streams[c->fc->nb_streams-1]->edit_count = get_be32(pb); /* entries */
-
+
for(i=0; i<edit_count; i++){
get_be32(pb); /* Track duration */
get_be32(pb); /* Media time */
{ MKTAG( 's', 'k', 'i', 'p' ), mov_read_leaf },
{ MKTAG( 's', 'm', 'h', 'd' ), mov_read_leaf }, /* sound media info header */
{ MKTAG( 'S', 'M', 'I', ' ' ), mov_read_smi }, /* Sorenson extension ??? */
-{ MKTAG( 'a', 'v', 'c', 'C' ), mov_read_avcC },
+{ MKTAG( 'a', 'v', 'c', 'C' ), mov_read_avcC },
{ MKTAG( 's', 't', 'b', 'l' ), mov_read_default },
{ MKTAG( 's', 't', 'c', 'o' ), mov_read_stco },
{ MKTAG( 's', 't', 'd', 'p' ), mov_read_default },
av_freep(&sc->sample_to_chunk);
av_freep(&sc->sample_sizes);
av_freep(&sc->keyframes);
- av_freep(&sc->stts_data);
- av_freep(&sc->ctts_data);
+ av_freep(&sc->stts_data);
+ av_freep(&sc->ctts_data);
av_freep(&sc);
}
}
}
#ifdef MOV_MINOLTA_FIX
- //Make sure that size is according to sample_size (Needed by .mov files
+ //Make sure that size is according to sample_size (Needed by .mov files
//created on a Minolta Dimage Xi where audio chunks contains waste data in the end)
//Maybe we should really not only check sc->sample_size, but also sc->sample_sizes
//but I have no such movies
- if (sc->sample_size > 0) {
+ if (sc->sample_size > 0) {
int foundsize=0;
for(i=0; i<(sc->sample_to_chunk_sz); i++) {
if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) )
av_get_packet(&s->pb, pkt, size);
pkt->stream_index = sc->ffindex;
-
+
// If the keyframes table exists, mark any samples that are in the table as key frames.
// If no table exists, treat very sample as a key frame.
- if (sc->keyframes) {
+ if (sc->keyframes) {
a = 0;
b = sc->keyframe_count - 1;
-
+
while (a < b) {
m = (a + b + 1) >> 1;
if (sc->keyframes[m] > sc->current_sample) {
b = m - 1;
} else {
a = m;
- }
+ }
}
-
+
if (sc->keyframes[a] == sc->current_sample)
pkt->flags |= PKT_FLAG_KEY;
}
#endif
mov->next_chunk_offset = offset + size;
-
- /* find the corresponding dts */
- if (sc && sc->sample_to_time_index < sc->stts_count && pkt) {
+
+ /* find the corresponding dts */
+ if (sc && sc->sample_to_time_index < sc->stts_count && pkt) {
unsigned int count;
uint64_t dts, pts;
unsigned int duration = sc->stts_data[sc->sample_to_time_index].duration;
count = sc->stts_data[sc->sample_to_time_index].count;
- if ((sc->sample_to_time_sample + count) < sc->current_sample) {
- sc->sample_to_time_sample += count;
- sc->sample_to_time_time += count*duration;
- sc->sample_to_time_index ++;
+ if ((sc->sample_to_time_sample + count) < sc->current_sample) {
+ sc->sample_to_time_sample += count;
+ sc->sample_to_time_time += count*duration;
+ sc->sample_to_time_index ++;
duration = sc->stts_data[sc->sample_to_time_index].duration;
- }
+ }
dts = sc->sample_to_time_time + (sc->current_sample-1 - sc->sample_to_time_sample) * (int64_t)duration;
/* find the corresponding pts */
if (sc->sample_to_ctime_index < sc->ctts_count) {
int64_t sample_file_offset;
int32_t first_chunk_sample;
int32_t sample_to_chunk_idx;
- int sample_to_time_index;
- long sample_to_time_sample = 0;
- uint64_t sample_to_time_time = 0;
+ int sample_to_time_index;
+ long sample_to_time_sample = 0;
+ uint64_t sample_to_time_time = 0;
int mov_idx;
// Find the corresponding mov stream
for (i = 0; i < sc->stts_count; i++) {
count = sc->stts_data[i].count;
duration = sc->stts_data[i].duration;
-//av_log(s, AV_LOG_DEBUG, "> sample_time %lli \n", (long)sample_time);
-//av_log(s, AV_LOG_DEBUG, "> count=%i duration=%i\n", count, duration);
+//av_log(s, AV_LOG_DEBUG, "> sample_time %lli \n", (long)sample_time);
+//av_log(s, AV_LOG_DEBUG, "> count=%i duration=%i\n", count, duration);
if ((start_time + count*duration) > sample_time) {
- sample_to_time_time = start_time;
- sample_to_time_index = i;
- sample_to_time_sample = sample;
+ sample_to_time_time = start_time;
+ sample_to_time_index = i;
+ sample_to_time_sample = sample;
sample += (sample_time - start_time) / duration;
break;
}
sample += count;
start_time += count * duration;
- }
- sample_to_time_time = start_time;
- sample_to_time_index = i;
+ }
+ sample_to_time_time = start_time;
+ sample_to_time_index = i;
/* NOTE: despite what qt doc say, the dt value (Display Time in qt vocabulary) computed with the stts atom
is a decoding time stamp (dts) not a presentation time stamp. And as usual dts != pts for stream with b frames */
sc->next_chunk = chunk; // +1 -1 (zero based)
sc->sample_to_chunk_index = sample_to_chunk_idx;
- // Update other streams
+ // Update other streams
for (i = 0; i<mov->total_streams; i++) {
MOVStreamContext *msc;
if (i == mov_idx) continue;
} else {
a = m;
}
-#ifdef DEBUG
+#ifdef DEBUG
/* av_log(s, AV_LOG_DEBUG, "a=%i (%li) b=%i (%li) m=%i (%li) stream #%i\n"
, a, (long)msc->chunk_offsets[a], b, (long)msc->chunk_offsets[b], m, (long)msc->chunk_offsets[m], i); */
-#endif
+#endif
}
msc->next_chunk = a;
if (msc->chunk_offsets[a] < chunk_file_offset && a < (msc->chunk_count-1))
msc->next_chunk ++;
-#ifdef DEBUG
+#ifdef DEBUG
av_log(s, AV_LOG_DEBUG, "Nearest next chunk for stream #%i is #%i @%lli\n", i, msc->next_chunk+1, msc->chunk_offsets[msc->next_chunk]);
-#endif
+#endif
// Compute sample count and index in the sample_to_chunk table (what a pity)
msc->sample_to_chunk_index = 0;
msc->current_sample = 0;
}
msc->current_sample += (msc->next_chunk - (msc->sample_to_chunk[msc->sample_to_chunk_index].first - 1)) * sc->sample_to_chunk[msc->sample_to_chunk_index].count;
msc->left_in_chunk = msc->sample_to_chunk[msc->sample_to_chunk_index].count - 1;
- // Find corresponding position in stts (used later to compute dts)
- sample = 0;
- start_time = 0;
- for (msc->sample_to_time_index = 0; msc->sample_to_time_index < msc->stts_count; msc->sample_to_time_index++) {
+ // Find corresponding position in stts (used later to compute dts)
+ sample = 0;
+ start_time = 0;
+ for (msc->sample_to_time_index = 0; msc->sample_to_time_index < msc->stts_count; msc->sample_to_time_index++) {
count = msc->stts_data[msc->sample_to_time_index].count;
duration = msc->stts_data[msc->sample_to_time_index].duration;
- if ((sample + count - 1) > msc->current_sample) {
- msc->sample_to_time_time = start_time;
- msc->sample_to_time_sample = sample;
- break;
- }
- sample += count;
- start_time += count * duration;
+ if ((sample + count - 1) > msc->current_sample) {
+ msc->sample_to_time_time = start_time;
+ msc->sample_to_time_sample = sample;
+ break;
+ }
+ sample += count;
+ start_time += count * duration;
}
sample = 0;
for (msc->sample_to_ctime_index = 0; msc->sample_to_ctime_index < msc->ctts_count; msc->sample_to_ctime_index++) {
break;
}
sample += count;
- }
-#ifdef DEBUG
+ }
+#ifdef DEBUG
av_log(s, AV_LOG_DEBUG, "Next Sample for stream #%i is #%i @%i\n", i, msc->current_sample + 1, msc->sample_to_chunk_index + 1);
-#endif
- }
+#endif
+ }
return 0;
}
#endif
mov_read_close,
#if defined(MOV_SPLIT_CHUNKS) && defined(MOV_SEEK)
mov_read_seek,
-#endif
+#endif
};
int mov_init(void)
#define MODE_MP4 0
#define MODE_MOV 1
#define MODE_3GP 2
-#define MODE_PSP 3 // example working PSP command line:
+#define MODE_PSP 3 // example working PSP command line:
// ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4
#define MODE_3G2 4
}
if (equalChunks) {
int sSize = track->cluster[0][0].size/track->cluster[0][0].entries;
- put_be32(pb, sSize); // sample size
+ put_be32(pb, sSize); // sample size
put_be32(pb, entries); // sample count
}
else {
- put_be32(pb, 0); // sample size
- put_be32(pb, entries); // sample count
+ put_be32(pb, 0); // sample size
+ put_be32(pb, entries); // sample count
for (i=0; i<track->entry; i++) {
int cl = i / MOV_INDEX_CLUSTER_SIZE;
int id = i % MOV_INDEX_CLUSTER_SIZE;
int pos = url_ftell(pb);
put_be32(pb, 0); /* size */
put_tag(pb, "stsc");
- put_be32(pb, 0); // version & flags
+ put_be32(pb, 0); // version & flags
entryPos = url_ftell(pb);
- put_be32(pb, track->entry); // entry count
+ put_be32(pb, track->entry); // entry count
for (i=0; i<track->entry; i++) {
int cl = i / MOV_INDEX_CLUSTER_SIZE;
int id = i % MOV_INDEX_CLUSTER_SIZE;
if(oldval != track->cluster[cl][id].samplesInChunk)
{
- put_be32(pb, i+1); // first chunk
+ put_be32(pb, i+1); // first chunk
put_be32(pb, track->cluster[cl][id].samplesInChunk); // samples per chunk
- put_be32(pb, 0x1); // sample description index
+ put_be32(pb, 0x1); // sample description index
oldval = track->cluster[cl][id].samplesInChunk;
index++;
}
}
curpos = url_ftell(pb);
url_fseek(pb, entryPos, SEEK_SET);
- put_be32(pb, index); // rewrite size
+ put_be32(pb, index); // rewrite size
url_fseek(pb, curpos, SEEK_SET);
return updateSize (pb, pos);
long curpos;
int i, index = 0, entryPos;
int pos = url_ftell(pb);
- put_be32(pb, 0); // size
+ put_be32(pb, 0); // size
put_tag(pb, "stss");
- put_be32(pb, 0); // version & flags
+ put_be32(pb, 0); // version & flags
entryPos = url_ftell(pb);
- put_be32(pb, track->entry); // entry count
+ put_be32(pb, track->entry); // entry count
for (i=0; i<track->entry; i++) {
int cl = i / MOV_INDEX_CLUSTER_SIZE;
int id = i % MOV_INDEX_CLUSTER_SIZE;
}
curpos = url_ftell(pb);
url_fseek(pb, entryPos, SEEK_SET);
- put_be32(pb, index); // rewrite size
+ put_be32(pb, index); // rewrite size
url_fseek(pb, curpos, SEEK_SET);
return updateSize (pb, pos);
}
{
int pos = url_ftell(pb);
int tag;
-
+
put_be32(pb, 0); /* size */
tag = track->enc->codec_tag;
put_be32(pb, 0x5);
put_be32(pb, 0xe2c0211d);
put_be32(pb, 0xc0000000);
- put_byte(pb, 0);
+ put_byte(pb, 0);
return 0x15;
}
len = size;
vals[3] = (uint8_t)(len & 0x7f);
len >>= 7;
- vals[2] = (uint8_t)((len & 0x7f) | 0x80);
+ vals[2] = (uint8_t)((len & 0x7f) | 0x80);
len >>= 7;
- vals[1] = (uint8_t)((len & 0x7f) | 0x80);
+ vals[1] = (uint8_t)((len & 0x7f) | 0x80);
len >>= 7;
vals[0] = (uint8_t)((len & 0x7f) | 0x80);
int pos = url_ftell(pb);
void *vosDataBackup=track->vosData;
int vosLenBackup=track->vosLen;
-
+
// we should be able to have these passed in, via vosData, then we wouldn't need to attack this routine at all
static const char PSPAACData[]={0x13,0x10};
static const char PSPMP4Data[]={0x00,0x00,0x01,0xB0,0x03,0x00,0x00,0x01,0xB5,0x09,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x20,0x00,0x84,0x5D,0x4C,0x28,0x50,0x20,0xF0,0xA3,0x1F };
-
-
+
+
if (track->mode == MODE_PSP) // fails on psp if this is not here
{
if (track->enc->codec_id == CODEC_ID_AAC)
put_be32(pb, 0x00480000); /* Vertical resolution 72dpi */
put_be32(pb, 0); /* Data size (= 0) */
put_be16(pb, 1); /* Frame count (= 1) */
-
+
memset(compressor_name,0,32);
if (track->enc->codec && track->enc->codec->name)
strncpy(compressor_name,track->enc->codec->name,31);
put_byte(pb, strlen(compressor_name));
put_buffer(pb, compressor_name, 31);
-
+
put_be16(pb, 0x18); /* Reserved */
put_be16(pb, 0xffff); /* Reserved */
if(track->enc->codec_id == CODEC_ID_MPEG4)
else if(track->enc->codec_id == CODEC_ID_H263)
mov_write_d263_tag(pb);
else if(track->enc->codec_id == CODEC_ID_SVQ3)
- mov_write_svq3_tag(pb);
+ mov_write_svq3_tag(pb);
return updateSize (pb, pos);
}
{
char *descr, *hdlr, *hdlr_type;
int pos = url_ftell(pb);
-
+
if (!track) { /* no media --> data handler */
hdlr = "dhlr";
hdlr_type = "url ";
descr = "SoundHandler";
}
}
-
+
put_be32(pb, 0); /* size */
put_tag(pb, "hdlr");
put_be32(pb, 0); /* Version & flags */
put_be32(pb, 0); /* Version & flags */
put_be32(pb, track->time); /* creation time */
put_be32(pb, track->time); /* modification time */
- put_be32(pb, track->timescale); /* time scale (sample rate for audio) */
+ put_be32(pb, track->timescale); /* time scale (sample rate for audio) */
put_be32(pb, track->trackDuration); /* duration */
put_be16(pb, 0); /* language, 0 = english */
put_be16(pb, 0); /* reserved (quality) */
put_be32(pb, 0); /* size */
put_tag(pb, "trak");
mov_write_tkhd_tag(pb, track);
- if (track->mode == MODE_PSP)
+ if (track->mode == MODE_PSP)
mov_write_edts_tag(pb, track); // PSP Movies require edts box
mov_write_mdia_tag(pb, track);
- if (track->mode == MODE_PSP)
+ if (track->mode == MODE_PSP)
mov_write_uuid_tag_psp(pb,track); // PSP Movies require this uuid box
return updateSize(pb, pos);
}
int size = 0;
// only save meta tag if required
- if ( s->title[0] || s->author[0] || s->album[0] || s->year ||
+ if ( s->title[0] || s->author[0] || s->album[0] || s->year ||
s->comment[0] || s->genre[0] || s->track ) {
int pos = url_ftell(pb);
put_be32(pb, 0); /* size */
}
return size;
}
-
+
static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,
AVFormatContext *s)
{
}
}
- mov->tracks[i].trackDuration =
+ mov->tracks[i].trackDuration =
mov->tracks[i].sampleCount * mov->tracks[i].sampleDuration;
mov->tracks[i].time = mov->time;
mov->tracks[i].trackID = i+1;
int mov_write_mdat_tag(ByteIOContext *pb, MOVContext* mov)
{
- mov->mdat_pos = url_ftell(pb);
+ mov->mdat_pos = url_ftell(pb);
put_be32(pb, 0); /* size placeholder*/
put_tag(pb, "mdat");
return 0;
{
int AudioRate = s->streams[1]->codec->sample_rate;
int FrameRate = ((s->streams[0]->codec->time_base.den) * (0x10000))/ (s->streams[0]->codec->time_base.num);
-
+
//printf("audiorate = %d\n",AudioRate);
//printf("framerate = %d / %d = 0x%x\n",s->streams[0]->codec->time_base.den,s->streams[0]->codec->time_base.num,FrameRate);
put_be32(pb, 0x0 );
put_be32(pb, 0xc0 );
put_be32(pb, 0xc0 );
- put_be32(pb, FrameRate); // was 0xefc29
+ put_be32(pb, FrameRate); // was 0xefc29
put_be32(pb, FrameRate ); // was 0xefc29
put_be16(pb, s->streams[0]->codec->width);
put_be16(pb, s->streams[0]->codec->height);
}
else if(enc->codec_id == CODEC_ID_PCM_S16BE || enc->codec_id == CODEC_ID_PCM_S16LE) {
samplesInChunk = size/(2*enc->channels);
- }
+ }
else {
samplesInChunk = 1;
}
id = trk->entry % MOV_INDEX_CLUSTER_SIZE;
if (trk->ents_allocated <= trk->entry) {
- trk->cluster = av_realloc(trk->cluster, (cl+1)*sizeof(void*));
+ trk->cluster = av_realloc(trk->cluster, (cl+1)*sizeof(void*));
if (!trk->cluster)
return -1;
trk->cluster[cl] = av_malloc(MOV_INDEX_CLUSTER_SIZE*sizeof(MOVIentry));
-/*
+/*
* MP3 encoder and decoder
* Copyright (c) 2003 Fabrice Bellard.
*
(buf[9] & 0x80) == 0);
}
-static void id3_get_string(char *str, int str_size,
+static void id3_get_string(char *str, int str_size,
const uint8_t *buf, int buf_size)
{
int i, c;
{
char str[5];
int genre;
-
+
if (!(buf[0] == 'T' &&
buf[1] == 'A' &&
buf[2] == 'G'))
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_MP3;
st->need_parsing = 1;
-
+
/* try to get the TAG */
if (!url_is_streamed(&s->pb)) {
/* XXX: change that */
{
int ret, size;
// AVStream *st = s->streams[0];
-
+
size= MP3_PACKET_SIZE;
ret= av_get_packet(&s->pb, pkt, size);
av_register_output_format(&mp2_oformat);
#ifdef CONFIG_MP3LAME
av_register_output_format(&mp3_oformat);
-#endif
+#endif
#endif //CONFIG_MUXERS
return 0;
}
#define PACKET_START_CODE_MASK ((unsigned int)0xffffff00)
#define PACKET_START_CODE_PREFIX ((unsigned int)0x00000100)
#define ISO_11172_END_CODE ((unsigned int)0x000001b9)
-
+
/* mpeg2 */
#define PROGRAM_STREAM_MAP 0x1bc
#define PRIVATE_STREAM_1 0x1bd
static AVOutputFormat mpeg2svcd_mux;
static AVOutputFormat mpeg2dvd_mux;
-static int put_pack_header(AVFormatContext *ctx,
+static int put_pack_header(AVFormatContext *ctx,
uint8_t *buf, int64_t timestamp)
{
MpegMuxContext *s = ctx->priv_data;
PutBitContext pb;
-
+
init_put_bits(&pb, buf, 128);
put_bits(&pb, 32, PACK_START_CODE);
put_bits(&pb, 32, SYSTEM_HEADER_START_CODE);
put_bits(&pb, 16, 0);
put_bits(&pb, 1, 1);
-
+
put_bits(&pb, 22, s->mux_rate); /* maximum bit rate of the multiplexed stream */
put_bits(&pb, 1, 1); /* marker */
if (s->is_vcd && only_for_stream_id==VIDEO_ID) {
if (s->is_vcd) {
/* see VCD standard, p. IV-7*/
- put_bits(&pb, 1, 0);
+ put_bits(&pb, 1, 0);
put_bits(&pb, 1, 1);
} else {
put_bits(&pb, 1, 0); /* variable bitrate*/
put_bits(&pb, 1, 0); /* non constrainted bit stream */
}
-
+
if (s->is_vcd || s->is_dvd) {
/* see VCD standard p IV-7 */
put_bits(&pb, 1, 1); /* audio locked */
put_bits(&pb, 5, 0);
} else
put_bits(&pb, 5, s->video_bound);
-
+
if (s->is_dvd) {
put_bits(&pb, 1, 0); /* packet_rate_restriction_flag */
put_bits(&pb, 7, 0x7f); /* reserved byte */
} else
put_bits(&pb, 8, 0xff); /* reserved byte */
-
+
/* DVD-Video Stream_bound entries
- id (0xB9) video, maximum P-STD for stream 0xE0. (P-STD_buffer_bound_scale = 1)
- id (0xB8) audio, maximum P-STD for any MPEG audio (0xC0 to 0xC7) streams. If there are none set to 4096 (32x128). (P-STD_buffer_bound_scale = 0)
- id (0xBD) private stream 1 (audio other than MPEG and subpictures). (P-STD_buffer_bound_scale = 1)
+ id (0xB9) video, maximum P-STD for stream 0xE0. (P-STD_buffer_bound_scale = 1)
+ id (0xB8) audio, maximum P-STD for any MPEG audio (0xC0 to 0xC7) streams. If there are none set to 4096 (32x128). (P-STD_buffer_bound_scale = 0)
+ id (0xBD) private stream 1 (audio other than MPEG and subpictures). (P-STD_buffer_bound_scale = 1)
id (0xBF) private stream 2, NAV packs, set to 2x1024. */
if (s->is_dvd) {
-
+
int P_STD_max_video = 0;
int P_STD_max_mpeg_audio = 0;
int P_STD_max_mpeg_PS1 = 0;
-
+
for(i=0;i<ctx->nb_streams;i++) {
StreamInfo *stream = ctx->streams[i]->priv_data;
private_stream_coded = 0;
for(i=0;i<ctx->nb_streams;i++) {
StreamInfo *stream = ctx->streams[i]->priv_data;
-
+
/* For VCDs, only include the stream info for the stream
that the pack which contains this system belongs to.
s->is_svcd = (ctx->oformat == &mpeg2svcd_mux);
s->is_mpeg2 = (ctx->oformat == &mpeg2vob_mux || ctx->oformat == &mpeg2svcd_mux || ctx->oformat == &mpeg2dvd_mux);
s->is_dvd = (ctx->oformat == &mpeg2dvd_mux);
-
+
if(ctx->packet_size)
s->packet_size = ctx->packet_size;
else
s->packet_size = 2048;
-
+
s->vcd_padding_bytes_written = 0;
s->vcd_padding_bitrate=0;
-
+
s->audio_bound = 0;
s->video_bound = 0;
mpa_id = AUDIO_ID;
/* This value HAS to be used for VCD (see VCD standard, p. IV-7).
Right now it is also used for everything else.*/
- stream->max_buffer_size = 4 * 1024;
+ stream->max_buffer_size = 4 * 1024;
s->audio_bound++;
break;
case CODEC_TYPE_VIDEO:
stream->max_buffer_size = 230*1024; //FIXME this is probably too small as default
#if 0
/* see VCD standard, p. IV-7*/
- stream->max_buffer_size = 46 * 1024;
+ stream->max_buffer_size = 46 * 1024;
else
/* This value HAS to be used for SVCD (see SVCD standard, p. 26 V.2.3.2).
Right now it is also used for everything else.*/
- stream->max_buffer_size = 230 * 1024;
+ stream->max_buffer_size = 230 * 1024;
#endif
s->video_bound++;
break;
codec_rate= st->codec->rc_max_rate;
else
codec_rate= st->codec->bit_rate;
-
+
if(!codec_rate)
codec_rate= (1<<21)*8*50/ctx->nb_streams;
-
+
bitrate += codec_rate;
if (stream->id==AUDIO_ID)
else if (stream->id==VIDEO_ID)
video_bitrate += codec_rate;
}
-
+
if(ctx->mux_rate){
s->mux_rate= (ctx->mux_rate + (8 * 50) - 1) / (8 * 50);
} else {
overhead_rate = ((audio_bitrate / 8.0) / 2279) * (2324 - 2279);
overhead_rate += ((video_bitrate / 8.0) / 2294) * (2324 - 2294);
overhead_rate *= 8;
-
+
/* Add padding so that the full bitrate is 2324*75 bytes/sec */
s->vcd_padding_bitrate = 2324 * 75 * 8 - (bitrate + overhead_rate);
}
-
+
if (s->is_vcd || s->is_mpeg2)
/* every packet */
s->pack_header_freq = 1;
/* the above seems to make pack_header_freq zero sometimes */
if (s->pack_header_freq == 0)
s->pack_header_freq = 1;
-
+
if (s->is_mpeg2)
/* every 200 packets. Need to look at the spec. */
s->system_header_freq = s->pack_header_freq * 40;
s->system_header_freq = 0x7fffffff;
else
s->system_header_freq = s->pack_header_freq * 5;
-
+
for(i=0;i<ctx->nb_streams;i++) {
stream = ctx->streams[i]->priv_data;
stream->packet_number = 0;
static inline void put_timestamp(ByteIOContext *pb, int id, int64_t timestamp)
{
- put_byte(pb,
- (id << 4) |
- (((timestamp >> 30) & 0x07) << 1) |
+ put_byte(pb,
+ (id << 4) |
+ (((timestamp >> 30) & 0x07) << 1) |
1);
put_be16(pb, (uint16_t)((((timestamp >> 15) & 0x7fff) << 1) | 1));
put_be16(pb, (uint16_t)((((timestamp) & 0x7fff) << 1) | 1));
if (s->vcd_padding_bitrate > 0 && pts!=AV_NOPTS_VALUE)
{
int64_t full_pad_bytes;
-
+
full_pad_bytes = (int64_t)((s->vcd_padding_bitrate * (pts / 90000.0)) / 8.0); //FIXME this is wrong
pad_bytes = (int) (full_pad_bytes - s->vcd_padding_bytes_written);
buf_index = 0;
if (((s->packet_number % s->pack_header_freq) == 0)) {
/* pack header size */
- if (s->is_mpeg2)
+ if (s->is_mpeg2)
buf_index += 14;
else
buf_index += 12;
-
+
if (s->is_vcd) {
/* there is exactly one system header for each stream in a VCD MPEG,
One in the very first video packet and one in the very first
audio packet (see VCD standard p. IV-7 and IV-8).*/
-
+
if (stream->packet_number==0)
/* The system headers refer only to the stream they occur in,
so they have a constant size.*/
buf_index += 15;
- } else {
+ } else {
if ((s->packet_number % s->system_header_freq) == 0)
buf_index += s->system_header_size;
}
if ((s->is_vcd && stream->packet_number==0)
|| (s->is_svcd && s->packet_number==0))
/* the first pack of each stream contains only the pack header,
- the system header and some padding (see VCD standard p. IV-6)
+ the system header and some padding (see VCD standard p. IV-6)
Add the padding size, so that the actual payload becomes 0.*/
buf_index += s->packet_size - buf_index;
else {
if (!s->is_mpeg2)
buf_index++;
}
-
+
if (stream->id < 0xc0) {
/* AC3/LPCM private data header */
buf_index += 4;
each audio packet (see standard p. IV-8).*/
buf_index+=20;
}
- return s->packet_size - buf_index;
+ return s->packet_size - buf_index;
}
#endif
{
MpegMuxContext *s = ctx->priv_data;
int i;
-
+
put_be32(pb, PADDING_STREAM);
put_be16(pb, packet_bytes - 6);
if (!s->is_mpeg2) {
int nb_frames=0;
PacketDesc *pkt_desc= stream->premux_packet;
- while(len>0){
+ while(len>0){
if(pkt_desc->size == pkt_desc->unwritten_size)
nb_frames++;
len -= pkt_desc->unwritten_size;
}
/* flush the packet on stream stream_index */
-static int flush_packet(AVFormatContext *ctx, int stream_index,
+static int flush_packet(AVFormatContext *ctx, int stream_index,
int64_t pts, int64_t dts, int64_t scr, int trailer_size)
{
MpegMuxContext *s = ctx->priv_data;
int pes_flags;
int general_pack = 0; /*"general" pack without data specific to one stream?*/
int nb_frames;
-
+
id = stream->id;
-
+
#if 0
- printf("packet ID=%2x PTS=%0.3f\n",
+ printf("packet ID=%2x PTS=%0.3f\n",
id, pts / 90000.0);
#endif
/* there is exactly one system header for each stream in a VCD MPEG,
One in the very first video packet and one in the very first
audio packet (see VCD standard p. IV-7 and IV-8).*/
-
+
if (stream->packet_number==0) {
size = put_system_header(ctx, buf_ptr, id);
buf_ptr += size;
/* The VCD standard demands that 20 zero bytes follow
each audio pack (see standard p. IV-8).*/
zero_trail_bytes += 20;
-
+
if ((s->is_vcd && stream->packet_number==0)
|| (s->is_svcd && s->packet_number==0)) {
/* for VCD the first pack of each stream contains only the pack header,
/* packet header size */
packet_size -= 6;
-
+
/* packet header */
if (s->is_mpeg2) {
header_len = 3;
// first byte doesnt fit -> reset pts/dts + stuffing
if(payload_size <= trailer_size && pts != AV_NOPTS_VALUE){
int timestamp_len=0;
- if(dts != pts)
+ if(dts != pts)
timestamp_len += 5;
if(pts != AV_NOPTS_VALUE)
timestamp_len += s->is_mpeg2 ? 5 : 4;
payload_size -= stuffing_size;
stuffing_size = 0;
}
-
+
nb_frames= get_nb_frames(ctx, stream, payload_size - stuffing_size);
put_be32(&ctx->pb, startcode);
put_be16(&ctx->pb, packet_size);
-
+
if (!s->is_mpeg2)
for(i=0;i<stuffing_size;i++)
put_byte(&ctx->pb, 0xff);
put_timestamp(&ctx->pb, (pes_flags & 0x40) ? 0x03 : 0x02, pts);
if (pes_flags & 0x40) /*write dts*/
put_timestamp(&ctx->pb, 0x01, dts);
-
+
if (pes_flags & 0x01) { /*write pes extension*/
put_byte(&ctx->pb, 0x10); /* flags */
- /* P-STD buffer info */
+ /* P-STD buffer info */
if (id == AUDIO_ID)
put_be16(&ctx->pb, 0x4000 | stream->max_buffer_size/128);
else
}
if (pad_packet_bytes > 0)
- put_padding_packet(ctx,&ctx->pb, pad_packet_bytes);
+ put_padding_packet(ctx,&ctx->pb, pad_packet_bytes);
for(i=0;i<zero_trail_bytes;i++)
put_byte(&ctx->pb, 0x00);
-
+
put_flush_packet(&ctx->pb);
-
+
s->packet_number++;
/* only increase the stream packet number if this pack actually contains
or some data.*/
if (!general_pack)
stream->packet_number++;
-
+
return payload_size - stuffing_size;
}
put_byte(&ctx->pb, 0);
s->vcd_padding_bytes_written += s->packet_size;
-
+
put_flush_packet(&ctx->pb);
-
+
/* increasing the packet number is correct. The SCR of the following packs
is calculated from the packet_number and it has to include the padding
sector (it represents the sector index, not the MPEG pack index)
scr = 36000 + s->packet_number * 1200;
return scr;
-}
+}
#endif
static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr){
AVStream *st = ctx->streams[i];
StreamInfo *stream = st->priv_data;
PacketDesc *pkt_desc= stream->predecode_packet;
-
+
while(pkt_desc && scr > pkt_desc->dts){ //FIXME > vs >=
- if(stream->buffer_index < pkt_desc->size ||
+ if(stream->buffer_index < pkt_desc->size ||
stream->predecode_packet == stream->premux_packet){
av_log(ctx, AV_LOG_ERROR, "buffer underflow\n");
break;
av_freep(&pkt_desc);
}
}
-
+
return 0;
}
if(space < s->packet_size && !ignore_constraints)
continue;
-
+
if(next_pkt && next_pkt->dts - scr > max_delay)
continue;
-
+
if(rel_space > best_score){
best_score= rel_space;
best_i = i;
avail_space= space;
}
}
-
+
if(best_i < 0){
int64_t best_dts= INT64_MAX;
}
#if 0
- av_log(ctx, AV_LOG_DEBUG, "bumping scr, scr:%f, dts:%f\n",
+ av_log(ctx, AV_LOG_DEBUG, "bumping scr, scr:%f, dts:%f\n",
scr/90000.0, best_dts/90000.0);
#endif
if(best_dts == INT64_MAX)
}
assert(best_i >= 0);
-
+
st = ctx->streams[best_i];
stream = st->priv_data;
-
+
assert(fifo_size(&stream->fifo, stream->fifo.rptr) > 0);
assert(avail_space >= s->packet_size || ignore_constraints);
-
+
timestamp_packet= stream->premux_packet;
if(timestamp_packet->unwritten_size == timestamp_packet->size){
trailer_size= 0;
s->last_scr += s->packet_size*90000LL / (s->mux_rate*50LL); //FIXME rounding and first few bytes of each packet
}
}
-
+
stream->buffer_index += es_size;
s->last_scr += s->packet_size*90000LL / (s->mux_rate*50LL); //FIXME rounding and first few bytes of each packet
-
+
while(stream->premux_packet && stream->premux_packet->unwritten_size <= es_size){
es_size -= stream->premux_packet->unwritten_size;
stream->premux_packet= stream->premux_packet->next;
}
if(es_size)
stream->premux_packet->unwritten_size -= es_size;
-
+
if(remove_decoded_packets(ctx, s->last_scr) < 0)
return -1;
PacketDesc *pkt_desc;
const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE);
const int is_iframe = st->codec->codec_type == CODEC_TYPE_VIDEO && (pkt->flags & PKT_FLAG_KEY);
-
+
pts= pkt->pts;
dts= pkt->dts;
for(;;){
int ret= output_packet(ctx, 0);
- if(ret<=0)
+ if(ret<=0)
return ret;
}
}
// MpegMuxContext *s = ctx->priv_data;
StreamInfo *stream;
int i;
-
+
for(;;){
int ret= output_packet(ctx, 1);
- if(ret<0)
+ if(ret<0)
return ret;
else if(ret==0)
break;
return pts;
}
-static int find_next_start_code(ByteIOContext *pb, int *size_ptr,
+static int find_next_start_code(ByteIOContext *pb, int *size_ptr,
uint32_t *header_state)
{
unsigned int state, v;
/**
* Extracts stream types from a program stream map
* According to ISO/IEC 13818-1 ('MPEG-2 Systems') table 2-35
- *
+ *
* @return number of bytes occupied by PSM in the bitstream
*/
static long mpegps_psm_parse(MpegDemuxContext *m, ByteIOContext *pb)
return 2 + psm_length;
}
-/* read the next PES header. Return its position in ppos
+/* read the next PES header. Return its position in ppos
(if not NULL), and its start code, pts and dts.
*/
static int mpegps_read_pes_header(AVFormatContext *s,
- int64_t *ppos, int *pstart_code,
+ int64_t *ppos, int *pstart_code,
int64_t *ppts, int64_t *pdts)
{
MpegDemuxContext *m = s->priv_data;
mpegps_psm_parse(m, &s->pb);
goto redo;
}
-
+
/* find matching stream */
if (!((startcode >= 0x1c0 && startcode <= 0x1df) ||
(startcode >= 0x1e0 && startcode <= 0x1ef) ||
c = get_byte(&s->pb);
len--;
/* XXX: for mpeg1, should test only bit 7 */
- if (c != 0xff)
+ if (c != 0xff)
break;
}
if ((c & 0xc0) == 0x40) {
}
}
}
-
+
*pstart_code = startcode;
*ppts = pts;
*pdts = dts;
len = mpegps_read_pes_header(s, &dummy_pos, &startcode, &pts, &dts);
if (len < 0)
return len;
-
+
/* now find stream */
for(i=0;i<s->nb_streams;i++) {
st = s->streams[i];
}
/* no stream found: add a new stream */
st = av_new_stream(s, startcode);
- if (!st)
+ if (!st)
goto skip;
st->codec->codec_type = type;
st->codec->codec_id = codec_id;
return 0;
}
-static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
+static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
int64_t *ppos, int64_t pos_limit)
{
int len, startcode;
#endif
return AV_NOPTS_VALUE;
}
- if (startcode == s->streams[stream_index]->id &&
+ if (startcode == s->streams[stream_index]->id &&
dts != AV_NOPTS_VALUE) {
break;
}
int64_t cur_pcr;
int pcr_incr;
int pcr_pid;
-
+
/* data needed to handle file based ts */
int stop_parse; /* stop parsing loop */
AVPacket *pkt; /* packet containing av data */
MpegTSFilter *sdt_filter;
int nb_services;
MpegTSService **services;
-
+
/* set service context (XXX: allocated it ?) */
SetServiceCallback *set_service_cb;
void *set_service_opaque;
{
MpegTSSectionFilter *tss = &tss1->u.section_filter;
int len;
-
+
if (is_start) {
memcpy(tss->section_buf, buf, buf_size);
tss->section_index = buf_size;
}
}
-MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid,
+MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int pid,
SectionCallback *section_cb, void *opaque,
int check_crc)
{
MpegTSFilter *filter;
MpegTSSectionFilter *sec;
-
+
#ifdef DEBUG_SI
printf("Filter: pid=0x%x\n", pid);
#endif
if (pid >= NB_PID_MAX || ts->pids[pid])
return NULL;
filter = av_mallocz(sizeof(MpegTSFilter));
- if (!filter)
+ if (!filter)
return NULL;
ts->pids[pid] = filter;
filter->type = MPEGTS_SECTION;
return filter;
}
-MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid,
+MpegTSFilter *mpegts_open_pes_filter(MpegTSContext *ts, unsigned int pid,
PESCallback *pes_cb,
void *opaque)
{
if (pid >= NB_PID_MAX || ts->pids[pid])
return NULL;
filter = av_mallocz(sizeof(MpegTSFilter));
- if (!filter)
+ if (!filter)
return NULL;
ts->pids[pid] = filter;
filter->type = MPEGTS_PES;
if (size < (TS_FEC_PACKET_SIZE * 5 + 1))
return -1;
-
+
score = analyze(buf, size, TS_PACKET_SIZE, NULL);
fec_score= analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);
// av_log(NULL, AV_LOG_DEBUG, "score: %d, fec_score: %d \n", score, fec_score);
-
+
if (score > fec_score) return TS_PACKET_SIZE;
else if(score < fec_score) return TS_FEC_PACKET_SIZE;
else return -1;
return str;
}
-static int parse_section_header(SectionHeader *h,
+static int parse_section_header(SectionHeader *h,
const uint8_t **pp, const uint8_t *p_end)
{
int val;
return 0;
}
-static MpegTSService *new_service(MpegTSContext *ts, int sid,
+static MpegTSService *new_service(MpegTSContext *ts, int sid,
char *provider_name, char *name)
{
MpegTSService *service;
#ifdef DEBUG_SI
- printf("new_service: sid=0x%04x provider='%s' name='%s'\n",
+ printf("new_service: sid=0x%04x provider='%s' name='%s'\n",
sid, provider_name, name);
#endif
int desc_list_len, desc_len, desc_tag;
int comp_page = 0, anc_page = 0; /* initialize to kill warnings */
char language[4];
-
+
#ifdef DEBUG_SI
printf("PMT:\n");
av_hex_dump(stdout, (uint8_t *)section, section_len);
/* NIT info */
} else {
if (ts->req_sid == sid) {
- ts->pmt_filter = mpegts_open_section_filter(ts, pmt_pid,
+ ts->pmt_filter = mpegts_open_section_filter(ts, pmt_pid,
pmt_cb, ts, 1);
goto found;
}
ts->set_service_cb = set_service_cb;
ts->set_service_opaque = opaque;
ts->req_sid = sid;
- ts->pat_filter = mpegts_open_section_filter(ts, PAT_PID,
+ ts->pat_filter = mpegts_open_section_filter(ts, PAT_PID,
pat_cb, ts, 1);
}
/* scan services in a transport stream by looking at the SDT */
void mpegts_scan_sdt(MpegTSContext *ts)
{
- ts->sdt_filter = mpegts_open_section_filter(ts, SDT_PID,
+ ts->sdt_filter = mpegts_open_section_filter(ts, SDT_PID,
sdt_cb, ts, 1);
}
than nothing !) */
void mpegts_scan_pat(MpegTSContext *ts)
{
- ts->pat_filter = mpegts_open_section_filter(ts, PAT_PID,
+ ts->pat_filter = mpegts_open_section_filter(ts, PAT_PID,
pat_scan_cb, ts, 1);
}
MpegTSContext *ts = pes->ts;
const uint8_t *p;
int len, code;
-
+
if (is_start) {
pes->state = MPEGTS_HEADER;
pes->data_index = 0;
cc = (packet[3] & 0xf);
cc_ok = (tss->last_cc < 0) || ((((tss->last_cc + 1) & 0x0f) == cc));
tss->last_cc = cc;
-
+
/* skip adaptation field */
afc = (packet[3] >> 4) & 3;
p = packet + 4;
p_end = packet + TS_PACKET_SIZE;
if (p >= p_end)
return;
-
+
if (tss->type == MPEGTS_SECTION) {
if (is_start) {
/* pointer field present */
return;
if (len && cc_ok) {
/* write remaining section bytes */
- write_section_data(s, tss,
+ write_section_data(s, tss,
p, len, 0);
/* check whether filter has been closed */
if (!ts->pids[pid])
}
p += len;
if (p < p_end) {
- write_section_data(s, tss,
+ write_section_data(s, tss,
p, p_end - p, 1);
}
} else {
if (cc_ok) {
- write_section_data(s, tss,
+ write_section_data(s, tss,
p, p_end - p, 0);
}
}
} else {
- tss->u.pes_filter.pes_cb(tss->u.pes_filter.opaque,
+ tss->u.pes_filter.pes_cb(tss->u.pes_filter.opaque,
p, p_end - p, is_start);
}
}
const int size= p->buf_size;
int score, fec_score;
#define CHECK_COUNT 10
-
+
if (size < (TS_FEC_PACKET_SIZE * CHECK_COUNT))
return -1;
-
+
score = analyze(p->buf, TS_PACKET_SIZE *CHECK_COUNT, TS_PACKET_SIZE, NULL);
fec_score= analyze(p->buf, TS_FEC_PACKET_SIZE*CHECK_COUNT, TS_FEC_PACKET_SIZE, NULL);
// av_log(NULL, AV_LOG_DEBUG, "score: %d, fec_score: %d \n", score, fec_score);
-
+
// we need a clear definition for the returned score otherwise things will become messy sooner or later
if (score > fec_score && score > 6) return AVPROBE_SCORE_MAX + score - CHECK_COUNT;
else if( fec_score > 6) return AVPROBE_SCORE_MAX + fec_score - CHECK_COUNT;
/* return the 90 kHz PCR and the extension for the 27 MHz PCR. return
(-1) if not available */
-static int parse_pcr(int64_t *ppcr_high, int *ppcr_low,
+static int parse_pcr(int64_t *ppcr_high, int *ppcr_low,
const uint8_t *packet)
{
int afc, len, flags;
/* first do a scaning to get all the services */
url_fseek(pb, pos, SEEK_SET);
mpegts_scan_sdt(ts);
-
+
handle_packets(ts, MAX_SCAN_PACKETS);
-
+
if (ts->nb_services <= 0) {
/* no SDT found, we try to look at the PAT */
-
+
/* First remove the SDT filters from each PID */
int i;
for (i=0; i < NB_PID_MAX; i++) {
}
url_fseek(pb, pos, SEEK_SET);
mpegts_scan_pat(ts);
-
+
handle_packets(ts, MAX_SCAN_PACKETS);
}
-
+
if (ts->nb_services <= 0) {
/* raw transport stream */
ts->auto_guess = 1;
s->ctx_flags |= AVFMTCTX_NOHEADER;
goto do_pcr;
}
-
+
/* tune to first service found */
for(i=0; i<ts->nb_services && ts->set_service_ret; i++){
service = ts->services[i];
#ifdef DEBUG_SI
printf("tuning to '%s'\n", service->name);
#endif
-
+
/* now find the info for the first service if we found any,
otherwise try to filter all PATs */
-
+
url_fseek(pb, pos, SEEK_SET);
mpegts_set_service(ts, sid, set_service_cb, ts);
-
+
handle_packets(ts, MAX_SCAN_PACKETS);
}
/* if could not find service, exit */
-
+
if (ts->set_service_ret != 0)
return -1;
-
+
#ifdef DEBUG_SI
printf("tuning done\n");
#endif
int64_t pcrs[2], pcr_h;
int packet_count[2];
uint8_t packet[TS_PACKET_SIZE];
-
+
/* only read packets */
-
+
do_pcr:
st = av_new_stream(s, 0);
if (!st)
av_set_pts_info(st, 60, 1, 27000000);
st->codec->codec_type = CODEC_TYPE_DATA;
st->codec->codec_id = CODEC_ID_MPEG2TS;
-
+
/* we iterate until we find two PCRs to estimate the bitrate */
pcr_pid = -1;
nb_pcrs = 0;
get_buffer(&s->pb, pcr_buf, 12);
if (parse_pcr(&next_pcr_h, &next_pcr_l, pcr_buf) == 0) {
/* XXX: not precise enough */
- ts->pcr_incr = ((next_pcr_h - pcr_h) * 300 + (next_pcr_l - pcr_l)) /
+ ts->pcr_incr = ((next_pcr_h - pcr_h) * 300 + (next_pcr_l - pcr_l)) /
(i + 1);
break;
}
return 0;
}
-static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
+static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
int64_t *ppos, int64_t pos_limit)
{
MpegTSContext *ts = s->priv_data;
// pid = ((buf[1] & 0x1f) << 8) | buf[2];
if(buf[1] & 0x40) break;
pos += ts->raw_packet_size;
- }
+ }
url_fseek(&s->pb, pos, SEEK_SET);
return 0;
MpegTSContext *mpegts_parse_open(AVFormatContext *s)
{
MpegTSContext *ts;
-
+
ts = av_mallocz(sizeof(MpegTSContext));
if (!ts)
return NULL;
/* table ids */
#define PAT_TID 0x00
-#define PMT_TID 0x02
+#define PMT_TID 0x02
#define SDT_TID 0x42
/* descriptor ids */
{
register int i;
unsigned int crc = 0xffffffff;
-
+
for (i=0; i<len; i++)
crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *data++) & 0xff];
-
+
return crc;
}
buf[len - 3] = (crc >> 16) & 0xff;
buf[len - 2] = (crc >> 8) & 0xff;
buf[len - 1] = (crc) & 0xff;
-
+
/* send each packet */
buf_ptr = buf;
while (len > 0) {
if (first)
*q++ = 0; /* 0 offset */
len1 = TS_PACKET_SIZE - (q - packet);
- if (len1 > len)
+ if (len1 > len)
len1 = len;
memcpy(q, buf_ptr, len1);
q += len1;
*q_ptr = q;
}
-int mpegts_write_section1(MpegTSSection *s, int tid, int id,
+int mpegts_write_section1(MpegTSSection *s, int tid, int id,
int version, int sec_num, int last_sec_num,
uint8_t *buf, int len)
{
uint8_t section[1024], *q;
unsigned int tot_len;
-
+
tot_len = 3 + 5 + len + 4;
/* check if not too big */
if (tot_len > 1024)
*q++ = sec_num;
*q++ = last_sec_num;
memcpy(q, buf, len);
-
+
mpegts_write_section(s, section, tot_len);
return 0;
}
MpegTSService *service;
uint8_t data[1012], *q;
int i;
-
+
q = data;
for(i = 0; i < ts->nb_services; i++) {
service = ts->services[i];
val = 0xf000 | (q - program_info_length_ptr - 2);
program_info_length_ptr[0] = val >> 8;
program_info_length_ptr[1] = val;
-
+
for(i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
MpegTSWriteStream *ts_st = st->priv_data;
}
mpegts_write_section1(&service->pmt, PMT_TID, service->sid, 0, 0, 0,
data, q - data);
-}
+}
/* NOTE: str == NULL is accepted for an empty string */
static void putstr8(uint8_t **q_ptr, const char *str)
MpegTSService *service;
uint8_t data[1012], *q, *desc_list_len_ptr, *desc_len_ptr;
int i, running_status, free_ca_mode, val;
-
+
q = data;
put16(&q, ts->onid);
*q++ = 0xff;
desc_len_ptr[0] = q - desc_len_ptr - 1;
/* fill descriptor length */
- val = (running_status << 13) | (free_ca_mode << 12) |
+ val = (running_status << 13) | (free_ca_mode << 12) |
(q - desc_list_len_ptr - 2);
desc_list_len_ptr[0] = val >> 8;
desc_list_len_ptr[1] = val;
data, q - data);
}
-static MpegTSService *mpegts_add_service(MpegTSWrite *ts,
- int sid,
- const char *provider_name,
+static MpegTSService *mpegts_add_service(MpegTSWrite *ts,
+ int sid,
+ const char *provider_name,
const char *name)
{
MpegTSService *service;
AVStream *st;
int i, total_bit_rate;
const char *service_name;
-
+
ts->tsid = DEFAULT_TSID;
ts->onid = DEFAULT_ONID;
/* allocate a single DVB service */
service_name = s->title;
if (service_name[0] == '\0')
service_name = DEFAULT_SERVICE_NAME;
- service = mpegts_add_service(ts, DEFAULT_SID,
+ service = mpegts_add_service(ts, DEFAULT_SID,
DEFAULT_PROVIDER_NAME, service_name);
service->pmt.write_packet = section_write_packet;
service->pmt.opaque = s;
ts_st->pid = DEFAULT_START_PID + i;
ts_st->payload_pts = AV_NOPTS_VALUE;
/* update PCR pid by using the first video stream */
- if (st->codec->codec_type == CODEC_TYPE_VIDEO &&
+ if (st->codec->codec_type == CODEC_TYPE_VIDEO &&
service->pcr_pid == 0x1fff)
service->pcr_pid = ts_st->pid;
total_bit_rate += st->codec->bit_rate;
}
-
+
/* if no video stream, use the first stream as PCR */
if (service->pcr_pid == 0x1fff && s->nb_streams > 0) {
ts_st = s->streams[0]->priv_data;
if (total_bit_rate <= 8 * 1024)
total_bit_rate = 8 * 1024;
- service->pcr_packet_freq = (total_bit_rate * PCR_RETRANS_TIME) /
+ service->pcr_packet_freq = (total_bit_rate * PCR_RETRANS_TIME) /
(TS_PACKET_SIZE * 8 * 1000);
- ts->sdt_packet_freq = (total_bit_rate * SDT_RETRANS_TIME) /
+ ts->sdt_packet_freq = (total_bit_rate * SDT_RETRANS_TIME) /
(TS_PACKET_SIZE * 8 * 1000);
- ts->pat_packet_freq = (total_bit_rate * PAT_RETRANS_TIME) /
+ ts->pat_packet_freq = (total_bit_rate * PAT_RETRANS_TIME) /
(TS_PACKET_SIZE * 8 * 1000);
#if 0
- printf("%d %d %d\n",
+ printf("%d %d %d\n",
total_bit_rate, ts->sdt_packet_freq, ts->pat_packet_freq);
#endif
write_pcr = 0;
if (ts_st->pid == ts_st->service->pcr_pid) {
ts_st->service->pcr_packet_count++;
- if (ts_st->service->pcr_packet_count >=
+ if (ts_st->service->pcr_packet_count >=
ts_st->service->pcr_packet_freq) {
ts_st->service->pcr_packet_count = 0;
write_pcr = 1;
} else if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
(st->codec->codec_id == CODEC_ID_MP2 ||
st->codec->codec_id == CODEC_ID_MP3)) {
- *q++ = 0xc0;
+ *q++ = 0xc0;
} else {
*q++ = 0xbd;
if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) {
if (pts != AV_NOPTS_VALUE) {
*q++ = 0x80; /* PTS only */
*q++ = 0x05; /* header len */
- val = (0x02 << 4) |
+ val = (0x02 << 4) |
(((pts >> 30) & 0x07) << 1) | 1;
*q++ = val;
val = (((pts >> 15) & 0x7fff) << 1) | 1;
/* stuffing already present: increase its size */
afc_len = buf[4] + 1;
memmove(buf + 4 + afc_len + stuffing_len,
- buf + 4 + afc_len,
+ buf + 4 + afc_len,
header_len - (4 + afc_len));
buf[4] += stuffing_len;
memset(buf + 4 + afc_len, 0xff, stuffing_len);
mpegts_write_pes(s, st, buf, size, pkt->pts);
return 0;
}
-
+
max_payload_size = DEFAULT_PES_PAYLOAD_SIZE;
while (size > 0) {
len = max_payload_size - ts_st->payload_index;
}
}
put_flush_packet(&s->pb);
-
+
for(i = 0; i < ts->nb_services; i++) {
service = ts->services[i];
av_freep(&service->provider_name);
/*
* notes on the header (Francois Revol):
- *
- * It is followed by strings, then a table, but nothing tells
+ *
+ * It is followed by strings, then a table, but nothing tells
* where the table begins according to (1). After checking faster.nsv,
* I believe NVSf[16-19] gives the size of the strings data
* (that is the offset of the data table after the header).
* Then, about NSVf[12-15], faster.nsf has 179700. When veiwing it in VLC,
* I noticed there was about 1 NVSs chunk/s, so I ran
* strings faster.nsv | grep NSVs | wc -l
- * which gave me 180. That leads me to think that NSVf[12-15] might be the
+ * which gave me 180. That leads me to think that NSVf[12-15] might be the
* file length in milliseconds.
* Let's try that:
* for f in *.nsv; do HTIME="$(od -t x4 "$f" | head -1 | sed 's/.* //')"; echo "'$f' $((0x$HTIME))s = $((0x$HTIME/1000/60)):$((0x$HTIME/1000%60))"; done
* except for nstrailer (which doesn't have an NSVf header), it repports correct time.
*
- * nsvtrailer.nsv (S1) does not have any NSVf header, only NSVs chunks,
+ * nsvtrailer.nsv (S1) does not have any NSVf header, only NSVs chunks,
* so the header seems to not be mandatory. (for streaming).
- *
+ *
* index slice duration check (excepts nsvtrailer.nsv):
* for f in [^n]*.nsv; do DUR="$(ffmpeg -i "$f" 2>/dev/null | grep 'NSVf duration' | cut -d ' ' -f 4)"; IC="$(ffmpeg -i "$f" 2>/dev/null | grep 'INDEX ENTRIES' | cut -d ' ' -f 2)"; echo "duration $DUR, slite time $(($DUR/$IC))"; done
*/
#ifdef DEBUG
#define PRINT(_v) printf _v
#else
-#define PRINT(_v)
+#define PRINT(_v)
#endif
#if 0
int frame_offset; /* current frame (video) or byte (audio) counter
(used to compute the pts) */
int scale;
- int rate;
+ int rate;
int sample_size; /* audio only data */
int start;
-
+
int new_frame_offset; /* temporary storage (used during seek) */
int cum_len; /* temporary storage (used during seek) */
} NSVStream;
ByteIOContext *pb = &s->pb;
uint32_t v = 0;
int i;
-
+
PRINT(("%s(), offset = %"PRId64", state = %d\n", __FUNCTION__, url_ftell(pb), nsv->state));
-
+
//nsv->state = NSV_UNSYNC;
-
+
for (i = 0; i < NSV_MAX_RESYNC; i++) {
if (url_feof(pb)) {
PRINT(("NSV EOF\n"));
PRINT(("NSV resync: [%d] = %02x\n", i, v & 0x0FF));
}
*/
-
+
if ((v & 0x0000ffff) == 0xefbe) { /* BEEF */
PRINT(("NSV resynced on BEEF after %d bytes\n", i+1));
nsv->state = NSV_FOUND_BEEF;
nsv->state = NSV_FOUND_NSVS;
return 0;
}
-
+
}
PRINT(("NSV sync lost\n"));
return -1;
PRINT(("%s()\n", __FUNCTION__));
nsv->state = NSV_UNSYNC; /* in case we fail */
-
+
size = get_le32(pb);
if (size < 28)
return -1;
strings_size = get_le32(pb);
table_entries = get_le32(pb);
table_entries_used = get_le32(pb);
- PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
+ PRINT(("NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
strings_size, table_entries, table_entries_used));
if (url_feof(pb))
return -1;
-
+
PRINT(("NSV got header; filepos %"PRId64"\n", url_ftell(pb)));
if (strings_size > 0) {
}
if (url_feof(pb))
return -1;
-
+
PRINT(("NSV got infos; filepos %"PRId64"\n", url_ftell(pb)));
if (table_entries_used > 0) {
}
PRINT(("NSV got index; filepos %"PRId64"\n", url_ftell(pb)));
-
+
#ifdef DEBUG_DUMP_INDEX
#define V(v) ((v<0x20 || v > 127)?'.':v)
/* dump index */
PRINT(("NSV [0x%08lx][0x%08lx]: %02x %02x %02x %02x %02x %02x %02x %02x"
"%c%c%c%c%c%c%c%c\n",
nsv->nsvf_index_data[i], size + nsv->nsvf_index_data[i],
- b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
+ b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
V(b[0]), V(b[1]), V(b[2]), V(b[3]), V(b[4]), V(b[5]), V(b[6]), V(b[7]) ));
}
//url_fseek(pb, size, SEEK_SET); /* go back to end of header */
#undef V
#endif
-
+
url_fseek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
-
+
if (url_feof(pb))
return -1;
nsv->state = NSV_HAS_READ_NSVF;
print_tag("NSV NSVs atag", atag, 0);
PRINT(("NSV NSVs vsize %dx%d\n", vwidth, vheight));
#endif
-
+
/* XXX change to ap != NULL ? */
if (s->nb_streams == 0) { /* streams not yet published, let's do that */
nsv->vtag = vtag;
st->codec->codec_id = codec_get_id(nsv_codec_audio_tags, atag);
st->start_time = 0;
// st->duration = nsv->duration; //FIXME
-
+
st->need_parsing = 1; /* for PCM we will read a chunk later and put correct info */
/* XXX:FIXME */
//st->codec->channels = 2; //XXX:channels;
nsv->state = NSV_UNSYNC;
nsv->ahead[0].data = nsv->ahead[1].data = NULL;
-
+
for (i = 0; i < NSV_MAX_RESYNC_TRIES; i++) {
if (nsv_resync(s) < 0)
return -1;
return -1;
/* now read the first chunk, so we can attempt to decode more info */
err = nsv_read_chunk(s, 1);
-
+
PRINT(("parsed header\n"));
return 0;
}
uint16_t asize;
uint16_t auxsize;
uint32_t auxtag;
-
+
PRINT(("%s(%d)\n", __FUNCTION__, fill_header));
-
+
if (nsv->ahead[0].data || nsv->ahead[1].data)
return 0; //-1; /* hey! eat what you've in your plate first! */
null_chunk_retry:
if (url_feof(pb))
return -1;
-
+
for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++)
err = nsv_resync(s);
if (err < 0)
return err;
if (nsv->state != NSV_HAS_READ_NSVS && nsv->state != NSV_FOUND_BEEF)
return -1;
-
+
auxcount = get_byte(pb);
vsize = get_le16(pb);
asize = get_le16(pb);
for (i = 0; i < auxcount; i++) {
auxsize = get_le16(pb);
auxtag = get_le32(pb);
- PRINT(("NSV aux data: '%c%c%c%c', %d bytes\n",
- (auxtag & 0x0ff),
- ((auxtag >> 8) & 0x0ff),
+ PRINT(("NSV aux data: '%c%c%c%c', %d bytes\n",
+ (auxtag & 0x0ff),
+ ((auxtag >> 8) & 0x0ff),
((auxtag >> 16) & 0x0ff),
((auxtag >> 24) & 0x0ff),
auxsize));
url_fskip(pb, auxsize);
vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming braindead */
}
-
+
if (url_feof(pb))
return -1;
if (!vsize && !asize) {
nsv->state = NSV_UNSYNC;
goto null_chunk_retry;
}
-
+
/* map back streams to v,a */
if (s->streams[0])
st[s->streams[0]->id] = s->streams[0];
if (s->streams[1])
st[s->streams[1]->id] = s->streams[1];
-
+
if (vsize/* && st[NSV_ST_VIDEO]*/) {
nst = st[NSV_ST_VIDEO]->priv_data;
pkt = &nsv->ahead[NSV_ST_VIDEO];
channels = 1;
st[NSV_ST_AUDIO]->codec->channels = channels;
st[NSV_ST_AUDIO]->codec->sample_rate = samplerate;
- av_set_pts_info(st[NSV_ST_AUDIO], 64, 1,
+ av_set_pts_info(st[NSV_ST_AUDIO], 64, 1,
st[NSV_ST_AUDIO]->codec->sample_rate);
PRINT(("NSV RAWAUDIO: bps %d, nchan %d, srate %d\n", bps, channels, samplerate));
}
// pkt->dts /= nst->sample_size;
nst->frame_offset += asize; // XXX: that's valid only for PCM !?
}
-
+
//pkt->flags |= PKT_FLAG_KEY;
nsv->state = NSV_UNSYNC;
return 0;
int i, err = 0;
PRINT(("%s()\n", __FUNCTION__));
-
+
/* in case we don't already have something to eat ... */
if (nsv->ahead[0].data == NULL && nsv->ahead[1].data == NULL)
err = nsv_read_chunk(s, 0);
if (err < 0)
return err;
-
+
/* now pick one of the plates */
for (i = 0; i < 2; i++) {
if (nsv->ahead[i].data) {
return pkt->size;
}
}
-
+
/* this restaurant is not approvisionned :^] */
return -1;
}
//from /dev/random
-#define MAIN_STARTCODE (0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48))
-#define STREAM_STARTCODE (0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48))
-#define KEYFRAME_STARTCODE (0xE4ADEECA4569ULL + (((uint64_t)('N'<<8) + 'K')<<48))
-#define INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48))
-#define INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48))
+#define MAIN_STARTCODE (0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48))
+#define STREAM_STARTCODE (0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48))
+#define KEYFRAME_STARTCODE (0xE4ADEECA4569ULL + (((uint64_t)('N'<<8) + 'K')<<48))
+#define INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48))
+#define INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48))
#define ID_STRING "nut/multimedia container\0"
static void update(NUTContext *nut, int stream_index, int64_t frame_start, int frame_type, int frame_code, int key_frame, int size, int64_t pts){
StreamContext *stream= &nut->stream[stream_index];
-
+
stream->last_key_frame= key_frame;
nut->packet_start[ frame_type ]= frame_start;
stream->last_pts= pts;
static void reset(AVFormatContext *s, int64_t global_ts){
NUTContext *nut = s->priv_data;
int i;
-
+
for(i=0; i<s->nb_streams; i++){
StreamContext *stream= &nut->stream[i];
-
+
stream->last_key_frame= 1;
stream->last_pts= av_rescale(global_ts, stream->rate_num*(int64_t)nut->rate_den, stream->rate_den*(int64_t)nut->rate_num);
for(key_frame=0; key_frame<2; key_frame++){
if(intra_only && keyframe_0_esc && key_frame==0)
continue;
-
+
{
FrameCode *ft= &nut->frame_code[start2];
ft->flags= FLAG_KEY_FRAME*key_frame;
static int get_str(ByteIOContext *bc, char *string, unsigned int maxlen){
unsigned int len= get_v(bc);
-
+
if(len && maxlen)
get_buffer(bc, string, FFMIN(len, maxlen));
while(len > maxlen){
if(maxlen)
string[FFMIN(len, maxlen-1)]= 0;
-
+
if(maxlen == len)
return -1;
else
static uint64_t get_vb(ByteIOContext *bc){
uint64_t val=0;
unsigned int i= get_v(bc);
-
+
if(i>8)
return UINT64_MAX;
-
+
while(i--)
val = (val<<8) + get_byte(bc);
-
+
//av_log(NULL, AV_LOG_DEBUG, "get_vb()= %lld\n", val);
return val;
}
}
/**
- *
+ *
*/
static int get_length(uint64_t val){
int i;
static uint64_t find_any_startcode(ByteIOContext *bc, int64_t pos){
uint64_t state=0;
-
+
if(pos >= 0)
url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream isnt seekable, but that shouldnt matter, as in this case we simply start where we are currently
*/
static void put_str(ByteIOContext *bc, const char *string){
int len= strlen(string);
-
+
put_v(bc, len);
put_buffer(bc, string, len);
}
static void put_vb(ByteIOContext *bc, uint64_t val){
int i;
-
+
for (i=8; val>>i; i+=8);
put_v(bc, i>>3);
#ifdef TRACE
static inline void put_v_trace(ByteIOContext *bc, uint64_t v, char *file, char *func, int line){
printf("get_v %5lld / %llX in %s %s:%d\n", v, v, file, func, line);
-
+
put_v(bc, v);
}
static inline void put_s_trace(ByteIOContext *bc, int64_t v, char *file, char *func, int line){
printf("get_s %5lld / %llX in %s %s:%d\n", v, v, file, func, line);
-
+
put_s(bc, v);
}
static inline void put_vb_trace(ByteIOContext *bc, uint64_t v, char *file, char *func, int line){
printf("get_vb %5lld / %llX in %s %s:%d\n", v, v, file, func, line);
-
+
put_vb(bc, v);
}
#define put_v(bc, v) put_v_trace(bc, v, __FILE__, __PRETTY_FUNCTION__, __LINE__)
put_flush_packet(bc);
nut->packet_start[2]= url_ftell(bc) - 8;
nut->written_packet_size = max_size;
-
+
/* packet header */
put_v(bc, nut->written_packet_size); /* forward ptr */
int64_t start= nut->packet_start[2];
int64_t cur= url_ftell(bc);
int size= cur - start - get_length(nut->written_packet_size)/7 - 8;
-
+
if(calculate_checksum)
size += 4;
-
+
if(size != nut->written_packet_size){
int i;
assert( size <= nut->written_packet_size );
-
+
url_fseek(bc, start + 8, SEEK_SET);
for(i=get_length(size); i < get_length(nut->written_packet_size); i+=7)
put_byte(bc, 0x80);
url_fseek(bc, cur, SEEK_SET);
nut->written_packet_size= size; //FIXME may fail if multiple updates with differing sizes, as get_length may differ
-
+
if(calculate_checksum)
put_be32(bc, get_checksum(bc));
}
-
+
return 0;
}
int i, j, tmp_time, tmp_flags,tmp_stream, tmp_mul, tmp_size, tmp_fields;
nut->avf= s;
-
- nut->stream =
+
+ nut->stream =
av_mallocz(sizeof(StreamContext)*s->nb_streams);
-
+
put_buffer(bc, ID_STRING, strlen(ID_STRING));
put_byte(bc, 0);
nut->packet_start[2]= url_ftell(bc);
-
+
/* main header */
put_be64(bc, MAIN_STARTCODE);
put_packetheader(nut, bc, 120+5*256, 1);
put_v(bc, s->nb_streams);
put_v(bc, MAX_DISTANCE);
put_v(bc, MAX_SHORT_DISTANCE);
-
+
put_v(bc, nut->rate_num=1);
put_v(bc, nut->rate_den=2);
put_v(bc, nut->short_startcode=0x4EFE79);
-
+
build_frame_code(s);
assert(nut->frame_code['N'].flags == FLAG_INVALID);
-
+
tmp_time= tmp_flags= tmp_stream= tmp_mul= tmp_size= /*tmp_res=*/ INT_MAX;
for(i=0; i<256;){
tmp_fields=0;
tmp_mul = nut->frame_code[i].size_mul;
tmp_size = nut->frame_code[i].size_lsb;
// tmp_res = nut->frame_code[i].res;
-
+
for(j=0; i<256; j++,i++){
if(nut->frame_code[i].timestamp_delta != tmp_time ) break;
if(nut->frame_code[i].flags != tmp_flags ) break;
}
update_packetheader(nut, bc, 0, 1);
-
+
/* stream headers */
for (i = 0; i < s->nb_streams; i++)
{
int nom, denom, ssize;
codec = s->streams[i]->codec;
-
+
put_be64(bc, STREAM_STARTCODE);
put_packetheader(nut, bc, 120 + codec->extradata_size, 1);
put_v(bc, i /*s->streams[i]->index*/);
}
else
put_vb(bc, 0);
-
+
ff_parse_specific_params(codec, &nom, &ssize, &denom);
nut->stream[i].rate_num= nom;
put_v(bc, nut->stream[i].msb_timestamp_shift);
put_v(bc, codec->has_b_frames);
put_byte(bc, 0); /* flags: 0x1 - fixed_fps, 0x2 - index_present */
-
+
if(codec->extradata_size){
put_v(bc, 1);
put_v(bc, codec->extradata_size);
- put_buffer(bc, codec->extradata, codec->extradata_size);
+ put_buffer(bc, codec->extradata, codec->extradata_size);
}
put_v(bc, 0); /* end of codec specific headers */
-
+
switch(codec->codec_type)
{
case CODEC_TYPE_AUDIO:
/* info header */
put_be64(bc, INFO_STARTCODE);
put_packetheader(nut, bc, 30+strlen(s->author)+strlen(s->title)+
- strlen(s->comment)+strlen(s->copyright)+strlen(LIBAVFORMAT_IDENT), 1);
+ strlen(s->comment)+strlen(s->copyright)+strlen(LIBAVFORMAT_IDENT), 1);
if (s->author[0])
{
put_v(bc, 9); /* type */
put_v(bc, 13); /* type */
put_str(bc, LIBAVFORMAT_IDENT);
}
-
+
put_v(bc, 0); /* eof info */
update_packetheader(nut, bc, 0, 1);
-
+
put_flush_packet(bc);
-
+
return 0;
}
enc = s->streams[stream_index]->codec;
key_frame = !!(pkt->flags & PKT_FLAG_KEY);
-
+
frame_type=0;
if(frame_start + size + 20 - FFMAX(nut->packet_start[1], nut->packet_start[2]) > MAX_DISTANCE)
frame_type=2;
flags= nut->frame_code[i].flags;
assert(size_mul > size_lsb);
-
+
if(stream_id_plus1 == 0) length+= get_length(stream_index);
else if(stream_id_plus1 - 1 != stream_index)
continue;
if(full_pts && time_delta)
continue;
-
+
if(!time_delta){
length += get_length(coded_pts);
}else{
if(size > MAX_DISTANCE){
assert(frame_type > 1);
}
-
+
put_buffer(bc, pkt->data, size);
update(nut, stream_index, frame_start, frame_type, frame_code, key_frame, size, pts);
-
+
return 0;
}
#endif
put_flush_packet(bc);
-
+
av_freep(&nut->stream);
return 0;
ByteIOContext *bc = &s->pb;
uint64_t tmp;
int i, j, tmp_stream, tmp_mul, tmp_time, tmp_size, count, tmp_res;
-
+
get_packetheader(nut, bc, 1);
tmp = get_v(bc);
av_log(s, AV_LOG_ERROR, "bad version (%"PRId64")\n", tmp);
return -1;
}
-
+
nut->stream_count = get_v(bc);
if(nut->stream_count > MAX_STREAMS){
av_log(s, AV_LOG_ERROR, "too many streams\n");
av_log(s, AV_LOG_ERROR, "invalid short startcode %X\n", nut->short_startcode);
return -1;
}
-
+
for(i=0; i<256;){
int tmp_flags = get_v(bc);
int tmp_fields= get_v(bc);
else tmp_res = 0;
if(tmp_fields>5) count = get_v(bc);
else count = tmp_mul - tmp_size;
-
- while(tmp_fields-- > 6)
+
+ while(tmp_fields-- > 6)
get_v(bc);
-
+
if(count == 0 || i+count > 256){
av_log(s, AV_LOG_ERROR, "illegal count %d at %d\n", count, i);
return -1;
int class, nom, denom, stream_id;
uint64_t tmp;
AVStream *st;
-
+
get_packetheader(nut, bc, 1);
stream_id= get_v(bc);
if(stream_id >= nut->stream_count || s->streams[stream_id])
return -1;
-
+
st = av_new_stream(s, stream_id);
if (!st)
return AVERROR_NOMEM;
if((unsigned)st->codec->extradata_size > (1<<30))
return -1;
st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
- get_buffer(bc, st->codec->extradata, st->codec->extradata_size);
+ get_buffer(bc, st->codec->extradata, st->codec->extradata_size);
// url_fskip(bc, get_v(bc));
}
-
+
if (st->codec->codec_type == CODEC_TYPE_VIDEO) /* VIDEO */
{
st->codec->width = get_v(bc);
static int decode_info_header(NUTContext *nut){
AVFormatContext *s= nut->avf;
ByteIOContext *bc = &s->pb;
-
+
get_packetheader(nut, bc, 1);
for(;;){
get_str(bc, custom_name, sizeof(custom_name));
name= custom_name;
}
-
+
if(!strcmp(type, "v")){
get_v(bc);
}else{
int inited_stream_count;
nut->avf= s;
-
+
/* main header */
pos=0;
for(;;){
if(decode_main_header(nut) >= 0)
break;
}
-
-
+
+
s->bit_rate = 0;
nut->stream = av_malloc(sizeof(StreamContext)*nut->stream_count);
if(frame_type)
nut->packet_start[ frame_type ]= frame_start; //otherwise 1 goto 1 may happen
-
+
flags= nut->frame_code[frame_code].flags;
size_mul= nut->frame_code[frame_code].size_mul;
size_lsb= nut->frame_code[frame_code].size_lsb;
stream_id= nut->frame_code[frame_code].stream_id_plus1 - 1;
time_delta= nut->frame_code[frame_code].timestamp_delta;
-
+
if(stream_id==-1)
stream_id= get_v(bc);
if(stream_id >= s->nb_streams){
if(*key_frame_ret){
// av_log(s, AV_LOG_DEBUG, "stream:%d start:%lld pts:%lld length:%lld\n",stream_id, frame_start, av_pts, frame_start - nut->stream[stream_id].last_sync_pos);
av_add_index_entry(
- s->streams[stream_id],
- frame_start,
- pts,
+ s->streams[stream_id],
+ frame_start,
+ pts,
frame_start - nut->stream[stream_id].last_sync_pos,
AVINDEX_KEYFRAME);
nut->stream[stream_id].last_sync_pos= frame_start;
size= size_lsb;
if(flags & FLAG_DATA_SIZE)
size+= size_mul*get_v(bc);
-
+
#ifdef TRACE
av_log(s, AV_LOG_DEBUG, "fs:%lld fc:%d ft:%d kf:%d pts:%lld size:%d mul:%d lsb:%d flags:%d delta:%d\n", frame_start, frame_code, frame_type, *key_frame_ret, pts, size, size_mul, size_lsb, flags, time_delta);
#endif
av_log(s, AV_LOG_ERROR, "frame size too large\n");
return -1;
}
-
+
*stream_id_ret = stream_id;
*pts_ret = pts;
ByteIOContext *bc = &s->pb;
int size, stream_id, key_frame, discard;
int64_t pts, last_IP_pts;
-
+
size= decode_frame_header(nut, &key_frame, &pts, &stream_id, frame_code, frame_type, frame_start);
if(size < 0)
return -1;
url_fseek(bc, -8, SEEK_CUR);
for(i=0; i<s->nb_streams; i++)
nut->stream[i].last_sync_pos= url_ftell(bc);
-
+
for(;;){
int frame_type=0;
int64_t pos= url_ftell(bc);
uint64_t tmp=0;
-
+
if(pos > pos_limit || url_feof(bc))
return AV_NOPTS_VALUE;
size= decode_frame_header(nut, &key_frame, &pts, &stream_id, frame_code, frame_type, pos);
if(size < 0)
goto resync;
-
+
stream= &nut->stream[stream_id];
if(stream_id != stream_index || !key_frame || pos < *pos_arg){
url_fseek(bc, size, SEEK_CUR);
break;
}
-
+
*pos_arg= pos;
return pts;
default:
#ifdef CONFIG_MUXERS
-static int ogg_write_header(AVFormatContext *avfcontext)
+static int ogg_write_header(AVFormatContext *avfcontext)
{
OggContext *context = avfcontext->priv_data;
- ogg_packet *op= &context->op;
+ ogg_packet *op= &context->op;
int n;
ogg_stream_init(&context->os, 31415);
-
+
for(n = 0 ; n < avfcontext->nb_streams ; n++) {
AVCodecContext *codec = avfcontext->streams[n]->codec;
uint8_t *headers = codec->extradata;
uint8_t *header_start[3];
int header_len[3];
int i, j;
-
+
av_set_pts_info(avfcontext->streams[n], 60, 1, AV_TIME_BASE);
for(j=1,i=0;i<2;++i, ++j) {
context->header_handled = 0 ;
}
-
+
return 0 ;
}
op->granulepos= pts;
/* correct the fields in the packet -- essential for streaming */
-
- ogg_stream_packetin(&context->os, op);
-
+
+ ogg_stream_packetin(&context->os, op);
+
while(ogg_stream_pageout(&context->os, &og)) {
put_buffer(&avfcontext->pb, og.header, og.header_len);
- put_buffer(&avfcontext->pb, og.body, og.body_len);
+ put_buffer(&avfcontext->pb, og.body, og.body_len);
put_flush_packet(&avfcontext->pb);
- }
+ }
op->packetno++;
return 0;
buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ;
if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0)
return 1 ;
- ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;
- }
-
+ ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;
+ }
+
/* got a page. Feed it into the stream and get the packet */
if(ogg_stream_pagein(&context->os, &og) != 0)
return 1 ;
static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap)
{
OggContext *context = avfcontext->priv_data;
- ogg_packet op ;
+ ogg_packet op ;
char *buf ;
ogg_page og ;
AVStream *ast ;
AVCodecContext *codec;
uint8_t *p;
int i;
-
+
ogg_sync_init(&context->oy) ;
buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ;
if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0)
return AVERROR_IO ;
-
- ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;
+
+ ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;
ogg_sync_pageout(&context->oy, &og) ;
ogg_stream_init(&context->os, ogg_page_serialno(&og)) ;
ogg_stream_pagein(&context->os, &og) ;
-
+
/* currently only one vorbis stream supported */
ast = av_new_stream(avfcontext, 0) ;
static int ogg_read_packet(AVFormatContext *avfcontext, AVPacket *pkt) {
ogg_packet op ;
- if(next_packet(avfcontext, &op))
+ if(next_packet(avfcontext, &op))
return AVERROR_IO ;
if(av_new_packet(pkt, op.bytes) < 0)
return AVERROR_IO ;
* Ogg bitstream support
* Luca Barbato <lu_zero@gentoo.org>
* Based on tcvp implementation
- *
+ *
*/
/**
ogg_stream_t *os;
int idx = -1;
- //Get an ogg packet
+ //Get an ogg packet
do{
if (ogg_packet (s, &idx) < 0)
return AVERROR_IO;
ogg_read_packet,
ogg_read_close,
ogg_read_seek,
-// ogg_read_timestamp,
+// ogg_read_timestamp,
.extensions = "ogg",
};
/*
* Copyright (C) 2005 Matthieu CASTET
- *
+ *
* This library 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
return -1;
skip_bits(&gb, 8 + 16); /* minor version + header count */
skip_bits(&gb, 4*8); /* "fLaC" */
-
+
/* METADATA_BLOCK_HEADER */
if (get_bits(&gb, 32) != FLAC_STREAMINFO_SIZE)
return -1;
st->codec->sample_rate = get_bits_long(&gb, 20);
st->codec->channels = get_bits(&gb, 3) + 1;
-
+
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_FLAC;
skip_bits(&gb, 64);
st->codec->time_base.den = get_bits(&gb, 32);
st->codec->time_base.num = get_bits(&gb, 32);
-
+
st->codec->sample_aspect_ratio.num = get_bits(&gb, 24);
st->codec->sample_aspect_ratio.den = get_bits(&gb, 24);
memcpy (ct, v, vl);
ct[vl] = 0;
- // took from Vorbis_I_spec
+ // took from Vorbis_I_spec
if (!strcmp (tt, "AUTHOR"))
strncpy (as->author, ct, FFMIN(sizeof (as->author), vl));
else if (!strcmp (tt, "TITLE"))
* Vorbis Identification header from Vorbis_I_spec.html#vorbis-spec-codec
* [vorbis_version] = read 32 bits as unsigned integer | Not used
* [audio_channels] = read 8 bit integer as unsigned | Used
- * [audio_sample_rate] = read 32 bits as unsigned integer | Used
+ * [audio_sample_rate] = read 32 bits as unsigned integer | Used
* [bitrate_maximum] = read 32 bits as signed integer | Not used yet
* [bitrate_nominal] = read 32 bits as signed integer | Not used yet
* [bitrate_minimum] = read 32 bits as signed integer | Used as bitrate
struct tm *localtime_r(const time_t *t, struct tm *tp)
{
struct tm *l;
-
+
l = localtime(t);
if (!l)
return 0;
int channels;
int bits_per_pixel;
int bpp;
-
+
uint8_t *image_buf;
int image_linesize;
uint32_t palette[256];
};
/* Mask to determine which pixels to overwrite while displaying */
-static const uint8_t png_pass_dsp_mask[NB_PASSES] = {
+static const uint8_t png_pass_dsp_mask[NB_PASSES] = {
0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff
};
/* NOTE: we try to construct a good looking image at each pass. width
is the original image width. We also do pixel format convertion at
this stage */
-static void png_put_interlaced_row(uint8_t *dst, int width,
- int bits_per_pixel, int pass,
+static void png_put_interlaced_row(uint8_t *dst, int width,
+ int bits_per_pixel, int pass,
int color_type, const uint8_t *src)
{
int x, mask, dsp_mask, j, src_x, b, bpp;
uint8_t *d;
const uint8_t *s;
-
+
mask = png_pass_mask[pass];
dsp_mask = png_pass_dsp_mask[pass];
switch(bits_per_pixel) {
}
}
-static void png_get_interlaced_row(uint8_t *dst, int row_size,
- int bits_per_pixel, int pass,
+static void png_get_interlaced_row(uint8_t *dst, int row_size,
+ int bits_per_pixel, int pass,
const uint8_t *src, int width)
{
int x, mask, dst_x, j, b, bpp;
/* XXX: optimize */
/* NOTE: 'dst' can be equal to 'last' */
-static void png_filter_row(uint8_t *dst, int filter_type,
+static void png_filter_row(uint8_t *dst, int filter_type,
uint8_t *src, uint8_t *last, int size, int bpp)
{
int i, p;
uint8_t *d;
int j;
unsigned int v;
-
+
d = dst;
for(j = 0; j < width; j++) {
v = ((uint32_t *)src)[j];
{
uint8_t *ptr, *last_row;
int got_line;
-
+
if (!s->interlace_type) {
ptr = s->image_buf + s->image_linesize * s->y;
/* need to swap bytes correctly for RGB_ALPHA */
if (s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
- png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
+ png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
s->last_row, s->row_size, s->bpp);
memcpy(s->last_row, s->tmp_row, s->row_size);
convert_to_rgba32(ptr, s->tmp_row, s->width);
last_row = s->last_row;
else
last_row = ptr - s->image_linesize;
-
- png_filter_row(ptr, s->crow_buf[0], s->crow_buf + 1,
+
+ png_filter_row(ptr, s->crow_buf[0], s->crow_buf + 1,
last_row, s->row_size, s->bpp);
}
s->y++;
wait for the next one */
if (got_line)
break;
- png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
+ png_filter_row(s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
s->last_row, s->pass_row_size, s->bpp);
memcpy(s->last_row, s->tmp_row, s->pass_row_size);
got_line = 1;
}
if ((png_pass_dsp_ymask[s->pass] << (s->y & 7)) & 0x80) {
/* NOTE: rgba32 is handled directly in png_put_interlaced_row */
- png_put_interlaced_row(ptr, s->width, s->bits_per_pixel, s->pass,
+ png_put_interlaced_row(ptr, s->width, s->bits_per_pixel, s->pass,
s->color_type, s->last_row);
}
s->y++;
} else {
s->pass++;
s->y = 0;
- s->pass_row_size = png_pass_row_size(s->pass,
- s->bits_per_pixel,
+ s->pass_row_size = png_pass_row_size(s->pass,
+ s->bits_per_pixel,
s->width);
s->crow_size = s->pass_row_size + 1;
if (s->pass_row_size != 0)
return 0;
}
-static int png_read(ByteIOContext *f,
+static int png_read(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
{
AVImageInfo info1, *info = &info1;
goto fail;
tag = get_le32(f);
#ifdef DEBUG
- printf("png: tag=%c%c%c%c length=%u\n",
+ printf("png: tag=%c%c%c%c length=%u\n",
(tag & 0xff),
((tag >> 8) & 0xff),
((tag >> 16) & 0xff),
crc = get_be32(f);
s->state |= PNG_IHDR;
#ifdef DEBUG
- printf("width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
- s->width, s->height, s->bit_depth, s->color_type,
+ printf("width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
+ s->width, s->height, s->bit_depth, s->color_type,
s->compression_type, s->filter_type, s->interlace_type);
#endif
break;
s->bpp = (s->bits_per_pixel + 7) >> 3;
s->row_size = (info->width * s->bits_per_pixel + 7) >> 3;
- if (s->bit_depth == 8 &&
+ if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_RGB) {
info->pix_fmt = PIX_FMT_RGB24;
- } else if (s->bit_depth == 8 &&
+ } else if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
info->pix_fmt = PIX_FMT_RGBA32;
- } else if (s->bit_depth == 8 &&
+ } else if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_GRAY) {
info->pix_fmt = PIX_FMT_GRAY8;
- } else if (s->bit_depth == 1 &&
+ } else if (s->bit_depth == 1 &&
s->color_type == PNG_COLOR_TYPE_GRAY) {
info->pix_fmt = PIX_FMT_MONOBLACK;
} else if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
goto fail;
}
ret = alloc_cb(opaque, info);
- if (ret)
+ if (ret)
goto the_end;
/* compute the compressed row size */
s->crow_size = s->row_size + 1;
} else {
s->pass = 0;
- s->pass_row_size = png_pass_row_size(s->pass,
- s->bits_per_pixel,
+ s->pass_row_size = png_pass_row_size(s->pass,
+ s->bits_per_pixel,
s->width);
s->crow_size = s->pass_row_size + 1;
}
#ifdef DEBUG
- printf("row_size=%d crow_size =%d\n",
+ printf("row_size=%d crow_size =%d\n",
s->row_size, s->crow_size);
#endif
s->image_buf = info->pict.data[0];
case MKTAG('P', 'L', 'T', 'E'):
{
int n, i, r, g, b;
-
+
if ((length % 3) != 0 || length > 256 * 3)
goto skip_tag;
/* read the palette */
uint8_t *ptr;
uint8_t *crow_buf = NULL;
uint8_t *tmp_buf = NULL;
-
+
s->f = f;
is_progressive = info->interleaved;
switch(info->pix_fmt) {
/* write png header */
put_buffer(f, pngsig, 8);
-
+
to_be32(s->buf, info->width);
to_be32(s->buf + 4, info->height);
s->buf[8] = bit_depth;
s->buf[10] = 0; /* compression type */
s->buf[11] = 0; /* filter type */
s->buf[12] = is_progressive; /* interlace type */
-
+
png_write_chunk(f, MKTAG('I', 'H', 'D', 'R'), s->buf, 13);
/* put the palette if needed */
unsigned int v;
uint32_t *palette;
uint8_t *alpha_ptr;
-
+
palette = (uint32_t *)info->pict.data[1];
ptr = s->buf;
alpha_ptr = s->buf + 256 * 3;
} else {
ptr1 = ptr;
}
- png_get_interlaced_row(crow_buf + 1, pass_row_size,
- bits_per_pixel, pass,
+ png_get_interlaced_row(crow_buf + 1, pass_row_size,
+ bits_per_pixel, pass,
ptr1, info->width);
crow_buf[0] = PNG_FILTER_VALUE_NONE;
png_write_row(s, crow_buf, pass_row_size + 1);
"png",
png_probe,
png_read,
- (1 << PIX_FMT_RGBA32) | (1 << PIX_FMT_RGB24) | (1 << PIX_FMT_GRAY8) |
+ (1 << PIX_FMT_RGBA32) | (1 << PIX_FMT_RGB24) | (1 << PIX_FMT_GRAY8) |
(1 << PIX_FMT_MONOBLACK) | (1 << PIX_FMT_PAL8),
png_write,
AVIMAGE_INTERLEAVED,
*/
#include "avformat.h"
-static inline int pnm_space(int c)
+static inline int pnm_space(int c)
{
return (c == ' ' || c == '\n' || c == '\r' || c == '\t');
}
-static void pnm_get(ByteIOContext *f, char *str, int buf_size)
+static void pnm_get(ByteIOContext *f, char *str, int buf_size)
{
char *s;
int c;
-
+
/* skip spaces and comments */
for(;;) {
c = url_fgetc(f);
break;
}
}
-
+
s = str;
while (c != URL_EOF && !pnm_space(c)) {
if ((s - str) < buf_size - 1)
*s = '\0';
}
-static int pnm_read1(ByteIOContext *f,
+static int pnm_read1(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque,
int allow_yuv)
{
if (!strcmp(buf1, "P4")) {
info->pix_fmt = PIX_FMT_MONOWHITE;
} else if (!strcmp(buf1, "P5")) {
- if (allow_yuv)
+ if (allow_yuv)
info->pix_fmt = PIX_FMT_YUV420P;
else
info->pix_fmt = PIX_FMT_GRAY8;
h /= 3;
info->height = h;
}
-
+
ret = alloc_cb(opaque, info);
if (ret)
return ret;
-
+
switch(info->pix_fmt) {
default:
return AVERROR_INVALIDDATA;
return 0;
}
-static int pnm_read(ByteIOContext *f,
+static int pnm_read(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
{
return pnm_read1(f, alloc_cb, opaque, 0);
}
-static int pgmyuv_read(ByteIOContext *f,
+static int pgmyuv_read(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
{
return pnm_read1(f, alloc_cb, opaque, 1);
default:
return AVERROR_INVALIDDATA;
}
- snprintf(buf, sizeof(buf),
+ snprintf(buf, sizeof(buf),
"P%c\n%d %d\n",
c, info->width, h1);
put_buffer(pb, buf, strlen(buf));
if (info->pix_fmt != PIX_FMT_MONOWHITE) {
- snprintf(buf, sizeof(buf),
+ snprintf(buf, sizeof(buf),
"%d\n", 255);
put_buffer(pb, buf, strlen(buf));
}
-
+
ptr = info->pict.data[0];
linesize = info->pict.linesize[0];
for(i=0;i<h;i++) {
put_buffer(pb, ptr, n);
ptr += linesize;
}
-
+
if (info->pix_fmt == PIX_FMT_YUV420P) {
h >>= 1;
n >>= 1;
return 0;
}
-static int pam_read(ByteIOContext *f,
+static int pam_read(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
{
int i, n, linesize, h, w, depth, maxval;
if (depth == 1) {
if (maxval == 1)
info->pix_fmt = PIX_FMT_MONOWHITE;
- else
+ else
info->pix_fmt = PIX_FMT_GRAY8;
} else if (depth == 3) {
info->pix_fmt = PIX_FMT_RGB24;
ret = alloc_cb(opaque, info);
if (ret)
return ret;
-
+
switch(info->pix_fmt) {
default:
return AVERROR_INVALIDDATA;
default:
return AVERROR_INVALIDDATA;
}
- snprintf(buf, sizeof(buf),
+ snprintf(buf, sizeof(buf),
"P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\nTUPLETYPE %s\nENDHDR\n",
w, h, depth, maxval, tuple_type);
put_buffer(pb, buf, strlen(buf));
-
+
ptr = info->pict.data[0];
linesize = info->pict.linesize[0];
-
+
if (info->pix_fmt == PIX_FMT_RGBA32) {
int j;
unsigned int v;
"pam",
pam_probe,
pam_read,
- (1 << PIX_FMT_MONOWHITE) | (1 << PIX_FMT_GRAY8) | (1 << PIX_FMT_RGB24) |
+ (1 << PIX_FMT_MONOWHITE) | (1 << PIX_FMT_GRAY8) | (1 << PIX_FMT_RGB24) |
(1 << PIX_FMT_RGBA32),
pam_write,
};
str->channels[channel].video_stream_index = st->index;
st->codec->codec_type = CODEC_TYPE_VIDEO;
- st->codec->codec_id = CODEC_ID_MDEC;
+ st->codec->codec_id = CODEC_ID_MDEC;
st->codec->codec_tag = 0; /* no fourcc */
st->codec->width = str->channels[channel].width;
st->codec->height = str->channels[channel].height;
int fmt;
str->audio_channel = channel;
str->channels[channel].type = STR_AUDIO;
- str->channels[channel].channels =
+ str->channels[channel].channels =
(sector[0x13] & 0x01) ? 2 : 1;
- str->channels[channel].sample_rate =
+ str->channels[channel].sample_rate =
(sector[0x13] & 0x04) ? 18900 : 37800;
- str->channels[channel].bits =
+ str->channels[channel].bits =
(sector[0x13] & 0x10) ? 8 : 4;
/* allocate a new AVStream */
fmt = sector[0x13];
st->codec->codec_type = CODEC_TYPE_AUDIO;
- st->codec->codec_id = CODEC_ID_ADPCM_XA;
+ st->codec->codec_id = CODEC_ID_ADPCM_XA;
st->codec->codec_tag = 0; /* no fourcc */
st->codec->channels = (fmt&1)?2:1;
st->codec->sample_rate = (fmt&4)?18900:37800;
str->channels[str->video_channel].width,
str->channels[str->video_channel].height,str->channels[str->video_channel].video_stream_index);
if (str->audio_channel != -1)
- av_log (s, AV_LOG_DEBUG, " audio channel = %d, %d Hz, %d channels, %d bits/sample %d\n",
+ av_log (s, AV_LOG_DEBUG, " audio channel = %d, %d Hz, %d channels, %d bits/sample %d\n",
str->audio_channel,
str->channels[str->audio_channel].sample_rate,
str->channels[str->audio_channel].channels,
return AVERROR_IO;
pkt->pos= url_ftell(pb) - RAW_CD_SECTOR_SIZE;
- pkt->stream_index =
+ pkt->stream_index =
str->channels[channel].video_stream_index;
// pkt->pts = str->pts;
return AVERROR_IO;
memcpy(pkt->data,sector+24,2304);
- pkt->stream_index =
+ pkt->stream_index =
str->channels[channel].audio_stream_index;
//pkt->pts = str->pts;
return 0;
0x93, 0x65, 0x5E, 0x00,
0xFF, 0xFF, 0xFF, 0x00,
0xDF, 0xD0, 0xAB, 0x00,
- 0x00, 0x00, 0x00, 0x00
+ 0x00, 0x00, 0x00, 0x00
};
unsigned char ff_qt_default_palette_16[16 * 4] = {
0xFF, 0xFB, 0xF9, 0x00,
0xE8, 0xCA, 0xC5, 0x00,
0x8A, 0x7C, 0x77, 0x00,
- 0x00, 0x00, 0x00, 0x00
+ 0x00, 0x00, 0x00, 0x00
};
unsigned char ff_qt_default_palette_256[256 * 4] = {
-/*
+/*
* RAW encoder and decoder
* Copyright (c) 2001 Fabrice Bellard.
* Copyright (c) 2005 Alex Beregszaszi
{
int ret, size;
// AVStream *st = s->streams[0];
-
+
size= RAW_PACKET_SIZE;
ret= av_get_packet(&s->pb, pkt, size);
if (av_new_packet(pkt, size) < 0)
return AVERROR_IO;
-
+
pkt->pos= url_ftell(&s->pb);
pkt->stream_index = 0;
ret = get_partial_buffer(&s->pb, pkt->data, size);
static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, size, w, h, unk1, unk2;
-
+
if (get_le32(&s->pb) != MKTAG('M', 'J', 'P', 'G'))
return AVERROR_IO; // FIXME
size = get_le32(&s->pb);
-
+
w = get_le16(&s->pb);
h = get_le16(&s->pb);
-
+
url_fskip(&s->pb, 8); // zero + size (padded?)
url_fskip(&s->pb, 2);
unk1 = get_le16(&s->pb);
unk2 = get_le16(&s->pb);
url_fskip(&s->pb, 22); // ascii timestamp
-
+
av_log(NULL, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
size, w, h, unk1, unk2);
return 0;
}
-int pcm_read_seek(AVFormatContext *s,
+int pcm_read_seek(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
AVStream *st;
byte_rate = st->codec->bit_rate / 8;
break;
}
-
+
if (block_align <= 0 || byte_rate <= 0)
return -1;
/* compute the position by aligning it to block_align */
- pos = av_rescale_rnd(timestamp * byte_rate,
- st->time_base.num,
+ pos = av_rescale_rnd(timestamp * byte_rate,
+ st->time_base.num,
st->time_base.den * (int64_t)block_align,
(flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP);
pos *= block_align;
/* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
if (ap && ap->time_base.num) {
av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
- } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
+ } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
st->codec->codec_id == CODEC_ID_MPEG4 ||
st->codec->codec_id == CODEC_ID_H264) {
av_set_pts_info(st, 64, 1, 25);
AVOutputFormat ac3_oformat = {
"ac3",
"raw ac3",
- "audio/x-ac3",
+ "audio/x-ac3",
"ac3",
0,
CODEC_ID_AC3,
#endif
-PCMDEF(s16le, "pcm signed 16 bit little endian format",
+PCMDEF(s16le, "pcm signed 16 bit little endian format",
LE_DEF("sw"), CODEC_ID_PCM_S16LE)
-PCMDEF(s16be, "pcm signed 16 bit big endian format",
+PCMDEF(s16be, "pcm signed 16 bit big endian format",
BE_DEF("sw"), CODEC_ID_PCM_S16BE)
-PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
+PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
LE_DEF("uw"), CODEC_ID_PCM_U16LE)
-PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
+PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
BE_DEF("uw"), CODEC_ID_PCM_U16BE)
-PCMDEF(s8, "pcm signed 8 bit format",
+PCMDEF(s8, "pcm signed 8 bit format",
"sb", CODEC_ID_PCM_S8)
-PCMDEF(u8, "pcm unsigned 8 bit format",
+PCMDEF(u8, "pcm unsigned 8 bit format",
"ub", CODEC_ID_PCM_U8)
-PCMDEF(mulaw, "pcm mu law format",
+PCMDEF(mulaw, "pcm mu law format",
"ul", CODEC_ID_PCM_MULAW)
-PCMDEF(alaw, "pcm A law format",
+PCMDEF(alaw, "pcm A law format",
"al", CODEC_ID_PCM_ALAW)
static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
av_register_input_format(&h263_iformat);
av_register_output_format(&h263_oformat);
-
+
av_register_input_format(&m4v_iformat);
av_register_output_format(&m4v_oformat);
-
+
av_register_input_format(&h264_iformat);
av_register_output_format(&h264_oformat);
av_register_input_format(&mjpeg_iformat);
av_register_output_format(&mjpeg_oformat);
-
+
av_register_input_format(&ingenient_iformat);
av_register_input_format(&pcm_s16le_iformat);
#include "avformat.h"
/* in ms */
-#define BUFFER_DURATION 0
+#define BUFFER_DURATION 0
typedef struct {
int nb_packets;
}
}
-static void rv10_write_header(AVFormatContext *ctx,
+static void rv10_write_header(AVFormatContext *ctx,
int data_size, int index_pos)
{
RMContext *rm = ctx->priv_data;
if (url_is_streamed(s))
flags |= 4; /* live broadcast */
put_be16(s, flags);
-
+
/* comments */
put_tag(s,"CONT");
- size = strlen(ctx->title) + strlen(ctx->author) + strlen(ctx->copyright) +
+ size = strlen(ctx->title) + strlen(ctx->author) + strlen(ctx->copyright) +
strlen(ctx->comment) + 4 * 2 + 10;
put_be32(s,size);
put_be16(s,0);
put_str(s, ctx->author);
put_str(s, ctx->copyright);
put_str(s, ctx->comment);
-
+
for(i=0;i<ctx->nb_streams;i++) {
int codec_data_size;
stream = &rm->streams[i];
-
+
if (stream->enc->codec_type == CODEC_TYPE_AUDIO) {
desc = "The Audio Stream";
mimetype = "audio/x-pn-realaudio";
put_be32(s, stream->bit_rate); /* avg bit rate */
put_be32(s, stream->packet_max_size); /* max packet size */
if (stream->nb_packets > 0)
- packet_avg_size = stream->packet_total_size /
+ packet_avg_size = stream->packet_total_size /
stream->nb_packets;
else
packet_avg_size = 0;
put_str8(s, desc);
put_str8(s, mimetype);
put_be32(s, codec_data_size);
-
+
if (stream->enc->codec_type == CODEC_TYPE_AUDIO) {
int coded_frame_size, fscode, sample_rate;
sample_rate = stream->enc->sample_rate;
- coded_frame_size = (stream->enc->bit_rate *
+ coded_frame_size = (stream->enc->bit_rate *
stream->enc->frame_size) / (8 * sample_rate);
/* audio codec info */
put_tag(s, ".ra");
put_be32(s, 0x249f0); /* unknown */
put_be16(s, 0x01);
/* frame length : seems to be very important */
- put_be16(s, coded_frame_size);
+ put_be16(s, coded_frame_size);
put_be32(s, 0); /* unknown */
put_be16(s, stream->enc->sample_rate); /* sample rate */
put_be32(s, 0x10); /* unknown */
versions seems to add a diffential DC coding as in
MPEG... nothing new under the sun */
if(stream->enc->codec_id == CODEC_ID_RV10)
- put_be32(s,0x10000000);
+ put_be32(s,0x10000000);
else
- put_be32(s,0x20103001);
- //put_be32(s,0x10003000);
+ put_be32(s,0x20103001);
+ //put_be32(s,0x10003000);
}
}
data_offset_ptr[1] = data_pos >> 16;
data_offset_ptr[2] = data_pos >> 8;
data_offset_ptr[3] = data_pos;
-
+
/* data stream */
put_tag(s,"DATA");
put_be32(s,data_size + 10 + 8);
put_be32(s,0); /* next data header */
}
-static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream,
+static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream,
int length, int key_frame)
{
int timestamp;
/* XXX: suppress this malloc */
buf1= (uint8_t*) av_malloc( size * sizeof(uint8_t) );
-
+
write_packet_header(s, stream, size, !!(flags & PKT_FLAG_KEY));
-
+
/* for AC3, the words seems to be reversed */
for(i=0;i<size;i+=2) {
buf1[i] = buf[i+1];
#if 1
write_packet_header(s, stream, size + 7, key_frame);
/* bit 7: '1' if final packet of a frame converted in several packets */
- put_byte(pb, 0x81);
+ put_byte(pb, 0x81);
/* bit 7: '1' if I frame. bits 6..0 : sequence number in current
frame starting from 1 */
if (key_frame) {
- put_byte(pb, 0x81);
+ put_byte(pb, 0x81);
} else {
- put_byte(pb, 0x01);
+ put_byte(pb, 0x01);
}
put_be16(pb, 0x4000 + (size)); /* total frame size */
put_be16(pb, 0x4000 + (size)); /* offset from the start or the end */
#else
/* full frame */
write_packet_header(s, size + 6);
- put_byte(pb, 0xc0);
+ put_byte(pb, 0xc0);
put_be16(pb, 0x4000 + size); /* total frame size */
put_be16(pb, 0x4000 + packet_number * 126); /* position in stream */
#endif
- put_byte(pb, stream->nb_frames & 0xff);
-
+ put_byte(pb, stream->nb_frames & 0xff);
+
put_buffer(pb, buf, size);
put_flush_packet(pb);
static int rm_write_packet(AVFormatContext *s, AVPacket *pkt)
{
- if (s->streams[pkt->stream_index]->codec->codec_type ==
+ if (s->streams[pkt->stream_index]->codec->codec_type ==
CODEC_TYPE_AUDIO)
return rm_write_audio(s, pkt->data, pkt->size, pkt->flags);
else
return rm_write_video(s, pkt->data, pkt->size, pkt->flags);
}
-
+
static int rm_write_trailer(AVFormatContext *s)
{
RMContext *rm = s->priv_data;
put_tag(pb, "INDX");
put_be32(pb, 10 + 10 * s->nb_streams);
put_be16(pb, 0);
-
+
for(i=0;i<s->nb_streams;i++) {
put_be32(pb, 0); /* zero indices */
put_be16(pb, i); /* stream number */
/* undocumented end header */
put_be32(pb, 0);
put_be32(pb, 0);
-
+
url_fseek(pb, 0, SEEK_SET);
for(i=0;i<s->nb_streams;i++)
rm->streams[i].total_frames = rm->streams[i].nb_frames;
*q = '\0';
}
-static void rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,
+static void rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,
int read_all)
{
RMContext *rm = s->priv_data;
get_be32(pb); /* ??? */
get_be32(pb); /* ??? */
get_be32(pb); /* ??? */
- rm->sub_packet_h = sub_packet_h = get_be16(pb); /* 1 */
+ rm->sub_packet_h = sub_packet_h = get_be16(pb); /* 1 */
st->codec->block_align= get_be16(pb); /* frame size */
rm->sub_packet_size = sub_packet_size = get_be16(pb); /* sub packet size */
get_be16(pb); /* ??? */
get_byte(pb);
get_byte(pb);
get_byte(pb);
-
+
get_str8(pb, s->title, sizeof(s->title));
get_str8(pb, s->author, sizeof(s->author));
get_str8(pb, s->copyright, sizeof(s->copyright));
get_be16(pb);
get_be32(pb);
get_be32(pb); /* number of headers */
-
+
for(;;) {
if (url_feof(pb))
goto fail;
tag_size = get_be32(pb);
get_be16(pb);
#if 0
- printf("tag=%c%c%c%c (%08x) size=%d\n",
+ printf("tag=%c%c%c%c (%08x) size=%d\n",
(tag) & 0xff,
(tag >> 8) & 0xff,
(tag >> 16) & 0xff,
get_be32(pb);
fps2= get_be16(pb);
get_be16(pb);
-
+
st->codec->extradata_size= codec_data_size - (url_ftell(pb) - codec_pos);
st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
-
+
// av_log(NULL, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2);
st->codec->time_base.den = fps * st->codec->time_base.num;
/* modification of h263 codec version (!) */
*flags= 0;
}else{
state= (state<<8) + get_byte(pb);
-
+
if(state == MKBETAG('I', 'N', 'D', 'X')){
len = get_be16(pb) - 6;
if(len<0)
continue;
goto skip;
}
-
+
if(state > (unsigned)0xFFFF || state < 12)
continue;
len=state;
res= get_byte(pb); /* reserved */
*flags = get_byte(pb); /* flags */
-
+
len -= 12;
}
for(i=0;i<s->nb_streams;i++) {
continue;
}
*stream_index= i;
-
+
return len;
}
return -1;
av_free_packet(pkt);
goto resync;
}
-
+
pkt->stream_index = i;
#if 0
return 0;
}
-static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
+static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
int64_t *ppos, int64_t pos_limit)
{
RMContext *rm = s->priv_data;
int stream_index2, flags, len, h;
pos = *ppos;
-
+
if(rm->old_format)
return AV_NOPTS_VALUE;
seq = get_byte(&s->pb); len--;
}
}
-
+
if((flags&2) && (seq&0x7F) == 1){
// av_log(s, AV_LOG_DEBUG, "%d %d-%d %Ld %d\n", flags, stream_index2, stream_index, dts, seq);
av_add_index_entry(st, pos, dts, 0, AVINDEX_KEYFRAME);
buffer to 'rtp_write_packet' contains all the packets for ONE
frame. Each packet should have a four byte header containing
the length in big endian format (same trick as
- 'url_open_dyn_packet_buf')
+ 'url_open_dyn_packet_buf')
*/
/* from http://www.iana.org/assignments/rtp-parameters last updated 05 January 2005 */
MpegTSContext *ts; /* only used for MP2T payloads */
int read_buf_index;
int read_buf_size;
-
+
/* rtcp sender statistics receive */
int64_t last_rtcp_ntp_time;
int64_t first_rtcp_ntp_time;
/**
* open a new RTP parse context for stream 'st'. 'st' can be NULL for
* MPEG2TS streams to indicate that they should be demuxed inside the
- * rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned)
+ * rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned)
*/
RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, int payload_type, rtp_payload_data_t *rtp_payload_data)
{
}
/**
- * Parse an RTP or RTCP packet directly sent as a buffer.
+ * Parse an RTP or RTCP packet directly sent as a buffer.
* @param s RTP parse context.
* @param pkt returned packet
* @param buf input buffer or NULL to read the next packets
* @param len buffer len
- * @return 0 if a packet is returned, 1 if a packet is returned and more can follow
+ * @return 0 if a packet is returned, 1 if a packet is returned and more can follow
* (use buf as NULL to read the next). -1 if no packet (error or no more packet).
*/
-int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
+int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
const uint8_t *buf, int len)
{
unsigned int ssrc, h;
int payload_type, seq, delta_timestamp, ret;
AVStream *st;
uint32_t timestamp;
-
+
if (!buf) {
/* return the next packets, if any */
if (s->read_buf_index >= s->read_buf_size)
return -1;
- ret = mpegts_parse_packet(s->ts, pkt, s->buf + s->read_buf_index,
+ ret = mpegts_parse_packet(s->ts, pkt, s->buf + s->read_buf_index,
s->read_buf_size - s->read_buf_index);
if (ret < 0)
return -1;
seq = (buf[2] << 8) | buf[3];
timestamp = decode_be32(buf + 4);
ssrc = decode_be32(buf + 8);
-
+
/* NOTE: we can handle only one payload type */
if (s->payload_type != payload_type)
return -1;
#if defined(DEBUG) || 1
if (seq != ((s->seq + 1) & 0xffff)) {
- av_log(s->st->codec, AV_LOG_ERROR, "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
+ av_log(s->st->codec, AV_LOG_ERROR, "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
payload_type, seq, ((s->seq + 1) & 0xffff));
}
#endif
memcpy(pkt->data, buf, len);
break;
}
-
+
switch(st->codec->codec_id) {
case CODEC_ID_MP2:
case CODEC_ID_MPEG1VIDEO:
put_be16(&s1->pb, s->seq);
put_be32(&s1->pb, s->timestamp);
put_be32(&s1->pb, s->ssrc);
-
+
put_buffer(&s1->pb, buf1, len);
put_flush_packet(&s1->pb);
-
+
s->seq++;
s->octet_count += len;
s->packet_count++;
s->timestamp += n / sample_size;
}
}
-}
+}
/* NOTE: we suppose that exactly one frame is given as argument here */
/* XXX: test it */
rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0);
s->buf_ptr = s->buf + 4;
/* 90 KHz time stamp */
- s->timestamp = s->base_timestamp +
+ s->timestamp = s->base_timestamp +
(s->cur_timestamp * 90000LL) / st->codec->sample_rate;
}
}
*q++ = h >> 8;
*q++ = h;
}
-
+
len = max_packet_size - (q - s->buf);
if (len > size)
len = size;
q += len;
/* 90 KHz time stamp */
- s->timestamp = s->base_timestamp +
+ s->timestamp = s->base_timestamp +
av_rescale((int64_t)s->cur_timestamp * st->codec->time_base.num, 90000, st->codec->time_base.den); //FIXME pass timestamps
rtp_send_data(s1, s->buf, q - s->buf, (len == size));
len = size;
/* 90 KHz time stamp */
- s->timestamp = s->base_timestamp +
+ s->timestamp = s->base_timestamp +
av_rescale((int64_t)s->cur_timestamp * st->codec->time_base.num, 90000, st->codec->time_base.den); //FIXME pass timestamps
rtp_send_data(s1, buf1, len, (len == size));
buf1 += len;
size -= len;
s->buf_ptr += len;
-
+
out_len = s->buf_ptr - s->buf;
if (out_len >= s->max_payload_size) {
rtp_send_data(s1, s->buf, out_len, 0);
int64_t ntp_time;
int size= pkt->size;
uint8_t *buf1= pkt->data;
-
+
#ifdef DEBUG
printf("%d: write len=%d\n", pkt->stream_index, size);
#endif
/* XXX: mpeg pts hardcoded. RTCP send every 0.5 seconds */
- rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
+ rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
RTCP_TX_RATIO_DEN;
if (s->first_packet || rtcp_bytes >= 28) {
/* compute NTP time */
/* XXX: 90 kHz timestamp hardcoded */
ntp_time = (pkt->pts << 28) / 5625;
- rtcp_send_sr(s1, ntp_time);
+ rtcp_send_sr(s1, ntp_time);
s->last_octet_count = s->octet_count;
s->first_packet = 0;
}
typedef struct RTPDemuxContext RTPDemuxContext;
typedef struct rtp_payload_data_s rtp_payload_data_s;
RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, int payload_type, rtp_payload_data_s *rtp_payload_data);
-int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
+int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
const uint8_t *buf, int len);
void rtp_parse_close(RTPDemuxContext *s);
char buf[1024];
char path[1024];
-
- url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
+
+ url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
path, sizeof(path), uri);
snprintf(buf, sizeof(buf), "udp://%s:%d%s", hostname, port, path);
/*
* url syntax: rtp://host:port[?option=val...]
- * option: 'multicast=1' : enable multicast
+ * option: 'multicast=1' : enable multicast
* 'ttl=n' : set the ttl value (for multicast only)
* 'localport=n' : set the local port to n
*
char buf[1024];
char path[1024];
const char *p;
-
+
is_output = (flags & URL_WRONLY);
s = av_mallocz(sizeof(RTPContext));
if (!s)
return -ENOMEM;
h->priv_data = s;
-
- url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
+
+ url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
path, sizeof(path), uri);
/* extract parameters */
is_multicast = 0;
/* XXX: need to open another connexion if the port is not even */
/* well, should suppress localport in path */
-
+
build_udp_url(buf, sizeof(buf),
hostname, port + 1, local_port + 1, is_multicast, ttl);
if (url_open(&s->rtcp_hd, buf, flags) < 0)
goto fail;
-
+
/* just to ease handle access. XXX: need to suppress direct handle
access */
s->rtp_fd = udp_get_file_handle(s->rtp_hd);
s->rtcp_fd = udp_get_file_handle(s->rtcp_hd);
- h->max_packet_size = url_get_max_packet_size(s->rtp_hd);
+ h->max_packet_size = url_get_max_packet_size(s->rtp_hd);
h->is_streamed = 1;
return 0;
RTPContext *s = h->priv_data;
int ret;
URLContext *hd;
-
+
if (buf[1] >= 200 && buf[1] <= 204) {
/* RTCP payload type */
hd = s->rtcp_hd;
URLContext *rtsp_hd; /* RTSP TCP connexion handle */
int nb_rtsp_streams;
struct RTSPStream **rtsp_streams;
-
+
enum RTSPClientState state;
int64_t seek_timestamp;
-
+
/* XXX: currently we use unbuffered input */
// ByteIOContext rtsp_gb;
int seq; /* RTSP command sequence number */
typedef struct RTSPStream {
URLContext *rtp_handle; /* RTP stream handle */
RTPDemuxContext *rtp_ctx; /* RTP parse context */
-
+
int stream_index; /* corresponding stream index, if any. -1 if none (MPEG2TS case) */
int interleaved_min, interleaved_max; /* interleave ids, if TCP transport */
char control_url[1024]; /* url for this stream (from SDP) */
*pp = p;
}
-static void get_word_sep(char *buf, int buf_size, const char *sep,
+static void get_word_sep(char *buf, int buf_size, const char *sep,
const char **pp)
{
const char *p;
if (*p == '\0')
break;
get_word_sep(attr, sizeof(attr), "=", &p);
- if (*p == '=')
+ if (*p == '=')
p++;
get_word_sep(value, sizeof(value), ";", &p);
if (*p == ';')
rtsp_st->sdp_port = atoi(buf1);
get_word(buf1, sizeof(buf1), &p); /* protocol (ignored) */
-
+
/* XXX: handle list of formats */
get_word(buf1, sizeof(buf1), &p); /* format list */
rtsp_st->sdp_payload_type = atoi(buf1);
/* get the control url */
st = s->streams[s->nb_streams - 1];
rtsp_st = st->priv_data;
-
+
/* XXX: may need to add full url resolution */
url_split(proto, sizeof(proto), NULL, 0, NULL, 0, NULL, NULL, 0, p);
if (proto[0] == '\0') {
}
} else if (strstart(p, "rtpmap:", &p)) {
/* NOTE: rtpmap is only supported AFTER the 'm=' tag */
- get_word(buf1, sizeof(buf1), &p);
+ get_word(buf1, sizeof(buf1), &p);
payload_type = atoi(buf1);
for(i = 0; i < s->nb_streams;i++) {
st = s->streams[i];
}
} else if (strstart(p, "fmtp:", &p)) {
/* NOTE: fmtp is only supported AFTER the 'a=rtpmap:xxx' tag */
- get_word(buf1, sizeof(buf1), &p);
+ get_word(buf1, sizeof(buf1), &p);
payload_type = atoi(buf1);
for(i = 0; i < s->nb_streams;i++) {
st = s->streams[i];
int letter;
char buf[1024], *q;
SDPParseState sdp_parse_state, *s1 = &sdp_parse_state;
-
+
memset(s1, 0, sizeof(SDPParseState));
p = content;
for(;;) {
char parameter[16];
RTSPTransportField *th;
char buf[256];
-
+
reply->nb_transports = 0;
-
+
for(;;) {
skip_spaces(&p);
if (*p == '\0')
th = &reply->transports[reply->nb_transports];
- get_word_sep(transport_protocol, sizeof(transport_protocol),
+ get_word_sep(transport_protocol, sizeof(transport_protocol),
"/", &p);
if (*p == '/')
p++;
lower_transport[0] = '\0';
if (*p == '/') {
p++;
- get_word_sep(lower_transport, sizeof(lower_transport),
+ get_word_sep(lower_transport, sizeof(lower_transport),
";,", &p);
}
if (!strcasecmp(lower_transport, "TCP"))
th->protocol = RTSP_PROTOCOL_RTP_TCP;
else
th->protocol = RTSP_PROTOCOL_RTP_UDP;
-
+
if (*p == ';')
p++;
/* get each parameter */
} else if (!strcmp(parameter, "client_port")) {
if (*p == '=') {
p++;
- rtsp_parse_range(&th->client_port_min,
+ rtsp_parse_range(&th->client_port_min,
&th->client_port_max, &p);
}
} else if (!strcmp(parameter, "server_port")) {
if (*p == '=') {
p++;
- rtsp_parse_range(&th->server_port_min,
+ rtsp_parse_range(&th->server_port_min,
&th->server_port_max, &p);
}
} else if (!strcmp(parameter, "interleaved")) {
if (*p == '=') {
p++;
- rtsp_parse_range(&th->interleaved_min,
+ rtsp_parse_range(&th->interleaved_min,
&th->interleaved_max, &p);
}
} else if (!strcmp(parameter, "multicast")) {
if (*p == '=') {
p++;
get_word_sep(buf, sizeof(buf), ";,", &p);
- if (inet_aton(buf, &ipaddr))
+ if (inet_aton(buf, &ipaddr))
th->destination = ntohl(ipaddr.s_addr);
}
}
reply->range_start = AV_NOPTS_VALUE;
reply->range_end = AV_NOPTS_VALUE;
-
+
get_word_sep(buf, sizeof(buf), "-", &p);
reply->range_start = parse_date(buf, 1);
if (*p == '-') {
}
}
-static void rtsp_send_cmd(AVFormatContext *s,
- const char *cmd, RTSPHeader *reply,
+static void rtsp_send_cmd(AVFormatContext *s,
+ const char *cmd, RTSPHeader *reply,
unsigned char **content_ptr)
{
RTSPState *rt = s->priv_data;
}
line_count++;
}
-
+
if (rt->session_id[0] == '\0' && reply->session_id[0] != '\0')
pstrcpy(rt->session_id, sizeof(rt->session_id), reply->session_id);
-
+
content_length = reply->content_length;
if (content_length > 0) {
/* leave some room for a trailing '\0' (useful for simple parsing) */
return AVERROR_IO;
rt->rtsp_hd = rtsp_hd;
rt->seq = 0;
-
+
/* describe the stream */
- snprintf(cmd, sizeof(cmd),
+ snprintf(cmd, sizeof(cmd),
"DESCRIBE %s RTSP/1.0\r\n"
"Accept: application/sdp\r\n",
s->filename);
err = AVERROR_INVALIDDATA;
goto fail;
}
-
+
/* now we got the SDP description, we parse it */
ret = sdp_parse(s, (const char *)content);
av_freep(&content);
err = AVERROR_INVALIDDATA;
goto fail;
}
-
+
protocol_mask = rtsp_default_protocols;
/* for each stream, make the setup request */
else if (protocol_mask & (1 << RTSP_PROTOCOL_RTP_UDP_MULTICAST)) {
if (transport[0] != '\0')
pstrcat(transport, sizeof(transport), ",");
- snprintf(transport + strlen(transport),
+ snprintf(transport + strlen(transport),
sizeof(transport) - strlen(transport) - 1,
"RTP/AVP/UDP;multicast");
}
- snprintf(cmd, sizeof(cmd),
+ snprintf(cmd, sizeof(cmd),
"SETUP %s RTSP/1.0\r\n"
"Transport: %s\r\n",
rtsp_st->control_url, transport);
rtsp_st->interleaved_min = reply->transports[0].interleaved_min;
rtsp_st->interleaved_max = reply->transports[0].interleaved_max;
break;
-
+
case RTSP_PROTOCOL_RTP_UDP:
{
char url[1024];
-
+
/* XXX: also use address if specified */
- snprintf(url, sizeof(url), "rtp://%s:%d",
+ snprintf(url, sizeof(url), "rtp://%s:%d",
host, reply->transports[0].server_port_min);
if (rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) {
err = AVERROR_INVALIDDATA;
ttl = reply->transports[0].ttl;
if (!ttl)
ttl = 16;
- snprintf(url, sizeof(url), "rtp://%s:%d?multicast=1&ttl=%d",
- host,
+ snprintf(url, sizeof(url), "rtp://%s:%d?multicast=1&ttl=%d",
+ host,
reply->transports[0].server_port_min,
ttl);
if (url_open(&rtsp_st->rtp_handle, url, URL_RDONLY) < 0) {
/* use callback if available to extend setup */
if (ff_rtsp_callback) {
- if (ff_rtsp_callback(RTSP_ACTION_CLIENT_SETUP, rt->session_id,
+ if (ff_rtsp_callback(RTSP_ACTION_CLIENT_SETUP, rt->session_id,
NULL, 0, rt->last_reply) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
}
}
-
+
rt->state = RTSP_STATE_IDLE;
rt->seek_timestamp = 0; /* default is to start stream at position
ret = url_readbuf(rt->rtsp_hd, buf, len);
if (ret != len)
return -1;
-
+
/* find the matching stream */
for(i = 0; i < rt->nb_rtsp_streams; i++) {
rtsp_st = rt->rtsp_streams[i];
- if (id >= rtsp_st->interleaved_min &&
- id <= rtsp_st->interleaved_max)
+ if (id >= rtsp_st->interleaved_min &&
+ id <= rtsp_st->interleaved_max)
goto found;
}
goto redo;
return len;
}
-static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
+static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
uint8_t *buf, int buf_size)
{
RTSPState *rt = s->priv_data;
av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state);
if (rt->state == RTSP_STATE_PAUSED) {
- snprintf(cmd, sizeof(cmd),
+ snprintf(cmd, sizeof(cmd),
"PLAY %s RTSP/1.0\r\n",
s->filename);
} else {
- snprintf(cmd, sizeof(cmd),
+ snprintf(cmd, sizeof(cmd),
"PLAY %s RTSP/1.0\r\n"
"Range: npt=%0.3f-\r\n",
s->filename,
char cmd[1024];
rt = s->priv_data;
-
+
if (rt->state != RTSP_STATE_PLAYING)
return 0;
- snprintf(cmd, sizeof(cmd),
+ snprintf(cmd, sizeof(cmd),
"PAUSE %s RTSP/1.0\r\n",
s->filename);
rtsp_send_cmd(s, cmd, reply, NULL);
}
}
-static int rtsp_read_seek(AVFormatContext *s, int stream_index,
+static int rtsp_read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
RTSPState *rt = s->priv_data;
-
+
rt->seek_timestamp = timestamp;
switch(rt->state) {
default:
url_fclose(&rt->rtsp_gb);
}
#endif
- snprintf(cmd, sizeof(cmd),
+ snprintf(cmd, sizeof(cmd),
"TEARDOWN %s RTSP/1.0\r\n",
s->filename);
rtsp_send_cmd(s, cmd, reply, NULL);
if (ff_rtsp_callback) {
- ff_rtsp_callback(RTSP_ACTION_CLIENT_TEARDOWN, rt->session_id,
+ ff_rtsp_callback(RTSP_ACTION_CLIENT_TEARDOWN, rt->session_id,
NULL, 0, NULL);
}
/* open each RTP stream */
for(i=0;i<rt->nb_rtsp_streams;i++) {
rtsp_st = rt->rtsp_streams[i];
-
- snprintf(url, sizeof(url), "rtp://%s:%d?multicast=1&ttl=%d",
- inet_ntoa(rtsp_st->sdp_ip),
+
+ snprintf(url, sizeof(url), "rtp://%s:%d?multicast=1&ttl=%d",
+ inet_ntoa(rtsp_st->sdp_ip),
rtsp_st->sdp_port,
rtsp_st->sdp_ttl);
if (url_open(&rtsp_st->rtp_handle, url, URL_RDONLY) < 0) {
enum RTSPStatusCode status_code; /* response code from server */
int nb_transports;
/* in AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
- int64_t range_start, range_end;
+ int64_t range_start, range_end;
RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
int seq; /* sequence number */
char session_id[512];
char transport_option[512];
} RTSPActionServerSetup;
-typedef int FFRTSPCallback(enum RTSPCallbackAction action,
+typedef int FFRTSPCallback(enum RTSPCallbackAction action,
const char *session_id,
char *buf, int buf_size,
void *arg);
st->codec->sample_rate = film->audio_samplerate;
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
st->codec->bits_per_sample;
- st->codec->block_align = st->codec->channels *
+ st->codec->block_align = st->codec->channels *
st->codec->bits_per_sample / 8;
}
if(film->sample_count >= UINT_MAX / sizeof(film_sample_t))
return -1;
film->sample_table = av_malloc(film->sample_count * sizeof(film_sample_t));
-
+
for(i=0; i<s->nb_streams; i++)
av_set_pts_info(s->streams[i], 33, 1, film->base_clock);
-
+
audio_frame_counter = 0;
for (i = 0; i < film->sample_count; i++) {
/* load the next sample record and transfer it to an internal struct */
av_free(film->sample_table);
return AVERROR_IO;
}
- film->sample_table[i].sample_offset =
+ film->sample_table[i].sample_offset =
data_offset + BE_32(&scratch[0]);
film->sample_table[i].sample_size = BE_32(&scratch[4]);
if (BE_32(&scratch[8]) == 0xFFFFFFFF) {
url_fseek(pb, sample->sample_offset, SEEK_SET);
/* do a special song and dance when loading FILM Cinepak chunks */
- if ((sample->stream == film->video_stream_index) &&
+ if ((sample->stream == film->video_stream_index) &&
(film->video_type == CODEC_ID_CINEPAK)) {
if (av_new_packet(pkt, sample->sample_size - film->cvid_extra_bytes))
return AVERROR_NOMEM;
ret = get_buffer(pb, pkt->data, 10);
/* skip the non-spec CVID bytes */
url_fseek(pb, film->cvid_extra_bytes, SEEK_CUR);
- ret += get_buffer(pb, pkt->data + 10,
+ ret += get_buffer(pb, pkt->data + 10,
sample->sample_size - 10 - film->cvid_extra_bytes);
if (ret != sample->sample_size - film->cvid_extra_bytes)
ret = AVERROR_IO;
info->xsize = (unsigned short) get_be16(f);
info->ysize = (unsigned short) get_be16(f);
info->zsize = (unsigned short) get_be16(f);
-
- if(info->zsize > 4096)
+
+ if(info->zsize > 4096)
info->zsize= 0;
#ifdef DEBUG
/* read an uncompressed sgi image */
-static int read_uncompressed_sgi(const SGIInfo *si,
+static int read_uncompressed_sgi(const SGIInfo *si,
AVPicture *pict, ByteIOContext *f)
{
int x, y, z, chan_offset, ret = 0;
uint8_t *dest_row;
- /* skip header */
+ /* skip header */
url_fseek(f, SGI_HEADER_SIZE, SEEK_SET);
pict->linesize[0] = si->xsize;
#ifndef WORDS_BIGENDIAN
/* rgba -> bgra for rgba32 on little endian cpus */
- if (si->zsize == 4 && z != 3)
+ if (si->zsize == 4 && z != 3)
chan_offset = 2 - z;
else
#endif
chan_offset = z;
-
+
for (y = si->ysize - 1; y >= 0; y--) {
dest_row = pict->data[0] + (y * si->xsize * si->zsize);
for (x = 0; x < si->xsize; x++) {
- dest_row[chan_offset] = get_byte(f);
+ dest_row[chan_offset] = get_byte(f);
dest_row += si->zsize;
}
}
{
unsigned char pixel, count;
int length = 0;
-
+
#ifndef WORDS_BIGENDIAN
/* rgba -> bgra for rgba32 on little endian cpus */
if (pixelstride == 4 && chan_offset != 3) {
chan_offset = 2 - chan_offset;
}
#endif
-
+
optr += chan_offset;
while (1) {
/* read a run length encoded sgi image */
-static int read_rle_sgi(const SGIInfo *sgi_info,
+static int read_rle_sgi(const SGIInfo *sgi_info,
AVPicture *pict, ByteIOContext *f)
{
uint8_t *dest_row;
unsigned long *start_table;
- int y, z, xsize, ysize, zsize, tablen;
+ int y, z, xsize, ysize, zsize, tablen;
long start_offset;
int ret = 0;
ysize = sgi_info->ysize;
zsize = sgi_info->zsize;
- /* skip header */
+ /* skip header */
url_fseek(f, SGI_HEADER_SIZE, SEEK_SET);
/* size of rle offset and length tables */
goto fail;
}
- /* skip run length table */
+ /* skip run length table */
url_fseek(f, tablen, SEEK_CUR);
for (z = 0; z < zsize; z++) {
}
-static int sgi_read(ByteIOContext *f,
+static int sgi_read(ByteIOContext *f,
int (*alloc_cb)(void *opaque, AVImageInfo *info), void *opaque)
{
SGIInfo sgi_info, *s = &sgi_info;
put_be16(f, SGI_MAGIC);
put_byte(f, info->rle);
- put_byte(f, info->bytes_per_channel);
+ put_byte(f, info->bytes_per_channel);
put_be16(f, info->dimension);
put_be16(f, info->xsize);
put_be16(f, info->ysize);
put_be16(f, info->zsize);
/* The rest are constant in this implementation */
- put_be32(f, 0L); /* pixmin */
- put_be32(f, 255L); /* pixmax */
- put_be32(f, 0L); /* dummy */
+ put_be32(f, 0L); /* pixmin */
+ put_be32(f, 255L); /* pixmax */
+ put_be32(f, 0L); /* dummy */
/* name */
for (i = 0; i < 80; i++) {
put_byte(f, 0);
}
- put_be32(f, 0L); /* colormap */
+ put_be32(f, 0L); /* colormap */
/* The rest of the 512 byte header is unused. */
for (i = 0; i < 404; i++) {
row += (2 * stride);
x -= 2;
- while (x > 0 && (row[-2 * stride] != row[-1 * stride] ||
+ while (x > 0 && (row[-2 * stride] != row[-1 * stride] ||
row[-1 * stride] != row[0])) {
row += stride;
x--;
i = count > 126 ? 126 : count;
count -= i;
- put_byte(f, 0x80 | i);
+ put_byte(f, 0x80 | i);
length++;
while (i > 0) {
put_byte(f, i);
length++;
- put_byte(f, repeat);
+ put_byte(f, repeat);
length++;
};
};
length++;
- put_byte(f, 0);
+ put_byte(f, 0);
return (length);
}
si->ysize = info->height;
si->rle = 1;
si->bytes_per_channel = 1;
-
+
switch(info->pix_fmt) {
case PIX_FMT_GRAY8:
si->dimension = SGI_SINGLE_CHAN;
return AVERROR_INVALIDDATA;
}
- write_sgi_header(pb, si);
+ write_sgi_header(pb, si);
tablesize = si->zsize * si->ysize * sizeof(long);
-
+
/* skip rle offset and length tables, write them at the end. */
url_fseek(pb, tablesize * 2, SEEK_CUR);
put_flush_packet(pb);
-
+
lengthtab = av_malloc(tablesize);
offsettab = av_malloc(tablesize);
#ifndef WORDS_BIGENDIAN
/* rgba -> bgra for rgba32 on little endian cpus */
- if (si->zsize == 4 && z != 3)
+ if (si->zsize == 4 && z != 3)
chan_offset = 2 - z;
else
#endif
chan_offset = z;
-
+
srcrow = info->pict.data[0] + chan_offset;
-
+
for (y = si->ysize -1; y >= 0; y--) {
offsettab[(z * si->ysize) + y] = url_ftell(pb);
lengthtab[(z * si->ysize) + y] = rle_row(pb, srcrow,
si->zsize, si->xsize);
- srcrow += info->pict.linesize[0];
+ srcrow += info->pict.linesize[0];
}
}
url_fseek(pb, 512, SEEK_SET);
-
+
/* write offset table */
for (i = 0; i < (si->ysize * si->zsize); i++) {
put_be32(pb, offsettab[i]);
}
-
+
/* write length table */
for (i = 0; i < (si->ysize * si->zsize); i++) {
put_be32(pb, lengthtab[i]);
}
put_flush_packet(pb);
-
+
av_free(lengthtab);
av_free(offsettab);
"sgi,rgb,rgba,bw",
sgi_probe,
sgi_read,
- (1 << PIX_FMT_GRAY8) | (1 << PIX_FMT_RGB24) | (1 << PIX_FMT_RGBA32),
+ (1 << PIX_FMT_GRAY8) | (1 << PIX_FMT_RGB24) | (1 << PIX_FMT_RGBA32),
#ifdef CONFIG_MUXERS
sgi_write,
#else
st->codec->codec_tag = 0; /* no codec tag */
st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1;
st->codec->sample_rate = vmd->sample_rate;
- st->codec->block_align = vmd->audio_block_align =
+ st->codec->block_align = vmd->audio_block_align =
LE_16(&vmd->vmd_header[806]);
if (st->codec->block_align & 0x8000) {
st->codec->bits_per_sample = 16;
} else
st->codec->bits_per_sample = 16;
// st->codec->bits_per_sample = 8;
- st->codec->bit_rate = st->codec->sample_rate *
+ st->codec->bit_rate = st->codec->sample_rate *
st->codec->bits_per_sample * st->codec->channels;
/* for calculating pts */
- vmd->audio_frame_divisor = st->codec->bits_per_sample / 8 /
+ vmd->audio_frame_divisor = st->codec->bits_per_sample / 8 /
st->codec->channels;
video_pts_inc = 90000;
video_pts_inc = 90000 / 10;
}
- /* skip over the offset table and load the table of contents; don't
- * care about the offset table since demuxer will calculate those
+ /* skip over the offset table and load the table of contents; don't
+ * care about the offset table since demuxer will calculate those
* independently */
toc_offset = LE_32(&vmd->vmd_header[812]);
vmd->frame_count = LE_16(&vmd->vmd_header[6]);
av_free(vmd->frame_table);
return AVERROR_NOMEM;
}
- if (get_buffer(pb, raw_frame_table, raw_frame_table_size) !=
+ if (get_buffer(pb, raw_frame_table, raw_frame_table_size) !=
raw_frame_table_size) {
av_free(raw_frame_table);
av_free(vmd->frame_table);
/* if the frame size is 0, do not count the frame and bring the
* total frame count down */
// note, we limit the size to 1Gb to ensure that we dont end up overflowing the size integer used to allocate the memory
- vmd->frame_table[i].frame_size = LE_32(¤t_frame_record[2]) & 0x3FFFFFFF;
+ vmd->frame_table[i].frame_size = LE_32(¤t_frame_record[2]) & 0x3FFFFFFF;
/* this logic is present so that 0-length audio chunks are not
* accounted */
return AVERROR_NOMEM;
pkt->pos= url_ftell(pb);
memcpy(pkt->data, frame->frame_record, BYTES_PER_FRAME_RECORD);
- ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD,
+ ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD,
frame->frame_size);
if (ret != frame->frame_size) {
-/*
+/*
* Sierra SOL decoder
* Copyright Konstantin Shishkov.
*
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*
+/*
* Based on documents from Game Audio Player and own research
*/
if (magic == 0x0B8D || !(type & SOL_STEREO)) return 1;
return 2;
}
-
+
static int sol_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
size = get_le32(pb);
if (magic != 0x0B8D)
get_byte(pb); /* newer SOLs contain padding byte */
-
+
codec = sol_codec_id(magic, type);
channels = sol_channels(magic, type);
-
+
if (codec == CODEC_ID_SOL_DPCM)
id = sol_codec_type(magic, type);
else id = 0;
-
+
/* now we are ready: build format streams */
st = av_new_stream(s, 0);
if (!st)
st->codec->codec_tag = id;
st->codec->codec_id = codec;
st->codec->channels = channels;
- st->codec->sample_rate = rate;
+ st->codec->sample_rate = rate;
av_set_pts_info(st, 64, 1, rate);
return 0;
}
offset_t duration_pos;
offset_t tag_pos;
-
+
int samples_per_frame;
int sound_samples;
int video_samples;
int bitRate = 0;
int bitsPerSlot = sBitsPerSlot[layerID];
int isPadded = ((header >> 9) & 0x01);
-
+
if ( (( header >> 21 ) & 0x7ff) != 0x7ff ) {
return 0;
}
*nbits_ptr = n;
}
-static void put_swf_rect(ByteIOContext *pb,
+static void put_swf_rect(ByteIOContext *pb,
int xmin, int xmax, int ymin, int ymax)
{
PutBitContext p;
int nbits, mask;
init_put_bits(&p, buf, sizeof(buf));
-
+
nbits = 0;
max_nbits(&nbits, xmin);
max_nbits(&nbits, xmax);
put_bits(&p, nbits, xmax & mask);
put_bits(&p, nbits, ymin & mask);
put_bits(&p, nbits, ymax & mask);
-
+
flush_put_bits(&p);
put_buffer(pb, buf, pbBufPtr(&p) - p.buf);
}
mask = (1 << nbits) - 1;
put_bits(pb, 4, nbits - 2); /* 16 bits precision */
if (dx == 0) {
- put_bits(pb, 1, 0);
- put_bits(pb, 1, 1);
+ put_bits(pb, 1, 0);
+ put_bits(pb, 1, 1);
put_bits(pb, nbits, dy & mask);
} else if (dy == 0) {
- put_bits(pb, 1, 0);
- put_bits(pb, 1, 0);
+ put_bits(pb, 1, 0);
+ put_bits(pb, 1, 0);
put_bits(pb, nbits, dx & mask);
} else {
- put_bits(pb, 1, 1);
+ put_bits(pb, 1, 1);
put_bits(pb, nbits, dx & mask);
put_bits(pb, nbits, dy & mask);
}
int nbits;
init_put_bits(&p, buf, sizeof(buf));
-
+
put_bits(&p, 1, 1); /* a, d present */
nbits = 1;
max_nbits(&nbits, a);
put_bits(&p, 5, nbits); /* nb bits */
put_bits(&p, nbits, a);
put_bits(&p, nbits, d);
-
+
put_bits(&p, 1, 1); /* b, c present */
nbits = 1;
max_nbits(&nbits, c);
} else {
put_byte(pb, 4); /* version (should use 4 for mpeg audio support) */
}
- put_le32(pb, DUMMY_FILE_SIZE); /* dummy size
- (will be patched if not streamed) */
+ put_le32(pb, DUMMY_FILE_SIZE); /* dummy size
+ (will be patched if not streamed) */
put_swf_rect(pb, 0, width * 20, 0, height * 20);
put_le16(pb, (rate * 256) / rate_base); /* frame rate */
swf->duration_pos = url_ftell(pb);
put_le16(pb, (uint16_t)(DUMMY_DURATION * (int64_t)rate / rate_base)); /* frame count */
-
+
/* define a shape with the jpeg inside */
if ( video_enc && video_enc->codec_id == CODEC_ID_FLV1 ) {
} else if ( video_enc && video_enc->codec_id == CODEC_ID_MJPEG ) {
put_byte(pb, 0x41); /* clipped bitmap fill */
put_le16(pb, BITMAP_ID); /* bitmap ID */
/* position of the bitmap */
- put_swf_matrix(pb, (int)(1.0 * (1 << FRAC_BITS)), 0,
+ put_swf_matrix(pb, (int)(1.0 * (1 << FRAC_BITS)), 0,
0, (int)(1.0 * (1 << FRAC_BITS)), 0, 0);
put_byte(pb, 0); /* no line style */
-
+
/* shape drawing */
init_put_bits(&p, buf1, sizeof(buf1));
put_bits(&p, 4, 1); /* one fill bit */
put_bits(&p, 4, 0); /* zero line bit */
-
+
put_bits(&p, 1, 0); /* not an edge */
put_bits(&p, 5, FLAG_MOVETO | FLAG_SETFILL0);
put_bits(&p, 5, 1); /* nbits */
put_bits(&p, 1, 0); /* X */
put_bits(&p, 1, 0); /* Y */
put_bits(&p, 1, 1); /* set fill style 1 */
-
+
/* draw the rectangle ! */
put_swf_line_edge(&p, width, 0);
put_swf_line_edge(&p, 0, height);
put_swf_line_edge(&p, -width, 0);
put_swf_line_edge(&p, 0, -height);
-
+
/* end of shape */
put_bits(&p, 1, 0); /* not an edge */
put_bits(&p, 5, 0);
put_swf_end_tag(s);
}
-
+
if (audio_enc && audio_enc->codec_id == CODEC_ID_MP3 ) {
int v;
put_byte(&s->pb, v);
put_le16(&s->pb, swf->samples_per_frame); /* avg samples per frame */
put_le16(&s->pb, 0);
-
+
put_swf_end_tag(s);
}
return 0;
}
-static int swf_write_video(AVFormatContext *s,
+static int swf_write_video(AVFormatContext *s,
AVCodecContext *enc, const uint8_t *buf, int size)
{
SWFContext *swf = s->priv_data;
int c = 0;
int outSize = 0;
int outSamples = 0;
-
+
/* Flash Player limit */
if ( swf->swf_frame_number == 16000 ) {
av_log(enc, AV_LOG_INFO, "warning: Flash Player limit of 16000 frames reached\n");
int mp3SampleRate = 0;
int mp3IsMono = 0;
int mp3SamplesPerFrame = 0;
-
+
/* copy out mp3 header from ring buffer */
uint8_t header[4];
for (c=0; c<4; c++) {
header[c] = swf->audio_fifo[(swf->audio_in_pos+outSize+c) % AUDIO_FIFO_SIZE];
}
-
+
if ( swf_mp3_info(header,&mp3FrameSize,&mp3SamplesPerFrame,&mp3SampleRate,&mp3IsMono) ) {
if ( ( swf->audio_size-outSize ) >= mp3FrameSize ) {
outSize += mp3FrameSize;
}
} else {
/* invalid mp3 data, skip forward
- we need to do this since the Flash Player
+ we need to do this since the Flash Player
does not like custom headers */
swf->audio_in_pos ++;
swf->audio_size --;
goto retry_swf_audio_packet;
}
}
-
+
/* audio stream is behind video stream, bail */
if ( ( swf->sound_samples + outSamples + swf->samples_per_frame ) < swf->video_samples ) {
return 0;
put_byte(pb, 0);
put_byte(pb, SWF_VIDEO_CODEC_FLV1);
put_swf_end_tag(s);
-
+
/* place the video object for the first time */
put_swf_tag(s, TAG_PLACEOBJECT2);
put_byte(pb, 0x36);
put_le16(pb, swf->video_frame_number );
put_swf_end_tag(s);
}
-
+
/* set video frame data */
put_swf_tag(s, TAG_VIDEOFRAME | TAG_LONG);
- put_le16(pb, VIDEO_ID);
+ put_le16(pb, VIDEO_ID);
put_le16(pb, swf->video_frame_number++ );
put_buffer(pb, buf, size);
put_swf_end_tag(s);
put_le16(pb, SHAPE_ID); /* shape ID */
put_le16(pb, 1); /* depth */
put_swf_end_tag(s);
-
+
/* free the bitmap */
put_swf_tag(s, TAG_FREECHARACTER);
put_le16(pb, BITMAP_ID);
put_swf_end_tag(s);
}
-
+
put_swf_tag(s, TAG_JPEG2 | TAG_LONG);
-
+
put_le16(pb, BITMAP_ID); /* ID of the image */
-
+
/* a dummy jpeg header seems to be required */
- put_byte(pb, 0xff);
+ put_byte(pb, 0xff);
put_byte(pb, 0xd8);
put_byte(pb, 0xff);
put_byte(pb, 0xd9);
/* write the jpeg image */
put_buffer(pb, buf, size);
-
+
put_swf_end_tag(s);
-
+
/* draw the shape */
-
+
put_swf_tag(s, TAG_PLACEOBJECT);
put_le16(pb, SHAPE_ID); /* shape ID */
put_le16(pb, 1); /* depth */
} else {
/* invalid codec */
}
-
+
swf->swf_frame_number ++;
swf->video_samples += swf->samples_per_frame;
put_byte(pb,swf->audio_fifo[(swf->audio_in_pos+c) % AUDIO_FIFO_SIZE]);
}
put_swf_end_tag(s);
-
+
/* update FIFO */
swf->sound_samples += outSamples;
swf->audio_in_pos += outSize;
/* output the frame */
put_swf_tag(s, TAG_SHOWFRAME);
put_swf_end_tag(s);
-
+
put_flush_packet(&s->pb);
-
+
return 0;
}
-static int swf_write_audio(AVFormatContext *s,
+static int swf_write_audio(AVFormatContext *s,
AVCodecContext *enc, const uint8_t *buf, int size)
{
SWFContext *swf = s->priv_data;
put_swf_tag(s, TAG_END);
put_swf_end_tag(s);
-
+
put_flush_packet(&s->pb);
/* patch file size and number of frames if not streamed */
url_fseek(pb, swf->duration_pos, SEEK_SET);
put_le16(pb, video_enc->frame_number);
}
-
+
av_free(swf->audio_fifo);
return 0;
/* Extract FLV encoded frame and MP3 from swf
Note that the detection of the real frame
is inaccurate at this point as it can be
- quite tricky to determine, you almost certainly
+ quite tricky to determine, you almost certainly
will get a bad audio/video sync */
static int get_swf_tag(ByteIOContext *pb, int *len_ptr)
{
int tag, len;
-
+
if (url_feof(pb))
return -1;
url_fskip(pb, len);
frame_rate = get_le16(pb);
get_le16(pb); /* frame count */
-
- /* The Flash Player converts 8.8 frame rates
- to milliseconds internally. Do the same to get
+
+ /* The Flash Player converts 8.8 frame rates
+ to milliseconds internally. Do the same to get
a correct framerate */
swf->ms_per_frame = ( 1000 * 256 ) / frame_rate;
swf->samples_per_frame = 0;
if ( get_byte(pb) == SWF_VIDEO_CODEC_FLV1 ) {
vst = av_new_stream(s, 0);
av_set_pts_info(vst, 24, 1, 1000); /* 24 bit pts in ms */
-
+
vst->codec->codec_type = CODEC_TYPE_VIDEO;
vst->codec->codec_id = CODEC_ID_FLV1;
if ( swf->samples_per_frame ) {
}
}
url_fseek(pb, firstTagOff, SEEK_SET);
-
+
return 0;
}
ByteIOContext *pb = &s->pb;
AVStream *st = 0;
int tag, len, i, frame;
-
+
for(;;) {
tag = get_swf_tag(pb, &len);
- if (tag < 0)
+ if (tag < 0)
return AVERROR_IO;
if (tag == TAG_VIDEOFRAME) {
for( i=0; i<s->nb_streams; i++ ) {
continue;
}
}
- }
+ }
url_fskip(pb, len);
} else if (tag == TAG_STREAMBLOCK) {
for( i=0; i<s->nb_streams; i++ ) {
&port, path, sizeof(path), uri); // PETR: use url_split
if (strcmp(proto,"tcp")) goto fail; // PETR: check protocol
if ((q = strchr(hostname,'@'))) { strcpy(tmp,q+1); strcpy(hostname,tmp); } // PETR: take only the part after '@' for tcp protocol
-
+
s = av_malloc(sizeof(TCPContext));
if (!s)
return -ENOMEM;
h->priv_data = s;
-
+
if (port <= 0 || port >= 65536)
goto fail;
-
+
dest_addr.sin_family = AF_INET;
dest_addr.sin_port = htons(port);
if (resolve_host(&dest_addr.sin_addr, hostname) < 0)
if (fd < 0)
goto fail;
fcntl(fd, F_SETFL, O_NONBLOCK);
-
+
redo:
- ret = connect(fd, (struct sockaddr *)&dest_addr,
+ ret = connect(fd, (struct sockaddr *)&dest_addr,
sizeof(dest_addr));
if (ret < 0) {
if (errno == EINTR)
if (ret > 0 && FD_ISSET(fd, &wfds))
break;
}
-
+
/* test error */
optlen = sizeof(ret);
getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
int udp_ipv6_is_multicast_address(const struct sockaddr *addr) {
if (addr->sa_family == AF_INET)
- return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
+ return IN_MULTICAST(ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr));
if (addr->sa_family == AF_INET6)
- return IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *)addr)->sin6_addr);
+ return IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6 *)addr)->sin6_addr);
return -1;
}
int udp_ipv6_join_multicast_group(int sockfd, struct sockaddr *addr) {
struct ip_mreq mreq;
- struct ipv6_mreq mreq6;
+ struct ipv6_mreq mreq6;
if (addr->sa_family == AF_INET) {
mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
mreq.imr_interface.s_addr= INADDR_ANY;
int udp_ipv6_leave_multicast_group(int sockfd, struct sockaddr *addr) {
struct ip_mreq mreq;
- struct ipv6_mreq mreq6;
+ struct ipv6_mreq mreq6;
if (addr->sa_family == AF_INET) {
mreq.imr_multiaddr.s_addr = ((struct sockaddr_in *)addr)->sin_addr.s_addr;
mreq.imr_interface.s_addr= INADDR_ANY;
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = type;
hints.ai_family = family;
- hints.ai_flags = flags;
+ hints.ai_flags = flags;
if ((error = getaddrinfo(node, service, &hints, &res))) {
av_log(NULL, AV_LOG_ERROR, "udp_ipv6_resolve_host: %s\n", gai_strerror(error));
}
char sbuf[NI_MAXSERV];
char hbuf[NI_MAXHOST];
struct addrinfo *res0 = NULL, *res = NULL;
-
- if (s->local_port != 0) {
+
+ if (s->local_port != 0) {
res0 = udp_ipv6_resolve_host(0, s->local_port, SOCK_DGRAM, AF_UNSPEC, AI_PASSIVE);
if (res0 == 0)
goto fail;
- for (res = res0; res; res=res->ai_next) {
+ for (res = res0; res; res=res->ai_next) {
udp_fd = socket(res->ai_family, SOCK_DGRAM, 0);
if (udp_fd > 0) break;
perror("socket");
}
} else {
udp_fd = socket(s->dest_addr.ss_family, SOCK_DGRAM, 0);
- if (udp_fd < 0)
+ if (udp_fd < 0)
perror("socket");
}
if (udp_fd < 0)
goto fail;
-
+
if (s->local_port != 0) {
if (bind(udp_fd, res0->ai_addr, res0->ai_addrlen) < 0) {
perror("bind");
}
freeaddrinfo(res0);
res0 = NULL;
- }
+ }
addrlen = sizeof(clientaddr);
if (getsockname(udp_fd, (struct sockaddr *)&clientaddr, &addrlen) < 0) {
}
s->local_port = strtol(sbuf, NULL, 10);
-
+
return udp_fd;
-
+
fail:
if (udp_fd >= 0)
#ifdef CONFIG_BEOS_NETSERVER
* the remote server address.
*
* url syntax: udp://host:port[?option=val...]
- * option: 'multicast=1' : enable multicast
+ * option: 'multicast=1' : enable multicast
* 'ttl=n' : set the ttl value (for multicast only)
* 'localport=n' : set the local port
* 'pkt_size=n' : set max packet size
UDPContext *s = h->priv_data;
char hostname[256];
int port;
-
+
url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port, NULL, 0, uri);
/* set the destination address */
h->max_packet_size = 1472;
is_output = (flags & URL_WRONLY);
-
+
s = av_malloc(sizeof(UDPContext));
if (!s)
return -ENOMEM;
/* fill the dest addr */
url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port, NULL, 0, uri);
-
+
/* XXX: fix url_split */
if (hostname[0] == '\0' || hostname[0] == '?') {
/* only accepts null hostname if input */
}
/* the bind is needed to give a port to the socket now */
- if (bind(udp_fd,(struct sockaddr *)&my_addr, sizeof(my_addr)) < 0)
+ if (bind(udp_fd,(struct sockaddr *)&my_addr, sizeof(my_addr)) < 0)
goto fail;
len = sizeof(my_addr1);
if (s->is_multicast) {
if (h->flags & URL_WRONLY) {
/* output */
- if (setsockopt(udp_fd, IPPROTO_IP, IP_MULTICAST_TTL,
+ if (setsockopt(udp_fd, IPPROTO_IP, IP_MULTICAST_TTL,
&s->ttl, sizeof(s->ttl)) < 0) {
perror("IP_MULTICAST_TTL");
goto fail;
memset(&s->mreq, 0, sizeof(s->mreq));
s->mreq.imr_multiaddr = s->dest_addr.sin_addr;
s->mreq.imr_interface.s_addr = htonl (INADDR_ANY);
- if (setsockopt(udp_fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+ if (setsockopt(udp_fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
&s->mreq, sizeof(s->mreq)) < 0) {
perror("rtp: IP_ADD_MEMBERSHIP");
goto fail;
goto fail;
}
}
-#endif
+#endif
#endif
if (is_output) {
int ret;
for(;;) {
- ret = sendto (s->udp_fd, buf, size, 0,
+ ret = sendto (s->udp_fd, buf, size, 0,
(struct sockaddr *) &s->dest_addr,
#ifndef CONFIG_IPV6
sizeof (s->dest_addr));
#ifndef CONFIG_BEOS_NETSERVER
#ifndef CONFIG_IPV6
if (s->is_multicast && !(h->flags & URL_WRONLY)) {
- if (setsockopt(s->udp_fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
+ if (setsockopt(s->udp_fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
&s->mreq, sizeof(s->mreq)) < 0) {
perror("IP_DROP_MEMBERSHIP");
}
if(!filename)
return 0;
-
+
ext = strrchr(filename, '.');
if (ext) {
ext++;
p = extensions;
for(;;) {
q = ext1;
- while (*p != '\0' && *p != ',' && q-ext1<sizeof(ext1)-1)
+ while (*p != '\0' && *p != ',' && q-ext1<sizeof(ext1)-1)
*q++ = *p++;
*q = '\0';
- if (!strcasecmp(ext1, ext))
+ if (!strcasecmp(ext1, ext))
return 1;
- if (*p == '\0')
+ if (*p == '\0')
break;
p++;
}
return 0;
}
-AVOutputFormat *guess_format(const char *short_name, const char *filename,
+AVOutputFormat *guess_format(const char *short_name, const char *filename,
const char *mime_type)
{
AVOutputFormat *fmt, *fmt_found;
int score_max, score;
/* specific test for image sequences */
- if (!short_name && filename &&
+ if (!short_name && filename &&
filename_number_test(filename) >= 0 &&
av_guess_image2_codec(filename) != CODEC_ID_NONE) {
return guess_format("image2", NULL, NULL);
}
- if (!short_name && filename &&
+ if (!short_name && filename &&
filename_number_test(filename) >= 0 &&
guess_image_format(filename)) {
return guess_format("image", NULL, NULL);
score += 100;
if (fmt->mime_type && mime_type && !strcmp(fmt->mime_type, mime_type))
score += 10;
- if (filename && fmt->extensions &&
+ if (filename && fmt->extensions &&
match_ext(filename, fmt->extensions)) {
score += 5;
}
fmt = fmt->next;
}
return fmt_found;
-}
+}
-AVOutputFormat *guess_stream_format(const char *short_name, const char *filename,
+AVOutputFormat *guess_stream_format(const char *short_name, const char *filename,
const char *mime_type)
{
AVOutputFormat *fmt = guess_format(short_name, filename, mime_type);
/**
* Guesses the codec id based upon muxer and filename.
*/
-enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
+enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type, enum CodecType type){
if(type == CODEC_TYPE_VIDEO){
enum CodecID codec_id= CODEC_ID_NONE;
{
void *data;
if((unsigned)size > (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
- return AVERROR_NOMEM;
+ return AVERROR_NOMEM;
data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!data)
return AVERROR_NOMEM;
memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
av_init_packet(pkt);
- pkt->data = data;
+ pkt->data = data;
pkt->size = size;
pkt->destruct = av_destruct_packet;
return 0;
/* we duplicate the packet and don't forget to put the padding
again */
if((unsigned)pkt->size > (unsigned)pkt->size + FF_INPUT_BUFFER_PADDING_SIZE)
- return AVERROR_NOMEM;
+ return AVERROR_NOMEM;
data = av_malloc(pkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!data) {
return AVERROR_NOMEM;
int fifo_size(FifoBuffer *f, uint8_t *rptr)
{
int size;
-
+
if(!rptr)
rptr= f->rptr;
} else {
size = (f->end - rptr) + (f->wptr - f->buffer);
}
-
+
if (size < buf_size)
return -1;
while (buf_size > 0) {
*/
void fifo_realloc(FifoBuffer *f, unsigned int new_size){
unsigned int old_size= f->end - f->buffer;
-
+
if(old_size < new_size){
uint8_t *old= f->buffer;
} else {
size = (f->end - rptr) + (f->wptr - f->buffer);
}
-
+
if (size < buf_size)
return -1;
while (buf_size > 0) {
if (match_ext(pd->filename, fmt1->extensions)) {
score = 50;
}
- }
+ }
if (score > score_max) {
score_max = score;
fmt = fmt1;
* Allocates all the structures needed to read an input stream.
* This does not open the needed codecs for decoding the stream[s].
*/
-int av_open_input_stream(AVFormatContext **ic_ptr,
- ByteIOContext *pb, const char *filename,
+int av_open_input_stream(AVFormatContext **ic_ptr,
+ ByteIOContext *pb, const char *filename,
AVInputFormat *fmt, AVFormatParameters *ap)
{
int err;
* @param ap additionnal parameters needed when opening the file (NULL if default)
* @return 0 if OK. AVERROR_xxx otherwise.
*/
-int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
+int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
AVInputFormat *fmt,
int buf_size,
AVFormatParameters *ap)
uint8_t buf[PROBE_BUF_SIZE];
AVProbeData probe_data, *pd = &probe_data;
ByteIOContext pb1, *pb = &pb1;
-
+
file_opened = 0;
pd->filename = "";
if (filename)
}
}
}
-
+
/* guess file format */
if (!fmt) {
fmt = av_probe_input_format(pd, 1);
err = AVERROR_NOFMT;
goto fail;
}
-
+
/* XXX: suppress this hack for redirectors */
#ifdef CONFIG_NETWORK
if (fmt == &redir_demux) {
/* check filename in case of an image number is expected */
if (fmt->flags & AVFMT_NEEDNUMBER) {
- if (filename_number_test(filename) < 0) {
+ if (filename_number_test(filename) < 0) {
err = AVERROR_NUMEXPECTED;
goto fail;
}
url_fclose(pb);
*ic_ptr = NULL;
return err;
-
+
}
/*******************************************************/
*
* This function is absolete and should never be used.
* Use av_read_frame() instead.
- *
+ *
* @param s media file handle
- * @param pkt is filled
- * @return 0 if OK. AVERROR_xxx if error.
+ * @param pkt is filled
+ * @return 0 if OK. AVERROR_xxx if error.
*/
int av_read_packet(AVFormatContext *s, AVPacket *pkt)
{
/**
* Return the frame duration in seconds, return 0 if not available.
*/
-static void compute_frame_duration(int *pnum, int *pden, AVStream *st,
+static void compute_frame_duration(int *pnum, int *pden, AVStream *st,
AVCodecParserContext *pc, AVPacket *pkt)
{
int frame_size;
return ((lsb - delta)&mask) + delta;
}
-static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
+static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
AVCodecParserContext *pc, AVPacket *pkt)
{
int num, den, presentation_delayed;
if(pkt->dts != AV_NOPTS_VALUE)
pkt->dts= lsb2full(pkt->dts, st->cur_dts, st->pts_wrap_bits);
}
-
+
if (pkt->duration == 0) {
compute_frame_duration(&num, &den, st, pc, pkt);
if (den && num) {
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
/* XXX: need has_b_frame, but cannot get it if the codec is
not initialized */
- if (( st->codec->codec_id == CODEC_ID_H264
- || st->codec->has_b_frames) &&
+ if (( st->codec->codec_id == CODEC_ID_H264
+ || st->codec->has_b_frames) &&
pc && pc->pict_type != FF_B_TYPE)
presentation_delayed = 1;
/* this may be redundant, but it shouldnt hurt */
if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts)
presentation_delayed = 1;
}
-
+
if(st->cur_dts == AV_NOPTS_VALUE){
if(presentation_delayed) st->cur_dts = -pkt->duration;
else st->cur_dts = 0;
// av_log(NULL, AV_LOG_DEBUG, "id:%d old:%Ld new:%Ld dur:%d cur:%Ld size:%d\n", pkt->stream_index, old_diff, new_diff, pkt->duration, st->cur_dts, pkt->size);
}
}
-
+
/* presentation is not delayed : PTS and DTS are the same */
if (pkt->pts == AV_NOPTS_VALUE) {
if (pkt->dts == AV_NOPTS_VALUE) {
st->cur_dts += pkt->duration;
}
// av_log(NULL, AV_LOG_DEBUG, "OUTdelayed:%d pts:%lld, dts:%lld cur_dts:%lld\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts);
-
+
/* update flags */
if (pc) {
pkt->flags = 0;
s->cur_st = NULL;
return 0;
} else if (s->cur_len > 0 && st->discard < AVDISCARD_ALL) {
- len = av_parser_parse(st->parser, st->codec, &pkt->data, &pkt->size,
+ len = av_parser_parse(st->parser, st->codec, &pkt->data, &pkt->size,
s->cur_ptr, s->cur_len,
s->cur_pkt.pts, s->cur_pkt.dts);
s->cur_pkt.pts = AV_NOPTS_VALUE;
/* increment read pointer */
s->cur_ptr += len;
s->cur_len -= len;
-
+
/* return packet if any */
if (pkt->size) {
got_packet:
}
} else {
/* free packet */
- av_free_packet(&s->cur_pkt);
+ av_free_packet(&s->cur_pkt);
s->cur_st = NULL;
}
} else {
for(i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
if (st->parser && st->need_parsing) {
- av_parser_parse(st->parser, st->codec,
- &pkt->data, &pkt->size,
- NULL, 0,
+ av_parser_parse(st->parser, st->codec,
+ &pkt->data, &pkt->size,
+ NULL, 0,
AV_NOPTS_VALUE, AV_NOPTS_VALUE);
if (pkt->size)
goto got_packet;
/* no more packets: really terminates parsing */
return ret;
}
-
+
st = s->streams[s->cur_pkt.stream_index];
s->cur_st = st;
* frames if each frame has a known fixed size (e.g. PCM or ADPCM
* data). If the audio frames have a variable size (e.g. MPEG audio),
* then it contains one frame.
- *
+ *
* pkt->pts, pkt->dts and pkt->duration are always set to correct
* values in AV_TIME_BASE unit (and guessed if the format cannot
* provided them). pkt->pts can be AV_NOPTS_VALUE if the video format
* has B frames, so it is better to rely on pkt->dts if you do not
* decompress the payload.
- *
+ *
* @return 0 if OK, < 0 if error or end of file.
*/
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
if(genpts && next_pkt->dts != AV_NOPTS_VALUE){
while(pktl && next_pkt->pts == AV_NOPTS_VALUE){
- if( pktl->pkt.stream_index == next_pkt->stream_index
+ if( pktl->pkt.stream_index == next_pkt->stream_index
&& next_pkt->dts < pktl->pkt.dts
&& pktl->pkt.pts != pktl->pkt.dts //not b frame
/*&& pktl->pkt.dts != AV_NOPTS_VALUE*/){
}
pktl = s->packet_buffer;
}
-
- if( next_pkt->pts != AV_NOPTS_VALUE
- || next_pkt->dts == AV_NOPTS_VALUE
+
+ if( next_pkt->pts != AV_NOPTS_VALUE
+ || next_pkt->dts == AV_NOPTS_VALUE
|| !genpts || eof){
/* read packet from packet buffer, if there is data */
*pkt = *next_pkt;
}else
return ret;
}
-
+
/* duplicate the packet */
if (av_dup_packet(pkt) < 0)
return AVERROR_NOMEM;
while(*plast_pktl) plast_pktl= &(*plast_pktl)->next; //FIXME maybe maintain pointer to the last?
-
+
pktl = av_mallocz(sizeof(AVPacketList));
if (!pktl)
return AVERROR_NOMEM;
-
+
/* add the packet in the buffered packet list */
*plast_pktl = pktl;
- pktl->pkt= *pkt;
+ pktl->pkt= *pkt;
}else{
assert(!s->packet_buffer);
return av_read_frame_internal(s, pkt);
for(;;) {
pktl = s->packet_buffer;
- if (!pktl)
+ if (!pktl)
break;
s->packet_buffer = pktl->next;
av_free_packet(&pktl->pkt);
/* fail safe */
s->cur_ptr = NULL;
s->cur_len = 0;
-
+
/* for each stream, reset read state */
for(i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
-
+
if (st->parser) {
av_parser_close(st->parser);
st->parser = NULL;
for(i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
- st->cur_dts = av_rescale(timestamp,
+ st->cur_dts = av_rescale(timestamp,
st->time_base.den * (int64_t)ref_st->time_base.num,
st->time_base.num * (int64_t)ref_st->time_base.den);
}
{
AVIndexEntry *entries, *ie;
int index;
-
+
if((unsigned)st->nb_index_entries + 1 >= UINT_MAX / sizeof(AVIndexEntry))
return -1;
-
+
entries = av_fast_realloc(st->index_entries,
&st->index_entries_allocated_size,
- (st->nb_index_entries + 1) *
+ (st->nb_index_entries + 1) *
sizeof(AVIndexEntry));
if(!entries)
return -1;
ie->timestamp = timestamp;
ie->min_distance= distance;
ie->flags = flags;
-
+
return index;
}
break;
if (pkt->stream_index == 0 && st->parser &&
(pkt->flags & PKT_FLAG_KEY)) {
- av_add_index_entry(st, st->parser->frame_offset, pkt->dts,
+ av_add_index_entry(st, st->parser->frame_offset, pkt->dts,
0, AVINDEX_KEYFRAME);
}
av_free_packet(pkt);
/**
* Gets the index for a specific timestamp.
- * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond to
- * the timestamp which is <= the requested one, if backward is 0
+ * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond to
+ * the timestamp which is <= the requested one, if backward is 0
* then it will be >=
* if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
* @return < 0 if no such timestamp could be found
a = m;
}
m= (flags & AVSEEK_FLAG_BACKWARD) ? a : b;
-
+
if(!(flags & AVSEEK_FLAG_ANY)){
while(m>=0 && m<nb_entries && !(entries[m].flags & AVINDEX_KEYFRAME)){
m += (flags & AVSEEK_FLAG_BACKWARD) ? -1 : 1;
}
}
- if(m == nb_entries)
+ if(m == nb_entries)
return -1;
return m;
}
if (stream_index < 0)
return -1;
-
+
#ifdef DEBUG_SEEK
av_log(s, AV_LOG_DEBUG, "read_seek: %d %"PRId64"\n", stream_index, target_ts);
#endif
pos_min= e->pos;
ts_min= e->timestamp;
#ifdef DEBUG_SEEK
- av_log(s, AV_LOG_DEBUG, "using cached pos_min=0x%"PRIx64" dts_min=%"PRId64"\n",
+ av_log(s, AV_LOG_DEBUG, "using cached pos_min=0x%"PRIx64" dts_min=%"PRId64"\n",
pos_min,ts_min);
#endif
}else{
assert(index==0);
}
-
- index= av_index_search_timestamp(st, target_ts, flags & ~AVSEEK_FLAG_BACKWARD);
+
+ index= av_index_search_timestamp(st, target_ts, flags & ~AVSEEK_FLAG_BACKWARD);
assert(index < st->nb_index_entries);
if(index >= 0){
e= &st->index_entries[index];
ts_max= e->timestamp;
pos_limit= pos_max - e->min_distance;
#ifdef DEBUG_SEEK
- av_log(s, AV_LOG_DEBUG, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64" dts_max=%"PRId64"\n",
+ av_log(s, AV_LOG_DEBUG, "using cached pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64" dts_max=%"PRId64"\n",
pos_max,pos_limit, ts_max);
#endif
}
}while(ts_max == AV_NOPTS_VALUE && pos_max >= step);
if (ts_max == AV_NOPTS_VALUE)
return -1;
-
+
for(;;){
int64_t tmp_pos= pos_max + 1;
int64_t tmp_ts= avif->read_timestamp(s, stream_index, &tmp_pos, INT64_MAX);
no_change=0;
while (pos_min < pos_limit) {
#ifdef DEBUG_SEEK
- av_log(s, AV_LOG_DEBUG, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%"PRId64" dts_max=%"PRId64"\n",
+ av_log(s, AV_LOG_DEBUG, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" dts_min=%"PRId64" dts_max=%"PRId64"\n",
pos_min, pos_max,
ts_min, ts_max);
#endif
ts_min = ts;
}
}
-
+
pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max;
ts = (flags & AVSEEK_FLAG_BACKWARD) ? ts_min : ts_max;
#ifdef DEBUG_SEEK
ts_min = avif->read_timestamp(s, stream_index, &pos_min, INT64_MAX);
pos_min++;
ts_max = avif->read_timestamp(s, stream_index, &pos_min, INT64_MAX);
- av_log(s, AV_LOG_DEBUG, "pos=0x%"PRIx64" %"PRId64"<=%"PRId64"<=%"PRId64"\n",
+ av_log(s, AV_LOG_DEBUG, "pos=0x%"PRIx64" %"PRId64"<=%"PRId64"<=%"PRId64"\n",
pos, ts_min, target_ts, ts_max);
#endif
/* do the seek */
return 0;
}
-static int av_seek_frame_generic(AVFormatContext *s,
+static int av_seek_frame_generic(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
int index;
* Seek to the key frame at timestamp.
* 'timestamp' in 'stream_index'.
* @param stream_index If stream_index is (-1), a default
- * stream is selected, and timestamp is automatically converted
+ * stream is selected, and timestamp is automatically converted
* from AV_TIME_BASE units to the stream specific time_base.
* @param timestamp timestamp in AVStream.time_base units
* or if there is no stream specified then in AV_TIME_BASE units
{
int ret;
AVStream *st;
-
+
av_read_frame_flush(s);
-
+
if(flags & AVSEEK_FLAG_BYTE)
return av_seek_frame_byte(s, stream_index, timestamp, flags);
-
+
if(stream_index < 0){
stream_index= av_find_default_stream_index(s);
if(stream_index < 0)
return -1;
-
+
st= s->streams[stream_index];
/* timestamp for default must be expressed in AV_TIME_BASE units */
timestamp = av_rescale(timestamp, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num);
ic->duration = end_time - start_time;
if (ic->file_size > 0) {
/* compute the bit rate */
- ic->bit_rate = (double)ic->file_size * 8.0 * AV_TIME_BASE /
+ ic->bit_rate = (double)ic->file_size * 8.0 * AV_TIME_BASE /
(double)ic->duration;
}
}
}
/* if duration is already set, we believe it */
- if (ic->duration == AV_NOPTS_VALUE &&
- ic->bit_rate != 0 &&
+ if (ic->duration == AV_NOPTS_VALUE &&
+ ic->bit_rate != 0 &&
ic->file_size != 0) {
filesize = ic->file_size;
if (filesize > 0) {
int read_size, i, ret;
int64_t end_time;
int64_t filesize, offset, duration;
-
+
/* free previous packet */
if (ic->cur_st && ic->cur_st->parser)
- av_free_packet(&ic->cur_pkt);
+ av_free_packet(&ic->cur_pkt);
ic->cur_st = NULL;
/* flush packet queue */
st->parser= NULL;
}
}
-
+
/* we read the first packets to get the first PTS (not fully
accurate, but it is enough now) */
url_fseek(&ic->pb, 0, SEEK_SET);
}
if (i == ic->nb_streams)
break;
-
+
ret = av_read_packet(ic, pkt);
if (ret != 0)
break;
}
av_free_packet(pkt);
}
-
+
fill_all_stream_timings(ic);
url_fseek(&ic->pb, 0, SEEK_SET);
AVStream *st;
for(i = 0;i < ic->nb_streams; i++) {
st = ic->streams[i];
- printf("%d: start_time: %0.3f duration: %0.3f\n",
- i, (double)st->start_time / AV_TIME_BASE,
+ printf("%d: start_time: %0.3f duration: %0.3f\n",
+ i, (double)st->start_time / AV_TIME_BASE,
(double)st->duration / AV_TIME_BASE);
}
- printf("stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
- (double)ic->start_time / AV_TIME_BASE,
+ printf("stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
+ (double)ic->start_time / AV_TIME_BASE,
(double)ic->duration / AV_TIME_BASE,
ic->bit_rate / 1000);
}
AVCodec *codec;
int got_picture, ret=0;
AVFrame picture;
-
+
if(!st->codec->codec){
codec = avcodec_find_decoder(st->codec->codec_id);
if (!codec)
if(!has_codec_parameters(st->codec)){
switch(st->codec->codec_type) {
case CODEC_TYPE_VIDEO:
- ret = avcodec_decode_video(st->codec, &picture,
+ ret = avcodec_decode_video(st->codec, &picture,
&got_picture, (uint8_t *)data, size);
break;
case CODEC_TYPE_AUDIO:
samples = av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
if (!samples)
goto fail;
- ret = avcodec_decode_audio(st->codec, samples,
+ ret = avcodec_decode_audio(st->codec, samples,
&got_picture, (uint8_t *)data, size);
av_free(samples);
break;
* frame mode.
*
* @param ic media file handle
- * @return >=0 if OK. AVERROR_xxx if error.
+ * @return >=0 if OK. AVERROR_xxx if error.
* @todo let user decide somehow what information is needed so we dont waste time geting stuff the user doesnt need
*/
int av_find_stream_info(AVFormatContext *ic)
last_dts[i]= AV_NOPTS_VALUE;
duration_sum[i]= INT64_MAX;
}
-
+
count = 0;
read_size = 0;
ppktl = &ic->packet_buffer;
pkt = &pktl->pkt;
*pkt = pkt1;
-
+
/* duplicate the packet */
if (av_dup_packet(pkt) < 0) {
ret = AVERROR_NOMEM;
memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size);
}
}
-
+
/* if still no information, we try to open the codec and to
decompress the frame. We try to avoid that in most cases as
it takes longer and uses more memory. For MPEG4, we need to
st->codec->codec_id == CODEC_ID_SHORTEN ||
(st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
try_decode_frame(st, pkt->data, pkt->size);
-
+
if (av_rescale_q(st->codec_info_duration, st->time_base, AV_TIME_BASE_Q) >= MAX_STREAM_DURATION) {
break;
}
num= st->time_base.den*duration_count[i];
den= st->time_base.num*duration_sum[i];
-
+
av_reduce(&fps1.num, &fps1.den, num*1001, den*1000, FFMAX(st->time_base.den, st->time_base.num)/4);
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, num, den, FFMAX(st->time_base.den, st->time_base.num)/4);
if(fps1.num < st->r_frame_rate.num && fps1.den == 1 && (fps1.num==24 || fps1.num==30)){ //FIXME better decission
st->codec->sub_id == 2) {
if (st->codec_info_nb_frames >= 20) {
float coded_frame_rate, est_frame_rate;
- est_frame_rate = ((double)st->codec_info_nb_frames * AV_TIME_BASE) /
+ est_frame_rate = ((double)st->codec_info_nb_frames * AV_TIME_BASE) /
(double)st->codec_info_duration ;
coded_frame_rate = 1.0/av_q2d(st->codec->time_base);
#if 0
- printf("telecine: coded_frame_rate=%0.3f est_frame_rate=%0.3f\n",
+ printf("telecine: coded_frame_rate=%0.3f est_frame_rate=%0.3f\n",
coded_frame_rate, est_frame_rate);
#endif
/* if we detect that it could be a telecine, we
signal it. It would be better to do it at a
higher level as it can change in a film */
- if (coded_frame_rate >= 24.97 &&
+ if (coded_frame_rate >= 24.97 &&
(est_frame_rate >= 23.5 && est_frame_rate < 24.5)) {
st->r_frame_rate = (AVRational){24000, 1001};
}
/**
* start playing a network based stream (e.g. RTSP stream) at the
- * current position
+ * current position
*/
int av_read_play(AVFormatContext *s)
{
/* free previous packet */
if (s->cur_st && s->cur_st->parser)
- av_free_packet(&s->cur_pkt);
+ av_free_packet(&s->cur_pkt);
if (s->iformat->read_close)
s->iformat->read_close(s);
* can be added in read_packet too.
*
* @param s media file handle
- * @param id file format dependent stream id
+ * @param id file format dependent stream id
*/
AVStream *av_new_stream(AVFormatContext *s, int id)
{
st = av_mallocz(sizeof(AVStream));
if (!st)
return NULL;
-
+
st->codec= avcodec_alloc_context();
if (s->iformat) {
/* no default bitrate if decoding */
int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap)
{
int ret;
-
+
if (s->oformat->priv_data_size > 0) {
s->priv_data = av_mallocz(s->oformat->priv_data_size);
if (!s->priv_data)
return AVERROR_NOMEM;
} else
s->priv_data = NULL;
-
+
if (s->oformat->set_parameters) {
ret = s->oformat->set_parameters(s, ap);
if (ret < 0)
* output media file
*
* @param s media file handle
- * @return 0 if OK. AVERROR_xxx if error.
+ * @return 0 if OK. AVERROR_xxx if error.
*/
int av_write_header(AVFormatContext *s)
{
int num, den, frame_size;
// av_log(NULL, AV_LOG_DEBUG, "av_write_frame: pts:%lld dts:%lld cur_dts:%lld b:%d size:%d st:%d\n", pkt->pts, pkt->dts, st->cur_dts, b_frames, pkt->size, pkt->stream_index);
-
+
/* if(pkt->pts == AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE)
return -1;*/
-
+
/* duration field */
if (pkt->duration == 0) {
compute_frame_duration(&num, &den, st, NULL, pkt);
pkt->pts= st->pts.val;
}
- //calculate dts from pts
+ //calculate dts from pts
if(pkt->pts != AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE){
if(b_frames){
if(st->last_IP_pts == AV_NOPTS_VALUE){
}else
pkt->dts= pkt->pts;
}
-
+
if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >= pkt->dts){
av_log(NULL, AV_LOG_ERROR, "error, non monotone timestamps %"PRId64" >= %"PRId64"\n", st->cur_dts, pkt->dts);
return -1;
static void truncate_ts(AVStream *st, AVPacket *pkt){
int64_t pts_mask = (2LL << (st->pts_wrap_bits-1)) - 1;
-
+
// if(pkt->dts < 0)
// pkt->dts= 0; //this happens for low_delay=0 and b frames, FIXME, needs further invstigation about what we should do here
-
+
pkt->pts &= pts_mask;
pkt->dts &= pts_mask;
}
ret=compute_pkt_fields2(s->streams[pkt->stream_index], pkt);
if(ret<0)
return ret;
-
+
truncate_ts(s->streams[pkt->stream_index], pkt);
ret= s->oformat->write_packet(s, pkt);
/**
* interleave_packet implementation which will interleave per DTS.
- * packets with pkt->destruct == av_destruct_packet will be freed inside this function.
+ * packets with pkt->destruct == av_destruct_packet will be freed inside this function.
* so they cannot be used after it, note calling av_free_packet() on them is still safe
*/
static int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){
this_pktl->next= *next_point;
*next_point= this_pktl;
}
-
+
memset(streams, 0, sizeof(streams));
pktl= s->packet_buffer;
while(pktl){
streams[ pktl->pkt.stream_index ]++;
pktl= pktl->next;
}
-
+
if(s->nb_streams == stream_count || (flush && stream_count)){
pktl= s->packet_buffer;
*out= pktl->pkt;
-
- s->packet_buffer= pktl->next;
+
+ s->packet_buffer= pktl->next;
av_freep(&pktl);
return 1;
}else{
* @param in the input packet
* @param flush 1 if no further packets are available as input and all
* remaining packets should be output
- * @return 1 if a packet was output, 0 if no packet could be output,
+ * @return 1 if a packet was output, 0 if no packet could be output,
* < 0 if an error occured
*/
static int av_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush){
//av_log(NULL, AV_LOG_DEBUG, "av_interleaved_write_frame %d %Ld %Ld\n", pkt->size, pkt->dts, pkt->pts);
if(compute_pkt_fields2(st, pkt) < 0)
return -1;
-
+
if(pkt->dts == AV_NOPTS_VALUE)
return -1;
int ret= av_interleave_packet(s, &opkt, pkt, 0);
if(ret<=0) //FIXME cleanup needed for ret<0 ?
return ret;
-
+
truncate_ts(s->streams[opkt.stream_index], &opkt);
ret= s->oformat->write_packet(s, &opkt);
-
+
av_free_packet(&opkt);
pkt= NULL;
-
+
if(ret<0)
return ret;
if(url_ferror(&s->pb))
int av_write_trailer(AVFormatContext *s)
{
int ret, i;
-
+
for(;;){
AVPacket pkt;
ret= av_interleave_packet(s, &pkt, NULL, 1);
goto fail;
if(!ret)
break;
-
+
truncate_ts(s->streams[pkt.stream_index], &pkt);
ret= s->oformat->write_packet(s, &pkt);
-
+
av_free_packet(&pkt);
-
+
if(ret<0)
goto fail;
if(url_ferror(&s->pb))
/* "user interface" functions */
void dump_format(AVFormatContext *ic,
- int index,
+ int index,
const char *url,
int is_output)
{
int i, flags;
char buf[256];
- av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
+ av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
is_output ? "Output" : "Input",
- index,
- is_output ? ic->oformat->name : ic->iformat->name,
+ index,
+ is_output ? ic->oformat->name : ic->iformat->name,
is_output ? "to" : "from", url);
if (!is_output) {
av_log(NULL, AV_LOG_INFO, " Duration: ");
secs %= 60;
hours = mins / 60;
mins %= 60;
- av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%01d", hours, mins, secs,
+ av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%01d", hours, mins, secs,
(10 * us) / AV_TIME_BASE);
} else {
av_log(NULL, AV_LOG_INFO, "N/A");
{
int i;
char* cp;
-
+
/* First, we check our abbreviation table */
for (i = 0; i < sizeof(frame_abvs)/sizeof(*frame_abvs); ++i)
if (!strcmp(frame_abvs[i].abv, arg)) {
if (cp) {
char* cpp;
*frame_rate = strtol(arg, &cpp, 10);
- if (cpp != arg || cpp == cp)
+ if (cpp != arg || cpp == cp)
*frame_rate_base = strtol(cp+1, &cpp, 10);
else
*frame_rate = 0;
- }
+ }
else {
/* Finally we give up and parse it as double */
*frame_rate_base = DEFAULT_FRAME_RATE_BASE; //FIXME use av_d2q()
* - If not a duration:
* [{YYYY-MM-DD|YYYYMMDD}]{T| }{HH[:MM[:SS[.m...]]][Z]|HH[MM[SS[.m...]]][Z]}
* Time is localtime unless Z is suffixed to the end. In this case GMT
- * Return the date in micro seconds since 1970
+ * Return the date in micro seconds since 1970
*
* - If a duration:
* HH[:MM[:SS[.m...]]]
int val, n;
q++;
for (val = 0, n = 100000; n >= 1; n /= 10, q++) {
- if (!isdigit(*q))
+ if (!isdigit(*q))
break;
val += n * (*q - '0');
}
}
*q = '\0';
}
- if (!strcmp(tag, tag1))
+ if (!strcmp(tag, tag1))
return 1;
if (*p != '&')
break;
/**
* Set the pts for a given stream.
*
- * @param s stream
+ * @param s stream
* @param pts_wrap_bits number of bits effectively used by the pts
- * (used for wrap control, 33 is the value for MPEG)
- * @param pts_num numerator to convert to seconds (MPEG: 1)
+ * (used for wrap control, 33 is the value for MPEG)
+ * @param pts_num numerator to convert to seconds (MPEG: 1)
* @param pts_den denominator to convert to seconds (MPEG: 90000)
*/
void av_set_pts_info(AVStream *s, int pts_wrap_bits,
* @param f fractional number
* @param val integer value
* @param num must be >= 0
- * @param den must be >= 1
+ * @param den must be >= 1
*/
void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
{
}
/**
- * Read an image from a stream.
+ * Read an image from a stream.
* @param gb byte stream containing the image
* @param fmt image format, NULL if probing is required
*/
-/*
+/*
* WAV encoder and decoder
* Copyright (c) 2001, 2002 Fabrice Bellard.
*
} else {
bps = 16;
}
-
+
if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3) {
blkalign = enc->frame_size; //this is wrong, but seems many demuxers dont work if this is set correctly
//blkalign = 144 * enc->bit_rate/enc->sample_rate;
* WAVEFORMATEX adds 'WORD cbSize' and basically makes itself
* an openended structure.
*/
-void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size)
+void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size)
{
int id;
}else
codec->bits_per_sample = get_le16(pb);
codec->codec_id = wav_codec_get_id(id, codec->bits_per_sample);
-
+
if (size > 16) { /* We're obviously dealing with WAVEFORMATEX */
codec->extradata_size = get_le16(pb);
if (codec->extradata_size > 0) {
get_buffer(pb, codec->extradata, codec->extradata_size);
} else
codec->extradata_size = 0;
-
+
/* It is possible for the chunk to contain garbage at the end */
if (size - codec->extradata_size - 18 > 0)
url_fskip(pb, size - codec->extradata_size - 18);
/* data header */
wav->data = start_tag(pb, "data");
-
+
put_flush_packet(pb);
return 0;
tag = get_le32(pb);
if (tag != MKTAG('W', 'A', 'V', 'E'))
return -1;
-
+
/* parse fmt header */
size = find_tag(pb, MKTAG('f', 'm', 't', ' '));
if (size < 0)
return 0;
}
-static int wav_read_seek(AVFormatContext *s,
+static int wav_read_seek(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
AVStream *st;
/* bizarre palette lookup table */
static const unsigned char wc3_pal_lookup[] = {
- 0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E,
+ 0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E,
0x10, 0x12, 0x13, 0x15, 0x16, 0x18, 0x19, 0x1A,
- 0x1C, 0x1D, 0x1F, 0x20, 0x21, 0x23, 0x24, 0x25,
+ 0x1C, 0x1D, 0x1F, 0x20, 0x21, 0x23, 0x24, 0x25,
0x27, 0x28, 0x29, 0x2A, 0x2C, 0x2D, 0x2E, 0x2F,
- 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x38, 0x39,
+ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3F, 0x40, 0x41, 0x42,
- 0x43, 0x44, 0x45, 0x46, 0x48, 0x49, 0x4A, 0x4B,
+ 0x43, 0x44, 0x45, 0x46, 0x48, 0x49, 0x4A, 0x4B,
0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53,
- 0x54, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C,
+ 0x54, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C,
0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64,
- 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
+ 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C,
0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74,
- 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C,
+ 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C,
0x7D, 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83,
- 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B,
+ 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B,
0x8C, 0x8D, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92,
- 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x99,
+ 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x99,
0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA1,
- 0xA2, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8,
+ 0xA2, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8,
0xA9, 0xAA, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
- 0xB0, 0xB1, 0xB2, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
+ 0xB0, 0xB1, 0xB2, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
0xB7, 0xB8, 0xB9, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD,
- 0xBE, 0xBF, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4,
+ 0xBE, 0xBF, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4,
0xC5, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB,
- 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD0, 0xD1,
+ 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD0, 0xD1,
0xD2, 0xD3, 0xD4, 0xD5, 0xD5, 0xD6, 0xD7, 0xD8,
0xD9, 0xDA, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
0xDF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE4, 0xE5,
- 0xE6, 0xE7, 0xE8, 0xE9, 0xE9, 0xEA, 0xEB, 0xEC,
+ 0xE6, 0xE7, 0xE8, 0xE9, 0xE9, 0xEA, 0xEB, 0xEC,
0xED, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF1, 0xF2,
- 0xF3, 0xF4, 0xF5, 0xF6, 0xF6, 0xF7, 0xF8, 0xF9,
+ 0xF3, 0xF4, 0xF5, 0xF6, 0xF6, 0xF7, 0xF8, 0xF9,
0xFA, 0xFA, 0xFB, 0xFC, 0xFD, 0xFD, 0xFD, 0xFD
};
/* traverse through the chunks and load the header information before
* the first BRCH tag */
- if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
+ if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
WC3_PREAMBLE_SIZE)
return AVERROR_IO;
fourcc_tag = LE_32(&preamble[0]);
case SIZE_TAG:
/* video resolution override */
- if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
+ if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
WC3_PREAMBLE_SIZE)
return AVERROR_IO;
wc3->width = LE_32(&preamble[0]);
/* one of several palettes */
if ((unsigned)current_palette >= wc3->palette_count)
return AVERROR_INVALIDDATA;
- if ((ret = get_buffer(pb,
- &wc3->palettes[current_palette * PALETTE_SIZE],
+ if ((ret = get_buffer(pb,
+ &wc3->palettes[current_palette * PALETTE_SIZE],
PALETTE_SIZE)) != PALETTE_SIZE)
return AVERROR_IO;
i < (current_palette + 1) * PALETTE_SIZE; i++) {
/* rotate each palette component left by 2 and use the result
* as an index into the color component table */
- rotate = ((wc3->palettes[i] << 2) & 0xFF) |
+ rotate = ((wc3->palettes[i] << 2) & 0xFF) |
((wc3->palettes[i] >> 6) & 0xFF);
wc3->palettes[i] = wc3_pal_lookup[rotate];
}
break;
}
- if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
+ if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
WC3_PREAMBLE_SIZE)
return AVERROR_IO;
fourcc_tag = LE_32(&preamble[0]);
if ((field < 8000) || (field > 48000))
return 0;
- /* note: only check for WS IMA (type 99) right now since there is no
+ /* note: only check for WS IMA (type 99) right now since there is no
* support for type 1 */
if (p->buf[11] != 99)
return 0;
pkt->pts /= wsvqa->audio_samplerate;
/* 2 samples/byte, 1 or 2 samples per frame depending on stereo */
- wsvqa->audio_frame_counter += (chunk_size * 2) /
+ wsvqa->audio_frame_counter += (chunk_size * 2) /
wsvqa->audio_channels;
} else {
pkt->stream_index = wsvqa->video_stream_index;
int size;
URLContext *h;
AVImageInfo info1, *info = &info1;
-
+
img_size = url_fsize(f);
/* XXX: hack hack */
return AVERROR_IO;
}
info->pix_fmt = PIX_FMT_YUV420P;
-
+
ret = alloc_cb(opaque, info);
if (ret)
return ret;
-
+
size = info->width * info->height;
-
+
p = strrchr(fname, '.');
if (!p || p[1] != 'Y')
return AVERROR_IO;
get_buffer(f, info->pict.data[0], size);
-
+
p[1] = 'U';
if (url_fopen(pb, fname, URL_RDONLY) < 0)
return AVERROR_IO;
get_buffer(pb, info->pict.data[1], size / 4);
url_fclose(pb);
-
+
p[1] = 'V';
if (url_fopen(pb, fname, URL_RDONLY) < 0)
return AVERROR_IO;
uint8_t *ptr;
URLContext *h;
static const char *ext = "YUV";
-
+
/* XXX: hack hack */
h = url_fileno(pb2);
url_get_filename(h, fname, sizeof(fname));
} else {
pb = pb2;
}
-
+
ptr = info->pict.data[i];
for(j=0;j<height;j++) {
put_buffer(pb, ptr, width);
}
return 0;
}
-
+
static int yuv_probe(AVProbeData *pd)
{
if (match_ext(pd->filename, "Y"))
height = st->codec->height;
av_reduce(&raten, &rated, st->codec->time_base.den, st->codec->time_base.num, (1UL<<31)-1);
-
+
aspectn = st->codec->sample_aspect_ratio.num;
aspectd = st->codec->sample_aspect_ratio.den;
-
+
if ( aspectn == 0 && aspectd == 1 ) aspectd = 0; // 0:0 means unknown
inter = 'p'; /* progressive is the default */
inter,
aspectn, aspectd,
colorspace);
-
+
return n;
}
av_log(s, AV_LOG_ERROR, "Error. YUV4MPEG stream header write failed.\n");
return AVERROR_IO;
} else {
- put_buffer(pb, buf2, strlen(buf2));
+ put_buffer(pb, buf2, strlen(buf2));
}
}
/* construct frame header */
-
+
m = snprintf(buf1, sizeof(buf1), "%s\n", Y4M_FRAME_MAGIC);
put_buffer(pb, buf1, strlen(buf1));
width = st->codec->width;
height = st->codec->height;
-
+
ptr = picture->data[0];
for(i=0;i<height;i++) {
put_buffer(pb, ptr, width);
static int yuv4_write_header(AVFormatContext *s)
{
int* first_pkt = s->priv_data;
-
+
if (s->nb_streams != 1)
return AVERROR_IO;
-
+
if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {
av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV stream, some mjpegtools might not work.\n");
- }
- else if ((s->streams[0]->codec->pix_fmt != PIX_FMT_YUV420P) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV422P) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&
+ }
+ else if ((s->streams[0]->codec->pix_fmt != PIX_FMT_YUV420P) &&
+ (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV422P) &&
+ (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&
(s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) {
av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, yuv422p, yuv420p, yuv411p and gray pixel formats. Use -pix_fmt to select one.\n");
return AVERROR_IO;
}
-
+
*first_pkt = 1;
return 0;
}
int width=-1, height=-1, raten=0, rated=0, aspectn=0, aspectd=0,interlaced_frame=0,top_field_first=0;
enum PixelFormat pix_fmt=PIX_FMT_NONE,alt_pix_fmt=PIX_FMT_NONE;
AVStream *st;
-
+
for (i=0; i<MAX_YUV4_HEADER; i++) {
header[i] = get_byte(pb);
if (header[i] == '\n') {
while(tokstart<header_end&&*tokstart!=0x20) tokstart++;
break;
}
- }
+ }
if ((width == -1) || (height == -1)) {
av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n");
- return -1;
+ return -1;
}
-
+
if (pix_fmt == PIX_FMT_NONE) {
if (alt_pix_fmt == PIX_FMT_NONE)
pix_fmt = PIX_FMT_YUV420P;
// Pixel aspect unknown
aspectd = 1;
}
-
+
st = av_new_stream(s, 0);
st = s->streams[0];
st->codec->width = width;
}
if (i == MAX_FRAME_HEADER) return -1;
if (strncmp(header, Y4M_FRAME_MAGIC, strlen(Y4M_FRAME_MAGIC))) return -1;
-
+
width = st->codec->width;
height = st->codec->height;
endif
%.o: %.c
- $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
depend: $(SRCS)
$(CC) -MM $(CFLAGS) $^ 1>.depend
"0" (x));
return x;
#else
- union {
+ union {
uint64_t ll;
struct {
uint32_t l,h;
static inline uint64_t bswap_64(uint64_t x)
{
- union {
+ union {
uint64_t ll;
struct {
uint32_t l,h;
x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
return (x>>32) | (x<<32);
#else
- union {
+ union {
uint64_t ll;
- uint32_t l[2];
+ uint32_t l[2];
} w, r;
w.ll = x;
r.l[0] = bswap_32 (w.l[1]);
#endif
#if defined(CONFIG_OS2) || defined(CONFIG_SUNOS)
-static inline float floorf(float f) {
- return floor(f);
+static inline float floorf(float f) {
+ return floor(f);
}
#endif
#else
# define FASTDIV(a,b) ((a)/(b))
#endif
-
+
/* define it to include statistics code (useful only for optimizing
codec efficiency */
//#define STATS
int ret=0;
int s;
int ret_sq=0;
-
+
if(a<128) return ff_sqrt_tab[a];
-
+
for(s=15; s>=0; s--){
int b= ret_sq + (1<<(s*2)) + (ret<<s)*2;
if(b<=a){
}\
}
#else
-#define START_TIMER
+#define START_TIMER
#define STOP_TIMER(id) {}
#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file integer.c
* arbitrary precision integers.
AVInteger av_add_i(AVInteger a, AVInteger b){
int i, carry=0;
-
+
for(i=0; i<AV_INTEGER_SIZE; i++){
carry= (carry>>16) + a.v[i] + b.v[i];
a.v[i]= carry;
AVInteger av_sub_i(AVInteger a, AVInteger b){
int i, carry=0;
-
+
for(i=0; i<AV_INTEGER_SIZE; i++){
carry= (carry>>16) + a.v[i] - b.v[i];
a.v[i]= carry;
int i, j;
int na= (av_log2_i(a)+16) >> 4;
int nb= (av_log2_i(b)+16) >> 4;
-
+
memset(&out, 0, sizeof(out));
-
+
for(i=0; i<na; i++){
unsigned int carry=0;
-
+
if(a.v[i])
for(j=i; j<AV_INTEGER_SIZE && j-i<=nb; j++){
carry= (carry>>16) + out.v[j] + a.v[i]*b.v[j-i];
* returns 0 if a==b, 1 if a>b and -1 if a<b.
*/
int av_cmp_i(AVInteger a, AVInteger b){
- int i;
+ int i;
int v= (int16_t)a.v[AV_INTEGER_SIZE-1] - (int16_t)b.v[AV_INTEGER_SIZE-1];
if(v) return (v>>16)|1;
-
+
for(i=AV_INTEGER_SIZE-2; i>=0; i--){
int v= a.v[i] - b.v[i];
if(v) return (v>>16)|1;
int i= av_log2_i(a) - av_log2_i(b);
AVInteger quot_temp;
if(!quot) quot = "_temp;
-
+
assert((int16_t)a[AV_INTEGER_SIZE-1] >= 0 && (int16_t)b[AV_INTEGER_SIZE-1] >= 0);
assert(av_log2(b)>=0);
-
+
if(i > 0)
b= av_shr_i(b, -i);
-
+
memset(quot, 0, sizeof(AVInteger));
while(i-- >= 0){
AVInteger av_int2i(int64_t a){
AVInteger out;
int i;
-
+
for(i=0; i<AV_INTEGER_SIZE; i++){
out.v[i]= a;
a>>=16;
/**
* converts the given AVInteger to an int64_t.
- * if the AVInteger is too large to fit into an int64_t,
+ * if the AVInteger is too large to fit into an int64_t,
* then only the least significant 64bit will be used
*/
int64_t av_i2int(AVInteger a){
int i;
int64_t out=(int8_t)a.v[AV_INTEGER_SIZE-1];
-
+
for(i= AV_INTEGER_SIZE-2; i>=0; i--){
out = (out<<16) + a.v[i];
}
for(b=3; b<256*256*256; b+=27118){
AVInteger ai= av_int2i(a);
AVInteger bi= av_int2i(b);
-
+
assert(av_i2int(ai) == a);
assert(av_i2int(bi) == b);
assert(av_i2int(av_add_i(ai,bi)) == a+b);
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file integer.h
* arbitrary precision integers
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-
+
#ifndef INTEGER_H
#define INTEGER_H
#define AV_INTEGER_SIZE 8
typedef struct AVInteger{
- uint16_t v[AV_INTEGER_SIZE];
+ uint16_t v[AV_INTEGER_SIZE];
} AVInteger;
AVInteger av_add_i(AVInteger a, AVInteger b);
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file intfloat_readwrite.c
* Portable IEEE float/double read/write functions.
*/
-
+
#include "common.h"
double av_int2dbl(int64_t v){
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/**
* @file mathematics.c
* Miscellaneous math routines and tables.
assert(c > 0);
assert(b >=0);
assert(rnd >=0 && rnd<=5 && rnd!=4);
-
- if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
-
+
+ if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
+
if(rnd==AV_ROUND_NEAR_INF) r= c/2;
else if(rnd&1) r= c-1;
else
return a/c*b + (a%c*b + r)/c;
}
-
+
ai= av_mul_i(av_int2i(a), av_int2i(b));
ai= av_add_i(ai, av_int2i(r));
-
+
return av_i2int(av_div_i(ai, av_int2i(c)));
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file rational.c
* Rational numbers
//#include <math.h>
#include <limits.h>
-
+
#include "common.h"
#include "mathematics.h"
#include "rational.h"
a1= (AVRational){nom, den};
den=0;
}
-
+
while(den){
int64_t x = nom / den;
int64_t next_den= nom - den*x;
den= next_den;
}
assert(ff_gcd(a1.num, a1.den) == 1);
-
+
*dst_nom = sign ? -a1.num : a1.num;
*dst_den = a1.den;
-
+
return den==0;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-
+
/**
* @file rational.h
* Rational numbers.
/*
* Libavformat API example: Output a media file in any supported
* libavformat format. The default codecs are used.
- *
+ *
* Copyright (c) 2003 Fabrice Bellard
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
+ * THE SOFTWARE.
*/
#include <stdlib.h>
#include <stdio.h>
int audio_outbuf_size;
int audio_input_frame_size;
-/*
+/*
* add an audio output stream
*/
AVStream *add_audio_stream(AVFormatContext *oc, int codec_id)
AVCodecContext *c;
AVPacket pkt;
av_init_packet(&pkt);
-
+
c = st->codec;
get_audio_frame(samples, audio_input_frame_size, c->channels);
void close_audio(AVFormatContext *oc, AVStream *st)
{
avcodec_close(st->codec);
-
+
av_free(samples);
av_free(audio_outbuf);
}
fprintf(stderr, "Could not alloc stream\n");
exit(1);
}
-
+
c = st->codec;
c->codec_id = codec_id;
c->codec_type = CODEC_TYPE_VIDEO;
/* put sample parameters */
c->bit_rate = 400000;
/* resolution must be a multiple of two */
- c->width = 352;
+ c->width = 352;
c->height = 288;
/* time base: this is the fundamental unit of time (in seconds) in terms
of which frame timestamps are represented. for fixed-fps content,
timebase should be 1/framerate and timestamp increments should be
identically 1. */
- c->time_base.den = STREAM_FRAME_RATE;
+ c->time_base.den = STREAM_FRAME_RATE;
c->time_base.num = 1;
c->gop_size = 12; /* emit one intra frame every twelve frames at most */
c->pix_fmt = STREAM_PIX_FMT;
c->max_b_frames = 2;
}
if (c->codec_id == CODEC_ID_MPEG1VIDEO){
- /* needed to avoid using macroblocks in which some coeffs overflow
- this doesnt happen with normal video, it just happens here as the
+ /* needed to avoid using macroblocks in which some coeffs overflow
+ this doesnt happen with normal video, it just happens here as the
motion of the chroma plane doesnt match the luma plane */
c->mb_decision=2;
}
// some formats want stream headers to be seperate
if(!strcmp(oc->oformat->name, "mp4") || !strcmp(oc->oformat->name, "mov") || !strcmp(oc->oformat->name, "3gp"))
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-
+
return st;
}
AVFrame *picture;
uint8_t *picture_buf;
int size;
-
+
picture = avcodec_alloc_frame();
if (!picture)
return NULL;
av_free(picture);
return NULL;
}
- avpicture_fill((AVPicture *)picture, picture_buf,
+ avpicture_fill((AVPicture *)picture, picture_buf,
pix_fmt, width, height);
return picture;
}
-
+
void open_video(AVFormatContext *oc, AVStream *st)
{
AVCodec *codec;
pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;
}
}
-
+
/* Cb and Cr */
for(y=0;y<height/2;y++) {
for(x=0;x<width/2;x++) {
{
int out_size, ret;
AVCodecContext *c;
-
+
c = st->codec;
-
+
if (frame_count >= STREAM_NB_FRAMES) {
/* no more frame to compress. The codec has a latency of a few
frames if using B frames, so we get the last frames by
/* as we only generate a YUV420P picture, we must convert it
to the codec pixel format if needed */
fill_yuv_image(tmp_picture, frame_count, c->width, c->height);
- img_convert((AVPicture *)picture, c->pix_fmt,
+ img_convert((AVPicture *)picture, c->pix_fmt,
(AVPicture *)tmp_picture, PIX_FMT_YUV420P,
c->width, c->height);
} else {
}
}
-
+
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
/* raw video case. The API will change slightly in the near
futur for that */
AVPacket pkt;
av_init_packet(&pkt);
-
+
pkt.flags |= PKT_FLAG_KEY;
pkt.stream_index= st->index;
pkt.data= (uint8_t *)picture;
pkt.size= sizeof(AVPicture);
-
+
ret = av_write_frame(oc, &pkt);
} else {
/* encode the image */
if (out_size > 0) {
AVPacket pkt;
av_init_packet(&pkt);
-
+
pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);
if(c->coded_frame->key_frame)
pkt.flags |= PKT_FLAG_KEY;
pkt.stream_index= st->index;
pkt.data= video_outbuf;
pkt.size= out_size;
-
+
/* write the compressed frame in the media file */
ret = av_write_frame(oc, &pkt);
} else {
/* initialize libavcodec, and register all codecs and formats */
av_register_all();
-
+
if (argc != 2) {
printf("usage: %s output_file\n"
"API example program to output a media file with libavformat.\n"
"\n", argv[0]);
exit(1);
}
-
+
filename = argv[1];
/* auto detect the output format from the name. default is
fprintf(stderr, "Could not find suitable output format\n");
exit(1);
}
-
+
/* allocate the output media context */
oc = av_alloc_format_context();
if (!oc) {
exit(1);
}
}
-
+
/* write the stream header, if any */
av_write_header(oc);
-
+
for(;;) {
/* compute current audio and video time */
if (audio_st)
audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
else
audio_pts = 0.0;
-
+
if (video_st)
video_pts = (double)video_st->pts.val * video_st->time_base.num / video_st->time_base.den;
else
video_pts = 0.0;
- if ((!audio_st || audio_pts >= STREAM_DURATION) &&
+ if ((!audio_st || audio_pts >= STREAM_DURATION) &&
(!video_st || video_pts >= STREAM_DURATION))
break;
-
+
/* write interleaved audio and video frames */
if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {
write_audio_frame(oc, audio_st);
/* write the trailer, if any */
av_write_trailer(oc);
-
+
/* free the streams */
for(i = 0; i < oc->nb_streams; i++) {
av_freep(&oc->streams[i]);
int dontquit = 0;
int nowrite = 0;
int err;
-
+
if ((argc > 1) && !strncmp(argv[1], "-", 1)) {
if (strchr(argv[1], 'w'))
dontquit = 1;
}
strcat(fntemplate, PKTFILESUFF);
printf("FNTEMPLATE: '%s'\n", fntemplate);
-
+
// register all file formats
av_register_all();
-
+
err = av_open_input_file(&fctx, argv[1], NULL, 0, NULL);
if (err < 0) {
fprintf(stderr, "av_open_input_file: error %d\n", err);
return 1;
}
-
+
err = av_find_stream_info(fctx);
if (err < 0) {
fprintf(stderr, "av_find_stream_info: error %d\n", err);
return 1;
}
-
+
av_init_packet(&pkt);
-
+
while ((err = av_read_frame(fctx, &pkt)) >= 0) {
int fd;
snprintf(pktfilename, PATH_MAX-1, fntemplate, pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & PKT_FLAG_KEY)?'K':'_');
if (maxpkts && (pktnum >= maxpkts))
break;
}
-
+
while (dontquit)
sleep(60);
-
+
return 0;
}
tiny_psnr: tiny_psnr.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
-
+
DSPDEPS = $(SRC_PATH)/libavcodec/i386/dsputil_mmx.c \
$(SRC_PATH)/libavcodec/i386/dsputil_mmx_avg.h \
$(SRC_PATH)/libavcodec/i386/dsputil_mmx_rnd.h \
clean:
rm -rf vsynth1 vsynth2 data
- rm -f asynth1.sw *~ audiogen videogen rotozoom tiny_psnr
+ rm -f asynth1.sw *~ audiogen videogen rotozoom tiny_psnr
"generate a test raw 16 bit stereo audio stream\n", argv[0]);
exit(1);
}
-
+
outfile = fopen(argv[1], "wb");
if (!outfile) {
perror(argv[1]);
f = 100 + (((10000 - 100) * i) / FE);
a += (f * FRAC_ONE) / FE;
}
-
+
/* 0.5 second of low amplitude white noise */
for(i=0;i<FE / 2;i++) {
v = myrnd(&seed, 20000) - 10000;
taba[j] += (f * FRAC_ONE) / FE;
}
}
-
+
/* stereo 500 Hz with varying volume */
a = 0;
ampa = 0;
echo $ffmpeg -y -flags +bitexact -dct fastint -idct simple $* -f crc $datadir/ffmpeg.crc
$ffmpeg -y -flags +bitexact -dct fastint -idct simple $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:|ffmpeg version| configuration| built)" /tmp/ffmpeg$$ || true
- rm -f /tmp/ffmpeg$$
+ rm -f /tmp/ffmpeg$$
echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
}
if [ -n "$do_mpeg" ] ; then
# mpeg1 encoding
file=${outfile}mpeg1.mpg
-do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
# mpeg1 decoding
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
if [ -n "$do_mpeg2" ] ; then
# mpeg2 encoding
file=${outfile}mpeg2.mpg
-do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file
# mpeg2 decoding
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
# mpeg2 encoding
file=${outfile}mpeg2.mpg
-do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct int -dct int -f mpeg1video $file
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct int -dct int -f mpeg1video $file
# mpeg2 decoding
do_ffmpeg $raw_dst -y -idct int -i $file -f rawvideo $raw_dst
# mpeg2 encoding interlaced
file=${outfile}mpeg2i.mpg
-do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -flags +ildct+ilme $file
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -flags +ildct+ilme $file
# mpeg2 decoding
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
if [ -n "$do_mpeg2thread" ] ; then
# mpeg2 encoding interlaced
file=${outfile}mpeg2thread.mpg
-do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2 $file
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2 $file
# mpeg2 decoding
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
# mpeg2 encoding interlaced
file=${outfile}mpeg2reuse.mpg
-do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
+do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
# mpeg2 decoding
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
# msmpeg4v2 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
# msmpeg4 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
# wmv1 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
# wmv2 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 11 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h261 $file
# h261 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
# h263 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 2 -flags +umv+aiv+aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
# h263p decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -flags +mv4 -mbd bits -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
# mpeg4 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
# mpeg4 rate control decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
# mpeg4 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -b 500 -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 -threads 2 $file
# mpeg4 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
# mpeg4 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
# damaged mpeg4 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 8 -flags +mv4 -mbd rd -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
# mpeg4 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
# mpeg1 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg -pix_fmt yuvj420p $file
# mjpeg decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
fi
###################################
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg -strict -1 $file
# ljpeg decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
if [ -n "$do_rv10" ] ; then
# rv10 encoding
file=${outfile}rv10.rm
-do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
# rv10 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
if [ -n "$do_rv20" ] ; then
# rv20 encoding
file=${outfile}rv20.rm
-do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec rv20 -an $file
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec rv20 -an $file
# rv20 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
# asv1 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
# asv2 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
# flv decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
# ffv1 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec snow -qscale 2 $file
# snow decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
# snow encoding
file=${outfile}snow53.avi
do_ffmpeg $file -y -strict -2 -f pgmyuv -i $raw_src -an -vcodec snow -pred 1 -flags +mv4+qpel $file
# snow decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
do_ffmpeg $file -dct int -y -f pgmyuv -i $raw_src -s pal -an $file
# dv decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo -s cif $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo -s cif $raw_dst
fi
###################################
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
# svq1 decoding
-do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
+do_ffmpeg $raw_dst -y -i $file -f rawvideo -pix_fmt yuv420p $raw_dst
fi
###################################
if [ -n "$do_mp2" ] ; then
# mp2 encoding
file=${outfile}mp2.mp2
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
+do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
# mp2 decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
fi
if [ -n "$do_ac3" ] ; then
# ac3 encoding
file=${outfile}ac3.rm
-do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
+do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
# ac3 decoding
-#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
fi
###################################
if [ -n "$do_g726" ] ; then
# g726 encoding
file=${outfile}g726.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
+do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
# g726 decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
fi
###################################
if [ -n "$do_adpcm_ima_wav" ] ; then
# encoding
file=${outfile}adpcm_ima.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
+do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
# decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
fi
###################################
if [ -n "$do_adpcm_ms" ] ; then
# encoding
file=${outfile}adpcm_ms.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
+do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
# decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
fi
###################################
if [ -n "$do_adpcm_yam" ] ; then
# encoding
file=${outfile}adpcm_yam.wav
-do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
+do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_yamaha $file
# decoding
-do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
+do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
fi
###################################
if $diff_cmd "$logfile" "$reffile" ; then
- echo
+ echo
echo Regression test succeeded.
exit 0
else
- echo
+ echo
echo Regression test: Error.
exit 1
fi
if(a>=MY_PI*3/2) a -= 2*MY_PI; // -PI/2 .. 3PI/2
if(a>=MY_PI/2 ) a = MY_PI - a; // -PI/2 .. PI/2
-
+
return a - int_pow(a, 3)/6 + int_pow(a, 5)/120 - int_pow(a, 7)/5040;
}
r1 = r;
g1 = g;
b1 = b;
- lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
r = p[3];
g = p[4];
r1 += r;
g1 += g;
b1 += b;
- lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
p += wrap3;
lum += wrap;
r1 += r;
g1 += g;
b1 += b;
- lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
r = p[3];
g = p[4];
r1 += r;
g1 += g;
b1 += b;
- lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
-
- cb[0] = ((- FIX(0.16874) * r1 - FIX(0.33126) * g1 +
+
+ cb[0] = ((- FIX(0.16874) * r1 - FIX(0.33126) * g1 +
FIX(0.50000) * b1 + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128;
- cr[0] = ((FIX(0.50000) * r1 - FIX(0.41869) * g1 -
+ cr[0] = ((FIX(0.50000) * r1 - FIX(0.41869) * g1 -
FIX(0.08131) * b1 + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128;
cb++;
int s11= src[ ((int_x+1)&255) + 256*((int_y+1)&255) ];
int s0= (((1<<16) - frac_x)*s00 + frac_x*s01)>>8;
int s1= (((1<<16) - frac_x)*s10 + frac_x*s11)>>8;
-
+
return (((1<<16) - frac_y)*s0 + frac_y*s1)>>24;
}
{
const int c = h_cos [teta];
const int s = h_sin [teta];
-
+
const int xi = -(w/2) * c;
const int yi = (w/2) * s;
-
+
const int xj = -(h/2) * s;
const int yj = -(h/2) * c;
int i,j;
-
+
int x,y;
int xprime = xj;
int yprime = yj;
y = yprime + yi + FIXP*h/2;
yprime += c;
-
+
for ( i=0 ; i<w ; i++ ) {
x += c;
y -= s;
perror(filename);
exit(1);
}
-
+
fread(line, 1, 15, fichier);
for (i=0;i<H;i++) {
fread(line,1,3*W,fichier);
gen_image(i, w, h);
pgmyuv_save(buf, w, h, rgb_tab);
}
-
+
free(rgb_tab);
return 0;
}
else
diff_cmd="diff"
fi
-
+
# Make sure that the data directory exists
mkdir -p data
wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=100000 > ff-$file 2>/dev/null &
fi
MDFILES="$MDFILES ff-$file"
- done
+ done
wait
# the status page is always different
md5sum $MDFILES | grep -v html > ffserver.regression
kill $FFSERVER_PID
wait > /dev/null 2>&1
if $diff_cmd data/ffserver.regression $1 ; then
- echo
+ echo
echo Server regression test succeeded.
exit 0
else
- echo
+ echo
echo Server regression test: Error.
exit 1
fi
# You must use 'ffmpeg' to send a live feed to ffserver. In this
# example, you can type:
-#
+#
# ffmpeg http://localhost:8090/feed1.ffm
# ffserver can also do time shifting. It means that it can stream any
if(a < 1<<16)
return -log16((1LL<<32) / a);
a<<=16;
-
+
for(i=20;i>=0;i--){
int64_t b= exp16_table[i];
if(a<(b<<16)) continue;
int len= argc<4 ? 1 : atoi(argv[3]);
int64_t max= (1<<(8*len))-1;
int shift= argc<5 ? 0 : atoi(argv[4]);
-
+
if(argc<3){
printf("tiny_psnr <file1> <file2> [<elem size> [<shift>]]\n");
return -1;
}
-
+
f[0]= fopen(argv[1], "rb");
f[1]= fopen(argv[2], "rb");
fseek(f[shift<0], shift < 0 ? -shift : shift, SEEK_SET);
for(i=0;;){
if( fread(buf[0], SIZE, 1, f[0]) != 1) break;
if( fread(buf[1], SIZE, 1, f[1]) != 1) break;
-
+
for(j=0; j<SIZE; i++,j++){
int64_t a= buf[0][j];
int64_t b= buf[1][j];
sse += (a-b) * (a-b);
}
}
-
+
if(!i) i=1;
dev= int_sqrt( ((sse/i)*F*F) + (((sse%i)*F*F) + i/2)/i );
if(sse)
psnr= ((2*log16(max<<16) + log16(i) - log16(sse))*284619LL*F + (1<<31)) / (1LL<<32);
else
psnr= 100*F-1; //floating point free infinity :)
-
- printf("stddev:%3d.%02d PSNR:%2d.%02d bytes:%d\n",
- (int)(dev/F), (int)(dev%F),
+
+ printf("stddev:%3d.%02d PSNR:%2d.%02d bytes:%d\n",
+ (int)(dev/F), (int)(dev%F),
(int)(psnr/F), (int)(psnr%F),
i);
return 0;
r1 = r;
g1 = g;
b1 = b;
- lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
r = p[3];
g = p[4];
r1 += r;
g1 += g;
b1 += b;
- lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
p += wrap3;
lum += wrap;
r1 += r;
g1 += g;
b1 += b;
- lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[0] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
r = p[3];
g = p[4];
r1 += r;
g1 += g;
b1 += b;
- lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
+ lum[1] = (FIX(0.29900) * r + FIX(0.58700) * g +
FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;
-
- cb[0] = ((- FIX(0.16874) * r1 - FIX(0.33126) * g1 +
+
+ cb[0] = ((- FIX(0.16874) * r1 - FIX(0.33126) * g1 +
FIX(0.50000) * b1 + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128;
- cr[0] = ((FIX(0.50000) * r1 - FIX(0.41869) * g1 -
+ cr[0] = ((FIX(0.50000) * r1 - FIX(0.41869) * g1 -
FIX(0.08131) * b1 + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128;
cb++;
put_pixel(x + NOISE_X, y + NOISE_Y, r, g, b);
}
}
-
+
/* then moving objects */
for(i=0;i<NB_OBJS;i++) {
VObj *p = &objs[i];
gen_image(i, w, h);
pgmyuv_save(buf, w, h, rgb_tab);
}
-
+
free(rgb_tab);
return 0;
}
ifeq ($(HAVE_IMLIB2),yes)
HOOKS += imlib2$(SLIBSUF)
-endif
+endif
ifeq ($(HAVE_FREETYPE2),yes)
HOOKS += drawtext$(SLIBSUF)
CFLAGS += `freetype-config --cflags`
-endif
+endif
-all: $(HOOKS)
+all: $(HOOKS)
SRCS := $(HOOKS:$(SLIBSUF)=.c)
* -x <pos> x position ( >= 0) [default 0]
* -y <pos> y position ( >= 0) [default 0]
* -t <text> text to print (will be passed to strftime())
- * MANDATORY: will be used even when -T is used.
- * in this case, -t will be used if some error
+ * MANDATORY: will be used even when -T is used.
+ * in this case, -t will be used if some error
* occurs
* -T <filename> file with the text (re-read every frame)
* -c <#RRGGBB> foreground color ('internet' way) [default #ffffff]
unsigned char fgcolor[3]; /* YUV */
FT_Library library;
FT_Face face;
- FT_Glyph glyphs[ 255 ];
+ FT_Glyph glyphs[ 255 ];
FT_Bitmap bitmaps[ 255 ];
int advance[ 255 ];
int bitmap_left[ 255 ];
}
}
- if (!ci->text)
+ if (!ci->text)
{
fprintf(stderr,"ERROR: No text provided (-t text)\n");
return -1;
fprintf(stderr,"ERROR: Could not load face: %s (error# %d)\n",font, error);
return -1;
}
-
+
if ((error = FT_Set_Pixel_Sizes( ci->face, 0, size)) != 0)
{
fprintf(stderr,"ERROR: Could not set font size to %d pixels (error# %d)\n",size, error);
/* Load char */
error = FT_Load_Char( ci->face, (unsigned char) c, FT_LOAD_RENDER | FT_LOAD_MONOCHROME );
if (error) continue; /* ignore errors */
-
+
/* Save bitmap */
ci->bitmaps[c] = ci->face->glyph->bitmap;
/* Save bitmap left */
/* Save glyph */
error = FT_Get_Glyph( ci->face->glyph, &(ci->glyphs[c]) );
/* Save glyph index */
- ci->glyphs_index[c] = FT_Get_Char_Index( ci->face, (unsigned char) c );
+ ci->glyphs_index[c] = FT_Get_Char_Index( ci->face, (unsigned char) c );
/* Measure text height to calculate text_height (or the maximum text height) */
FT_Glyph_Get_CBox( ci->glyphs[ c ], ft_glyph_bbox_pixels, &bbox );
yMax = bbox.yMax;
if (bbox.yMin < yMin)
yMin = bbox.yMin;
-
+
}
ci->text_height = yMax - yMin;
GET_PIXEL(picture, dpixel, (c+x), (y+r));
/* pixel in the glyph bitmap (source) */
- spixel = bitmap->buffer[r*bitmap->pitch +c/8] & (0x80>>(c%8));
-
- if (spixel)
+ spixel = bitmap->buffer[r*bitmap->pitch +c/8] & (0x80>>(c%8));
+
+ if (spixel)
COPY_3(dpixel, yuv_fgcolor);
-
+
if (outline)
{
- /* border detection: */
+ /* border detection: */
if ( (!in_glyph) && (spixel) )
/* left border detected */
{
/* 'draw' right pixel border */
COPY_3(dpixel, yuv_bgcolor);
}
-
- if (in_glyph)
+
+ if (in_glyph)
/* see if we have a top/bottom border */
{
/* top */
if ( (r+1 < height) && (! bitmap->buffer[(r+1)*bitmap->pitch +c/8] & (0x80>>(c%8))) )
/* we have a bottom border */
SET_PIXEL(picture, yuv_bgcolor, (c+x), (y+r+1));
-
+
}
}
-
+
SET_PIXEL(picture, dpixel, (c+x), (y+r));
}
}
int i, j;
for (j = 0; (j < height); j++)
- for (i = 0; (i < width); i++)
- {
+ for (i = 0; (i < width); i++)
+ {
SET_PIXEL(picture, yuv_color, (i+x), (y+j));
}
-
+
}
{
ContextInfo *ci = (ContextInfo *) ctx;
FT_Face face = ci->face;
- FT_GlyphSlot slot = face->glyph;
+ FT_GlyphSlot slot = face->glyph;
unsigned char *text = ci->text;
unsigned char c;
int x = 0, y = 0, i=0, size=0;
unsigned char tbuff[MAXSIZE_TEXT];
time_t now = time(0);
int str_w, str_w_max;
- FT_Vector pos[MAXSIZE_TEXT];
+ FT_Vector pos[MAXSIZE_TEXT];
FT_Vector delta;
- if (ci->file)
+ if (ci->file)
{
int fd = open(ci->file, O_RDONLY);
-
- if (fd < 0)
+
+ if (fd < 0)
{
text = ci->text;
perror("WARNING: the file could not be opened. Using text provided with -t switch. ");
- }
- else
+ }
+ else
{
int l = read(fd, tbuff, sizeof(tbuff) - 1);
-
- if (l >= 0)
+
+ if (l >= 0)
{
tbuff[l] = 0;
text = tbuff;
- }
- else
+ }
+ else
{
text = ci->text;
perror("WARNING: the file could not be opened. Using text provided with -t switch. ");
text = buff;
size = strlen(text);
-
+
/* measure string size and save glyphs position*/
str_w = str_w_max = 0;
- x = ci->x;
+ x = ci->x;
y = ci->y;
for (i=0; i < size; i++)
{
/* kerning */
if ( (ci->use_kerning) && (i > 0) && (ci->glyphs_index[c]) )
{
- FT_Get_Kerning( ci->face,
- ci->glyphs_index[ text[i-1] ],
+ FT_Get_Kerning( ci->face,
+ ci->glyphs_index[ text[i-1] ],
ci->glyphs_index[c],
- ft_kerning_default,
+ ft_kerning_default,
&delta );
-
+
x += delta.x >> 6;
}
-
+
if (( (x + ci->advance[ c ]) >= width ) || ( c == '\n' ))
{
str_w = width - ci->x - 1;
}
-
+
if (ci->bg)
y = height - 1 - 2*ci->y;
/* Draw Background */
- draw_box( picture, ci->x, ci->y, str_w_max, y - ci->y, ci->bgcolor );
+ draw_box( picture, ci->x, ci->y, str_w_max, y - ci->y, ci->bgcolor );
}
c = text[i];
if (
- ( (c == '_') && (text == ci->text) ) || /* skip '_' (consider as space)
- IF text was specified in cmd line
+ ( (c == '_') && (text == ci->text) ) || /* skip '_' (consider as space)
+ IF text was specified in cmd line
(which doesn't like neasted quotes) */
( c == '\n' ) /* Skip new line char, just go to new line */
)
continue;
/* now, draw to our target surface */
- draw_glyph( picture,
+ draw_glyph( picture,
&(ci->bitmaps[ c ]),
pos[i].x,
pos[i].y,
- width,
+ width,
height,
ci->fgcolor,
ci->bgcolor,
ci->outline );
-
+
/* increment pen position */
x += slot->advance.x >> 6;
}
* Fish Detector Hook
* Copyright (c) 2002 Philip Gladstone
*
- * This file implements a fish detector. It is used to see when a
+ * This file implements a fish detector. It is used to see when a
* goldfish passes in front of the camera. It does this by counting
* the number of input pixels that fall within a particular HSV
* range.
}
-
-
+
+
typedef struct {
int h; /* 0 .. 360 */
int s; /* 0 .. 255 */
int v; /* 0 .. 255 */
} HSV;
-
+
typedef struct {
int zapping;
int threshold;
static void get_hsv(HSV *hsv, int r, int g, int b)
{
int i, v, x, f;
-
+
x = (r < g) ? r : g;
if (b < x)
x = b;
v = (r > g) ? r : g;
if (b > v)
v = b;
-
+
if (v == x) {
hsv->h = 0;
hsv->s = 0;
hsv->v = v;
return;
}
-
+
if (r == v) {
f = g - b;
i = 0;
f = r - g;
i = 4 * 60;
}
-
+
hsv->h = i + (60 * f) / (v - x);
if (hsv->h < 0)
hsv->h += 360;
hsv->s = (255 * (v - x)) / v;
hsv->v = v;
-
+
return;
-}
+}
void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, int64_t pts)
{
ContextInfo *ci = (ContextInfo *) ctx;
- uint8_t *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
int rowsize = picture->linesize[0];
#if 0
if (width < ci->min_width)
return;
- ci->next_pts = pts + 1000000;
+ ci->next_pts = pts + 1000000;
if (pix_fmt == PIX_FMT_YUV420P) {
uint8_t *y, *u, *v;
get_hsv(&hsv, r, g, b);
- if (ci->debug > 1)
+ if (ci->debug > 1)
fprintf(stderr, "(%d,%d,%d) -> (%d,%d,%d)\n",
r,g,b,hsv.h,hsv.s,hsv.v);
if (hsv.h >= ci->dark.h && hsv.h <= ci->bright.h &&
hsv.s >= ci->dark.s && hsv.s <= ci->bright.s &&
- hsv.v >= ci->dark.v && hsv.v <= ci->bright.v) {
+ hsv.v >= ci->dark.v && hsv.v <= ci->bright.v) {
inrange++;
} else if (ci->zapping) {
y[0] = y[1] = y[rowsize] = y[rowsize + 1] = 16;
v += picture->linesize[2] - (w_start - w_end);
}
- if (ci->debug)
+ if (ci->debug)
fprintf(stderr, "Fish: Inrange=%d of %d = %d threshold\n", inrange, pixcnt, 1000 * inrange / pixcnt);
if (inrange * 1000 / pixcnt >= ci->threshold) {
buf = av_malloc(size);
avpicture_fill(&picture1, buf, PIX_FMT_RGB24, width, height);
- if (img_convert(&picture1, PIX_FMT_RGB24,
+ if (img_convert(&picture1, PIX_FMT_RGB24,
picture, pix_fmt, width, height) >= 0) {
/* Write out the PPM file */
}
av_free(buf);
- ci->next_pts = pts + ci->min_interval;
+ ci->next_pts = pts + ci->min_interval;
}
}
}
/*
- * imlib2 based hook
+ * imlib2 based hook
* Copyright (c) 2002 Philip Gladstone
- *
+ *
* This module implements a text overlay for a video image. Currently it
* supports a fixed overlay or reading the text from a file. The string
* is passed through strftime so that it is easy to imprint the date and
* This module is very much intended as an example of what could be done.
* For example, you could overlay an image (even semi-transparent) like
* TV stations do. You can manipulate the image using imlib2 functions
- * in any way.
+ * in any way.
*
* One caution is that this is an expensive process -- in particular the
* conversion of the image into RGB and back is time consuming. For some
* special cases -- e.g. painting black text -- it would be faster to paint
* the text into a bitmap and then combine it directly into the YUV
- * image. However, this code is fast enough to handle 10 fps of 320x240 on a
+ * image. However, this code is fast enough to handle 10 fps of 320x240 on a
* 900MHz Duron in maybe 15% of the CPU.
*
* This library is free software; you can redistribute it and/or
#include <sys/time.h>
#include <time.h>
#include <X11/Xlib.h>
-#include <Imlib2.h>
+#include <Imlib2.h>
typedef struct {
int dummy;
return -1;
}
imlib_context_set_font(ci->fn);
- imlib_context_set_direction(IMLIB_TEXT_TO_RIGHT);
+ imlib_context_set_direction(IMLIB_TEXT_TO_RIGHT);
if (color) {
char buff[256];
avpicture_fill(&picture1, (uint8_t *) data, PIX_FMT_RGBA32, width, height);
if (pix_fmt != PIX_FMT_RGBA32) {
- if (img_convert(&picture1, PIX_FMT_RGBA32,
+ if (img_convert(&picture1, PIX_FMT_RGBA32,
picture, pix_fmt, width, height) < 0) {
goto done;
}
} else {
- img_copy(&picture1, picture, PIX_FMT_RGBA32, width, height);
+ img_copy(&picture1, picture, PIX_FMT_RGBA32, width, height);
}
imlib_image_set_has_alpha(0);
{
- int wid, hig, h_a, v_a;
+ int wid, hig, h_a, v_a;
char buff[1000];
char tbuff[1000];
char *tbp = ci->text;
}
if (pix_fmt != PIX_FMT_RGBA32) {
- if (img_convert(picture, pix_fmt,
+ if (img_convert(picture, pix_fmt,
&picture1, PIX_FMT_RGBA32, width, height) < 0) {
}
} else {
- img_copy(picture, &picture1, PIX_FMT_RGBA32, width, height);
+ img_copy(picture, &picture1, PIX_FMT_RGBA32, width, height);
}
done:
/*
- * Null Video Hook
+ * Null Video Hook
* Copyright (c) 2002 Philip Gladstone
*
* This library is free software; you can redistribute it and/or
buf = av_malloc(size);
avpicture_fill(&picture1, buf, PIX_FMT_RGB24, width, height);
- if (img_convert(&picture1, PIX_FMT_RGB24,
+ if (img_convert(&picture1, PIX_FMT_RGB24,
picture, pix_fmt, width, height) < 0) {
av_free(buf);
return;
/* Insert filter code here */
if (pix_fmt != PIX_FMT_RGB24) {
- if (img_convert(picture, pix_fmt,
+ if (img_convert(picture, pix_fmt,
&picture1, PIX_FMT_RGB24, width, height) < 0) {
}
}
/*
- * PPM Video Hook
+ * PPM Video Hook
* Copyright (c) 2003 Charles Yates
*
* This library is free software; you can redistribute it and/or
int c = 0;
FILE *in = rwpipe_reader( rw );
- do
+ do
{
c = fgetc( in );
/** Context info for this vhook - stores the pipe and image buffers.
*/
-typedef struct
+typedef struct
{
rwpipe *rw;
int size1;
char *buf1;
int size2;
char *buf2;
-}
+}
ContextInfo;
/** Initialise the context info for this vhook.
err = 1;
/* Convert to RGB24 if necessary */
- if ( !err && pix_fmt != PIX_FMT_RGB24 )
+ if ( !err && pix_fmt != PIX_FMT_RGB24 )
{
int size = avpicture_get_size(PIX_FMT_RGB24, width, height);
if ( !err )
{
/* Actually, this is wrong, since the out_width/out_height returned from the
- * filter won't necessarily be the same as width and height - img_resample
- * won't scale rgb24, so the only way out of this is to convert to something
- * that img_resample does like [which may or may not be pix_fmt], rescale
+ * filter won't necessarily be the same as width and height - img_resample
+ * won't scale rgb24, so the only way out of this is to convert to something
+ * that img_resample does like [which may or may not be pix_fmt], rescale
* and finally convert to pix_fmt... slow, but would provide the most flexibility.
*
* Currently, we take the upper left width/height pixels from the filtered image,
* are gracefully ignored and the original image is returned - in this case, a
* failure may corrupt the input.
*/
- if (img_convert(picture, pix_fmt, &picture2, PIX_FMT_RGB24, width, height) < 0)
+ if (img_convert(picture, pix_fmt, &picture2, PIX_FMT_RGB24, width, height) < 0)
{
}
}
/*
- * Watermark Hook
+ * Watermark Hook
* Copyright (c) 2005 Marcus Engene myfirstname(at)mylastname.se
*
* The watermarkpicture works like this. (Assuming colorintencities 0..0xff)
* > 0xff, result = 0xff
*
* This way a mask that is visible both in light pictures and in dark can be
- * made (fex by using a picture generated by gimp and the bump map tool).
+ * made (fex by using a picture generated by gimp and the bump map tool).
*
* An example watermark file is at
* http://engene.se/ffmpeg_watermark.gif
//#include <fcntl.h>
#include <unistd.h>
#include <stdarg.h>
-
+
#include "common.h"
#include "avformat.h"
const char *p_ext;
int videoStream;
int frameFinished;
- AVCodecContext *pCodecCtx;
- AVCodec *pCodec;
+ AVCodecContext *pCodecCtx;
+ AVCodec *pCodec;
AVFrame *pFrame;
AVPacket packet;
int numBytes;
int i;
AVInputFormat *file_iformat;
AVStream *st;
- int is_done;
+ int is_done;
AVFrame *pFrameRGB;
} ContextInfo;
/****************************************************************************
- *
+ *
****************************************************************************/
void Release(void *ctx)
{
ci = (ContextInfo *) ctx;
if (ci) get_watermark_picture(ci, 1);
-
+
if (ctx)
av_free(ctx);
}
/****************************************************************************
- *
+ *
****************************************************************************/
int Configure(void **ctxp, int argc, char *argv[])
{
ci = (ContextInfo *) *ctxp;
optind = 1;
-
+
// Struct is mallocz:ed so no need to reset.
-
+
while ((c = getopt(argc, argv, "f:")) > 0) {
switch (c) {
case 'f':
return -1;
}
}
-
+
//
if (0 == ci->filename[0]) {
av_log(NULL, AV_LOG_ERROR, "Watermark: There is no filename specified.\n");
return -1;
}
-
+
av_register_all();
return get_watermark_picture(ci, 0);
}
/****************************************************************************
* Why is this a void returning functions? I want to be able to go wrong!
****************************************************************************/
-void Process(void *ctx,
- AVPicture *picture,
- enum PixelFormat pix_fmt,
- int src_width,
- int src_height,
+void Process(void *ctx,
+ AVPicture *picture,
+ enum PixelFormat pix_fmt,
+ int src_width,
+ int src_height,
int64_t pts)
{
ContextInfo *ci = (ContextInfo *) ctx;
char *buf = 0;
AVPicture picture1;
AVPicture *pict = picture;
-
+
AVFrame *pFrameRGB;
int xm_size;
int ym_size;
uint32_t pixel_meck;
uint32_t pixel;
uint32_t pixelm;
- int tmp;
-
-
+ int tmp;
+
+
//?? (void) ci;
if (pix_fmt != PIX_FMT_RGBA32) {
buf = av_malloc(size);
avpicture_fill(&picture1, buf, PIX_FMT_RGBA32, src_width, src_height);
- if (img_convert(&picture1, PIX_FMT_RGBA32,
+ if (img_convert(&picture1, PIX_FMT_RGBA32,
picture, pix_fmt, src_width, src_height) < 0) {
av_free(buf);
return;
/* Insert filter code here */ /* ok */
- // Get me next frame
+ // Get me next frame
if (0 > get_watermark_picture(ci, 0)) {
return;
- }
+ }
// These are the three original static variables in the ffmpeg hack.
pFrameRGB = ci->pFrameRGB;
xm_size = ci->x_size;
ym_size = ci->y_size;
-
+
// I'll do the *4 => <<2 crap later. Most compilers understand that anyway.
// According to avcodec.h PIX_FMT_RGBA32 is handled in endian specific manner.
for (y=0; y<src_height; y++) {
if (tmp > 255) tmp = 255;
if (tmp < 0) tmp = 0;
pixel_meck |= (tmp << 0) & 0xff;
-
-
+
+
// test:
//pixel_meck = pixel & 0xff000000;
//pixel_meck |= (pixelm & 0x00ffffff);
*p_pixel = pixel_meck;
- offs += 4;
+ offs += 4;
} // foreach X
- } // foreach Y
-
-
-
+ } // foreach Y
+
+
+
if (pix_fmt != PIX_FMT_RGBA32) {
- if (img_convert(picture, pix_fmt,
+ if (img_convert(picture, pix_fmt,
&picture1, PIX_FMT_RGBA32, src_width, src_height) < 0) {
}
}
* When cleanup == 0, we try to get the next frame. If no next frame, nothing
* is done.
*
- * This code follows the example on
+ * This code follows the example on
* http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html
*
* 0 = ok, -1 = error
// Yes, *pFrameRGB arguments must be null the first time otherwise it's not good..
// This block is only executed the first time we enter this function.
- if (0 == ci->pFrameRGB &&
- 0 == cleanup)
+ if (0 == ci->pFrameRGB &&
+ 0 == cleanup)
{
-
- /*
+
+ /*
* The last three parameters specify the file format, buffer size and format
* parameters; by simply specifying NULL or 0 we ask libavformat to auto-detect
* the format and use a default buffer size. (Didn't work!)
av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Really failed to find iformat [%s]\n", ci->p_ext);
return -1;
}
- // now continues the Martin template.
-
+ // now continues the Martin template.
+
if (av_open_input_file(&ci->pFormatCtx, ci->filename, ci->file_iformat, 0, NULL)!=0) {
av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to open input file [%s]\n", ci->filename);
return -1;
- }
+ }
}
-
- /*
+
+ /*
* This fills the streams field of the AVFormatContext with valid information.
*/
if(av_find_stream_info(ci->pFormatCtx)<0) {
av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to find stream info\n");
return -1;
}
-
+
/*
- * As mentioned in the introduction, we'll handle only video streams, not audio
+ * As mentioned in the introduction, we'll handle only video streams, not audio
* streams. To make things nice and easy, we simply use the first video stream we
* find.
*/
av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to find any video stream\n");
return -1;
}
-
+
ci->st = ci->pFormatCtx->streams[ci->videoStream];
ci->x_size = ci->st->codec->width;
ci->y_size = ci->st->codec->height;
-
+
// Get a pointer to the codec context for the video stream
ci->pCodecCtx = ci->pFormatCtx->streams[ci->videoStream]->codec;
-
-
+
+
/*
* OK, so now we've got a pointer to the so-called codec context for our video
* stream, but we still have to find the actual codec and open it.
- */
+ */
// Find the decoder for the video stream
ci->pCodec = avcodec_find_decoder(ci->pCodecCtx->codec_id);
if(ci->pCodec == NULL) {
av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to find any codec\n");
return -1;
}
-
+
// Inform the codec that we can handle truncated bitstreams -- i.e.,
// bitstreams where frame boundaries can fall in the middle of packets
if (ci->pCodec->capabilities & CODEC_CAP_TRUNCATED)
ci->pCodecCtx->flags|=CODEC_FLAG_TRUNCATED;
-
+
// Open codec
if(avcodec_open(ci->pCodecCtx, ci->pCodec)<0) {
av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to open codec\n");
return -1;
}
-
- // Hack to correct wrong frame rates that seem to be generated by some
+
+ // Hack to correct wrong frame rates that seem to be generated by some
// codecs
if (ci->pCodecCtx->time_base.den>1000 && ci->pCodecCtx->time_base.num==1)
- ci->pCodecCtx->time_base.num=1000;
-
+ ci->pCodecCtx->time_base.num=1000;
+
/*
* Allocate a video frame to store the decoded images in.
*/
ci->pFrame = avcodec_alloc_frame();
-
-
+
+
/*
* The RGB image pFrameRGB (of type AVFrame *) is allocated like this:
*/
av_log(NULL, AV_LOG_ERROR, "get_watermark_picture() Failed to alloc pFrameRGB\n");
return -1;
}
-
+
// Determine required buffer size and allocate buffer
ci->numBytes = avpicture_get_size(PIX_FMT_RGBA32, ci->pCodecCtx->width,
ci->pCodecCtx->height);
ci->buffer = av_malloc(ci->numBytes);
-
+
// Assign appropriate parts of buffer to image planes in pFrameRGB
avpicture_fill((AVPicture *)ci->pFrameRGB, ci->buffer, PIX_FMT_RGBA32,
- ci->pCodecCtx->width, ci->pCodecCtx->height);
+ ci->pCodecCtx->width, ci->pCodecCtx->height);
}
// TODO loop, pingpong etc?
- if (0 == cleanup)
- {
+ if (0 == cleanup)
+ {
// av_log(NULL, AV_LOG_DEBUG, "get_watermark_picture() Get a frame\n");
while(av_read_frame(ci->pFormatCtx, &ci->packet)>=0)
{
if(ci->packet.stream_index == ci->videoStream)
{
// Decode video frame
- avcodec_decode_video(ci->pCodecCtx, ci->pFrame, &ci->frameFinished,
+ avcodec_decode_video(ci->pCodecCtx, ci->pFrame, &ci->frameFinished,
ci->packet.data, ci->packet.size);
-
+
// Did we get a video frame?
if(ci->frameFinished)
{
// Convert the image from its native format to RGBA32
- img_convert((AVPicture *)ci->pFrameRGB, PIX_FMT_RGBA32,
- (AVPicture*)(ci->pFrame), ci->pCodecCtx->pix_fmt, ci->pCodecCtx->width,
+ img_convert((AVPicture *)ci->pFrameRGB, PIX_FMT_RGBA32,
+ (AVPicture*)(ci->pFrame), ci->pCodecCtx->pix_fmt, ci->pCodecCtx->width,
ci->pCodecCtx->height);
-
+
// Process the video frame (save to disk etc.)
//fprintf(stderr,"banan() New frame!\n");
//DoSomethingWithTheImage(ci->pFrameRGB);
return 0;
}
}
-
+
// Free the packet that was allocated by av_read_frame
av_free_packet(&ci->packet);
}
- ci->is_done = 1;
+ ci->is_done = 1;
return 0;
} // if 0 != cleanup
-
- if (0 != cleanup)
+
+ if (0 != cleanup)
{
// Free the RGB image
if (0 != ci->buffer) {
if (0 != ci->pFrameRGB) {
av_free(ci->pFrameRGB);
ci->pFrameRGB = 0;
- }
-
+ }
+
// Close the codec
if (0 != ci->pCodecCtx) {
avcodec_close(ci->pCodecCtx);
ci->pCodecCtx = 0;
}
-
+
// Close the video file
if (0 != ci->pFormatCtx) {
- av_close_input_file(ci->pFormatCtx);
+ av_close_input_file(ci->pFormatCtx);
ci->pFormatCtx = 0;
}
-
+
ci->is_done = 0;
}
return 0;
unsigned int picture_structure;//top/bottom fields or frame !
unsigned int flags;//XVMC_SECOND_FIELD - 1'st or 2'd field in the sequence
- unsigned int display_flags; //1,2 or 1+2 fields for XvMCPutSurface,
+ unsigned int display_flags; //1,2 or 1+2 fields for XvMCPutSurface,
//these are internal communication one
int state;//0-free,1 Waiting to Display,2 Waiting for prediction
int start_mv_blocks_num;//offset in the array for the current slice,updated by vo
int filled_mv_blocks_num;//processed mv block in this slice,change by decoder
-
+
int next_free_data_block_num;//used in add_mv_block, pointer to next free block
} xvmc_render_state_t;